diff --git a/data/items/mom_phone.asm b/data/items/mom_phone.asm index 6e891ef0..56a56ceb 100644 --- a/data/items/mom_phone.asm +++ b/data/items/mom_phone.asm @@ -1,7 +1,6 @@ MACRO momitem ; money to trigger, cost, kind, item - dt \1 - dt \2 + bigdt \1, \2 db \3, \4 ENDM @@ -26,4 +25,4 @@ MomItems_2: momitem 100000, 22800, MOM_DOLL, DECO_BIG_SNORLAX_DOLL .End - dt 0 ; unused + bigdt 0 ; unused diff --git a/engine/events/mom.asm b/engine/events/mom.asm index 633222f3..e6583b20 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -554,26 +554,15 @@ Mom_WithdrawDepositMenuJoypad: ret .DigitQuantities: - dt 100000 - dt 10000 - dt 1000 - dt 100 - dt 10 - dt 1 - - dt 100000 - dt 10000 - dt 1000 - dt 100 - dt 10 - dt 1 - - dt 900000 - dt 90000 - dt 9000 - dt 900 - dt 90 - dt 9 + for x, 5, -1, -1 + bigdt 10**x + endr + for x, 5, -1, -1 + bigdt 10**x + endr + for x, 5, -1, -1 + bigdt 9 * 10**x + endr MomLeavingText1: text_far _MomLeavingText1 diff --git a/engine/events/money.asm b/engine/events/money.asm index c8f9d058..4558fd7e 100644 --- a/engine/events/money.asm +++ b/engine/events/money.asm @@ -23,7 +23,7 @@ GiveMoney:: ret MaxMoney: - dt MAX_MONEY + bigdt MAX_MONEY TakeMoney:: ld a, 3 diff --git a/macros/data.asm b/macros/data.asm index 268c5d4b..e6694e36 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -55,16 +55,25 @@ MACRO dc ; "crumbs" endr ENDM -MACRO dt ; three-byte (big-endian) - db LOW((\1) >> 16), HIGH(\1), LOW(\1) -ENDM - -MACRO dd ; four-byte (big-endian) - db HIGH((\1) >> 16), LOW((\1) >> 16), HIGH(\1), LOW(\1) -ENDM - MACRO bigdw ; big-endian word - db HIGH(\1), LOW(\1) + rept _NARG + db HIGH(\1), LOW(\1) + shift + endr +ENDM + +MACRO bigdt ; big-endian "tribyte" + rept _NARG + db LOW((\1) >> 16), HIGH(\1), LOW(\1) + shift + endr +ENDM + +MACRO bigdd ; big-endian "double word" + rept _NARG + db HIGH((\1) >> 16), LOW((\1) >> 16), HIGH(\1), LOW(\1) + shift + endr ENDM MACRO dba ; dbw bank, address diff --git a/macros/legacy.asm b/macros/legacy.asm index ed1df82e..a97e719a 100644 --- a/macros/legacy.asm +++ b/macros/legacy.asm @@ -13,6 +13,14 @@ ENDM ; macros/data.asm +MACRO dt + bigdt \1 +ENDM + +MACRO dd + bigdd \1 +ENDM + MACRO dbbw db \1, \2 dw \3 diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index 17419873..c6e71d52 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -229,21 +229,21 @@ ENDM MACRO givemoney db givemoney_command db \1 ; account - dt \2 ; money + bigdt \2 ; money ENDM const takemoney_command ; $23 MACRO takemoney db takemoney_command db \1 ; account - dt \2 ; money + bigdt \2 ; money ENDM const checkmoney_command ; $24 MACRO checkmoney db checkmoney_command db \1 ; account - dt \2 ; money + bigdt \2 ; money ENDM const givecoins_command ; $25