diff options
author | libjet <libj3t@gmail.com> | 2020-02-19 23:35:57 +0000 |
---|---|---|
committer | libjet <libj3t@gmail.com> | 2020-02-19 23:35:57 +0000 |
commit | c2e849aaa2ee59da43984c3d02acf0d60b011ddd (patch) | |
tree | 2de6f34a46b268ec7618e1c8e0e109a2da5891ff | |
parent | d1bc3af431cc1203599f0e9bc0c3bd5aa7393a35 (diff) |
Add home/print_level.asm
-rw-r--r-- | home.asm | 22 | ||||
-rwxr-xr-x | home/print_level.asm | 28 |
2 files changed, 29 insertions, 21 deletions
@@ -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 diff --git a/home/print_level.asm b/home/print_level.asm new file mode 100755 index 00000000..dbe14f74 --- /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 [wDeciramBuffer], a + ld de, wDeciramBuffer + ld b, PRINTNUM_RIGHTALIGN | 1 + jp PrintNum
\ No newline at end of file |