From 1b9663c9b4739cac82e9a1fb53540e28fdf499fc Mon Sep 17 00:00:00 2001 From: Max Fierke Date: Wed, 9 Oct 2024 23:32:40 -0500 Subject: [PATCH] Fix mode interrupt condition select reads --- devices/ppu.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devices/ppu.go b/devices/ppu.go index cc4d9f6..70ab8f0 100644 --- a/devices/ppu.go +++ b/devices/ppu.go @@ -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 { @@ -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() } } @@ -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() } }