Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
version display and modes
Browse files Browse the repository at this point in the history
  • Loading branch information
fruityloops1 committed Dec 14, 2021
1 parent 6714e9f commit 2d74873
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 6 deletions.
8 changes: 8 additions & 0 deletions exported.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,13 @@
_Z18fisPadReleaseRighti;
_Z17fisPadReleaseDowni;
_Z17fisPadReleaseLefti;


_Z26fisModeDiverOrJungleGymRomv;
_Z15fisModeDiverRomv;
_Z16fisModeE3LiveRomv;
_Z17fisModeE3MovieRomv;
_Z18fisModeEpdMovieRomv;
_Z19fisModeJungleGymRomv;
local: *;
};
4 changes: 4 additions & 0 deletions include/fl/common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#pragma once

#define PRACTICE_VERSTR "1.1.0"
#define PRACTICE_VER 110
10 changes: 10 additions & 0 deletions include/fl/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ class PracticeUI
sead::Vector3f reloadStagePos;
sead::Quatf reloadStageQuat;
StageScene* stageScene;

bool inputEnabled = true;
bool hideShineCounter = false;

#if(SMOVER==130)
char textBuffer[4096];
u32 printPos;
#endif

void savePosition(PlayerActorHakoniwa& player);
void loadPosition(PlayerActorHakoniwa& player);
Expand All @@ -42,6 +45,13 @@ class PracticeUI
bool gotShineRefresh = false;
bool alwaysWarp = false;
bool disableAutoSave = false;

bool isModeDiverOrJungleGymRom = false;
bool isModeDiverRom = false;
bool isModeE3LiveRom = false;
bool isModeE3MovieRom = false;
bool isModeEpdMovieRom = false;
bool isModeJungleGymRom = false;
};

}
158 changes: 158 additions & 0 deletions patches/modes.slpatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
[version=100, target=main]
003fafe4:
bl fisModeDiverOrJungleGymRom
0041f560:
bl fisModeDiverOrJungleGymRom
0043f548:
bl fisModeDiverOrJungleGymRom
004c9c20:
bl fisModeDiverOrJungleGymRom
004cd0dc:
bl fisModeDiverOrJungleGymRom

000efad8:
bl fisModeDiverRom
0030ab8c:
bl fisModeDiverRom
003a47a4:
bl fisModeDiverRom
004c8a30:
bl fisModeDiverRom
004cbef0:
bl fisModeDiverRom

0020ca64:
bl fisModeE3LiveRom
0020cb54:
bl fisModeE3LiveRom
0020cfd0:
bl fisModeE3LiveRom
0020d168:
bl fisModeE3LiveRom
0020d2b4:
bl fisModeE3LiveRom
0028e790:
bl fisModeE3LiveRom
002ad8e0:
bl fisModeE3LiveRom
002c5f20:
bl fisModeE3LiveRom
00308e9c:
bl fisModeE3LiveRom
00309440:
bl fisModeE3LiveRom
00309820:
bl fisModeE3LiveRom
0030aba4:
bl fisModeE3LiveRom
0030c258:
bl fisModeE3LiveRom
0034d35c:
bl fisModeE3LiveRom
004ca424:
bl fisModeE3LiveRom
004cdbe0:
bl fisModeE3LiveRom
004cde38:
bl fisModeE3LiveRom
004dd990:
bl fisModeE3LiveRom
004ea258:
bl fisModeE3LiveRom
004eb438:
bl fisModeE3LiveRom
004eb520:
bl fisModeE3LiveRom
004f22d0:
bl fisModeE3LiveRom
00505a70:
bl fisModeE3LiveRom
00505a9c:
bl fisModeE3LiveRom
00506258:
bl fisModeE3LiveRom
0050634c:
bl fisModeE3LiveRom
0050e99c:
bl fisModeE3LiveRom
0052c914:
bl fisModeE3LiveRom
0052d9b8:
bl fisModeE3LiveRom
005306e0:
bl fisModeE3LiveRom
00558514:
bl fisModeE3LiveRom

000db84c:
bl fisModeE3MovieRom
000df47c:
bl fisModeE3MovieRom
00145ce8:
bl fisModeE3MovieRom
00146678:
bl fisModeE3MovieRom
00157bd4:
bl fisModeE3MovieRom
00157d7c:
bl fisModeE3MovieRom
0018baa0:
bl fisModeE3MovieRom
00287d84:
bl fisModeE3MovieRom
0028c198:
bl fisModeE3MovieRom
002ad83c:
bl fisModeE3MovieRom
002ad864:
bl fisModeE3MovieRom
002ad8d8:
bl fisModeE3MovieRom
002aece4:
bl fisModeE3MovieRom
002aed00:
bl fisModeE3MovieRom
002af1ec:
bl fisModeE3MovieRom
002af348:
bl fisModeE3MovieRom
002c5f18:
bl fisModeE3MovieRom
0030ab9c:
bl fisModeE3MovieRom
0030eb3c:
bl fisModeE3MovieRom
0030ee14:
bl fisModeE3MovieRom
0030f008:
bl fisModeE3MovieRom
003a47ac:
bl fisModeE3MovieRom
003d0d34:
bl fisModeE3MovieRom
00474c4c:
bl fisModeE3MovieRom
0047bea8:
bl fisModeE3MovieRom
004a81a4:
bl fisModeE3MovieRom
004a9cc0:
bl fisModeE3MovieRom
004c870c:
bl fisModeE3MovieRom
004c8a38:
bl fisModeE3MovieRom
004c8c90:
bl fisModeE3MovieRom
004cbef8:
bl fisModeE3MovieRom
004cd0c0:
bl fisModeE3MovieRom
004f07dc:
bl fisModeE3MovieRom

0030abac:
bl fisModeEpdMovieRom

004c8a28:
bl fisModeJungleGymRom
39 changes: 33 additions & 6 deletions source/fl/ui.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "al/util.hpp"
#include "game/GameData/GameDataFunction.h"
#include "rs/util.hpp"

#include <fl/common.h>
#include <fl/ui.h>
#include <fl/util.h>

#include <fl/server.h>

const char* stageNames[] = {"CapWorldHomeStage", "WaterfallWorldHomeStage", "SandWorldHomeStage", "LakeWorldHomeStage", "ForestWorldHomeStage", "CloudWorldHomeStage", "ClashWorldHomeStage", "CityWorldHomeStage",
Expand All @@ -17,7 +18,7 @@ const char* stageNames[] = {"CapWorldHomeStage", "WaterfallWorldHomeStage", "San
#endif


#define NUM_PAGES 7
#define NUM_PAGES 8
#define NUM_STAGES 200

#if(SMOVER==100)
Expand Down Expand Up @@ -78,7 +79,14 @@ void fl::PracticeUI::update(StageScene& stageScene)
#endif

if (holdL && al::isPadTriggerRight(CONTROLLER_AUTO)) {inputEnabled = !inputEnabled; return;}
else if (holdL && al::isPadTriggerLeft(CONTROLLER_AUTO)) showMenu = !showMenu;
else if
#if(SMOVER==130)
(holdL && al::isPadTriggerLeft(CONTROLLER_AUTO))
#endif
#if(SMOVER==100)
(al::isPadTriggerPressLeftStick(CONTROLLER_AUTO))
#endif
showMenu = !showMenu;

if (!showMenu)
{
Expand Down Expand Up @@ -119,7 +127,7 @@ void fl::PracticeUI::menu()
{
enum Page : u8
{
About, Options, Stage, Misc, Info, MoonInfo, Debug
About, Options, Stage, Misc, Info, MoonInfo, Modes, Debug
};
static Page curPage = About;
static u8 curLine = 0;
Expand All @@ -141,7 +149,8 @@ void fl::PracticeUI::menu()
else if (curPage == Stage) curPage = Misc;
else if (curPage == Misc) curPage = Info;
else if (curPage == Info) curPage = MoonInfo;
else if (curPage == MoonInfo) curPage = Debug;
else if (curPage == MoonInfo) curPage = Modes;
else if (curPage == Modes) curPage = Debug;
else if (curPage == Debug) curPage = About;
}
if (al::isPadTriggerLeft(CONTROLLER_AUTO))
Expand All @@ -151,7 +160,8 @@ void fl::PracticeUI::menu()
else if (curPage == Misc) curPage = Stage;
else if (curPage == Info) curPage = Misc;
else if (curPage == MoonInfo) curPage = Info;
else if (curPage == Debug) curPage = MoonInfo;
else if (curPage == Modes) curPage = MoonInfo;
else if (curPage == Debug) curPage = Modes;
else if (curPage == About) curPage = Debug;
}
}
Expand Down Expand Up @@ -319,6 +329,21 @@ void fl::PracticeUI::menu()
#endif
break;
}
case Modes:
{
printf("Modes\n");
MAX_LINE(6);
CURSOR(0);
CHANGE_PAGE();

TOGGLE("isModeDiverOrJungleGymRom: %s\n", isModeDiverOrJungleGymRom, 1);
TOGGLE("isModeDiverRom: %s\n", isModeDiverRom, 2);
TOGGLE("isModeJungleGymRom: %s\n", isModeJungleGymRom, 3);
TOGGLE("isModeE3LiveRom: %s\n", isModeE3LiveRom, 4);
TOGGLE("isModeE3MovieRom: %s\n", isModeE3MovieRom, 5);
TOGGLE("isModeEpdMovieRom: %s\n", isModeEpdMovieRom, 6);
break;
};
case Debug:
{
printf("Debug\n");
Expand All @@ -331,6 +356,8 @@ void fl::PracticeUI::menu()
printf("Current World ID: %d\n", GameDataFunction::getCurrentWorldId(*stageScene->mHolder));
printf("Current Stage Name: %s\n", GameDataFunction::getCurrentStageName(*stageScene->mHolder));
printf("Language: %s\n", stageScene->mHolder->getLanguage());
printf("\n");
printf("Practice Mod Version: %s\n", PRACTICE_VERSTR);
#endif
break;
}
Expand Down
30 changes: 30 additions & 0 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,34 @@ bool isTriggerSnapShotModeVar(const al::IUseSceneObjHolder* objHolder)
bool isTriggerAmiiboModeVar(const al::IUseSceneObjHolder* objHolder)
{
return showMenu ? false : rs::isTriggerAmiiboMode(objHolder);
}

bool fisModeDiverOrJungleGymRom()
{
return fl::PracticeUI::instance().isModeDiverOrJungleGymRom;
}

bool fisModeDiverRom()
{
return fl::PracticeUI::instance().isModeDiverRom;
}

bool fisModeJungleGymRom()
{
return fl::PracticeUI::instance().isModeJungleGymRom;
}

bool fisModeE3LiveRom()
{
return fl::PracticeUI::instance().isModeE3LiveRom;
}

bool fisModeE3MovieRom()
{
return fl::PracticeUI::instance().isModeE3MovieRom;
}

bool fisModeEpdMovieRom()
{
return fl::PracticeUI::instance().isModeEpdMovieRom;
}

0 comments on commit 2d74873

Please sign in to comment.