summaryrefslogtreecommitdiff
path: root/home/print_level.asm
diff options
context:
space:
mode:
authorlibjet <libj3t@gmail.com>2020-02-19 23:35:57 +0000
committerlibjet <libj3t@gmail.com>2020-02-19 23:35:57 +0000
commitc2e849aaa2ee59da43984c3d02acf0d60b011ddd (patch)
tree2de6f34a46b268ec7618e1c8e0e109a2da5891ff /home/print_level.asm
parentd1bc3af431cc1203599f0e9bc0c3bd5aa7393a35 (diff)
Add home/print_level.asm
Diffstat (limited to 'home/print_level.asm')
-rwxr-xr-xhome/print_level.asm28
1 files changed, 28 insertions, 0 deletions
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