2017-12-14 05:36:24 +00:00
|
|
|
; Used in wram.asm
|
2016-01-07 23:45:32 +00:00
|
|
|
|
|
|
|
flag_array: MACRO
|
|
|
|
ds ((\1) + 7) / 8
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
box_struct: MACRO
|
|
|
|
\1Species:: db
|
|
|
|
\1Item:: db
|
|
|
|
\1Moves:: ds NUM_MOVES
|
|
|
|
\1ID:: dw
|
|
|
|
\1Exp:: ds 3
|
|
|
|
\1StatExp::
|
|
|
|
\1HPExp:: dw
|
|
|
|
\1AtkExp:: dw
|
|
|
|
\1DefExp:: dw
|
|
|
|
\1SpdExp:: dw
|
|
|
|
\1SpcExp:: dw
|
2017-12-14 05:36:24 +00:00
|
|
|
\1DVs:: dw
|
2016-01-07 23:45:32 +00:00
|
|
|
\1PP:: ds NUM_MOVES
|
|
|
|
\1Happiness:: db
|
|
|
|
\1PokerusStatus:: db
|
|
|
|
\1CaughtData::
|
|
|
|
\1CaughtTime::
|
|
|
|
\1CaughtLevel:: db
|
|
|
|
\1CaughtGender::
|
|
|
|
\1CaughtLocation:: db
|
|
|
|
\1Level:: db
|
|
|
|
\1End::
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
party_struct: MACRO
|
|
|
|
box_struct \1
|
|
|
|
\1Status:: db
|
|
|
|
\1Unused:: db
|
|
|
|
\1HP:: dw
|
|
|
|
\1MaxHP:: dw
|
|
|
|
\1Stats:: ; big endian
|
|
|
|
\1Attack:: dw
|
|
|
|
\1Defense:: dw
|
|
|
|
\1Speed:: dw
|
|
|
|
\1SpclAtk:: dw
|
|
|
|
\1SpclDef:: dw
|
|
|
|
\1StatsEnd::
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
red_box_struct: MACRO
|
|
|
|
\1Species:: db
|
|
|
|
\1HP:: dw
|
|
|
|
\1BoxLevel:: db
|
|
|
|
\1Status:: db
|
|
|
|
\1Type::
|
|
|
|
\1Type1:: db
|
|
|
|
\1Type2:: db
|
|
|
|
\1CatchRate:: db
|
|
|
|
\1Moves:: ds NUM_MOVES
|
|
|
|
\1OTID:: dw
|
|
|
|
\1Exp:: ds 3
|
|
|
|
\1HPExp:: dw
|
|
|
|
\1AttackExp:: dw
|
|
|
|
\1DefenseExp:: dw
|
|
|
|
\1SpeedExp:: dw
|
|
|
|
\1SpecialExp:: dw
|
2017-12-14 05:36:24 +00:00
|
|
|
\1DVs:: dw
|
2016-01-07 23:45:32 +00:00
|
|
|
\1PP:: ds NUM_MOVES
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
red_party_struct: MACRO
|
|
|
|
red_box_struct \1
|
|
|
|
\1Level:: db
|
|
|
|
\1Stats::
|
|
|
|
\1MaxHP:: dw
|
|
|
|
\1Attack:: dw
|
|
|
|
\1Defense:: dw
|
|
|
|
\1Speed:: dw
|
|
|
|
\1Special:: dw
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
|
|
|
|
battle_struct: MACRO
|
|
|
|
\1Species:: db
|
|
|
|
\1Item:: db
|
|
|
|
\1Moves:: ds NUM_MOVES
|
|
|
|
\1MovesEnd::
|
2017-12-14 05:36:24 +00:00
|
|
|
\1DVs:: dw
|
2016-01-07 23:45:32 +00:00
|
|
|
\1PP:: ds NUM_MOVES
|
|
|
|
\1Happiness:: db
|
|
|
|
\1Level:: db
|
|
|
|
\1Status:: ds 2
|
|
|
|
\1HP:: dw
|
|
|
|
\1MaxHP:: dw
|
|
|
|
\1Stats:: ; big endian
|
|
|
|
\1Attack:: dw
|
|
|
|
\1Defense:: dw
|
|
|
|
\1Speed:: dw
|
|
|
|
\1SpclAtk:: dw
|
|
|
|
\1SpclDef:: dw
|
|
|
|
\1StatsEnd::
|
|
|
|
\1Type::
|
|
|
|
\1Type1:: db
|
|
|
|
\1Type2:: db
|
|
|
|
\1StructEnd::
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
box: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Count:: db
|
2016-01-07 23:45:32 +00:00
|
|
|
\1Species:: ds MONS_PER_BOX + 1
|
|
|
|
\1Mons::
|
|
|
|
\1Mon1:: box_struct \1Mon1
|
2018-02-03 03:55:38 +00:00
|
|
|
\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX + -1)
|
2016-01-07 23:45:32 +00:00
|
|
|
\1MonOT:: ds NAME_LENGTH * MONS_PER_BOX
|
2018-01-20 17:25:55 +00:00
|
|
|
\1MonNicknames:: ds MON_NAME_LENGTH * MONS_PER_BOX
|
2016-01-07 23:45:32 +00:00
|
|
|
\1MonNicknamesEnd::
|
|
|
|
\1End:: ds 2 ; padding
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
|
2017-12-15 23:25:32 +00:00
|
|
|
map_connection_struct: MACRO
|
|
|
|
\1ConnectedMapGroup:: db
|
|
|
|
\1ConnectedMapNumber:: db
|
|
|
|
\1ConnectionStripPointer:: dw
|
|
|
|
\1ConnectionStripLocation:: dw
|
|
|
|
\1ConnectionStripLength:: db
|
|
|
|
\1ConnectedMapWidth:: db
|
|
|
|
\1ConnectionStripYOffset:: db
|
|
|
|
\1ConnectionStripXOffset:: db
|
|
|
|
\1ConnectionWindow:: dw
|
|
|
|
ENDM
|
|
|
|
|
2016-01-07 23:45:32 +00:00
|
|
|
channel_struct: MACRO
|
2018-01-23 21:45:34 +00:00
|
|
|
; Addreses are wChannel1 (c101).
|
2016-01-07 23:45:32 +00:00
|
|
|
\1MusicID:: dw
|
|
|
|
\1MusicBank:: db
|
2018-06-04 09:35:27 +00:00
|
|
|
\1Flags1:: db ; 0:on/off 1:subroutine 3:sfx 4:noise 5:rest
|
2016-01-07 23:45:32 +00:00
|
|
|
\1Flags2:: db ; 0:vibrato on/off 2:duty 4:cry pitch
|
|
|
|
\1Flags3:: db ; 0:vibrato up/down
|
|
|
|
\1MusicAddress:: dw
|
|
|
|
\1LastMusicAddress:: dw
|
|
|
|
dw
|
|
|
|
\1NoteFlags:: db ; 5:rest
|
|
|
|
\1Condition:: db ; conditional jumps
|
|
|
|
\1DutyCycle:: db ; bits 6-7 (0:12.5% 1:25% 2:50% 3:75%)
|
|
|
|
\1Intensity:: db ; hi:pressure lo:velocity
|
2018-06-04 09:35:27 +00:00
|
|
|
\1Frequency:: dw ; 11 bits
|
2016-01-07 23:45:32 +00:00
|
|
|
\1Pitch:: db ; 0:rest 1-c:note
|
|
|
|
\1Octave:: db ; 7-0 (0 is highest)
|
2017-12-14 05:36:24 +00:00
|
|
|
\1PitchOffset:: db ; raises existing octaves (to repeat phrases)
|
2016-01-07 23:45:32 +00:00
|
|
|
\1NoteDuration:: db ; frames remaining for the current note
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field16:: ds 1 ; c117
|
2016-01-07 23:45:32 +00:00
|
|
|
ds 1 ; c118
|
|
|
|
\1LoopCount:: db
|
|
|
|
\1Tempo:: dw
|
|
|
|
\1Tracks:: db ; hi:left lo:right
|
2017-12-14 05:36:24 +00:00
|
|
|
\1SFXDutyLoop:: db ; c11d
|
2016-01-07 23:45:32 +00:00
|
|
|
\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
|
|
|
|
\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
|
|
|
|
\1VibratoExtent:: db
|
|
|
|
\1VibratoRate:: db ; hi:frames for each alt lo:frames to the next alt
|
2016-05-10 18:33:24 +00:00
|
|
|
\1PitchWheelTarget:: dw ; frequency endpoint for pitch wheel
|
|
|
|
\1PitchWheelAmount:: db ; c124
|
|
|
|
\1PitchWheelAmountFraction:: db ; c125
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field25:: db ; c126
|
2016-01-07 23:45:32 +00:00
|
|
|
ds 1 ; c127
|
|
|
|
\1CryPitch:: dw
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field29:: ds 1
|
|
|
|
\1Field2a:: ds 2
|
|
|
|
\1Field2c:: ds 1
|
2016-01-07 23:45:32 +00:00
|
|
|
\1NoteLength:: db ; frames per 16th note
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field2e:: ds 1 ; c12f
|
|
|
|
\1Field2f:: ds 1 ; c130
|
|
|
|
\1Field30:: ds 1 ; c131
|
2016-01-07 23:45:32 +00:00
|
|
|
ds 1 ; c132
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
battle_tower_struct: MACRO
|
2018-02-03 03:55:38 +00:00
|
|
|
\1Name:: ds NAME_LENGTH + -1
|
2016-01-07 23:45:32 +00:00
|
|
|
\1TrainerClass:: ds 1
|
2018-02-22 16:13:29 +00:00
|
|
|
\1Mon1:: party_struct \1Mon1
|
|
|
|
\1Mon1Name:: ds MON_NAME_LENGTH
|
|
|
|
\1Mon1NameEnd::
|
|
|
|
\1Mon2:: party_struct \1Mon2
|
|
|
|
\1Mon2Name:: ds MON_NAME_LENGTH
|
|
|
|
\1Mon2NameEnd::
|
|
|
|
\1Mon3:: party_struct \1Mon3
|
|
|
|
\1Mon3Name:: ds MON_NAME_LENGTH
|
|
|
|
\1Mon3NameEnd::
|
2016-01-07 23:45:32 +00:00
|
|
|
\1TrainerData:: ds BATTLETOWER_TRAINERDATALENGTH
|
|
|
|
\1TrainerEnd::
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-01-07 23:45:32 +00:00
|
|
|
|
|
|
|
mailmsg: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Message:: ds MAIL_MSG_LENGTH
|
2016-01-07 23:45:32 +00:00
|
|
|
\1MessageEnd:: ds 1
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Author:: ds PLAYER_NAME_LENGTH
|
2016-01-07 23:45:32 +00:00
|
|
|
\1AuthorNationality:: ds 2
|
2017-12-14 05:36:24 +00:00
|
|
|
\1AuthorID:: dw
|
|
|
|
\1Species:: db
|
|
|
|
\1Type:: db
|
2016-01-07 23:45:32 +00:00
|
|
|
\1End::
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-01-07 23:45:32 +00:00
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
roam_struct: MACRO
|
|
|
|
\1Species:: db
|
|
|
|
\1Level:: db
|
|
|
|
\1MapGroup:: db
|
|
|
|
\1MapNumber:: db
|
2017-12-14 05:36:24 +00:00
|
|
|
\1HP:: db
|
|
|
|
\1DVs:: dw
|
2016-05-01 01:20:12 +00:00
|
|
|
ENDM
|
|
|
|
|
2017-12-28 12:23:44 +00:00
|
|
|
bugcontestwinner: MACRO
|
2017-12-24 18:46:34 +00:00
|
|
|
\1WinnerID:: db
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Mon:: db
|
|
|
|
\1Score:: dw
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2017-12-14 05:36:24 +00:00
|
|
|
|
|
|
|
hof_mon: MACRO
|
|
|
|
\1Species:: db
|
|
|
|
\1ID:: dw
|
|
|
|
\1DVs:: dw
|
|
|
|
\1Level:: db
|
2018-02-03 03:55:38 +00:00
|
|
|
\1Nickname:: ds MON_NAME_LENGTH + -1
|
2017-12-14 05:36:24 +00:00
|
|
|
\1End::
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-05-01 01:20:12 +00:00
|
|
|
|
2016-01-07 23:45:32 +00:00
|
|
|
hall_of_fame: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1WinCount:: db
|
2016-04-10 18:42:14 +00:00
|
|
|
\1Mon1:: hof_mon \1Mon1
|
|
|
|
\1Mon2:: hof_mon \1Mon2
|
|
|
|
\1Mon3:: hof_mon \1Mon3
|
|
|
|
\1Mon4:: hof_mon \1Mon4
|
|
|
|
\1Mon5:: hof_mon \1Mon5
|
2016-01-07 23:45:32 +00:00
|
|
|
\1Mon6:: hof_mon \1Mon6
|
2018-03-19 15:36:14 +00:00
|
|
|
\1End:: db
|
2016-01-07 23:45:32 +00:00
|
|
|
ENDM
|
2016-01-09 21:28:22 +00:00
|
|
|
|
2017-12-14 05:36:24 +00:00
|
|
|
link_battle_record: MACRO
|
2018-02-03 03:55:38 +00:00
|
|
|
\1Name:: ds NAME_LENGTH + -1
|
2017-12-14 05:36:24 +00:00
|
|
|
\1ID:: dw
|
|
|
|
\1Wins:: dw
|
|
|
|
\1Losses:: dw
|
|
|
|
\1Draws:: dw
|
|
|
|
ENDM
|
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
trademon: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Species:: db ; wc6d0 | wc702
|
2018-01-20 17:25:55 +00:00
|
|
|
\1SpeciesName:: ds MON_NAME_LENGTH ; wc6d1 | wc703
|
|
|
|
\1Nickname:: ds MON_NAME_LENGTH ; wc6dc | wc70e
|
2017-12-14 05:36:24 +00:00
|
|
|
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
|
|
|
|
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
|
|
|
|
\1DVs:: dw ; wc6fd | wc72f
|
|
|
|
\1ID:: dw ; wc6ff | wc731
|
|
|
|
\1CaughtData:: db ; wc701 | wc733
|
2016-01-09 21:28:22 +00:00
|
|
|
\1End::
|
|
|
|
ENDM
|
2016-01-10 00:34:14 +00:00
|
|
|
|
|
|
|
move_struct: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Animation:: db
|
|
|
|
\1Effect:: db
|
|
|
|
\1Power:: db
|
|
|
|
\1Type:: db
|
|
|
|
\1Accuracy:: db
|
|
|
|
\1PP:: db
|
|
|
|
\1EffectChance:: db
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-01-10 04:41:03 +00:00
|
|
|
|
|
|
|
slot_reel: MACRO
|
|
|
|
\1ReelAction:: db
|
|
|
|
\1TilemapAddr:: dw
|
|
|
|
\1Position:: db
|
|
|
|
\1SpinDistance:: db
|
|
|
|
\1SpinRate:: db
|
|
|
|
\1OAMAddr:: dw
|
|
|
|
\1XCoord:: db
|
2017-12-28 18:38:15 +00:00
|
|
|
\1ManipCounter:: db
|
|
|
|
\1ManipDelay:: db
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field0b:: ds 1
|
|
|
|
\1Field0c:: ds 1
|
|
|
|
\1Field0d:: ds 1
|
|
|
|
\1Field0e:: ds 1
|
2017-12-28 18:38:15 +00:00
|
|
|
\1StopDelay:: db
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-05-01 01:20:12 +00:00
|
|
|
|
|
|
|
object_struct: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Sprite:: db
|
|
|
|
\1MapObjectIndex:: db
|
|
|
|
\1SpriteTile:: db
|
|
|
|
\1MovementType:: db
|
|
|
|
\1Flags:: dw
|
|
|
|
\1Palette:: db
|
|
|
|
\1Walking:: db
|
|
|
|
\1Direction:: db
|
|
|
|
\1StepType:: db
|
|
|
|
\1StepDuration:: db
|
|
|
|
\1Action:: db
|
|
|
|
\1ObjectStepFrame:: db
|
|
|
|
\1Facing:: db
|
|
|
|
\1StandingTile:: db ; collision
|
|
|
|
\1LastTile:: db ; collision
|
|
|
|
\1StandingMapX:: db
|
|
|
|
\1StandingMapY:: db
|
|
|
|
\1LastMapX:: db
|
|
|
|
\1LastMapY:: db
|
|
|
|
\1ObjectInitX:: db
|
|
|
|
\1ObjectInitY:: db
|
|
|
|
\1Radius:: db
|
|
|
|
\1SpriteX:: db
|
|
|
|
\1SpriteY:: db
|
|
|
|
\1SpriteXOffset:: db
|
|
|
|
\1SpriteYOffset:: db
|
|
|
|
\1MovementByteIndex:: db
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Field1c:: ds 1
|
|
|
|
\1Field1d:: ds 1
|
|
|
|
\1Field1e:: ds 1
|
|
|
|
\1Field1f:: ds 1
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Range:: db
|
2016-05-01 01:20:12 +00:00
|
|
|
ds 7
|
|
|
|
\1StructEnd::
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
map_object: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1ObjectStructID:: db
|
|
|
|
\1ObjectSprite:: db
|
|
|
|
\1ObjectYCoord:: db
|
|
|
|
\1ObjectXCoord:: db
|
|
|
|
\1ObjectMovement:: db
|
|
|
|
\1ObjectRadius:: db
|
|
|
|
\1ObjectHour:: db
|
|
|
|
\1ObjectTimeOfDay:: db
|
|
|
|
\1ObjectColor:: db
|
|
|
|
\1ObjectRange:: db
|
|
|
|
\1ObjectScript:: dw
|
|
|
|
\1ObjectEventFlag:: dw
|
2016-05-01 01:20:12 +00:00
|
|
|
ds 2
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-05-01 01:20:12 +00:00
|
|
|
|
2018-01-10 18:47:57 +00:00
|
|
|
sprite_oam_struct: MACRO
|
|
|
|
\1YCoord:: db
|
|
|
|
\1XCoord:: db
|
|
|
|
\1TileID:: db
|
|
|
|
\1Attributes:: db
|
|
|
|
; bit 7: priority
|
|
|
|
; bit 6: y flip
|
|
|
|
; bit 5: x flip
|
|
|
|
; bit 4: pal # (non-cgb)
|
|
|
|
; bit 3: vram bank (cgb only)
|
|
|
|
; bit 2-0: pal # (cgb only)
|
|
|
|
ENDM
|
|
|
|
|
2016-05-01 01:20:12 +00:00
|
|
|
sprite_anim_struct: MACRO
|
2017-12-14 05:36:24 +00:00
|
|
|
\1Index:: db
|
|
|
|
\1FramesetID:: db
|
|
|
|
\1AnimSeqID:: db
|
|
|
|
\1TileID:: db
|
|
|
|
\1XCoord:: db
|
|
|
|
\1YCoord:: db
|
|
|
|
\1XOffset:: db
|
|
|
|
\1YOffset:: db
|
|
|
|
\1Duration:: db
|
|
|
|
\1DurationOffset:: db
|
|
|
|
\1FrameIndex:: db
|
2017-12-29 15:19:51 +00:00
|
|
|
\1JumptableIndex:: db
|
|
|
|
\1Field0c:: ds 1
|
|
|
|
\1Field0d:: ds 1
|
|
|
|
\1Field0e:: ds 1
|
|
|
|
\1Field0f:: ds 1
|
2016-05-01 01:20:12 +00:00
|
|
|
ENDM
|
|
|
|
|
|
|
|
battle_anim_struct: MACRO
|
|
|
|
; Placeholder until we can figure out what it all means
|
2017-12-29 15:19:51 +00:00
|
|
|
\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
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|
2016-05-01 01:20:12 +00:00
|
|
|
|
|
|
|
battle_bg_effect: MACRO
|
2017-12-29 15:19:51 +00:00
|
|
|
\1Function:: db
|
|
|
|
\1Field01:: ds 1
|
|
|
|
\1Field02:: ds 1
|
|
|
|
\1Field03:: ds 1
|
2017-12-28 21:31:16 +00:00
|
|
|
ENDM
|