Skip to content
Permalink
Browse files

Adding GTROM mapper 111.

  • Loading branch information...
christopherpow committed Feb 1, 2019
1 parent 4cf8a17 commit 757ffd4d72ef3a19cf2cd7fdd6a26c0f89ee9d36
@@ -42,6 +42,7 @@ MapperInformationDockWidget::MapperInformationDockWidget(QWidget *parent) :
internalPageMap.insert(19,ui->mapper19);
internalPageMap.insert(28,ui->mapper28);
internalPageMap.insert(69,ui->mapper69);
internalPageMap.insert(111,ui->mapper111);
internalPageMap.insert(159,ui->mapper16);

// Force UI update so it doesn't look uninitialized completely.
@@ -124,6 +125,7 @@ void MapperInformationDockWidget::updateInformation()
nesMapper028Info mapper028Info;
nesMapper069Info mapper069Info;
uint16_t mirroring[4];
uint8_t reg;

// Show mirroring...
nesGetMirroring(&(mirroring[0]),&(mirroring[1]),&(mirroring[2]),&(mirroring[3]));
@@ -308,6 +310,28 @@ void MapperInformationDockWidget::updateInformation()
sprintf ( buffer, "%02X", mapper069Info.regValue );
ui->regValue69->setText(buffer);
break;
case 111:
reg = nesMapperLowRead(0x5000);
// red LED
if ( reg&0x40 )
{
ui->redLED->setStyleSheet("");
}
else
{
ui->redLED->setStyleSheet("QLabel { background-color: red; }");
}
// green LED
if ( reg&0x80 )
{
ui->greenLED->setStyleSheet("");
}
else
{
ui->greenLED->setStyleSheet("QLabel { background-color: green; }");
}
ui->nameTableMapping->setText(QString::number((reg&0x20)>>5));
break;
}

// Check breakpoints for hits and highlight if necessary...
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>386</width>
<height>293</height>
<width>471</width>
<height>364</height>
</rect>
</property>
<property name="windowTitle">
@@ -354,12 +354,21 @@
<number>0</number>
</property>
<property name="currentIndex">
<number>4</number>
<number>8</number>
</property>
<widget class="QWidget" name="noInternals"/>
<widget class="QWidget" name="mapper1">
<layout class="QGridLayout" name="gridLayout_4">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@@ -407,7 +416,16 @@
</widget>
<widget class="QWidget" name="mapper4">
<layout class="QGridLayout" name="gridLayout_5">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="2" column="2">
@@ -491,7 +509,16 @@
</widget>
<widget class="QWidget" name="mapper9and10">
<layout class="QGridLayout" name="gridLayout_10">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@@ -551,7 +578,16 @@
</widget>
<widget class="QWidget" name="mapper16">
<layout class="QGridLayout" name="gridLayout_12">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@@ -648,14 +684,32 @@
</widget>
<widget class="QWidget" name="mapper19">
<layout class="QGridLayout" name="gridLayout_11">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget>
<widget class="QWidget" name="mapper28">
<layout class="QGridLayout" name="gridLayout_9">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="0">
@@ -732,7 +786,16 @@
</widget>
<widget class="QWidget" name="mapper69">
<layout class="QGridLayout" name="gridLayout_6">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="1" column="0">
@@ -835,6 +898,59 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mapper111">
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>LEDs</string>
</property>
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<widget class="QLabel" name="redLED">
<property name="text">
<string>Red</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="greenLED">
<property name="text">
<string>Green</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_45">
<property name="text">
<string>NameTable mapping:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="nameTableMapping"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
@@ -30,7 +30,7 @@ static CBitfieldData* tbl5000_5FFFBitfields [] =

static CRegisterData* tblRegisters [] =
{
new CRegisterData(0x5000, "Bank Select", nesMapperHighRead, nesMapperHighWrite, 1, tbl5000_5FFFBitfields)
new CRegisterData(0x5000, "Bank Select", nesMapperHighRead, nesMapperHighWrite, 5, tbl5000_5FFFBitfields)
};

static const char* rowHeadings [] =
@@ -65,8 +65,8 @@ void CROMMapper111::RESET ( bool soft )

m_pPRGROMmemory [ 0 ] = m_PRGROMmemory [ 0 ];
m_pPRGROMmemory [ 1 ] = m_PRGROMmemory [ 1 ];
m_pPRGROMmemory [ 2 ] = m_PRGROMmemory [ m_numPrgBanks-2 ];
m_pPRGROMmemory [ 3 ] = m_PRGROMmemory [ m_numPrgBanks-1 ];
m_pPRGROMmemory [ 2 ] = m_PRGROMmemory [ 2 ];
m_pPRGROMmemory [ 3 ] = m_PRGROMmemory [ 3 ];

// CHR ROM/RAM already set up in CROM::RESET()...
}
@@ -78,6 +78,28 @@ uint32_t CROMMapper111::DEBUGINFO ( uint32_t addr )

void CROMMapper111::LMAPPER ( uint32_t addr, uint8_t data )
{
uint8_t bank;

m_reg = data;

bank = (m_reg&0x0f)<<2;

m_pPRGROMmemory [ 0 ] = m_PRGROMmemory [ bank ];
m_pPRGROMmemory [ 1 ] = m_PRGROMmemory [ bank+1 ];
m_pPRGROMmemory [ 2 ] = m_PRGROMmemory [ bank+2 ];
m_pPRGROMmemory [ 3 ] = m_PRGROMmemory [ bank+3 ];

bank = (m_reg&0x10)>>1;

m_pCHRmemory [ 0 ] = m_CHRmemory [ bank+0 ];
m_pCHRmemory [ 1 ] = m_CHRmemory [ bank+1 ];
m_pCHRmemory [ 2 ] = m_CHRmemory [ bank+2 ];
m_pCHRmemory [ 3 ] = m_CHRmemory [ bank+3 ];
m_pCHRmemory [ 4 ] = m_CHRmemory [ bank+4 ];
m_pCHRmemory [ 5 ] = m_CHRmemory [ bank+5 ];
m_pCHRmemory [ 6 ] = m_CHRmemory [ bank+6 ];
m_pCHRmemory [ 7 ] = m_CHRmemory [ bank+7 ];

if ( nesIsDebuggable() )
{
// Check mapper state breakpoints...

0 comments on commit 757ffd4

Please sign in to comment.
You can’t perform that action at this time.