From f4f9329653611dcc6fff5568fe5fbf688e9c599e Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Wed, 2 Nov 2022 12:39:32 -0400 Subject: [PATCH 1/5] Fix build of jsonproc - Changing uint to unsigned int, as uint is not standard. --- tools/jsonproc/jsonproc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jsonproc/jsonproc.cpp b/tools/jsonproc/jsonproc.cpp index d58e23eb9..23056a5ff 100755 --- a/tools/jsonproc/jsonproc.cpp +++ b/tools/jsonproc/jsonproc.cpp @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) env.add_callback("cleanString", 1, [](Arguments& args) { string badChars = ".'{} \n\t-\u00e9"; string str = args.at(0)->get(); - for (uint i = 0; i < str.length(); i++) { + for (unsigned int i = 0; i < str.length(); i++) { if (badChars.find(str[i]) != std::string::npos) { str[i] = '_'; } From 8ff5ae7eb4dfb43004d659a2df0a622b0ea758eb Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Wed, 2 Nov 2022 12:42:26 -0400 Subject: [PATCH 2/5] Pinning the GF header to the front of modern - Pinning the GF Header, crt0, and main to the front of the ROM when building modern. - Moving the gflib before other source files, to make it closer to the non-modern linker script (and therefore smaller patches). --- ld_script.txt | 2 +- ld_script_modern.txt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ld_script.txt b/ld_script.txt index 904ca0fec..bd9d7c4a3 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -27,7 +27,7 @@ SECTIONS { *libc.a:locale.o(.data); *libc.a:mallocr.o(.data); . = 0x40000; -} + } . = 0x3000000; diff --git a/ld_script_modern.txt b/ld_script_modern.txt index a988fe0cd..549d040e1 100644 --- a/ld_script_modern.txt +++ b/ld_script_modern.txt @@ -49,8 +49,11 @@ SECTIONS { ALIGN(4) { src/rom_header.o(.text*); - src/*.o(.text*); + src/rom_header_gf.o(.text.*); + src/crt0.o(.text); + src/main.o(.text); gflib/*.o(.text*); + src/*.o(.text*); asm/*.o(.text*); } =0 From fd87c97ef833d5f94f7c9dfdf0e5b76c0316fb9a Mon Sep 17 00:00:00 2001 From: tustin2121 Date: Wed, 2 Nov 2022 12:42:58 -0400 Subject: [PATCH 3/5] Adding documentation about GFHeader --- src/rom_header_gf.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 2723e1200..472efe994 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -6,6 +6,15 @@ #include "item.h" #include "pokeball.h" +// The purpose of this struct is for outside applications to be +// able to access parts of the ROM or its save file, like a public API. +// In vanilla, it was used by Colosseum and XD to access pokemon graphics. +// +// If this struct is rearranged in any way, it defeats the purpose of +// having it at all. Applications like PKHex or streaming HUDs may find +// these values useful, so there's some potential benefit to keeping it. +// If there's a compilation problem below, just comment out the assignment +// instead of changing this struct. struct GFRomHeader { u32 version; From 237877e21bebd06bea8a42dff26c300324d9d4e5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 7 Nov 2022 00:00:23 -0300 Subject: [PATCH 4/5] =?UTF-8?q?Doc=20missing=20uses=20of=20ST=5FOAM=5FOBJ?= =?UTF-8?q?=5FX=20in=20Pok=C3=A9mon=20Storage=20System?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pokemon_storage_system.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 9a9e551a2..1eefc23f6 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -8825,12 +8825,12 @@ static void TakeItemFromMon(u8 cursorArea, u8 cursorPos) if (cursorArea == CURSOR_AREA_IN_BOX) { SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); - SetBoxMonIconObjMode(cursorPos, 1); + SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND); } else { SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); - SetPartyMonIconObjMode(cursorPos, 1); + SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND); } sStorage->movingItemId = sStorage->displayMonItemId; @@ -8891,12 +8891,12 @@ static void GiveItemToMon(u8 cursorArea, u8 cursorPos) if (cursorArea == CURSOR_AREA_IN_BOX) { SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId); - SetBoxMonIconObjMode(cursorPos, 0); + SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL); } else { SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId); - SetPartyMonIconObjMode(cursorPos, 0); + SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_NORMAL); } } @@ -8915,12 +8915,12 @@ static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos) if (cursorArea == CURSOR_AREA_IN_BOX) { SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId); - SetBoxMonIconObjMode(cursorPos, 1); + SetBoxMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND); } else { SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId); - SetPartyMonIconObjMode(cursorPos, 1); + SetPartyMonIconObjMode(cursorPos, ST_OAM_OBJ_BLEND); } } From a35986fd9c460f530111f4521655df7eef8e9ca0 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Tue, 8 Nov 2022 20:52:34 -0300 Subject: [PATCH 5/5] Fixed indentation in ScrCmd_faceplayer --- src/scrcmd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/scrcmd.c b/src/scrcmd.c index 3d67c69e5..01e1a8f09 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1152,10 +1152,7 @@ bool8 ScrCmd_resetobjectsubpriority(struct ScriptContext *ctx) bool8 ScrCmd_faceplayer(struct ScriptContext *ctx) { if (gObjectEvents[gSelectedObjectEvent].active) - { - ObjectEventFaceOppositeDirection(&gObjectEvents[gSelectedObjectEvent], - GetPlayerFacingDirection()); - } + ObjectEventFaceOppositeDirection(&gObjectEvents[gSelectedObjectEvent], GetPlayerFacingDirection()); return FALSE; }