mirror of
https://github.com/colby-swandale/waterfoul
synced 2024-12-26 21:58:54 +01:00
Avoid calling IO::LCDControl.screen_enabled? twice
This commit is contained in:
parent
b6be04497f
commit
394dfdea5e
1 changed files with 15 additions and 15 deletions
|
@ -37,19 +37,19 @@ module Waterfoul
|
||||||
@modeclock += cycles
|
@modeclock += cycles
|
||||||
@auxillary_modeclock += cycles
|
@auxillary_modeclock += cycles
|
||||||
|
|
||||||
if IO::LCDControl.screen_enabled? && @screen_enabled
|
if IO::LCDControl.screen_enabled?
|
||||||
case @mode
|
if @screen_enabled
|
||||||
when H_BLANK_STATE
|
case @mode
|
||||||
hblank if @modeclock >= H_BLANK_TIME
|
when H_BLANK_STATE
|
||||||
when V_BLANK_STATE
|
hblank if @modeclock >= H_BLANK_TIME
|
||||||
vblank
|
when V_BLANK_STATE
|
||||||
when OAM_READ_STATE
|
vblank
|
||||||
oam if @modeclock >= OAM_SCANLINE_TIME
|
when OAM_READ_STATE
|
||||||
when VMRAM_READ_STATE
|
oam if @modeclock >= OAM_SCANLINE_TIME
|
||||||
vram if @modeclock >= VRAM_SCANLINE_TIME
|
when VMRAM_READ_STATE
|
||||||
end
|
vram if @modeclock >= VRAM_SCANLINE_TIME
|
||||||
else
|
end
|
||||||
if IO::LCDControl.screen_enabled?
|
else
|
||||||
@screen_enabled = true
|
@screen_enabled = true
|
||||||
@modeclock = 0
|
@modeclock = 0
|
||||||
@mode = 0
|
@mode = 0
|
||||||
|
@ -58,9 +58,9 @@ module Waterfoul
|
||||||
reset_current_line
|
reset_current_line
|
||||||
update_stat_mode
|
update_stat_mode
|
||||||
compare_lylc
|
compare_lylc
|
||||||
else
|
|
||||||
@screen_enabled = false
|
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
@screen_enabled = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue