Documentation ¶
Index ¶
- Constants
- Variables
- type HDMATransfer
- type MMU
- func (mmu *MMU) ConnectPeripheral(p components.Peripheral, startAddr, endAddr types.Word)
- func (mmu *MMU) ConnectPeripheralOn(p components.Peripheral, addrs ...types.Word)
- func (mmu *MMU) IsCartridgeColor() bool
- func (mmu *MMU) LoadBIOS(data []byte) error
- func (mmu *MMU) LoadCartridge(cart *cartridge.Cartridge)
- func (mmu *MMU) LoadCartridgeRam(savesDir string)
- func (mmu *MMU) PrintPeripheralMap()
- func (mmu *MMU) ReadByte(addr types.Word) byte
- func (mmu *MMU) ReadByteFromRegister(addr types.Word) byte
- func (mmu *MMU) ReadFromWorkingRAM(addr types.Word) byte
- func (mmu *MMU) ReadWord(addr types.Word) types.Word
- func (mmu *MMU) RequestInterrupt(interrupt byte)
- func (mmu *MMU) Reset()
- func (mmu *MMU) SaveCartridgeRam(savesDir string)
- func (mmu *MMU) SetInBootMode(mode bool)
- func (mmu *MMU) WriteByte(addr types.Word, value byte)
- func (mmu *MMU) WriteByteToRegister(addr types.Word, value byte)
- func (mmu *MMU) WriteToWorkingRAM(addr types.Word, value byte)
- func (mmu *MMU) WriteWord(addr types.Word, value types.Word)
- type MemoryMappedUnit
Constants ¶
View Source
const ( DMG_STATUS_REG types.Word = 0xFF50 CGB_INFRARED_PORT_REG types.Word = 0xFF56 CGB_WRAM_BANK_SELECT types.Word = 0xFF70 CGB_DOUBLE_SPEED_PREP_REG types.Word = 0xFF4D CGB_HDMA_SOURCE_HIGH_REG types.Word = 0xFF51 CGB_HDMA_SOURCE_LOW_REG types.Word = 0xFF52 CGB_HDMA_DEST_HIGH_REG types.Word = 0xFF53 CGB_HDMA_DEST_LOW_REG types.Word = 0xFF54 CGB_HDMA_REG types.Word = 0xFF55 )
View Source
const PREFIX = "MMU"
View Source
const ZERO byte = 0
Variables ¶
View Source
var ROMIsBiggerThanRegion error = errors.New("ROM is bigger than addressable region")
Functions ¶
This section is empty.
Types ¶
type HDMATransfer ¶
type MMU ¶ added in v0.1.1
type MMU struct { DMARegister byte RunningColorGBHardware bool // contains filtered or unexported fields }
func (*MMU) ConnectPeripheral ¶ added in v0.1.1
func (mmu *MMU) ConnectPeripheral(p components.Peripheral, startAddr, endAddr types.Word)
func (*MMU) ConnectPeripheralOn ¶ added in v0.1.1
func (mmu *MMU) ConnectPeripheralOn(p components.Peripheral, addrs ...types.Word)
Helper method for connecting peripherals that don't look at contiguous chunks of memory
func (*MMU) IsCartridgeColor ¶ added in v0.1.1
func (*MMU) LoadCartridge ¶ added in v0.1.1
func (*MMU) LoadCartridgeRam ¶ added in v0.1.1
func (*MMU) PrintPeripheralMap ¶ added in v0.1.1
func (mmu *MMU) PrintPeripheralMap()
func (*MMU) ReadByteFromRegister ¶ added in v0.1.1
This area deals with registers (some only applicable to CGB hardware)
func (*MMU) ReadFromWorkingRAM ¶ added in v0.1.1
func (*MMU) RequestInterrupt ¶ added in v0.1.1
USE SHARED CONSTANTS FOR FLAGS AND STUFF TOO - for reuse in the CPU
func (*MMU) SaveCartridgeRam ¶ added in v0.1.1
func (*MMU) SetInBootMode ¶ added in v0.1.1
When the MMU is in boot mode, the area below 0x0100 is reserved for the BIOS
func (*MMU) WriteByteToRegister ¶ added in v0.1.1
This area deals with registers (some only applicable to CGB hardware)
func (*MMU) WriteToWorkingRAM ¶ added in v0.1.1
type MemoryMappedUnit ¶
type MemoryMappedUnit interface { WriteByte(address types.Word, value byte) WriteWord(address types.Word, value types.Word) ReadByte(address types.Word) byte ReadWord(address types.Word) types.Word SetInBootMode(mode bool) LoadBIOS(data []byte) error LoadCartridge(cart *cartridge.Cartridge) Reset() }
Click to show internal directories.
Click to hide internal directories.