From afd5f1f52f7a2b74e9850892aef118292a45df8e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 2 Oct 2019 21:26:01 -0400 Subject: itemfinder through sub_813F004 --- include/global.fieldmap.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index 3623737ea..cc9510997 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -120,26 +120,34 @@ struct CoordEvent u8 *script; }; +struct HiddenItemStruct +{ + u32 field_00:16; + u32 hiddenItemId:8; // flag offset to determine flag lookup + u32 field_03_0:7; + u32 field_03_7: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 hiddenItem; + + // secret base type + u32 secretBaseId; + +}; + struct BgEvent { u16 x, y; u8 unk4; u8 kind; // 0x2 padding for the union beginning. - 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. - u8 *script; - - // hidden item type probably - struct { - u8 filler6[0x2]; - u16 hiddenItemId; // flag offset to determine flag lookup - } hiddenItem; - - // secret base type - u32 secretBaseId; - - } bgUnion; + union BgUnion bgUnion; }; struct MapEvents -- cgit v1.2.3 From a56a90d998cfdce7ea2bcacb9958ef312b19792b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 3 Oct 2019 14:01:57 -0400 Subject: Resolve review comments --- include/global.fieldmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index cc9510997..f90c6fc66 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -122,10 +122,10 @@ struct CoordEvent struct HiddenItemStruct { - u32 field_00:16; + u32 quantity:16; u32 hiddenItemId:8; // flag offset to determine flag lookup u32 field_03_0:7; - u32 field_03_7:1; + u32 isUnderfoot:1; }; union BgUnion -- cgit v1.2.3 From 38d2b717173e9d6b24766fc3d6e46002db684cf5 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 3 Oct 2019 15:20:28 -0400 Subject: Normal hidden item script; hidden item attr enum --- include/global.fieldmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/global.fieldmap.h') diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index f90c6fc66..bf142d265 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -122,9 +122,9 @@ struct CoordEvent struct HiddenItemStruct { - u32 quantity:16; + u32 itemId:16; u32 hiddenItemId:8; // flag offset to determine flag lookup - u32 field_03_0:7; + u32 quantity:7; u32 isUnderfoot:1; }; -- cgit v1.2.3