Reorganize macros

This commit is contained in:
Remy Oukaour
2017-12-14 00:36:24 -05:00
parent 8745915dbd
commit e48a401290
48 changed files with 1637 additions and 2030 deletions

View File

@@ -1,3 +1,5 @@
; Used in data/base_stats/*.asm
define: macro
if !def(\1)
\1 equs \2

55
macros/code.asm Normal file
View File

@@ -0,0 +1,55 @@
; Syntactic sugar macros
lb: MACRO ; r, hi, lo
ld \1, (\2 & $ff) << 8 + (\3 & $ff)
ENDM
ln: MACRO ; r, hi, lo
ld \1, (\2 & $f) << 4 + (\3 & $f)
ENDM
ldpixel: MACRO
if _NARG >= 5
lb \1, \2 * 8 + \4, \3 * 8 + \5
else
lb \1, \2 * 8, \3 * 8
endc
endm
depixel EQUS "ldpixel de,"
bcpixel EQUS "ldpixel bc,"
; Design patterns
jumptable: MACRO
ld a, [\2]
ld e, a
ld d, 0
ld hl, \1
add hl, de
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
jp hl
endm
; Many mobile functions were dummied out in localization.
mobile EQUS "ret"
maskbits: macro
; example usage in rejection sampling:
; .loop
; call Random
; maskbits 30
; cp 30
; jr nc, .loop
x = 1
rept 8
IF \1 > x
x = (x + 1) * 2 +- 1
ENDC
endr
and x
endm

15
macros/color.asm Normal file
View File

@@ -0,0 +1,15 @@
RGB: MACRO
rept _NARG / 3
dw ((\3) << 10) + ((\2) << 5) + (\1)
shift
shift
shift
endr
ENDM
palettes EQUS "* 8"
palette EQUS "+ 8 *"
palred EQUS "$0001 *"
palgreen EQUS "$0020 *"
palblue EQUS "$0400 *"

51
macros/coords.asm Normal file
View File

@@ -0,0 +1,51 @@
bccoord equs "coord bc,"
decoord equs "coord de,"
hlcoord equs "coord hl,"
coord: MACRO
; register, x, y[, origin]
if _NARG < 4
ld \1, TileMap + SCREEN_WIDTH * (\3) + (\2)
else
ld \1, \4 + SCREEN_WIDTH * (\3) + (\2)
endc
ENDM
dwcoord: MACRO
rept _NARG / 2
dw TileMap + SCREEN_WIDTH * (\2) + (\1)
shift
shift
endr
ENDM
ldcoord_a: MACRO
if _NARG < 3
ld [TileMap + SCREEN_WIDTH * (\2) + (\1)], a
else
ld [\3 + SCREEN_WIDTH * (\2) + (\1)], a
endc
ENDM
lda_coord: MACRO
if _NARG < 3
ld a, [TileMap + SCREEN_WIDTH * (\2) + (\1)]
else
ld a, [\3 + SCREEN_WIDTH * (\2) + (\1)]
endc
ENDM
bgrows EQUS "* $20" ; SCREEN_WIDTH
hlbgcoord EQUS "bgcoord hl,"
debgcoord EQUS "bgcoord de,"
bcbgcoord EQUS "bgcoord bc,"
bgcoord: MACRO
IF _NARG >= 4
ld \1, \3 bgrows + \2 + \4
ELSE
ld \1, \3 bgrows + \2 + VBGMap0
ENDC
ENDM

121
macros/data.asm Normal file
View File

@@ -0,0 +1,121 @@
; Constant data (db, dw, dl) macros
dwb: MACRO
dw \1
db \2
ENDM
dbw: MACRO
db \1
dw \2
ENDM
dbbw: MACRO
db \1, \2
dw \3
ENDM
dbww: MACRO
db \1
dw \2, \3
ENDM
dbwww: MACRO
db \1
dw \2, \3, \4
ENDM
dn: MACRO ; nybbles
rept _NARG / 2
db ((\1) << 4) | (\2)
shift
shift
endr
ENDM
dc: MACRO ; "crumbs"
rept _NARG / 4
db ((\1) << 6) | ((\2) << 4) | ((\3) << 2) | (\4)
shift
shift
shift
shift
endr
ENDM
dx: MACRO
x = 8 * ((\1) - 1)
rept \1
db ((\2) >> x) & $ff
x = x + -8
endr
ENDM
dt: MACRO ; three-byte (big-endian)
dx 3, \1
ENDM
dd: MACRO ; four-byte (big-endian)
dx 4, \1
ENDM
bigdw: MACRO ; big-endian word
dx 2, \1
ENDM
dba: MACRO ; dbw bank, address
rept _NARG
dbw BANK(\1), \1
shift
endr
ENDM
dab: MACRO ; dwb address, bank
rept _NARG
dwb \1, BANK(\1)
shift
endr
ENDM
dba_pic: MACRO ; dbw bank, address
db BANK(\1) - PICS_FIX
dw \1
ENDM
dbpixel: MACRO
if _NARG >= 4
db \1 * 8 + \3, \2 * 8 + \4
else
db \1 * 8, \2 * 8
endc
endm
dsprite: MACRO
; conditional segment is there because not every instance of
; this macro is directly OAM
if _NARG >= 7 ; y tile, y pxl, x tile, x pxl, vtile offset, flags, palette
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, (\6 << 3) + (\7 & 7)
else
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
endc
endm
sine_wave: MACRO
; \1: amplitude
x = 0
rept $20
; Round up.
dw (sin(x) + (sin(x) & $ff)) >> 8
x = x + (\1) * $40000
endr
ENDM
bcd: MACRO
rept _NARG
dn ((\1) % 100) / 10, (\1) % 10
shift
endr
ENDM

View File

@@ -1,211 +0,0 @@
map: macro
;\1: map id
db GROUP_\1, MAP_\1
endm
maptrigger: macro
;\1: script pointer
dw \1, 0
endm
warp_def: macro
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: warp destination: starts at 1
;\4: map id: from constants/map_constants.asm
db \1, \2, \3
map \4
endm
xy_trigger: macro
;\1: number: controlled by dotrigger/domaptrigger
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
;\4: script pointer
db \1, \2, \3, $0
dw \4
db $0, $0
endm
signpost: macro
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: function: a SIGNPOST_* constant
;\4: script pointer
db \1, \2, \3
dw \4
endm
person_event: macro
;\1: sprite: a SPRITE_* constant
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
;\4: movement function: a SPRITEMOVEDATA_* constant
;\5, \6: movement radius: y, x
;\7: clock hour: ???
;\8: clock daytime: sum of MORN, DAY, and/or NITE, or 0 for always
;\9: color: a PAL_NPC_* constant, or 0 for sprite default
;\10: function: a PERSONTYPE_* constant
;\11: sight range: applies to PERSONTYPE_TRAINER
;\12: script pointer
;\13: event flag: an EVENT_* constant, or 0 for always
db \1, \2 + 4, \3 + 4, \4
dn \5, \6
db \7, \8
shift
dn \8, \9
shift
db \9
shift
dw \9
shift
dw \9
endm
newgroup: macro
const_value = const_value + 1
enum_start 1
endm
mapgroup: macro
;\1: map id
;\2: height: in blocks
;\3: width: in blocks
GROUP_\1 EQU const_value
enum MAP_\1
\1_HEIGHT EQU \2
\1_WIDTH EQU \3
endm
map_header: macro
;\1: map label
;\2: tileset: a TILESET_* constant
;\3: permission: TOWN, ROUTE, INDOOR, CAVE, PERM_5, GATE, or DUNGEON
;\4: location: from constants/landmark_constants.asm
;\5: music: a MUSIC_* constant
;\6: phone service flag: 1 to prevent phone calls
;\7: time of day: a PALETTE_* constant
;\8: fishing group: a FISHGROUP_* constant
\1_MapHeader:
db BANK(\1_SecondMapHeader), \2, \3
dw \1_SecondMapHeader
db \4, \5
dn \6, \7
db \8
endm
map_header_2: macro
;\1: map label
;\2: map id
;\3: border block
;\4: connections: sum of NORTH, SOUTH, WEST, and/or EAST, or 0 for none
\1_SecondMapHeader::
db \3
db \2_HEIGHT, \2_WIDTH
db BANK(\1_BlockData)
dw \1_BlockData
db BANK(\1_MapScriptHeader)
dw \1_MapScriptHeader
dw \1_MapEventHeader
db \4
endm
connection: macro
if "\1" == "north"
;\2: map id
;\3: map label (eventually will be rolled into map id)
;\4: x
;\5: offset?
;\6: strip length
;\7: this map id
map \2
dw \3_BlockData + \2_WIDTH * (\2_HEIGHT - 3) + \5
dw OverworldMap + \4 + 3
db \6
db \2_WIDTH
db \2_HEIGHT * 2 - 1
db (\4 - \5) * -2
dw OverworldMap + \2_HEIGHT * (\2_WIDTH + 6) + 1
endc
if "\1" == "south"
;\2: map id
;\3: map label (eventually will be rolled into map id)
;\4: x
;\5: offset?
;\6: strip length
;\7: this map id
map \2
dw \3_BlockData + \5
dw OverworldMap + (\7_HEIGHT + 3) * (\7_WIDTH + 6) + \4 + 3
db \6
db \2_WIDTH
db 0
db (\4 - \5) * -2
dw OverworldMap + \2_WIDTH + 7
endc
if "\1" == "west"
;\2: map id
;\3: map label (eventually will be rolled into map id)
;\4: y
;\5: offset?
;\6: strip length
;\7: this map id
map \2
dw \3_BlockData + (\2_WIDTH * \5) + \2_WIDTH - 3
dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3)
db \6
db \2_WIDTH
db (\4 - \5) * -2
db \2_WIDTH * 2 - 1
dw OverworldMap + \2_WIDTH * 2 + 6
endc
if "\1" == "east"
;\2: map id
;\3: map label (eventually will be rolled into map id)
;\4: y
;\5: offset?
;\6: strip length
;\7: this map id
map \2
dw \3_BlockData + (\2_WIDTH * \5)
dw OverworldMap + (\7_WIDTH + 6) * (\4 + 3 + 1) - 3
db \6
db \2_WIDTH
db (\4 - \5) * -2
db 0
dw OverworldMap + \2_WIDTH + 7
endc
endm
itemball: macro
;\1: item: from constants/item_constants.asm
;\2: quantity: default 1
if _NARG == 2
db \1, \2
else
db \1, 1
endc
endm
elevfloor: macro
;\1: floor: a FLOOR_* constant
;\2: warp destination: starts at 1
;\3: map id
db \1, \2
map \3
ENDM
stonetable: macro
;\1: warp id
;\2: person_event id
;\3: script pointer
db \1, \2
dw \3
endm

View File

@@ -1,2 +0,0 @@
; Many mobile functions were dummied out in localization.
mobile EQUS "ret"

View File

@@ -1,4 +0,0 @@
add_pic: MACRO
db BANK(\1) - PICS_FIX
dw \1
ENDM

View File

@@ -15,3 +15,15 @@ callab: MACRO ; address, bank
ld a, BANK(\1)
rst FarCall
ENDM
homecall: MACRO
ld a, [hROMBank]
push af
ld a, BANK(\1)
rst Bankswitch
call \1
pop af
rst Bankswitch
ENDM

View File

@@ -0,0 +1,46 @@
; pic+sprite animations
frame: macro
db \1
x = \2
if _NARG > 2
rept _NARG +- 2
x = x | (1 << (\3 + 1))
shift
endr
endc
db x
endm
enum_start $fc
; used for sprites
enum delanim_command ; fc
delanim: macro
db delanim_command
endm
enum dorepeat_command ; fd
dorepeat: macro
db dorepeat_command
db \1 ; #
endm
enum setrepeat_command ; fe
setrepeat: macro
db setrepeat_command
db \1 ; #
endm
enum endanim_command ; ff
endanim: macro
db endanim_command
endm
__enum__ = $fe
; used for sprites
enum dorestart_command ; fe
dorestart: macro
db dorestart_command
endm

104
macros/scripts/maps.asm Normal file
View File

@@ -0,0 +1,104 @@
map: macro
;\1: map id
db GROUP_\1, MAP_\1
endm
maptrigger: macro
;\1: script pointer
dw \1, 0
endm
warp_def: macro
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: warp destination: starts at 1
;\4: map id: from constants/map_constants.asm
db \1, \2, \3
map \4
endm
xy_trigger: macro
;\1: number: controlled by dotrigger/domaptrigger
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
;\4: script pointer
db \1, \2, \3, $0
dw \4
db $0, $0
endm
signpost: macro
;\1: y: top to bottom, starts at 0
;\2: x: left to right, starts at 0
;\3: function: a SIGNPOST_* constant
;\4: script pointer
db \1, \2, \3
dw \4
endm
person_event: macro
;\1: sprite: a SPRITE_* constant
;\2: y: top to bottom, starts at 0
;\3: x: left to right, starts at 0
;\4: movement function: a SPRITEMOVEDATA_* constant
;\5, \6: movement radius: y, x
;\7: clock hour: ???
;\8: clock daytime: sum of MORN, DAY, and/or NITE, or 0 for always
;\9: color: a PAL_NPC_* constant, or 0 for sprite default
;\10: function: a PERSONTYPE_* constant
;\11: sight range: applies to PERSONTYPE_TRAINER
;\12: script pointer
;\13: event flag: an EVENT_* constant, or 0 for always
db \1, \2 + 4, \3 + 4, \4
dn \5, \6
db \7, \8
shift
dn \8, \9
shift
db \9
shift
dw \9
shift
dw \9
endm
trainer: macro
;\1: flag: an EVENT_BEAT_* constant
;\2: trainer group
;\3: trainer id
;\4: seen text
;\5: win text
;\6: loss text
;\7: after-battle text
dw \1
db \2, \3
dw \4, \5, \6, \7
endm
itemball: macro
;\1: item: from constants/item_constants.asm
;\2: quantity: default 1
if _NARG == 2
db \1, \2
else
db \1, 1
endc
endm
elevfloor: macro
;\1: floor: a FLOOR_* constant
;\2: warp destination: starts at 1
;\3: map id
db \1, \2
map \3
ENDM
stonetable: macro
;\1: warp id
;\2: person_event id
;\3: script pointer
db \1, \2
dw \3
endm

View File

View File

@@ -1,3 +1,5 @@
; Used in tilesets/*.asm
tilepal: MACRO
; vram bank, pals
x = \1 << OAM_TILE_BANK

View File

@@ -1,11 +0,0 @@
trainerclass: MACRO
enum \1
const_value = 1
ENDM
trainer: MACRO
; flag, group, id, seen text, win text, lost text, talk-again text
dw \1
db \2, \3
dw \4, \5, \6, \7
ENDM

View File

@@ -1,3 +1,4 @@
; Used in wram.asm
flag_array: MACRO
ds ((\1) + 7) / 8
@@ -15,7 +16,7 @@ box_struct: MACRO
\1DefExp:: dw
\1SpdExp:: dw
\1SpcExp:: dw
\1DVs:: ds 2
\1DVs:: dw
\1PP:: ds NUM_MOVES
\1Happiness:: db
\1PokerusStatus:: db
@@ -60,7 +61,7 @@ red_box_struct: MACRO
\1DefenseExp:: dw
\1SpeedExp:: dw
\1SpecialExp:: dw
\1DVs:: ds 2
\1DVs:: dw
\1PP:: ds NUM_MOVES
ENDM
@@ -81,7 +82,7 @@ battle_struct: MACRO
\1Item:: db
\1Moves:: ds NUM_MOVES
\1MovesEnd::
\1DVs:: ds 2
\1DVs:: dw
\1PP:: ds NUM_MOVES
\1Happiness:: db
\1Level:: db
@@ -103,7 +104,7 @@ ENDM
box: MACRO
\1::
\1Count:: ds 1
\1Count:: db
\1Species:: ds MONS_PER_BOX + 1
\1Mons::
\1Mon1:: box_struct \1Mon1
@@ -134,14 +135,14 @@ channel_struct: MACRO
\1FrequencyHi:: db
\1Pitch:: db ; 0:rest 1-c:note
\1Octave:: db ; 7-0 (0 is highest)
\1PitchOffset:: db ; raises existing octaves (to repeat phrases)
\1PitchOffset:: db ; raises existing octaves (to repeat phrases)
\1NoteDuration:: db ; frames remaining for the current note
\1Field0x16:: ds 1 ; c117
ds 1 ; c118
\1LoopCount:: db
\1Tempo:: dw
\1Tracks:: db ; hi:left lo:right
\1SFXDutyLoop:: ds 1 ; c11d
\1SFXDutyLoop:: db ; c11d
\1VibratoDelayCount:: db ; initialized by \1VibratoDelay
\1VibratoDelay:: db ; number of frames a note plays until vibrato starts
\1VibratoExtent:: db
@@ -149,7 +150,7 @@ channel_struct: MACRO
\1PitchWheelTarget:: dw ; frequency endpoint for pitch wheel
\1PitchWheelAmount:: db ; c124
\1PitchWheelAmountFraction:: db ; c125
\1Field0x25:: ds 1 ; c126
\1Field0x25:: db ; c126
ds 1 ; c127
\1CryPitch:: dw
\1Field0x29:: ds 1
@@ -179,22 +180,13 @@ battle_tower_struct: MACRO
endm
mailmsg: MACRO
\1Message:: ds MAIL_MSG_LENGTH
\1Message:: ds MAIL_MSG_LENGTH
\1MessageEnd:: ds 1
\1Author:: ds PLAYER_NAME_LENGTH
\1Author:: ds PLAYER_NAME_LENGTH
\1AuthorNationality:: ds 2
\1AuthorID:: ds 2
\1Species:: ds 1
\1Type:: ds 1
\1End::
endm
hof_mon: MACRO
\1Species:: ds 1
\1ID:: ds 2
\1DVs:: ds 2
\1Level:: ds 1
\1Nickname:: ds PKMN_NAME_LENGTH +- 1
\1AuthorID:: dw
\1Species:: db
\1Type:: db
\1End::
endm
@@ -203,19 +195,28 @@ roam_struct: MACRO
\1Level:: db
\1MapGroup:: db
\1MapNumber:: db
\1HP:: ds 1
\1DVs:: ds 2
\1HP:: db
\1DVs:: dw
ENDM
bugcontestwinner: macro
\1PersonID:: ds 1
\1Mon:: ds 1
\1Score:: ds 2
\1PersonID:: db
\1Mon:: db
\1Score:: dw
endm
hof_mon: MACRO
\1Species:: db
\1ID:: dw
\1DVs:: dw
\1Level:: db
\1Nickname:: ds PKMN_NAME_LENGTH +- 1
\1End::
endm
hall_of_fame: MACRO
\1::
\1WinCount:: ds 1
\1WinCount:: db
\1Mon1:: hof_mon \1Mon1
\1Mon2:: hof_mon \1Mon2
\1Mon3:: hof_mon \1Mon3
@@ -225,26 +226,34 @@ hall_of_fame: MACRO
\1End:: ds 1
ENDM
link_battle_record: MACRO
\1Name:: ds NAME_LENGTH +- 1
\1ID:: dw
\1Wins:: dw
\1Losses:: dw
\1Draws:: dw
ENDM
trademon: MACRO
\1Species:: ds 1 ; wc6d0 | wc702
\1Species:: db ; wc6d0 | wc702
\1SpeciesName:: ds PKMN_NAME_LENGTH ; wc6d1 | wc703
\1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
\1DVs:: ds 2 ; wc6fd | wc72f
\1ID:: ds 2 ; wc6ff | wc731
\1CaughtData:: ds 1 ; wc701 | wc733
\1Nickname:: ds PKMN_NAME_LENGTH ; wc6dc | wc70e
\1SenderName:: ds NAME_LENGTH ; wc6e7 | wc719
\1OTName:: ds NAME_LENGTH ; wc6f2 | wc724
\1DVs:: dw ; wc6fd | wc72f
\1ID:: dw ; wc6ff | wc731
\1CaughtData:: db ; wc701 | wc733
\1End::
ENDM
move_struct: MACRO
\1Animation:: ds 1
\1Effect:: ds 1
\1Power:: ds 1
\1Type:: ds 1
\1Accuracy:: ds 1
\1PP:: ds 1
\1EffectChance:: ds 1
\1Animation:: db
\1Effect:: db
\1Power:: db
\1Type:: db
\1Accuracy:: db
\1PP:: db
\1EffectChance:: db
endm
slot_reel: MACRO
@@ -266,109 +275,109 @@ endm
object_struct: MACRO
\1Struct::
\1Sprite:: ds 1
\1MapObjectIndex:: ds 1
\1SpriteTile:: ds 1
\1MovementType:: ds 1
\1Flags:: ds 2
\1Palette:: ds 1
\1Walking:: ds 1
\1Direction:: ds 1
\1StepType:: ds 1
\1StepDuration:: ds 1
\1Action:: ds 1
\1ObjectStepFrame:: ds 1
\1Facing:: ds 1
\1StandingTile:: ds 1 ; collision
\1LastTile:: ds 1 ; collision
\1StandingMapX:: ds 1
\1StandingMapY:: ds 1
\1LastMapX:: ds 1
\1LastMapY:: ds 1
\1ObjectInitX:: ds 1
\1ObjectInitY:: ds 1
\1Radius:: ds 1
\1SpriteX:: ds 1
\1SpriteY:: ds 1
\1SpriteXOffset:: ds 1
\1SpriteYOffset:: ds 1
\1MovementByteIndex:: ds 1
\1Object28:: ds 1
\1Object29:: ds 1
\1Object30:: ds 1
\1Object31:: ds 1
\1Range:: ds 1
\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
\1Object28:: ds 1
\1Object29:: ds 1
\1Object30:: ds 1
\1Object31:: ds 1
\1Range:: db
ds 7
\1StructEnd::
ENDM
map_object: MACRO
\1Object::
\1ObjectStructID:: ds 1
\1ObjectSprite:: ds 1
\1ObjectYCoord:: ds 1
\1ObjectXCoord:: ds 1
\1ObjectMovement:: ds 1
\1ObjectRadius:: ds 1
\1ObjectHour:: ds 1
\1ObjectTimeOfDay:: ds 1
\1ObjectColor:: ds 1
\1ObjectRange:: ds 1
\1ObjectScript:: ds 2
\1ObjectEventFlag:: ds 2
\1ObjectStructID:: db
\1ObjectSprite:: db
\1ObjectYCoord:: db
\1ObjectXCoord:: db
\1ObjectMovement:: db
\1ObjectRadius:: db
\1ObjectHour:: db
\1ObjectTimeOfDay:: db
\1ObjectColor:: db
\1ObjectRange:: db
\1ObjectScript:: dw
\1ObjectEventFlag:: dw
ds 2
endm
sprite_anim_struct: MACRO
\1Index:: ds 1 ; 0
\1FramesetID:: ds 1 ; 1
\1AnimSeqID:: ds 1 ; 2
\1TileID:: ds 1 ; 3
\1XCoord:: ds 1 ; 4
\1YCoord:: ds 1 ; 5
\1XOffset:: ds 1 ; 6
\1YOffset:: ds 1 ; 7
\1Duration:: ds 1 ; 8
\1DurationOffset:: ds 1 ; 9
\1FrameIndex:: ds 1 ; a
\1Sprite0b:: ds 1
\1Sprite0c:: ds 1
\1Sprite0d:: ds 1
\1Sprite0e:: ds 1
\1Sprite0f:: ds 1
\1Index:: db
\1FramesetID:: db
\1AnimSeqID:: db
\1TileID:: db
\1XCoord:: db
\1YCoord:: db
\1XOffset:: db
\1YOffset:: db
\1Duration:: db
\1DurationOffset:: db
\1FrameIndex:: db
\1Sprite0b:: ds 1
\1Sprite0c:: ds 1
\1Sprite0d:: ds 1
\1Sprite0e:: ds 1
\1Sprite0f:: ds 1
ENDM
battle_anim_struct: MACRO
; Placeholder until we can figure out what it all means
\1_Index:: ds 1
\1_Anim01:: ds 1
\1_Anim02:: ds 1
\1_FramesetIndex:: ds 1
\1_FunctionIndex:: ds 1
\1_Anim05:: ds 1
\1_TileID:: ds 1
\1_XCoord:: ds 1
\1_YCoord:: ds 1
\1_XOffset:: ds 1
\1_YOffset:: ds 1
\1_Anim0b:: ds 1
\1_Anim0c:: ds 1
\1_Anim0d:: ds 1
\1_AnonJumptableIndex:: ds 1
\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
\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
endm
battle_bg_effect: MACRO
\1_Function:: ds 1
\1_01:: ds 1
\1_02:: ds 1
\1_03:: ds 1
\1_Function:: db
\1_01:: ds 1
\1_02:: ds 1
\1_03:: ds 1
endm