diff options
author | Bryan Bishop <kanzure@gmail.com> | 2012-05-31 01:47:19 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2012-05-31 01:47:19 -0500 |
commit | 7fd15ecfb4e85a92d6718dd78a4c10a165d672c3 (patch) | |
tree | f83b1b80cfa988f494e08ca6b962d173d0cd7b12 | |
parent | 7dd189b62ef4536033d752085c1f6c8ce496167d (diff) |
add in PrintNumber_AdvancePointer and Divide from pokered
-rw-r--r-- | main.asm | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -311,7 +311,11 @@ Multiply: ; 0x3119 INCBIN "baserom.gbc",$3119,$3124 - $3119 ; 0x3124 -INCBIN "baserom.gbc",$3124,$313d - $3124 +Divide: ; 0x3124 + INCBIN "baserom.gbc",$3124,$3136 - $3124 +; 0x3136 + +INCBIN "baserom.gbc",$3136,$313d - $3136 PrintLetterDelay: ; 313d ; This function is used to wait a short period after printing a letter to the @@ -699,7 +703,10 @@ SpecialsPointers: ; 0xc029 dbw $24,$4a88 dbw $03,$4224 -INCBIN "baserom.gbc",$c224,$c644 - $c224 +INCBIN "baserom.gbc",$c224,$c5d2 - $c224 + +PrintNumber_PrintDigit: ; c5d2 +INCBIN "baserom.gbc",$c5d2,$c644 - $c5d2 PrintNumber_PrintLeadingZero: ; c644 ; prints a leading zero unless they are turned off in the flags @@ -708,7 +715,22 @@ PrintNumber_PrintLeadingZero: ; c644 ld [hl], "0" ret -INCBIN "baserom.gbc",$c64a,$ffff - $c64a +PrintNumber_AdvancePointer: ; c64a +; increments the pointer unless leading zeroes are not being printed, +; the number is left-aligned, and no nonzero digits have been printed yet + bit 7, d ; print leading zeroes? + jr nz, .incrementPointer\@ + bit 6, d ; left alignment or right alignment? + jr z, .incrementPointer\@ + ld a, [$ffb3] ; was H_PASTLEADINGZEROES + and a + ret z +.incrementPointer\@ + inc hl + ret +; 0xc658 + +INCBIN "baserom.gbc",$c658,$ffff - $c658 SECTION "bank4",DATA,BANK[$4] |