Z80 port map

From NeoGeo Development Wiki
Revision as of 04:11, 24 February 2026 by Furrtek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Some infos from User:kyuusaku

The decode mask for reading ports is always $0C. The one for writes is indicated for each case.

Address Read Write
$00

Active signal: SDZ80R

Clear sound code from 68k to $00

Active signal: SDZ80CLR

Decode mask: $0C

$04~$07 YM2610 read

Active signal: 2610RD

YM2610 write

Active signal: 2610WR

Decode mask: $0C

$08 Set $F000~$F7FF bank

Active signal: SDRD0

Enable NMIs

Decode mask: $1C

$09 Set $E000~$EFFF bank

Active signal: SDRD0

$0A Set $C000~$DFFF bank

Active signal: SDRD0

$0B Set $8000~$BFFF bank

Active signal: SDRD0

$0C See SDRD1. Never used by any game ? Write reply byte to 68k

Active signal: SDZ80W

Decode mask: $0C

$18 Same as range $08~$0B Disable NMIs

Decode mask: $1C

Note that the Z80 ROM bank selection is done by reading ports.

SNK used an obscure feature of the Z80: when accessing ports, the entire address bus is set with A-port or register pair BC, not only the lower 8 bits.

The banks can then be chosen by putting the bank number in register B, the port number ($8 to $B) in register C, and doing IN A,(C), discarding register A.

This also works when putting the bank number in register A and doing IN A,(port).

This is handled by NEO-ZMC in cartridges.

Some sound drivers use port $C0 (and others ?) in their code. Since only SDA2 and SDA3 are used for port decoding, port $C0 maps to a mirror of port $00. It's believed to be a remnant of some development tool.