mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-24 22:19:50 +00:00
StageFileLoader.o 100% decompiled
This commit is contained in:
parent
43859e144b
commit
dbe4fa54c1
@ -438,12 +438,12 @@ calcPlacementMtx__15StageDataHolderFRC12JMapInfoIter,StageDataHolder.o,Scene.a,t
|
||||
getStageDataHolder__2MRFv,StageDataHolder.o,Scene.a,false
|
||||
__dt__Q22MR26AssignableArray<8JMapInfo>Fv,StageDataHolder.o,Scene.a,true
|
||||
__dt__15StageDataHolderFv,StageDataHolder.o,Scene.a,true
|
||||
__ct__15StageFileLoaderFPCc,StageFileLoader.o,Scene.a,false
|
||||
startLoadingStageFile__15StageFileLoaderFv,StageFileLoader.o,Scene.a,false
|
||||
waitLoadedStageFile__15StageFileLoaderFv,StageFileLoader.o,Scene.a,false
|
||||
makeStageArchiveNameList__15StageFileLoaderFv,StageFileLoader.o,Scene.a,false
|
||||
makeStageArchiveName__15StageFileLoaderFPcUlPCc,StageFileLoader.o,Scene.a,false
|
||||
mountFilesInStageMapFile__15StageFileLoaderFPCc,StageFileLoader.o,Scene.a,false
|
||||
__ct__15StageFileLoaderFPCc,StageFileLoader.o,Scene.a,true
|
||||
startLoadingStageFile__15StageFileLoaderFv,StageFileLoader.o,Scene.a,true
|
||||
waitLoadedStageFile__15StageFileLoaderFv,StageFileLoader.o,Scene.a,true
|
||||
makeStageArchiveNameList__15StageFileLoaderFv,StageFileLoader.o,Scene.a,true
|
||||
makeStageArchiveName__15StageFileLoaderFPcUlPCc,StageFileLoader.o,Scene.a,true
|
||||
mountFilesInStageMapFile__15StageFileLoaderFPCc,StageFileLoader.o,Scene.a,true
|
||||
tryRequestLoadStageResource__2MRFv,StageResourceLoader.o,Scene.a,false
|
||||
isLoadStageScenarioResource__2MRFv,StageResourceLoader.o,Scene.a,false
|
||||
__ct__21StopSceneDelayRequestFv,StopSceneController.o,Scene.a,false
|
||||
|
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"label": "decompiled",
|
||||
"message": "5.598347359893896%",
|
||||
"message": "5.615940978243848%",
|
||||
"color": "blue"
|
||||
}
|
@ -18,7 +18,7 @@
|
||||
| [Player](https://github.com/shibbo/Petari/blob/master/docs/lib/Player.md) | 0.14184156212575486% |
|
||||
| [RhythmLib](https://github.com/shibbo/Petari/blob/master/docs/lib/RhythmLib.md) | 0.0% |
|
||||
| [Ride](https://github.com/shibbo/Petari/blob/master/docs/lib/Ride.md) | 0.0% |
|
||||
| [Scene](https://github.com/shibbo/Petari/blob/master/docs/lib/Scene.md) | 5.900967982129561% |
|
||||
| [Scene](https://github.com/shibbo/Petari/blob/master/docs/lib/Scene.md) | 7.59493670886076% |
|
||||
| [Screen](https://github.com/shibbo/Petari/blob/master/docs/lib/Screen.md) | 0.8324294656508502% |
|
||||
| [Speaker](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker.md) | 8.252703471826978% |
|
||||
| [System](https://github.com/shibbo/Petari/blob/master/docs/lib/System.md) | 6.628178895059925% |
|
||||
|
@ -23,7 +23,7 @@
|
||||
| SceneNameObjListExecutor.o | 0.0% | 0 / 5 | 0.0% |
|
||||
| SceneNameObjMovementController.o | 0.0% | 0 / 20 | 0.0% |
|
||||
| StageDataHolder.o | 25.36162005785921% | 18 / 51 | 35.294117647058826% |
|
||||
| StageFileLoader.o | 0.0% | 0 / 6 | 0.0% |
|
||||
| StageFileLoader.o | 100.0% | 6 / 6 | 100.0% |
|
||||
| StageResourceLoader.o | 0.0% | 0 / 2 | 0.0% |
|
||||
| StopSceneController.o | 0.0% | 0 / 9 | 0.0% |
|
||||
|
||||
@ -580,12 +580,12 @@
|
||||
# StageFileLoader.o
|
||||
| Symbol | Decompiled? |
|
||||
| ------------- | ------------- |
|
||||
| __ct__15StageFileLoaderFPCc | :x: |
|
||||
| startLoadingStageFile__15StageFileLoaderFv | :x: |
|
||||
| waitLoadedStageFile__15StageFileLoaderFv | :x: |
|
||||
| makeStageArchiveNameList__15StageFileLoaderFv | :x: |
|
||||
| makeStageArchiveName__15StageFileLoaderFPcUlPCc | :x: |
|
||||
| mountFilesInStageMapFile__15StageFileLoaderFPCc | :x: |
|
||||
| __ct__15StageFileLoaderFPCc | :white_check_mark: |
|
||||
| startLoadingStageFile__15StageFileLoaderFv | :white_check_mark: |
|
||||
| waitLoadedStageFile__15StageFileLoaderFv | :white_check_mark: |
|
||||
| makeStageArchiveNameList__15StageFileLoaderFv | :white_check_mark: |
|
||||
| makeStageArchiveName__15StageFileLoaderFPcUlPCc | :white_check_mark: |
|
||||
| mountFilesInStageMapFile__15StageFileLoaderFPCc | :white_check_mark: |
|
||||
|
||||
|
||||
# StageResourceLoader.o
|
||||
|
@ -1,8 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution.h>
|
||||
|
||||
class StageFileLoader {
|
||||
public:
|
||||
StageFileLoader(const char *);
|
||||
|
||||
void startLoadingStageFile();
|
||||
void waitLoadedStageFile();
|
||||
void makeStageArchiveNameList();
|
||||
static void makeStageArchiveName(char *, u32, const char *);
|
||||
void mountFilesInStageMapFile(const char *);
|
||||
|
||||
char* mStageFiles[0x18]; // _0
|
||||
s32 mZoneCount; // _60
|
||||
};
|
@ -36,6 +36,6 @@ public:
|
||||
};
|
||||
|
||||
namespace MR {
|
||||
GalaxyStatusAccessor* makeGalaxyStatusAcessor(const char *);
|
||||
GalaxyStatusAccessor* makeCurrentGalaxyStatusAccessor();
|
||||
GalaxyStatusAccessor makeGalaxyStatusAcessor(const char *);
|
||||
GalaxyStatusAccessor makeCurrentGalaxyStatusAccessor();
|
||||
};
|
11
include/Game/System/NANDManagerThread.h
Normal file
11
include/Game/System/NANDManagerThread.h
Normal file
@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "Game/System/OSThreadWrapper.h"
|
||||
|
||||
class NANDManagerThread : public OSThreadWrapper {
|
||||
public:
|
||||
NANDManagerThread(int, int, JKRHeap *);
|
||||
|
||||
virtual ~NANDManagerThread();
|
||||
virtual s32 run();
|
||||
};
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
virtual ~ScenarioDataParser();
|
||||
|
||||
GalaxyStatusAccessor* makeAccessor(const char *) const;
|
||||
GalaxyStatusAccessor makeAccessor(const char *) const;
|
||||
|
||||
static const char* sNullStr;
|
||||
};
|
||||
|
70
source/Game/Scene/StageFileLoader.cpp
Normal file
70
source/Game/Scene/StageFileLoader.cpp
Normal file
@ -0,0 +1,70 @@
|
||||
#include "Game/Scene/StageFileLoader.h"
|
||||
#include "Game/System/GalaxyStatusAccessor.h"
|
||||
#include "Game/Util.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRFileFinder.h"
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
|
||||
StageFileLoader::StageFileLoader(const char *pName) {
|
||||
mZoneCount = 0;
|
||||
makeStageArchiveNameList();
|
||||
}
|
||||
|
||||
void StageFileLoader::startLoadingStageFile() {
|
||||
for (int i = 0; i < mZoneCount; i++) {
|
||||
MR::mountAsyncArchive(mStageFiles[i], MR::getAproposHeapForSceneArchive(0.029999999f));
|
||||
}
|
||||
}
|
||||
|
||||
void StageFileLoader::waitLoadedStageFile() {
|
||||
for (int i = 0; i < mZoneCount; i++) {
|
||||
const char* file = mStageFiles[i];
|
||||
MR::receiveFile(file);
|
||||
mountFilesInStageMapFile(file);
|
||||
}
|
||||
}
|
||||
|
||||
void StageFileLoader::makeStageArchiveNameList() {
|
||||
GalaxyStatusAccessor access = MR::makeCurrentGalaxyStatusAccessor();
|
||||
mZoneCount = access.getZoneNum();
|
||||
|
||||
for (int i = 0; i < mZoneCount; i++) {
|
||||
const char* zoneName = access.getZoneName(i);
|
||||
char path[0x100];
|
||||
snprintf(path, 0x100, "/StageData/%s.arc", zoneName);
|
||||
u32 len = strlen(path) + 1;
|
||||
mStageFiles[i] = new char[len];
|
||||
MR::copyString(mStageFiles[i], path, len);
|
||||
}
|
||||
}
|
||||
|
||||
void StageFileLoader::makeStageArchiveName(char *buf, u32 len, const char *pZoneName) {
|
||||
snprintf(buf, len, "/StageData/%s.arc", pZoneName);
|
||||
}
|
||||
|
||||
void StageFileLoader::mountFilesInStageMapFile(const char *pName) {
|
||||
JKRArchive* archive = 0;
|
||||
JKRHeap* heap = 0;
|
||||
MR::getMountedArchiveAndHeap(pName, &archive, &heap);
|
||||
void* res;
|
||||
const char* curName;
|
||||
s32 fileCount = archive->countFile("/arc") - 2;
|
||||
|
||||
if (fileCount > 0) {
|
||||
JKRArcFinder* firstFile = archive->getFirstFile("/arc");
|
||||
|
||||
for (int i = 0; i < fileCount;) {
|
||||
if (!MR::isMountedArchive(firstFile->mName)) {
|
||||
curName = firstFile->mName;
|
||||
res = archive->getResource(QUESTIONMARK_MAGIC, curName);
|
||||
MR::createAndAddArchive(res, heap, curName);
|
||||
}
|
||||
|
||||
i++;
|
||||
firstFile->findNextFile();
|
||||
}
|
||||
|
||||
delete firstFile;
|
||||
}
|
||||
}
|
@ -251,11 +251,11 @@ bool GalaxyStatusAccessor::isHiddenStar(s32 scenario) const {
|
||||
}
|
||||
|
||||
namespace MR {
|
||||
GalaxyStatusAccessor* makeGalaxyStatusAccessor(const char *pGalaxyName) {
|
||||
GalaxyStatusAccessor makeGalaxyStatusAccessor(const char *pGalaxyName) {
|
||||
return ScenarioDataFunction::getScenarioDataParser()->makeAccessor(pGalaxyName);
|
||||
}
|
||||
|
||||
GalaxyStatusAccessor* makeCurrentGalaxyStatusAccessor() {
|
||||
GalaxyStatusAccessor makeCurrentGalaxyStatusAccessor() {
|
||||
return ScenarioDataFunction::getScenarioDataParser()->makeAccessor(MR::getCurrentStageName());
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user