SCSP (also used by Model 2):
- The slot engine from current MAME: key off goes to the release, the
envelope tables and the dB curve of the decay, pitch, interpolation,
the four loop modes, FM from the ring buffer, noise (SSCTL), SBCTL,
LPSLNK, STWINH/SDIR; 8-bit samples read in big-endian byte order.
- The monitor register 0x408 returns CA, SGC and EG of the slot set in
MSLC: the sound drivers look there for a free slot, and Winter Heat
played every voice on slot 0, each one cutting the previous.
- Real timers for timers A, B and C, as in MAME: counting them with the
generated samples delayed every interrupt until the next stream update.
- Interrupts as in MAME: each source raises its own level until it is
acknowledged in SCIRE, and an acknowledged expired timer is pending
again with no new interrupt. Reading MIBUF drops the MIDI interrupt:
left raised, the sound CPU took it again on an empty FIFO and read
stale bytes as MIDI data, which broke music commands in Model 2
(Fighting Vipers, Dead or Alive, Manx TT).
- The DMA used the common registers 0x412 words past them, inside the
slots: now as in MAME.
- The common registers are 0x400-0x42f only (0x500 is not a mirror),
the ring buffer at 0x600 can be read and written, the LFO saw wave and
rate as in MAME.
- ST-V: a 16-bit access of the SH-2 touches only its half of the SCSP
registers.
Batman Forever: the Acclaim RAX sound board (ADSP-2181), moved from zn.c
to sndhrdw/acclaim_rax.c and shared by NBA Jam Extreme and Batman
Forever, which writes its commands to 0x04800000 as in MAME.
docs/sega-model2.md: the MIDI interrupt of the sound link.
Fixes#2194.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vje3pEtpLHubqCGwCgoQX
* Save states: the audio frame length (samples per frame) and its fraction
When the frame rate doesn't divide the sample rate, the frames alternate
their number of samples; where they are in that was not in the save state,
so after a load the mixer asked the streams for a different number of
samples and the audio drifted from the run that never loaded (netplay CRC
mismatches in the mixer state, RunAhead audio).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N3fzdsnzkQVtgYtYzqepjX
* Cave CV1000: SH-3 (SH7709S) with recompiler, driver, EPIC12 blitter, YMZ770
The Cave CV1000-B and CV1000-D games (Mushihime-Sama, Ibara, Espgaluda II,
Muchi Muchi Pork, Pink Sweets, Mushihime-Sama Futari, Deathsmiles, DoDonPachi
Dai-Fukkatsu and their sets), ported to C89 from current MAME:
- src/cpu/sh3: the SH7709S interpreter (current MAME's SH-3 with the cycle
counts of MAME's recompiler and its cache and bus timing model), the
interrupt controller, timers, DMA, ports.
- src/cpu/sh3/sh3jit.c: an SH-3 recompiler on sljit with the same results
as the interpreter, cycle for cycle (save states, netplay and RunAhead
don't depend on it); core option "SH-3 Dynarec", on by default, offered
on x86, x86-64, ARMv7 and AArch64.
- src/drivers/cv1k.c: memory maps, NAND flash, RTC9701, idle loop
speedups, the sets.
- src/vidhrdw/cv1k_vidhrdw.c: the EPIC12 blitter (16-bit VRAM).
- src/sound/ymz770.c and the AMM variant of MPEG audio in mpeg_audio.c.
Everything is in the save states. Details in docs/cave-cv1000.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01N3fzdsnzkQVtgYtYzqepjX
---------
Co-authored-by: Claude <[email protected]>
A C89 port of current MAME's cps3.cpp and cps3_a.cpp: MAME's 53 sets
without the multi-game bootlegs, plus sfiii4n, the 3rd Strike "4rd
Arrange Edition 2013" hack that FBNeo has and MAME does not.
- Encryption with the per-game keys, through the new SH-2 hooks.
- Flash SIMMs (Fujitsu 29F016A), EEPROM, inputs, save states.
- Video: sprites with zoom, tilemaps, text layer, shadow/highlight,
full screen zoom; palette and character DMA.
- The 16-voice sample chip (sndhrdw/cps3_sndhrdw.c).
- No CD drive: the BIOS no-CD flag is always set, so the CD sets run
from the SIMMs; the Red Earth / Warzard CD BIOSes, with no such flag,
start the game straight from the SIMMs.
- A "Region" DIP switch patches the cart's region byte at reset:
Europe by default, USA on 2nd Impact (no European release), any
region or "As BIOS" selectable.
- Idle loop skip per game (FBNeo's addresses).
Docs in docs/capcom-cps3.md, sets in metadata/mame2003-plus.xml.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vje3pEtpLHubqCGwCgoQX
Virtua Racing, Virtua Formula, Virtua Fighter, Star Wars Arcade, Wing War
(and R360) and NetMerc, with current MAME's sets.
- Driver from current MAME: interrupt controller, interval timers, the
UART to the Model 1 sound board, the Digital Sound Board for Star Wars
Arcade; the I/O board firmware is simulated (inputs, DIP switches,
analog channels, backup RAM).
- Video: C port of current MAME's model1_v.cpp; no fused multiply-add and
x86 float to int conversions, so every CPU renders as x86.
- TGP: the geometry DSP runs in C (HLE), started from MAME 0.215. With the
MB86233 core the real TGP program can run next to it (development
builds, MODEL1_TGP=oracle): every function the games call was rewritten
from the 315-5573, 315-5711 and 315-5724 programs until the results
match bit for bit, bugs of the real programs included. Virtua Fighter
gets its own table (MAME 0.215 used Virtua Racing's, with guessed camera
functions).
- The TGP sits in the V60 I/O space too (Wing War boots it with an OUT).
- Save states keep the TGP FIFOs, the data ROM bank, the timers and the
renderer's light setup, so a state loads in a new session.
- C89, own square root helper.
Details and open questions: docs/sega-model1.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013Vje3pEtpLHubqCGwCgoQX
The whole Model 2 family: i960 main CPU, TGP (MB86234) and TGPx4
(MB86235) geometrizers, SHARC (ADSP-21062) for Model 2B, geometrizer and
3D rasterizer, System 24 tile layers, 68000 + SCSP sound with the MIDI link
from the i960, Model 1 I/O board (Z80 with its BIOS, or simulated), the
315-5881/315-5838 protections, the Digital Sound Boards (DSB Z80 and DSB2
68000, MPEG audio) and the Model 1 sound board of Manx TT DX.
Beyond MAME:
- SCSP effect DSP from current MAME, without MAME's MADRS mirror that
breaks the Dead or Alive reverb; master volume.
- Rail Chase 2: mirrored sample ROMs, the missing sound effects play.
- DSB music level measured on Top Skater cabinet recordings.
- Tile layers mixed before the polygons (Virtua Cop 2 stage select), black
polygon pixels drawn.
- Games that do not start in MAME play: Virtual-On (comm board present,
link stand-alone), Manx TT DX and Motor Raid DX (drive boards
simulated), Sega Ski Super G, Top Skater in 3D (compact object format,
second matrix, foot sensors), the Daytona USA hacks.
- Daytona USA factory link ID set to single, Super GT 24h sound queue.
- SHARC: a wait on a FIFO flag (NOP loop or jump to itself) gives up
its timeslice (identical output, Model 2B games 1.3x-2.9x faster).
Royal Ascot II (SegaNet terminal) and Power Sled (network) are not added.
Choices that differ from the hardware: docs/sega-model2.md.
C89, no C99 math in the build paths (C89 fallbacks), checked on ARM, x86
and the Apple targets. DAT: the Model 2 entries added.
Claude-Session: https://claude.ai/code/session_016PwPGTj4SDjmvPp3DRm9j5
Co-authored-by: Vanni <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>