← コア一覧
Arcade-ZN2Capcom (XelaNotPu)
MAMEのソースを引用 — 100
- ZN2.sv:1150 The real board feeds its CXD8661R a 100 MHz crystal vs ZN-1's 67.7376 (MAME: psxcpu executes clock/4 -> 25M vs 16.9M cycles/s = 1.476x).
- ZN2.sv:1191 Real hardware enforces these; MAME's interpreter may not.
- ZN2.sv:1745 The MRA loads the ROM STRAIGHT, so the byte select is INVERTED vs FX-1A to reproduce MAME's ROM_LOAD16_WORD_SWAP ordering (odd byte address -> low half, even -> high half).
- ZN2.sv:2053 (Was >>1, which made QSound too quiet.) Music/SFX balance (user report: music quieter than SFX): MAME capcom_zn routes QSound at 1.0 and the SPU at 0.35 => music:SFX = 2.86:1.
- ZN2.sv:2055 With QSound at x2 here, the SPU must sit at x0.6875 (>>1 + >>3 + >>4) => 2.91:1, within 0.15 dB of MAME.
- rtl/capcom_qsound.sv:5 MAME is cited in-file only as the behavioral ground-truth reference, not as a source of code.
- rtl/capcom_qsound.sv:15 Reference hardware: MAME src/mame/sony/zn.cpp capcom_zn_state (coh1002c)
- rtl/capcom_qsound.sv:16 - Z80 = XTAL 8 MHz (zn.cpp:573)
- rtl/capcom_qsound.sv:17 - QSound = qsound_device, default 60 MHz DSP16A clk (qsound.h:20-21) sample rate = 60e6 / 2 / 1248 = 24038 Hz - main-CPU -> Z80 comm : generic_latch_8 @ 0x1FB60000 (zn.cpp:613) latch write -> Z80 /NMI (data_pending_cb) (zn.cpp:581)
- rtl/capcom_qsound.sv:24 Z80 qsound_map (zn.cpp:616-624): 0x0000-0x7FFF ROM (fixed, first 32 KB of 256 KB audiocpu region) 0x8000-0xBFFF banked ROM window (16 KB, bank = write 0xD003 & 0x0F) 0xD000-0xD002 qsound_w (DSP command: D000=data MSB, D001=data LSB, D0
- rtl/capcom_qsound.sv:29 0xD003 soundbank switch (bank = data & 0x0F) (zn.cpp:638-641)
- rtl/capcom_qsound.sv:30 0xD007 qsound_r (status: bit7 = DSP ready, 0x80=ready) 0xF000-0xFFFF RAM (4 KB) Z80 qsound_portmap (zn.cpp:626-629): IN 0x00 soundlatch read (0x1FB60000 byte from main CPU)
- rtl/capcom_qsound.sv:35 QSound register/ROM semantics: MAME src/devices/sound/qsound.cpp qsound_w offset0=data[15:8], offset1=data[7:0], offset2=addr (+trigger) qsound_r = m_dsp_ready ?
- rtl/capcom_qsound.sv:37 0x80 : 0x00 (qsound.cpp:175-178) sample ROM addressed a byte at a time, high 8 bits used (qsound.cpp:289)
- rtl/capcom_qsound.sv:87 -- QSound sample ROM read bus (4 MB, read-only, from SDRAM) --------------- NOTE: MAME loads this region with ROM_LOAD16_WORD_SWAP, so the SDRAM image MUST be 16-bit word-byteswapped (see MRA note).
- rtl/capcom_qsound.sv:257 Address decode (matches zn.cpp qsound_map / qsound_portmap)
- rtl/capcom_qsound.sv:343 QSound host command registers (Z80 writes D000-D002) qsound.cpp:147 cpu2dsp[15:8]=D000 (data MSB), [7:0]=D001 (data LSB), [23:16]=D002 addr A write to D002 raises the DSP IRQ handshake and clears "ready".
- rtl/capcom_qsound.sv:592 #310 ch4 fetch-integrity tap (CONSUME-triggered): emit {addr, byte} at the exact cycle the DSP advances PAST an external read — dsp_ext_rq & qsnd_ok & dsp_cen_cko (the same "consume" condition the Verilator MAME-oracle uses).
- rtl/capcom_qsound.sv:750 NOTE: the residual in-band "rides-with-music" static is NOT imaging (proven: a 5.3 kHz brick wall did not remove it) — it is subtly distorted DSP samples, leading suspect = sample-ROM bank/offset addressing vs MAME (needs deeper analysis).
- rtl/gpu.vhd:721 Per MAME: 109 bank switches during cube attract (game code at 0x800504F0 loads assets from banks).
- rtl/gpu.vhd:738 Tests whether DMA can carry MAME's expected R=31 for cube CLUT entries.
- rtl/gpu.vhd:911 #326: in vertical-interlace mode bit31 is the FIELD bit, mirroring bit13 through the whole field INCLUDING vblank (MAME psx.cpp read(): bit31 = bit22 & bit13).
- rtl/gpu.vhd:2355 Cube attract drives global drawMode[3:0] to 0xA (TexPage X=640) or 0xB (X=704) per MAME ground truth.
- rtl/gpu.vhd:2371 B125/B126 (Y=482 exact) showed write_R=read_R=0, suggesting cube CLUT might use different Y. Y∈[460,500] covers Y=462 (text font) + Y=480-487 (cube CLUT band per MAME).
- rtl/gpu_cpu2vram.vhd:76 Three stickys distinguish where it goes: A any_ever — any such upload ever (sanity) B y482_ever — and copyDstY=482 (MAME ground truth) C y488_ever — and copyDstY=488 (FPGA's existing in_cube guess)
- rtl/gpu_cpu2vram.vhd:253 This tells us what data accompanies the suspect upload: if it's MAME's cube CLUT (entry0=0x0000, entry1=0x7FFF), only the position is wrong.
- rtl/gpu_cpu2vram.vhd:417 GREEN = h49_fifo_data(24:16) — entry 1 (upper halfword) bits 8:0 (includes R[4:0] in 4:0) BLUE = anchor sticky — fired at first WRITING+copySizeX=16+copySizeY=1+copyDstY∈[472..476] MAME-expected values (cube CLUT first FIFO word = 0x7FFF00
- rtl/gpu_pixelpipeline.vhd:115 Expected entries 0..3 (MAME-verified): 0x0000, 0x7FFF, 0x023F, 0x3FFF.
- rtl/gpu_pixelpipeline.vhd:220 MAME ground truth says CLUT[3] != 0x0003.
- rtl/gpu_poly.vhd:536 MAME stream for DoA++ shows 267 of 2270 textured polys use extended Y CLUTs (Y >= 512) via bit 15 of polygon CLUT word.
- rtl/gpu_rect.vhd:243 MAME stream for DoA++ shows 267 textured polys use bit 15 of CLUT word to address Y>=512 in extended VRAM.
- rtl/joypad.vhd:418 HARDWARE EVIDENCE (MAME src/mame/sony/zn.cpp, authoritative): the ZN-1 machine config attaches NO controller port to SIO0 on either port.
- rtl/joypad.vhd:421 Compare src/mame/sony/psx.cpp, which does instantiate PSXCONTROLLERPORTS + PSX_CONTROLLER_PORT(port1/port2) and a sio0.dtr_handler().
- rtl/memorymux.vhd:149 Capcom 4-button title (MAME capcom4b, e.g. starglad): KICK harness carries only 2 buttons at bit0/bit1, fed from core buttons 3/4 (joy[6..7]) so they sit contiguously after the 2 punch buttons.
- rtl/memorymux.vhd:156 MB3773 watchdog strobe (Taito FX only): single-cycle pulse on the FALLING edge of bank-register bit5, mirroring MAME taito_fx bank_w -> mb3773->write_line_ck(BIT(data,5)).
- rtl/memorymux.vhd:163 MAME src/mame/sony/zn.cpp taito_fx1b_state: 0x1FB80000 reg_data_w / 0x1FB80002 reg_address_w (global volume, 16-bit) 0x1FBA0000 sound_irq_w -> MN10200 IRQ0 doorbell 0x1FBC0000 sound_irq_r -> 0 (handled by BUSREAD_SNDSTUB) 0x1FBE0000-0x1F
- rtl/memorymux.vhd:358 In MAME (sony/zn.cpp taito_fx1z_state) it is a PLAIN memory-mapped array at 0x1FB00000-0x1FB003FF (umask 0x00ff00ff), read/written via trivial fram_r/fram_w (NOT a serial/bit-banged protocol).
- rtl/memorymux.vhd:367 Power-up state is 0x00 (no init) rather than MAME's 0xFF, which is harmless: gdarius checksums and REINITS the region on any invalid content, and writes now persist, so it self-heals to a valid state and boots.
- rtl/memorymux.vhd:370 (For byte-exact MAME parity / true persistence, an ioctl-loaded MIF + save path is the follow-up — same NVRAM infra the FX-1A EEPROM needs.)
- rtl/memorymux.vhd:536 Capcom 4MB bank register (4-bit = MAME bank_w data&0x0F).
- rtl/memorymux.vhd:983 Per MAME capcom_zn_state::maincpu_program_map: 0x1f000000-0x1f3fffff .rom() region(bankedroms,0) 0x1f400000-0x1f7fffff bankr(rombank) [4MB banks, ofs 0x400000+] SDRAM byte = 0x800000 + EB*0x400000 + addr[21:0]; EB=0 for the fixed window (ad
- rtl/memorymux.vhd:1010 Capcom ZN-1 country/program ROM (512KB @0x1FB80000), MAME .rom() region "countryrom" (the game's "_04" program ROM — executable).
- rtl/memorymux.vhd:1177 VRAM destination (per MAME): X=256, Y=482, 4-bit CLUT 16×1.
- rtl/memorymux.vhd:1178 MAME 20s trace shows NO direct CPU read at 0x1F7B61CC, so the load likely happens via I/D-cache fill of a 32-byte line, or via a bulk DMA copy.
- rtl/memorymux.vhd:1238 Taito FX bank register write: MAME taito_fx uses only bits[1:0] (BIT(data,0,2)); bit5 is the MB3773 watchdog strobe, bit2 unused.
- rtl/memorymux.vhd:1242 MB3773 watchdog: kick on the falling edge of bit5 (MAME parity).
- rtl/memorymux.vhd:1251 MAME atlus_zn_state::bank_w uses data & 3 (2 bits); was bits[18:16].
- rtl/memorymux.vhd:1259 Per MAME's analysis, 109 bank switches happen during cube attract via game code at 0x800504F0.
- rtl/memorymux.vhd:1267 Capcom ZN-1 bank register: byte write @0x1FB00000, rombank = data & 0x0F (MAME capcom_zn_state::bank_w).
- rtl/memorymux.vhd:1275 Capcom QSound sound latch: byte write @0x1FB60000 (MAME capcom_zn_state generic_latch_8 -> Z80 /NMI).
- rtl/memorymux.vhd:1285 Capcom ZN-1 country/program ROM (512KB @0x1FB80000, MAME region "countryrom").
- rtl/memorymux.vhd:1302 build #79 fix: Raizing bank is data & 3 (bits[1:0]) per MAME raizing_zn_state::znsecsel_w.
- rtl/memorymux.vhd:1347 MAME: unknown_r() returns 0x0000FFFF for all ZN platforms
- rtl/memorymux.vhd:1352 Taito Zoom global-volume registers (MAME zn.cpp taito_fx1b): one 32-bit word carries two 16-bit ports, +0 = reg_data_w and +2 = reg_address_w.
- rtl/memorymux.vhd:1370 sound_irq_w: MAME asserts and immediately clears MN10200 IRQ0.
- rtl/memorymux.vhd:1393 Capcom ZN-1 KICK1 (0x1FB40010) / KICK2 (0x1FB40020) button harness (MAME capcom_zn_state maps these as portr("KICK1"/"KICK2")).
- rtl/memorymux.vhd:1411 Two addresses matter to the main CPU's sound dispatcher (game code at 0x800B2A34): 0x1FBC0000 sound_irq_r : MAME returns 0; game does andi 1 / bne — if bit0 reads 1 the dispatcher bails WITHOUT draining its command queue (0x800B2A48-58), w
- rtl/memorymux.vhd:1422 Both stubs mirror MAME's ground-truth handshake WITHOUT the sound CPU.
- rtl/memorymux.vhd:1622 MAME capcom6b/4b: bit0=BUTTON4, bit1=BUTTON5, bit2=BUTTON6, rest=1.
- rtl/memorymux.vhd:1647 Mirrors MAME sound_irq_r()==0.
- rtl/psx_top.vhd:743 build #150: sticky latches for CPU PC at the cube CLUT PIO upload site (MAME PC 0x8003CB20).
- rtl/psx_top.vhd:2580 HW-accurate: MAME znmcu_device drives DSR on select the same way.
- rtl/psx_top.vhd:2604 X=768 is the ONLY CLUT at X>=512 in lpadv's entire stream (MAME log: CLUT X in {0,256,768}), so a sticky latch firing == the cubes.
- rtl/psx_top.vhd:2646 RED = h40_cube_clut_loaded_ever — CLUTwrenA + CLUTaddrA=0 + vram_DOUT[31:16]=0x7FFF + vram_DOUT[47:32]=0x023F (cube CLUT word 0 loaded into dpram with the EXACT MAME-verified values) GREEN = h40_clut_read_7fff_ever — any CLUTDataB lane
- rtl/psx_top.vhd:2691 Display origin is at Y=240 per MAME GP1 0x05 trace, so screen shows the empty front buffer.
- rtl/psx_top.vhd:3221 Banking + MRA ROM layout were proven correct vs MAME (byte-for-byte), so the upstream ROM->SDRAM->banked-read path is clean.
- rtl/psx_top.vhd:3223 The classification now happens in gpu.vhd gated on the cube CLUT's UNIQUE VRAM destination (X<256, Y=488 = MAME's exact cube-CLUT upload), removing the value/address ambiguity that contaminated builds #40-43.
- rtl/sdram.sv:531 #319 REVERT of the b24a1b2 ch4-over-ch1 preemption: its premise ("CPU runs uncached from banked ROM and hammers ch1") is DISPROVEN for the slow titles — MAME traces show sfex2 executes 100% from RAM — and the GPUF profiler shows the EX2 slo
- rtl/zn1_io.vhd:103 build #117b: store the full znsecsel byte for verifiable readback (MAME returns whatever was written).
- rtl/zn1_io.vhd:163 Real AT28C16 returns inverted bit 7 during 200μs write cycle (per MAME at28c16_device::read).
- rtl/zn1_io.vhd:195 Per MAME zn.cpp: Taito FX-1A/FX-1B (coh1000t*) AND Capcom coh1000c both use zn1_1mb_vram(config) -> CXD8561Q with 0x100000 (1MB) -> boardconfig_r bit3=0 (0x61).
- rtl/zn1_io.vhd:228 MAME at28c16_device::write(): the busy/data-poll window (and the write) only engage when the new byte DIFFERS from what is stored (read_byte(offset) != data).
- rtl/zn1_io.vhd:298 Per MAME: read returns m_last_write XOR 0x80 during write-in-progress.
- rtl/zn1_io.vhd:322 build #115: initialize EEPROM BRAM to 0xFF (AT28C16 factory state per MAME nvram_default).
- rtl/zn1_io.vhd:436 0x060000 zn2_spu_hack (MAME toggles bit 3 each read)
- rtl/zn1_io.vhd:439 MAME: noprw/nopr returns 0 for unrecognised ZN I/O addresses
- rtl/zn_sio.vhd:9 sec_select[2:0] = {data_write[7], data_write[3], data_write[2]} from BIOS write to 0x1FA10300: sec_select="000" (0x00: bit3=0,bit2=0) → BOTH chips active (wired-AND TXD) ← Tecmo BIOS sec_select="101" (0x84: bit7=1,bit3=0,bit2=1) → KN02 onl
- rtl/zn_sio.vhd:34 ZN security select (from zn1_io register 0x1FA10300) [2]=data[7], [1]=data[3], [0]=data[2]; ZNMCU when all three bits set ("111"=0x8C per MAME logic)
- rtl/zn_sio.vhd:50 Expected 0xFF per MAME exchange 0.
- rtl/zn_sio.vhd:51 Expected 0xAF per MAME psyforce exchange 8.
- rtl/zn_sio.vhd:57 MAME ground truth for BR2 Ex1 with et01 motherboard key: byte0 = 0xFF, byte3 = 0x0A.
- rtl/zn_sio.vhd:64 1-cycle strobe emitted ~50us after the ZNMCU is selected (and again after byte0), mirroring MAME znmcu_device's DSR line.
- rtl/zn_sio.vhd:75 tondemo runs its game-side CAT702 driver at JOY_BAUD=2 (~2 MHz, byte=16 clk) and bounds its I_STAT-bit7 poll to ~81 iterations; the old fixed DELAY1=1200 exceeded that budget, so every byte "timed out", the driver aborted (RX path itself wa
- rtl/zn_sio.vhd:209 ZNMCU state (MAME reference: src/mame/sony/znmcu.cpp znmcu_device) MAME protocol: select is active when (znsecsel & 0x8C) == 0x8C.
- rtl/zn_sio.vhd:224 The Taito FX-1 BIOS polls JOY_STAT bit7 for that pulse (BFC0B0A0..BFC0B11C) but falls through after a bounded 0x2710-iteration timeout and clocks the byte anyway, so the missing pre-byte pulse is non-fatal (verified via MAME debugger trace)
- rtl/zn_sio.vhd:231 While set, receive_valid/ack are asserted as LEVELS so that port-1 (JOY_CTRL bit13=0) transfers — sampled by joypad.vhd's internal baud engine ~JOY_BAUD*8 cycles after beginTransfer, long before this FSM's SNAC pulses at DELAY1 — still pick
- rtl/zn_sio.vhd:241 ===== PROPOSED FIX (Tecmo ZNMCU boot-hang) ===== MAME znmcu_device arms a 50us timer on select-active that drives DSR low (raising SIO0 IRQ7 / I_STAT bit7), then re-arms after each byte while the transferred byte index < databytes.
- rtl/zn_sio.vhd:244 In this core databytes is always 1 (standard digital mode, see header), so MAME emits exactly TWO DSR pulses per session: one on select (before byte0) and one after byte0 (before byte1).
- rtl/zn_sio.vhd:274 B123: capture KN02 byte at index 50 (= MAME's last).
- rtl/zn_sio.vhd:393 Per-chip CAT702 reset: mirrors MAME cat702_device::write_select(0).
- rtl/zn_sio.vhd:408 ZNMCU newly selected: mirrors MAME znmcu_device::select(0), which resets the bit/byte counters on the select-active edge (znsecsel write where bits 7,3,2 all become set, e.g. 0x8C).
- rtl/zn_sio.vhd:415 Mirrors MAME znmcu.select(0) arming the 50us DSR timer.
- rtl/zn_sio.vhd:436 ZNMCU mode (MAME src/mame/sony/znmcu.cpp): the response never depends on the TX byte, so unlike CAT702 it can (and must) be loaded immediately: port-1 transfers are consumed by joypad.vhd's internal baud engine within ~JOY_BAUD*8 cycles of
- rtl/zn_sio.vhd:441 byte0 = (databytes<<4)|(dsw&0xF) = 0x10|dsw[3:0] (standard mode, databytes=1 — znsecsel bits 4/5 not wired, see header) byte1..n = 0x00 (MAME m_send[] is zero-filled; bytes beyond databytes shift out 0 bits, NOT 0xFF)
- rtl/zn_sio.vhd:467 ZNMCU mode: sec_select="111" (0x8C, all bits set) activates ZNMCU per MAME znmcu.select((data & 0x8C) == 0x8C).
- rtl/zn_sio.vhd:518 51st event (first spurious after MAME's 50)
- rtl/zn_sio.vhd:550 MAME emits DSR before byte0 (armed on select) and before byte1 (armed here after byte0).
- README.md:148 **The MAME project** — used solely as hardware documentation and behavioral reference for developing the ZN-2 board support as an independent re-implementation.
- README.md:150 No MAME source code is included in this core.
- README.md:189 The hardware behavior was re-implemented independently, using MAME purely as behavioral reference documentation; no proprietary source code was used.
MAMEと一致する、MAMEに合わせた、またはMAMEで確認したと記載 — 9
- ZN2.sv:2037 The DL-1425 emits genuine full-scale 16-bit audio; in real gameplay (8-16 simultaneous PCM voices) its output reaches ~40-75% FS (verified against MAME's qsound HLE, derived from the same dl-1425.bin our jtdsp16 runs -- see scratchpad/stati
- rtl/gpu.vhd:1414 reset to 1023, matching real hardware (MAME: n_drawarea_x2=1023)
- rtl/gpu.vhd:1415 reset to 1023, matching real hardware (MAME: n_drawarea_y2=1023)
- rtl/gpu_cpu2vram.vhd:60 Cube CLUT is uploaded at copyDstX=256, copyDstY=482 (verified via MAME GP0 stream).
- rtl/memorymux.vhd:1319 ZN-1 has no CD-ROM: return 0xFF for reads (matches MAME open-bus), ignore writes
- rtl/zn1_io.vhd:17 Input bit encoding for P1/P2 (active-low, matches ZN MAME driver):
- rtl/zn1_io.vhd:152 Board config register value (matches MAME zn_state::boardconfig_r): [7:5] = "011" → rev=1 (always for ZN-1) [3] = vmem (1=2MB, 0=1MB) — set by m_gpu->vram_size() in MAME [2] = smem (1=2MB SPU SGRAM) — MAME never sets this; left 0 [1:0]
- rtl/zn1_io.vhd:395 FIX (loading): toggle bit 3 of the zn2_spu_hack reg (0x1FA60000) exactly once per read (rising edge of read_en at that address), matching MAME's `m_zn2_spu_hack ^= 8` so the load's poll exits.
- rtl/zn_sio.vhd:271 build #119/120/121/122/123 diagnostics B119-121: verified KN02 bytes 1-4 = AF, 95, 94, 14 match MAME exchange 8 exactly B122: FPGA count=58 vs MAME=50 → 8 EXTRA KN02 byte events on FPGA.
MAMEから移植・書き写した、または取り入れたと記載 — 1
MAMEの近似をそのまま採用 — 3
- rtl/zn1_io.vhd:106 MAME's zn2_spu_hack_r TOGGLES bit 3 (^=8) on every read; DoA++ (and likely other ZN titles) poll this register during the post-coin load waiting for that bit to change.
- rtl/zn1_io.vhd:111 Replicate MAME: return spu_hack_reg, toggling bit 3 once per read.
- rtl/zn1_io.vhd:395 FIX (loading): toggle bit 3 of the zn2_spu_hack reg (0x1FA60000) exactly once per read (rising edge of read_en at that address), matching MAME's `m_zn2_spu_hack ^= 8` so the load's poll exits.
MAMEドライバと同じ文言を含む(出典の明記なし) — 1