Skip to content

Commit

Permalink
DisablePostProcessing ini toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
InvoxiPlayGames committed Oct 3, 2022
1 parent ccd75f6 commit 45fa660
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ typedef struct _RB3E_Config
// [Graphics]
int RenderResX;
int RenderResY;
char DisablePostProcessing;
// [Events]
char BroadcastTarget[RB3E_MAX_DOMAIN];
char EnableEvents;
Expand Down
2 changes: 2 additions & 0 deletions include/ports.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#define PORT_BUILDINSTRUMENTSELECTION 0x82668c70 // BuildInstrumentSelectionList(?) - actual name not known
#define PORT_PREPARESOMEVECTORMAYBE 0x82796d90 // Prepares some vector, used by BuildInstrumentSelectionList
#define PORT_SOMEVECTORPUSHBACKMAYBE 0x82b6aa10 // vector<class_Key<class_Vector2>,class_stlpmtx_std::StlNodeAlloc<class_Key<class_Vector2>_>_>::push_back
#define PORT_POSTPROC_DOPOST 0x82b89a08 // NgPostProc::DoPost
// instance addresses
#define PORT_MODIFIERMGR_POINTER 0x82dfec08 // pointer to ModifierManager
#define PORT_ROCKCENTRALGATEWAY 0x82cc8f60 // address of RockCentralGateway
Expand Down Expand Up @@ -182,6 +183,7 @@ void DbgPrint(const char *s, ...);
#define PORT_BUILDINSTRUMENTSELECTION 0x802478a8 // BuildInstrumentSelectionList(?) - actual name not known
#define PORT_PREPARESOMEVECTORMAYBE 0x80247c58 // Prepares some vector, used by BuildInstrumentSelectionList
#define PORT_SOMEVECTORPUSHBACKMAYBE 0x802484a8 // vector<class_Key<class_Vector2>,class_stlpmtx_std::StlNodeAlloc<class_Key<class_Vector2>_>_>::push_back
#define PORT_POSTPROC_DOPOST 0x806b52b4 // WiiPostProc::DoPost
// instance addresses
#define PORT_MODIFIERMGR_POINTER 0x808fda68 // pointer to ModifierManager
#define PORT_ROCKCENTRALGATEWAY 0x80900870 // address of RockCentralGateway
Expand Down
18 changes: 11 additions & 7 deletions source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ static int INIHandler(void *user, const char *section, const char *name, const c
config.LegacySDMode = RB3E_CONFIG_BOOL(value);
}
#elif RB3E_XBOX
if (strcmp(section, "Graphics") == 0)
{
if (strcmp(name, "RenderResX") == 0)
config.RenderResX = atoi(value);
if (strcmp(name, "RenderResY") == 0)
config.RenderResY = atoi(value);
}
if (strcmp(section, "Xbox360") == 0)
{
if (strcmp(name, "EnableLiveless") == 0)
Expand All @@ -97,6 +90,17 @@ static int INIHandler(void *user, const char *section, const char *name, const c
config.STUNServerPort = atoi(value);
}
#endif
if (strcmp(section, "Graphics") == 0)
{
#ifdef RB3E_XBOX
if (strcmp(name, "RenderResX") == 0)
config.RenderResX = atoi(value);
if (strcmp(name, "RenderResY") == 0)
config.RenderResY = atoi(value);
#endif
if (strcmp(name, "DisablePostProcessing") == 0)
config.DisablePostProcessing = RB3E_CONFIG_BOOL(value);
}
return 1;
}

Expand Down
7 changes: 6 additions & 1 deletion source/rb3enhanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ static unsigned int framecount = 0;
void RB3E_RunLoop()
{
framecount++;
// TODO(Emma): do stuff here
}

#ifdef RB3E_XBOX
Expand Down Expand Up @@ -208,6 +207,12 @@ void ApplyConfigurablePatches()
POKE_32(PORT_FACE_PAINT_CHECK, LI(3, 1));
POKE_32(PORT_VIDEO_VENUE_CHECK, LI(3, 1));
}
if (config.DisablePostProcessing == 1)
{
// Disables post processing effects
// Should improve framerate on emulators and maybe Wii
POKE_32(PORT_POSTPROC_DOPOST, BLR);
}
}

void InitialiseFunctions()
Expand Down

0 comments on commit 45fa660

Please sign in to comment.