mirror of
https://github.com/pret/pokegold.git
synced 2026-08-27 02:54:29 -05:00
Add home/print_level.asm
This commit is contained in:
22
home.asm
22
home.asm
@@ -262,27 +262,7 @@ INCLUDE "home/stone_queue.asm"
|
||||
INCLUDE "home/trainers.asm"
|
||||
INCLUDE "home/mon_stats.asm"
|
||||
INCLUDE "home/cry.asm"
|
||||
|
||||
PrintLevel:: ; 3a50
|
||||
ld a, [wTempMonLevel]
|
||||
ld [hl], $6e
|
||||
inc hl
|
||||
ld c, $2
|
||||
cp MAX_LEVEL
|
||||
jr c, Print8BitNumRightAlign
|
||||
dec hl
|
||||
inc c
|
||||
jr Print8BitNumRightAlign
|
||||
|
||||
PrintLevel_Force3Digits::
|
||||
ld [hl], $6e
|
||||
inc hl
|
||||
ld c, $3
|
||||
Print8BitNumRightAlign::
|
||||
ld [wd151], a
|
||||
ld de, wd151
|
||||
ld b, PRINTNUM_RIGHTALIGN | 1
|
||||
jp PrintNum
|
||||
INCLUDE "home/print_level.asm"
|
||||
|
||||
Function3a70::
|
||||
ld hl, wd149
|
||||
|
||||
28
home/print_level.asm
Executable file
28
home/print_level.asm
Executable file
@@ -0,0 +1,28 @@
|
||||
PrintLevel::
|
||||
; Print wTempMonLevel at hl
|
||||
|
||||
ld a, [wTempMonLevel]
|
||||
ld [hl], "<LV>"
|
||||
inc hl
|
||||
|
||||
; How many digits?
|
||||
ld c, 2
|
||||
cp 100 ; This is distinct from MAX_LEVEL.
|
||||
jr c, Print8BitNumRightAlign
|
||||
|
||||
; 3-digit numbers overwrite the :L.
|
||||
dec hl
|
||||
inc c
|
||||
jr Print8BitNumRightAlign
|
||||
|
||||
PrintLevel_Force3Digits::
|
||||
; Print :L and all 3 digits
|
||||
ld [hl], "<LV>"
|
||||
inc hl
|
||||
ld c, 3
|
||||
|
||||
Print8BitNumRightAlign::
|
||||
ld [wDeciramBuffer], a
|
||||
ld de, wDeciramBuffer
|
||||
ld b, PRINTNUM_RIGHTALIGN | 1
|
||||
jp PrintNum
|
||||
Reference in New Issue
Block a user