1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
/*
* Copyright holder 2001-2011 Vedder Bruno.
* Contributor 2016 Carlos Donizete Froes [a.k.a coringao]
*
* This file is part of Osmose, a Sega Master System/Game Gear software
* emulator.
*
* Osmose 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
* any later version.
*
* Osmose 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 Osmose. If not, see <http://www.gnu.org/licenses/>.
*
*
* File : OsmoseGUI.h
*
* Description : This class is the main Application class. It contains
* all QT objects and signal slots that are needed.
*
* Author : B.Vedder
*
* Date : Fri May 14 14:53:24 2010
*
*/
#ifndef OSMOSE_GUI_H
#define OSMOSE_GUI_H
#include <pthread.h>
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
#include <QAction>
#include <QActionGroup>
#include <QFileDialog>
#include <QMessageBox>
#include <QList>
#include <QIcon>
#include "QGLImage.h"
#include "OsmoseEmulationThread.h"
#include "WhiteNoiseEmulationThread.h"
#include "QOsmoseConfiguration.h"
#include "OsmoseConfigurationFile.h"
#include "OsmoseCore.h"
#include "MemoryMapper.h"
#include "QLogWindow.h"
#include "Joystick.h"
#define MENU_HEIGHT 20
class OsmoseGUI : public QMainWindow, JoystickListener
{
Q_OBJECT;
public:
OsmoseGUI(QWidget * parent = 0, Qt::WindowFlags flags = 0);
~OsmoseGUI();
/* JoystickListener interface */
void buttonChanged(unsigned int button, bool pressed); /* True when pressed */
void xAxisChanged(int value);
void yAxisChanged(int value);
void joystickError();
void loadTheROM(QString name);
void toggleFullscreen();
void aboutDialog();
protected:
void closeEvent(QCloseEvent * );
void dropEvent(QDropEvent *e);
void dragEnterEvent(QDragEnterEvent *event);
protected slots:
void sizeX1();
void sizeX2();
void sizeX3();
void sizeX4();
void fullscreen();
void loadROM();
void pauseResumeEmulation();
void resetEmulation();
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void configure();
void saveScreenshot();
void saveSound();
void saveState();
void saveVDPGFX();
void loadState();
void selectSlot0();
void selectSlot1();
void selectSlot2();
void selectSlot3();
void selectSlot4();
void exitApplication();
void setDefaultMapper();
void setCodeMasterMapper();
void setKoreanMapper();
void setNTSCTiming();
void setPALTiming();
void setJapanese();
void setEuropean();
void toggleIrqHack();
void showLogWindow();
private:
bool paused;
QGLImage *glImage;
EmulationThread *emuThread;
char *rom_name;
QAction *pauseResume;
QAction *saveSoundQAction;
QAction *ntscQAction;
QAction *palQAction;
QAction *japaneseQAction;
QAction *europeanQAction;
QAction *codemasterMapperQAction;
QAction *segaMapperQAction;
QAction *koreanMapperQAction;
QAction *irqHackQAction;
OsmoseConfigurationFile *configuration;
OsmoseCore *osmoseCore;
int saveStateSlot;
pthread_mutex_t osmose_core_mutex; // OsmoseCore access mutex.
void updateMachineMenu();
bool isFullscreen;
Joystick *js0;
};
#endif // OsmoseGUI
|