go fmt
This commit is contained in:
parent
edac661d26
commit
1f526b5331
|
@ -1,8 +1,8 @@
|
|||
package chip8
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
const graphicsBufferSize = 64 * 32
|
||||
|
@ -349,7 +349,7 @@ func (cpu *Chip8) UpdateKeys(newKeys [16]byte) {
|
|||
}
|
||||
|
||||
func (cpu *Chip8) PerformCycle() {
|
||||
cpu.opcode = (uint16(cpu.memory[cpu.pc]) << 8) + uint16(cpu.memory[cpu.pc + 1])
|
||||
cpu.opcode = (uint16(cpu.memory[cpu.pc]) << 8) + uint16(cpu.memory[cpu.pc+1])
|
||||
cpu.pc += 2
|
||||
switch cpu.opcode >> 12 {
|
||||
case 0:
|
||||
|
@ -386,4 +386,3 @@ func (cpu *Chip8) PerformCycle() {
|
|||
cpu.fifteenIndexOpcodes()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.jacknet.io/S.D/Chip-8_Go/chip8"
|
||||
"fmt"
|
||||
)
|
||||
)
|
||||
|
||||
func main() {
|
||||
prog := make([]byte, 6)
|
||||
cpu := chip8.NewCHIP8(prog)
|
||||
cpu.PerformCycle()
|
||||
fmt.Printf("This should print out zero: %d!\n", cpu.GetGraphicsBuffer()[0])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue