Skip to content

Commit

Permalink
Added temporary memory store for APU to fix a problem with Zelda
Browse files Browse the repository at this point in the history
  • Loading branch information
djhworld committed Jun 29, 2013
1 parent d0abc85 commit 1627fa7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/apu/apu.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (
"types"
)

type APU struct{}
type APU struct {
mem [0x41]byte
}

func NewAPU() *APU {
var a *APU = new(APU)
Expand All @@ -24,12 +26,15 @@ func (apu *APU) Name() string {
return "APU"
}

func (apu *APU) Read(Address types.Word) byte {
return 0x00
func (apu *APU) Read(addr types.Word) byte {
if addr == 0xFF26 {
return 0x00
}
return apu.mem[addr-0xFF00]
}

func (apu *APU) Write(Address types.Word, Value byte) {

func (apu *APU) Write(addr types.Word, value byte) {
apu.mem[addr-0xFF00] = value
}

func (apu *APU) LinkIRQHandler(m components.IRQHandler) {
Expand Down

0 comments on commit 1627fa7

Please sign in to comment.