mirror of
https://github.com/mattrberry/crab.git
synced 2025-01-16 03:41:18 +01:00
add vdma
This commit is contained in:
parent
c57bb1e4bf
commit
d92d37e875
2 changed files with 8 additions and 1 deletions
|
@ -91,7 +91,6 @@ class DMA
|
|||
end
|
||||
end
|
||||
|
||||
# todo: vdma
|
||||
def trigger_hdma : Nil
|
||||
4.times do |channel|
|
||||
dmacnt_h = @dmacnt_h[channel]
|
||||
|
@ -99,6 +98,13 @@ class DMA
|
|||
end
|
||||
end
|
||||
|
||||
def trigger_vdma : Nil
|
||||
4.times do |channel|
|
||||
dmacnt_h = @dmacnt_h[channel]
|
||||
trigger channel if dmacnt_h.enable && dmacnt_h.start_timing == StartTiming::VBlank.value
|
||||
end
|
||||
end
|
||||
|
||||
# todo: maybe abstract these various triggers
|
||||
def trigger_fifo(fifo_channel : Int) : Nil
|
||||
dmacnt_h = @dmacnt_h[fifo_channel + 1]
|
||||
|
|
|
@ -64,6 +64,7 @@ class PPU
|
|||
@dispstat.vblank = false
|
||||
elsif @vcount == 160
|
||||
@dispstat.vblank = true
|
||||
@gba.dma.trigger_vdma
|
||||
@gba.interrupts.reg_if.vblank = true if @dispstat.vblank_irq_enable
|
||||
@bgref.each_with_index { |bgrefs, bg_num| bgrefs.each_with_index { |bgref, ref_num| @bgref_int[bg_num][ref_num] = bgref.num } }
|
||||
draw
|
||||
|
|
Loading…
Reference in a new issue