You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
# Pic Animations
|
# Pic Animations
|
||||||
|
|
||||||
Defined in [macros/scripts/gfx_anims.asm](https://github.com/pret/pokecrystal/blob/master/macros/scripts/gfx_anims.asm).
|
Defined in [macros/scripts/pic_anims.asm](https://github.com/pret/pokecrystal/blob/master/macros/scripts/pic_anims.asm).
|
||||||
|
|
||||||
Pic animations are assembled in 3 parts:
|
Pic animations are assembled in 3 parts:
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ Pic animations are assembled in 3 parts:
|
|||||||
- <code>frame <i>N</i>, <i>duration</i></code>: Frame #0 is the original pic (no change)
|
- <code>frame <i>N</i>, <i>duration</i></code>: Frame #0 is the original pic (no change)
|
||||||
- <code>setrepeat <i>N</i></code>: Sets the number of times to repeat
|
- <code>setrepeat <i>N</i></code>: Sets the number of times to repeat
|
||||||
- <code>dorepeat <i>I</i></code>: Repeats from command #<i>I</i> (with the first command being #0)
|
- <code>dorepeat <i>I</i></code>: Repeats from command #<i>I</i> (with the first command being #0)
|
||||||
- `end`
|
- `endanim`
|
||||||
|
|
||||||
- Bitmasks:
|
- Bitmasks:
|
||||||
Layered over the pic to designate affected tiles
|
Layered over the pic to designate affected tiles
|
||||||
|
@@ -80,9 +80,9 @@ endr
|
|||||||
BattleAnimOAMUpdate:
|
BattleAnimOAMUpdate:
|
||||||
call InitBattleAnimBuffer
|
call InitBattleAnimBuffer
|
||||||
call GetBattleAnimFrame
|
call GetBattleAnimFrame
|
||||||
cp dowait_command
|
cp oamwait_command
|
||||||
jp z, .done
|
jp z, .done
|
||||||
cp delanim_command
|
cp oamdelete_command
|
||||||
jp z, .delete
|
jp z, .delete
|
||||||
|
|
||||||
push af
|
push af
|
||||||
|
@@ -29,9 +29,9 @@ GetBattleAnimFrame:
|
|||||||
inc [hl]
|
inc [hl]
|
||||||
call .GetPointer
|
call .GetPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp dorestart_command
|
cp oamrestart_command
|
||||||
jr z, .restart
|
jr z, .restart
|
||||||
cp endanim_command
|
cp oamend_command
|
||||||
jr z, .repeat_last
|
jr z, .repeat_last
|
||||||
|
|
||||||
push af
|
push af
|
||||||
@@ -44,7 +44,7 @@ GetBattleAnimFrame:
|
|||||||
pop hl
|
pop hl
|
||||||
.okay
|
.okay
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "frame" macro
|
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "oamframe" macro
|
||||||
srl a
|
srl a
|
||||||
ld [wBattleAnimTempFrameOAMFlags], a
|
ld [wBattleAnimTempFrameOAMFlags], a
|
||||||
pop af
|
pop af
|
||||||
|
@@ -229,9 +229,9 @@ DeinitializeAllSprites:
|
|||||||
UpdateAnimFrame:
|
UpdateAnimFrame:
|
||||||
call InitSpriteAnimBuffer ; init WRAM
|
call InitSpriteAnimBuffer ; init WRAM
|
||||||
call GetSpriteAnimFrame ; read from a memory array
|
call GetSpriteAnimFrame ; read from a memory array
|
||||||
cp dowait_command
|
cp oamwait_command
|
||||||
jr z, .done
|
jr z, .done
|
||||||
cp delanim_command
|
cp oamdelete_command
|
||||||
jr z, .delete
|
jr z, .delete
|
||||||
call GetFrameOAMPointer
|
call GetFrameOAMPointer
|
||||||
; add byte to [wCurAnimVTile]
|
; add byte to [wCurAnimVTile]
|
||||||
@@ -303,6 +303,7 @@ UpdateAnimFrame:
|
|||||||
jr .done
|
jr .done
|
||||||
|
|
||||||
.delete
|
.delete
|
||||||
|
; Removes the object from the screen, as opposed to `oamend` which just stops all motion
|
||||||
call DeinitializeSprite
|
call DeinitializeSprite
|
||||||
.done
|
.done
|
||||||
and a
|
and a
|
||||||
@@ -428,9 +429,9 @@ GetSpriteAnimFrame:
|
|||||||
inc [hl]
|
inc [hl]
|
||||||
call .GetPointer
|
call .GetPointer
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp dorestart_command
|
cp oamrestart_command
|
||||||
jr z, .restart
|
jr z, .restart
|
||||||
cp endanim_command
|
cp oamend_command
|
||||||
jr z, .repeat_last
|
jr z, .repeat_last
|
||||||
|
|
||||||
push af
|
push af
|
||||||
@@ -446,7 +447,7 @@ GetSpriteAnimFrame:
|
|||||||
pop hl
|
pop hl
|
||||||
.okay
|
.okay
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "frame" macro
|
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "oamframe" macro
|
||||||
srl a
|
srl a
|
||||||
ld [wCurSpriteOAMFlags], a
|
ld [wCurSpriteOAMFlags], a
|
||||||
pop af
|
pop af
|
||||||
|
@@ -15,6 +15,7 @@ INCLUDE "macros/scripts/text.asm"
|
|||||||
INCLUDE "macros/scripts/movement.asm"
|
INCLUDE "macros/scripts/movement.asm"
|
||||||
INCLUDE "macros/scripts/battle_commands.asm"
|
INCLUDE "macros/scripts/battle_commands.asm"
|
||||||
INCLUDE "macros/scripts/battle_anims.asm"
|
INCLUDE "macros/scripts/battle_anims.asm"
|
||||||
INCLUDE "macros/scripts/gfx_anims.asm"
|
INCLUDE "macros/scripts/oam_anims.asm"
|
||||||
|
INCLUDE "macros/scripts/pic_anims.asm"
|
||||||
|
|
||||||
INCLUDE "macros/legacy.asm"
|
INCLUDE "macros/legacy.asm"
|
||||||
|
@@ -338,6 +338,11 @@ DEF anim_enemyfeetobj EQUS "anim_battlergfx_2row"
|
|||||||
DEF anim_playerheadobj EQUS "anim_battlergfx_1row"
|
DEF anim_playerheadobj EQUS "anim_battlergfx_1row"
|
||||||
DEF anim_clearsprites EQUS "anim_keepsprites"
|
DEF anim_clearsprites EQUS "anim_keepsprites"
|
||||||
|
|
||||||
|
; macros/scripts/oam_anims.asm
|
||||||
|
DEF dorestart EQUS "oamrestart"
|
||||||
|
DEF dowait EQUS "oamwait"
|
||||||
|
DEF delanim EQUS "oamdel"
|
||||||
|
|
||||||
; engine/events/std_scripts.asm
|
; engine/events/std_scripts.asm
|
||||||
DEF pokecenternurse EQUS "PokecenterNurseScript"
|
DEF pokecenternurse EQUS "PokecenterNurseScript"
|
||||||
DEF difficultbookshelf EQUS "DifficultBookshelfScript"
|
DEF difficultbookshelf EQUS "DifficultBookshelfScript"
|
||||||
|
@@ -1,53 +0,0 @@
|
|||||||
; pic + oam animations
|
|
||||||
|
|
||||||
MACRO frame
|
|
||||||
db \1
|
|
||||||
DEF x = \2
|
|
||||||
if _NARG > 2
|
|
||||||
rept _NARG - 2
|
|
||||||
DEF x |= 1 << (\3 + 1)
|
|
||||||
shift
|
|
||||||
endr
|
|
||||||
endc
|
|
||||||
db x
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const_def -1, -1
|
|
||||||
|
|
||||||
const endanim_command ; $ff
|
|
||||||
MACRO endanim
|
|
||||||
db endanim_command
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const dorestart_command ; $fe
|
|
||||||
MACRO dorestart
|
|
||||||
db dorestart_command
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const dowait_command ; $fd
|
|
||||||
MACRO dowait
|
|
||||||
db dowait_command
|
|
||||||
db \1 ; frames
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const delanim_command ; $fc
|
|
||||||
MACRO delanim
|
|
||||||
; Removes the object from the screen, as opposed to `endanim` which just stops all motion
|
|
||||||
db delanim_command
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
|
|
||||||
; Used for pic animations
|
|
||||||
const_def -2, -1
|
|
||||||
|
|
||||||
const setrepeat_command ; $fe
|
|
||||||
MACRO setrepeat
|
|
||||||
db setrepeat_command
|
|
||||||
db \1 ; amount of times to repeat
|
|
||||||
ENDM
|
|
||||||
|
|
||||||
const dorepeat_command ; $fd
|
|
||||||
MACRO dorepeat
|
|
||||||
db dorepeat_command
|
|
||||||
db \1 ; command offset to jump to
|
|
||||||
ENDM
|
|
38
macros/scripts/oam_anims.asm
Normal file
38
macros/scripts/oam_anims.asm
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
; Battle and sprite OAM animations
|
||||||
|
|
||||||
|
MACRO oamframe
|
||||||
|
db \1 ; duration
|
||||||
|
DEF x = \2
|
||||||
|
assert !(x & (1 << (OAM_X_FLIP + 1) | 1 << (OAM_Y_FLIP + 1))), \
|
||||||
|
"oamframe duration overflows into X/Y flip bits"
|
||||||
|
if _NARG > 2
|
||||||
|
rept _NARG - 2
|
||||||
|
DEF x |= 1 << (\3 + 1)
|
||||||
|
shift
|
||||||
|
endr
|
||||||
|
endc
|
||||||
|
db x ; flags
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const_def -1, -1
|
||||||
|
|
||||||
|
const oamend_command ; $ff
|
||||||
|
MACRO oamend
|
||||||
|
db oamend_command
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const oamrestart_command ; $fe
|
||||||
|
MACRO oamrestart
|
||||||
|
db oamrestart_command
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const oamwait_command ; $fd
|
||||||
|
MACRO oamwait
|
||||||
|
db oamwait_command
|
||||||
|
db \1 ; frames
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const oamdelete_command ; $fc
|
||||||
|
MACRO oamdelete
|
||||||
|
db oamdelete_command
|
||||||
|
ENDM
|
28
macros/scripts/pic_anims.asm
Normal file
28
macros/scripts/pic_anims.asm
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
MACRO frame
|
||||||
|
if _NARG <= 2
|
||||||
|
db \1 ; index
|
||||||
|
db \2 ; duration
|
||||||
|
else
|
||||||
|
; LEGACY: Support for the old name of "oamanim"
|
||||||
|
oamanim \#
|
||||||
|
endc
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const_def -1, -1
|
||||||
|
|
||||||
|
const endanim_command ; $ff
|
||||||
|
MACRO endanim
|
||||||
|
db endanim_command
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const setrepeat_command ; $fe
|
||||||
|
MACRO setrepeat
|
||||||
|
db setrepeat_command
|
||||||
|
db \1 ; amount of times to repeat
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
const dorepeat_command ; $fd
|
||||||
|
MACRO dorepeat
|
||||||
|
db dorepeat_command
|
||||||
|
db \1 ; command offset to jump to
|
||||||
|
ENDM
|
Reference in New Issue
Block a user