Module arcade

Module arcade 

Source
Expand description

The Arcade Card: 2 MiB of RAM behind four address ports, and a 32-bit shift/rotate unit (arcade.py).

An Arcade Card (Hudson, 1994) sits on the same EXT BUS as the CD unit; here it is a component of CdUnit, which claims its pages (one add-on: CD-ROM² + Arcade Card). It has no clock: every access is immediate, so it takes no part in catch_up.

Sources, and what is tier what. No hardware documentation of the card is in the reference’s reference/: the card is not in MacDonald’s pcetech.txt, and the only text the sources cite for it is Mednafen’s header (“based on information provided by Ki and David Shadoff”). So every behaviour below is [emu: Mednafen arcade_card.cpp, Geargrafx arcade_card_mapper*, Mesen2 PceArcadeCard.cpp] (tier 5, detectors) and holds where all three agree; where they differ the choice is a field of ArcadeSwitches and a U/C entry in the reference’s docs/m9-record.md.

Address map [emu, all three]:

wherewhat
banks $40-$43the data of port bank & 3 at any offset, as $1A00 + 16 * port
$1A00-$1A7Ffour port groups, port = (addr >> 4) & 3: $1A40-$1A7F mirrors $1A00
$1AE0-$1AE3the 32-bit value register, low byte first
$1AE4shift: write n (4 bits) shifts the value, read returns n
$1AE5rotate: write n (4 bits) rotates the value, read returns n
$1AFE, $1AFFversion $10 and ID $51

Port registers (low nibble of the address):

regmeaning
$0, $1data: read or write RAM at the effective address, then auto-increment
$2-$4base address, 24 bits, low byte first
$5, $6offset, 16 bits, low byte then high byte
$7, $8increment, 16 bits
$9control (below)
$Atrigger write (reads 0)

Control bits: D0 auto-increment; D1 add the offset to the base for the access; D2 signed increment (no emulator uses it); D3 signed offset; D4 the increment goes to the base (else to the offset); D6-D5 when the offset is written it is added into the base: 0 never, 1 on the low-byte write, 2 on the high-byte write, 3 on a write to $A.

The effective address is (base [+ offset [+ $FF0000 if signed]]) & $1FFFFF (2 MiB).

Differences forced by Rust: the reference’s class attributes are ArcadeSwitches (a subclass there, a value handed to ArcadeCard::with here).

Structs§

ArcadeCard
The card’s RAM, four ports and the shift unit.
ArcadeSwitches
The emulator-only choices (the reference’s ArcadeCard class attributes, its defaults).

Constants§

ARCADE_RAM_BYTES
CTL_ADD_OFFSET
CTL_AUTO_INCREMENT
CTL_INCREMENT_BASE
CTL_SIGNED_OFFSET
CTL_TRIGGER_SHIFT
FIRST_PORT_BANK
PORT_BANKS
PORT_BANK_PAGES
banks $40-$43 at physical $080000-$087FFF (8 KiB banks)
REGISTER_PAGE
$1A00-$1AFF
TRIGGER_HIGH
TRIGGER_LOW
TRIGGER_NONE
TRIGGER_REG_A