CaptureScreenDirector 100%

This commit is contained in:
shibbo 2022-07-02 01:24:06 -04:00
parent a7b59436e3
commit ad02fbe886
12 changed files with 219 additions and 34 deletions

View File

@ -211,20 +211,20 @@ execute__Q213NrvCameraInfo24CameraInfoNrvFirstPersonCFP5Spine,CameraInfo.o,Scree
execute__Q213NrvCameraInfo19CameraInfoNrvNormalCFP5Spine,CameraInfo.o,Screen.a,false
execute__Q213NrvCameraInfo19CameraInfoNrvAppearCFP5Spine,CameraInfo.o,Screen.a,false
execute__Q213NrvCameraInfo17CameraInfoNrvHideCFP5Spine,CameraInfo.o,Screen.a,false
__ct__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,false
captureIfAllow__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,false
capture__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,false
requestCaptureTiming__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,false
invalidateCaptureTiming__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,false
getResTIMG__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,false
getTexImage__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,false
getUsingTiming__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,false
getCurrentTiming__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,false
findFromName__21CaptureScreenDirectorCFPCc,CaptureScreenDirector.o,Screen.a,false
__ct__18CaptureScreenActorFUlPCc,CaptureScreenDirector.o,Screen.a,false
draw__18CaptureScreenActorCFv,CaptureScreenDirector.o,Screen.a,false
__dt__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,false
__dt__18CaptureScreenActorFv,CaptureScreenDirector.o,Screen.a,false
__ct__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,true
captureIfAllow__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,true
capture__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,true
requestCaptureTiming__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,true
invalidateCaptureTiming__21CaptureScreenDirectorFPCc,CaptureScreenDirector.o,Screen.a,true
getResTIMG__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,true
getTexImage__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,true
getUsingTiming__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,true
getCurrentTiming__21CaptureScreenDirectorCFv,CaptureScreenDirector.o,Screen.a,true
findFromName__21CaptureScreenDirectorCFPCc,CaptureScreenDirector.o,Screen.a,true
__ct__18CaptureScreenActorFUlPCc,CaptureScreenDirector.o,Screen.a,true
draw__18CaptureScreenActorCFv,CaptureScreenDirector.o,Screen.a,true
__dt__21CaptureScreenDirectorFv,CaptureScreenDirector.o,Screen.a,true
__dt__18CaptureScreenActorFv,CaptureScreenDirector.o,Screen.a,true
__ct__16CenterScreenBlurFv,CenterScreenBlur.o,Screen.a,false
init__16CenterScreenBlurFRC12JMapInfoIter,CenterScreenBlur.o,Screen.a,false
appear__16CenterScreenBlurFv,CenterScreenBlur.o,Screen.a,false

1 Symbol Name Object File Library Archive Matching
211 execute__Q213NrvCameraInfo19CameraInfoNrvNormalCFP5Spine CameraInfo.o Screen.a false
212 execute__Q213NrvCameraInfo19CameraInfoNrvAppearCFP5Spine CameraInfo.o Screen.a false
213 execute__Q213NrvCameraInfo17CameraInfoNrvHideCFP5Spine CameraInfo.o Screen.a false
214 __ct__21CaptureScreenDirectorFv CaptureScreenDirector.o Screen.a false true
215 captureIfAllow__21CaptureScreenDirectorFPCc CaptureScreenDirector.o Screen.a false true
216 capture__21CaptureScreenDirectorFv CaptureScreenDirector.o Screen.a false true
217 requestCaptureTiming__21CaptureScreenDirectorFPCc CaptureScreenDirector.o Screen.a false true
218 invalidateCaptureTiming__21CaptureScreenDirectorFPCc CaptureScreenDirector.o Screen.a false true
219 getResTIMG__21CaptureScreenDirectorCFv CaptureScreenDirector.o Screen.a false true
220 getTexImage__21CaptureScreenDirectorCFv CaptureScreenDirector.o Screen.a false true
221 getUsingTiming__21CaptureScreenDirectorCFv CaptureScreenDirector.o Screen.a false true
222 getCurrentTiming__21CaptureScreenDirectorCFv CaptureScreenDirector.o Screen.a false true
223 findFromName__21CaptureScreenDirectorCFPCc CaptureScreenDirector.o Screen.a false true
224 __ct__18CaptureScreenActorFUlPCc CaptureScreenDirector.o Screen.a false true
225 draw__18CaptureScreenActorCFv CaptureScreenDirector.o Screen.a false true
226 __dt__21CaptureScreenDirectorFv CaptureScreenDirector.o Screen.a false true
227 __dt__18CaptureScreenActorFv CaptureScreenDirector.o Screen.a false true
228 __ct__16CenterScreenBlurFv CenterScreenBlur.o Screen.a false
229 init__16CenterScreenBlurFRC12JMapInfoIter CenterScreenBlur.o Screen.a false
230 appear__16CenterScreenBlurFv CenterScreenBlur.o Screen.a false

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "Screen",
"message": "2.55348%",
"message": "2.91154%",
"color": "ff4040"
}

View File

@ -1,6 +1,6 @@
{
"schemaVersion": 1,
"label": "decompiled",
"message": "7.120582020095393%",
"message": "7.147069115853009%",
"color": "blue"
}

View File

@ -19,7 +19,7 @@
| [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) | 7.59493670886076% |
| [Screen](https://github.com/shibbo/Petari/blob/master/docs/lib/Screen.md) | 2.553480652875606% |
| [Screen](https://github.com/shibbo/Petari/blob/master/docs/lib/Screen.md) | 2.911542934803915% |
| [Speaker](https://github.com/shibbo/Petari/blob/master/docs/lib/Speaker.md) | 47.06886738759249% |
| [System](https://github.com/shibbo/Petari/blob/master/docs/lib/System.md) | 7.724349605378544% |
| [Util](https://github.com/shibbo/Petari/blob/master/docs/lib/Util.md) | 6.4024270638542715% |

View File

@ -17,7 +17,7 @@
| BrosButton.o | 0.0% | 0 / 21 | 0.0% | :x:
| ButtonPaneController.o | 0.0% | 0 / 55 | 0.0% | :x:
| CameraInfo.o | 0.0% | 0 / 30 | 0.0% | :x:
| CaptureScreenDirector.o | 0.0% | 0 / 14 | 0.0% | :x:
| CaptureScreenDirector.o | 100.0% | 14 / 14 | 100.0% | :white_check_mark:
| CenterScreenBlur.o | 0.0% | 0 / 16 | 0.0% | :x:
| CinemaFrame.o | 0.0% | 0 / 28 | 0.0% | :x:
| CoinCounter.o | 100.0% | 22 / 22 | 100.0% | :white_check_mark:
@ -407,20 +407,20 @@
# CaptureScreenDirector.o
| Symbol | Decompiled? |
| ------------- | ------------- |
| __ct__21CaptureScreenDirectorFv | :x: |
| captureIfAllow__21CaptureScreenDirectorFPCc | :x: |
| capture__21CaptureScreenDirectorFv | :x: |
| requestCaptureTiming__21CaptureScreenDirectorFPCc | :x: |
| invalidateCaptureTiming__21CaptureScreenDirectorFPCc | :x: |
| getResTIMG__21CaptureScreenDirectorCFv | :x: |
| getTexImage__21CaptureScreenDirectorCFv | :x: |
| getUsingTiming__21CaptureScreenDirectorCFv | :x: |
| getCurrentTiming__21CaptureScreenDirectorCFv | :x: |
| findFromName__21CaptureScreenDirectorCFPCc | :x: |
| __ct__18CaptureScreenActorFUlPCc | :x: |
| draw__18CaptureScreenActorCFv | :x: |
| __dt__21CaptureScreenDirectorFv | :x: |
| __dt__18CaptureScreenActorFv | :x: |
| __ct__21CaptureScreenDirectorFv | :white_check_mark: |
| captureIfAllow__21CaptureScreenDirectorFPCc | :white_check_mark: |
| capture__21CaptureScreenDirectorFv | :white_check_mark: |
| requestCaptureTiming__21CaptureScreenDirectorFPCc | :white_check_mark: |
| invalidateCaptureTiming__21CaptureScreenDirectorFPCc | :white_check_mark: |
| getResTIMG__21CaptureScreenDirectorCFv | :white_check_mark: |
| getTexImage__21CaptureScreenDirectorCFv | :white_check_mark: |
| getUsingTiming__21CaptureScreenDirectorCFv | :white_check_mark: |
| getCurrentTiming__21CaptureScreenDirectorCFv | :white_check_mark: |
| findFromName__21CaptureScreenDirectorCFPCc | :white_check_mark: |
| __ct__18CaptureScreenActorFUlPCc | :white_check_mark: |
| draw__18CaptureScreenActorCFv | :white_check_mark: |
| __dt__21CaptureScreenDirectorFv | :white_check_mark: |
| __dt__18CaptureScreenActorFv | :white_check_mark: |
# CenterScreenBlur.o

View File

@ -0,0 +1,54 @@
#pragma once
#include "Game/NameObj/NameObj.h"
#include "JSystem/JUtility/JUTTexture.h"
struct TimingInfo {
const char* name; // _0
s32 timing; // _4
u32 _8;
u32 _C;
};
namespace {
const TimingInfo cTimingInfo[6] = {
{ "GameScreen", 0x20, 0x1000000, 1 },
{ "Indirect", 1, 0, 0 },
{ "Camera", 4, 0x1000000, 1 },
{ "WipeMap", 5, 0x1000000, 1 },
{ "SystemWipe", 0x14, 0, 1 },
{ "Unused", 0x10, 0, 0 }
};
};
class CaptureScreenDirector : public NameObj {
public:
CaptureScreenDirector();
virtual ~CaptureScreenDirector();
void captureIfAllow(const char *);
void capture();
void requestCaptureTiming(const char *);
void invalidateCaptureTiming(const char *);
ResTIMG* getResTIMG() const;
ResTIMG* getTexImage() const;
const TimingInfo* getUsingTiming() const;
const TimingInfo* getCurrentTiming() const;
const TimingInfo* findFromName(const char *) const;
const char* _C;
const char* mTimingType; // _10
JUTTexture* mTexture; // _14
u8 _18;
};
class CaptureScreenActor : public NameObj {
public:
CaptureScreenActor(u32, const char *);
virtual ~CaptureScreenActor();
virtual void draw() const;
const char* mCameraName; // _C
};

View File

@ -21,6 +21,8 @@ namespace MR {
JKRHeap* getAproposHeapForSceneArchive(f32);
JKRHeap* getStationedHeapGDDR3();
void adjustHeapSize(JKRExpHeap *, const char *);
class CurrentHeapRestorer {

View File

@ -45,4 +45,6 @@ namespace MR {
void forceToBlankCinemaFrame();
void requestOneUp();
void captureScreenIfAllow(const char *);
};

View File

@ -55,7 +55,7 @@ public:
GXTexObj mTexObj; // _0
ResTIMG* _20;
u32* _24;
ResTIMG* _24;
JUTPalette* _28;
JUTPalette* mPalette; // _2C
u8 mWrapS; // _30

View File

@ -0,0 +1,31 @@
#pragma once
#include <revolution.h>
#include <revolution/vi.h>
class JUTVideo {
public:
JUTVideo(const _GXRenderModeObj *);
virtual ~JUTVideo();
_GXRenderModeObj* mRenderModeObj; // _4
u32 _8;
u32 mRetraceCount; // _C
u32 _10;
u32 _14;
u32 _18;
VIRetraceCallback mPreRetractCb; // _1C
VIRetraceCallback mPostRetraceCb; // _20
u32 _24;
u32 _28;
u8 _2C;
u8 _2D;
u8 _2E;
u8 _2F;
u32 _30;
OSMessage mMessage; // _34
OSMessageQueue mMessageQueue; // _38
static JUTVideo* sManager;
};

View File

@ -0,0 +1,95 @@
#include "Game/Screen/CaptureScreenDirector.h"
#include "JSystem/JUtility/JUTVideo.h"
#include <string.h>
CaptureScreenDirector::CaptureScreenDirector() : NameObj("画面キャプチャ") {
_C = NULL;
mTimingType = "Indirect";
mTexture = NULL;
_18 = 0;
MR::CurrentHeapRestorer heap_restorer(MR::getStationedHeapGDDR3());
mTexture = new JUTTexture(JUTVideo::sManager->mRenderModeObj->fbWidth, JUTVideo::sManager->mRenderModeObj->efbHeight, GX_TF_RGB565);
}
void CaptureScreenDirector::captureIfAllow(const char *pName) {
const TimingInfo* info = findFromName(pName);
if (getUsingTiming() == info && (!getUsingTiming()->_C || _18)) {
capture();
_18 = 0;
}
}
void CaptureScreenDirector::capture() {
_GXRenderModeObj* renderObj = JUTVideo::sManager->mRenderModeObj;
GXSetCopyFilter(GX_FALSE, renderObj->sample_pattern, GX_FALSE, renderObj->vfilter);
mTexture->capture(0, 0, GX_TF_RGB565, false, 0);
GXSetCopyFilter(GX_FALSE, renderObj->sample_pattern, GX_TRUE, renderObj->vfilter);
}
void CaptureScreenDirector::requestCaptureTiming(const char *pName) {
const TimingInfo* info = findFromName(pName);
if (!getCurrentTiming() || getCurrentTiming()->timing < info->timing) {
_C = pName;
_18 = 1;
}
}
void CaptureScreenDirector::invalidateCaptureTiming(const char *pName) {
const TimingInfo* info = getCurrentTiming();
if (info) {
if (strcmp(info->name, pName) == 0) {
_C = 0;
}
}
}
ResTIMG* CaptureScreenDirector::getResTIMG() const {
return mTexture->_20;
}
ResTIMG* CaptureScreenDirector::getTexImage() const {
return mTexture->_24;
}
const TimingInfo* CaptureScreenDirector::getUsingTiming() const {
if (_C) {
return findFromName(_C);
}
return findFromName(mTimingType);
}
const TimingInfo* CaptureScreenDirector::getCurrentTiming() const {
if (_C) {
return findFromName(_C);
}
return NULL;
}
const TimingInfo* CaptureScreenDirector::findFromName(const char *pName) const {
for (u32 i = 0; i < 6; i++) {
if (strcmp(cTimingInfo[i].name, pName) == 0) {
return &cTimingInfo[i];
}
}
return NULL;
}
CaptureScreenActor::CaptureScreenActor(u32 scene_arg, const char *pCameraName) : NameObj("画面キャプチャ") {
mCameraName = pCameraName;
MR::connectToScene(this, -1, -1, -1, scene_arg);
}
void CaptureScreenActor::draw() const {
MR::captureScreenIfAllow(mCameraName);
}
CaptureScreenDirector::~CaptureScreenDirector() {
}
CaptureScreenActor::~CaptureScreenActor() {
}

View File

@ -1,5 +1,6 @@
#include "Game/Screen/LayoutActor.h"
#include "Game/Screen/PaneEffectKeeper.h"
#include <nw4r/lyt/pane.h>
LayoutActor::LayoutActor(const char *pName, bool) : NameObj(pName),
mManager(NULL), mSpine(NULL), mPaneEffectKeeper(NULL), mStarPointerTargetKeeper(NULL) {
@ -95,4 +96,4 @@ void LayoutActor::updateSpine() {
if (mSpine) {
mSpine->update();
}
}
}