← コア一覧
Model2 (retrorepair)
MAMEのドライバにない実基板の資料を引用 — 4
- Model2.sv:4846 Simulation at 30M instructions reaches 399 matrix writes, 553 objects and 3,038 polygons; the board sits at 2 focal writes and nothing else, unchanged across 382 records in 60 seconds.
- rtl/io/m2_cpu_bridge.sv:776 R264: texture sheet 0, and its mirror at +0x200000.
- rtl/io/m2_cpu_bridge.sv:783 Taking it as part of the index put every mirrored write half a megaword past the base: sheet 0's mirror landed on sheet 1, and sheet 1's mirror landed on the LUMA TABLE.
- rtl/io/m2_rom_loader.sv:41 Sized from MEASURED ROM extents across all ten dumped Model 1 games, not from MAME's ROM_REGION declarations.
MAMEのドライバにもある実基板の情報・測定値を引用 — 1
「実機」で確認したと記載 — 1
- rtl/io/m2_cpu_bridge.sv:886 Measured: the CPU issues a byte store (data 0x27272727, be=0001 -- correct i960 behaviour, it replicates the byte and relies on the enables), the bridge forwards be=01 (verified on hardware), and every lane still lands.
MAMEとの相違点を記載 — 2
- rtl/cpu/i960/i960_icache.sv:16 MAME does not model an instruction cache at all: its `m_cache` is an address space accessor, and the IAC that would invalidate the real cache — 0x89, "invalidate internal instruction cache" — is logged rather than executed.
- rtl/tgp/m2_tgp.sv:370 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.
MAMEのソースを引用 — 452
- Model2.sv:204 model2.cpp's screen_vblank walks the list only on even frames when the game is in 30 Hz mode -- "if 60 Hz mode or frame number is even" -- and this core has always walked every vblank.
- Model2.sv:227 1 is MAME's sharpness; 2, 4 and 8 draw faster (a heavy list draws in ~5.2, 3.1, 1.9 video frames at 1, 2, 4 -- a list comes every ~2.1) and the 3D updates at whichever is slower, the game or the draw.
- Model2.sv:257 MAME's is entry zero, the reference; Mild lifts the darks; Off is the colour table's raw values.
- Model2.sv:259 Menu 0 Off, 1 MAME, 2 Mild, mapped below to the palette's encoding (0 MAME, 1 mild, 2/3 off).
- Model2.sv:261 R790: MAME first now -- Ben's default.
- Model2.sv:261 Menu 0 MAME, 1 Off, 2 Mild.
- Model2.sv:428 MAME declares Model 2's pixel clock as `32_MHz_XTAL/2`, so this is the reference rate and not an approximation of it.
- Model2.sv:655 TEXTURES ARE NOT CONTIGUOUS WITH MAME'S REGION, and the texture unit will need to know.
- Model2.sv:656 model2.cpp's "textures" is 16 MB with mpr-16522/16521 at 0x000000 and mpr-16517/16516 at 0x800000 -- a 4 MB hole in the middle.
- Model2.sv:657 The MRA streams both pairs back to back with no gap, so an address computed against MAME's layout is 4 MB out for everything above the hole.
- Model2.sv:670 R725: DAYTONA '94 (MAME `daytona`, Revision A) HAS 16 MB OF POLYGON ROM, '93 13 -- its ic19/ic23 pair is 4 MB to '93's 1.
- Model2.sv:723 R639: menu 0 Off -> 2, 1 MAME -> 0, 2 Mild -> 1, 3 (unused) -> off.
- Model2.sv:724 R790: menu 0 MAME -> 0, 1 Off -> 2, 2 Mild -> 1, 3 (unused) -> off.
- Model2.sv:1127 pcm1 is the first 4 MB and pcm2 the second, which is not the MRA's ordering taken on trust: MAME's own region contents were read back and matched against the files, and pcm1 is mpr-16491+16492 while pcm2 is mpr-16493+16494.
- Model2.sv:1396 On the board a Double Buffered menu walks and draws in alternate vblanks and the game flips every second one, though its frame is ~1 ms of CPU in MAME; the CPU's SDRAM wait was measured 86% behind texels (R606), and round-robin behind four
- Model2.sv:1673 model2.cpp: "initialize bufferram to a sane default", m_bufferram[i] = 0x07800f0f.
- Model2.sv:1800 MAME's raster_state is value-initialised, so those headers read ZERO there: renderer 0, flat and opaque, colour base 0, and they are drawn.
- Model2.sv:1838 No CPU exists in this slice, so nothing writes the tilemap; the contents come from a state captured out of MAME at a known frame (docs/rom-layout.md) and streamed in as ROM:
- Model2.sv:1892 MAME's polygon_ram0/1 are 0x8000 DWORDS each -- 128 KB apiece, 256 KB together, which is 205 M10K blocks of the 553 on this part.
- Model2.sv:2150 MAME's base offsets are 0x0080>>1, 0x4080>>1 and 0x8080>>1 in words.
- Model2.sv:2539 Transcribed from model2.cpp; each of these was found by logging the address a poll loop was reading, not by reasoning about it.
- Model2.sv:2549 V-blank into bit 0, the same line MAME's screen_vblank sets.
- Model2.sv:2596 model2.cpp raises it from sound_ready_w whenever TXRDY or RXRDY changes and either is then active, and again from irq_mask_delayed_update when the mask itself is written.
- Model2.sv:2628 Byte-wide at bytes 0 and 2 of the dword -- model2.cpp maps it .umask16(0x00ff) -- so it is the same shape as the I/O board's DPRAM: data in byte 0, status/command in byte 2, and the byte enables say which one an access names.
- Model2.sv:2654 MAME writes this port 59 times over 900 frames -- 11 control, 48 data, first data byte at frame 13 -- and never reads it back, so the board has a number to be wrong against.
- Model2.sv:2914 The DPRAM is EIGHT BITS WIDE at bytes 0 and 2 of each dword -- model2.cpp maps it .umask32(0x00ff00ff) -- so both live in the same 32-bit word and the value is 0x00400000.
- Model2.sv:2919 A 4 KB capture of MAME's DPRAM was tried first and gets no further: it produced the same boot and WORSE settings values, because a recording answers questions from a moment that is not this one.
- Model2.sv:2938 // if 60 Hz mode or frame number is even, trigger geometrizer to start new frame if ((m_videocontrol & 1) == 0 || (m_framenum & 1) == 0) geo_parse(); -- model2.cpp, screen_vblank
- Model2.sv:2961 This gated the walk start and the renderer's swap to even frames when videocontrol bit 0 was set -- MAME's screen_vblank rule for when geo_parse runs.
- Model2.sv:3009 NOT the current boot blocker, and that is measured rather than assumed -- MAME's boot trace references this region once, at 0x980000, and never reads the ID.
- Model2.sv:3014 R765: MAME's videoctl_r exactly -- the frame bit ALWAYS in bit 2, frame bit 0 in 60 Hz render mode and bit 1 in 30 Hz.
- Model2.sv:3015 This was keyed on videocontrol bit 0 and put frame bit 1 in bit 3 when it was clear; Daytona writes videocontrol 0 and render mode 1, reads bit 2 once a frame (0x17cb8) to pick the list buffer -- and so always got 0: single-buffered at dwor
- Model2.sv:3039 Three regions, from model2.cpp's map.
- Model2.sv:3061 That was WRONG, and it was wrong because of a bad measurement: MAME's TGP program space is WORD-addressed, so it must be read as `read_u32(word)`, and it had been read as `read_u32(word*4)`.
- Model2.sv:3065 Read correctly, MAME's program is 2024 non-zero words and satisfies program[i] == write[i].
- Model2.sv:3068 The command code is the address: MAME takes (offset >> 2) & 0xff of a dword offset, which is bits 11:4 of the byte address.
- Model2.sv:3107 The game starts a step only after a vblank IRQ that comes after its last step's flip (0x138c waits for the IRQ's count to change, MAME debugger, Rev A), and that IRQ writes the scroll for the list two before the new step: so the words writt
- Model2.sv:3136 Dumped MAME's buffer RAM at the same frame and compared it word for word with ours.
- Model2.sv:3139 dword MAME ours
- Model2.sv:3147 geo_w (model2.cpp) reconstructs the command word from the WRITE ADDRESS:
- Model2.sv:3359 MAME's polygon_rom_mask is not a power of two either.
- Model2.sv:3477 MIPZ_B: a polygon is drawn at level 0 when MAME's own level (the game's texlod) is at most -MIPZ_B over all of it.
- Model2.sv:3520 MAME builds them from the rasterizer's viewport and centre (model2_v.cpp:882); for a 496x384 screen centred at (248,192) they come out as -248, +248, +192, -192.
- Model2.sv:3524 The walker reads geo_window_data and m2_geo_view turns its viewport and centre into these, as MAME does; the CRTC offsets (0, 128 on Daytona, logged from MAME) are its parameters.
- Model2.sv:3650 MAME: 6, 7, 8, 9, 0x14.
- Model2.sv:3955 Driven combinationally, hps_io's ioctl_upload fed the debug-port address mux whose data fed ioctl_din straight back into hps_io, and Quartus 17.0's fitter timing engine CRASHED on the apparent cycle -- Internal Error, sta_scc.cpp:1041, repr
- Model2.sv:4054 MAME's rest positions
- Model2.sv:4083 an_callback<0..2> are STEER/ACCEL/BRAKE; <3> is never bound for this game and an unbound devcb_read8 reads 0xFF, which is what MAME's firmware deposits at DPRAM 0x03.
- Model2.sv:4094 The buttons are mapped, the firmware path is proven in simulation (R65: in0=FB puts FB in DPRAM byte 0x08, byte for byte what MAME's machine does), and the board still does nothing.
- Model2.sv:4227 The i960 core implements exactly the opcode set the REFERENCE implements; anything MAME reaches fatalerror on is trapped LOUDLY rather than implemented blind, so "a game that needs more announces itself instead of drifting" (docs/p1-i960-sp
- Model2.sv:4324 The block capture did its job: the firmware sweeps 0x100-0x17f with 7F/FF, 384 times a minute, where MAME's firmware writes it ONCE (frame 10, "SEGA...") and never touches it again.
- Model2.sv:4327 MAME puts it at DPRAM 0x00-0x0d and the bytes are known exactly:
- Model2.sv:4442 MAME's game reads real settings there; if the board reads something else, that difference is the thing being rejected, and it names itself.
- Model2.sv:4608 MAME holds 1,274 distinct values there; the board held SIX, which was the flat screen.
- Model2.sv:4617 MAME emits exactly 59 bytes to this port over 900 frames of attract mode, so the board either sends that stream or it does not -- and that is checkable before a single sound chip exists.
- Model2.sv:4653 Reading ipring_q into the streamer made quartus_fit die with "Internal Error: TDB, tdb_node.cpp:2080" on TWO consecutive seeds -- 19 and 31 -- where the same design without it built fine.
- Model2.sv:4669 The previous build measured THREE io reads in 45 s where MAME's TGP hammers its math units, which says the coprocessor is executing something, but not the geometry code.
- Model2.sv:4839 MAME has exactly two writers of geo->matrix, geo_matrix_write (0x0b, twelve words) and geo_translate_write (0x0c, matrix[9..11]), and this core implements both.
- Model2.sv:5133 MAME's real machine holds 00 03 03 00 at window offsets 0x114-0x117 and holds it stable for hundreds of frames; our board fills the window with the 7F FF RAM-test pattern.
- Model2.sv:5194 DOES OUR i960 RESPOND TO THE COIN THE WAY MAME'S DOES?
- Model2.sv:5202 MAME's i960 answers a coin by starting a repeated write to 0x01c0001c byte 2 -- dword 7, the high lane -- which does NOT happen before the coin.
- Model2.sv:5208 The second would be coinage: MAME on a fresh nvram wants THREE coins, and shows "CREDIT 0/3" climbing to "CREDITS 2/3" as they go in.
- Model2.sv:5588 XOR and SUM over the values written, plus the smallest and largest seen, are four numbers MAME can be asked for exactly.
- Model2.sv:5592 Folding the WRITES was not decisive: the board's range 0x0020..0x8020 contains MAME's 0x3000..0x3d8d, so spaces written while clearing widen it without saying what the final content is.
- Model2.sv:5599 MAME's map2 holds 1,274 distinct values between 0x3000 and 0x3d8d; if this comes back as a handful of values, that is the flat screen and it is a data fault, not a rendering one.
- Model2.sv:5605 MAME holds count=0x13, base=0x00505100, size=0x300 and leaves after nineteen passes.
- Model2.sv:6151 The frame simulation that reproduces MAME's picture ends with layer 0 holding 0x310 and layers 1-3 at zero, so that is what a working board must show.
- Model2.sv:6372 poly_tex[11] is texheader[0] bit 15, MAME's `checker` (model2_v.cpp): the polygon paints every other pixel on a (x ^ y) grid -- how Model 2 draws the car's shadow and the minimap panel.
- Model2.sv:6443 Tile overruns: 0 on 114 MAME frames at the board's latency (was 8 a frame).
- Model2.sv:6512 Those are MAME's set_raw numbers (docs and sim/video/tb_m2_video_timing.cpp assert the same two).
- Model2.sv:6519 They existed to prove m2_video_timing produced MAME's 424 lines and 496 visible pixels, they proved it on hardware, and sim/video/tb_m2_video_timing.cpp asserts both every run.
- rtl/cpu/i960/i960_alu.sv:35 MAME computes carry as:
- rtl/cpu/i960/i960_alu.sv:44 MAME's addc and subc never set carry at all.
- rtl/cpu/i960/i960_alu.sv:58 The reference model carries a switch to reproduce MAME's result so lockstep can still run; see i960_alu_ref.h. Design study §2 and R7 record this.
- rtl/cpu/i960/i960_alu.sv:70 MAME t1
- rtl/cpu/i960/i960_alu.sv:71 MAME t2
- rtl/cpu/i960/i960_dec.sv:32 Per docs/p1-i960-spike.md §1 that is deliberate: anything MAME reaches fatalerror on is unreachable in practice, so it is trapped loudly rather than implemented blind.
- rtl/cpu/i960/i960_dec.sv:87 Format ranges follow i960dis.cpp's mnemonic table, where the format column is 1=CTRL, 2=COBR, 3=MEM, 4=REG:
- rtl/cpu/i960/i960_dec.sv:101 From i960.cpp:
- rtl/cpu/i960/i960_dec.sv:163 MAME: get_disp = sext(opcode, 24) - 4 get_disp_s = sext(opcode, 13) - 4
- rtl/cpu/i960/i960_fpmisc.sv:237 MAME casts r2_a double to int32_t, which is undefined in C++ and yields x86's indefinite value; the i960 manual instead specifies the truncated low 32 bits when the integer-overflow fault is masked.
- rtl/cpu/i960/i960_fptrans.sv:17 MAME computes them with the host's libm; the programs (tools/i960_fptrans.py, which also generates i960_fptrans_rom.svh and is this module's reference) work in double-double and round once, so the result is the correctly rounded value -- wh
- rtl/cpu/i960/i960_memmap.sv:11 Region table from MAME's model2.cpp — model2_base_mem, model2_tgp_mem and model2a_crx_mem (BSD-3-Clause).
- rtl/cpu/i960/i960_regs.sv:30 It is wrong here, and the reason is easy to miss: MAME copies the locals into the cache and **does not clear them**, so the callee's frame starts life holding the caller's register values.
- rtl/cpu/i960/i960_regs.sv:102 MAME dispatches: 0 is an ordinary return, 7 is an interrupt return that also restores PC and AC from the frame, and 1 to 6 are fatalerror.
- rtl/cpu/i960/i960_regs.sv:108 TYPE 7 IS NOT AN ERROR: it is the interrupt return, and MAME performs a full do_ret_0 for it and then restores PC and AC from the frame.
- rtl/cpu/i960/i960_regs.sv:137 i960.cpp's device_reset:
- rtl/cpu/i960/i960_regs.sv:199 Depth counter, exactly MAME's m_rcache_pos.
- rtl/cpu/i960/i960_regs.sv:223 It was removed as dead logic that also changed semantics in a case with no oracle -- an overlapping movl/movt/movq (`movl r4, r5`), where T_MULTI writes word i while reading word i+1, and which MAME implements with memcpy on overlapping reg
- rtl/cpu/i960/i960_top.sv:45 Desert Tank runs them from the title's end (MAME: first movrl at frame 1105, 19.23 s) and this core trapped on every one, halting the i960.
- rtl/cpu/i960/i960_top.sv:49 R839: THE FORMS VIRTUA COP RUNS AND DAYTONA NEVER DID -- sqrtrl (0x69.8), cpysre (0x6e.2) and cvtzril (0x6c.3), MAME's semantics.
- rtl/cpu/i960/i960_top.sv:69 Sega and Namco both wired the i960 in "normal" mode only, which is the subset MAME implements and the only one modelled here.
- rtl/cpu/i960/i960_top.sv:130 ARCHITECTURAL STATE THE INTERRUPT PATH CONSUMES, with MAME's reset values (i960.cpp device_reset).
- rtl/cpu/i960/i960_top.sv:161 WHEN an interrupt is taken is the one place this does not follow MAME literally.
- rtl/cpu/i960/i960_top.sv:162 MAME calls check_immediate_irqs() once per execute_run(), a scheduler timeslice boundary, which is an emulator artifact; silicon takes it at the next instruction boundary and so does this.
- rtl/cpu/i960/i960_top.sv:170 the single immediate slot MAME models
- rtl/cpu/i960/i960_top.sv:189 Only the message TYPE of the first IAC word is kept -- the low 24 bits are never read by any message MAME implements.
- rtl/cpu/i960/i960_top.sv:221 MAME's order is whatever the driving machine calls execute_set_input in; a fixed order is needed for lockstep, and the reference uses the same one.
- rtl/cpu/i960/i960_top.sv:257 MAME walks 31 down to 0 and takes the first hit, so this is a find-highest-set over the eligible mask.
- rtl/cpu/i960/i960_top.sv:575 R836: A LONG-REAL REGISTER OPERAND IS THE EVEN-ALIGNED PAIR read as one double (MAME get_1_rifl / get_2_rifl: m_r[n & 0x1e] low, m_r[(n & 0x1e)+1] high).
- rtl/cpu/i960/i960_top.sv:725 R839: get_1_rifl -> sqrt -> set_rifl; cpysre: |src1| with src2's "sign" as MAME tests it (src2 >= 0.0, so -0.0 counts as positive and a NaN as negative); cvtzril: get_1_rif (the single-form operand) -> (int64_t) -> set_ri64, the unmasked pa
- rtl/cpu/i960/i960_top.sv:785 MAME: t2f >= 0.0 ?
- rtl/cpu/i960/i960_top.sv:919 The i960 reads its startup state from low memory before it executes anything (MAME i960.cpp device_reset):
- rtl/cpu/i960/i960_top.sv:1306 m_r[I960_FP] = m_program.read_dword(m_PRCB+24); i960.cpp
- rtl/cpu/i960/i960_top.sv:1379 Vector 0 means the line is in IAC mode, which MAME logs and declines to handle.
- rtl/cpu/i960/i960_top.sv:1449 A two-word instruction used the cache port for its displacement, so the word after it was never prefetched and every one paid T_FETCH + two cycles of T_FETCH_W for the next instruction even on a hit -- 11-16% of the game's instructions are
- rtl/cpu/i960/i960_top.sv:1570 That is the only way ICR is ever written, and ICR supplies the vector byte for each external IRQ line -- so interrupts are unreachable without it (MAME i960.cpp 0x60.0).
- rtl/cpu/i960/i960_top.sv:1596 MAME fatalerrors on every other 0x60 sub-opcode.
- rtl/cpu/i960/i960_top.sv:1634 i960_regs has always done the work (MAME's: clamp the depth to the cache, write every cached frame out, depth 0); only the dispatch was missing.
- rtl/cpu/i960/i960_top.sv:1676 The link register takes ip_next, because MAME's m_IP is already past the instruction when execute_op runs.
- rtl/cpu/i960/i960_top.sv:1755 Exact while |x| < 2^31: Virtua Cop's results measured -57,796..39,835 (MAME, 300 s with a game).
- rtl/cpu/i960/i960_top.sv:1830 Giving up the priority this interrupt ran at can release a queued one, so MAME checks here.
- rtl/cpu/i960/i960_top.sv:1899 Generate IRQ, invalidate I-cache, breakpoints, stop, continue: MAME logs and ignores each one.
- rtl/cpu/i960/i960_top.sv:1948 Only a priority that went DOWN can release a queued interrupt, and MAME checks on exactly that condition rather than on any change.
- rtl/cpu/i960/i960_top.sv:1997 MAME does not guard vector < 8, and the wrap is reproduced rather than corrected: vectors below 8 are reserved on the part, so the address it forms is undefined either way and inventing a guard here would make this disagree with the oracle
- rtl/cpu/i960/i960_top.sv:2017 The +64 is MAME's padding against a save underflow and is not optional -- the three writes below land under FP.
- rtl/cpu/i960/i960_top.sv:2051 MAME clears 0x1f00 -- bits 8 to 12 -- and then ORs the new level into bits 16 to 20 WITHOUT clearing them first.
- rtl/cpu/i960/i960_top.sv:2127 MAME logs, clears the level and gives up rather than taking anything; reproduced, because a generator can build this state.
- rtl/io/m2_backup.sv:27 DEFAULT_ALL_1 above, and it is the one region MAME fills with 0xFF rather than zero -- it is also the region whose contents the boot signature-checks before deciding whether to initialise it, so 0x00 versus 0xFF is a branch and not a detail
- rtl/io/m2_cab_inputs.sv:44 model2.cpp's `daytona` port map, which is `model2` plus `gears` with IN0 and IN1 modified.
- rtl/io/m2_cab_inputs.sv:56 MAME's own limits are PORT_MINMAX(0x20, 0xe0) on all three.
- rtl/io/m2_cab_inputs.sv:62 The cabinet has a five-position shifter and MAME models it as five buttons feeding daytona_gearbox_r, which returns gearvalue[] = {0, 2, 1, 6, 5} for N,1,2,3,4 -- deliberately NOT a binary count, because the real shifter is a set of microsw
- rtl/io/m2_cab_inputs.sv:92 R835: DESERT TANK'S IN1 -- model2.cpp INPUT_PORTS_START(desert): 0x01 Shift (PORT_TOGGLE), 0x10 Machine Gun, 0x20 Cannon, the rest unused; all active low.
- rtl/io/m2_cab_inputs.sv:98 SHIFT IS A LEVER, NOT A BUTTON: the cabinet's forward / reverse switch latches, and MAME models it as a toggle.
- rtl/io/m2_cab_inputs.sv:99 Out of reset it reads 1 (released), MAME's default -- forward.
- rtl/io/m2_cab_inputs.sv:103 With bit 0 low for reverse (R837, read off MAME's input test) Ben's Forward drove the tank backwards and Reverse forwards on s1107, so bit 0 is HIGH in reverse.
- rtl/io/m2_cab_inputs.sv:113 MAME's range is 0x20..0xe0, so +-96 about 0x80.
- rtl/io/m2_cab_inputs.sv:238 THE RANGE IS MODEL 2'S, NOT MODEL 1'S. This board's ADC idles at 0x20 and tops at 0xe0 -- MAME's PORT_MINMAX(0x20,0xe0) on all three channels -- where Model 1 runs 0x01..0xff.
- rtl/io/m2_cab_inputs.sv:251 MAME gives its pedals 0x00..0xff and its wheel 0x00..0xff (no PORT_MINMAX), but the game itself clamps: in MAME 0.289 a race with the accelerator held at 0x20 is the same run, frame for frame, as one at 0x00 ("GAS PEDAL", the tank stands),
- rtl/io/m2_cab_inputs.sv:265 THE GAME NAMES ITS CHANNELS (service mode, INPUT TEST, MAME 0.289): HANDLE (0), ACCEL (1), TURRET (2) -- three, and nothing on 3-7.
- rtl/io/m2_cab_inputs.sv:266 There is no brake: channel 2 is the CANNON'S ELEVATION, an absolute position with 0x80 at centre (MAME's own default for it), lower = aim up (the crosshair at the top of the screen by 0x28), higher = aim down; the game slews the gun to it i
- rtl/io/m2_cab_inputs.sv:332 MAME 0.289 (sim/io/mame_m2_desert_input.lua): with the gun fully up, a jump of the TURRET value to 0xc8 or beyond (0x20 -> 0xc8 / 0xd0 / 0xe0, 0x30 -> 0xe0) sends the gun the wrong way -- it stays pinned up, ignores the input for 10-20 s an
- rtl/io/m2_cpu_bridge.sv:121 Measured in MAME over 900 attract frames: 33,554 writes and 12,269 reads.
- rtl/io/m2_cpu_bridge.sv:204 MAME's generic_fifo never drops -- push() into a full FIFO queues the value and HALTS THE SOURCE -- and this core dropped 429,406 of the i960's commands in one boot because a full FIFO looked like an overflow to guard against rather than a
- rtl/io/m2_cpu_bridge.sv:667 Regions are tested in the order model2.cpp declares them, and the ROM mirror is tested BEFORE the RAM it overlaps so a stray write cannot shadow it.
- rtl/io/m2_cpu_bridge.sv:843 model2.cpp reads it:
- rtl/io/m2_cpu_bridge.sv:1143 Daytona's `stis g0,0x1800000(g4)` at 0x2784 is a HALFWORD store: MAME clears palette entry 0 and leaves entry 1 holding ffff, and we cleared both -- which is precisely why its test menu drew green values and no white labels.
- rtl/io/m2_ioboard.sv:8 On the real cabinet a Z80 behind a 315-5338A sits here running EPR-14869 -- the SAME board and the SAME ROM as Model 1's, confirmed from model2.cpp: model2o instantiates SEGA_MODEL1IO with bios epr14869c.
- rtl/io/m2_ioboard.sv:64 MEASURED: MAME clears it on frame 174 of a 57.5 Hz refresh, which is 3.026 s. At 25 MHz that is 75,652,174 -- a 27-bit counter, and it counts once.
- rtl/io/m2_ioboard.sv:121 MEASURED, not argued: the differential against MAME diverges at 2,609,803 instructions with the window left empty and at 1,300,259 with the block pushed.
- rtl/io/m2_ioboard.sv:187 The Z80's publication of DPRAM word 4 -- byte 0x10 to the i960, which MAME says is the ONE byte a coin changes.
- rtl/io/m2_ioboard.sv:240 MAME says a coin changes exactly that byte and nothing else -- ff to fe, bit 0 low for COIN1 -- so the Z80 publishes the input scan and the i960 does the crediting.
- rtl/io/m2_ioboard.sv:260 MAME's DPRAM is umasked to bytes 0 and 2 of each dword, so DPRAM byte 0x08 -- where R65 measured in0 -- is i960 address 0x01c00010 is dword 4 is dp_lo[4].
- rtl/io/m2_ioboard.sv:262 R65's "byte 0x08" and the MAME write tap's "byte 0x10" are the same place in two numberings.
- rtl/io/m2_ioboard.sv:322 Values are MAME's, sampled at frames 10, 60, 120, 300 and 900 and identical at all five (tools/mame_m2_idblock.lua).
- rtl/io/m2_ioboard.sv:461 The first version cleared the flag exactly once, because MAME clears it exactly once.
- rtl/io/m2_ioz80.sv:34 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/m2_ioz80.sv:69 R839: THE TYPE-2 BOARD (MAME model1io2, Virtua Cop's 837-11130 with EPR-17181).
- rtl/io/m2_ioz80.sv:87 The light guns, as MAME's model1io2 fpga_r hands them over: 10-bit coordinates in the game's own units, and the off-screen bits {P2, P1}.
- rtl/io/m2_ioz80.sv:101 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/m2_ioz80.sv:307 model1io.cpp, io_pa_w: "-------0 control switch (0 = first, 1 = second)" and every input port is muxed on it:
- rtl/io/m2_ioz80.sv:320 No new register: PA writes already land in port_out[0], which is exactly where MAME takes the bit from.
- rtl/io/m2_ioz80.sv:406 ------------------------------------------------------------ 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/m2_ioz80.sv:437 R839: the type-2 board wires the 93C46 to PF (model1io2.cpp io_pf_w: bit 6 DI, bit 5 CLK, bit 4 CS) and reads DO at 0x8040 bit 6.
- rtl/io/m2_ioz80.sv:463 R839: the type-2 firmware reads the 93C46 the way MAME models it (eepromser.cpp, 93Cxx: output on the FALLING clock): the dummy 0 as the address's last bit is taken, then D15 at the first falling edge.
- rtl/io/m2_ioz80.sv:470 and ones after D0, as MAME shifts in
- rtl/io/m2_ioz80.sv:485 R839: MAME's dummy 0, now
- rtl/io/m2_ioz80.sv:538 MEASURED ON HARDWARE, against MAME running the same firmware: every analog byte the firmware deposited was its input shifted LEFT BY ONE.
- rtl/io/m2_ioz80.sv:541 DPRAM board MAME fed in
- rtl/io/m2_ioz80.sv:571 "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/m2_ioz80.sv:588 What EPR-17181 was measured to touch (MAME 0.289, sim/io/mame_m2_vcop_io .lua: power-on, attract, a coin, a game with both guns, 300 s):
- rtl/io/m2_ioz80.sv:604 0x8200 the MSM6253, mirrored at 0x8204: Virtua Cop binds no channel, so every read is 0x01 (MAME: n 75,792 per address, value 01 always).
- rtl/io/m2_ioz80.sv:751 Status (0x0d) is MAME's 0x08 with BUSY in bit 0.
- rtl/io/m2_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/m2_vcop_guns.sv:15 MAME 0.289 INPUT_PORTS_START(vcop), which are also the game's own default calibration (its GUN MARK CHECK screen shows these four ranges as AD1 / AD2 XMIN..YMAX):
- rtl/io/m2_vcop_guns.sv:22 and model1io2.cpp fpga_r sets a gun's off-screen bit when any coordinate is within 5% of its range of either end (int(span * 0.05): X 24, Y 19).
- rtl/io/m2_vcop_guns.sv:42 The game's own aim mark (GUN MARK CHECK) sits on pixel floor((v - min) * 496 / span) -- MAME's crosshair pixel -- within 0.7 px over 43 marks (R846), so each pixel maps to the smallest unit that lands on it, v - min = ceil(px * span / 496):
- rtl/io/m2_vcop_guns.sv:218 MAME's rest positions
- rtl/io/m2_vcop_guns.sv:232 ------------------------------------------------------ stage D: off-screen, the ports MAME's 5% border, from the coordinates as the board hands them over
- rtl/io/m2_vcop_state.sv:17 Found in MAME 0.289 vcopa (sim/io/mame_m2_vcop_play.lua; R849): 0x5016d4 byte 0 the game's mode: 0 boot, 1 attract, 2 credited start, 3 / 4 / 6 stage select and its way in, 7 PLAYING, 0x0c continue, 0x0d game over 0x50ee30 byte 0 player 1
- rtl/io/m2_vcop_state.sv:26 TEST MODE entered during a game leaves all three words as they were (mode stays 7 for the ~3 s of the test screens, MAME) and the game reboots on leaving it, writing the mode word.
- rtl/mem/m2_char_cdc.sv:25 * Every simulation answered char_ack in m2_video's OWN clock, so the frame render reproduced MAME's picture exactly while the board showed a screen of one flat colour -- red through a garbage palette, black once the palette was correct.
- rtl/mem/m2_ddr3.sv:12 The framebuffer is what the hardware does -- MAME redisplays a persistent bitmap when the geometrizer presents nothing new -- and the framework already owns the SCANOUT through FB_EN, so only the write side is ours to build.
- 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/fp_mul.sv:30 MAME evaluates with host floats, which are fully IEEE and honour denormals.
- rtl/tgp/m2_copro.sv:9 THE INTERFACE, from model2.cpp's own address map rather than description:
- rtl/tgp/m2_copro.sv:62 model2.cpp:
- rtl/tgp/m2_copro.sv:121 MAME's generic_fifo NEVER drops: push() into a full FIFO stores the value in m_extra_values and halts the source.
- rtl/tgp/m2_copro.sv:188 model2.cpp sets both up as EIGHT deep, and the outbound one is exactly eight here: the TGP writing into a full output FIFO must stall, and it does, by having its acknowledge withheld.
- rtl/tgp/m2_copro.sv:193 MAME's generic_fifo does NOT block a push into a full FIFO -- gen_fifo.cpp, push():
- rtl/tgp/m2_copro.sv:255 model2.cpp:202-205 sets up copro_fifo_out with `m_maincpu->i960_stall()` as its on-empty callback, and gen_fifo.cpp:109-115 fires that callback BEFORE returning T(): the zero is returned to an instruction that has already been cancelled.
- rtl/tgp/m2_copro.sv:258 i960.h:71-75 is the whole of i960_stall() -- `m_stalled = true; m_IP = m_PIP;` -- and i960.cpp:2053 refuses to write the destination register while stalled.
- rtl/tgp/m2_copro.sv:297 The reference has no such state: MAME's TGP is a scheduled device that is always able to run, so `on_fifo_unempty` can always arrive.
- rtl/tgp/m2_copro.sv:420 model2.cpp:193-196 sets up copro_fifo_in with `m_copro_tgp->stall()` on empty, then HALT at the sync; gen_fifo.cpp:109-115 fires it before returning T(); mb86233.cpp:1225-1227 (`do_stall: m_pc = m_ppc`) replays the instruction.
- rtl/tgp/m2_copro.sv:423 MAME's TGP parks at 004c with the FIFO empty -- it does NOT fall through `0053 brif !zrd` into the idle handler.
- rtl/tgp/m2_copro.sv:433 With the pop held, the only read that can consume a command is the dispatch at 004c, exactly as in MAME.
- rtl/tgp/m2_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/m2_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/m2_tgp.sv:50 gen_fifo.cpp's pop() returns T() on an empty FIFO -- but only AFTER firing the on-empty callback, which for the Model 2 TGP is `m_copro_tgp->stall()` (model2.cpp:193-196).
- rtl/tgp/m2_tgp.sv:52 mb86233.cpp:1225-1227 then replays the instruction: `do_stall: m_pc = m_ppc`.
- rtl/tgp/m2_tgp.sv:53 MAME's TGP sits at 004c until a word arrives and never enters the idle handler on an empty FIFO.
- rtl/tgp/m2_tgp.sv:396 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/m2_tgp.sv:401 may be bigger than the fifo size" -- so the reference TGP carries straight on and MAME cannot reach the state this created.
- rtl/tgp/m2_tgp.sv:404 MEASURED, and it is why the board sat at frame 1: the i960 parks on the mailbox poll at 0x1166C (R142), stops draining results, `fout` fills, and the coprocessor freezes here -- 10,815 retires in 40 SECONDS, about 270 instructions per secon
- rtl/tgp/m2_tgp.sv:463 model2.cpp installs the math units and THEN the view, over the whole space:
- rtl/tgp/m2_tgp.sv:487 sel_radr/sel_rdat are a MODEL 1 inheritance in any case -- model1_m.cpp's copro RAM window.
- rtl/tgp/m2_tgp.sv:493 The 0x10 read R156 was aimed at is real and still owed -- but sel_math was gated with it, on an argument from MAME's view semantics rather than a measurement, and the pair has never been separated.
- rtl/tgp/m2_tgp.sv:505 That half was an argument from MAME's view semantics, not a measurement, and on the board it cost the tilemap -- the TGP hung, the i960 stalled on its next FIFO read, and the CPU never drew.
- rtl/tgp/m2_tgp.sv:517 GATED BY THE WINDOW, AS THE FULL R156 HAD IT AND AS MAME'S VIEW SEMANTICS SAY.
- rtl/tgp/m2_tgp.sv:532 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/m2_tgp.sv:576 ATAN, PER MODEL 2 (model2.cpp copro_atan_r), NOT MODEL 1 (R212).
- rtl/tgp/m2_tgp.sv:618 The table-word fixup that stood here was Model 1's (model1_m.cpp corrects a ROM table on the way out); Model 2's handler reads its table as it is.
- rtl/tgp/m2_tgp.sv:749 R146: the mailbox word is a computed float result, and ours is 0xFFFFFFFF where MAME's is 0.
- rtl/tgp/m2_tgp.sv:777 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_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:63 SFT is a u8 in MAME; only [4:0] are used
- rtl/tgp/mb86233_alu.sv:73 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:145 Numerator is D, denominator is A: MAME evaluates f2u(u2f(m_d) / u2f(m_a)).
- rtl/tgp/mb86233_alu.sv:171 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:239 Round to nearest, ties to even — the host FPU default that MAME's f2u(s32) inherits.
- rtl/tgp/mb86233_alu.sv:256 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:340 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:356 MAME keeps them as separate cases computing identical expressions; so do we.
- rtl/tgp/mb86233_alu.sv:372 fned leaves +0 alone rather than producing -0: MAME writes `m_d ?
- rtl/tgp/mb86233_alu.sv:513 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:525 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/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:327 MAME keeps m_st as state and updates it exactly once per instruction:
- rtl/tgp/mb86233_core.sv:328 mb86233.cpp:201 m_st = F_ZRC|F_ZRD|F_ZX0|F_ZX1|F_ZX2|F_ZC0|F_ZC1;
- rtl/tgp/mb86233_core.sv:329 mb86233.cpp:499 m_st = (m_st & ~m_alu_stmask) | m_alu_stset; That is what this now is.
- rtl/tgp/mb86233_core.sv:336 Reset value is MAME's, minus the two the sequencer owns:
- rtl/tgp/mb86233_core.sv:414 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:614 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:657 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:764 Bit 14 of the instruction's low half selects register over memory, exactly as MAME's `opcode & 0x4000` does.
- rtl/tgp/mb86233_core.sv:770 MAME's ea_pre_0: `switch(r & 0x180) case 0x000: return r & 0x7f`.
- rtl/tgp/mb86233_core.sv:793 Everything else read index 0 (b0) -- including a register-sourced rep, still: Model 1's deb6642 reads opcode[5:0] there (MAME), not ported (R732), and that is now the 6'd0 below.
- rtl/tgp/mb86233_core.sv:909 MAME, mb86233.cpp case 6: when the condition passes, `v = m_data.read_dword(ea_pre_0(opcode)); ea_post_0(opcode); write_reg(opcode >> 9, v)`.
- rtl/tgp/mb86233_core.sv:934 MAME's pop on an empty FIFO returns zero AND calls stall(), and `goto do_stall` re-executes the instruction -- so the read does not retire until a command arrives.
- rtl/tgp/mb86233_core.sv:965 `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:976 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:1016 Only sub-op 5 is implemented in MAME; the rest log.
- rtl/tgp/mb86233_core.sv:1058 EA = opcode & 0x7f, MAME's ea_pre_0 mode 0.
- rtl/tgp/mb86233_core.sv:1127 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_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_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:92 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:166 MAME models this as m_stall plus `goto do_stall`, which re-executes the whole instruction.
- 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:151 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:73 and model2.cpp's copro_tgp_rf_map puts the input FIFO at rf 1 and the output FIFO at rf 2.
- rtl/tgp/mb86233_regs.sv:132 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:222 explicit no-op in MAME
- rtl/tgp/mb86233_regs.sv:260 MAME: case 0x0f: break;
- rtl/tgp/mb86233_regs.sv:276 logs in MAME, no state change
- rtl/tgp/mb86233_regs.sv:292 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_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/fp_to_int.sv:6 This is the float-to-screen-coordinate conversion the quad store needs: MAME keeps vertices as floats through its rasterizer and converts late, while the ported quad store takes 16-bit signed screen coordinates.
- rtl/video/fp_to_int.sv:22 MAME assigns a float straight into `spoint_t`'s int members, so the behaviour that reaches the rasterizer is the host's. On x86 `cvttss2si` returns 0x80000000 - "integer indefinite" - for a NaN, an infinity, or any magnitude too large for t
- rtl/video/fp_to_int.sv:25 MAME's own comment on draw_wireframe_line says so outright: "a degenerate projection yields inf/NaN, which float->int conversion turns into INT32_MIN on x86 hosts", and it clips the line precisely because that value arrives.
- rtl/video/fp_to_int.sv:28 Saturating instead would be the tidier arithmetic and the wrong picture: a vertex that MAME throws to the far left would sit on the right-hand edge.
- rtl/video/m2_char_cache.sv:73 Measured on MAME's Daytona scenes (tb_m2_video_ovr): see the study's R823.
- rtl/video/m2_char_x2.sv:75 -> v_ack -> f_ack` is a cycle in the netlist even though every path through m2_char_cache is registered, and Quartus 17.0's STA cannot analyse it: all three seeds of build/char100 died with "Internal Error: sta_scc.cpp, Line 1041" -- its st
- rtl/video/m2_fb_wcomb.sv:60 The word being written asks the fill mask about its two pixels (pg_*) and writes only the ones not yet painted -- first write wins, model2rd.ipp's `if (fill[x] == 0)`.
- rtl/video/m2_fb_wcomb.sv:354 MAME's checker: (x ^ y) & 1 == 1 is painted (x even here)
- rtl/video/m2_fb_write.sv:174 R779: MAME paints (x ^ y) & 1
- rtl/video/m2_geo.sv:9 `model2.cpp`:
- rtl/video/m2_geo.sv:109 These three opcodes carry the state the transform needs, and model2_v.cpp reads them straight:
- rtl/video/m2_geo.sv:384 But Daytona DOUBLE-buffers -- MAME 0.289, 180 s of attract: 10,355 walks alternating between dword 0x0000 and 0x4000 every frame, no jumps, lists at most 2,057 dwords -- so while one list is walked the CPU (the loop at 0x19f58) is writing t
- rtl/video/m2_geo.sv:388 Holding those filled the queue and stalled the CPU until the walk ended, so every game frame took two vblanks (telemetry lite: 2.03; MAME 1.00).
- rtl/video/m2_geo.sv:497 Walking the real list dumped out of MAME retires 101 commands and reaches `end` cleanly using only:
- rtl/video/m2_geo.sv:553 It writes nothing and changes no geometrizer state -- on failure MAME only logerrors, and the real board lights an LED.
- rtl/video/m2_geo.sv:621 R638 CORRECTS THIS: MAME 0.289 walks 57.5 lists a second, alternating dword 0x0000 / 0x4000 -- one flip a frame, double-buffered.
- rtl/video/m2_geo.sv:681 MAME (model2_v.cpp): center_sel = (opcode >> 29) & 3, the polygons clipped against clip_plane[center_sel] and projected about center[center_sel], the four read from the window command's words 2-5.
- rtl/video/m2_geo.sv:780 R642: until the game sends one, the window MAME's first frame carries -- viewport (0,128)-(496,512), centre (248,320) -- which is exactly the projection this core used as constants (R174).
- rtl/video/m2_geo.sv:876 MAME cannot hit this because it fills bufferram with 0x07800f0f (an `end`) at reset.
- rtl/video/m2_geo.sv:1044 MAME reads it as `index = (*input++) >> 2` -- a byte offset into a table of dwords -- and wraps it to 32 entries after each write.
- rtl/video/m2_geo.sv:1095 `pd_i` indexes from the destination and wraps inside the 32K-dword window, as MAME's `oba & 0x7fff` does for reads -- MAME's own pointer walks off the end of the array here, which is undefined behaviour we decline to reproduce.
- rtl/video/m2_geo_clip.sv:17 Behavioural contract is MAME's model1_v.cpp fclip_push_quad (:697) and the four clip/isclipped pairs at :635-:690 (BSD-3-Clause, Olivier Galibert).
- rtl/video/m2_geo_clip.sv:22 MAME clips every quad against four frustum planes before it is rasterised, splitting it and creating vertices on the boundary.
- rtl/video/m2_geo_clip.sv:29 MAME satisfies that by construction, because the clipper has already pulled every vertex onto the viewport boundary.
- …ほか152件
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 17
- Model2.sv:2688 The board's 48 bytes went out over that wire and matched MAME's signature exactly; they now go to a 68000 that reads them.
- Model2.sv:3196 The words themselves are now known good: the board pushes 01800000 (op 03 window_data, byte-identical to MAME's dword 2) and 07800000 (op 0f geo_end).
- Model2.sv:3831 Low half first, which is the order the MRA's interleave puts them in: opr-14742a supplies bits 15:0 and opr-14743a bits 31:16, verified against MAME's own copro_tgp_tables region.
- Model2.sv:5197 Everything upstream measures identical to MAME: the button gives 20 edges for 20 presses, the Z80 publishes DPRAM word 4 with a lowest-ever 0xFE exactly as MAME's does, and the i960 demonstrably reads that byte because Start, Test and Servi
- Model2.sv:5567 The tilemaps are RIGHT -- maps 2 and 3 match MAME's content exactly, 4,096 real tiles each -- and the screen is two flat bands.
- rtl/cpu/i960/i960_top.sv:1312 It survived 803,355 instructions verified against MAME because NOTHING TOUCHES MEMORY UNTIL A FRAME SPILLS, and a spill needs the call depth to exceed the four-frame register cache.
- rtl/io/m2_cpu_bridge.sv:859 Found from the board: the CPU builds a correct palette (4,036 of 4,096 words matching MAME) and a correct tilemap (32,340 of 32,768), and the screen was still white.
- rtl/tgp/fp_mul.sv:34 Default matches MAME.
- rtl/tgp/mb86233_pkg.sv:23 Ground truth: MAME src/devices/cpu/mb86233/mb86233.cpp (Olivier Galibert).
- rtl/tgp/mb86233_pkg.sv:202 Kept verbatim only so the transcription matches MAME line for line.
- rtl/tgp/mb86233_regs.sv:286 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/video/m2_geo_xform.sv:52 WHY IT IS BIT-EXACT AGAINST MAME AND NOT MERELY CLOSE
- rtl/video/m2_geo_xform.sv:54 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:38 | **TGP coprocessor** | The MB86233 runs the game's own microcode, which the core extracts from the data ROM. On a recorded race its results match MAME's, apart
- README.md:40 | **2D tilemap** | Pixel-exact against MAME. A four-line buffer ring stops it dropping scanlines on busy screens. |
- README.md:41 | **Sound board** | Its own 68000 (fx68k), the YM3438 (jt12), and both MultiPCM sample chips on one shared engine. Levels match MAME's to within about a dB. |
- README.md:70 | **P1.5** | 2D on hardware | Done, pixel-exact against MAME. |
MAMEから移植・書き写した、または取り入れたと記載 — 18
- rtl/cpu/i960/i960_agu.sv:11 Transcribed from MAME's i960 device, get_ea (BSD-3-Clause, Farfetch'd and R. Belmont).
- rtl/cpu/i960/i960_alu.sv:11 Semantics transcribed from MAME's i960 device (BSD-3-Clause, Farfetch'd and R. Belmont), execute_op cases 0x58-0x5b.
- rtl/cpu/i960/i960_dec.sv:11 Encoding transcribed from MAME's i960 device (BSD-3-Clause, Farfetch'd and R. Belmont).
- rtl/cpu/i960/i960_ldst.sv:11 Transcribed from MAME's i960 device, MEM opcodes 0x80-0xca and the i960_read/write_*_unaligned helpers (BSD-3-Clause, Farfetch'd, R. Belmont).
- rtl/cpu/i960/i960_lsu.sv:11 Sequencing transcribed from MAME's i960 device: the MEM opcodes and i960_read/write_word/dword_unaligned (BSD-3-Clause, Farfetch'd, R. Belmont).
- rtl/cpu/i960/i960_muldiv.sv:11 Transcribed from MAME's i960 device, REG blocks 0x67, 0x70 and 0x74 (BSD-3-Clause, Farfetch'd and R. Belmont).
- rtl/cpu/i960/i960_regs.sv:11 Semantics transcribed from MAME's i960 device (BSD-3-Clause, Farfetch'd and R. Belmont): do_call, do_ret, do_ret_0 and flushreg.
- rtl/cpu/i960/i960_top.sv:152 ------------------------------------------------------- interrupt state Transcribed from MAME i960.cpp.
- rtl/io/m2_ioz80.sv:20 The map and devices are taken from MAME (model1io.cpp, 315_5338a.cpp, msm6253.cpp), which is this project's ruling reference:
- rtl/tgp/mb86233_agu.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_alu.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_core.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_dec.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_mem.sv:11 Behaviour transcribed from MAME's Model 1 driver:
- rtl/tgp/mb86233_pkg.sv:192 Copied verbatim from MAME.
- rtl/tgp/mb86233_regs.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_seq.sv:11 Behaviour transcribed from MAME's MB86233 device model:
- rtl/tgp/mb86233_xfer.sv:11 Behaviour transcribed from MAME's MB86233 device model:
MAMEの近似をそのまま採用 — 2
- Model2.sv:255 R630: GAMMA, because MAME's curve is MAME's guess at cabinet calibration (m2_palette) and the board is judged on Ben's own screen.
- README.md:68 | **P0** | Measure before building | Done. The approach was costed from instrumented MAME and from other cores on this chip, not guessed. |
MAMEドライバと同じ文言を含む(出典の明記なし) — 46
- Model2.sv:1673 model2.cpp: "initialize bufferram to a sane default", m_bufferram[i] = — 共通の文言: sega/model2.cpp:299
- Model2.sv:2938 // if 60 Hz mode or frame number is even, trigger geometrizer to start new frame — 共通の文言: sega/model2.cpp:2427
- Model2.sv:2939 if ((m_videocontrol & 1) == 0 || (m_framenum & 1) == 0) — 共通の文言: sega/model2.cpp:2428
- Model2.sv:3003 unsigned char ID[]={0,'T','A','H',0,'A','K','O',0,'Z','A','K',0,'M','T','K'}; — 共通の文言: sega/model2.cpp:1016
- Model2.sv:3155 r |= ((address >> 10) & 3) << 29; // eye mode, Sega Rally — 共通の文言: sega/model2.cpp:875
- rtl/io/m2_backup.sv:8 map(0x01d00000, 0x01d03fff).ram().share("backup1") — 共通の文言: sega/model2.cpp:1065
- rtl/io/m2_backup.sv:9 NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1) — 共通の文言: sega/model2.cpp:2569
- rtl/io/m2_cpu_bridge.sv:118 `map(0x00900000,0x0091ffff).mirror(0x60000).ram().share("bufferram")` -- — 共通の文言: sega/model2.cpp:1040
- rtl/io/m2_cpu_bridge.sv:845 r = m_colorxlat[(0x0080 >> 1) + (((palcolor >> 0) & 0x1f) << 8)]; — 共通の文言: sega/model2.cpp:367
- rtl/tgp/m2_copro.sv:21 void model2_tgp_state::copro_fifo_w(u32 data) — 共通の文言: sega/model2.cpp:624
- rtl/tgp/m2_copro.sv:23 if (m_coproctl & 0x80000000) { m_copro_tgp_program[m_coprocnt] = data; — 共通の文言: sega/model2.cpp:626
- rtl/tgp/m2_copro.sv:25 else m_copro_fifo_in->push(u32(data)); — 共通の文言: sega/model2.cpp:631
- rtl/tgp/m2_copro.sv:40 FIFO DEPTH IS EIGHT, from `m_copro_fifo_in->setup(8, ...)`. Not a guess and — 共通の文言: sega/model2.cpp:193
- rtl/tgp/m2_copro.sv:64 void copro_function_port_w(offs_t offset, u32 data) { — 共通の文言: sega/model2.cpp:599
- rtl/tgp/m2_copro.sv:68 m_copro_fifo_in->push(u32(d)); — 共通の文言: sega/model2.cpp:605
- rtl/tgp/m2_tgp.sv:466 map(0x0000, 0xffff).view(m_copro_tgp_bank); — 共通の文言: sega/model2.cpp:470
- rtl/tgp/m2_tgp.sv:467 m_copro_tgp_bank[0](0x0000, 0xffff).rw(copro_tgp_memory_r, ...); — 共通の文言: sega/model2.cpp:471
- rtl/video/m2_geo.sv:11 void geo_prg_w(u32 data) { — 共通の文言: sega/model2.h:174
- rtl/video/m2_geo.sv:15 void push_geo_data(u32 d) { m_bufferram[m_geo_write_start_address/4] = d; — 共通の文言: sega/model2.cpp:780
- rtl/video/m2_geo.sv:16 m_geo_write_start_address += 4; } — 共通の文言: sega/model2.cpp:780
- rtl/video/m2_geo.sv:714 for (i = 0; i < 3; i++) geo->matrix[i+9] = u2f(*input++); — 共通の文言: sega/model2_v.cpp:544
- rtl/video/m2_geo.sv:857 `(m_geo_read_start_address & 0x1ffff)/4`, and the mask is not — 共通の文言: sega/model2_v.cpp:2329
- rtl/video/m2_geo_engine.sv:54 "if count == 0 then rolls over to max size" gives 0xfffff -- 1,048,575 — 共通の文言: sega/model2_v.cpp:1747
- rtl/video/m2_geo_engine.sv:531 model2_3d_push(raster, luma << 15); — 共通の文言: sega/model2_v.cpp:1111
- rtl/video/m2_geo_engine.sv:608 "if count == 0 then rolls over to max size" -- Virtual On and — 共通の文言: sega/model2_v.cpp:1747
- rtl/video/m2_geo_engine.sv:948 reuse P0(n-1) and P0(n) — 共通の文言: sega/model2_v.cpp:543
- rtl/video/m2_geo_engine.sv:951 reuse P1(n-1) and P1(n) — 共通の文言: sega/model2_v.cpp:551
- rtl/video/m2_geo_engine.sv:954 0 and 2: reuse P0(n) and P1(n) — 共通の文言: sega/model2_v.cpp:533
- rtl/video/m2_geometry.sv:562 exponent = ((f >> 23) & 0xff) - ((z_adjust >> 23) & 0xff) — 共通の文言: sega/model2_v.cpp:174
- rtl/video/m2_palette.sv:26 u8 r = m_colorxlat[(0x0080 >> 1) + (((palcolor >> 0) & 0x1f) << 8)]; — 共通の文言: sega/model2.cpp:367
- rtl/video/m2_palette.sv:27 u8 g = m_colorxlat[(0x4080 >> 1) + (((palcolor >> 5) & 0x1f) << 8)]; — 共通の文言: sega/model2.cpp:368
- rtl/video/m2_palette.sv:28 u8 b = m_colorxlat[(0x8080 >> 1) + (((palcolor >> 10) & 0x1f) << 8)]; — 共通の文言: sega/model2.cpp:369
- rtl/video/m2_palette.sv:29 r = m_gamma_table[r]; g = ...; b = ...; — 共通の文言: sega/model2.cpp:370
- rtl/video/m2_palette.sv:57 // convert color space; this works OK for most games — 共通の文言: sega/model2_v.cpp:2387
- rtl/video/m2_palette.sv:58 // real cabinets probably have their monitors calibrated depending on the game — 共通の文言: sega/model2_v.cpp:2388
- rtl/video/m2_texel_bl.sv:246 model2_v.cpp: "disable smooth wrapping if mirroring is enabled". — 共通の文言: sega/model2_v.cpp:586
- rtl/video/m2_texel_bl.sv:912 model2_v.cpp: "disable smooth wrapping if mirroring is enabled". — 共通の文言: sega/model2_v.cpp:586
- rtl/video/m2_tile_decode.sv:15 segaic24.cpp says why: "The tilemap chip has been reused for model1 and — 共通の文言: sega/segaic24.cpp:12
- rtl/video/m2_tile_decode.sv:16 model2, probably because they had it handy and it handles medium res." So — 共通の文言: sega/segaic24.cpp:12
- rtl/video/m2_tile_decode.sv:30 8, 8, SYS24_TILES, 4, {0,1,2,3}, {STEP8(0,4)}, {STEP8(0,32)}, 8*32 — 共通の文言: sega/segaic24.cpp:43
- rtl/video/m2_tile_decode.sv:39 set_gfx(..., (uint8_t *)char_ram.get(), NATIVE_ENDIAN_VALUE_LE_BE(8,0), ...) — 共通の文言: sega/segaic24.cpp:100
- rtl/video/m2_tile_decode.sv:111 MAME: tileinfo.set(gfx, val & tile_mask, (val >> 7) & 0xff, 0); — 共通の文言: sega/segaic24.cpp:55
- rtl/video/m2_video.sv:46 hscr = tile_ram[0x5000 + (layer >> 1)] — 共通の文言: sega/segaic24.cpp:342
- rtl/video/m2_video.sv:47 vscr = tile_ram[0x5004 + (layer >> 1)] — 共通の文言: sega/segaic24.cpp:343
- rtl/video/m2_video.sv:1052 MAME reads tile_ram[0x5004 + ((layer >> 1) & 2)], which for our — 共通の文言: sega/segaic24.cpp:344
- rtl/video/m2_video_timing.sv:42 Model 2: set_raw(32_MHz_XTAL/2, 656, 0, 496, 424, 0, 384) — 共通の文言: sega/model2.cpp:2523