mirror of
https://github.com/colby-swandale/waterfoul
synced 2024-12-26 21:58:54 +01:00
fix screen enable/disable
This commit is contained in:
parent
bf785c7d54
commit
ba6073aba0
1 changed files with 13 additions and 20 deletions
|
@ -24,11 +24,11 @@ module Waterfoul
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@framebuffer = Array.new FRAMEBUFFER_SIZE, 0
|
@framebuffer = Array.new FRAMEBUFFER_SIZE, 0
|
||||||
@mode = OAM_READ_STATE
|
@mode = V_BLANK_STATE
|
||||||
@modeclock = 0
|
@modeclock = 0
|
||||||
@auxillary_modeclock = 0
|
|
||||||
@vblank_line = 0
|
@vblank_line = 0
|
||||||
@screen_enable_delay_cycles = 0
|
@auxillary_modeclock = 0
|
||||||
|
@screen_enabled = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def step(cycles = 1)
|
def step(cycles = 1)
|
||||||
|
@ -36,7 +36,7 @@ module Waterfoul
|
||||||
@modeclock += cycles
|
@modeclock += cycles
|
||||||
@auxillary_modeclock += cycles
|
@auxillary_modeclock += cycles
|
||||||
|
|
||||||
if IO::LCDControl.screen_enabled?
|
if IO::LCDControl.screen_enabled? && @screen_enabled
|
||||||
case @mode
|
case @mode
|
||||||
when H_BLANK_STATE
|
when H_BLANK_STATE
|
||||||
hblank if @modeclock >= H_BLANK_TIME
|
hblank if @modeclock >= H_BLANK_TIME
|
||||||
|
@ -48,23 +48,16 @@ module Waterfoul
|
||||||
vram if @modeclock >= VRAM_SCANLINE_TIME
|
vram if @modeclock >= VRAM_SCANLINE_TIME
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @screen_enable_delay_cycles > 0
|
if IO::LCDControl.screen_enabled?
|
||||||
@screen_enable_delay_cycles -= @modeclock
|
@screen_enabled = true
|
||||||
|
@modeclock = 0
|
||||||
if @screen_enable_delay_cycles <= 0
|
@mode = 0
|
||||||
@screen_enable_delay_cycles = 0
|
@auxillary_modeclock = 0
|
||||||
@hide_frames = 3
|
reset_current_line
|
||||||
@mode = 0
|
update_stat_mode
|
||||||
@modeclock = 0
|
compare_lylc
|
||||||
@auxillary_modeclock = 0
|
|
||||||
reset_current_line
|
|
||||||
@window_line = 0
|
|
||||||
@vblank_line = 0
|
|
||||||
|
|
||||||
compare_lylc
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@screen_enable_delay_cycles = 244
|
@screen_enabled = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue