Decompile and label all battle animations (#116)
* Began decompiling Bank $33 * Decompiled battle anim functions * Decompiled battle anim OAM and AnimObjGFX, split up and labelled battle animation graphics, other minor changes * Deleted useless files I forgot to delete * Decompiled framesets * Decompiled battle anim objects * Partially started decompiling animations * Finished decompiling and labelling bank 32 in its entirety * Replaced gfx.c with latest version * Labelled all sound effects, properly constantified * Fixed up bg_effects.asm, other minor LYOverrides-related changes
|
|
@ -2687,6 +2687,7 @@ _PlaySFX::
|
|||
jr nz, .start_channels
|
||||
ret
|
||||
|
||||
PlayStereoSFX::
|
||||
ld a, [wce5f]
|
||||
bit 5, a ; Stereo flag?
|
||||
jr z, _PlaySFX
|
||||
|
|
|
|||
660
audio/sfx.asm
|
|
@ -4,105 +4,105 @@ SECTION "audio/sfx_pointers.asm", ROMX
|
|||
|
||||
SFX::
|
||||
; entries correspond to SFX_* constants
|
||||
dba Sfx_00
|
||||
dba Sfx_BallWobble
|
||||
dba Sfx_Potion
|
||||
dba Sfx_FullHeal
|
||||
dba Sfx_Menu
|
||||
dba Sfx_ReadText
|
||||
dba Sfx_ReadText
|
||||
dba Sfx_06
|
||||
dba Sfx_07
|
||||
dba Sfx_08
|
||||
dba Sfx_09
|
||||
dba Sfx_Poison
|
||||
dba Sfx_TradeMachine
|
||||
dba Sfx_BootPC
|
||||
dba Sfx_ShutDownPC
|
||||
dba Sfx_ChoosePCOption
|
||||
dba Sfx_EscapeRope
|
||||
dba Sfx_0c
|
||||
dba Sfx_0d
|
||||
dba Sfx_0e
|
||||
dba Sfx_0f
|
||||
dba Sfx_10
|
||||
dba Sfx_11
|
||||
dba Sfx_12
|
||||
dba Sfx_13
|
||||
dba Sfx_PressSwitch
|
||||
dba Sfx_HealingMachine
|
||||
dba Sfx_WarpTo
|
||||
dba Sfx_TeleportEnter1
|
||||
dba Sfx_TeleportExit2
|
||||
dba Sfx_JumpOverLedge
|
||||
dba Sfx_TeleportEnter2
|
||||
dba Sfx_Fly
|
||||
dba Sfx_Wrong
|
||||
dba Sfx_15
|
||||
dba Sfx_16
|
||||
dba Sfx_17
|
||||
dba Sfx_18
|
||||
dba Sfx_19
|
||||
dba Sfx_1a
|
||||
dba Sfx_ArrowTiles
|
||||
dba Sfx_Strength
|
||||
dba Sfx_Megaphone
|
||||
dba Sfx_WithdrawDeposit
|
||||
dba Sfx_CutRG
|
||||
dba Sfx_GoInside
|
||||
dba Sfx_SwitchPokemon
|
||||
dba Sfx_1c
|
||||
dba Sfx_1d
|
||||
dba Sfx_1e
|
||||
dba Sfx_1f
|
||||
dba Sfx_20
|
||||
dba Sfx_BellyDrum
|
||||
dba Sfx_Purchase
|
||||
dba Sfx_Collision
|
||||
dba Sfx_GoOutside
|
||||
dba Sfx_Save
|
||||
dba Sfx_Pokeflute
|
||||
dba Sfx_22
|
||||
dba Sfx_23
|
||||
dba Sfx_24
|
||||
dba Sfx_25
|
||||
dba Sfx_26
|
||||
dba Sfx_SafariZonePA
|
||||
dba Sfx_ThrowBall
|
||||
dba Sfx_BallPoof
|
||||
dba Sfx_Faint
|
||||
dba Sfx_Run
|
||||
dba Sfx_PokedexRegistration
|
||||
dba Sfx_28
|
||||
dba Sfx_29
|
||||
dba Sfx_2a
|
||||
dba Sfx_2b
|
||||
dba Sfx_2c
|
||||
dba Sfx_IntroLungeRG
|
||||
dba Sfx_Unknown29
|
||||
dba Sfx_Unknown2a
|
||||
dba Sfx_IntroRaiseRG
|
||||
dba Sfx_IntroCrashRG
|
||||
dba Sfx_TitleEntrance
|
||||
dba Sfx_2e
|
||||
dba Sfx_2f
|
||||
dba Sfx_SlotsStopWheel
|
||||
dba Sfx_SlotsReward
|
||||
dba Sfx_PayDay
|
||||
dba Sfx_GameFreakLogoRG
|
||||
dba Sfx_32
|
||||
dba Sfx_33
|
||||
dba Sfx_34
|
||||
dba Sfx_35
|
||||
dba Sfx_36
|
||||
dba Sfx_37
|
||||
dba Sfx_38
|
||||
dba Sfx_39
|
||||
dba Sfx_3a
|
||||
dba Sfx_3b
|
||||
dba Sfx_3c
|
||||
dba Sfx_3d
|
||||
dba Sfx_3e
|
||||
dba Sfx_3f
|
||||
dba Sfx_40
|
||||
dba Sfx_41
|
||||
dba Sfx_42
|
||||
dba Sfx_43
|
||||
dba Sfx_44
|
||||
dba Sfx_45
|
||||
dba Sfx_46
|
||||
dba Sfx_47
|
||||
dba Sfx_48
|
||||
dba Sfx_49
|
||||
dba Sfx_4a
|
||||
dba Sfx_4b
|
||||
dba Sfx_4c
|
||||
dba Sfx_4d
|
||||
dba Sfx_4e
|
||||
dba Sfx_4f
|
||||
dba Sfx_50
|
||||
dba Sfx_51
|
||||
dba Sfx_52
|
||||
dba Sfx_53
|
||||
dba Sfx_54
|
||||
dba Sfx_55
|
||||
dba Sfx_56
|
||||
dba Sfx_57
|
||||
dba Sfx_58
|
||||
dba Sfx_59
|
||||
dba Sfx_5a
|
||||
dba Sfx_5b
|
||||
dba Sfx_5c
|
||||
dba Sfx_5d
|
||||
dba Sfx_5e
|
||||
dba Sfx_5f
|
||||
dba Sfx_60
|
||||
dba Sfx_61
|
||||
dba Sfx_62
|
||||
dba Sfx_Peck
|
||||
dba Sfx_Kinesis
|
||||
dba Sfx_Lick
|
||||
dba Sfx_Pound
|
||||
dba Sfx_Thrash
|
||||
dba Sfx_CometPunch
|
||||
dba Sfx_MegaPunch
|
||||
dba Sfx_Scratch
|
||||
dba Sfx_ViceGrip
|
||||
dba Sfx_RazorWind
|
||||
dba Sfx_Cut
|
||||
dba Sfx_WingAttack
|
||||
dba Sfx_Whirlwind
|
||||
dba Sfx_Bind
|
||||
dba Sfx_VineWhip
|
||||
dba Sfx_DoubleKick
|
||||
dba Sfx_MegaKick
|
||||
dba Sfx_Headbutt
|
||||
dba Sfx_HornAttack
|
||||
dba Sfx_Tackle
|
||||
dba Sfx_PoisonSting
|
||||
dba Sfx_Powder
|
||||
dba Sfx_Doubleslap
|
||||
dba Sfx_Bite
|
||||
dba Sfx_JumpKick
|
||||
dba Sfx_Stomp
|
||||
dba Sfx_TailWhip
|
||||
dba Sfx_KarateChop
|
||||
dba Sfx_Submission
|
||||
dba Sfx_WaterGun
|
||||
dba Sfx_SwordsDance
|
||||
dba Sfx_Thunder
|
||||
dba Sfx_Supersonic
|
||||
dba Sfx_Leer
|
||||
dba Sfx_Ember
|
||||
dba Sfx_Bubblebeam
|
||||
dba Sfx_HydroPump
|
||||
dba Sfx_Surf
|
||||
dba Sfx_Psybeam
|
||||
dba Sfx_Charge
|
||||
dba Sfx_Thundershock
|
||||
dba Sfx_Psychic
|
||||
dba Sfx_Screech
|
||||
dba Sfx_BoneClub
|
||||
dba Sfx_Sharpen
|
||||
dba Sfx_EggBomb
|
||||
dba Sfx_Sing
|
||||
dba Sfx_HyperBeam
|
||||
dba Sfx_Shine
|
||||
dba Sfx_GetItemRG
|
||||
dba Sfx_UnusedFanfare1
|
||||
dba Sfx_PokedexEvaluationRG
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ INCLUDE "macros/maps.asm"
|
|||
|
||||
INCLUDE "macros/battle_commands.asm"
|
||||
INCLUDE "macros/oam_anims.asm"
|
||||
INCLUDE "macros/battle_anims.asm"
|
||||
INCLUDE "macros/asserts.asm"
|
||||
|
||||
INCLUDE "constants/audio_constants.asm"
|
||||
|
|
|
|||
|
|
@ -273,24 +273,22 @@ DEF NUM_ATTACKS EQU const_value - 1
|
|||
const ANIM_IN_LOVE ; 10a
|
||||
const ANIM_IN_SANDSTORM ; 10b
|
||||
const ANIM_IN_NIGHTMARE ; 10c
|
||||
const ANIM_IN_WHIRLPOOL ; 10d
|
||||
; battle anims
|
||||
const ANIM_MISS ; 10e
|
||||
const ANIM_ENEMY_DAMAGE ; 10f
|
||||
const ANIM_ENEMY_STAT_DOWN ; 110
|
||||
const ANIM_PLAYER_STAT_DOWN ; 111
|
||||
const ANIM_PLAYER_DAMAGE ; 112
|
||||
const ANIM_WOBBLE ; 113
|
||||
const ANIM_SHAKE ; 114
|
||||
const ANIM_HIT_CONFUSION ; 115
|
||||
const ANIM_MISS ; 10d
|
||||
const ANIM_DAMAGE ; 10e
|
||||
const ANIM_SHAKE_HORIZONTAL_UNUSED ; 10f
|
||||
const ANIM_PLAYER_STAT_DOWN ; 110
|
||||
const ANIM_BLINK_ENEMY_MON_UNUSED ; 111
|
||||
const ANIM_SHAKE_HORIZONTAL_UNUSED_2 ; 112
|
||||
const ANIM_ENEMY_STAT_DOWN ; 113
|
||||
DEF NUM_BATTLE_ANIMS EQU const_value - 1
|
||||
|
||||
; wNumHits uses offsets from ANIM_MISS
|
||||
const_def
|
||||
const BATTLEANIM_NONE
|
||||
const BATTLEANIM_ENEMY_DAMAGE
|
||||
const BATTLEANIM_ENEMY_STAT_DOWN
|
||||
const BATTLEANIM_DAMAGE
|
||||
const BATTLEANIM_SHAKE_HORIZONTAL_UNUSED
|
||||
const BATTLEANIM_PLAYER_STAT_DOWN
|
||||
const BATTLEANIM_PLAYER_DAMAGE
|
||||
const BATTLEANIM_WOBBLE
|
||||
const BATTLEANIM_SHAKE
|
||||
const BATTLEANIM_HIT_CONFUSION
|
||||
const BATTLEANIM_BLINK_ENEMY_MON_UNUSED
|
||||
const BATTLEANIM_SHAKE_HORIZONTAL_UNUSED_2
|
||||
const BATTLEANIM_ENEMY_STAT_DOWN
|
||||
|
|
|
|||
|
|
@ -1,34 +1,113 @@
|
|||
; TODO
|
||||
|
||||
DEF SFX_POTION EQU $01
|
||||
DEF SFX_FULL_HEAL EQU $02
|
||||
DEF SFX_MENU EQU $03
|
||||
DEF SFX_READ_TEXT EQU $04
|
||||
DEF SFX_READ_TEXT_2 EQU $05
|
||||
DEF SFX_BOOT_PC EQU $0A
|
||||
DEF SFX_ESCAPE_ROPE EQU $0B ; player shrink
|
||||
DEF SFX_WRONG EQU $14
|
||||
DEF SFX_SWITCH_POKEMON EQU $1B
|
||||
DEF SFX_1E EQU $1E
|
||||
DEF SFX_POKEFLUTE EQU $21
|
||||
DEF SFX_22 EQU $22
|
||||
DEF SFX_24 EQU $24
|
||||
DEF SFX_25 EQU $25
|
||||
DEF SFX_POKEDEX_REGISTRATION EQU $27
|
||||
DEF SFX_TITLE_ENTRANCE EQU $2D
|
||||
DEF SFX_PAY_DAY EQU $30
|
||||
DEF SFX_GAME_FREAK_LOGO_RG EQU $31
|
||||
|
||||
DEF SFX_SHINE EQU $62
|
||||
; SFX indexes (see audio/sfx_pointers.asm)
|
||||
; Asterisk (*) means the sound effect is an unused leftover from Generation I.
|
||||
const_def
|
||||
const SFX_BALL_WOBBLE ; 00
|
||||
const SFX_POTION ; 01
|
||||
const SFX_FULL_HEAL ; 02
|
||||
const SFX_MENU ; 03
|
||||
const SFX_READ_TEXT ; 04
|
||||
const SFX_READ_TEXT_2 ; 05
|
||||
const SFX_POISON ; 06
|
||||
const SFX_TRADE_MACHINE ; 07*
|
||||
const SFX_BOOT_PC ; 08*
|
||||
const SFX_SHUT_DOWN_PC ; 09*
|
||||
const SFX_CHOOSE_PC_OPTION ; 0a, used when booting PC
|
||||
const SFX_ESCAPE_ROPE ; 0b, player shrink
|
||||
const SFX_PRESS_SWITCH ; 0c*
|
||||
const SFX_HEALING_MACHINE ; 0d*
|
||||
const SFX_WARP_TO ; 0e, SFX_TELEPORT_EXIT_1 in pokered
|
||||
const SFX_TELEPORT_ENTER_1 ; 0f*
|
||||
const SFX_TELEPORT_EXIT_2 ; 10*
|
||||
const SFX_JUMP_OVER_LEDGE ; 11*
|
||||
const SFX_TELEPORT_ENTER_2 ; 12*
|
||||
const SFX_FLY ; 13*
|
||||
const SFX_WRONG ; 14
|
||||
const SFX_ARROW_TILES ; 15*
|
||||
const SFX_STRENGTH ; 16
|
||||
const SFX_MEGAPHONE ; 17, SFX_SS_ANNE_HORN in pokered
|
||||
const SFX_WITHDRAW_DEPOSIT ; 18*
|
||||
const SFX_CUT_RG ; 19*
|
||||
const SFX_GO_INSIDE ; 1a*
|
||||
const SFX_SWITCH_POKEMON ; 1b
|
||||
const SFX_BELLY_DRUM ; 1c, SFX_59 in pokered
|
||||
const SFX_PURCHASE ; 1d*
|
||||
const SFX_COLLISION ; 1e, only used in debug
|
||||
const SFX_GO_OUTSIDE ; 1f*
|
||||
const SFX_SAVE ; 20
|
||||
const SFX_POKEFLUTE ; 21
|
||||
const SFX_SAFARI_ZONE_PA ; 22*
|
||||
const SFX_THROW_BALL ; 23*
|
||||
const SFX_BALL_POOF ; 24*
|
||||
const SFX_FAINT ; 25
|
||||
const SFX_RUN ; 26
|
||||
const SFX_POKEDEX_REGISTRATION ; 27
|
||||
const SFX_INTRO_LUNGE_RG ; 28*
|
||||
const SFX_UNKNOWN_29 ; 29*, doesn't match pokered
|
||||
const SFX_UNKNOWN_2A ; 2a*, doesn't match pokered
|
||||
const SFX_INTRO_RAISE_RG ; 2b*
|
||||
const SFX_INTRO_CRASH_RG ; 2c*
|
||||
const SFX_TITLE_ENTRANCE ; 2d, SFX_INTRO_WHOOSH in pokered
|
||||
const SFX_SLOTS_STOP_WHEEL ; 2e*
|
||||
const SFX_SLOTS_REWARD ; 2f*
|
||||
const SFX_PAY_DAY ; 30, SFX_SLOTS_NEW_SPIN in pokered
|
||||
const SFX_GAME_FREAK_LOGO_RG ; 31
|
||||
const SFX_PECK ; 32
|
||||
const SFX_KINESIS ; 33
|
||||
const SFX_LICK ; 34
|
||||
const SFX_POUND ; 35
|
||||
const SFX_THRASH ; 36, SFX_MOVE_PUZZLE_PIECE in pokegold
|
||||
const SFX_COMET_PUNCH ; 37
|
||||
const SFX_MEGA_PUNCH ; 38
|
||||
const SFX_SCRATCH ; 39
|
||||
const SFX_VICEGRIP ; 3a
|
||||
const SFX_RAZOR_WIND ; 3b
|
||||
const SFX_CUT ; 3c
|
||||
const SFX_WING_ATTACK ; 3d
|
||||
const SFX_WHIRLWIND ; 3e
|
||||
const SFX_BIND ; 3f
|
||||
const SFX_VINE_WHIP ; 40
|
||||
const SFX_DOUBLE_KICK ; 41
|
||||
const SFX_MEGA_KICK ; 42
|
||||
const SFX_HEADBUTT ; 43
|
||||
const SFX_HORN_ATTACK ; 44
|
||||
const SFX_TACKLE ; 45
|
||||
const SFX_POISON_STING ; 46
|
||||
const SFX_POWDER ; 47
|
||||
const SFX_DOUBLESLAP ; 48
|
||||
const SFX_BITE ; 49
|
||||
const SFX_JUMP_KICK ; 4a
|
||||
const SFX_STOMP ; 4b
|
||||
const SFX_TAIL_WHIP ; 4c
|
||||
const SFX_KARATE_CHOP ; 4d
|
||||
const SFX_SUBMISSION ; 4e
|
||||
const SFX_WATER_GUN ; 4f
|
||||
const SFX_SWORDS_DANCE ; 50
|
||||
const SFX_THUNDER ; 51
|
||||
const SFX_SUPERSONIC ; 52
|
||||
const SFX_LEER ; 53
|
||||
const SFX_EMBER ; 54
|
||||
const SFX_BUBBLEBEAM ; 55
|
||||
const SFX_HYDRO_PUMP ; 56
|
||||
const SFX_SURF ; 57
|
||||
const SFX_PSYBEAM ; 58
|
||||
const SFX_CHARGE ; 59
|
||||
const SFX_THUNDERSHOCK ; 5a
|
||||
const SFX_PSYCHIC ; 5b
|
||||
const SFX_SCREECH ; 5c
|
||||
const SFX_BONE_CLUB ; 5d
|
||||
const SFX_SHARPEN ; 5e
|
||||
const SFX_EGG_BOMB ; 5f
|
||||
const SFX_SING ; 60
|
||||
const SFX_HYPER_BEAM ; 61
|
||||
const SFX_SHINE ; 62
|
||||
|
||||
; R/G/B/Y fanfares
|
||||
DEF SFX_GET_ITEM_RG EQU $63
|
||||
DEF SFX_UNUSED_FANFARE_1 EQU $64
|
||||
DEF SFX_POKEDEX_EVALUATION_RG EQU $65
|
||||
DEF SFX_LEVEL_UP_RG EQU $66
|
||||
DEF SFX_EVOLUTION_COMPLETE_RG EQU $67
|
||||
DEF SFX_GET_KEY_ITEM_RG EQU $68
|
||||
DEF SFX_UNUSED_FANFARE_2 EQU $69
|
||||
DEF SFX_CAUGHT_POKEMON_RG EQU $6A
|
||||
DEF SFX_UNUSED_FANFARE_3 EQU $6B
|
||||
|
||||
const SFX_GET_ITEM_RG ; 63
|
||||
const SFX_UNUSED_FANFARE_1 ; 64
|
||||
const SFX_POKEDEX_EVALUATION_RG ; 65
|
||||
const SFX_LEVEL_UP_RG ; 66
|
||||
const SFX_EVOLUTION_COMPLETE_RG ; 67
|
||||
const SFX_GET_KEY_ITEM_RG ; 68
|
||||
const SFX_UNUSED_FANFARE_2 ; 69*
|
||||
const SFX_CAUGHT_POKEMON_RG ; 6a*
|
||||
const SFX_UNUSED_FANFARE_3 ; 6b*
|
||||
|
|
|
|||
|
|
@ -102,4 +102,11 @@ DEF TOOLGEAR_COORDS_F EQU 0
|
|||
DEF OVERWORLD_MINUTE_TIME_F EQU 7
|
||||
|
||||
; wTimeOfDayPalFlags::
|
||||
DEF CLEAR_PALSET_F EQU 7
|
||||
DEF CLEAR_PALSET_F EQU 7
|
||||
|
||||
; wBattleAnimFlags::
|
||||
const_def
|
||||
const BATTLEANIM_STOP_F ; 0
|
||||
const BATTLEANIM_IN_SUBROUTINE_F ; 1
|
||||
const BATTLEANIM_IN_LOOP_F ; 2
|
||||
const BATTLEANIM_KEEPSPRITES_F ; 3
|
||||
|
|
|
|||
1252
data/battle_anims/framesets.inc
Normal file
1079
data/battle_anims/oam.inc
Normal file
50
data/battle_anims/object_gfx.inc
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
MACRO anim_obj_gfx
|
||||
; # tiles, gfx pointer
|
||||
db \1
|
||||
dba \2
|
||||
ENDM
|
||||
|
||||
AnimObjGFX:
|
||||
; entries correspond to BATTLE_ANIM_GFX_* constants
|
||||
table_width 4, AnimObjGFX
|
||||
anim_obj_gfx 0, AnimObj00GFX
|
||||
anim_obj_gfx 21, AnimObjHitGFX
|
||||
anim_obj_gfx 6, AnimObjCutGFX
|
||||
anim_obj_gfx 6, AnimObjFireGFX
|
||||
anim_obj_gfx 20, AnimObjWaterGFX
|
||||
anim_obj_gfx 26, AnimObjLightningGFX
|
||||
anim_obj_gfx 18, AnimObjPlantGFX
|
||||
anim_obj_gfx 12, AnimObjSmokeGFX
|
||||
anim_obj_gfx 9, AnimObjExplosionGFX
|
||||
anim_obj_gfx 17, AnimObjRocksGFX
|
||||
anim_obj_gfx 6, AnimObjIceGFX
|
||||
anim_obj_gfx 10, AnimObjPokeBallGFX
|
||||
anim_obj_gfx 9, AnimObjPoisonGFX
|
||||
anim_obj_gfx 13, AnimObjBubbleGFX
|
||||
anim_obj_gfx 16, AnimObjNoiseGFX
|
||||
anim_obj_gfx 2, AnimObjPowderGFX
|
||||
anim_obj_gfx 11, AnimObjBeamGFX
|
||||
anim_obj_gfx 9, AnimObjSpeedGFX
|
||||
anim_obj_gfx 9, AnimObjChargeGFX
|
||||
anim_obj_gfx 19, AnimObjWindGFX
|
||||
anim_obj_gfx 10, AnimObjWhipGFX
|
||||
anim_obj_gfx 12, AnimObjEggGFX
|
||||
anim_obj_gfx 18, AnimObjRopeGFX
|
||||
anim_obj_gfx 13, AnimObjPsychicGFX
|
||||
anim_obj_gfx 10, AnimObjReflectGFX
|
||||
anim_obj_gfx 27, AnimObjStatusGFX
|
||||
anim_obj_gfx 12, AnimObjSandGFX
|
||||
anim_obj_gfx 14, AnimObjWebGFX
|
||||
anim_obj_gfx 16, AnimObjHazeGFX
|
||||
anim_obj_gfx 7, AnimObjHornGFX
|
||||
anim_obj_gfx 8, AnimObjFlowerGFX
|
||||
anim_obj_gfx 40, AnimObjMiscGFX
|
||||
anim_obj_gfx 36, AnimObjSkyAttackGFX
|
||||
anim_obj_gfx 16, AnimObjGlobeGFX
|
||||
anim_obj_gfx 48, AnimObjShapesGFX
|
||||
anim_obj_gfx 18, AnimObjObjectsGFX
|
||||
anim_obj_gfx 38, AnimObjShineGFX
|
||||
anim_obj_gfx 35, AnimObjAngelsGFX
|
||||
anim_obj_gfx 0, NULL
|
||||
anim_obj_gfx 0, NULL
|
||||
assert_table_length NUM_BATTLE_ANIM_GFX + 1
|
||||
383
data/battle_anims/objects.inc
Normal file
|
|
@ -0,0 +1,383 @@
|
|||
DEF ABSOLUTE_X EQU $00
|
||||
DEF RELATIVE_X EQU $01
|
||||
|
||||
MACRO battleanimobj
|
||||
db \1 ; flags
|
||||
; bit 7: priority
|
||||
; bit 6: y flip (for enemy)
|
||||
; bit 5: x flip (for enemy)
|
||||
; bit 0: enable enemy animation coord fixing (x = $b4 - x; see below for y)
|
||||
db \2 ; enemy animation y fix param
|
||||
; if $FF: y = y + 5 tiles
|
||||
; else: y = -y - (1 tile) * (is_softboiled_animation)
|
||||
db \3 ; video sequence
|
||||
db \4 ; callback
|
||||
db \5 ; tile offset
|
||||
ENDM
|
||||
|
||||
BattleAnimObjects:
|
||||
; entries correspond to BATTLE_ANIM_OBJ_* constants
|
||||
table_width BATTLEANIMOBJ_LENGTH, BattleAnimObjects
|
||||
; BATTLE_ANIM_OBJ_HIT_BIG_YFIX
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_HIT_BIG, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_HIT_YFIX
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_HIT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_HIT_SMALL_YFIX
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_HIT_SMALL, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_HIT_BIG
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_HIT_BIG, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_HIT
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_HIT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_HIT_SMALL
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_HIT_SMALL, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_PUNCH
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_PUNCH, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_KICK
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_KICK, BATTLE_ANIM_FUNC_KICK, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_PALM
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_PALM, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_FANG
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_FANG, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_PUNCH_SHAKE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_PUNCH_SHAKE, BATTLE_ANIM_FUNC_SHAKE, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_EMBER
|
||||
battleanimobj RELATIVE_X, $aa, BATTLE_ANIM_FRAMESET_EMBER, BATTLE_ANIM_FUNC_EMBER, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_DRAGON_RAGE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_DRAGON_RAGE, BATTLE_ANIM_FUNC_WAVE_TO_TARGET, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_FLAMETHROWER
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_FLAMETHROWER, BATTLE_ANIM_FUNC_MOVE_IN_CIRCLE, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_FIRE_SPIN
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_EMBER, BATTLE_ANIM_FUNC_USER_TO_TARGET_SPIN, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_FIRE_BLAST
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_FLAMETHROWER, BATTLE_ANIM_FUNC_FIRE_BLAST, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_BURNED
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BURNED, BATTLE_ANIM_FUNC_MOVE_IN_CIRCLE, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_BLIZZARD
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BLIZZARD, BATTLE_ANIM_FUNC_USER_TO_TARGET_SPIN, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_ICE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_ICE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_ICE_BEAM
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_ICE_BEAM, BATTLE_ANIM_FUNC_USER_TO_TARGET, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_RAZOR_LEAF
|
||||
battleanimobj RELATIVE_X | X_FLIP, $78, BATTLE_ANIM_FRAMESET_RAZOR_LEAF_1, BATTLE_ANIM_FUNC_RAZOR_LEAF, BATTLE_ANIM_GFX_PLANT
|
||||
; BATTLE_ANIM_OBJ_POKE_BALL
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_POKE_BALL_1, BATTLE_ANIM_FUNC_POKEBALL, BATTLE_ANIM_GFX_POKE_BALL
|
||||
; BATTLE_ANIM_OBJ_POKE_BALL_BLOCKED
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_POKE_BALL_1, BATTLE_ANIM_FUNC_POKEBALL_BLOCKED, BATTLE_ANIM_GFX_POKE_BALL
|
||||
; BATTLE_ANIM_OBJ_EXPLOSION1
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_EXPLOSION, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_EXPLOSION2
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_EXPLOSION, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_ACID
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_ACID, BATTLE_ANIM_FUNC_THROW_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_POISON
|
||||
; BATTLE_ANIM_OBJ_SLUDGE
|
||||
battleanimobj RELATIVE_X, $b4, BATTLE_ANIM_FRAMESET_SLUDGE_BUBBLE, BATTLE_ANIM_FUNC_SLUDGE, BATTLE_ANIM_GFX_POISON
|
||||
; BATTLE_ANIM_OBJ_BETA_BALL_POOF
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BALL_POOF, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SMOKE
|
||||
; BATTLE_ANIM_OBJ_BALL_POOF
|
||||
battleanimobj RELATIVE_X, $a0, BATTLE_ANIM_FRAMESET_BALL_POOF, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SMOKE
|
||||
; BATTLE_ANIM_OBJ_BIG_ROCK
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_BIG_ROCK, BATTLE_ANIM_FUNC_DROP, BATTLE_ANIM_GFX_ROCKS
|
||||
; BATTLE_ANIM_OBJ_SMALL_ROCK
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_SMALL_ROCK, BATTLE_ANIM_FUNC_DROP, BATTLE_ANIM_GFX_ROCKS
|
||||
; BATTLE_ANIM_OBJ_STRENGTH
|
||||
battleanimobj RELATIVE_X, $b0, BATTLE_ANIM_FRAMESET_STRENGTH, BATTLE_ANIM_FUNC_STRENGTH_SEISMIC_TOSS, BATTLE_ANIM_GFX_ROCKS
|
||||
; BATTLE_ANIM_OBJ_SEISMIC_TOSS
|
||||
battleanimobj RELATIVE_X, $b0, BATTLE_ANIM_FRAMESET_SEISMIC_TOSS, BATTLE_ANIM_FUNC_STRENGTH_SEISMIC_TOSS, BATTLE_ANIM_GFX_GLOBE
|
||||
; BATTLE_ANIM_OBJ_BUBBLE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SMALL_BUBBLE, BATTLE_ANIM_FUNC_BUBBLE, BATTLE_ANIM_GFX_BUBBLE
|
||||
; BATTLE_ANIM_OBJ_SURF
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_SURF, BATTLE_ANIM_FUNC_SURF, BATTLE_ANIM_GFX_BUBBLE
|
||||
; BATTLE_ANIM_OBJ_SING
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1, BATTLE_ANIM_FUNC_SING, BATTLE_ANIM_GFX_NOISE
|
||||
; BATTLE_ANIM_OBJ_WATER_GUN
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLE_ANIM_FRAMESET_WATER_GUN_1, BATTLE_ANIM_FUNC_WATER_GUN, BATTLE_ANIM_GFX_WATER
|
||||
; BATTLE_ANIM_OBJ_HYDRO_PUMP
|
||||
battleanimobj RELATIVE_X, $b4, BATTLE_ANIM_FRAMESET_HYDRO_PUMP, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_WATER
|
||||
; BATTLE_ANIM_OBJ_POWDER
|
||||
battleanimobj RELATIVE_X, $40, BATTLE_ANIM_FRAMESET_POWDER, BATTLE_ANIM_FUNC_POWDER, BATTLE_ANIM_GFX_POWDER
|
||||
; BATTLE_ANIM_OBJ_BEAM
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLE_ANIM_FRAMESET_BEAM, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_BEAM
|
||||
; BATTLE_ANIM_OBJ_BEAM_TIP
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $98, BATTLE_ANIM_FRAMESET_BEAM_TIP, BATTLE_ANIM_FUNC_SHAKE, BATTLE_ANIM_GFX_BEAM
|
||||
; BATTLE_ANIM_OBJ_ICE_BUILDUP
|
||||
battleanimobj RELATIVE_X, $b8, BATTLE_ANIM_FRAMESET_ICE_BUILDUP, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_FROZEN
|
||||
battleanimobj RELATIVE_X, $b8, BATTLE_ANIM_FRAMESET_FROZEN, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_MASTER_BALL_SPARKLE
|
||||
battleanimobj RELATIVE_X, $b8, BATTLE_ANIM_FRAMESET_CIRCLING_SPARKLE, BATTLE_ANIM_FUNC_RECOVER, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_RECOVER
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SMALL_BUBBLE, BATTLE_ANIM_FUNC_RECOVER, BATTLE_ANIM_GFX_BUBBLE
|
||||
; BATTLE_ANIM_OBJ_THUNDER_CENTER
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_THUNDER_CENTER, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDER_LEFT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_THUNDER_LEFT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDER_RIGHT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_THUNDER_RIGHT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDER_WAVE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDER_WAVE_DISABLE, BATTLE_ANIM_FUNC_THUNDER_WAVE, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDERBOLT_SPARKS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDERBOLT_SPARKS, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDERBOLT_CORE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDERBOLT_CORE, BATTLE_ANIM_FUNC_MOVE_IN_CIRCLE, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_THUNDERSHOCK_SPARKS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDERSHOCK_SPARKS, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_THUNDERSHOCK_CORE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDERSHOCK_CORE, BATTLE_ANIM_FUNC_MOVE_IN_CIRCLE, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_CLAMP
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_CLAMP, BATTLE_ANIM_FUNC_CLAMP_ENCORE, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_BITE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BITE_1, BATTLE_ANIM_FUNC_BITE, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CUT_DOWN_LEFT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CUT_DOWN_LEFT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CUT_DOWN_RIGHT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CUT_DOWN_RIGHT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CUT_UP_RIGHT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CUT_UP_RIGHT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CUT_LONG_DOWN_LEFT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CUT_LONG_DOWN_LEFT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CUT_LONG_DOWN_RIGHT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CUT_LONG_DOWN_RIGHT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_SOLAR_BEAM_CHARGE
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_CHARGE_ORB_1, BATTLE_ANIM_FUNC_SOLAR_BEAM, BATTLE_ANIM_GFX_CHARGE
|
||||
; BATTLE_ANIM_OBJ_ABSORB_CENTER
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_ABSORB_CENTER, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CHARGE
|
||||
; BATTLE_ANIM_OBJ_GUST
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLE_ANIM_FRAMESET_GUST, BATTLE_ANIM_FUNC_GUST, BATTLE_ANIM_GFX_WIND
|
||||
; BATTLE_ANIM_OBJ_VINE_WHIP1
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_VINE_WHIP_1, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_VINE_WHIP2
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_VINE_WHIP_2, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_RAZOR_WIND1
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_RAZOR_WIND_1, BATTLE_ANIM_FUNC_RAZOR_WIND, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_RAZOR_WIND2
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_RAZOR_WIND_2, BATTLE_ANIM_FUNC_RAZOR_WIND, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_SONICBOOM
|
||||
battleanimobj RELATIVE_X | X_FLIP, $98, BATTLE_ANIM_FRAMESET_SONICBOOM, BATTLE_ANIM_FUNC_USER_TO_TARGET, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_WARP
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_WARP, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_ABSORB
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_CHARGE_ORB_2, BATTLE_ANIM_FUNC_ABSORB, BATTLE_ANIM_GFX_CHARGE
|
||||
; BATTLE_ANIM_OBJ_EGG
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_EGG, BATTLE_ANIM_FUNC_EGG, BATTLE_ANIM_GFX_EGG
|
||||
; BATTLE_ANIM_OBJ_FOCUS
|
||||
battleanimobj RELATIVE_X, $b0, BATTLE_ANIM_FRAMESET_FOCUS, BATTLE_ANIM_FUNC_MOVE_UP, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_BIND1
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_BIND_1, BATTLE_ANIM_FUNC_WRAP, BATTLE_ANIM_GFX_ROPE
|
||||
; BATTLE_ANIM_OBJ_BIND2
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_BIND_3, BATTLE_ANIM_FUNC_WRAP, BATTLE_ANIM_GFX_ROPE
|
||||
; BATTLE_ANIM_OBJ_LEECH_SEED
|
||||
battleanimobj RELATIVE_X | X_FLIP, $68, BATTLE_ANIM_FRAMESET_LEECH_SEED_1, BATTLE_ANIM_FUNC_LEECH_SEED, BATTLE_ANIM_GFX_PLANT
|
||||
; BATTLE_ANIM_OBJ_SOUND
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_SOUND_1, BATTLE_ANIM_FUNC_SOUND, BATTLE_ANIM_GFX_NOISE
|
||||
; BATTLE_ANIM_OBJ_WAVE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_WAVE, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_PSYCHIC
|
||||
; BATTLE_ANIM_OBJ_CONFUSE_RAY
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_CONFUSE_RAY_1, BATTLE_ANIM_FUNC_CONFUSE_RAY, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_LEER
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLE_ANIM_FRAMESET_LEER, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_BEAM
|
||||
; BATTLE_ANIM_OBJ_LEER_TIP
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $88, BATTLE_ANIM_FRAMESET_BEAM_TIP, BATTLE_ANIM_FUNC_SHAKE, BATTLE_ANIM_GFX_BEAM
|
||||
; BATTLE_ANIM_OBJ_SCREEN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $88, BATTLE_ANIM_FRAMESET_REFLECT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_REFLECT
|
||||
; BATTLE_ANIM_OBJ_HARDEN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_REFLECT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_REFLECT
|
||||
; BATTLE_ANIM_OBJ_CHICK
|
||||
battleanimobj RELATIVE_X | X_FLIP, $50, BATTLE_ANIM_FRAMESET_CHICK_1, BATTLE_ANIM_FUNC_DIZZY, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_AMNESIA
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_AMNESIA_1, BATTLE_ANIM_FUNC_AMNESIA, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_ASLEEP
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_ASLEEP, BATTLE_ANIM_FUNC_FLOAT_UP, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_SKULL_CROSSBONE
|
||||
battleanimobj RELATIVE_X, $50, BATTLE_ANIM_FRAMESET_SKULL_CROSSBONE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_POISON
|
||||
; BATTLE_ANIM_OBJ_DIG_SAND
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLE_ANIM_FRAMESET_DIG_SAND, BATTLE_ANIM_FUNC_DIG, BATTLE_ANIM_GFX_SAND
|
||||
; BATTLE_ANIM_OBJ_DIG_PILE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLE_ANIM_FRAMESET_DIG_PILE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SAND
|
||||
; BATTLE_ANIM_OBJ_SAND
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_SAND, BATTLE_ANIM_FUNC_USER_TO_TARGET, BATTLE_ANIM_GFX_SAND
|
||||
; BATTLE_ANIM_OBJ_PARALYZED
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_PARALYZED, BATTLE_ANIM_FUNC_PARALYZED, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_STRING_SHOT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_STRING_SHOT_1, BATTLE_ANIM_FUNC_STRING, BATTLE_ANIM_GFX_WEB
|
||||
; BATTLE_ANIM_OBJ_HAZE
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_HAZE, BATTLE_ANIM_FUNC_SPIRAL_DESCENT, BATTLE_ANIM_GFX_HAZE
|
||||
; BATTLE_ANIM_OBJ_MIST
|
||||
battleanimobj RELATIVE_X | X_FLIP, $48, BATTLE_ANIM_FRAMESET_MIST, BATTLE_ANIM_FUNC_SPIRAL_DESCENT, BATTLE_ANIM_GFX_HAZE
|
||||
; BATTLE_ANIM_OBJ_SMOG
|
||||
battleanimobj RELATIVE_X | X_FLIP, $48, BATTLE_ANIM_FRAMESET_HAZE, BATTLE_ANIM_FUNC_SPIRAL_DESCENT, BATTLE_ANIM_GFX_HAZE
|
||||
; BATTLE_ANIM_OBJ_POISON_GAS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $78, BATTLE_ANIM_FRAMESET_HAZE, BATTLE_ANIM_FUNC_POISON_GAS, BATTLE_ANIM_GFX_HAZE
|
||||
; BATTLE_ANIM_OBJ_HORN
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLE_ANIM_FRAMESET_HORN, BATTLE_ANIM_FUNC_HORN, BATTLE_ANIM_GFX_HORN
|
||||
; BATTLE_ANIM_OBJ_NEEDLE
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLE_ANIM_FRAMESET_NEEDLE, BATTLE_ANIM_FUNC_NEEDLE, BATTLE_ANIM_GFX_HORN
|
||||
; BATTLE_ANIM_OBJ_PETAL_DANCE
|
||||
battleanimobj RELATIVE_X, $48, BATTLE_ANIM_FRAMESET_FLOWER, BATTLE_ANIM_FUNC_PETAL_DANCE, BATTLE_ANIM_GFX_FLOWER
|
||||
; BATTLE_ANIM_OBJ_SLUDGE_BOMB
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BARRAGE_BALL, BATTLE_ANIM_FUNC_THROW_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_EGG
|
||||
; BATTLE_ANIM_OBJ_PAY_DAY
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_PAY_DAY, BATTLE_ANIM_FUNC_THIEF_PAYDAY, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_COIN_HURL
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_PAY_DAY, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_MIMIC
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_CIRCLING_SPARKLE, BATTLE_ANIM_FUNC_ABSORB_CIRCLE, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_ATTRACT
|
||||
battleanimobj RELATIVE_X, $78, BATTLE_ANIM_FRAMESET_HEART, BATTLE_ANIM_FUNC_POISON_GAS, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_BONEMERANG
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_SPINNING_BONE, BATTLE_ANIM_FUNC_BONEMERANG, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_BONE_CLUB
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SPINNING_BONE, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_BONE_RUSH
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_SPINNING_BONE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_SWIFT
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_STAR, BATTLE_ANIM_FUNC_USER_TO_TARGET_SPIN, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_KINESIS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_SPOON, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_FLASH
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_SPARKLE, BATTLE_ANIM_FUNC_SHINY, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_SHINY
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_SPARKLE, BATTLE_ANIM_FUNC_SHINY, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_SKY_ATTACK
|
||||
battleanimobj RELATIVE_X | X_FLIP, $88, BATTLE_ANIM_FRAMESET_SKY_ATTACK, BATTLE_ANIM_FUNC_SKY_ATTACK, BATTLE_ANIM_GFX_SKY_ATTACK
|
||||
; BATTLE_ANIM_OBJ_LICK
|
||||
battleanimobj RELATIVE_X | X_FLIP, $98, BATTLE_ANIM_FRAMESET_LICK, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_WATER
|
||||
; BATTLE_ANIM_OBJ_WITHDRAW
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_WITHDRAW_SHELL, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_REFLECT
|
||||
; BATTLE_ANIM_OBJ_DRAIN
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_SMALL_BUBBLE, BATTLE_ANIM_FUNC_ABSORB_CIRCLE, BATTLE_ANIM_GFX_BUBBLE
|
||||
; BATTLE_ANIM_OBJ_GROWTH
|
||||
battleanimobj RELATIVE_X, $b0, BATTLE_ANIM_FRAMESET_SHRINKING_CHARGE_ORB, BATTLE_ANIM_FUNC_GROWTH_SWORDS_DANCE, BATTLE_ANIM_GFX_CHARGE
|
||||
; BATTLE_ANIM_OBJ_CONVERSION
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_CONVERSION, BATTLE_ANIM_FUNC_ABSORB_CIRCLE, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_SMOKE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLE_ANIM_FRAMESET_HAZE, BATTLE_ANIM_FUNC_SMOKE_FLAME_WHEEL, BATTLE_ANIM_GFX_HAZE
|
||||
; BATTLE_ANIM_OBJ_SMOKESCREEN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLE_ANIM_FRAMESET_BARRAGE_BALL, BATTLE_ANIM_FUNC_PRESENT_SMOKESCREEN, BATTLE_ANIM_GFX_EGG
|
||||
; BATTLE_ANIM_OBJ_SWORDS_DANCE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_SWORD, BATTLE_ANIM_FUNC_GROWTH_SWORDS_DANCE, BATTLE_ANIM_GFX_WHIP
|
||||
; BATTLE_ANIM_OBJ_SPEED_LINE
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_SPEED_LINE_1, BATTLE_ANIM_FUNC_SPEED_LINE, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_SHARPEN
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_SHARPEN, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SHAPES
|
||||
; BATTLE_ANIM_OBJ_DEFENSE_CURL
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_DEFENSE_CURL, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SHAPES
|
||||
; BATTLE_ANIM_OBJ_METRONOME_HAND
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_METRONOME_HAND, BATTLE_ANIM_FUNC_METRONOME_HAND, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_METRONOME_SPARKLE
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_CIRCLING_SPARKLE, BATTLE_ANIM_FUNC_METRONOME_SPARKLE_SKETCH, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_DISABLE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_THUNDER_WAVE_DISABLE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_AGILITY
|
||||
battleanimobj RELATIVE_X | X_FLIP | PRIORITY, $88, BATTLE_ANIM_FRAMESET_AGILITY, BATTLE_ANIM_FUNC_AGILITY, BATTLE_ANIM_GFX_WIND
|
||||
; BATTLE_ANIM_OBJ_HEART
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_HEART, BATTLE_ANIM_FUNC_FLOAT_UP, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_FLAME_WHEEL
|
||||
battleanimobj RELATIVE_X, $98, BATTLE_ANIM_FRAMESET_EMBER, BATTLE_ANIM_FUNC_SMOKE_FLAME_WHEEL, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_SACRED_FIRE
|
||||
battleanimobj RELATIVE_X, $a8, BATTLE_ANIM_FRAMESET_FLAMETHROWER, BATTLE_ANIM_FUNC_SACRED_FIRE, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_COTTON_SPORE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $68, BATTLE_ANIM_FRAMESET_COTTON, BATTLE_ANIM_FUNC_SPIRAL_DESCENT, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_MILK_DRINK
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b0, BATTLE_ANIM_FRAMESET_MILK_BOTTLE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_ANGER
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_ANGER_VEIN, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_BELL_CHIME
|
||||
battleanimobj RELATIVE_X | X_FLIP, $50, BATTLE_ANIM_FRAMESET_BELL_CHIME, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_BELL_CHIME_NOTE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $40, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1, BATTLE_ANIM_FUNC_BELL_CHIME_NOTES, BATTLE_ANIM_GFX_NOISE
|
||||
; BATTLE_ANIM_OBJ_BATON_PASS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a8, BATTLE_ANIM_FRAMESET_BATON_PASS, BATTLE_ANIM_FUNC_BATON_PASS, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_LOCK_ON
|
||||
battleanimobj RELATIVE_X | X_FLIP, $88, BATTLE_ANIM_FRAMESET_LOCK_ON_1, BATTLE_ANIM_FUNC_LOCK_ON_MIND_READER, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_MIND_READER
|
||||
battleanimobj RELATIVE_X | X_FLIP, $88, BATTLE_ANIM_FRAMESET_MIND_READER_1, BATTLE_ANIM_FUNC_LOCK_ON_MIND_READER, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_SAFEGUARD
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_SAFEGUARD, BATTLE_ANIM_FUNC_SAFEGUARD_PROTECT, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_MEGAPHONE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_MEGAPHONE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_PROTECT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_STAR, BATTLE_ANIM_FUNC_SAFEGUARD_PROTECT, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_THIEF
|
||||
battleanimobj RELATIVE_X, $ff, BATTLE_ANIM_FRAMESET_ITEM_BAG, BATTLE_ANIM_FUNC_THIEF_PAYDAY, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_OCTAZOOKA
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLE_ANIM_FRAMESET_BARRAGE_BALL, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_EGG
|
||||
; BATTLE_ANIM_OBJ_PRESENT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLE_ANIM_FRAMESET_ITEM_BAG, BATTLE_ANIM_FUNC_PRESENT_SMOKESCREEN, BATTLE_ANIM_GFX_STATUS
|
||||
; BATTLE_ANIM_OBJ_SPIKES
|
||||
battleanimobj RELATIVE_X | X_FLIP, $70, BATTLE_ANIM_FRAMESET_SPIKE, BATTLE_ANIM_FUNC_SPIKES, BATTLE_ANIM_GFX_MISC
|
||||
; BATTLE_ANIM_OBJ_POWDER_SNOW
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_POWDER_SNOW, BATTLE_ANIM_FUNC_USER_TO_TARGET_SPIN, BATTLE_ANIM_GFX_ICE
|
||||
; BATTLE_ANIM_OBJ_DRAGONBREATH
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_BURNED, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_FIRE
|
||||
; BATTLE_ANIM_OBJ_CONVERSION2
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_CONVERSION, BATTLE_ANIM_FUNC_CONVERSION2, BATTLE_ANIM_GFX_EXPLOSION
|
||||
; BATTLE_ANIM_OBJ_SPIDER_WEB
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_SPIDER_WEB, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_WEB
|
||||
; BATTLE_ANIM_OBJ_CAKE_TEMPT
|
||||
battleanimobj RELATIVE_X | X_FLIP, $a0, BATTLE_ANIM_FRAMESET_TEMPT_CAKE, BATTLE_ANIM_FUNC_PRESENT_SMOKESCREEN, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_NIGHTMARE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_IMP, BATTLE_ANIM_FUNC_DIZZY, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_IN_NIGHTMARE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_IMP_FLIPPED, BATTLE_ANIM_FUNC_FLOAT_UP, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_LOVELY_KISS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_IMP, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_SWEET_KISS
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_CHERUB, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_SKETCH
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $80, BATTLE_ANIM_FRAMESET_PENCIL, BATTLE_ANIM_FUNC_METRONOME_SPARKLE_SKETCH, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_ENCORE_HAND
|
||||
battleanimobj RELATIVE_X | X_FLIP, $80, BATTLE_ANIM_FRAMESET_ENCORE_HAND, BATTLE_ANIM_FUNC_CLAMP_ENCORE, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_ENCORE_STAR
|
||||
battleanimobj RELATIVE_X | X_FLIP, $70, BATTLE_ANIM_FRAMESET_STAR, BATTLE_ANIM_FUNC_ENCORE_BELLY_DRUM, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_DESTINY_BOND
|
||||
battleanimobj RELATIVE_X | X_FLIP, $c0, BATTLE_ANIM_FRAMESET_DESTINY_BOND, BATTLE_ANIM_FUNC_USER_TO_TARGET, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_MORNING_SUN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $40, BATTLE_ANIM_FRAMESET_MORNING_SUN, BATTLE_ANIM_FUNC_SWAGGER_MORNING_SUN, BATTLE_ANIM_GFX_SHINE
|
||||
; BATTLE_ANIM_OBJ_GLIMMER
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_GLIMMER, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SHINE
|
||||
; BATTLE_ANIM_OBJ_MOONLIGHT
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_MOONLIGHT, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SHINE
|
||||
; BATTLE_ANIM_OBJ_HIDDEN_POWER
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_CHARGE_ORB_1, BATTLE_ANIM_FUNC_HIDDEN_POWER, BATTLE_ANIM_GFX_CHARGE
|
||||
; BATTLE_ANIM_OBJ_CROSS_CUTTER1
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CROSS_CUTTER_1, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_CROSS_CUTTER2
|
||||
battleanimobj RELATIVE_X | X_FLIP, $ff, BATTLE_ANIM_FRAMESET_CROSS_CUTTER_2, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_CUT
|
||||
; BATTLE_ANIM_OBJ_SANDSTORM
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_POWDER, BATTLE_ANIM_FUNC_USER_TO_TARGET_SPIN, BATTLE_ANIM_GFX_POWDER
|
||||
; BATTLE_ANIM_OBJ_ZAP_CANNON
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_ZAP_CANNON, BATTLE_ANIM_FUNC_USER_TO_TARGET_DISAPPEAR, BATTLE_ANIM_GFX_LIGHTNING
|
||||
; BATTLE_ANIM_OBJ_SPITE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $40, BATTLE_ANIM_FRAMESET_IMP, BATTLE_ANIM_FUNC_POWDER, BATTLE_ANIM_GFX_ANGELS
|
||||
; BATTLE_ANIM_OBJ_NAIL_DOWN
|
||||
battleanimobj RELATIVE_X | X_FLIP | Y_FLIP, $90, BATTLE_ANIM_FRAMESET_NAIL_DOWN, BATTLE_ANIM_FUNC_NAIL_DOWN, BATTLE_ANIM_GFX_OBJECTS
|
||||
; BATTLE_ANIM_OBJ_PERISH_SONG
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1, BATTLE_ANIM_FUNC_PERISH_SONG, BATTLE_ANIM_GFX_NOISE
|
||||
; BATTLE_ANIM_OBJ_FORESIGHT
|
||||
battleanimobj RELATIVE_X, $80, BATTLE_ANIM_FRAMESET_FORESIGHT_SHINE, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_SHINE
|
||||
; BATTLE_ANIM_OBJ_RAPID_SPIN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $b8, BATTLE_ANIM_FRAMESET_RAPID_SPIN, BATTLE_ANIM_FUNC_RAPID_SPIN, BATTLE_ANIM_GFX_WIND
|
||||
; BATTLE_ANIM_OBJ_SWAGGER
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_SWAGGER, BATTLE_ANIM_FUNC_SWAGGER_MORNING_SUN, BATTLE_ANIM_GFX_WIND
|
||||
; BATTLE_ANIM_OBJ_BELLY_DRUM_HAND
|
||||
battleanimobj RELATIVE_X, $a8, BATTLE_ANIM_FRAMESET_PALM, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_BELLY_DRUM_NOTE
|
||||
battleanimobj RELATIVE_X, $90, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1, BATTLE_ANIM_FUNC_ENCORE_BELLY_DRUM, BATTLE_ANIM_GFX_NOISE
|
||||
; BATTLE_ANIM_OBJ_STALKER
|
||||
battleanimobj RELATIVE_X, $88, BATTLE_ANIM_FRAMESET_STALKER, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_PSYCHIC
|
||||
; BATTLE_ANIM_OBJ_BETA_PURSUIT
|
||||
battleanimobj RELATIVE_X, $a8, BATTLE_ANIM_FRAMESET_UPSIDE_DOWN_PUNCH, BATTLE_ANIM_FUNC_BETA_PURSUIT, BATTLE_ANIM_GFX_HIT
|
||||
; BATTLE_ANIM_OBJ_SHOOTING_SPARKLE
|
||||
battleanimobj RELATIVE_X | X_FLIP, $90, BATTLE_ANIM_FRAMESET_GROWING_SPARKLE, BATTLE_ANIM_FUNC_USER_TO_TARGET, BATTLE_ANIM_GFX_SPEED
|
||||
; BATTLE_ANIM_OBJ_RAIN
|
||||
battleanimobj RELATIVE_X | X_FLIP, $00, BATTLE_ANIM_FRAMESET_RAIN_1, BATTLE_ANIM_FUNC_RAIN, BATTLE_ANIM_GFX_WATER
|
||||
; BATTLE_ANIM_OBJ_ENEMYFEET_1ROW
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_ENEMYFEET_1ROW, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_PLAYERHEAD
|
||||
; BATTLE_ANIM_OBJ_PLAYERHEAD_1ROW
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_PLAYERHEAD_1ROW, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ENEMYFEET
|
||||
; BATTLE_ANIM_OBJ_ENEMYFEET_2ROW
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_ENEMYFEET_2ROW, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_PLAYERHEAD
|
||||
; BATTLE_ANIM_OBJ_PLAYERHEAD_2ROW
|
||||
battleanimobj ABSOLUTE_X, $00, BATTLE_ANIM_FRAMESET_PLAYERHEAD_2ROW, BATTLE_ANIM_FUNC_NULL, BATTLE_ANIM_GFX_ENEMYFEET
|
||||
assert_table_length NUM_BATTLE_ANIM_OBJS
|
||||
4617
data/moves/animations.asm
Normal file
|
|
@ -51,8 +51,8 @@ GiveItemPredef::
|
|||
add_predef Function3e1a4
|
||||
add_predef Function3ef19
|
||||
add_predef CalcAndPlaceExpBar
|
||||
add_predef Function3e91e
|
||||
add_predef Function3e963 ; 28
|
||||
add_predef GetBattleMonBackpic
|
||||
add_predef GetEnemyMonFrontpic ; 28
|
||||
add_predef Function421f8
|
||||
add_predef FillMoves
|
||||
add_predef Function41fa1
|
||||
|
|
@ -63,7 +63,7 @@ GiveItemPredef::
|
|||
add_predef ConvertMon_1to2 ; 30
|
||||
add_predef CopyMonToTempMon
|
||||
add_predef ListMoves
|
||||
add_predef Function50bcd
|
||||
add_predef GetMonBackpic
|
||||
add_predef PlaceNonFaintStatus
|
||||
add_predef Function508c4
|
||||
add_predef PartyMenuInBattle_Setup
|
||||
|
|
@ -78,9 +78,9 @@ GiveItemPredef::
|
|||
add_predef PrintMoveType
|
||||
add_predef PrintMonTypes ; 40
|
||||
add_predef GetUnownLetter
|
||||
add_predef Functioncb6ff
|
||||
add_predef Functioncb710
|
||||
add_predef Functioncb733
|
||||
add_predef ChangeBGPalColor0_4Frames
|
||||
add_predef PredefShakeScreenVertically
|
||||
add_predef PredefShakeScreenHorizontally
|
||||
add_predef Function145b8
|
||||
add_predef Function146dc
|
||||
add_predef Function145de
|
||||
|
|
|
|||
1095
engine/battle_anims/anim_commands.asm
Normal file
308
engine/battle_anims/core.asm
Normal file
|
|
@ -0,0 +1,308 @@
|
|||
INCLUDE "constants.asm"
|
||||
|
||||
SECTION "engine/dumps/bank33.asm", ROMX
|
||||
|
||||
QueueBattleAnimation:
|
||||
ld hl, wActiveAnimObjects
|
||||
ld e, NUM_BATTLE_ANIM_STRUCTS
|
||||
.loop
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .done
|
||||
ld bc, BATTLEANIMSTRUCT_LENGTH
|
||||
add hl, bc
|
||||
dec e
|
||||
jr nz, .loop
|
||||
scf
|
||||
ret
|
||||
|
||||
.done
|
||||
ld c, l
|
||||
ld b, h
|
||||
ld hl, wLastAnimObjectIndex
|
||||
inc [hl]
|
||||
call InitBattleAnimation
|
||||
ret
|
||||
|
||||
DeinitBattleAnimation:
|
||||
ld hl, BATTLEANIMSTRUCT_INDEX
|
||||
add hl, bc
|
||||
ld [hl], $0
|
||||
ret
|
||||
|
||||
InitBattleAnimation:
|
||||
ld a, [wBattleObjectTempID]
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, BattleAnimObjects
|
||||
rept BATTLEANIMOBJ_LENGTH
|
||||
add hl, de
|
||||
endr
|
||||
ld e, l
|
||||
ld d, h
|
||||
ld hl, BATTLEANIMSTRUCT_INDEX
|
||||
add hl, bc
|
||||
ld a, [wLastAnimObjectIndex]
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_INDEX
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_OAMFLAGS
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_FIX_Y
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_FRAMESET_ID
|
||||
ld a, [de]
|
||||
inc de
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_FUNCTION
|
||||
ld a, [de]
|
||||
call GetBattleAnimTileOffset
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_TILEID
|
||||
ld a, [wBattleObjectTempXCoord]
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_XCOORD
|
||||
ld a, [wBattleObjectTempYCoord]
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_YCOORD
|
||||
xor a
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_XOFFSET
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_YOFFSET
|
||||
ld a, [wBattleObjectTempParam]
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_PARAM
|
||||
xor a
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_DURATION
|
||||
dec a
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_FRAME
|
||||
xor a
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_JUMPTABLE_INDEX
|
||||
ld [hli], a ; BATTLEANIMSTRUCT_VAR1
|
||||
ld [hl], a ; BATTLEANIMSTRUCT_VAR2
|
||||
ret
|
||||
|
||||
BattleAnimOAMUpdate:
|
||||
call InitBattleAnimBuffer
|
||||
call GetBattleAnimFrame
|
||||
cp oamwait_command
|
||||
jr z, .done
|
||||
cp oamdelete_command
|
||||
jr z, .delete
|
||||
|
||||
push af
|
||||
ld hl, wBattleAnimTempOAMFlags
|
||||
ld a, [wBattleAnimTempFrameOAMFlags]
|
||||
xor [hl]
|
||||
and PRIORITY | Y_FLIP | X_FLIP
|
||||
ld [hl], a
|
||||
pop af
|
||||
|
||||
push bc
|
||||
call GetBattleAnimOAMPointer
|
||||
ld a, [wBattleAnimTempTileID]
|
||||
add [hl] ; tile offset
|
||||
ld [wBattleAnimTempTileID], a
|
||||
inc hl
|
||||
ld a, [hli] ; oam data length
|
||||
ld c, a
|
||||
ld a, [hli] ; oam data pointer
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld a, [wBattleAnimOAMPointerLo]
|
||||
ld e, a
|
||||
ld d, HIGH(wShadowOAM)
|
||||
|
||||
.loop
|
||||
; Y Coord
|
||||
ld a, [wBattleAnimTempYCoord]
|
||||
ld b, a
|
||||
ld a, [wBattleAnimTempYOffset]
|
||||
add b
|
||||
ld b, a
|
||||
call .XFlip
|
||||
add b
|
||||
ld [de], a
|
||||
|
||||
; X Coord
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [wBattleAnimTempXCoord]
|
||||
ld b, a
|
||||
ld a, [wBattleAnimTempXOffset]
|
||||
add b
|
||||
ld b, a
|
||||
call .YFlip
|
||||
add b
|
||||
ld [de], a
|
||||
|
||||
; Tile ID
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [wBattleAnimTempTileID]
|
||||
add BATTLEANIM_BASE_TILE
|
||||
add [hl]
|
||||
ld [de], a
|
||||
|
||||
; Attributes
|
||||
inc hl
|
||||
inc de
|
||||
call .UpdateAttributes
|
||||
ld [de], a
|
||||
|
||||
inc hl
|
||||
inc de
|
||||
ld a, e
|
||||
ld [wBattleAnimOAMPointerLo], a
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .exit_set_carry
|
||||
dec c
|
||||
jr nz, .loop
|
||||
pop bc
|
||||
jr .done
|
||||
|
||||
.delete
|
||||
call DeinitBattleAnimation
|
||||
|
||||
.done
|
||||
and a
|
||||
ret
|
||||
|
||||
.exit_set_carry
|
||||
pop bc
|
||||
scf
|
||||
ret
|
||||
|
||||
; This and the other two subroutines below it are kind of pointless to have as subroutines,
|
||||
; as they only get run once... which is likely why they were merged into the main function in the final game.
|
||||
.XFlip:
|
||||
push hl
|
||||
ld a, [hl]
|
||||
ld hl, wBattleAnimTempOAMFlags
|
||||
bit OAM_Y_FLIP, [hl]
|
||||
jr z, .no_yflip
|
||||
add $8
|
||||
xor $ff
|
||||
inc a
|
||||
.no_yflip
|
||||
pop hl
|
||||
ret
|
||||
|
||||
.YFlip:
|
||||
push hl
|
||||
ld a, [hl]
|
||||
ld hl, wBattleAnimTempOAMFlags
|
||||
bit OAM_X_FLIP, [hl]
|
||||
jr z, .no_xflip
|
||||
add $8
|
||||
xor $ff
|
||||
inc a
|
||||
.no_xflip
|
||||
pop hl
|
||||
ret
|
||||
|
||||
.UpdateAttributes:
|
||||
ld a, [wBattleAnimTempOAMFlags]
|
||||
ld b, a
|
||||
ld a, [hl]
|
||||
xor b
|
||||
and PRIORITY | Y_FLIP | X_FLIP
|
||||
ld b, a
|
||||
ld a, [hl]
|
||||
and OBP_NUM
|
||||
or b
|
||||
ret
|
||||
|
||||
InitBattleAnimBuffer:
|
||||
ld hl, BATTLEANIMSTRUCT_OAMFLAGS
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
|
||||
and PRIORITY
|
||||
ld [wBattleAnimTempOAMFlags], a
|
||||
xor a
|
||||
ld [wBattleAnimTempFrameOAMFlags], a
|
||||
ld hl, BATTLEANIMSTRUCT_FIX_Y
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wBattleAnimTempFixY], a
|
||||
ld hl, BATTLEANIMSTRUCT_TILEID
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld [wBattleAnimTempTileID], a
|
||||
ld a, [hli]
|
||||
ld [wBattleAnimTempXCoord], a
|
||||
ld a, [hli]
|
||||
ld [wBattleAnimTempYCoord], a
|
||||
ld a, [hli]
|
||||
ld [wBattleAnimTempXOffset], a
|
||||
ld a, [hli]
|
||||
ld [wBattleAnimTempYOffset], a
|
||||
|
||||
ldh a, [hBattleTurn]
|
||||
and a
|
||||
ret z
|
||||
|
||||
ld hl, BATTLEANIMSTRUCT_OAMFLAGS
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wBattleAnimTempOAMFlags], a
|
||||
bit BATTLEANIMSTRUCT_OAMFLAGS_FIX_COORDS_F, [hl]
|
||||
ret z
|
||||
|
||||
ld hl, BATTLEANIMSTRUCT_XCOORD
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld d, a
|
||||
ld a, (-10 * TILE_WIDTH) + 4
|
||||
sub d
|
||||
ld [wBattleAnimTempXCoord], a
|
||||
ld a, [hli]
|
||||
ld d, a
|
||||
ld a, [wBattleAnimTempFixY]
|
||||
cp $ff
|
||||
jr nz, .check_kinesis_softboiled_milkdrink
|
||||
|
||||
ld a, 5 * TILE_WIDTH
|
||||
add d
|
||||
jr .done
|
||||
|
||||
; The changes for these animations were seemingly expanded upon for the final game
|
||||
.check_kinesis_softboiled_milkdrink
|
||||
sub d
|
||||
.done
|
||||
ld [wBattleAnimTempYCoord], a
|
||||
ld a, [hli]
|
||||
xor $ff
|
||||
inc a
|
||||
ld [wBattleAnimTempXOffset], a
|
||||
ret
|
||||
|
||||
GetBattleAnimTileOffset:
|
||||
push hl
|
||||
push bc
|
||||
ld hl, wBattleAnimTileDict
|
||||
ld b, a
|
||||
ld c, NUM_BATTLEANIMTILEDICT_ENTRIES
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr z, .load
|
||||
inc hl
|
||||
dec c
|
||||
jr nz, .loop
|
||||
xor a
|
||||
jr .done
|
||||
|
||||
.load
|
||||
ld a, [hl]
|
||||
.done
|
||||
pop bc
|
||||
pop hl
|
||||
ret
|
||||
|
||||
_ExecuteBGEffects:
|
||||
callfar ExecuteBGEffects
|
||||
ret
|
||||
|
||||
_QueueBGEffect:
|
||||
callfar QueueBGEffect
|
||||
ret
|
||||
|
||||
INCLUDE "data/battle_anims/objects.inc"
|
||||
4208
engine/battle_anims/functions.asm
Normal file
|
|
@ -19,7 +19,7 @@ FieldDebug_PokemonFollowing:
|
|||
and a
|
||||
jr nz, .ShowUnableText
|
||||
callfar SpawnFollower
|
||||
ld de, SFX_24
|
||||
ld de, SFX_BALL_POOF
|
||||
call PlaySFX
|
||||
call CloseWindow
|
||||
call UpdateSprites
|
||||
|
|
@ -28,7 +28,7 @@ FieldDebug_PokemonFollowing:
|
|||
|
||||
.remove
|
||||
callfar DeleteFollower
|
||||
ld de, SFX_25
|
||||
ld de, SFX_FAINT
|
||||
call PlaySFX
|
||||
jr .done
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ FieldDebug_NPCMovementTest:
|
|||
ld a, 2
|
||||
ld hl, .MovementData
|
||||
call LoadMovementDataPointer
|
||||
ld de, SFX_22
|
||||
ld de, SFX_SAFARI_ZONE_PA
|
||||
call PlaySFX
|
||||
scf
|
||||
ret
|
||||
|
|
@ -42,7 +42,7 @@ FieldDebug_NPCMovementTest:
|
|||
db MOVEMENT_32
|
||||
|
||||
.not_here
|
||||
ld de, SFX_1E
|
||||
ld de, SFX_COLLISION
|
||||
call PlaySFX
|
||||
ld hl, .NotHereText
|
||||
call FieldDebug_ShowTextboxAndExit
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ FieldDebug_Warp:
|
|||
ldh a, [hROMBank]
|
||||
ld hl, FieldDebug_ShowWarpToText
|
||||
call QueueScript
|
||||
ld de, SFX_22
|
||||
ld de, SFX_SAFARI_ZONE_PA
|
||||
call PlaySFX
|
||||
call DelayFrame
|
||||
ld a, FIELDDEBUG_RETURN_EXIT
|
||||
|
|
|
|||
|
|
@ -3006,7 +3006,7 @@ PokeBallEffect:
|
|||
|
||||
.room_in_party
|
||||
xor a
|
||||
ld [wce35], a
|
||||
ld [wWildMon], a
|
||||
call ReturnToBattle_UseBall
|
||||
|
||||
ld hl, ItemUsedText
|
||||
|
|
@ -3138,7 +3138,7 @@ PokeBallEffect:
|
|||
.sub_e9d6
|
||||
ld a, [wEnemyMonSpecies]
|
||||
.sub_e9d9
|
||||
ld [wce35], a
|
||||
ld [wWildMon], a
|
||||
ld c, $14
|
||||
call DelayFrames
|
||||
ld a, [wCurItem]
|
||||
|
|
@ -3153,7 +3153,7 @@ PokeBallEffect:
|
|||
ld [wMapBlocksAddress], a
|
||||
ld [wNumHits], a
|
||||
predef PlayBattleAnim
|
||||
ld a, [wce35]
|
||||
ld a, [wWildMon]
|
||||
and a
|
||||
jr nz, .sub_ea29
|
||||
ld a, [wMapBlocksAddress]
|
||||
|
|
@ -3216,7 +3216,7 @@ PokeBallEffect:
|
|||
pop af
|
||||
ld [hl], a
|
||||
ld a, [wEnemyMonSpecies]
|
||||
ld [wce35], a
|
||||
ld [wWildMon], a
|
||||
ld [wCurPartySpecies], a
|
||||
ld [wce37], a
|
||||
ld a, [wce03]
|
||||
|
|
@ -5444,66 +5444,74 @@ Breeder_EggLaidText:
|
|||
Functionfd45:
|
||||
ret
|
||||
|
||||
Functionfd46:
|
||||
ld a, [wMapBlocksAddress]
|
||||
GetPokeBallWobble:
|
||||
; Returns whether a Poke Ball will wobble in the catch animation.
|
||||
; Whether a Pokemon is caught is determined beforehand.
|
||||
|
||||
ld a, [wThrownBallWobbleCount]
|
||||
inc a
|
||||
ld [wMapBlocksAddress], a
|
||||
cp $04
|
||||
jr z, .sub_fd71
|
||||
ld a, [wce35]
|
||||
ld [wThrownBallWobbleCount], a
|
||||
|
||||
; Wobble up to 3 times.
|
||||
cp 3 + 1
|
||||
jr z, .finished
|
||||
ld a, [wWildMon]
|
||||
and a
|
||||
ld c, $00
|
||||
ld c, 0 ; next
|
||||
ret nz
|
||||
ld hl, Datafd7b
|
||||
ld a, [wFieldMoveScriptID]
|
||||
ld hl, WobbleProbabilities
|
||||
ld a, [wFinalCatchRate]
|
||||
ld b, a
|
||||
.sub_fd5f
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr nc, .sub_fd66
|
||||
jr nc, .checkwobble
|
||||
inc hl
|
||||
jr .sub_fd5f
|
||||
.sub_fd66
|
||||
jr .loop
|
||||
.checkwobble
|
||||
ld b, [hl]
|
||||
call Random
|
||||
cp b
|
||||
ld c, $00
|
||||
ld c, 0 ; next
|
||||
ret c
|
||||
ld c, $02
|
||||
ret
|
||||
.sub_fd71
|
||||
ld a, [wce35]
|
||||
and a
|
||||
ld c, $01
|
||||
ret nz
|
||||
ld c, $02
|
||||
ld c, 2 ; escaped
|
||||
ret
|
||||
|
||||
Datafd7b:
|
||||
db $01, $3f
|
||||
db $02, $4b
|
||||
db $03, $54
|
||||
db $04, $5a
|
||||
db $05, $5f
|
||||
db $07, $67
|
||||
db $0a, $71
|
||||
db $0f, $7e
|
||||
db $14, $86
|
||||
db $1e, $95
|
||||
db $28, $a0
|
||||
db $32, $a9
|
||||
db $3c, $b1
|
||||
db $50, $bf
|
||||
db $64, $c9
|
||||
db $78, $d3
|
||||
db $8c, $dc
|
||||
db $a0, $e3
|
||||
db $b4, $ea
|
||||
db $c8, $f0
|
||||
db $dc, $f6
|
||||
db $f0, $fb
|
||||
db $fe, $fd
|
||||
db $ff, $ff
|
||||
.finished
|
||||
ld a, [wWildMon]
|
||||
and a
|
||||
ld c, 1 ; caught
|
||||
ret nz
|
||||
ld c, 2 ; escaped
|
||||
ret
|
||||
|
||||
WobbleProbabilities:
|
||||
; catch rate, chance of wobbling / 255
|
||||
; nLeft/255 = (nRight/255) ** 4
|
||||
db 1, 63
|
||||
db 2, 75
|
||||
db 3, 84
|
||||
db 4, 90
|
||||
db 5, 95
|
||||
db 7, 103
|
||||
db 10, 113
|
||||
db 15, 126
|
||||
db 20, 134
|
||||
db 30, 149
|
||||
db 40, 160
|
||||
db 50, 169
|
||||
db 60, 177
|
||||
db 80, 191
|
||||
db 100, 201
|
||||
db 120, 211
|
||||
db 140, 220
|
||||
db 160, 227
|
||||
db 180, 234
|
||||
db 200, 240
|
||||
db 220, 246
|
||||
db 240, 251
|
||||
db 254, 253
|
||||
db 255, 255
|
||||
|
||||
Functionfdab:
|
||||
ld a, $02
|
||||
|
|
|
|||
|
|
@ -2261,6 +2261,7 @@ BattleCommand_MoveAnim:
|
|||
and a
|
||||
jp nz, BattleCommand_MoveDelay
|
||||
|
||||
assert BATTLEANIM_NONE + 1 == BATTLEANIM_DAMAGE
|
||||
inc a
|
||||
ld [wNumHits], a
|
||||
ldh a, [hBattleTurn]
|
||||
|
|
@ -7435,9 +7436,11 @@ BattleCommand_Selfdestruct:
|
|||
ld de, wEnemySubStatus4
|
||||
|
||||
.ok
|
||||
; BUG: hl is increased one too many times, causing only the lower byte of the user's current HP to be zeroed out,
|
||||
; and incorrectly zeroing the high byte of the user's max HP.
|
||||
xor a
|
||||
ld [hli], a
|
||||
ld [hli], a
|
||||
ld [hli], a ; Without this line, the bug wouldn't happen. This byte isn't even used in normal gameplay (wPartyMon#Unused)
|
||||
inc hl
|
||||
ld [hli], a
|
||||
ld [hl], a
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ asm_3c132:
|
|||
|
||||
asm_3c14a:
|
||||
call PrintText
|
||||
ld de, $26
|
||||
ld de, SFX_RUN
|
||||
call PlaySFX
|
||||
xor a
|
||||
ldh [hBattleTurn], a
|
||||
|
|
@ -571,11 +571,11 @@ asm_3c4a3:
|
|||
and $18
|
||||
jr z, asm_3c4eb
|
||||
ld hl, HurtByPoisonText
|
||||
ld de, $0106
|
||||
ld de, ANIM_PSN
|
||||
and $10
|
||||
jr z, asm_3c4b8
|
||||
ld hl, HurtByBurnText
|
||||
ld de, $0105
|
||||
ld de, ANIM_BRN
|
||||
|
||||
asm_3c4b8:
|
||||
push de
|
||||
|
|
@ -627,7 +627,7 @@ asm_3c4f6:
|
|||
ldh [hBattleTurn], a
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld de, $0107
|
||||
ld de, ANIM_SAP
|
||||
call PlayMoveAnimation
|
||||
pop af
|
||||
ldh [hBattleTurn], a
|
||||
|
|
@ -649,7 +649,7 @@ asm_3c528:
|
|||
jr z, asm_3c542
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld de, $010c
|
||||
ld de, ANIM_IN_NIGHTMARE
|
||||
call PlayMoveAnimation
|
||||
call GetQuarterMaxHP
|
||||
call SubtractHPFromUser
|
||||
|
|
@ -668,7 +668,7 @@ asm_3c54d:
|
|||
jr z, asm_3c567
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld de, $010c
|
||||
ld de, ANIM_IN_NIGHTMARE
|
||||
call PlayMoveAnimation
|
||||
call GetQuarterMaxHP
|
||||
call SubtractHPFromUser
|
||||
|
|
@ -691,7 +691,7 @@ asm_3c572:
|
|||
ldh [hBattleTurn], a
|
||||
xor a
|
||||
ld [wNumHits], a
|
||||
ld de, $010b
|
||||
ld de, ANIM_IN_SANDSTORM
|
||||
call PlayMoveAnimation
|
||||
pop af
|
||||
ldh [hBattleTurn], a
|
||||
|
|
@ -1212,12 +1212,12 @@ asm_3c8e2:
|
|||
dec a
|
||||
jr z, asm_3c935
|
||||
push de
|
||||
ld de, $33
|
||||
ld de, SFX_KINESIS
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
pop de
|
||||
push de
|
||||
ld de, $25
|
||||
ld de, SFX_FAINT
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
pop de
|
||||
|
|
@ -2356,7 +2356,7 @@ TryRunningFromBattle:
|
|||
.play_sound
|
||||
ld [wcd5d], a
|
||||
push de
|
||||
ld de, $26
|
||||
ld de, SFX_RUN
|
||||
call WaitPlaySFX
|
||||
pop de
|
||||
call WaitSFX
|
||||
|
|
@ -3175,7 +3175,7 @@ BattleMenu_Pack:
|
|||
ld a, 1
|
||||
ld [wMenuCursorY], a
|
||||
call sub_3d832
|
||||
ld a, [wce35]
|
||||
ld a, [wWildMon]
|
||||
and a
|
||||
jr nz, .asm_3d7eb
|
||||
call CloseWindow
|
||||
|
|
@ -3189,7 +3189,7 @@ BattleMenu_Pack:
|
|||
|
||||
.asm_3d7eb
|
||||
xor a
|
||||
ld [wce35], a
|
||||
ld [wWildMon], a
|
||||
ld a, 2
|
||||
ld [wcd5d], a
|
||||
call ClearWindowData
|
||||
|
|
@ -5653,15 +5653,17 @@ CalcAndPlaceExpBar:
|
|||
.finish
|
||||
ret
|
||||
|
||||
Function3e91e:
|
||||
GetBattleMonBackpic:
|
||||
ld a, [wPlayerSubStatus4]
|
||||
bit SUBSTATUS_SUBSTITUTE, a
|
||||
ld hl, Functioncc44f
|
||||
jr nz, asm_3e954
|
||||
ld hl, BattleAnimCmd_RaiseSub
|
||||
jr nz, GetBattleMonBackpic_DoAnim
|
||||
|
||||
DropPlayerSub:
|
||||
ld a, [wPlayerMinimized]
|
||||
and a
|
||||
ld hl, Functioncc4d4
|
||||
jr nz, asm_3e954
|
||||
ld hl, BattleAnimCmd_MinimizeOpp
|
||||
jr nz, GetBattleMonBackpic_DoAnim
|
||||
ld a, [wCurPartySpecies]
|
||||
push af
|
||||
ld a, [wBattleMonSpecies]
|
||||
|
|
@ -5670,32 +5672,34 @@ Function3e91e:
|
|||
call GetBaseData
|
||||
ld hl, wMonHBackSprite - wMonHeader
|
||||
call UncompressMonSprite
|
||||
ld hl, $9310
|
||||
predef Function50bcd
|
||||
ld hl, vBackPic
|
||||
predef GetMonBackpic
|
||||
pop af
|
||||
ld [wCurPartySpecies], a
|
||||
ret
|
||||
|
||||
asm_3e954:
|
||||
GetBattleMonBackpic_DoAnim:
|
||||
ldh a, [hBattleTurn]
|
||||
push af
|
||||
xor a
|
||||
ldh [hBattleTurn], a
|
||||
ld a, BANK(Functioncc44f)
|
||||
ld a, BANK(BattleAnimCmd_RaiseSub)
|
||||
call FarCall_hl
|
||||
pop af
|
||||
ldh [hBattleTurn], a
|
||||
ret
|
||||
|
||||
Function3e963:
|
||||
GetEnemyMonFrontpic:
|
||||
ld a, [wEnemySubStatus4]
|
||||
bit 4, a
|
||||
ld hl, Functioncc44f
|
||||
jr nz, asm_3e999
|
||||
bit SUBSTATUS_SUBSTITUTE, a
|
||||
ld hl, BattleAnimCmd_RaiseSub
|
||||
jr nz, GetEnemyMonFrontpic_DoAnim
|
||||
|
||||
DropEnemySub:
|
||||
ld a, [wEnemyMinimized]
|
||||
and a
|
||||
ld hl, Functioncc4d4
|
||||
jr nz, asm_3e999
|
||||
ld hl, BattleAnimCmd_MinimizeOpp
|
||||
jr nz, GetEnemyMonFrontpic_DoAnim
|
||||
ld a, [wCurPartySpecies]
|
||||
push af
|
||||
ld a, [wEnemyMonSpecies]
|
||||
|
|
@ -5710,12 +5714,12 @@ Function3e963:
|
|||
ld [wCurPartySpecies], a
|
||||
ret
|
||||
|
||||
asm_3e999:
|
||||
GetEnemyMonFrontpic_DoAnim:
|
||||
ldh a, [hBattleTurn]
|
||||
push af
|
||||
ld a, 1
|
||||
ldh [hBattleTurn], a
|
||||
ld a, BANK(Functioncc44f)
|
||||
ld a, BANK(BattleAnimCmd_RaiseSub)
|
||||
call FarCall_hl
|
||||
pop af
|
||||
ldh [hBattleTurn], a
|
||||
|
|
@ -6178,7 +6182,7 @@ LoadMonBackPic:
|
|||
ld hl, wMonHBackSprite - wMonHeader
|
||||
call UncompressMonSprite
|
||||
ld hl, vBackPic
|
||||
predef_jump Function50bcd
|
||||
predef_jump GetMonBackpic
|
||||
|
||||
Function3f068:
|
||||
ld de, $a203
|
||||
|
|
@ -6412,7 +6416,7 @@ AddBattleMoneyToAccount:
|
|||
call PrintText
|
||||
ret
|
||||
|
||||
BattleText_PlayerPickedUpPayDayMoney:
|
||||
BattleText_PlayerPickedUpPayDayMoney:
|
||||
text "<PLAYER>は @"
|
||||
deciram wPayDayMoney, 3, 6
|
||||
text "円"
|
||||
|
|
@ -6580,7 +6584,7 @@ InitBackPic:
|
|||
ld a, BANK(PlayerBacksprite)
|
||||
call UncompressSpriteFromDE
|
||||
ld hl, vTitleLogo2
|
||||
predef Function50bcd
|
||||
predef GetMonBackpic
|
||||
ld a, 0
|
||||
call OpenSRAM
|
||||
ld hl, vSprites
|
||||
|
|
@ -6644,7 +6648,7 @@ BattleStartMessage:
|
|||
ld a, [wBattleMode]
|
||||
dec a
|
||||
jr z, .wild
|
||||
ld de, $62 ; SFX_SHINE
|
||||
ld de, SFX_SHINE
|
||||
call PlaySFX
|
||||
call WaitSFX
|
||||
ld c, 20
|
||||
|
|
|
|||
|
|
@ -1620,7 +1620,7 @@ PlaceNonFaintStatus::
|
|||
ld [hl], "ひ"
|
||||
ret
|
||||
|
||||
Function50bcd::
|
||||
GetMonBackpic::
|
||||
ld a, $00
|
||||
call OpenSRAM
|
||||
push hl
|
||||
|
|
|
|||
135
engine/dumps/bank33.asm
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
INCLUDE "constants.asm"
|
||||
|
||||
SECTION "engine/battle_anims/helper.asm", ROMX
|
||||
|
||||
ReinitBattleAnimFrameset:
|
||||
ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
ld hl, BATTLEANIMSTRUCT_DURATION
|
||||
add hl, bc
|
||||
ld [hl], 0
|
||||
ld hl, BATTLEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
ld [hl], -1
|
||||
ret
|
||||
|
||||
GetBattleAnimFrame:
|
||||
.loop
|
||||
ld hl, BATTLEANIMSTRUCT_DURATION
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .next_frame
|
||||
dec [hl]
|
||||
call .GetPointer
|
||||
ld a, [hli]
|
||||
push af
|
||||
jr .okay
|
||||
|
||||
.next_frame
|
||||
ld hl, BATTLEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
inc [hl]
|
||||
call .GetPointer
|
||||
ld a, [hli]
|
||||
cp oamrestart_command
|
||||
jr z, .restart
|
||||
cp oamend_command
|
||||
jr z, .repeat_last
|
||||
|
||||
push af
|
||||
ld a, [hl]
|
||||
push hl
|
||||
and ~(Y_FLIP << 1 | X_FLIP << 1)
|
||||
ld hl, BATTLEANIMSTRUCT_DURATION
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
pop hl
|
||||
.okay
|
||||
ld a, [hl]
|
||||
and Y_FLIP << 1 | X_FLIP << 1 ; The << 1 is compensated in the "oamframe" macro
|
||||
srl a
|
||||
ld [wBattleAnimTempFrameOAMFlags], a
|
||||
pop af
|
||||
ret
|
||||
|
||||
.repeat_last
|
||||
xor a
|
||||
ld hl, BATTLEANIMSTRUCT_DURATION
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
|
||||
ld hl, BATTLEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
dec [hl]
|
||||
dec [hl]
|
||||
jr .loop
|
||||
|
||||
.restart
|
||||
xor a
|
||||
ld hl, BATTLEANIMSTRUCT_DURATION
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
|
||||
dec a
|
||||
ld hl, BATTLEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
ld [hl], a
|
||||
jr .loop
|
||||
|
||||
.GetPointer:
|
||||
ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
ld d, 0
|
||||
ld hl, BattleAnimFrameData
|
||||
add hl, de
|
||||
add hl, de
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
ld hl, BATTLEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
ld l, [hl]
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
add hl, de
|
||||
ret
|
||||
|
||||
GetBattleAnimOAMPointer:
|
||||
ld l, a
|
||||
ld h, 0
|
||||
ld de, BattleAnimOAMData
|
||||
add hl, hl
|
||||
add hl, hl
|
||||
add hl, de
|
||||
ret
|
||||
|
||||
LoadBattleAnimGFX:
|
||||
push hl
|
||||
ld l, a
|
||||
ld h, 0
|
||||
add hl, hl
|
||||
add hl, hl
|
||||
ld de, AnimObjGFX
|
||||
add hl, de
|
||||
ld c, [hl]
|
||||
inc hl
|
||||
ld b, [hl]
|
||||
inc hl
|
||||
ld e, [hl]
|
||||
inc hl
|
||||
ld d, [hl]
|
||||
pop hl
|
||||
push bc
|
||||
call Request2bpp
|
||||
pop bc
|
||||
ret
|
||||
|
||||
|
||||
INCLUDE "data/battle_anims/framesets.inc"
|
||||
|
||||
INCLUDE "data/battle_anims/oam.inc"
|
||||
|
||||
INCLUDE "data/battle_anims/object_gfx.inc"
|
||||
|
|
@ -100,7 +100,7 @@ PC_PlayBootSound:
|
|||
; Don't play the bootup sound if player has at least one mon
|
||||
ret nz
|
||||
|
||||
ld de, SFX_BOOT_PC
|
||||
ld de, SFX_CHOOSE_PC_OPTION
|
||||
call PlaySFX
|
||||
ld hl, .NoPokemonText
|
||||
call OpenTextbox
|
||||
|
|
@ -117,7 +117,7 @@ PC_PlayBootSound:
|
|||
text_end
|
||||
|
||||
PC_Demo:
|
||||
ld de, SFX_BOOT_PC
|
||||
ld de, SFX_CHOOSE_PC_OPTION
|
||||
call PlaySFX
|
||||
ld hl, .SkarmoryText
|
||||
call PrintText
|
||||
|
|
|
|||
72
engine/gfx/screen_effects.asm
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
INCLUDE "constants.asm"
|
||||
|
||||
SECTION "engine/gfx/screen_effects.asm", ROMX
|
||||
|
||||
; b = new color for BG color 0 (usually white) for 4 frames
|
||||
ChangeBGPalColor0_4Frames:
|
||||
ldh a, [rBGP]
|
||||
or b
|
||||
ldh [rBGP], a
|
||||
ld c, 4
|
||||
call DelayFrames
|
||||
ldh a, [rBGP]
|
||||
and %11111100
|
||||
ldh [rBGP], a
|
||||
ret
|
||||
|
||||
; Moves the window down and then back in a sequence of progressively smaller
|
||||
; numbers of pixels, starting at b.
|
||||
PredefShakeScreenVertically:
|
||||
ld a, 1
|
||||
ld [wDisableVBlankWYUpdate], a
|
||||
xor a
|
||||
.loop
|
||||
ldh [hMutateWY], a
|
||||
call .MutateWY
|
||||
call .MutateWY
|
||||
dec b
|
||||
ld a, b
|
||||
jr nz, .loop
|
||||
xor a
|
||||
ld [wDisableVBlankWYUpdate], a
|
||||
ret
|
||||
|
||||
.MutateWY
|
||||
ldh a, [hMutateWY]
|
||||
xor b
|
||||
ldh [hMutateWY], a
|
||||
ldh [rWY], a
|
||||
ld c, 3
|
||||
jp DelayFrames
|
||||
|
||||
; Moves the window right and then back in a sequence of progressively smaller
|
||||
; numbers of pixels, starting at b.
|
||||
PredefShakeScreenHorizontally:
|
||||
ld a, 1
|
||||
ld [wDisableVBlankWYUpdate], a
|
||||
xor a
|
||||
.loop
|
||||
ldh [hMutateWX], a
|
||||
call .MutateWX
|
||||
ld c, 1
|
||||
call DelayFrames
|
||||
call .MutateWX
|
||||
dec b
|
||||
ld a, b
|
||||
jr nz, .loop
|
||||
xor a
|
||||
ld [wDisableVBlankWYUpdate], a
|
||||
ret
|
||||
|
||||
.MutateWX
|
||||
ldh a, [hMutateWX]
|
||||
xor b
|
||||
ldh [hMutateWX], a
|
||||
bit 7, a ; negative?
|
||||
jr z, .skipZeroing
|
||||
xor a ; zero a if it's negative
|
||||
.skipZeroing
|
||||
add 7
|
||||
ldh [rWX], a
|
||||
ld c, 4
|
||||
jp DelayFrames
|
||||
|
|
@ -470,7 +470,7 @@ Intro_UpdateTilemapAndBGMap:
|
|||
ld e, a
|
||||
ld a, [wIntroBGMapPointer + 1]
|
||||
ld d, a
|
||||
ld hl, hCurSpriteYCoord
|
||||
ld hl, -2 * BG_MAP_WIDTH
|
||||
add hl, de
|
||||
ld a, l
|
||||
ld [wIntroBGMapPointer + 0], a
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ TitleSeq_Start::
|
|||
ld a, $80
|
||||
ld [wJumptableIndex + 2], a
|
||||
call SetLYOverrides
|
||||
ld a, $43
|
||||
ld a, LOW(rSCX)
|
||||
ldh [hLCDCPointer], a
|
||||
ret
|
||||
|
||||
|
|
|
|||
BIN
gfx/battle/minimize.png
Normal file
|
After Width: | Height: | Size: 113 B |
BIN
gfx/battle_anims/angels.png
Normal file
|
After Width: | Height: | Size: 606 B |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
BIN
gfx/battle_anims/beam.png
Normal file
|
After Width: | Height: | Size: 351 B |
BIN
gfx/battle_anims/bubble.png
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
gfx/battle_anims/charge.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
gfx/battle_anims/cut.png
Normal file
|
After Width: | Height: | Size: 221 B |
BIN
gfx/battle_anims/egg.png
Normal file
|
After Width: | Height: | Size: 283 B |
BIN
gfx/battle_anims/explosion.png
Normal file
|
After Width: | Height: | Size: 201 B |
BIN
gfx/battle_anims/fire.png
Normal file
|
After Width: | Height: | Size: 206 B |
BIN
gfx/battle_anims/flower.png
Normal file
|
After Width: | Height: | Size: 222 B |
BIN
gfx/battle_anims/globe.png
Normal file
|
After Width: | Height: | Size: 360 B |
BIN
gfx/battle_anims/haze.png
Normal file
|
After Width: | Height: | Size: 219 B |
BIN
gfx/battle_anims/hit.png
Normal file
|
After Width: | Height: | Size: 488 B |
BIN
gfx/battle_anims/horn.png
Normal file
|
After Width: | Height: | Size: 242 B |
BIN
gfx/battle_anims/ice.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
gfx/battle_anims/lightning.png
Normal file
|
After Width: | Height: | Size: 518 B |
BIN
gfx/battle_anims/misc.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
gfx/battle_anims/noise.png
Normal file
|
After Width: | Height: | Size: 339 B |
BIN
gfx/battle_anims/objects.png
Normal file
|
After Width: | Height: | Size: 421 B |
BIN
gfx/battle_anims/plant.png
Normal file
|
After Width: | Height: | Size: 389 B |
BIN
gfx/battle_anims/poison.png
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
gfx/battle_anims/pokeball.png
Normal file
|
After Width: | Height: | Size: 227 B |
BIN
gfx/battle_anims/powder.png
Normal file
|
After Width: | Height: | Size: 126 B |
BIN
gfx/battle_anims/psychic.png
Normal file
|
After Width: | Height: | Size: 236 B |
BIN
gfx/battle_anims/reflect.png
Normal file
|
After Width: | Height: | Size: 250 B |
BIN
gfx/battle_anims/rocks.png
Normal file
|
After Width: | Height: | Size: 419 B |
BIN
gfx/battle_anims/rope.png
Normal file
|
After Width: | Height: | Size: 310 B |
BIN
gfx/battle_anims/sand.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
gfx/battle_anims/shapes.png
Normal file
|
After Width: | Height: | Size: 328 B |
BIN
gfx/battle_anims/shine.png
Normal file
|
After Width: | Height: | Size: 421 B |
BIN
gfx/battle_anims/skyattack.png
Normal file
|
After Width: | Height: | Size: 547 B |
BIN
gfx/battle_anims/smoke.png
Normal file
|
After Width: | Height: | Size: 251 B |
BIN
gfx/battle_anims/speed.png
Normal file
|
After Width: | Height: | Size: 196 B |
BIN
gfx/battle_anims/status.png
Normal file
|
After Width: | Height: | Size: 504 B |
BIN
gfx/battle_anims/water.png
Normal file
|
After Width: | Height: | Size: 409 B |
BIN
gfx/battle_anims/web.png
Normal file
|
After Width: | Height: | Size: 259 B |
BIN
gfx/battle_anims/whip.png
Normal file
|
After Width: | Height: | Size: 248 B |
BIN
gfx/battle_anims/wind.png
Normal file
|
After Width: | Height: | Size: 405 B |
45
gfx/gfx.asm
|
|
@ -373,10 +373,47 @@ INCLUDE "gfx/pokemon/egg.inc"
|
|||
|
||||
SECTION "gfx.asm@Attack Animation GFX", ROMX
|
||||
|
||||
INCBIN "gfx/battle_anims/attack_animations_1.2bpp"
|
||||
PointerGFX::
|
||||
INCBIN "gfx/battle_anims/pointer.2bpp"
|
||||
INCBIN "gfx/battle_anims/attack_animations_2.2bpp"
|
||||
AnimObj00GFX:
|
||||
AnimObjHitGFX: INCBIN "gfx/battle_anims/hit.2bpp"
|
||||
AnimObjCutGFX: INCBIN "gfx/battle_anims/cut.2bpp"
|
||||
AnimObjFireGFX: INCBIN "gfx/battle_anims/fire.2bpp"
|
||||
AnimObjWaterGFX: INCBIN "gfx/battle_anims/water.2bpp"
|
||||
AnimObjLightningGFX: INCBIN "gfx/battle_anims/lightning.2bpp"
|
||||
AnimObjSmokeGFX: INCBIN "gfx/battle_anims/smoke.2bpp"
|
||||
AnimObjExplosionGFX: INCBIN "gfx/battle_anims/explosion.2bpp"
|
||||
AnimObjIceGFX: INCBIN "gfx/battle_anims/ice.2bpp"
|
||||
AnimObjRocksGFX: INCBIN "gfx/battle_anims/rocks.2bpp"
|
||||
AnimObjPoisonGFX: INCBIN "gfx/battle_anims/poison.2bpp"
|
||||
AnimObjPlantGFX: INCBIN "gfx/battle_anims/plant.2bpp"
|
||||
AnimObjPokeBallGFX: INCBIN "gfx/battle_anims/pokeball.2bpp"
|
||||
AnimObjBubbleGFX: INCBIN "gfx/battle_anims/bubble.2bpp"
|
||||
AnimObjNoiseGFX: INCBIN "gfx/battle_anims/noise.2bpp"
|
||||
AnimObjReflectGFX: INCBIN "gfx/battle_anims/reflect.2bpp"
|
||||
AnimObjPowderGFX: INCBIN "gfx/battle_anims/powder.2bpp"
|
||||
AnimObjBeamGFX: INCBIN "gfx/battle_anims/beam.2bpp"
|
||||
AnimObjSpeedGFX: INCBIN "gfx/battle_anims/speed.2bpp"
|
||||
AnimObjChargeGFX: INCBIN "gfx/battle_anims/charge.2bpp"
|
||||
AnimObjWindGFX: INCBIN "gfx/battle_anims/wind.2bpp"
|
||||
AnimObjWhipGFX: INCBIN "gfx/battle_anims/whip.2bpp"
|
||||
AnimObjRopeGFX: INCBIN "gfx/battle_anims/rope.2bpp"
|
||||
AnimObjEggGFX: INCBIN "gfx/battle_anims/egg.2bpp"
|
||||
AnimObjPsychicGFX: INCBIN "gfx/battle_anims/psychic.2bpp"
|
||||
AnimObjSandGFX: INCBIN "gfx/battle_anims/sand.2bpp"
|
||||
AnimObjWebGFX: INCBIN "gfx/battle_anims/web.2bpp"
|
||||
AnimObjHazeGFX: INCBIN "gfx/battle_anims/haze.2bpp"
|
||||
AnimObjHornGFX: INCBIN "gfx/battle_anims/horn.2bpp"
|
||||
AnimObjFlowerGFX: INCBIN "gfx/battle_anims/flower.2bpp"
|
||||
AnimObjMiscGFX:
|
||||
PointerGFX: INCBIN "gfx/battle_anims/pointer.2bpp"
|
||||
INCBIN "gfx/battle_anims/misc.2bpp"
|
||||
AnimObjSkyAttackGFX: INCBIN "gfx/battle_anims/skyattack.2bpp"
|
||||
AnimObjGlobeGFX: INCBIN "gfx/battle_anims/globe.2bpp"
|
||||
AnimObjShapesGFX: INCBIN "gfx/battle_anims/shapes.2bpp"
|
||||
AnimObjStatusGFX: INCBIN "gfx/battle_anims/status.2bpp"
|
||||
AnimObjObjectsGFX: INCBIN "gfx/battle_anims/objects.2bpp"
|
||||
AnimObjShineGFX: INCBIN "gfx/battle_anims/shine.2bpp"
|
||||
AnimObjAngelsGFX: INCBIN "gfx/battle_anims/angels.2bpp"
|
||||
;INCBIN "gfx/battle_anims/destinybond.2bpp"
|
||||
|
||||
SECTION "gfx.asm@Pokemon Party Sprites", ROMX
|
||||
MenuMonIconGFX::
|
||||
|
|
|
|||
18
gfx/gfx.mk
|
|
@ -31,3 +31,21 @@ $(BUILD)/gfx/battle_anims/attack_animations_1.2bpp: tools/gfx += --trim-whitespa
|
|||
$(BUILD)/gfx/battle_anims/attack_animations_2.2bpp: tools/gfx += --trim-whitespace
|
||||
|
||||
$(BUILD)/gfx/title/title_logo.2bpp: tools/gfx += --trim-whitespace
|
||||
|
||||
$(BUILD)/gfx/battle_anims/angels.2bpp: tools/gfx += --trim-whitespace
|
||||
$(BUILD)/gfx/battle_anims/beam.2bpp: tools/gfx += --remove-xflip --remove-yflip --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/bubble.2bpp: tools/gfx += --trim-whitespace
|
||||
$(BUILD)/gfx/battle_anims/charge.2bpp: tools/gfx += --trim-whitespace
|
||||
$(BUILD)/gfx/battle_anims/egg.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/explosion.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/hit.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/horn.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/lightning.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/misc.2bpp: tools/gfx += --remove-duplicates --remove-xflip
|
||||
$(BUILD)/gfx/battle_anims/noise.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/objects.2bpp: tools/gfx += --remove-whitespace --remove-xflip
|
||||
$(BUILD)/gfx/battle_anims/pokeball.2bpp: tools/gfx += --remove-xflip --keep-whitespace
|
||||
$(BUILD)/gfx/battle_anims/reflect.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/rocks.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/skyattack.2bpp: tools/gfx += --remove-whitespace
|
||||
$(BUILD)/gfx/battle_anims/status.2bpp: tools/gfx += --remove-whitespace
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ CheckTossableItem::
|
|||
ret
|
||||
|
||||
GetBattleAnimPointer::
|
||||
ld a, BANK(BattleAnimationsBankRef)
|
||||
ld a, BANK(BattleAnimations)
|
||||
ld [MBC3RomBank], a
|
||||
ldh [hROMBank], a
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ GetBattleAnimByte::
|
|||
inc hl
|
||||
ld d, [hl]
|
||||
|
||||
ld a, BANK(BattleAnimationsBankRef)
|
||||
ld a, BANK(BattleAnimations)
|
||||
ld [MBC3RomBank], a
|
||||
ldh [hROMBank], a
|
||||
|
||||
|
|
|
|||
|
|
@ -772,9 +772,16 @@ ROMX $31
|
|||
ROMX $32
|
||||
org $4000
|
||||
"engine/battle_anims/bg_effects.asm"
|
||||
"data/moves/animations.asm"
|
||||
"engine/gfx/screen_effects.asm"
|
||||
|
||||
ROMX $33
|
||||
org $4000
|
||||
"engine/battle_anims/anim_commands.asm"
|
||||
"engine/dumps/bank33.asm"
|
||||
"engine/battle_anims/functions.asm"
|
||||
"engine/battle_anims/helper.asm"
|
||||
|
||||
|
||||
ROMX $34
|
||||
org $4000
|
||||
|
|
|
|||
301
macros/battle_anims.asm
Normal file
|
|
@ -0,0 +1,301 @@
|
|||
; BattleAnimCommands indexes (see engine/battle_anims/anim_commands.asm)
|
||||
const_def $d0
|
||||
DEF FIRST_BATTLE_ANIM_CMD EQU const_value
|
||||
|
||||
MACRO anim_wait
|
||||
assert (\1) < FIRST_BATTLE_ANIM_CMD, "anim_wait argument must be less than {FIRST_BATTLE_ANIM_CMD}"
|
||||
db \1
|
||||
ENDM
|
||||
|
||||
const anim_obj_command ; $d0
|
||||
MACRO anim_obj
|
||||
db anim_obj_command
|
||||
if _NARG <= 4
|
||||
db \1 ; object
|
||||
db \2 ; x
|
||||
db \3 ; y
|
||||
db \4 ; param
|
||||
else
|
||||
; LEGACY: Support the tile+offset format
|
||||
db \1 ; object
|
||||
db (\2) * TILE_WIDTH + (\3) ; x_tile, x
|
||||
db (\4) * TILE_WIDTH + (\5) ; y_tile, y
|
||||
db \6 ; param
|
||||
endc
|
||||
ENDM
|
||||
|
||||
const anim_1gfx_command ; $d1
|
||||
MACRO anim_1gfx
|
||||
db anim_1gfx_command
|
||||
db \1 ; gfx1
|
||||
ENDM
|
||||
|
||||
const anim_2gfx_command ; $d2
|
||||
MACRO anim_2gfx
|
||||
db anim_2gfx_command
|
||||
db \1 ; gfx1
|
||||
db \2 ; gfx2
|
||||
ENDM
|
||||
|
||||
const anim_3gfx_command ; $d3
|
||||
MACRO anim_3gfx
|
||||
db anim_3gfx_command
|
||||
db \1 ; gfx1
|
||||
db \2 ; gfx2
|
||||
db \3 ; gfx3
|
||||
ENDM
|
||||
|
||||
const anim_4gfx_command ; $d4
|
||||
MACRO anim_4gfx
|
||||
db anim_4gfx_command
|
||||
db \1 ; gfx1
|
||||
db \2 ; gfx2
|
||||
db \3 ; gfx3
|
||||
db \4 ; gfx4
|
||||
ENDM
|
||||
|
||||
const anim_5gfx_command ; $d5
|
||||
MACRO anim_5gfx
|
||||
db anim_5gfx_command
|
||||
db \1 ; gfx1
|
||||
db \2 ; gfx2
|
||||
db \3 ; gfx3
|
||||
db \4 ; gfx4
|
||||
db \5 ; gfx5
|
||||
ENDM
|
||||
|
||||
const anim_incobj_command ; $d6
|
||||
MACRO anim_incobj
|
||||
db anim_incobj_command
|
||||
db \1 ; object_id
|
||||
ENDM
|
||||
|
||||
const anim_setobj_command ; $d7
|
||||
MACRO anim_setobj
|
||||
db anim_setobj_command
|
||||
db \1 ; object_id
|
||||
db \2 ; value
|
||||
ENDM
|
||||
|
||||
const anim_incbgeffect_command ; $d8
|
||||
MACRO anim_incbgeffect
|
||||
db anim_incbgeffect_command
|
||||
db \1 ; effect
|
||||
ENDM
|
||||
|
||||
const anim_battlergfx_2row_command ; $d9
|
||||
MACRO anim_battlergfx_2row
|
||||
db anim_battlergfx_2row_command
|
||||
ENDM
|
||||
|
||||
const anim_battlergfx_1row_command ; $da
|
||||
MACRO anim_battlergfx_1row
|
||||
db anim_battlergfx_1row_command
|
||||
ENDM
|
||||
|
||||
const anim_checkpokeball_command ; $db
|
||||
MACRO anim_checkpokeball
|
||||
db anim_checkpokeball_command
|
||||
ENDM
|
||||
|
||||
const anim_transform_command ; $dc
|
||||
MACRO anim_transform
|
||||
db anim_transform_command
|
||||
ENDM
|
||||
|
||||
const anim_raisesub_command ; $dd
|
||||
MACRO anim_raisesub
|
||||
db anim_raisesub_command
|
||||
ENDM
|
||||
|
||||
const anim_dropsub_command ; $de
|
||||
MACRO anim_dropsub
|
||||
db anim_dropsub_command
|
||||
ENDM
|
||||
|
||||
const anim_resetobp0_command ; $df
|
||||
MACRO anim_resetobp0
|
||||
db anim_resetobp0_command
|
||||
ENDM
|
||||
|
||||
const anim_sound_command ; $e0
|
||||
MACRO anim_sound
|
||||
db anim_sound_command
|
||||
db (\1 << 2) | \2 ; duration, tracks
|
||||
db \3 ; sound_id
|
||||
ENDM
|
||||
|
||||
const anim_cry_command ; $e1
|
||||
MACRO anim_cry
|
||||
db anim_cry_command
|
||||
db \1 ; pitch
|
||||
ENDM
|
||||
|
||||
const anim_minimizeopp_command ; $e2
|
||||
MACRO anim_minimizeopp
|
||||
db anim_minimizeopp_command
|
||||
ENDM
|
||||
|
||||
const anim_oamon_command ; $e3
|
||||
MACRO anim_oamon
|
||||
db anim_oamon_command
|
||||
ENDM
|
||||
|
||||
const anim_oamoff_command ; $e4
|
||||
MACRO anim_oamoff
|
||||
db anim_oamoff_command
|
||||
ENDM
|
||||
|
||||
const anim_0xe5_command ; $e5
|
||||
MACRO anim_0xe5
|
||||
db anim_0xe5_command
|
||||
ENDM
|
||||
|
||||
const anim_0xe6_command ; $e6
|
||||
MACRO anim_0xe6
|
||||
db anim_0xe6_command
|
||||
ENDM
|
||||
|
||||
const anim_0xe7_command ; $e7
|
||||
MACRO anim_0xe7
|
||||
db anim_0xe7_command
|
||||
ENDM
|
||||
|
||||
const anim_updateactorpic_command ; $e8
|
||||
MACRO anim_updateactorpic
|
||||
db anim_updateactorpic_command
|
||||
ENDM
|
||||
|
||||
const anim_minimize_command ; $e9
|
||||
MACRO anim_minimize
|
||||
db anim_minimize_command
|
||||
ENDM
|
||||
|
||||
const anim_0xea_command ; $ea
|
||||
MACRO anim_0xea
|
||||
db anim_0xea_command
|
||||
ENDM
|
||||
|
||||
const anim_0xeb_command ; $eb
|
||||
MACRO anim_0xeb
|
||||
db anim_0xeb_command
|
||||
ENDM
|
||||
|
||||
const anim_0xec_command ; $ec
|
||||
MACRO anim_0xec
|
||||
db anim_0xec_command
|
||||
ENDM
|
||||
|
||||
const anim_0xed_command ; $ed
|
||||
MACRO anim_0xed
|
||||
db anim_0xed_command
|
||||
ENDM
|
||||
|
||||
const anim_if_param_and_command ; $ee
|
||||
MACRO anim_if_param_and
|
||||
db anim_if_param_and_command
|
||||
db \1 ; value
|
||||
dw \2 ; address
|
||||
ENDM
|
||||
|
||||
const anim_jumpuntil_command ; $ef
|
||||
MACRO anim_jumpuntil
|
||||
db anim_jumpuntil_command
|
||||
dw \1 ; address
|
||||
ENDM
|
||||
|
||||
const anim_bgeffect_command ; $f0
|
||||
MACRO anim_bgeffect
|
||||
db anim_bgeffect_command
|
||||
db \1 ; effect
|
||||
db \2 ; jumptable index
|
||||
db \3 ; battle turn
|
||||
db \4 ; unknown
|
||||
ENDM
|
||||
|
||||
const anim_bgp_command ; $f1
|
||||
MACRO anim_bgp
|
||||
db anim_bgp_command
|
||||
db \1 ; colors
|
||||
ENDM
|
||||
|
||||
const anim_obp0_command ; $f2
|
||||
MACRO anim_obp0
|
||||
db anim_obp0_command
|
||||
db \1 ; colors
|
||||
ENDM
|
||||
|
||||
const anim_obp1_command ; $f3
|
||||
MACRO anim_obp1
|
||||
db anim_obp1_command
|
||||
db \1 ; colors
|
||||
ENDM
|
||||
|
||||
const anim_keepsprites_command ; $f4
|
||||
MACRO anim_keepsprites
|
||||
db anim_keepsprites_command
|
||||
ENDM
|
||||
|
||||
const anim_0xf5_command ; $f5
|
||||
MACRO anim_0xf5
|
||||
db anim_0xf5_command
|
||||
ENDM
|
||||
|
||||
const anim_0xf6_command ; $f6
|
||||
MACRO anim_0xf6
|
||||
db anim_0xf6_command
|
||||
ENDM
|
||||
|
||||
const anim_0xf7_command ; $f7
|
||||
MACRO anim_0xf7
|
||||
db anim_0xf7_command
|
||||
ENDM
|
||||
|
||||
const anim_if_param_equal_command ; $f8
|
||||
MACRO anim_if_param_equal
|
||||
db anim_if_param_equal_command
|
||||
db \1 ; value
|
||||
dw \2 ; address
|
||||
ENDM
|
||||
|
||||
const anim_setvar_command ; $f9
|
||||
MACRO anim_setvar
|
||||
db anim_setvar_command
|
||||
db \1 ; value
|
||||
ENDM
|
||||
|
||||
const anim_incvar_command ; $fa
|
||||
MACRO anim_incvar
|
||||
db anim_incvar_command
|
||||
ENDM
|
||||
|
||||
const anim_if_var_equal_command ; $fb
|
||||
MACRO anim_if_var_equal
|
||||
db anim_if_var_equal_command
|
||||
db \1 ; value
|
||||
dw \2 ; address
|
||||
ENDM
|
||||
|
||||
const anim_jump_command ; $fc
|
||||
MACRO anim_jump
|
||||
db anim_jump_command
|
||||
dw \1 ; address
|
||||
ENDM
|
||||
|
||||
const anim_loop_command ; $fd
|
||||
MACRO anim_loop
|
||||
db anim_loop_command
|
||||
db \1 ; count
|
||||
dw \2 ; address
|
||||
ENDM
|
||||
|
||||
const anim_call_command ; $fe
|
||||
MACRO anim_call
|
||||
db anim_call_command
|
||||
dw \1 ; address
|
||||
ENDM
|
||||
|
||||
const anim_ret_command ; $ff
|
||||
MACRO anim_ret
|
||||
db anim_ret_command
|
||||
ENDM
|
||||
|
|
@ -332,38 +332,29 @@ MACRO sprite_anim_struct
|
|||
ENDM
|
||||
|
||||
MACRO battle_anim_struct
|
||||
; 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
|
||||
\1Index:: db
|
||||
\1OAMFlags:: db
|
||||
\1FixY:: db
|
||||
\1FramesetID:: db
|
||||
\1Function:: db
|
||||
\1TileID:: db
|
||||
\1XCoord:: db
|
||||
\1YCoord:: db
|
||||
\1XOffset:: db
|
||||
\1YOffset:: db
|
||||
\1Param:: db
|
||||
\1Duration:: db
|
||||
\1Frame:: db
|
||||
\1JumptableIndex:: db
|
||||
\1Var1:: db
|
||||
\1Var2:: db
|
||||
ENDM
|
||||
|
||||
MACRO battle_bg_effect
|
||||
\1_Function:: ds 1
|
||||
\1_01:: ds 1
|
||||
\1_02:: ds 1
|
||||
\1_03:: ds 1
|
||||
\1Function:: db
|
||||
\1JumptableIndex:: db
|
||||
\1BattleTurn:: db
|
||||
\1Param:: db
|
||||
ENDM
|
||||
|
||||
MACRO sprite_oam_struct
|
||||
|
|
|
|||
|
|
@ -150,6 +150,11 @@ hPrintNumDividend:: ds 3 ; big-endian
|
|||
hPrintNumDivisor:: ds 3 ; big-endian
|
||||
hPrintNumTemp:: ds 3 ; big-endian
|
||||
|
||||
NEXTU
|
||||
ds 1
|
||||
hMutateWY:: db
|
||||
hMutateWX:: db
|
||||
|
||||
ENDU
|
||||
|
||||
ds 3 ; TODO
|
||||
|
|
|
|||
54
ram/wram.asm
|
|
@ -385,7 +385,19 @@ wPicrossErrorCheck:: ds 1
|
|||
ds 1
|
||||
NEXTU
|
||||
; Battle-related
|
||||
ds $1ea
|
||||
ds $140
|
||||
|
||||
wBattleAnimTileDict::
|
||||
; wBattleAnimTileDict pairs keys with values
|
||||
; keys: BATTLE_ANIM_GFX_* indexes (taken from anim_*gfx arguments)
|
||||
; values: vTiles0 offsets
|
||||
ds NUM_BATTLEANIMTILEDICT_ENTRIES * 2
|
||||
|
||||
wActiveAnimObjects::
|
||||
; wAnimObject1 - wAnimObject10
|
||||
for n, 1, NUM_BATTLE_ANIM_STRUCTS + 1
|
||||
wAnimObject{d:n}:: battle_anim_struct wAnimObject{d:n}
|
||||
endr
|
||||
|
||||
wActiveBGEffects::
|
||||
wBGEffect1:: battle_bg_effect wBGEffect1
|
||||
|
|
@ -395,7 +407,7 @@ wBGEffect4:: battle_bg_effect wBGEffect4
|
|||
wBGEffect5:: battle_bg_effect wBGEffect5
|
||||
wActiveBGEffectsEnd::
|
||||
|
||||
wNumActiveBattleAnims:: db
|
||||
wLastAnimObjectIndex:: db
|
||||
|
||||
wBattleAnimFlags:: db
|
||||
wBattleAnimAddress:: dw
|
||||
|
|
@ -408,22 +420,39 @@ wBattleAnimOAMPointerLo:: db
|
|||
db
|
||||
|
||||
UNION
|
||||
; unidentified
|
||||
wBattleAnimTemp0:: db
|
||||
wBattleAnimTemp1:: db
|
||||
wBattleAnimTemp2:: db
|
||||
wBattleAnimTemp3:: db
|
||||
wBattleObjectTempID:: db
|
||||
wBattleObjectTempXCoord:: db
|
||||
wBattleObjectTempYCoord:: db
|
||||
wBattleObjectTempParam:: db
|
||||
|
||||
NEXTU
|
||||
wBattleBGEffectTempID:: db
|
||||
wBattleBGEffectTempJumptableIndex:: db
|
||||
wBattleBGEffectTempTurn:: db
|
||||
wBattleBGEffectTempParam:: db
|
||||
|
||||
NEXTU
|
||||
wBattleSineWaveTempProgress:: db
|
||||
wBattleSineWaveTempOffset:: db
|
||||
wBattleSineWaveTempAmplitude:: db
|
||||
wBattleSineWaveTempTimer:: db
|
||||
|
||||
NEXTU
|
||||
wBattleAnimTempOAMFlags:: db
|
||||
wBattleAnimTempField02:: db
|
||||
wBattleAnimTempFixY:: db
|
||||
wBattleAnimTempTileID:: db
|
||||
wBattleAnimTempXCoord:: db
|
||||
wBattleAnimTempYCoord:: db
|
||||
wBattleAnimTempXOffset:: db
|
||||
wBattleAnimTempYOffset:: db
|
||||
wBattleAnimTempAddSubFlags:: db
|
||||
wBattleAnimTempFrameOAMFlags:: db
|
||||
wBattleAnimTempPalette:: db
|
||||
|
||||
NEXTU
|
||||
wBattleAnimGFXTempTileID::
|
||||
wBattleAnimGFXTempPicHeight:: db
|
||||
wBattlePicResizeTempPointer:: dw
|
||||
|
||||
ENDU
|
||||
|
||||
ds $32
|
||||
|
|
@ -1139,6 +1168,11 @@ NEXTU
|
|||
; battle HUD
|
||||
wBattleHUDTiles:: ds PARTY_LENGTH
|
||||
|
||||
NEXTU
|
||||
; thrown ball data
|
||||
wFinalCatchRate:: db
|
||||
wThrownBallWobbleCount:: db
|
||||
|
||||
ENDU
|
||||
|
||||
wLinkBattleRNs:: ds 10
|
||||
|
|
@ -1240,7 +1274,7 @@ wListMoves_MoveIndicesBuffer:: ds NUM_MOVES
|
|||
wce32:: ds 1
|
||||
wce33:: ds 1
|
||||
wce34:: ds 1
|
||||
wce35:: ds 1
|
||||
wWildMon:: db
|
||||
wBattleHasJustStarted:: db
|
||||
|
||||
wNamedObjectIndexBuffer::
|
||||
|
|
|
|||
51
shim.sym
|
|
@ -61,19 +61,48 @@
|
|||
23:4940 Function8c940
|
||||
23:49C6 Function8c9c6
|
||||
|
||||
32:76FF Functioncb6ff
|
||||
32:7710 Functioncb710
|
||||
32:7733 Functioncb733
|
||||
32:7FFF BattleAnimationsBankRef
|
||||
|
||||
33:4000 Functioncc000
|
||||
33:4000 Functioncc000_2
|
||||
33:4001 PlayBattleAnim
|
||||
33:444F Functioncc44f
|
||||
33:44D4 Functioncc4d4
|
||||
33:467B QueueBattleAnimation
|
||||
33:625D BattleAnim_Sine_e
|
||||
33:6263 BattleAnim_Cosine_e
|
||||
;32:4cfe BattleAnimations
|
||||
;32:5b8d BattleAnim_FocusEnergy
|
||||
;32:7511 BattleAnimSub_Drain
|
||||
;32:753d BattleAnimSub_EyeBeams
|
||||
;32:7573 BattleAnimSub_WarpAway
|
||||
;32:759a BattleAnimSub_Beam
|
||||
;32:75c3 BattleAnimSub_Explosion1
|
||||
;32:75f0 BattleAnimSub_Explosion2
|
||||
;32:761d BattleAnimSub_Sound
|
||||
;32:762d BattleAnimSub_Fire
|
||||
;32:7640 BattleAnimSub_Ice
|
||||
;32:7676 BattleAnimSub_Sludge
|
||||
;32:7696 BattleAnimSub_Acid
|
||||
;32:76a4 BattleAnimSub_Metallic
|
||||
;32:76bc BattleAnimSub_SandOrMud
|
||||
;32:76cb BattleAnim_TargetObj_1Row
|
||||
;32:76d3 BattleAnim_TargetObj_2Row
|
||||
;32:76db BattleAnim_ShowMon_0
|
||||
;32:76e5 BattleAnim_UserObj_1Row
|
||||
;32:76ed BattleAnim_UserObj_2Row
|
||||
;32:76f5 BattleAnim_ShowMon_1
|
||||
;33:480f BattleAnimObjects
|
||||
;33:4b98 DoBattleAnimFrame
|
||||
|
||||
;33:5081 BattleAnim_ScatterHorizontal
|
||||
;33:61fd BattleAnim_StepToTarget
|
||||
;33:6211 BattleAnim_AnonJumptable
|
||||
;33:6224 BattleAnim_IncAnonJumptableIndex
|
||||
;33:622a BattleAnim_Cosine
|
||||
;33:622c BattleAnim_Sine
|
||||
;33:62a9 ReinitBattleAnimFrameset
|
||||
;33:62bb GetBattleAnimFrame
|
||||
;33:625D BattleAnim_Sine_e
|
||||
;33:6263 BattleAnim_Cosine_e
|
||||
;33:6326 GetBattleAnimOAMPointer
|
||||
;33:6330 LoadBattleAnimGFX
|
||||
;33:697C BattleAnimOAMData
|
||||
;33:6CC8 OAMData
|
||||
;33:7780 AnimObjGFX
|
||||
|
||||
|
||||
38:48A2 PokerMinigame
|
||||
38:5AE3 FifteenPuzzleMinigame
|
||||
|
|
|
|||
149
tools/common.h
|
|
@ -1,39 +1,150 @@
|
|||
#ifndef GUARD_COMMON_H
|
||||
#define GUARD_COMMON_H
|
||||
|
||||
int __getopt_long_i__;
|
||||
#define getopt_long(c, v, s, l) getopt_long(c, v, s, l, &__getopt_long_i__)
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdnoreturn.h>
|
||||
#include <inttypes.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <getopt.h>
|
||||
|
||||
FILE *fopen_verbose(char *filename, char *mode) {
|
||||
#ifndef PROGRAM_NAME
|
||||
#error Define PROGRAM_NAME before including common.h!
|
||||
#endif
|
||||
#ifndef USAGE_OPTS
|
||||
#error Define USAGE_OPTS before including common.h!
|
||||
#endif
|
||||
|
||||
#define COUNTOF(...) (sizeof(__VA_ARGS__) / sizeof(*(__VA_ARGS__)))
|
||||
|
||||
#define error_exit(...) exit((fprintf(stderr, PROGRAM_NAME ": " __VA_ARGS__), 1))
|
||||
|
||||
noreturn void usage_exit(int status) {
|
||||
fprintf(stderr, "Usage: " PROGRAM_NAME " " USAGE_OPTS "\n");
|
||||
exit(status);
|
||||
}
|
||||
|
||||
int getopt_long_index;
|
||||
#define getopt_long(argc, argv, optstring, longopts) getopt_long(argc, argv, optstring, longopts, &getopt_long_index)
|
||||
|
||||
void *xmalloc(size_t size) {
|
||||
errno = 0;
|
||||
void *m = malloc(size);
|
||||
if (!m) {
|
||||
error_exit("Could not allocate %zu bytes: %s\n", size, strerror(errno));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
void *xcalloc(size_t size) {
|
||||
errno = 0;
|
||||
void *m = calloc(size, 1);
|
||||
if (!m) {
|
||||
error_exit("Could not allocate %zu bytes: %s\n", size, strerror(errno));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
void *xrealloc(void *m, size_t size) {
|
||||
errno = 0;
|
||||
m = realloc(m, size);
|
||||
if (!m) {
|
||||
error_exit("Could not allocate %zu bytes: %s\n", size, strerror(errno));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
FILE *xfopen(const char *filename, char rw) {
|
||||
char mode[3] = {rw, 'b', '\0'};
|
||||
errno = 0;
|
||||
FILE *f = fopen(filename, mode);
|
||||
if (!f) {
|
||||
fprintf(stderr, "Could not open file: \"%s\"\n", filename);
|
||||
error_exit("Could not open file \"%s\": %s\n", filename, strerror(errno));
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
uint8_t *read_u8(char *filename, int *size) {
|
||||
FILE *f = fopen_verbose(filename, "rb");
|
||||
if (!f) {
|
||||
exit(1);
|
||||
void xfread(uint8_t *data, size_t size, const char *filename, FILE *f) {
|
||||
errno = 0;
|
||||
if (fread(data, 1, size, f) != size) {
|
||||
fclose(f);
|
||||
error_exit("Could not read from file \"%s\": %s\n", filename, strerror(errno));
|
||||
}
|
||||
fseek(f, 0, SEEK_END);
|
||||
*size = ftell(f);
|
||||
rewind(f);
|
||||
uint8_t *data = malloc(*size);
|
||||
if (*size != (int)fread(data, 1, *size, f)) {
|
||||
fprintf(stderr, "Could not read file: \"%s\"\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void xfwrite(const uint8_t *data, size_t size, const char *filename, FILE *f) {
|
||||
errno = 0;
|
||||
if (fwrite(data, 1, size, f) != size) {
|
||||
fclose(f);
|
||||
error_exit("Could not write to file \"%s\": %s\n", filename, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
long xfsize(const char *filename, FILE *f) {
|
||||
long size = -1;
|
||||
errno = 0;
|
||||
if (!fseek(f, 0, SEEK_END)) {
|
||||
size = ftell(f);
|
||||
if (size != -1) {
|
||||
rewind(f);
|
||||
}
|
||||
}
|
||||
if (size == -1) {
|
||||
error_exit("Could not measure file \"%s\": %s\n", filename, strerror(errno));
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
uint8_t *read_u8(const char *filename, long *size) {
|
||||
FILE *f = xfopen(filename, 'r');
|
||||
*size = xfsize(filename, f);
|
||||
uint8_t *data = xmalloc(*size);
|
||||
xfread(data, *size, filename, f);
|
||||
fclose(f);
|
||||
return data;
|
||||
}
|
||||
|
||||
void write_u8(char *filename, uint8_t *data, int size) {
|
||||
FILE *f = fopen_verbose(filename, "wb");
|
||||
if (f) {
|
||||
fwrite(data, 1, size, f);
|
||||
void write_u8(const char *filename, uint8_t *data, size_t size) {
|
||||
FILE *f = xfopen(filename, 'w');
|
||||
xfwrite(data, size, filename, f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
uint32_t read_png_width(const char *filename) {
|
||||
FILE *f = xfopen(filename, 'r');
|
||||
uint8_t header[16] = {0};
|
||||
xfread(header, sizeof(header), filename, f);
|
||||
static uint8_t expected_header[16] = {
|
||||
0x89, 'P', 'N', 'G', '\r', '\n', 0x1A, '\n', // signature
|
||||
0, 0, 0, 13, // IHDR chunk length
|
||||
'I', 'H', 'D', 'R', // IHDR chunk type
|
||||
};
|
||||
if (memcmp(header, expected_header, sizeof(header))) {
|
||||
fclose(f);
|
||||
error_exit("Not a valid PNG file: \"%s\"\n", filename);
|
||||
}
|
||||
uint8_t bytes[4] = {0};
|
||||
xfread(bytes, sizeof(bytes), filename, f);
|
||||
fclose(f);
|
||||
return (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3];
|
||||
}
|
||||
|
||||
void read_dimensions(const char *filename, int *width) {
|
||||
long filesize;
|
||||
uint8_t *bytes = read_u8(filename, &filesize);
|
||||
if (filesize != 1) {
|
||||
error_exit("%s: invalid dimensions file\n", filename);
|
||||
}
|
||||
uint8_t dimensions = bytes[0];
|
||||
free(bytes);
|
||||
*width = dimensions & 0xF;
|
||||
int height = dimensions >> 4;
|
||||
if (*width != height || (*width != 5 && *width != 6 && *width != 7)) {
|
||||
error_exit("%s: invalid dimensions: %dx%d tiles\n", filename, *width, height);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
319
tools/gfx.c
|
|
@ -1,91 +1,118 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#define PROGRAM_NAME "gfx"
|
||||
#define USAGE_OPTS "[-h|--help] [--trim-whitespace] [--remove-whitespace] [--interleave] [--remove-duplicates [--keep-whitespace]] [--remove-xflip] [--remove-yflip] [--preserve indexes] [-d|--depth depth] [-p|--png filename.png] [-o|--out outfile] infile"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static void usage(void) {
|
||||
fprintf(stderr, "Usage: gfx [[--trim-whitespace] | [--trim-trailing]] [--remove-whitespace] [--interleave] "
|
||||
"[--remove-duplicates [--keep-whitespace]] [--remove-xflip] [--remove-yflip] [--png filename] "
|
||||
"[-d depth] [-h] [-o outfile] infile\n");
|
||||
}
|
||||
|
||||
static void error(char *message) {
|
||||
fputs(message, stderr);
|
||||
fputs("\n", stderr);
|
||||
}
|
||||
|
||||
struct Options {
|
||||
int trim_whitespace;
|
||||
int trim_trailing;
|
||||
int remove_whitespace;
|
||||
int help;
|
||||
char *outfile;
|
||||
bool trim_whitespace;
|
||||
bool trim_trailing;
|
||||
bool remove_whitespace;
|
||||
bool interleave;
|
||||
bool remove_duplicates;
|
||||
bool keep_whitespace;
|
||||
bool remove_xflip;
|
||||
bool remove_yflip;
|
||||
int *preserved;
|
||||
int num_preserved;
|
||||
int depth;
|
||||
int interleave;
|
||||
int remove_duplicates;
|
||||
int keep_whitespace;
|
||||
int remove_xflip;
|
||||
int remove_yflip;
|
||||
char *png_file;
|
||||
char *outfile;
|
||||
};
|
||||
|
||||
struct Options Options = {
|
||||
.depth = 2,
|
||||
};
|
||||
struct Options options = {.depth = 2};
|
||||
|
||||
void get_args(int argc, char *argv[]) {
|
||||
void parse_args(int argc, char *argv[]) {
|
||||
struct option long_options[] = {
|
||||
{"remove-whitespace", no_argument, &Options.remove_whitespace, 1},
|
||||
{"trim-whitespace", no_argument, &Options.trim_whitespace, 1},
|
||||
{"trim-trailing", no_argument, &Options.trim_trailing, 1},
|
||||
{"interleave", no_argument, &Options.interleave, 1},
|
||||
{"remove-duplicates", no_argument, &Options.remove_duplicates, 1},
|
||||
{"keep-whitespace", no_argument, &Options.keep_whitespace, 1},
|
||||
{"remove-xflip", no_argument, &Options.remove_xflip, 1},
|
||||
{"remove-yflip", no_argument, &Options.remove_yflip, 1},
|
||||
{"remove-whitespace", no_argument, 0, 'R'},
|
||||
{"trim-whitespace", no_argument, 0, 'T'},
|
||||
{"trim-trailing", no_argument, 0, 't'},
|
||||
{"interleave", no_argument, 0, 'I'},
|
||||
{"remove-duplicates", no_argument, 0, 'D'},
|
||||
{"keep-whitespace", no_argument, 0, 'W'},
|
||||
{"remove-xflip", no_argument, 0, 'X'},
|
||||
{"remove-yflip", no_argument, 0, 'Y'},
|
||||
{"preserve", required_argument, 0, 'r'},
|
||||
{"png", required_argument, 0, 'p'},
|
||||
{"depth", required_argument, 0, 'd'},
|
||||
{"out", required_argument, 0, 'o'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{0}
|
||||
};
|
||||
for (int opt = 0; opt != -1;) {
|
||||
switch (opt = getopt_long(argc, argv, "ho:d:p:", long_options)) {
|
||||
case 'h':
|
||||
Options.help = true;
|
||||
for (int opt; (opt = getopt_long(argc, argv, "d:o:p:h", long_options)) != -1;) {
|
||||
switch (opt) {
|
||||
case 'R':
|
||||
options.remove_whitespace = true;
|
||||
break;
|
||||
case 'o':
|
||||
Options.outfile = optarg;
|
||||
case 'T':
|
||||
options.trim_whitespace = true;
|
||||
break;
|
||||
case 't':
|
||||
options.trim_trailing = true;
|
||||
break;
|
||||
case 'I':
|
||||
options.interleave = true;
|
||||
break;
|
||||
case 'D':
|
||||
options.remove_duplicates = true;
|
||||
break;
|
||||
case 'W':
|
||||
options.keep_whitespace = true;
|
||||
break;
|
||||
case 'X':
|
||||
options.remove_xflip = true;
|
||||
break;
|
||||
case 'Y':
|
||||
options.remove_yflip = true;
|
||||
break;
|
||||
case 'r':
|
||||
for (char *token = strtok(optarg, ","); token; token = strtok(NULL, ",")) {
|
||||
options.preserved = xrealloc(options.preserved, ++options.num_preserved * sizeof(*options.preserved));
|
||||
options.preserved[options.num_preserved-1] = strtoul(token, NULL, 0);
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
Options.depth = strtoul(optarg, NULL, 0);
|
||||
options.depth = strtoul(optarg, NULL, 0);
|
||||
break;
|
||||
case 'p':
|
||||
Options.png_file = optarg;
|
||||
options.png_file = optarg;
|
||||
break;
|
||||
case 0:
|
||||
case -1:
|
||||
case 'o':
|
||||
options.outfile = optarg;
|
||||
break;
|
||||
case 'h':
|
||||
usage_exit(0);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
exit(1);
|
||||
break;
|
||||
usage_exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Graphic {
|
||||
int size;
|
||||
uint8_t *data;
|
||||
long size;
|
||||
};
|
||||
|
||||
bool is_whitespace(uint8_t *tile, int tile_size) {
|
||||
uint8_t WHITESPACE = 0;
|
||||
bool is_preserved(int index) {
|
||||
for (int i = 0; i < options.num_preserved; i++) {
|
||||
if (options.preserved[i] == index) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void shift_preserved(int removed_index) {
|
||||
for (int i = 0; i < options.num_preserved; i++) {
|
||||
if (options.preserved[i] >= removed_index) {
|
||||
options.preserved[i]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool is_whitespace(const uint8_t *tile, int tile_size) {
|
||||
for (int i = 0; i < tile_size; i++) {
|
||||
if (tile[i] != WHITESPACE) {
|
||||
if (tile[i] != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -114,9 +141,9 @@ bool is_solid_color(uint8_t *tile, int depth, int tile_size) {
|
|||
}
|
||||
|
||||
void trim_whitespace(struct Graphic *graphic) {
|
||||
int tile_size = Options.depth * 8;
|
||||
int tile_size = options.depth * 8;
|
||||
for (int i = graphic->size - tile_size; i > 0; i -= tile_size) {
|
||||
if (is_whitespace(&graphic->data[i], tile_size)) {
|
||||
if (is_whitespace(&graphic->data[i], tile_size) && !is_preserved(i / tile_size)) {
|
||||
graphic->size = i;
|
||||
} else {
|
||||
break;
|
||||
|
|
@ -125,9 +152,9 @@ void trim_whitespace(struct Graphic *graphic) {
|
|||
}
|
||||
|
||||
void trim_trailing(struct Graphic *graphic) {
|
||||
int tile_size = Options.depth * 8;
|
||||
int tile_size = options.depth * 8;
|
||||
int last_tile = graphic->size - tile_size;
|
||||
if (!is_solid_color(&graphic->data[last_tile], Options.depth, tile_size)) {
|
||||
if (!is_solid_color(&graphic->data[last_tile], options.depth, tile_size)) {
|
||||
return;
|
||||
}
|
||||
for (int i = graphic->size - 2 * tile_size; i > 0; i -= tile_size) {
|
||||
|
|
@ -139,30 +166,34 @@ void trim_trailing(struct Graphic *graphic) {
|
|||
}
|
||||
}
|
||||
|
||||
int get_tile_size(void) {
|
||||
return options.depth * (options.interleave ? 16 : 8);
|
||||
}
|
||||
|
||||
void remove_whitespace(struct Graphic *graphic) {
|
||||
int tile_size = Options.depth * 8;
|
||||
if (Options.interleave) tile_size *= 2;
|
||||
int tile_size = get_tile_size();
|
||||
graphic->size &= ~(tile_size - 1);
|
||||
int i = 0;
|
||||
for (int j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
while (is_whitespace(&graphic->data[j], tile_size)) {
|
||||
j += tile_size;
|
||||
for (int j = 0, d = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
for (; j < graphic->size && is_whitespace(&graphic->data[j], tile_size) && !is_preserved(j / tile_size - d); j += tile_size, d++) {
|
||||
shift_preserved(j / tile_size - d);
|
||||
}
|
||||
if (j >= graphic->size) {
|
||||
break;
|
||||
}
|
||||
if (j > i) {
|
||||
} else if (j > i) {
|
||||
memcpy(&graphic->data[i], &graphic->data[j], tile_size);
|
||||
}
|
||||
}
|
||||
graphic->size = i;
|
||||
}
|
||||
|
||||
bool tile_exists(uint8_t *tile, uint8_t *tiles, int tile_size, int num_tiles) {
|
||||
bool tile_exists(const uint8_t *tile, const uint8_t *tiles, int tile_size, int num_tiles) {
|
||||
for (int i = 0; i < num_tiles; i++) {
|
||||
bool match = true;
|
||||
for (int j = 0; j < tile_size; j++) {
|
||||
if (tile[j] != tiles[i * tile_size + j]) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (match) {
|
||||
|
|
@ -173,15 +204,15 @@ bool tile_exists(uint8_t *tile, uint8_t *tiles, int tile_size, int num_tiles) {
|
|||
}
|
||||
|
||||
void remove_duplicates(struct Graphic *graphic) {
|
||||
int tile_size = Options.depth * 8;
|
||||
if (Options.interleave) tile_size *= 2;
|
||||
int tile_size = get_tile_size();
|
||||
graphic->size &= ~(tile_size - 1);
|
||||
int num_tiles = 0;
|
||||
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
while (tile_exists(&graphic->data[j], graphic->data, tile_size, num_tiles)) {
|
||||
if (Options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) {
|
||||
for (int i = 0, j = 0, d = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
for (; j < graphic->size && tile_exists(&graphic->data[j], graphic->data, tile_size, num_tiles); j += tile_size, d++) {
|
||||
if ((options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) || is_preserved(j / tile_size - d)) {
|
||||
break;
|
||||
}
|
||||
j += tile_size;
|
||||
shift_preserved(j / tile_size - d);
|
||||
}
|
||||
if (j >= graphic->size) {
|
||||
break;
|
||||
|
|
@ -194,41 +225,49 @@ void remove_duplicates(struct Graphic *graphic) {
|
|||
graphic->size = num_tiles * tile_size;
|
||||
}
|
||||
|
||||
bool flip_exists(uint8_t *tile, uint8_t *tiles, int tile_size, int num_tiles, bool xflip, bool yflip) {
|
||||
uint8_t *flip = calloc(tile_size, 1);
|
||||
// for (int i = 0; i < 256; i++)
|
||||
// for (int bit = 0; bit < 8; bit++) {
|
||||
// flipped[i] |= ((i >> bit) & 1) << (7 - bit);
|
||||
const uint8_t flipped[256] = {
|
||||
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
|
||||
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
|
||||
0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
|
||||
0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
|
||||
0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
|
||||
0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
|
||||
0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
|
||||
0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
|
||||
0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
|
||||
0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
|
||||
0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
|
||||
0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
|
||||
0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
|
||||
0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
|
||||
0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
|
||||
0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
|
||||
};
|
||||
|
||||
bool flip_exists(const uint8_t *tile, const uint8_t *tiles, int tile_size, int num_tiles, bool xflip, bool yflip) {
|
||||
uint8_t flip[tile_size]; // VLA
|
||||
memset(flip, 0, tile_size);
|
||||
int half_size = tile_size / 2;
|
||||
for (int i = 0; i < tile_size; i++) {
|
||||
int byte = i;
|
||||
if (yflip) {
|
||||
byte = tile_size - 1 - (i ^ 1);
|
||||
if (Options.interleave && i < half_size) {
|
||||
byte = half_size - 1 - (i ^ 1);
|
||||
}
|
||||
}
|
||||
if (xflip) {
|
||||
for (int bit = 0; bit < 8; bit++) {
|
||||
flip[byte] |= ((tile[i] >> bit) & 1) << (7 - bit);
|
||||
}
|
||||
} else {
|
||||
flip[byte] = tile[i];
|
||||
}
|
||||
int j = yflip ? (options.interleave && i < half_size ? half_size : tile_size) - 1 - (i ^ 1) : i;
|
||||
flip[j] = xflip ? flipped[tile[i]] : tile[i];
|
||||
}
|
||||
if (tile_exists(flip, tiles, tile_size, num_tiles)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return tile_exists(flip, tiles, tile_size, num_tiles);
|
||||
}
|
||||
|
||||
void remove_flip(struct Graphic *graphic, bool xflip, bool yflip) {
|
||||
int tile_size = Options.depth * 8;
|
||||
if (Options.interleave) tile_size *= 2;
|
||||
int tile_size = get_tile_size();
|
||||
graphic->size &= ~(tile_size - 1);
|
||||
int num_tiles = 0;
|
||||
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
while (flip_exists(&graphic->data[j], graphic->data, tile_size, num_tiles, xflip, yflip)) {
|
||||
if (Options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) {
|
||||
for (int i = 0, j = 0, d = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||
for (; j < graphic->size && flip_exists(&graphic->data[j], graphic->data, tile_size, num_tiles, xflip, yflip); j += tile_size, d++) {
|
||||
if ((options.keep_whitespace && is_whitespace(&graphic->data[j], tile_size)) || is_preserved(j / tile_size - d)) {
|
||||
break;
|
||||
}
|
||||
j += tile_size;
|
||||
shift_preserved(j / tile_size - d);
|
||||
}
|
||||
if (j >= graphic->size) {
|
||||
break;
|
||||
|
|
@ -242,18 +281,13 @@ void remove_flip(struct Graphic *graphic, bool xflip, bool yflip) {
|
|||
}
|
||||
|
||||
void interleave(struct Graphic *graphic, int width) {
|
||||
int tile_size = Options.depth * 8;
|
||||
int tile_size = options.depth * 8;
|
||||
int width_tiles = width / 8;
|
||||
int num_tiles = graphic->size / tile_size;
|
||||
uint8_t *interleaved = malloc(graphic->size);
|
||||
uint8_t *interleaved = xmalloc(graphic->size);
|
||||
for (int i = 0; i < num_tiles; i++) {
|
||||
int tile = i * 2;
|
||||
int row = i / width_tiles;
|
||||
tile -= width_tiles * row;
|
||||
if (row % 2) {
|
||||
tile -= width_tiles;
|
||||
tile += 1;
|
||||
}
|
||||
int tile = i * 2 - (row % 2 ? width_tiles * (row + 1) - 1 : width_tiles * row);
|
||||
memcpy(&interleaved[tile * tile_size], &graphic->data[i * tile_size], tile_size);
|
||||
}
|
||||
graphic->size = num_tiles * tile_size;
|
||||
|
|
@ -261,78 +295,49 @@ void interleave(struct Graphic *graphic, int width) {
|
|||
free(interleaved);
|
||||
}
|
||||
|
||||
int png_get_width(char *filename) {
|
||||
FILE *f = fopen_verbose(filename, "rb");
|
||||
if (!f) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const int OFFSET_WIDTH = 16;
|
||||
uint8_t bytes[4];
|
||||
fseek(f, OFFSET_WIDTH, SEEK_SET);
|
||||
size_t size = 4;
|
||||
size_t result = fread(bytes, 1, size, f);
|
||||
fclose(f);
|
||||
if (result != size) {
|
||||
fprintf(stderr, "Could not read file at offset 0x%x: \"%s\"\n", OFFSET_WIDTH, filename);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int width = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
width |= bytes[i] << (8 * (3 - i));
|
||||
}
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
get_args(argc, argv);
|
||||
parse_args(argc, argv);
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (Options.help) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
if (argc < 1) {
|
||||
usage();
|
||||
exit(1);
|
||||
usage_exit(1);
|
||||
}
|
||||
char *infile = argv[0];
|
||||
|
||||
struct Graphic graphic;
|
||||
graphic.data = read_u8(infile, &graphic.size);
|
||||
if (Options.trim_whitespace) {
|
||||
graphic.data = read_u8(argv[0], &graphic.size);
|
||||
|
||||
if (options.trim_whitespace) {
|
||||
trim_whitespace(&graphic);
|
||||
} else if (Options.trim_trailing) {
|
||||
} else if (options.trim_trailing) {
|
||||
trim_trailing(&graphic);
|
||||
}
|
||||
if (Options.interleave) {
|
||||
if (!Options.png_file) {
|
||||
error("interleave: need --png to infer dimensions");
|
||||
usage();
|
||||
exit(1);
|
||||
if (options.interleave) {
|
||||
if (!options.png_file) {
|
||||
error_exit("--interleave needs --png to infer dimensions\n");
|
||||
}
|
||||
int width = png_get_width(Options.png_file);
|
||||
int width = read_png_width(options.png_file);
|
||||
interleave(&graphic, width);
|
||||
}
|
||||
if (Options.remove_duplicates) {
|
||||
if (options.remove_duplicates) {
|
||||
remove_duplicates(&graphic);
|
||||
}
|
||||
if (Options.remove_xflip) {
|
||||
if (options.remove_xflip) {
|
||||
remove_flip(&graphic, true, false);
|
||||
}
|
||||
if (Options.remove_yflip) {
|
||||
if (options.remove_yflip) {
|
||||
remove_flip(&graphic, false, true);
|
||||
}
|
||||
if (Options.remove_xflip && Options.remove_yflip) {
|
||||
if (options.remove_xflip && options.remove_yflip) {
|
||||
remove_flip(&graphic, true, true);
|
||||
}
|
||||
if (Options.remove_whitespace) {
|
||||
if (options.remove_whitespace) {
|
||||
remove_whitespace(&graphic);
|
||||
}
|
||||
if (Options.outfile) {
|
||||
write_u8(Options.outfile, graphic.data, graphic.size);
|
||||
if (options.outfile) {
|
||||
write_u8(options.outfile, graphic.data, graphic.size);
|
||||
}
|
||||
|
||||
free(graphic.data);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||