Skip to content

Commit 906f059

Browse files
authored
Merge pull request #28 from SeekyCt/dev
v4
2 parents bd03f51 + 642167b commit 906f059

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1134
-166
lines changed

MANUAL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ A full list of map names can be found [here](https://docs.google.com/document/d/
1616

1717
By default a Dimentio teleport animation will play when you do this (thanks to JohnP55 for the idea and documentation of relevant functions), but you can turn that off by pressing `-` in the menu if you'd like.
1818

19+
## Pit Warping
20+
The `Warp To Pit Floor` option in the menu allows you to warp to any floor of either Pit of 100 Trials.
21+
22+
In the left column you can choose which pit you'd like to warp to, and in the right column you can choose the floor of that pit. These can be scrolled through using the D-Pad.
23+
24+
Once you've chosen the floor and pit you'd like to warp to, press `2`.
25+
26+
By default a Dimentio teleport animation will play when you do this (thanks to JohnP55 for the idea and documentation of relevant functions), but you can turn that off by pressing `-` in the menu if you'd like.
27+
1928
## HUD Displays
2029
The `Edit HUD Display Options` option in the menu allows you to enable and disable various displays on the screen. The list can be navigated with the D-Pad and `2` can be pressed to switch between Enabled and Disabled.
2130

@@ -53,6 +62,9 @@ The `Edit Stats` option in the menu allows you to change the values of your Leve
5362
## Saved Settings
5463
The `Manage Saved Settings` option in the menu allows you to save your settings for the mod to your Wii's NAND (to the file `pcset.bin` in the game's save folder) and they'll automatically load next time you boot the mod. You can also load your saved settings, load the default settings or delete them from your NAND.
5564

65+
## Game Saving and Reloading
66+
The `Game Save Options` option in the menu allows you to save the game anywhere (it's recommended to make a backup of your save file before using this feature, if you do have any issues with it please report them either as an issue in the Github repo or by contacting me on Discord) and to reload the current save file.
67+
5668
## Return to Title Screen
5769
The `Return to Title Screen` option allows you to return to the main menu without needing to game over or reboot.
5870

include/gamesavemenu.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
GameSaveMenu
3+
Controls for saving & loading the game save file
4+
*/
5+
6+
#pragma once
7+
8+
#include "mod_ui_base/menuwindow.h"
9+
10+
namespace mod {
11+
12+
class GameSaveMenu : public MenuWindow
13+
{
14+
private:
15+
MenuButton * mButtons[2];
16+
17+
virtual void close() override;
18+
void initMainScreen();
19+
void initConfirmScreen();
20+
void exitScreen();
21+
static bool openMainScreen(MenuButton * button, void * param);
22+
static bool openConfirmScreen(MenuButton * button, void * param);
23+
24+
public:
25+
GameSaveMenu();
26+
27+
static void pitSavePatch();
28+
};
29+
30+
}

include/mainmenu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace mod {
1111

12-
#define MAIN_MENU_OPTION_COUNT 8
12+
#define MAIN_MENU_OPTION_COUNT 10
1313

1414
class MainMenu : public MenuWindow
1515
{

include/mod.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace mod {
44

5-
#define MOD_VERSION "SPM Practice Codes v3"
5+
#define MOD_VERSION "SPM Practice Codes v4"
66

7-
extern bool isDolphin;
7+
extern bool gIsDolphin;
8+
extern bool gIs4_3;
89

910
void main();
1011

include/nandsettings.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ struct NandSettings
5353
bool mapChangeEffect;
5454
};
5555

56-
extern NandSettings * settings;
56+
extern NandSettings * gSettings;
5757

5858
EVT_DECLARE(nand_settings_load);
5959
EVT_DECLARE(nand_settings_write);
6060
EVT_DECLARE(nand_settings_delete);
6161

62-
extern int nandSettingsSuccess;
62+
extern int gNandSettingsSuccess;
6363

6464
void nandSettingsDefaults();
6565
void nandSettingsPatch();

include/pitselectmenu.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
PitSelectMenu
3+
Menu window to warp to a floor of a pit of 100 trials
4+
*/
5+
6+
#pragma once
7+
8+
#include "mod_ui_base/menuscroller.h"
9+
#include "mod_ui_base/menuwindow.h"
10+
11+
namespace mod {
12+
13+
class PitSelectMenu : public MenuWindow
14+
{
15+
private:
16+
int mGroup;
17+
int mFloor;
18+
char mFloorStr[3];
19+
MenuScroller * mGroupDisp;
20+
MenuScroller * mFloorDisp;
21+
22+
void updateGroupDisp();
23+
void updateFloorDisp();
24+
void _doMapChange();
25+
26+
static void groupSwap(MenuScroller * scroller, void * param);
27+
static void floorUp(MenuScroller * scroller, void * param);
28+
static void floorDown(MenuScroller * scroller, void * param);
29+
static bool doMapChange(MenuButton * button, void * param);
30+
31+
protected:
32+
virtual void disp() override;
33+
virtual void close() override;
34+
35+
public:
36+
static const char * sMapName;
37+
static int sGSW1;
38+
39+
PitSelectMenu();
40+
};
41+
42+
}

include/spm.eu0.lst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
8003ab80:windowDispGX2_Waku_col
4444
// more
4545

46+
// camdrv.c
47+
80055b24:camGetPtr
48+
// more
49+
4650
// dispdrv.c
4751
8005af04:dispEntry
4852
// more
@@ -116,9 +120,13 @@
116120
// more
117121

118122
// evt_mobj.c
123+
// text
119124
800f3608:evt_mobj_delete
120125
800f8be8:evt_mobj_blk
121126
// more
127+
// data
128+
8041b6d8:mobj_save_blk_sysevt
129+
// more
122130

123131
// evt_msg.c
124132
800fba54:evt_msg_print
@@ -138,6 +146,8 @@
138146
80121f48:marioGetPtr
139147
80122b68:marioCtrlOffChk
140148
80122b7c:marioKeyOffChk
149+
80122bf4:marioKeyOff
150+
80122c2c:marioKeyOn
141151
8012b50c:marioSetGravity
142152
// more
143153

@@ -165,6 +175,10 @@
165175
80179140:seq_logoMain
166176
// more
167177

178+
// seq_mapchange.c
179+
8017af98:_unload
180+
// more
181+
168182
// seq_game.c
169183
8017ce44:seq_gameInit
170184
// more
@@ -187,6 +201,11 @@
187201
80195f98:charPixlItemWinIsClosed
188202
// more
189203

204+
// hud.c
205+
80199490:hudLoadStats
206+
80199ad0:hudHide
207+
// more
208+
190209
// system.c
191210
8019d254:irand
192211
8019c54c:__assert2
@@ -271,6 +290,7 @@
271290
// spmario_snd.c
272291
80238598:spsndExit
273292
8023c93c:spsndBGMOn
293+
8023c948:spsndBGMOff_f_d
274294
// more
275295

276296
// relmgr.c
@@ -283,6 +303,12 @@
283303
805ae1a4:relDecompName
284304
805ae1a8:relCompName
285305

306+
// nandmgr.c
307+
8023e9ec:nandGetSaveFiles
308+
8023edcc:nandUpdateSave
309+
8023efe0:nandLoadSave
310+
// more
311+
286312
// MSL_C.PPCEABI.bare.H.a
287313
// printf.c
288314
8025d098:sprintf

include/spm.jp0.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
802958FC:IOS_Open
200200
80295ADC:IOS_Close
201201
80C36B20:evt_machi_set_elv_descs
202+
203+
// new to v4
204+
80055A0C:camGetPtr
205+
803B0FB0:mobj_save_blk_sysevt
206+
80122198:marioKeyOff
207+
801221D0:marioKeyOn
208+
8017A2F0:_unload
209+
80198650:hudLoadStats
210+
80198C90:hudHide
211+
8023A2F4:spsndBGMOff_f_d
212+
8023C2F8:nandGetSaveFiles
213+
8023C6D8:nandUpdateSave
214+
8023c8ec:nandLoadSave

include/spm.jp1.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
80295E98:IOS_Open
200200
80296078:IOS_Close
201201
80C23E20:evt_machi_set_elv_descs
202+
203+
// new to v4
204+
80055A2C:camGetPtr
205+
803B2130:mobj_save_blk_sysevt
206+
801221B8:marioKeyOff
207+
801221F0:marioKeyOn
208+
8017A338:_unload
209+
80198698:hudLoadStats
210+
80198CD8:hudHide
211+
8023A9A0:spsndBGMOff_f_d
212+
8023C9A4:nandGetSaveFiles
213+
8023CD84:nandUpdateSave
214+
8023cf98:nandLoadSave

include/spm.kr0.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,16 @@
189189
8029DD50:IOS_Open
190190
8029DF30:IOS_Close
191191
80C64440:evt_machi_set_elv_descs
192+
193+
// new to v4
194+
8004FF58:camGetPtr
195+
8044BE18:mobj_save_blk_sysevt
196+
8011E780:marioKeyOff
197+
8011E7B8:marioKeyOn
198+
80176CE8:_unload
199+
80195544:hudLoadStats
200+
80195B84:hudHide
201+
80234FCC:spsndBGMOff_f_d
202+
802371CC:nandGetSaveFiles
203+
80237544:nandUpdateSave
204+
80237758:nandLoadSave

include/spm.us0.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
8029594C:IOS_Open
200200
80295B2C:IOS_Close
201201
80C1BC00:evt_machi_set_elv_descs
202+
203+
// new to v4
204+
80055A0C:camGetPtr
205+
803DBD30:mobj_save_blk_sysevt
206+
80122198:marioKeyOff
207+
801221D0:marioKeyOn
208+
8017A300:_unload
209+
80198660:hudLoadStats
210+
80198CA0:hudHide
211+
8023A34C:spsndBGMOff_f_d
212+
8023C350:nandGetSaveFiles
213+
8023C730:nandUpdateSave
214+
8023c944:nandLoadSave

include/spm.us1.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
80296118:IOS_Open
200200
802962F8:IOS_Close
201201
80C09180:evt_machi_set_elv_descs
202+
203+
// new to v4
204+
80055A2C:camGetPtr
205+
803DD090:mobj_save_blk_sysevt
206+
801221B8:marioKeyOff
207+
801221F0:marioKeyOn
208+
8017A35C:_unload
209+
801986BC:hudLoadStats
210+
80198CFC:hudHide
211+
8023AA38:spsndBGMOff_f_d
212+
8023CA3C:nandGetSaveFiles
213+
8023CE1C:nandUpdateSave
214+
8023d030:nandLoadSave

include/spm.us2.lst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,16 @@
199199
802961B8:IOS_Open
200200
80296398:IOS_Close
201201
80C09300:evt_machi_set_elv_descs
202+
203+
// new to v4
204+
800559AC:camGetPtr
205+
803DD270:mobj_save_blk_sysevt
206+
801225C8:marioKeyOff
207+
80122600:marioKeyOn
208+
8017A76C:_unload
209+
80198ACC:hudLoadStats
210+
8019910C:hudHide
211+
8023AD64:spsndBGMOff_f_d
212+
8023CD68:nandGetSaveFiles
213+
8023D0CC:nandUpdateSave
214+
8023d2e0:nandLoadSave

include/spm/camdrv.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#pragma once
2+
3+
#include <types.h>
4+
#include <wii/types.h>
5+
6+
namespace spm::camdrv {
7+
8+
#define CAM_FLAG_16_9 0x10000000
9+
10+
enum
11+
{
12+
// 0-12 unknown
13+
CAM_DEBUG = 13,
14+
CAM_DEBUG_3D = 14
15+
};
16+
17+
struct CamEntry
18+
{
19+
u32 flag;
20+
u8 unknown_0x4[0x15c - 0x4];
21+
wii::Vec3 pos;
22+
wii::Vec3 target;
23+
u8 unknown_0x174[0x2f0 - 0x174];
24+
};
25+
static_assert(sizeof(CamEntry) == 0x2f0);
26+
27+
extern "C" {
28+
29+
CamEntry * camGetPtr(int camId);
30+
31+
}
32+
33+
}

include/spm/dispdrv.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#pragma once
22

33
#include <types.h>
4+
#include <spm/camdrv.h>
45

56
namespace spm::dispdrv {
67

7-
enum
8-
{
9-
// 0-12 unknown
10-
CAM_DEBUG = 13,
11-
CAM_DEBUG_3D = 14
12-
};
13-
148
typedef void (DispCallback)(s8 cameraId, void * param);
159

1610
extern "C" {

include/spm/evt_mobj.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
#include "evt_cmd.h"
4+
5+
namespace spm::evt_mobj {
6+
7+
extern "C" {
8+
9+
// Script to save the game
10+
EVT_DECLARE(mobj_save_blk_sysevt);
11+
12+
}
13+
14+
}

0 commit comments

Comments
 (0)