mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-30 20:34:45 +01:00
fixed ppu interrupt flags
This commit is contained in:
parent
0c39869653
commit
4b6563773c
1 changed files with 7 additions and 8 deletions
|
@ -154,23 +154,23 @@ class PPU
|
||||||
def start_hblank : Nil
|
def start_hblank : Nil
|
||||||
@gba.scheduler.schedule 272, ->end_hblank
|
@gba.scheduler.schedule 272, ->end_hblank
|
||||||
@dispstat.hblank = true
|
@dispstat.hblank = true
|
||||||
@gba.interrupts.reg_if.hblank = false
|
@gba.interrupts.reg_if.hblank = @dispstat.hblank_irq_enable
|
||||||
@gba.interrupts.schedule_interrupt_check
|
@gba.interrupts.schedule_interrupt_check if @dispstat.hblank_irq_enable
|
||||||
scanline if @vcount < 160
|
scanline if @vcount < 160
|
||||||
end
|
end
|
||||||
|
|
||||||
def end_hblank : Nil
|
def end_hblank : Nil
|
||||||
@dispstat.hblank = false
|
@dispstat.hblank = false
|
||||||
@gba.interrupts.reg_if.hblank = @dispstat.hblank_irq_enable
|
@gba.interrupts.reg_if.hblank = false
|
||||||
@vcount += 1
|
@vcount = (@vcount + 1) % 228
|
||||||
@vcount %= 228
|
|
||||||
@dispstat.vcounter = @vcount == @dispstat.vcount_setting
|
@dispstat.vcounter = @vcount == @dispstat.vcount_setting
|
||||||
@gba.interrupts.reg_if.vcounter == @dispstat.vcounter_irq_enable && @dispstat.vcounter
|
@gba.interrupts.reg_if.vcounter = @dispstat.vcounter_irq_enable && @dispstat.vcounter
|
||||||
if @vcount == 0
|
if @vcount == 0
|
||||||
@dispstat.vblank = false
|
@dispstat.vblank = false
|
||||||
|
@gba.interrupts.reg_if.vblank = false
|
||||||
elsif @vcount == 160
|
elsif @vcount == 160
|
||||||
@dispstat.vblank = true
|
@dispstat.vblank = true
|
||||||
@gba.interrupts.reg_if.vblank = @dispstat.vblank_irq_enable && @dispstat.vblank
|
@gba.interrupts.reg_if.vblank = @dispstat.vblank_irq_enable
|
||||||
draw
|
draw
|
||||||
end
|
end
|
||||||
@gba.interrupts.schedule_interrupt_check
|
@gba.interrupts.schedule_interrupt_check
|
||||||
|
@ -211,7 +211,6 @@ class PPU
|
||||||
240.times do |col|
|
240.times do |col|
|
||||||
effective_col = (col + @bg0hofs.value) % (tw << 3)
|
effective_col = (col + @bg0hofs.value) % (tw << 3)
|
||||||
tx = effective_col >> 3
|
tx = effective_col >> 3
|
||||||
x = effective_col & 7
|
|
||||||
|
|
||||||
se_idx = se_index(tx, ty, @bg0cnt.screen_size)
|
se_idx = se_index(tx, ty, @bg0cnt.screen_size)
|
||||||
screen_entry = @vram[screen_base + se_idx * 2 + 1].to_u16 << 8 | @vram[screen_base + se_idx * 2]
|
screen_entry = @vram[screen_base + se_idx * 2 + 1].to_u16 << 8 | @vram[screen_base + se_idx * 2]
|
||||||
|
|
Loading…
Add table
Reference in a new issue