ref: ee5bf7164038ad9f0c988de8f9c35c1c8911acfc
parent: def3b6049387a6d2afab66780f7f09dbb61d6166
author: xCrystal <rgr.crystal@gmail.com>
date: Fri Dec 29 11:19:51 EST 2017
Consistently name unknown fields in macros/wram as Fieldxx
--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -829,7 +829,7 @@
ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
ld [hl], a ; remainder
- ld hl, Channel1Field0x25 - Channel1
+ ld hl, Channel1Field25 - Channel1
add hl, bc
xor a
ld [hl], a
@@ -981,12 +981,12 @@
add hl, de
ld d, h
ld e, l
- ; [Channel*Field0x25] += [Channel*PitchWheelAmountFraction]
+ ; [Channel*Field25] += [Channel*PitchWheelAmountFraction]
; if rollover: Frequency += 1
ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
ld a, [hl]
- ld hl, Channel1Field0x25 - Channel1
+ ld hl, Channel1Field25 - Channel1
add hl, bc
add [hl]
ld [hl], a
@@ -1023,7 +1023,7 @@
ld a, d
sbc 0
ld d, a
- ; [Channel*Field0x25] *= 2
+ ; [Channel*Field25] *= 2
; if rollover: Frequency -= 1
ld hl, Channel1PitchWheelAmountFraction - Channel1
add hl, bc
@@ -1726,7 +1726,7 @@
; seems to have been dummied out
; params: 1
call GetMusicByte
- ld hl, Channel1Field0x2c - Channel1
+ ld hl, Channel1Field2c - Channel1
add hl, bc
ld [hl], a
ld hl, Channel1Flags2 - Channel1
@@ -1849,7 +1849,7 @@
add hl, bc
set SOUND_UNKN_0E, [hl]
call GetMusicByte
- ld hl, Channel1Field0x29 - Channel1
+ ld hl, Channel1Field29 - Channel1
add hl, bc
ld [hl], a
ret
@@ -1885,7 +1885,7 @@
add hl, bc
set SOUND_UNKN_0D, [hl]
call GetMusicByte
- ld hl, Channel1Field0x2a - Channel1
+ ld hl, Channel1Field2a - Channel1
add hl, bc
ld [hl], a
ret
@@ -2307,7 +2307,7 @@
inc hl
ld d, [hl]
; add ???? to the next result
- ld hl, Channel1Field0x16 - Channel1
+ ld hl, Channel1Field16 - Channel1
add hl, bc
ld l, [hl]
; multiply Tempo by last result (NoteLength * LOW(delay))
@@ -2316,7 +2316,7 @@
ld e, l
ld d, h
; store result in ????
- ld hl, Channel1Field0x16 - Channel1
+ ld hl, Channel1Field16 - Channel1
add hl, bc
ld [hl], e
; store result in NoteDuration
@@ -2392,7 +2392,7 @@
ld [hl], d
; clear ????
xor a
- ld hl, Channel1Field0x16 - Channel1
+ ld hl, Channel1Field16 - Channel1
add hl, bc
ld [hl], a
ret
@@ -2749,7 +2749,7 @@
add hl, bc
ld [hl], a
- ld hl, Channel1Field0x30 - Channel1 ; $c131 - Channel1
+ ld hl, Channel1Field30 - Channel1 ; $c131 - Channel1
add hl, bc
ld [hl], a
@@ -2760,11 +2760,11 @@
; ch3-4
ld a, [wSFXDuration]
- ld hl, Channel1Field0x2e - Channel1 ; $c12f - Channel1
+ ld hl, Channel1Field2e - Channel1 ; $c12f - Channel1
add hl, bc
ld [hl], a
- ld hl, Channel1Field0x2f - Channel1 ; $c130 - Channel1
+ ld hl, Channel1Field2f - Channel1 ; $c130 - Channel1
add hl, bc
ld [hl], a
--- a/constants/map_data_constants.asm
+++ b/constants/map_data_constants.asm
@@ -34,7 +34,7 @@
const PALETTE_MORN
const PALETTE_DARK
-; fish groups
+; fish groups
const_def
const FISHGROUP_NONE
const FISHGROUP_SHORE
@@ -97,10 +97,10 @@
const OBJECT_SPRITE_X_OFFSET ; 19
const OBJECT_SPRITE_Y_OFFSET ; 1a
const OBJECT_MOVEMENT_BYTE_INDEX ; 1b
- const OBJECT_28 ; 1c
- const OBJECT_29 ; 1d
- const OBJECT_30 ; 1e
- const OBJECT_31 ; 1f
+ const OBJECT_1C ; 1c
+ const OBJECT_1D ; 1d
+ const OBJECT_1E ; 1e
+ const OBJECT_1F ; 1f
const OBJECT_RANGE ; 20
; 33-39 are not used
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -2314,7 +2314,7 @@
ld [hSCY], a
xor $ff
inc a
- ld [AnimObject01_YOffset], a
+ ld [AnimObject01YOffset], a
ret
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -285,7 +285,7 @@
ld [hli], a
ld [hli], a
ld [hli], a
- ld [hl], a ; OBJECT_30
+ ld [hl], a ; OBJECT_1E
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
ld [hl], STANDING
@@ -482,22 +482,22 @@
ret
; 479b
-ClearObjectStructField28: ; 479b
- ld hl, OBJECT_28
+ClearObjectStructField1c: ; 479b
+ ld hl, OBJECT_1C
add hl, bc
ld [hl], 0
ret
; 47a2
-IncrementObjectStructField28: ; 47a2
- ld hl, OBJECT_28
+IncrementObjectStructField1c: ; 47a2
+ ld hl, OBJECT_1C
add hl, bc
inc [hl]
ret
; 47a8
-Object28AnonymousJumptable: ; 47a8
- ld hl, OBJECT_28
+Field1cAnonymousJumptable: ; 47a8
+ ld hl, OBJECT_1C
add hl, bc
ld a, [hl]
pop hl
@@ -505,15 +505,15 @@
ret
; 47b0
-GetValueObjectStructField28: ; 47b0
- ld hl, OBJECT_28
+GetValueObjectStructField1c: ; 47b0
+ ld hl, OBJECT_1C
add hl, bc
ld a, [hl]
ret
; 47b6
-SetValueObjectStructField28: ; 47b6
- ld hl, OBJECT_28
+SetValueObjectStructField1c: ; 47b6
+ ld hl, OBJECT_1C
add hl, bc
ld [hl], a
ret
@@ -541,7 +541,7 @@
; 47dd
MapObjectMovementPattern: ; 47dd
- call ClearObjectStructField28
+ call ClearObjectStructField1c
call GetSpriteMovementFunction
ld a, [hl]
ld hl, .Pointers
@@ -1002,7 +1002,7 @@
ld d, b
ld e, c
pop bc
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld [hl], e
inc hl
@@ -1021,7 +1021,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], e
- ld hl, OBJECT_30
+ ld hl, OBJECT_1E
add hl, bc
ld [hl], a
ld hl, OBJECT_STEP_TYPE
@@ -1141,7 +1141,7 @@
; 4b86
NPCJump: ; 4b86
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Jump
dw .Land
@@ -1158,7 +1158,7 @@
ld hl, OBJECT_FLAGS2
add hl, bc
res 3, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.Land:
@@ -1176,7 +1176,7 @@
; 4bbf
PlayerJump: ; 4bbf
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .initjump
dw .stepjump
@@ -1186,7 +1186,7 @@
.initjump
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.stepjump
call UpdateJumpPosition
call UpdatePlayerStep
@@ -1201,7 +1201,7 @@
ld hl, wPlayerStepFlags
set 6, [hl]
set 4, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.initland
@@ -1208,7 +1208,7 @@
call GetNextTile
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.stepland
call UpdateJumpPosition
call UpdatePlayerStep
@@ -1226,7 +1226,7 @@
; 4c18
TeleportFrom: ; 4c18
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .InitSpin
dw .DoSpin
@@ -1241,7 +1241,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.DoSpin:
ld hl, OBJECT_ACTION
add hl, bc
@@ -1250,7 +1250,7 @@
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
.InitSpinRise:
@@ -1257,7 +1257,7 @@
ld hl, OBJECT_STEP_FRAME
add hl, bc
ld [hl], 0
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld [hl], $10
ld hl, OBJECT_STEP_DURATION
@@ -1266,12 +1266,12 @@
ld hl, OBJECT_FLAGS2
add hl, bc
res 3, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.DoSpinRise:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], OBJECT_ACTION_SPIN
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
inc [hl]
ld a, [hl]
@@ -1296,7 +1296,7 @@
; 4c89
TeleportTo: ; 4c89
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .InitWait
dw .DoWait
@@ -1314,7 +1314,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
; 4caa
@@ -1323,18 +1323,18 @@
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.InitDescent:
ld hl, OBJECT_STEP_FRAME
add hl, bc
ld [hl], 0
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld [hl], 0
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
; 4cc9
@@ -1342,7 +1342,7 @@
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], OBJECT_ACTION_SPIN
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
inc [hl]
ld a, [hl]
@@ -1357,12 +1357,12 @@
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.InitFinalSpin:
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
ret
; 4cf5
@@ -1388,7 +1388,7 @@
; 4d14
Skyfall: ; 4d14
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Step
@@ -1403,7 +1403,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Step:
ld hl, OBJECT_STEP_DURATION
add hl, bc
@@ -1415,15 +1415,15 @@
ld hl, OBJECT_STEP_FRAME
add hl, bc
ld [hl], 0
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld [hl], 0
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Fall:
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
inc [hl]
ld a, [hl]
@@ -1438,7 +1438,7 @@
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Finish:
ld hl, OBJECT_STEP_FRAME
add hl, bc
@@ -1453,7 +1453,7 @@
; 4d7e
GotBiteStep: ; 4d7e
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
@@ -1466,7 +1466,7 @@
ld hl, OBJECT_SPRITE_Y_OFFSET
add hl, bc
ld [hl], 0
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Run:
ld hl, OBJECT_SPRITE_Y_OFFSET
add hl, bc
@@ -1558,7 +1558,7 @@
; 4e0c
StepType05: ; 4e0c
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Reset
dw StepType04
@@ -1569,7 +1569,7 @@
ld hl, OBJECT_FACING
add hl, bc
ld [hl], a
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
StepType04: ; 4e21
call MobileFn_4fb2
ld hl, OBJECT_DIRECTION_WALKING
@@ -1607,7 +1607,7 @@
PlayerStep: ; 4e56
; AnimateStep?
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .init
dw .step
@@ -1615,7 +1615,7 @@
.init
ld hl, wPlayerStepFlags
set 7, [hl]
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.step
call UpdatePlayerStep
ld hl, OBJECT_STEP_DURATION
@@ -1635,7 +1635,7 @@
; 4e83
PlayerOrNPCTurnStep: ; 4e83
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .init1
dw .step1
@@ -1653,15 +1653,15 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 2
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.step1
ld hl, OBJECT_STEP_DURATION
add hl, bc
dec [hl]
ret nz
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.init2
- ld hl, OBJECT_29 ; new facing
+ ld hl, OBJECT_1D ; new facing
add hl, bc
ld a, [hl]
ld hl, OBJECT_FACING
@@ -1670,7 +1670,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 2
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.step2
ld hl, OBJECT_STEP_DURATION
add hl, bc
@@ -1715,7 +1715,7 @@
; 4f04
StepTypeTrackingObject: ; 4f04
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld e, [hl]
inc hl
@@ -1750,7 +1750,7 @@
StepType14: ; 4f33
StepType15: ; 4f33
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
@@ -1757,12 +1757,12 @@
.Init:
xor a
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld [hl], a
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Run:
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld d, [hl]
ld a, [wPlayerStepVectorY]
@@ -1774,7 +1774,7 @@
jr z, .ok
ld a, [hl]
call .GetSign
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
ld [hl], a
ld d, a
@@ -1788,7 +1788,7 @@
ret
.GetSign:
- ld hl, OBJECT_30
+ ld hl, OBJECT_1E
add hl, bc
and 1
ld a, [hl]
@@ -1799,10 +1799,10 @@
; 4f77
StepType16: ; 4f77
- call Object28AnonymousJumptable ; ????
+ call Field1cAnonymousJumptable ; ????
; 4f7a
StepType17: ; 4f7a
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .null
dw .null
@@ -1811,7 +1811,7 @@
; 4f83
SkyfallTop: ; 4f83
- call Object28AnonymousJumptable
+ call Field1cAnonymousJumptable
; anonymous dw
dw .Init
dw .Run
@@ -1823,7 +1823,7 @@
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
- call IncrementObjectStructField28
+ call IncrementObjectStructField1c
.Run:
ld hl, OBJECT_STEP_DURATION
@@ -1843,7 +1843,7 @@
; 4fb2
MobileFn_4fb2: mobile
- ld hl, OBJECT_29
+ ld hl, OBJECT_1D
add hl, bc
inc [hl]
ld a, [hl]
@@ -1866,7 +1866,7 @@
UpdateJumpPosition: ; 4fd5
call GetStepVector
ld a, h
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld e, [hl]
add e
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -727,7 +727,7 @@
jr TurnStep
TurnStep: ; 5400
- ld hl, OBJECT_29 ; new facing
+ ld hl, OBJECT_1D ; new facing
add hl, bc
ld [hl], a
@@ -832,7 +832,7 @@
JumpStep: ; 548a
call InitStep
- ld hl, OBJECT_31
+ ld hl, OBJECT_1F
add hl, bc
ld [hl], $0
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -1326,7 +1326,7 @@
ld hl, wReel1ReelAction - wReel1
add hl, bc
inc [hl] ; REEL_ACTION_WAIT_DROP_REEL
- ld hl, wReel1Slot0b - wReel1
+ ld hl, wReel1Field0b - wReel1
add hl, bc
ld [hl], 32
ld hl, wReel1SpinRate - wReel1
@@ -1333,7 +1333,7 @@
add hl, bc
ld [hl], 0
ReelAction_WaitDropReel: ; 92e31
- ld hl, wReel1Slot0b - wReel1
+ ld hl, wReel1Field0b - wReel1
add hl, bc
ld a, [hl]
and a
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -149,7 +149,7 @@
\1Octave:: db ; 7-0 (0 is highest)
\1PitchOffset:: db ; raises existing octaves (to repeat phrases)
\1NoteDuration:: db ; frames remaining for the current note
-\1Field0x16:: ds 1 ; c117
+\1Field16:: ds 1 ; c117
ds 1 ; c118
\1LoopCount:: db
\1Tempo:: dw
@@ -162,16 +162,16 @@
\1PitchWheelTarget:: dw ; frequency endpoint for pitch wheel
\1PitchWheelAmount:: db ; c124
\1PitchWheelAmountFraction:: db ; c125
-\1Field0x25:: db ; c126
+\1Field25:: db ; c126
ds 1 ; c127
\1CryPitch:: dw
-\1Field0x29:: ds 1
-\1Field0x2a:: ds 2
-\1Field0x2c:: ds 1
+\1Field29:: ds 1
+\1Field2a:: ds 2
+\1Field2c:: ds 1
\1NoteLength:: db ; frames per 16th note
-\1Field0x2e:: ds 1 ; c12f
-\1Field0x2f:: ds 1 ; c130
-\1Field0x30:: ds 1 ; c131
+\1Field2e:: ds 1 ; c12f
+\1Field2f:: ds 1 ; c130
+\1Field30:: ds 1 ; c131
ds 1 ; c132
ENDM
@@ -277,10 +277,10 @@
\1XCoord:: db
\1ManipCounter:: db
\1ManipDelay:: db
-\1Slot0b:: ds 1
-\1Slot0c:: ds 1
-\1Slot0d:: ds 1
-\1Slot0e:: ds 1
+\1Field0b:: ds 1
+\1Field0c:: ds 1
+\1Field0d:: ds 1
+\1Field0e:: ds 1
\1StopDelay:: db
ENDM
@@ -313,10 +313,10 @@
\1SpriteXOffset:: db
\1SpriteYOffset:: db
\1MovementByteIndex:: db
-\1Object28:: ds 1
-\1Object29:: ds 1
-\1Object30:: ds 1
-\1Object31:: ds 1
+\1Field1c:: ds 1
+\1Field1d:: ds 1
+\1Field1e:: ds 1
+\1Field1f:: ds 1
\1Range:: db
ds 7
\1StructEnd::
@@ -351,44 +351,44 @@
\1Duration:: db
\1DurationOffset:: db
\1FrameIndex:: db
-\1Sprite0b:: ds 1
-\1Sprite0c:: ds 1
-\1Sprite0d:: ds 1
-\1Sprite0e:: ds 1
-\1Sprite0f:: ds 1
+\1JumptableIndex:: db
+\1Field0c:: ds 1
+\1Field0d:: ds 1
+\1Field0e:: ds 1
+\1Field0f:: ds 1
ENDM
battle_anim_struct: MACRO
; Placeholder until we can figure out what it all means
-\1_Index:: db
-\1_Anim01:: ds 1
-\1_Anim02:: ds 1
-\1_FramesetIndex:: db
-\1_FunctionIndex:: db
-\1_Anim05:: ds 1
-\1_TileID:: db
-\1_XCoord:: db
-\1_YCoord:: db
-\1_XOffset:: db
-\1_YOffset:: db
-\1_Anim0b:: ds 1
-\1_Anim0c:: ds 1
-\1_Anim0d:: ds 1
-\1_AnonJumptableIndex:: db
-\1_Anim0f:: ds 1
-\1_Anim10:: ds 1
-\1_Anim11:: ds 1
-\1_Anim12:: ds 1
-\1_Anim13:: ds 1
-\1_Anim14:: ds 1
-\1_Anim15:: ds 1
-\1_Anim16:: ds 1
-\1_Anim17:: ds 1
+\1Index:: db
+\1Field01:: ds 1
+\1Field02:: ds 1
+\1FramesetID:: db
+\1Function:: db
+\1Palette:: db
+\1TileID:: db
+\1XCoord:: db
+\1YCoord:: db
+\1XOffset:: db
+\1YOffset:: db
+\1Field0b:: ds 1
+\1Duration:: db
+\1Frame:: db
+\1AnonJumptableIndex:: db
+\1Field0f:: ds 1
+\1Field10:: ds 1
+\1Field11:: ds 1
+\1Field12:: ds 1
+\1Field13:: ds 1
+\1Field14:: ds 1
+\1Field15:: ds 1
+\1Field16:: ds 1
+\1Field17:: ds 1
ENDM
battle_bg_effect: MACRO
-\1_Function:: db
-\1_01:: ds 1
-\1_02:: ds 1
-\1_03:: ds 1
+\1Function:: db
+\1Field01:: ds 1
+\1Field02:: ds 1
+\1Field03:: ds 1
ENDM