Skip to content

Commit

Permalink
kaillera fix attempt #2
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkc64 committed Nov 12, 2021
1 parent 5951aa5 commit 0d0aecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/burner/win32/fba_kaillera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const int MAXPLAYER = 4;
static int nPlayerInputs[MAXPLAYER], nCommonInputs, nDIPInputs;
static int nPlayerOffset[MAXPLAYER], nCommonOffset, nDIPOffset;

const int INPUTSIZE = 8 * (4 + 8);
const int INPUTSIZE = 8 * (4 + 8 + 0x40); // + 0x40 ZX Spectrum keyboard
static unsigned char nControls[INPUTSIZE];

// Inputs are assumed to be in the following order:
Expand Down Expand Up @@ -55,7 +55,7 @@ int KailleraInitInput()
nDIPOffset = i;
nDIPInputs = nGameInpCount - nDIPOffset;

#if 0 && defined FBNEO_DEBUG
#if 1 && defined FBNEO_DEBUG
dprintf(_T(" * Kaillera inputs configured as follows --\n"));
for (int j = 0; j < MAXPLAYER; j++) {
dprintf(_T(" p%d offset %d, inputs %d.\n"), j + 1, nPlayerOffset[j], nPlayerInputs[j]);
Expand Down Expand Up @@ -117,7 +117,6 @@ int KailleraGetInput()
k = j + 1;

// Send the control block to the Kaillera DLL & retrieve all controls
//if (kailleraModifyPlayValues(nControls, k) == -1) {
if (Kaillera_Modify_Play_Values(nControls, k) == -1) {
kNetGame = 0;
return 1;
Expand Down
13 changes: 5 additions & 8 deletions src/burner/win32/scrn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ static int WINAPI gameCallback(char* game, int player, int numplayers)
}

if (!bFound) {
// kailleraEndGame();
Kaillera_End_Game();
return 1;
}
Expand All @@ -227,9 +226,12 @@ static int WINAPI gameCallback(char* game, int player, int numplayers)
bCheatsAllowed = false; // Disable cheats during netplay
AudSoundStop(); // Stop while we load roms
DrvInit(nBurnDrvActive, false); // Init the game driver
ScrnInit();

// w/Kaillera: DrvInit() can't post it's restart message because we're not in the message loop yet.
// so we must MediaExit() / MediaInit() here. -dink
MediaExit();
MediaInit();
AudSoundPlay(); // Restart sound
VidInit();
SetFocus(hScrnWnd);

// dprintf(_T(" ** OSD startnet text sent.\n"));
Expand All @@ -246,7 +248,6 @@ static int WINAPI gameCallback(char* game, int player, int numplayers)
DrvExit();
if (kNetGame) {
kNetGame = 0;
// kailleraEndGame();
Kaillera_End_Game();
}
DeActivateChat();
Expand Down Expand Up @@ -299,10 +300,8 @@ static void DoNetGame()
ki.moreInfosCallback = NULL;

Kaillera_Set_Infos(&ki);
//kailleraSetInfos(&ki);

Kaillera_Select_Server_Dialog(NULL);
//kailleraSelectServerDialog(NULL);

if (gameList) {
free(gameList);
Expand Down Expand Up @@ -1168,7 +1167,6 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
DrvExit();
if (kNetGame) {
kNetGame = 0;
// kailleraEndGame();
Kaillera_End_Game();
DeActivateChat();
PostQuitMessage(0);
Expand All @@ -1192,7 +1190,6 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
#endif
if (kNetGame) {
kNetGame = 0;
// kailleraEndGame();
Kaillera_End_Game();
DeActivateChat();
}
Expand Down

0 comments on commit 0d0aecd

Please sign in to comment.