com.monkeycoder.monkeynes.hardware.mapper
Class MemoryMapperZero

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.mapper.MemoryMapper
        |
        +--com.monkeycoder.monkeynes.hardware.mapper.MemoryMapperZero

public class MemoryMapperZero
extends MemoryMapper

This is an implementation of Mapper 0. Mapper 0 simply means that there is no mapper in use.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
 
Fields inherited from class com.monkeycoder.monkeynes.hardware.mapper.MemoryMapper
mainMem, rom, vidMem
 
Constructor Summary
MemoryMapperZero(NesMainMemory inMainMem, NesVideoMemory inVidMem, NesRom inRom)
          Creates a new MemoryMapperZero.
 
Method Summary
 void doCycle()
          Called to tell the mapper to do a cycle.
 String getMapperDesc()
          Returns the description of this mapper.
 String getMapperName()
          Returns the name of this mapper.
 int getMapperNumber()
          Returns the mapper number of this mapper.
 void powerOff()
          Called to tell the mapper that power is now off.
 void powerOn()
          Called to tell the mapper that power is now on.
 void reset()
          Called to tell the mapper that a reset has occurred.
 boolean write(int inAddress, int inValue)
          Called to indicate to the mapper that a specific address in memory was written to.
 
Methods inherited from class com.monkeycoder.monkeynes.hardware.mapper.MemoryMapper
getMainMemory, getRom, getVideoMemory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemoryMapperZero

public MemoryMapperZero(NesMainMemory inMainMem,
                        NesVideoMemory inVidMem,
                        NesRom inRom)
Creates a new MemoryMapperZero.

Parameters:
inMainMem - Main memory bank accessed by this mapper.
inVidMem - Video memory bank accessed by this mapper.
inRom - ROM accessed by this mapper.
Method Detail

getMapperNumber

public int getMapperNumber()
Description copied from class: MemoryMapper
Returns the mapper number of this mapper.

Specified by:
getMapperNumber in class MemoryMapper
Returns:
The mapper number of this mapper.

getMapperName

public String getMapperName()
Description copied from class: MemoryMapper
Returns the name of this mapper.

Specified by:
getMapperName in class MemoryMapper
Returns:
The name of this mapper.

getMapperDesc

public String getMapperDesc()
Description copied from class: MemoryMapper
Returns the description of this mapper.

Specified by:
getMapperDesc in class MemoryMapper
Returns:
The description of this mapper.

powerOn

public void powerOn()
Description copied from class: MemoryMapper
Called to tell the mapper that power is now on.

Specified by:
powerOn in class MemoryMapper

powerOff

public void powerOff()
Description copied from class: MemoryMapper
Called to tell the mapper that power is now off.

Specified by:
powerOff in class MemoryMapper

reset

public void reset()
Description copied from class: MemoryMapper
Called to tell the mapper that a reset has occurred.

Specified by:
reset in class MemoryMapper

doCycle

public void doCycle()
Description copied from class: MemoryMapper
Called to tell the mapper to do a cycle.

Specified by:
doCycle in class MemoryMapper

write

public boolean write(int inAddress,
                     int inValue)
Description copied from class: MemoryMapper
Called to indicate to the mapper that a specific address in memory was written to.

Specified by:
write in class MemoryMapper
Parameters:
inAddress - The address of main memory that was written.
inValue - The value that will be written to main memory.
Returns:
Whether or not the write should be allowed to happen.