WIP. lay base for EmuInstance.

This commit is contained in:
Arisotura
2024-05-10 12:48:32 +02:00
parent f93937e88b
commit faa6cfec48
11 changed files with 514 additions and 134 deletions

View File

@ -0,0 +1,71 @@
/*
Copyright 2016-2023 melonDS team
This file is part of melonDS.
melonDS is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with melonDS. If not, see http://www.gnu.org/licenses/.
*/
#ifndef EMUINSTANCE_H
#define EMUINSTANCE_H
#include "EmuThread.h"
#include "Window.h"
#include "Config.h"
const int kMaxWindows = 16;
class EmuInstance
{
public:
EmuInstance(int inst);
~EmuInstance();
void createWindow();
// return: empty string = setup OK, non-empty = error message
QString verifySetup();
private:
static int lastSep(const std::string& path);
std::string getAssetPath(bool gba, const std::string& configpath, const std::string& ext, const std::string& file);
QString verifyDSBIOS();
QString verifyDSiBIOS();
QString verifyDSFirmware();
QString verifyDSiFirmware();
QString verifyDSiNAND();
int instanceID;
EmuThread* emuThread;
MainWindow* mainWindow;
MainWindow* windowList[kMaxWindows];
int numWindows;
Config::Table globalCfg;
Config::Table localCfg;
int cartType;
std::string baseROMDir;
std::string baseROMName;
std::string baseAssetName;
int gbaCartType;
std::string baseGBAROMDir;
std::string baseGBAROMName;
std::string baseGBAAssetName;
};
#endif //EMUINSTANCE_H