diff options
Diffstat (limited to 'home/print_level.asm')
-rw-r--r-- | home/print_level.asm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/home/print_level.asm b/home/print_level.asm new file mode 100644 index 000000000..2ebbbf980 --- /dev/null +++ b/home/print_level.asm @@ -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 [wd265], a + ld de, wd265 + ld b, PRINTNUM_RIGHTALIGN | 1 + jp PrintNum |