Skip to content

Commit

Permalink
PAD: windows merge relatively complete, linker issues left
Browse files Browse the repository at this point in the history
  • Loading branch information
GovanifY authored and lightningterror committed Dec 17, 2020
1 parent ce7fbe6 commit 2b4e73e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 24 deletions.
36 changes: 17 additions & 19 deletions pcsx2/PAD/Windows/PAD.cpp
Expand Up @@ -782,42 +782,40 @@ struct QueryInfo
u8 response[42];
} query = {0, 0, 0, 0, 0, 0xFF, {0xF3}};

s32 PADinit(u32 flags)
s32 PADinit()
{
const u32 flags = 3;
// Note: Won't load settings if already loaded.
if (LoadSettings() < 0) {
return -1;
}
int port = (flags & 3);
if (port == 3) {
if (PADinit(1) == -1)
return -1;
return PADinit(2);
}

#if defined(PCSX2_DEBUG) && defined(_MSC_VER)
int tmpFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
tmpFlag |= _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(tmpFlag);
#endif
for (int i = 2; i > 0; i--)
{
port = i;
port--;

port--;

for (int slot = 0; slot < 4; slot++)
ResetPad(port, slot);
slots[port] = 0;
portInitialized[port] = 1;
for (int slot = 0; slot < 4; slot++)
ResetPad(port, slot);
slots[port] = 0;
portInitialized[port] = 1;

query.lastByte = 1;
query.numBytes = 0;
ClearKeyQueue();
query.lastByte = 1;
query.numBytes = 0;
ClearKeyQueue();
#ifdef __linux__
R_ClearKeyQueue();
R_ClearKeyQueue();
#endif
// Just in case, when resuming emulation.
ReleaseModifierKeys();
// Just in case, when resuming emulation.
ReleaseModifierKeys();
}

DEBUG_TEXT_OUT("LilyPad initialized\n\n");
return 0;
}

Expand Down
5 changes: 1 addition & 4 deletions pcsx2/PAD/Windows/PAD.h
Expand Up @@ -26,9 +26,6 @@
#include <assert.h>
#include "PS2Edefs.h"

#include <windows.h>
#include <windowsx.h>

#include <array>
#include <vector>
#include <map>
Expand All @@ -50,7 +47,7 @@ typedef struct

void PADupdate(int pad);
void PADshutdown();
s32 PADinit(u32 flags);
s32 PADinit();
s32 PADopen(void* pDsp);
void PADclose();
u8 PADstartPoll(int pad);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/PAD/Windows/PADConfig.cpp
Expand Up @@ -304,7 +304,7 @@ wchar_t *GetCommandStringW(u8 command, int port, int slot)

static wchar_t iniFile[MAX_PATH * 2] = L"inis/LilyPad.ini";

void CALLBACK PADsetSettingsDir(const char *dir)
void PADsetSettingsDir(const char *dir)
{
//swprintf_s( iniFile, L"%S", (dir==NULL) ? "inis" : dir );

Expand Down

0 comments on commit 2b4e73e

Please sign in to comment.