Skip to content

Commit

Permalink
Rename dt and dd to bigdt and bigdd
Browse files Browse the repository at this point in the history
This makes their big-endianness obvious and matches `bigdw`
  • Loading branch information
Rangi42 committed Sep 21, 2024
1 parent 7b59860 commit 7a4ca73
Show file tree
Hide file tree
Showing 10 changed files with 270 additions and 266 deletions.
420 changes: 210 additions & 210 deletions data/battle_tower/parties.asm

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions data/events/odd_eggs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OddEggs:
db NO_ITEM
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
dw 02048 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -66,7 +66,7 @@ OddEggs:
db NO_ITEM
db THUNDERSHOCK, CHARM, DIZZY_PUNCH, 0
dw 00256 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -92,7 +92,7 @@ OddEggs:
db NO_ITEM
db POUND, CHARM, DIZZY_PUNCH, 0
dw 04096 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -118,7 +118,7 @@ OddEggs:
db NO_ITEM
db POUND, CHARM, DIZZY_PUNCH, 0
dw 00768 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -144,7 +144,7 @@ OddEggs:
db NO_ITEM
db SING, CHARM, DIZZY_PUNCH, 0
dw 04096 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -170,7 +170,7 @@ OddEggs:
db NO_ITEM
db SING, CHARM, DIZZY_PUNCH, 0
dw 00768 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -196,7 +196,7 @@ OddEggs:
db NO_ITEM
db POUND, LICK, DIZZY_PUNCH, 0
dw 03584 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -222,7 +222,7 @@ OddEggs:
db NO_ITEM
db POUND, LICK, DIZZY_PUNCH, 0
dw 00512 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -248,7 +248,7 @@ OddEggs:
db NO_ITEM
db EMBER, DIZZY_PUNCH, 0, 0
dw 02560 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -274,7 +274,7 @@ OddEggs:
db NO_ITEM
db EMBER, DIZZY_PUNCH, 0, 0
dw 00512 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -300,7 +300,7 @@ OddEggs:
db NO_ITEM
db QUICK_ATTACK, LEER, DIZZY_PUNCH, 0
dw 03072 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -326,7 +326,7 @@ OddEggs:
db NO_ITEM
db QUICK_ATTACK, LEER, DIZZY_PUNCH, 0
dw 00512 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -352,7 +352,7 @@ OddEggs:
db NO_ITEM
db TACKLE, DIZZY_PUNCH, 0, 0
dw 02560 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand All @@ -378,7 +378,7 @@ OddEggs:
db NO_ITEM
db TACKLE, DIZZY_PUNCH, 0, 0
dw 00256 ; OT ID
dt 125 ; Exp
bigdt 125 ; Exp
; Stat exp
bigdw 0
bigdw 0
Expand Down
5 changes: 2 additions & 3 deletions data/items/mom_phone.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MACRO momitem
; money to trigger, cost, kind, item
dt \1
dt \2
bigdt \1, \2
db \3, \4
ENDM

Expand All @@ -26,4 +25,4 @@ MomItems_2:
momitem 100000, 22800, MOM_DOLL, DECO_BIG_SNORLAX_DOLL
.End

dt 0 ; unused
bigdt 0 ; unused
29 changes: 9 additions & 20 deletions engine/events/mom.asm
Original file line number Diff line number Diff line change
Expand Up @@ -552,26 +552,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
Expand Down
1 change: 0 additions & 1 deletion engine/events/mom_phone.asm
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ MomItsInYourRoomText:
text_far _MomItsInYourRoomText
text_end


DummyPredef3A_DummyData: ; unreferenced
db 0

Expand Down
2 changes: 1 addition & 1 deletion engine/events/money.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ GiveMoney::
ret

MaxMoney:
dt MAX_MONEY
bigdt MAX_MONEY

TakeMoney::
ld a, 3
Expand Down
21 changes: 15 additions & 6 deletions macros/data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,25 @@ MACRO dc ; "crumbs"
endr
ENDM

MACRO dt ; three-byte (big-endian)
db LOW((\1) >> 16), HIGH(\1), LOW(\1)
MACRO bigdw ; big-endian word
rept _NARG
db HIGH(\1), LOW(\1)
shift
endr
ENDM

MACRO dd ; four-byte (big-endian)
db HIGH((\1) >> 16), LOW((\1) >> 16), HIGH(\1), LOW(\1)
MACRO bigdt ; big-endian "tribyte"
rept _NARG
db LOW((\1) >> 16), HIGH(\1), LOW(\1)
shift
endr
ENDM

MACRO bigdw ; big-endian word
db HIGH(\1), LOW(\1)
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
Expand Down
8 changes: 8 additions & 0 deletions macros/legacy.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions macros/scripts/events.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions mobile/mobile_41.asm
Original file line number Diff line number Diff line change
Expand Up @@ -698,21 +698,21 @@ endr
ret

._9
dd 1000000000
bigdd 10**9
._8
dd 100000000
bigdd 10**8
._7
dd 10000000
bigdd 10**7
._6
dd 1000000
bigdd 10**6
._5
dd 100000
bigdd 10**5
._4
dd 10000
bigdd 10**4
._3
dd 1000
bigdd 10**3
._2
dd 100
bigdd 10**2

.Function1062b2:
ld c, $0
Expand Down

0 comments on commit 7a4ca73

Please sign in to comment.