← コア一覧
Namco_NB1 (kyledlester)
MAMEとの相違点を記載 — 1
- README.md:143 **In MAME, turning it on flips the background but every sprite disappears**, because MAME does not emulate the sprite chip's screen flip.
MAMEのソースを引用 — 186
- NB1.sv:102 Status bits (docs/M16_IMPLEMENTATION.md): 0 Reset, 1 Re-run ROM check, (2 Display, 3 Background: removed in M21), 4 Program cache, 5 Service mode, (6 Freeze, 7 Test switch, 8 Controls: removed in M22 -- reserved, never reused, so saved sett
- NB1.sv:155 0 = ROM stream (fixed platform layout, nb1_mem_pkg) 2 = board configuration record (M7: KEYCUS part description; nb1_board_config) 3 = M2 check record (diagnostic; expected CRC32s, generated from MAME metadata) 1 = EEPROM image (M18): the M
- NB1.sv:517 M16: the game's MAME orientation (record v2; else ROT90)
- NB1.sv:845 Held in reset until the 68020 writes $400018 = 1; every such write restarts it and a write of 0 halts it (MAME cpureg_w).
- NB1.sv:847 INT0/INT2: MAME's free-running 60 Hz sources (provisional, nb1_c75_irq).
- NB1.sv:1153 M13: the C355 position and bank registers are sampled at the CPU vblank (MAME: once per frame at vblank), before the VBL handler rewrites them; the sprite-RAM snapshot and the frame switch stay at the video vblank.
- NB1.sv:1180 M21: OSD "Sprite zoom", 0 = Continuous (default), 1 = MAME
- NB1.sv:1287 M17 native 15-kHz output: the bundle above IS the native NB-1 raster (MAME totals 384 x 264 at clk_sys/16 = 6.048 MHz: 15.750 kHz, 59.659 Hz, progressive; 288 x 224 active; HSync 32 px from pixel 310, VSync 3 lines from line 231; free-runni
- rtl/nb1/nb1_board_config.sv:11 Record, 16 bytes, little-endian fields: 0-3 "NB1B" 4 version = 1, 2 (M16) or 3 (M25) 5 record length in bytes = 16 6-7 0 8 KEYCUS mode: 0 = no KEYCUS answer (every word reads $0000), 1 = ID word + changing word (C3xx "ID + r
- rtl/nb1/nb1_c116_palette.sv:4 MAME's namco_c116 device and the documented PCB wiring expose a 32 KiB, byte-addressed CPU window containing three 8 KiB x 8 palette SRAMs and eight 16-bit C116 registers:
- rtl/nb1/nb1_c116_palette.sv:20 M10 video side [MAME-SOURCE namco_c116.cpp, namconb1.cpp screen_update]: * each plane is true dual-port (nb1_dp_ram, same 8 M10K per plane as the M4 single-port store); port A is the unchanged CPU port, port B the read-only pen port.
- rtl/nb1/nb1_c116_palette.sv:23 vid_pen (13-bit pen = MAME colour index) is registered by the RAM; vid_rgb is valid one clk_sys later and holds.
- rtl/nb1/nb1_c116_palette.sv:25 The MAME pen -> RAM mapping is the CPU one: pen = {A14:A13, A10:A0}.
- rtl/nb1/nb1_c123_ctl.sv:4 MAME maps NB-1 $660000-$66003F to namco_c123tmap control16_r/_w [MAME-SOURCE namconb1.cpp maincpu_am, namco_c123tmap.cpp]: 32 16-bit words, byte lanes merged with COMBINE_DATA, read back unchanged, no mirrors, and no device_reset (power-up
- rtl/nb1/nb1_c123_ctl.sv:7 Word meanings (docs/M10_RESEARCH.md): w1, w5, w9, w13 layer 0-3 scroll X (bits 8-0); w1 bit 15 = global flip w3, w7, w11, w15 layer 0-3 scroll Y (bits 8-0) w16-w21 layer 0-5 priority (bits 2-0), bit 3 = layer disabled w24-w29
- rtl/nb1/nb1_c123_ctl.sv:19 Nebulas Ray never reads it (M5 captures); MAME returns the word.
- rtl/nb1/nb1_c123_ctl.sv:36 synthesis translate_on Quartus: power-up zero for the registers (MAME std::fill 0)
- rtl/nb1/nb1_c123_render.sv:6 Behaviour is MAME 0.289's [MAME-SOURCE namco_c123tmap.cpp, tilemap.cpp, namconb1.cpp screen_update]; docs/M10_RESEARCH.md derives every formula below and scripts/research/nb1_m10_ref.py restates it (that model equals MAME pixel for pixel on
- rtl/nb1/nb1_c123_render.sv:20 MAME quirk not copied [IMPLEMENTATION-DECISION]: MAME negates a scroll value at the moment it is written if the flip bit is set at that moment, so a scroll register written before a flip change keeps the old sign.
- rtl/nb1/nb1_c123_render.sv:33 writer 8 pixels per tile row into the line buffer, 1 per clk_sys, opaque and on-screen pixels only (painter's order = MAME order).
- rtl/nb1/nb1_c123_render.sv:326 MAME order: priority 0..7, then layer 0..5 (one candidate per clk)
- rtl/nb1/nb1_c123_vram.sv:4 MAME maps NB-1 $640000-$64FFFF to namco_c123tmap videoram16_r/_w [MAME-SOURCE namconb1.cpp maincpu_am, namco_c123tmap.cpp]: a flat array of 32,768 16-bit words, word index = A15:A1, no mirrors inside the window, no CPU-visible side effects,
- rtl/nb1/nb1_c123_vram.sv:15 Storage is not cleared by reset: MAME's C123 has no device_reset and the PCB VRAM is external SRAM.
- rtl/nb1/nb1_c123_vram.sv:17 Simulation and M10K configuration power up to zero, as MAME's allocation does.
- rtl/nb1/nb1_c352.sv:4 Behavioural contract = MAME 0.289 src/devices/sound/c352.cpp (docs/M15_RESEARCH.md section 1); scripts/research/nb1_m15_c352.py restates it and equals MAME's own 84 kHz output sample for sample on a 60 s Nebulas Ray capture.
- rtl/nb1/nb1_c352.sv:18 Output s16(sum >> 3) (16-bit wrap, as MAME).
- rtl/nb1/nb1_c352.sv:22 Access timing [IMPLEMENTATION, = MAME's stream rule]: C75 writes are posted in a 16-entry FIFO and applied only while no sample is being rendered, so every write affects the samples rendered after it.
- rtl/nb1/nb1_c352.sv:24 Reads wait only for the posted writes (read after write): flags, control and unmapped offsets (flip-flops) are answered one clock after the FIFO is empty, even during a render (M16: the firmware polls flags ~900 times/s, and waiting for the
- rtl/nb1/nb1_c352.sv:31 Voice ROM: SDRAM region VOICE (2 MiB populated; MAME's 16 MiB window reads 0 above it) through one 8-byte line per voice.
- rtl/nb1/nb1_c352.sv:130 ---------------------------------------------------------------- mu-law (MAME m_mulawtab)
- rtl/nb1/nb1_c352.sv:179 >= 2 MiB: MAME's zero-filled window
- rtl/nb1/nb1_c352.sv:239 execute key-ons / key-offs (MAME c352_device::write offset 0x202)
- rtl/nb1/nb1_c352.sv:291 key-on play state (MAME: pos = bank:start, samples 0, counter 0xFFFF, volumes 0)
- rtl/nb1/nb1_c352.sv:329 decode, then advance the position (MAME fetch_sample)
- rtl/nb1/nb1_c352.sv:383 s16(sum >> 3): MAME's wrap
- rtl/nb1/nb1_c355_ram.sv:4 MAME [MAME-SOURCE namconb1.cpp maincpu_am, namco_c355spr.cpp]: $600000-$61FFFF sprite RAM, 64K words, read/write.
- rtl/nb1/nb1_c355_render.sv:4 Behaviour = MAME 0.289 namco_c355spr for NB-1 [MAME-SOURCE; derivation and MAME pixel comparisons in docs/M11_RESEARCH.md].
- rtl/nb1/nb1_c355_render.sv:5 The per-line formulation used here is scripts/research/nb1_m11_ref.py hw_render(), proven bit-equal to MAME's frame renderer on 259 captured frames.
- rtl/nb1/nb1_c355_render.sv:9 Frame pipeline (MAME set_buffer(2)): vblank V (line 224) CAPTURE: copy what the C355 needs from sprite RAM -- clip windows, the display list, per listed sprite its attributes and format entry, and its tile-table cells -- plus the tile ban
- rtl/nb1/nb1_c355_render.sv:18 So a frame shows the sprite RAM of the vblank two vblanks before the one that ends it (MAME: copy, render, compose), with the position of the vblank that starts it.
- rtl/nb1/nb1_c355_render.sv:22 Line renderer (per line, sprites in list order; later sprites overwrite): walker per sprite: position/anchor/clip set-up and a vertical reject; per grid row: MAME's exact size distribution (th = rem/rows, screen height sh = round(zoom*16)
- rtl/nb1/nb1_c355_render.sv:38 M20 native (game) flip [INFERRED, docs/M20_RESEARCH.md]: C355 position word 2 ($620004), which MAME stores and never reads, is the C355's screen flip.
- rtl/nb1/nb1_c355_render.sv:41 Without it MAME (and M11-M19) drew no sprites at all in that mode.
- rtl/nb1/nb1_c355_render.sv:42 Display line Y shows MAME sprite line KY - Y, and a pixel MAME would draw at x lands at KX - x, with KX = 436, KY = 462 in MAME's sprite coordinates (visible window [149, 436] x [239, 462]).
- rtl/nb1/nb1_c355_render.sv:46 M21 EXPERIMENTAL continuous zoom (zoom_cont = 1, OSD; default 0 = MAME) [docs/M21_RESEARCH.md]: instead of MAME's per-tile shares with a per-tile restart of the source index, one accumulator per axis runs across the whole sprite.
- rtl/nb1/nb1_c355_render.sv:48 For an axis of n tiles drawn at size S: step = 65536 when S == 16n, else (n * floor(2^28 / S)) >> 8 (= MAME's floor(2^20 / S) for n = 1); logical pixel j (0 ..
- rtl/nb1/nb1_c355_render.sv:123 M21: widened from 2^20 / n (same 3 M10K); the MAME path uses bits [27:8] = floor(2^20 / n) exactly.
- rtl/nb1/nb1_c355_render.sv:199 On an axis whose format offset (dx/dy, zoom-scaled by the walker) is 0 the screen position is exactly sext11(pos - xs/ys) (MAME get_single_sprite); a sprite more than 16 pixels outside the 288 x 224 screen on such an axis draws nothing (the
- rtl/nb1/nb1_c355_render.sv:271 sprite set-up (positions are 16-bit signed: MAME uses int)
- rtl/nb1/nb1_c355_render.sv:320 M21 timing: MAME-path span-end indices
- rtl/nb1/nb1_c355_render.sv:324 M20: the MAME sprite line evaluated for display line rline (registered: first used 4+ clocks after rline changes, in W_SF)
- rtl/nb1/nb1_c355_render.sv:448 cell count and space check for this sprite, registered (timing) a disabled sprite (width or height 0) reads no cells, like MAME
- rtl/nb1/nb1_c355_render.sv:544 visible window in MAME sprite coordinates: [0, 287] x [0, 223], flipped [149, 436] x [239, 462]
- rtl/nb1/nb1_c355_render.sv:577 ------------------------------------------------ rows (MAME order)
- rtl/nb1/nb1_c355_render.sv:666 16.16 source index at both ends of the clipped span (MAME x_index)
- rtl/nb1/nb1_c75.sv:4 The C75 is a Mitsubishi M37702M2 with Namco's 16 KiB internal BIOS (MAME namcomcu.cpp: NAMCO_C75 = m37702m2_device, ROM c75.bin), clocked at 16.128 MHz = XTAL/3 (namconb1.cpp NAMCO_C75(..., 48.384_MHz_XTAL / 3)).
- rtl/nb1/nb1_c75.sv:11 Address map [MAME-SOURCE m37702m2_device::map + namconb1 namcoc75_am]: $000000-$00007F SFRs (na1_c69_sfr: ports, timers, A-D, interrupts) $000080-$00027F internal RAM, 512 bytes (on-chip; not cleared by reset) $002000-$002FFF C352 regist
- rtl/nb1/nb1_c75.sv:23 Shared RAM lanes [MAME-SOURCE share_r / C75 .ram() on the same u16 array]: the 16-bit word is the same value on both sides.
- rtl/nb1/nb1_c75.sv:28 Ports [MAME-SOURCE namconb1 port6_r/port6_w/port7_r, dac_bit_r]: P6 reads back what was last written (data & dir); P7 = {P4, MISC, P1, P2, $FF...} selected by P6[7:4] = 0,2,4,6 (else $FF); A-D channel n = $0080 when its P3 bit is set, else
- rtl/nb1/nb1_c75.sv:32 The board inputs arrive active low (MAME IP_ACTIVE_LOW); with nothing pressed every one is $FF.
- rtl/nb1/nb1_c75.sv:35 Interrupts: INT0 / INT2 are external pulses (nb1_c75_irq); INT1 is not connected in MAME.
- rtl/nb1/nb1_c75.sv:87 board inputs, active low (MAME P1, P2, P3, P4, MISC)
- rtl/nb1/nb1_c75.sv:98 instructions whose bus waits exceeded MAME's cycle count
- rtl/nb1/nb1_c75.sv:162 [IMPLEMENTATION] MAME's internal RAM starts zeroed; physical power-up [UNKNOWN].
- rtl/nb1/nb1_c75_irq.sv:4 [MAME-SOURCE namconb1.cpp] The C75's INT0 and INT2 come from two periodic 60 Hz timers ("mcu_irq0" / "mcu_irq2", HOLD_LINE), started with the machine and never reset, both firing at the same instants.
- rtl/nb1/nb1_c75_irq.sv:6 MAME marks the source "TODO: Real sources of these" and keeps 60 Hz because "has to be 60 hz or music will go crazy in nebulray, vshoot, gslugrs*".
- rtl/nb1/nb1_c75_irq.sv:11 [IMPLEMENTATION, provisional, docs/M8_RESEARCH.md section 6] This module reproduces MAME: one free-running counter of exactly 96.768 MHz / 60 = 1,612,800 clk_sys, not reset by anything (like MAME's timers it runs from configuration), pulsin
- rtl/nb1/nb1_clock_enables.sv:5 All NB-1 clocks are exact integer divisions [MAME-SOURCE, namconb1.cpp]:
- rtl/nb1/nb1_cpu.sv:136 NB-1 uses autovectors only [MAME-SOURCE]
- rtl/nb1/nb1_cpu_map_pkg.sv:4 One function classifies a 24-bit 68EC020 byte address (the EC020 has 24 address lines, so A31-A24 never reach the board) into the NB-1 map of MAME's namconb1_state::maincpu_am [MAME-SOURCE namconb1.cpp line 1048].
- rtl/nb1/nb1_cpu_map_pkg.sv:18 CLS_RAMX marks addresses MAME maps as RAM but M3 does not back with storage (see the RAM sizing note in docs/M3_IMPLEMENTATION.md); it is kept separate from the device classes so an access there is visibly a sizing question, not a missing d
- rtl/nb1/nb1_cpu_map_pkg.sv:25 MAME maps 64 KiB; Nebulas Ray was measured to use $1C0000-$1C03FF only (M0 capture, 1800 frames: stack top $1C0400, vectors, RAM ISR).
- rtl/nb1/nb1_cpu_map_pkg.sv:28 Every NB-1 game measured (MAME captures, docs/M25_IMPLEMENTATION.md) stays below $1C0500 (Point Blank's RAM test is the largest: $1C0000-$1C04FF).
- rtl/nb1/nb1_cpu_map_pkg.sv:41 MAME RAM not backed in M3: $1C4000-$1CFFFF, $240000-$2FFFFF
- rtl/nb1/nb1_cpu_map_pkg.sv:52 not decoded by MAME at all
- rtl/nb1/nb1_cpu_ram.sv:10 The array powers up as 0 (M10K default), like MAME's RAM.
- rtl/nb1/nb1_cpu_raster.sv:4 docs/M13_RESEARCH.md sections 4, 6 and 8: MAME draws tile line T with the C123/C116 state at the start of raster line T+1 (Nebulas Ray's update_to_line_before_posirq: the POS handler of line T has already run).
- rtl/nb1/nb1_dp_ram.sv:7 M24 collision rules (Quartus infers these arrays with mixed-port read-during-write = DONT_CARE, where an M10K returns undefined data): * a port that reads a byte lane the other port writes in the same clk_sys gets the newly written byte (by
- rtl/nb1/nb1_eeprom.sv:4 MAME maps NB-1 $580000-$5807FF to an EEPROM_2816 (eeprom_parallel_28xx, 2048 x 8) with 8-bit read/write handlers and no unit mask [MAME-SOURCE namconb1.cpp maincpu_am, machine/eeprompar.cpp].
- rtl/nb1/nb1_eeprom.sv:6 MAME therefore presents the device on every byte lane with byte offset A10:A0: the 68EC020 sees 2 KiB of contiguous big-endian bytes, and word and longword accesses read/write consecutive EEPROM cells [MAME-CONFIRMED, docs/M6_RESEARCH.md se
- rtl/nb1/nb1_eeprom.sv:17 Write timing: MAME builds eeprompar with EMULATE_POLLING 0, so a write is visible to the next read (no busy period, no DQ7 data-polling complement).
- rtl/nb1/nb1_eeprom.sv:19 Every Nebulas Ray EEPROM store is followed by a whole-byte read-back poll that exits on equality, so an immediate write exits that poll on its first iteration with the same program flow as MAME (docs/M6_RESEARCH.md section 5).
- rtl/nb1/nb1_eeprom.sv:25 Power-on and reset: MAME's nvram_default fills a set without an "eeprom" region (nebulray has none) with $FF, the erased state.
- rtl/nb1/nb1_eeprom.sv:28 Reset does not touch the array (MAME's reset only clears the write-completion timer; the part is non-volatile).
- rtl/nb1/nb1_gun.sv:4 [MAME-SOURCE namconb1.cpp gunbulet_state] The gun games add an I/O board read at $100000-$10001F (32-bit handler gun_r, the value in bits 31:24 of each longword, i.e. the byte at $100000 + 4n; every other byte reads 0): n = 0, 1 Y of playe
- rtl/nb1/nb1_gun.sv:9 n = 4, 5 Y of player 1 0x0F + LIGHT0_Y * 224 / 255 n = 6, 7 X of player 1 0x26 + LIGHT0_X * 288 / 314 LIGHTn_X/Y are MAME light-gun ports, 0..255 across the visible screen (288 x 224).
- rtl/nb1/nb1_gun.sv:11 The trigger is the player's button 1 on the normal C75 input port (nb1_inputs); MAME has no other gun signal.
- rtl/nb1/nb1_gun.sv:24 Exact integer forms of MAME's arithmetic for every 0..255 port value (checked exhaustively): v * 288 / 314 = (v * 3757) >> 12, v * 224 / 255 = (v * 28785) >> 15.
- rtl/nb1/nb1_gun.sv:65 ---------------------------------------------------------------- gun counts (MAME gun_r)
- rtl/nb1/nb1_inputs.sv:7 This module only forms the five MAME `namconb1` port bytes, active low [MAME-SOURCE namconb1.cpp INPUT_PORTS namconb1]: P1-P4 bit 0 right, 1 left, 2 down, 3 up, 4 button 1, 5 button 2, 6 button 3, 7 start MISC bit 0 Freeze Screen DIP (SW
- rtl/nb1/nb1_inputs.sv:26 0 = MAME's mapping.
- rtl/nb1/nb1_keycus.sv:4 MAME maps NB-1 $6E0000-$6E001F to namconb1_state::custom_key_r, a 32-bit read handler, and ignores writes (nopw) [MAME-SOURCE namconb1.cpp maincpu_am, custom_key_r].
- rtl/nb1/nb1_keycus.sv:15 Mode 0 (no record, invalid record, or a board without a KEYCUS answer): every word reads $0000, as MAME's default path.
- rtl/nb1/nb1_keycus.sv:20 Changing value [IMPLEMENTATION-DECISION, docs/M7_RESEARCH.md section 5]: MAME uses host rand(); the physical C3xx generator is [UNKNOWN].
- rtl/nb1/nb1_keycus.sv:21 This is a 16-bit maximal-length Galois LFSR (taps $B400, period 65,535), stepped once per KEYCUS read cycle of ANY word (MAME re-rolls on every custom_key_r call), and a read of the changing word returns the state before its step.
- rtl/nb1/nb1_keycus.sv:28 The sequence depends only on the number of KEYCUS reads, not on time, so a run is deterministic and the MAME reference script can reproduce it exactly (scripts/mame/nb1_m4_ref.lua policy m7).
- rtl/nb1/nb1_main_bus.sv:18 EEPROM $580000-$5807FF M6 CPU-visible 2816 (2 KiB contiguous bytes, all lanes); M18: second storage port for MiSTer NVRAM (nv_*) KEYCUS $6E0000-$6E001F M7 generic C3xx (16 words; ID/changing word from the MRA board record; writes ignored)
- rtl/nb1/nb1_main_bus.sv:29 The rest of cpureg $400000-$40001F (unknown level and ack, watchdog, ...) stays unimplemented; every cpureg read returns $FF like MAME.
- rtl/nb1/nb1_main_bus.sv:265 M25: CLS_RNG = the random generator $1E4000-$1E4003 [MAME-SOURCE randgen_r: machine().rand(), a new value per read; srand_w a no-op] -- here a free-running 32-bit LFSR, so successive reads differ -- and the gun I/O board $100000-$10001F [MA
- rtl/nb1/nb1_main_bus.sv:542 ------------------------------------------------------------ C75 control [MAME-SOURCE namconb1_state::cpureg_w case 0x18] bit 0 = 1: HALT clear, RESET assert + clear; bit 0 = 0: HALT.
- rtl/nb1/nb1_main_bus.sv:546 CPU reset halts it (MAME's C75 runs from power-on until the 68020's first instruction halts it; holding it instead is harmless, docs/M8_RESEARCH.md).
- rtl/nb1/nb1_main_irq.sv:4 Behavioural model of the VBL part of the NB-1 cpureg interrupt logic, exactly as MAME models it (namconb1_state::scantimer / cpureg_w / machine_reset, docs/M9_RESEARCH.md sections 2-3):
- rtl/nb1/nb1_main_irq.sv:10 Bits 7-4 are ignored like MAME.
- rtl/nb1/nb1_main_irq.sv:12 line 224 at the start of scanline 224 (vbl_event), if the level is nonzero, the VBL request is raised and HELD: MAME uses ASSERT_LINE, not HOLD_LINE, so the CPU's interrupt acknowledge does not withdraw it.
- rtl/nb1/nb1_main_irq.sv:18 reset level 0, nothing requested (MAME machine_reset).
- rtl/nb1/nb1_main_irq.sv:20 Reads of the cpureg bytes are not decoded here: MAME returns $FF for every cpureg read, which is what the bus's unimplemented path already returns.
- rtl/nb1/nb1_main_irq.sv:23 [IMPLEMENTATION-DECISION] Two cases MAME cannot tell us about: * a level write or ack in the same clk_sys cycle as vbl_event: the event wins (evaluated with the newly written level), so a VBL is never lost to a coincident register write.
- rtl/nb1/nb1_main_irq.sv:28 * levels 8-15: MAME would pass them to set_input_line as nonexistent 68000 lines; the 68EC020 has three IPL pins.
- rtl/nb1/nb1_main_irq.sv:30 No NB-1 game in MAME writes them.
- rtl/nb1/nb1_main_irq.sv:32 M13: POS (raster position) source, same MAME model (namconb1_state:: scantimer / cpureg_w, docs/M13_RESEARCH.md section 2):
- rtl/nb1/nb1_main_irq.sv:43 Levels: the 68020 sees the highest requested level of the two sources, as MAME's separate input lines do.
- rtl/nb1/nb1_main_irq.sv:46 MAME clears the shared CPU input line of the old level; if the game ever gave POS and VBL the same level, a level write would there also withdraw a pending VBL.
- rtl/nb1/nb1_mem_pkg.sv:9 Byte order [IMPLEMENTATION-DECISION, docs/M2_RESEARCH.md section 7]: every region holds MAME's region bytes in MAME's byte order, and a 32-bit read at offset A returns {byte A, A+1, A+2, A+3} (big-endian lanes, the 68EC020 bus order: D31-24
- rtl/nb1/nb1_mem_pkg.sv:18 id region MAME region window SDRAM base
- rtl/nb1/nb1_nvram.sv:5 Platform level: nothing here knows which NB-1 game is loaded (every NB-1/NB-2 set has one 2 KiB 28C16, MAME EEPROM_2816; docs/M18_RESEARCH.md).
- rtl/nb1/nb1_nvram.sv:12 The MRA sends an erased image on the same index just before it (<rom index="INDEX">, $FF x 2048; a game whose MAME set has an "eeprom" default region would send that region instead), so the contents are defined whether or not a save exists.
- rtl/nb1/nb1_nvram.sv:21 File format = MAME's nvram/<set>/eeprom: cell 0 first.
- rtl/nb1/nb1_orientation.sv:26 `game_rot` = the game's MAME orientation in quarter turns CW (board record v2 byte 13: ROT0 0, ROT90 1, ROT180 2, ROT270 3): the raster turned CW by game_rot shows the game upright, so the game's up points to screen direction -game_rot + d.
- rtl/nb1/nb1_orientation.sv:31 With Game orientation (0) the stick is the game's own (rot_q = 0; MAME's mapping, e.g. a physically rotated monitor).
- rtl/nb1/nb1_reset.sv:15 Emulated NB-1 hardware therefore always starts at the same raster position and clock-enable phase, like MAME's power-on at vpos 0.
- rtl/nb1/nb1_reset.sv:16 That makes FPGA runs reproducible and comparable with MAME frame-numbered traces.
- rtl/nb1/nb1_rom_check.sv:11 For an interleaved region, each lane of a 32-bit word is its own CRC: a ROM_LOAD32_WORD pair gives two lanes (bytes 0-1 and 2-3 of every longword), so each lane's CRC equals the CRC32 MAME lists for that EPROM file.
- rtl/nb1/nb1_rom_check.sv:14 That checks byte-lane placement against MAME metadata directly.
- rtl/nb1/nb1_rom_loader.sv:11 This one swap is the only data transformation in the loader; the MRA already delivers MAME's region bytes in MAME's order.
- rtl/nb1/nb1_share_lock.sv:8 MAME interleaves the CPUs in time slices, so the C75's read and write-back never have a 68020 write between them.
- rtl/nb1/nb1_video_out.sv:4 Per displayed pixel [MAME-SOURCE namconb1.cpp screen_update, namco_c116.cpp]: 1.
- rtl/nb1/nb1_video_out.sv:7 mixer (C156 on the PCB) [MAME-SOURCE namconb1 sprite_mix_callback]: the tile pen is $1000 + bank*256 + pixel of the topmost opaque tile layer (priority p, 0 where none).
- rtl/nb1/nb1_video_out.sv:14 C116 output: pen -> 8-bit R/G/B from the palette RAMs (video port of nb1_c116_palette); black outside the C116 clip window X + $4A >= reg0, X + $4A < reg1, Y + $21 >= reg2, Y + $21 < reg3 (16-bit signed registers, MAME's clip rectangle), an
- rtl/nb1/nb1_video_timing.sv:4 Counter frame: MAME's namconb1 screen, set_raw(48.384 MHz/8, 384, 0, 288, 264, 0, 224): hcount 0..383 per line, hcount 0..287 active [MAME-SOURCE] vcount 0..263 per frame, vcount 0..223 active [MAME-SOURCE] pixel 6.048 MHz, 15.750 kH
- rtl/nb1/nb1_video_timing.sv:13 MAME maps those to x 0..287 and y 0..223 by subtracting $4A and $21 (namconb1_state::screen_update).
- rtl/nb1/nb1_video_timing.sv:18 Sync placement: NOT established by MAME or any document we have (MAME gives only totals and active bounds).
- rtl/nb1/nb1_video_timing.sv:63 Single clk_sys pulse in the ce_pix cycle before vcount becomes V_ACTIVE (the MAME VBLANK IRQ point), for future interrupt logic.
- rtl/vendor/m37702/na1_c69_sfr.sv:6 Behavioural contract [MAME-CONFIRMED] = MAME 0.289 m37710.cpp (m37702m2_device::map, port_r/w, get_port_reg/set_port_reg, count_start_w, m37710_recalc_timer, m37710_timer_cb, ad_control_w, ad_timer_cb, uart*_w, set_int_control, m37710_set_i
- rtl/vendor/m37702/na1_c69_sfr.sv:10 Reproduced MAME properties that differ from the datasheet (deliberately, see docs/M20B_IMPLEMENTATION.md sections 2-3): a started timer never stops; timer registers read back the written reload value; interrupt-control bit 3 is a register i
- rtl/vendor/m37702/na1_c69_sfr.sv:17 Timing [IMPLEMENTATION]: MAME schedules timer/A-D starts at the time of the register write, which is the end of the writing instruction's cycle budget; the core signals that boundary with instr_commit and the starts are applied there.
- rtl/vendor/m37702/na1_c69_sfr.sv:20 Periods count ce_mcu ticks (MAME clocks_to_attotime in input clocks).
- rtl/vendor/m37702/na1_c69_sfr.sv:21 MAME_EARLY=1 reproduces a MAME arithmetic artefact [MAME-CONFIRMED by the f140 trace, docs/M20B_IMPLEMENTATION.md section 7]: 2*floor(1e18/12528250) as is one attosecond less than floor(1e18/6264125), so every expiry lands just below a CPU-
- rtl/vendor/m37702/na1_c69_sfr.sv:33 MAME never stops a started timer; COUNT_STOP=0 (default) keeps exactly that upstream behaviour.
- rtl/vendor/m37702/na1_c69_sfr.sv:40 ports: inputs as the board drives them (MAME p*_in_cb; unbound ports read $FF)
- rtl/vendor/m37702/na1_c69_sfr.sv:44 A-D inputs (MAME analog callbacks)
- rtl/vendor/m37702/na1_c69_sfr.sv:56 MAME line numbers
- rtl/vendor/m37702/na1_c69_sfr.sv:67 timers: MAME timer objects
- rtl/vendor/m37702/na1_c69_sfr.sv:80 ------------------------------------------------------------ helpers port index for byte address $02-$14 (MAME port_r<0>/<1> layout), -1 = none
- rtl/vendor/m37702/na1_c69_sfr.sv:105 MAME get_port_reg
- rtl/vendor/m37702/na1_c69_sfr.sv:109 byte read of the SFR space (MAME handlers; unmapped -> 0)
- rtl/vendor/m37702/na1_c69_sfr.sv:133 one byte write (side effects handled by the caller where MAME has them)
- rtl/vendor/m37702/na1_c69_sfr.sv:163 MAME timer period: tscales[mode>>6] * (reg + 1) = (reg + 1) << {1,4,6,9}; 0 = no timer
- rtl/vendor/m37702/na1_c69_sfr.sv:168 not timer mode: no MAME timer
- rtl/vendor/m37702/na1_c69_sfr.sv:183 ------------------------------------------------------------ interrupt resolver (m37710i_update_irqs) MAME scans the lines from 19 down to 0 and takes each one whose priority is strictly above both the CPU's ipl and the best seen so far: th
- rtl/vendor/m37702/na1_c69_sfr.sv:249 ---- instruction boundary: apply MAME's time-of-write side effects
- rtl/vendor/m37702/na1_c69_sfr.sv:261 ---- timers and A-D on the MAME clock
- rtl/vendor/m37702/na1_m37702.sv:3 Behavioural contract [MAME-CONFIRMED] = MAME 0.289 src/devices/cpu/m37710/ (m37710op.h opcode macros, m37710il.h EA/stack helpers, m37710.cpp interrupt entry / reset).
- rtl/vendor/m37702/na1_m37702.sv:5 No physical M37702 behaviour has been measured; where MAME is known to deviate from the datasheet (see docs/M20B_IMPLEMENTATION.md section 2) the MAME behaviour is reproduced deliberately, because the F/A BIOS is proven to run on it and the
- rtl/vendor/m37702/na1_m37702.sv:10 Microarchitecture [IMPLEMENTATION]: microsequenced 16-bit core on clk_sys, single little-endian 16-bit bus (byte lanes; a 16-bit access at an odd address is two byte accesses in address order), data accesses issued in MAME's order (push hig
- rtl/vendor/m37702/na1_m37702.sv:14 Every instruction is padded to MAME's CLK cycle count in ce_mcu ticks (static part from na1_m37702_decode, dynamic extras added here) so timers/interrupts stay lock-step with MAME; bus wait states add on top.
- rtl/vendor/m37702/na1_m37702.sv:17 MAME's M37710 executes one CPU cycle per two input clocks (execute_clocks_to_cycles), while timer/A-D periods count input clocks; the core therefore spends one cycle per two ce_mcu ticks and the SFR block counts every tick.
- rtl/vendor/m37702/na1_m37702.sv:26 instr_commit pulses at each instruction boundary (before the interrupt decision): SFR side effects that MAME time-stamps at the end of the writing instruction (timer / A-D starts) are applied there.
- rtl/vendor/m37702/na1_m37702.sv:33 MCU input clock tick (12.528 MHz); one MAME CPU cycle = 2 ticks
- rtl/vendor/m37702/na1_m37702.sv:45 MAME cycles elapsed since reset (2 ce_mcu ticks each)
- rtl/vendor/m37702/na1_m37702.sv:56 MAME index-register view: only the low byte participates when X=1.
- rtl/vendor/m37702/na1_m37702.sv:119 ------------------------------------------------------------ ALU (MAME OP_* semantics) Decimal ADC/SBC low byte (MAME's nibble rule: correct the low nibble of the 8-bit sum when > 9, then the high nibble of the corrected value when > 9), co
- rtl/vendor/m37702/na1_m37702.sv:192 MAME VFLAG_ADD_16(SRC, REG_A, FLAG_C) with FLAG_C holding only the high-byte partial sum: bit 15 of (src^bh)&(acc^bh) = src[15]&acc[15]
- rtl/vendor/m37702/na1_m37702.sv:242 branch condition (MAME COND_*; fz=1 means zero)
- rtl/vendor/m37702/na1_m37702.sv:247 MAME's page-cross test for AX, AY and DIY: (base ^ (base + X)) & 0xff00
- rtl/vendor/m37702/na1_m37702.sv:313 MAME tests the page with X
- rtl/vendor/m37702/na1_m37702.sv:388 TXA/TYA (TXB/TYB): source is MAME's index view (8-bit value when X=1)
- rtl/vendor/m37702/na1_m37702.sv:436 MAME stores N as 0/1 and tests it with &0x80: always clear
- rtl/vendor/m37702/na1_m37702.sv:639 MAME: V = C = quotient (or remainder) does not fit; N cleared when no overflow
- rtl/vendor/m37702/na1_m37702.sv:691 MAME: the CPU sleeps until an interrupt is actually taken
- rtl/vendor/m37702/na1_m37702_decode.sv:1 GENERATED by scripts/m20b-decode.py from the MAME 0.289 m37710op.h opcode tables (TABLE_OPCODES / $42 B-accumulator prefix / $89 MPY-DIV prefix) and CLK_* accounting.
- README.md:23 Put the MAME 0.289 ROM zips in **`/media/fat/games/mame/`** (the set names are in the tables below).
- README.md:34 | Game | MAME set | Year | Genre | Board | Status |
- README.md:50 | Game | MAME set | Year | Parent game | Status |
- README.md:93 To fix it, delete that game's calibration file from the SD card and calibrate again: `/media/fat/config/<set>_gun_cal_0b9a_016a_v2.cfg`, for example `ptblank_gu
- README.md:110 Improvements over MAME
- README.md:112 MAME's `namconb1` driver (0.289) is the behavioural reference.
- README.md:112 During development the core was compared against MAME in simulation: the C75 MCU event-for-event, the picture pixel-for-pixel on captured scenes, and the sound
- README.md:115 The core deliberately goes beyond MAME in two places.
- README.md:117 Continuous sprite zoom (default), with MAME's zoom as a fallback
- README.md:120 MAME draws a zoomed sprite **one 16-pixel tile at a time**: it gives each tile a whole-pixel share of the screen, restarts the scaling at the start of every til
- README.md:123 Columns are dropped or doubled in clumps at the tile seams (MAME can skip up to six source columns at one seam where even scaling skips three), so scaled sprite
- README.md:134 **MAME**: MAME's per-tile zoom, bit-exact, as a fallback if you prefer the reference behaviour.
- README.md:137 The continuous mode is a quality improvement over MAME, not a claim about the PCB.
- README.md:176 Sound: the C352 at MAME's sample rate, stereo, with an optional stereo mix.
- README.md:179 OSD options: aspect ratio, scandoubler effects, orientation (Horizontal, Vertical CCW, Vertical CW, Flipped), sprite zoom (Continuous / MAME), gun aim and cross
- README.md:197 Palette fades on the bottom two picture lines can differ slightly from MAME.
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 2
- rtl/nb1/nb1_c355_render.sv:44 Model-proven pixel-exact against MAME's unflipped frames rotated 180 degrees (scripts/research/nb1_m20_flip.py).
- rtl/nb1/nb1_gun.sv:13 The game turns these raw counts into screen positions with the calibration in its EEPROM (MAME's default "eeprom" region, loaded by the MRA), so matching MAME's mapping keeps the default calibration right.
MAMEの近似をそのまま採用 — 1
MAMEドライバと同じ文言を含む(出典の明記なし) — 2