mirror of
https://github.com/pret/pokeheartgold.git
synced 2024-11-23 05:09:45 +00:00
documentation, 4; improve make clean
This commit is contained in:
parent
32b8f01f2d
commit
c3c6278b46
2
Makefile
2
Makefile
@ -46,7 +46,7 @@ tidy:
|
||||
clean: tidy clean-filesystem clean-tools
|
||||
@$(MAKE) -C lib/syscall clean
|
||||
@$(MAKE) -C sub clean
|
||||
$(RM) $(ICON_PNG:%.png=%.nbfp) $(ICON_PNG:%.png=%.nbfc)
|
||||
$(RM) $(foreach bn,$(SUPPORTED_ROMS),$(bn)/icon.nbf[pc])
|
||||
|
||||
SBIN_LZ := $(SBIN)_LZ
|
||||
.PHONY: main_lz
|
||||
|
@ -7,4 +7,6 @@ $(HEADBUTT_NARC): %.$(buildname).narc: %.json %.json.txt
|
||||
$(O2NARC) $*.o $@ -n
|
||||
@$(RM) -f $*.s $*.o
|
||||
|
||||
FS_CLEAN_TARGETS += $(HEADBUTT_DIR).d
|
||||
FS_CLEAN_TARGETS += \
|
||||
$(HEADBUTT_DIR).d \
|
||||
$(foreach bn,$(SUPPORTED_ROMS),$(HEADBUTT_DIR).$(bn).na{rc,ix})
|
||||
|
@ -15,4 +15,9 @@ VERSION101_SOPC_8BPP_NCGR_FILES += $(PREVIEW_GRAPHIC_NCGR)
|
||||
$(PREVIEW_GRAPHIC_NARC): $(PREVIEW_GRAPHIC_NCGR_LZ) $(PREVIEW_GRAPHIC_NSCR_LZ) $(PREVIEW_GRAPHIC_NCLR)
|
||||
$(KNARC) -p $(PREVIEW_GRAPHIC_NARC) -d $(PREVIEW_GRAPHIC_DIR) -i
|
||||
|
||||
FS_CLEAN_TARGETS += $(PREVIEW_GRAPHIC_NCGR_LZ) $(PREVIEW_GRAPHIC_NSCR_LZ) $(PREVIEW_GRAPHIC_NCLR) $(PREVIEW_GRAPHIC_NARC)
|
||||
FS_CLEAN_TARGETS += \
|
||||
$(PREVIEW_GRAPHIC_NCGR_LZ) \
|
||||
$(PREVIEW_GRAPHIC_NSCR_LZ) \
|
||||
$(PREVIEW_GRAPHIC_NCGR) \
|
||||
$(PREVIEW_GRAPHIC_NCLR) \
|
||||
$(PREVIEW_GRAPHIC_NARC)
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define GAME_STAT_FISHING_LANDED_MON 11
|
||||
#define GAME_STAT_HATCHED_EGG 12
|
||||
#define GAME_STAT_UNK14 14
|
||||
#define GAME_STAT_UNK16 16
|
||||
#define GAME_STAT_BATTLE_TOWER_BATTLE_COUNT 16
|
||||
#define GAME_STAT_UNK17 17
|
||||
#define GAME_STAT_UNK20 20
|
||||
#define GAME_STAT_UNK21 21 //link battles?
|
||||
|
@ -36,6 +36,7 @@ typedef enum ViewRankingsWindowId {
|
||||
VIEW_RANKINGS_APP_WINDOW_RETURN,
|
||||
VIEW_RANKINGS_APP_WINDOW_DELETE_RECORD,
|
||||
VIEW_RANKINGS_APP_WINDOW_SELECT_RECORD_TO_DELETE,
|
||||
VIEW_RANKINGS_APP_WINDOW_MAX,
|
||||
} ViewRankingsWindowId;
|
||||
|
||||
typedef enum ViewRankingsSpriteId {
|
||||
@ -44,8 +45,20 @@ typedef enum ViewRankingsSpriteId {
|
||||
VIEW_RANKINGS_APP_SPRITE_LEFT_ARROW,
|
||||
VIEW_RANKINGS_APP_SPRITE_RETURN,
|
||||
VIEW_RANKINGS_APP_SPRITE_DELETE_RECORD,
|
||||
VIEW_RANKINGS_APP_SPRITE_MAX,
|
||||
} ViewRankingsSpriteId;
|
||||
|
||||
typedef enum ViewRankingsMiscStringId {
|
||||
VIEW_RANKINGS_MISC_STRING_0,
|
||||
VIEW_RANKINGS_MISC_STRING_1,
|
||||
VIEW_RANKINGS_MISC_STRING_2,
|
||||
VIEW_RANKINGS_MISC_STRING_3,
|
||||
VIEW_RANKINGS_MISC_STRING_4,
|
||||
VIEW_RANKINGS_MISC_STRING_5,
|
||||
VIEW_RANKINGS_MISC_STRING_6,
|
||||
VIEW_RANKINGS_MISC_STRING_MAX,
|
||||
} ViewRankingsMiscStringId;
|
||||
|
||||
typedef enum ViewRankingsMainState {
|
||||
VIEW_RANKINGS_APP_MAIN_STATE_FADE_IN,
|
||||
VIEW_RANKINGS_APP_MAIN_STATE_WAIT_FADE_IN,
|
||||
@ -93,27 +106,27 @@ typedef struct ViewRankingsAppPage {
|
||||
|
||||
typedef struct ViewRankingsAppdata {
|
||||
BgConfig *bgConfig;
|
||||
Window windows[6];
|
||||
Window windows[VIEW_RANKINGS_APP_WINDOW_MAX];
|
||||
MsgData *msgData;
|
||||
MessageFormat *msgFormat;
|
||||
String *formatedStrBuf;
|
||||
String *playerNameString;
|
||||
String *rankingString;
|
||||
String *miscStrings[7];
|
||||
String *miscStrings[VIEW_RANKINGS_MISC_STRING_MAX];
|
||||
YesNoPrompt *yesNoPrompt;
|
||||
SpriteList *spriteList;
|
||||
GF_G2dRenderer g2dRenderer;
|
||||
GF_2DGfxResMan *gf2dGfxResManagers[6];
|
||||
GF_2DGfxResObj *gf2dGfxResObjects[6];
|
||||
GF_2DGfxResMan *gf2dGfxResManagers[GF_GFX_RES_TYPE_MAX];
|
||||
GF_2DGfxResObj *gf2dGfxResObjects[GF_GFX_RES_TYPE_MAX];
|
||||
SpriteResourcesHeader spriteResourcesHeader;
|
||||
Sprite *sprites[5];
|
||||
Sprite *sprites[VIEW_RANKINGS_APP_SPRITE_MAX];
|
||||
TouchscreenHitbox *touchscreenHitboxes;
|
||||
u8 mainState;
|
||||
u8 isDeleteMode;
|
||||
s8 cursorPos;
|
||||
u8 state;
|
||||
SaveRankings *saveRankings;
|
||||
ViewRankingsPage *pages[7];
|
||||
ViewRankingsPage *pages[RANKINGS_PER_STAT + 1];
|
||||
ViewRankingsAppPage *records;
|
||||
ViewRankingsAppPageEntry *recordToDelete;
|
||||
u8 page;
|
||||
@ -122,7 +135,7 @@ typedef struct ViewRankingsAppdata {
|
||||
u8 pageOffset;
|
||||
u8 recordIdx;
|
||||
u8 numRecords;
|
||||
u8 recordEntryIdxs[6];
|
||||
u8 recordEntryIdxs[RANKINGS_PER_STAT];
|
||||
u8 frame;
|
||||
} ViewRankingsAppData;
|
||||
|
||||
@ -642,7 +655,7 @@ static void ViewRankings_LoadBgGraphics(BgConfig *bgConfig, HeapID heapId) {
|
||||
|
||||
static void ViewRankings_LoadSpriteGraphics(ViewRankingsAppData *appData, HeapID heapId) {
|
||||
appData->spriteList = G2dRenderer_Init(5, &appData->g2dRenderer, heapId);
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int i = 0; i < GF_GFX_RES_TYPE_MAX; ++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_application_guinness, NARC_guinness_guinness_00000009_NCGR_lz, TRUE, 0, NNS_G2D_VRAM_TYPE_2DMAIN, heapId);
|
||||
@ -1009,13 +1022,13 @@ static void ViewRankings_CreateStrings(ViewRankingsAppData *appData) {
|
||||
appData->formatedStrBuf = String_New(76, HEAP_ID_9E);
|
||||
appData->playerNameString = NewString_ReadMsgData(appData->msgData, msg_0421_00043);
|
||||
appData->rankingString = NewString_ReadMsgData(appData->msgData, msg_0421_00042);
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
for (int i = 0; i < VIEW_RANKINGS_MISC_STRING_MAX; ++i) {
|
||||
appData->miscStrings[i] = NewString_ReadMsgData(appData->msgData, msg_0421_00044 + i);
|
||||
}
|
||||
}
|
||||
|
||||
static void ViewRankings_DeleteStrings(ViewRankingsAppData *appData) {
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
for (int i = 0; i < VIEW_RANKINGS_MISC_STRING_MAX; ++i) {
|
||||
String_Delete(appData->miscStrings[i]);
|
||||
}
|
||||
String_Delete(appData->playerNameString);
|
||||
|
@ -135,7 +135,7 @@ static u32 *Save_RankingSys_GetPlayerStats(SaveData *saveData, HeapID heapId) {
|
||||
for (i = 0; i < RANKINGS_COUNT; ++i) {
|
||||
switch (i) {
|
||||
case RANKINGS_RECORD_BATTLE_TOWER_AVG_WIN_STREAK: {
|
||||
val = GameStats_GetCapped(gameStats, GAME_STAT_UNK16);
|
||||
val = GameStats_GetCapped(gameStats, GAME_STAT_BATTLE_TOWER_BATTLE_COUNT);
|
||||
if (val != 0) {
|
||||
val = GameStats_GetCapped(gameStats, GAME_STAT_BATTLE_TOWER_WIN_COUNT) / val;
|
||||
}
|
||||
@ -152,13 +152,13 @@ static u32 *Save_RankingSys_GetPlayerStats(SaveData *saveData, HeapID heapId) {
|
||||
val = GameStats_GetCapped(gameStats, GAME_STAT_LOCAL_CONTEST_ENTRIES);
|
||||
val += GameStats_GetCapped(gameStats, GAME_STAT_COMM_CONTEST_ENTRIES);
|
||||
if (val != 0) {
|
||||
val = ret[10] * 100 / val;
|
||||
val = ret[RANKINGS_RECORD_CONTEST_WIN] * 100 / val;
|
||||
}
|
||||
ret[i] = val;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (i >= 0 && i <= 4) {
|
||||
if (i >= RANKINGS_RECORD_BATTLE_TOWER_SINGLE_WINS && i <= RANKINGS_RECORD_BATTLE_TOWER_WIFI_WINS) {
|
||||
ret[i] = FrontierSave_GetStat(frontierSave, sStatIDs[i], 0xFF);
|
||||
} else {
|
||||
ret[i] = GameStats_GetCapped(gameStats, sStatIDs[i]);
|
||||
|
@ -451,7 +451,7 @@ void sub_0204AD04(UnkStruct_Fsys_A0 *a0, SaveData *saveData) {
|
||||
GameStats_Add(gameStats, GAME_STAT_BATTLE_TOWER_WIN_COUNT, a0->curWinStreak);
|
||||
sub_0202D57C(a0->unk74, a0->unk0f, 2);
|
||||
if (a0->unk0f != 6) {
|
||||
GameStats_Add(Save_GameStats_Get(saveData), GAME_STAT_UNK16, 1);
|
||||
GameStats_Add(Save_GameStats_Get(saveData), GAME_STAT_BATTLE_TOWER_BATTLE_COUNT, 1);
|
||||
}
|
||||
sub_0204B318(a0);
|
||||
unk++;
|
||||
@ -484,7 +484,7 @@ void sub_0204AE20(UnkStruct_Fsys_A0 *a0, SaveData *saveData) {
|
||||
GameStats_Add(gameStats, GAME_STAT_BATTLE_TOWER_WIN_COUNT, 7);
|
||||
sub_0202D57C(a0->unk74, a0->unk0f, 3);
|
||||
if (a0->unk0f != 6) {
|
||||
GameStats_Add(gameStats, GAME_STAT_UNK16, 1);
|
||||
GameStats_Add(gameStats, GAME_STAT_BATTLE_TOWER_BATTLE_COUNT, 1);
|
||||
}
|
||||
GameStats_AddScore(gameStats, SCORE_INC_TYPE_14);
|
||||
sub_0204B318(a0);
|
||||
|
Loading…
Reference in New Issue
Block a user