diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/code.asm | 10 | ||||
-rw-r--r-- | macros/rst.asm | 12 | ||||
-rw-r--r-- | macros/scripts/audio.asm | 4 | ||||
-rw-r--r-- | macros/scripts/event.asm | 74 | ||||
-rw-r--r-- | macros/scripts/maps.asm | 28 | ||||
-rw-r--r-- | macros/scripts/movement.asm | 18 | ||||
-rwxr-xr-x | macros/wram.asm | 2 |
7 files changed, 76 insertions, 72 deletions
diff --git a/macros/code.asm b/macros/code.asm index 5e247e9a3..93b35bd94 100644 --- a/macros/code.asm +++ b/macros/code.asm @@ -14,7 +14,7 @@ if _NARG >= 5 else lb \1, \2 * 8, \3 * 8 endc -endm + ENDM depixel EQUS "ldpixel de," bcpixel EQUS "ldpixel bc," @@ -33,7 +33,7 @@ jumptable: MACRO ld h, [hl] ld l, a jp hl -endm + ENDM ; Many mobile functions were dummied out in localization. mobile EQUS "ret" @@ -47,9 +47,9 @@ maskbits: macro ; jr nc, .loop x = 1 rept 8 -IF \1 > x +if \1 > x x = (x + 1) * 2 +- 1 -ENDC +endc endr and x -endm + ENDM diff --git a/macros/rst.asm b/macros/rst.asm index fe7e42723..cf4cc5314 100644 --- a/macros/rst.asm +++ b/macros/rst.asm @@ -8,22 +8,22 @@ farcall: MACRO ; bank, address rst FarCall ENDM -callba EQUS "farcall" - -callab: MACRO ; address, bank +callfar: MACRO ; address, bank ld hl, \1 ld a, BANK(\1) rst FarCall ENDM +; legacy support for pre-2018 pokecrystal +callba EQUS "farcall" +callab EQUS "callfar" + homecall: MACRO ld a, [hROMBank] push af ld a, BANK(\1) rst Bankswitch - call \1 - pop af rst Bankswitch -ENDM + ENDM diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 3766785ba..83ff44963 100644 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -72,7 +72,11 @@ soundinput: macro enum sound_duty_cmd ; $de sound_duty: macro db sound_duty_cmd + if _NARG == 4 db \1 | (\2 << 2) | (\3 << 4) | (\4 << 6) ; duty sequence + else + db \1 ; one-byte duty value for legacy support + endc endm enum togglesfx_cmd ; $df diff --git a/macros/scripts/event.asm b/macros/scripts/event.asm index c40d6f8fd..1bf6b8622 100644 --- a/macros/scripts/event.asm +++ b/macros/scripts/event.asm @@ -112,28 +112,28 @@ ptcallasm: macro dw \1 ; asm endm - enum checkmaptriggers_command ; $11 -checkmaptriggers: macro - db checkmaptriggers_command + enum checkmapscene_command ; $11 +checkmapscene: macro + db checkmapscene_command map \1 ; map endm - enum domaptrigger_command ; $12 -domaptrigger: macro - db domaptrigger_command + enum setmapscene_command ; $12 +setmapscene: macro + db setmapscene_command map \1 ; map - db \2 ; trigger_id + db \2 ; scene_id endm - enum checktriggers_command ; $13 -checktriggers: macro - db checktriggers_command + enum checkscene_command ; $13 +checkscene: macro + db checkscene_command endm - enum dotrigger_command ; $14 -dotrigger: macro - db dotrigger_command - db \1 ; trigger_id + enum setscene_command ; $14 +setscene: macro + db setscene_command + db \1 ; scene_id endm enum writebyte_command ; $15 @@ -665,13 +665,13 @@ check_just_battled: macro enum setlasttalked_command ; $68 setlasttalked: macro db setlasttalked_command - db \1 ; person + db \1 ; object id endm enum applymovement_command ; $69 applymovement: macro db applymovement_command - db \1 ; person + db \1 ; object id dw \2 ; data endm @@ -686,11 +686,11 @@ faceplayer: macro db faceplayer_command endm - enum faceperson_command ; $6c -faceperson: macro - db faceperson_command - db \1 ; person1 - db \2 ; person2 + enum faceobject_command ; $6c +faceobject: macro + db faceobject_command + db \1 ; object1 + db \2 ; object2 endm enum variablesprite_command ; $6d @@ -703,20 +703,20 @@ variablesprite: macro enum disappear_command ; $6e disappear: macro db disappear_command - db \1 ; person + db \1 ; object id endm enum appear_command ; $6f appear: macro db appear_command - db \1 ; person + db \1 ; object id endm enum follow_command ; $70 follow: macro db follow_command - db \1 ; person2 - db \2 ; person1 + db \1 ; object2 + db \2 ; object1 endm enum stopfollow_command ; $71 @@ -724,18 +724,18 @@ stopfollow: macro db stopfollow_command endm - enum moveperson_command ; $72 -moveperson: macro - db moveperson_command - db \1 ; person + enum moveobject_command ; $72 +moveobject: macro + db moveobject_command + db \1 ; object id db \2 ; x db \3 ; y endm - enum writepersonxy_command ; $73 -writepersonxy: macro - db writepersonxy_command - db \1 ; person + enum writeobjectxy_command ; $73 +writeobjectxy: macro + db writeobjectxy_command + db \1 ; object id endm enum loademote_command ; $74 @@ -748,22 +748,22 @@ loademote: macro showemote: macro db showemote_command db \1 ; bubble - db \2 ; person + db \2 ; object id db \3 ; time endm enum spriteface_command ; $76 spriteface: macro db spriteface_command - db \1 ; person + db \1 ; object id db \2 ; facing endm enum follownotexact_command ; $77 follownotexact: macro db follownotexact_command - db \1 ; person2 - db \2 ; person1 + db \1 ; object2 + db \2 ; object1 endm enum earthquake_command ; $78 diff --git a/macros/scripts/maps.asm b/macros/scripts/maps.asm index 6c1e0b6b6..3f83740ca 100644 --- a/macros/scripts/maps.asm +++ b/macros/scripts/maps.asm @@ -4,7 +4,7 @@ map: macro endm -maptrigger: macro +scene_script: macro ;\1: script pointer dw \1, 0 endm @@ -18,8 +18,8 @@ warp_def: macro map \4 endm -xy_trigger: macro -;\1: number: controlled by dotrigger/domaptrigger +coord_event: macro +;\1: number: controlled by setscene/setmapscene ;\2: y: top to bottom, starts at 0 ;\3: x: left to right, starts at 0 ;\4: script pointer @@ -28,32 +28,32 @@ xy_trigger: macro db $0, $0 endm -signpost: macro +bg_event: macro ;\1: y: top to bottom, starts at 0 ;\2: x: left to right, starts at 0 -;\3: function: a SIGNPOST_* constant +;\3: function: a BGEVENT_* constant ;\4: script pointer db \1, \2, \3 dw \4 endm -person_event: macro +object_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, \8: hour1 and hour2: control the hours a person_event is visible (0-23) -; * if hour1 < hour2, the person_event will only appear from hour1 to hour2 -; * if hour1 > hour2, the person_event will not appear from hour2 to hour1 -; * if hour1 == hour2, the person_event will always appear +;\7, \8: hour1 and hour2: control the hours an object_event is visible (0-23) +; * if hour1 < hour2, the object_event will only appear from hour1 to hour2 +; * if hour1 > hour2, the object_event will not appear from hour2 to hour1 +; * if hour1 == hour2, the object_event will always appear ; * if hour1 == -1, hour2 is treated as a time-of-day value: ; a combo of MORN, DAY, and/or NITE, or -1 to always appear ;\9: color: a PAL_NPC_* constant, or 0 for sprite default -;\10: function: a PERSONTYPE_* constant -;\11: sight range: applies to PERSONTYPE_TRAINER +;\10: function: a OBJECTTYPE_* constant +;\11: sight range: applies to OBJECTTYPE_TRAINER ;\12: script pointer -;\13: event flag: an EVENT_* constant, or 0 for always +;\13: event flag: an EVENT_* constant, or 0 to always appear db \1, \2 + 4, \3 + 4, \4 dn \5, \6 db \7, \8 @@ -101,7 +101,7 @@ ENDM stonetable: macro ;\1: warp id -;\2: person_event id +;\2: object_event id ;\3: script pointer db \1, \2 dw \3 diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm index 28be559a3..2b0cedc69 100644 --- a/macros/scripts/movement.asm +++ b/macros/scripts/movement.asm @@ -122,14 +122,14 @@ fix_facing: macro db movement_fix_facing endm - enum movement_show_person ; $3c -show_person: macro - db movement_show_person + enum movement_show_object ; $3c +show_object: macro + db movement_show_object endm - enum movement_hide_person ; $3d -hide_person: macro - db movement_hide_person + enum movement_hide_object ; $3d +hide_object: macro + db movement_hide_object endm ; Sleep @@ -156,9 +156,9 @@ step_48: macro db \1 ; ??? endm - enum movement_remove_person ; $49 -remove_person: macro - db movement_remove_person + enum movement_remove_object ; $49 +remove_object: macro + db movement_remove_object endm enum movement_step_loop ; $4a diff --git a/macros/wram.asm b/macros/wram.asm index 7cead9158..e47e0a2f4 100755 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -212,7 +212,7 @@ roam_struct: MACRO ENDM bugcontestwinner: macro -\1PersonID:: db +\1WinnerID:: db \1Mon:: db \1Score:: dw endm |