Mega CD Docs:Memory Map

From MegaDrive Wiki
Jump to: navigation, search

The memory map on the Mega CD varies depending on the Word RAM mode selected, mainly affecting the location of where the banks of Word RAM are.

Memory Map

Main CPU

  • $000000 to $01FFFF: CD-ROM Boot Memory
  • $020000 to $03FFFF: Sub-CPU Program RAM. The Sub CPU must have a bus request to access.
  • $200000 to $23FFFF: Word RAM (Varies based on Word RAM mode)
  • $240000 to $7FFFFF: Reserved (Access prohibited, may hang machine)
  • $800000 to $A1FFFF: Same as in Cartridge mode
  • $A20000 to $A1202F: Mega CD Gate Array
  • $A12030 to $FFFFFF: See Mega Drive Manual

Sub CPU

  • $000000 to $01FFFF: Program ROM
  • $020000 to $07FFFF: Reserved (Access prohibited)
  • $080000 to $0BFFFF: Word RAM
  • $0C0000 to $0DFFFF: Word RAM (Access prohibited in 2M mode)
  • $0E0000 to $FDFFFF: Reserved (Access prohibited)
  • $FE0000 to $FE3FFF: Battery backed RAM, lower byte only.
  • $FE0400 to $FE7FFF: Image of battery backed RAM, should not be accessed.
  • $FF0000 to $FF7FFF: PCM chip area
  • $FF8000 to $FF81FF: Mega CD Gate Array
  • $FF8200 to $FFFFFF: Reserved (Access prohibited)

The imaged/mirrored areas should never be accessed, for their behaviour is undefined. Some hardware may have an imaged area there, while some hardware may not. It's therefore not safe to rely on it's existence for proper function of your programme.

2M Mode

Address
Main CPU Sub CPU Description
$000000 -- 1 MBit ROM (Main only)
$020000 $000000 4 MBit Program RAM
$200000 $080000 Word RAM (2 MBit)
$A00000 -- Z80/IO
$C00000 -- VDP
-- $FE0000 Backup RAM
$FF0000 -- Work RAM (64 KB)
-- $FF0000 5C164 PCM
-- $FF8000 G/A Register

1M Mode

Address
Main CPU Sub CPU Description
$000000 -- 1 MBit ROM (Main only)
$020000 $000000 4 MBit Program RAM
$200000 $0C0000 Word RAM (1 MBit)
$220000 $080000 Image of Word RAM (1 MBit)
$A00000 -- Z80/IO
$C00000 -- VDP
-- $FE0000 Backup RAM
$FF0000 -- Work RAM (64 KB)
-- $FF0000 5C164 PCM
-- $FF8000 G/A Register

Register Map

The table below is a rough overview of the Mega CD's register map. If a memory space is listed as "N/A," it should not be accessed from the CPU specified, or the behaviour resulting may be undefined.

Sub CPU ($FF8000) Main CPU ($A12000) Notes
$00 Version, Reset, LED N/A
$02 Memory Mode, Write Protect Reset, Int2, Memory mode, Write Protect
$04 CDC Mode, CDC RSO CDC Mode See this page for details.
$06 CDC RS1 H-Int Vector See this page for details.
$08 CDC Host Data CDC Host Data See this page for details.
$0A CDC DMA Address N/A See this page for details.
$0C Stopwatch Timer Stopwatch Timer Counts up to 4095. (30.72 µS per count)
$0E Communication Flag Communication Flag
$10 Communication RAM (Read Only) Communication RAM (Read/Write)
$20 Communication RAM (Read/Write) Communication RAM (Read Only)
$30 Interrupt Timer N/A Causes an interrupt every n counts. (30.72 µS per count)
$32 Interrupt Mask N/A
$34 CDD Fader N/A See this page for details.
$36 CDD Control N/A See this page for details.
$38 CDD Communication N/A See this page for details.
$38 CDD Status N/A See this page for details.
$42 CDD Command N/A See this page for details.
$4C Font Colour N/A See this page for details.
$4E Font Input N/A See this page for details.
$50-$56 Font Output Data N/A See this page for details.
$58+ Scaling and Rotation N/A See this page for details.