Skip to content

Commit 69d684e

Browse files
committed
Make all cpu methods work on cpu pointer. This improved performance as no copies of cpu were done anymore.
1 parent 622cd85 commit 69d684e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nes/cpu6502.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func CreateCPU(memory Memory, debugger *cpu.Debugger) *Cpu6502 {
3737
return &cpu6502
3838
}
3939

40-
func (cpu6502 Cpu6502) ProgramCounter() types.Address {
40+
func (cpu6502 *Cpu6502) ProgramCounter() types.Address {
4141
return cpu6502.Registers().Pc
4242
}
4343

@@ -394,7 +394,7 @@ func (cpu6502 *Cpu6502) initAddressModeEvaluators() {
394394
}
395395
}
396396

397-
func (cpu6502 Cpu6502) evaluateOperandAddress(addressMode cpu.AddressMode, pc types.Address) (finalAddress types.Address, operand [3]byte, pageCrossed bool) {
397+
func (cpu6502 *Cpu6502) evaluateOperandAddress(addressMode cpu.AddressMode, pc types.Address) (finalAddress types.Address, operand [3]byte, pageCrossed bool) {
398398
if addressMode == cpu.Implicit {
399399
finalAddress = 0
400400
return

0 commit comments

Comments
 (0)