diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/event.asm | 6 | ||||
-rw-r--r-- | macros/map.asm | 177 | ||||
-rw-r--r-- | macros/move_effect.asm | 186 | ||||
-rwxr-xr-x | macros/pals.asm | 2 |
4 files changed, 105 insertions, 266 deletions
diff --git a/macros/event.asm b/macros/event.asm index c575b7caf..a439b8fbf 100644 --- a/macros/event.asm +++ b/macros/event.asm @@ -287,9 +287,9 @@ checktime: macro db \1 ; time endm -checkmorn EQUS "checktime 1 << MORN" -checkday EQUS "checktime 1 << DAY" -checknite EQUS "checktime 1 << NITE" +checkmorn EQUS "checktime MORN" +checkday EQUS "checktime DAY" +checknite EQUS "checktime NITE" enum checkpoke_command checkpoke: macro diff --git a/macros/map.asm b/macros/map.asm index 2e8765770..eb78be725 100644 --- a/macros/map.asm +++ b/macros/map.asm @@ -1,77 +1,110 @@ -map: MACRO +map: macro +;\1: map id db GROUP_\1, MAP_\1 -ENDM +endm -roam_map: MACRO -; A map and an arbitrary number of some more maps. +maptrigger: macro +;\1: script pointer + dw \1, 0 +endm - map \1 - db \2 +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 - rept \2 - map \3 - shift - endr +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: unknown1: $0 +;\5: script pointer +;\6: unknown2: $0 +;\7: unknown3: $0 + db \1, \2, \3, \4 + dw \5 + db \6, \7 +endm - db 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 - db \1 ; sprite - db \2 + 4 ; y - db \3 + 4 ; x - db \4 ; movement function - dn \5, \6 ; radius: y, x - db \7 ; clock_hour - db \8 ; clock_daytime +;\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 ; color_function + dn \8, \9 shift - db \9 ; sight_range + db \9 shift - dw \9 ; pointer + dw \9 shift - dw \9 ; event flag - endm + dw \9 +endm -signpost: macro - db \1 ; y - db \2 ; x - db \3 ; function - dw \4 ; pointer - endm -xy_trigger: macro - db \1 ; number - db \2 ; y - db \3 ; x - db \4 ; unknown1 - dw \5 ; script - db \6 ; unknown2 - db \7 ; unknown3 - endm +newgroup: macro +const_value = const_value + 1 + enum_start 1 +endm -warp_def: macro - db \1 ; y - db \2 ; x - db \3 ; warp_to - map \4 ; map - 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 - ; label, tileset, permission, location, music, phone service flag, time of day, fishing group +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 +endm -map_header_2: MACRO -; label, map, border block, connections +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 @@ -81,9 +114,9 @@ map_header_2: MACRO dw \1_MapScriptHeader dw \1_MapEventHeader db \4 -ENDM +endm -connection: MACRO +connection: macro if "\1" == "north" ;\2: map id ;\3: map label (eventually will be rolled into map id) @@ -151,27 +184,12 @@ if "\1" == "east" db 0 dw OverworldMap + \2_WIDTH + 7 endc +endm -ENDM - -mapgroup: MACRO -GROUP_\1 EQU const_value - enum MAP_\1 -\1_HEIGHT EQU \2 -\1_WIDTH EQU \3 -ENDM - -newgroup: MACRO -const_value = const_value + 1 - enum_start 1 -ENDM - -elevfloor: MACRO - db \1, \2 - map \3 -ENDM -itemball: MACRO +itemball: macro +;\1: item: from constants/item_constants.asm +;\2: quantity: default 1 if _NARG == 2 db \1, \2 else @@ -179,11 +197,18 @@ else endc endm -stonetable: MACRO +elevfloor: macro +;\1: floor: a FLOOR_* constant +;\2: warp destination: starts at 1 +;\3: map id db \1, \2 - dw \3 -endm + map \3 +ENDM -maptrigger: MACRO - dw \1, 0 +stonetable: macro +;\1: warp id +;\2: person_event id +;\3: script pointer + db \1, \2 + dw \3 endm diff --git a/macros/move_effect.asm b/macros/move_effect.asm deleted file mode 100644 index d3761c9a1..000000000 --- a/macros/move_effect.asm +++ /dev/null @@ -1,186 +0,0 @@ -command: macro - enum \1_command -\1 equs "db \1_command" -endm - - enum_start 1 - - command checkturn ; 01 - command checkobedience ; 02 - command usedmovetext ; 03 - command doturn ; 04 - command critical ; 05 - command damagestats ; 06 - command stab ; 07 - command damagevariation ; 08 - command checkhit ; 09 - command lowersub ; 0a - command hittargetnosub ; 0b - command raisesub ; 0c - command failuretext ; 0d - command checkfaint ; 0e - command criticaltext ; 0f - command supereffectivetext ; 10 - command checkdestinybond ; 11 - command buildopponentrage ; 12 - command poisontarget ; 13 - command sleeptarget ; 14 - command draintarget ; 15 - command eatdream ; 16 - command burntarget ; 17 - command freezetarget ; 18 - command paralyzetarget ; 19 - command selfdestruct ; 1a - command mirrormove ; 1b - command statup ; 1c - command statdown ; 1d - command payday ; 1e - command conversion ; 1f - command resetstats ; 20 - command storeenergy ; 21 - command unleashenergy ; 22 - command forceswitch ; 23 - command endloop ; 24 - command flinchtarget ; 25 - command ohko ; 26 - command recoil ; 27 - command mist ; 28 - command focusenergy ; 29 - command confuse ; 2a - command confusetarget ; 2b - command heal ; 2c - command transform ; 2d - command screen ; 2e - command poison ; 2f - command paralyze ; 30 - command substitute ; 31 - command rechargenextturn ; 32 - command mimic ; 33 - command metronome ; 34 - command leechseed ; 35 - command splash ; 36 - command disable ; 37 - command cleartext ; 38 - command charge ; 39 - command checkcharge ; 3a - command traptarget ; 3b - command effect0x3c ; 3c - command rampage ; 3d - command checkrampage ; 3e - command constantdamage ; 3f - command counter ; 40 - command encore ; 41 - command painsplit ; 42 - command snore ; 43 - command conversion2 ; 44 - command lockon ; 45 - command sketch ; 46 - command defrostopponent ; 47 - command sleeptalk ; 48 - command destinybond ; 49 - command spite ; 4a - command falseswipe ; 4b - command healbell ; 4c - command kingsrock ; 4d - command triplekick ; 4e - command kickcounter ; 4f - command thief ; 50 - command arenatrap ; 51 - command nightmare ; 52 - command defrost ; 53 - command curse ; 54 - command protect ; 55 - command spikes ; 56 - command foresight ; 57 - command perishsong ; 58 - command startsandstorm ; 59 - command endure ; 5a - command checkcurl ; 5b - command rolloutpower ; 5c - command effect0x5d ; 5d - command furycutter ; 5e - command attract ; 5f - command happinesspower ; 60 - command present ; 61 - command damagecalc ; 62 - command frustrationpower ; 63 - command safeguard ; 64 - command checksafeguard ; 65 - command getmagnitude ; 66 - command batonpass ; 67 - command pursuit ; 68 - command clearhazards ; 69 - command healmorn ; 6a - command healday ; 6b - command healnite ; 6c - command hiddenpower ; 6d - command startrain ; 6e - command startsun ; 6f - command attackup ; 70 - command defenseup ; 71 - command speedup ; 72 - command specialattackup ; 73 - command specialdefenseup ; 74 - command accuracyup ; 75 - command evasionup ; 76 - command attackup2 ; 77 - command defenseup2 ; 78 - command speedup2 ; 79 - command specialattackup2 ; 7a - command specialdefenseup2 ; 7b - command accuracyup2 ; 7c - command evasionup2 ; 7d - command attackdown ; 7e - command defensedown ; 7f - command speeddown ; 80 - command specialattackdown ; 81 - command specialdefensedown ; 82 - command accuracydown ; 83 - command evasiondown ; 84 - command attackdown2 ; 85 - command defensedown2 ; 86 - command speeddown2 ; 87 - command specialattackdown2 ; 88 - command specialdefensedown2 ; 89 - command accuracydown2 ; 8a - command evasiondown2 ; 8b - command statupmessage ; 8c - command statdownmessage ; 8d - command statupfailtext ; 8e - command statdownfailtext ; 8f - command effectchance ; 90 - command statdownanim ; 91 - command statupanim ; 92 - command switchturn ; 93 - command fakeout ; 94 - command bellydrum ; 95 - command psychup ; 96 - command rage ; 97 - command doubleflyingdamage ; 98 - command doubleundergrounddamage ; 99 - command mirrorcoat ; 9a - command checkfuturesight ; 9b - command futuresight ; 9c - command doubleminimizedamage ; 9d - command skipsuncharge ; 9e - command thunderaccuracy ; 9f - command teleport ; a0 - command beatup ; a1 - command ragedamage ; a2 - command resettypematchup ; a3 - command allstatsup ; a4 - command effect0xa5 ; a5 - command raisesubnoanim ; a6 - command lowersubnoanim ; a7 - command effect0xa8 ; a8 - command clearmissdamage ; a9 - command movedelay ; aa - command hittarget ; ab - command tristatuschance ; ac - command supereffectivelooptext ; ad - command startloop ; ae - command curl ; af - - enum_start -1, -1 - command endmove - command endturn diff --git a/macros/pals.asm b/macros/pals.asm index 44f1f7944..72bb4c96d 100755 --- a/macros/pals.asm +++ b/macros/pals.asm @@ -1,6 +1,6 @@ tilepal: MACRO ; vram bank, pals -x = \1 << 3 +x = \1 << OAM_TILE_BANK rept (_NARG +- 1) / 2 dn (x | PAL_BG_\3), (x | PAL_BG_\2) shift |