Skip to content

Commit

Permalink
3rdParty: update mupen64plus-video-GLideN64
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Oct 20, 2024
1 parent f6b73b8 commit e68483f
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 46 deletions.
1 change: 1 addition & 0 deletions Source/3rdParty/mupen64plus-video-GLideN64/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ src/Revision.h
/projects/cmake/mupen64plus-video-GLideN64_autogen/
.vs
/translations/wtl
.DS_Store
4 changes: 2 additions & 2 deletions Source/3rdParty/mupen64plus-video-GLideN64/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[subrepo]
remote = [email protected]:/gonetz/GLideN64.git
branch = master
commit = f4b0755e2722d59fe1c20d7e470f7b8929dcae85
parent = 1b45907ab26a5e8532bfc3c41d70c4611fb61028
commit = a1320da566c03503ea755447458bb2b79a610cb5
parent = f6b73b86c6625fa5a268b74b1e36114a5bdd535c
method = merge
cmdver = 0.4.6
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ generalEmulation\enableLegacyBlending=0
Good_Name=Bio F.R.E.A.K.S. (E)(U)
frameBufferEmulation\copyToRDRAM=1

[BioHazard%20II]
[BIOHAZARD%20II]
Good_Name=Biohazard 2 (J)
frameBufferEmulation\copyFromRDRAM=1
frameBufferEmulation\copyToRDRAM=0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLideN64", "GLideN64.vcxproj", "{37D31D7F-C4E7-45B0-AEF6-D6824A243CF7}"
ProjectSection(ProjectDependencies) = postProject
{37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE} = {37CAB375-A7A6-3CAB-BD56-0E954D3FD2FE}
{7BF6F100-31DB-44AE-A2A5-5DDEED9A909C} = {7BF6F100-31DB-44AE-A2A5-5DDEED9A909C}
{9E05B70F-A294-44A9-A151-B2CC95AA884E} = {9E05B70F-A294-44A9-A151-B2CC95AA884E}
{DA965BCF-2219-47AF-ACE7-EAF76D5D4756} = {DA965BCF-2219-47AF-ACE7-EAF76D5D4756}
EndProjectSection
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ else(EGL)
endif(NOT OPENGL_FOUND)
endif(EGL)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
#check for compiler version
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE G++_VERSION)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND G++_VERSION VERSION_LESS 4.8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions( -D__MSC__)
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x -Wno-unused-result")
if ( NOT MINGW )
SET ( PIC_FLAGS "-fPIC" )
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ Q_IMPORT_PLUGIN(QICOPlugin)

//#define RUN_DIALOG_IN_THREAD

static
int openConfigDialog(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy, bool & _accepted)
static int openConfigDialog(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy, bool & _accepted)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
Expand All @@ -40,22 +39,22 @@ int openConfigDialog(const wchar_t * _strFileName, const char * _romName, unsign
return 0;
}

bool runConfigThread(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
bool runConfigThread(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
{
bool accepted = false;
#ifdef RUN_DIALOG_IN_THREAD
std::thread configThread(openConfigDialog, _strFileName, _maxMSAALevel, std::ref(accepted));
configThread.join();
#else
openConfigDialog(_strFileName, _romName, _maxMSAALevel, _maxAnisotropy, accepted);
openConfigDialog(_strFileName, _strSharedFileName, _romName, _maxMSAALevel, _maxAnisotropy, accepted);
#endif
return accepted;

}

EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy)
{
return runConfigThread(_strFileName, _romName, _maxMSAALevel, _maxAnisotropy);
return runConfigThread(_strFileName, _strSharedFileName, _romName, _maxMSAALevel, _maxAnisotropy);
}

EXPORT int CALL RunAbout(const wchar_t * _strFileName)
Expand All @@ -73,7 +72,7 @@ EXPORT int CALL RunAbout(const wchar_t * _strFileName)
return 0;
}

EXPORT void CALL LoadConfig(const wchar_t * _strFileName)
EXPORT void CALL LoadConfig(const wchar_t * _strFileName, const wchar_t * _strSharedFileName)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
Expand All @@ -84,7 +83,7 @@ EXPORT void CALL LoadConfig(const wchar_t * _strFileName)
loadSettings(IniFolder.c_str());
}

EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const char * _romName)
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName)
{
std::string IniFolder;
uint32_t slength = WideCharToMultiByte(CP_ACP, 0, _strFileName, -1, NULL, 0, NULL, NULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ extern "C" {
#define CALL
#endif

EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy);
EXPORT int CALL RunAbout(const wchar_t * _strFileName);
EXPORT void CALL LoadConfig(const wchar_t * _strFileName);
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const char * _romName);
EXPORT bool CALL RunConfig(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName, unsigned int _maxMSAALevel, unsigned int _maxAnisotropy);
EXPORT int CALL RunAbout(const wchar_t * _strFileName);
EXPORT void CALL LoadConfig(const wchar_t * _strFileName, const wchar_t * _strSharedFileName);
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const wchar_t * _strSharedFileName, const char * _romName);

#if defined(__cplusplus)
}
Expand Down
56 changes: 28 additions & 28 deletions Source/3rdParty/mupen64plus-video-GLideN64/src/Textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,39 @@ u32 GetCI4IA_RGBA4444(u16 offset, u16 x, u16 i, u8 palette)
const u8 color4B = Get4BitPaletteColor(offset, x, i);

if (x & 1)
return IA88_RGBA4444(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF]);
return IA88_RGBA4444(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF] & 0xFFFF));
else
return IA88_RGBA4444(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF]);
return IA88_RGBA4444(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF] & 0xFFFF));
}

u32 GetCI4IA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color4B = Get4BitPaletteColor(offset, x, i);

if (x & 1)
return IA88_RGBA8888(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF]);
return IA88_RGBA8888(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF] & 0xFFFF));
else
return IA88_RGBA8888(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF]);
return IA88_RGBA8888(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF] & 0xFFFF));
}

u32 GetCI4RGBA_RGBA5551(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color4B = Get4BitPaletteColor(offset, x, i);

if (x & 1)
return RGBA5551_RGBA5551(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF] & 0xFFFF));
else
return RGBA5551_RGBA5551(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF] & 0xFFFF));
}

u32 GetCI4RGBA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color4B = Get4BitPaletteColor(offset, x, i);

if (x & 1)
return RGBA5551_RGBA8888(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B & 0x0F)) & 0x1FF] & 0xFFFF));
else
return RGBA5551_RGBA8888(*(u16*)&TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[(0x100 + (palette << 4) + (color4B >> 4)) & 0x1FF] & 0xFFFF));
}

u32 GetIA31_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
Expand Down Expand Up @@ -120,25 +120,25 @@ inline u8 Get8BitPaletteColor(u16 offset, u16 x, u16 i)
u32 GetCI8IA_RGBA4444(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color = Get8BitPaletteColor(offset, x, i);
return IA88_RGBA4444(*(u16*)&TMEM[(0x100 + color) & 0x1FF]);
return IA88_RGBA4444(static_cast<u16>(TMEM[(0x100 + color) & 0x1FF] & 0xFFFF));
}

u32 GetCI8IA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color = Get8BitPaletteColor(offset, x, i);
return IA88_RGBA8888(*(u16*)&TMEM[(0x100 + color) & 0x1FF]);
return IA88_RGBA8888(static_cast<u16>(TMEM[(0x100 + color) & 0x1FF] & 0xFFFF));
}

u32 GetCI8RGBA_RGBA5551(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color = Get8BitPaletteColor(offset, x, i);
return RGBA5551_RGBA5551(*(u16*)&TMEM[(0x100 + color) & 0x1FF]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[(0x100 + color) & 0x1FF] & 0xFFFF));
}

u32 GetCI8RGBA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
{
const u8 color = Get8BitPaletteColor(offset, x, i);
return RGBA5551_RGBA8888(*(u16*)&TMEM[(0x100 + color) & 0x1FF]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[(0x100 + color) & 0x1FF] & 0xFFFF));
}

u32 GetIA44_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
Expand Down Expand Up @@ -193,7 +193,7 @@ u32 GetI16_RGBA4444(u16 offset, u16 x, u16 i, u8 palette)
u32 GetCI16IA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
{
const u16 tex = Get16BitColor(offset, x, i);
const u16 col = (*(u16*)&TMEM[0x100 + (tex & 0xFF)]);
const u16 col = (static_cast<u16>(TMEM[0x100 + (tex & 0xFF)] & 0xFFFF));
const u16 c = col >> 8;
const u16 a = col & 0xFF;
return (a << 24) | (c << 16) | (c << 8) | c;
Expand All @@ -202,7 +202,7 @@ u32 GetCI16IA_RGBA8888(u16 offset, u16 x, u16 i, u8 palette)
u32 GetCI16IA_RGBA4444(u16 offset, u16 x, u16 i, u8 palette)
{
const u16 tex = Get16BitColor(offset, x, i);
const u16 col = (*(u16*)&TMEM[0x100 + (tex & 0xFF)]);
const u16 col = (static_cast<u16>(TMEM[0x100 + (tex & 0xFF)] & 0xFFFF));
const u16 c = col >> 12;
const u16 a = col & 0x0F;
return (a << 12) | (c << 8) | (c << 4) | c;
Expand Down Expand Up @@ -303,39 +303,39 @@ u32 GetCI4IA_RGBA4444_BG(u64 *src, u16 x, u16 i, u8 palette)
u8 color4B = ((u8*)src)[(x >> 1) ^ (i << 1)];

if (x & 1)
return IA88_RGBA4444(*(u16*)&TMEM[256 + (palette << 4) + (color4B & 0x0F)]);
return IA88_RGBA4444(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B & 0x0F)] & 0xFFFF));
else
return IA88_RGBA4444(*(u16*)&TMEM[256 + (palette << 4) + (color4B >> 4)]);
return IA88_RGBA4444(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B >> 4)] & 0xFFFF));
}

u32 GetCI4IA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
{
u8 color4B = ((u8*)src)[(x >> 1) ^ (i << 1)];

if (x & 1)
return IA88_RGBA8888(*(u16*)&TMEM[256 + (palette << 4) + (color4B & 0x0F)]);
return IA88_RGBA8888(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B & 0x0F)] & 0xFFFF));
else
return IA88_RGBA8888(*(u16*)&TMEM[256 + (palette << 4) + (color4B >> 4)]);
return IA88_RGBA8888(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B >> 4)] & 0xFFFF));
}

u32 GetCI4RGBA_RGBA5551_BG(u64 *src, u16 x, u16 i, u8 palette)
{
u8 color4B = ((u8*)src)[(x >> 1) ^ (i << 1)];

if (x & 1)
return RGBA5551_RGBA5551(*(u16*)&TMEM[256 + (palette << 4) + (color4B & 0x0F)]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B & 0x0F)] & 0xFFFF));
else
return RGBA5551_RGBA5551(*(u16*)&TMEM[256 + (palette << 4) + (color4B >> 4)]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B >> 4)] & 0xFFFF));
}

u32 GetCI4RGBA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
{
u8 color4B = ((u8*)src)[(x >> 1) ^ (i << 1)];

if (x & 1)
return RGBA5551_RGBA8888(*(u16*)&TMEM[256 + (palette << 4) + (color4B & 0x0F)]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B & 0x0F)] & 0xFFFF));
else
return RGBA5551_RGBA8888(*(u16*)&TMEM[256 + (palette << 4) + (color4B >> 4)]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[256 + (palette << 4) + (color4B >> 4)] & 0xFFFF));
}

u32 GetIA31_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
Expand Down Expand Up @@ -368,22 +368,22 @@ u32 GetI4_RGBA4444_BG(u64 *src, u16 x, u16 i, u8 palette)

u32 GetCI8IA_RGBA4444_BG(u64 *src, u16 x, u16 i, u8 palette)
{
return IA88_RGBA4444(*(u16*)&TMEM[256 + ((u8*)src)[x ^ (i << 1)]]);
return IA88_RGBA4444(static_cast<u16>(TMEM[256 + ((u8*)src)[x ^ (i << 1)]] & 0xFFFF));
}

u32 GetCI8IA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
{
return IA88_RGBA8888(*(u16*)&TMEM[256 + ((u8*)src)[x ^ (i << 1)]]);
return IA88_RGBA8888(static_cast<u16>(TMEM[256 + ((u8*)src)[x ^ (i << 1)]] & 0xFFFF));
}

u32 GetCI8RGBA_RGBA5551_BG(u64 *src, u16 x, u16 i, u8 palette)
{
return RGBA5551_RGBA5551(*(u16*)&TMEM[256 + ((u8*)src)[x ^ (i << 1)]]);
return RGBA5551_RGBA5551(static_cast<u16>(TMEM[256 + ((u8*)src)[x ^ (i << 1)]] & 0xFFFF));
}

u32 GetCI8RGBA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
{
return RGBA5551_RGBA8888(*(u16*)&TMEM[256 + ((u8*)src)[x ^ (i << 1)]]);
return RGBA5551_RGBA8888(static_cast<u16>(TMEM[256 + ((u8*)src)[x ^ (i << 1)]] & 0xFFFF));
}

u32 GetIA44_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
Expand Down Expand Up @@ -429,7 +429,7 @@ u32 GetI16_RGBA4444_BG(u64 *src, u16 x, u16 i, u8 palette)
u32 GetCI16IA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
{
const u16 tex = ((u16*)src)[x^i];
const u16 col = (*(u16*)&TMEM[256 + (tex & 0xFF)]);
const u16 col = (static_cast<u16>(TMEM[256 + (tex & 0xFF)] & 0xFFFF));
const u16 c = col >> 8;
const u16 a = col & 0xFF;
return (a << 24) | (c << 16) | (c << 8) | c;
Expand All @@ -438,7 +438,7 @@ u32 GetCI16IA_RGBA8888_BG(u64 *src, u16 x, u16 i, u8 palette)
u32 GetCI16IA_RGBA4444_BG(u64 *src, u16 x, u16 i, u8 palette)
{
const u16 tex = ((u16*)src)[x^i];
const u16 col = (*(u16*)&TMEM[256 + (tex & 0xFF)]);
const u16 col = (static_cast<u16>(TMEM[256 + (tex & 0xFF)] & 0xFFFF));
const u16 c = col >> 12;
const u16 a = col & 0x0F;
return (a << 12) | (c << 8) | (c << 4) | c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ void Config_LoadCustomConfig()
ROMname.replace(pos, 1, "%20");
for (size_t pos = ROMname.find('\''); pos != std::string::npos; pos = ROMname.find('\'', pos))
ROMname.replace(pos, 1, "%27");
for (size_t pos = ROMname.find('&'); pos != std::string::npos; pos = ROMname.find('&', pos))
ROMname.replace(pos, 1, "%26");
std::transform(ROMname.begin(), ROMname.end(), ROMname.begin(), ::toupper);
const char* sectionName = ROMname.c_str();
m64p_handle fileHandle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions( -D__MSC__)
endif()

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(GCC_CPP11_COMPILE_FLAGS "-std=c++0x")
if (NOT MINGW)
SET( PIC_FLAGS "-fPIC")
Expand Down

0 comments on commit e68483f

Please sign in to comment.