mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-19 03:55:43 -04:00
[kde] MegaDriveView: Display most of the information.
SRAM information isn't displayed yet, and Shift-JIS ROM names aren't decoded correctly.
This commit is contained in:
parent
314b2cd68f
commit
19b2eea6c5
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "MegaDriveView.hpp"
|
#include "MegaDriveView.hpp"
|
||||||
#include "libromdata/MegaDrive.hpp"
|
#include "libromdata/MegaDrive.hpp"
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#include "ui_MegaDriveView.h"
|
#include "ui_MegaDriveView.h"
|
||||||
class MegaDriveViewPrivate
|
class MegaDriveViewPrivate
|
||||||
@ -38,6 +39,11 @@ class MegaDriveViewPrivate
|
|||||||
public:
|
public:
|
||||||
Ui::MegaDriveView ui;
|
Ui::MegaDriveView ui;
|
||||||
const LibRomData::MegaDrive *rom;
|
const LibRomData::MegaDrive *rom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the display widgets.
|
||||||
|
*/
|
||||||
|
void updateDisplay(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** MegaDriveViewPrivate **/
|
/** MegaDriveViewPrivate **/
|
||||||
@ -52,6 +58,57 @@ MegaDriveViewPrivate::~MegaDriveViewPrivate()
|
|||||||
delete rom;
|
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::MegaDriveView(const LibRomData::MegaDrive *rom, QWidget *parent)
|
MegaDriveView::MegaDriveView(const LibRomData::MegaDrive *rom, QWidget *parent)
|
||||||
@ -60,6 +117,9 @@ MegaDriveView::MegaDriveView(const LibRomData::MegaDrive *rom, QWidget *parent)
|
|||||||
{
|
{
|
||||||
Q_D(MegaDriveView);
|
Q_D(MegaDriveView);
|
||||||
d->ui.setupUi(this);
|
d->ui.setupUi(this);
|
||||||
|
|
||||||
|
// Update the display widgets.
|
||||||
|
d->updateDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
MegaDriveView::~MegaDriveView()
|
MegaDriveView::~MegaDriveView()
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>373</width>
|
<width>483</width>
|
||||||
<height>359</height>
|
<height>373</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
@ -29,6 +29,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
@ -46,10 +49,13 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="lblDomesticTitleDesc">
|
<widget class="QLabel" name="lblTitleDomesticDesc">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Domestic Title:</string>
|
<string>Domestic Title:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -59,14 +65,17 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="lblDomesticTitle">
|
<widget class="QLabel" name="lblTitleDomestic">
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lblExportTitleDesc">
|
<widget class="QLabel" name="lblTitleExportDesc">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Export Title:</string>
|
<string>Export Title:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -76,10 +85,13 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="lblExportTitle">
|
<widget class="QLabel" name="lblTitleExport">
|
||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
@ -97,6 +109,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
@ -114,6 +129,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
@ -133,6 +151,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@ -287,6 +308,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="9" column="0">
|
||||||
@ -304,6 +328,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="10" column="0">
|
||||||
@ -321,6 +348,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="11" column="0">
|
||||||
@ -338,6 +368,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="12" column="0">
|
<item row="12" column="0">
|
||||||
@ -355,6 +388,9 @@
|
|||||||
<property name="textFormat">
|
<property name="textFormat">
|
||||||
<enum>Qt::PlainText</enum>
|
<enum>Qt::PlainText</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
Loading…
Reference in New Issue
Block a user