mirror of
https://github.com/colby-swandale/waterfoul
synced 2024-12-27 21:58:55 +01:00
tiny refactor of update lylc
This commit is contained in:
parent
322cbffc3c
commit
bf785c7d54
1 changed files with 11 additions and 9 deletions
|
@ -131,7 +131,8 @@ module Waterfoul
|
||||||
|
|
||||||
def update_stat_mode
|
def update_stat_mode
|
||||||
stat = $mmu.read_byte 0xFF41
|
stat = $mmu.read_byte 0xFF41
|
||||||
$mmu.write_byte 0xFF41, (stat & 0xFC) | (@mode & 0x3)
|
new_stat = (stat & 0xFC) | (@mode & 0x3)
|
||||||
|
$mmu.write_byte 0xFF41, new_stat
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_bg
|
def render_bg
|
||||||
|
@ -192,17 +193,18 @@ module Waterfoul
|
||||||
end
|
end
|
||||||
|
|
||||||
def compare_lylc
|
def compare_lylc
|
||||||
|
if IO::LCDControl.screen_enabled?
|
||||||
lyc = $mmu.read_byte 0xFF45
|
lyc = $mmu.read_byte 0xFF45
|
||||||
stat = $mmu.read_byte 0xFF41
|
stat = $mmu.read_byte 0xFF41
|
||||||
|
|
||||||
if lyc == current_line
|
if lyc == current_line
|
||||||
stat |= BIT_2
|
stat = stat | 0x4
|
||||||
else
|
else
|
||||||
stat = stat & 0xFB
|
stat = stat & 0xFB
|
||||||
end
|
end
|
||||||
|
|
||||||
$mmu.write_byte 0xFF41, stat
|
$mmu.write_byte 0xFF41, stat
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def current_line
|
def current_line
|
||||||
$mmu.read_byte LCDC_Y_COORDINATE_MEM_LOC
|
$mmu.read_byte LCDC_Y_COORDINATE_MEM_LOC
|
||||||
|
|
Loading…
Reference in a new issue