mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 14:45:41 +12:00
Bonk
This commit is contained in:
parent
1c50ca065d
commit
c0c3153cd8
3 changed files with 10 additions and 10 deletions
|
@ -4,16 +4,18 @@
|
||||||
|
|
||||||
#include "emulator.hpp"
|
#include "emulator.hpp"
|
||||||
|
|
||||||
struct FrontendSDL {
|
class FrontendSDL {
|
||||||
|
Emulator emu;
|
||||||
|
#ifdef PANDA3DS_ENABLE_OPENGL
|
||||||
|
SDL_GLContext glContext;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
public:
|
||||||
FrontendSDL();
|
FrontendSDL();
|
||||||
bool loadROM(const std::filesystem::path& path);
|
bool loadROM(const std::filesystem::path& path);
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
Emulator emu;
|
|
||||||
SDL_Window* window = nullptr;
|
SDL_Window* window = nullptr;
|
||||||
#ifdef PANDA3DS_ENABLE_OPENGL
|
|
||||||
SDL_GLContext glContext;
|
|
||||||
#endif
|
|
||||||
SDL_GameController* gameController = nullptr;
|
SDL_GameController* gameController = nullptr;
|
||||||
int gameControllerID;
|
int gameControllerID;
|
||||||
};
|
};
|
|
@ -75,7 +75,6 @@ FrontendSDL::FrontendSDL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FrontendSDL::loadROM(const std::filesystem::path& path) { return emu.loadROM(path); }
|
bool FrontendSDL::loadROM(const std::filesystem::path& path) { return emu.loadROM(path); }
|
||||||
|
|
||||||
void FrontendSDL::run() { emu.run(this); }
|
void FrontendSDL::run() { emu.run(this); }
|
||||||
|
|
||||||
void Emulator::run(void* frontend) {
|
void Emulator::run(void* frontend) {
|
||||||
|
@ -352,7 +351,6 @@ void Emulator::run(void* frontend) {
|
||||||
// TODO: Should this be uncommented?
|
// TODO: Should this be uncommented?
|
||||||
// kernel.evalReschedule();
|
// kernel.evalReschedule();
|
||||||
|
|
||||||
// Update inputs in the HID module
|
|
||||||
SDL_GL_SwapWindow(frontendSDL->window);
|
SDL_GL_SwapWindow(frontendSDL->window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "panda_sdl/frontend_sdl.hpp"
|
#include "panda_sdl/frontend_sdl.hpp"
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
FrontendSDL frontend;
|
FrontendSDL app;
|
||||||
|
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
auto romPath = std::filesystem::current_path() / argv[1];
|
auto romPath = std::filesystem::current_path() / argv[1];
|
||||||
if (!frontend.loadROM(romPath)) {
|
if (!app.loadROM(romPath)) {
|
||||||
// For some reason just .c_str() doesn't show the proper path
|
// For some reason just .c_str() doesn't show the proper path
|
||||||
Helpers::panic("Failed to load ROM file: %s", romPath.string().c_str());
|
Helpers::panic("Failed to load ROM file: %s", romPath.string().c_str());
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,5 @@ int main(int argc, char *argv[]) {
|
||||||
printf("No ROM inserted! Load a ROM by dragging and dropping it into the emulator window!\n");
|
printf("No ROM inserted! Load a ROM by dragging and dropping it into the emulator window!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
frontend.run();
|
app.run();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue