diff --git a/Source/Project64-video/Gfx_1.3.h b/Source/Project64-video/Gfx_1.3.h index 28a7efb97..a85c8fe7b 100644 --- a/Source/Project64-video/Gfx_1.3.h +++ b/Source/Project64-video/Gfx_1.3.h @@ -61,8 +61,6 @@ extern "C" { //******** extern unsigned int BMASK; -#define WMASK 0x3FFFFF -#define DMASK 0x1FFFFF extern uint32_t update_screen_count; diff --git a/Source/Project64-video/Main.cpp b/Source/Project64-video/Main.cpp index f1fccf19a..76fd963fa 100644 --- a/Source/Project64-video/Main.cpp +++ b/Source/Project64-video/Main.cpp @@ -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(); diff --git a/Source/Project64-video/Settings.cpp b/Source/Project64-video/Settings.cpp index 9be2b80ef..076367d89 100644 --- a/Source/Project64-video/Settings.cpp +++ b/Source/Project64-video/Settings.cpp @@ -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(); } diff --git a/Source/Project64-video/Settings.h b/Source/Project64-video/Settings.h index 568b2177f..fb11f6e44 100644 --- a/Source/Project64-video/Settings.h +++ b/Source/Project64-video/Settings.h @@ -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;