Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/System/Resolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,31 @@

#include <dolphin/types.h>

#ifdef VERSION_GMSP01
u16 SMSGetGCLogoVideoHeight(u32 format);
#else
u16 SMSGetGCLogoVideoHeight();
#endif
u16 SMSGetGCLogoVideoWidth();
u16 SMSGetGCLogoRenderHeight();
u16 SMSGetGCLogoRenderWidth();
u16 SMSGetTitleRenderHeight();
u16 SMSGetTitleRenderWidth();
u16 SMSGetGameRenderHeight();
u16 SMSGetGameRenderWidth();
#ifdef VERSION_GMSP01
u16 SMSGetTitleVideoHeight(u32 format);
#else
u16 SMSGetTitleVideoHeight();
#endif
u16 SMSGetTitleVideoWidth();
s32 SMSGetDisplayHeightMax();
s32 SMSGetDisplayWidthMax();
#ifdef VERSION_GMSP01
u16 SMSGetGameVideoHeight(u32 format);
#else
u16 SMSGetGameVideoHeight();
#endif
u16 SMSGetGameVideoWidth();

#endif
8 changes: 8 additions & 0 deletions src/System/MarDirectorSetupObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#include <JSystem/JKernel/JKRDvdFile.hpp>
#include <JSystem/JKernel/JKRDvdRipper.hpp>
#include <System/Resolution.hpp>
#ifdef VERSION_GMSP01
#include <dolphin/vi.h>
#endif
#include <System/EventWatcher.hpp>
#include <System/EmitterViewObj.hpp>
#include <System/RenderModeObj.hpp>
Expand Down Expand Up @@ -305,8 +308,13 @@ bool TMarDirector::setupObjects()

JDrama::TLookAtCamera* cam
= JDrama::TNameRefGen::search<JDrama::TLookAtCamera>("camera 1");
#ifdef VERSION_GMSP01
cam->mAspect = (u16)SMSGetGameVideoWidth() * 0.9134614f
/ (u16)SMSGetGameVideoHeight(VIGetTvFormat());
#else
cam->mAspect = (u16)SMSGetGameVideoWidth() * 0.9134614f
/ (u16)SMSGetGameVideoHeight();
#endif
}

unk80 = new JDrama::TViewObjPtrListT<JDrama::TViewObj>("イベントグループ");
Expand Down
51 changes: 51 additions & 0 deletions src/System/RenderModeObj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,23 @@ JDrama::TRect SMSGetRederRect_Game()

void SMSSetupGCLogoRenderMode(GXRenderModeObj* rmo)
{
#ifdef VERSION_GMSP01
u32 format = VIGetTvFormat();
rmo->viTVmode = (VITVMode)VI_TVMODE(format, VI_INTERLACE);
#else
rmo->viTVmode = (VITVMode)VI_TVMODE(VIGetTvFormat(), VI_INTERLACE);
#endif
rmo->fbWidth = SMSGetGCLogoRenderWidth();
rmo->efbHeight = SMSGetGCLogoRenderHeight();
rmo->viWidth = SMSGetGCLogoVideoWidth();
rmo->xFBmode = VI_XFBMODE_DF;
rmo->field_rendering = 0;
rmo->aa = 0;
#ifdef VERSION_GMSP01
JDrama::CalcRenderModeXFBHeight(rmo, SMSGetGCLogoVideoHeight(format));
#else
JDrama::CalcRenderModeXFBHeight(rmo, SMSGetGCLogoVideoHeight());
#endif
JDrama::CalcRenderModeVIXOrigin(rmo);
JDrama::CalcRenderModeVIYOrigin(rmo);
JDrama::CopyRenderModeSamplePattern(rmo, SMSAASamplePattern_non);
Expand All @@ -46,17 +55,31 @@ void SMSSetupGCLogoRenderingInfo(JDrama::TDisplay* param_1)

void SMSSetupTitleRenderMode(GXRenderModeObj* rmo)
{
#ifdef VERSION_GMSP01
u32 format = VIGetTvFormat();
bool noFilter = format == 0 && OSGetProgressiveMode() == 1;
#else
bool noFilter = VIGetTvFormat() == 0 && OSGetProgressiveMode() == 1;
#endif

#ifdef VERSION_GMSP01
rmo->viTVmode
= (VITVMode)VI_TVMODE(format, noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#else
rmo->viTVmode = (VITVMode)VI_TVMODE(
VIGetTvFormat(), noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#endif
rmo->fbWidth = SMSGetTitleRenderWidth();
rmo->efbHeight = SMSGetTitleRenderHeight();
rmo->viWidth = SMSGetTitleVideoWidth();
rmo->xFBmode = noFilter ? VI_XFBMODE_SF : VI_XFBMODE_DF;
rmo->field_rendering = 0;
rmo->aa = 0;
#ifdef VERSION_GMSP01
JDrama::CalcRenderModeXFBHeight(rmo, SMSGetTitleVideoHeight(format));
#else
JDrama::CalcRenderModeXFBHeight(rmo, SMSGetTitleVideoHeight());
#endif
JDrama::CalcRenderModeVIXOrigin(rmo);
JDrama::CalcRenderModeVIYOrigin(rmo);
JDrama::CopyRenderModeSamplePattern(rmo, SMSAASamplePattern_non);
Expand All @@ -74,10 +97,20 @@ void SMSSetupGameRenderingInfo(JDrama::TDisplay* param_1, bool param_2)
{
GXRenderModeObj& rmo = param_1->getRenderMode();

#ifdef VERSION_GMSP01
u32 format = VIGetTvFormat();
bool noFilter = format == 0 && OSGetProgressiveMode() == 1;
#else
bool noFilter = VIGetTvFormat() == 0 && OSGetProgressiveMode() == 1;
#endif

#ifdef VERSION_GMSP01
rmo.viTVmode
= (VITVMode)VI_TVMODE(format, noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#else
rmo.viTVmode = (VITVMode)VI_TVMODE(
VIGetTvFormat(), noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#endif

param_1->onFlag(0x8);
if (param_2) {
Expand All @@ -91,7 +124,11 @@ void SMSSetupGameRenderingInfo(JDrama::TDisplay* param_1, bool param_2)
rmo.efbHeight = SMSGetGameRenderHeight();
rmo.viWidth = SMSGetGameVideoWidth();

#ifdef VERSION_GMSP01
JDrama::CalcRenderModeXFBHeight(&rmo, SMSGetGameVideoHeight(format));
#else
JDrama::CalcRenderModeXFBHeight(&rmo, SMSGetGameVideoHeight());
#endif
JDrama::CalcRenderModeVIXOrigin(&rmo);
JDrama::CalcRenderModeVIYOrigin(&rmo);
if (param_2 || noFilter) {
Expand All @@ -108,17 +145,31 @@ void SMSSetupMovieRenderingInfo(JDrama::TDisplay* param_1)
{
GXRenderModeObj& rmo = param_1->getRenderMode();

#ifdef VERSION_GMSP01
u32 format = VIGetTvFormat();
bool noFilter = format == 0 && OSGetProgressiveMode() == 1;
#else
bool noFilter = VIGetTvFormat() == 0 && OSGetProgressiveMode() == 1;
#endif

#ifdef VERSION_GMSP01
rmo.viTVmode
= (VITVMode)VI_TVMODE(format, noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#else
rmo.viTVmode = (VITVMode)VI_TVMODE(
VIGetTvFormat(), noFilter ? VI_PROGRESSIVE : VI_INTERLACE);
#endif
rmo.fbWidth = SMSGetGameRenderWidth();
rmo.efbHeight = SMSGetGameRenderHeight();
rmo.viWidth = SMSGetGameVideoWidth();
rmo.xFBmode = noFilter ? VI_XFBMODE_SF : VI_XFBMODE_DF;
rmo.field_rendering = 0;
rmo.aa = 0;
#ifdef VERSION_GMSP01
JDrama::CalcRenderModeXFBHeight(&rmo, SMSGetGameVideoHeight(format));
#else
JDrama::CalcRenderModeXFBHeight(&rmo, SMSGetGameVideoHeight());
#endif
JDrama::CalcRenderModeVIXOrigin(&rmo);
JDrama::CalcRenderModeVIYOrigin(&rmo);
JDrama::CopyRenderModeSamplePattern(&rmo, SMSAASamplePattern_non);
Expand Down
31 changes: 31 additions & 0 deletions src/System/Resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@

u16 SMSGetGameVideoWidth() { return 660; }

#ifdef VERSION_GMSP01
u16 SMSGetGameVideoHeight(u32 format)
{
u16 ret = 448;
switch (format) {
case VI_MPAL:
case VI_NTSC:
case VI_EURGB60:
ret = 448;
break;
case VI_PAL:
ret = 530;
break;
default:
break;
}
return ret;
}
#else
u16 SMSGetGameVideoHeight()
{
u16 ret = 448;
Expand All @@ -20,6 +39,7 @@ u16 SMSGetGameVideoHeight()
}
return ret;
}
#endif

// UNUSED
s32 SMSGetDisplayWidthMax() { return 720; }
Expand All @@ -29,7 +49,11 @@ s32 SMSGetDisplayHeightMax() { return 574; }

u16 SMSGetTitleVideoWidth() { return 660; }

#ifdef VERSION_GMSP01
u16 SMSGetTitleVideoHeight(u32 format) { return SMSGetGameVideoHeight(format); }
#else
u16 SMSGetTitleVideoHeight() { return SMSGetGameVideoHeight(); }
#endif

u16 SMSGetGameRenderWidth() { return 640; }

Expand All @@ -45,4 +69,11 @@ u16 SMSGetGCLogoRenderHeight() { return 448; }

u16 SMSGetGCLogoVideoWidth() { return 640; }

#ifdef VERSION_GMSP01
u16 SMSGetGCLogoVideoHeight(u32 format)
{
return SMSGetTitleVideoHeight(format);
}
#else
u16 SMSGetGCLogoVideoHeight() { return SMSGetTitleVideoHeight(); }
#endif