Skip to content

Commit c9cce1a

Browse files
committed
2 parents 59da25b + e42c8d1 commit c9cce1a

35 files changed

+1108
-117
lines changed

base/symbols_resort.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,6 +3588,7 @@ __dt__Q23EGG5SceneFv=0x801c8318
35883588
sCurrentHeap__Q23EGG4Heap=0x806f49b0
35893589
sTVMode__Q23EGG6Screen=0x806f4938
35903590
sTVInfo__Q23EGG6Screen=0x806b4ad8
3591+
__ct__Q23EGG6ScreenFv=0x801b83d0
35913592

35923593
spInstance__11RPSysSystem=0x806f4c68
35933594
spInstance__13RPSysSceneMgr=0x806f4c98
@@ -3630,8 +3631,16 @@ sDrawPass__13RPGrpRenderer=0x806f0bf8
36303631
spInstance__15RPSysTextWriter=0x806f4d08
36313632
Begin__15RPSysTextWriterFv=0x8023bdfc
36323633
mainLoop__11RPSysSystemFv=0x80237b2c
3634+
spCurrent__13RPGrpRenderer=0x806f4e04
3635+
AppendDrawObject__13RPGrpRendererFP16IRPGrpDrawObject=0x80253d44
3636+
CreateView2D__13RPGrpRendererFUcP11RPGrpScreen=0x80253e1c
3637+
CorrectView__13RPGrpRendererFv=0x80253d68
3638+
__vt__11RPGrpScreen=0x806b5358
3639+
3640+
startSeWithRemote__Q23Sp23SndFUlUl=0x802b735c
3641+
startSe__Q23Sp23SndFUl=0x802b73bc
3642+
startBgm__Q23Sp23SndFUl=0x802b7228
36333643

3634-
playSound__Q23Sp27SndUtilFUlUl=0x802b735c
36353644
sInstance__Q33Sp23Swf5Scene=0x806f5ff0
36363645
spInstance__Q33Sp23Cmn9StaticMem=0x806f4e98
36373646
spInstance__17RPSysSystemWinMgr=0x806f4cd0
@@ -3641,4 +3650,4 @@ sActiveScreen__13RPGrpRenderer=0x807cef2c
36413650
setStaticVar__Q33Sp23Cmn9StaticMemFiib=0x80269f08
36423651

36433652
setTimer__Q43Sp23Bsk3Lyt4MainFUlUl=0x80533a78
3644-
setType__Q33Sp23Bsk4BallFQ43Sp23Bsk4Ball5EType=0x804ffa44
3653+
setType__Q33Sp23Bsk4BallFQ43Sp23Bsk4Ball5EType=0x804ffa44

include/Sports2/Snd/Sp2SndUtil.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
#include <Sports2/Sp2Types.h>
44

55
namespace Sp2 {
6+
namespace Snd {
67

7-
class SndUtil {
8-
public:
9-
static void playBgm(u32 id);
10-
static void playSound(u32 id, u32 spkFlag);
11-
};
8+
void startBgm(u32 id);
9+
void startSe(u32 id);
10+
void startSeWithRemote(u32 id, u32 spkFlag);
1211

12+
} // namespace Snd
1313
} // namespace Sp2
1414

15-
#endif
15+
#endif

include/egg/core/eggController.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ class CoreController {
142142
u32 mButtonHold; // at 0x8
143143
u32 mButtonTrigger; // at 0xC
144144
u32 mButtonRelease; // at 0x10
145+
#if defined(PACK_RESORT)
146+
char _14[0x4];
147+
#endif
145148
CoreStatus mCoreStatus[16];
149+
#if defined(PACK_RESORT)
150+
char _858[0xF18 - 0x858];
151+
#endif
146152
int mKPADReadLength; // at 0x854
147153
Vector3f VEC3_0x858;
148154
UNKWORD WORD_0x864;

include/nw4r/ut/ut_Font.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ class Font {
7272
virtual int GetCharWidth(u16 ch) const = 0; // at 0x48
7373
virtual CharWidths GetCharWidths(u16 ch) const = 0; // at 0x4C
7474
virtual void GetGlyph(Glyph* pGlyph, u16 ch) const = 0; // at 0x50
75-
virtual FontEncoding GetEncoding() const = 0; // at 0x54
75+
#if defined(PACK_RESORT)
76+
virtual bool HasGlyph(u16 ch) const = 0; // at 0x54
77+
#endif
78+
virtual FontEncoding GetEncoding() const = 0; // at 0x54
7679

7780
void InitReaderFunc(FontEncoding encode);
7881

include/nw4r/ut/ut_ResFontBase.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ class ResFontBase : public Font {
9797
virtual int GetCharWidth(u16 ch) const; // at 0x48
9898
virtual CharWidths GetCharWidths(u16 ch) const; // at 0x4C
9999
virtual void GetGlyph(Glyph* pGlyph, u16 ch) const; // at 0x50
100-
virtual FontEncoding GetEncoding() const; // at 0x54
100+
#if defined(PACK_RESORT)
101+
virtual bool HasGlyph(u16 ch) const = 0; // at 0x54
102+
#endif
103+
virtual FontEncoding GetEncoding() const; // at 0x54
101104

102105
protected:
103106
bool IsManaging(const void* pBuffer) const {

lib/libkiwi/core/kiwiIScene.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ void IScene::Configure() {
1414
RP_GET_INSTANCE(RPGrpModelResManager)->CreateResourceList(0x400);
1515
RP_GET_INSTANCE(RPGrpModelManager)
1616
->CreateModelScene(0, 0, 1, nullptr, nullptr);
17+
#endif
1718

1819
// Setup renderer view
1920
RPGrpScreen* pScreen = new RPGrpScreen();
@@ -22,7 +23,6 @@ void IScene::Configure() {
2223

2324
RPGrpRenderer::GetCurrent()->CreateView2D(1, pScreen);
2425
RPGrpRenderer::GetCurrent()->CorrectView();
25-
#endif
2626

2727
// User state function
2828
OnConfigure();

lib/libkiwi/core/kiwiIScene.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,20 @@ class IScene : public RPSysScene {
8787
}
8888

8989
#if defined(PACK_RESORT)
90+
/**
91+
* @brief Gets the scene's group ID
92+
*/
93+
virtual EGroupID GetGroup() const {
94+
return EGroupID_Cmn;
95+
}
96+
97+
/**
98+
* @brief Tests whether to show the warning screen while loading
99+
*/
100+
virtual bool GetWarnAsLoading() const {
101+
return false;
102+
}
103+
90104
/**
91105
* @brief Gets the scene's type
92106
*/
@@ -244,6 +258,10 @@ template <typename T> class SceneDecl {
244258
static_cast<T*>(nullptr)->T::GetName(),
245259
static_cast<T*>(nullptr)->T::GetDirectory(),
246260
static_cast<T*>(nullptr)->T::GetID(),
261+
#if defined(PACK_RESORT)
262+
static_cast<T*>(nullptr)->T::GetWarnAsLoading(),
263+
static_cast<T*>(nullptr)->T::GetGroup(),
264+
#endif
247265
static_cast<T*>(nullptr)->T::GetPack(),
248266
static_cast<T*>(nullptr)->T::GetCreateType(),
249267
static_cast<T*>(nullptr)->T::GetExitType(),

lib/libkiwi/core/kiwiSceneCreator.cpp

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ TMap<s32, SceneCreator::Info> SceneCreator::sUserScenes;
7979

8080
//! Root debug menu scene ID
8181
s32 SceneCreator::sDebugRootID = -1;
82+
//! Whether to boot into the root debug menu
83+
bool SceneCreator::sDebugRootBootUp = false;
8284
//! Root debug menu button combination (held)
8385
u16 SceneCreator::sDebugRootButtons = 0xFFFF;
8486

@@ -132,16 +134,19 @@ void SceneCreator::RegistScene(const Info& rInfo) {
132134
/**
133135
* @brief Registers root debug menu information
134136
* @details The debug root scene is entered when transitioning to the main
135-
* menu while the specified button mask is held.
137+
* menu while the specified button mask is held, or always on first boot
138+
* if the bootUp flag is set.
136139
*
137140
* @param id Debug root scene ID (-1 to disable)
138-
* @param buttons Buttons that must be held to visit the debug menu
139-
* (defaults to B+Minus+1+2)
141+
* @param bootUp Whether to boot into the debug root scene
142+
* @param buttons Buttons that must be held to visit the debug root scene
143+
* (defaults to B+MINUS)
140144
*/
141-
void SceneCreator::RegistDebugRoot(s32 id, u16 buttons) {
145+
void SceneCreator::RegistDebugRoot(s32 id, bool bootUp, u16 buttons) {
142146
K_ASSERT_EX(id >= 0 || id == -1, "Invalid scene ID");
143147

144148
sDebugRootID = id;
149+
sDebugRootBootUp = bootUp;
145150
sDebugRootButtons = buttons;
146151
}
147152

@@ -194,12 +199,18 @@ bool SceneCreator::ChangeSceneAfterFade(s32 id, bool reload) {
194199
}
195200

196201
// Visit debug root instead of menu if buttons are held
197-
if (id == GetMenuScene()) {
202+
if (id == GetMenuScene() && current != sDebugRootID) {
198203
for (int i = 0; i < EPlayer_Max; i++) {
199204
const WiiCtrl& rCtrl =
200205
CtrlMgr::GetInstance().GetWiiCtrl(static_cast<EPlayer>(i));
201206

202-
if (rCtrl.IsConnected() && rCtrl.IsHold(sDebugRootButtons)) {
207+
bool visit = sDebugRootBootUp; // Visit on boot
208+
visit |= sDebugRootButtons == 0; // Always visit
209+
visit |= rCtrl.IsConnected() &&
210+
rCtrl.IsHold(sDebugRootButtons); // Button combo held
211+
212+
if (visit) {
213+
sDebugRootBootUp = false;
203214
id = sDebugRootID;
204215
break;
205216
}
@@ -243,13 +254,19 @@ bool SceneCreator::ChangeSceneAfterFade(s32 id, const nw4r::ut::Color* pColor) {
243254
id = current;
244255
}
245256

246-
// Visit debug root instead of menu if buttons are held
247-
if (id == GetMenuScene()) {
257+
// Visit debug root instead of menu if on boot, or if buttons are held
258+
if (id == GetMenuScene() && current != sDebugRootID) {
248259
for (int i = 0; i < EPlayer_Max; i++) {
249260
const WiiCtrl& rCtrl =
250261
CtrlMgr::GetInstance().GetWiiCtrl(static_cast<EPlayer>(i));
251262

252-
if (rCtrl.IsConnected() && rCtrl.IsHold(sDebugRootButtons)) {
263+
bool visit = sDebugRootBootUp; // Visit on boot
264+
visit |= sDebugRootButtons == 0; // Always visit
265+
visit |= rCtrl.IsConnected() &&
266+
rCtrl.IsHold(sDebugRootButtons); // Button combo held
267+
268+
if (visit) {
269+
sDebugRootBootUp = false;
253270
id = sDebugRootID;
254271
break;
255272
}

lib/libkiwi/core/kiwiSceneCreator.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,16 @@ class SceneCreator : public ExtSingletonPtr<RPSysSceneCreator, SceneCreator> {
192192
/**
193193
* @brief Registers root debug menu information
194194
* @details The debug root scene is entered when transitioning to the main
195-
* menu while the specified button mask is held.
195+
* menu while the specified button mask is held, or always on first boot
196+
* if the bootUp flag is set.
196197
*
197198
* @param id Debug root scene ID (-1 to disable)
198-
* @param buttons Buttons that must be held to visit the debug menu
199-
* (defaults to B+MINUS+2)
199+
* @param bootUp Whether to boot into the debug root scene
200+
* @param buttons Buttons that must be held to visit the debug root scene
201+
* (defaults to B+MINUS)
200202
*/
201-
static void RegistDebugRoot(s32 id,
202-
u16 buttons = (EButton_B | EButton_Minus |
203-
EButton_2));
203+
static void RegistDebugRoot(s32 id, bool bootUp = true,
204+
u16 buttons = EButton_B | EButton_Minus);
204205

205206
/**
206207
* @brief Gets the scene ID of the main menu scene
@@ -347,6 +348,8 @@ class SceneCreator : public ExtSingletonPtr<RPSysSceneCreator, SceneCreator> {
347348

348349
//! Root debug menu scene ID
349350
static s32 sDebugRootID;
351+
//! Whether to boot into the root debug menu
352+
static bool sDebugRootBootUp;
350353
//! Root debug menu button combination (held)
351354
static u16 sDebugRootButtons;
352355
};

lib/libkiwi/core/kiwiSceneHookMgr.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ void SceneHookMgr::DoEnter() {
7171
GetCurrentScene()->Configure();
7272

7373
// Global hooks
74-
K_FOREACH (GetInstance().mGlobalHooks) {
74+
K_FOREACH (it, GetInstance().mGlobalHooks) {
7575
it->Configure(GetCurrentScene());
7676
}
7777

7878
// Hooks for game scene
7979
if (IsPackScene()) {
80-
K_FOREACH (GetInstance().GetActiveHooks()) {
80+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
8181
it->Configure(GetCurrentScene());
8282
}
8383
}
@@ -93,27 +93,27 @@ KOKESHI_BY_PACK(KM_CALL(0x8018532c, SceneHookMgr::DoEnter), // Wii Sports
9393
*/
9494
void SceneHookMgr::DoReset() {
9595
// Global hooks
96-
K_FOREACH (GetInstance().mGlobalHooks) {
96+
K_FOREACH (it, GetInstance().mGlobalHooks) {
9797
it->BeforeReset(GetCurrentScene());
9898
}
9999

100100
// Hooks for game scene
101101
if (IsPackScene()) {
102-
K_FOREACH (GetInstance().GetActiveHooks()) {
102+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
103103
it->BeforeReset(GetCurrentScene());
104104
}
105105
}
106106

107107
GetCurrentScene()->Reset();
108108

109109
// Global hooks
110-
K_FOREACH (GetInstance().mGlobalHooks) {
110+
K_FOREACH (it, GetInstance().mGlobalHooks) {
111111
it->AfterReset(GetCurrentScene());
112112
}
113113

114114
// Hooks for game scene
115115
if (IsPackScene()) {
116-
K_FOREACH (GetInstance().GetActiveHooks()) {
116+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
117117
it->AfterReset(GetCurrentScene());
118118
}
119119
}
@@ -132,13 +132,13 @@ KOKESHI_BY_PACK(KM_CALL(0x801853d4, SceneHookMgr::DoReset), // Wii Sports
132132
*/
133133
void SceneHookMgr::DoLoadResource() {
134134
// Global hooks
135-
K_FOREACH (GetInstance().mGlobalHooks) {
135+
K_FOREACH (it, GetInstance().mGlobalHooks) {
136136
it->LoadResource(GetCurrentScene());
137137
}
138138

139139
// Hooks for game scene
140140
if (IsPackScene()) {
141-
K_FOREACH (GetInstance().GetActiveHooks()) {
141+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
142142
it->LoadResource(GetCurrentScene());
143143
}
144144
}
@@ -154,13 +154,13 @@ KOKESHI_BY_PACK(KM_BRANCH(0x8018695c, SceneHookMgr::DoLoadResource), // Wii Spo
154154
*/
155155
void SceneHookMgr::DoCalculate() {
156156
// Global hooks
157-
K_FOREACH (GetInstance().mGlobalHooks) {
157+
K_FOREACH (it, GetInstance().mGlobalHooks) {
158158
it->BeforeCalculate(GetCurrentScene());
159159
}
160160

161161
// Hooks for game scene
162162
if (IsPackScene()) {
163-
K_FOREACH (GetInstance().GetActiveHooks()) {
163+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
164164
it->BeforeCalculate(GetCurrentScene());
165165
}
166166
}
@@ -170,13 +170,13 @@ void SceneHookMgr::DoCalculate() {
170170
RP_GET_INSTANCE(RPSysSceneMgr)->SceneManager::calcCurrentScene();
171171

172172
// Global hooks
173-
K_FOREACH (GetInstance().mGlobalHooks) {
173+
K_FOREACH (it, GetInstance().mGlobalHooks) {
174174
it->AfterCalculate(GetCurrentScene());
175175
}
176176

177177
// Hooks for game scene
178178
if (IsPackScene()) {
179-
K_FOREACH (GetInstance().GetActiveHooks()) {
179+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
180180
it->AfterCalculate(GetCurrentScene());
181181
}
182182
}
@@ -192,13 +192,13 @@ KOKESHI_BY_PACK(KM_BRANCH(0x80185868, SceneHookMgr::DoCalculate), // Wii Sports
192192
*/
193193
void SceneHookMgr::DoExit() {
194194
// Global hooks
195-
K_FOREACH (GetInstance().mGlobalHooks) {
195+
K_FOREACH (it, GetInstance().mGlobalHooks) {
196196
it->Exit(GetCurrentScene());
197197
}
198198

199199
// Hooks for game scene
200200
if (IsPackScene()) {
201-
K_FOREACH (GetInstance().GetActiveHooks()) {
201+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
202202
it->Exit(GetCurrentScene());
203203
}
204204
}
@@ -214,13 +214,13 @@ KOKESHI_BY_PACK(KM_BRANCH(0x80185000, SceneHookMgr::DoExit), // Wii Sports
214214
*/
215215
void SceneHookMgr::DoPause() {
216216
// Global hooks
217-
K_FOREACH (GetInstance().mGlobalHooks) {
217+
K_FOREACH (it, GetInstance().mGlobalHooks) {
218218
it->Pause(GetCurrentScene(), true);
219219
}
220220

221221
// Hooks for game scene
222222
if (IsPackScene()) {
223-
K_FOREACH (GetInstance().GetActiveHooks()) {
223+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
224224
it->Pause(GetCurrentScene(), true);
225225
}
226226
}
@@ -236,13 +236,13 @@ KOKESHI_BY_PACK(KM_BRANCH(0x801b68ec, SceneHookMgr::DoPause), // Wii Sports
236236
*/
237237
void SceneHookMgr::DoUnPause() {
238238
// Global hooks
239-
K_FOREACH (GetInstance().mGlobalHooks) {
239+
K_FOREACH (it, GetInstance().mGlobalHooks) {
240240
it->Pause(GetCurrentScene(), false);
241241
}
242242

243243
// Hooks for game scene
244244
if (IsPackScene()) {
245-
K_FOREACH (GetInstance().GetActiveHooks()) {
245+
K_FOREACH (it, GetInstance().GetActiveHooks()) {
246246
it->Pause(GetCurrentScene(), false);
247247
}
248248
}

0 commit comments

Comments
 (0)