Beispiel #1
0
        public byte Peek(ushort address)
        {
            // Regular RAM
            if (address < 0xFC00)
            {
                return(Ram.Peek(address));
                //return directAccessRam[address];
            }

            // "These overlays are controlled by the bits in the hardware register at FFF9."
            if (address == 0xFFF9)             // Special case for memory map control register
            {
                // "Both Mikey and Suzy accept a write at those addresses but only Mikey responds to a read."
                // Since we will be passing regular RAM memory to Suzy, it is OK to always return value
                // because only Mikey will be going through this MMU.
                return(MAPCTL.ByteData);
            }

            // For details on address ranges see Poke() implementation
            if (address >= 0xFFFA)
            {
                return(VectorSpace.Peek(address));
            }
            if (address >= 0xFE00)
            {
                return(RomSpace.Peek(address));
            }
            if (address >= 0xFD00)
            {
                return(MikeySpace.Peek(address));
            }
            if (address >= 0xFC00)
            {
                return(SuzySpace.Peek(address));
            }

            return(0);
        }