mirror of https://github.com/mgba-emu/mgba.git
Qt: Warning dialog if an unimplemented BIOS feature is called (fixes #177)
This commit is contained in:
parent
740f733563
commit
3d8cfda57d
1
CHANGES
1
CHANGES
|
@ -32,6 +32,7 @@ Features:
|
||||||
- Local link cable support
|
- Local link cable support
|
||||||
- Ability to switch which game controller is in use per instance
|
- Ability to switch which game controller is in use per instance
|
||||||
- Ability to prevent opposing directional input
|
- Ability to prevent opposing directional input
|
||||||
|
- Warning dialog if an unimplemented BIOS feature is called
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- ARM7: Extend prefetch by one stage
|
- ARM7: Extend prefetch by one stage
|
||||||
- GBA Audio: Support 16-bit writes to FIFO audio
|
- GBA Audio: Support 16-bit writes to FIFO audio
|
||||||
|
|
|
@ -118,7 +118,14 @@ GameController::GameController(QObject* parent)
|
||||||
};
|
};
|
||||||
|
|
||||||
m_threadContext.logHandler = [] (GBAThread* context, enum GBALogLevel level, const char* format, va_list args) {
|
m_threadContext.logHandler = [] (GBAThread* context, enum GBALogLevel level, const char* format, va_list args) {
|
||||||
|
static const char* stubMessage = "Stub software interrupt";
|
||||||
GameController* controller = static_cast<GameController*>(context->userData);
|
GameController* controller = static_cast<GameController*>(context->userData);
|
||||||
|
if (level == GBA_LOG_STUB && strncmp(stubMessage, format, strlen(stubMessage)) == 0) {
|
||||||
|
va_list argc;
|
||||||
|
va_copy(argc, args);
|
||||||
|
int immediate = va_arg(argc, int);
|
||||||
|
controller->unimplementedBiosCall(immediate);
|
||||||
|
}
|
||||||
if (level == GBA_LOG_FATAL) {
|
if (level == GBA_LOG_FATAL) {
|
||||||
QMetaObject::invokeMethod(controller, "crashGame", Q_ARG(const QString&, QString().vsprintf(format, args)));
|
QMetaObject::invokeMethod(controller, "crashGame", Q_ARG(const QString&, QString().vsprintf(format, args)));
|
||||||
} else if (!(controller->m_logLevels & level)) {
|
} else if (!(controller->m_logLevels & level)) {
|
||||||
|
|
|
@ -85,6 +85,7 @@ signals:
|
||||||
void gameCrashed(const QString& errorMessage);
|
void gameCrashed(const QString& errorMessage);
|
||||||
void gameFailed();
|
void gameFailed();
|
||||||
void stateLoaded(GBAThread*);
|
void stateLoaded(GBAThread*);
|
||||||
|
void unimplementedBiosCall(int);
|
||||||
|
|
||||||
void luminanceValueChanged(int);
|
void luminanceValueChanged(int);
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,7 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent)
|
||||||
connect(m_controller, SIGNAL(frameAvailable(const uint32_t*)), this, SLOT(recordFrame()));
|
connect(m_controller, SIGNAL(frameAvailable(const uint32_t*)), this, SLOT(recordFrame()));
|
||||||
connect(m_controller, SIGNAL(gameCrashed(const QString&)), this, SLOT(gameCrashed(const QString&)));
|
connect(m_controller, SIGNAL(gameCrashed(const QString&)), this, SLOT(gameCrashed(const QString&)));
|
||||||
connect(m_controller, SIGNAL(gameFailed()), this, SLOT(gameFailed()));
|
connect(m_controller, SIGNAL(gameFailed()), this, SLOT(gameFailed()));
|
||||||
|
connect(m_controller, SIGNAL(unimplementedBiosCall(int)), this, SLOT(unimplementedBiosCall(int)));
|
||||||
connect(m_logView, SIGNAL(levelsSet(int)), m_controller, SLOT(setLogLevel(int)));
|
connect(m_logView, SIGNAL(levelsSet(int)), m_controller, SLOT(setLogLevel(int)));
|
||||||
connect(m_logView, SIGNAL(levelsEnabled(int)), m_controller, SLOT(enableLogLevel(int)));
|
connect(m_logView, SIGNAL(levelsEnabled(int)), m_controller, SLOT(enableLogLevel(int)));
|
||||||
connect(m_logView, SIGNAL(levelsDisabled(int)), m_controller, SLOT(disableLogLevel(int)));
|
connect(m_logView, SIGNAL(levelsDisabled(int)), m_controller, SLOT(disableLogLevel(int)));
|
||||||
|
@ -411,6 +412,7 @@ void Window::gameStarted(GBAThread* context) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
m_hitUnimplementedBiosCall = false;
|
||||||
m_fpsTimer.start();
|
m_fpsTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,6 +444,19 @@ void Window::gameFailed() {
|
||||||
fail->show();
|
fail->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::unimplementedBiosCall(int call) {
|
||||||
|
if (m_hitUnimplementedBiosCall) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_hitUnimplementedBiosCall = true;
|
||||||
|
|
||||||
|
QMessageBox* fail = new QMessageBox(QMessageBox::Warning, tr("Unimplemented BIOS call"),
|
||||||
|
tr("This game uses a BIOS call that is not implemented. Please use the official BIOS for best experience."),
|
||||||
|
QMessageBox::Ok, this, Qt::Sheet);
|
||||||
|
fail->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
fail->show();
|
||||||
|
}
|
||||||
|
|
||||||
void Window::recordFrame() {
|
void Window::recordFrame() {
|
||||||
m_frameList.append(QDateTime::currentDateTime());
|
m_frameList.append(QDateTime::currentDateTime());
|
||||||
while (m_frameList.count() > FRAME_LIST_SIZE) {
|
while (m_frameList.count() > FRAME_LIST_SIZE) {
|
||||||
|
|
|
@ -101,6 +101,7 @@ private slots:
|
||||||
void gameStopped();
|
void gameStopped();
|
||||||
void gameCrashed(const QString&);
|
void gameCrashed(const QString&);
|
||||||
void gameFailed();
|
void gameFailed();
|
||||||
|
void unimplementedBiosCall(int);
|
||||||
|
|
||||||
void recordFrame();
|
void recordFrame();
|
||||||
void showFPS();
|
void showFPS();
|
||||||
|
@ -136,6 +137,8 @@ private:
|
||||||
ShortcutController* m_shortcutController;
|
ShortcutController* m_shortcutController;
|
||||||
int m_playerId;
|
int m_playerId;
|
||||||
|
|
||||||
|
bool m_hitUnimplementedBiosCall;
|
||||||
|
|
||||||
#ifdef USE_FFMPEG
|
#ifdef USE_FFMPEG
|
||||||
VideoView* m_videoView;
|
VideoView* m_videoView;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue