diff --git a/src/kde/MegaDriveView.cpp b/src/kde/MegaDriveView.cpp index 834c92969..e512c4873 100644 --- a/src/kde/MegaDriveView.cpp +++ b/src/kde/MegaDriveView.cpp @@ -21,6 +21,7 @@ #include "MegaDriveView.hpp" #include "libromdata/MegaDrive.hpp" +#include #include "ui_MegaDriveView.h" class MegaDriveViewPrivate @@ -38,6 +39,11 @@ class MegaDriveViewPrivate public: Ui::MegaDriveView ui; const LibRomData::MegaDrive *rom; + + /** + * Update the display widgets. + */ + void updateDisplay(void); }; /** MegaDriveViewPrivate **/ @@ -52,6 +58,57 @@ MegaDriveViewPrivate::~MegaDriveViewPrivate() delete rom; } +/** + * Update the display widgets. + */ +void MegaDriveViewPrivate::updateDisplay(void) +{ + ui.lblSystem->setText(QString::fromUtf8(rom->m_system.c_str())); + ui.lblCopyright->setText(QString::fromUtf8(rom->m_copyright.c_str())); + ui.lblTitleDomestic->setText(QString::fromUtf8(rom->m_title_domestic.c_str())); + ui.lblTitleExport->setText(QString::fromUtf8(rom->m_title_export.c_str())); + ui.lblSerialNumber->setText(QString::fromUtf8(rom->m_serial.c_str())); + // TODO: Company. + + // Checksum, in hex. + char buf[128]; + snprintf(buf, sizeof(buf), "0x%04X", rom->m_checksum); + ui.lblChecksum->setText(QLatin1String(buf)); + // FIXME: Verify checksum? + ui.lblChecksumStatus->setVisible(false); + + // I/O support. + ui.chkIO3btn->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_JOYPAD_3)); + ui.chkIO6btn->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_JOYPAD_6)); + ui.chkIO2btn->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_JOYPAD_SMS)); + ui.chkIOTeamPlayer->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_TEAM_PLAYER)); + ui.chkIOKeyboard->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_KEYBOARD)); + ui.chkIOSerial->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_SERIAL)); + ui.chkIOPrinter->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_PRINTER)); + ui.chkIOTablet->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_TABLET)); + ui.chkIOTrackball->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_TRACKBALL)); + ui.chkIOPaddle->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_PADDLE)); + ui.chkIOFloppy->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_FDD)); + ui.chkIOMegaCD->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_CDROM)); + ui.chkIOActivator->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_ACTIVATOR)); + ui.chkIOMegaMouse->setChecked(!!(rom->m_io_support & LibRomData::MegaDrive::IO_MEGA_MOUSE)); + + // ROM range. + snprintf(buf, sizeof(buf), "0x%08X - 0x%08X", rom->m_rom_start, rom->m_rom_end); + ui.lblROMRange->setText(QLatin1String(buf)); + // RAM range. + snprintf(buf, sizeof(buf), "0x%08X - 0x%08X", rom->m_ram_start, rom->m_ram_end); + ui.lblRAMRange->setText(QLatin1String(buf)); + + // TODO: SRAM. + + // Vectors. + snprintf(buf, sizeof(buf), "0x%08X", rom->m_entry_point); + ui.lblEntryPoint->setText(QLatin1String(buf)); + snprintf(buf, sizeof(buf), "0x%08X", rom->m_initial_sp); + ui.lblInitialSP->setText(QLatin1String(buf)); +} + /** MegaDriveView **/ MegaDriveView::MegaDriveView(const LibRomData::MegaDrive *rom, QWidget *parent) @@ -60,6 +117,9 @@ MegaDriveView::MegaDriveView(const LibRomData::MegaDrive *rom, QWidget *parent) { Q_D(MegaDriveView); d->ui.setupUi(this); + + // Update the display widgets. + d->updateDisplay(); } MegaDriveView::~MegaDriveView() diff --git a/src/kde/MegaDriveView.ui b/src/kde/MegaDriveView.ui index bc054d34b..81303502a 100644 --- a/src/kde/MegaDriveView.ui +++ b/src/kde/MegaDriveView.ui @@ -6,8 +6,8 @@ 0 0 - 373 - 359 + 483 + 373 @@ -29,6 +29,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -46,10 +49,13 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + - + Domestic Title: @@ -59,14 +65,17 @@ - + Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + - + Export Title: @@ -76,10 +85,13 @@ - + Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -97,6 +109,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -114,6 +129,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -133,6 +151,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -287,6 +308,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -304,6 +328,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -321,6 +348,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -338,6 +368,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + @@ -355,6 +388,9 @@ Qt::PlainText + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse +