mirror of https://github.com/mgba-emu/mgba.git
GB: Add GB/GBC No-Intro databases
This commit is contained in:
parent
4e7f70c102
commit
d8dc368f36
18193
res/nointro.dat
18193
res/nointro.dat
File diff suppressed because it is too large
Load Diff
|
@ -31,6 +31,7 @@ ROMInfo::ROMInfo(GameController* controller, QWidget* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
const NoIntroDB* db = GBAApp::app()->gameDB();
|
const NoIntroDB* db = GBAApp::app()->gameDB();
|
||||||
|
uint32_t crc32 = 0;
|
||||||
|
|
||||||
controller->threadInterrupt();
|
controller->threadInterrupt();
|
||||||
mCore* core = controller->thread()->core;
|
mCore* core = controller->thread()->core;
|
||||||
|
@ -50,17 +51,7 @@ ROMInfo::ROMInfo(GameController* controller, QWidget* parent)
|
||||||
case PLATFORM_GBA: {
|
case PLATFORM_GBA: {
|
||||||
GBA* gba = static_cast<GBA*>(core->board);
|
GBA* gba = static_cast<GBA*>(core->board);
|
||||||
m_ui.size->setText(QString::number(gba->pristineRomSize) + tr(" bytes"));
|
m_ui.size->setText(QString::number(gba->pristineRomSize) + tr(" bytes"));
|
||||||
m_ui.crc->setText(QString::number(gba->romCrc32, 16));
|
crc32 = gba->romCrc32;
|
||||||
if (db) {
|
|
||||||
NoIntroGame game;
|
|
||||||
if (NoIntroDBLookupGameByCRC(db, gba->romCrc32, &game)) {
|
|
||||||
m_ui.name->setText(game.name);
|
|
||||||
} else {
|
|
||||||
m_ui.name->setText(tr("(unknown)"));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
m_ui.name->setText(tr("(no database present)"));
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -68,16 +59,29 @@ ROMInfo::ROMInfo(GameController* controller, QWidget* parent)
|
||||||
case PLATFORM_GB: {
|
case PLATFORM_GB: {
|
||||||
GB* gb = static_cast<GB*>(core->board);
|
GB* gb = static_cast<GB*>(core->board);
|
||||||
m_ui.size->setText(QString::number(gb->pristineRomSize) + tr(" bytes"));
|
m_ui.size->setText(QString::number(gb->pristineRomSize) + tr(" bytes"));
|
||||||
m_ui.crc->setText(QString::number(gb->romCrc32, 16));
|
crc32 = gb->romCrc32;
|
||||||
m_ui.name->setText(tr("(unknown)"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
m_ui.size->setText(tr("(unknown)"));
|
m_ui.size->setText(tr("(unknown)"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (crc32) {
|
||||||
|
m_ui.crc->setText(QString::number(crc32, 16));
|
||||||
|
if (db) {
|
||||||
|
NoIntroGame game;
|
||||||
|
if (NoIntroDBLookupGameByCRC(db, crc32, &game)) {
|
||||||
|
m_ui.name->setText(game.name);
|
||||||
|
} else {
|
||||||
|
m_ui.name->setText(tr("(unknown)"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
m_ui.name->setText(tr("(no database present)"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
m_ui.crc->setText(tr("(unknown)"));
|
m_ui.crc->setText(tr("(unknown)"));
|
||||||
m_ui.name->setText(tr("(unknown)"));
|
m_ui.name->setText(tr("(unknown)"));
|
||||||
|
|
||||||
}
|
}
|
||||||
controller->threadContinue();
|
controller->threadContinue();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
#include "VideoView.h"
|
#include "VideoView.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef M_CORE_GB
|
||||||
|
#include "gb/gb.h"
|
||||||
|
#endif
|
||||||
#include "platform/commandline.h"
|
#include "platform/commandline.h"
|
||||||
#include "util/nointro.h"
|
#include "util/nointro.h"
|
||||||
#include "util/vfs.h"
|
#include "util/vfs.h"
|
||||||
|
@ -733,8 +736,29 @@ void Window::updateTitle(float fps) {
|
||||||
if (m_controller->isLoaded()) {
|
if (m_controller->isLoaded()) {
|
||||||
const NoIntroDB* db = GBAApp::app()->gameDB();
|
const NoIntroDB* db = GBAApp::app()->gameDB();
|
||||||
NoIntroGame game;
|
NoIntroGame game;
|
||||||
if (m_controller->thread()->core->platform(m_controller->thread()->core) == PLATFORM_GBA && db &&
|
uint32_t crc32 = 0;
|
||||||
NoIntroDBLookupGameByCRC(db, static_cast<GBA*>(m_controller->thread()->core->board)->romCrc32, &game)) {
|
|
||||||
|
switch (m_controller->thread()->core->platform(m_controller->thread()->core)) {
|
||||||
|
#ifdef M_CORE_GBA
|
||||||
|
case PLATFORM_GBA: {
|
||||||
|
GBA* gba = static_cast<GBA*>(m_controller->thread()->core->board);
|
||||||
|
crc32 = gba->romCrc32;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef M_CORE_GB
|
||||||
|
case PLATFORM_GB: {
|
||||||
|
GB* gb = static_cast<GB*>(m_controller->thread()->core->board);
|
||||||
|
crc32 = gb->romCrc32;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (db && crc32) {
|
||||||
|
NoIntroDBLookupGameByCRC(db, crc32, &game);
|
||||||
title = QLatin1String(game.name);
|
title = QLatin1String(game.name);
|
||||||
} else {
|
} else {
|
||||||
char gameTitle[17] = { '\0' };
|
char gameTitle[17] = { '\0' };
|
||||||
|
|
Loading…
Reference in New Issue