2013-01-13 23:29:42 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
#include "ConsoleListener.h"
|
2013-01-13 23:29:42 +00:00
|
|
|
#include "Core/Core.h"
|
2013-11-19 04:02:24 +00:00
|
|
|
#include "Core/Config.h"
|
2013-01-13 23:29:42 +00:00
|
|
|
#include "input/input_state.h"
|
|
|
|
#include "debugger_disasm.h"
|
2013-02-10 15:36:06 +00:00
|
|
|
#include "debugger_memory.h"
|
2013-02-17 00:06:06 +00:00
|
|
|
#include "debugger_memorytex.h"
|
|
|
|
#include "debugger_displaylist.h"
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
#include <QtCore>
|
|
|
|
#include <QtGui>
|
|
|
|
|
2013-01-13 23:29:42 +00:00
|
|
|
class QtEmuGL;
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
2013-02-19 20:59:53 +00:00
|
|
|
~MainWindow();
|
2013-01-13 23:29:42 +00:00
|
|
|
|
|
|
|
Debugger_Disasm* GetDialogDisasm() { return dialogDisasm; }
|
2013-02-10 15:36:06 +00:00
|
|
|
Debugger_Memory* GetDialogMemory() { return memoryWindow; }
|
2013-02-17 00:06:06 +00:00
|
|
|
Debugger_MemoryTex* GetDialogMemoryTex() { return memoryTexWindow; }
|
|
|
|
Debugger_DisplayList* GetDialogDisplaylist() { return displaylistWindow; }
|
2013-01-13 23:29:42 +00:00
|
|
|
CoreState GetNextState() { return nextState; }
|
2013-02-19 20:59:53 +00:00
|
|
|
|
2013-02-10 15:36:06 +00:00
|
|
|
void ShowMemory(u32 addr);
|
2013-02-19 20:59:53 +00:00
|
|
|
void UpdateMenus();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *);
|
|
|
|
void keyPressEvent(QKeyEvent *e);
|
|
|
|
void keyReleaseEvent(QKeyEvent *e);
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
public slots:
|
2013-01-13 23:29:42 +00:00
|
|
|
void Boot();
|
2013-02-10 15:36:06 +00:00
|
|
|
void CoreEmitWait(bool);
|
2013-04-18 15:40:30 +00:00
|
|
|
void Update();
|
2013-01-13 23:29:42 +00:00
|
|
|
|
|
|
|
private slots:
|
2013-02-19 20:59:53 +00:00
|
|
|
// File
|
2013-11-19 04:02:24 +00:00
|
|
|
void openAct_triggered();
|
|
|
|
void closeAct_triggered();
|
|
|
|
void qlstateAct_triggered();
|
|
|
|
void qsstateAct_triggered();
|
|
|
|
void lstateAct_triggered();
|
|
|
|
void sstateAct_triggered();
|
|
|
|
void exitAct_triggered();
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Emulation
|
2013-11-19 04:02:24 +00:00
|
|
|
void runAct_triggered();
|
|
|
|
void pauseAct_triggered();
|
|
|
|
void resetAct_triggered();
|
|
|
|
void runonloadAct_triggered();
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Debug
|
2013-11-19 04:02:24 +00:00
|
|
|
void lmapAct_triggered();
|
|
|
|
void smapAct_triggered();
|
|
|
|
void resetTableAct_triggered();
|
|
|
|
void dumpNextAct_triggered();
|
|
|
|
void disasmAct_triggered();
|
|
|
|
void dpyListAct_triggered();
|
|
|
|
void consoleAct_triggered();
|
|
|
|
void memviewAct_triggered();
|
|
|
|
void memviewTexAct_triggered();
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Options
|
|
|
|
// Core
|
2013-11-19 04:02:24 +00:00
|
|
|
void dynarecAct_triggered() { g_Config.bJit = !g_Config.bJit; }
|
2013-11-19 09:32:31 +00:00
|
|
|
void vertexDynarecAct_triggered() { g_Config.bVertexDecoderJit = !g_Config.bVertexDecoderJit; }
|
2013-11-19 04:02:24 +00:00
|
|
|
void fastmemAct_triggered() { g_Config.bFastMemory = !g_Config.bFastMemory; }
|
|
|
|
void ignoreIllegalAct_triggered() { g_Config.bIgnoreBadMemAccess = !g_Config.bIgnoreBadMemAccess; }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Video
|
2013-11-19 04:02:24 +00:00
|
|
|
void anisotropic_triggered(QAction *action) { g_Config.iAnisotropyLevel = action->data().toInt(); }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
void bufferRenderAct_triggered() { g_Config.iRenderingMode = !g_Config.iRenderingMode; }
|
|
|
|
void linearAct_triggered() { g_Config.iTexFiltering = (g_Config.iTexFiltering != 0) ? 0 : 3; }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
void screen_triggered(QAction *action) { SetZoom(action->data().toInt()); }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
void stretchAct_triggered();
|
|
|
|
void transformAct_triggered() { g_Config.bHardwareTransform = !g_Config.bHardwareTransform; }
|
|
|
|
void vertexCacheAct_triggered() { g_Config.bVertexCache = !g_Config.bVertexCache; }
|
|
|
|
void frameskipAct_triggered() { g_Config.iFrameSkip = !g_Config.iFrameSkip; }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Sound
|
2013-11-19 04:02:24 +00:00
|
|
|
void audioAct_triggered() { g_Config.bEnableSound = !g_Config.bEnableSound; }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-11-19 04:02:24 +00:00
|
|
|
void fullscreenAct_triggered();
|
|
|
|
void statsAct_triggered() { g_Config.bShowDebugStats = !g_Config.bShowDebugStats; }
|
|
|
|
void showFPSAct_triggered() { g_Config.iShowFPSCounter = !g_Config.iShowFPSCounter; }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Logs
|
2013-11-19 04:02:24 +00:00
|
|
|
void defaultLog_triggered(QAction * action) {
|
|
|
|
LogTypes::LOG_LEVELS level = (LogTypes::LOG_LEVELS)action->data().toInt();
|
|
|
|
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
|
|
|
{
|
|
|
|
LogTypes::LOG_TYPE type = (LogTypes::LOG_TYPE)i;
|
|
|
|
if(type == LogTypes::G3D || type == LogTypes::HLE) continue;
|
|
|
|
LogManager::GetInstance()->SetLogLevel(type, level);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void g3dLog_triggered(QAction * action) { LogManager::GetInstance()->SetLogLevel(LogTypes::G3D, (LogTypes::LOG_LEVELS)action->data().toInt()); }
|
|
|
|
void hleLog_triggered(QAction * action) { LogManager::GetInstance()->SetLogLevel(LogTypes::HLE, (LogTypes::LOG_LEVELS)action->data().toInt()); }
|
2013-01-13 23:29:42 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Help
|
2013-11-19 04:02:24 +00:00
|
|
|
void websiteAct_triggered();
|
|
|
|
void aboutAct_triggered();
|
2013-02-03 23:45:37 +00:00
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
// Others
|
2013-11-19 09:32:31 +00:00
|
|
|
void langChanged(QAction *action) { loadLanguage(action->data().toString(), true); }
|
2013-02-06 17:49:20 +00:00
|
|
|
|
2013-01-13 23:29:42 +00:00
|
|
|
private:
|
2013-11-19 04:02:24 +00:00
|
|
|
void SetZoom(int zoom);
|
2013-02-19 20:59:53 +00:00
|
|
|
void SetGameTitle(QString text);
|
2013-11-19 09:32:31 +00:00
|
|
|
void loadLanguage(const QString &language, bool retranslate);
|
|
|
|
void retranslateUi();
|
|
|
|
void createMenu();
|
2013-02-19 20:59:53 +00:00
|
|
|
void notifyMapsLoaded();
|
2013-02-06 17:49:20 +00:00
|
|
|
|
|
|
|
QTranslator translator;
|
|
|
|
QString currentLanguage;
|
|
|
|
|
2013-02-19 20:59:53 +00:00
|
|
|
QtEmuGL *emugl;
|
2013-04-18 15:40:30 +00:00
|
|
|
QTimer timer;
|
2013-01-13 23:29:42 +00:00
|
|
|
CoreState nextState;
|
|
|
|
InputState input_state;
|
2013-04-20 10:43:55 +00:00
|
|
|
GlobalUIState lastUIState;
|
2013-01-13 23:29:42 +00:00
|
|
|
|
|
|
|
Debugger_Disasm *dialogDisasm;
|
2013-02-10 15:36:06 +00:00
|
|
|
Debugger_Memory *memoryWindow;
|
2013-02-17 00:06:06 +00:00
|
|
|
Debugger_MemoryTex *memoryTexWindow;
|
|
|
|
Debugger_DisplayList *displaylistWindow;
|
2013-11-19 04:02:24 +00:00
|
|
|
|
|
|
|
// Menus
|
|
|
|
// File
|
2013-11-19 09:32:31 +00:00
|
|
|
QMenu *fileMenu;
|
2013-11-19 04:02:24 +00:00
|
|
|
QAction *openAct, *closeAct, *qlstateAct, *qsstateAct,
|
|
|
|
*lstateAct, *sstateAct, *exitAct;
|
|
|
|
// Emulation
|
2013-11-19 09:32:31 +00:00
|
|
|
QMenu *emuMenu;
|
2013-11-19 04:02:24 +00:00
|
|
|
QAction *runAct, *pauseAct, *resetAct, *runonloadAct;
|
|
|
|
// Debug
|
2013-11-19 09:32:31 +00:00
|
|
|
QMenu *debugMenu;
|
2013-11-19 04:02:24 +00:00
|
|
|
QAction *lmapAct, *smapAct, *resetTableAct, *dumpNextAct,
|
|
|
|
*disasmAct, *dpyListAct, *consoleAct, *memviewAct,
|
|
|
|
*memviewTexAct;
|
|
|
|
// Options
|
2013-11-19 09:32:31 +00:00
|
|
|
QMenu *optionsMenu, *coreMenu, *videoMenu, *anisotropicMenu,
|
|
|
|
*screenMenu, *levelsMenu, *langMenu;
|
|
|
|
QAction *dynarecAct, *vertexDynarecAct, *fastmemAct,
|
|
|
|
*ignoreIllegalAct, *bufferRenderAct,
|
2013-11-19 04:02:24 +00:00
|
|
|
*linearAct, *stretchAct, *transformAct, *vertexCacheAct,
|
|
|
|
*frameskipAct, *audioAct, *fullscreenAct, *statsAct,
|
|
|
|
*showFPSAct;
|
|
|
|
QActionGroup *anisotropicGroup, *screenGroup, *langGroup,
|
|
|
|
*defaultLogGroup, *g3dLogGroup, *hleLogGroup;
|
|
|
|
// Help
|
2013-11-19 09:32:31 +00:00
|
|
|
QMenu *helpMenu;
|
2013-11-19 04:02:24 +00:00
|
|
|
QAction *websiteAct, *aboutAct;
|
|
|
|
|
2013-01-13 23:29:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|