From baeb8c562973ea4afd010fa6aecb44006924a1cb Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Sat, 10 Oct 2015 23:19:52 -0400 Subject: [PATCH 1/2] video-gliden64: Update to commit a978fa8. https://github.com/gonetz/GLideN64/commit/a978fa8 * a978fa8 Fix "Error: selected processor does not support ARM mode `rev16 r3,r3'" * 7303ce4 Ask for numBinaryFormats only if GL_NUM_PROGRAM_BINARY_FORMATS defined. * 9cff8d2 Add support for async buffer copy mode in GUI. copyFrameCheckBox replaced by by radio buttons. Tooltip text corrected. * a07835b Add support for async color buffer read in mupen64plus settings. * 2483f03 Add CopyToRDRAM modes to Config: disable, sync, async. copyToRDRAM option can take 'async' value. copyDepthToRDRAM is still sync mode only. * 23de60b Re-implement async color buffer read. * 2b942b8 Update GLideN64.custom.ini : set copyDepthToRDRAM option for games, which need it. * ac963fd cmake: add missing osal lib * aca3a53 Use ARM macro "__arm__" instead of "ARM_ASM" * ae3da6c rpi: add platform specific fullscreen option * c92f5fc rpi: disable framebuffer emulation * 6d2ce67 rpi: fix cmake files * cf9907f cmake: add gcc version check * 2573480 Merge pull request #751 from lioncash/oob |\ | * 1c972fe GlideNUI: Fix an out of bounds access in Settings.cpp * e0007cc Merge pull request #752 from matthewharvey/shader_storage_extra_check * e126a51 Adding check that there is at least one binary format for shader cache support --- .../ini/GLideN64.custom.ini | 18 ++++++ .../src/CMakeLists.txt | 44 ++++++++++--- .../src/Combiner.cpp | 8 ++- jni/mupen64plus-video-gliden64/src/Config.cpp | 10 ++- jni/mupen64plus-video-gliden64/src/Config.h | 6 ++ .../src/FrameBuffer.cpp | 33 ++++++---- .../src/GLideNHQ/CMakeLists.txt | 52 +++++++++++----- .../src/GLideNUI/ConfigDialog.cpp | 19 +++++- .../src/GLideNUI/Settings.cpp | 2 +- .../src/GLideNUI/configDialog.ui | 62 ++++++++++++++++--- jni/mupen64plus-video-gliden64/src/RSP.cpp | 4 +- jni/mupen64plus-video-gliden64/src/Revision.h | 2 +- jni/mupen64plus-video-gliden64/src/gDP.cpp | 4 +- .../src/mupenplus/Config_mupenplus.cpp | 4 +- .../src/mupenplus/OpenGL_mupenplus.cpp | 23 +++++++ 15 files changed, 234 insertions(+), 57 deletions(-) diff --git a/jni/mupen64plus-video-gliden64/ini/GLideN64.custom.ini b/jni/mupen64plus-video-gliden64/ini/GLideN64.custom.ini index e3f2cb3bf4..d6d2a19e42 100644 --- a/jni/mupen64plus-video-gliden64/ini/GLideN64.custom.ini +++ b/jni/mupen64plus-video-gliden64/ini/GLideN64.custom.ini @@ -33,6 +33,14 @@ Good_Name=Bakushou Jinsei 64 - Mezase! Resort Ou (J) Good_Name=Banjo-Kazooie (E)(U) / Banjo To Kazooie No Daibouken (J) frameBufferEmulation\copyToRDRAM=1 +[BANJO%20KAZOOIE%202] +Good_Name=Banjo to Kazooie no Daibouken 2 (J) +frameBufferEmulation\copyToRDRAM=1 + +[BANJO%20TOOIE] +Good_Name=Banjo-Tooie (E)(U) +frameBufferEmulation\copyToRDRAM=1 + [BEETLE%20ADVENTURE%20RAC] Good_Name=Beetle Adventure Racing (E)(U) frameBufferEmulation\copyToRDRAM=1 @@ -54,6 +62,7 @@ frameBufferEmulation\detectCFB=1 [52150A67] Good_Name=Bokujou Monogatari 2 (J) +frameBufferEmulation\N64DepthCompare=1 [476C09C1] Good_Name=Bomberman Hero - Mirian Oujo Wo Sukue! (J) @@ -99,11 +108,13 @@ frameBufferEmulation\copyDepthToRDRAM=1 Good_Name=Donkey Kong 64 (E)(J)(U) frameBufferEmulation\copyToRDRAM=1 frameBufferEmulation\detectCFB=1 +frameBufferEmulation\copyDepthToRDRAM=1 [D%20K%20DISPLAY] Good_Name=Donkey Kong 64 Kiosk Demo (U) frameBufferEmulation\copyToRDRAM=1 frameBufferEmulation\detectCFB=1 +frameBufferEmulation\copyDepthToRDRAM=1 [72390C86] Good_Name=Doraemon - Nobita To 3tsu No Seireiseki (J) @@ -121,6 +132,9 @@ frameBufferEmulation\copyFromRDRAM=1 [67000C2B] Good_Name=Eikou No Saint Andrews (J) +[EXCITEBIKE64] +frameBufferEmulation\copyDepthToRDRAM=1 + [EXTREME_G] Good_Name=Extreme-G (E) frameBufferEmulation\N64DepthCompare=1 @@ -250,6 +264,7 @@ frameBufferEmulation\copyToRDRAM=1 [MICKEY%20USA] Good_Name=Mickey's Speedway USA (U) / Mickey No Racing Challenge USA (J) frameBufferEmulation\copyToRDRAM=1 +frameBufferEmulation\copyDepthToRDRAM=1 [293D0695] Good_Name=Morita Shougi 64 (J) @@ -336,6 +351,9 @@ Good_Name=Super Robot Taisen 64 (J) [622D0C12] Good_Name=Susume! Taisen Puzzle Dama - Toukon! Marutama Chou (J) +[TWISTED%20EDGE] +frameBufferEmulation\copyDepthToRDRAM=1 + [ZELDA%20MAJORA%27S%20MASK] Good_Name=The Legend Of Zelda - Majora's Mask (E)(U) / Zelda No Densetsu - Mujura No Karmen (J) frameBufferEmulation\copyToRDRAM=1 diff --git a/jni/mupen64plus-video-gliden64/src/CMakeLists.txt b/jni/mupen64plus-video-gliden64/src/CMakeLists.txt index 8c4a6d2c0c..f81e7f343b 100644 --- a/jni/mupen64plus-video-gliden64/src/CMakeLists.txt +++ b/jni/mupen64plus-video-gliden64/src/CMakeLists.txt @@ -47,6 +47,28 @@ set(GLideN64_SOURCES common/CommonAPIImpl_common.cpp ) +#check if we're running on Raspberry Pi +MESSAGE("Looking for bcm_host.h") +if(EXISTS "/opt/vc/include/bcm_host.h") + MESSAGE("bcm_host.h found") + set(BCMHOST ON) + set(GLES2 ON) + add_definitions( + -DVC + ) + include_directories( + "/opt/vc/include" + "/opt/vc/include/interface/vcos" + "/opt/vc/include/interface/vmcs_host/linux" + "/opt/vc/include/interface/vcos/pthreads" + ) + link_directories( + "/opt/vc/lib" + ) +else(EXISTS "/opt/vc/include/bcm_host.h") + MESSAGE("bcm_host.h not found") +endif(EXISTS "/opt/vc/include/bcm_host.h") + if(MUPENPLUSAPI) add_definitions( -DMUPENPLUSAPI @@ -128,7 +150,11 @@ if(PANDORA) ) endif(PANDORA) -SET( ENV{FREETYPE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../freetype ) +if(BCMHOST) + SET( FREETYPE_INCLUDE_DIRS "/usr/include/freetype2/" ) +else(BCMHOST) + SET( ENV{FREETYPE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../freetype ) +endif(BCMHOST) FIND_PACKAGE( Freetype REQUIRED ) include_directories( ${FREETYPE_INCLUDE_DIRS} ) @@ -176,10 +202,15 @@ else(GLES2) endif(GLES2) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x -static-libgcc -static-libstdc++") - SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS}" ) - SET(GCC_STATIC_LINK_FLAGS "-static-libgcc -static-libstdc++") - SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_STATIC_LINK_FLAGS}" ) + #check for G++ 4.8+ + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE G++_VERSION) + if (G++_VERSION VERSION_LESS 4.8) + message(SEND_ERROR "You need at least G++ 4.8 to compile GLideN64!") + endif() + SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x -static-libgcc -static-libstdc++") + SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_CPP11_COMPILE_FLAGS}" ) + SET(GCC_STATIC_LINK_FLAGS "-static-libgcc -static-libstdc++") + SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_STATIC_LINK_FLAGS}" ) endif() add_library( ${GLideN64_DLL_NAME} SHARED ${GLideN64_SOURCES}) @@ -212,7 +243,6 @@ if( CMAKE_BUILD_TYPE STREQUAL "Release") if(SDL) target_link_libraries(${GLideN64_DLL_NAME} ${OPENGL_LIBRARIES} ${SDL_LIBRARIES} ${FREETYPE_LIBRARIES} osal GLideNHQ ) else(SDL) - target_link_libraries(${GLideN64_DLL_NAME} PRIVATE ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} osal GLideNHQ ) + target_link_libraries(${GLideN64_DLL_NAME} ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} osal GLideNHQ ) endif(SDL) endif( CMAKE_BUILD_TYPE STREQUAL "Release") - diff --git a/jni/mupen64plus-video-gliden64/src/Combiner.cpp b/jni/mupen64plus-video-gliden64/src/Combiner.cpp index 2eb3795de3..7b71185b22 100644 --- a/jni/mupen64plus-video-gliden64/src/Combiner.cpp +++ b/jni/mupen64plus-video-gliden64/src/Combiner.cpp @@ -97,7 +97,13 @@ void CombinerInfo::init() { m_pCurrent = NULL; m_pUniformCollection = createUniformCollection(); - m_bShaderCacheSupported = config.generalEmulation.enableShadersStorage != 0 && OGLVideo::isExtensionSupported(GET_PROGRAM_BINARY_EXTENSION); + GLint numBinaryFormats = 0; +#ifdef GL_NUM_PROGRAM_BINARY_FORMATS + glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &numBinaryFormats); +#endif + m_bShaderCacheSupported = config.generalEmulation.enableShadersStorage != 0 && + OGLVideo::isExtensionSupported(GET_PROGRAM_BINARY_EXTENSION) && + numBinaryFormats > 0; m_shadersLoaded = 0; if (m_bShaderCacheSupported && !_loadShadersStorage()) { diff --git a/jni/mupen64plus-video-gliden64/src/Config.cpp b/jni/mupen64plus-video-gliden64/src/Config.cpp index dae2274a27..e589527219 100644 --- a/jni/mupen64plus-video-gliden64/src/Config.cpp +++ b/jni/mupen64plus-video-gliden64/src/Config.cpp @@ -12,7 +12,7 @@ void Config::resetToDefaults() { version = CONFIG_VERSION_CURRENT; -#ifdef PANDORA +#if defined(PANDORA) || defined(VC) video.fullscreen = 1; video.fullscreenWidth = video.windowedWidth = 800; #else @@ -42,10 +42,14 @@ void Config::resetToDefaults() generalEmulation.polygonOffsetUnits = 0.0f; #endif +#ifdef VC + frameBufferEmulation.enable = 0; +#else frameBufferEmulation.enable = 1; - frameBufferEmulation.copyDepthToRDRAM = 0; +#endif + frameBufferEmulation.copyDepthToRDRAM = ctDisable; frameBufferEmulation.copyFromRDRAM = 0; - frameBufferEmulation.copyToRDRAM = 1; + frameBufferEmulation.copyToRDRAM = ctSync; frameBufferEmulation.detectCFB = 0; frameBufferEmulation.N64DepthCompare = 0; frameBufferEmulation.aspect = 1; diff --git a/jni/mupen64plus-video-gliden64/src/Config.h b/jni/mupen64plus-video-gliden64/src/Config.h index 924f0b03c3..06ccd5e7db 100644 --- a/jni/mupen64plus-video-gliden64/src/Config.h +++ b/jni/mupen64plus-video-gliden64/src/Config.h @@ -63,6 +63,12 @@ struct Config aTotal = 4 }; + enum CopyToRDRAM { + ctDisable = 0, + ctSync, + ctAsync + }; + struct { u32 enable; u32 copyToRDRAM; diff --git a/jni/mupen64plus-video-gliden64/src/FrameBuffer.cpp b/jni/mupen64plus-video-gliden64/src/FrameBuffer.cpp index ac28f8cf43..9eb1a9198d 100644 --- a/jni/mupen64plus-video-gliden64/src/FrameBuffer.cpp +++ b/jni/mupen64plus-video-gliden64/src/FrameBuffer.cpp @@ -23,8 +23,10 @@ class FrameBufferToRDRAM { public: FrameBufferToRDRAM() : - m_FBO(0), m_PBO(0), m_pTexture(NULL) - {} + m_bSync(true), m_FBO(0), m_pTexture(NULL), m_curIndex(0) + { + m_aPBO[0] = m_aPBO[1] = 0; + } void Init(); void Destroy(); @@ -39,9 +41,11 @@ class FrameBufferToRDRAM u32 raw; }; + bool m_bSync; GLuint m_FBO; - GLuint m_PBO; CachedTexture * m_pTexture; + u32 m_curIndex; + GLuint m_aPBO[2]; }; class DepthBufferToRDRAM @@ -924,10 +928,14 @@ void FrameBufferToRDRAM::Init() glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); // Generate and initialize Pixel Buffer Objects - glGenBuffers(1, &m_PBO); - glBindBuffer(GL_PIXEL_PACK_BUFFER, m_PBO); + glGenBuffers(2, m_aPBO); + glBindBuffer(GL_PIXEL_PACK_BUFFER, m_aPBO[0]); + glBufferData(GL_PIXEL_PACK_BUFFER, m_pTexture->textureBytes, NULL, GL_DYNAMIC_READ); + glBindBuffer(GL_PIXEL_PACK_BUFFER, m_aPBO[1]); glBufferData(GL_PIXEL_PACK_BUFFER, m_pTexture->textureBytes, NULL, GL_DYNAMIC_READ); glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + m_bSync = config.frameBufferEmulation.copyToRDRAM == Config::ctSync; + m_curIndex = 0; } void FrameBufferToRDRAM::Destroy() { @@ -940,10 +948,8 @@ void FrameBufferToRDRAM::Destroy() { textureCache().removeFrameBufferTexture(m_pTexture); m_pTexture = NULL; } - if (m_PBO != 0) { - glDeleteBuffers(1, &m_PBO); - m_PBO = 0; - } + glDeleteBuffers(2, m_aPBO); + m_aPBO[0] = m_aPBO[1] = 0; } void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) @@ -979,14 +985,17 @@ void FrameBufferToRDRAM::CopyToRDRAM(u32 _address) glBindFramebuffer(GL_READ_FRAMEBUFFER, m_FBO); glReadBuffer(GL_COLOR_ATTACHMENT0); #ifndef GLES2 - PBOBinder binder(GL_PIXEL_PACK_BUFFER, m_PBO); + // If Sync, read pixels from the buffer, copy them to RDRAM. + // If not Sync, read pixels from the buffer, copy pixels from the previous buffer to RDRAM. + m_curIndex ^= 1; + const u32 nextIndex = m_bSync ? m_curIndex : m_curIndex^1; + glBindBuffer(GL_PIXEL_PACK_BUFFER, m_aPBO[m_curIndex]); glReadPixels(0, 0, VI.width, VI.height, GL_RGBA, GL_UNSIGNED_BYTE, 0); + PBOBinder binder(GL_PIXEL_PACK_BUFFER, m_aPBO[nextIndex]); GLubyte* pixelData = (GLubyte*)glMapBufferRange(GL_PIXEL_PACK_BUFFER, 0, numPixels * 4, GL_MAP_READ_BIT); if(pixelData == NULL) return; #else - m_curIndex = 0; - const u32 nextIndex = 0; GLubyte* pixelData = (GLubyte* )malloc(numPixels * 4); if(pixelData == NULL) return; diff --git a/jni/mupen64plus-video-gliden64/src/GLideNHQ/CMakeLists.txt b/jni/mupen64plus-video-gliden64/src/GLideNHQ/CMakeLists.txt index 328a131235..ebf0b2dbff 100644 --- a/jni/mupen64plus-video-gliden64/src/GLideNHQ/CMakeLists.txt +++ b/jni/mupen64plus-video-gliden64/src/GLideNHQ/CMakeLists.txt @@ -20,11 +20,11 @@ set(GLideNHQ_SOURCES TxUtil.cpp ) -if(PANDORA) -include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../osal ) -else(PANDORA) -include_directories( inc ${CMAKE_CURRENT_SOURCE_DIR}/../osal ) -endif(PANDORA) +if(PANDORA OR BCMHOST) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../osal ) +else(PANDORA OR BCMHOST) + include_directories( inc ${CMAKE_CURRENT_SOURCE_DIR}/../osal ) +endif(PANDORA OR BCMHOST) LINK_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/lib ) if(UNIX) @@ -90,10 +90,21 @@ if( NOT GHQCHK ) set_target_properties(GLideNHQd PROPERTIES LINK_SEARCH_START_STATIC 1) set_target_properties(GLideNHQd PROPERTIES LINK_SEARCH_END_STATIC 1) - target_link_libraries(GLideNHQd PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a - ) + if(BCMHOST) + FIND_PACKAGE( ZLIB REQUIRED ) + FIND_PACKAGE( PNG REQUIRED ) + target_link_libraries(GLideNHQd + ${PNG_LIBRARIES} + ${ZLIB_LIBRARIES} + osald + ) + else(BCMHOST) + target_link_libraries(GLideNHQd PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a + osald + ) + endif(BCMHOST) endif( CMAKE_BUILD_TYPE STREQUAL "Debug") if( CMAKE_BUILD_TYPE STREQUAL "Release") @@ -106,14 +117,24 @@ if( NOT GHQCHK ) if(PANDORA) target_link_libraries(GLideNHQ PRIVATE - /mnt/utmp/codeblocks/usr/lib/libpng.a - /mnt/utmp/codeblocks/usr/lib/libz.a - ) + /mnt/utmp/codeblocks/usr/lib/libpng.a + /mnt/utmp/codeblocks/usr/lib/libz.a + osal + ) + elseif(BCMHOST) + FIND_PACKAGE( ZLIB REQUIRED ) + FIND_PACKAGE( PNG REQUIRED ) + target_link_libraries(GLideNHQ + ${PNG_LIBRARIES} + ${ZLIB_LIBRARIES} + osal + ) else(PANDORA) target_link_libraries(GLideNHQ PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a - ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a - ) + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libpng.a + ${CMAKE_CURRENT_SOURCE_DIR}/lib/libz.a + osal + ) endif(PANDORA) endif( CMAKE_BUILD_TYPE STREQUAL "Release") else( NOT GHQCHK ) @@ -137,3 +158,4 @@ else( NOT GHQCHK ) target_link_libraries(ghqchk ${OPENGL_LIBRARIES} png z ) endif( CMAKE_BUILD_TYPE STREQUAL "Release") endif( NOT GHQCHK ) + diff --git a/jni/mupen64plus-video-gliden64/src/GLideNUI/ConfigDialog.cpp b/jni/mupen64plus-video-gliden64/src/GLideNUI/ConfigDialog.cpp index 7e175e04e5..6177f0b590 100644 --- a/jni/mupen64plus-video-gliden64/src/GLideNUI/ConfigDialog.cpp +++ b/jni/mupen64plus-video-gliden64/src/GLideNUI/ConfigDialog.cpp @@ -115,7 +115,17 @@ void ConfigDialog::_init() ui->customSettingsCheckBox->setChecked(config.generalEmulation.enableCustomSettings != 0); ui->frameBufferGroupBox->setChecked(config.frameBufferEmulation.enable != 0); - ui->copyFrameCheckBox->setChecked(config.frameBufferEmulation.copyToRDRAM != 0); + switch (config.frameBufferEmulation.copyToRDRAM) { + case Config::ctDisable: + ui->copyBufferDisableRadioButton->setChecked(true); + break; + case Config::ctSync: + ui->copyBufferSyncRadioButton->setChecked(true); + break; + case Config::ctAsync: + ui->copyBufferAsyncRadioButton->setChecked(true); + break; + } ui->RenderFBCheckBox->setChecked(config.frameBufferEmulation.copyFromRDRAM != 0); ui->detectCPUWritesCheckBox->setChecked(config.frameBufferEmulation.detectCFB != 0); ui->CopyDepthCheckBox->setChecked(config.frameBufferEmulation.copyDepthToRDRAM != 0); @@ -285,7 +295,12 @@ void ConfigDialog::accept() config.generalEmulation.enableCustomSettings = ui->customSettingsCheckBox->isChecked() ? 1 : 0; config.frameBufferEmulation.enable = ui->frameBufferGroupBox->isChecked() ? 1 : 0; - config.frameBufferEmulation.copyToRDRAM = ui->copyFrameCheckBox->isChecked() ? 1 : 0; + if (ui->copyBufferDisableRadioButton->isChecked()) + config.frameBufferEmulation.copyToRDRAM = Config::ctDisable; + else if (ui->copyBufferSyncRadioButton->isChecked()) + config.frameBufferEmulation.copyToRDRAM = Config::ctSync; + else if (ui->copyBufferAsyncRadioButton->isChecked()) + config.frameBufferEmulation.copyToRDRAM = Config::ctAsync; config.frameBufferEmulation.copyFromRDRAM = ui->RenderFBCheckBox->isChecked() ? 1 : 0; config.frameBufferEmulation.detectCFB = ui->detectCPUWritesCheckBox->isChecked() ? 1 : 0; config.frameBufferEmulation.copyDepthToRDRAM = ui->CopyDepthCheckBox->isChecked() ? 1 : 0; diff --git a/jni/mupen64plus-video-gliden64/src/GLideNUI/Settings.cpp b/jni/mupen64plus-video-gliden64/src/GLideNUI/Settings.cpp index 4d6dbe01fd..6d307a2427 100644 --- a/jni/mupen64plus-video-gliden64/src/GLideNUI/Settings.cpp +++ b/jni/mupen64plus-video-gliden64/src/GLideNUI/Settings.cpp @@ -78,7 +78,7 @@ void _loadSettings(QSettings & settings) config.font.color[0] = fontColor.red(); config.font.color[1] = fontColor.green(); config.font.color[2] = fontColor.blue(); - config.font.color[4] = fontColor.alpha(); + config.font.color[3] = fontColor.alpha(); config.font.colorf[0] = _FIXED2FLOAT(config.font.color[0], 8); config.font.colorf[1] = _FIXED2FLOAT(config.font.color[1], 8); config.font.colorf[2] = _FIXED2FLOAT(config.font.color[2], 8); diff --git a/jni/mupen64plus-video-gliden64/src/GLideNUI/configDialog.ui b/jni/mupen64plus-video-gliden64/src/GLideNUI/configDialog.ui index adbca75a74..9b839ddc22 100644 --- a/jni/mupen64plus-video-gliden64/src/GLideNUI/configDialog.ui +++ b/jni/mupen64plus-video-gliden64/src/GLideNUI/configDialog.ui @@ -641,14 +641,57 @@ - - - <html><head/><body><p><span style=" font-weight:600;">Copy frame buffer to RDRAM:</span></p><p>In some games plugin can't detect frame buffer usage. In such cases you need to enable this option to see frame buffer effects. Every drawn frame will be read from video card and copied into RDRAM area.</p><p>[Recommended: <span style=" font-style:italic;">mostly off (needed only for a few games)</span>]</p></body></html> - - - Copy frame buffer to RDRAM - - + + + + + <html><head/><body><p><span style=" font-weight:600;">Copy color buffer to RDRAM:</span></p><p>In some games plugin can't detect frame buffer usage. In such cases you need to enable this option to see frame buffer effects. Every drawn frame will be read from video card and copied into RDRAM area.</p><p>* disable - do not copy buffer</p><p>* sync - copy buffer in sync mode. Can be slow, but works for all games</p><p>* async - copy buffer in async mode. Can be up to 10 times faster than sync mode, but is incompatible with some games.</p><p>[Recommended: <span style=" font-style:italic;">mostly async (sync needed only for a few games)</span>]</p></body></html> + + + Copy frame buffer to RDRAM + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Copy color buffer to RDRAM:</span></p><p>In some games plugin can't detect frame buffer usage. In such cases you need to enable this option to see frame buffer effects. Every drawn frame will be read from video card and copied into RDRAM area.</p><p>* disable - do not copy buffer</p><p>* sync - copy buffer in sync mode. Can be slow, but works for all games</p><p>* async - copy buffer in async mode. Can be up to 10 times faster than sync mode, but is incompatible with some games.</p><p>[Recommended: <span style=" font-style:italic;">mostly async (sync needed only for a few games)</span>]</p></body></html> + + + disable + + + copyFrameBufferButtonGroup + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Copy color buffer to RDRAM:</span></p><p>In some games plugin can't detect frame buffer usage. In such cases you need to enable this option to see frame buffer effects. Every drawn frame will be read from video card and copied into RDRAM area.</p><p>* disable - do not copy buffer</p><p>* sync - copy buffer in sync mode. Can be slow, but works for all games</p><p>* async - copy buffer in async mode. Can be up to 10 times faster than sync mode, but is incompatible with some games.</p><p>[Recommended: <span style=" font-style:italic;">mostly async (sync needed only for a few games)</span>]</p></body></html> + + + sync + + + copyFrameBufferButtonGroup + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Copy color buffer to RDRAM:</span></p><p>In some games plugin can't detect frame buffer usage. In such cases you need to enable this option to see frame buffer effects. Every drawn frame will be read from video card and copied into RDRAM area.</p><p>* disable - do not copy buffer</p><p>* sync - copy buffer in sync mode. Can be slow, but works for all games</p><p>* async - copy buffer in async mode. Can be up to 10 times faster than sync mode, but is incompatible with some games.</p><p>[Recommended: <span style=" font-style:italic;">mostly async (sync needed only for a few games)</span>]</p></body></html> + + + async + + + copyFrameBufferButtonGroup + + + + @@ -1344,8 +1387,9 @@ + - + diff --git a/jni/mupen64plus-video-gliden64/src/RSP.cpp b/jni/mupen64plus-video-gliden64/src/RSP.cpp index 797b536951..0b594af0f5 100644 --- a/jni/mupen64plus-video-gliden64/src/RSP.cpp +++ b/jni/mupen64plus-video-gliden64/src/RSP.cpp @@ -209,9 +209,9 @@ void RSP_ProcessDList() } } - if (config.frameBufferEmulation.copyToRDRAM) + if (config.frameBufferEmulation.copyToRDRAM != Config::ctDisable) FrameBuffer_CopyToRDRAM(gDP.colorImage.address); - if (config.frameBufferEmulation.copyDepthToRDRAM) + if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable) FrameBuffer_CopyDepthBuffer(gDP.colorImage.address); RSP.busy = FALSE; diff --git a/jni/mupen64plus-video-gliden64/src/Revision.h b/jni/mupen64plus-video-gliden64/src/Revision.h index 8934822be0..3f7be43dea 100644 --- a/jni/mupen64plus-video-gliden64/src/Revision.h +++ b/jni/mupen64plus-video-gliden64/src/Revision.h @@ -1 +1 @@ -#define PLUGIN_REVISION "a12c9e7" +#define PLUGIN_REVISION "a978fa8" diff --git a/jni/mupen64plus-video-gliden64/src/gDP.cpp b/jni/mupen64plus-video-gliden64/src/gDP.cpp index 0b1ff9c96f..8597fe5d7f 100644 --- a/jni/mupen64plus-video-gliden64/src/gDP.cpp +++ b/jni/mupen64plus-video-gliden64/src/gDP.cpp @@ -883,9 +883,9 @@ void gDPTextureRectangleFlip( f32 ulx, f32 uly, f32 lrx, f32 lry, s32 tile, f32 void gDPFullSync() { if (RSP.bLLE) { - if (config.frameBufferEmulation.copyToRDRAM) + if (config.frameBufferEmulation.copyToRDRAM != Config::ctDisable) FrameBuffer_CopyToRDRAM(gDP.colorImage.address); - if (config.frameBufferEmulation.copyDepthToRDRAM) + if (config.frameBufferEmulation.copyDepthToRDRAM != Config::ctDisable) FrameBuffer_CopyDepthBuffer(gDP.colorImage.address); } diff --git a/jni/mupen64plus-video-gliden64/src/mupenplus/Config_mupenplus.cpp b/jni/mupen64plus-video-gliden64/src/mupenplus/Config_mupenplus.cpp index 9da269ba06..ef5ec8e33d 100644 --- a/jni/mupen64plus-video-gliden64/src/mupenplus/Config_mupenplus.cpp +++ b/jni/mupen64plus-video-gliden64/src/mupenplus/Config_mupenplus.cpp @@ -79,7 +79,7 @@ bool Config_SetDefault() //#Frame Buffer Settings:" res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFBEmulation", config.frameBufferEmulation.enable, "Enable frame and|or depth buffer emulation."); assert(res == M64ERR_SUCCESS); - res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableCopyColorToRDRAM", config.frameBufferEmulation.copyToRDRAM, "Enable color buffer copy to RDRAM."); + res = ConfigSetDefaultInt(g_configVideoGliden64, "EnableCopyColorToRDRAM", config.frameBufferEmulation.copyToRDRAM, "Enable color buffer copy to RDRAM (0=do not copy, 1=copy in sync mode, 2=copy in async mode)"); assert(res == M64ERR_SUCCESS); res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableCopyDepthToRDRAM", config.frameBufferEmulation.copyDepthToRDRAM, "Enable depth buffer copy to RDRAM."); assert(res == M64ERR_SUCCESS); @@ -189,7 +189,7 @@ void Config_LoadConfig() #endif //#Frame Buffer Settings:" config.frameBufferEmulation.enable = ConfigGetParamBool(g_configVideoGliden64, "EnableFBEmulation"); - config.frameBufferEmulation.copyToRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyColorToRDRAM"); + config.frameBufferEmulation.copyToRDRAM = ConfigGetParamInt(g_configVideoGliden64, "EnableCopyColorToRDRAM"); config.frameBufferEmulation.copyDepthToRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyDepthToRDRAM"); config.frameBufferEmulation.copyFromRDRAM = ConfigGetParamBool(g_configVideoGliden64, "EnableCopyColorFromRDRAM"); config.frameBufferEmulation.detectCFB = ConfigGetParamBool(g_configVideoGliden64, "EnableDetectCFB"); diff --git a/jni/mupen64plus-video-gliden64/src/mupenplus/OpenGL_mupenplus.cpp b/jni/mupen64plus-video-gliden64/src/mupenplus/OpenGL_mupenplus.cpp index bdc7ab8fcc..ce3809154a 100644 --- a/jni/mupen64plus-video-gliden64/src/mupenplus/OpenGL_mupenplus.cpp +++ b/jni/mupen64plus-video-gliden64/src/mupenplus/OpenGL_mupenplus.cpp @@ -8,6 +8,10 @@ #include "../Revision.h" #include "../Log.h" +#ifdef VC +#include +#endif + #if !defined(OS_WINDOWS) || defined(GLES2) || defined(GLES3) || defined(GLES3_1) void initGLFunctions() @@ -22,6 +26,7 @@ class OGLVideoMupenPlus : public OGLVideo private: void _setAttributes(); + void _getDisplaySize(); virtual bool _start(); virtual void _stop(); @@ -80,6 +85,7 @@ bool OGLVideoMupenPlus::_start() m_bFullscreen = config.video.fullscreen > 0; m_screenWidth = config.video.windowedWidth; m_screenHeight = config.video.windowedHeight; + _getDisplaySize(); _setBufferSize(); printf("(II) Setting video mode %dx%d...\n", m_screenWidth, m_screenHeight); @@ -150,3 +156,20 @@ void OGLVideoMupenPlus::_changeWindow() { CoreVideo_ToggleFullScreen(); } + +void OGLVideoMupenPlus::_getDisplaySize() +{ +#ifdef VC + if( m_bFullscreen ) { + // Use VC get_display_size function to get the current screen resolution + u32 fb_width; + u32 fb_height; + if (graphics_get_display_size(0 /* LCD */, &fb_width, &fb_height) < 0) + printf("ERROR: Failed to get display size\n"); + else { + m_screenWidth = fb_width; + m_screenHeight = fb_height; + } + } +#endif +} From ea4fb15add29442330899a70c5182f718c7b0b5a Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Sat, 10 Oct 2015 23:35:55 -0400 Subject: [PATCH 2/2] Make compatible with latest GLideN64 --- res/xml/profile_emulation.xml | 5 +++-- .../android/mupen64plusae/jni/NativeConfigFiles.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/res/xml/profile_emulation.xml b/res/xml/profile_emulation.xml index 9af9b3eb38..a73009be49 100644 --- a/res/xml/profile_emulation.xml +++ b/res/xml/profile_emulation.xml @@ -188,9 +188,10 @@ android:defaultValue="true" android:key="EnableFBEmulation" android:title="EnableFBEmulation" /> -