Help with potentially extra RAM space for Z80 sound drivers

Discussion in 'Discussion & Q&A' started by RealMalachi, May 16, 2023.

  1. RealMalachi

    RealMalachi You look like an atheist seeing an angel... Member

    Joined:
    Oct 16, 2022
    Messages:
    18
    Location:
    Australia
    I'm interested in Z80 address 2000h-3FFFh. In documents I found detailing how Z80 is used, those addresses seem to be reserved by SEGA. Did it get used? Do certain machines not support it, like clone consoles?

    For clarity, here's why I'm asking.
    Basically, I'm trying to compress as much data as I can, and learn more about how the Z80 could be used in general. It seems like under the right circumstances, it could be a great compression handler
    Sonic 2 compresses its song data into Z80 RAM. This reduces how many times it calls from 68K data, and also saves ROM space. Every song in Sonic 2 fits in the regular allocated size of $7C0, aside for the ending theme which requires $1700, so it's uncompressed. All the other uncompressed songs are to avoid compression giving the song a delay, though when compressed, only the 1up jingle presents any major bugs (the drowning may or may not have a slight issue, I have to double check)

    When using this space though, it crashed BlastEm. It's possible that I did something wrong, but for now I'm assuming SEGA ended up using that space, but that begs a question; for what? Knowing Kega though it probably works there, didn't check
    Here's a picture of the Z80 addresses, for reference
    [​IMG]

    While we're here, what did the prohibited accesses get used for? If unused, 4010h-5FFFh and 6002h-7F10h could be viable as well
     
  2. Devon

    Devon A̸ ̴S̴ ̵C̵ ̷E̶ ̸N̸ ̴D̶ ̵E̶ ̸D̶ Member

    Joined:
    Aug 26, 2013
    Messages:
    1,380
    Location:
    your mom
    2000h-3FFFh is just a mirror of 0000h-1FFFh. The 4000h-5FFFh range is mapped to the YM2612 (mirrored every 4 bytes), the 6000-60FFh range is mapped to the bank register (mirrored at every byte), and the 7F00h-7FFFh range is mapped to the VDP (PSG is part of the VDP on the Genesis, also no mirroring here, I believe). As far as I know, the rest are not really mapped to anything.
     
    Last edited: May 16, 2023