[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; extern unsigned int BMASK;
#define WMASK 0x3FFFFF
#define DMASK 0x1FFFFF
extern uint32_t update_screen_count; extern uint32_t update_screen_count;

View File

@ -896,27 +896,6 @@ void CALL RomClosed(void)
ReleaseGfx(); 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 Function: RomOpen
Purpose: This function is called when a rom is open. (from the Purpose: This function is called when a rom is open. (from the
@ -973,7 +952,7 @@ void CALL RomOpen(void)
g_settings->ReadGameSettings(name); g_settings->ReadGameSettings(name);
ClearCache(); ClearCache();
CheckDRAMSize(); BMASK = g_settings->RdramSize() - 1;
// ** EVOODOO EXTENSIONS ** // ** EVOODOO EXTENSIONS **
evoodoo = 1; evoodoo = 1;
InitGfx(); InitGfx();

View File

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

View File

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