diff --git a/ezusb/ezusb-popn15.dll b/ezusb/ezusb-popn15.dll deleted file mode 100644 index dab1b16..0000000 Binary files a/ezusb/ezusb-popn15.dll and /dev/null differ diff --git a/ezusb/ezusb.dll b/ezusb/ezusb.dll index 8bbc8cf..713fbb9 100644 Binary files a/ezusb/ezusb.dll and b/ezusb/ezusb.dll differ diff --git a/ezusb/readme.md b/ezusb/readme.md index 64fe77d..94c8032 100644 --- a/ezusb/readme.md +++ b/ezusb/readme.md @@ -8,9 +8,7 @@ For ease of use I included pre-compiled dll working on WinXP Embedded (for offic Replace the game ezusb.dll file with this one and the game will read input and send lights to your Arduino as if it were the original IOBoard. -Pop'n Music Adventure used a different dll format so you have to set a flag in `ezusb.h` for the dll to compile in a way that will work with this game. - -The dll makes the lights turn on for 1 sec on load so you'll know if the game managed to load your device. +The dll makes the lights turn on in a wave pattern during the game's i/o check, so you'll know if it managed to load your device. ## How to retrieve devicepath diff --git a/ezusb/src/ezusb.cpp b/ezusb/src/ezusb.cpp index 0483f7f..58e20fa 100644 --- a/ezusb/src/ezusb.cpp +++ b/ezusb/src/ezusb.cpp @@ -229,10 +229,6 @@ static int controller_write_leds(int32_t lamp_bits){ /* EZUSB EXPORTS */ -#ifdef POPN15_FORMAT -extern "C" { -#endif - __declspec(dllexport) int __cdecl usbCheckAlive() { return 1; } @@ -337,11 +333,14 @@ __declspec(dllexport) int __cdecl usbStart(int i) { #ifdef FORCE_DIP4 g_dip_state |= 0x08; #endif - /* light everything for 1 sec to get visual confirmation - * the device is working */ - controller_write_leds((uint32_t) 0xFFFFFFFF); - Sleep(1000); - controller_write_leds((uint32_t) 0x00000000); + /* light up each part of the cab in a wave pattern to get visual confirmation the device is working */ + for (int i = 0; i<32; i++){ + if ((i > 4 && i < 8) || (i > 11 && i < 23)) { // unused bits + continue; + } + controller_write_leds((uint32_t) 1 << i); + Sleep(300); + } #ifdef DEBUG printf("Managed to open device %x\n",g_hid_handle); @@ -362,11 +361,6 @@ __declspec(dllexport) int __cdecl usbWdtStartDone() { return 0; } -#ifdef POPN15_FORMAT -} -#endif - - BOOL APIENTRY DllMain( HMODULE hModule, DWORD fdwReason, LPVOID lpReserved diff --git a/ezusb/src/ezusb.h b/ezusb/src/ezusb.h index 0cc071a..650f55a 100644 --- a/ezusb/src/ezusb.h +++ b/ezusb/src/ezusb.h @@ -1,13 +1,6 @@ #ifndef EZUSB_UPC_EZUSB_H #define EZUSB_UPC_EZUSB_H -/* Pop'n Music Adventure ezusb.dll was compiled in C and thus used unmangled function names - * set this POPN15_FORMAT to 1 to compile a compatible version */ -#define POPN15_FORMAT 0 - -#if POPN15_FORMAT == 1 -extern "C" { -#endif __declspec(dllexport) int __cdecl usbCheckAlive(); __declspec(dllexport) int __cdecl usbCheckSecurityNew(int i); __declspec(dllexport) int __cdecl usbCoinGet(int i); @@ -30,8 +23,5 @@ __declspec(dllexport) int __cdecl usbStart(int i); __declspec(dllexport) int __cdecl usbWdtReset(); __declspec(dllexport) int __cdecl usbWdtStart(int i); __declspec(dllexport) int __cdecl usbWdtStartDone(); -#if POPN15_FORMAT == 1 -} -#endif #endif //EZUSB_UPC_EZUSB_H \ No newline at end of file