← コア一覧
Arcade-SegaSpaceHarrier (rossops)
MAMEのドライバにない実基板の資料を引用 — 5
- rtl/audio/sh_soundsys.sv:85 The vendored T80 (as the GHDL-converted netlist verif/board/t80/T80s_ghdl.v), kept for the bench's cross-check only (make ...
- rtl/io/sh_adc0804.sv:2 ADC0804 with the analog input multiplexer (74HC4052 on this board) A write starts a conversion (ignored while one is running); 74 ADC clocks later (ADC clock = 25.1748 MHz/4/6 = 1.049 MHz -> 70.5 us) the result is latched and /INTR asserts.
- rtl/sh_core.sv:528 ---- ADC0804 (E03021, odd byte): one converter behind the 74HC4052 mux selected by PPI1 port A bits 3:2
- rtl/sh_core.sv:778 road: ROM in BRAM from the loader, the netlist renderer on road RAM's second port
- rtl/video/sh_road.sv:55 netlist state
MAMEのドライバにもある実基板の情報・測定値を引用 — 1
MAMEとの相違点を記載 — 1
- README.md:191 The re-entry count differs from MAME's because our bus cycles carry DTACK latency MAME doesn't model — same shape the Y Board saw.
MAMEのソースを引用 — 93
- rtl/audio/sh_segapcm_5218.sv:2 Sega 315-5218 PCM (SegaPCM), MAME segapcm.cpp.
- rtl/audio/sh_segapcm_5218.sv:11 The sums are in MAME's 1/32768 units, i.e. directly 16-bit samples.
- rtl/audio/sh_segapcm_5218.sv:13 ROM bytes come from SDRAM port p6 (16-bit words, byte selected by A0); the stream pads the PCM slot with 0xFF like MAME's ERASEFF region.
- rtl/audio/sh_segapcm_5218.sv:20 MAME m_bankshift (BANK_512: every segahang set)
- rtl/audio/sh_segapcm_5218.sv:27 channel slots 8-15, no banking (MAME 0.289)
- rtl/audio/sh_segapcm_5218.sv:48 MAME m_low: addr[7:0] per channel
- rtl/audio/sh_segapcm_5218.sv:71 MAME runs the stream up to every register write before applying it, so a driver restarting a playing voice always ends with its new address in 0x84/0x85.
- rtl/audio/sh_segapcm_5218.sv:78 So: a Z80 write to 0x84/0x85/0x86 of the channel in flight marks that byte dirty and the engine skips its own write to it; the sample already accumulated from the old address stands, as MAME's does.
- rtl/audio/sh_segapcm_5218.sv:117 the page after end, as MAME through 0.288: 0.289's rewrite compares
- rtl/audio/sh_soundsys.sv:19 Mix, from MAME's segahang routes: the 2203 board (ymfm rotation understood: outputs 0-2 = SSG A/B/C, 3 = FM) SSG 0.05 each, FM 0.15, PCM 0.40; the 2151 board YM 0.30, PCM 0.70.
- rtl/audio/sh_soundsys.sv:188 The sim zero-fills it: the game tests bytes it never wrote (C01F gates the whole song-activation path), MAME zero- fills its RAM regions, and the FPGA M10K powers up zero; only the simulator's x-assign disagreed, which cost a day of sound d
- rtl/audio/sh_soundsys.sv:210 MAME 0.289's discrete-board model is not used: the M7
- rtl/audio/sh_soundsys.sv:268 ---- mix (MAME's routes): PCM 0.40, FM 0.15, SSG channels 0.05 each, the 8-bit SSG channels scaled by 128 toward 16 bits
- rtl/cpu/sh_fd1089b.sv:2 FD1089B decrypt (Enduro Racer's main CPU, key 317-0013A), the static per-address table from MAME's fd1089.cpp (Salmoria, Naive, MacDonald).
- rtl/cpu/sh_fd1089b.sv:11 Opcode = a program-space fetch (FC 2 or 6), MAME's AS_OPCODES: the 68000's instruction and extension words alike.
- rtl/cpu/sh_m68k_bus.sv:8 Bus contract towards the board: bus_valid high from the clk after ASn falls until ASn rises bus_start one-clk pulse on the first bus_valid clk (decoders sample) bus_rd/wr read or write cycle; bus_be = {UDS, LDS} bus_ack board asse
- rtl/cpu/sh_mcu.sv:17 The program drives level 4 once per vblank and nothing else; the level is latched here and cleared by the 68000's interrupt acknowledge, not by the MCU releasing it (MAME: HOLD_LINE).
- rtl/io/sh_adc0804.sv:6 Channel select = the sub PPI port A bits 3:2 (MAME segahang.cpp).
- rtl/io/sh_adc0804.sv:7 Reference MAME adc0804.cpp + segaxbd.cpp analog_r.
- rtl/io/sh_adc0804.sv:52 sampled at end of conversion (MAME)
- rtl/io/sh_i8255.sv:2 i8255 PPI (MAME i8255.cpp is the behavioural reference).
- rtl/io/sh_i8255.sv:51 Mode-2 status: PC5 = IBF (always 0 here: the input half has no writer — the Z80 side has no path to strobe data in, in MAME or on this board), PC4 = INTE2 (its BSR flip-flop).
- rtl/io/sh_i8255.sv:94 mode set: group A mode from bits 6:5, direction bits 4 (A), 3 (C upper), 1 (B), 0 (C lower); output latches clear (MAME does the same)
- rtl/sh_core.sv:2 Sega Space Harrier / Hang-On — board top M1: the two 68000s (fx68k) with ROM caches on the hangon memory map, every CPU-visible RAM, the shared sub/road RAM behind a hold-through-RMW arbiter (with a third requester slot reserved for the i87
- rtl/sh_core.sv:92 The M11 option raises it for Enduro Racer only: the game is vblank-synced but CPU-bound, and drops frames under load that MAME's zero-wait 68000 does not; 32540 / 39048 / 52064 give 12.5 / 15 / 20 MHz for both 68000s, everything else at the
- rtl/sh_core.sv:177 ---------------------------------------------------------------- interrupts Main: IRQ4 raised entering vblank (line 224) and held until the CPU's interrupt acknowledge (MAME irq4_line_hold).
- rtl/sh_core.sv:180 Sub: level 4 is a plain level from PPI1 port A bit 6, active low, no acknowledge (MAME sub_control_adc_w).
- rtl/sh_core.sv:185 held until the 68000 acknowledges that level (MAME HOLD_LINE)
- rtl/sh_core.sv:186 MAME: every P1 write with a level is set_input_line(level, HOLD_LINE): the line stands until the 68000 takes it and is then dropped, whatever the MCU's pin does.
- rtl/sh_core.sv:253 MAME suppresses the same write for the same reason.
- rtl/sh_core.sv:302 main decode: the hangon map (MAME hangon_map) or, by the descriptor, the sharrier map (sharrier_map: Space Harrier and Enduro Racer).
- rtl/sh_core.sv:330 ---- main ROM cache (256 KB, plus the bootleg sets' decrypted-opcode image as a second 256 KB behind address bit 19: MAME's AS_OPCODES for endurobl/endurob2, whose program-space fetches read the mainops slot)
- rtl/sh_core.sv:360 fd1089.cpp decrypt_one
- rtl/sh_core.sv:509 enduror (MAME `enduror` port): start is bit 6, bits 7, 5 and 4 unused; its list is J1: 4 Gas, 5 Brake, 6 Start, 7 Wheelie, 8 Coin, 9 Pause, 10 Test, 11 Service (the pedals and coin group as on Hang-On and Space Harrier, so the core's gas/br
- rtl/sh_core.sv:609 enduror's bank channel (MAME ADC2: 0x00-0xFF, rest 0x20, no reverse): MAME scales a stick's two halves separately, so pulling back runs 0x20 up to 0xFF and pushing forward 0x20 down to 0x00; the Wheelie button (J1 bit 7) is a full pull
- rtl/sh_core.sv:639 sub decode: 19-bit space (MAME global_mask 0x7ffff)
- rtl/sh_core.sv:663 One access per clock in priority order; a CPU that has read keeps the space until its next bus cycle starts, an RMW write is served first and an instruction fetch releases the hold, so tas and the two-cycle bclr/bset/addq on memory are atom
- rtl/sh_core.sv:719 ================================================================ read muxes Writes into ROM space (main program ROM and the sub-ROM window) are acknowledged and dropped: real DTACK logic ignores R/W, MAME drops them silently, and a decode t
- rtl/sh_core.sv:821 A sprite pixel with colour bits all ones is the shadow pen: the underlying pixel moves to the shadow or hilight palette bank, picked by the PPI's SHADE0 bit (MAME video_lamps_w: ~portB & 0x40 truthy selects hilight).
- rtl/sh_pkg.sv:21 ---- video timing: 400 x 262 at clk_sys/8 = 6.2937 MHz, 320 x 224 ----- MAME 0.289 set_raw(25.1748 MHz/4, 400, 0, 320, 262, 0, 224) — measured, unlike the Y Board's set_size placeholder.
- rtl/video/sh_palette_5242.sv:4 Palette word: bit 15 = effects select (1 hilight / 0 shadow), 14:12 = LSB of B/G/R, 11:8 B, 7:4 G, 3:0 R (MAME paletteram_w).
- rtl/video/sh_road.sv:5 Renders the next scanline from live road RAM into a double-buffered line buffer at two clocks per pixel (state step + ROM fetch), 24 warm-up pixels before x 0 as in MAME's loop from -24.
- rtl/video/sh_road.sv:13 Colour bases (segahang_v.cpp): road pixels 0x038, background 0x7C0.
- rtl/video/sh_road.sv:57 MAME keeps an int; 9 bits covers its range
- rtl/video/sh_road.sv:68 MAME's loop-top order: the 0xFF clear first, then the control-bit-8 set, so the set wins when both apply
- rtl/video/sh_sprite.sv:2 SEGA_HANGON_SPRITES and, with `sharrier`, SEGA_SHARRIER_SPRITES (sega16sp.cpp) as a line renderer.
- rtl/video/sh_sprite.sv:7 MAME draws whole sprites from live RAM with a per-sprite row-base accumulator (`addr`, advanced by pitch, doubled on zoom-ROM row skips) and a scratch fetch pointer (data[7]); the real chip is line-based.
- rtl/video/sh_sprite.sv:10 This renderer takes a private copy of sprite RAM once per frame (at line 260, after the game's vblank writes) with word 7 initialised to word 3, then per line walks the list: an entry spanning the line advances its word-7 row base exactly a
- rtl/video/sh_sprite.sv:18 ROM words come from SDRAM port p2 in 128-bit bursts, cached one burst at a time; the row's fetch direction is bit 15 of the row base at row start (the address-overflow-into-flip interaction rides on the 16-bit add and the 15-bit fetch mask,
- rtl/video/sh_sprite.sv:21 Pen 0 and 15 transparent, pen 15 in a word's last position ends the row; the row also ends at the word boundary after x passes the right edge (MAME's group re-entry check).
- rtl/video/sh_sprite.sv:165 Word 7 of each entry is initialised to its word 3 (MAME's data[7] = addr).
- rtl/video/sh_sprite.sv:251 MAME's group re-entry check
- rtl/video/sh_tilemap_5012.sv:2 Sega 315-5011/5012 tilemap generator, "TILEMAP_HANGON" register layout (MAME segaic16.cpp tilemap_16a_*, the 4-page 16A variant).
- rtl/video/sh_tilemap_5012.sv:68 0 fg, 1 bg (MAME's 'which')
- rtl/video/sh_tilerom.sv:6 Plane 2 (third ROM, epr-6843) is pen bit 2 (MAME gfx_8x8x3_planar: RGN_FRAC(2,3) is the MSB plane).
- rtl/video/sh_video_timing.sv:4 MAME 0.289: m_screen->set_raw(25.1748 MHz/4, 400, 0, 320, 262, 0, 224).
- rtl/video/sh_video_timing.sv:5 vbl_irq is a 1-line level during VBLANK_LINE (224, the first vblank line, where MAME fires IRQ4); latch_pulse at line 261 frames the bench (the HANGON tilemap has no register latch of its own).
- rtl/video/sh_video_timing.sv:38 Sync widths follow the System 16-family convention used by MAME's screen layout: hsync from 336..367 (32 px), vsync lines 240..243 (4 lines).
- README.md:28 | M1 | Two 68000s, shared RAM, PPIs, ADC, interrupts track MAME | done (2026-08-31) |
- README.md:31 | M4 | Hang-On sprites and mixer: full frames vs MAME | done (2026-08-31) |
- README.md:32 | M5 | YM2203 + PCM sound vs MAME recordings | done (2026-08-31) |
- README.md:35 | M7b | Space Harrier gamepad feel (optional): MAME-style stick slew | not started |
- README.md:37 | M11 | Enduro Racer 60 fps mode (optional): an OSD CPU speed for both 68000s | measured 2026-09-07: not a CPU limit; a 20 MHz 68000 trims a quarter second of r
- README.md:43 Core vs MAME
- README.md:45 MAME 0.289 is this core's behavioural reference: every renderer has a Python golden model ported line for line from it, and the gates compare frames and traces
- README.md:47 But MAME is an emulator with its own conveniences, and a cycle-concurrent board sometimes has to model what MAME can skip.
- README.md:57 Video timing is MAME's measured `set_raw`: 400x262 at 25.1748 MHz/4, 320x224 visible.
- README.md:60 All four video layers (tilemaps, text, road, sprites), the mixer's priority rules and the three-bank shadow/hilight palette reproduce MAME's screenshots pixel f
- README.md:63 The main CPU's vblank interrupt is held until acknowledge, exactly MAME's `irq4_line_hold`.
- README.md:65 Analog reversal follows MAME's PORT_REVERSE arithmetic: `0x100 - value` on every reversed channel (the carried module said `255 - value`, one count off centre;
- README.md:68 The 315-5218 PCM ticks at clock/128 per MAME.
- README.md:76 MAME never needs this because its instructions are atomic; the real bus has the race, and the Y Board's Power Drift deadlocked twice to prove it.
- README.md:79 MAME drops them silently; a decode that only acks reads stalls a real 68000 until the watchdog.
- README.md:82 The renderers work the way the chips do, not the way MAME draws: the sprite generator is line-based with a private copy of the list (the chip's word-7 scratch w
- README.md:86 MAME draws whole frames at frame end from end-of-frame state.
- README.md:94 The one level the MCU drives, IRQ 4 once per vblank, is armed when the MCU asserts it and dropped at the 68000's acknowledge, MAME's HOLD_LINE exactly.
- README.md:100 The PCM engine keeps the loop rule MAME used through 0.288 (a voice wraps or stops when its page passes the end register) and the 16-voice 315-5218 with banking
- README.md:102 MAME 0.289 rewrote the device: the end check lost its plus one, and the YM2203 board became an 8-voice discrete model without banking.
- README.md:109 So the older MAME wins on hardware evidence, and the M8 audio gate records its reference with a MAME 0.289 built with that rule restored (tools/mame_ref_build.s
- README.md:114 The game is vblank-synced but CPU-bound: MAME's zero-wait 68000 drops a fifth of the frames in the busy first seconds of a race, and ours, behind an SDRAM cache
- README.md:128 Space Harrier's attract demo drifts against MAME by one frame per 450 or so, with the scene otherwise identical: the MCU's 71 bus accesses a frame halt the 6800
- README.md:146 MAME re-synchronises its scheduler on every access to the main PPI (`sync_ppi_w`) to keep the sound handshake ordered.
- README.md:151 The simulation-only tv80 it replaces turned out to be the less faithful core; the attract audio's envelope correlation with MAME rose from 0.94 to 0.97 the day
- README.md:164 The main PPI runs in i8255 mode 2, not the mode-1-style handshake MAME's driver comments suggest — the game programs control word 0xC0 and uses the bidirectiona
- README.md:166 Two of our bugs came from assuming mode 2 was absent; MAME's i8255 device had it right all along.
- README.md:171 The YM2203 timer flags cleared wrong twice in our vendored jt12, and MAME's ymfm was the faithful one both times.
- README.md:194 Uninitialised RAM: MAME zero-fills its RAM regions and the FPGA's M10K blocks power up cleared, and Hang-On's sound driver counts on it — it reads a byte it nev
- README.md:201 Instrumented MAME is not MAME.
- README.md:201 The Lua read/write taps we used to trace the YM2203 flipped MAME's own sound driver onto the wrong side of an internal channel race, and the trace then "confirm
- README.md:204 A single minimal tap reproduced MAME's real output exactly.
- README.md:208 The PCM chip's register file has a real race MAME hides.
- README.md:216 The engine now yields to the Z80's write, which is what MAME's ordering amounts to (M6 findings).
- README.md:233 MAME lands on the side where the coin sound is rejected and the theme ends on schedule; our cycle-timed board (and MAME itself, once taps perturb its scheduler)
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 7
- rtl/io/sh_i8255.sv:15 Reset (and any control-word write): all ports mode 0 inputs, latches 0, which matches MAME driving its output callbacks with the tri value (0) until the game programs the chip.
- README.md:9 Hang-On's video is complete — full frames match MAME's screenshots on every pixel, confirmed on a DE10-Nano — and the sound board plays: the attract sequence's
- README.md:49 This section is the running scorecard — where we match MAME exactly, where we deliberately go past it toward the real hardware, and where chasing a bug taught u
- README.md:55 Matching MAME exactly
- README.md:120 Off matches MAME's mapping; On is a player preference layered on top.
- README.md:125 Checked word for word against MAME's decrypted sets: the only differences are two words at 0xFF0 the decrypted bootlegs patch themselves.
- README.md:198 Every game-visible RAM now zero-inits in simulation to match both MAME and the silicon.
MAMEから移植・書き写した、または取り入れたと記載 — 2
- rtl/video/sh_road.sv:2 segaic16 road generator, HANGON/SHARRIER variant — a port of MAME's netlist emulation (segaic16_road.cpp segaic16_road_hangon_draw: the counters at 9M and 9N/9P, the two 9J flip-flops, the 8S serial shift register).
- README.md:4 Same approach as the X Board and Y Board cores it descends from: simulate the board, verify every custom chip against a Python port of MAME, then check whole fr
MAMEの近似をそのまま採用 — 2
- README.md:58 Unusually for this board family, MAME's numbers here are real measurements, not placeholders.
- README.md:133 MAME suppresses the MCU's write to 040385 as a sync hack, and after the first hardware test we do the same, now knowing why.
MAMEドライバと同じ文言を含む(出典の明記なし) — 1