Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed ezusb/ezusb-popn15.dll
Binary file not shown.
Binary file modified ezusb/ezusb.dll
Binary file not shown.
4 changes: 1 addition & 3 deletions ezusb/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 8 additions & 14 deletions ezusb/src/ezusb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand All @@ -362,11 +361,6 @@ __declspec(dllexport) int __cdecl usbWdtStartDone() {
return 0;
}

#ifdef POPN15_FORMAT
}
#endif


BOOL APIENTRY DllMain( HMODULE hModule,
DWORD fdwReason,
LPVOID lpReserved
Expand Down
10 changes: 0 additions & 10 deletions ezusb/src/ezusb.h
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -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