System Specs:
Processor: Z-80 (encryption modification on some boards)
Resolution: 384 x 240 (No scrolling?)
Colors: 16 colors per tile/sprite
128 palettes of 16 colors each
Tile Size: 8 x 8
Sprite Size: 16 x 16
Max Sprites: ?
Z80 Memory Read Address
$0000-$7fff Rom
$8000-$bfff Bank1
$c000-$c7ff Banked palette RAM
$c800-$cfff Attribute RAM
$d000-$dfff Banked char / OBJ RAM
$e000-$ffff Work RAM
Memory Write Address
$0000-$bfff Rom
$c000-$c7ff Palette Ram
BANK 0 = 0x00-0x3f BANK 1 = 0x40-0xff
Format is xxxxRRRRGGGGBBBB
$c800-$cfff Attribute RAM
$d000-$dfff Banked char / OBJ RAM
BANK 0 = CHAR, BANK 1 = OBJ
$e000-$ffff Work RAM
Port Reads
$00
$01 ?
$02 Start 2
$04 ?
$08 Start 1
$10 ?
$20 ?
$40 Coin 2
$80 Coin 1
$01 Player 1
$01 ?
$02 ?
$04 Button 2
$08 Button 1
$10 Right
$20 Left
$40 Down
$80 Up
$02 Player 2
$01 ?
$02 ?
$04 Button 2
$08 Button 1
$10 Right
$20 Left
$40 Down
$80 Up
$05 bits 0 and (sometimes) 3 are checked in the interrupt handler.
Maybe they are vblank related, but I'm not sure.
bit 3 is checked before updating the palette so it really seems to
be vblank. Many games require two interrupts per frame and for
these bits to toggle, otherwise music doesn't work.
Port Writes
$00 Palette bank, layer enable, coin counters, more
bit 0 maybe back color enable?
bit 1 coin counter
bit 2 flip screen
bit 3 ? marukin pulses it on the title screen
bit 4 selects OKI M6295 bank
bit 5 palette RAM bank selector
bits 6 and 7 ? At first I thought they were bg and sprites enable,
but this screws up spang (screen flickers every time you pop a bubble).
However, not using them as enable bits screws up marukin - you can
see partially built up screens during attract mode.
$01 Input Selection (not valid on normal controls)
$02 Code bank register
$03 YM2413 Data Port
$04 YM2413 Register Port
$05 OKIM6295 Data 0
$06 watchdog? irq ack?
$07 Video RAM bank register
$00 Selects Video Ram
$01 Selects Object Ram
$08 EEProm CS
rrrryyyyyyyyyyyyyyyyxxxxxx
x address bits
y data bits
r command
"0110", Read command
"0101", Write command
"0111" Erase command
$10 EEProm Clock
$18 EEProm Serial
Sprite Table
BYTE Tile (low bits)
BYTE Attribute $tttxcccc
cccc - Palette
x - High bit of position
ttt - High bits of Tile number
BYTE Y Position ; Starting position is 8 for fully visible
BYTE X Position ; Starting position is 64 for fully visible
Map Format (+Attribute)
WORD Tile Number (in Char ram) ; 64 Tiles per line
BYTE fppppppp (in Attribute ram)
f - flipx
p - palette number
Character Layout
width = 8
height = 8
total = 16640
planes = 4
planeoffsets = 3145732 3145728 4 0
xoffsets = 0 1 2 3 8 9 10 11
yoffsets = 0 16 32 48 64 80 96 112
charincrement = 128
Sprite Layout
width = 16
height = 16
total = 2048
planes = 4
planeoffsets = 3145732 3145728 4 0
xoffsets = 0 1 2 3 8 9 10 11 256 257 258 259 264 265 266 267
yoffsets = 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240
charincrement = 512