← All cores
Arcade-SegaSystem32 (zakk4223)
Cites hardware documentation that MAME's driver does not — 7
- README.md:52 | Board and clocks | Sega schematics 171-5964D / 171-5965C | Standard single-screen board; V60, Z80/YM3438, and PCM domains |
- README.md:53 | Main CPU/controller | Schematics, sheet 1 | 16-bit V60 bus, interrupts, timers, and system control |
- README.md:54 | Scroll hardware | Schematics, sheet 2; Sega 315-5387 | Four tilemap layers and dual-port VRAM |
- README.md:56 | Colour/video output | Schematics, sheet 5; [315-5242 silicon evidence](https://github.com/furrtek/SiliconRE/tree/master/Sega/315-5242) | Palette, priority, sh
- README.md:96 | Sega 315-5387 scroll | Tilemap VRAM and registers | [`s32_tilemap.sv`](rtl/video/s32_tilemap.sv); schematic sheet 2 |
- README.md:98 | Sega 315-5296 I/O | JAMMA, DIP, service, coin | [`s32_io.sv`](rtl/io/s32_io.sv); schematic sheet 6 |
- README.md:114 **Sega, Nemesis1207, and System 32 researchers** - original hardware and public schematic material recorded in [the source ledger](docs/references.md).
Cites MAME source — 191
- Arcade-SegaSystem32.sv:285 This is a model-consistency fix, not a turbo: the alternative consistent choice (both sides at 16.108 MHz) was measured to make Dark Edge's gameplay countdown advance every 70 frames against MAME's 35.
- Arcade-SegaSystem32.sv:510 GA2's 315-5296 player ports follow MAME: {left,right,up,down,unused,button3,button2,button1}, active low.
- Arcade-SegaSystem32.sv:748 MAME's Alien3 P1_A/P2_A masks leave only BUTTON1/2 (the trigger and the second cabinet button) connected; direction and BUTTON3 bits are physically unused.
- Arcade-SegaSystem32.sv:816 MAME system32_generic: port C is unused; port E/SERVICE12 is {unknown[7:6], start2, start1, coin2, coin1, test, service}, active low.
- Arcade-SegaSystem32.sv:845 GA2's 4-player i8255 port C is MAME EXTRA3 (ppi.in_pc_callback -> "EXTRA3").
- Arcade-SegaSystem32.sv:959 Original = the 4:3 arcade monitor (MAME's default for both 320- and 416-wide System 32 modes); the old 13:7 square-pixel ratio stretched holo's 320 mode.
- rtl/audio/s32_audio_mix.sv:30 Exact MAME route gains expressed as small integers: System 32: YM1 0.30 + YM2 0.30 + RF5C68 0.40 (divide by 10).
- rtl/audio/s32_audio_mix.sv:33 Multi 32 cross-routes BOTH the YM and the MultiPCM (MAME segas32.cpp: multipcm add_route(1,"sleft") / add_route(0,"sright") — stream 1 -> left, stream 0 -> right — the same cross as the YM).
- rtl/audio/s32_multipcm.sv:4 Register, descriptor, pitch and PCM semantics follow MAME multipcm.cpp and gew.cpp.
- rtl/audio/s32_multipcm.sv:74 MAME update_step: base=(1+pitch/1024), exponent=(signed octave-1).
- rtl/audio/s32_multipcm.sv:75 This RTL position uses sixteen fractional bits instead of MAME's TL_SHIFT.
- rtl/audio/s32_multipcm.sv:107 9..15 attenuate right using MAME's inverted distance.
- rtl/audio/s32_rf5c68.sv:4 Register map (per MAME rf5c68.cpp): 0 ENV, 1 PAN {R[7:4],L[3:0]}, 2 FDL, 3 FDH, 4 LSL, 5 LSH, 6 ST, 7 control {en[7], sel[6]: 1=cbank(ch) 0=wbank, val[3:0]}, 8 channel-OFF mask (active low enables) Samples: 8-bit sign-magnitude-ish (0xFF =
- rtl/audio/s32_rf5c68.sv:227 MAME models the RF5C68 as a 10-bit DAC: clear the low six bits of an in-range mix, then clamp excursions to signed 16-bit full scale.
- rtl/audio/s32_rf5c68.sv:303 A marker at the loop target is an empty/dead voice: retain the loop address and contribute silence, as MAME does.
- rtl/audio/s32_soundsys.sv:216 MAME installs the Z80's 0xE000-0xFFFF onto the V60's 0x700000 window with 8-bit handlers on BOTH byte lanes and no umask16, so V60 byte k maps to Z80 0xE000+k (byte granularity, 8 KB mirror).
- rtl/audio/s32_soundsys.sv:350 slot 3 = mask reg (MAME: m_sound_irq_control[3])
- rtl/audio/s32_soundsys.sv:353 only YM #1 wired (MAME)
- rtl/audio/s32_soundsys.sv:424 MAME maps D0-D3 mirrored only at D4-D7.
- rtl/audio/s32_soundsys.sv:453 RF5C68 registers (0xC000-0xCFFF) are write-only; the sound map has no unmap_value_high, so reads there return 0x00 in MAME, not 0xFF (audit R20 AU-7).
- rtl/cpu/v60/s32_v60.sv:5 Behavioral contract is MAME's v60 core (BSD-3-Clause, Farfetch'd / R. Belmont): opcode dispatch per optable.hxx, addressing modes per am1-3.hxx, exception entry per v60.cpp.
- rtl/cpu/v60/s32_v60.sv:13 the fill/stop variants (MOVC*/CMPC*/SCHC*/SKPC*), TASI, bit ops, GETPSW/UPDPSW, TRAP/TRAPFL/BRK/BRKV, CHLVL, task save/load, privileged register moves (LDPR/STPR), and MAME-defined decimal/bit- string/bit-field groups.
- rtl/cpu/v60/s32_v60.sv:20 - Not implemented (reserved-instruction exception, logged in sim): the un-dispatched 0x5C/0x5F sub-opcodes (MAME UNHANDLED).
- rtl/cpu/v60/s32_v60.sv:21 MMU/TLB effects are absent like MAME, but CLRTLB still decodes its complete operand.
- rtl/cpu/v60/s32_v60.sv:31 V60/V70 reset PC (MAME m_start_pc; audit V60-21)
- rtl/cpu/v60/s32_v60.sv:129 PSW fields (MAME bit layout: Z=b0,S=b1,OV=b2,CY=b3,IE=b18,EL=b25:24,IS=b28)
- rtl/cpu/v60/s32_v60.sv:685 C-style truncating divide-by-8 of a signed bit offset (MAME bamoffset/8)
- rtl/cpu/v60/s32_v60.sv:775 stack switch on IS change, or EL change while IS=0 (MAME v60WritePSW)
- rtl/cpu/v60/s32_v60.sv:1210 primary dispatch (per MAME optable.hxx)
- rtl/cpu/v60/s32_v60.sv:1215 BRK — MAME skips this opcode (A4)
- rtl/cpu/v60/s32_v60.sv:1235 ---- Bcc disp8 (0x60-0x6a,0x6c-0x6f) / disp16 equivalent ---- 0x6B/0x7B are holes in MAME's authoritative primary dispatch table, not branch-condition encodings.
- rtl/cpu/v60/s32_v60.sv:1295 MAME opDBcc: reg ALWAYS decrements; branch iff cond true and decremented reg != 0.
- rtl/cpu/v60/s32_v60.sv:1401 JMP/JSR/TASI: MAME sets moddim=0 — the dim scales INDEXED modes' index register, and ga2's jump tables (3-byte BR entries, `JMP [PC+d](rN)`) rely on the unscaled index (found by real-ROM boot: dim=2 quadrupled the index and jumped mid-table
- rtl/cpu/v60/s32_v60.sv:1427 RETI adj (halfword, MAME moddim=1)
- rtl/cpu/v60/s32_v60.sv:1451 MAME F7a/F7b decode with dim 0 (0x58 byte) / 1 (0x5A half): autoincrement/indexed AMs step and scale by the element size, and F7b immediates size accordingly — not dword.
- rtl/cpu/v60/s32_v60.sv:1471 MAME implements ADDDC/SUBDC/SUBRDC/CVTDPZ/CVTDZP (radm timer); remaining subops are reserved there too.
- rtl/cpu/v60/s32_v60.sv:1560 Unhandled sub-opcodes still take the reserved-instruction vector exactly as MAME's op5C/op5F UNHANDLED entries fatalerror.
- rtl/cpu/v60/s32_v60.sv:1602 RSR (A9): pop PC ONLY (MAME opRSR: PC=[SP]; SP+=4)
- rtl/cpu/v60/s32_v60.sv:1607 MAME/NEC floating-exception test: enabled TKCW causes are intersected with the PSW floating-status field.
- rtl/cpu/v60/s32_v60.sv:1636 F12: plan operands per instflags (MAME F12DecodeOperands)
- rtl/cpu/v60/s32_v60.sv:1645 MOVEA takes op1 as an ADDRESS (MAME ReadAMAddress) — decoding it as a value loaded SP with a byte read instead of the EA and sent ga2's boot stub off a cliff (found by real-ROM boot)
- rtl/cpu/v60/s32_v60.sv:2277 MAME opDIVX/opDIVUX set only S/Z and leave OV unchanged; do not clear it.
- rtl/cpu/v60/s32_v60.sv:2309 MAME opROTC*: the carry bit enters the active operand's LSB; bits above a byte/halfword operand are not part of the ring.
- rtl/cpu/v60/s32_v60.sv:2640 pops (8) + frame-destroy operand (MAME: SP += amout), then the PSW write may bank-switch SP — order matters: adjust THEN switch.
- rtl/cpu/v60/s32_v60.sv:2682 push highest set register first (MAME pushes from r31 down?
- rtl/cpu/v60/s32_v60.sv:2730 TASI sets flags as SUBB(old, 0xFF, 0) before writing 0xFF (MAME opTASI).
- rtl/cpu/v60/s32_v60.sv:2767 R27 (dst) / R28 (src) updated at completion (MAME MOVSTR).
- rtl/cpu/v60/s32_v60.sv:2776 Element-size dim for both (MAME dim 0 byte / 1 half — see decode).
- rtl/cpu/v60/s32_v60.sv:2793 V60-15: down-direction search (subop[0]=1, MAME opSEARCHD*).
- rtl/cpu/v60/s32_v60.sv:2795 The down form scans the range in descending order from MAME's start index: byte reads op1+len1 down to op1 (len1+1 reads; the first read is one past the buffer, exactly as opSEARCHDB does), half reads op1+(len1-1)*2 down to op1 (len1 reads)
- rtl/cpu/v60/s32_v60.sv:2820 MOVCD/MOVCFD (down copy) transfers the ascending range base..base+min-1 in descending element order (MAME opMOVSTRD): start at the TOP of that range and decrement, instead of walking physically below the base as the old code did (audit R20
- rtl/cpu/v60/s32_v60.sv:2829 CMPCS (0x02): stop mode starts with CY=1, cleared when a fill (R26) byte is met in the compare (MAME opCMPSTR bStop).
- rtl/cpu/v60/s32_v60.sv:2832 CMPCF (0x01): fill the SHORTER operand's tail with R26 BEFORE the compare (MAME bFill); MOVC fill happens AFTER the copy.
- rtl/cpu/v60/s32_v60.sv:2861 Down exhaustion: the scan ran off the bottom to i=-1 (MAME opSEARCHD*), so Z=0, R27=0xFFFFFFFF, and str_src has already reached op1-step.
- rtl/cpu/v60/s32_v60.sv:2876 CMPC exhausted the common prefix (all min elements equal): R28=len1+min*step, R27=len2+min*step, and S/Z from the length compare (MAME opCMPSTR tail).
- rtl/cpu/v60/s32_v60.sv:2911 Z follows MAME's post-loop test i==len1: up never breaks at i==len1 (Z=0), down does so only at its one-past-the-top byte read (str_cnt==len1+1).
- rtl/cpu/v60/s32_v60.sv:2950 CMPC (MAME opCMPSTR): compare source(op1) vs dest(op2).
- rtl/cpu/v60/s32_v60.sv:3209 BAM: bit addressing modes for the 0x5B/0x5D groups (MAME BAMTable1/2 implemented subset — everything MAME fatalerrors on traps here too).
- rtl/cpu/v60/s32_v60.sv:3683 exception / interrupt entry (MAME v60_do_irq): switch to interrupt context, push old PSW, push PC, PC = vector
- rtl/cpu/v60/s32_v60.sv:3918 per-opcode dim helpers (operand sizes per MAME op12 handlers)
- rtl/cpu/v60/s32_v60.sv:3920 F12 ops whose FIRST operand is an effective address, not a value (MAME F12DecodeFirstOperand(ReadAMAddress, ...)): MOVEA and IN
- rtl/cpu/v60/s32_v60.sv:3941 NOTE: ROTH (8b) / ROTCH (9b) must NOT appear here — their op1 is the rotate COUNT, a byte (MAME ReadAM dim 0); listing them in the half group made `ROT.H #imm8, r6` decode one byte long and holo's EEPROM write loop entered mid-instruction (
- rtl/cpu/v60/s32_v60.sv:3974 These read op2 as a VALUE (MAME ReadAM), so a memory operand must be loaded into op2val before exec; otherwise the exec fell back to the effective address / a stale op2val (audit R20 V60-18).
- rtl/cpu/v60/s32_v60.sv:4060 MOVC completion (MAME opMOVSTRU*/opMOVSTRD*): publish R28/R27 for the final element index `idx`, and — for the fill variants (MOVCFU/MOVCFD) with the source shorter than the destination — kick off the R26 tail-fill phase.
- rtl/cpu/v60/s32_v60.sv:4083 MAME pads the destination tail elements [idx, lenop2) with R26; the down form uses op2+dest+(lenop2-j-1) for bytes and op2+(lenop2-j-1)*2 for halves.
- rtl/cpu/v60/s32_v60.sv:4164 MAME MOV sets no flags?
- rtl/cpu/v60/s32_v60.sv:4285 A zero count must clear CY (MAME); the old code left it unchanged (audit R20 V60-7).
- rtl/cpu/v60/s32_v60.sv:4312 MAME defines CY from the post-rotate wrap bit: LSB after a positive (left) rotate, MSB after a negative (right) rotate.
- rtl/cpu/v60/s32_v60.sv:4323 MAME clears CY for a zero count; nonzero counts retain the final shifted-out bit, so only bypass the iterative state for zero.
- rtl/cpu/v60/s32_v60.sv:4384 MAME divide-by-zero: destination unchanged and no trap, but Z/S are still set from the (unchanged) destination = the dividend, and OV is cleared (audit R20 V60-8); the old code left flags stale.
- rtl/cpu/v60/s32_v60.sv:4417 MAME sets OV and leaves the destination unchanged (audit R20 V60-8); the old code always cleared OV and wrote the wrapped quotient.
- rtl/cpu/v60/s32_v60.sv:4435 MAME opMULX/opMULUX leave OV unchanged
- rtl/cpu/v60/s32_v60.sv:4451 MAME: no zero-divide trap
- rtl/cpu/v60/s32_v60.sv:4523 MAME opCALL: SP-=4; [SP]=AP; AP=op2; SP-=4; [SP]=retPC; PC=op1.
- rtl/cpu/v60/s32_v60.sv:4560 MAME opTRAP: the operand's HIGH nibble is a Bcc-encoded condition (cond 0xB never traps); only trap when it evaluates true, else fall through.
- rtl/cpu/v60/s32_v60.sv:4810 SHA left-shift overflow (MAME SHIFTLEFT_OV op12.hxx): OV is set when the top `count` bits of the width-sized value are not all equal to the sign bit — i.e. a bit different from the sign is shifted out through the top.
- rtl/cpu/v60/s32_v60.sv:4812 MAME masks exactly `count` bits (((1<<count)-1) << (bitsize-count)); using count+1 here spuriously set OV (e.g. SHA.B #1,0x40 gave OV=1 vs MAME OV=0), misbranching a following signed Bcc (S^OV).
- rtl/cpu/v60/s32_v60.sv:4823 count > width: MAME's macro is UB here (bitsize-count<0); any nonzero value overflowed
- rtl/cpu/v60/s32_v60.sv:4899 MAME opMUL/opMULU: OV = (product >> width) != 0 on the product's unsigned bit pattern (signed product for MUL, unsigned for MULU).
- rtl/cpu/v60/s32_v60.sv:4901 For byte/half MAME shifts the 32-bit value; for word, the 64-bit one.
- rtl/cpu/v60/s32_v60.sv:4924 MAME clears OV for REM/REMU (audit R20 V60-8)
- rtl/cpu/v60/s32_v60.sv:4933 Behavioral contract is MAME op2.hxx/op5.hxx, which use host `float` — round-to-nearest-even, with gradual underflow (subnormals) and IEEE special values.
- rtl/cpu/v60/s32_v60.sv:4949 NEGFS/ABSFS are NOT: MAME does ReadAMAddress + store only (no load) — they operate on op1 and must not read a possibly read-sensitive destination.
- rtl/cpu/v60/s32_v60.sv:5125 Deliberate divergence from the pinned MAME for |n| > 30: MAME computes `appf * / (1 << n)` with the host's shift-count masking (&31, and 1 << 31 = INT_MIN there), so e.g. SCLFS(31) flips the sign and SCLFS(32) is a no-op on x86.
- rtl/cpu/v60/s32_v60.sv:5182 Pinned MAME converts (uint32_t)(int64_t)val on its x86 host: NaN and out-of-int64-range saturate the hardware convert to INT64_MIN, whose low 32 bits are 0.
- rtl/cpu/v60/s32_v60.sv:5205 MAME stores the LOW 32 BITS of the int64 truncation, not a clamp: well-defined in C for e in [31,62]; e >= 63 saturates the x86 convert to INT64_MIN (low 32 = 0).
- rtl/cpu/v60/s32_v60.sv:5216 (MAME: (_S && val>=0) || (!_S && val<=-1); |val| >= 1 here).
- rtl/cpu/v60/s32_v60.sv:5331 MAME materializes the subtraction: same-signed infinities give inf-inf = NaN, so they compare Z=0/S=0 like unordered operands.
- rtl/io/s32_io.sv:51 MAME device_reset: m_cnt = 0
- rtl/io/s32_io.sv:52 MAME device_reset: m_dir = 0
- rtl/io/s32_io.sv:56 Ports A-H = 0-7, CNT = 0xE, direction = 0xF (per MAME map).
- rtl/io/s32_io.sv:586 MAME WAIT_FOR_COMPLETION: CS ends it
- rtl/io/s32_io.sv:618 MAME's d7_r returns shift_register[7] before applying the side-effecting left shift.
- rtl/io/s32_io.sv:703 SegaSonic's X counter is reversed like the MAME TRACKX input; Y defaults positive-down and can be inverted with the descriptor-gated OSD option.
- rtl/io/s32_io.sv:791 Control word powers up 0x9b (all ports input, mode 0) like MAME i8255 device_reset(); a mode-set write (port 3, bit7=1) latches it and a control-port read returns it with bit7 set.
- rtl/io/s32_io.sv:799 MAME's i8255 implementation returns the external pin value for input bits and the output latch for output bits; returning pc_in unconditionally made a mode-set write such as 0x93 observe 0xff instead of the mixed Port-C value (upper output
- rtl/io/s32_io.sv:818 MAME's set_mode() clears the output latches whenever a new mode word is written.
- rtl/io/s32_io.sv:854 MAME interrupt_control_16_w: BOTH byte lanes are registers — even byte -> ctl[offset*2], odd byte -> ctl[offset*2+1] (ga2 programs vectors 0..4, the ack reg 7, and the timer highs 9/11 on both lanes; found by real-ROM boot: dropped acks mad
- rtl/io/s32_io.sv:916 MAME device_reset (memset(m_v60_irq_control,0xff)) leaves the pending byte (index 7) = 0xff -> all 5 sources pending, but ctl[6]=0xff below masks them so no IRQ is delivered until the game unmasks.
- rtl/io/s32_io.sv:928 MAME/device-reset contract: the complete 16-byte register file starts at FF.
- rtl/io/s32_io.sv:979 n == 0: MAME only re-arms `if (duration)` — the write stores the register byte and leaves an in-flight one-shot running.
- rtl/io/s32_io.sv:988 MAME/hardware: 0x100*N ticks at exactly 50 MHz/16.
- rtl/io/s32_io.sv:995 n == 0: register write only, armed one-shot keeps running (MAME parity — see timer 0 above).
- rtl/io/s32_io.sv:1003 MAME int_control_r/hardware-visible readback
- rtl/mem/s32_fb_if.sv:6 Services (per DESIGN.md): - erase_line(y): fill line with 0xFFFF - write_run(...): pixel run writes from the sprite renderer; wr_shadow runs RMW dest &= 0x7fff instead (MAME shadow sprites clear framebuffer bit 15) - read_line(y):
- rtl/mem/s32_rom_loader.sv:12 The inverse of MAME's destination-to-source address lookup is applied (see v25_stream_to_dst below and DESIGN.md §8.1).
- rtl/mem/s32_rom_loader.sv:90 MAME describes the ROM as: descrambled[dst] = raw[bitswap(dst, 14,11,15,12,13,4,3,7, 5,10,2,8,9,6,1,0)] The ioctl loader visits raw source addresses in ascending order, so the BRAM write address must use the inverse permutation: dst = inver
- rtl/prot/s32_prot.sv:104 Burning Rival ROM-string protection copy (MAME init_brival).
- rtl/prot/s32_prot.sv:115 Read trap: the MAME handler is installed for word reads at 0x20BA00-07.
- rtl/prot/s32_prot.sv:212 MAME's init_jleague installs a write16 handler at 0x20f700-0x20f705: offset 0 indexes the main-ROM table at 0x07bbc0 and publishes its low byte at work RAM 0x20f708; offset 2 (0x20f704) publishes the selected team byte at 0x200016.
- rtl/prot/s32_prot.sv:477 HLE: wakeup string + echo protocol (MAME simulation fallback) ga2: "wake up!
- rtl/prot/s32_prot.sv:481 v1 provides the string + the ga2 sprite expansion results table (prot[16] from MAME).
- rtl/prot/s32_prot.sv:515 ga2 sprite-expansion result table (MAME prot[16])
- rtl/s32_core.sv:12 In a captured pre-fix Dark Edge build, running both sides from ce_cpu made its displayed gameplay countdown advance every 70 frames instead of MAME's measured 35-frame writes to 0x20a112 at PC 0x087080, consistent with alternate VBlank work
- rtl/s32_core.sv:180 Driving-cabinet games poll this at whatever cadence their own code takes (measured in MAME: every frame during Rad Mobile gameplay, every other frame on its Input Test screen) -- the host wheel adapter slews to this event directly instead o
- rtl/s32_core.sv:304 MAME reset PC (audit R20 V60-21)
- rtl/s32_core.sv:334 MAME's regular System 32 map exposes the communication-board CN and FG flip-flop registers at 0x801000/0x801002.
- rtl/s32_core.sv:335 They are byte registers, not open-bus locations: reset reads 0xFE from both, CN stores bit 0, and FG stores bit 0 only while CN is enabled (s32comm.cpp).
- rtl/s32_core.sv:343 MAME's I/O mirrors ignore A19:A7 (System 32) or A18:A7 (Multi 32).
- rtl/s32_core.sv:708 The sprite engine keeps its own width bit (ctl_latched[6][0]) for sprite-side clipping, exactly MAME's split (games program both consistently).
- rtl/s32_core.sv:936 The regular-PCB machine config instantiates S32COMM (MAME segas32_regular_state::device_add_mconfig), so this window behaves as byte-wide RAM even with no link partner: a game that writes then reads the share area must read its own data bac
- rtl/s32_core.sv:940 Only D[7:0] is mapped (MAME maps 0x800000-0x800fff share_r/w with umask16 0x00ff); the cn/fg link registers at 0x801000/2 use the small HLE below, and the rest of the 0x80xxxx page reads link-not-connected (0xFFFF).
- rtl/s32_core.sv:1020 MAME's s32comm cn_w(0) invokes device_reset(), clearing FG too.
- rtl/s32_core.sv:1027 MAME's EPR-14084 simulation starts with an offline link and performs the master handshake over 0xe8 VBLANK ticks.
- rtl/s32_core.sv:1079 Multi 32 EEPROM DO is read on the SECOND I/O chip's SERVICE34_B bit 7 (MAME io_chip_1.in_pf = SERVICE34_B, do_read on bit 7); previously io1 got constant 0xff there, so Multi 32 NVRAM boot never converged (audit R23-F1).
- rtl/s32_core.sv:1084 cnt1 = screen-B display enable (MAME io_chip_1 out_cnt1 -> display_enable_w<1>).
- rtl/s32_core.sv:1428 MAME: map(0xf00000, 0xffffff).rom().region("maincpu", 0) — the top window mirrors the FIRST megabyte (the V60 reset stub at 0xFFFFF0 lives at maincpu offset 0xFFFF0).
- rtl/s32_core.sv:1507 MAME returns machine().rand() (full-width, uncorrelated).
- rtl/s32_core.sv:1550 MAME s32comm returns 0xFE | CN for CN and 0xFE | FG for FG with the unconnected ZFG held low; only the rest of 0x80xxxx remains open bus.
- rtl/s32_core.sv:1552 The descriptor-selected EPR-14084 HLE publishes shared byte 4 after the MAME link timer expires.
- rtl/s32_core.sv:1569 Open-bus when this board has no V25 (holo, spidman): MAME leaves 0xA00000 unmapped (audit R20 PF-7).
- rtl/s32_core.sv:1579 MSM6253 serial output is wired to D7, not D0 (MAME msm6253 d7_r); audit R20 IO-3.
- rtl/s32_pkg.sv:92 MAME mirrors the controller's 2-bit bank selection modulo that physical count.
- rtl/video/s32_mixer.sv:9 This module implements MAME mix_all_layers' effective-priority scheme evaluated directly per pixel: - first = topmost non-transparent layer (the winner) - second = the scan continued below the winner (blend partner) - blend = (first*(7-f)
- rtl/video/s32_mixer.sv:68 MAME video_start memsets mixer_control to 0xFF: unwritten registers read 0xFFFF, giving priority 0xF.
- rtl/video/s32_mixer.sv:121 sprite pixel semantics (MAME mix loop, exactly): transparent when (pix & 0x7fff) == 0x7fff (covers 0xFFFF erase + 0x7FFF) shadow source a: bit15 CLEAR when reg 0x4C bit2 set (RMW shadow sprites) shadow source b: masked pen == sprshadow (0x7
- rtl/video/s32_mixer.sv:152 MAME records the unresolved System 24-style hardware theory as a fallback above the backdrop but behind every real pixel; giving it the layer's ordinary programmed priority instead lets a blank NBG cover terrain and sprites.
- rtl/video/s32_mixer.sv:175 disabled layers never mix (MAME enablemask) — a disabled layer's line buffer keeps stale pixels, so it must be gated here
- rtl/video/s32_mixer.sv:262 backdrop pixel (MAME update_background): per line.
- rtl/video/s32_mixer.sv:354 MAME uses the raw pixel-derived group for the per-layer sprite blend mask.
- rtl/video/s32_mixer.sv:359 shadow applies when the scan passes the sprite layer's order slot: scan 1 (always): sprite at/above the winner scan 2 (only when the winner has blends): sprite below winner, at/above the partner — MAME's second loop re-evaluates shadow iden
- rtl/video/s32_mixer.sv:391 MAME reads mixer control once per frame, after the frame is complete.
- rtl/video/s32_mixer.sv:463 pixel pipeline: two palette lookups per pixel, then MAME's 5-bit-domain arithmetic.
- rtl/video/s32_mixer.sv:504 This is the standard pal5bit expansion used by MAME: replicate the upper three bits into the low three bits so 5'b11111 becomes 8'hff (not 8'hf8).
- rtl/video/s32_mixer.sv:512 MAME applies signed color offsets before blending and clamps only after the weighted sum.
- rtl/video/s32_mixer.sv:652 With the bubble a pixel took 13 clk_ram edges from the display-X change — one more than the 12-edge 416-wide pixel period — so the display sampled the previous pixel and the whole 416-wide picture came out one column right of MAME.
- rtl/video/s32_mixer.sv:677 Preserve MAME's order: offset, blend, then shadow.
- rtl/video/s32_palette.sv:60 Disabled bits therefore remain from each half's own old word (MAME paletteram_w), rather than being copied from the source half.
- rtl/video/s32_sprite.sv:74 MAME m_sprite_render_count (0/1)
- rtl/video/s32_sprite.sv:115 MAME exposes only selected-buffer bit 0.
- rtl/video/s32_sprite.sv:117 MAME reg 0 bit0 = (SPRITES.num < SPRITES_2.num), i.e. the CPU-visible identity of the displayed buffer.
- rtl/video/s32_sprite.sv:157 MAME's controller model bounds a frame to the 0x20000-byte sprite RAM divided by one 16-byte command (8192 commands).
- rtl/video/s32_sprite.sv:191 MAME controller model uses 16.16 zoom
- rtl/video/s32_sprite.sv:194 wide MAME int-domain origin; no 12-bit wrap
- rtl/video/s32_sprite.sv:198 The MiSTer SDRAM port is the only part of the Golden Axe sprite path that cannot be reproduced by the cycle-exact MAME/RTL replays.
- rtl/video/s32_sprite.sv:219 MAME visits every word even if strong downscale emits no pixel from it.
- rtl/video/s32_sprite.sv:241 Scaling setup is not on the pixel-rate path, so share one restoring divider across Y then X. The 25-bit numerators preserve MAME's unsigned 16.16 controller math.
- rtl/video/s32_sprite.sv:261 MAME transparency_masks[ctl4 & 3][ctl5 & 3]
- rtl/video/s32_sprite.sv:330 MAME never misses because its render is instantaneous.
- rtl/video/s32_sprite.sv:350 Automatic mode uses MAME's 0/1 down-counter exactly, including mode changes between 60 Hz and 30 Hz.
- rtl/video/s32_sprite.sv:359 audit R20 SP-2: on the 30Hz skip frame MAME leaves m_sprite_control[0] untouched (m_sprite_render_count-- != 0), so a CPU-written manual command still executes.
- rtl/video/s32_sprite.sv:508 MAME: bit12 of word0 gates clip-in (words 0-3: y0,y1,x0,x1 sext12); bit13 gates clip-out (words 4-7)
- rtl/video/s32_sprite.sv:517 MAME changes clip-out only when bit 13 is set.
- rtl/video/s32_sprite.sv:542 MAME uses int arithmetic after sign-extending both 12-bit values.
- rtl/video/s32_sprite.sv:595 MAME: entry & (bpp8 ?
- rtl/video/s32_sprite.sv:603 Flip reverses the DESTINATION sweep while the source reads forward (hardware/MAME model) — end codes and word transparency track source order regardless of flip.
- rtl/video/s32_sprite.sv:637 MAME applies latched controller flip while scanning the displayed sprite framebuffer.
- rtl/video/s32_sprite.sv:715 MAME consumes m_spriteram_32bit MSB-first.
- rtl/video/s32_sprite.sv:760 MAME clips the trailing xtarget before its source loop.
- rtl/video/s32_sprite.sv:773 This keeps end_scan_word out of the 96.6 MHz cache/mux path while preserving MAME's sequential end-code scan.
- rtl/video/s32_sprite.sv:858 MAME: first/last pixel of each 32-bit word uses transp (0x0f/0xff, or 0 when opaque); middle pixels use 0.
- rtl/video/s32_tilemap.sv:2 System 32 scroll/tilemap engine — 315-5387 (DESIGN.md §6.2, Appendix C) Renders one scanline of each enabled layer into per-layer line buffers: NBG0/1: MAME-exact 12.20 X/Y zoom and fractional scroll ($1FF10-1E, $1FF50-56, 0x200=1.0) NBG2/3
- rtl/video/s32_tilemap.sv:61 to the mixers (MAME enablemask, inverted)
- rtl/video/s32_tilemap.sv:64 layer enable logic: $1FF02 low bits + $1FF8E second disable set (+ $1FF00 bits 12/13 disable NBG2/NBG3 — MAME update_tilemaps)
- rtl/video/s32_tilemap.sv:98 MAME source coordinate/step, 12.20 modulo 2^32
- rtl/video/s32_tilemap.sv:105 MAME's update_tilemap_rowscroll (segas32_v.cpp) hoists exactly these out of its inner loop: `xscroll`/`yscroll` and the flip flags are computed once for the layer, and each row resolves its effective source Y and its pair of page pixmaps (`
- rtl/video/s32_tilemap.sv:137 NBG0/1 use MAME's exact (0x200 << 20)/zoom calculation on both axes.
- rtl/video/s32_tilemap.sv:202 layer clip windows (MAME compute_clipping_extents, per-pixel form): rect i = clips[4i..4i+3] = {min_x[8:0], min_y[7:0], max_x[8:0], max_y[7:0]} (max inclusive); pixel drawn iff !enable | (inside-union ^ clipout)
- rtl/video/s32_tilemap.sv:220 Text layer name address: MAME's get_text_tile_info uses the full five-bit page selector $1FF5C[8:4] (<<11 words).
- rtl/video/s32_tilemap.sv:289 MAME uses zoom X for both axes unless independent Y zoom is selected by $1FF00 bit 14.
- rtl/video/s32_tilemap.sv:292 MAME treats the destination center as signed 9-bit at neutral zoom and signed 10-bit whenever that axis is zoomed.
- rtl/video/s32_tilemap.sv:373 V-2 (MAME update_tilemap_zoom): exact 12.20 reciprocal step, with destination zoom floored at 0x80.
- rtl/video/s32_tilemap.sv:620 ---- bitmap layer (MAME update_bitmap) ---- 4bpp: 512x512, row = 128 words, y wraps 9 bits 8bpp: 512x256, row = 256 words, y wraps 8 bits color = (reg 0x1FF8C << 4) masked above the pen bits
- rtl/video/s32_tilemap.sv:720 Each quotient takes 30 clocks and truncates toward zero exactly like MAME's unsigned integer division.
- rtl/video/s32_vram.sv:143 register file powers up 0 (Cyclone V flops); $1FF00 gets the MAME device_start default.
- rtl/video/s32_vram.sv:146 416-wide default (MAME device_start)
- README.md:94 | Sega 315-5385 controller | V60 registers, IRQs, timers | [`s32_io.sv`](rtl/io/s32_io.sv); schematics and MAME behaviour |
- README.md:101 | SegaSonic control-ball adapter | Three player channels, 12-bit relative X/Y counters, c00040/c00048/c00050-style byte reads and reset writes | [`s32_trackball
- README.md:116 **MAME developers** - [System 32 behavioural reference](https://github.com/mamedev/mame), including the uPD4701A trackball contract and SegaSonic ROM/input defi
- README.md:139 Intel Quartus, Verilator, Icarus Verilog, ModelSim, and MAME tool authors.
- README.md:167 Place the required MAME ROM ZIPs in `/media/fat/games/mame/`, then launch a game from the MiSTer Arcade menu.
Says it matches, follows or was checked against MAME — 8
- rtl/audio/s32_rf5c68.sv:213 sample[7]=1 is positive; sample[7]=0 is negative, matching MAME's RF5C68 sign/magnitude convention.
- rtl/cpu/v60/s32_v60.sv:17 - Single-precision FP (0x5C/0x5F: CMPF/MOVFS/NEGFS/ABSFS/SCLFS/ADDFS/SUBFS/ MULFS/DIVFS/CVTWS/CVTSW): a binary32 unit (round-to-nearest-even, gradual underflow) matching MAME's host-float contract; no System 32 game uses it.
- rtl/cpu/v60/s32_v60.sv:2972 Equal AND matches the stop byte: MAME clears CY and breaks; S/Z stay 0 (i != dest), R28/R27 at the current index.
- rtl/cpu/v60/s32_v60.sv:4824 1 <= count <= width: exact MAME SHIFTLEFT_OV mask (count==width uses the full-width mask, matching MAME's count==bitsize case, e.g. SHA.B #8,-1 -> OV=0)
- rtl/io/s32_io.sv:30 Matches MAME 315_5296.cpp read()/write() in MAME's 315_5296 device.
- rtl/s32_core.sv:706 TM-1: CRT/tilemap screen-width authority is VRAM $1FF00 bit 15, matching MAME screen_update_system32 / multi32_update, which set the visible area to 52*8 (416) when that bit is set and 40*8 (320) otherwise.
- rtl/s32_core.sv:1117 Power up at bank 0 to match MAME device_start (m_analog_bank = 0); System 32 analog games never write 0xC00060 so it would otherwise stay X in simulation and undefined at cold boot (audit R20 IO-15).
- rtl/video/s32_sprite.sv:699 Repack each pair to the same byte layout as a sprite-ROM burst (matching the 315-5386/MAME controller model).
Shares text with the MAME driver without saying so — 4