diff options
-rw-r--r-- | berry_fix/payload/include/global.fieldmap.h | 17 | ||||
-rw-r--r-- | include/global.fieldmap.h | 37 | ||||
-rw-r--r-- | tools/gbafix/gbafix.c | 8 |
3 files changed, 21 insertions, 41 deletions
diff --git a/berry_fix/payload/include/global.fieldmap.h b/berry_fix/payload/include/global.fieldmap.h index f68ca9125..5cc3e8b1b 100644 --- a/berry_fix/payload/include/global.fieldmap.h +++ b/berry_fix/payload/include/global.fieldmap.h @@ -79,23 +79,16 @@ struct CoordEvent struct BgEvent { - /*0x00*/u16 x; - /*0x02*/u16 y; - /*0x04*/u8 elevation; - /*0x05*/u8 kind; - /*0x08*/union { // carried over from diego's FR/LG work, seems to be the same struct - // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. + u16 x, y; + u8 elevation; + u8 kind; // The "kind" field determines how to access bgUnion union below. + union { u8 *script; - - // hidden item type struct { u16 item; - u16 hiddenItemId; // flag offset to determine flag lookup + u16 hiddenItemId; } hiddenItem; - - // secret base type u32 secretBaseId; - } bgUnion; }; diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index a266b8ce1..c481968cf 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -125,35 +125,22 @@ struct CoordEvent u8 *script; }; -struct HiddenItemStruct -{ - u32 itemId:16; - u32 hiddenItemId:8; // flag offset to determine flag lookup - u32 quantity:7; - u32 isUnderfoot:1; -}; - -union BgUnion -{ // carried over from diego's FR/LG work, seems to be the same struct - // in gen 3, "kind" (0x3 in BgEvent struct) determines the method to read the union. - u8 *script; - - // hidden item type probably - struct HiddenItemStruct hiddenItemStr; - u32 hiddenItem; - - // secret base type - u32 secretBaseId; - -}; - struct BgEvent { u16 x, y; u8 elevation; - u8 kind; - // 0x2 padding for the union beginning. - union BgUnion bgUnion; + u8 kind; // The "kind" field determines how to access bgUnion union below. + union { + u8 *script; + struct { + u32 itemId:16; + u32 hiddenItemId:8; // flag offset to determine flag lookup + u32 quantity:7; + u32 isUnderfoot:1; + } hiddenItemStr; + u32 hiddenItem; + u32 secretBaseId; + } bgUnion; }; struct MapEvents diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c index 598e43aa0..d62a9c661 100644 --- a/tools/gbafix/gbafix.c +++ b/tools/gbafix/gbafix.c @@ -28,14 +28,14 @@ // gbafix.c //--------------------------------------------------------------------------------- /* - Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome) + Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Sierraffinity) Validates header of GBA roms. History ------- v1.07 - added support for ELF input, (PikalaxALT) - v1.06 - added output silencing, (Diegoisawesome) - v1.05 - added debug offset argument, (Diegoisawesome) + v1.06 - added output silencing, (Sierraffinity) + v1.05 - added debug offset argument, (Sierraffinity) v1.04 - converted to plain C, (WinterMute) v1.03 - header.fixed, header.device_type v1.02 - redefined the options (rgbfix style), checksum=0 @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) // show syntax if (argc <= 1) { - printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n"); + printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Sierraffinity \n"); printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n"); printf("\n"); printf("parameters:\n"); |