← コア一覧
NamcoNA2 (yaguboo)
MAMEのドライバにない実基板の資料を引用 — 1
- projects/namco/na1_na2/rtl/video/na2_cgmem.sv:501 WRITE_QUEUE=0 resolves every signal here back to the expression it replaced, so that configuration is the shipped netlist unchanged -- and it has to be, because it is the control every sweep is read against.
MAMEとの相違点を記載 — 4
MAMEのソースを引用 — 288
- projects/namco/na1_na2/rtl/na2_top.sv:133 Which raw scanline raises the 68000's vblank interrupt: 0 = 224 (MAME), 1 = 240 (FBNeo), 2 = 256 (end of active display).
- projects/namco/na1_na2/rtl/na2_top.sv:202 fix/na12-accuracy: 1 = a palette write while graphics are disabled does not change the backdrop colour until graphics come back on, as MAME (rtl/video/na2_bgpal_hold.sv).
- projects/namco/na1_na2/rtl/na2_top.sv:601 namcona1.cpp:526 calls blit() from inside vreg_w, so the whole transfer -- every transfer_dword, every gfxram_w, and every read of m_vreg[0x0c/2] inside it -- completes before the CPU's write to the trigger register returns.
- projects/namco/na1_na2/rtl/na2_top.sv:604 $0C therefore cannot change part way through a MAME blit: it is frozen by construction.
- projects/namco/na1_na2/rtl/na2_top.sv:617 The 68000's own writes to the CG/shape window keep following $0C live, exactly as MAME's gfxram_w does for a CPU write.
- projects/namco/na1_na2/rtl/na2_top.sv:629 Measured offline against MAME's captured write stream: on 4,400 attract frames, EVERY one of the 96 256-word shape blits has $0C move 3 -> 2 part way through (207 words each, which then land in CG RAM rather than shape RAM), and 77 of 384 5
- projects/namco/na1_na2/rtl/na2_top.sv:744 Work RAM holds 68000 words big-endian, so the byte at an even address is the high half -- the same convention na2_membus loads the download with, and the one MAME's C219 reads through (ENDIANNESS_BIG).
- projects/namco/na1_na2/rtl/na2_top.sv:839 the blitter uses the bank its trigger captured; the 68000 uses the live register, as MAME's gfxram_w does for a CPU write
- projects/namco/na1_na2/rtl/na2_top.sv:929 na2_video runs the scanline: per-line scroll, backdrop clear, then the tilemap layers in MAME's priority order, into a double-buffered line buffer that is scanned out one pixel ahead.
- projects/namco/na1_na2/rtl/na2_top.sv:992 Blitter only, because a 68000 write into the CG/shape window with $0C set to neither 2 nor 3 is discarded by MAME's gfxram_w in exactly the same way -- that is the reference behaviour, not a fault, and putting it on a fault strip would ligh
- projects/namco/na1_na2/rtl/na2_top.sv:1015 MAME never exercises that loop.
- projects/namco/na1_na2/rtl/na2_top.sv:1015 namcona1.cpp's simulate_mcu() forces m_workram[0xf60/2] = 0 at EVERY vblank, with a FIXME saying it should not be necessary, and it does it even though the real M37710 is running.
- projects/namco/na1_na2/rtl/na2_top.sv:1017 So in MAME every handshake succeeds immediately no matter what the MCU did -- which means MAME's captured C219 register stream, the thing this whole investigation has used as ground truth for "what the driver does", comes from a machine whe
- projects/namco/na1_na2/rtl/na2_top.sv:1024 In MAME the answer would be one or two per command.
- projects/namco/na1_na2/rtl/na2_top.sv:1063 MAME's trace of the scene where the melody is missing has A=0x46BC and B=0x0043 at the next instruction (0x00E253); the board reads A=0x2468 B=0x000A on the same note, at the same sample address and the same pitch.
- projects/namco/na1_na2/rtl/na2_top.sv:1071 MAME's settled channel shows 0x46, the channel base the caller loaded; MAME's RAMPING channel 0x5320 shows 0x03, which is its own level.
- projects/namco/na1_na2/rtl/na2_top.sv:1082 MAME's trace: X = 0x4600 here, and a few instructions later `LDX $da` makes it 0x1000, voice 0's register base.
- projects/namco/na1_na2/rtl/na2_top.sv:1379 44100 is MAME's rate for this chip and the rate everything here is checked against; c140.cpp's own notes say the 219's base pitch is the C352's 42667 Hz.
- projects/namco/na1_na2/rtl/na2_top.sv:1452 The board crosses the chip's outputs on the way to the speakers (MAME_VERIFIED, namcona1.cpp: add_route(0, "speaker", 1.00, 1) and add_route(1, "speaker", 1.00, 0)).
- projects/namco/na1_na2/rtl/na2_top.sv:1454 Whether that is the PCB's wiring or MAME compensating for something else is UNKNOWN; it is reproduced because it is what the audio this core is checked against does.
- projects/namco/na1_na2/rtl/na2_top.sv:1463 The backdrop colour while graphics are off: MAME holds palette writes until graphics return (rtl/video/na2_bgpal_hold.sv).
- projects/namco/na1_na2/rtl/na2_top.sv:1561 The game-level timing tools/mame/na12_golden.lua measures in MAME, measured here the same way so the two can be compared number for number (docs/NA12_TIMING_AUDIT.md).
- projects/namco/na1_na2/rtl/na2_top.sv:1933 This compared nine bits, so a game that parked a value with bit 8 set would never take the raster interrupt here and would take it in MAME.
- projects/namco/na1_na2/rtl/na2_top.sv:1976 Measured in MAME: during an event the game re-triggers every 400 system clocks with 16 or 32 words in flight and never polls a status bit -- that allows 12.5 clocks per word, and this blitter needs about 14, so 555 of 1,521 kicks (36.5 %) w
- projects/namco/na1_na2/rtl/na2_top.sv:2010 Measured in MAME (tools/d7_origin.lua): `jsr $c20000.l` at 0xC00028 pushes 0x00C0002E with SP = 0x0007FFFC, and the routine pops it back at
- projects/namco/na1_na2/rtl/na2_top.sv:2086 Quiztou's vector table (tools/vectors.lua, read out of MAME at frame 1200) installs nothing: vectors 2-15 and the spurious-interrupt vector 24 are all 0x00000000, and only autovectors 3 and 4 have handlers.
- projects/namco/na1_na2/rtl/na2_top.sv:2184 MAME writes D7 exactly twice in that whole block -- 0x00000000 at 0xC22600 and 0x00C0002E at the pop at 0xC2263A -- and never again before the jump (tools/d7_track.lua).
- projects/namco/na1_na2/rtl/na2_top.sv:2186 So our core writes it somewhere MAME does not, and nothing outside the CPU can see a register.
- projects/namco/na1_na2/rtl/na2_top.sv:2220 C2074A movem.l (sp)+, d0-d7/a0-a6 MAME runs the pair and D7 comes back.
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:21 MAME_VERIFIED: namcona1.cpp custom_key_r is, for every set in this family, two rules and nothing else -- offset == the set's identity offset -> the identity word anything else -> machine().rand() (the switch return
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:44 Running MAME's algorithm reproduces FBNeo's table exactly, 32 of 32, so the shift order, the bitswap order and the feedback condition are all confirmed twice over.
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:54 MAME uses the host RNG and additionally forces two consecutive reads to differ; FBNeo uses its own "guaranteed_rand".
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:78 Chosen because it never repeats a value on consecutive reads, which is the only property MAME's implementation actually guarantees.
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:96 The order matters and is MAME's: the value handed back is computed from the register BEFORE the step, and the feedback test looks at the register AFTER it.
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:129 The identity wins, as it does in MAME's switch: Tinkle Pit's identity is at offset 7 and its algorithm at offset 3, so the two never collide.
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:5 MAME_VERIFIED: namcona1.cpp namcona1_main_map has map(0xe00000, 0xe00fff).rw("eeprom", ...).umask16(0x00ff); and the machine config instantiates EEPROM_2816.
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:36 A real erased 28C16 reads 0xFF everywhere, and numanath ships no default EEPROM image in MAME (unlike Cosmo Gang the Puzzle and others, which ship one "otherwise game would lock up on 1st boot").
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:52 MAME_VERIFIED, measured this session and not read out of a source file: starting numanath in MAME with no nvram file at all, the 2 KiB behind 0xE00001 has become byte-for-byte identical to nvram/numanath/eeprom by frame 200 (0 differing byt
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:63 The bytes are not invented -- they are exactly what this game writes into a blank part on its own, captured from a local MAME run (see LICENSE_NOTES.md), so the machine state after the first frames is the same either way.
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:191 The rest of the word is not driven by anything, and MAME hands back zero for it.
- projects/namco/na1_na2/rtl/cpu/na2_m68k.sv:65 MAME models no wait states, and nothing on the NA-2 PCB is known to insert them (UNKNOWN -- PCB_VERIFICATION_NEEDED), so the game lost that time only here: Numan Athletics' main loop overran frames MAME finishes, and on those frames its vbl
- projects/namco/na1_na2/rtl/cpu/na2_m68k.sv:108 Autovector every interrupt: the NA-1/NA-2 68000 has no vector generator, MAME raises levels 3 and 4 with HOLD_LINE which is autovectored.
- projects/namco/na1_na2/rtl/video/na2_cgmem.sv:149 That is not a defect -- the CPU and the video hardware are not synchronised on real hardware either, and MAME draws the frame-end snapshot -- but it does mean the old gate cannot judge this.
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:16 Line numbering follows MAME's `m_screen->vpos()` so that the posirq comparison against vreg $8A means the same thing here as there.
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:21 FBNEO_CROSSCHECK: d_namcona1.cpp draw_layer() iterates raw y 0..255 and writes `pTransDraw + (y - 32) * nScreenWidth`, i.e. raw line 32 is the first visible line.
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:35 MAME gets away with 224 because it draws everything above the posirq line in one pass AT scanline 240, after the handler has run; a scanline renderer cannot.
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:68 This is an open question, not a setting: MAME uses 224 and FBNeo 240, both of which land inside the visible region (raw 32..255), and neither has any hardware backing.
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:77 0 = 256 (end of active display, the measured answer) 1 = 224 (MAME) 2 = 240 (FBNeo)
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:66 MAME blit_setup(): "bytes per row" and "pitch" for a format word.
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:69 The `default` rows are `(64 - (format >> n)) << m` in MAME, computed in `int`.
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:110 MAME transfer_dword() accepts exactly these ranges and aborts the whole blit on anything else.
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:124 namcona1.cpp:355 also accepts `dest >= 0xf00000*2 && dest < 0xf02000*2` -- 0x1E00000-0x1E03FFF -- which its own comment calls an assumed palette mirror for xday2, and it TRANSLATES that address back to palette RAM before writing.
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:169 MAME folds a destination below 0xF00000 up into the gfx window once, before the loop.
- projects/namco/na1_na2/rtl/video/na2_tilemap.sv:7 Reference (MAME_VERIFIED + FBNEO_CROSSCHECK -- the two agree pixel for pixel; MAME namcona1_v.cpp draw_background()/tilemap_get_info(), FBNeo d_namcona1.cpp draw_layer()):
- projects/namco/na1_na2/rtl/video/na2_tilemap.sv:26 MAME's gfx_layout has planeoffset {0..7} and xoffset {0,8,16,...}, and MAME reads bits MSB-first, so plane p lands on byte bit (7-p) and is placed at pen bit (7-p) -- an identity mapping.
- projects/namco/na1_na2/rtl/video/na2_tilemap.sv:182 Measured 2026-08-30 on a real MAME frame through the Pocket CG path: sprite starts 448, busy 0 cycles, sp_cg_stall high for all 896 cycles of the window, peak sprites 0.
- projects/namco/na1_na2/rtl/video/na2_tilemap.sv:236 MAME: tile-word bit 15 forces an opaque tile (TILE_FORCE_LAYER0), which `shape_byte` already folds in
- projects/namco/na1_na2/rtl/video/na2_palette.sv:4 Each entry is read two ways (MAME_VERIFIED: namcona1_state::update_palette in namcona1_v.cpp, FBNEO_CROSSCHECK: palette_update_entry in d_namcona1.cpp -- identical arithmetic):
- projects/namco/na1_na2/rtl/video/na2_palette.sv:12 MAME builds both interpretations into one 8192-entry pen table: pens 0x0000-0x0FFF are the normal reading and 0x1000-0x1FFF the alternate one.
- projects/namco/na1_na2/rtl/video/na2_palette.sv:16 MAME says the alternate form is used in-game by Emeraldia; it costs almost nothing to support, so it is here.
- projects/namco/na1_na2/rtl/video/na2_palette.sv:41 What is established is that MAME does, and that this game leans on the path -- the attract mode keeps sprites with colour word 0x7FFE on screen for seconds at a time.
- projects/namco/na1_na2/rtl/video/na2_palette.sv:44 MAME's own TODO says "non-shadow pixels for sprites flagged to enable shadows have bad colors", so the corner is not settled upstream either.
- projects/namco/na1_na2/rtl/video/na2_palette.sv:95 MAME truncates: n * 0xff / (0x3*3), integer division.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:4 Runs after every tilemap for the line, exactly where MAME's screen_update() calls draw_sprites().
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:52 64 dropped sprites in five shipped sets (KNOWN_ISSUES RISK-9); Emeraldia's high-score table lost visible text against MAME.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:76 UNKNOWN: whether the real hardware darkens by MAME's 0.6.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:76 What is measured is that MAME does -- a frame of the attract mode disagreed with this renderer on 422 pixels, every one of them on a sprite with colour word 0x7FFE, until this was implemented (tools/mame_check.sh).
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:196 Measured: ten frames of the Turbo Dash event across four MAME runs, 731 differing pixels each, all of them on opaque sprites carrying the shadow bit -- 0 with this one line.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:208 code = (tile + (row << 6) + col) & 0xFFF, which is MAME's `code % gfx->elements()`: CG RAM holds exactly 0x1000 cells of 64 bytes.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:218 MAME: tile-word bit 15 forces an opaque cell, which this folds in.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:223 MAME: sx = (xpos & 0x1ff) - 10 + delta*8, then ((sx + 16) & 0x1ff) - 8.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:290 MAME's draw_sprites() does `source += 0x400` on a u16*, i.e. the bank selects a 0x400-WORD half of object RAM, not 0x200.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:291 With the shift one place short, sprite n in bank 1 read MAME's sprite n-128 and MAME's sprites 128-255 were never read at all.
- projects/namco/na1_na2/rtl/video/na2_sprite.sv:344 Measured 2026-08-30 on a real MAME frame through the Pocket CG path: sprite starts 448, busy 0 cycles, sp_cg_stall high for all 896 cycles of the window, peak sprites 0.
- projects/namco/na1_na2/rtl/video/na2_linebuf.sv:5 Each entry carries the pen and the priority value that wrote it, which is what MAME keeps in its separate `screen.priority()` bitmap: layers are drawn in increasing priority order and each stamps its own priority, then sprites draw over a p
- projects/namco/na1_na2/rtl/video/na2_roz.sv:4 The fifth background layer, `which == 4` in MAME's priority loop.
- projects/namco/na1_na2/rtl/video/na2_roz.sv:9 MAME_VERIFIED (namcona1_v.cpp roz_get_info() and draw_background()'s which == 4 branch, plus tilemap_t::draw_roz), FBNEO_CROSSCHECK (d_namcona1.cpp predraw_roz()/draw_roz(), which agrees on every field -- see the one place it does not, belo
- projects/namco/na1_na2/rtl/video/na2_roz.sv:33 The `& 0xFBF` drops bit 6 of the tile number; MAME's comment calls it a patch for Emeraldia Japan and does not explain it, so it is copied and tagged rather than justified.
- projects/namco/na1_na2/rtl/video/na2_roz.sv:45 MAME/FBNeo difference, recorded rather than split: MAME's draw_roz advances the start point by cliprect.min_x * incxx before the first pixel, so (startx, starty) belongs to screen pixel (0,0).
- projects/namco/na1_na2/rtl/video/na2_roz.sv:152 Measured 2026-08-30 on a real MAME frame through the Pocket CG path: sprite starts 448, busy 0 cycles, sp_cg_stall high for all 896 cycles of the window, peak sprites 0.
- projects/namco/na1_na2/rtl/video/na2_vram.sv:31 FBNEO_CROSSCHECK: d_namcona1.cpp bankswitch() maps DrvShapeRAM over 0xF40000-0xF47FFF for bank 3 and DrvGfxRAM over the full window for bank 2, which independently confirms the 32 KiB shape-RAM extent.
- projects/namco/na1_na2/rtl/video/na2_vram.sv:238 MAME's gfxram_w does the same thing, so this is not a bug by itself -- but a blitter write that lands here is a graphic that never arrives, and that is worth counting rather than assuming.
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:8 While graphics are off MAME draws nothing but the backdrop pen, (vreg[0xBA] & 0xF) << 8 (namcona1_v.cpp:559-561), so the only colours that can be seen held are those sixteen entries.
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:13 FBNeo updates the colour immediately (d_namcona1.cpp:445-456), which is what this core did before.
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:16 TODO(HARDWAREIZE): does the board transfer palette RAM to the DAC only while the display is enabled, or is this MAME's own economy?
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:19 Why it is here: Numan Athletics, during a scene load with graphics off, writes 0xE7E7 and 0.3 ms later 0x0000 to entry 0xF00 -- the backdrop (C11C22 / C11C34, MEASURED(MAME) frames 4200, 4204, 7548, 7551).
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:25 Not reproduced: MAME rebuilds only when graphics are enabled AND the display window is non-empty (namcona1_v.cpp:561).
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:27 While graphics are enabled palette writes are shown immediately in both, so the difference is confined to a frame whose window is empty -- where the backdrop is all there is and MAME would show the held colour a frame longer.
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:47 what MAME's palette device holds for them
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:69 graphics just came on: MAME's rebuild of the whole palette.
- projects/namco/na1_na2/rtl/video/na2_video.sv:8 Written from reference/mame/namcona1_v.cpp screen_update()/draw_background() and reference/fbneo/d_namcona1.cpp DrvDrawTo()/draw_layer(), read directly rather than from a paraphrase.
- projects/namco/na1_na2/rtl/video/na2_video.sv:23 MAME wraps the scrollx update in `if (xdata)`; FBNeo does not.
- projects/namco/na1_na2/rtl/video/na2_video.sv:23 The two are the same function: when xdata is 0 the 0x4000 branch cannot be taken and `xdata & 0x1ff` is 0, so MAME's guard changes nothing.
- projects/namco/na1_na2/rtl/video/na2_video.sv:27 A layer whose per-line scroll word is exactly 0xC001 does not draw its tilemap at all: that scanline comes straight out of video RAM as packed 8-bit pixels (`na2_pixline`, MAME's draw_pixel_line()).
- projects/namco/na1_na2/rtl/video/na2_video.sv:29 It replaces that layer's turn in the priority loop and nothing else, except that it declares every pixel of the line off-limits to sprites -- MAME writes 0xff into the priority buffer across the whole width, which here is "set every occupan
- projects/namco/na1_na2/rtl/video/na2_video.sv:33 MAME calls the trigger condition itself unproven; keep the UNKNOWN.
- projects/namco/na1_na2/rtl/video/na2_video.sv:46 The ROZ sampling point is accumulated per line the same way the tilemap scroll is, and for the same reason -- MAME evaluates `startx + x*incxx + y*incyx` for absolute screen coordinates, so a per-line adder reproduces it exactly and costs n
- projects/namco/na1_na2/rtl/video/na2_video.sv:49 The base is reloaded at the frame wrap, which is where MAME's screen_update() reads the registers.
- projects/namco/na1_na2/rtl/video/na2_video.sv:72 The display window (MAME `display_rect`, FBNeo `clip`) is x from vreg[$80]-0x48 to vreg[$82]-0x48-1 y from max(vreg[$84], 32) to min(vreg[$86]-1, 255) and nothing is drawn at all if it is empty or starts negative (MAME screen_enabled(), FBN
- projects/namco/na1_na2/rtl/video/na2_video.sv:230 The frame's last line wraps round to raw line 0 and resets the scroll accumulators, exactly where MAME's `for (line = 0; ...)` starts over.
- projects/namco/na1_na2/rtl/video/na2_video.sv:245 MAME draws a whole frame (or a posirq half) from one snapshot, so a register the game changes part way down the picture is invisible to any frame-by-frame comparison -- by construction, no matter how far apart the two pictures really are.
- projects/namco/na1_na2/rtl/video/na2_video.sv:310 MAME reads that bit once, when it draws the frame.
- projects/namco/na1_na2/rtl/video/na2_video.sv:322 0 = live (what this core has always done, and what MAME's source reads literally) 1 = latched at the top of the frame
- projects/namco/na1_na2/rtl/video/na2_video.sv:393 MAME_VERIFIED / FBNEO_CROSSCHECK, both identical: inc* = (s16)reg << 8, start = (offset << 12) + incxx*46 - incyx*8 46 and -8 are MAME's `dx` and `dy` screen adjustments.
- projects/namco/na1_na2/rtl/video/na2_video.sv:620 Sprites deliberately do not update it: occupancy already blocks every later sprite, and MAME's 0xff is not a priority value anything compares against afterwards.
- projects/namco/na1_na2/rtl/video/na2_video.sv:675 MAME writes 0xff across the whole width of a pixel line, which is the value sprites refuse to draw over
- projects/namco/na1_na2/rtl/video/na2_video.sv:753 MAME checks the raw scroll word for 0xC001 *after* letting it through the scrollx accumulator, so the accumulation below is unchanged; only the draw for this layer is replaced.
- projects/namco/na1_na2/rtl/video/na2_video.sv:765 MAME fills the backdrop over the whole cliprect and only then restricts drawing to display_rect, so a line outside the window shows the backdrop -- not, as this used to, whatever the line buffer happened to hold from two lines ago.
- projects/namco/na1_na2/rtl/video/na2_video.sv:787 ---- layers, in MAME's order ---------------------------------
- projects/namco/na1_na2/rtl/video/na2_video.sv:830 ---- sprites, after every tilemap, as MAME does ---------------
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:48 MAME 0xFFFF in the scene where the board plays it too quietly.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:51 MAME 0x040A, into the 68000's work RAM at 0x270000.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:89 Row 29 (4 px) the melody channel's {alive flag ($08,X, MAME 0x80), frames until its envelope advances again ($2D,X)}.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:92 MAME 0x4600 -- the melody channel is the FIRST one, so a truncated list cannot skip it and anything else here is the list itself being wrong.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:96 MAME's high byte is 0x80 and its low two bits are what 0x00DBC5 tests: zero means no fade and the attenuation is cleared, which is the only path MAME ever takes.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:233 All seven have answered: every voice is keyed, at the address, pitch and mode MAME uses, on banks MAME uses, and the beat is loud.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:235 What is NOT known is why the melody channel's envelope level sits at 0x24 where MAME's sits at 0xFF, so those rows carry the envelope instead.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:370 RISK-10: Quiztou draws its notice screen and then executes in upper work RAM, while MAME's 68000 spends 1718 of 1800 frames in program ROM and every one of its work-RAM frames in page 0x000000.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:390 It is not: MAME's 68000 reads PC=0 only while the C70 still holds it in reset, and from the frame it is released it never fetches outside program ROM again.
- projects/namco/na1_na2/rtl/video/na2_pixline.sv:9 MAME_VERIFIED (draw_pixel_line() in namcona1_v.cpp), FBNEO_CROSSCHECK (d_namcona1.cpp has the same special case, and MAME's own comment says this is "a simplification, but produces the correct behavior for the only game that uses this featu
- projects/namco/na1_na2/rtl/video/na2_pixline.sv:24 MAME's comment next to it says this breaks colours in the VS Express event and that the palette bank may live somewhere else in this mode, so the arrangement is `UNKNOWN`, not settled.
- projects/namco/na1_na2/rtl/video/na2_pixline.sv:33 A later tilemap layer still draws over this one: MAME's tilemap draw writes its pixels and its priority unconditionally, and only sprites test what is already there.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:27 RESEARCH.md section 2 records an LH5168 (8K x 8) on the PCB, but MAME maps 32 KiB and the game's own mailbox command 3 uploads a block to 0x8A00, which is past the end of 8 KiB.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:40 This is the same swap tools/c219_ref.py applies to the captured MAME writes that rtl/sound/na2_c219.sv was verified against.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:58 MAME_VERIFIED, and the units matter: namcona1.cpp instantiates the C70 at MASTER_CLOCK/4, and m37710.h:209 then divides that by two before executing anything, so instructions run at 6.2641 MHz.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:64 Timers are the part that has to be right, and MAME counts them off the UNDIVIDED XIN (m37710.cpp:520,547 use clocks_to_attotime).
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:65 `mcu_ce` is therefore XIN here and na2_m37702_periph counts timers on it, which puts the sound driver's Timer A0 at 64 * 0x65B = 104128 clocks = 120.31 Hz, MAME's own number.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:125 $08,X 0x4608 the channel is alive MAME 0x80 $12,X 0x4612 envelope program pointer, 16 MAME 0x040A (into 68000 RAM) $14,X 0x4614 envelope fraction MAME 0x50 $15,X 0x4615 envelope LEVEL MAME 0xFF,
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:135 The board plays the melody at a sixth of MAME's level; these taps say whether the level is being ramped to a different TARGET or is failing to reach the same one.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:143 The ramp was cleared: our core executes all thirteen of its instructions exactly as MAME does (54/54, tools/bgm_ramp_gen.py), yet the board holds the level at 0x24 for nineteen seconds in a state where MAME would move it to 0x1A.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:158 esram[0x6420] -- list head, MAME 0x4600
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:159 iram[0x0120] -- dispatch, MAME 0xE1AA
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:162 00DBC3 LDA $06,X ; the fade control, esram[0x4006] MAME 0x80
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:164 00DBC7 BEQ 00dbef ; zero -> clear the attenuation MAME's path
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:168 MAME never reaches 0x00DBCC in any of five captures.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:176 Why it is defensible rather than a patch over ignorance: the cause is known in full (section 21), and MAME reaches the instruction that installs that attenuation, 0x00DBCC, in NONE of five captures while its melody voice stays audible 99.3
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:269 MAME implements one uniform swapped rule and that is exactly why its C70 "never responds to the version string command": with the words swapped, command 7 reads src=0x00C0 len=0x1000 dst=0x0010 instead of src=0xC000 len=0x0010 dst=0x1000.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:279 The page has now been OBSERVED, in MAME, both ways round in the same frame (tools/bgm_lane.lua): a 16-bit MCU read at 0x2840 yields 0x2820 where the 68000's own bytes at 0x0840/41 are 0x20 0x28.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:292 Flipping gave 0x2028 instead of 0x2820, so the driver read its fade byte out of the wrong block: 0x85 where MAME reads 0x80, whose low bits put it into a fade, whose attenuation of 0x50 turned every melody volume into silence.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:386 MAME 0xE1AA.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:409 Little-endian, MAME 0x4600.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:446 MAME_VERIFIED, c140.cpp: data = (v.key ?
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:498 MAME models the mailbox as eight symmetric 16-bit slots, reads 0x0000 here, and therefore never services a single command -- which is what its own FIXME in mcu_mailbox_w_68k is describing.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:540 See the long note in that file; in short, a board that cannot do this needs a canned EEPROM for every set that programs its own, which is exactly the list in MAME's To-Do.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:36 P8 0x12/0x14 dir=0xBB at C06A; bit 5 toggled at C13F/C143, C16B, C18E, C277, C534, C5BC, C5F7 (MAME: "watchdog?").
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:80 The registers read back; no interrupt is ever generated, which is what MAME does too.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:88 Modelled exactly as MAME does: the registers hold their values, the receive buffer reads 0, and no UART interrupt is ever raised.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:90 MAME runs the game this way, so the BIOS does not depend on a transmit-empty flag -- but that is MAME_VERIFIED, not HW_CONFIRMED, and it is the most likely place for this module to hang if it ever does.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:96 No watchdog reset is generated (MAME does not either) -- a watchdog that never fires cannot hang the BIOS, one that fires early can.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:127 MAME_VERIFIED (namcona1.cpp port6_w / port7_r) and independently ROM_DISASM_CONFIRMED from the BIOS's own polling routine at 0x00D26E (RESEARCH.md section 13 quotes it in full):
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:142 Two independent sources agreeing on the same four select values is unusually good evidence, so this is the one part of this file that is not "MAME says so".
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:165 The scramble and the read order are inverses of each other, which is what a reassembly routine has to look like, so both are now confirmed from the ROM as well as from MAME.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:180 That was never really unknown: MAME runs the same M37702 on the same c70.bin and player 3 works there, so the BIOS does the reassembly (it is ROM_DISASM_CONFIRMED at 0xD202-0xD23A below) and puts the result somewhere the game finds.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:194 If the real BIOS ever polls that flag on a path MAME does not take, this block will spin there.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:248 --- I/O ports P0-P8 ---------------------------------------------------- MAME_VERIFIED (m37710.cpp m37702m2_device::map): the port registers live at 0x02-0x15 on even bytes for P0/P2/P4/P6/P8 and 0x03-0x11 on odd bytes for P1/P3/P5/P7, data
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:252 In m37710.cpp's own terms: p = (offset & ~1) + Base, and BIT(offset,0) selects the direction register.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:260 last byte written, raw (m37710.cpp m_port_regs)
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:263 The board-side latches namcona1.cpp keeps for the pins it drives.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:263 MAME only calls the out callback when the direction register is non-zero and masks the data with it (set_port_reg), so a write while the port is still all-inputs never reaches the pin.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:284 din & p_dir[p_idx], what MAME hands the callback
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:286 --- A-D converter ------------------------------------------------------ MAME_VERIFIED (m37710.cpp ad_register_map / ad_control_w / ad_timer_cb): 0x1E ad_control b7 clock (0 = f2/4, 1 = f2/2), b6 start/busy, b4 sweep, b3 repeat, b2:0 chann
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:314 --- timers ------------------------------------------------------------- MAME_VERIFIED (m37710.cpp timer_register_map, m37710_recalc_timer, m37710_timer_cb): 0x40 count start bit i enables timer i 0x42 one-shot start (write only) 0x44 up/
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:341 --- interrupt controller ---------------------------------------------- MAME_VERIFIED (m37710.cpp int_control_r/w and m37710i_update_irqs): one byte per source, bits 2:0 priority, bit 3 request, and for the three external INT lines bit 4 po
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:344 Indexed here by the M37710_LINE_* number (reference/mame/m37710.h), because the CPU core derives its vector from that number: vector = 0xFFCE + 2 * line.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:427 MAME_VERIFIED (namcona1.cpp c70() an0_cb..an7_cb -> portana_r<Bit>) and ROM_DISASM_CONFIRMED by the reassembly order at 0xD202-0xD23A: AN0<-bit6 AN1<-bit5 AN2<-bit4 AN3<-bit0 AN4<-bit1 AN5<-bit2 AN6<-bit3 AN7<-bit7 portana_r returns 0xFFFF
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:448 MAME_VERIFIED (namcona1.cpp port7_r): if ((m_mcu_port6 & 0x80) == 0) return m_muxed_inputs[m_mcu_port6>>5]; else return 0xff; with m_muxed_inputs = { P4, DSW, P1, P2 }.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:464 The "pin" side of each port, i.e. what MAME's in callback returns.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:489 MAME_VERIFIED (namcona1.cpp machine_reset): m_mcu_port4 = 0 and m_mcu_port5 = 1.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:503 MAME_VERIFIED (m37710.cpp set_port_reg): the out callback fires only when the direction register is non-zero, and it is handed (data & dir), not data.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:508 MAME_VERIFIED (namcona1.cpp port4_w).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:515 MAME_VERIFIED (namcona1.cpp port5_w): m_mcu_port5 = data; m_mcu_port5 &= 0xfe; m_mcu_port5 |= ((m_mcu_port5 & 0x2) >> 1); MAME's own comment is "not sure yet, but MCU code requires this interaction at least", so this is MAME_VERIFIED and no
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:528 MAME_VERIFIED (namcona1.cpp port8_w).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:543 MAME_VERIFIED (m37710.cpp ad_control_w and ad_timer_cb).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:663 MAME latches the whole period when the timer is started (m_reload[timer]) and never looks at the register again; the real part reloads the counter from the register at every underflow.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:704 MAME_VERIFIED: proc_mode_r returns the register masked with 0xF7; watchdog_timer_w (0x60) is a kick with no timer behind it in MAME either, and watchdog_freq (0x61) is a plain register.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:711 It was NOT true of this register, and that omission is what makes seven sets in this family need a canned EEPROM in MAME.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:721 MEASURED in MAME, quiztou, 1800 frames, blank 28C16 against factory image (tools/procmode.lua, tools/deadman.lua):
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:730 So the game finishes programming a blank EEPROM -- byte-for-byte the image MAME ships, cmp reports no differences -- and then deliberately stops feeding the switch to ask for a reset.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:734 0x15 is the normal mode and 0x1D is 0x15 with bit 3 set, and MAME's own proc_mode_r masks that bit off on read (`& 0xf7`, m37710.cpp:879), which is what a write-only self-clearing reset bit looks like.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:736 MAME latches the byte and does nothing (m37710.cpp:882-886), so its board never resets and the game sits on the NOTICE screen forever -- which is the whole reason for "Canned EEPROM data ...
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:742 Three things agree meanwhile: the BIOS writes exactly this value at exactly this moment, MAME masks exactly this bit on read, and a machine reset applied at that moment makes the game boot (tools/watchdog_test.lua -- attract mode, INSERT CO
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:827 namcona1.cpp never calls set_input_line(M37710_LINE_IRQ2), although c70.bin does give 0x7F a priority of 4 at 0xC0E7 and clears its request bit at 0xC0EA, so the pin may well be wired to something not yet identified.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:890 m37710.cpp keeps the pending set in LINE_IRQ and its int_control_w touches neither direction, so in MAME a write can neither set nor clear a request; the readable bit 3 just goes stale.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:905 MAME_VERIFIED (namcona1.cpp): a 68000 write to mailbox slot 4 raises M37710_LINE_IRQ0 (= line 19) and vblank raises M37710_LINE_IRQ1 (= 18).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:947 write-only in MAME; we read back
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:959 write-only in MAME
- projects/namco/na1_na2/rtl/mcu/na2_c70_hle.sv:12 c70.bin at 0x00C62E, with the data bank register set to $20 (the shared work RAM window): LDM #$0000, $0000 LDM #$0004, $0002 LDM #$C000, $0004 LDM #$0000, $0006 then at 0x00C646 "LDM #$0C,$0A" sets port P4 bit 3, which MAME's port4
- projects/namco/na1_na2/rtl/mcu/na2_c70_hle.sv:53 MAME's simulate_mcu() writes workram[0x0F60] = 0 once per frame and its own comment says "FIXME: These two functions shouldn't be necessary?".
- projects/namco/na1_na2/rtl/mcu/na2_c70_hle.sv:395 MAME raises MCU IRQ1 at vblank and the BIOS polling routine at 0x00D26E is the obvious consumer, but the call site has not been traced yet, so the *rate* is an assumption even though the addresses are confirmed.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:6 In one line: this is the only open-source 7700-series core that exists, it is production code in a released MiSTer core (Namco System 11's C76, the same m37702m2_device MAME uses for our C70), and it was measured executing our own c70.bin f
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:31 Found by instruction-diffing this core against MAME running the same c70.bin; see docs/c70_rtl_boot.md.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:36 Upstream never needed it because the System 11 BIOS does not use those opcodes -- and the survey that measured "none of the missing opcodes appear in reachable code" was measuring a MAME trace in which command 7 is never serviced, so this c
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:55 d. TAD / TBD set N and Z; MAME's OP_TAD sets no flag.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:56 e. MPY set N from the product's top bit; MAME always clears it.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:57 f. DIV set N from the quotient; MAME clears it (and leaves it alone on overflow).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:64 The check is sim/tb_na2_m37702_ops.sv + sim/run_ops.sh (9,324 directed vectors, oracle tools/ops_model.py, mutation test tools/ops_mutants.py -- 31 of 31 seeded faults caught); docs/m37702_ops_check.md has the reference semantics, the evide
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:69 the long-indirect addressing modes added -- [dp] and [dp],Y. Upstream had no 24-bit-pointer effective-address plumbing on any page, so 07/17/27/37/47/57/67/77/87/97/A7/B7/C7/D7/E7/F7 on the base page, the same sixteen on the 0x42 page (MAM
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:88 [dp],Y adds Y to the whole 24-bit address with carry into the bank, because MAME's EA_DLIY() (m37710il.h:202) adds REG_Y to a uint32_t and masks nothing.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:133 Timer A2 tick (1-cycle pulse); vector 0xFFEA -- NA2: was 0xFFF0 in the comment; the code arms 0xFFEA, which is what MAME says
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:166 The sound driver computes a voice's volume as `MPY $30,X` at 0x00E250, and MAME's own trace of the scene where the melody is missing has A=0x46BC B=0x0043 immediately afterwards while the board plays that note at a volume of 1.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:203 HOLD_LINE semantics for the EXTERNAL INT0/INT1/INT2 pins: MAME asserts these via set_input_line(HOLD_LINE) from 60 Hz timers and the line stays asserted until the CPU ACKNOWLEDGES (takes) the IRQ.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:234 For [dp],Y the Y index is added to the whole 24-bit address and carries into the bank: MAME m37710il.h:202 EA_DLIY() = OPER_24_D() + REG_Y, no masking.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:291 Dividend B:A is left-aligned in div_num and shifted into the partial remainder; div_quot accumulates the FULL 2w-bit quotient (needed for MAME's overflow test).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:477 Timer A2 (MAME m37710_irq_vectors)
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:546 Full MAME 89-page dispatch (m37710op.h OP(201..21f)): dxi,s,d,dli,imm,a,al,diy,di,siy,dx,dliy,ay,ax,alx.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:548 NA2 modification 6 added dli(07)/dliy(17), so every mode MAME lists is now dispatched here and the 89 page has no halt arm left.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:568 DIV (unsigned): B:A / SRC -> quotient A, remainder B. MAME 89-page dispatch (m37710op.h OP(22x/23x)): dxi,s,d,dli,imm,a,al, diy,di,siy,dx,dliy,ay,ax,alx.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:570 NA2 modification 6 added dli(27)/dliy(37); every mode MAME lists is dispatched here now.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:572 NOTE: MAME's 89 page has NO signed DIVS — MPYS/DIVS are 7750-block opcodes (28x-2bx) that MAME leaves unimplemented; unsigned only.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:592 MAME's OP_XAB with FLAG_SET_M swaps m_a with m_ba only, so in 8-bit mode the two HIGH bytes stay where they are: A=0x1234 B=0x5678 becomes A=0x1278 B=0x5634, not A=0x5678 B=0x1234.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:633 MAME splits each accumulator into m_a/m_b and each index into m_x/m_xh, so in 8-bit mode a transfer moves ONE BYTE and leaves the other half of the destination alone (m37710op.h OP_TAX / OP_TBX / OP_TXA / OP_TXB, all four M/X variants).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:637 sim/tb_na2_m37702_ops.sv measured the difference: TXA with M=1, A=0x1234, X=0x0010 gave A=0x0010 here and A=0x1210 in MAME.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:656 NA2: TAD/TBD set N and Z here and MAME's OP_TAD/OP_TBD set no flag at all.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:708 (MAME OP_PHP/OP_PLP push/pull two bytes unconditionally.) A 1-byte PLP left the C76's TB1-ISR stack off by one (LDA #imm16/PHA/PLP idiom) -> RTI derailed -> the mailbox was never serviced.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:933 The 0x42 page re-decodes through this same case with use_b='1', which is what gives MAME's ORB/ANDB/EORB/ ADCB/STB/LDB/CMPB/SBCB dli+dliy (OP 107..1f7).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1051 [dp] and [dp],Y form the pointer address exactly as (dp) does -- MAME EA_DLI() is OPER_24_D(), and OPER_24_D()'s address is EA_D(), the same one (dp) uses.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1118 ea still holds the direct-page pointer address here, so +2 is that address, not the target -- same arithmetic MAME does in m37710i_read_24_direct (address, address+1, address+2).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1136 For [dp],Y the index is added to the full 24-bit address and is allowed to carry out of the bank, because MAME's EA_DLIY() adds REG_Y to a uint32_t with no mask.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1180 M37710 JMP/JSR (abs,X): pointer table lives at PG:(abs+X) — MAME read_16_AXI(REG_PG | u16(abs + REG_X)).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1187 Caught by diffing this core against MAME running the same c70.bin: at the C70's interrupt dispatcher JSR ($8160,X), X=0x1A, MAME read [0x817A] = 0xD8C8 and this core read [0x8194] = 0xCFD5.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1243 MAME m37710 OP_RLA rotates REG_A only and does NOT touch any flags (N/Z/C unchanged) — so NO set_nz here (corrupting flags caused a mis-branch -> derail to the 0xC000 BIOS string).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1327 1 : 0` and m37710il.h reads N back as `FLAG_N & 0x80`, so that 1 can never set it: MAME's MPY always leaves N clear.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1329 It is visible in MAME's own attract trace -- 5 of 321 multiplies produce a product with bit 15 set and N is clear after every one of them.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1332 MAME is the reference of record here AND is the only implementation measured to play this game's in-game music, so matching it is the safe direction.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1345 (89-page) unsigned divide, per MAME OP_DIV (m37710op.h): m=0: (B<<16|A) / SRC16 ; m=1: ((B&FF)<<8|(A&FF)) / SRC8 quotient -> A (truncated to w), remainder -> B; V=C=1 on quotient overflow (N then unchanged), Z from truncated quot.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1351 zero divide: MAME m37710i_interrupt_software(0xfffc) pushes PG, PC (past the operand), IPL, PS, sets I, PG=0, PC=[FFFC].
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1353 (Shared entry path also clears D and re-loads IPL; MAME's software trap leaves both alone, so pass the current IPL.)
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1394 synthesis translate_on writeback per MAME OP_DIV; remainder is exact (< divisor), quotient is the full 2w-bit value truncated to w for A. NA2: on a non-overflowing divide N is CLEARED, for the same reason as MPY above -- OP_DIV writes `FLAG
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1400 On overflow MAME skips the assignment altogether, so N keeps its previous value; both branches below already do that.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1631 X and Y need no such care: MAME's debugger reports m_x, which an 8-bit pull leaves in 0x00..0xFF, and that is what operand holds.
- README.md:36 아래 표의 "MAME 픽셀 일치" 는 이전 검증에서 실기 스크린샷이 MAME 0.289 가 그린 같은 장면과 68,096 픽셀 중 0 픽셀 차이였다는 뜻입니다 (세트당 최소 한 프레임).
- README.md:39 | MAME set | 공식 명칭 | MCU | 상태 |
- README.md:41 | `bkrtmaq` | Bakuretsu Quiz Ma-Q Dai Bouken (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:42 | `cgangpzl` | Cosmo Gang the Puzzle (US) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:43 | `cgangpzlj` | Cosmo Gang the Puzzle (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:44 | `exvania` | Exvania (World) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:45 | `exvaniaj` | Exvania (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:46 | `fghtatck` | Fighter & Attacker (US) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:47 | `fa` | F/A (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:48 | `swcourt` | Super World Court (World) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:49 | `swcourtj` | Super World Court (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:50 | `swcourtb` | Super World Court (World, bootleg) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:51 | `emeraldaj` | Emeraldia (Japan) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:52 | `emeraldajb` | Emeraldia (Japan Version B) | C69 | 실기 동작, MAME 픽셀 일치 |
- README.md:53 | `tinklpit` | Tinkle Pit (Japan) | C69 | 실기 동작, MAME 픽셀 일치, 게임 플레이 확인 |
- README.md:54 | `numanath` | Numan Athletics (World) | C70 | 실기 동작, MAME 픽셀 일치, 게임 플레이 확인 |
- README.md:55 | `numanathj` | Numan Athletics (Japan) | C70 | 실기 동작, MAME 픽셀 일치, 게임 플레이 확인 |
- README.md:57 | `knckheadj` | Knuckle Heads (Japan) | C70 | 실기 동작, MAME 픽셀 일치 |
- README.md:58 | `knckheadjp` | Knuckle Heads (Japan, Prototype?) | C70 | 실기 동작, MAME 픽셀 일치 |
- README.md:59 | `emeralda` | Emeraldia (World) | C70 | 실기 동작, MAME 픽셀 일치 |
- README.md:60 | `emeraldajd` | Emeraldia (Japan Version D) | C70 | 실기 동작, MAME 픽셀 일치 |
- README.md:61 | `quiztou` | Nettou! Gekitou! Quiztou!! (Japan) | C70 | 실기 동작, MAME 픽셀 일치 |
- README.md:63 사운드는 21개 세트 전부 실기에서 voice 가 MAME 와 같은 패턴으로 발음되는 것을 계측했고, `numanath` 는 사람이 직접 BGM·효과음을 들어 확인했습니다.
- README.md:70 `zelos` / `zelost` / `bbbingo` / `bbbingot` 은 별도 구성(KEYCUS 없음)이며 MAME 에서도 `MACHINE_NOT_WORKING` 입니다.
- README.md:86 직접 마련한 MAME ROM 세트 zip 을 SD 카드의 `/games/mame/` 에 넣습니다.
- README.md:88 zip 은 MAME 세트 이름 그대로 두고, 압축을 풀지 않습니다.
- README.md:164 새 MAME 픽셀 대조나 오디오 파형 대조를 수행했다는 뜻은 아닙니다.
- README.md:183 **2026-08-23** — Emeraldia·Knuckle Heads 를 MAME 와 프레임 단위로 대조.
- README.md:186 **2026-08-24** — Quiztou 가 빈 EEPROM 에서 첫 부팅 시 ADDRESS ERROR 로 죽는 원인 규명: 코어가 아니라 **게임 ROM 자체의 버그**(서브루틴이 D7 을 보존하지 않음)이며 MAME 도 진짜 빈 EEPROM 에서는 똑같이 죽음.
- README.md:189 **2026-08-26** — NA-1 (C69) 13개 세트 전부 실기 동작, 전부 MAME 와 픽셀 일치.
- README.md:200 SDRAM 지연 때문에 거의 모든 버스 사이클에 wait state 가 붙어 실효 속도가 66~78 % 로 떨어지고 있었고, 그 결과 lag 프레임이 MAME 의 1.4~1.8 배, 어트랙트의 페이드 단계가 빠지는 현상이 있었습니다.
- README.md:202 DTACK 가 늦을 때 CPU 위상을 멈췄다가 멈춘 만큼만 되갚는 방식으로 고쳐 lag 비율이 MAME 대비 0.96~1.07 배가 됐습니다.
- README.md:209 같은 BIOS 를 MAME 와 나란히 돌려 **144,534 명령어를 레지스터 단위까지 대조해 불일치 0** 입니다.
- README.md:211 **68000 ↔ MCU 메일박스** — MCU 가 명령 7 에 응답하려면 메일박스 슬롯 2 의 doorbell 비트가 필요하고, 공유 RAM 창의 16비트 접근은 MAME 의 모델과 바이트 순서가 다릅니다.
- README.md:216 `c140.cpp` 를 읽은 해석이 아니라 MAME 가 실제로 낸 어트랙트 오디오와 대조해 차이 0 (모듈 머리말 기준 219,619 샘플).
- README.md:219 **비디오** — 블리터, 타일맵, 스프라이트(셰도 테이블 포함), ROZ, 픽셀 라인 모드를 각각 MAME 동작의 골든 모델과 대조하고 결함을 일부러 심어 테스트벤치가 잡는지(뮤테이션 테스트) 확인했습니다.
- README.md:221 그다음 실행 중인 MAME 의 비디오 메모리를 꺼내 실제 RTL 로 렌더링해 MAME 의 그림과 RGB 로 비교했습니다.
- README.md:222 그래픽이 꺼진 동안 게임이 배경색에 잠깐 쓰는 값 때문에 연두색 띠가 번쩍이던 현상은 MAME 처럼 배경색을 유지하도록 고쳤습니다.
- README.md:224 MAME 의 `machine().rand()` 자리에는 LFSR 을 넣었습니다.
- README.md:225 Tinkle Pit 의 C367 은 알고리즘으로 답하며, MAME 의 알고리즘과 FBNeo 의 32개 출력 표가 서로 일치하는 것을 확인한 뒤 구현했습니다.
- README.md:236 MAME 메모리로 돌린 시뮬레이션에서 잘리던 Emeraldia·Tinkle Pit 장면이 MAME 와 픽셀 단위로 같아졌습니다.
- README.md:242 이 코어는 **MAME 팀**의 수십 년에 걸친 작업 없이는 불가능했습니다.
- README.md:242 NA-1/NA-2 드라이버와 M37710 CPU, C140/C219 사운드 코어에 담긴 지식이 이 RTL 의 사양서였고, 실행 중인 MAME 의 화면·오디오·명령어 흐름이 모든 검증의 기준이었습니다.
- README.md:245 — https://www.mamedev.org/ · https://github.com/mamedev/mame
- README.md:263 참고한 MAME 소스
- README.md:265 MAME 코드는 RTL 에 복사하지 않았습니다.
- README.md:265 동작을 읽고 MAME 를 돌려 비교한 뒤 독립적으로 구현했으며, 아래 파일 이름과 줄 번호를 RTL 주석에 근거로 남겼습니다.
- README.md:268 | MAME 파일 | 라이선스 | copyright-holders | 참고한 내용 |
- README.md:270 | `src/mame/namco/namcona1.cpp` | BSD-3-Clause | Phil Stroffolino | 메모리 맵, 블리터, KEYCUS, 메일박스, MCU 포트, ROM 정의, 기판 메모 |
- README.md:271 | `src/mame/namco/namcona1_v.cpp` | BSD-3-Clause | Phil Stroffolino | 타일맵·스프라이트·ROZ·팔레트·우선순위, 비디오 레지스터 맵 |
- README.md:272 | `src/devices/cpu/m37710/m37710.cpp`, `m37710.h` | BSD-3-Clause | R. Belmont, Karl Stenerud | M37702M2 내부 레지스터 맵, 인터럽트 벡터 |
- README.md:274 | `src/devices/sound/c140.cpp` | BSD-3-Clause | R. Belmont | C219 레지스터, 키온, 뱅킹, mu-law, 믹서 |
- README.md:275 | `src/emu/tilemap.cpp` | BSD-3-Clause | Aaron Giles | ROZ 샘플링(`draw_roz`)과 스크롤 의미 |
- README.md:277 **FinalBurn Neo** (`d_namcona1.cpp`) 는 사실 확인용 교차 대조로만 읽었습니다 — 예를 들어 ROZ 필드 해석과 Tinkle Pit KEYCUS 출력 표.
- README.md:286 참고한 MAME 파일은 모두 BSD-3-Clause 이며 위 표에 출처를 밝혔습니다.
- README.md:287 해당 조건·면책 전문은 [`LICENSES/MAME-BSD-3-Clause.txt`](LICENSES/MAME-BSD-3-Clause.txt)에 함께 제공합니다.
- README.md:303 MAME 는 이 문자열을 하드코딩해 통과합니다.
- README.md:312 MAME 대조는 MAME 0.289 기준입니다.
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 20
- projects/namco/na1_na2/rtl/na2_top.sv:1131 Every other link in ROM -> blitter -> CG/shape RAM -> renderer -> pixel is now verified against MAME's own data, so if the spark is still wrong on the board it is one of these three, and one screenshot during the event names it.
- projects/namco/na1_na2/rtl/keycus/na2_keycus.sv:41 MAME_VERIFIED + FBNEO_CROSSCHECK, and the two are independent: MAME (namcona1.cpp, NAMCO_TINKLPIT) runs the algorithm, while FBNeo (d_namcona1.cpp tinklpit_keycus_read) hard-codes the first 32 outputs as a table -- somebody there ran it onc
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:32 With the interrupt at 224 the board drew the dolphin ONLY in raw lines 227..240 -- the band between the two handlers, the 227 being interrupt latency -- and with it at 256 the picture matches MAME.
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:9 Registers (MAME_VERIFIED: blit() in src/mame/namco/namcona1.cpp, FBNEO_CROSSCHECK: blit() in d_namcona1.cpp -- identical) vreg[0x1] source format selector vreg[0x4] destination format selector vreg[0x6] gfx bank; 3 selects t
- projects/namco/na1_na2/rtl/video/na2_palette.sv:35 MAME_VERIFIED, and against MAME's *output* rather than its source: the rule is floor(channel * 0.6), on the 8-bit channel after decode.
- projects/namco/na1_na2/rtl/video/na2_roz.sv:50 MAME's convention is the one every other ROZ driver uses, and `dx = 46` was tuned against it, so this follows MAME.
- projects/namco/na1_na2/rtl/video/na2_bgpal_hold.sv:4 EMULATION_DERIVED Matches MAME namcona1_v.cpp:131-143 and 564-572: a palette write while vreg[0x8E] (GFX enable) is zero is stored in palette RAM but not shown; the palette device is rebuilt from RAM at the next draw with graphics enabled.
- projects/namco/na1_na2/rtl/video/na2_video.sv:460 MEASURED 2026-08-26: with this defined the four .mame/dump-emeralda-sea frames render pixel-exact against MAME -- 1289, 1476, 1367 and 1231 differing pixels all go to zero -- with no change to any rule in this renderer.
- projects/namco/na1_na2/rtl/video/na2_dbg.sv:221 All three answered their question -- no voice leaves work RAM, and the PCM matches MAME's sets -- so they carry the volume registers instead.
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:15 Address map, MAME_VERIFIED from namcona1_mcu_map (reference/mame/ namcona1.cpp) and the internal map in reference/mame/m37710.cpp:
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:11 Register addresses are MAME_VERIFIED from the M37702M2 internal map in reference/mame/m37710.cpp (BSD-3-Clause), and the board-level behaviour of ports P4-P8 is MAME_VERIFIED from reference/mame/namcona1.cpp.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:192 MAME never sets bit 3 of the UART control register 0 and never raises a UART interrupt, and the game runs, so this follows MAME.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:595 UARTs -- MAME_VERIFIED, and modelled exactly as far as MAME models them (which is: they hold their registers and never do anything).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:779 MAME_VERIFIED, the M37710_LINE_* numbering (reference/mame/m37710.h) and the vectors (m37710_irq_vectors, m37710.cpp):
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:897 Honouring the clear and ignoring the set satisfies both, and matches what MAME effectively does for the set.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:16 MAME_VERIFIED vectors from m37710_irq_vectors (reference/mame/m37710.cpp:393): TA0 0xFFEE, TA1 0xFFEC, TA4 0xFFE6, TB2 0xFFE0.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:41 stale vector numbers in the port comments corrected to match the code and MAME (the code was already right; only the comments were wrong).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:43 the 0x42 (B accumulator) and 0x89 (multiply/divide) prefix pages checked opcode by opcode against MAME's own m37710op.h and eight defects fixed.
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:447 IPL-masked priority interrupt acceptance (matches MAME m37710i_update_irqs): take the highest-priority PENDING source whose IC priority STRICTLY exceeds the current IPL (I-flag clear), and raise IPL to it on entry (RTI restores IPL).
- projects/namco/na1_na2/rtl/mcu/na2_m37702_cpu.vhd:1190 5 of 5 RTL sites matched abs+2X and 14 of 14 MAME sites matched abs+X. docs/c70_rtl_boot.md.
MAMEから移植・書き写した、または取り入れたと記載 — 1
MAMEの近似をそのまま採用 — 2
MAMEドライバと同じ文言を含む(出典の明記なし) — 19
- projects/namco/na1_na2/rtl/na2_top.sv:1380 against; c140.cpp's own notes say the 219's base pitch is the C352's — 共通の文言: devices/sound/c140.cpp:42
- projects/namco/na1_na2/rtl/na2_top.sv:1453 (MAME_VERIFIED, namcona1.cpp: add_route(0, "speaker", 1.00, 1) and — 共通の文言: namco/namcona1.cpp:1079
- projects/namco/na1_na2/rtl/na2_top.sv:1454 add_route(1, "speaker", 1.00, 0)). Whether that is the PCB's wiring or — 共通の文言: namco/namcona1.cpp:1080
- projects/namco/na1_na2/rtl/memory/na2_eeprom.sv:38 one "otherwise game would lock up on 1st boot"). So a blank part is the — 共通の文言: namco/namcona1.cpp:1183
- projects/namco/na1_na2/rtl/video/na2_crtc.sv:20 MAME_VERIFIED: set_visarea(0, 38*8-1, 4*8, 32*8-1) over a 320x256 bitmap. — 共通の文言: namco/namcona1.cpp:1066
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:125 accepts `dest >= 0xf00000*2 && dest < 0xf02000*2` -- 0x1E00000-0x1E03FFF — 共通の文言: namco/namcona1.cpp:356
- projects/namco/na1_na2/rtl/video/na2_blitter.sv:152 "dest and source are provided as dword offsets": byte address = 2 * value, — 共通の文言: namco/namcona1.cpp:453
- projects/namco/na1_na2/rtl/video/na2_palette.sv:44 MAME's own TODO says "non-shadow pixels for sprites flagged to enable — 共通の文言: namco/namcona1_v.cpp:13
- projects/namco/na1_na2/rtl/video/na2_linebuf.sv:37 (MAME_VERIFIED: pdraw_tile, `dest[x] = palette_shadow_table[dest[x]]`) — 共通の文言: namco/namcona1_v.cpp:330
- projects/namco/na1_na2/rtl/video/na2_roz.sv:18 startx = (xoffset << 12) + incxx*dx + incyx*dy — 共通の文言: namco/namcona1_v.cpp:455
- projects/namco/na1_na2/rtl/video/na2_roz.sv:19 starty = (yoffset << 12) + incxy*dx + incyy*dy — 共通の文言: namco/namcona1_v.cpp:456
- projects/namco/na1_na2/rtl/video/na2_pixline.sv:11 is "a simplification, but produces the correct behavior for the only game — 共通の文言: namco/namcona1_v.cpp:502
- projects/namco/na1_na2/rtl/video/na2_pixline.sv:18 pDest[x+1] = paldata[data & 0xff]; — 共通の文言: namco/namcona1_v.cpp:438
- projects/namco/na1_na2/rtl/mcu/na2_c70.sv:270 that is exactly why its C70 "never responds to the version string — 共通の文言: namco/namcona1.cpp:574
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:449 if ((m_mcu_port6 & 0x80) == 0) return m_muxed_inputs[m_mcu_port6>>5]; — 共通の文言: namco/namcona1.cpp:733
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:510 if ((data & 0x08) && !(m_mcu_port4 & 0x08)) ... CLEAR_LINE — 共通の文言: namco/namcona1.cpp:695
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:518 m_mcu_port5 |= ((m_mcu_port5 & 0x2) >> 1); — 共通の文言: namco/namcona1.cpp:718
- projects/namco/na1_na2/rtl/mcu/na2_m37702_periph.sv:519 MAME's own comment is "not sure yet, but MCU code requires this — 共通の文言: namco/namcona1.cpp:706
- projects/namco/na1_na2/rtl/mcu/na2_c70_hle.sv:55 "FIXME: These two functions shouldn't be necessary?". FBNeo does the same — 共通の文言: namco/namcona1.cpp:191