Skip to content

Commit

Permalink
fix(graphics): resolve scroll and high resolution issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoliveira21 committed Dec 30, 2023
1 parent acdd595 commit cb53a63
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Binary file removed cli/roms/test/Test128.ch8
Binary file not shown.
Binary file removed cli/roms/test/scroll.ch8
Binary file not shown.
Binary file removed cli/roms/test/scroll2.ch8
Binary file not shown.
8 changes: 4 additions & 4 deletions core/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ func (cpu *CPU) clock() {

switch opcode.instruction {
case 0x0000:
switch opcode.registerY {
case 0xC:
if opcode.registerY == 0xC {
cpu.scd(opcode.n)
return
}

switch opcode.nnn {
Expand Down Expand Up @@ -330,8 +330,8 @@ func (cpu *CPU) ldm(vIndex uint8) {
}

func (cpu *CPU) drw(oc *opcode) {
x := cpu.v[oc.registerX] & 0x3F
y := cpu.v[oc.registerY] & 0x1F
x := cpu.v[oc.registerX] & (byte(cpu.Graphics.Width - 1))
y := cpu.v[oc.registerY] & (byte(cpu.Graphics.Height - 1))
cpu.v[0xF] = 0x00

for i := 0; uint8(i) < oc.n; i++ {
Expand Down

0 comments on commit cb53a63

Please sign in to comment.