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,7 +37,8 @@ module Waterfoul
|
|||
@modeclock += cycles
|
||||
@auxillary_modeclock += cycles
|
||||
|
||||
if IO::LCDControl.screen_enabled? && @screen_enabled
|
||||
if IO::LCDControl.screen_enabled?
|
||||
if @screen_enabled
|
||||
case @mode
|
||||
when H_BLANK_STATE
|
||||
hblank if @modeclock >= H_BLANK_TIME
|
||||
|
@ -49,7 +50,6 @@ module Waterfoul
|
|||
vram if @modeclock >= VRAM_SCANLINE_TIME
|
||||
end
|
||||
else
|
||||
if IO::LCDControl.screen_enabled?
|
||||
@screen_enabled = true
|
||||
@modeclock = 0
|
||||
@mode = 0
|
||||
|
@ -58,11 +58,11 @@ module Waterfoul
|
|||
reset_current_line
|
||||
update_stat_mode
|
||||
compare_lylc
|
||||
end
|
||||
else
|
||||
@screen_enabled = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def vblank?
|
||||
@vblank
|
||||
|
|
Loading…
Reference in a new issue