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 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 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
d314612
Merge remote-tracking branch 'upstream/main' into document_pl_batt_obj
joshua-smith-12 Nov 18, 2024
41bbde7
fix palette line endings, fix merge issue, adjust NCER build with new…
joshua-smith-12 Nov 18, 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
  •  
  •  
  •  
26 changes: 13 additions & 13 deletions include/unk_0207C908.h → include/battle/battle_icon.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef POKEPLATINUM_UNK_0207C908_H
#define POKEPLATINUM_UNK_0207C908_H
#ifndef POKEPLATINUM_BATTLE_ICON_H
#define POKEPLATINUM_BATTLE_ICON_H

#include <nnsys.h>

Expand All @@ -10,26 +10,26 @@

#include "palette.h"

u32 sub_0207C908(int param0);
u32 sub_0207C920(void);
u32 BattleIcon_GetMoveTypeTiles(int param0);
u32 BattleIcon_GetMoveTypePaletteFileIndex(void);
u32 sub_0207C924(void);
u32 sub_0207C928(void);
u8 sub_0207C92C(int param0);
u32 sub_0207C944(void);
void sub_0207C948(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4);
void sub_0207C97C(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, u32 param3);
u8 BattleIcon_GetMoveTypePaletteIndex(int param0);
u32 BattleIcon_GetNARCIndex(void);
void BattleIcon_MakeTypeSpriteTiles(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4);
void BattleIcon_MakeTypeSpritePalette(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, u32 param3);
void sub_0207C9B0(PaletteData *param0, int param1, SpriteRenderer *param2, SpriteGfxHandler *param3, NNS_G2D_VRAM_TYPE param4, u32 param5);
void sub_0207C9EC(SpriteRenderer *param0, SpriteGfxHandler *param1, u32 param2, u32 param3);
void sub_0207CA34(SpriteGfxHandler *param0, u32 param1);
void sub_0207CA3C(SpriteGfxHandler *param0, u32 param1);
void sub_0207CA44(SpriteGfxHandler *param0, u32 param1, u32 param2);
CellActorData *sub_0207CA58(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, const SpriteTemplate *param3);
void sub_0207CA88(CellActorData *param0);
u32 sub_0207CA90(int param0);
u8 sub_0207CAA8(int param0);
u32 sub_0207CAC0(void);
void sub_0207CAC4(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4);
u32 BattleIcon_GetMoveClassTiles(int param0);
u8 BattleIcon_GetMoveClassPaletteIndex(int param0);
u32 BattleIcon_GetMoveClassPalettteFileIndex(void);
void BattleIcon_MakeMoveTypeSpriteTiles(SpriteRenderer *param0, SpriteGfxHandler *param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4);
void sub_0207CAF8(SpriteGfxHandler *param0, u32 param1);
void sub_0207CB00(CellActorData *param0);

#endif // POKEPLATINUM_UNK_0207C908_H
#endif // POKEPLATINUM_BATTLE_ICON_H
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/pl_batt_obj/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/pl_batt_obj
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('pl_batt_obj')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Can we name the internal folder something more meaningful? Maybe res/battle/graphics/objects? We generally try to avoid using the actual NARC names outside of where strictly necessary for matching (e.g., on NARC names)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed the directory, I considered renaming some of the other files (pl_batt_obj.ignore, pl_batt_obj.order) but these are more directly related to the final NARC name so I've left them as-is

51 changes: 51 additions & 0 deletions res/battle/graphic/pl_batt_obj/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
}
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
Loading