Skip to content

Commit

Permalink
fix: enable loading on any Windows, and linker convention without lea…
Browse files Browse the repository at this point in the history
…d underscore
  • Loading branch information
jpcima committed Dec 29, 2018
1 parent 0bf590e commit 03e55bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/opl/chips/win9x_opl_proxy.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <QSysInfo>
//#include <QSysInfo>
#include <QMessageBox>
#include <cstring>
#include "win9x_opl_proxy.h"
Expand Down Expand Up @@ -46,6 +46,10 @@ template<class FunkPtr>
void initOplFunction(HINSTANCE &chip_lib, FunkPtr &ptr, const char *procName, bool required = true)
{
ptr = (FunkPtr)GetProcAddress(chip_lib, procName);

if(!ptr && procName[0] == '_')
ptr = (FunkPtr)GetProcAddress(chip_lib, procName + 1);

static bool shownWarning = false;
if(!ptr && required && !shownWarning)
{
Expand All @@ -63,10 +67,12 @@ void initOplFunction(HINSTANCE &chip_lib, FunkPtr &ptr, const char *procName, bo
void Win9x_OPL_Proxy::initChip()
{
OPLProxyDriver *chip_r = reinterpret_cast<OPLProxyDriver*>(m_chip);
/*
QSysInfo::WinVersion wver = QSysInfo::windowsVersion();
bool m_enableProxy = (wver == QSysInfo::WV_98) ||
(wver == QSysInfo::WV_Me);
if(m_enableProxy && !chip_r->chip_lib)
*/
if(/*m_enableProxy && */ !chip_r->chip_lib)
{
chip_r->chip_lib = LoadLibraryA("liboplproxy.dll");
if(!chip_r->chip_lib)
Expand Down

0 comments on commit 03e55bb

Please sign in to comment.