← All cores
Model1 (alphanu1)
Cites hardware documentation that MAME's driver does not — 6
- rtl/m1_integrated.sv:1150 OFF is one character away from ON and the generate prunes completely - DEBUG_OVERLAY proved that, with 4,287 registers removed and no trace of its capture logic left in the netlist.
- rtl/cpu/v60/v60.sv:3741 A zero divide exception sets the PSW.OV flag and leaves the destination unmodified." p.8-2 Figure 8-2: SBT entry 21 (+84) is the integer arithmetic exception vector, shared with BRKV's integer overflow (p.7-13).
- rtl/io/m1_glue.sv:191 Only selector 1 — the 0x100000-0x1fffff data ROM window — is used by any dumped game; the others are decoded and ignored, as there.
- rtl/io/m1_rom_loader.sv:41 Sized from MEASURED ROM extents across all ten dumped Model 1 games, not from MAME's ROM_REGION declarations.
- rtl/io/m1_decode.sv:59 MAME's bank_w takes the low nibble as a selector and bits 7:4 as the bank; only selector 1, the 0x100000-0x1fffff data ROM window, is used by any dumped game.
- README.md:449 CAPS0ff — decapped MB86233 microcode ROMs
Cites hardware references or measurements that MAME's driver also gives — 1
Says it was checked on “real hardware” — 4
- Model1.sv:819 Confirmed on hardware 2026-09-07 at 46b9e2c, tile overruns massively reduced.
- rtl/tgp/m1_copro_if.sv:457 Confirmed on hardware 2026-08-18: row 10 = 000492, row 00 parked in the poll loop.
- README.md:28 Confirmed on hardware in attract and in play across Virtua Racing, Virtua Formula, Virtua Fighter and Star Wars Arcade.
- README.md:92 Neither is yet confirmed on hardware.
Notes where it differs from MAME — 4
- rtl/io/m1_glue.sv:48 With no USART, level 3 never existed here, the queue never drained, and `make v60_trace GAME=vf` diverged from MAME 21,817 instructions in — one boundary after the game enables interrupts — because the reference services vblank AND THEN lev
- rtl/io/m1_speed_report.sv:214 MAME is the oracle for what the REFERENCE does; it says nothing about what our V60 writes, and ours is known to diverge from MAME's at instruction 197,251.
- rtl/tgp/m1_tgp.sv:322 It must not block, and the comment that used to stand here - "MAME's generic_fifo blocks the same way" - was wrong about the one thing it was cited for.
- README.md:9 The core implements one MB86233, because MAME instantiates one and never executes the other two — decision D4, reversed, with what that gives up stated there.
Cites MAME source — 461
- Model1.sv:71 MEASURED AGAINST MAME, 2026-09-14, and this reverses an earlier x16 that was actively making the sound worse.
- Model1.sv:74 MAME's own output for vr over 75 seconds, in five-second windows:
- Model1.sv:93 Star Wars' Digital Sound Board is summed in, as MAME sums its "mpeg" speaker with the sound board's. Zero for every other game.
- Model1.sv:105 The sound board boots correctly in `make test_m1_sndboard` against the real ROM -- 1.25 M instructions, MAME's own main loop at PC 0x1100, both MultiPCMs driven, and it survives SDRAM latency from 12 to 100 cycles.
- Model1.sv:188 Virtua Racing's control panel, from model1.cpp's INPUT_PORTS( vr ): coin, test, service, start, four VR view buttons and a two-position shifter.
- Model1.sv:226 Idle is 0xFF because every control in MAME's model1.cpp is IP_ACTIVE_LOW; a byte left at zero reads as every button on it held down.
- Model1.sv:230 Byte 0 is Virtua Racing's IN.0 and byte 1 its IN.1, in MAME's bit order.
- Model1.sv:232 The bit assignment within a byte is from model1.cpp and is not a guess; the base address is.
- Model1.sv:273 MAME maps 0x000000-0x0fffff as .rom() for every Model 1 game, and four of the six populate it by mirroring the boot ROM in with ROM_RELOAD:
- Model1.sv:300 Wing War does not use the board the other games do: model1.cpp's wingwar() replaces it with SEGA_MODEL1IO2 running EPR-16891, a TMPZ84C015 with a different map whose firmware is driven by a CTC timer interrupt.
- Model1.sv:313 The LEFT STICK stands in for the player's head: m1_main's m1_hmd_pose writes the pose, forward when the stick is released, turned up to +-90 degrees of yaw and +-45 of pitch at full deflection (that module carries the format, measured in MA
- Model1.sv:337 model1.cpp INPUT_PORTS_START( vr ) and ( vf ).
- Model1.sv:342 The layouts, the bytes and the reasons are in rtl/io/m1_pad_map.sv; tb_m1_pad_map checks every named button against the fixed layout this replaced and against MAME's bit.
- Model1.sv:386 MAME's an_callback<N> index IS the DPRAM byte index -- vr publishes WHEEL, ACCEL, BRAKE on 0/1/2 and reads them at 0x00/0x01/0x02.
- Model1.sv:403 MAME declares PORT_MINMAX(27,227) with a 0x7f centre, so the real pot swings 27..227 and never reaches the rails.
- Model1.sv:453 That asymmetry is why left/right came out swapped on the board while up/down was fine -- the reverse was read off model1.cpp and then not applied.
- Model1.sv:459 `0xff - v` maps a centred 0x80 to 0x7f -- one count off -- so with the invert ON, which is the DEFAULT here because MAME declares PORT_REVERSE, a stick sitting perfectly still sent 126 where the pot's centre is 127.
- Model1.sv:490 x_inv defaults to 1 because MAME declares PORT_REVERSE on X, so that is exactly what happened on the board -- the left stick did nothing and the aim sat hard over.
- Model1.sv:503 ISSUE #7: THE THROTTLE MOVES NOW (m1_swa_throttle, instantiated after the PLL because it is clocked: MAME's 28..200 on DPRAM 0x02, 28 the fast end).
- Model1.sv:537 MAME's DPRAM in play reads 7f ff 7f at 0x00-0x02 with the stick at rest (model1io2 an_callback 0 and 2, both defaulting to 0x7f).
- Model1.sv:1220 The main board never reads back, but Star Wars' DSB listens to this line: model1.cpp appends dsbz80's write_txd to m1audio's rxd_handler.
- Model1.sv:1238 It also reproduced the reference: model1.cpp gives each MULTIPCM a 0x400000 region and loads 0x200000 into it for vr, so a voice addressing the top half reads ZEROS in MAME.
- Model1.sv:1243 **MAME EQUIVALENCE IS PRESERVED BY THE MRA, NOT BY LOGIC**: vr and vformula are zero-padded to fill the 4 MB slot (`<part repeat="2097152">00</part>`), so the upper half holds actual zeros and a voice reading it gets what the reference gets
- Model1.sv:1246 That is why the pad fill is 00 and not the FF used elsewhere in those files -- FF would be full-scale noise exactly where MAME is silent.
- Model1.sv:1267 Star Wars is the only Model 1 game that has one (model1.cpp swa()); it is held in reset for every other game, whose streams carry no DSB data.
- Model1.sv:1358 tb_m1_sndboard settles at pc=0x00116e, inside MAME's main loop at page 0x001100, after 901,005 instructions.
- Model1.sv:1754 The core is meant to emit MAME's 57.52 Hz and MiSTer's own Information screen agrees, but that reports what the scaler locked onto, not what the core produced.
- Model1.sv:1912 tb_m1_sndboard settles in MAME's main loop at 0x00116e.
- Model1.sv:2273 LED_DISK = snd_ready -> the sound ROM stream completed LED_POWER = v60_cmd_seen -> the V60 has pushed a byte into the USART LED_USER = snd_mainloop_seen -> the sound 68000 reached MAME's main loop
- rtl/m1_main.sv:81 See m1_decode, which carries the per-game table and the MAME evidence.
- rtl/m1_main.sv:224 MAME takes the same care: set_current_render_list() assigns m_display_list_current once, at the start of a render, and everything afterwards reads that pointer.
- rtl/m1_main.sv:361 It copies routines into RAMA and calls them there - MAME's trace runs 40D000h-40D014h and 40DC00h on, among others, from the first attract frame - and the fetch took only the ROM mapping, so a fetch from 40D000h read SDRAM word 0 (m1_decode
- rtl/m1_main.sv:372 The routines are ~0.1% of Wing War's instructions in MAME's trace, so uncached costs nothing measurable, where an invalidate port would cost a second tag read.
- rtl/m1_main.sv:393 ROMA, ROMO, ROMX and ROM0 are `.rom()` and `.bankr()` in MAME's map (model1.cpp:985) and mask ROM on the board: a write to them goes nowhere.
- rtl/m1_main.sv:400 MAME never writes these regions: 0 writes in 600 s of Virtua Racing attract, measured with a write tap (build/mame_romwrites.lua in docs/findings.md 2026-10-28).
- rtl/m1_main.sv:578 The firmware is a MAME BIOS set, which is what made it possible: model1io.zip is required to run any Model 1 game in MAME too.
- rtl/m1_main.sv:646 The cabinet is a VR game: a Polhemus tracker on the player's head supplies six 16-bit words there (MAME declares the board, an i386SX, and does not run it), and the V60 reads them in play as the camera's orientation.
- rtl/m1_main.sv:652 MAME's netmerc_state::machine_reset seeds a pose looking forward, {0, 0, 0, 12868, 25736, 12868}.
- rtl/m1_main.sv:805 MAME clocks the real part at 40 MHz against this domain's 19.2, so throughput is the open question — measure it against the polygon rate before moving it to the fast domain, which would put a clock crossing on the shared RAM.
- rtl/m1_main.sv:860 From the Model 2 core, measured on hardware: "DQM tied low is common on these boards and would make every byte write land in all four lanes exactly as observed - invisible to every test we own, because they all test the FPGA." Their symptom
- rtl/m1_main.sv:977 sel_fifo_stat deliberately falls through: MAME's fifoin_status_r returns a constant 0xFFFF and the default below already is that.
- rtl/m1_mainram.sv:162 `model1.cpp:994` maps each buffer as the full 64 KB, and `model1_v.cpp:25` masks the walker's address with 0x7fff, so the ARCHITECTURE really is 32,768 words.
- rtl/m1_mainram.sv:185 Star Wars uploads its whole colour table through command 4 at boot in blocks that run to word 0x783e; Wing War and NetMerc do the same in play (MAME, 4,000 frames of each).
- rtl/m1_mainram.sv:258 Measured: our table against MAME's, per section.
- rtl/m1_integrated.sv:846 Only command 4's colour uploads ever reach it - measured against MAME over 4,000 frames of all six sets: Star Wars at boot, Wing War and NetMerc in play; Virtua Racing, Virtua Fighter and Virtua Formula never pass word 0x2006 - so the walke
- rtl/cpu/v60/v60.sv:34 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/v60.sv:42 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/v60.sv:49 - Not implemented (reserved-instruction exception, logged in sim): the un-dispatched 0x5C/0x5F sub-opcodes (MAME UNHANDLED).
- rtl/cpu/v60/v60.sv:50 MMU/TLB effects are absent like MAME, but CLRTLB still decodes its complete operand.
- rtl/cpu/v60/v60.sv:64 V60/V70 reset PC (MAME m_start_pc; audit V60-21)
- rtl/cpu/v60/v60.sv:282 PSW fields (MAME bit layout: Z=b0,S=b1,OV=b2,CY=b3,IE=b18,EL=b25:24,IS=b28)
- rtl/cpu/v60/v60.sv:588 C-style truncating divide-by-8 of a signed bit offset (MAME bamoffset/8) Rounding toward zero is rounding UP for a negative offset, and that is (off + 7) >>> 3: the same value as negate-shift-negate for every 32-bit input, including 0x80000
- rtl/cpu/v60/v60.sv:1178 stack switch on IS change, or EL change while IS=0 (MAME v60WritePSW)
- rtl/cpu/v60/v60.sv:1299 `make v60_trace` logs dbg_pc on change and diffs it against MAME's tracer, which only prints instructions it actually retires; at `updpsw.w #FFFFFFFF, #40000` — whose mask 0x40000 is bit 18, psw_ie — the reference vectors straight to the ha
- rtl/cpu/v60/v60.sv:1342 primary dispatch (per MAME optable.hxx)
- rtl/cpu/v60/v60.sv:1347 BRK — MAME skips this opcode (A4)
- rtl/cpu/v60/v60.sv:1367 ---- 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/v60.sv:1423 MAME opDBcc: reg ALWAYS decrements; branch iff cond true and decremented reg != 0.
- rtl/cpu/v60/v60.sv:1492 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/v60.sv:1518 RETI adj (halfword, MAME moddim=1)
- rtl/cpu/v60/v60.sv:1542 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/v60.sv:1562 MAME implements ADDDC/SUBDC/SUBRDC/CVTDPZ/CVTDZP (radm timer); remaining subops are reserved there too.
- rtl/cpu/v60/v60.sv:1659 Unhandled sub-opcodes still take the reserved-instruction vector exactly as MAME's op5C/op5F UNHANDLED entries fatalerror.
- rtl/cpu/v60/v60.sv:1701 RSR (A9): pop PC ONLY (MAME opRSR: PC=[SP]; SP+=4)
- rtl/cpu/v60/v60.sv:1706 MAME/NEC floating-exception test: enabled TKCW causes are intersected with the PSW floating-status field.
- rtl/cpu/v60/v60.sv:1735 F12: plan operands per instflags (MAME F12DecodeOperands)
- rtl/cpu/v60/v60.sv:1744 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/v60.sv:2014 Immediate modes carry no address: the "address requested" path must still hand back the value (MAME LDPR-quirk equivalent), and op2 immediates pre-fill op2val so S_OP2_LD never dereferences a stale ea_addr (found by real-ROM boot: ga2's `LD
- rtl/cpu/v60/v60.sv:2106 MAME stores the truncated quotient and leaves OV alone, which is what this did until 2026-11-12 (docs/findings.md).
- rtl/cpu/v60/v60.sv:2164 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/v60.sv:2313 MAME, op12.hxx opOUTB: F12DecodeOperands(&ReadAM, 0, &ReadAMAddress, 2); m_io->write_byte(m_op2, (uint8_t)m_op1);
- rtl/cpu/v60/v60.sv:2450 pops (8) + frame-destroy operand (MAME: SP += amout), then the PSW write may bank-switch SP — order matters: adjust THEN switch.
- rtl/cpu/v60/v60.sv:2482 push highest set register first (MAME pushes from r31 down?
- rtl/cpu/v60/v60.sv:2530 TASI sets flags as SUBB(old, 0xFF, 0) before writing 0xFF (MAME opTASI).
- rtl/cpu/v60/v60.sv:2567 R27 (dst) / R28 (src) updated at completion (MAME MOVSTR).
- rtl/cpu/v60/v60.sv:2576 Element-size dim for both (MAME dim 0 byte / 1 half — see decode).
- rtl/cpu/v60/v60.sv:2593 V60-15: down-direction search (subop[0]=1, MAME opSEARCHD*).
- rtl/cpu/v60/v60.sv:2595 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/v60.sv:2620 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/v60.sv:2629 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/v60.sv:2632 CMPCF (0x01): fill the SHORTER operand's tail with R26 BEFORE the compare (MAME bFill); MOVC fill happens AFTER the copy.
- rtl/cpu/v60/v60.sv:2661 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/v60.sv:2676 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/v60.sv:2707 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/v60.sv:2746 CMPC (MAME opCMPSTR): compare source(op1) vs dest(op2).
- rtl/cpu/v60/v60.sv:2970 Only the flags the instruction writes: CVTSW keeps CY and MOVFS keeps all four, as MAME's op2.hxx does.
- rtl/cpu/v60/v60.sv:2999 BAM: bit addressing modes for the 0x5B/0x5D groups (MAME BAMTable1/2 implemented subset — everything MAME fatalerrors on traps here too).
- rtl/cpu/v60/v60.sv:3385 CMPC finishes through S_STR_RD's exhaustion branch so the MAME length-tail flags/registers apply; MOVC finalizes R28/R27 from the operand bases and the copied count via movc_finish (which also scales by the element size and launches the MOV
- rtl/cpu/v60/v60.sv:3478 exception / interrupt entry (MAME v60_do_irq): switch to interrupt context, push old PSW, push PC, PC = vector
- rtl/cpu/v60/v60.sv:3663 per-opcode dim helpers (operand sizes per MAME op12 handlers)
- rtl/cpu/v60/v60.sv:3665 F12 ops whose FIRST operand is an effective address, not a value (MAME F12DecodeFirstOperand(ReadAMAddress, ...)): MOVEA and IN
- rtl/cpu/v60/v60.sv:3686 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/v60.sv:3719 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/v60.sv:3785 MOVC completion (MAME opMOVSTRU*/opMOVSTRD*): publish R28/R27 for the final element index, and - for the fill variants (MOVCFU/MOVCFD) with the source shorter than the destination - kick off the R26 tail-fill phase.
- rtl/cpu/v60/v60.sv:3799 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 - which is r27 itself for halves and r27+dest for bytes.
- rtl/cpu/v60/v60.sv:3912 MAME MOV sets no flags?
- rtl/cpu/v60/v60.sv:4024 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/v60.sv:4097 NEC uPD70616 Programmer's Reference Manual (1986): DIV p.7-36, DIVU p.7-38, REM p.7-84 and REMU p.7-85 each list "Exceptions: Zero Divide" and say the destination is unchanged when it occurs; p.8-8: "A zero divide exception sets the PSW.OV
- rtl/cpu/v60/v60.sv:4133 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/v60.sv:4148 MAME opMULX/opMULUX leave OV unchanged
- rtl/cpu/v60/v60.sv:4165 MAME takes no trap.
- rtl/cpu/v60/v60.sv:4229 MAME opCALL: SP-=4; [SP]=AP; AP=op2; SP-=4; [SP]=retPC; PC=op1.
- rtl/cpu/v60/v60.sv:4266 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/v60.sv:4523 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/v60.sv:4525 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/v60.sv:4536 count > width: MAME's macro is UB here (bitsize-count<0); any nonzero value overflowed
- rtl/cpu/v60/v60.sv:4624 MAME's opMUL tests (product >> width) != 0 on the bit pattern, which also flags every negative product that fits - 1 * -1 gave OV=1 here until 2026-11-12.
- rtl/cpu/v60/v60.sv:4657 MAME clears OV for REM/REMU (audit R20 V60-8)
- rtl/cpu/v60/v60_shift.sv:28 These helpers were audited and corrected once already (R20 V60-7): a zero count must CLEAR carry rather than leave it; a count greater than the operand width is undefined in MAME's own macro, so ours defines it; and count == width uses the
- rtl/cpu/v60/v60_shift.sv:189 The original leant on 32-bit wraparound - `32'd1 << 32` is 0, so minus one gives 0xffffffff, the full-width mask - which is MAME's count == bitsize case.
- rtl/cpu/v60/v60_fp.sv:92 The failures are against `numpy.float32` -- tb_v60_fp's own header says "expectations from numpy.float32 (IEEE-754 RNE, the MAME host-float contract)".
- rtl/cpu/v60/v60_fp.sv:122 MAME's CVTSW sets S, OV and Z and leaves CY alone, and MOVFS sets no flag at all (op2.hxx); the unit's o_cy/o_* are not driven for those, so without this the CPU copied whatever the previous FP instruction had left there.
- rtl/cpu/v60/v60_fp.sv:126 Measured on Virtua Fighter (tb_v60_fp_replay, MAME's own operands): 22 of 1,982 FP ops in the stage 3 sweep and 34 of 645 in the attract Lau scene came out with the wrong CY - every one a CVTSW.
- rtl/cpu/v60/v60_fp.sv:398 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/v60_fp.sv:421 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/v60_fp.sv:432 (MAME: (_S && val>=0) || (!_S && val<=-1); |val| >= 1 here).
- rtl/cpu/v60/v60_fp.sv:556 MAME materializes the subtraction: same-signed infinities give inf-inf = NaN, so they compare Z=0/S=0 like unordered operands.
- rtl/cpu/v60/v60_alu.sv:172 The s32 original cleared CY for NOT ("NOT does clear it" stood here); NEC's uPD70616 Programmer's Reference Manual (1986), NOT, p.7-72, gives its condition codes as "CY Unchanged, OV Cleared", and MAME's opNOTB/H/W assign OV, S and Z only.
- rtl/io/m1_glue.sv:19 Every source in model1.cpp raises through
- rtl/io/m1_glue.sv:39 model1.cpp wires the uPD71051C's txrdy and rxrdy handlers to sound_ready_w(), and calls that from irq_mask_w() as well:
- rtl/io/m1_glue.sv:56 MAME arms each timer for 0x800 * period CPU clocks and timer_r returns the remaining ticks divided by 0x800.
- rtl/io/m1_glue.sv:59 Reloading on expiry is MAME's behaviour too: the callback re-arms from the period rather than stopping.
- rtl/io/m1_glue.sv:79 `snd_ready_ev` pulses where MAME calls update_tx_ready(); `snd_txrdy` is the level it re-reads there.
- rtl/io/m1_glue.sv:85 MAME's irq_callback scans irq_status from bit 0 and returns the FIRST SET BIT, storing it as m_last_irq at that moment — so the vector is computed at acknowledge, not at raise.
- rtl/io/m1_glue.sv:119 IRQ_MASK RESETS TO ALL-MASKED, AS MAME'S machine_reset DOES (`m_irq_mask = 0xff`).
- rtl/io/m1_glue.sv:127 model1.cpp's own comment says the reset value "is not observable"; adding level 3 made it observable.
- rtl/io/m1_glue.sv:141 Placed above the register writes so that an explicit 0x10/0x20 acknowledge arriving in the same cycle still wins: in MAME these are separate calls that can never coincide, and letting the clear lose would strand a level the handler believed
- rtl/io/m1_glue.sv:150 MAME stores the vector inside irq_callback, i.e. when the CPU consumes it.
- rtl/io/m1_glue.sv:162 MAME re-arms on expiry
- rtl/io/m1_glue.sv:200 vf and swa write zero there at init and MAME discards it, so this must not treat the write as a period.
- rtl/io/m1_rom_loader.sv:46 The V60's four sub-regions are the one place the stream is not a plain copy of a MAME region, because `maincpu` is sparse: it spans 19.5 MB of address space holding 5.5 MB of ROM, with the program at 0x200000, the boot vectors at 0xf80000 a
- rtl/io/m1_rom_loader.sv:106 Sizes are Virtua Racing's, from MAME's ROM_START( vr ): epr-14870a.7 is 0x20000, mpr-14873.32 and mpr-14876.4 are 0x200000 each -- 4.125 MB, which is what Model1.sv's memory map was sized for.
- rtl/io/m1_rom_loader.sv:139 NetMerc keeps its gun's alignment there - MAME's default image (ROM_REGION "nvram", netmerc_nvram.bin) is all FF but for bytes 0x38 and 0x40, which are 00, and with FF in them the gun is drawn rolled half over in play.
- rtl/io/m1_drive_inputs.sv:42 model1.cpp declares WHEEL as a full 0x00..0xff paddle centred at 0x80 and both pedals PORT_MINMAX(1,0xff), released at 0x01 (a pedal resting at 0x00 is a car that will not move, docs/io-board.md).
- rtl/io/m1_drive_inputs.sv:102 Idle is 0x01 and full 0xff, MAME's PORT_MINMAX(1,0xff): a pedal resting at 0x00 is a car that will not move, measured in docs/io-board.md.
- rtl/io/m1_speed_report.sv:213 The scroll census said pair 2/3 is always mode 1 - but that was MAME, in attract, over 2,000 frames, and it is twice removed from the question.
- rtl/io/m1_speed_report.sv:221 MAME renders those in a SECOND pass through a stencil; we render one pass and no stencil, so they are drawn like ordinary geometry.
- rtl/io/m1_decode.sv:21 That works for every region except the V60's, because MAME's `maincpu` is not contiguous — measured across all ten dumped games it spans 19.5 MB of address space holding 5.5 MB of ROM:
- rtl/io/m1_decode.sv:59 MAME's bank_w takes the low nibble as a selector and bits 7:4 as the bank; only selector 1, the 0x100000-0x1fffff data ROM window, is used by any dumped game.
- rtl/io/m1_decode.sv:64 MAME maps 0x000000-0x0fffff as .rom() for every Model 1 game, and FOUR OF THE SIX populate it -- by mirroring the boot ROM into it with ROM_RELOAD, not with separate data.
- rtl/io/m1_decode.sv:107 Region compares are written against the same address slices MAME's map uses, so a change there is a one-line change here.
- rtl/io/m1_decode.sv:138 addr[18:1] rather than addr[19:1] is deliberate for mode 1: ROMA is 1 MB and the part behind it is 512 KB, so dropping bit 19 wraps the region onto the ROM twice, which is exactly the pair of ROM_RELOADs MAME declares for swa and swaj.
- rtl/io/m1_decode.sv:146 Above that MAME's region is ERASEFF, so it must read erased rather than running off the end of the packed boot region into the banked data behind it.
- rtl/io/m1_decode.sv:186 MAME discards them; they are decoded here so they cannot read as unmapped.
- rtl/io/m1_decode.sv:204 ---------------------------------------------------------------- CPR Every copro register carries a mirror in MAME's map — .mirror(0x1fffe) on the address register and .mirror(0x1fffc) on the rest — so each one covers a full 128 KB rather t
- rtl/io/m1_decode.sv:226 MAME maps these individually and nothing else in the page: e00000 irq_control_w e00006 timer_mode_w e00002 irq_mask_r/w e00008 timer_period_w (..e0000b)
- rtl/io/m1_decode.sv:232 Found by diffing our write trace against MAME's: the reference has no write to e00002 at pc=fe006c and we did.
- rtl/io/m1_hmd_pose.sv:13 The cabinet is a VR game: a Polhemus tracker on the player's headset supplies six int16 at DPRAM 0x80-0x8b, little-endian, and the V60 reads them as the camera's pose (MAME declares the tracker's i386SX board and does not run it).
- rtl/io/m1_hmd_pose.sv:16 Measured in MAME 0.289 by writing each word during play (docs/findings.md 2026-10-29, "NetMerc's head look"):
- rtl/io/m1_hmd_pose.sv:25 The angles are radians x 8192 (Q3.13): 12868 is pi/2, 25736 is pi, which is MAME's machine_reset seed.
- rtl/io/m1_hmd_pose.sv:38 Ninety degrees of yaw turns the view fully sideways and 45 of pitch looks down onto the player's own platform or up into open sky; both read right in MAME.
- rtl/io/m1_hmd_pose.sv:48 - The game reads all twelve bytes in one ascending block, 0x80 first and 0x8b last, low byte before high (MAME read tap: every second frame, the twelve within ~6 us).
- rtl/io/m1_pad_map.sv:32 The bit order inside each byte is MAME 0.289's INPUT_PORTS (model1.cpp), active low throughout.
- rtl/io/m1_pad_map.sv:33 tb_m1_pad_map checks every named button of every game against the previous fixed layout and against MAME's bit.
- rtl/io/m1_sound_usart.sv:13 Three unrelated things in this repository are called a UART and keeping them apart matters: - this module: the board's i8251-compatible USART, what M4's sound path talks through, mapped at 0xc40000 by model1.cpp:1014; - rtl/io/m1_uart_tx.sv
- rtl/io/m1_sound_usart.sv:22 model1.cpp wires both txrdy_handler and rxrdy_handler to sound_ready_w(), which raises IRQ level 3 whenever the line is ready and level 3 is unmasked.
- rtl/io/m1_sound_usart.sv:24 Virtua Fighter's level 3 vector is 0xfe3f5c and its handler pumps the game's sound queue out through here; the game unmasks level 3 while that queue is non-empty and masks it again once it drains (model1.cpp's irq_mask_w comment).
- rtl/io/m1_sound_usart.sv:80 One byte per word, low lane, as model1.cpp's .umask16(0x00ff) has it.
- rtl/io/m1_sound_usart.sv:91 pulses where MAME calls update_tx_ready()
- rtl/io/m1_sound_usart.sv:108 model1.cpp's irq_init() does write_cts(0), which asserts it permanently, so TxEN alone decides.
- rtl/io/m1_swa_throttle.sv:12 MAME 0.289: PORT_MINMAX(28,200), PORT_REVERSE, default 0x7f.
- rtl/io/m1_swa_throttle.sv:13 Measured in MAME (headless, the field driven from lua, DPRAM read back through the V60's 0xc00004): released, MAME's pedal reads 0xc8 (200) there; driven to 28 it reads 0x1c; nothing else in DPRAM 0x00-0x07 moves.
- rtl/io/m1_swa_throttle.sv:21 At 80 MHz and STEP = 2^19 a count is 6.55 ms, so the whole travel of 172 counts takes 1.13 s. It powers up at 127, the value this core always gave and MAME's port default.
- rtl/io/m1_ioz80.sv:28 With `io2` set this is Wing War's model1io2 instead (model1io2.cpp): the same Z80 core and the same 315-5338A, 93C46 and MSM6253, re-mapped, plus the TMPZ84C015's CTC (m1_ctc, at the end of this file), whose timer interrupt drives that boar
- rtl/io/m1_ioz80.sv:39 315-5338A ports, per model1io.cpp's bindings: PB (1) / PC (2) / PD (3) <- IN0 / IN1 / IN2, or DSW1-3 when the firmware selects SECONDARY controls with PA bit 0.
- rtl/io/m1_ioz80.sv:119 Without one the part powers up erased, as MAME's does with no region and no .nv file.
- rtl/io/m1_ioz80.sv:123 Cabinet inputs, ACTIVE LOW at rest (0xff = nothing pressed), matching model2.cpp's port definitions: IN0 = {VR3,VR2,VR1,START1,SERVICE,TEST, COIN2,COIN1}, IN1 bits 6:4 = gearbox (ACTIVE HIGH), bit 0 = VR4.
- rtl/io/m1_ioz80.sv:261 EPR-16891 does: the TMPZ84C015's on-die CTC, SIO, PIO and watchdog are Z80 I/O ports (MAME tmpz84c015.cpp: CTC 10h-13h, SIO 18h-1Bh, PIO 1Ch-1Fh, watchdog F0h/F1h, daisy-chain priority F4h), decoded on A[7:0].
- rtl/io/m1_ioz80.sv:348 PIO A/B data are DSW2/DSW3 (model1io2.cpp: in_pa/in_pb).
- rtl/io/m1_ioz80.sv:454 No Wing War set carries a 93c45.bin, so MAME's model1io2 powers up erased, and no Wing War MRA sends index 3 -- so the SDRAM block this reads holds whatever the LAST game loaded there (Virtua Racing's "SEGA" image, say).
- rtl/io/m1_ioz80.sv:519 model1io.cpp, io_pa_w: "-------0 control switch (0 = first, 1 = second)" and every input port is muxed on it:
- rtl/io/m1_ioz80.sv:532 No new register: PA writes already land in port_out[0], which is exactly where MAME takes the bit from.
- rtl/io/m1_ioz80.sv:535 The second board moves it to PG bit 6 (model1io2.cpp io_pg_w), and there it switches only the ADC: its DIP banks have their own addresses (DSW1 at 8080h, DSW2/3 on the PIO), so its digital inputs are never multiplexed.
- rtl/io/m1_ioz80.sv:552 The second board's port reads honour the direction register, as MAME's 315_5338a read() does (bit set = input): its firmware read-modify-writes PG (SET 0,(8006h) on every tick) and must get its own latch back.
- rtl/io/m1_ioz80.sv:554 Its inputs are bound PA/PB/PC = IN.0/IN.1/IN.2 (model1io2.cpp io_pa_r..pc_r), where the first board has them on PB/PC/PD.
- rtl/io/m1_ioz80.sv:582 CONSTANT 0x08, which is what MAME's 315_5338a.cpp returns:
- rtl/io/m1_ioz80.sv:650 ------------------------------------------------------------ 93C46 EEPROM The board's own settings store, bit-banged by the firmware through the 315-5338A: PA7 = CLK, PA6 = CS, PA5 = DI, PG7 = DO (model1io.cpp io_pa_w).
- rtl/io/m1_ioz80.sv:686 Reading it one cycle early gave the firmware a stale word and the boot trace parted from MAME at instruction 24,825 - the same identity-block failure the dummy-bit bug produced, from a different cause.
- rtl/io/m1_ioz80.sv:701 The second board drives the part from PF: bit 5 CLK, bit 4 CS, bit 6 DI (model1io2.cpp io_pf_w), and reads DO back at 8040h bit 6.
- rtl/io/m1_ioz80.sv:837 MEASURED ON HARDWARE, against MAME running the same firmware: every analog byte the firmware deposited was its input shifted LEFT BY ONE.
- rtl/io/m1_ioz80.sv:840 DPRAM board MAME fed in
- rtl/io/m1_ioz80.sv:870 "analog port switching is handled by two 74hc4066 analog switches" -- model1io.cpp, and analogN_r picks an_cb[N+4] when secondary is selected.
- rtl/io/m1_ioz80.sv:887 The second board's own registers (model1io2.cpp mem_map): 8040h board: bits 3:0 the four board buttons (released), 4 JP4 and 5 JP3 (both off: the firmware's own entry test at 0000h takes the normal path at 0600h only then), 6 EEPROM DO, 7
- rtl/io/m1_ioz80.sv:918 Measured on MAME's model1io2 (tools census, docs/findings.md 2026-10-29): with no tick the board never answers the V60 at all.
- rtl/io/m1_ioz80.sv:922 What is modelled, from the Z80 CTC's programming model (MAME z80ctc.cpp is the reference): - four channels at port base+0..3, each a control word (bit 0 = 1), a time constant following a control word with bit 2 set, and on channel 0 only a
- rtl/io/m1_ioz80.sv:938 What is not: counter mode and the CLK/TRG trigger inputs (nothing on this board drives them -- MAME's model1io2 binds no CLK/TRG lines, only the ZC/TO outputs into the SIO's baud clocks, which this core does not build), and the ZC/TO output
- rtl/io/m1_ioboard.sv:98 Every control in MAME's model1.cpp is IP_ACTIVE_LOW, and an M10K comes up zeroed — so a core that publishes nothing presents every button as held.
- rtl/io/m1_ioboard.sv:102 0x00-0x0e is the whole control region, confirmed by watching MAME run the real Z80 — see docs/io-board.md:
- rtl/io/m1_ioboard.sv:150 Our HLE never wrote it at all, so a whole-DPRAM diff against MAME showed 0x21 as the one persistent difference in 2048 bytes.
- rtl/io/m1_ioboard.sv:177 Idle is 0xFF for the digital bytes — every control in model1.cpp is IP_ACTIVE_LOW — but NOT for the analog ones, whose released values were measured as 0x80 centre for steering and 0x01 for each pedal.
- rtl/io/m1_ioboard.sv:232 Every byte here was read off MAME running the real Z80 against the real ROM — see docs/io-board.md — rather than reasoned about, because only five of the twenty-three non-zero bytes have a known meaning.
- rtl/tgp/m1_tgp.sv:14 From model1.cpp's machine config and model1_m.cpp's handlers — see docs/m2-tgp-integration.md for the full transcription.
- rtl/tgp/m1_tgp.sv:24 It has FOUR address registers, selected by IO address bits 4:3 — MAME's `.select(0x18)` with `m_copro_ram_adr[offset >> 3]` — and its increment is unconditional, stepping by FOUR when bit 18 of the register is set and by one otherwise.
- rtl/tgp/m1_tgp.sv:348 That direction is the V60 reading results, where acknowledging an empty read returned a stale word and hung the CPU at fed5a4; MAME halts the maincpu there rather than letting it proceed.
- rtl/tgp/m1_tgp.sv:383 sincos, atan, inv and isqrt, read off model1_m.cpp's copro_sincos_r, copro_atan_r, copro_inv_r and copro_isqrt_r.
- rtl/tgp/m1_tgp.sv:448 atan's table is WRONG IN THE ROM and MAME corrects it on the way out, with the note that "the hardware does something equivalent somehow".
- rtl/tgp/m1_tgp.sv:529 MAME does this on both the read and the write handler.
- rtl/tgp/mb86233_agu.sv:13 src/devices/cpu/mb86233/mb86233.cpp (ea_pre_0/1, ea_post_0/1) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_agu.sv:21 MAME's ea_pre_* computes the effective address and ea_post_* updates the index register; both are functions of the same instruction field, so there is no state here.
- rtl/tgp/mb86233_agu.sv:28 MAME's header comment calls it the "automatic 0x200 adder", which reads as if ea_pre_* applies it.
- rtl/tgp/mb86233_agu.sv:29 It does not: ea_pre_* never mentions 0x200, and the adder is applied by individual instruction forms at their call sites — the `mem + 0x200` variants at mb86233.cpp lines 770, 785, 870 and 912, plus write_mem_internal_1's bank flag.
- rtl/tgp/mb86233_agu.sv:59 MAME does it both ways: 1: u16 arithmetic, wraps at 0x10000 (write_mem_internal_1) 0: u32 arithmetic, so 0xffff + 0x200 reaches 0x101ff (the mem + 0x200 instruction forms) Only reachable with an EA already near 0xffff, but the two disagree
- rtl/tgp/mb86233_pkg.sv:11 Portions of this file transcribe constants (opcode numbering, status flag bit positions, exponent/mantissa field accessors) from MAME's MB86233 device model:
- rtl/tgp/mb86233_pkg.sv:15 src/devices/cpu/mb86233/mb86233.cpp SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_pkg.sv:60 Both MAME sources agree they are 0x16 ..
- rtl/tgp/mb86233_pkg.sv:61 0x1b: mb86233.cpp alu_pre cases 0x16-0x1b, and mb86233d.cpp lines 243-248 disassemble the same numbering.
- rtl/tgp/mb86233_pkg.sv:71 SFT is a u8 in MAME and the shift ops evaluate `m_d >> m_sft` directly, which is undefined in C++ for counts above 31.
- rtl/tgp/mb86233_pkg.sv:72 On x86 the host masks to 5 bits, so that is what MAME exhibits in practice and what is modelled here.
- rtl/tgp/mb86233_pkg.sv:103 Ops that write D from the integer path (MAME alu_post_1).
- rtl/tgp/mb86233_pkg.sv:105 Note cxfd/cfxd sit here despite one of them producing a float: MAME dispatches both from alu_post_1, not alu_post_2.
- rtl/tgp/mb86233_pkg.sv:122 Ops dispatched from MAME alu_post_2, every one of which does m_icount--.
- rtl/tgp/mb86233_pkg.sv:132 MAME computes its flags with stset_set_sz_int on the float bit pattern.
- rtl/tgp/mb86233_pkg.sv:152 MAME's alu_pre default plus nop (0x00, 0x12, 0x15, 0x1c-0x1f).
- rtl/tgp/mb86233_regs.sv:13 src/devices/cpu/mb86233/mb86233.cpp (read_reg / write_reg) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_regs.sv:57 read_reg — combinational, as MAME's is
- rtl/tgp/mb86233_regs.sv:129 Sixteen 32-bit registers are flip-flops on the device and come up cleared; MAME's RF space is zero-filled RAM.
- rtl/tgp/mb86233_regs.sv:205 explicit no-op in MAME
- rtl/tgp/mb86233_regs.sv:252 MAME: case 0x0f: break;
- rtl/tgp/mb86233_regs.sv:268 logs in MAME, no state change
- rtl/tgp/mb86233_regs.sv:284 clr0 last: MAME applies it inside the 0x0f case, after alu_pre and before alu_post_1, so it beats anything the transfer path wrote.
- rtl/tgp/mb86233_mem.sv:13 src/mame/sega/model1_m.cpp (copro_data_map) BSD-3-Clause / GPL-2.0 mixed — see THIRD-PARTY.md
- rtl/tgp/mb86233_mem.sv:80 Kept as two separate arrays rather than one 0x000-0x3ff block with a hole: the banks are physically distinct on the die (the 86233 has "two normal independent ram banks, one of 256 dwords and one of 512" per MAME's header) and inferring the
- rtl/tgp/mb86233_mem.sv:129 MAME models this as m_stall plus `goto do_stall`, which re-executes the whole instruction.
- rtl/tgp/fp_div.sv:13 MAME evaluates it as f2u(u2f(m_d) / u2f(m_a)) — plain host division with the default round-to-nearest-even.
- rtl/tgp/m1_copro_if.sv:13 Transcribed from model1.cpp's memory map and model1_m.cpp's handlers; see docs/m2-tgp-integration.md.
- rtl/tgp/m1_copro_if.sv:35 The FIFO status register at 0xdc0000 needs no logic: MAME's fifoin_status_r returns a constant 0xFFFF and m1_main's default read for undecoded space is already exactly that.
- rtl/tgp/m1_copro_if.sv:71 So both FIFO directions stall on empty, which is MAME's effective behaviour in both.
- rtl/tgp/m1_copro_if.sv:79 model1_m.cpp calls `m_copro_fifo_in->setup(16, ...)` and the same for the outbound one.
- rtl/tgp/m1_copro_if.sv:216 MAME does this and the game depends on it: model1_m.cpp:59 ends device_reset with memset(m_copro_ram_data.get(), 0, 0x2000*4).
- rtl/tgp/m1_copro_if.sv:299 MAME halts the CPU outright; stalling the access is the bus-level equivalent and keeps the effect local to this interface.
- rtl/tgp/m1_copro_if.sv:357 The `a1` term is not optional — MAME increments inside `if (offset)` in both handlers, so a low-half access must leave the address alone.
- rtl/tgp/m1_copro_if.sv:365 MAME: latch[0] | (latch[1] << 16)
- rtl/tgp/m1_copro_if.sv:441 model1_m.cpp:29-44 wires both of them symmetrically:
- rtl/tgp/m1_copro_if.sv:466 That is the correct failure: MAME hangs it too, and a hung CPU with a stuck counter is diagnosable, whereas reading rubbish gives a wrong picture and no counter moves at all.
- rtl/tgp/mb86233_dec.sv:13 src/devices/cpu/mb86233/mb86233.cpp (execute_run dispatch) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_dec.sv:25 The encoding exists nowhere but MAME.
- rtl/tgp/mb86233_dec.sv:25 mb86233d.cpp gives the field layout and mb86233.cpp gives the semantics; there is no datasheet with opcode encodings.
- rtl/tgp/mb86233_dec.sv:32 0x0d stm / clm only sub-op 5 (stmh) is implemented in MAME
- rtl/tgp/mb86233_dec.sv:39 MAME has `(opcode >> 21) & 0x1f` in the first two and `(opcode >> 20) & 0x1f` in the third.
- rtl/tgp/mb86233_dec.sv:129 bit 30 is what separates 0x2f from 0x3f, and MAME reads it directly as `opcode & 0x40000000` rather than deriving it from the dispatch value.
- rtl/tgp/mb86233_dec.sv:163 MAME assigns to a u8 either way, so only the low 8 bits survive.
- rtl/tgp/mb86233_alu.sv:13 src/devices/cpu/mb86233/mb86233.cpp (alu_pre / alu_post_1 / alu_post_2) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_alu.sv:64 SFT is a u8 in MAME; only [4:0] are used
- rtl/tgp/mb86233_alu.sv:74 MAME's case 0x0f (rep/clr0/clr1/set) calls alu_pre and alu_post_1 and then STOPS — it never calls alu_post_2 — so an FP op encoded there computes its result and discards it.
- rtl/tgp/mb86233_alu.sv:146 Numerator is D, denominator is A: MAME evaluates f2u(u2f(m_d) / u2f(m_a)).
- rtl/tgp/mb86233_alu.sv:172 MAME's flag model never sets OVD, UND or DVZD from anywhere: alu_pre puts them in the clear-mask and stset_set_sz_* only ever sets ZRD or SGD.
- rtl/tgp/mb86233_alu.sv:226 Round to nearest, ties to even — the host FPU default that MAME's f2u(s32) inherits.
- rtl/tgp/mb86233_alu.sv:243 Modes are MAME's, and mode 0 is C's roundf: half away from zero, NOT the half-to-even the FP units use for their own rounding.
- rtl/tgp/mb86233_alu.sv:307 SFT is a u8 but MAME evaluates `m_d >> m_sft` directly, which is undefined in C++ above 31 and masks to 5 bits on x86.
- rtl/tgp/mb86233_alu.sv:322 MAME keeps LSLD and ASLD as separate cases computing identical expressions, and the RESULT is still identical -- this changes how it is built, not what it produces.
- rtl/tgp/mb86233_alu.sv:324 tb_mb86233_alu's 2,170,388 cases against MAME say so.
- rtl/tgp/mb86233_alu.sv:348 asld and lsld are the same operation on the bit pattern -- MAME keeps them as separate cases computing identical expressions, and now they share the one shifter instead of building two.
- rtl/tgp/mb86233_alu.sv:363 fned leaves +0 alone rather than producing -0: MAME writes `m_d ?
- rtl/tgp/mb86233_alu.sv:497 Gating only the mask still ORs ZRD in — a zeroed r1 reads as "result was zero" — so nop, fml and every undecoded opcode would set ZRD on an instruction MAME leaves ST completely alone for.
- rtl/tgp/mb86233_alu.sv:509 Write-priority arbitration, from MAME's own comment: with two writes to one register in a single instruction, transfers beat integer ops but FP ops beat transfers.
- rtl/tgp/fp_mul.sv:30 MAME evaluates with host floats, which are fully IEEE and honour denormals.
- rtl/tgp/mb86233_core.sv:13 src/devices/cpu/mb86233/mb86233.cpp (execute_run) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_core.sv:25 TIMING IS NOT MAME'S. MAME executes an instruction atomically and charges cycles afterwards; this is a multi-cycle FSM.
- rtl/tgp/mb86233_core.sv:32 MAME models an incomplete external access as `m_stall` plus `goto do_stall`, which resets PC to ppc and re-executes the whole instruction.
- rtl/tgp/mb86233_core.sv:303 MAME keeps m_st as state and updates it exactly once per instruction:
- rtl/tgp/mb86233_core.sv:304 mb86233.cpp:201 m_st = F_ZRC|F_ZRD|F_ZX0|F_ZX1|F_ZX2|F_ZC0|F_ZC1;
- rtl/tgp/mb86233_core.sv:305 mb86233.cpp:499 m_st = (m_st & ~m_alu_stmask) | m_alu_stset; That is what this now is.
- rtl/tgp/mb86233_core.sv:312 Reset value is MAME's, minus the two the sequencer owns:
- rtl/tgp/mb86233_core.sv:376 MAME calls alu_pre(alu) at the TOP of every instruction, before the memory access and before the parallel transfer writes its register.
- rtl/tgp/mb86233_core.sv:431 MAME calls alu_pre and alu_post only from cases 0x00, 0x07 and 0x0f; everywhere else the bits that would be the ALU field are immediate data that merely aliases onto it.
- rtl/tgp/mb86233_core.sv:473 MAME reads A with ea_pre_0(r1) and B with ea_pre_1(r2) - different field, different bank, and ea_post_1(r2) afterwards.
- rtl/tgp/mb86233_core.sv:540 Bit 14 of the instruction's low half selects register over memory, exactly as MAME's `opcode & 0x4000` does.
- rtl/tgp/mb86233_core.sv:546 MAME's ea_pre_0: `switch(r & 0x180) case 0x000: return r & 0x7f`.
- rtl/tgp/mb86233_core.sv:715 `lab` is load A AND B - MAME's case 0x00 ends `m_a = v1; m_b = v2;` - and this state issued the read for v2, waited for it, and never captured it, while lab_a_val was assigned and never read by anything.
- rtl/tgp/mb86233_core.sv:726 MAME calls alu_pre(alu) at the top of the instruction and only then assigns m_a/m_b, so the parallel ALU op of a `lab` sees the OLD operands.
- rtl/tgp/mb86233_core.sv:765 Only sub-op 5 is implemented in MAME; the rest log.
- rtl/tgp/mb86233_core.sv:807 EA = opcode & 0x7f, MAME's ea_pre_0 mode 0.
- rtl/tgp/mb86233_core.sv:864 MAME is `u8 r = opcode & 0x8000 ?
- rtl/tgp/mb86233_core.sv:887 MAME, mb86233.cpp case 1 (brul) and case 3 (bsul): if(opcode & 0x4000) { v = read_reg(opcode); } // register else { ea = ea_pre_0(opcode); v = read_dword(ea); } // memory and read_reg masks its argument to SIX bits (`r &= 0x3f`), so
- rtl/tgp/mb86233_seq.sv:13 src/devices/cpu/mb86233/mb86233.cpp (execute_run, pcs_push/pcs_pop) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_seq.sv:30 MAME's `if(m_r != 1) { m_pc = m_ppc; m_r--; }` sits below the whole instruction switch, so a taken branch inside an active repeat is computed and then discarded.
- rtl/tgp/mb86233_seq.sv:94 That is MAME's behaviour and it is reachable.
- rtl/tgp/mb86233_xfer.sv:13 src/devices/cpu/mb86233/mb86233.cpp (execute_run cases 0x00 and 0x07) SPDX-License-Identifier: BSD-3-Clause Copyright-holders: Olivier Galibert
- rtl/tgp/mb86233_xfer.sv:64 no case in MAME; it logs and does nothing
- rtl/tgp/mb86233_xfer.sv:135 Verbatim from MAME; do not "fix" the inconsistency.
- rtl/video/m1_geo_norm.sv:11 Normalize a vector: glm::normalize, as push_object applies it to the polygon normal before lighting (model1_v.cpp:1013).
- rtl/video/m1_geo_norm.sv:17 Following glm here matters because it is what MAME evaluates: the two differ in the last place, and the last place is the only thing that can differ at all once m1_geo_rsqrt's accuracy is settled.
- rtl/video/m1_geo_norm.sv:26 MAME would divide by zero here and glm would return a vector of NaNs, which then makes the whole lighting term NaN and the luminance zero via fp_to_int's indefinite - so the visible result is a black polygon either way, and passing the vect
- rtl/video/m1_raster3d.sv:32 MAME clips against the four side planes in 3D before projecting; here the fill unit's 2D clamp does the visible work, which is equivalent for the pixels EXCEPT that a vertex beyond +/-32768 wraps in the 16.16 span arithmetic (m1_raster_fill
- rtl/video/m1_raster3d.sv:144 Virtua Racing's beginner course (the hills after the first corners, MAME frames 2760-2800 driven by tools/mame_vr_drive.lua) has bands whose fill runs past the beam on the board's own clock, and the rows above the beam show the 2D for that
- rtl/video/m1_raster3d.sv:170 Display-list command 5 uploads 32-bit model words into it and an object whose poly_adr has bit 23 set is read from it instead of the polygon ROM (model1_v.cpp push_object, `if (poly_adr & 0x800000)`).
- rtl/video/m1_raster3d.sv:213 MAME latches it once per render too (set_current_render_list, model1_v.cpp:1338).
- rtl/video/m1_raster3d.sv:423 NORMALIZED, as MAME stores it
- rtl/video/m1_raster3d.sv:486 Indices 1..6 are xc, yc, x1, y2, x2, y1 - model1_v.cpp:1502-1507.
- rtl/video/m1_raster3d.sv:511 MAME sorts and draws what it has collected at every viewport command (model1_v.cpp tgp_render, case 3 -> draw_objects), so a later viewport paints over an earlier one regardless of depth.
- rtl/video/m1_raster3d.sv:543 tgp_ram's size in words: MAME's make_unique_clear<uint16_t[]>(0x100000-0x40000).
- rtl/video/m1_raster3d.sv:630 The geometry emits 32-bit ones, as MAME's spoint_t does, and they are truncated here - which matches the reference's own overflow: fill_quad shifts s.x left by 16 into an int32, so anything past +/-32768 has already wrapped by the time it i
- rtl/video/m1_raster3d.sv:779 The fill walks every quad against the SCREEN, as MAME's fill_quad does, and emits only the band's rows: clipping to the band is what keeps a quad that spans several bands from writing outside the one being filled.
- rtl/video/m1_raster3d.sv:1386 This is what MAME's pal5bit does - (v << 3) | (v >> 2) - and the same convention m1_geo_color already uses on the way in, so zero-filling here undoes it on the way out.
- rtl/video/m1_raster3d.sv:1534 Starting there is what MAME effectively does - set_current_render_list at the next render - less the wait for vblank, and it also settles the PHASE: a pass finishes before the V60 flips again and starts rewriting the buffer it read, for any
- rtl/video/m1_raster3d.sv:1556 MAME renders the list at the end of the frame in which the game flipped, so the game has the rest of that frame to finish whatever it writes after the flip.
- rtl/video/m1_raster3d.sv:1562 fs_since_flip is cleared by the flip and counts frame pulses after it, so "at least one" is exactly MAME's timing.
- rtl/video/m1_raster3d.sv:1570 Closing the hole would add a frame of display latency to every game: with the frame buffer a pass started at the flip reaches the screen exactly when MAME's would (MAME renders the new list at the next vblank and shows it after that one), a
- rtl/video/m1_raster3d.sv:1576 Star Wars uses the automatic double buffer (listctl bit 2): the hardware flips every second frame whether or not the game has finished, and the game builds the hidden list behind a terminator - 000f at word 0x38 first, the body, then word 0
- rtl/video/m1_raster3d.sv:1580 MAME walks it at the vblank AFTER the flip, about two frames after the build starts; a walk at the flip gives the build one.
- … 161 more
Says it matches, follows or was checked against MAME — 17
- Model1.sv:22 The 2D path is verified against MAME at 380,929 checks, and the boot trace shows the V60 filling every memory it reads from — 168,288 character RAM accesses, 53,673 to tile RAM, 40,960 to the colour translation tables and 8,433 real xBGR-55
- Model1.sv:356 Each idle value is measured rather than assumed — see docs/io-board.md — and they are not the same: steering rests centred at 0x80, while a released pedal reads 0x01, matching MAME's PORT_MINMAX(1,0xff).
- rtl/m1_main.sv:35 Reads of nothing return all ones, matching an unpulled bus and MAME's ERASEFF regions, and writes are discarded — which is what makes a stray pointer a graphical glitch rather than a hang.
- rtl/cpu/v60/v60.sv:46 - 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/v60.sv:2323 The instruction streams matched MAME for 197,250 instructions, then memory diverged — `out.b #40, 10002[R0]` wrote to address 0x000040, the immediate, instead of sending 0x40 to port 0xC10002.
- rtl/cpu/v60/v60.sv:2765 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/v60.sv:4537 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/m1_sound_usart.sv:30 `make v60_trace GAME=vf` proved what that costs: our instruction stream is identical to MAME's for 21,816 instructions and then, one boundary after the game enables interrupts at 0xfe4648, the reference services vblank AND THEN level 3, whi
- rtl/tgp/mb86233_pkg.sv:23 Ground truth: MAME src/devices/cpu/mb86233/mb86233.cpp (Olivier Galibert).
- rtl/tgp/mb86233_pkg.sv:203 Kept verbatim only so the transcription matches MAME line for line.
- rtl/tgp/mb86233_regs.sv:278 The AGU's post-increment likewise beats a same-cycle write_reg to the index register, matching MAME's ordering: ea_post_* runs after the transfer that used the address.
- rtl/tgp/fp_mul.sv:34 Default matches MAME.
- rtl/video/m1_geo_xform.sv:35 WHY IT IS BIT-EXACT AGAINST MAME AND NOT MERELY CLOSE
- rtl/video/m1_geo_xform.sv:37 MAME evaluates the geometry in host `float`, and fp_mul and fp_add are fuzzed against host float directly (sim/tgp/tb_fp_mul.cpp: "reference is the host C float, matching MAME's evaluation model").
- README.md:42 The OSD's *Star Wars music volume* chooses how the board's volume writes are read; *Firmware* is the default, *MAME* matches MAME.
- README.md:250 Its music board (DSBZ80, MPEG) is built on `swa-sound` and benched bit-exact against MAME; not yet on hardware.
- README.md:417 The hardware behaviour is verified throughout against **MAME**, whose Model 1 driver and MB86233 coprocessor model are the reference every block here is checked
Says it was translated, ported or taken from MAME — 13
Keeps a MAME approximation — 2
- Model1.sv:234 Bit order is MAME's INPUT_PORTS( vr ), not a guess: IN.0 0 coin1, 1 coin2, 2 test, 3 service, 4 start, 5 VR1, 6 VR2, 7 VR3 IN.1 0 VR4, 4 shift down, 5 shift up Inverted because every control on this hardware is active low.
- Model1.sv:882 THE ROOM CAME FROM TWO OVER-ALLOCATIONS, both measured against MAME rather than assumed:
Shares text with the MAME driver without saying so — 50
- rtl/io/m1_glue.sv:42 if ((txrdy_r() || rxrdy_r()) && !BIT(m_irq_mask, 3)) irq_raise(3); — shares text with sega/model1.cpp:870
- rtl/io/m1_glue.sv:47 the USART; the game unmasks level 3 while that queue is non-empty and masks — shares text with sega/model1.cpp:846
- rtl/io/m1_glue.sv:128 comment says the reset value "is not observable"; adding level 3 made — shares text with sega/model1.cpp:841
- rtl/io/m1_sound_usart.sv:26 here; the game unmasks level 3 while that queue is non-empty and masks it — shares text with sega/model1.cpp:846
- rtl/io/m1_sound_usart.sv:45 a 31.25 kbit/s line, the standard Sega/MIDI sound data rate. A 10-bit — shares text with sega/dsbz80.cpp:57
- rtl/tgp/m1_tgp.sv:25 `.select(0x18)` with `m_copro_ram_adr[offset >> 3]` — and its increment is — shares text with sega/model1_m.cpp:154
- rtl/tgp/m1_tgp.sv:449 the note that "the hardware does something equivalent somehow". Reproduced — shares text with sega/model1_m.cpp:246
- rtl/tgp/m1_copro_if.sv:79 model1_m.cpp calls `m_copro_fifo_in->setup(16, ...)` and the same for the — shares text with sega/model1_m.cpp:29
- rtl/tgp/m1_copro_if.sv:217 device_reset with memset(m_copro_ram_data.get(), 0, 0x2000*4). The V60 spins — shares text with sega/model1_m.cpp:59
- rtl/tgp/m1_copro_if.sv:462 returns the low half, offset 1 returns `m_v60_copro_fifo_r >> 16` — shares text with sega/model1_m.cpp:107
- rtl/video/m1_raster3d.sv:543 tgp_ram's size in words: MAME's make_unique_clear<uint16_t[]>(0x100000-0x40000). — shares text with sega/model1_v.cpp:1727
- rtl/video/m1_raster3d.sv:1789 words. MAME indexes m_tgp_ram[adr - 0x40000 + i], so the base is — shares text with sega/model1_v.cpp:1521
- rtl/video/m1_raster3d.sv:1829 m_poly_ram[adr - 0x800000 + i] = readi(...), 32-bit words. Bounded the — shares text with sega/model1_v.cpp:1532
- rtl/video/m1_geo_xform.sv:26 p->x = ayyc * xx - ayys * zz; — shares text with sega/model1_v.cpp:44
- rtl/video/m1_geo_xform.sv:27 p->z = ayys * xx + ayyc * zz; — shares text with sega/model1_v.cpp:45
- rtl/video/m1_tile_mixer.sv:55 test is `*srct == tpri || flags & TILEMAP_DRAW_OPAQUE`: under OPAQUE every — shares text with sega/segaic24.cpp:146
- rtl/video/m1_geo_walk.sv:322 MAME indexes `m_tgp_ram[tex_adr - 0x40000]`, so the BASE IS SUBTRACTED here. — shares text with sega/model1_v.cpp:1049
- rtl/video/m1_geo_walk.sv:697 `type = flags & 3; if (!type) break;` - and the size limit. — shares text with sega/model1_v.cpp:942
- rtl/video/m1_geo_planes.sv:14 a_left = ( x1 - xc - viewx) / zoomx — shares text with sega/model1_v.cpp:629
- rtl/video/m1_geo_planes.sv:15 a_right = ( x2 - xc - viewx) / zoomx — shares text with sega/model1_v.cpp:630
- rtl/video/m1_geo_planes.sv:16 a_bottom = (-y1 + yc - viewy) / zoomy — shares text with sega/model1_v.cpp:631
- rtl/video/m1_geo_planes.sv:17 a_top = (-y2 + yc - viewy) / zoomy — shares text with sega/model1_v.cpp:632
- rtl/video/m1_palette.sv:16 if (!BIT(v, 15)) { r >>= 1; g >>= 1; b >>= 1; } — shares text with sega/model1_v.cpp:1383
- rtl/video/m1_palette.sv:23 "Bit 15 is an intensity/shade bit, not unused as the plain xBGR_555 decode — shares text with sega/model1_v.cpp:1379
- rtl/video/m1_palette.sv:24 assumes. Almost every entry has it set (full brightness); a handful clear — shares text with sega/model1_v.cpp:1380
- rtl/video/m1_palette.sv:25 it to render dimmed (e.g. Star Wars Arcade's grey menu backdrop pen — shares text with sega/model1_v.cpp:1381
- rtl/video/m1_palette.sv:26 0x7777). Halve the channels when it is clear so those pens stop reading — shares text with sega/model1_v.cpp:1381
- rtl/video/m1_palette.sv:30 is invisible in almost all content — "almost every entry has it set" — so a — shares text with sega/model1_v.cpp:1380
- rtl/video/m1_raster_fill.sv:52 * MAME guards the span with `xx1 <= view->x2 || xx2 >= view->x1`, where && was — shares text with sega/model1_v.cpp:167
- rtl/video/m1_video.sv:46 hscr = tile_ram[0x5000 + (layer >> 1)] — shares text with sega/segaic24.cpp:342
- rtl/video/m1_video.sv:47 vscr = tile_ram[0x5004 + (layer >> 1)] — shares text with sega/segaic24.cpp:343
- rtl/video/m1_video.sv:336 uint16_t hscr = tile_ram[0x5000+(layer >> 1)]; — shares text with sega/segaic24.cpp:342
- rtl/video/m1_video.sv:337 uint16_t vscr = tile_ram[0x5004+(layer >> 1)]; — shares text with sega/segaic24.cpp:343
- rtl/video/m1_video.sv:338 uint16_t ctrl = tile_ram[0x5004+((layer >> 1) & 2)]; — shares text with sega/segaic24.cpp:344
- rtl/video/m1_video.sv:698 MAME reads tile_ram[0x5004 + ((layer >> 1) & 2)], which for our — shares text with sega/segaic24.cpp:344
- rtl/video/fp_to_int.sv:20 draw_wireframe_line says so outright: "a degenerate projection yields inf/NaN, — shares text with sega/model1_v.cpp:223
- rtl/video/fp_to_int.sv:21 which float->int conversion turns into INT32_MIN on x86 hosts", and it clips — shares text with sega/model1_v.cpp:223
- rtl/video/m1_geo_clip.sv:38 a_left = ( x1 - xc - viewx) / zoomx p.x < p.z * a_left — shares text with sega/model1_v.cpp:629
- rtl/video/m1_geo_clip.sv:39 a_right = ( x2 - xc - viewx) / zoomx p.x > p.z * a_right — shares text with sega/model1_v.cpp:630
- rtl/video/m1_geo_clip.sv:40 a_bottom = (-y1 + yc - viewy) / zoomy p.y > p.z * a_bottom — shares text with sega/model1_v.cpp:631
- rtl/video/m1_geo_clip.sv:41 a_top = (-y2 + yc - viewy) / zoomy p.y < p.z * a_top — shares text with sega/model1_v.cpp:632
- rtl/video/m1_geo_det.sv:15 det = p1.x*(y1*z2 - y2*z1) + p1.y*(z1*x2 - z2*x1) + p1.z*(x1*y2 - x2*y1); — shares text with sega/model1_v.cpp:76
- rtl/video/m1_tile_decode.sv:15 segaic24.cpp says why: "The tilemap chip has been reused for model1 and — shares text with sega/segaic24.cpp:12
- rtl/video/m1_tile_decode.sv:16 model2, probably because they had it handy and it handles medium res." So — shares text with sega/segaic24.cpp:12
- rtl/video/m1_tile_decode.sv:30 8, 8, SYS24_TILES, 4, {0,1,2,3}, {STEP8(0,4)}, {STEP8(0,32)}, 8*32 — shares text with sega/segaic24.cpp:43
- rtl/video/m1_tile_decode.sv:39 set_gfx(..., (uint8_t *)char_ram.get(), NATIVE_ENDIAN_VALUE_LE_BE(8,0), ...) — shares text with sega/segaic24.cpp:100
- rtl/video/m1_tile_decode.sv:111 MAME: tileinfo.set(gfx, val & tile_mask, (val >> 7) & 0xff, 0); — shares text with sega/segaic24.cpp:55
- rtl/video/m1_video_timing.sv:13 m_screen->set_raw(XTAL(16'000'000), 656, 0, 496, 424, 0, 384); — shares text with sega/model1.cpp:1834
- rtl/video/m1_listctl.sv:33 m_listctl[0] = (m_listctl[0] & ~0x40) | (m_listctl[0] & 8 ? 0x40 : 0); — shares text with sega/model1_v.cpp:1341
- rtl/video/m1_listctl.sv:36 if((m_listctl[0] & 4) && (m_screen->frame_number() & 1)) — shares text with sega/model1_v.cpp:1340