Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decompile pl_batt_obj NARC, document related battle_icon.c #269

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cf9f42d
unpack pl_batt_obj and document some related code (not matching yet)
joshua-smith-12 Oct 10, 2024
67d9df6
fix build process for pl_batt_obj, resolve filesystem diffs
joshua-smith-12 Oct 14, 2024
d458f65
resolve ROM diff - need to keep narc at same filesystem level
joshua-smith-12 Oct 14, 2024
54f8f91
update some naming scheme for BattleObj
joshua-smith-12 Oct 14, 2024
fdf3cf9
rename a couple of icon rendering functions
joshua-smith-12 Oct 14, 2024
663e218
remove unnecessary copy step
joshua-smith-12 Oct 15, 2024
b218cbb
rename to battle_icon
joshua-smith-12 Oct 15, 2024
faae000
fix header guards in battle_icon.h
joshua-smith-12 Oct 15, 2024
ec50ea9
fix missed renaming after rebase onto main
joshua-smith-12 Oct 15, 2024
b8cb5db
update PNG files for balls, healthbars, battle platforms
joshua-smith-12 Oct 15, 2024
d597f8f
update names to align with emerald, add terrain names, rename some pa…
joshua-smith-12 Oct 16, 2024
c4f1a2d
apply clang-format to code changes
joshua-smith-12 Oct 16, 2024
ec4f1ff
rename all terrain img/pals, better describe arrays using pl_batt_obj…
joshua-smith-12 Oct 16, 2024
434a250
generate + use naix for pl_batt_obj, rename known NCER/NANR files
joshua-smith-12 Oct 16, 2024
fa6cd30
apply clang-format again after adding naix
joshua-smith-12 Oct 16, 2024
0986173
update const names and method names from review
joshua-smith-12 Oct 17, 2024
6611b55
convert all NCER files into json and adjust build system
joshua-smith-12 Oct 17, 2024
cc7c504
build all NANRs for pl_batt_obj using nitrogfx
joshua-smith-12 Oct 18, 2024
c43f294
rename back sprites for players, update levelup background with naix …
joshua-smith-12 Oct 18, 2024
f427b7a
fix some issues with anim/cell definitions, update a couple source lo…
joshua-smith-12 Oct 20, 2024
cb7b584
format on files using new naix fields
joshua-smith-12 Oct 20, 2024
15a5e94
use new generators to produce NARC contents
joshua-smith-12 Oct 28, 2024
0ef8173
convert to generators instead of Python for build, update NAIX fields…
joshua-smith-12 Oct 28, 2024
2113cb3
apply clang-format, format got messed up after rebase
joshua-smith-12 Oct 28, 2024
79c1b33
Merge remote-tracking branch 'upstream/main' into document_pl_batt_obj
joshua-smith-12 Nov 9, 2024
c7ab5db
fix build issue after merge from main
joshua-smith-12 Nov 9, 2024
c3353f6
apply changes from review
joshua-smith-12 Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 35 additions & 0 deletions include/battle/battle_icon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef POKEPLATINUM_BATTLE_ICON_H
#define POKEPLATINUM_BATTLE_ICON_H

#include <nnsys.h>

#include "struct_decls/cell_actor_data.h"
#include "struct_decls/struct_0200C6E4_decl.h"
#include "struct_decls/struct_0200C704_decl.h"
#include "struct_defs/sprite_template.h"

#include "palette.h"

u32 BattleIcon_GetMoveTypeTiles(int param0);
u32 BattleIcon_GetMoveTypePaletteFileIndex(void);
u32 BattleIcon_GetMoveTypeCellsFileIndex(void);
u32 BattleIcon_GetMoveTypeAnimFileIndex(void);
u8 BattleIcon_GetMoveTypePaletteIndex(int param0);
u32 BattleIcon_GetNARCIndex(void);
void BattleIcon_MakeTypeSpriteTiles(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NNS_G2D_VRAM_TYPE vramType, int typeIndex, u32 resourceID);
void BattleIcon_MakeTypeSpritePalette(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NNS_G2D_VRAM_TYPE vramType, u32 resourceID);
void BattleIcon_LoadTypeSpritePalette(PaletteData *palette, enum PaletteBufferID bufferID, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NNS_G2D_VRAM_TYPE vramType, u32 resourceID);
void BattleIcon_MakeTypeSpriteCellsAnim(SpriteRenderer *param0, SpriteGfxHandler *param1, u32 param2, u32 param3);
void BattleIcon_UnloadTypeSpriteTiles(SpriteGfxHandler *param0, u32 param1);
void BattleIcon_UnloadTypeSpritePalette(SpriteGfxHandler *param0, u32 param1);
void BattleIcon_UnloadTypeSpriteCellsAnim(SpriteGfxHandler *param0, u32 param1, u32 param2);
CellActorData *BattleIcon_CreateCellActorForTypeSprite(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, const SpriteTemplate *param3);
void BattleIcon_DeleteMoveTypeCellActorData(CellActorData *param0);
u32 BattleIcon_GetMoveClassTiles(int param0);
u8 BattleIcon_GetMoveClassPaletteIndex(int param0);
u32 BattleIcon_GetMoveClassNARCIndex(void);
void BattleIcon_MakeMoveClassSpriteTiles(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4);
void BattleIcon_UnloadMoveClassSpriteTiles(SpriteGfxHandler *param0, u32 param1);
void BattleIcon_DeleteMoveClassCellActorData(CellActorData *param0);

#endif // POKEPLATINUM_BATTLE_ICON_H
35 changes: 0 additions & 35 deletions include/unk_0207C908.h

This file was deleted.

2 changes: 1 addition & 1 deletion platinum.us/filesys.sha1
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ d672202157109fb1bb293070b5d35787b2b2b6d3 *res/prebuilt/battle/graphic/batt_bg.na
c9baf056c8646bc0bc826bbc98f5cbd439643f3d *res/prebuilt/battle/graphic/batt_obj.narc
036b81fe61c6347100c73b2c23d28da5abc7626c *res/prebuilt/battle/graphic/pl_b_plist_gra.narc
2fafdda86f7f740e2843c95382f08dfac35fa64f *res/prebuilt/battle/graphic/pl_batt_bg.narc
db5906303178da70f6b6c852990df560fb4dfeba *res/prebuilt/battle/graphic/pl_batt_obj.narc
db5906303178da70f6b6c852990df560fb4dfeba *res/battle/graphic/objects/pl_batt_obj.narc
955ce80b532be2184c62c36a6cb9d6b68c4669dd *res/prebuilt/battle/graphic/vs_demo_gra.narc
c7e601f3c145dd3c36c6f1deee1f63d526be3c37 *res/prebuilt/wazaeffect/we.arc
30bb77e76c27874bc8ff923b33492595f1a377e2 *res/prebuilt/wazaeffect/we_sub.narc
Expand Down
2 changes: 1 addition & 1 deletion platinum.us/main.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Static main
Object main.nef.p/src_unk_0207A6DC.c.o
Object main.nef.p/src_unk_0207AE68.c.o
Object main.nef.p/src_unk_0207C63C.c.o
Object main.nef.p/src_unk_0207C908.c.o
Object main.nef.p/src_battle_battle_icon.c.o
Object main.nef.p/src_unk_0207CB08.c.o
Object main.nef.p/src_item.c.o
Object main.nef.p/src_bag.c.o
Expand Down
8 changes: 7 additions & 1 deletion platinum.us/rom.rsf
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ RomSpec
File battle/graphic/batt_obj.narc
File battle/graphic/pl_b_plist_gra.narc
File battle/graphic/pl_batt_bg.narc
File battle/graphic/pl_batt_obj.narc

Root /battle/graphic
HostRoot res/battle/graphic/objects
File pl_batt_obj.narc

Root /
HostRoot res/prebuilt
File battle/graphic/vs_demo_gra.narc
File wazaeffect/we.arc
File wazaeffect/we_sub.narc
Expand Down
1 change: 1 addition & 0 deletions res/battle/graphic/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subdir('objects')
51 changes: 51 additions & 0 deletions res/battle/graphic/objects/anims/bait_throw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"labelEnabled": true,
"sequenceCount": 2,
"frameCount": 5,
"sequences": [{
"frameCount": 4,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 2,
"resultId": 0
}, {
"frameDelay": 2,
"resultId": 1
}, {
"frameDelay": 2,
"resultId": 2
}, {
"frameDelay": 2,
"resultId": 3
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 60,
"resultId": 0
}]
}],
"animationResults": [{
"resultType": 0,
"index": 0
}, {
"resultType": 0,
"index": 1
}, {
"resultType": 0,
"index": 2
}, {
"resultType": 0,
"index": 3
}],
"resultCount": 4,
"labels": ["CellAnime0", "CellAnime1"],
"labelCount": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"labelEnabled": true,
"sequenceCount": 4,
"frameCount": 4,
"sequences": [{
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 0
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 1
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 2
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 3
}]
}],
"animationResults": [{
"resultType": 0,
"index": 0
}, {
"resultType": 0,
"index": 1
}, {
"resultType": 0,
"index": 2
}, {
"resultType": 0,
"index": 3
}],
"resultCount": 4,
"labels": ["CellAnime0", "CellAnime1", "CellAnime2", "CellAnime3"],
"labelCount": 4
}
62 changes: 62 additions & 0 deletions res/battle/graphic/objects/anims/ball_status_indicator_player.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"labelEnabled": true,
"sequenceCount": 4,
"frameCount": 4,
"sequences": [{
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 0
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 1
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 2
}]
}, {
"frameCount": 1,
"loopStartFrame": 0,
"animationElement": 0,
"animationType": 1,
"playbackMode": 2,
"frameData": [{
"frameDelay": 4,
"resultId": 3
}]
}],
"animationResults": [{
"resultType": 0,
"index": 0
}, {
"resultType": 0,
"index": 1
}, {
"resultType": 0,
"index": 2
}, {
"resultType": 0,
"index": 3
}],
"resultCount": 4,
"labels": ["CellAnime0", "CellAnime1", "CellAnime2", "CellAnime3"],
"labelCount": 4
}
Loading