62 lines
1.6 KiB
C++
62 lines
1.6 KiB
C++
#pragma once
|
|
#include <RenderWidget.hpp>
|
|
#include <SettingsWindow.hpp>
|
|
#include <SDL3/SDL_gamepad.h>
|
|
#include <QMainWindow>
|
|
#include <QFileDialog>
|
|
#include <QDropEvent>
|
|
#include <QDragEnterEvent>
|
|
#include <Core.hpp>
|
|
#include <bitset>
|
|
#include <tuple>
|
|
|
|
class EmuThread;
|
|
|
|
class KaizenGui final : QMainWindow {
|
|
Q_OBJECT
|
|
void updateKeys();
|
|
void updateAxis();
|
|
|
|
public:
|
|
explicit KaizenGui() noexcept;
|
|
~KaizenGui();
|
|
|
|
void cleanup();
|
|
void dropEvent(QDropEvent *) override;
|
|
void dragEnterEvent(QDragEnterEvent *) override;
|
|
void keyPressEvent(QKeyEvent *) override;
|
|
void keyReleaseEvent(QKeyEvent *) override;
|
|
|
|
bool fastForward = false;
|
|
bool minimized = false;
|
|
|
|
SettingsWindow *settingsWindow;
|
|
RenderWidget *vulkanWidget;
|
|
QSettings settings;
|
|
QThread *emuThread;
|
|
QTimer *statusBarTimer;
|
|
QLabel *fpsLabel;
|
|
QLabel *cpuTypeLabel;
|
|
QLabel *idleSkipLabel;
|
|
QAction *pause = new QAction("Pause");
|
|
QAction *reset = new QAction("Reset");
|
|
QAction *stop = new QAction("Stop");
|
|
|
|
SDL_Gamepad *gamepad = nullptr;
|
|
|
|
void LoadTAS(const std::string &path) noexcept;
|
|
void LoadROM(const std::string &path) noexcept;
|
|
signals:
|
|
void paused();
|
|
|
|
private:
|
|
float elapsed = 0.f;
|
|
n64::Core &core = n64::Core::GetInstance();
|
|
std::bitset<18> pressedKeys{};
|
|
std::array<Qt::Key, 18> mapping = {
|
|
Qt::Key_Z, Qt::Key_X, Qt::Key_C, Qt::Key_A, Qt::Key_S, Qt::Key_Return,
|
|
Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, Qt::Key_T, Qt::Key_G,
|
|
Qt::Key_F, Qt::Key_H, Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right,
|
|
};
|
|
};
|