mirror of
https://github.com/pret/pokeruby.git
synced 2026-08-23 19:04:35 -05:00
Merge branch 'master' into fix_nonmatching
This commit is contained in:
File diff suppressed because it is too large
Load Diff
2183
asm/psychic.s
2183
asm/psychic.s
File diff suppressed because it is too large
Load Diff
1643
asm/rock.s
1643
asm/rock.s
File diff suppressed because it is too large
Load Diff
@@ -3,685 +3,6 @@
|
||||
|
||||
.section .rodata
|
||||
|
||||
.align 2
|
||||
gUnknown_083B600C:: @ 83B600C
|
||||
.4byte PCText_WithdrawPoke, PCText_MovePokeToParty
|
||||
.4byte PCText_DepositPoke, PCText_StorePokeInBox
|
||||
.4byte PCText_MovePoke, PCText_OrganizeBoxesParty
|
||||
.4byte PCText_SeeYa, PCText_ReturnToPrevMenu
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B602C:: @ 83B602C
|
||||
obj_image_anim_frame 0, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6034:: @ 83B6034
|
||||
obj_image_anim_frame 4, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B603C:: @ 83B603C
|
||||
obj_image_anim_frame 6, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6044:: @ 83B6044
|
||||
obj_image_anim_frame 10, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnimTable_83B604C:: @ 83B604C
|
||||
.4byte gSpriteAnim_83B602C
|
||||
.4byte gSpriteAnim_83B6034
|
||||
.4byte gSpriteAnim_83B603C
|
||||
.4byte gSpriteAnim_83B6044
|
||||
|
||||
.align 2
|
||||
gSpriteAffineAnim_83B605C:: @ 83B605C
|
||||
obj_rot_scal_anim_frame 0xE0, 0xE0, 0, 0
|
||||
obj_rot_scal_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAffineAnimTable_83B606C:: @ 83B606C
|
||||
.4byte gSpriteAffineAnim_83B605C
|
||||
|
||||
.align 2
|
||||
gBoxSelectionPopupPalette:: @ 83B6070
|
||||
.incbin "graphics/pokemon_storage/box_selection_popup.gbapal"
|
||||
|
||||
.align 2
|
||||
gBoxSelectionPopupCenterTiles:: @ 83B6090
|
||||
.incbin "graphics/pokemon_storage/box_selection_popup_center.4bpp"
|
||||
|
||||
.align 2
|
||||
gBoxSelectionPopupSidesTiles:: @ 83B6890
|
||||
.incbin "graphics/pokemon_storage/box_selection_popup_sides.4bpp"
|
||||
|
||||
.align 2
|
||||
gPokemonStorageScrollingBGPalette:: @ 83B6A10
|
||||
.incbin "graphics/pokemon_storage/scrolling_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gPokemonStorageScrollingBGTile:: @ 83B6A30
|
||||
.incbin "graphics/pokemon_storage/scrolling_bg.4bpp"
|
||||
|
||||
.align 2
|
||||
gPokemonStorageScrollingBGTilemap:: @ 83B6A50
|
||||
.incbin "graphics/pokemon_storage/scrolling_bg_map.bin.lz"
|
||||
|
||||
@ unused tilemap?
|
||||
.2byte 0x1281
|
||||
.2byte 0x1282
|
||||
.2byte 0x1283
|
||||
.2byte 0x1284
|
||||
.2byte 0x1285
|
||||
.2byte 0x1286
|
||||
.2byte 0x1287
|
||||
.2byte 0x1288
|
||||
.2byte 0x128C
|
||||
.2byte 0x128D
|
||||
.2byte 0x128E
|
||||
.2byte 0x128F
|
||||
.2byte 0x1290
|
||||
.2byte 0x1291
|
||||
.2byte 0x1292
|
||||
.2byte 0x1293
|
||||
.2byte 0x0281
|
||||
.2byte 0x0282
|
||||
.2byte 0x0283
|
||||
.2byte 0x0284
|
||||
.2byte 0x0285
|
||||
.2byte 0x0286
|
||||
.2byte 0x0287
|
||||
.2byte 0x0288
|
||||
.2byte 0x028C
|
||||
.2byte 0x028D
|
||||
.2byte 0x028E
|
||||
.2byte 0x028F
|
||||
.2byte 0x0290
|
||||
.2byte 0x0291
|
||||
.2byte 0x0292
|
||||
.2byte 0x0293
|
||||
.2byte 0x12AD
|
||||
.2byte 0x12AE
|
||||
.2byte 0x12A8
|
||||
.2byte 0x12A8
|
||||
|
||||
.align 2
|
||||
WaveformPalette: @ 83B6B94
|
||||
.incbin "graphics/pokemon_storage/waveform.gbapal"
|
||||
|
||||
.align 2
|
||||
WaveformTiles: @ 83B6BB4
|
||||
.incbin "graphics/pokemon_storage/waveform.4bpp"
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6D74:: @ 83B6D74
|
||||
.incbin "graphics/pokemon_storage/83B6D74.gbapal"
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6D94:: @ 83B6D94
|
||||
.incbin "graphics/pokemon_storage/83B6D94.gbapal"
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6DB4:: @ 83B6DB4
|
||||
.4byte gSharedMem
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6DB8:: @ 83B6DB8
|
||||
.4byte gTileBuffer
|
||||
|
||||
.align 2
|
||||
gWaveformSpritePalette:: @ 83B6DBC
|
||||
obj_pal WaveformPalette, 56013
|
||||
|
||||
.align 2
|
||||
gWaveformSpriteSheet:: @ 83B6DC4
|
||||
obj_tiles WaveformTiles, 0x1C0, 5
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6DCC:: @ 83B6DCC
|
||||
obj_tiles gSharedMem + 0x2784, 0x800, 2
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6DD4:: @ 83B6DD4
|
||||
obj_pal gSharedMem + 0x2704, 56007
|
||||
|
||||
.align 2
|
||||
gSpriteTemplate_83B6DDC:: @ 83B6DDC
|
||||
spr_template 2, 56007, gOamData_83B6EAC, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
|
||||
.align 2
|
||||
gUnknown_083B6DF4:: @ 83B6DF4
|
||||
.4byte PCText_ExitBox, 0
|
||||
.4byte PCText_WhatYouDo, 0
|
||||
.4byte PCText_PickATheme, 0
|
||||
.4byte PCText_PickAWallpaper, 0
|
||||
.4byte PCText_IsSelected, 1
|
||||
.4byte PCText_JumpToWhichBox, 0
|
||||
.4byte PCText_DepositInWhichBox, 0
|
||||
.4byte PCText_WasDeposited, 1
|
||||
.4byte PCText_BoxIsFull, 0
|
||||
.4byte PCText_ReleasePoke, 0
|
||||
.4byte PCText_WasReleased, 4
|
||||
.4byte PCText_ByeBye, 6
|
||||
.4byte PCText_MarkPoke, 0
|
||||
.4byte PCText_LastPoke, 0
|
||||
.4byte PCText_PartyFull, 0
|
||||
.4byte PCText_HoldingPoke, 0
|
||||
.4byte PCText_WhichOneWillTake, 0
|
||||
.4byte PCText_CantReleaseEgg, 0
|
||||
.4byte PCText_ContinueBox, 0
|
||||
.4byte PCText_CameBack, 1
|
||||
.4byte PCText_Worried, 0
|
||||
.4byte PCText_Surprise, 0
|
||||
.4byte PCText_PleaseRemoveMail, 0
|
||||
|
||||
.align 2
|
||||
gOamData_83B6EAC:: @ 83B6EAC
|
||||
.2byte 0x0000
|
||||
.2byte 0xC000
|
||||
.2byte 0x0000
|
||||
|
||||
.align 2
|
||||
gOamData_83B6EB4:: @ 83B6EB4
|
||||
.2byte 0x4000
|
||||
.2byte 0x0000
|
||||
.2byte 0x0000
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6EBC:: @ 83B6EBC
|
||||
obj_image_anim_frame 0, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6EC4:: @ 83B6EC4
|
||||
obj_image_anim_frame 2, 8
|
||||
obj_image_anim_frame 4, 8
|
||||
obj_image_anim_frame 6, 8
|
||||
obj_image_anim_jump 0
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6ED4:: @ 83B6ED4
|
||||
obj_image_anim_frame 8, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83B6EDC:: @ 83B6EDC
|
||||
obj_image_anim_frame 10, 8
|
||||
obj_image_anim_frame 4, 8
|
||||
obj_image_anim_frame 12, 8
|
||||
obj_image_anim_jump 0
|
||||
|
||||
.align 2
|
||||
gSpriteAnimTable_83B6EEC:: @ 83B6EEC
|
||||
.4byte gSpriteAnim_83B6EBC
|
||||
.4byte gSpriteAnim_83B6EC4
|
||||
.4byte gSpriteAnim_83B6ED4
|
||||
.4byte gSpriteAnim_83B6EDC
|
||||
|
||||
.align 2
|
||||
gSpriteTemplate_83B6EFC:: @ 83B6EFC
|
||||
spr_template 5, 56013, gOamData_83B6EB4, gSpriteAnimTable_83B6EEC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
|
||||
.align 2
|
||||
gSpriteTemplate_83B6F14:: @ 83B6F14
|
||||
spr_template 15, 56000, gOamData_83B6F2C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
|
||||
.align 2
|
||||
gOamData_83B6F2C:: @ 83B6F2C
|
||||
.2byte 0x0000
|
||||
.2byte 0x8000
|
||||
.2byte 0x0000
|
||||
|
||||
.align 2
|
||||
gSpriteAffineAnim_83B6F34:: @ 83B6F34
|
||||
obj_rot_scal_anim_frame 0xFFFE, 0xFFFE, 0, 120
|
||||
obj_rot_scal_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAffineAnim_83B6F44:: @ 83B6F44
|
||||
obj_rot_scal_anim_frame 0x10, 0x10, 0, 0
|
||||
obj_rot_scal_anim_frame 0x10, 0x10, 0, 15
|
||||
obj_rot_scal_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAffineAnimTable_83B6F5C:: @ 83B6F5C
|
||||
.4byte gSpriteAffineAnim_83B6F34
|
||||
.4byte gSpriteAffineAnim_83B6F44
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Forest: @ 83B6F64
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/forest_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/forest_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Forest: @ 83B6FC4
|
||||
.incbin "graphics/pokemon_storage/forest.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Forest: @ 83B7394
|
||||
.incbin "graphics/pokemon_storage/forest.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_City: @ 83B7470
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/city_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/city_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_City: @ 83B74D0
|
||||
.incbin "graphics/pokemon_storage/city.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_City: @ 83B76D8
|
||||
.incbin "graphics/pokemon_storage/city.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Desert: @ 83B7788
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/desert_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/desert_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Desert: @ 83B77E8
|
||||
.incbin "graphics/pokemon_storage/desert.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Desert: @ 83B7AD4
|
||||
.incbin "graphics/pokemon_storage/desert.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Savanna: @ 83B7BB8
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/savanna_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/savanna_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Savanna: @ 83B7C18
|
||||
.incbin "graphics/pokemon_storage/savanna.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Savanna: @ 83B7E38
|
||||
.incbin "graphics/pokemon_storage/savanna.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Crag: @ 83B7F04
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/crag_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/crag_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Crag: @ 83B7F64
|
||||
.incbin "graphics/pokemon_storage/crag.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Crag: @ 83B82B4
|
||||
.incbin "graphics/pokemon_storage/crag.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Volcano: @ 83B838C
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/volcano_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/volcano_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Volcano: @ 83B83EC
|
||||
.incbin "graphics/pokemon_storage/volcano.4bpp.lz"
|
||||
|
||||
.space 4
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Volcano: @ 83B8720
|
||||
.incbin "graphics/pokemon_storage/volcano.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Snow: @ 83B87F8
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/snow_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/snow_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Snow: @ 83B8858
|
||||
.incbin "graphics/pokemon_storage/snow.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Snow: @ 83B8B10
|
||||
.incbin "graphics/pokemon_storage/snow.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Cave: @ 83B8BDC
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/cave_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/cave_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Cave: @ 83B8C3C
|
||||
.incbin "graphics/pokemon_storage/cave.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Cave: @ 83B8F80
|
||||
.incbin "graphics/pokemon_storage/cave.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Beach: @ 83B905C
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/beach_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/beach_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Beach: @ 83B90BC
|
||||
.incbin "graphics/pokemon_storage/beach.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Beach: @ 83B9440
|
||||
.incbin "graphics/pokemon_storage/beach.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Seafloor: @ 83B9528
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/seafloor_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/seafloor_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Seafloor: @ 83B9588
|
||||
.incbin "graphics/pokemon_storage/seafloor.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Seafloor: @ 83B983C
|
||||
.incbin "graphics/pokemon_storage/seafloor.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_River: @ 83B9918
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/river_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/river_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_River: @ 83B9978
|
||||
.incbin "graphics/pokemon_storage/river.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_River: @ 83B9C0C
|
||||
.incbin "graphics/pokemon_storage/river.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Sky: @ 83B9CF8
|
||||
.incbin "graphics/pokemon_storage/box_bg1.gbapal"
|
||||
.incbin "graphics/pokemon_storage/sky_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/sky_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Sky: @ 83B9D58
|
||||
.incbin "graphics/pokemon_storage/sky.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Sky: @ 83B9FF0
|
||||
.incbin "graphics/pokemon_storage/sky.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Polkadot: @ 83BA0D0
|
||||
.incbin "graphics/pokemon_storage/box_bg2.gbapal"
|
||||
.incbin "graphics/pokemon_storage/polkadot_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/polkadot_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Polkadot: @ 83BA130
|
||||
.incbin "graphics/pokemon_storage/polkadot.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Polkadot: @ 83BA32C
|
||||
.incbin "graphics/pokemon_storage/polkadot.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Pokecenter: @ 83BA3E4
|
||||
.incbin "graphics/pokemon_storage/box_bg2.gbapal"
|
||||
.incbin "graphics/pokemon_storage/pokecenter_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/pokecenter_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Pokecenter: @ 83BA444
|
||||
.incbin "graphics/pokemon_storage/pokecenter.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Pokecenter: @ 83BA7E8
|
||||
.incbin "graphics/pokemon_storage/pokecenter.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Machine: @ 83BA8FC
|
||||
.incbin "graphics/pokemon_storage/box_bg3.gbapal"
|
||||
.incbin "graphics/pokemon_storage/machine_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/machine_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Machine: @ 83BA95C
|
||||
.incbin "graphics/pokemon_storage/machine.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Machine: @ 83BAC4C
|
||||
.incbin "graphics/pokemon_storage/machine.bin.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperPalettes_Plain: @ 83BAD18
|
||||
.incbin "graphics/pokemon_storage/box_bg4.gbapal"
|
||||
.incbin "graphics/pokemon_storage/plain_frame.gbapal"
|
||||
.incbin "graphics/pokemon_storage/plain_bg.gbapal"
|
||||
|
||||
.align 2
|
||||
gWallpaperTiles_Plain: @ 83BAD78
|
||||
.incbin "graphics/pokemon_storage/plain.4bpp.lz"
|
||||
|
||||
.align 2
|
||||
gWallpaperTilemap_Plain: @ 83BAE74
|
||||
.incbin "graphics/pokemon_storage/plain.bin.lz"
|
||||
|
||||
@ 12×18 tilemap
|
||||
.incbin "graphics/unused/tilemap_3BAEF8.bin"
|
||||
|
||||
.align 1
|
||||
gUnknown_083BB0A8:: @ 83BB0A8
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
.2byte 0x1CE7, 0x7FFF
|
||||
|
||||
.align 2
|
||||
gWallpaperTable:: @ 83BB0E8
|
||||
@ Forest
|
||||
.4byte gWallpaperTiles_Forest
|
||||
.4byte 0x3D0
|
||||
.4byte gWallpaperTilemap_Forest
|
||||
.4byte gWallpaperPalettes_Forest
|
||||
|
||||
@ City
|
||||
.4byte gWallpaperTiles_City
|
||||
.4byte 0x208
|
||||
.4byte gWallpaperTilemap_City
|
||||
.4byte gWallpaperPalettes_City
|
||||
|
||||
@ Desert
|
||||
.4byte gWallpaperTiles_Desert
|
||||
.4byte 0x2EC
|
||||
.4byte gWallpaperTilemap_Desert
|
||||
.4byte gWallpaperPalettes_Desert
|
||||
|
||||
@ Savanna
|
||||
.4byte gWallpaperTiles_Savanna
|
||||
.4byte 0x220
|
||||
.4byte gWallpaperTilemap_Savanna
|
||||
.4byte gWallpaperPalettes_Savanna
|
||||
|
||||
@ Crag
|
||||
.4byte gWallpaperTiles_Crag
|
||||
.4byte 0x350
|
||||
.4byte gWallpaperTilemap_Crag
|
||||
.4byte gWallpaperPalettes_Crag
|
||||
|
||||
@ Volcano
|
||||
.4byte gWallpaperTiles_Volcano
|
||||
.4byte 0x334
|
||||
.4byte gWallpaperTilemap_Volcano
|
||||
.4byte gWallpaperPalettes_Volcano
|
||||
|
||||
@ Snow
|
||||
.4byte gWallpaperTiles_Snow
|
||||
.4byte 0x2B8
|
||||
.4byte gWallpaperTilemap_Snow
|
||||
.4byte gWallpaperPalettes_Snow
|
||||
|
||||
@ Cave
|
||||
.4byte gWallpaperTiles_Cave
|
||||
.4byte 0x344
|
||||
.4byte gWallpaperTilemap_Cave
|
||||
.4byte gWallpaperPalettes_Cave
|
||||
|
||||
@ Beach
|
||||
.4byte gWallpaperTiles_Beach
|
||||
.4byte 0x384
|
||||
.4byte gWallpaperTilemap_Beach
|
||||
.4byte gWallpaperPalettes_Beach
|
||||
|
||||
@ Seafloor
|
||||
.4byte gWallpaperTiles_Seafloor
|
||||
.4byte 0x2B4
|
||||
.4byte gWallpaperTilemap_Seafloor
|
||||
.4byte gWallpaperPalettes_Seafloor
|
||||
|
||||
@ River
|
||||
.4byte gWallpaperTiles_River
|
||||
.4byte 0x294
|
||||
.4byte gWallpaperTilemap_River
|
||||
.4byte gWallpaperPalettes_River
|
||||
|
||||
@ Sky
|
||||
.4byte gWallpaperTiles_Sky
|
||||
.4byte 0x298
|
||||
.4byte gWallpaperTilemap_Sky
|
||||
.4byte gWallpaperPalettes_Sky
|
||||
|
||||
@ Polkadot
|
||||
.4byte gWallpaperTiles_Polkadot
|
||||
.4byte 0x1FC
|
||||
.4byte gWallpaperTilemap_Polkadot
|
||||
.4byte gWallpaperPalettes_Polkadot
|
||||
|
||||
@ Pokecenter
|
||||
.4byte gWallpaperTiles_Pokecenter
|
||||
.4byte 0x3A4
|
||||
.4byte gWallpaperTilemap_Pokecenter
|
||||
.4byte gWallpaperPalettes_Pokecenter
|
||||
|
||||
@ Machine
|
||||
.4byte gWallpaperTiles_Machine
|
||||
.4byte 0x2F0
|
||||
.4byte gWallpaperTilemap_Machine
|
||||
.4byte gWallpaperPalettes_Machine
|
||||
|
||||
@ Plain
|
||||
.4byte gWallpaperTiles_Plain
|
||||
.4byte 0xFC
|
||||
.4byte gWallpaperTilemap_Plain
|
||||
.4byte gWallpaperPalettes_Plain
|
||||
|
||||
PCPal_Arrow:
|
||||
.incbin "graphics/pokemon_storage/arrow.gbapal"
|
||||
PCGfx_Arrow:
|
||||
.incbin "graphics/pokemon_storage/arrow.4bpp"
|
||||
|
||||
.align 2
|
||||
gUnknown_083BB288:: @ 83BB288
|
||||
obj_tiles PCGfx_Arrow, 128, 0x0006
|
||||
|
||||
.align 2
|
||||
gUnknown_083BB290:: @ 83BB290
|
||||
obj_pal PCPal_Arrow, 0xDACF
|
||||
|
||||
.align 2
|
||||
gOamData_83BB298:: @ 83BB298
|
||||
.2byte 0x4000
|
||||
.2byte 0x8000
|
||||
.2byte 0x0800
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83BB2A0:: @ 83BB2A0
|
||||
obj_image_anim_frame 0, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83BB2A8:: @ 83BB2A8
|
||||
obj_image_anim_frame 8, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnimTable_83BB2B0:: @ 83BB2B0
|
||||
.4byte gSpriteAnim_83BB2A0
|
||||
.4byte gSpriteAnim_83BB2A8
|
||||
|
||||
.align 2
|
||||
gSpriteTemplate_83BB2B8:: @ 83BB2B8
|
||||
spr_template 3, 56008, gOamData_83BB298, gSpriteAnimTable_83BB2B0, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
|
||||
.align 2
|
||||
gOamData_83BB2D0:: @ 83BB2D0
|
||||
.2byte 0x8000
|
||||
.2byte 0x0000
|
||||
.2byte 0x0800
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83BB2D8:: @ 83BB2D8
|
||||
obj_image_anim_frame 0, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnim_83BB2E0:: @ 83BB2E0
|
||||
obj_image_anim_frame 2, 5
|
||||
obj_image_anim_end
|
||||
|
||||
.align 2
|
||||
gSpriteAnimTable_83BB2E8:: @ 83BB2E8
|
||||
.4byte gSpriteAnim_83BB2D8
|
||||
.4byte gSpriteAnim_83BB2E0
|
||||
|
||||
.align 2
|
||||
gSpriteTemplate_83BB2F0:: @ 83BB2F0
|
||||
spr_template 6, 56015, gOamData_83BB2D0, gSpriteAnimTable_83BB2E8, NULL, gDummySpriteAffineAnimTable, sub_809A8C8
|
||||
|
||||
.align 2
|
||||
HandCursorPalette: @ 83BB308
|
||||
.incbin "graphics/pokemon_storage/hand_cursor_pal.bin"
|
||||
|
||||
.align 2
|
||||
HandCursorAltPalette: @ 83BB328
|
||||
.incbin "graphics/pokemon_storage/hand_cursor_alt_pal.bin"
|
||||
|
||||
.align 2
|
||||
HandCursorTiles: @ 83BB348
|
||||
.incbin "graphics/pokemon_storage/hand_cursor.4bpp"
|
||||
|
||||
.align 2
|
||||
HandCursorShadowTiles: @ 83BBB48
|
||||
.incbin "graphics/pokemon_storage/hand_cursor_shadow.4bpp"
|
||||
|
||||
.align 2
|
||||
gUnknown_083BBBC8:: @ 83BBBC8
|
||||
.4byte sub_809B150
|
||||
.4byte sub_809B1D8
|
||||
.4byte sub_809B24C
|
||||
|
||||
.align 2
|
||||
gUnknown_083BBBD4:: @ 83BBBD4
|
||||
.4byte sub_809C464, 0
|
||||
|
||||
@@ -63,5 +63,6 @@ void sub_80763FC(u16 a, u16 *b, u32 c, u8 d);
|
||||
s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
|
||||
s16 sub_8077104(s16 newPan, int oldPan);
|
||||
void DestroyAnimSoundTask(u8 taskId);
|
||||
void sub_8076464(u8 a);
|
||||
|
||||
#endif
|
||||
|
||||
11
include/credits.h
Normal file
11
include/credits.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef GUARD_credits_H
|
||||
#define GUARD_credits_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void sub_81439D0(void);
|
||||
|
||||
#endif //GUARD_credits_H
|
||||
@@ -127,17 +127,12 @@ extern u8 gUnknown_020388F5;
|
||||
extern u8 gUnknown_020388F6;
|
||||
extern u8 gUnknown_020388D6[16];
|
||||
extern u8 gUnknown_020388E6[12];
|
||||
extern u16 gSpecialVar_0x8004;
|
||||
extern u16 gSpecialVar_0x8005;
|
||||
extern u16 gSpecialVar_0x8006;
|
||||
extern u16 gSpecialVar_0x8007;
|
||||
extern u16 gUnknown_020391A4;
|
||||
extern u16 gUnknown_020391A6;
|
||||
extern u8 gUnknown_020391A8;
|
||||
extern u8 gUnknown_020391A9;
|
||||
extern u8 gUnknown_020391AA;
|
||||
extern u8 gUnknown_02039234;
|
||||
extern void (*gFieldCallback)(void);
|
||||
extern const struct YesNoFuncTable gUnknown_083EC96C[];
|
||||
extern struct UnkStruct_020391B4 gUnknown_020391B4[16];
|
||||
|
||||
@@ -160,7 +155,6 @@ extern const struct YesNoFuncTable gUnknown_083ECAA0;
|
||||
extern u8 sub_8134194(u8); // src/decoration_inventory
|
||||
extern bool8 sub_81341D4(void); // src/decoration_inventory
|
||||
extern void sub_8134104(u8); // src/decoration_inventory
|
||||
extern bool8 IsWeatherNotFadingIn(void);
|
||||
extern void sub_8109DAC(u8); // src/trader
|
||||
extern void ReshowPlayerPC(u8); // src/player_pc
|
||||
void Task_SecretBasePC_Decoration(u8);
|
||||
|
||||
@@ -28,6 +28,7 @@ extern u8 gSharedMem[];
|
||||
#define ewram0_9(i) (u8 *)(ewram_addr + (i * 0x20))
|
||||
#define ewram0_10 (*(struct UnknownPokenav0*)(gSharedMem + 0))
|
||||
#define ewram0_11 (*(struct UnknownPokenav0_1*)(gSharedMem + 0))
|
||||
#define ePokemonStorageSystem (*(struct PokemonStorageSystemData *)(gSharedMem + 0))
|
||||
#define ewram4 (*(struct UnknownStruct8 *)(gSharedMem + 0x4))
|
||||
#define ewram520 ((struct UnknownStruct7 *)(gSharedMem + 0x00520))
|
||||
#define ewram520_2 (u8 *)(ewram_addr + 0x520)
|
||||
@@ -38,10 +39,6 @@ extern u8 gSharedMem[];
|
||||
#define ewram01000 (*(struct Unk2001000 *)(gSharedMem + 0x1000))
|
||||
#define ewramBerryPicTemp (gSharedMem + 0x1000)
|
||||
#define EWRAM_1000 (*(struct Struct2001000 *)(gSharedMem + 0x1000))
|
||||
#define gUnk20011fa (u8 *)(&gSharedMem[0x11FA])
|
||||
#define gUnk2002694 (u8 *)(&gSharedMem[0x2694])
|
||||
#define gUnk20026A6 (u8 *)(&gSharedMem[0x26A6])
|
||||
#define gUnk20026e4 (u8 *)(&gSharedMem[0x26E4])
|
||||
#define ewram4000 (gSharedMem + 0x4000)
|
||||
#define gUnknown_02007000 (*(ewramStruct_02007000 *)(gSharedMem + 0x7000))
|
||||
#define ARRAY_2007800 ((struct EasyChatPair *)(gSharedMem + 0x7800))
|
||||
@@ -251,6 +248,7 @@ extern u8 gSharedMem[];
|
||||
#define ewram1C000 (*(struct Unk201C000 *)(gSharedMem + 0x1C000))
|
||||
#define ewram1c000 (*(struct Unk201C000 *)(gSharedMem + 0x1C000)) // FIXME, names too similar
|
||||
#define eHallOfFameMons1 (struct HallofFameMons*)(&gSharedMem[0x1C000])
|
||||
#define eHOFPCScreenEffect (*(struct PCScreenEffectStruct *)(gSharedMem + 0x1c000))
|
||||
#define EWRAM_1C800 (*(struct Unk201C800 *)(gSharedMem + 0x1C800))
|
||||
#define ewram1D000 ((struct Pokemon *)(gSharedMem + 0x1D000))
|
||||
#define ewram1D000_2 ((u16 *)(gSharedMem + 0x1D000))
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
#define DmaClearLarge(dmaNum, dest, size, block, bit) \
|
||||
{ \
|
||||
const void *_dest = dest; \
|
||||
void *_dest = dest; \
|
||||
u32 _size = size; \
|
||||
while (1) \
|
||||
{ \
|
||||
|
||||
@@ -2739,7 +2739,15 @@ extern const u16 gCableCar_Pal[];
|
||||
extern const u16 gCableCarBG_Pal[];
|
||||
extern const u8 gCableCarBG_Gfx[];
|
||||
|
||||
// data/graphics.s
|
||||
extern const u8 gPSSMenuHeader_Gfx[];
|
||||
extern const u8 gPSSMenuHeader_Tilemap[];
|
||||
extern const u16 gPSSMenu1_Pal[];
|
||||
extern const u16 gPSSMenu2_Pal[];
|
||||
extern const u8 gPSSMenuMisc_Gfx[];
|
||||
extern const u8 gPSSMenuMisc_Tilemap[];
|
||||
extern const u16 gPSSMenu3_Pal[];
|
||||
extern const u16 gPSSMenu4_Pal[];
|
||||
|
||||
extern struct CompressedSpriteSheet gBattleAnimSpriteSheet_000;
|
||||
extern struct CompressedSpriteSheet gBattleAnimSpriteSheet_001;
|
||||
extern struct CompressedSpriteSheet gBattleAnimSpriteSheet_002;
|
||||
|
||||
12
include/hof_pc.h
Normal file
12
include/hof_pc.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef GUARD_hof_pc_H
|
||||
#define GUARD_hof_pc_H
|
||||
|
||||
// Exported type declarations
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void ReturnFromHallOfFamePC(void);
|
||||
|
||||
#endif //GUARD_hof_pc_H
|
||||
@@ -51,6 +51,8 @@ extern bool8 gLinkVSyncDisabled;
|
||||
extern const u8 gGameVersion;
|
||||
extern const u8 gGameLanguage;
|
||||
|
||||
extern u16 gKeyRepeatStartDelay;
|
||||
|
||||
void AgbMain(void);
|
||||
void SetMainCallback2(MainCallback callback);
|
||||
void InitKeys(void);
|
||||
|
||||
31
include/mon_markings.h
Normal file
31
include/mon_markings.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef POKERUBY_MON_MARKINGS_H
|
||||
#define POKERUBY_MON_MARKINGS_H
|
||||
|
||||
struct PokemonMarkMenu
|
||||
{
|
||||
/*0x0000*/ u16 baseTileTag;
|
||||
/*0x0002*/ u16 basePaletteTag;
|
||||
/*0x0004*/ u8 markings; // bit flags
|
||||
/*0x0005*/ s8 cursorPos;
|
||||
/*0x0006*/ bool8 markingsArray[4];
|
||||
/*0x000A*/ u8 cursorBaseY;
|
||||
/*0x000B*/ bool8 spriteSheetLoadRequired;
|
||||
/*0x000C*/ struct Sprite *menuWindowSprites[2]; // upper and lower halves of menu window
|
||||
/*0x0014*/ struct Sprite *menuMarkingSprites[4];
|
||||
/*0x0024*/ struct Sprite *menuTextSprite;
|
||||
/*0x0028*/ const u8 *frameTiles;
|
||||
/*0x002C*/ const u16 *framePalette;
|
||||
/*0x0030*/ u8 menuWindowSpriteTiles[0x1000];
|
||||
/*0x1030*/ u8 filler1030[0x80];
|
||||
/*0x10B0*/ u8 tileLoadState;
|
||||
}; // 10b4
|
||||
|
||||
void sub_80F727C(struct PokemonMarkMenu *ptr);
|
||||
void sub_80F7404(void);
|
||||
void sub_80F7418(u8 markings, s16 x, s16 y);
|
||||
void sub_80F7470(void);
|
||||
bool8 sub_80F7500(void);
|
||||
struct Sprite *sub_80F7940(u16 tileTag, u16 paletteTag, const u16 *palette);
|
||||
void sub_80F7A10(u8 markings, void *dest);
|
||||
|
||||
#endif //POKERUBY_MON_MARKINGS_H
|
||||
21
include/pc_screen_effect.h
Normal file
21
include/pc_screen_effect.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef GUARD_PC_SCREEN_EFFECT_H
|
||||
#define GUARD_PC_SCREEN_EFFECT_H
|
||||
|
||||
struct PCScreenEffectStruct
|
||||
{
|
||||
/*0x00*/ u16 tileTag;
|
||||
/*0x02*/ u16 paletteTag;
|
||||
/*0x04*/ u16 unk04;
|
||||
/*0x06*/ u16 unk06;
|
||||
/*0x08*/ u16 unk08;
|
||||
/*0x0A*/ u16 unk0A;
|
||||
/*0x0C*/ s16 unk0C;
|
||||
/*0x10*/ u32 selectedPalettes;
|
||||
};
|
||||
|
||||
void sub_80C5CD4(struct PCScreenEffectStruct *unkStruct);
|
||||
bool8 sub_80C5DCC(void);
|
||||
void sub_80C5E38(struct PCScreenEffectStruct *unkStruct);
|
||||
bool8 sub_80C5F98(void);
|
||||
|
||||
#endif //GUARD_PC_SCREEN_EFFECT_H
|
||||
@@ -428,10 +428,10 @@ struct BattleMove
|
||||
|
||||
struct PokemonStorage
|
||||
{
|
||||
/*0x00*/ u8 currentBox;
|
||||
/*0x01*/ struct BoxPokemon boxes[14][30];
|
||||
u8 boxNames[14][9];
|
||||
u8 unkArray[14];
|
||||
/*0x0000*/ u8 currentBox;
|
||||
/*0x0004*/ struct BoxPokemon boxes[14][30];
|
||||
/*0x8344*/ u8 boxNames[14][9];
|
||||
/*0x83c2*/ u8 wallpaper[14];
|
||||
};
|
||||
|
||||
struct SpindaSpot
|
||||
@@ -522,7 +522,7 @@ void sub_803ADE8(struct Pokemon *mon, struct UnknownPokemonStruct *src);
|
||||
void sub_803AF78(struct Pokemon *mon, struct UnknownPokemonStruct *dest);
|
||||
u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon);
|
||||
void CalculateMonStats(struct Pokemon *mon);
|
||||
void sub_803B4B4(const struct BoxPokemon *src, struct Pokemon *dest);
|
||||
void ExpandBoxMon(const struct BoxPokemon *src, struct Pokemon *dest);
|
||||
u8 GetLevelFromMonExp(struct Pokemon *mon);
|
||||
u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon);
|
||||
u16 GiveMoveToMon(struct Pokemon *mon, u16 move);
|
||||
@@ -627,9 +627,8 @@ void RandomlyGivePartyPokerus(struct Pokemon *party);
|
||||
void PartySpreadPokerus(struct Pokemon *party);
|
||||
|
||||
struct Sprite *sub_80F7920(u16, u16, const u16 *);
|
||||
void BoxMonRestorePP(struct BoxPokemon *);
|
||||
|
||||
bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId);
|
||||
|
||||
|
||||
|
||||
#endif // GUARD_POKEMON_H
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef GUARD_POKEMON_ICON_H
|
||||
#define GUARD_POKEMON_ICON_H
|
||||
|
||||
extern const u8 * const gMonIconTable[];
|
||||
extern const u8 gMonIconPaletteIndices[];
|
||||
|
||||
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
|
||||
u8 UpdateMonIconFrame(struct Sprite *sprite);
|
||||
u8 sub_809D3A4(u16 arg0, void (*)(struct Sprite *), int, u8 arg3, u32 arg4);
|
||||
@@ -12,5 +15,6 @@ void sub_809D580(u16);
|
||||
void sub_809D608(u16);
|
||||
void sub_809D62C(struct Sprite *sprite);
|
||||
void sub_809D824(struct Sprite *sprite, u8 animNum);
|
||||
u16 mon_icon_convert_unown_species_id(u16 species, u32 personality);
|
||||
|
||||
#endif // GUARD_POKEMON_ICON_H
|
||||
|
||||
@@ -1,8 +1,302 @@
|
||||
#ifndef GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
#define GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
|
||||
#include "pc_screen_effect.h"
|
||||
#include "mon_markings.h"
|
||||
|
||||
enum {
|
||||
PC_TEXT_EXIT_BOX,
|
||||
PC_TEXT_WHAT_YOU_DO,
|
||||
PC_TEXT_PICK_A_THEME,
|
||||
PC_TEXT_PICK_A_WALLPAPER,
|
||||
PC_TEXT_IS_SELECTED,
|
||||
PC_TEXT_JUMP_TO_WHICH_BOX,
|
||||
PC_TEXT_DEPOSIT_IN_WHICH_BOX,
|
||||
PC_TEXT_WAS_DEPOSITED,
|
||||
PC_TEXT_BOX_IS_FULL,
|
||||
PC_TEXT_RELEASE_POKE,
|
||||
PC_TEXT_WAS_RELEASED,
|
||||
PC_TEXT_BYE_BYE,
|
||||
PC_TEXT_MARK_POKE,
|
||||
PC_TEXT_LAST_POKE,
|
||||
PC_TEXT_PARTY_FULL,
|
||||
PC_TEXT_HOLDING_POKE,
|
||||
PC_TEXT_WHICH_ONE_WILL_TAKE,
|
||||
PC_TEXT_CANT_RELEASE_EGG,
|
||||
PC_TEXT_CONTINUE_BOX,
|
||||
PC_TEXT_CAME_BACK,
|
||||
PC_TEXT_WORRIED,
|
||||
PC_TEXT_SURPRISE,
|
||||
PC_TEXT_PLEASE_REMOVE_MAIL
|
||||
};
|
||||
|
||||
enum {
|
||||
PC_TEXT_FMT_NORMAL,
|
||||
PC_TEXT_FMT_MON_NAME,
|
||||
PC_TEXT_FMT_UNK_02,
|
||||
PC_TEXT_FMT_UNK_03,
|
||||
PC_TEXT_FMT_MON_NAME_2,
|
||||
PC_TEXT_FMT_UNK_05,
|
||||
PC_TEXT_FMT_MON_NAME_AFTER_EXCL_MARK
|
||||
};
|
||||
|
||||
struct StorageAction {
|
||||
const u8 *text;
|
||||
u8 format;
|
||||
};
|
||||
|
||||
struct PSS_MenuStringPtrs {
|
||||
const u8 *text;
|
||||
const u8 *desc;
|
||||
};
|
||||
|
||||
struct UnkStruct_2000028 {
|
||||
void *unk_00;
|
||||
void *unk_04;
|
||||
u16 unk_08;
|
||||
u16 unk_0a;
|
||||
void (*unk_0c)(struct UnkStruct_2000028 *data);
|
||||
};
|
||||
|
||||
struct UnkStruct_2000020 {
|
||||
struct UnkStruct_2000028 *unk_00;
|
||||
u8 unk_04;
|
||||
u8 unk_05;
|
||||
};
|
||||
|
||||
struct UnkPSSStruct_2002370 {
|
||||
struct Sprite *unk_0000;
|
||||
struct Sprite *unk_0004[4];
|
||||
u32 unk_0014[3];
|
||||
struct Sprite *unk_0020[2];
|
||||
u8 filler_0028[0x214];
|
||||
u8 curBox;
|
||||
u8 unk_023d;
|
||||
u8 unk_023e;
|
||||
u16 unk_0240;
|
||||
u16 unk_0242;
|
||||
}; // 0244
|
||||
|
||||
struct PokemonStorageSystemData {
|
||||
void (*unk_0000)(void);
|
||||
u8 unk_0004;
|
||||
u8 unk_0005;
|
||||
u8 unk_0006;
|
||||
u8 unk_0007;
|
||||
u16 unk_0008;
|
||||
u16 unk_000a;
|
||||
struct PCScreenEffectStruct unk_000c;
|
||||
struct UnkStruct_2000020 unk_0020;
|
||||
struct UnkStruct_2000028 unk_0028[8];
|
||||
u16 unk_00a8[0x400];
|
||||
u16 unk_08a8;
|
||||
u16 unk_08aa;
|
||||
u8 unk_08ac;
|
||||
u8 unk_08ad;
|
||||
u8 unk_08ae;
|
||||
u8 unk_08af;
|
||||
u8 unk_08b0;
|
||||
bool8 unk_08b1;
|
||||
s16 unk_08b2;
|
||||
u16 unk_08b4;
|
||||
u16 unk_08b6;
|
||||
u16 unk_08b8;
|
||||
bool8 unk_08ba;
|
||||
u8 unk_08bb;
|
||||
u16 unk_08bc;
|
||||
u16 unk_08be;
|
||||
u16 unk_08c0;
|
||||
u16 unk_08c2;
|
||||
u16 unk_08c4;
|
||||
u16 unk_08c6;
|
||||
u16 unk_08c8;
|
||||
u8 unk_08ca[0x400];
|
||||
u8 unk_0cca;
|
||||
u16 unk_0ccc[0x10];
|
||||
u16 unk_0cec;
|
||||
u16 unk_0cee;
|
||||
struct Sprite *unk_0cf0[2];
|
||||
struct Sprite *unk_0cf8[2];
|
||||
struct Sprite *unk_0d00[2];
|
||||
u32 unk_0d08;
|
||||
u8 filler_0d0c[0x50];
|
||||
u16 unk_0d5c;
|
||||
s16 unk_0d5e;
|
||||
s16 unk_0d60;
|
||||
u16 unk_0d62[360];
|
||||
u8 unk_1032;
|
||||
struct Sprite *unk_1034;
|
||||
struct Sprite *unk_1038[6]; // party
|
||||
struct Sprite *unk_1050[30]; // box
|
||||
struct Sprite **unk_10c8;
|
||||
struct Sprite **unk_10cc;
|
||||
u16 unk_10d0[40];
|
||||
u16 unk_1120[40];
|
||||
u8 unk_1170;
|
||||
u8 unk_1171;
|
||||
u16 unk_1172;
|
||||
s16 unk_1174;
|
||||
s16 unk_1176;
|
||||
u16 unk_1178;
|
||||
u8 unk_117a;
|
||||
s8 unk_117b;
|
||||
u8 unk_117c;
|
||||
u8 unk_117d;
|
||||
u8 filler_117e[0x42];
|
||||
struct Sprite *unk_11c0;
|
||||
struct Sprite *unk_11c4;
|
||||
s32 unk_11c8;
|
||||
s32 unk_11cc;
|
||||
s32 unk_11d0;
|
||||
s32 unk_11d4;
|
||||
s16 unk_11d8;
|
||||
s16 unk_11da;
|
||||
u16 unk_11dc;
|
||||
s8 unk_11de;
|
||||
s8 unk_11df;
|
||||
u8 unk_11e0;
|
||||
u8 unk_11e1;
|
||||
u8 unk_11e2;
|
||||
u8 unk_11e3;
|
||||
u8 filler_11e4[4];
|
||||
const u8 *unk_11e8;
|
||||
u32 unk_11ec;
|
||||
u16 unk_11f0;
|
||||
u16 unk_11f2;
|
||||
u8 filler_11f4[2];
|
||||
u8 unk_11f6;
|
||||
u8 unk_11f7;
|
||||
u8 unk_11f8;
|
||||
u8 unk_11f9;
|
||||
u8 unk_11fa[0x15];
|
||||
u8 unk_120f[0x25];
|
||||
u8 unk_1234[0x25];
|
||||
u8 unk_1259[0x21];
|
||||
u8 unk_127a[0x2a];
|
||||
bool8 (*unk_12a4)(void);
|
||||
u8 unk_12a8;
|
||||
u8 unk_12a9;
|
||||
struct Sprite *unk_12ac;
|
||||
struct Sprite *unk_12b0[2];
|
||||
u16 *unk_12b8;
|
||||
struct PokemonMarkMenu unk_12bc;
|
||||
struct UnkPSSStruct_2002370 unk_2370;
|
||||
struct Pokemon unk_25b4;
|
||||
struct Pokemon unk_2618;
|
||||
u8 unk_267c;
|
||||
u8 unk_267d;
|
||||
u8 unk_267e;
|
||||
u8 unk_267f;
|
||||
s8 unk_2680;
|
||||
s8 unk_2681;
|
||||
s8 unk_2682;
|
||||
s8 unk_2683;
|
||||
u16 unk_2684;
|
||||
u16 unk_2686[3];
|
||||
u8 unk_268c;
|
||||
u8 unk_268d;
|
||||
u8 unk_268e;
|
||||
union {
|
||||
struct Pokemon *pokemon;
|
||||
struct BoxPokemon *box;
|
||||
} unk_2690;
|
||||
u8 unk_2694[18];
|
||||
u8 unk_26a6[62];
|
||||
u8 unk_26e4[0x16];
|
||||
u16 unk_26fa;
|
||||
u16 *unk_26fc;
|
||||
struct Sprite *unk_2700;
|
||||
u16 unk_2704[0x10];
|
||||
u8 filler_2724[0x60];
|
||||
u8 unk_2784[0x800];
|
||||
u8 filler_2f84[0x1800];
|
||||
u8 unk_4784[0x800];
|
||||
};
|
||||
|
||||
extern u16 gUnknown_02039760[0x600];
|
||||
extern struct UnkPSSStruct_2002370 *gUnknown_02038478;
|
||||
extern struct PokemonStorageSystemData *const gPokemonStorageSystemPtr;
|
||||
extern u8 *const gUnknown_083B6DB8;
|
||||
|
||||
u8 StorageSystemGetPartySize(void);
|
||||
s16 GetIndexOfFirstEmptySpaceInBoxN(u8 boxId);
|
||||
u8 CountAlivePartyMonsExceptOne(u8 toSkip);
|
||||
u8 CountPokemonInBoxN(u8 boxId);
|
||||
void sub_8096264(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3);
|
||||
void sub_809634C(u8 curBox);
|
||||
u8 sub_8096368(void);
|
||||
void sub_809635C(void);
|
||||
void sub_8096310(void);
|
||||
void sub_80961A8(void);
|
||||
void task_intro_29(u8 whichMenu);
|
||||
void ResetPokemonStorageSystem(void);
|
||||
void BoxMonRestorePP(struct BoxPokemon *);
|
||||
void party_compaction(void);
|
||||
void ResetPSSMonIconSprites(void);
|
||||
void SpawnBoxIconSprites(u8 boxId);
|
||||
u8 get_preferred_box(void);
|
||||
void sub_8098BF0(void);
|
||||
void sub_8098D20(u8 monId);
|
||||
bool8 sub_80990AC(void);
|
||||
void sub_8099200(bool8 a0);
|
||||
void sub_8099310(void);
|
||||
bool8 sub_8099374(void);
|
||||
void sub_8099480(void);
|
||||
void sub_80994A8(s16 a0);
|
||||
void sub_8099520(u8 a0);
|
||||
void sub_809954C(void);
|
||||
void sub_8099584(u8 a0, u8 a1);
|
||||
void sub_809960C(u8 a0, u8 a1);
|
||||
void sub_80996B0(u8 a0, u8 a1);
|
||||
bool8 sub_809971C(void);
|
||||
void sub_809981C(u8 mode, u8 idx);
|
||||
bool8 sub_80998D8(void);
|
||||
void sub_8099920(void);
|
||||
void sub_8099958(void);
|
||||
bool8 sub_8099990(void);
|
||||
struct Sprite *sub_809A9A0(u16 x, u16 y, u8 animId, u8 priority, u8 subpriority);
|
||||
void sub_8099BF8(u8 a0);
|
||||
void sub_8099C70(u8 whichBox);
|
||||
bool8 sub_8099D34(void);
|
||||
void sub_8099DCC(u8 a0);
|
||||
bool8 sub_8099E08(void);
|
||||
void sub_809A860(bool8 a0);
|
||||
void sub_809AA24(void);
|
||||
void sub_809AA98(void);
|
||||
bool8 sub_809AC00(void);
|
||||
void sub_809B0C0(u8 a0);
|
||||
void sub_809B0D4(void);
|
||||
void sub_809B0E0(void);
|
||||
u8 sub_809B0F4(void);
|
||||
void sub_809B068(void);
|
||||
void sub_809B100(u8 a0);
|
||||
bool8 sub_809B130(void);
|
||||
void sub_809B440(void);
|
||||
bool8 sub_809B62C(u8);
|
||||
void sub_809B6BC(void);
|
||||
void sub_809B6DC(void);
|
||||
bool8 sub_809B734(void);
|
||||
void sub_809B760(void);
|
||||
void sub_809B7AC(void);
|
||||
void sub_809B7D4(void);
|
||||
s8 sub_809B960(void);
|
||||
void sub_809BB90(void);
|
||||
void sub_809BBC0(void);
|
||||
void sub_809BC18(void);
|
||||
void sub_809BD14(void);
|
||||
s16 party_compaction(void);
|
||||
void sub_809BDD8(u8 markings);
|
||||
bool8 sub_809BE80(void);
|
||||
bool8 sub_809BEBC(void);
|
||||
bool8 sub_809BF20(void);
|
||||
bool8 sub_809BF48(void);
|
||||
u8 sub_809CA40(void);
|
||||
void sub_809CDCC(void);
|
||||
void sub_809CDEC(u8 a0);
|
||||
void sub_809CE84(void);
|
||||
s16 sub_809CF30(void);
|
||||
void sub_809CFDC(struct UnkStruct_2000020 *a0, struct UnkStruct_2000028 *a1, u8 a2);
|
||||
void sub_809CFF0(void);
|
||||
void sub_809D034(void *dest, u16 dLeft, u16 dTop, const void *src, u16 sLeft, u16 sTop, u16 width, u16 height);
|
||||
void sub_809D104(void *dest, u16 dLeft, u16 dTop, const void *src, u16 sLeft, u16 sTop, u16 width, u16 height);
|
||||
void sub_809D16C(void *dest, u16 dLeft, u16 dTop, u16 width, u16 height);
|
||||
|
||||
#endif // GUARD_POKEMON_STORAGE_SYSTEM_H
|
||||
|
||||
@@ -85,7 +85,7 @@ void sub_8078174(struct Sprite *sprite);
|
||||
void sub_80793C4(struct Sprite *sprite);
|
||||
void sub_807A3FC(u8 slot, u8 a2, s16 *a3, s16 *a4);
|
||||
u8 sub_8079ED4(u8 slot);
|
||||
int sub_807A100(u8 slot, u8 a2);
|
||||
s16 sub_807A100(u8 slot, u8 a2);
|
||||
u16 sub_80790F0(s16 a, s16 b);
|
||||
void sub_8078FDC(struct Sprite *sprite, bool8 a2, s16 xScale, s16 yScale, u16 rotation);
|
||||
void sub_807867C(struct Sprite *sprite, s16 a2);
|
||||
@@ -103,5 +103,8 @@ bool8 sub_8078718(struct Sprite *sprite);
|
||||
bool8 sub_8078CE8(struct Sprite *sprite);
|
||||
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
|
||||
void sub_8078BD4(struct Sprite *sprite);
|
||||
void sub_807941C(struct Sprite *sprite);
|
||||
void sub_80789D4(bool8 a1);
|
||||
void sub_8079AB8(u8 sprite, u8 sprite2);
|
||||
|
||||
#endif // GUARD_ROM_8077ABC_H
|
||||
|
||||
@@ -235,6 +235,7 @@ extern const union AffineAnimCmd *const gDummySpriteAffineAnimTable[];
|
||||
extern s16 gSpriteCoordOffsetX;
|
||||
extern s16 gSpriteCoordOffsetY;
|
||||
extern u8 gReservedSpritePaletteCount;
|
||||
extern u16 gReservedSpriteTileCount;
|
||||
|
||||
extern u8 gOamLimit;
|
||||
|
||||
|
||||
@@ -253,4 +253,6 @@ void Text_StripExtCtrlCodes(u8 *str);
|
||||
s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2);
|
||||
u8 sub_8004FD0(struct Window *win, u8 *dest, const u8 *src, u16 tileDataStartOffset, u8 left, u16 top, u8 width, u32 a8);
|
||||
|
||||
extern const u16 gUnknownPalette_81E6692[];
|
||||
|
||||
#endif // GUARD_TEXT_H
|
||||
|
||||
@@ -128,9 +128,12 @@ SECTIONS {
|
||||
src/engine/save_menu_util.o(.text);
|
||||
src/battle/battle_party_menu.o(.text);
|
||||
asm/unk_text_8095904.o(.text);
|
||||
asm/pokemon_storage_system.o(.text);
|
||||
src/pokemon/pokemon_storage_system.o(.text);
|
||||
asm/pokemon_storage_system.o(.text_8098A38);
|
||||
src/pokemon/pokemon_storage_system_2.o(.text);
|
||||
src/pokemon/pokemon_storage_system_3.o(.text);
|
||||
src/pokemon/pokemon_storage_system_4.o(.text);
|
||||
src/pokemon/pokemon_storage_system_5.o(.text);
|
||||
asm/pokemon_storage_system.o(.text);
|
||||
src/pokemon/pokemon_icon.o(.text);
|
||||
src/pokemon/pokemon_summary_screen.o(.text);
|
||||
src/field/script_movement.o(.text);
|
||||
@@ -293,9 +296,9 @@ SECTIONS {
|
||||
asm/fight.o(.text);
|
||||
src/battle/anim/poison.o(.text);
|
||||
asm/flying.o(.text);
|
||||
asm/psychic.o(.text);
|
||||
src/battle/anim/psychic.o(.text);
|
||||
src/battle/anim/bug.o(.text);
|
||||
asm/rock.o(.text);
|
||||
src/battle/anim/rock.o(.text);
|
||||
asm/ghost.o(.text);
|
||||
src/battle/anim/dragon.o(.text);
|
||||
src/battle/anim/dark.o(.text);
|
||||
@@ -555,6 +558,11 @@ SECTIONS {
|
||||
src/pokemon/pokedex.o(.rodata);
|
||||
src/engine/trainer_card.o(.rodata);
|
||||
src/battle/battle_party_menu.o(.rodata);
|
||||
src/pokemon/pokemon_storage_system.o(.rodata);
|
||||
src/pokemon/pokemon_storage_system_2.o(.rodata);
|
||||
src/pokemon/pokemon_storage_system_3.o(.rodata);
|
||||
src/pokemon/pokemon_storage_system_4.o(.rodata);
|
||||
src/pokemon/pokemon_storage_system_5.o(.rodata);
|
||||
data/pokemon_storage_system.o(.rodata);
|
||||
src/pokemon/pokemon_icon.o(.rodata);
|
||||
src/pokemon/pokemon_summary_screen.o(.rodata);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
.align 2
|
||||
gMPlayTable:: @ 845545C
|
||||
music_player gMPlay_BGM, 0x30007F8, 10, 0
|
||||
music_player gMPlay_SE1, 0x3000B18, 3, 1
|
||||
music_player gMPlay_SE2, 0x3000C08, 9, 1
|
||||
music_player gMPlay_SE3, 0x3000ED8, 1, 0
|
||||
music_player gMPlay_BGM, gUnknown_030007B8 + 0x40, 10, 0
|
||||
music_player gMPlay_SE1, gUnknown_030007B8 + 0x360, 3, 1
|
||||
music_player gMPlay_SE2, gUnknown_030007B8 + 0x450, 9, 1
|
||||
music_player gMPlay_SE3, gUnknown_030007B8 + 0x720, 1, 0
|
||||
|
||||
900
src/battle/anim/psychic.c
Normal file
900
src/battle/anim/psychic.c
Normal file
@@ -0,0 +1,900 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "palette.h"
|
||||
#include "rom_8077ABC.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "sound.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern s16 gBattleAnimArgs[];
|
||||
extern u8 gAnimBankAttacker;
|
||||
extern u8 gAnimBankTarget;
|
||||
extern u16 gBattle_BG1_X;
|
||||
extern u16 gBattle_BG2_X;
|
||||
extern u8 gObjectBankIDs[];
|
||||
|
||||
extern const union AffineAnimCmd *const gUnknown_083DA888[];
|
||||
extern struct AffineAnimFrameCmd gUnknown_083DA8A4;
|
||||
extern struct AffineAnimFrameCmd gUnknown_083DA8C4;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_83DA8DC;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_83DA9AC;
|
||||
|
||||
static void sub_80DB88C(struct Sprite *sprite);
|
||||
static void sub_80DB8C0(struct Sprite *sprite);
|
||||
static void sub_80DB92C(struct Sprite *sprite);
|
||||
static void sub_80DB9E4(struct Sprite *sprite);
|
||||
static void sub_80DBC00(struct Sprite *sprite);
|
||||
static void sub_80DBC34(struct Sprite *sprite);
|
||||
static void sub_80DBCD0(u8 taskId);
|
||||
static void sub_80DBD58(u8 taskId);
|
||||
static void sub_80DBE98(u8 taskId);
|
||||
static void sub_80DC1FC(u8 taskId);
|
||||
static void sub_80DC3F4(u8 taskId);
|
||||
void sub_80DC5F4(u8 taskId);
|
||||
|
||||
|
||||
void sub_80DB74C(struct Sprite *sprite)
|
||||
{
|
||||
if (GetBankSide(gAnimBankAttacker) == SIDE_PLAYER || IsContest())
|
||||
{
|
||||
sprite->oam.priority = 2;
|
||||
sprite->subpriority = 200;
|
||||
}
|
||||
|
||||
if (!IsContest())
|
||||
{
|
||||
u8 bankCopy;
|
||||
u8 bank = bankCopy = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
|
||||
u8 identity = GetBankIdentity_permutated(bank);
|
||||
int var0 = 1;
|
||||
u8 toBG_2 = (identity ^ var0) != 0;
|
||||
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
sub_8076034(bank, toBG_2);
|
||||
|
||||
bank = bankCopy ^ 2;
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
sub_8076034(bank, toBG_2 ^ var0);
|
||||
}
|
||||
|
||||
if (!IsContest() && IsDoubleBattle())
|
||||
{
|
||||
if (GetBankSide(gAnimBankAttacker) == SIDE_PLAYER)
|
||||
{
|
||||
sprite->pos1.x = 72;
|
||||
sprite->pos1.y = 80;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x = 176;
|
||||
sprite->pos1.y = 40;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0) + gBattleAnimArgs[0];
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1) + gBattleAnimArgs[1];
|
||||
}
|
||||
|
||||
if (IsContest())
|
||||
sprite->pos1.y += 9;
|
||||
|
||||
sprite->data[0] = 256 + IndexOfSpritePaletteTag(gBattleAnimArgs[2]) * 16;
|
||||
sprite->callback = sub_80DB88C;
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
static void sub_80DB88C(struct Sprite *sprite)
|
||||
{
|
||||
REG_BLDALPHA = ((16 - sprite->data[3]) << 8) | sprite->data[3];
|
||||
|
||||
if (sprite->data[3] == 13)
|
||||
sprite->callback = sub_80DB8C0;
|
||||
else
|
||||
sprite->data[3]++;
|
||||
}
|
||||
|
||||
static void sub_80DB8C0(struct Sprite *sprite)
|
||||
{
|
||||
u16 color;
|
||||
u16 startOffset;
|
||||
int i;
|
||||
|
||||
if (++sprite->data[1] == 2)
|
||||
{
|
||||
sprite->data[1] = 0;
|
||||
startOffset = sprite->data[0];
|
||||
color = gPlttBufferFaded[startOffset + 8];
|
||||
|
||||
for (i = 8; i > 0; i--)
|
||||
gPlttBufferFaded[startOffset + i] = gPlttBufferFaded[startOffset + i - 1];
|
||||
|
||||
gPlttBufferFaded[startOffset + 1] = color;
|
||||
|
||||
if (++sprite->data[2] == 16)
|
||||
sprite->callback = sub_80DB92C;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80DB92C(struct Sprite *sprite)
|
||||
{
|
||||
REG_BLDALPHA = ((16 - sprite->data[3]) << 8) | sprite->data[3];
|
||||
|
||||
if (--sprite->data[3] == -1)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
u8 bankCopy;
|
||||
u8 bank = bankCopy = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
|
||||
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
gSprites[gObjectBankIDs[bank]].invisible = 0;
|
||||
|
||||
bank = bankCopy ^ 2;
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
gSprites[gObjectBankIDs[bank]].invisible = 0;
|
||||
}
|
||||
|
||||
sprite->invisible = 1;
|
||||
sprite->callback = sub_80DB9E4;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80DB9E4(struct Sprite *sprite)
|
||||
{
|
||||
if (!IsContest())
|
||||
{
|
||||
u8 bankCopy;
|
||||
u8 bank = bankCopy = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
|
||||
u8 identity = GetBankIdentity_permutated(bank);
|
||||
int var0 = 1;
|
||||
u8 toBG_2 = (identity ^ var0) != 0;
|
||||
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
sub_8076464(toBG_2);
|
||||
|
||||
bank = bankCopy ^ 2;
|
||||
if (IsAnimBankSpriteVisible(bank))
|
||||
sub_8076464(toBG_2 ^ var0);
|
||||
}
|
||||
|
||||
sprite->callback = DestroyAnimSprite;
|
||||
}
|
||||
|
||||
void sub_80DBA4C(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
int arg3 = gBattleAnimArgs[3];
|
||||
u8 var0 = 0;
|
||||
if (arg3 == 0)
|
||||
var0 = 1;
|
||||
|
||||
if (!IsContest() && IsDoubleBattle())
|
||||
{
|
||||
if (GetBankSide(gAnimBankAttacker) == SIDE_PLAYER)
|
||||
{
|
||||
sprite->pos1.x = 72 - gBattleAnimArgs[0];
|
||||
sprite->pos1.y = gBattleAnimArgs[1] + 80;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x = gBattleAnimArgs[0] + 176;
|
||||
sprite->pos1.y = gBattleAnimArgs[1] + 40;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleAnimArgs[2] == 0)
|
||||
sub_80787B0(sprite, var0);
|
||||
else
|
||||
sub_8078764(sprite, var0);
|
||||
}
|
||||
|
||||
sprite->data[0]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sprite->animEnded || sprite->affineAnimEnded)
|
||||
move_anim_8074EE0(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DBAF4(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2);
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3);
|
||||
|
||||
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
|
||||
{
|
||||
StartSpriteAnim(sprite, 1);
|
||||
sprite->pos1.x -= 40;
|
||||
sprite->pos1.y += 10;
|
||||
sprite->data[1] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x += 40;
|
||||
sprite->pos1.y -= 10;
|
||||
sprite->data[1] = 1;
|
||||
}
|
||||
|
||||
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
|
||||
sprite->callback = sub_8078600;
|
||||
}
|
||||
|
||||
void sub_80DBB70(struct Sprite *sprite)
|
||||
{
|
||||
s16 x = sub_807A100(gAnimBankAttacker, 1) / 2;
|
||||
s16 y = sub_807A100(gAnimBankAttacker, 0) / -2;
|
||||
|
||||
if (GetBankSide(gAnimBankAttacker) == SIDE_OPPONENT)
|
||||
{
|
||||
x = -x;
|
||||
}
|
||||
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2) + x;
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3) + y;
|
||||
|
||||
if (sprite->pos1.y < 16)
|
||||
{
|
||||
sprite->pos1.y = 16;
|
||||
}
|
||||
|
||||
StoreSpriteCallbackInData(sprite, sub_80DBC00);
|
||||
sprite->callback = sub_8078600;
|
||||
}
|
||||
|
||||
static void sub_80DBC00(struct Sprite *sprite)
|
||||
{
|
||||
sprite->oam.affineMode = 1;
|
||||
sprite->affineAnims = gUnknown_083DA888;
|
||||
sprite->data[0] = 0;
|
||||
InitSpriteAffineAnim(sprite);
|
||||
sprite->callback = sub_80DBC34;
|
||||
}
|
||||
|
||||
static void sub_80DBC34(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
case 0:
|
||||
if (sprite->affineAnimEnded)
|
||||
{
|
||||
FreeOamMatrix(sprite->oam.matrixNum);
|
||||
sprite->oam.affineMode = 0;
|
||||
sprite->data[1] = 18;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (--sprite->data[1] == -1)
|
||||
{
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DBC94(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBankSpriteId(0);
|
||||
task->data[0] = spriteId;
|
||||
sub_80798F4(task, spriteId, &gUnknown_083DA8A4);
|
||||
task->func = sub_80DBCD0;
|
||||
}
|
||||
|
||||
static void sub_80DBCD0(u8 taskId)
|
||||
{
|
||||
if (!sub_807992C(&gTasks[taskId]))
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DBCFC(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBankSpriteId(0);
|
||||
task->data[0] = spriteId;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
task->data[3] = GetBankSide(gAnimBankAttacker) != SIDE_PLAYER ? 4 : 8;
|
||||
|
||||
sub_80798F4(task, task->data[0], &gUnknown_083DA8C4);
|
||||
task->func = sub_80DBD58;
|
||||
}
|
||||
|
||||
static void sub_80DBD58(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[1])
|
||||
{
|
||||
case 0:
|
||||
sub_807992C(task);
|
||||
if (++task->data[2] > 19)
|
||||
task->data[1]++;
|
||||
break;
|
||||
case 1:
|
||||
if (task->data[3] != 0)
|
||||
{
|
||||
gSprites[task->data[0]].pos2.y -= 8;
|
||||
task->data[3]--;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSprites[task->data[0]].invisible = 1;
|
||||
gSprites[task->data[0]].pos1.x = 272;
|
||||
sub_8078F40(task->data[0]);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DBE00(u8 taskId)
|
||||
{
|
||||
u16 var0, var1;
|
||||
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
task->data[3] = 16;
|
||||
task->data[4] = 0;
|
||||
task->data[13] = GetBankPosition(gAnimBankAttacker, 2);
|
||||
task->data[14] = GetBankPosition(gAnimBankAttacker, 3);
|
||||
|
||||
var0 = sub_807A100(gAnimBankAttacker, 1) / 3;
|
||||
var1 = sub_807A100(gAnimBankAttacker, 0) / 3;
|
||||
task->data[12] = var0 > var1 ? var0 : var1;
|
||||
|
||||
REG_BLDCNT = 0x3F40;
|
||||
REG_BLDALPHA = 0x10;
|
||||
|
||||
task->func = sub_80DBE98;
|
||||
}
|
||||
|
||||
static void sub_80DBE98(u8 taskId)
|
||||
{
|
||||
u16 i;
|
||||
u8 spriteId;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
if (++task->data[1] > 8)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
spriteId = CreateSprite(&gSpriteTemplate_83DA8DC, task->data[13], task->data[14], 0);
|
||||
task->data[task->data[2] + 8] = spriteId;
|
||||
|
||||
if (spriteId != 64)
|
||||
{
|
||||
switch (task->data[2])
|
||||
{
|
||||
case 0:
|
||||
gSprites[spriteId].pos2.x = task->data[12];
|
||||
gSprites[spriteId].pos2.y = -task->data[12];
|
||||
break;
|
||||
case 1:
|
||||
gSprites[spriteId].pos2.x = -task->data[12];
|
||||
gSprites[spriteId].pos2.y = task->data[12];
|
||||
break;
|
||||
case 2:
|
||||
gSprites[spriteId].pos2.x = task->data[12];
|
||||
gSprites[spriteId].pos2.y = task->data[12];
|
||||
break;
|
||||
case 3:
|
||||
gSprites[spriteId].pos2.x = -task->data[12];
|
||||
gSprites[spriteId].pos2.y = -task->data[12];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (++task->data[2] == 5)
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (task->data[1] & 1)
|
||||
task->data[3]--;
|
||||
else
|
||||
task->data[4]++;
|
||||
|
||||
REG_BLDALPHA = (task->data[4] << 8) | task->data[3];
|
||||
|
||||
if (++task->data[1] == 32)
|
||||
{
|
||||
for (i = 8; i < 13; i++)
|
||||
{
|
||||
if (task->data[i] != 64)
|
||||
DestroySprite(&gSprites[task->data[i]]);
|
||||
}
|
||||
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 3:
|
||||
REG_BLDALPHA = 0;
|
||||
REG_BLDCNT = 0;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80DC020(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[1] > sprite->data[0] - 10)
|
||||
sprite->invisible = sprite->data[1] & 1;
|
||||
|
||||
if (sprite->data[1] == sprite->data[0])
|
||||
DestroyAnimSprite(sprite);
|
||||
|
||||
sprite->data[1]++;
|
||||
}
|
||||
|
||||
void sub_80DC068(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 2);
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 3);
|
||||
}
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[1];
|
||||
sprite->callback = sub_80DC020;
|
||||
}
|
||||
|
||||
void sub_80DC0B0(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 1)
|
||||
{
|
||||
task->data[10] = -10;
|
||||
task->data[11] = sub_807A100(gAnimBankTarget, 5) - 8;
|
||||
task->data[12] = sub_807A100(gAnimBankTarget, 2) + 8;
|
||||
task->data[13] = sub_807A100(gAnimBankAttacker, 5) - 8;
|
||||
task->data[14] = sub_807A100(gAnimBankAttacker, 2) + 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[10] = 10;
|
||||
task->data[11] = sub_807A100(gAnimBankAttacker, 4) + 8;
|
||||
task->data[12] = sub_807A100(gAnimBankAttacker, 3) - 8;
|
||||
task->data[13] = sub_807A100(gAnimBankTarget, 4) + 8;
|
||||
task->data[14] = sub_807A100(gAnimBankTarget, 3) - 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 1)
|
||||
{
|
||||
task->data[10] = -10;
|
||||
task->data[11] = sub_807A100(gAnimBankTarget, 4) + 8;
|
||||
task->data[12] = sub_807A100(gAnimBankTarget, 2) + 8;
|
||||
task->data[13] = sub_807A100(gAnimBankAttacker, 4) + 8;
|
||||
task->data[14] = sub_807A100(gAnimBankAttacker, 2) + 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[10] = 10;
|
||||
task->data[11] = sub_807A100(gAnimBankAttacker, 5) - 8;
|
||||
task->data[12] = sub_807A100(gAnimBankAttacker, 3) - 8;
|
||||
task->data[13] = sub_807A100(gAnimBankTarget, 5) - 8;
|
||||
task->data[14] = sub_807A100(gAnimBankTarget, 3) - 8;
|
||||
}
|
||||
}
|
||||
|
||||
task->data[1] = 6;
|
||||
task->func = sub_80DC1FC;
|
||||
}
|
||||
|
||||
static void sub_80DC1FC(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
if (++task->data[1] > 6)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
spriteId = CreateSprite(&gSpriteTemplate_83DA9AC, task->data[11], task->data[12], 0);
|
||||
if (spriteId != 64)
|
||||
{
|
||||
gSprites[spriteId].data[0] = 16;
|
||||
gSprites[spriteId].data[2] = task->data[13];
|
||||
gSprites[spriteId].data[4] = task->data[14];
|
||||
gSprites[spriteId].data[5] = task->data[10];
|
||||
|
||||
sub_80786EC(&gSprites[spriteId]);
|
||||
StartSpriteAffineAnim(&gSprites[spriteId], task->data[2] & 3);
|
||||
}
|
||||
|
||||
if (++task->data[2] == 12)
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (++task->data[1] > 17)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DC2B0(struct Sprite *sprite)
|
||||
{
|
||||
if (sub_8078718(sprite))
|
||||
{
|
||||
FreeOamMatrix(sprite->oam.matrixNum);
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DC2D4(u8 taskId)
|
||||
{
|
||||
s16 i;
|
||||
u8 var1;
|
||||
struct ScanlineEffectParams scanlineParams;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
var1 = sub_8077FC0(gAnimBankTarget);
|
||||
task->data[14] = var1 - 32;
|
||||
|
||||
switch (gBattleAnimArgs[0])
|
||||
{
|
||||
case 0:
|
||||
task->data[11] = 2;
|
||||
task->data[12] = 5;
|
||||
task->data[13] = 64;
|
||||
task->data[15] = var1 + 32;
|
||||
break;
|
||||
case 1:
|
||||
task->data[11] = 2;
|
||||
task->data[12] = 5;
|
||||
task->data[13] = 192;
|
||||
task->data[15] = var1 + 32;
|
||||
break;
|
||||
case 2:
|
||||
task->data[11] = 4;
|
||||
task->data[12] = 4;
|
||||
task->data[13] = 0;
|
||||
task->data[15] = var1 + 32;
|
||||
break;
|
||||
}
|
||||
|
||||
if (task->data[14] < 0)
|
||||
task->data[14] = 0;
|
||||
|
||||
if (GetBankIdentity_permutated(gAnimBankTarget) == 1)
|
||||
{
|
||||
task->data[10] = gBattle_BG1_X;
|
||||
scanlineParams.dmaDest = ®_BG1HOFS;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[10] = gBattle_BG2_X;
|
||||
scanlineParams.dmaDest = ®_BG2HOFS;
|
||||
}
|
||||
|
||||
i = task->data[14];
|
||||
while (i <= task->data[14] + 64)
|
||||
{
|
||||
gScanlineEffectRegBuffers[0][i] = task->data[10];
|
||||
gScanlineEffectRegBuffers[1][i] = task->data[10];
|
||||
i++;
|
||||
}
|
||||
|
||||
scanlineParams.dmaControl = 0XA2600001;
|
||||
scanlineParams.initState = 1;
|
||||
scanlineParams.unused9 = 0;
|
||||
ScanlineEffect_SetParams(scanlineParams);
|
||||
|
||||
task->func = sub_80DC3F4;
|
||||
}
|
||||
|
||||
static void sub_80DC3F4(u8 taskId)
|
||||
{
|
||||
s16 sineIndex, i;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
sineIndex = task->data[13];
|
||||
i = task->data[14];
|
||||
while (i <= task->data[15])
|
||||
{
|
||||
s16 var2 = (gSineTable[sineIndex] >> task->data[12]);
|
||||
if (var2 > 0)
|
||||
{
|
||||
var2 += (task->data[1] & 3);
|
||||
}
|
||||
else if (var2 < 0)
|
||||
{
|
||||
var2 -= (task->data[1] & 3);
|
||||
}
|
||||
|
||||
gScanlineEffectRegBuffers[0][i] = task->data[10] + var2;
|
||||
gScanlineEffectRegBuffers[1][i] = task->data[10] + var2;
|
||||
|
||||
sineIndex += task->data[11];
|
||||
i++;
|
||||
}
|
||||
|
||||
if (++task->data[1] > 23)
|
||||
{
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gScanlineEffect.state = 3;
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NONMATCHING
|
||||
void sub_80DC4F4(u8 taskId)
|
||||
{
|
||||
s16 spriteId;
|
||||
u8 matrixNum;
|
||||
register u8 matrixNum2 asm("r6");
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
matrixNum = AllocOamMatrix();
|
||||
matrixNum2 = matrixNum;
|
||||
if (matrixNum2 == 0xFF)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
spriteId = duplicate_obj_of_side_rel2move_in_transparent_mode(gBattleAnimArgs[0]);
|
||||
if (spriteId < 0)
|
||||
{
|
||||
FreeOamMatrix(matrixNum);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
gSprites[spriteId].callback = SpriteCallbackDummy;
|
||||
gSprites[spriteId].oam.affineMode = ST_OAM_AFFINE_DOUBLE;
|
||||
gSprites[spriteId].oam.matrixNum = matrixNum2;
|
||||
gSprites[spriteId].affineAnimPaused = 1;
|
||||
gSprites[spriteId].subpriority++;
|
||||
obj_id_set_rotscale(spriteId, 256, 256, 0);
|
||||
CalcCenterToCornerVec(&gSprites[spriteId], gSprites[spriteId].oam.shape, gSprites[spriteId].oam.size, gSprites[spriteId].oam.affineMode);
|
||||
|
||||
task->data[13] = GetAnimBankSpriteId(gBattleAnimArgs[0]);
|
||||
task->data[14] = matrixNum;
|
||||
task->data[15] = spriteId;
|
||||
task->func = sub_80DC5F4;
|
||||
}
|
||||
#else
|
||||
__attribute__((naked))
|
||||
void sub_80DC4F4(u8 taskId)
|
||||
{
|
||||
asm(".syntax unified\n\
|
||||
push {r4-r7,lr}\n\
|
||||
mov r7, r10\n\
|
||||
mov r6, r9\n\
|
||||
mov r5, r8\n\
|
||||
push {r5-r7}\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r4, r0, 24\n\
|
||||
mov r8, r4\n\
|
||||
lsls r0, r4, 2\n\
|
||||
adds r0, r4\n\
|
||||
lsls r0, 3\n\
|
||||
ldr r1, _080DC528 @ =gTasks\n\
|
||||
adds r7, r0, r1\n\
|
||||
bl AllocOamMatrix\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r5, r0, 24\n\
|
||||
mov r10, r5\n\
|
||||
adds r6, r5, 0\n\
|
||||
cmp r6, 0xFF\n\
|
||||
bne _080DC52C\n\
|
||||
adds r0, r4, 0\n\
|
||||
bl DestroyAnimVisualTask\n\
|
||||
b _080DC5D6\n\
|
||||
.align 2, 0\n\
|
||||
_080DC528: .4byte gTasks\n\
|
||||
_080DC52C:\n\
|
||||
ldr r1, _080DC550 @ =gBattleAnimArgs\n\
|
||||
ldrb r0, [r1]\n\
|
||||
bl duplicate_obj_of_side_rel2move_in_transparent_mode\n\
|
||||
lsls r0, 16\n\
|
||||
lsrs r1, r0, 16\n\
|
||||
mov r9, r1\n\
|
||||
asrs r0, 16\n\
|
||||
cmp r0, 0\n\
|
||||
bge _080DC554\n\
|
||||
adds r0, r5, 0\n\
|
||||
bl FreeOamMatrix\n\
|
||||
mov r0, r8\n\
|
||||
bl DestroyAnimVisualTask\n\
|
||||
b _080DC5D6\n\
|
||||
.align 2, 0\n\
|
||||
_080DC550: .4byte gBattleAnimArgs\n\
|
||||
_080DC554:\n\
|
||||
ldr r2, _080DC5E4 @ =gSprites\n\
|
||||
lsls r4, r0, 4\n\
|
||||
adds r4, r0\n\
|
||||
lsls r4, 2\n\
|
||||
adds r0, r2, 0\n\
|
||||
adds r0, 0x1C\n\
|
||||
adds r0, r4, r0\n\
|
||||
ldr r1, _080DC5E8 @ =SpriteCallbackDummy\n\
|
||||
str r1, [r0]\n\
|
||||
adds r4, r2\n\
|
||||
ldrb r0, [r4, 0x1]\n\
|
||||
movs r1, 0x3\n\
|
||||
orrs r0, r1\n\
|
||||
strb r0, [r4, 0x1]\n\
|
||||
movs r0, 0x1F\n\
|
||||
ands r6, r0\n\
|
||||
lsls r2, r6, 1\n\
|
||||
ldrb r1, [r4, 0x3]\n\
|
||||
movs r0, 0x3F\n\
|
||||
negs r0, r0\n\
|
||||
ands r0, r1\n\
|
||||
orrs r0, r2\n\
|
||||
strb r0, [r4, 0x3]\n\
|
||||
adds r2, r4, 0\n\
|
||||
adds r2, 0x2C\n\
|
||||
ldrb r0, [r2]\n\
|
||||
movs r1, 0x80\n\
|
||||
orrs r0, r1\n\
|
||||
strb r0, [r2]\n\
|
||||
adds r1, r4, 0\n\
|
||||
adds r1, 0x43\n\
|
||||
ldrb r0, [r1]\n\
|
||||
adds r0, 0x1\n\
|
||||
strb r0, [r1]\n\
|
||||
mov r1, r9\n\
|
||||
lsls r0, r1, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
movs r2, 0x80\n\
|
||||
lsls r2, 1\n\
|
||||
adds r1, r2, 0\n\
|
||||
movs r3, 0\n\
|
||||
bl obj_id_set_rotscale\n\
|
||||
ldrb r3, [r4, 0x1]\n\
|
||||
lsrs r1, r3, 6\n\
|
||||
ldrb r2, [r4, 0x3]\n\
|
||||
lsrs r2, 6\n\
|
||||
lsls r3, 30\n\
|
||||
lsrs r3, 30\n\
|
||||
adds r0, r4, 0\n\
|
||||
bl CalcCenterToCornerVec\n\
|
||||
ldr r1, _080DC5EC @ =gBattleAnimArgs\n\
|
||||
ldrb r0, [r1]\n\
|
||||
bl GetAnimBankSpriteId\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r0, 24\n\
|
||||
strh r0, [r7, 0x22]\n\
|
||||
mov r0, r10\n\
|
||||
strh r0, [r7, 0x24]\n\
|
||||
mov r1, r9\n\
|
||||
strh r1, [r7, 0x26]\n\
|
||||
ldr r0, _080DC5F0 @ =sub_80DC5F4\n\
|
||||
str r0, [r7]\n\
|
||||
_080DC5D6:\n\
|
||||
pop {r3-r5}\n\
|
||||
mov r8, r3\n\
|
||||
mov r9, r4\n\
|
||||
mov r10, r5\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.align 2, 0\n\
|
||||
_080DC5E4: .4byte gSprites\n\
|
||||
_080DC5E8: .4byte SpriteCallbackDummy\n\
|
||||
_080DC5EC: .4byte gBattleAnimArgs\n\
|
||||
_080DC5F0: .4byte sub_80DC5F4\n\
|
||||
.syntax divided\n");
|
||||
}
|
||||
#endif // NONMATCHING
|
||||
|
||||
void sub_80DC5F4(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
task->data[1] += 4;
|
||||
task->data[2] = 256 - (gSineTable[task->data[1]] >> 1);
|
||||
obj_id_set_rotscale(task->data[15], task->data[2], task->data[2], 0);
|
||||
sub_8079AB8(task->data[15], task->data[13]);
|
||||
if (task->data[1] == 48)
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
task->data[1] -= 4;
|
||||
task->data[2] = 256 - (gSineTable[task->data[1]] >> 1);;
|
||||
obj_id_set_rotscale(task->data[15], task->data[2], task->data[2], 0);
|
||||
sub_8079AB8(task->data[15], task->data[13]);
|
||||
if (task->data[1] == 0)
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
obj_delete_but_dont_free_vram(&gSprites[task->data[15]]);
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 3:
|
||||
FreeOamMatrix(task->data[14]);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DC700(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
case 0:
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankAttacker, 0);
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankAttacker, 1);
|
||||
|
||||
if (IsContest())
|
||||
sprite->pos1.y += 12;
|
||||
|
||||
sprite->data[1] = 8;
|
||||
REG_BLDCNT = 0x3F40;
|
||||
REG_BLDALPHA = ((16 - sprite->data[1]) << 8) | sprite->data[1];
|
||||
sprite->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
if (sprite->affineAnimEnded)
|
||||
{
|
||||
PlaySE12WithPanning(SE_W100, BattleAnimAdjustPanning(-64));
|
||||
ChangeSpriteAffineAnim(sprite, 1);
|
||||
sprite->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sprite->data[2]++ > 1)
|
||||
{
|
||||
sprite->data[2] = 0;
|
||||
sprite->data[1]--;
|
||||
REG_BLDALPHA = ((16 - sprite->data[1]) << 8) | sprite->data[1];
|
||||
|
||||
if (sprite->data[1] == 0)
|
||||
{
|
||||
sprite->data[0]++;
|
||||
sprite->invisible = 1;
|
||||
}
|
||||
}
|
||||
|
||||
sprite->data[3] += 896;
|
||||
sprite->pos2.y -= sprite->data[3] >> 8;
|
||||
sprite->data[3] &= 0xFF;
|
||||
break;
|
||||
case 3:
|
||||
REG_BLDCNT = 0;
|
||||
REG_BLDALPHA = 0;
|
||||
DestroyAnimSprite(sprite);
|
||||
break;
|
||||
}
|
||||
}
|
||||
602
src/battle/anim/rock.c
Normal file
602
src/battle/anim/rock.c
Normal file
@@ -0,0 +1,602 @@
|
||||
#include "global.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "decompress.h"
|
||||
#include "palette.h"
|
||||
#include "rom_8077ABC.h"
|
||||
#include "sound.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern s16 gBattleAnimArgs[];
|
||||
extern u8 gAnimBankAttacker;
|
||||
extern u8 gAnimBankTarget;
|
||||
extern u32 gAnimMoveDmg;
|
||||
extern u16 gBattle_BG1_X;
|
||||
extern u16 gBattle_BG1_Y;
|
||||
extern u16 gBattle_BG3_Y;
|
||||
|
||||
extern const u8 gBattleAnimBackgroundTilemap_SandstormBrew[];
|
||||
extern const u8 gBattleAnimBackgroundImage_SandstormBrew[];
|
||||
extern const u16 gBattleAnimSpritePalette_261[];
|
||||
extern const struct SpriteTemplate gSpriteTemplate_83DAD78;
|
||||
extern const struct SpriteTemplate gSpriteTemplate_83DAD90;
|
||||
|
||||
extern const struct SubspriteTable gUnknown_083DAD10;
|
||||
|
||||
static void sub_80DCF1C(struct Sprite *sprite);
|
||||
static void sub_80DD02C(struct Sprite *sprite);
|
||||
static void sub_80DD190(u8 taskId);
|
||||
static void sub_80DD604(u8 taskId);
|
||||
static void sub_80DD774(struct Task *task);
|
||||
static u8 sub_80DD8BC(void);
|
||||
static void sub_80DD928(struct Sprite *sprite);
|
||||
static void sub_80DD9FC(struct Sprite *sprite);
|
||||
|
||||
|
||||
void sub_80DCE9C(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[3] != 0)
|
||||
sub_807A3FC(gAnimBankTarget, 0, &sprite->pos1.x, &sprite->pos1.y);
|
||||
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
sprite->pos1.y += 14;
|
||||
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[1]);
|
||||
AnimateSprite(sprite);
|
||||
|
||||
sprite->data[0] = 0;
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[2] = 4;
|
||||
sprite->data[3] = 16;
|
||||
sprite->data[4] = -70;
|
||||
sprite->data[5] = gBattleAnimArgs[2];
|
||||
|
||||
StoreSpriteCallbackInData(sprite, sub_80DCF1C);
|
||||
sprite->callback = sub_8078278;
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
static void sub_80DCF1C(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x += sprite->data[5];
|
||||
|
||||
sprite->data[0] = 192;
|
||||
sprite->data[1] = sprite->data[5];
|
||||
sprite->data[2] = 4;
|
||||
sprite->data[3] = 32;
|
||||
sprite->data[4] = -24;
|
||||
|
||||
StoreSpriteCallbackInData(sprite, move_anim_8074EE0);
|
||||
sprite->callback = sub_8078278;
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
void sub_80DCF60(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[5]);
|
||||
AnimateSprite(sprite);
|
||||
|
||||
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
|
||||
sprite->pos1.x -= gBattleAnimArgs[0];
|
||||
else
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
|
||||
sprite->pos1.y += gBattleAnimArgs[1];
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[4];
|
||||
sprite->data[1] = sprite->pos1.x;
|
||||
sprite->data[2] = sprite->pos1.x + gBattleAnimArgs[2];
|
||||
sprite->data[3] = sprite->pos1.y;
|
||||
sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[3];
|
||||
|
||||
sub_8078A5C(sprite);
|
||||
sprite->data[3] = 0;
|
||||
sprite->data[4] = 0;
|
||||
|
||||
sprite->callback = sub_8078394;
|
||||
StoreSpriteCallbackInData(sprite, move_anim_8074EE0);
|
||||
}
|
||||
|
||||
void sub_80DCFE4(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[6] == 0)
|
||||
sub_80787B0(sprite, 0);
|
||||
else
|
||||
sub_8078764(sprite, 0);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[3];
|
||||
sprite->data[1] = gBattleAnimArgs[2];
|
||||
sprite->data[2] = gBattleAnimArgs[4];
|
||||
sprite->data[3] = gBattleAnimArgs[5];
|
||||
|
||||
sprite->callback = sub_80DD02C;
|
||||
}
|
||||
|
||||
static void sub_80DD02C(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[4] += sprite->data[1];
|
||||
sprite->pos2.y = -(sprite->data[4] >> 8);
|
||||
sprite->pos2.x = Sin(sprite->data[5], sprite->data[3]);
|
||||
sprite->data[5] = (sprite->data[5] + sprite->data[2]) & 0xFF;
|
||||
|
||||
if (--sprite->data[0] == -1)
|
||||
{
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
void do_boulder_dust(u8 taskId)
|
||||
{
|
||||
struct Struct_sub_8078914 subStruct;
|
||||
int var0 = 0;
|
||||
|
||||
REG_BLDCNT = 0x3F42;
|
||||
REG_BLDALPHA = 0x1000;
|
||||
REG_BG1CNT_BITFIELD.priority = 1;
|
||||
REG_BG1CNT_BITFIELD.screenSize = 0;
|
||||
|
||||
if (!IsContest())
|
||||
REG_BG1CNT_BITFIELD.charBaseBlock = 1;
|
||||
|
||||
gBattle_BG1_X = 0;
|
||||
gBattle_BG1_Y = 0;
|
||||
REG_BG1HOFS = 0;
|
||||
REG_BG1VOFS = 0;
|
||||
|
||||
sub_8078914(&subStruct);
|
||||
DmaFill32Defvars(3, 0, subStruct.field_4, 0x1000);
|
||||
LZDecompressVram(&gBattleAnimBackgroundTilemap_SandstormBrew, subStruct.field_4);
|
||||
LZDecompressVram(&gBattleAnimBackgroundImage_SandstormBrew, subStruct.field_0);
|
||||
LoadCompressedPalette(&gBattleAnimSpritePalette_261, subStruct.field_8 << 4, 32);
|
||||
|
||||
if (IsContest())
|
||||
sub_80763FC(subStruct.field_8, (u16 *)subStruct.field_4, 0, 0);
|
||||
|
||||
if (gBattleAnimArgs[0] != 0 && GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
|
||||
var0 = 1;
|
||||
|
||||
gTasks[taskId].data[0] = var0;
|
||||
gTasks[taskId].func = sub_80DD190;
|
||||
}
|
||||
|
||||
static void sub_80DD190(u8 taskId)
|
||||
{
|
||||
struct Struct_sub_8078914 subStruct;
|
||||
|
||||
if (gTasks[taskId].data[0] == 0)
|
||||
gBattle_BG1_X += 0xFFFA;
|
||||
else
|
||||
gBattle_BG1_X += 6;
|
||||
|
||||
gBattle_BG1_Y += -1;
|
||||
|
||||
switch (gTasks[taskId].data[12])
|
||||
{
|
||||
case 0:
|
||||
if (++gTasks[taskId].data[10] == 4)
|
||||
{
|
||||
gTasks[taskId].data[10] = 0;
|
||||
gTasks[taskId].data[11]++;
|
||||
REG_BLDALPHA = gTasks[taskId].data[11] | ((16 - gTasks[taskId].data[11]) << 8);
|
||||
if (gTasks[taskId].data[11] == 7)
|
||||
{
|
||||
gTasks[taskId].data[12]++;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (++gTasks[taskId].data[11] == 101)
|
||||
{
|
||||
gTasks[taskId].data[11] = 7;
|
||||
gTasks[taskId].data[12]++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (++gTasks[taskId].data[10] == 4)
|
||||
{
|
||||
gTasks[taskId].data[10] = 0;
|
||||
gTasks[taskId].data[11]--;
|
||||
REG_BLDALPHA = gTasks[taskId].data[11] | ((16 - gTasks[taskId].data[11]) << 8);
|
||||
if (gTasks[taskId].data[11] == 0)
|
||||
{
|
||||
gTasks[taskId].data[12]++;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sub_8078914(&subStruct);
|
||||
DmaFill32Large(3, 0, subStruct.field_0, 0x2000, 0x1000);
|
||||
DmaClear32(3, subStruct.field_4, 0x800);
|
||||
if (!IsContest())
|
||||
REG_BG1CNT_BITFIELD.charBaseBlock = 0;
|
||||
|
||||
gTasks[taskId].data[12]++;
|
||||
// fall through
|
||||
case 4:
|
||||
gBattle_BG1_X = 0;
|
||||
gBattle_BG1_Y = 0;
|
||||
REG_BLDCNT = 0;
|
||||
REG_BLDALPHA = 0;
|
||||
REG_BG1CNT_BITFIELD.priority = 1;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DD3AC(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
if (gBattleAnimArgs[3] != 0 && GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
|
||||
{
|
||||
sprite->pos1.x = 304;
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
sprite->data[5] = 1;
|
||||
sprite->oam.matrixNum = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x = -64;
|
||||
}
|
||||
|
||||
sprite->pos1.y = gBattleAnimArgs[0];
|
||||
SetSubspriteTables(sprite, &gUnknown_083DAD10);
|
||||
sprite->data[1] = gBattleAnimArgs[1];
|
||||
sprite->data[2] = gBattleAnimArgs[2];
|
||||
sprite->data[0]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->data[3] += sprite->data[1];
|
||||
sprite->data[4] += sprite->data[2];
|
||||
sprite->pos2.x += (sprite->data[3] >> 8);
|
||||
sprite->pos2.y += (sprite->data[4] >> 8);
|
||||
sprite->data[3] &= 0xFF;
|
||||
sprite->data[4] &= 0xFF;
|
||||
|
||||
if (sprite->data[5] == 0)
|
||||
{
|
||||
if (sprite->pos1.x + sprite->pos2.x > 272)
|
||||
{
|
||||
sprite->callback = DestroyAnimSprite;
|
||||
}
|
||||
}
|
||||
else if (sprite->pos1.x + sprite->pos2.x < -32)
|
||||
{
|
||||
sprite->callback = DestroyAnimSprite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DD490(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[4]);
|
||||
sub_80787B0(sprite, 0);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[3];
|
||||
sprite->data[2] = sprite->pos1.x;
|
||||
sprite->data[4] = sprite->pos1.y + gBattleAnimArgs[2];
|
||||
|
||||
sprite->callback = sub_8078B34;
|
||||
StoreSpriteCallbackInData(sprite, DestroyAnimSprite);
|
||||
}
|
||||
|
||||
void sub_80DD4D4(u8 taskId)
|
||||
{
|
||||
u16 var0, var1, var2, var3;
|
||||
u8 var4;
|
||||
int var5;
|
||||
s16 pan1, pan2;
|
||||
struct Task *task;
|
||||
|
||||
task = &gTasks[taskId];
|
||||
|
||||
var0 = GetBankPosition(gAnimBankAttacker, 2);
|
||||
var1 = GetBankPosition(gAnimBankAttacker, 1) + 24;
|
||||
var2 = GetBankPosition(gAnimBankTarget, 2);
|
||||
var3 = GetBankPosition(gAnimBankTarget, 1) + 24;
|
||||
|
||||
if ((gAnimBankAttacker ^ 2) == gAnimBankTarget)
|
||||
var3 = var1;
|
||||
|
||||
var4 = sub_80DD8BC();
|
||||
if (var4 == 1)
|
||||
task->data[8] = 32;
|
||||
else
|
||||
task->data[8] = 48 - (var4 * 8);
|
||||
|
||||
task->data[0] = 0;
|
||||
task->data[11] = 0;
|
||||
task->data[9] = 0;
|
||||
task->data[12] = 1;
|
||||
|
||||
var5 = task->data[8];
|
||||
if (var5 < 0)
|
||||
var5 += 7;
|
||||
|
||||
task->data[10] = (var5 >> 3) - 1;
|
||||
|
||||
task->data[2] = var0 * 8;
|
||||
task->data[3] = var1 * 8;
|
||||
task->data[4] = ((var2 - var0) * 8) / task->data[8];
|
||||
task->data[5] = ((var3 - var1) * 8) / task->data[8];
|
||||
task->data[6] = 0;
|
||||
task->data[7] = 0;
|
||||
|
||||
pan1 = BattleAnimAdjustPanning(-64);
|
||||
pan2 = BattleAnimAdjustPanning(63);
|
||||
|
||||
task->data[13] = pan1;
|
||||
task->data[14] = (pan2 - pan1) / task->data[8];
|
||||
task->data[1] = var4;
|
||||
task->data[15] = GetAnimBankSpriteId(0);
|
||||
|
||||
task->func = sub_80DD604;
|
||||
}
|
||||
|
||||
static void sub_80DD604(u8 taskId)
|
||||
{
|
||||
struct Task *task;
|
||||
|
||||
task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
task->data[6] -= task->data[4];
|
||||
task->data[7] -= task->data[5];
|
||||
gSprites[task->data[15]].pos2.x = task->data[6] >> 3;
|
||||
gSprites[task->data[15]].pos2.y = task->data[7] >> 3;
|
||||
|
||||
if (++task->data[9] == 10)
|
||||
{
|
||||
task->data[11] = 20;
|
||||
task->data[0]++;
|
||||
}
|
||||
|
||||
PlaySE12WithPanning(SE_W029, task->data[13]);
|
||||
break;
|
||||
case 1:
|
||||
if (--task->data[11] == 0)
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
if (--task->data[9] != 0)
|
||||
{
|
||||
task->data[6] += task->data[4];
|
||||
task->data[7] += task->data[5];
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[6] = 0;
|
||||
task->data[7] = 0;
|
||||
task->data[0]++;
|
||||
}
|
||||
|
||||
gSprites[task->data[15]].pos2.x = task->data[6] >> 3;
|
||||
gSprites[task->data[15]].pos2.y = task->data[7] >> 3;
|
||||
break;
|
||||
case 3:
|
||||
task->data[2] += task->data[4];
|
||||
task->data[3] += task->data[5];
|
||||
if (++task->data[9] >= task->data[10])
|
||||
{
|
||||
task->data[9] = 0;
|
||||
sub_80DD774(task);
|
||||
task->data[13] += task->data[14];
|
||||
PlaySE12WithPanning(SE_W091, task->data[13]);
|
||||
}
|
||||
|
||||
if (--task->data[8] == 0)
|
||||
{
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (task->data[11] == 0)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80DD774(struct Task *task)
|
||||
{
|
||||
const struct SpriteTemplate *spriteTemplate;
|
||||
int var0;
|
||||
u16 x, y;
|
||||
u8 spriteId;
|
||||
|
||||
switch (task->data[1])
|
||||
{
|
||||
case 1:
|
||||
spriteTemplate = &gSpriteTemplate_83DAD78;
|
||||
var0 = 0;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
spriteTemplate = &gSpriteTemplate_83DAD90;
|
||||
var0 = 80;
|
||||
break;
|
||||
case 4:
|
||||
spriteTemplate = &gSpriteTemplate_83DAD90;
|
||||
var0 = 64;
|
||||
break;
|
||||
case 5:
|
||||
spriteTemplate = &gSpriteTemplate_83DAD90;
|
||||
var0 = 48;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
x = task->data[2] >> 3;
|
||||
y = task->data[3] >> 3;
|
||||
x += (task->data[12] * 4);
|
||||
|
||||
spriteId = CreateSprite(spriteTemplate, x, y, 35);
|
||||
if (spriteId != 64)
|
||||
{
|
||||
gSprites[spriteId].data[0] = 18;
|
||||
gSprites[spriteId].data[2] = ((task->data[12] * 20) + x) + (task->data[1] * 3);
|
||||
gSprites[spriteId].data[4] = y;
|
||||
gSprites[spriteId].data[5] = -16 - (task->data[1] * 2);
|
||||
gSprites[spriteId].oam.tileNum += var0;
|
||||
|
||||
sub_80786EC(&gSprites[spriteId]);
|
||||
task->data[11]++;
|
||||
}
|
||||
|
||||
task->data[12] *= -1;
|
||||
}
|
||||
|
||||
void sub_80DD87C(struct Sprite *sprite)
|
||||
{
|
||||
if (sub_8078718(sprite))
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(sub_80DD604);
|
||||
if (taskId != 0xFF)
|
||||
gTasks[taskId].data[11]--;
|
||||
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_80DD8BC(void)
|
||||
{
|
||||
u8 retVal = gAnimDisableStructPtr->rolloutTimer2 - gAnimDisableStructPtr->rolloutTimer1;
|
||||
u8 var0 = retVal - 1;
|
||||
if (var0 > 4)
|
||||
{
|
||||
retVal = 1;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void sub_80DD8E8(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[4]);
|
||||
|
||||
sprite->pos2.x = gBattleAnimArgs[0];
|
||||
sprite->data[2] = gBattleAnimArgs[1];
|
||||
sprite->data[3] -= gBattleAnimArgs[2];
|
||||
sprite->data[0] = 3;
|
||||
sprite->data[1] = gBattleAnimArgs[3];
|
||||
sprite->callback = sub_80DD928;
|
||||
sprite->invisible = 1;
|
||||
}
|
||||
|
||||
static void sub_80DD928(struct Sprite *sprite)
|
||||
{
|
||||
sprite->invisible = 0;
|
||||
if (sprite->data[3] != 0)
|
||||
{
|
||||
sprite->pos2.y = sprite->data[2] + sprite->data[3];
|
||||
sprite->data[3] += sprite->data[0];
|
||||
sprite->data[0]++;
|
||||
if (sprite->data[3] > 0)
|
||||
{
|
||||
sprite->data[3] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (--sprite->data[1] == 0)
|
||||
{
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80DD978(struct Sprite *sprite)
|
||||
{
|
||||
if (GetBankSide(gAnimBankAttacker) == SIDE_OPPONENT)
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
|
||||
sub_807941C(sprite);
|
||||
}
|
||||
|
||||
void sub_80DD9A4(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x = GetBankPosition(gAnimBankTarget, 0);
|
||||
sprite->pos1.y = GetBankPosition(gAnimBankTarget, 1);
|
||||
sprite->pos1.x += gBattleAnimArgs[0];
|
||||
sprite->pos1.y += gBattleAnimArgs[1];
|
||||
|
||||
sprite->data[1] = gBattleAnimArgs[0];
|
||||
sprite->data[2] = gBattleAnimArgs[1];
|
||||
sprite->data[5] = gBattleAnimArgs[2];
|
||||
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[3]);
|
||||
sprite->callback = sub_80DD9FC;
|
||||
}
|
||||
|
||||
static void sub_80DD9FC(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[0] += 8;
|
||||
sprite->data[3] += sprite->data[1];
|
||||
sprite->data[4] += sprite->data[2];
|
||||
|
||||
sprite->pos2.x += sprite->data[3] / 40;
|
||||
sprite->pos2.y -= Sin(sprite->data[0], sprite->data[5]);
|
||||
|
||||
if (sprite->data[0] > 140)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
void sub_80DDA4C(u8 taskId)
|
||||
{
|
||||
if ((s32)gAnimMoveDmg < 33)
|
||||
gBattleAnimArgs[7] = 0;
|
||||
if (gAnimMoveDmg - 33 < 33)
|
||||
gBattleAnimArgs[7] = 1;
|
||||
if ((s32)gAnimMoveDmg > 65)
|
||||
gBattleAnimArgs[7] = 2;
|
||||
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void sub_80DDA8C(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] == 0)
|
||||
{
|
||||
sub_80789D4(0);
|
||||
gTasks[taskId].data[1] = 200;
|
||||
}
|
||||
|
||||
gBattle_BG3_Y += gTasks[taskId].data[1] / 10;
|
||||
gTasks[taskId].data[1] -= 3;
|
||||
|
||||
if (gTasks[taskId].data[0] == 120)
|
||||
{
|
||||
sub_80789D4(1);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
|
||||
void sub_80DDAF0(u8 taskId)
|
||||
{
|
||||
if (gTasks[taskId].data[0] == 0)
|
||||
{
|
||||
sub_80789D4(0);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].data[2] = gBattle_BG3_Y;
|
||||
}
|
||||
|
||||
gTasks[taskId].data[1] += 80;
|
||||
gTasks[taskId].data[1] &= 0xFF;
|
||||
gBattle_BG3_Y = gTasks[taskId].data[2] + Cos(4, gTasks[taskId].data[1]);
|
||||
|
||||
if (gBattleAnimArgs[7] == 0xFFF)
|
||||
{
|
||||
gBattle_BG3_Y = 0;
|
||||
sub_80789D4(1);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,6 @@
|
||||
#define COLUMN_COUNT 10
|
||||
#endif
|
||||
|
||||
extern u16 gKeyRepeatStartDelay;
|
||||
|
||||
extern u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
|
||||
|
||||
const u8 gSpriteImage_83CE094[] = INCBIN_U8("graphics/naming_screen/pc_icon/0.4bpp");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "decoration.h"
|
||||
#include "event_data.h"
|
||||
#include "field_fadetransition.h"
|
||||
#include "main.h"
|
||||
#include "menu.h"
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "palette.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokemon_menu.h"
|
||||
#include "field_weather.h"
|
||||
#include "pokemon.h"
|
||||
#include "pokemon_summary_screen.h"
|
||||
#include "overworld.h"
|
||||
|
||||
@@ -205,7 +205,7 @@ static u16 TakeSelectedPokemonFromDaycare(struct DayCare * daycare, u8 slot)
|
||||
|
||||
GetBoxMonNick(&daycare->mons[slot], gStringVar1);
|
||||
species = GetBoxMonData(&daycare->mons[slot], MON_DATA_SPECIES);
|
||||
sub_803B4B4(&daycare->mons[slot], &pokemon);
|
||||
ExpandBoxMon(&daycare->mons[slot], &pokemon);
|
||||
|
||||
if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_LEVEL)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "field_map_obj.h"
|
||||
#include "util.h"
|
||||
#include "field_effect_helpers.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
|
||||
#define subsprite_table(ptr) {.subsprites = ptr, .subspriteCount = (sizeof ptr) / (sizeof(struct Subsprite))}
|
||||
|
||||
|
||||
@@ -2,18 +2,7 @@
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "sprite.h"
|
||||
|
||||
struct UnkStruct
|
||||
{
|
||||
/*0x00*/ u16 tileTag;
|
||||
/*0x02*/ u16 paletteTag;
|
||||
/*0x04*/ u16 unk04;
|
||||
/*0x06*/ u16 unk06;
|
||||
/*0x08*/ u16 unk08;
|
||||
/*0x0A*/ u16 unk0A;
|
||||
/*0x0C*/ s16 unk0C;
|
||||
/*0x10*/ u32 selectedPalettes;
|
||||
};
|
||||
#include "pc_screen_effect.h"
|
||||
|
||||
void sub_80C603C(void);
|
||||
void sub_80C6078(void);
|
||||
@@ -30,7 +19,7 @@ extern const u16 gUnknownPal_083D18EC[16];
|
||||
|
||||
extern const u8 gUnknownGfx_083D190C[128];
|
||||
|
||||
EWRAM_DATA struct UnkStruct *gUnknown_020387EC = NULL;
|
||||
EWRAM_DATA struct PCScreenEffectStruct *gUnknown_020387EC = NULL;
|
||||
|
||||
const struct SpriteSheet gUnknown_083D1898 = { gUnknownGfx_083D190C, sizeof(gUnknownGfx_083D190C), 0 };
|
||||
|
||||
@@ -58,7 +47,7 @@ const struct SpriteTemplate gSpriteTemplate_83D18C0 =
|
||||
sub_80C6130,
|
||||
};
|
||||
|
||||
void sub_80C5CD4(struct UnkStruct *unkStruct)
|
||||
void sub_80C5CD4(struct PCScreenEffectStruct *unkStruct)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
|
||||
20
src/field/pokedex_area_screen.c
Normal file
20
src/field/pokedex_area_screen.c
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
EWRAM_DATA u16 gUnknown_02039260 = 0;
|
||||
EWRAM_DATA u16 gUnknown_02039262 = 0;
|
||||
EWRAM_DATA u16 gUnknown_02039264 = 0;
|
||||
EWRAM_DATA u16 gUnknown_02039266 = 0;
|
||||
EWRAM_DATA u16 gUnknown_02039268 = 0;
|
||||
EWRAM_DATA u16 gUnknown_0203926A = 0;
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
// .rodata
|
||||
|
||||
// .text
|
||||
16
src/field/pokenav.c
Normal file
16
src/field/pokenav.c
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
EWRAM_DATA u8 gUnknown_020388B0[4] = {};
|
||||
EWRAM_DATA u16 gUnknown_020388B4 = 0;
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
// .rodata
|
||||
|
||||
// .text
|
||||
@@ -104,7 +104,6 @@ static EWRAM_DATA struct Pokeblock *gUnknown_0203930C = NULL;
|
||||
EWRAM_DATA u8 gPokeblockMonID = 0;
|
||||
EWRAM_DATA s16 gPokeblockGain = 0;
|
||||
|
||||
extern u16 gKeyRepeatStartDelay;
|
||||
extern u16 gSpecialVar_ItemId; // FIXME: remove after merge of #349 Pokeblock
|
||||
|
||||
static void launch_c3_walk_stairs_and_run_once(void (*const)(void));
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
.syntax unified
|
||||
|
||||
.lcomm gUnknown_030007B8, 0x770
|
||||
.bss
|
||||
|
||||
.global gUnknown_030007B8
|
||||
gUnknown_030007B8:
|
||||
.space 0x770
|
||||
|
||||
.text
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "constants/songs.h"
|
||||
#include "sound.h"
|
||||
#include "sprite.h"
|
||||
#include "mon_markings.h"
|
||||
|
||||
#ifdef GERMAN
|
||||
#define MENU_TEXT_SPRITE_X_OFFSET 24
|
||||
@@ -12,25 +13,6 @@
|
||||
#define MENU_TEXT_SPRITE_X_OFFSET 32
|
||||
#endif
|
||||
|
||||
struct PokemonMarkMenu
|
||||
{
|
||||
/*0x0000*/ u16 baseTileTag;
|
||||
/*0x0002*/ u16 basePaletteTag;
|
||||
/*0x0004*/ u8 markings; // bit flags
|
||||
/*0x0005*/ s8 cursorPos;
|
||||
/*0x0006*/ bool8 markingsArray[4];
|
||||
/*0x000A*/ u8 cursorBaseY;
|
||||
/*0x000B*/ bool8 spriteSheetLoadRequired;
|
||||
/*0x000C*/ struct Sprite *menuWindowSprites[2]; // upper and lower halves of menu window
|
||||
/*0x0014*/ struct Sprite *menuMarkingSprites[4];
|
||||
/*0x0024*/ struct Sprite *menuTextSprite;
|
||||
/*0x0028*/ const u8 *frameTiles;
|
||||
/*0x002C*/ const u16 *framePalette;
|
||||
/*0x0030*/ u8 menuWindowSpriteTiles[0x1000];
|
||||
/*0x1030*/ u8 filler1030[0x80];
|
||||
/*0x10B0*/ u8 tileLoadState;
|
||||
};
|
||||
|
||||
extern u8 gPokenavConditionMenuMisc_Gfx[];
|
||||
extern u16 gUnknown_08E966B8[];
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ void CalculateMonStats(struct Pokemon *mon)
|
||||
SetMonData(mon, MON_DATA_HP, ¤tHP);
|
||||
}
|
||||
|
||||
void sub_803B4B4(const struct BoxPokemon *src, struct Pokemon *dest)
|
||||
void ExpandBoxMon(const struct BoxPokemon *src, struct Pokemon *dest)
|
||||
{
|
||||
u32 value = 0;
|
||||
dest->box = *src;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "constants/hold_effects.h"
|
||||
#include "constants/moves.h"
|
||||
#include "battle.h"
|
||||
#include "battle_util.h"
|
||||
#include "data2.h"
|
||||
@@ -569,7 +570,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
|
||||
u16 *moves = (u16 *)data;
|
||||
s32 i = 0;
|
||||
|
||||
while (moves[i] != 355)
|
||||
while (moves[i] != NUM_MOVES)
|
||||
{
|
||||
u16 move = moves[i];
|
||||
if (substruct1->moves[0] == move
|
||||
|
||||
@@ -1,93 +1,606 @@
|
||||
#include "global.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
#include "palette.h"
|
||||
#include "constants/songs.h"
|
||||
#include "sound.h"
|
||||
#include "field_weather.h"
|
||||
#include "overworld.h"
|
||||
#include "field_fadetransition.h"
|
||||
#include "menu.h"
|
||||
#include "main.h"
|
||||
#include "strings.h"
|
||||
#include "string_util.h"
|
||||
#include "ewram.h"
|
||||
#include "event_data.h"
|
||||
#include "script.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
|
||||
struct StorageAction {
|
||||
u8 *text;
|
||||
u8 format;
|
||||
};
|
||||
|
||||
extern const struct StorageAction gUnknown_083B6DF4[];
|
||||
void StorageSystemCreatePrimaryMenu(u8 whichMenu);
|
||||
void sub_80963D0(u8 curBox);
|
||||
void sub_809658C(void);
|
||||
void sub_80965F8(void);
|
||||
void sub_809662C(void);
|
||||
void sub_809665C(void);
|
||||
void sub_80966F4(const u8 *sourceString, u16 x, u16 y);
|
||||
void sub_8096784(struct Sprite *sprite);
|
||||
|
||||
EWRAM_DATA struct PokemonStorage gPokemonStorage = {0};
|
||||
EWRAM_DATA u8 gUnknown_02038470[3] = {};
|
||||
EWRAM_DATA u8 gUnknown_02038473 = 0;
|
||||
EWRAM_DATA u8 gUnknown_02038474 = 0;
|
||||
EWRAM_DATA struct UnkPSSStruct_2002370 *gUnknown_02038478 = NULL;
|
||||
|
||||
void sub_8098898(u8 index) {
|
||||
u8 *ptr;
|
||||
const struct PSS_MenuStringPtrs gUnknown_083B600C[] = {
|
||||
{PCText_WithdrawPoke, PCText_MovePokeToParty},
|
||||
{PCText_DepositPoke, PCText_StorePokeInBox},
|
||||
{PCText_MovePoke, PCText_OrganizeBoxesParty},
|
||||
{PCText_SeeYa, PCText_ReturnToPrevMenu}
|
||||
};
|
||||
|
||||
Menu_DrawStdWindowFrame(10, 16, 29, 19);
|
||||
const union AnimCmd gSpriteAnim_83B602C[] = {
|
||||
ANIMCMD_FRAME( 0, 5),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
switch (gUnknown_083B6DF4[index].format)
|
||||
const union AnimCmd gSpriteAnim_83B6034[] = {
|
||||
ANIMCMD_FRAME( 4, 5),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_83B603C[] = {
|
||||
ANIMCMD_FRAME( 6, 5),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
const union AnimCmd gSpriteAnim_83B6044[] = {
|
||||
ANIMCMD_FRAME(10, 5),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
const union AnimCmd *const gSpriteAnimTable_83B604C[] = {
|
||||
gSpriteAnim_83B602C,
|
||||
gSpriteAnim_83B6034,
|
||||
gSpriteAnim_83B603C,
|
||||
gSpriteAnim_83B6044
|
||||
};
|
||||
|
||||
const union AffineAnimCmd gSpriteAffineAnim_83B605C[] = {
|
||||
AFFINEANIMCMD_FRAME(0xe0, 0xe0, 0, 0),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_83B606C[] = {
|
||||
gSpriteAffineAnim_83B605C
|
||||
};
|
||||
|
||||
const u16 gBoxSelectionPopupPalette[] = INCBIN_U16("graphics/pokemon_storage/box_selection_popup.gbapal");
|
||||
|
||||
const u8 gBoxSelectionPopupCenterTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_center.4bpp");
|
||||
|
||||
const u8 gBoxSelectionPopupSidesTiles[] = INCBIN_U8("graphics/pokemon_storage/box_selection_popup_sides.4bpp");
|
||||
|
||||
u8 CountPokemonInBoxN(u8 boxId)
|
||||
{
|
||||
u16 i;
|
||||
u16 count;
|
||||
|
||||
for (i = 0, count = 0; i < 30; i++)
|
||||
{
|
||||
|
||||
case 2:
|
||||
ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
ptr = StringCopy(ptr, gUnk20011fa);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
ptr = StringCopy(ptr, gUnk20026e4);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// {var} + " is selected."
|
||||
ptr = StringCopy(gUnk2002694, gUnk20011fa);
|
||||
ptr = StringCopy(ptr, gUnknown_083B6DF4[index].text);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// {var} + " was released."
|
||||
ptr = StringCopy(gUnk2002694, gUnk20026e4);
|
||||
#if ENGLISH
|
||||
ptr = StringCopy(ptr, gUnknown_083B6DF4[index].text);
|
||||
#elif GERMAN
|
||||
ptr = de_sub_8073174(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 3:
|
||||
{
|
||||
u8 *stringLength;
|
||||
u8 *text;
|
||||
|
||||
text = gUnknown_083B6DF4[index].text;
|
||||
stringLength = &text[StringLength(text)] + 1;
|
||||
|
||||
ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
ptr = StringCopy(ptr, gUnk20011fa);
|
||||
ptr = StringCopy(ptr, stringLength);
|
||||
if (GetBoxMonData(gPokemonStorage.boxes[boxId] + i, MON_DATA_SPECIES) != 0)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
s16 GetIndexOfFirstEmptySpaceInBoxN(u8 boxId)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < 30; i++)
|
||||
{
|
||||
if (GetBoxMonData(gPokemonStorage.boxes[boxId] + i, MON_DATA_SPECIES) == 0)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
u8 GetNumValidDaycarePartyMons(void)
|
||||
{
|
||||
u16 i;
|
||||
u16 count;
|
||||
|
||||
for (i = 0, count = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
struct Pokemon *pokemon = gPlayerParty + i;
|
||||
if (GetMonData(pokemon, MON_DATA_SPECIES) != 0 && !GetMonData(pokemon, MON_DATA_IS_EGG))
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
u8 CountAlivePartyMonsExceptOne(u8 toSkip)
|
||||
{
|
||||
u16 i;
|
||||
u16 count;
|
||||
|
||||
for (i = 0, count = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (i != toSkip)
|
||||
{
|
||||
struct Pokemon *pokemon = gPlayerParty + i;
|
||||
if (GetMonData(pokemon, MON_DATA_SPECIES) != 0 && !GetMonData(pokemon, MON_DATA_IS_EGG) && GetMonData(pokemon, MON_DATA_HP) != 0)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
u8 CountAlivePartyMonsExceptSelectedOne(void)
|
||||
{
|
||||
return CountAlivePartyMonsExceptOne(gSpecialVar_0x8004);
|
||||
}
|
||||
|
||||
u8 StorageSystemGetPartySize(void)
|
||||
{
|
||||
u16 i;
|
||||
u16 count;
|
||||
|
||||
for (i = 0, count = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(gPlayerParty + i, MON_DATA_SPECIES) != 0)
|
||||
count++;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
u8 *unref_sub_8095C60(u8 *dest, const u8 *src, u16 pad)
|
||||
{
|
||||
u8 *_dest = StringCopy(dest, src);
|
||||
while (_dest < dest + pad)
|
||||
{
|
||||
*_dest++ = CHAR_SPACE;
|
||||
}
|
||||
*_dest = EOS;
|
||||
return _dest;
|
||||
}
|
||||
|
||||
void sub_8095C8C(u16 *dest, u16 dest_left, u16 dest_top, const u16 *src, u16 src_left, u16 src_top, u16 dest_width, u16 dest_height, u16 src_width)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
dest_width *= 2;
|
||||
dest += dest_top * 0x20 + dest_left;
|
||||
src += src_top * src_width + src_left;
|
||||
for (i = 0; i < dest_height; i++)
|
||||
{
|
||||
CpuCopy16(src, dest, dest_width);
|
||||
dest += 0x20;
|
||||
src += src_width;
|
||||
}
|
||||
}
|
||||
|
||||
#define MAX_DMA_BLOCK_SIZE 0x1000
|
||||
#define Dma3FillLarge_(value, dest, size, bit) \
|
||||
{ \
|
||||
void *_dest = dest; \
|
||||
u32 _size = size; \
|
||||
while (1) \
|
||||
{ \
|
||||
if (_size <= MAX_DMA_BLOCK_SIZE) \
|
||||
{ \
|
||||
DmaFill##bit(3, value, _dest, _size); \
|
||||
break; \
|
||||
} \
|
||||
DmaFill##bit(3, value, _dest, MAX_DMA_BLOCK_SIZE); \
|
||||
_dest += MAX_DMA_BLOCK_SIZE; \
|
||||
_size -= MAX_DMA_BLOCK_SIZE; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define Dma3FillLarge16_(value, dest, size) Dma3FillLarge_(value, dest, size, 16)
|
||||
#define Dma3FillLarge32_(value, dest, size) Dma3FillLarge_(value, dest, size, 32)
|
||||
|
||||
void unref_sub_8095D08(u16 *dest, u16 dest_left, u16 dest_top, u16 width, u16 height)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
dest += dest_top * 0x20 + dest_left;
|
||||
width *= 2;
|
||||
for (i = 0; i < height; dest += 0x20, i++)
|
||||
Dma3FillLarge16_(0, dest, width);
|
||||
}
|
||||
|
||||
s16 StorageSystemGetNextMonIndex(struct BoxPokemon *box, s8 startIdx, u8 stopIdx, u8 mode)
|
||||
{
|
||||
s16 i;
|
||||
s16 direction;
|
||||
if (mode == 0 || mode == 2)
|
||||
{
|
||||
direction = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
direction = -1;
|
||||
}
|
||||
if (mode == 2 || mode == 3)
|
||||
{
|
||||
for (i = startIdx + direction; i >= 0 && i <= stopIdx; i += direction)
|
||||
{
|
||||
if (GetBoxMonData(box + i, MON_DATA_SPECIES) != 0)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = startIdx + direction; i >= 0 && i <= stopIdx; i += direction)
|
||||
{
|
||||
if (GetBoxMonData(box + i, MON_DATA_SPECIES) != 0 && !GetBoxMonData(box + i, MON_DATA_IS_EGG))
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void StorageSystemClearMessageWindow(void)
|
||||
{
|
||||
Menu_BlankWindowRect(2, 15, 27, 18);
|
||||
}
|
||||
|
||||
void Task_PokemonStorageSystem(u8 taskId)
|
||||
{
|
||||
struct Task *task = gTasks + taskId;
|
||||
switch (task->data[0])
|
||||
{
|
||||
case 0:
|
||||
StorageSystemCreatePrimaryMenu(task->data[1]);
|
||||
Menu_DisplayDialogueFrame();
|
||||
Menu_PrintText(gUnknown_083B600C[task->data[1]].desc, 2, 15);
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
if (IsWeatherNotFadingIn())
|
||||
{
|
||||
task->data[0]++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
task->data[2] = Menu_ProcessInput();
|
||||
switch(task->data[2])
|
||||
{
|
||||
case -2:
|
||||
task->data[3] = task->data[1];
|
||||
if (gMain.newKeys & DPAD_UP && --task->data[3] < 0)
|
||||
task->data[3] = 3;
|
||||
|
||||
if (gMain.newKeys & DPAD_DOWN && ++task->data[3] > 3)
|
||||
task->data[3] = 0;
|
||||
if (task->data[1] != task->data[3])
|
||||
{
|
||||
task->data[1] = task->data[3];
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gUnknown_083B600C[task->data[1]].desc, 2, 15);
|
||||
}
|
||||
break;
|
||||
case -1:
|
||||
case 3:
|
||||
Menu_DestroyCursor();
|
||||
Menu_EraseWindowRect(0, 0, 13, 9);
|
||||
ScriptContext2_Disable();
|
||||
EnableBothScriptContexts();
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
default:
|
||||
if (task->data[2] == 0 && StorageSystemGetPartySize() == PARTY_SIZE)
|
||||
{
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gPCText_PartyFull2, 2, 15);
|
||||
task->data[0] = 3;
|
||||
}
|
||||
else if (task->data[2] == 1 && StorageSystemGetPartySize() == 1)
|
||||
{
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gPCText_OnlyOne, 2, 15);
|
||||
task->data[0] = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
FadeScreen(1, 0);
|
||||
task->data[0] = 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
{
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gUnknown_083B600C[task->data[1]].desc, 2, 15);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_UP)
|
||||
{
|
||||
if (--task->data[1] < 0)
|
||||
task->data[1] = 3;
|
||||
Menu_MoveCursor(-1);
|
||||
task->data[1] = Menu_GetCursorPos();
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gUnknown_083B600C[task->data[1]].desc, 2, 15);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_DOWN)
|
||||
{
|
||||
if (++task->data[1] > 3)
|
||||
task->data[1] = 0;
|
||||
Menu_MoveCursor(1);
|
||||
task->data[1] = Menu_GetCursorPos();
|
||||
StorageSystemClearMessageWindow();
|
||||
Menu_PrintText(gUnknown_083B600C[task->data[1]].desc, 2, 15);
|
||||
task->data[0] = 2;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
task_intro_29(task->data[2]);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPokemonStorageSystem(void)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_PokemonStorageSystem, 80);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = 0;
|
||||
ScriptContext2_Enable();
|
||||
}
|
||||
|
||||
void FieldCB_ReturnToOverworld(void)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_PokemonStorageSystem, 80);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = gUnknown_02038474;
|
||||
pal_fill_black();
|
||||
}
|
||||
|
||||
void StorageSystemCreatePrimaryMenu(u8 whichMenu)
|
||||
{
|
||||
Menu_DrawStdWindowFrame(0, 0, 13, 9);
|
||||
Menu_PrintItems(1, 1, 4, (const struct MenuAction *)gUnknown_083B600C);
|
||||
InitMenu(0, 1, 1, 4, whichMenu, 12);
|
||||
}
|
||||
|
||||
void sub_80961A8(void)
|
||||
{
|
||||
gUnknown_02038474 = gPokemonStorageSystemPtr->unk_0005;
|
||||
gFieldCallback = FieldCB_ReturnToOverworld;
|
||||
SetMainCallback2(c2_exit_to_overworld_2_switch);
|
||||
}
|
||||
|
||||
void ResetPokemonStorageSystem(void)
|
||||
{
|
||||
u16 boxId;
|
||||
u16 boxMon;
|
||||
|
||||
gPokemonStorage.currentBox = 0;
|
||||
for (boxId = 0; boxId < 14; boxId++)
|
||||
{
|
||||
for (boxMon = 0; boxMon < 30; boxMon++)
|
||||
{
|
||||
ZeroBoxMonData(gPokemonStorage.boxes[boxId] + boxMon);
|
||||
}
|
||||
}
|
||||
for (boxId = 0; boxId < 14; boxId++)
|
||||
{
|
||||
u8 *dest = StringCopy(gPokemonStorage.boxNames[boxId], gPCText_BOX);
|
||||
ConvertIntToDecimalStringN(dest, boxId + 1, STR_CONV_MODE_LEFT_ALIGN, 2);
|
||||
}
|
||||
for (boxId = 0; boxId < 14; boxId++)
|
||||
{
|
||||
gPokemonStorage.wallpaper[boxId] = boxId & 0x03;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8096264(struct UnkPSSStruct_2002370 *a0, u16 tileTag, u16 palTag, u8 a3)
|
||||
{
|
||||
struct SpritePalette palette = {
|
||||
gBoxSelectionPopupPalette, palTag
|
||||
};
|
||||
struct SpriteSheet sheets[] = {
|
||||
{gBoxSelectionPopupCenterTiles, 0x800, tileTag},
|
||||
{gBoxSelectionPopupSidesTiles, 0x180, tileTag + 1},
|
||||
{}
|
||||
};
|
||||
LoadSpritePalette(&palette);
|
||||
LoadSpriteSheets(sheets);
|
||||
gUnknown_02038478 = a0;
|
||||
a0->unk_0240 = tileTag;
|
||||
a0->unk_0242 = palTag;
|
||||
a0->unk_023e = a3;
|
||||
}
|
||||
|
||||
void sub_8096310(void)
|
||||
{
|
||||
FreeSpritePaletteByTag(gUnknown_02038478->unk_0242);
|
||||
FreeSpriteTilesByTag(gUnknown_02038478->unk_0240);
|
||||
FreeSpriteTilesByTag(gUnknown_02038478->unk_0240 + 1);
|
||||
}
|
||||
|
||||
void sub_809634C(u8 curBox)
|
||||
{
|
||||
sub_80963D0(curBox);
|
||||
}
|
||||
|
||||
void sub_809635C(void)
|
||||
{
|
||||
sub_809658C();
|
||||
}
|
||||
|
||||
u8 sub_8096368(void)
|
||||
{
|
||||
if (gMain.newKeys & B_BUTTON)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return 201;
|
||||
}
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return gUnknown_02038478->curBox;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_809662C();
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_RIGHT)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_80965F8();
|
||||
}
|
||||
return 200;
|
||||
}
|
||||
|
||||
void sub_80963D0(u8 curBox)
|
||||
{
|
||||
u16 i;
|
||||
u8 spriteId;
|
||||
struct SpriteTemplate template;
|
||||
struct OamData oamData = {};
|
||||
oamData.size = 3;
|
||||
oamData.paletteNum = 1;
|
||||
template = (struct SpriteTemplate){
|
||||
0, 0, &oamData, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
};
|
||||
|
||||
gUnknown_02038478->curBox = curBox;
|
||||
template.tileTag = gUnknown_02038478->unk_0240;
|
||||
template.paletteTag = gUnknown_02038478->unk_0242;
|
||||
|
||||
spriteId = CreateSprite(&template, 0xA0, 0x60, 0);
|
||||
gUnknown_02038478->unk_0000 = gSprites + spriteId;
|
||||
|
||||
oamData.shape = ST_OAM_V_RECTANGLE;
|
||||
oamData.size = 1;
|
||||
template.tileTag = gUnknown_02038478->unk_0240 + 1;
|
||||
template.anims = gSpriteAnimTable_83B604C;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
u16 r5;
|
||||
spriteId = CreateSprite(&template, 0x7c, 0x50, gUnknown_02038478->unk_023e);
|
||||
gUnknown_02038478->unk_0004[i] = gSprites + spriteId;
|
||||
r5 = 0;
|
||||
if (i & 2)
|
||||
{
|
||||
gUnknown_02038478->unk_0004[i]->pos1.x = 0xc4;
|
||||
r5 = 2;
|
||||
}
|
||||
if (i & 1)
|
||||
{
|
||||
gUnknown_02038478->unk_0004[i]->pos1.y = 0x70;
|
||||
gUnknown_02038478->unk_0004[i]->oam.size = 0;
|
||||
r5++;
|
||||
}
|
||||
StartSpriteAnim(gUnknown_02038478->unk_0004[i], r5);
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
gUnknown_02038478->unk_0020[i] = sub_809A9A0(72 * i + 0x7c, 0x58, i, 0, gUnknown_02038478->unk_023e);
|
||||
if (gUnknown_02038478->unk_0020[i])
|
||||
{
|
||||
gUnknown_02038478->unk_0020[i]->data[0] = (i == 0 ? -1 : 1);
|
||||
gUnknown_02038478->unk_0020[i]->callback = sub_8096784;
|
||||
}
|
||||
}
|
||||
sub_809665C();
|
||||
}
|
||||
|
||||
void sub_809658C(void)
|
||||
{
|
||||
u16 i;
|
||||
if (gUnknown_02038478->unk_0000)
|
||||
{
|
||||
DestroySprite(gUnknown_02038478->unk_0000);
|
||||
gUnknown_02038478->unk_0000 = NULL;
|
||||
}
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (gUnknown_02038478->unk_0004[i])
|
||||
{
|
||||
DestroySprite(gUnknown_02038478->unk_0004[i]);
|
||||
gUnknown_02038478->unk_0004[i] = NULL;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (gUnknown_02038478->unk_0020[i])
|
||||
DestroySprite(gUnknown_02038478->unk_0020[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80965F8(void)
|
||||
{
|
||||
if (++gUnknown_02038478->curBox > 13)
|
||||
gUnknown_02038478->curBox = 0;
|
||||
sub_809665C();
|
||||
}
|
||||
|
||||
void sub_809662C(void)
|
||||
{
|
||||
gUnknown_02038478->curBox = (gUnknown_02038478->curBox == 0 ? 13 : gUnknown_02038478->curBox - 1);
|
||||
sub_809665C();
|
||||
}
|
||||
|
||||
void sub_809665C(void)
|
||||
{
|
||||
u8 nPokemonInBox = CountPokemonInBoxN(gUnknown_02038478->curBox);
|
||||
u8 *stringVar = gStringVar1;
|
||||
|
||||
stringVar[0] = EXT_CTRL_CODE_BEGIN;
|
||||
stringVar[1] = 0x04; // EXT_CTRL_CODE_COLOR_HIGHLIGHT_SHADOW
|
||||
stringVar[2] = 0x0F; // TEXT_COLOR_WHITE2
|
||||
stringVar[3] = 0x01; // TEXT_COLOR_DARK_GREY
|
||||
stringVar[4] = 0x0E; // TEXT_COLOR_LIGHT_BLUE
|
||||
stringVar += 5;
|
||||
|
||||
stringVar = StringCopy(stringVar, gPokemonStorage.boxNames[gUnknown_02038478->curBox]);
|
||||
|
||||
stringVar[0] = CHAR_NEWLINE;
|
||||
stringVar[1] = EXT_CTRL_CODE_BEGIN;
|
||||
stringVar[2] = 0x11; // EXT_CTRL_CODE_CLEAR
|
||||
if (nPokemonInBox < 10)
|
||||
stringVar[3] = 0x28;
|
||||
else
|
||||
stringVar[3] = 0x22;
|
||||
stringVar += 4;
|
||||
|
||||
stringVar = ConvertIntToDecimalString(stringVar, nPokemonInBox);
|
||||
|
||||
stringVar[0] = CHAR_SLASH;
|
||||
stringVar[1] = CHAR_0 + 3;
|
||||
stringVar[2] = CHAR_0 + 0;
|
||||
stringVar[3] = EOS;
|
||||
sub_80966F4(gStringVar1, 0, 1);
|
||||
}
|
||||
|
||||
void sub_80966F4(const u8 *sourceString, u16 x, u16 y)
|
||||
{
|
||||
u16 *vdest = (u16 *)(BG_CHAR_ADDR(4) + (GetSpriteTileStartByTag(gUnknown_02038478->unk_0240) * 32) + y * 256 + x * 32);
|
||||
u8 *tileBuff = gUnknown_083B6DB8;
|
||||
DmaFill16(3, 0x1111, tileBuff, 0x400);
|
||||
Text_InitWindow8004E3C(&gWindowTemplate_81E6D38, tileBuff, sourceString);
|
||||
DmaCopy16(3, tileBuff, vdest, 0x400);
|
||||
}
|
||||
|
||||
void sub_8096784(struct Sprite *sprite)
|
||||
{
|
||||
if (++sprite->data[1] > 3)
|
||||
{
|
||||
sprite->data[1] = 0;
|
||||
sprite->pos2.x += sprite->data[0];
|
||||
if (++sprite->data[2] > 5)
|
||||
{
|
||||
sprite->data[2] = 0;
|
||||
sprite->pos2.x = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// "Bye-bye, ".substr(0, -1) + {var} + "Bye-bye, !".substr(-1, 1)
|
||||
{
|
||||
u8 *stringLength;
|
||||
u8 *text;
|
||||
|
||||
text = gUnknown_083B6DF4[index].text;
|
||||
stringLength = &text[StringLength(text)] - 1;
|
||||
|
||||
ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
ptr = StringCopy(ptr - 1, gUnk20026e4);
|
||||
ptr = StringCopy(ptr, stringLength);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
default:
|
||||
ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text);
|
||||
break;
|
||||
}
|
||||
|
||||
while (ptr < gUnk20026A6)
|
||||
{
|
||||
ptr[0] = CHAR_SPACE;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
ptr[0] = EOS;
|
||||
Menu_PrintText(gUnk2002694, 11, 17);
|
||||
}
|
||||
|
||||
2063
src/pokemon/pokemon_storage_system_2.c
Normal file
2063
src/pokemon/pokemon_storage_system_2.c
Normal file
File diff suppressed because it is too large
Load Diff
655
src/pokemon/pokemon_storage_system_3.c
Normal file
655
src/pokemon/pokemon_storage_system_3.c
Normal file
@@ -0,0 +1,655 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
#include "constants/species.h"
|
||||
#include "sprite.h"
|
||||
#include "trig.h"
|
||||
#include "pokemon_icon.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
static void sub_8098E68(struct Sprite *sprite);
|
||||
static void sub_8099388(struct Sprite *sprite, u16 a1);
|
||||
static void sub_80993F4(struct Sprite *sprite);
|
||||
static void sub_80999C4(struct Sprite *sprite);
|
||||
static struct Sprite *PSS_SpawnMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 priority, u8 subpriority);
|
||||
static void PSS_DestroyMonIconSprite(struct Sprite *sprite);
|
||||
|
||||
// .rodata
|
||||
|
||||
const struct OamData gOamData_83B6F2C;
|
||||
|
||||
// .text
|
||||
|
||||
u8 get_preferred_box(void)
|
||||
{
|
||||
return gPokemonStorage.currentBox;
|
||||
}
|
||||
|
||||
void ResetPSSMonIconSprites(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
sub_809D51C();
|
||||
for (i = 0; i < 40; i++)
|
||||
gPokemonStorageSystemPtr->unk_10d0[i] = 0;
|
||||
for (i = 0; i < 40; i++)
|
||||
gPokemonStorageSystemPtr->unk_1120[i] = 0;
|
||||
for (i = 0; i < 6; i++)
|
||||
gPokemonStorageSystemPtr->unk_1038[i] = NULL;
|
||||
for (i = 0; i < 30; i++)
|
||||
gPokemonStorageSystemPtr->unk_1050[i] = NULL;
|
||||
gPokemonStorageSystemPtr->unk_1034 = NULL;
|
||||
gPokemonStorageSystemPtr->unk_0d5c = 0;
|
||||
}
|
||||
|
||||
void sub_8098BF0(void)
|
||||
{
|
||||
u32 personality = GetMonData(&gPokemonStorageSystemPtr->unk_25b4, MON_DATA_PERSONALITY);
|
||||
gPokemonStorageSystemPtr->unk_1034 = PSS_SpawnMonIconSprite(GetMonData(&gPokemonStorageSystemPtr->unk_25b4, MON_DATA_SPECIES2), personality, 0, 0, 1, 7);
|
||||
gPokemonStorageSystemPtr->unk_1034->callback = sub_80999C4;
|
||||
}
|
||||
|
||||
void SpawnBoxIconSprites(u8 boxId)
|
||||
{
|
||||
struct BoxPokemon *box = gPokemonStorage.boxes[boxId];
|
||||
u16 i;
|
||||
u16 k = 0;
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
u16 j;
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
u16 species = GetBoxMonData(box, MON_DATA_SPECIES2);
|
||||
if (species != SPECIES_NONE)
|
||||
gPokemonStorageSystemPtr->unk_1050[k] = PSS_SpawnMonIconSprite(species, GetBoxMonData(box, MON_DATA_PERSONALITY), 24 * j + 0x64, 24 * i + 0x2c, 2, 18 - j);
|
||||
else
|
||||
gPokemonStorageSystemPtr->unk_1050[k] = NULL;
|
||||
box++;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8098D20(u8 monId)
|
||||
{
|
||||
struct BoxPokemon *mon = gPokemonStorage.boxes[get_preferred_box()] + monId;
|
||||
u16 species = GetBoxMonData(mon, MON_DATA_SPECIES2);
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
s16 x = 24 * (monId % 6) + 0x64;
|
||||
s16 y = 24 * (monId / 6) + 0x2c;
|
||||
gPokemonStorageSystemPtr->unk_1050[monId] = PSS_SpawnMonIconSprite(species, GetBoxMonData(mon, MON_DATA_PERSONALITY), x, y, 2, 18 - (monId % 6));
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8098DE0(s16 a0)
|
||||
{
|
||||
u16 monId;
|
||||
for (monId = 0; monId < 30; monId++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1050[monId])
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1050[monId]->data[2] = a0;
|
||||
gPokemonStorageSystemPtr->unk_1050[monId]->data[4] = 1;
|
||||
gPokemonStorageSystemPtr->unk_1050[monId]->callback = sub_8098E68;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8098E24(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[1] != 0)
|
||||
{
|
||||
sprite->data[1]--;
|
||||
sprite->pos1.x += sprite->data[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1178--;
|
||||
sprite->pos1.x = sprite->data[3];
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8098E68(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[4] != 0)
|
||||
{
|
||||
sprite->data[4]--;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x += sprite->data[2];
|
||||
sprite->data[5] = sprite->pos1.x + sprite->pos2.x;
|
||||
if (sprite->data[5] < 0x45 || sprite->data[5] > 0xfb)
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_8098EA0(u8 col)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1050[col])
|
||||
{
|
||||
PSS_DestroyMonIconSprite(gPokemonStorageSystemPtr->unk_1050[col]);
|
||||
gPokemonStorageSystemPtr->unk_1050[col] = NULL;
|
||||
}
|
||||
col += 6;
|
||||
}
|
||||
}
|
||||
|
||||
static u8 sub_8098EE0(u8 col, u16 a1, s16 a2)
|
||||
{
|
||||
u16 i;
|
||||
u16 x;
|
||||
u16 y;
|
||||
u8 count;
|
||||
u8 x1;
|
||||
u16 curX;
|
||||
|
||||
y = 0x2c;
|
||||
x = 24 * col + 0x64;
|
||||
curX = x - (a1 + 1) * a2;
|
||||
x1 = 18 - col;
|
||||
count = 0;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
u16 species = GetBoxMonData(gPokemonStorage.boxes[gPokemonStorageSystemPtr->unk_117d] + col, MON_DATA_SPECIES2);
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1050[col] = PSS_SpawnMonIconSprite(species, GetBoxMonData(gPokemonStorage.boxes[gPokemonStorageSystemPtr->unk_117d] + col, MON_DATA_PERSONALITY), curX, y, 2, x1);
|
||||
if (gPokemonStorageSystemPtr->unk_1050[col])
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1050[col]->data[1] = a1;
|
||||
gPokemonStorageSystemPtr->unk_1050[col]->data[2] = a2;
|
||||
gPokemonStorageSystemPtr->unk_1050[col]->data[3] = x;
|
||||
gPokemonStorageSystemPtr->unk_1050[col]->callback = sub_8098E24;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
col += 6;
|
||||
y += 24;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void sub_809900C(u8 a0, s8 a1)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_117c = 0;
|
||||
gPokemonStorageSystemPtr->unk_117d = a0;
|
||||
gPokemonStorageSystemPtr->unk_117b = a1;
|
||||
gPokemonStorageSystemPtr->unk_1172 = 32;
|
||||
gPokemonStorageSystemPtr->unk_1176 = -6 * a1;
|
||||
gPokemonStorageSystemPtr->unk_1178 = 0;
|
||||
if (a1 > 0)
|
||||
gPokemonStorageSystemPtr->unk_117a = 0;
|
||||
else
|
||||
gPokemonStorageSystemPtr->unk_117a = 5;
|
||||
gPokemonStorageSystemPtr->unk_1174 = 24 * gPokemonStorageSystemPtr->unk_117a + 0x64;
|
||||
sub_8098DE0(gPokemonStorageSystemPtr->unk_1176);
|
||||
}
|
||||
|
||||
bool8 sub_80990AC(void)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1172)
|
||||
gPokemonStorageSystemPtr->unk_1172--;
|
||||
switch (gPokemonStorageSystemPtr->unk_117c)
|
||||
{
|
||||
case 0:
|
||||
gPokemonStorageSystemPtr->unk_1174 += gPokemonStorageSystemPtr->unk_1176;
|
||||
if (gPokemonStorageSystemPtr->unk_1174 < 0x41 || gPokemonStorageSystemPtr->unk_1174 > 0xfb)
|
||||
{
|
||||
sub_8098EA0(gPokemonStorageSystemPtr->unk_117a);
|
||||
gPokemonStorageSystemPtr->unk_1174 += 24 * gPokemonStorageSystemPtr->unk_117b;
|
||||
gPokemonStorageSystemPtr->unk_117c++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
gPokemonStorageSystemPtr->unk_1174 += gPokemonStorageSystemPtr->unk_1176;
|
||||
gPokemonStorageSystemPtr->unk_1178 += sub_8098EE0(gPokemonStorageSystemPtr->unk_117a, gPokemonStorageSystemPtr->unk_1172, gPokemonStorageSystemPtr->unk_1176);
|
||||
if ((gPokemonStorageSystemPtr->unk_117b > 0 && gPokemonStorageSystemPtr->unk_117a == 5) || (gPokemonStorageSystemPtr->unk_117b < 0 && gPokemonStorageSystemPtr->unk_117a == 0))
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_117c++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_117a += gPokemonStorageSystemPtr->unk_117b;
|
||||
gPokemonStorageSystemPtr->unk_117c = 0;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (gPokemonStorageSystemPtr->unk_1178 == 0)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1172++;
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8099200(bool8 a0)
|
||||
{
|
||||
u16 count;
|
||||
u16 i;
|
||||
u16 species = GetMonData(gPlayerParty + 0, MON_DATA_SPECIES2);
|
||||
u32 personality = GetMonData(gPlayerParty + 0, MON_DATA_PERSONALITY);
|
||||
gPokemonStorageSystemPtr->unk_1038[0] = PSS_SpawnMonIconSprite(species, personality, 0x68, 0x40, 1, 11);
|
||||
count = 1;
|
||||
for (i = 1; i < PARTY_SIZE; i++)
|
||||
{
|
||||
species = GetMonData(gPlayerParty + i, MON_DATA_SPECIES2);
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
personality = GetMonData(gPlayerParty + i, MON_DATA_PERSONALITY);
|
||||
gPokemonStorageSystemPtr->unk_1038[i] = PSS_SpawnMonIconSprite(species, personality, 0x98, (i - 1) * 24 + 0x10, 1, 11);
|
||||
count++;
|
||||
}
|
||||
else
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1038[i] = NULL;
|
||||
}
|
||||
}
|
||||
if (!a0)
|
||||
{
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
// this routine assumes party_compaction has been called
|
||||
gPokemonStorageSystemPtr->unk_1038[i]->pos1.y -= 0xa0;
|
||||
gPokemonStorageSystemPtr->unk_1038[i]->invisible = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8099310(void)
|
||||
{
|
||||
u16 i;
|
||||
u16 count;
|
||||
|
||||
gPokemonStorageSystemPtr->unk_1171 = 0;
|
||||
for (i = 0, count = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1038[i])
|
||||
{
|
||||
if (i != count)
|
||||
{
|
||||
sub_8099388(gPokemonStorageSystemPtr->unk_1038[i], count);
|
||||
gPokemonStorageSystemPtr->unk_1038[i] = NULL;
|
||||
gPokemonStorageSystemPtr->unk_1171++;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_8099374(void)
|
||||
{
|
||||
return gPokemonStorageSystemPtr->unk_1171;
|
||||
}
|
||||
|
||||
static void sub_8099388(struct Sprite *sprite, u16 a1)
|
||||
{
|
||||
s16 r3;
|
||||
s16 r4;
|
||||
|
||||
sprite->data[1] = a1;
|
||||
if (a1 == 0)
|
||||
{
|
||||
r3 = 0x68;
|
||||
r4 = 0x40;
|
||||
}
|
||||
else
|
||||
{
|
||||
r3 = 0x98;
|
||||
r4 = 24 * (a1 - 1) + 0x10;
|
||||
}
|
||||
sprite->data[2] = sprite->pos1.x << 3;
|
||||
sprite->data[3] = sprite->pos1.y << 3;
|
||||
sprite->data[4] = (r3 * 8 - sprite->data[2]) / 8;
|
||||
sprite->data[5] = (r4 * 8 - sprite->data[3]) / 8;
|
||||
sprite->data[6] = 8;
|
||||
sprite->callback = sub_80993F4;
|
||||
}
|
||||
|
||||
static void sub_80993F4(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[6])
|
||||
{
|
||||
sprite->data[2] += sprite->data[4];
|
||||
sprite->data[3] += sprite->data[5];
|
||||
sprite->pos1.x = sprite->data[2] >> 3;
|
||||
sprite->pos1.y = sprite->data[3] >> 3;
|
||||
sprite->data[6]--;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sprite->data[1] == 0)
|
||||
{
|
||||
sprite->pos1.x = 0x68;
|
||||
sprite->pos1.y = 0x40;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->pos1.x = 0x98;
|
||||
sprite->pos1.y = (sprite->data[1] - 1) * 24 + 0x10;
|
||||
}
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
gPokemonStorageSystemPtr->unk_1038[sprite->data[1]] = sprite;
|
||||
gPokemonStorageSystemPtr->unk_1171--;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8099480(void)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1034)
|
||||
{
|
||||
PSS_DestroyMonIconSprite(gPokemonStorageSystemPtr->unk_1034);
|
||||
gPokemonStorageSystemPtr->unk_1034 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80994A8(s16 y)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1038[i])
|
||||
{
|
||||
s16 yy;
|
||||
gPokemonStorageSystemPtr->unk_1038[i]->pos1.y += y;
|
||||
yy = gPokemonStorageSystemPtr->unk_1038[i]->pos1.y + gPokemonStorageSystemPtr->unk_1038[i]->pos2.y + gPokemonStorageSystemPtr->unk_1038[i]->centerToCornerVecY;
|
||||
if (yy < -0x10 || yy > 0xb0)
|
||||
gPokemonStorageSystemPtr->unk_1038[i]->invisible = TRUE;
|
||||
else
|
||||
gPokemonStorageSystemPtr->unk_1038[i]->invisible = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8099520(u8 a0)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1038[a0])
|
||||
{
|
||||
PSS_DestroyMonIconSprite(gPokemonStorageSystemPtr->unk_1038[a0]);
|
||||
gPokemonStorageSystemPtr->unk_1038[a0] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_809954C(void)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1038[i])
|
||||
{
|
||||
PSS_DestroyMonIconSprite(gPokemonStorageSystemPtr->unk_1038[i]);
|
||||
gPokemonStorageSystemPtr->unk_1038[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8099584(u8 a0, u8 a1)
|
||||
{
|
||||
if (a0 == 0)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1034 = gPokemonStorageSystemPtr->unk_1038[a1];
|
||||
gPokemonStorageSystemPtr->unk_1038[a1] = NULL;
|
||||
}
|
||||
else if (a0 == 1)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1034 = gPokemonStorageSystemPtr->unk_1050[a1];
|
||||
gPokemonStorageSystemPtr->unk_1050[a1] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
gPokemonStorageSystemPtr->unk_1034->callback = sub_80999C4;
|
||||
gPokemonStorageSystemPtr->unk_1034->oam.priority = 1;
|
||||
gPokemonStorageSystemPtr->unk_1034->subpriority = 7;
|
||||
}
|
||||
|
||||
void sub_809960C(u8 a0, u8 a1)
|
||||
{
|
||||
if (a0 == 14)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1038[a1] = gPokemonStorageSystemPtr->unk_1034;
|
||||
gPokemonStorageSystemPtr->unk_1038[a1]->oam.priority = 1;
|
||||
gPokemonStorageSystemPtr->unk_1038[a1]->subpriority = 11;
|
||||
}
|
||||
else
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1050[a1] = gPokemonStorageSystemPtr->unk_1034;
|
||||
gPokemonStorageSystemPtr->unk_1050[a1]->oam.priority = 2;
|
||||
gPokemonStorageSystemPtr->unk_1050[a1]->subpriority = 18 - (a1 % 6);
|
||||
}
|
||||
gPokemonStorageSystemPtr->unk_1034->callback = SpriteCallbackDummy;
|
||||
gPokemonStorageSystemPtr->unk_1034 = NULL;
|
||||
}
|
||||
|
||||
void sub_80996B0(u8 a0, u8 a1)
|
||||
{
|
||||
if (a0 == 14)
|
||||
gPokemonStorageSystemPtr->unk_10c8 = gPokemonStorageSystemPtr->unk_1038 + a1;
|
||||
else
|
||||
gPokemonStorageSystemPtr->unk_10c8 = gPokemonStorageSystemPtr->unk_1050 + a1;
|
||||
gPokemonStorageSystemPtr->unk_1034->callback = SpriteCallbackDummy;
|
||||
gPokemonStorageSystemPtr->unk_1170 = 0;
|
||||
}
|
||||
|
||||
bool8 sub_809971C(void)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1170 == 16)
|
||||
return FALSE;
|
||||
gPokemonStorageSystemPtr->unk_1170++;
|
||||
if (gPokemonStorageSystemPtr->unk_1170 & 1)
|
||||
{
|
||||
(*gPokemonStorageSystemPtr->unk_10c8)->pos1.y--;
|
||||
gPokemonStorageSystemPtr->unk_1034->pos1.y++;
|
||||
}
|
||||
(*gPokemonStorageSystemPtr->unk_10c8)->pos2.x = gSineTable[gPokemonStorageSystemPtr->unk_1170 * 8] / 16;
|
||||
gPokemonStorageSystemPtr->unk_1034->pos2.x = -(gSineTable[gPokemonStorageSystemPtr->unk_1170 * 8] / 16);
|
||||
if (gPokemonStorageSystemPtr->unk_1170 == 8)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1034->oam.priority = (*gPokemonStorageSystemPtr->unk_10c8)->oam.priority;
|
||||
gPokemonStorageSystemPtr->unk_1034->subpriority = (*gPokemonStorageSystemPtr->unk_10c8)->subpriority;
|
||||
(*gPokemonStorageSystemPtr->unk_10c8)->oam.priority = 1;
|
||||
(*gPokemonStorageSystemPtr->unk_10c8)->subpriority = 7;
|
||||
}
|
||||
if (gPokemonStorageSystemPtr->unk_1170 == 16)
|
||||
{
|
||||
struct Sprite *sprite = gPokemonStorageSystemPtr->unk_1034;
|
||||
gPokemonStorageSystemPtr->unk_1034 = *(gPokemonStorageSystemPtr->unk_10c8);
|
||||
(*gPokemonStorageSystemPtr->unk_10c8) = sprite;
|
||||
gPokemonStorageSystemPtr->unk_1034->callback = sub_80999C4;
|
||||
(*gPokemonStorageSystemPtr->unk_10c8)->callback = SpriteCallbackDummy;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_83B6F5C[];
|
||||
|
||||
void sub_809981C(u8 mode, u8 idx)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
gPokemonStorageSystemPtr->unk_10cc = gPokemonStorageSystemPtr->unk_1038 + idx;
|
||||
break;
|
||||
case 1:
|
||||
gPokemonStorageSystemPtr->unk_10cc = gPokemonStorageSystemPtr->unk_1050 + idx;
|
||||
break;
|
||||
case 2:
|
||||
gPokemonStorageSystemPtr->unk_10cc = &gPokemonStorageSystemPtr->unk_1034;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (*gPokemonStorageSystemPtr->unk_10cc)
|
||||
{
|
||||
InitSpriteAffineAnim(*gPokemonStorageSystemPtr->unk_10cc);
|
||||
(*gPokemonStorageSystemPtr->unk_10cc)->oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
(*gPokemonStorageSystemPtr->unk_10cc)->affineAnims = gSpriteAffineAnimTable_83B6F5C;
|
||||
StartSpriteAffineAnim(*gPokemonStorageSystemPtr->unk_10cc, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_80998D8(void)
|
||||
{
|
||||
if (*gPokemonStorageSystemPtr->unk_10cc == NULL || (*gPokemonStorageSystemPtr->unk_10cc)->invisible)
|
||||
return FALSE;
|
||||
if ((*gPokemonStorageSystemPtr->unk_10cc)->affineAnimEnded)
|
||||
{
|
||||
(*gPokemonStorageSystemPtr->unk_10cc)->invisible = TRUE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8099920(void)
|
||||
{
|
||||
if (*gPokemonStorageSystemPtr->unk_10cc)
|
||||
{
|
||||
FreeOamMatrix((*gPokemonStorageSystemPtr->unk_10cc)->oam.matrixNum);
|
||||
PSS_DestroyMonIconSprite(*gPokemonStorageSystemPtr->unk_10cc);
|
||||
*gPokemonStorageSystemPtr->unk_10cc = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8099958(void)
|
||||
{
|
||||
if (*gPokemonStorageSystemPtr->unk_10cc)
|
||||
{
|
||||
(*gPokemonStorageSystemPtr->unk_10cc)->invisible = FALSE;
|
||||
StartSpriteAffineAnim(*gPokemonStorageSystemPtr->unk_10cc, 1);
|
||||
}
|
||||
}
|
||||
|
||||
bool8 sub_8099990(void)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_10cc == NULL)
|
||||
return FALSE;
|
||||
if ((*gPokemonStorageSystemPtr->unk_10cc)->affineAnimEnded)
|
||||
gPokemonStorageSystemPtr->unk_10cc = NULL;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void sub_80999C4(struct Sprite *sprite)
|
||||
{
|
||||
sprite->pos1.x = gPokemonStorageSystemPtr->unk_11c0->pos1.x;
|
||||
sprite->pos1.y = gPokemonStorageSystemPtr->unk_11c0->pos1.y + gPokemonStorageSystemPtr->unk_11c0->pos2.y + 4;
|
||||
}
|
||||
|
||||
static u16 PSS_LoadSpeciesIconGfx(u16 a0)
|
||||
{
|
||||
u16 i;
|
||||
u16 retval;
|
||||
|
||||
for (i = 0; i < 40; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1120[i] == a0)
|
||||
break;
|
||||
}
|
||||
if (i == 40)
|
||||
{
|
||||
for (i = 0; i < 40; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1120[i] == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i != 40)
|
||||
{
|
||||
gPokemonStorageSystemPtr->unk_1120[i] = a0;
|
||||
gPokemonStorageSystemPtr->unk_10d0[i]++;
|
||||
retval = i * 16;
|
||||
CpuCopy32(gMonIconTable[a0], BG_CHAR_ADDR(4) + 32 * retval, 0x200);
|
||||
return retval;
|
||||
}
|
||||
return 0xFFFF;
|
||||
}
|
||||
|
||||
static void PSS_ForgetSpeciesIcon(u16 a0)
|
||||
{
|
||||
u16 i;
|
||||
|
||||
for (i = 0; i < 40; i++)
|
||||
{
|
||||
if (gPokemonStorageSystemPtr->unk_1120[i] == a0)
|
||||
{
|
||||
if (--gPokemonStorageSystemPtr->unk_10d0[i] == 0)
|
||||
gPokemonStorageSystemPtr->unk_1120[i] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static struct Sprite *PSS_SpawnMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u8 priority, u8 subpriority)
|
||||
{
|
||||
struct SpriteTemplate template = {
|
||||
0x000f,
|
||||
0xdac0,
|
||||
&gOamData_83B6F2C,
|
||||
gDummySpriteAnimTable,
|
||||
NULL,
|
||||
gDummySpriteAffineAnimTable,
|
||||
SpriteCallbackDummy
|
||||
};
|
||||
u16 tileNum;
|
||||
u8 spriteId;
|
||||
|
||||
species = mon_icon_convert_unown_species_id(species, personality);
|
||||
template.paletteTag = 0xdac0 + gMonIconPaletteIndices[species];
|
||||
tileNum = PSS_LoadSpeciesIconGfx(species);
|
||||
if (tileNum == 0xFFFF)
|
||||
return NULL;
|
||||
spriteId = CreateSprite(&template, x, y, subpriority);
|
||||
if (spriteId == MAX_SPRITES)
|
||||
{
|
||||
PSS_ForgetSpeciesIcon(species);
|
||||
return NULL;
|
||||
}
|
||||
gSprites[spriteId].oam.tileNum = tileNum;
|
||||
gSprites[spriteId].oam.priority = priority;
|
||||
gSprites[spriteId].data[0] = species;
|
||||
return gSprites + spriteId;
|
||||
}
|
||||
|
||||
static void PSS_DestroyMonIconSprite(struct Sprite *sprite)
|
||||
{
|
||||
PSS_ForgetSpeciesIcon(sprite->data[0]);
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
|
||||
const struct OamData gOamData_83B6F2C = {
|
||||
.size = 2
|
||||
};
|
||||
|
||||
const union AffineAnimCmd gSpriteAffineAnim_83B6F34[] = {
|
||||
AFFINEANIMCMD_FRAME(-2, -2, 0, 120),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd gSpriteAffineAnim_83B6F44[] = {
|
||||
AFFINEANIMCMD_FRAME(16, 16, 0, 0),
|
||||
AFFINEANIMCMD_FRAME(16, 16, 0, 15),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const gSpriteAffineAnimTable_83B6F5C[] = {
|
||||
gSpriteAffineAnim_83B6F34,
|
||||
gSpriteAffineAnim_83B6F44
|
||||
};
|
||||
2844
src/pokemon/pokemon_storage_system_4.c
Normal file
2844
src/pokemon/pokemon_storage_system_4.c
Normal file
File diff suppressed because it is too large
Load Diff
16
src/pokemon/pokemon_storage_system_5.c
Normal file
16
src/pokemon/pokemon_storage_system_5.c
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
// Includes
|
||||
#include "global.h"
|
||||
#include "pokemon_storage_system.h"
|
||||
|
||||
// Static type declarations
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
EWRAM_DATA struct UnkStruct_2000020 *gUnknown_020384EC = NULL;
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
// .rodata
|
||||
|
||||
// .text
|
||||
@@ -144,7 +144,6 @@ extern const u8 gUnknown_08E74E88[];
|
||||
extern const u8 gUnknown_08E73508[];
|
||||
extern const u8 gStatusScreen_Gfx[];
|
||||
extern const u8 gFontDefaultPalette[];
|
||||
extern const u8 gUnknownPalette_81E6692[];
|
||||
extern const u8 gAbilityNames[][13];
|
||||
extern const u8 * const gAbilityDescriptions[];
|
||||
extern const u8 * const gContestEffectStrings[];
|
||||
@@ -931,21 +930,21 @@ static bool8 LoadPokemonSummaryScreenGraphics(void)
|
||||
|
||||
static void sub_809E044(void)
|
||||
{
|
||||
LoadPalette(&gUnknownPalette_81E6692[28], 129, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[30], 136, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[28], 143, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[30], 137, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[12], 209, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[20], 211, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[28], 213, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[12], 215, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[8], 217, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[16], 219, 4);
|
||||
LoadPalette(&gUnknownPalette_81E6692[4], 221, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[6], 222, 2);
|
||||
LoadPalette(&gUnknownPalette_81E6692[2], 223, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 14, 129, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 15, 136, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 14, 143, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 15, 137, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 6, 209, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 10, 211, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 14, 213, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 6, 215, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 4, 217, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 8, 219, 4);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 2, 221, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 3, 222, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 1, 223, 2);
|
||||
LoadPalette(gFontDefaultPalette, 240, 32);
|
||||
LoadPalette(&gUnknownPalette_81E6692[6], 249, 2);
|
||||
LoadPalette(gUnknownPalette_81E6692 + 3, 249, 2);
|
||||
}
|
||||
|
||||
static void SummaryScreenExit(u8 taskId)
|
||||
@@ -2245,7 +2244,7 @@ static void sub_809F678(struct Pokemon *mon)
|
||||
else
|
||||
{
|
||||
struct BoxPokemon *mons = pssData.monList.boxMons;
|
||||
sub_803B4B4(&mons[pssData.monIndex], mon);
|
||||
ExpandBoxMon(&mons[pssData.monIndex], mon);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ extern const u16 gPokenavConditionSearch2_Pal[];
|
||||
extern const u8 gUnknown_083E0334[];
|
||||
extern const u16 gUnknown_083E02B4[];
|
||||
extern const u8 gPokenavConditionSearch2_Gfx[];
|
||||
extern const u8 gUnknownPalette_81E6692[];
|
||||
extern const u8 gUnknown_083E0254[];
|
||||
extern const u8 gUnknown_08E9FEB4[];
|
||||
extern const u8 gUnknown_083E01AC[];
|
||||
|
||||
@@ -1970,7 +1970,7 @@ void sub_807A0F4(struct Sprite *sprite)
|
||||
DestroySpriteAndFreeResources(sprite);
|
||||
}
|
||||
|
||||
int sub_807A100(u8 slot, u8 a2)
|
||||
s16 sub_807A100(u8 slot, u8 a2)
|
||||
{
|
||||
u16 species;
|
||||
u32 personality;
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "random.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "trig.h"
|
||||
#include "hof_pc.h"
|
||||
#include "credits.h"
|
||||
#include "pc_screen_effect.h"
|
||||
#include "ewram.h"
|
||||
|
||||
static EWRAM_DATA u32 sUnknown_0203931C = 0;
|
||||
@@ -88,15 +91,6 @@ static u32 HallOfFame_LoadPokemonPic(u16 species, s16 posX, s16 posY, u16 pokeID
|
||||
static u32 HallOfFame_LoadTrainerPic(u16 trainerPicID, s16 posX, s16 posY, u16 a3);
|
||||
static bool8 sub_81438C4(void);
|
||||
|
||||
// functions from different files
|
||||
void sub_81439D0(void);
|
||||
void sub_80C5CD4(void*); // ?
|
||||
void sub_80C5E38(void*); // ?
|
||||
bool8 sub_80C5DCC(void);
|
||||
bool8 sub_80C5F98(void);
|
||||
void ReturnFromHallOfFamePC(void);
|
||||
u16 SpeciesToPokedexNum(u16 species);
|
||||
|
||||
// data and gfx
|
||||
|
||||
static const struct CompressedSpriteSheet sHallOfFame_ConfettiSpriteSheet =
|
||||
@@ -130,9 +124,9 @@ static const s16 sHallOfFame_MonsHalfTeamPositions[3][4] =
|
||||
{-41, 214, 184, 64}
|
||||
};
|
||||
|
||||
static const struct HallofFameMon sDummyFameMon =
|
||||
{
|
||||
0x3EA03EA, 0, 0, 0, {0}
|
||||
static const struct PCScreenEffectStruct sPCScreenEffectTemplate = {
|
||||
.tileTag = 0x3ea,
|
||||
.paletteTag = 0x3ea
|
||||
};
|
||||
|
||||
static const u8 sUnused2[6] = {2, 1, 3, 6, 4, 5};
|
||||
@@ -800,20 +794,15 @@ void sub_81428CC(void)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
struct HallofFameMons* fameMons;
|
||||
REG_BLDCNT = 0;
|
||||
REG_BLDALPHA = 0;
|
||||
REG_BLDY = 0;
|
||||
sub_81435B8();
|
||||
|
||||
REG_BLDCNT = 0;
|
||||
REG_BLDALPHA = 0;
|
||||
REG_BLDY = 0;
|
||||
sub_81435B8();
|
||||
eHOFPCScreenEffect = sPCScreenEffectTemplate;
|
||||
|
||||
fameMons = eHallOfFameMons1;
|
||||
fameMons->mons[0] = sDummyFameMon;
|
||||
|
||||
sub_80C5CD4(fameMons);
|
||||
gMain.state++;
|
||||
}
|
||||
sub_80C5CD4(&eHOFPCScreenEffect);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 4:
|
||||
AnimateSprites();
|
||||
@@ -1022,12 +1011,9 @@ static void sub_8142DF4(u8 taskID)
|
||||
|
||||
static void sub_8142F78(u8 taskID)
|
||||
{
|
||||
struct HallofFameMons* fameMons;
|
||||
|
||||
CpuSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x200);
|
||||
fameMons = eHallOfFameMons1;
|
||||
fameMons->mons[0] = sDummyFameMon;
|
||||
sub_80C5E38(fameMons);
|
||||
eHOFPCScreenEffect = sPCScreenEffectTemplate;
|
||||
sub_80C5E38(&eHOFPCScreenEffect);
|
||||
gTasks[taskID].func = sub_8142FCC;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ SYMBOL(gEggHatchData, 4)
|
||||
// load_save.c
|
||||
SYMBOL(gFlashMemoryPresent, 4)
|
||||
|
||||
// ???
|
||||
// trade.c
|
||||
SYMBOL(gUnknown_03004824, 4)
|
||||
SYMBOL(gUnknown_03004828, 4)
|
||||
. += 0x4;
|
||||
@@ -204,15 +204,20 @@ SYMBOL(gUnknown_03005CE4, 4)
|
||||
SYMBOL(gUnknown_03005CE8, 4)
|
||||
SYMBOL(gUnknown_03005CEC, 4)
|
||||
|
||||
// ???
|
||||
// pokemon_summary_screen.o
|
||||
SYMBOL(gUnknown_03005CF0, 4)
|
||||
|
||||
// huh?
|
||||
. = ALIGN(16);
|
||||
|
||||
// item_menu.c
|
||||
gFieldItemUseCallback = .;
|
||||
. += 0x10;
|
||||
gBagPocketScrollStates = .;
|
||||
. += 0x14;
|
||||
SYMBOL(gCurrentBagPocketItemSlots, 4)
|
||||
|
||||
// contest.c
|
||||
SYMBOL(gContestRngValue, 4)
|
||||
|
||||
// record_mixing.c
|
||||
@@ -226,8 +231,10 @@ SYMBOL(gSoundTestCryNum, 4)
|
||||
SYMBOL(gUnknown_03005D38, 4)
|
||||
. += 0x64; // huge gap?
|
||||
|
||||
// ???
|
||||
// mauville_man.c
|
||||
SYMBOL(gUnknown_03005DA0, 0x48)
|
||||
|
||||
// cute_sketch.c
|
||||
SYMBOL(gUnknown_03005DE8, 4)
|
||||
SYMBOL(gUnknown_03005DEC, 4)
|
||||
SYMBOL(gUnknown_03005DF0, 4)
|
||||
@@ -249,7 +256,7 @@ SYMBOL(gUnknown_03005E90, 4)
|
||||
// evolution_scene.c
|
||||
SYMBOL(gCB2_AfterEvolution, 4)
|
||||
|
||||
// ???
|
||||
// pokedex_cry_screen.c
|
||||
SYMBOL(gUnknown_03005E98, 4)
|
||||
|
||||
// save.c
|
||||
@@ -268,7 +275,7 @@ SYMBOL(gGameContinueCallback, 4)
|
||||
SYMBOL(gIntroFrameCounter, 4)
|
||||
SYMBOL(gMultibootProgramStruct, 44)
|
||||
|
||||
// ???
|
||||
// battle_anim_813F0F4.c
|
||||
SYMBOL(gUnknown_03005F0C, 4)
|
||||
SYMBOL(gUnknown_03005F10, 4)
|
||||
gUnknown_03005F14 = .;
|
||||
|
||||
@@ -326,61 +326,10 @@ gBattleMonForms = .; /* 2024E84 */
|
||||
. = ALIGN(4); src/pokemon/pokedex.o(ewram_data);
|
||||
. = ALIGN(4); src/engine/trainer_card.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/pokemon_storage_system.o(ewram_data);
|
||||
|
||||
/* still pokemon_storage_system */
|
||||
|
||||
. = ALIGN(4);
|
||||
gUnknown_02038470 = .; /* 2038470 */
|
||||
. += 0x3;
|
||||
|
||||
gUnknown_02038473 = .; /* 2038473 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_02038474 = .; /* 2038474 */
|
||||
. += 0x4;
|
||||
|
||||
gUnknown_02038478 = .; /* 2038478 */
|
||||
. += 0x4;
|
||||
|
||||
gUnknown_0203847C = .; /* 203847C */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_0203847D = .; /* 203847D */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_0203847E = .; /* 203847E */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_0203847F = .; /* 203847F */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_02038480 = .; /* 2038480 */
|
||||
. += 0x64;
|
||||
|
||||
gUnknown_020384E4 = .; /* 20384E4 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384E5 = .; /* 20384E5 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384E6 = .; /* 20384E6 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384E7 = .; /* 20384E7 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384E8 = .; /* 20384E8 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384E9 = .; /* 20384E9 */
|
||||
. += 0x1;
|
||||
|
||||
gUnknown_020384EA = .; /* 20384EA */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_020384EC = .; /* 20384EC */
|
||||
. += 0x4;
|
||||
|
||||
. = ALIGN(4); src/pokemon/pokemon_storage_system_2.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/pokemon_storage_system_3.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/pokemon_storage_system_4.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/pokemon_storage_system_5.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/pokemon_summary_screen.o(ewram_data);
|
||||
. = ALIGN(4); src/field/script_movement.o(ewram_data);
|
||||
. = ALIGN(4); src/field/map_name_popup.o(ewram_data);
|
||||
@@ -397,16 +346,7 @@ gUnknown_020384EC = .; /* 20384EC */
|
||||
. = ALIGN(4); src/field/rotating_gate.o(ewram_data);
|
||||
. = ALIGN(4); src/field/safari_zone.o(ewram_data);
|
||||
. = ALIGN(4); src/easy_chat_2.o(ewram_data);
|
||||
|
||||
/* pokenav */
|
||||
|
||||
. = ALIGN(4);
|
||||
gUnknown_020388B0 = .; /* 20388B0 */
|
||||
. += 0x4;
|
||||
|
||||
gUnknown_020388B4 = .; /* 20388B4 */
|
||||
. += 0x4;
|
||||
|
||||
. = ALIGN(4); src/field/pokenav.o(ewram_data);
|
||||
. = ALIGN(4); src/pokemon/mon_markings.o(ewram_data);
|
||||
. = ALIGN(4); src/field/mauville_man.o(ewram_data);
|
||||
. = ALIGN(4); src/field/menu_helpers.o(ewram_data);
|
||||
@@ -416,28 +356,7 @@ gUnknown_020388B4 = .; /* 20388B4 */
|
||||
. = ALIGN(4); src/rom6.o(ewram_data);
|
||||
. = ALIGN(4); src/field/pokeblock.o(ewram_data);
|
||||
. = ALIGN(4); src/field/field_specials.o(ewram_data);
|
||||
|
||||
/* pokedex_area_screen */
|
||||
|
||||
. = ALIGN(4);
|
||||
gUnknown_02039260 = .; /* 2039260 */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_02039262 = .; /* 2039262 */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_02039264 = .; /* 2039264 */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_02039266 = .; /* 2039266 */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_02039268 = .; /* 2039268 */
|
||||
. += 0x2;
|
||||
|
||||
gUnknown_0203926A = .; /* 203926A */
|
||||
. += 0x2;
|
||||
|
||||
. = ALIGN(4); src/field/pokedex_area_screen.o(ewram_data);
|
||||
. = ALIGN(4); src/battle/battle_message.o(ewram_data);
|
||||
. = ALIGN(4); src/field/choose_party.o(ewram_data);
|
||||
. = ALIGN(4); src/scene/cable_car.o(ewram_data);
|
||||
|
||||
Reference in New Issue
Block a user