unpack and rename a/2/6/0

This commit is contained in:
PikalaxALT 2024-08-09 14:53:44 -04:00
parent 178694e1bc
commit 32b8f01f2d
No known key found for this signature in database
GPG Key ID: 7774E96AA69E5B61
19 changed files with 100 additions and 11 deletions

2
files/.gitignore vendored
View File

@ -51,6 +51,7 @@ a/2/1/4
a/2/2/9
a/2/5/2
a/2/5/4
a/2/6/0
a/2/6/1
a/2/6/2
a/2/6/4
@ -74,4 +75,5 @@ demo/opening/gs_opening.narc
demo/legend.narc
data/photo_data.narc
graphic/camera_viewfinder.narc
application/guinness.narc
*.NCLR

Binary file not shown.

View File

@ -0,0 +1,21 @@
GUINNESS_DIR := files/application/guinness
GUINNESS_NARC := $(GUINNESS_DIR).narc
GUINNESS_FILES := \
guinness_00000000.NCLR \
guinness_00000001.NCLR \
guinness_00000002.NCGR.lz \
guinness_00000003.NCGR.lz \
guinness_00000004.NSCR.lz \
guinness_00000005.NSCR.lz \
guinness_00000006.NCLR \
guinness_00000007.NANR.lz \
guinness_00000008.NCER.lz \
guinness_00000009.NCGR.lz
$(GUINNESS_NARC): $(addprefix $(GUINNESS_DIR)/,$(GUINNESS_FILES))
$(KNARC) -p $@ -d $(GUINNESS_DIR) -i
FS_CLEAN_TARGETS += \
$(GUINNESS_NARC) \
$(addprefix $(GUINNESS_DIR)/,$(filter %.lz,$(GUINNESS_FILES)))

1
files/application/guinness/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.lz

View File

@ -0,0 +1,4 @@
*.NCGR
*.NSCR
*.NCER
*.NANR

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -451,6 +451,7 @@ $(eval $(call arc_strip_name,files/demo/opening/gs_opening.narc,files/a/2/6/2))
$(eval $(call arc_strip_name,files/application/voltorb_flip.narc,files/a/2/6/4))
$(eval $(call arc_strip_name,files/poketool/icongra/poke_icon/poke_icon.narc,files/a/0/2/0))
$(eval $(call arc_strip_name,files/data/photo_data.narc,files/a/2/5/4))
$(eval $(call arc_strip_name,files/application/guinness.narc,files/a/2/6/0))
$(eval $(call arc_strip_name,files/graphic/camera_viewfinder.narc,files/a/2/6/1))
$(DIFF_ARCS):
@ -515,6 +516,7 @@ include files/poketool/personal/personal.mk
include files/fielddata/graphic/preview_graphic/preview_graphic.mk
include files/data/photo_data.mk
include files/graphic/camera_viewfinder.mk
include files/application/guinness.mk
$(filter-out $(DIFF_ARCS) $(FS_RULE_OVERRIDES),$(NITROFS_FILES)): ;

View File

@ -267,7 +267,7 @@ typedef enum NarcId
NARC_a_2_5_7 = 259,
NARC_a_2_5_8 = 260,
NARC_a_2_5_9 = 261,
NARC_a_2_6_0 = 262,
NARC_application_guinness = 262,
NARC_graphic_camera_viewfinder = 263,
NARC_demo_opening_gs_opening = 264,
NARC_a_2_6_3 = 265,

58
scripts/resolve_nns_bins.sh Executable file
View File

@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$(uname -s)" = Darwin ]; then
SED=gsed
REALPATH=grealpath
else
SED=sed
REALPATH=realpath
fi
HOME_DIR="$("$REALPATH" -P "$(dirname "${BASH_SOURCE[0]}")")"
REPO_DIR="$(dirname "${HOME_DIR}")"
dir=
usage="usage: $(basename "$0") [opts]
-d <DIR> Directory to walk"
while getopts ":hd:" opt; do
case "$opt" in
h )
echo -e "$usage"
exit 0 ;;
d )
dir="$OPTARG" ;;
: )
echo -e "ERR: -$OPTARG needs an argument\n$usage" 1>&2
exit 1 ;;
\? )
echo -e "ERR: unrecognized argument\n$usage" 1>&2
exit 1 ;;
esac
done
if [ -z "$dir" -o ! -d "$dir" ]; then
echo -e "missing required argument: -d <DIR>\n$usage" 1>&2
exit 1
fi
for fl in "$dir"/*.bin; do
lz=
if [ $(head -c1 "$fl" | hexdump -ve '1/1 "%02x"') = '10' ]; then
mv "$fl" "$fl.lz"
"$REPO_DIR/tools/nitrogfx/nitrogfx" "$fl.lz" "$fl"
lz=.lz
fi
ext="$(head -c4 "$fl")"
if [[ "$ext" ~ ^B[A-Z][A-Z]]0$ ]]; then
ext="NS${ext//0/}"
else if [[ "$(ext)" ~ ^R[A-Z][A-Z]N$ ]]; then
ext="$(echo "$ext" | rev)"
else
echo "$fl$lz"
continue
fi
echo "${fl%.*}$ext$lz"
done

View File

@ -25,6 +25,7 @@
#include "player_data.h"
#include "msgdata/msg/msg_0421.h"
#include "constants/ranking.h"
#include "application/guinness.naix"
#define min(a, b) ((a) <= (b) ? (a) : (b))
@ -628,14 +629,14 @@ static void VBlankCB_ViewRankings(void *cbData) {
}
static void ViewRankings_LoadBgGraphics(BgConfig *bgConfig, HeapID heapId) {
GfGfxLoader_GXLoadPal(NARC_a_2_6_0, 1, GF_PAL_LOCATION_MAIN_BG, (enum GFPalSlotOffset)0, 0x40, heapId);
GfGfxLoader_LoadCharData(NARC_a_2_6_0, 3, bgConfig, GF_BG_LYR_MAIN_3, 0, 0x1000, TRUE, heapId);
GfGfxLoader_LoadScrnData(NARC_a_2_6_0, 5, bgConfig, GF_BG_LYR_MAIN_3, 0, 0x600, TRUE, heapId);
GfGfxLoader_GXLoadPal(NARC_application_guinness, NARC_guinness_guinness_00000001_NCLR, GF_PAL_LOCATION_MAIN_BG, (enum GFPalSlotOffset)0, 0x40, heapId);
GfGfxLoader_LoadCharData(NARC_application_guinness, NARC_guinness_guinness_00000003_NCGR_lz, bgConfig, GF_BG_LYR_MAIN_3, 0, 0x1000, TRUE, heapId);
GfGfxLoader_LoadScrnData(NARC_application_guinness, NARC_guinness_guinness_00000005_NSCR_lz, bgConfig, GF_BG_LYR_MAIN_3, 0, 0x600, TRUE, heapId);
BgCommitTilemapBufferToVram(bgConfig, GF_BG_LYR_MAIN_3);
GfGfxLoader_GXLoadPal(NARC_a_2_6_0, 0, GF_PAL_LOCATION_SUB_BG, (enum GFPalSlotOffset)0, 0x20, heapId);
GfGfxLoader_LoadCharData(NARC_a_2_6_0, 2, bgConfig, GF_BG_LYR_SUB_0, 0, 0x400, TRUE, heapId);
GfGfxLoader_LoadScrnData(NARC_a_2_6_0, 4, bgConfig, GF_BG_LYR_SUB_0, 0, 0x600, TRUE, heapId);
GfGfxLoader_GXLoadPal(NARC_application_guinness, NARC_guinness_guinness_00000000_NCLR, GF_PAL_LOCATION_SUB_BG, (enum GFPalSlotOffset)0, 0x20, heapId);
GfGfxLoader_LoadCharData(NARC_application_guinness, NARC_guinness_guinness_00000002_NCGR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0x400, TRUE, heapId);
GfGfxLoader_LoadScrnData(NARC_application_guinness, NARC_guinness_guinness_00000004_NSCR_lz, bgConfig, GF_BG_LYR_SUB_0, 0, 0x600, TRUE, heapId);
BgCommitTilemapBufferToVram(bgConfig, GF_BG_LYR_SUB_0);
}
@ -644,10 +645,10 @@ static void ViewRankings_LoadSpriteGraphics(ViewRankingsAppData *appData, HeapID
for (int i = 0; i < 6; ++i) {
appData->gf2dGfxResManagers[i] = Create2DGfxResObjMan(1, (GfGfxResType)i, heapId);
}
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_CHAR] = AddCharResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_CHAR], NARC_a_2_6_0, 9, TRUE, 0, NNS_G2D_VRAM_TYPE_2DMAIN, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_PLTT] = AddPlttResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_PLTT], NARC_a_2_6_0, 6, FALSE, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 4, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_CELL] = AddCellOrAnimResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_CELL], NARC_a_2_6_0, 8, TRUE, 0, GF_GFX_RES_TYPE_CELL, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_ANIM] = AddCellOrAnimResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_ANIM], NARC_a_2_6_0, 7, TRUE, 0, GF_GFX_RES_TYPE_ANIM, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_CHAR] = AddCharResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_CHAR], NARC_application_guinness, NARC_guinness_guinness_00000009_NCGR_lz, TRUE, 0, NNS_G2D_VRAM_TYPE_2DMAIN, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_PLTT] = AddPlttResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_PLTT], NARC_application_guinness, NARC_guinness_guinness_00000006_NCLR, FALSE, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 4, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_CELL] = AddCellOrAnimResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_CELL], NARC_application_guinness, NARC_guinness_guinness_00000008_NCER_lz, TRUE, 0, GF_GFX_RES_TYPE_CELL, heapId);
appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_ANIM] = AddCellOrAnimResObjFromNarc(appData->gf2dGfxResManagers[GF_GFX_RES_TYPE_ANIM], NARC_application_guinness, NARC_guinness_guinness_00000007_NANR_lz, TRUE, 0, GF_GFX_RES_TYPE_ANIM, heapId);
sub_0200ADA4(appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_CHAR]);
sub_0200AF94(appData->gf2dGfxResObjects[GF_GFX_RES_TYPE_PLTT]);
}