base for forwarding input to clients

This commit is contained in:
Arisotura
2023-03-23 22:09:51 +01:00
parent de8a768b79
commit e18c8d795c
5 changed files with 189 additions and 9 deletions

View File

@ -472,7 +472,14 @@ void EmuThread::run()
}
// process input and hotkeys
NDS::SetKeyMask(Input::InputMask);
if (Netplay::Active)
{
Netplay::ProcessInput();
}
else
{
NDS::SetKeyMask(Input::InputMask);
}
if (Input::HotkeyPressed(HK_Lid))
{
@ -1576,6 +1583,9 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
actMPStartClient = submenu->addAction("NETPLAY CLIENT");
connect(actMPStartClient, &QAction::triggered, this, &MainWindow::onMPStartClient);
actMPTest = submenu->addAction("NETPLAY GO");
connect(actMPTest, &QAction::triggered, this, &MainWindow::onMPTest);
}
}
{
@ -2337,8 +2347,11 @@ void MainWindow::onOpenFile()
recentFileList.prepend(filename);
updateRecentFilesMenu();
NDS::Start();
emuThread->emuRun();
if (!Netplay::Active)
{
NDS::Start();
emuThread->emuRun();
}
updateCartInserted(false);
}
@ -2434,8 +2447,11 @@ void MainWindow::onClickRecentFile()
recentFileList.prepend(filename);
updateRecentFilesMenu();
NDS::Start();
emuThread->emuRun();
if (!Netplay::Active)
{
NDS::Start();
emuThread->emuRun();
}
updateCartInserted(false);
}
@ -2458,8 +2474,11 @@ void MainWindow::onBootFirmware()
return;
}
NDS::Start();
emuThread->emuRun();
if (!Netplay::Active)
{
NDS::Start();
emuThread->emuRun();
}
}
void MainWindow::onInsertCart()
@ -2844,6 +2863,12 @@ void MainWindow::onMPStartClient()
Netplay::StartClient();
}
void MainWindow::onMPTest()
{
// HAX
Netplay::StartGame();
}
void MainWindow::onOpenEmuSettings()
{
emuThread->emuPause();