Z80 port map: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Some infos from [[User:kyuusaku]] | |||
The decode mask for '''reading''' ports is always $0C. The one for writes is indicated for each case. | |||
{| class="regdef" | {| class="regdef" | ||
|''' | |'''Address''' | ||
|'''Read''' | |'''Read''' | ||
|'''Write''' | |'''Write''' | ||
|'''[[Memory_mapped_registers#Address_decode_masks|Decode mask]]''' | |||
|- | |- | ||
|$00 | |$00 | ||
|Read sound code from 68k | | | ||
|Clear sound code | *Read sound code from {{Chipname|68k}} | ||
*Acknowledge [[Z80 interrupts|NMI]] | |||
|Clear sound code from 68k to $00 | |||
|rowspan="2"|$0C | |||
|- | |- | ||
|$04 | |$04-$07 | ||
|colspan="2"|[[YM2610]] I/O | |colspan="2"|[[YM2610]] I/O | ||
|- | |- | ||
|$08 | |$08 | ||
|Set [[Z80 | |Set [[Z80|window 0]] bank | ||
|Enable | |rowspan="4"|Enable NMIs | ||
|rowspan="4"|$1C | |||
|- | |- | ||
|$09 | |$09 | ||
|Set | |Set window 1 bank | ||
|- | |- | ||
|$0A | |$0A | ||
|Set | |Set window 2 bank | ||
|- | |- | ||
|$0B | |$0B | ||
|Set | |Set window 3 bank | ||
|- | |- | ||
|$0C | |$0C | ||
| | |See {{Sig|SDRD1|SDRD1}} | ||
|[[68k/Z80_communication|Reply]] to 68k | |[[68k/Z80_communication|Reply]] to 68k | ||
|$0C | |||
|- | |- | ||
|$18 | |$18 | ||
|Disable | |See address $08 | ||
|Disable NMIs | |||
|$1C | |||
|} | |} | ||
Note that the [[M1 ROM]] [[Z80|bankswitching]] is done by '''reading''' ports. | |||
SNK used an obscure feature of the Z80: when accessing ports, the | |||
SNK used an obscure feature of the Z80: when accessing ports, the top address bus byte is set to register C. | |||
The banks can be chosen by putting the bank number in C, and doing IN A,(port). | |||
This is handled by {{Chipname|NEO-ZMC}} in cartridges. | |||
Some [[sound driver]]s 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. | |||
[[Category:Base system]] | [[Category:Base system]] | ||
[[Category:Audio system]] |
Latest revision as of 09:19, 28 January 2024
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 | Decode mask |
$00 | Clear sound code from 68k to $00 | $0C | |
$04-$07 | YM2610 I/O | ||
$08 | Set window 0 bank | Enable NMIs | $1C |
$09 | Set window 1 bank | ||
$0A | Set window 2 bank | ||
$0B | Set window 3 bank | ||
$0C | See SDRD1 | Reply to 68k | $0C |
$18 | See address $08 | Disable NMIs | $1C |
Note that the M1 ROM bankswitching is done by reading ports.
SNK used an obscure feature of the Z80: when accessing ports, the top address bus byte is set to register C.
The banks can be chosen by putting the bank number in C, 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.