diff options
-rw-r--r-- | data/data2.s | 4 | ||||
-rw-r--r-- | include/fieldmap.h | 32 | ||||
-rw-r--r-- | include/global.h | 5 | ||||
-rw-r--r-- | include/script.h | 13 | ||||
-rw-r--r-- | include/trig.h | 9 | ||||
-rw-r--r-- | src/script.c | 2 | ||||
-rw-r--r-- | src/trig.c | 1 |
7 files changed, 61 insertions, 5 deletions
diff --git a/data/data2.s b/data/data2.s index 66e0a47d2..2c131952a 100644 --- a/data/data2.s +++ b/data/data2.s @@ -10924,9 +10924,11 @@ gUnknown_0839ACD8:: @ 839ACD8 gUnknown_0839ACDC:: @ 839ACDC .incbin "baserom.gba", 0x0039acdc, 0xc + .align 2 gUnknown_0839ACE8:: @ 839ACE8 - .incbin "baserom.gba", 0x0039ace8, 0x4 + .byte 4 + .align 2 gUnknown_0839ACEC:: @ 839ACEC .incbin "baserom.gba", 0x0039acec, 0xc diff --git a/include/fieldmap.h b/include/fieldmap.h index 6a0074153..8154bd387 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -1,6 +1,16 @@ #ifndef GUARD_FIELDMAP_H #define GUARD_FIELDMAP_H +enum +{ + CONNECTION_DOWN = 1, + CONNECTION_UP, + CONNECTION_LEFT, + CONNECTION_RIGHT, + CONNECTION_DIVE, + CONNECTION_EMERGE +}; + typedef void (*TilesetCB)(void); struct Tileset @@ -58,15 +68,33 @@ struct MapEvents void *bgEvents; }; +struct MapConnection +{ + u8 direction; + u32 offset; + s8 mapGroup; + s8 mapNum; +}; + +struct MapConnections +{ + s32 count; + struct MapConnection *connections; +}; + struct MapHeader { struct MapData *mapData; struct MapEvents *events; u8 *mapScripts; - void *connections; + struct MapConnections *connections; u16 music; u16 mapDataId; - u8 filler_14[0x8]; + u8 name; + u8 cave; + u8 weather; + u8 light; + u8 filler_18[0x4]; }; struct MapObject diff --git a/include/global.h b/include/global.h index e90678f0b..d673b0efd 100644 --- a/include/global.h +++ b/include/global.h @@ -130,7 +130,10 @@ struct SaveBlock1 struct WarpData warp2; struct WarpData warp3; struct WarpData warp4; - u8 filler_2C[0x6]; + u16 battleMusic; + u8 weather; + u8 filler_2F; + u8 flashUsed; u16 mapDataId; u8 filler_34[0x45C]; u32 money; diff --git a/include/script.h b/include/script.h index 96e13d072..7a7b2de72 100644 --- a/include/script.h +++ b/include/script.h @@ -39,5 +39,18 @@ void ScriptContext1_SetupScript(u8 *ptr); void ScriptContext1_Stop(void); void EnableBothScriptContexts(); void ScriptContext2_RunNewScript(u8 *ptr); +u8 *mapheader_get_tagged_pointer(u8 tag); +void mapheader_run_script_by_tag(u8 tag); +u8 *mapheader_get_first_match_from_tagged_ptr_list(u8 tag); +void mapheader_run_script_with_tag_x1(void); +void mapheader_run_script_with_tag_x3(void); +void mapheader_run_script_with_tag_x5(void); +void mapheader_run_script_with_tag_x6(void); +bool8 mapheader_run_first_tag2_script_list_match(void); +void mapheader_run_first_tag4_script_list_match(void); +u32 CalculateRamScriptChecksum(void); +void ClearRamScript(void); +bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId); +u8 *GetRamScript(u8 objectId, u8 *script); #endif // GUARD_SCRIPT_H diff --git a/include/trig.h b/include/trig.h new file mode 100644 index 000000000..5a948e1ef --- /dev/null +++ b/include/trig.h @@ -0,0 +1,9 @@ +#ifndef GUARD_TRIG_H +#define GUARD_TRIG_H + +s16 Sin(s16 index, s16 amplitude); +s16 Cos(s16 index, s16 amplitude); +s16 Sin2(u16 angle); +s16 Cos2(u16 angle); + +#endif // GUARD_TRIG_H diff --git a/src/script.c b/src/script.c index df2763a36..fdce4f7d2 100644 --- a/src/script.c +++ b/src/script.c @@ -312,7 +312,7 @@ bool8 mapheader_run_first_tag2_script_list_match(void) return 1; } -void mapheader_run_first_tag4_script_list_match() +void mapheader_run_first_tag4_script_list_match(void) { u8 *ptr = mapheader_get_first_match_from_tagged_ptr_list(4); if (ptr) diff --git a/src/trig.c b/src/trig.c index cd9f39cac..8b75b3838 100644 --- a/src/trig.c +++ b/src/trig.c @@ -1,4 +1,5 @@ #include "global.h" +#include "trig.h" extern s16 gSineTable[]; extern s16 gSineDegreeTable[]; |