Add more instructions. Fix JR bug. Start implementation of IO R/W

This commit is contained in:
Michael Smith
2025-09-03 09:11:16 +02:00
parent 7c494acc7e
commit 7678fda9e7
4 changed files with 272 additions and 4 deletions

View File

@@ -39,7 +39,11 @@ func (bus *Bus) Read(address uint16) byte {
}
return value
} else if address < 0xE000 {
//WRAM (Working RAM)
return bus.RAM.WRAMRead(address)
} else if address < 0xFF80 {
//IO Registers
return IORead(address)
} else {
fmt.Printf("Reading from bus address %X not implemented!\n", address)
return 0
@@ -62,8 +66,13 @@ func (bus *Bus) Write(address uint16, value byte) error {
}
return nil
} else if address < 0xE000 {
//WRAM (Working RAM)
bus.RAM.WRAMWrite(address, value)
return nil
} else if address < 0xFF80 {
//IO Registers
IOWrite(address, value)
return nil
} else {
return fmt.Errorf("Writing to bus address %X not implemented!", address)
}