start moving ROM/firmware loading to the emuthread to avoid cursed bugs

This commit is contained in:
Arisotura
2024-10-24 00:27:05 +02:00
parent 1428bfb2cf
commit 82f38f0b7a
3 changed files with 63 additions and 48 deletions

View File

@ -68,15 +68,15 @@ public:
msg_InitGL,
msg_DeInitGL,
msg_BootROM,
msg_BootFirmware,
};
struct Message
{
MessageType type;
union
{
bool stopExternal;
};
QVariant param;
};
void sendMessage(Message msg);
@ -100,6 +100,9 @@ public:
void emuFrameStep();
void emuReset();
int bootROM(QStringList filename);
int bootFirmware();
bool emuIsRunning();
bool emuIsActive();
@ -153,6 +156,8 @@ private:
constexpr static int emuPauseStackPauseThreshold = 1;
int emuPauseStack;
int bootResult = 0;
QMutex msgMutex;
QSemaphore msgSemaphore;
QQueue<Message> msgQueue;