Qt: GB Override view

This commit is contained in:
Jeffrey Pfau 2016-09-10 08:35:50 -07:00
parent 1bc8dfe42b
commit e81ed20a14
14 changed files with 625 additions and 332 deletions

View File

@ -265,20 +265,35 @@ void GBReset(struct LR35902Core* cpu) {
gb->biosVf->seek(gb->biosVf, 0, SEEK_SET); gb->biosVf->seek(gb->biosVf, 0, SEEK_SET);
gb->memory.romBase = malloc(GB_SIZE_CART_BANK0); gb->memory.romBase = malloc(GB_SIZE_CART_BANK0);
ssize_t size = gb->biosVf->read(gb->biosVf, gb->memory.romBase, GB_SIZE_CART_BANK0); ssize_t size = gb->biosVf->read(gb->biosVf, gb->memory.romBase, GB_SIZE_CART_BANK0);
uint32_t biosCrc = doCrc32(gb->memory.romBase, size);
memcpy(&gb->memory.romBase[size], &gb->memory.rom[size], GB_SIZE_CART_BANK0 - size); switch (biosCrc) {
if (size > 0x100) { case 0x59C8598E:
memcpy(&gb->memory.romBase[0x100], &gb->memory.rom[0x100], sizeof(struct GBCartridge)); break;
case 0x41884E46:
break;
default:
gb->biosVf->close(gb->biosVf);
gb->biosVf = NULL;
free(gb->memory.romBase);
gb->memory.romBase = gb->memory.rom;
break;
} }
cpu->a = 0; if (gb->biosVf) {
cpu->f.packed = 0; memcpy(&gb->memory.romBase[size], &gb->memory.rom[size], GB_SIZE_CART_BANK0 - size);
cpu->c = 0; if (size > 0x100) {
cpu->e = 0; memcpy(&gb->memory.romBase[0x100], &gb->memory.rom[0x100], sizeof(struct GBCartridge));
cpu->h = 0; }
cpu->l = 0;
cpu->sp = 0; cpu->a = 0;
cpu->pc = 0; cpu->f.packed = 0;
cpu->c = 0;
cpu->e = 0;
cpu->h = 0;
cpu->l = 0;
cpu->sp = 0;
cpu->pc = 0;
}
} }
cpu->b = 0; cpu->b = 0;
@ -298,10 +313,10 @@ void GBReset(struct LR35902Core* cpu) {
cpu->h = 1; cpu->h = 1;
cpu->l = 0x4D; cpu->l = 0x4D;
break; break;
case GB_MODEL_CGB: case GB_MODEL_AGB:
cpu->b = 1; cpu->b = 1;
// Fall through // Fall through
case GB_MODEL_AGB: // Silence warnings case GB_MODEL_CGB:
cpu->a = 0x11; cpu->a = 0x11;
cpu->f.packed = 0x80; cpu->f.packed = 0x80;
cpu->c = 0; cpu->c = 0;

View File

@ -129,6 +129,12 @@ set(UI_FILES
TileView.ui TileView.ui
VideoView.ui) VideoView.ui)
set(GBA_SRC
GBAOverride.cpp)
set(GB_SRC
GBOverride.cpp)
qt5_wrap_ui(UI_SRC ${UI_FILES}) qt5_wrap_ui(UI_SRC ${UI_FILES})
set(QT_LIBRARIES) set(QT_LIBRARIES)
@ -139,6 +145,14 @@ if(BUILD_SDL)
list(APPEND AUDIO_SRC AudioProcessorSDL.cpp) list(APPEND AUDIO_SRC AudioProcessorSDL.cpp)
endif() endif()
if(M_CORE_GBA)
list(APPEND PLATFORM_SRC ${GBA_SRC})
endif()
if(M_CORE_GB)
list(APPEND PLATFORM_SRC ${GB_SRC})
endif()
set(QT_DEFINES) set(QT_DEFINES)
if(Qt5Multimedia_FOUND) if(Qt5Multimedia_FOUND)
list(APPEND AUDIO_SRC list(APPEND AUDIO_SRC

View File

@ -12,7 +12,6 @@
#include <QMenu> #include <QMenu>
extern "C" { extern "C" {
#include "gba/overrides.h"
#include "feature/commandline.h" #include "feature/commandline.h"
} }
@ -177,8 +176,8 @@ QVariant ConfigController::getQtOption(const QString& key, const QString& group)
return value; return value;
} }
void ConfigController::saveOverride(const GBACartridgeOverride& override) { void ConfigController::saveOverride(const Override& override) {
GBAOverrideSave(overrides(), &override); override.save(overrides());
write(); write();
} }

View File

@ -6,6 +6,8 @@
#ifndef QGBA_CONFIG_CONTROLLER #ifndef QGBA_CONFIG_CONTROLLER
#define QGBA_CONFIG_CONTROLLER #define QGBA_CONFIG_CONTROLLER
#include "Override.h"
#include <QMap> #include <QMap>
#include <QObject> #include <QObject>
#include <QSettings> #include <QSettings>
@ -78,7 +80,7 @@ public:
void setMRU(const QList<QString>& mru); void setMRU(const QList<QString>& mru);
Configuration* overrides() { return mCoreConfigGetOverrides(&m_config); } Configuration* overrides() { return mCoreConfigGetOverrides(&m_config); }
void saveOverride(const GBACartridgeOverride&); void saveOverride(const Override&);
Configuration* input() { return mCoreConfigGetInput(&m_config); } Configuration* input() { return mCoreConfigGetInput(&m_config); }

View File

@ -0,0 +1,23 @@
/* Copyright (c) 2013-2016 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GBAOverride.h"
extern "C" {
#include "core/core.h"
}
using namespace QGBA;
void GBAOverride::apply(struct mCore* core) {
if (core->platform(core) != PLATFORM_GBA) {
return;
}
GBAOverrideApply(static_cast<GBA*>(core->board), &override);
}
void GBAOverride::save(struct Configuration* config) const {
GBAOverrideSave(config, &override);
}

View File

@ -0,0 +1,27 @@
/* Copyright (c) 2013-2016 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_GBA_OVERRIDE
#define QGBA_GBA_OVERRIDE
#include "Override.h"
extern "C" {
#include "gba/overrides.h"
}
namespace QGBA {
class GBAOverride : public Override {
public:
void apply(struct mCore*) override;
void save(struct Configuration*) const override;
struct GBACartridgeOverride override;
};
}
#endif

View File

@ -0,0 +1,23 @@
/* Copyright (c) 2013-2016 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GBOverride.h"
extern "C" {
#include "core/core.h"
}
using namespace QGBA;
void GBOverride::apply(struct mCore* core) {
if (core->platform(core) != PLATFORM_GB) {
return;
}
GBOverrideApply(static_cast<GB*>(core->board), &override);
}
void GBOverride::save(struct Configuration* config) const {
GBOverrideSave(config, &override);
}

View File

@ -0,0 +1,27 @@
/* Copyright (c) 2013-2016 Jeffrey Pfau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef QGBA_GB_OVERRIDE
#define QGBA_GB_OVERRIDE
#include "Override.h"
extern "C" {
#include "gb/overrides.h"
}
namespace QGBA {
class GBOverride : public Override {
public:
void apply(struct mCore*) override;
void save(struct Configuration*) const override;
struct GBCartridgeOverride override;
};
}
#endif

View File

@ -70,6 +70,7 @@ GameController::GameController(QObject* parent)
, m_backupSaveState(nullptr) , m_backupSaveState(nullptr)
, m_saveStateFlags(SAVESTATE_SCREENSHOT | SAVESTATE_SAVEDATA | SAVESTATE_CHEATS) , m_saveStateFlags(SAVESTATE_SCREENSHOT | SAVESTATE_SAVEDATA | SAVESTATE_CHEATS)
, m_loadStateFlags(SAVESTATE_SCREENSHOT) , m_loadStateFlags(SAVESTATE_SCREENSHOT)
, m_override(nullptr)
{ {
#ifdef M_CORE_GBA #ifdef M_CORE_GBA
m_lux.p = this; m_lux.p = this;
@ -283,8 +284,9 @@ void GameController::clearMultiplayerController() {
m_multiplayer = nullptr; m_multiplayer = nullptr;
} }
void GameController::setOverride(const GBACartridgeOverride& override) { void GameController::clearOverride() {
// TODO: Put back overrides delete m_override;
m_override = nullptr;
} }
void GameController::setConfig(const mCoreConfig* config) { void GameController::setConfig(const mCoreConfig* config) {
@ -434,6 +436,10 @@ void GameController::openGame(bool biosOnly) {
} }
m_vf = nullptr; m_vf = nullptr;
if (m_override) {
m_override->apply(m_threadContext.core);
}
if (!mCoreThreadStart(&m_threadContext)) { if (!mCoreThreadStart(&m_threadContext)) {
emit gameFailed(); emit gameFailed();
} }

View File

@ -39,6 +39,7 @@ namespace QGBA {
class AudioProcessor; class AudioProcessor;
class InputController; class InputController;
class MultiplayerController; class MultiplayerController;
class Override;
class GameController : public QObject { class GameController : public QObject {
Q_OBJECT Q_OBJECT
@ -71,8 +72,9 @@ public:
MultiplayerController* multiplayerController() { return m_multiplayer; } MultiplayerController* multiplayerController() { return m_multiplayer; }
void clearMultiplayerController(); void clearMultiplayerController();
void setOverride(const GBACartridgeOverride& override); void setOverride(Override* override) { m_override = override; }
void clearOverride() { /* TODO: Put back overrides */ } Override* override() { return m_override; }
void clearOverride();
void setConfig(const mCoreConfig*); void setConfig(const mCoreConfig*);
@ -191,6 +193,7 @@ private:
QString m_bios; QString m_bios;
bool m_useBios; bool m_useBios;
QString m_patch; QString m_patch;
Override* m_override;
QThread* m_audioThread; QThread* m_audioThread;
AudioProcessor* m_audioProcessor; AudioProcessor* m_audioProcessor;

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015 Jeffrey Pfau /* Copyright (c) 2013-2016 Jeffrey Pfau
* *
* This Source Code Form is subject to the terms of the Mozilla Public * This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
@ -8,17 +8,52 @@
#include "ConfigController.h" #include "ConfigController.h"
#include "GameController.h" #include "GameController.h"
#ifdef M_CORE_GBA
#include "GBAOverride.h"
extern "C" { extern "C" {
#include "gba/gba.h" #include "gba/gba.h"
} }
#endif
#ifdef M_CORE_GB
#include "GBOverride.h"
extern "C" {
#include "gb/gb.h"
}
#endif
using namespace QGBA; using namespace QGBA;
QList<enum GBModel> OverrideView::s_gbModelList;
QList<enum GBMemoryBankControllerType> OverrideView::s_mbcList;
OverrideView::OverrideView(GameController* controller, ConfigController* config, QWidget* parent) OverrideView::OverrideView(GameController* controller, ConfigController* config, QWidget* parent)
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint)
, m_controller(controller) , m_controller(controller)
, m_config(config) , m_config(config)
{ {
#ifdef M_CORE_GB
if (s_mbcList.isEmpty()) {
// NB: Keep in sync with OverrideView.ui
s_mbcList.append(GB_MBC_AUTODETECT);
s_mbcList.append(GB_MBC_NONE);
s_mbcList.append(GB_MBC1);
s_mbcList.append(GB_MBC2);
s_mbcList.append(GB_MBC3);
s_mbcList.append(GB_MBC3_RTC);
s_mbcList.append(GB_MBC5);
s_mbcList.append(GB_MBC5_RUMBLE);
s_mbcList.append(GB_MBC7);
s_mbcList.append(GB_HuC3);
}
if (s_gbModelList.isEmpty()) {
// NB: Keep in sync with OverrideView.ui
s_gbModelList.append(GB_MODEL_AUTODETECT);
s_gbModelList.append(GB_MODEL_DMG);
s_gbModelList.append(GB_MODEL_CGB);
s_gbModelList.append(GB_MODEL_AGB);
}
#endif
m_ui.setupUi(this); m_ui.setupUi(this);
connect(controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*))); connect(controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*)));
@ -41,7 +76,18 @@ OverrideView::OverrideView(GameController* controller, ConfigController* config,
connect(m_ui.hwRumble, SIGNAL(clicked()), this, SLOT(updateOverrides())); connect(m_ui.hwRumble, SIGNAL(clicked()), this, SLOT(updateOverrides()));
connect(m_ui.hwGBPlayer, SIGNAL(clicked()), this, SLOT(updateOverrides())); connect(m_ui.hwGBPlayer, SIGNAL(clicked()), this, SLOT(updateOverrides()));
connect(m_ui.save, SIGNAL(clicked()), this, SLOT(saveOverride())); connect(m_ui.gbModel, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOverrides()));
connect(m_ui.mbc, SIGNAL(currentIndexChanged(int)), this, SLOT(updateOverrides()));
connect(m_ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateOverrides()));
#ifndef M_CORE_GBA
m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.tabGBA));
#endif
#ifndef M_CORE_GB
m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.tabGB));
#endif
connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(saveOverride()));
if (controller->isLoaded()) { if (controller->isLoaded()) {
gameStarted(controller->thread()); gameStarted(controller->thread());
@ -52,50 +98,67 @@ void OverrideView::saveOverride() {
if (!m_config) { if (!m_config) {
return; return;
} }
m_config->saveOverride(m_override); m_config->saveOverride(*m_controller->override());
} }
void OverrideView::updateOverrides() { void OverrideView::updateOverrides() {
memset(m_override.id, 0, 4); #ifdef M_CORE_GBA
m_override.savetype = static_cast<SavedataType>(m_ui.savetype->currentIndex() - 1); if (m_ui.tabWidget->currentWidget() == m_ui.tabGBA) {
m_override.hardware = HW_NO_OVERRIDE; GBAOverride* gba = new GBAOverride;
m_override.idleLoop = IDLE_LOOP_NONE; memset(gba->override.id, 0, 4);
m_override.mirroring = false; gba->override.savetype = static_cast<SavedataType>(m_ui.savetype->currentIndex() - 1);
gba->override.hardware = HW_NO_OVERRIDE;
gba->override.idleLoop = IDLE_LOOP_NONE;
gba->override.mirroring = false;
if (!m_ui.hwAutodetect->isChecked()) { if (!m_ui.hwAutodetect->isChecked()) {
m_override.hardware = HW_NONE; gba->override.hardware = HW_NONE;
if (m_ui.hwRTC->isChecked()) { if (m_ui.hwRTC->isChecked()) {
m_override.hardware |= HW_RTC; gba->override.hardware |= HW_RTC;
}
if (m_ui.hwGyro->isChecked()) {
gba->override.hardware |= HW_GYRO;
}
if (m_ui.hwLight->isChecked()) {
gba->override.hardware |= HW_LIGHT_SENSOR;
}
if (m_ui.hwTilt->isChecked()) {
gba->override.hardware |= HW_TILT;
}
if (m_ui.hwRumble->isChecked()) {
gba->override.hardware |= HW_RUMBLE;
}
} }
if (m_ui.hwGyro->isChecked()) { if (m_ui.hwGBPlayer->isChecked()) {
m_override.hardware |= HW_GYRO; gba->override.hardware |= HW_GB_PLAYER_DETECTION;
} }
if (m_ui.hwLight->isChecked()) {
m_override.hardware |= HW_LIGHT_SENSOR;
}
if (m_ui.hwTilt->isChecked()) {
m_override.hardware |= HW_TILT;
}
if (m_ui.hwRumble->isChecked()) {
m_override.hardware |= HW_RUMBLE;
}
}
if (m_ui.hwGBPlayer->isChecked()) {
m_override.hardware |= HW_GB_PLAYER_DETECTION;
}
bool ok; bool ok;
uint32_t parsedIdleLoop = m_ui.idleLoop->text().toInt(&ok, 16); uint32_t parsedIdleLoop = m_ui.idleLoop->text().toInt(&ok, 16);
if (ok) { if (ok) {
m_override.idleLoop = parsedIdleLoop; gba->override.idleLoop = parsedIdleLoop;
} }
if (m_override.savetype != SAVEDATA_AUTODETECT || m_override.hardware != HW_NO_OVERRIDE || if (gba->override.savetype != SAVEDATA_AUTODETECT || gba->override.hardware != HW_NO_OVERRIDE ||
m_override.idleLoop != IDLE_LOOP_NONE) { gba->override.idleLoop != IDLE_LOOP_NONE) {
m_controller->setOverride(m_override); m_controller->setOverride(gba);
} else { } else {
m_controller->clearOverride(); m_controller->clearOverride();
}
} }
#endif
#ifdef M_CORE_GB
if (m_ui.tabWidget->currentWidget() == m_ui.tabGB) {
GBOverride* gb = new GBOverride;
gb->override.mbc = s_mbcList[m_ui.mbc->currentIndex()];
gb->override.model = s_gbModelList[m_ui.gbModel->currentIndex()];
if (gb->override.mbc != GB_MBC_AUTODETECT || gb->override.model != GB_MODEL_AUTODETECT) {
m_controller->setOverride(gb);
} else {
m_controller->clearOverride();
}
}
#endif
} }
void OverrideView::gameStarted(mCoreThread* thread) { void OverrideView::gameStarted(mCoreThread* thread) {
@ -103,66 +166,61 @@ void OverrideView::gameStarted(mCoreThread* thread) {
gameStopped(); gameStopped();
return; return;
} }
if (thread->core->platform(thread->core) != PLATFORM_GBA) {
close(); m_ui.tabWidget->setEnabled(false);
return;
switch (thread->core->platform(thread->core)) {
#ifdef M_CORE_GBA
case PLATFORM_GBA: {
m_ui.tabWidget->setCurrentWidget(m_ui.tabGBA);
GBA* gba = static_cast<GBA*>(thread->core->board);
m_ui.savetype->setCurrentIndex(gba->memory.savedata.type + 1);
m_ui.hwRTC->setChecked(gba->memory.hw.devices & HW_RTC);
m_ui.hwGyro->setChecked(gba->memory.hw.devices & HW_GYRO);
m_ui.hwLight->setChecked(gba->memory.hw.devices & HW_LIGHT_SENSOR);
m_ui.hwTilt->setChecked(gba->memory.hw.devices & HW_TILT);
m_ui.hwRumble->setChecked(gba->memory.hw.devices & HW_RUMBLE);
m_ui.hwGBPlayer->setChecked(gba->memory.hw.devices & HW_GB_PLAYER_DETECTION);
if (gba->idleLoop != IDLE_LOOP_NONE) {
m_ui.idleLoop->setText(QString::number(gba->idleLoop, 16));
} else {
m_ui.idleLoop->clear();
}
break;
} }
GBA* gba = static_cast<GBA*>(thread->core->board); #endif
m_ui.savetype->setCurrentIndex(gba->memory.savedata.type + 1); #ifdef M_CORE_GB
m_ui.savetype->setEnabled(false); case PLATFORM_GB: {
m_ui.tabWidget->setCurrentWidget(m_ui.tabGB);
m_ui.hwAutodetect->setEnabled(false); GB* gb = static_cast<GB*>(thread->core->board);
m_ui.hwRTC->setEnabled(false); int mbc = s_mbcList.indexOf(gb->memory.mbcType);
m_ui.hwGyro->setEnabled(false); if (mbc >= 0) {
m_ui.hwLight->setEnabled(false); m_ui.mbc->setCurrentIndex(mbc);
m_ui.hwTilt->setEnabled(false); } else {
m_ui.hwRumble->setEnabled(false); m_ui.mbc->setCurrentIndex(0);
}
m_ui.hwRTC->setChecked(gba->memory.hw.devices & HW_RTC); int model = s_gbModelList.indexOf(gb->model);
m_ui.hwGyro->setChecked(gba->memory.hw.devices & HW_GYRO); if (model >= 0) {
m_ui.hwLight->setChecked(gba->memory.hw.devices & HW_LIGHT_SENSOR); m_ui.gbModel->setCurrentIndex(model);
m_ui.hwTilt->setChecked(gba->memory.hw.devices & HW_TILT); } else {
m_ui.hwRumble->setChecked(gba->memory.hw.devices & HW_RUMBLE); m_ui.gbModel->setCurrentIndex(0);
m_ui.hwGBPlayer->setChecked(gba->memory.hw.devices & HW_GB_PLAYER_DETECTION); }
break;
if (gba->idleLoop != IDLE_LOOP_NONE) { }
m_ui.idleLoop->setText(QString::number(gba->idleLoop, 16)); #endif
} else { case PLATFORM_NONE:
m_ui.idleLoop->clear(); break;
} }
GBAGetGameCode(gba, m_override.id);
m_override.hardware = gba->memory.hw.devices;
m_override.savetype = gba->memory.savedata.type;
m_override.idleLoop = gba->idleLoop;
m_ui.idleLoop->setEnabled(false);
m_ui.save->setEnabled(m_config);
} }
void OverrideView::gameStopped() { void OverrideView::gameStopped() {
m_ui.tabWidget->setEnabled(true);
m_ui.savetype->setCurrentIndex(0); m_ui.savetype->setCurrentIndex(0);
m_ui.savetype->setEnabled(true);
m_ui.hwAutodetect->setEnabled(true);
m_ui.hwRTC->setEnabled(!m_ui.hwAutodetect->isChecked());
m_ui.hwGyro->setEnabled(!m_ui.hwAutodetect->isChecked());
m_ui.hwLight->setEnabled(!m_ui.hwAutodetect->isChecked());
m_ui.hwTilt->setEnabled(!m_ui.hwAutodetect->isChecked());
m_ui.hwRumble->setEnabled(!m_ui.hwAutodetect->isChecked());
m_ui.hwAutodetect->setChecked(true);
m_ui.hwRTC->setChecked(false);
m_ui.hwGyro->setChecked(false);
m_ui.hwLight->setChecked(false);
m_ui.hwTilt->setChecked(false);
m_ui.hwRumble->setChecked(false);
m_ui.idleLoop->setEnabled(true);
m_ui.idleLoop->clear(); m_ui.idleLoop->clear();
m_ui.save->setEnabled(false); m_ui.mbc->setCurrentIndex(0);
m_ui.gbModel->setCurrentIndex(0);
updateOverrides(); updateOverrides();
} }

View File

@ -8,11 +8,13 @@
#include <QDialog> #include <QDialog>
#include "ui_OverrideView.h" #ifdef M_CORE_GB
extern "C" { extern "C" {
#include "gba/overrides.h" #include "gb/overrides.h"
} }
#endif
#include "ui_OverrideView.h"
struct mCoreThread; struct mCoreThread;
@ -20,6 +22,7 @@ namespace QGBA {
class ConfigController; class ConfigController;
class GameController; class GameController;
class Override;
class OverrideView : public QDialog { class OverrideView : public QDialog {
Q_OBJECT Q_OBJECT
@ -40,7 +43,11 @@ private:
GameController* m_controller; GameController* m_controller;
ConfigController* m_config; ConfigController* m_config;
GBACartridgeOverride m_override;
#ifdef M_CORE_GB
static QList<enum GBModel> s_gbModelList;
static QList<enum GBMemoryBankControllerType> s_mbcList;
#endif
}; };
} }

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>401</width> <width>443</width>
<height>203</height> <height>282</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -19,232 +19,322 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Game Overrides</string> <string>Game Overrides</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint"> <item>
<enum>QLayout::SetFixedSize</enum> <widget class="QTabWidget" name="tabWidget">
</property> <property name="currentIndex">
<item row="4" column="1"> <number>0</number>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="save">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Save</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <widget class="QWidget" name="tabGBA">
<size> <attribute name="title">
<width>0</width> <string>Game Boy Advance</string>
<height>0</height> </attribute>
</size> <layout class="QGridLayout" name="gridLayout">
</property> <item row="0" column="0" rowspan="3">
</spacer> <widget class="QGroupBox" name="groupBox">
</item> <property name="title">
<item row="2" column="1"> <string/>
<widget class="QGroupBox" name="groupBox_2"> </property>
<property name="title"> <layout class="QVBoxLayout" name="verticalLayout_2">
<string/> <item>
</property> <widget class="QCheckBox" name="hwAutodetect">
<layout class="QVBoxLayout" name="verticalLayout_2"> <property name="text">
<item> <string>Autodetect</string>
<layout class="QFormLayout" name="formLayout"> </property>
<item row="0" column="0"> <property name="checked">
<widget class="QLabel" name="label"> <bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwRTC">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Realtime clock</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwGyro">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Gyroscope</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwTilt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Tilt</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwLight">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Light sensor</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwRumble">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Rumble</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Save type</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="savetype">
<item>
<property name="text">
<string>Autodetect</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>SRAM</string>
</property>
</item>
<item>
<property name="text">
<string>Flash 512kb</string>
</property>
</item>
<item>
<property name="text">
<string>Flash 1Mb</string>
</property>
</item>
<item>
<property name="text">
<string>EEPROM</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Idle loop</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="idleLoop"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="hwGBPlayer">
<property name="text">
<string>Game Boy Player features</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabGB">
<attribute name="title">
<string>Game Boy</string>
</attribute>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Game Boy model</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="gbModel">
<item>
<property name="text"> <property name="text">
<string>Save type</string> <string>Autodetect</string>
</property> </property>
</widget> </item>
</item> <item>
<item row="0" column="1">
<widget class="QComboBox" name="savetype">
<item>
<property name="text">
<string>Autodetect</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>SRAM</string>
</property>
</item>
<item>
<property name="text">
<string>Flash 512kb</string>
</property>
</item>
<item>
<property name="text">
<string>Flash 1Mb</string>
</property>
</item>
<item>
<property name="text">
<string>EEPROM</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text"> <property name="text">
<string>Idle loop</string> <string>Game Boy (DMG)</string>
</property> </property>
</widget> </item>
</item> <item>
<item row="2" column="1">
<widget class="QLineEdit" name="idleLoop"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="hwGBPlayer">
<property name="text"> <property name="text">
<string>Game Boy Player features</string> <string>Game Boy Color (CGB)</string>
</property> </property>
</widget> </item>
</item> <item>
<item> <property name="text">
<spacer name="horizontalSpacer_3"> <string>Game Boy Advance (AGB)</string>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> </item>
<size> </widget>
<width>0</width> </item>
<height>0</height> <item row="1" column="0">
</size> <widget class="QLabel" name="label_4">
<property name="text">
<string>Memory bank controller</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mbc">
<item>
<property name="text">
<string>Autodetect</string>
</property> </property>
</spacer> </item>
</item> <item>
</layout> <property name="text">
</item> <string>None</string>
</layout> </property>
</item>
<item>
<property name="text">
<string>MBC1</string>
</property>
</item>
<item>
<property name="text">
<string>MBC2</string>
</property>
</item>
<item>
<property name="text">
<string>MBC3</string>
</property>
</item>
<item>
<property name="text">
<string>MBC3 + RTC</string>
</property>
</item>
<item>
<property name="text">
<string>MBC5</string>
</property>
</item>
<item>
<property name="text">
<string>MBC5 + Rumble</string>
</property>
</item>
<item>
<property name="text">
<string>MBC7</string>
</property>
</item>
<item>
<property name="text">
<string>HuC-3</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item row="2" column="0" rowspan="3"> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="title"> <property name="standardButtons">
<string/> <set>QDialogButtonBox::Close|QDialogButtonBox::Save</set>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="hwAutodetect">
<property name="text">
<string>Autodetect</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwRTC">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Realtime clock</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwGyro">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Gyroscope</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwTilt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Tilt</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwLight">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Light sensor</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="hwRumble">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Rumble</string>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

@ -1318,7 +1318,6 @@ void Window::setupMenu(QMenuBar* menubar) {
#ifdef M_CORE_GBA #ifdef M_CORE_GBA
QAction* overrides = new QAction(tr("Game &overrides..."), toolsMenu); QAction* overrides = new QAction(tr("Game &overrides..."), toolsMenu);
connect(overrides, SIGNAL(triggered()), this, SLOT(openOverrideWindow())); connect(overrides, SIGNAL(triggered()), this, SLOT(openOverrideWindow()));
m_gbaActions.append(overrides);
addControlledAction(toolsMenu, overrides, "overrideWindow"); addControlledAction(toolsMenu, overrides, "overrideWindow");
#endif #endif