quick attempt.

This commit is contained in:
Arisotura
2023-03-26 22:40:09 +02:00
parent 79301c6e91
commit 31472607d6
3 changed files with 18 additions and 6 deletions

View File

@ -536,8 +536,7 @@ void ProcessCommands()
break; break;
case Cmd_Start: case Cmd_Start:
NDS::Start(); Netplay::StartLocal();
emuThread->emuRun();
break; break;
} }

View File

@ -461,6 +461,19 @@ void StartGame()
IPC::SendCommand(0xFFFF, IPC::Cmd_Start, 0, nullptr); IPC::SendCommand(0xFFFF, IPC::Cmd_Start, 0, nullptr);
// start game locally // start game locally
StartLocal();
}
void StartLocal()
{
for (int i = 0; i < 4; i++)
{
InputFrame frame;
frame.FrameNum = i;
frame.KeyMask = 0xFFF;
InputQueue.push(frame);
}
NDS::Start(); NDS::Start();
emuThread->emuRun(); emuThread->emuRun();
} }
@ -637,8 +650,7 @@ printf("bourf\n");
IPC::SendCommand(0xFFFF, IPC::Cmd_Start, 0, nullptr); IPC::SendCommand(0xFFFF, IPC::Cmd_Start, 0, nullptr);
printf("birf\n"); printf("birf\n");
// start game locally // start game locally
NDS::Start();printf("barf\n"); StartLocal();
emuThread->emuRun();printf("burf\n");
} }
break; break;
} }
@ -730,7 +742,7 @@ void ProcessMirrorClient()
if (!MirrorHost) return; if (!MirrorHost) return;
bool block = false; bool block = false;
if (emuThread->emuIsRunning() && NDS::NumFrames > 4) if (emuThread->emuIsRunning())// && NDS::NumFrames > 4)
{ {
if (InputQueue.empty()) if (InputQueue.empty())
block = true; block = true;
@ -844,7 +856,7 @@ void ProcessInput()
if (InputQueue.empty()) if (InputQueue.empty())
{ {
if (NDS::NumFrames > 4) //if (NDS::NumFrames > 4)
printf("Netplay: BAD! INPUT QUEUE EMPTY\n"); printf("Netplay: BAD! INPUT QUEUE EMPTY\n");
return; return;
} }

View File

@ -135,6 +135,7 @@ void StartMirror(const Player* player);
u32 PlayerAddress(int id); u32 PlayerAddress(int id);
void StartGame(); void StartGame();
void StartLocal();
void ProcessFrame(); void ProcessFrame();
void ProcessInput(); void ProcessInput();