36 lines
674 B
Go
36 lines
674 B
Go
package gb
|
|
|
|
// import (
|
|
// "fmt"
|
|
// )
|
|
|
|
// type Bus struct {
|
|
// Cart *Cartridge
|
|
// }
|
|
|
|
// func NewBus(cart *Cartridge) *Bus {
|
|
// bus := Bus{Cart: cart}
|
|
|
|
// return &bus
|
|
// }
|
|
|
|
// func (bus *Bus) Read(address uint16) (byte, error) {
|
|
// if address < 0x8000 {
|
|
// // ROM data
|
|
// return bus.Cart.Read(address), nil
|
|
// } else {
|
|
// return 0, fmt.Errorf("Reading from address %X not implemented!", address)
|
|
// }
|
|
// }
|
|
|
|
// func (bus *Bus) Write(address uint16, value byte) error {
|
|
// if address < 0x8000 {
|
|
// // ROM data
|
|
// bus.Cart.Write(address, value)
|
|
|
|
// return nil
|
|
// } else {
|
|
// return fmt.Errorf("Writing to address %X not implemented!", address)
|
|
// }
|
|
// }
|