[Video] Get rdram size from settings

This commit is contained in:
zilmar 2017-08-16 18:03:13 +10:00
parent 0ea0717c87
commit 90dcbd4f3f
4 changed files with 8 additions and 24 deletions

View File

@ -61,8 +61,6 @@ extern "C" {
//********
extern unsigned int BMASK;
#define WMASK 0x3FFFFF
#define DMASK 0x1FFFFF
extern uint32_t update_screen_count;

View File

@ -896,27 +896,6 @@ void CALL RomClosed(void)
ReleaseGfx();
}
static void CheckDRAMSize()
{
uint32_t test;
GLIDE64_TRY
{
test = gfx.RDRAM[0x007FFFFF] + 1;
}
GLIDE64_CATCH
{
test = 0;
}
if (test)
BMASK = 0x7FFFFF;
else
BMASK = WMASK;
#ifdef LOGGING
sprintf(out_buf, "Detected RDRAM size: %08lx", BMASK);
LOG(out_buf);
#endif
}
/******************************************************************
Function: RomOpen
Purpose: This function is called when a rom is open. (from the
@ -973,7 +952,7 @@ void CALL RomOpen(void)
g_settings->ReadGameSettings(name);
ClearCache();
CheckDRAMSize();
BMASK = g_settings->RdramSize() - 1;
// ** EVOODOO EXTENSIONS **
evoodoo = 1;
InitGfx();

View File

@ -19,6 +19,7 @@
CSettings::CSettings() :
m_Set_basic_mode(0),
m_Set_debugger(0),
m_Set_RDRamSize(0),
m_Set_texture_dir(0),
m_Set_log_dir(0),
m_Set_log_flush(0),
@ -90,6 +91,7 @@ CSettings::CSettings() :
#ifndef ANDROID
m_FullScreenRes(0),
#endif
m_RdramSize(0),
m_wrpVRAM(0),
m_wrpFBO(false),
m_wrpAnisotropic(false),
@ -125,6 +127,7 @@ void CSettings::RegisterSettings(void)
SetModuleName("default");
m_Set_basic_mode = FindSystemSettingId("Basic Mode");
m_Set_debugger = FindSystemSettingId("Debugger");
m_Set_RDRamSize = FindSystemSettingId("RDRamSize");
m_Set_texture_dir = FindSystemSettingId("Dir:Texture");
m_Set_log_flush = FindSystemSettingId("Log Auto Flush");
m_Set_log_dir = FindSystemSettingId("Dir:Log");
@ -763,6 +766,7 @@ void CSettings::ReadGameSettings(const char * name)
m_zmode_compare_less = GetSetting(Set_zmode_compare_less);
m_old_style_adither = GetSetting(Set_old_style_adither);
m_n64_z_scale = GetSetting(Set_n64_z_scale) != 0;
m_RdramSize = GetSystemSetting(m_Set_RDRamSize);
m_ScreenRes = GetSetting(Set_Resolution);
if (m_ScreenRes >= GetScreenResolutionCount()) { m_ScreenRes = GetDefaultScreenRes(); }

View File

@ -266,6 +266,7 @@ public:
#ifndef ANDROID
inline uint32_t FullScreenRes(void) const { return m_FullScreenRes; }
#endif
inline uint32_t RdramSize(void) const { return m_RdramSize; }
inline int wrpVRAM(void) const { return m_wrpVRAM; }
inline bool wrpFBO(void) const { return m_wrpFBO; }
inline bool wrpAnisotropic(void) const { return m_wrpAnisotropic; }
@ -330,6 +331,7 @@ private:
short m_Set_basic_mode;
short m_Set_debugger;
short m_Set_RDRamSize;
short m_Set_texture_dir;
short m_Set_log_dir;
short m_Set_log_flush;
@ -338,6 +340,7 @@ private:
#ifndef ANDROID
uint32_t m_FullScreenRes;
#endif
uint32_t m_RdramSize;
int m_wrpVRAM;
bool m_wrpFBO;
bool m_wrpAnisotropic;