diff options
author | Marcus Huderle <huderlem@gmail.com> | 2015-03-05 21:01:44 -0800 |
---|---|---|
committer | Marcus Huderle <huderlem@gmail.com> | 2015-03-05 21:01:44 -0800 |
commit | 2f503c0af4ab4229e1549fcce683132d0bdd3c25 (patch) | |
tree | f953d1379d877bc5e81f2ba8029b16a1b25708e3 | |
parent | 581e85d2753083608b6b296801dbedd88f1b8db8 (diff) |
Routine that draws the timer in the top-right corner of the screen during various events.
-rwxr-xr-x | main.asm | 30 | ||||
-rwxr-xr-x | wram.asm | 11 |
2 files changed, 39 insertions, 2 deletions
@@ -5539,7 +5539,35 @@ RedStageInitialMaps: ; 0x16605 db ROCK_MOUNTAIN db LAVENDER_TOWN -INCBIN "baserom.gbc",$1660c,$18000 - $1660c +INCBIN "baserom.gbc",$1660c,$175f5 - $1660c + +DrawTimer: ; 0x175f5 +; Loads the OAM data for the timer in the top-right corner of the screen. + ld a, [wTimerMinutes] + and $f + call DrawTimerDigit + ld a, $a ; colon + call DrawTimerDigit + ld a, [wTimerSeconds] + swap a + and $f + call DrawTimerDigit ; tens digit of the minutes + ld a, [wTimerSeconds] + and $f + call DrawTimerDigit ; ones digit of the minutes + ret + +INCBIN "baserom.gbc",$17615,$17625 - $17615 + +DrawTimerDigit: ; 0x17625 + add $b1 ; the timer digits' OAM ids start at $b1 + call LoadOAMData + ld a, b + add $8 + ld b, a + ret + +INCBIN "baserom.gbc",$1762f,$18000 - $1762f SECTION "bank6", ROMX, BANK[$6] @@ -13,7 +13,16 @@ wOAMBuffer:: ; d000 ; buffer for OAM data. Copied to OAM by DMA ds 4 * 40 - ds $869 + ds $4da + +wTimerSeconds:: ; 0xd57a + ds 1 +wTimerMinutes:: ; 0xd57b + ds 1 +wTimerFrames:: ; 0xd57c + ds 1 + + ds $38c wTitleScreenCursorSelection:: ; 0xd909 ; 0 = Game Start |