diff options
author | yenatch <yenatch@gmail.com> | 2018-04-09 21:30:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 21:30:24 -0400 |
commit | 40b537d45b4b8937038126f7e5d2d21ccee460c0 (patch) | |
tree | 881a090b80b2c22985fc6d1231b03c6721a83462 /home/print_level.asm | |
parent | e4b41fad4fd3787ca2e61adb5377ba8f68fca7ef (diff) | |
parent | 53ff57ca663dc5bf9c3731022b0eb0dc73f2207f (diff) |
Merge pull request #503 from Rangi42/master
Factor wMisc into meaningful parts; move most code out of home.asm
Diffstat (limited to 'home/print_level.asm')
-rw-r--r-- | home/print_level.asm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/home/print_level.asm b/home/print_level.asm new file mode 100644 index 000000000..578c7cd78 --- /dev/null +++ b/home/print_level.asm @@ -0,0 +1,31 @@ +PrintLevel:: ; 382d +; 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 +; 383d + +PrintLevel_Force3Digits:: ; 383d +; Print :L and all 3 digits + ld [hl], "<LV>" + inc hl + ld c, 3 +; 3842 + +Print8BitNumRightAlign:: ; 3842 + ld [wd265], a + ld de, wd265 + ld b, PRINTNUM_RIGHTALIGN | 1 + jp PrintNum +; 384d |