From 014f3668eb47b1576bdc182b1db00417f9938cf1 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 00:51:43 +0200 Subject: added untested support for world change nodes --- include/game.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index e31e675..41b925f 100755 --- a/include/game.h +++ b/include/game.h @@ -26,6 +26,7 @@ extern "C" { int wcslen(const wchar_t *str); int strlen(const char *str); char *strcpy(char *dest, const char *src); +char *strncpy(char *dest, const char *src, int num); int strncmp(const char *str1, const char *str2, int num); float atan(float x); @@ -200,7 +201,13 @@ public: struct { // ALL Newer additions should go here // This array has been verified as safe to replace - u8 currentNewerWorld; // 0x6FC + char newerWorldName[36]; // 0x6FC + GXColor fsTextColours[2]; // 0x720 + GXColor fsHintColours[2]; // 0x728 + GXColor hudTextColours[2]; // 0x730 + s16 hudHintH, hudHintS, hudHintL; // 0x738 + u8 currentMapMusic; // 0x73E + u8 _padding; // 0x73F }; }; u8 toad_location[10]; // 0x742 -- cgit v1.2.3 From 411c5a8e210b5cbca330a5438e2406dbe1ffecab Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 04:40:34 +0200 Subject: made world changes work, and HUD colourising and other fun things --- include/game.h | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index 41b925f..32b3a1d 100755 --- a/include/game.h +++ b/include/game.h @@ -560,7 +560,13 @@ namespace ut { LinkListNode initialNode; }; - class Color : public GXColor { }; + class Color : public GXColor { + public: + GXColor& operator=(const GXColor &other) { + *((u32*)this) = *((u32*)&other); + return *this; + } + }; class Rect { public: @@ -651,9 +657,35 @@ namespace lyt { }; + class TexMap { + public: + void *image, *palette; + u16 width, height; + f32 minLOD, magLOD; + u16 lodBias, palEntryNum; + struct + { + u32 textureFormat: 4; + u32 mipmap: 1; + u32 wrapS: 2; + u32 wrapT: 2; + u32 minFilter: 3; + u32 magFilter: 1; + u32 biasClampEnable: 1; + u32 edgeLODEnable: 1; + u32 anisotropy: 2; + u32 paletteFormat: 2; + } mBits; + }; + class Material { public: - // ... + virtual ~Material(); + + // cheating a bit here + u8 _[0x3C]; + // this is actually a pointer to more stuff, not just texmaps + TexMap *texMaps; }; class Pane { -- cgit v1.2.3 From 87cb3ef8451f6e6dc0f642d22f5335c1c4f4b064 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 06:08:02 +0200 Subject: a tiny bit of savefile RE, and default world stuff in the savefile --- include/game.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index 32b3a1d..071d93e 100755 --- a/include/game.h +++ b/include/game.h @@ -153,6 +153,31 @@ bool IsWideScreen(); #define COND_SGNORMAL 0x80 #define COND_SGSECRET 0x100 + +// All of these are set by "SetWorldCompleteionBitfield" (I didn't name it) +// at 801028D0. It's called by ScStage so it doesn't depend on Nintendo maps. + +#define SAVE_BIT_EXISTS_MAYBE 1 + +// Controls whether you can QUICK SAVE or not. +// Set if 8-Castle is complete. +#define SAVE_BIT_GAME_COMPLETE 2 + +// Set when all exits are complete. +// This is defined by "ReturnWhetherConditionMaskIsValid" / "SetSomeConditionShit" +// TODO: Need to RE and fix this for Newer... +#define SAVE_BIT_ALL_EXITS 4 + +// Set when all star coins in worlds 1-8 are obtained. +// Valid levels are chosen by the condition crap as above. +#define SAVE_BIT_ALL_STAR_COINS 8 + +#define SAVE_BIT_ALL_STAR_COINS_W9 0x10 + +// Set when, well... EVERYTHING is done. +#define SAVE_BIT_EVERYTHING_TRULY_DONE 0x20 + + class SaveFirstBlock { public: char titleID[4]; // 0x00 -- cgit v1.2.3 From 35dd657c71814377774ffbdc16158eda05a22ba9 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 28 Sep 2012 00:33:10 +0200 Subject: untested automatically moving elements and world numbers --- include/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index 071d93e..fd0dd3c 100755 --- a/include/game.h +++ b/include/game.h @@ -24,6 +24,7 @@ inline T clamp(T value, T one, T two) { return (value < one) ? one : ((value > t extern "C" { int wcslen(const wchar_t *str); +wchar_t *wcscpy(wchar_t *dest, const wchar_t *src); int strlen(const char *str); char *strcpy(char *dest, const char *src); char *strncpy(char *dest, const char *src, int num); -- cgit v1.2.3 From 324f2f2b3b8dff9c6b9c297390c8307d181dac87 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 28 Sep 2012 02:14:22 +0200 Subject: various fixes to stuff on map HUD --- include/game.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index fd0dd3c..e383cf7 100755 --- a/include/game.h +++ b/include/game.h @@ -3253,6 +3253,7 @@ namespace mHeap { }; void WriteNumberToTextBox(int *number, const int *fieldLength, nw4r::lyt::TextBox *textBox, bool unk); // 800B3B60 +void WriteNumberToTextBox(int *number, nw4r::lyt::TextBox *textBox, bool unk); // 800B3BE0 namespace EGG { class MsgRes { -- cgit v1.2.3 From 26f5315e65c74c269b6eb1a190cb54fcf19d16a7 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 28 Sep 2012 05:24:15 +0200 Subject: added level flags to levelinfo --- include/game.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/game.h') diff --git a/include/game.h b/include/game.h index e383cf7..ef6aba4 100755 --- a/include/game.h +++ b/include/game.h @@ -140,6 +140,17 @@ inline void *GetGameMgr() { bool QueryPlayerAvailability(int id); void DoStartLevel(void *gameMgr, StartLevelInfo *sl); + + +// Level Conditions +// 1 : Has Toad Block +// 2 : Is Regular Level (has star coins, etc) +// 0x10 : Has Normal Exit +// 0x20 : Has Secret Exit +// 0x40 : Warp Cannon +// 0x80 : 1up/Green Mushroom House +// 0x100 : Red Mushroom House +// 0x200 : Star/Yellow Mushroom House void SetSomeConditionShit(int world, int level, unsigned int bits); bool IsWideScreen(); -- cgit v1.2.3