diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-05 13:23:57 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-11-05 13:23:57 -0500 |
commit | 2db54ecb9b2ec41dd40318395f69814af64f6f7b (patch) | |
tree | 92dc11a670915c2120344e4ef84f79c844238af1 /engine/math/bcd.asm | |
parent | 379a563c438a9d758d534fd611c3aed705d3b47a (diff) |
Sync more with pokeyellow
Diffstat (limited to 'engine/math/bcd.asm')
-rw-r--r-- | engine/math/bcd.asm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engine/math/bcd.asm b/engine/math/bcd.asm index 1e5aedc9..92bf6f17 100644 --- a/engine/math/bcd.asm +++ b/engine/math/bcd.asm @@ -1,6 +1,9 @@ +; divide hMoney by hDivideBCDDivisor +; return output in hDivideBCDQuotient (same as hDivideBCDDivisor) +; used only to halve player money upon losing a fight DivideBCDPredef:: DivideBCDPredef2:: -DivideBCDPredef3:: +DivideBCDPredef3:: ; only used function DivideBCDPredef4:: call GetPredefRegisters @@ -40,6 +43,7 @@ DivideBCD:: and $f0 ldh [hDivideBCDDivisor+2], a jr .mulBy10Loop + .next push de push de @@ -151,8 +155,8 @@ DivideBCD_getNextDigit: pop bc ret c inc b - ld de, hMoney+2 ; since SubBCD works starting from the least significant digit - ld hl, hDivideBCDDivisor+2 + ld de, hMoney + 2 ; since SubBCD works starting from the least significant digit + ld hl, hDivideBCDDivisor + 2 push bc call SubBCD pop bc |