diff options
author | entrpntr <entrpntr@gmail.com> | 2020-04-27 03:33:13 -0400 |
---|---|---|
committer | entrpntr <entrpntr@gmail.com> | 2020-04-27 03:35:35 -0400 |
commit | 70d3a3fdbc508eeb4557ddc43d78ba12ed41963e (patch) | |
tree | 202f65e4131709331ae62cbe5eace4d6f8b6aa58 /macros | |
parent | 75cf425d30db6a036743cf85c483c1b537063605 (diff) |
Sync with the recent updates to pokecrystal.
Diffstat (limited to 'macros')
-rw-r--r-- | macros/code.asm | 13 | ||||
-rwxr-xr-x | macros/coords.asm | 6 | ||||
-rwxr-xr-x | macros/data.asm | 23 | ||||
-rwxr-xr-x | macros/gfx.asm | 28 | ||||
-rw-r--r-- | macros/legacy.asm | 5 | ||||
-rw-r--r-- | macros/scripts/audio.asm | 4 | ||||
-rw-r--r-- | macros/scripts/movement.asm | 4 | ||||
-rwxr-xr-x | macros/wram.asm | 5 |
8 files changed, 48 insertions, 40 deletions
diff --git a/macros/code.asm b/macros/code.asm index 9429884c..c92e7132 100644 --- a/macros/code.asm +++ b/macros/code.asm @@ -8,17 +8,6 @@ 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 @@ -62,7 +51,7 @@ calc_sine_wave: MACRO ; input: a = a signed 6-bit value ; output: a = d * sin(a * pi/32) and %111111 - cp %100000 + cp %100000 jr nc, .negative\@ call .apply\@ ld a, h diff --git a/macros/coords.asm b/macros/coords.asm index 3ea6e415..5a87e1d3 100755 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -49,3 +49,9 @@ lda_coord: MACRO ld a, [(\2) * SCREEN_WIDTH + (\1) + \3] endc ENDM + +menu_coords: MACRO +; x1, y1, x2, y2 + db \2, \1 ; start coords + db \4, \3 ; end coords +ENDM diff --git a/macros/data.asm b/macros/data.asm index b9b4b0a9..932525eb 100755 --- a/macros/data.asm +++ b/macros/data.asm @@ -47,7 +47,7 @@ dx: MACRO x = 8 * ((\1) - 1) rept \1 db ((\2) >> x) & $ff -x = x + -8 +x = x - 8 endr ENDM @@ -93,27 +93,6 @@ dba_pic: MACRO ; dbw bank, address dw \1 ENDM -dbpixel: MACRO -if _NARG >= 4 -; x tile, x pxl, y tile, y pxl - db \1 * 8 + \3, \2 * 8 + \4 -else -; x, y - db \1 * 8, \2 * 8 -endc -ENDM - -dsprite: MACRO -; y tile, y pxl, x tile, x pxl, vtile offset, attributes - db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6 -ENDM - -menu_coords: MACRO -; x1, y1, x2, y2 - db \2, \1 ; start coords - db \4, \3 ; end coords -ENDM - bcd: MACRO rept _NARG dn ((\1) % 100) / 10, (\1) % 10 diff --git a/macros/gfx.asm b/macros/gfx.asm index 24c79e1f..2c67cfc8 100755 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -20,3 +20,31 @@ tile EQUS "+ LEN_2BPP_TILE *" ; example usage: ; INCBIN "foo.gbcpal", middle_colors middle_colors EQUS "PAL_COLOR_SIZE, PAL_COLOR_SIZE * 2" + +dbpixel: MACRO +if _NARG >= 4 +; x tile, y tile, x pixel, y pixel + db \1 * TILE_WIDTH + \3, \2 * TILE_WIDTH + \4 +else +; x tile, y tile + db \1 * TILE_WIDTH, \2 * TILE_WIDTH +endc +ENDM + +ldpixel: MACRO +if _NARG >= 5 +; register, x tile, y tile, x pixel, y pixel + lb \1, \2 * TILE_WIDTH + \4, \3 * TILE_WIDTH + \5 +else +; register, x tile, y tile + lb \1, \2 * TILE_WIDTH, \3 * TILE_WIDTH +endc +ENDM + +depixel EQUS "ldpixel de," +bcpixel EQUS "ldpixel bc," + +dbsprite: MACRO +; x tile, y tile, x pixel, y pixel, vtile offset, attributes + db (\2 * TILE_WIDTH) % $100 + \4, (\1 * TILE_WIDTH) % $100 + \3, \5, \6 +ENDM diff --git a/macros/legacy.asm b/macros/legacy.asm index eae91e88..59ce0d2f 100644 --- a/macros/legacy.asm +++ b/macros/legacy.asm @@ -6,6 +6,11 @@ callba EQUS "farcall" callab EQUS "callfar" +; macros/gfx.asm +dsprite: MACRO + dbsprite \2, \4, \1, \3, \5, \6 +ENDM + ; macros/scripts/audio.asm __ EQU 0 CC EQU 13 diff --git a/macros/scripts/audio.asm b/macros/scripts/audio.asm index 92654ff9..6f87bc3e 100644 --- a/macros/scripts/audio.asm +++ b/macros/scripts/audio.asm @@ -41,7 +41,7 @@ noise_note: MACRO ENDM ; MusicCommands indexes (see audio/engine.asm) - enum_start $d0, +8 + enum_start $d0, 8 FIRST_MUSIC_CMD EQU __enum__ enum octave_cmd ; $d0 @@ -49,7 +49,7 @@ octave: MACRO db octave_cmd | 8 - (\1) ; octave ENDM -__enumdir__ = +1 +__enumdir__ = 1 enum note_type_cmd ; $d8 note_type: MACRO diff --git a/macros/scripts/movement.asm b/macros/scripts/movement.asm index 2896700e..f6ea46a6 100644 --- a/macros/scripts/movement.asm +++ b/macros/scripts/movement.asm @@ -1,5 +1,5 @@ ; MovementPointers indexes (see engine/overworld/movement.asm) - enum_start 0, +4 + enum_start 0, 4 ; Directional movements @@ -73,7 +73,7 @@ fast_jump_step: MACRO db movement_fast_jump_step | \1 ENDM -__enumdir__ = +1 +__enumdir__ = 1 ; Control enum movement_remove_sliding ; $38 diff --git a/macros/wram.asm b/macros/wram.asm index 4294abb5..1e7ab534 100755 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -106,7 +106,7 @@ curbox: MACRO \1Species:: ds MONS_PER_BOX + 1 \1Mons:: \1Mon1:: box_struct \1Mon1 -\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX + -1) +\1Mon2:: ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX - 1) \1MonOT:: ds NAME_LENGTH * MONS_PER_BOX \1MonNicknames:: ds MON_NAME_LENGTH * MONS_PER_BOX \1MonNicknamesEnd:: @@ -206,7 +206,7 @@ hof_mon: MACRO \1ID:: dw \1DVs:: dw \1Level:: db -\1Nickname:: ds MON_NAME_LENGTH + -1 +\1Nickname:: ds MON_NAME_LENGTH - 1 \1End:: ENDM @@ -227,6 +227,7 @@ link_battle_record: MACRO \1Wins:: dw \1Losses:: dw \1Draws:: dw +\1End:: ENDM trademon: MACRO |