From 0538ac5b8a6d8acb6805437f770792156c1cba26 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 17 Oct 2021 14:41:20 -0400 Subject: [PATCH] Added nvdaControllerClient.dll source code to speech directory. Added game "shooter" which is not enabled yet because of problems with the 64 bit version of the nvdaControllerClient64.dll. --- audiogame-manager.sh | 11 +++++++ speech/nvda-dll/Makefile | 16 ++++++++++ speech/nvda-dll/Makefile.test | 17 +++++++++++ speech/nvda-dll/nvdaControllerClient32.c | 28 ++++++++++++++++++ speech/nvda-dll/nvdaControllerClient32.cpp | 34 ++++++++++++++++++++++ 5 files changed, 106 insertions(+) create mode 100644 speech/nvda-dll/Makefile create mode 100644 speech/nvda-dll/Makefile.test create mode 100644 speech/nvda-dll/nvdaControllerClient32.c create mode 100644 speech/nvda-dll/nvdaControllerClient32.cpp diff --git a/audiogame-manager.sh b/audiogame-manager.sh index fa32af9..c7a8b28 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -908,6 +908,7 @@ gameList=( "Shades of Doom" "Silver Dollar" "Slender Lost Vision" + #"Shooter" "Sonic Zoom" #"Space Defender" "Super Dogs Bone Hunt" @@ -2030,6 +2031,16 @@ EOF unzip -d "$WINEPREFIX/drive_c/Program Files/" "${cache}/slender.zip" add_launcher "c:\Program Files\slender\slender.exe" ;; + "Shooter") + export WINEARCH=win64 + export winVer="win7" + install_wine_bottle + download "http://masonasons.me/softs/Shooter.zip" "https://stormgames.wolfe.casa/downloads/nvdaControllerClient32.dll" "https://stormgames.wolfe.casa/downloads/nvdaControllerClient64.dll" + unzip -d "$WINEPREFIX/drive_c/Program Files/shooter" "${cache}/Shooter.zip" + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient32.dll' -exec cp -v "${cache}/nvdaControllerClient32.dll" "{}" \; + find "${WINEPREFIX}" -type f -name 'nvdaControllerClient64.dll' -exec cp -v "${cache}/nvdaControllerClient64.dll" "{}" \; + add_launcher "c:\Program Files\shooter\shooter.exe" + ;; "Sonic Zoom") export winVer="win7" install_wine_bottle speechsdk diff --git a/speech/nvda-dll/Makefile b/speech/nvda-dll/Makefile new file mode 100644 index 0000000..b14f292 --- /dev/null +++ b/speech/nvda-dll/Makefile @@ -0,0 +1,16 @@ +CXX = i686-w64-mingw32-g++ +DLLTOOL = i686-w64-mingw32-dlltool + +all: nvdaControllerClient32.dll + +nvdaControllerClient32.dll: nvdaControllerClient32.o exports.o + @$(CXX) -shared -o nvdaControllerClient32.dll nvdaControllerClient32.o exports.o + +exports.o: nvdaControllerClient32.o + @$(DLLTOOL) -e exports.o nvdaControllerClient32.o + +nvdaControllerClient32.o: nvdaControllerClient32.cpp + @$(CXX) -c nvdaControllerClient32.cpp + +clean: + @rm -f nvdaControllerClient32.o exports.o diff --git a/speech/nvda-dll/Makefile.test b/speech/nvda-dll/Makefile.test new file mode 100644 index 0000000..fce3472 --- /dev/null +++ b/speech/nvda-dll/Makefile.test @@ -0,0 +1,17 @@ +CXX = i686-w64-mingw32-g++ +DLLTOOL = i686-w64-mingw32-dlltool +CC = i686-w64-mingw32-gcc + +all: nvdaControllerClient32.dll + +nvdaControllerClient32.dll: nvdaControllerClient32.o exports.o + @$(CC) -shared -o nvdaControllerClient32.dll nvdaControllerClient32.o exports.o + +exports.o: nvdaControllerClient32.o + @$(DLLTOOL) -e exports.o nvdaControllerClient32.o + +nvdaControllerClient32.o: nvdaControllerClient32.c + @$(CC) -c nvdaControllerClient32.cpp + +clean: + @rm -f nvdaControllerClient32.o exports.o diff --git a/speech/nvda-dll/nvdaControllerClient32.c b/speech/nvda-dll/nvdaControllerClient32.c new file mode 100644 index 0000000..3f4acd4 --- /dev/null +++ b/speech/nvda-dll/nvdaControllerClient32.c @@ -0,0 +1,28 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif +unsigned long __stdcall __declspec(dllexport) nvdaController_speakText(const wchar_t* text); +unsigned long __stdcall __declspec(dllexport) nvdaController_cancelSpeech(); +unsigned long __stdcall __declspec(dllexport) nvdaController_brailleMessage(const wchar_t* text); +unsigned long __stdcall __declspec(dllexport) nvdaController_testIfRunning(); +#ifdef __cplusplus +} +#endif + +unsigned long __stdcall __declspec(dllexport) nvdaController_speakText(const wchar_t* text) { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_cancelSpeech() { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_brailleMessage(const wchar_t* text) { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_testIfRunning() { + return 420; +} diff --git a/speech/nvda-dll/nvdaControllerClient32.cpp b/speech/nvda-dll/nvdaControllerClient32.cpp new file mode 100644 index 0000000..0949512 --- /dev/null +++ b/speech/nvda-dll/nvdaControllerClient32.cpp @@ -0,0 +1,34 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif +unsigned long __stdcall __declspec(dllexport) nvdaController_speakText(const wchar_t* text); +unsigned long __stdcall __declspec(dllexport) nvdaController_cancelSpeech(); +unsigned long __stdcall __declspec(dllexport) nvdaController_brailleMessage(const wchar_t* text); +unsigned long __stdcall __declspec(dllexport) nvdaController_testIfRunning(); +#ifdef __cplusplus +} +#endif + +asm (".section .drectve"); +asm (".ascii \"-export:nvdaController_speakText\""); +asm (".ascii \"-export:nvdaController_cancelSpeech\""); +asm (".ascii \"-export:nvdaController_brailleMessage\""); +asm (".ascii \"-export:nvdaController_testIfRunning\""); + +unsigned long __stdcall __declspec(dllexport) nvdaController_speakText(const wchar_t* text) { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_cancelSpeech() { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_brailleMessage(const wchar_t* text) { + return 420; +} + +unsigned long __stdcall __declspec(dllexport) nvdaController_testIfRunning() { + return 420; +}