← All cores
Arcade-NamcoS2_LW
Cites MAME source — 117
- NamcoS2.sv:98 180 degrees in the core, on every video path (ns2_flipbuf); a ROT180 set (MAME's Bubble Trouble) starts turned, and this turns it back
- NamcoS2.sv:338 MAME's power-on analog and dial values (M5 maps the controls onto them)
- NamcoS2.sv:363 Byte 0 is MAME's DSW port (the MCU's $2000; bit 7 the test switch).
- NamcoS2.sv:377 Keyboard: MAME's default bindings, always live, ORed with the pads.
- NamcoS2.sv:418 Inputs: MAME's ports (namcos2.cpp NAMCOS2_MCU_PORT_*_DEFAULT), active low.
- NamcoS2.sv:427 The sets with a wheel and pedals, light guns or Metal Hawk's stick map the analog sticks and the mouse onto AN0-AN7 (ns2_controls, the set's control mode in config byte 33); the others keep MAME's power-on values.
- NamcoS2.sv:758 Audio: MAME's routes (namcos2.cpp), both stereo, the set's own gains (config bytes 36-37, x128; NS2-26): the C140 at 0.75 (base2 and Metal Hawk 1.0, base3 0.45), the YM2151 at 0.80 (base3 1.0).
- NamcoS2.sv:760 Each chip first through its anti-imaging interpolator (ns2_fir4: 4x, MAME's resampler's response in the passband, NS2-26 and NS2-29): a held sample has images above the chip's Nyquist (the C140's 10.67 kHz, jt51's 27.97 kHz, which MiSTer's
- rtl/cheats.sv:1 Cheat engine — applies Pugsy MAME-database pokes to work RAM once a frame.
- rtl/cheats.sv:34 Poke semantics follow MAME's "run" state: the value is written every frame for as long as the cheat is enabled, which is what makes "infinite" cheats hold against the game decrementing the counter.
- rtl/ns2_board.sv:9 Line events, at the start of the line (MAME's scanline timer): 200 the MCU's IRQ1, 240 both C148s' VBLANK, (reg5 - 32) & 0xff POSIRQ.
- rtl/ns2_board.sv:23 inputs (MAME's ports)
- rtl/ns2_c123.sv:1 C123 tilemaps (namco_c123tmap.cpp; tools/ns2_model.py tilemap_layer is the specification): renders one line of the six planes into the composition line buffer, in MAME's draw order (priority 0..7, then plane 0..5), each opaque pixel overwri
- rtl/ns2_c123.sv:51 The planes in MAME's draw order (priority 0..7, then plane 0..5) are listed first; then a fetch engine fills slot bank k & 1 for the k-th listed plane while the pixel engine draws the plane before it from the other bank: a line costs about
- rtl/ns2_c140.sv:1 C140 (MAME c140.cpp): 24 PCM voices, the register file, the key-on status and the INT1 timer that drives the 6809's FIRQ.
- rtl/ns2_c140.sv:3 0x000-0x17f 24 voices x 16 registers: 0 volume right, 1 volume left, 2-3 frequency, 4 bank, 5 mode (key-on on bit 7, or bit 6 while keyed; bit 4 loop, bit 3 compressed), 6-7 start, 8-9 end, 10-11 loop (sample words within the bank) 0x1f8
- rtl/ns2_c140.sv:14 The voices, as MAME's sound_stream_update, one sample per base-rate tick (21.333 kHz: clk / 2304; MAME_RATE = 1 uses MAME's stream edges instead, its integer 21333 Hz, for the sample-exact comparison): offset += frequency * 2; pos += offset
- rtl/ns2_c140.sv:24 MAME computes the samples whose edge has passed before it applies a register write, so a write never reaches a sample being computed: the voice register writes wait in a queue while the voices run (the CPU's view, the register reads and the
- rtl/ns2_c140.sv:29 Voice ROM words: c140_rom_r (namcos2_m.cpp), the schematics' wiring: word address bit 21 picks voice1/voice2 for bits 15-8, bit 20 low enables voice0's nibble for bits 7-4, bit 19 low picks its low nibble.
- rtl/ns2_c140.sv:48 the output, one sample per tick; raw_*: MAME's mixer sums (debug)
- rtl/ns2_c140.sv:77 the timer counts clocks from the write, as MAME's (an exact duration, not the base-rate ticks' edges): (reload + 1) * 2 * 2304 clocks
- rtl/ns2_c140.sv:120 the voices' state (MAME's C140_VOICE)
- rtl/ns2_c140.sv:150 MAME's compressed table: j = (s8)i; s1 = j & 7; s2 = abs(j >> 3) & 31; v = ((0x80 << s1) & 0xff00) + (s2 << (s1 ?
- rtl/ns2_c140.sv:167 MAME's put_int_clamp(v, 4096): +-1.0 full scale, as 16 bits
- rtl/ns2_c140.sv:273 the key-on decision is MAME's, at the write
- rtl/ns2_c140.sv:337 MAME's per-sample step, voice ev
- rtl/ns2_c148.sv:1 C148: a 68000's interrupt controller and board control (namco_c148.cpp).
- rtl/ns2_c148.sv:13 MAME drives the 68000's input line of the source's level, not a per-source OR: a trigger sets the line of the source's current level, an ack (or a level write, which acks first) clears it, whatever else shares the level.
- rtl/ns2_c148.sv:94 line and hold are updated in order (blocking): the events of one clock apply as MAME applies them, one after another the acknowledge of a held level
- rtl/ns2_c169.sv:1 C169 ROZ (namco_c169roz.cpp; tools/ns2_model.py c169_params / c169_rows / draw_c169 are the specification): renders one line of both layers, layer 1 then layer 0, each into its own line buffer with its priority and colour per pixel (the per
- rtl/ns2_c169.sv:110 no wrap (word [1] bit 11, NS2-42, as MAME's namco_c169roz.cpp since 51864eb6632): the 12-bit position is the map position itself, and only the layer's window of the 4096 x 4096 map, [left, left + size) x [top, top + size), is drawn; a pixel
- rtl/ns2_c355.sv:1 C355 sprites (namco_c355spr.cpp; tools/ns2_c355hw.py is the specification, proven equal to MAME's frame algorithm, tools/ns2_model.py sprites_c355).
- rtl/ns2_c45.sv:1 C45 road (namco_c45road.cpp draw; tools/ns2_model.py road_line is the specification): renders one line of the road into the ROZ line buffer (a board has one or the other), with the line's priority.
- rtl/ns2_c65.sv:1 The C65 I/O MCU (MAME namco65.cpp): the HD63705 (rtl/ns2_hd63705.v, NS2-7) at 2.048 MHz (its crystal clock: a clock enable every 24 clocks) and its memory map: 0000-003f RAM, reads of 01 (MCUB), 02 (MCUC), 03 (port D: the analog inputs over
- rtl/ns2_c65.sv:13 IRQ1 (line 200) and the A/D interrupt are latched until the core fetches their vectors (0x1ff8, 0x1fea), as MAME's pending interrupts.
- rtl/ns2_c65.sv:14 MAME holds the IRQ1 input (HOLD_LINE) until the core enters any interrupt, and the core latches IRQ1 only when that input changes: a line-200 event while the input is still held is lost.
- rtl/ns2_c65.sv:40 inputs (MAME's ports, active low where the board is)
- rtl/ns2_c65.sv:78 MAME's IRQ1 input: held until an interrupt is taken
- rtl/ns2_c68.sv:1 The C68 I/O MCU (MAME namco68.cpp): an M37450 (rtl/ns2_m740.sv, NS2-9) at 8.192 MHz, a cycle every 4 clocks: 2.048 MHz, a clock enable every 24 clocks.
- rtl/ns2_c68.sv:3 Its on-chip peripherals as MAME's m3745x.cpp: 0000-00bf RAM 00d6-00dd ports P3-P6 and their direction 00e2-00e3 A/D 00fc-00ff interrupt requests and enables 0100-01ff RAM (the stack) and the board's map (c68_default_am
- rtl/ns2_c68.sv:16 Interrupts: MAME's m3745x maps the enabled requests to m740 lines; any raises irq and the lowest line gives the vector (0xfffc - 2 * line): requests 1 bit 2 (INT1, line 200's VBL) -> line 2, 0xfff8 requests 1 bits 3, 4 -> lines 3, 4; reque
- rtl/ns2_c68.sv:42 inputs (MAME's ports)
- rtl/ns2_c68.sv:50 MAME's taps see this access
- rtl/ns2_c68.sv:103 the ports' inputs (MAME's read_p callbacks)
- rtl/ns2_c68.sv:188 MAME's reset clears the requests: nothing from before the release
- rtl/ns2_controls.sv:1 The players' controls onto the I/O MCU's ports (namcos2.cpp's input ports): the digital ports MCUB, MCUC, MCUH and the eight analog channels AN0-AN7, per the set's control mode (config byte 33, tools/ns2_romdata.py): [1:0] 0 digital (MAME's
- rtl/ns2_controls.sv:14 Ghost!, Bubble Trouble); otherwise MCUH 5 and 4, the bombs MCUH 3 and 2 the wheel and pedals: [4] Start on MCUB 7 / 6 (Four Trax, Suzuka) [5] the gears on MCUB: 5 down (the d-pad's up, or B4), 7 up (the d-pad's down, or B3) (Dirt Fox) M
- rtl/ns2_controls.sv:23 A gun's value is its position across the board's own picture, 0 at the left (top) to 255 at the right (bottom), as MAME's crosshair maps it; the players aim at the displayed picture, turned 180 degrees when `flip`.
- rtl/ns2_controls.sv:26 Wheel: 0x01-0xff, 0x80 centred; accelerator 0-0x80, brake 0-0x40; Metal Hawk's stick and lever 0x20-0xe0 (MAME's PORT_MINMAX).
- rtl/ns2_controls.sv:27 A stick sets a value outright; a button or the d-pad moves it a step a frame, as MAME's key delta, and it returns when released.
- rtl/ns2_controls.sv:36 MAME's power-on AN0-AN7 (config bytes 21-28)
- rtl/ns2_controls.sv:45 MAME's power-on MCUDI0-3 (config bytes 29-32)
- rtl/ns2_controls.sv:109 ------------------------------------------------------------ the guns Each gun aims from the stick (or a MiSTer gun), the d-pad (8 a frame, MAME's key delta; it stays where it is left), or for player 1 the mouse: whichever moved last.
- rtl/ns2_controls.sv:174 ------------------------------------------------------------ Assault Two 4-way sticks a player, a tank's two tracks (MAME's assault ports): the left on MCUB (up, down, left) and MCUH 7/6 (right), the right on MCUH (up, down) and MCUDI0 (rig
- rtl/ns2_controls.sv:234 MAME's default ports (namcos2.cpp NAMCOS2_MCU_PORT_*_DEFAULT), active low
- rtl/ns2_cpu.sv:1 One of the two 68000s with its own bus (namcos2.cpp master_common_am / slave_common_am): fx68k at 12.288 MHz (a PHI1 and a PHI2 enable every 4 clocks of the 49.152 MHz clk), its program ROM, 64 KB of work RAM (the slave's 0x100000-0x13ffff
- rtl/ns2_cpu.sv:8 Interrupt acknowledges are answered with the autovector 24 + level (MAME's m68000 with the C148 on the IPL lines).
- rtl/ns2_cpu.sv:264 ext_in: MAME leaves it unconnected (7)
- rtl/ns2_fir4.sv:1 A sound chip's anti-imaging interpolator (NS2-26, NS2-29): its samples (one per in_stb) out at 4x through a 128-tap low-pass whose passband is MAME's own resampler's response (tools/ns2_firgen.py): a held sample puts images above the chip's
- rtl/ns2_hd63705.v:1 Derived from jt6805 (jotego/jtcores modules/jt680x @ 3eb8fec, GPL-3.0-or-later, rtl/third_party/jt680x) for the C65's HD63705Z0 as MAME implements it (hd6305.cpp, docs/PLAN.md D2): 16-bit addresses; the stack in page 1 (0x100-0x17f, 7 bits)
- rtl/ns2_hd63705_alu.v:1 Derived from jt6805 (jotego/jtcores modules/jt680x @ 3eb8fec, GPL-3.0-or-later, rtl/third_party/jt680x) for the C65's HD63705Z0 as MAME implements it (hd6305.cpp, docs/PLAN.md D2): 16-bit addresses; the stack in page 1 (0x100-0x17f, 7 bits)
- rtl/ns2_hd63705_ctrl.v:1 Derived from jt6805 (jotego/jtcores modules/jt680x @ 3eb8fec, GPL-3.0-or-later, rtl/third_party/jt680x) for the C65's HD63705Z0 as MAME implements it (hd6305.cpp, docs/PLAN.md D2): 16-bit addresses; the stack in page 1 (0x100-0x17f, 7 bits)
- rtl/ns2_hd63705_ctrl.v:66 MAME's order: IRQ1 before the A/D interrupt
- rtl/ns2_hd63705_regs.v:1 Derived from jt6805 (jotego/jtcores modules/jt680x @ 3eb8fec, GPL-3.0-or-later, rtl/third_party/jt680x) for the C65's HD63705Z0 as MAME implements it (hd6305.cpp, docs/PLAN.md D2): 16-bit addresses; the stack in page 1 (0x100-0x17f, 7 bits)
- rtl/ns2_key.sv:1 The key custom (namcos2_m.cpp namcos2_68k_key_r / _w): 8 word registers.
- rtl/ns2_key.sv:2 Per set, some offsets return a constant (the protection check); every other read returns MAME's random value, which the oracle patch makes the LFSR r = (r >> 1) ^ (r & 1 ?
- rtl/ns2_m740.sv:1 GENERATED by tools/ns2_740gen.py from MAME's devices/cpu/m6502 (dm740.lst, om740.lst, om6502.lst; BSD-3-Clause, Olivier Galibert): do not edit.
- rtl/ns2_m740.sv:3 The Mitsubishi 740 core of the C68's M37450, cycle for cycle as MAME's m740 (NS2-9).
- rtl/ns2_m740.sv:8 irq is MAME's m_irq_state (any enabled request), irq_vector its m_irq_vector; both are sampled at the opcode fetch, as MAME's prefetch_end.
- rtl/ns2_m740.sv:10 On reset the registers take MAME's power-on values and the core runs reset_m (the vector at 0xfffe).
- rtl/ns2_m740.sv:22 MAME's taps see this access (not read_pc, read_arg or a fetch)
- rtl/ns2_m740.sv:33 MAME's registers (blocking: the statements between two bus cycles run in C's order within one clock; the bus outputs are registered from b_*)
- rtl/ns2_m740.sv:72 ---------------------------------------------------------------- m6502.cpp
- rtl/ns2_m740.sv:197 ---------------------------------------------------------------- m740.cpp: T mode on m_TMP
- rtl/ns2_m740.sv:258 the prefetch's end: the opcode, then MAME's prefetch_end (the interrupt check)
- rtl/ns2_m740.sv:2416 MAME's STATE_RESET: reset_m from its start
- rtl/ns2_main.sv:1 The two 68000s and their shared bus (namcos2.cpp: namcos2_68k_default_cpu_board_am, common_default_am, common_finallap_am): the arbiter grants one access at a time (master first when both ask in the same clock); an access takes three clocks
- rtl/ns2_main.sv:179 the arbiter: the grant with the address, then the devices' read latency, then the capture (three clocks, the master first): the 68000 gets DTACK in time for no wait state, as in MAME
- rtl/ns2_main.sv:200 the boards' maps (namcos2.cpp): the CPU board's, then each graphics board's 0 standard: c00000 sprites, c40000 gfx_ctrl, c80000 ROZ RAM, cc0000 ROZ control, d00000 key 1 Final Lap: 300000 protection, 800000 sprites, 840000 gfx_ctrl, 880000
- rtl/ns2_main.sv:318 (MAME's umask16 reads: the other lane 0)
- rtl/ns2_main.sv:320 finallap_state::finallap_prot_r (namcos2_m.cpp): two tables on a counter that reads of words 3 and 1ffff advance
- rtl/ns2_mem.sv:10 It applies the board wiring MAME applies after loading (tools/ns2_romdata.py WIRING): Metal Hawk's sprite reorder (a byte lands in 0, 1 or 2 places) and its transposed copy for the rot90 sprites, and Lucky & Wild's bit-reversed C169 mask.
- rtl/ns2_mem.sv:18 WRAM_SD (the Suzuka and Lucky & Wild bitstreams): the 68000s' work RAMs and the C139's RAM are bank 1 clients that also write (ns2_wram_cache); the download first clears them, as MAME's RAM starts at 0 and the board's SDRAM keeps the last c
- rtl/ns2_mem.sv:28 MAME loads one byte lane of some 16-bit regions and leaves the other at 0: the C140 voices' odd bytes always, the data ROM's second megabyte where these say (rthun2: the odd bytes; suzuka8h: the even).
- rtl/ns2_mem.sv:106 Metal Hawk's reorder, per 4x4 block of a 32x32 tile: where a source byte (row r, column c in the block) goes; MAME's loop carries one byte into two places and drops another (tools/ns2_romdata.py _metlhawk_sprite)
- rtl/ns2_roz.sv:1 ROZ (A) (namcos2_roz.cpp draw_roz; tools/ns2_model.py roz_layer is the specification): renders one line of the ROZ plane into its own line buffer.
- rtl/ns2_roz.sv:3 The mixer resolves it against the tilemaps: MAME draws it after every plane of its priority or lower, so it wins over those and loses to higher ones.
- rtl/ns2_roz.sv:9 Without wrap a pixel is inside when xpos <= size and ypos < size (MAME's comparisons).
- rtl/ns2_sound.sv:1 The sound board (namcos2.cpp sound_default_am): the 6809 at 2.048 MHz (E and Q from clk: 24 clocks an E cycle), the YM2151 (jt51, 3.579545 MHz), the C140 (rtl/ns2_c140.sv), 8 KB of RAM and the DPRAM's third port.
- rtl/ns2_sound.sv:4 0000-3fff banked ROM (16 KB banks; c000-c001 writes select data >> 4) 4000-4001 YM2151 5000-51ff, 6000-61ff C140 (mirrored) 7000-77ff DPRAM (mirrored) 8000-9fff RAM a000-bfff amplifier enable (writes ignored) c000-ffff ROM (the re
- rtl/ns2_sound.sv:10 The YM2151's IRQ is not wired (MAME comments it out).
- rtl/ns2_sprite_a.sv:1 Sprites (A) (namcos2_sprite.cpp draw_sprites; tools/ns2_model.py sprites_a is the specification): renders one line of the 128 sprites of the bank gfx_ctrl & 0xf into the sprite line buffer, in list order, a later sprite overwriting an earli
- rtl/ns2_sprite_a.sv:7 MAME's zoom reduces to a screen size of sizex x sizey (sizex halved for 16x16), the source stepping by (gw << 16) / size per screen pixel, from the far edge when flipped: row = ((flipy ?
- rtl/ns2_sprite_a.sv:41 (gw << 16) / n for n = 1..64, gw = 16 or 32: MAME's zoom step, from a table of (32 << 16) / n (a divider does not fit a clock); for gw 16 it is halved, floor(floor(x / n) / 2) being floor(x / 2n)
- rtl/ns2_sprite_a.sv:74 the screen width: MAME's (scalex * gw + 0x8000) >> 16; Metal Hawk's scalex always divides by 0x20, so a 16-wide sprite is (sizex + 1) / 2
- rtl/ns2_sprite_a.sv:122 w0 is in: the line test (sh >= 2 is MAME's sizey - 1 != 0); Metal Hawk's position also depends on word 6, so it tests later
- rtl/ns2_video.sv:116 MAME's screen starts at the top of VBLANK (vpos 224)
- rtl/ns2_video.sv:156 MAME's POSIRQ line: (C116 register 5 - 32) & 0xff (namcos2 get_pos_irq_scanline)
- rtl/ns2_video.sv:239 the C116 sits on D7-D0 and takes any byte of the word (MAME's umask16(0x00ff).cswidth(16)): a byte write to the even address (UDS alone) writes too, with the byte the 68000 puts on both lanes
- rtl/ns2_video.sv:263 registers 6 and 7 read 0xff (namcos2_base_state::c116_r, MAME's "fix for finallap boot")
- rtl/ns2_video.sv:294 MAME's umask16 reads fill the other lane with 0
- rtl/ns2_video.sv:524 At equal priority MAME draws planes, then ROZ or road, then C169 layer 1, then layer 0: the pixel shows the last drawn, the largest {priority, order}
- rtl/ns2_ym_fifo.sv:2 jt51 applies an operator or key-on write over the next 32 of its cycles (64 with its half-rate phase), and a write before that cancels or redirects it; the games write every 26-28 cycles without reading the busy flag (Rolling Thunder 2: no
- README.md:12 The joystick games use MAME's default ports (one joystick, three buttons, Start, Coin, Service).
- README.md:24 **MAME as the reference.** MAME's `namco/namcos2.cpp` (K. Wilkins) and its devices, at a pinned commit (`deps.lock`), define the behaviour.
- README.md:28 **Gates are measurements.** Each milestone ends in a measured gate, not a judgement: the video against MAME's state (M1), the whole board against MAME's bus tra
- README.md:33 **Cycle-faithful CPUs.** Both 68000s, the 6809 and the I/O MCU (C65 or C68) run at MAME's clocks and bus timing.
- README.md:36 **Every set in MAME's driver**, including Final Lap 1-3, Four Trax and the NB-1 boards (Steel Gunner, Suzuka 8 Hours, Lucky & Wild).
- README.md:50 | Game | Year | MAME set | Bitstream | Controls | Alternates |
- README.md:108 **Cheats** from Pugsy's MAME cheat database: ten fixed slots (Infinite Time, Infinite Credits, P1/P2 Invincibility, P1/P2 Infinite Lives, P1/P2 Infinite Energy,
- README.md:126 The games on MAME's common ports have their own button names, and the buttons a game never reads are hidden: Cosmo Gang (Fire), Dragon Saber (Fire, Bomb), Marve
- README.md:140 or the d-pad's up, as MAME's ports.
- README.md:216 The C139 serial link between cabinets is not emulated (nor is it in MAME): each cabinet plays alone.
- README.md:250 Derived from MAME (BSD-3-Clause), besides its use as the behavioural reference:
- README.md:252 `rtl/ns2_m740.sv` (the C68's 740 core) is generated by `tools/ns2_740gen.py` from MAME's `dm740.lst`, `om740.lst` and `om6502.lst`, by Olivier Galibert; its hel
- README.md:256 `rtl/ns2_c140.sv` ports MAME's `sound/c140.cpp`, by R. Belmont.
- README.md:257 `tools/ns2_romdata.py` reads its ROM tables from MAME's `namcos2.cpp` (K. Wilkins and the MAME contributors).
Says it matches, follows or was checked against MAME — 1
- README.md:130 Each was checked in MAME, a press in play against the same run without it.
Shares text with the MAME driver without saying so — 3
- rtl/ns2_c123.sv:44 TilemapCB: bitswap<16>(code, 13,12,11,15,14,10..0); — shares text with namco/namcos2_v.cpp:12
- rtl/ns2_c123.sv:45 TilemapCB_finalap2: bitswap<15>(code, 13,12,11,14,10..0) — shares text with namco/namcos2_v.cpp:18
- rtl/ns2_main.sv:1 The two 68000s and their shared bus (namcos2.cpp: namcos2_68k_default_cpu_board_am, — shares text with namco/namcos2.cpp:682