Skip to content

Commit

Permalink
Fix mode interrupt condition select reads
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierke committed Oct 10, 2024
1 parent 9c66ff1 commit 1b9663c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions devices/ppu.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,15 @@ func (stat *lcdStatus) Read(ppu *PPU) uint8 {
)

if stat.mode0IntSel {
lycIntSel = 1 << LCD_STAT_BIT_MODE_0_INT_SEL
mode0IntSel = 1 << LCD_STAT_BIT_MODE_0_INT_SEL
}

if stat.mode1IntSel {
lycIntSel = 1 << LCD_STAT_BIT_MODE_1_INT_SEL
mode1IntSel = 1 << LCD_STAT_BIT_MODE_1_INT_SEL
}

if stat.mode2IntSel {
lycIntSel = 1 << LCD_STAT_BIT_MODE_2_INT_SEL
mode2IntSel = 1 << LCD_STAT_BIT_MODE_2_INT_SEL
}

if stat.lycIntSel {
Expand Down Expand Up @@ -445,7 +445,7 @@ func (ppu *PPU) Step(cycles uint8) {
ppu.requestLCD()
}

if ppu.lcdStatus.lycIntSel && ppu.IsCurrentLineEqualToCompare() && ppu.lcdStatus.ShouldInterrupt() {
if ppu.IsCurrentLineEqualToCompare() && ppu.lcdStatus.ShouldInterrupt() {
ppu.ic.RequestLCD()
}
}
Expand All @@ -460,7 +460,7 @@ func (ppu *PPU) Step(cycles uint8) {
ppu.requestLCD()
}

if ppu.lcdStatus.lycIntSel && ppu.IsCurrentLineEqualToCompare() && ppu.lcdStatus.ShouldInterrupt() {
if ppu.IsCurrentLineEqualToCompare() && ppu.lcdStatus.ShouldInterrupt() {
ppu.ic.RequestLCD()
}
}
Expand Down

0 comments on commit 1b9663c

Please sign in to comment.