Z80 port map: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
(Mirroring infos)
Line 1: Line 1:
Infos from [[User:kyuusaku]]
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"
|'''Number'''
|'''Address'''
|'''Read'''
|'''Read'''
|'''Write'''
|'''Write'''
|'''[[Memory_mapped_registers#Address_decode_masks|Decode mask]]'''
|-
|-
|$00
|$00
|Read sound code from 68k, acknowledge NMI
|
|Clear sound code from 68k to 0
*Read sound code from {{Chipname|68k}}
*Acknowledge [[Z80 interrupts|NMI]]
|Clear sound code from 68k to $00
|rowspan="2"|$0C
|-
|-
|$04~$07
|$04
|colspan="2"|[[YM2610]] I/O
|colspan="2"|[[YM2610]] I/O
|-
|-
|$08
|$08
|Set [[Z80 memory map|$F000~$F7FF]] bank
|Set [[Z80 memory map|$F000~$F7FF]] bank
|Enable NMI
|rowspan="4"|Enable NMIs
|rowspan="4"|$1C
|-
|-
|$09
|$09
|Set $E000~$EFFF bank
|Set $E000~$EFFF bank
|
|-
|-
|$0A
|$0A
|Set $C000~$DFFF bank
|Set $C000~$DFFF bank
|
|-
|-
|$0B
|$0B
|Set $8000~$BFFF bank
|Set $8000~$BFFF bank
|
|-
|-
|$0C
|$0C
|
|See {{Sig|SDRD1|SDRD1}}
|[[68k/Z80_communication|Reply]] to 68k
|[[68k/Z80_communication|Reply]] to 68k
|$0C
|-
|-
|$18
|$18
|
|See address $08
|Disable NMI
|Disable NMIs
|$1C
|}
|}


Bank selection is made by '''reading''' ports.
Note that the [[M1 ROM|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, not only the lower 8 bits.
SNK used an obscure feature of the Z80: when accessing ports, the entire address bus is set, not only the lower 8 bits.


The banks can then be chosen by putting the bank number in B, the port number in C and doing IN A,(C).
The banks can then be chosen by putting the bank number in B, the port number in C and doing IN A,(C).
Or by putting the bank number in A and doing IN A,(Port). (to verify)
This is handled by {{Chipname|NEO-ZMC}} in cartridges.


[[Category:Base system]]
[[Category:Base system]]

Revision as of 00:36, 12 October 2016

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
  • Read sound code from 68k
  • Acknowledge NMI
Clear sound code from 68k to $00 $0C
$04 YM2610 I/O
$08 Set $F000~$F7FF bank Enable NMIs $1C
$09 Set $E000~$EFFF bank
$0A Set $C000~$DFFF bank
$0B Set $8000~$BFFF bank
$0C See SDRD1 Reply to 68k $0C
$18 See address $08 Disable NMIs $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, not only the lower 8 bits.

The banks can then be chosen by putting the bank number in B, the port number in C and doing IN A,(C). This is handled by NEO-ZMC in cartridges.