diff --git a/OpenRGB.pro b/OpenRGB.pro index 02fd9fd6..5a8b2903 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -208,11 +208,21 @@ win32:HEADERS += \ RGBController/RGBController_AorusGPU.h \ RGBController/RGBController_OpenRazerWindows.h \ -win32:LIBS += \ - -lws2_32 \ - -L"$$PWD/dependencies/inpout32_1501/Win32/" -linpout32 \ - -L"$$PWD/dependencies/libusb-1.0.22/MS32/dll" -llibusb-1.0 \ - -L"$$PWD/dependencies/hidapi-win/x86/" -lhidapi +win32:contains(QMAKE_TARGET.arch, x86_64) { + LIBS += \ + -lws2_32 \ + -L"$$PWD/dependencies/inpout32_1501/x64/" -linpoutx64 \ + -L"$$PWD/dependencies/libusb-1.0.22/MS64/dll" -llibusb-1.0 \ + -L"$$PWD/dependencies/hidapi-win/x64/" -lhidapi +} + +win32:contains(QMAKE_TARGET.arch, x86) { + LIBS += \ + -lws2_32 \ + -L"$$PWD/dependencies/inpout32_1501/Win32/" -linpout32 \ + -L"$$PWD/dependencies/libusb-1.0.22/MS32/dll" -llibusb-1.0 \ + -L"$$PWD/dependencies/hidapi-win/x86/" -lhidapi +} win32:DEFINES -= \ UNICODE @@ -225,8 +235,15 @@ win32:DEFINES += \ WIN32_LEAN_AND_MEAN # Copy OpenRazer.dll to output directory -win32 -{ +win32:contains(QMAKE_TARGET.arch, x86_64) { + copydata.commands = $(COPY_FILE) \"$$shell_path($$PWD\\dependencies\\openrazer-win32\\OpenRazer64.dll)\" \"$$shell_path($$OUT_PWD)\" + first.depends = $(first) copydata + export(first.depends) + export(copydata.commands) + QMAKE_EXTRA_TARGETS += first copydata +} + +win32:contains(QMAKE_TARGET.arch, x86) { copydata.commands = $(COPY_FILE) \"$$shell_path($$PWD\\dependencies\\openrazer-win32\\OpenRazer.dll)\" \"$$shell_path($$OUT_PWD)\" first.depends = $(first) copydata export(first.depends) diff --git a/dependencies/inpout32_1501/x64/inpout32.h b/dependencies/inpout32_1501/x64/inpout32.h new file mode 100644 index 00000000..65df0969 --- /dev/null +++ b/dependencies/inpout32_1501/x64/inpout32.h @@ -0,0 +1,32 @@ +#pragma once + +//Functions exported from DLL. +//For easy inclusion is user projects. +//Original InpOut32 function support +void _stdcall Out32(short PortAddress, short data); +short _stdcall Inp32(short PortAddress); + +//My extra functions for making life easy +BOOL _stdcall IsInpOutDriverOpen(); //Returns TRUE if the InpOut driver was opened successfully +BOOL _stdcall IsXP64Bit(); //Returns TRUE if the OS is 64bit (x64) Windows. + +//DLLPortIO function support +UCHAR _stdcall DlPortReadPortUchar (USHORT port); +void _stdcall DlPortWritePortUchar(USHORT port, UCHAR Value); + +USHORT _stdcall DlPortReadPortUshort (USHORT port); +void _stdcall DlPortWritePortUshort(USHORT port, USHORT Value); + +ULONG _stdcall DlPortReadPortUlong(ULONG port); +void _stdcall DlPortWritePortUlong(ULONG port, ULONG Value); + +//WinIO function support (Untested and probably does NOT work - esp. on x64!) +PBYTE _stdcall MapPhysToLin(PBYTE pbPhysAddr, DWORD dwPhysSize, HANDLE *pPhysicalMemoryHandle); +BOOL _stdcall UnmapPhysicalMemory(HANDLE PhysicalMemoryHandle, PBYTE pbLinAddr); +BOOL _stdcall GetPhysLong(PBYTE pbPhysAddr, PDWORD pdwPhysVal); +BOOL _stdcall SetPhysLong(PBYTE pbPhysAddr, DWORD dwPhysVal); + + + + + diff --git a/dependencies/inpout32_1501/x64/inpoutx64.dll b/dependencies/inpout32_1501/x64/inpoutx64.dll new file mode 100644 index 00000000..82c343fe Binary files /dev/null and b/dependencies/inpout32_1501/x64/inpoutx64.dll differ diff --git a/dependencies/inpout32_1501/x64/inpoutx64.lib b/dependencies/inpout32_1501/x64/inpoutx64.lib new file mode 100644 index 00000000..b3d0dbb7 Binary files /dev/null and b/dependencies/inpout32_1501/x64/inpoutx64.lib differ diff --git a/dependencies/openrazer-win32/OpenRazer64.dll b/dependencies/openrazer-win32/OpenRazer64.dll new file mode 100644 index 00000000..ccd1779d Binary files /dev/null and b/dependencies/openrazer-win32/OpenRazer64.dll differ diff --git a/i2c_smbus/i2c_smbus_i801.cpp b/i2c_smbus/i2c_smbus_i801.cpp index d3c47a0e..708fccf2 100644 --- a/i2c_smbus/i2c_smbus_i801.cpp +++ b/i2c_smbus/i2c_smbus_i801.cpp @@ -12,8 +12,6 @@ #include #include "inpout32.h" -#pragma comment(lib, "inpout32.lib") - /* Return negative errno on error. */ s32 i2c_smbus_i801::i801_access(u16 addr, char read_write, u8 command, int size, i2c_smbus_data *data) { @@ -480,4 +478,4 @@ int i2c_smbus_i801::i801_wait_intr() s32 i2c_smbus_i801::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data) { return i801_access(addr, read_write, command, size, data); -} \ No newline at end of file +} diff --git a/i2c_smbus/i2c_smbus_nct6775.cpp b/i2c_smbus/i2c_smbus_nct6775.cpp index 5dd22ffe..8bc036a0 100644 --- a/i2c_smbus/i2c_smbus_nct6775.cpp +++ b/i2c_smbus/i2c_smbus_nct6775.cpp @@ -10,8 +10,6 @@ #include #include "inpout32.h" -#pragma comment(lib, "inpout32.lib") - s32 i2c_smbus_nct6775::nct6775_access(u16 addr, char read_write, u8 command, int size, i2c_smbus_data *data) { int i, len, status, cnt; @@ -157,4 +155,4 @@ s32 i2c_smbus_nct6775::nct6775_access(u16 addr, char read_write, u8 command, int s32 i2c_smbus_nct6775::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data) { return nct6775_access(addr, read_write, command, size, data); -} \ No newline at end of file +} diff --git a/i2c_smbus/i2c_smbus_piix4.cpp b/i2c_smbus/i2c_smbus_piix4.cpp index 7a6edd62..fde9c7a7 100644 --- a/i2c_smbus/i2c_smbus_piix4.cpp +++ b/i2c_smbus/i2c_smbus_piix4.cpp @@ -12,8 +12,6 @@ #include #include "inpout32.h" -#pragma comment(lib, "inpout32.lib") - //Logic adapted from piix4_transaction() in i2c-piix4.c int i2c_smbus_piix4::piix4_transaction() { @@ -169,4 +167,4 @@ s32 i2c_smbus_piix4::piix4_access(u16 addr, char read_write, u8 command, int siz s32 i2c_smbus_piix4::i2c_smbus_xfer(u8 addr, char read_write, u8 command, int size, i2c_smbus_data* data) { return piix4_access(addr, read_write, command, size, data); -} \ No newline at end of file +} diff --git a/super_io/super_io.cpp b/super_io/super_io.cpp index 0a5c8232..bfe46ca0 100644 --- a/super_io/super_io.cpp +++ b/super_io/super_io.cpp @@ -12,7 +12,6 @@ #include #include "inpout32.h" -#pragma comment(lib, "inpout32.lib") #else #include #include @@ -91,4 +90,4 @@ int superio_inb(int ioreg, int reg) close(dev_port_fd); return((int)temp); #endif -} \ No newline at end of file +}