Added 401C-401F addressing to all mappers, more EPSM renaming

This commit is contained in:
Perkka2 2021-07-30 16:06:29 +02:00
parent 000bfb1a71
commit d06a647428
8 changed files with 29 additions and 20 deletions

View file

@ -783,6 +783,7 @@ uint8_t BaseMapper::DebugReadRAM(uint16_t addr)
void BaseMapper::WriteRAM(uint16_t addr, uint8_t value) void BaseMapper::WriteRAM(uint16_t addr, uint8_t value)
{ {
if((addr == 0x4016) & (_console->GetCpu()->GetCycleCount() % 2 == 1)){ WriteEPSM(addr, value); } if((addr == 0x4016) & (_console->GetCpu()->GetCycleCount() % 2 == 1)){ WriteEPSM(addr, value); }
if ((addr >= 0x401c && addr <= 0x401f)) { WriteEPSM(addr, value); }
if(_isWriteRegisterAddr[addr]) { if(_isWriteRegisterAddr[addr]) {
if(_hasBusConflicts) { if(_hasBusConflicts) {
uint8_t prgValue = _prgPages[addr >> 8][(uint8_t)addr]; uint8_t prgValue = _prgPages[addr >> 8][(uint8_t)addr];

View file

@ -177,6 +177,10 @@ public:
WriteToChip(a04016 | (a14016 << 1), writeValue); WriteToChip(a04016 | (a14016 << 1), writeValue);
} }
} }
if (addr == 0x401c) { addr = 0xC000; }
if (addr == 0x401d) { addr = 0xE000; }
if (addr == 0x401e) { addr = 0xC002; }
if (addr == 0x401f) { addr = 0xE002; }
switch(addr) { switch(addr) {
case 0xC000: case 0xC000:

View file

@ -133,7 +133,7 @@ void MemoryManager::Write(uint16_t addr, uint8_t value, MemoryOperationType oper
{ {
if(_console->DebugProcessRamOperation(operationType, addr, value)) { if(_console->DebugProcessRamOperation(operationType, addr, value)) {
_ramWriteHandlers[addr]->WriteRAM(addr, value); _ramWriteHandlers[addr]->WriteRAM(addr, value);
if (addr == 0x4016) { if ((addr == 0x4016) | (addr >= 0x401c && addr <= 0x401f)) {
_ramWriteHandlers[0xE000]->WriteRAM(addr, value); _ramWriteHandlers[0xE000]->WriteRAM(addr, value);
} }
} }

View file

@ -90,6 +90,9 @@ void NsfLoader::InitializeFromHeader(RomData &romData)
if (header.SoundChips & 0x20) { if (header.SoundChips & 0x20) {
chips.push_back("Sunsoft 5B"); chips.push_back("Sunsoft 5B");
} }
if (header.SoundChips & 0x40) {
chips.push_back("VT02");
}
if (header.SoundChips & 0x80) { if (header.SoundChips & 0x80) {
chips.push_back("EPSM"); chips.push_back("EPSM");
} }

View file

@ -111,7 +111,7 @@ void NsfMapper::InitMapper(RomData& romData)
if(_nsfHeader.SoundChips & NsfSoundChips::EPSM) { if(_nsfHeader.SoundChips & NsfSoundChips::EPSM) {
AddRegisterRange(0x4016, 0x4016, MemoryOperation::Write); AddRegisterRange(0x4016, 0x4016, MemoryOperation::Write);
AddRegisterRange(0xC000, 0xFFFF, MemoryOperation::Write); AddRegisterRange(0x401c, 0x401f, MemoryOperation::Write);
} }
} }
@ -360,7 +360,7 @@ void NsfMapper::WriteRegister(uint16_t addr, uint8_t value)
} else if((_nsfHeader.SoundChips & NsfSoundChips::Sunsoft) && addr >= 0xC000 && addr <= 0xFFFF) { } else if((_nsfHeader.SoundChips & NsfSoundChips::Sunsoft) && addr >= 0xC000 && addr <= 0xFFFF) {
_sunsoftAudio->WriteRegister(addr, value); _sunsoftAudio->WriteRegister(addr, value);
} }
else if ((_nsfHeader.SoundChips & NsfSoundChips::EPSM) && addr >= 0xC000 && addr <= 0xFFFF) { else if ((_nsfHeader.SoundChips & NsfSoundChips::EPSM) && addr >= 0x401C && addr <= 0x401F) {
_epsmAudio->WriteRegister(addr, value); _epsmAudio->WriteRegister(addr, value);
} }
else { else {
@ -495,11 +495,11 @@ void NsfMapper::StreamState(bool saving)
SnapshotInfo fdsAudio { _fdsAudio.get() }; SnapshotInfo fdsAudio { _fdsAudio.get() };
SnapshotInfo namcoAudio { _namcoAudio.get() }; SnapshotInfo namcoAudio { _namcoAudio.get() };
SnapshotInfo sunsoftAudio { _sunsoftAudio.get() }; SnapshotInfo sunsoftAudio { _sunsoftAudio.get() };
SnapshotInfo epsmAudio{ _epsmAudio.get() }; SnapshotInfo epsgAudio{ _epsmAudio.get() };
Stream( Stream(
_model, _needInit, _irqEnabled, _irqReloadValue, _irqCounter, _irqStatus, _debugIrqStatus, _mmc5MultiplierValues[0], _mmc5MultiplierValues[1], _model, _needInit, _irqEnabled, _irqReloadValue, _irqCounter, _irqStatus, _debugIrqStatus, _mmc5MultiplierValues[0], _mmc5MultiplierValues[1],
_trackEndCounter, _trackFadeCounter, _fadeLength, _silenceDetectDelay, _trackEnded, _allowSilenceDetection, _hasBankSwitching, _ntscSpeed, _trackEndCounter, _trackFadeCounter, _fadeLength, _silenceDetectDelay, _trackEnded, _allowSilenceDetection, _hasBankSwitching, _ntscSpeed,
_palSpeed, _dendySpeed, _songNumber, mmc5Audio, vrc6Audio, vrc7Audio, fdsAudio, namcoAudio, sunsoftAudio, epsmAudio _palSpeed, _dendySpeed, _songNumber, mmc5Audio, vrc6Audio, vrc7Audio, fdsAudio, namcoAudio, sunsoftAudio, epsgAudio
); );
} }

View file

@ -27,6 +27,7 @@ private:
MMC5 = 0x08, MMC5 = 0x08,
Namco = 0x10, Namco = 0x10,
Sunsoft = 0x20, Sunsoft = 0x20,
VT02 = 0x40,
EPSM = 0x80 EPSM = 0x80
}; };

View file

@ -46,7 +46,7 @@
this.lblSunsoft = new System.Windows.Forms.Label(); this.lblSunsoft = new System.Windows.Forms.Label();
this.lblVrc6 = new System.Windows.Forms.Label(); this.lblVrc6 = new System.Windows.Forms.Label();
this.lblVrc7 = new System.Windows.Forms.Label(); this.lblVrc7 = new System.Windows.Forms.Label();
this.lblEpsg = new System.Windows.Forms.Label(); this.lblEpsm = new System.Windows.Forms.Label();
this.lblSoundChips = new System.Windows.Forms.Label(); this.lblSoundChips = new System.Windows.Forms.Label();
this.trkVolume = new System.Windows.Forms.TrackBar(); this.trkVolume = new System.Windows.Forms.TrackBar();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
@ -268,7 +268,7 @@
this.tableLayoutPanel3.Controls.Add(this.lblSunsoft, 3, 0); this.tableLayoutPanel3.Controls.Add(this.lblSunsoft, 3, 0);
this.tableLayoutPanel3.Controls.Add(this.lblVrc6, 4, 0); this.tableLayoutPanel3.Controls.Add(this.lblVrc6, 4, 0);
this.tableLayoutPanel3.Controls.Add(this.lblVrc7, 5, 0); this.tableLayoutPanel3.Controls.Add(this.lblVrc7, 5, 0);
this.tableLayoutPanel3.Controls.Add(this.lblEpsg, 6, 0); this.tableLayoutPanel3.Controls.Add(this.lblEpsm, 6, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(101, 66); this.tableLayoutPanel3.Location = new System.Drawing.Point(101, 66);
this.tableLayoutPanel3.Name = "tableLayoutPanel3"; this.tableLayoutPanel3.Name = "tableLayoutPanel3";
@ -357,18 +357,18 @@
this.lblVrc7.TabIndex = 3; this.lblVrc7.TabIndex = 3;
this.lblVrc7.Text = "VRC7"; this.lblVrc7.Text = "VRC7";
// //
// lblEpsg // lblEpsm
// //
this.lblEpsg.AutoSize = true; this.lblEpsm.AutoSize = true;
this.lblEpsg.BackColor = System.Drawing.Color.Transparent; this.lblEpsm.BackColor = System.Drawing.Color.Transparent;
this.lblEpsg.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblEpsm.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblEpsg.ForeColor = System.Drawing.Color.White; this.lblEpsm.ForeColor = System.Drawing.Color.White;
this.lblEpsg.Location = new System.Drawing.Point(220, 0); this.lblEpsm.Location = new System.Drawing.Point(220, 0);
this.lblEpsg.Margin = new System.Windows.Forms.Padding(0); this.lblEpsm.Margin = new System.Windows.Forms.Padding(0);
this.lblEpsg.Name = "lblEpsg"; this.lblEpsm.Name = "lblEpsm";
this.lblEpsg.Size = new System.Drawing.Size(35, 13); this.lblEpsm.Size = new System.Drawing.Size(35, 13);
this.lblEpsg.TabIndex = 3; this.lblEpsm.TabIndex = 3;
this.lblEpsg.Text = "EPSM"; this.lblEpsm.Text = "EPSM";
// //
// lblSoundChips // lblSoundChips
// //
@ -743,7 +743,7 @@
private System.Windows.Forms.Label lblSunsoft; private System.Windows.Forms.Label lblSunsoft;
private System.Windows.Forms.Label lblVrc6; private System.Windows.Forms.Label lblVrc6;
private System.Windows.Forms.Label lblVrc7; private System.Windows.Forms.Label lblVrc7;
private System.Windows.Forms.Label lblEpsg; private System.Windows.Forms.Label lblEpsm;
private System.Windows.Forms.Label lblMmc5; private System.Windows.Forms.Label lblMmc5;
private System.Windows.Forms.Label lblNamco; private System.Windows.Forms.Label lblNamco;
private System.Windows.Forms.Label lblFds; private System.Windows.Forms.Label lblFds;

View file

@ -274,7 +274,7 @@ namespace Mesen.GUI.Controls
lblMmc5.ForeColor = (header.SoundChips & 0x08) == 0x08 ? Color.White : Color.Gray; lblMmc5.ForeColor = (header.SoundChips & 0x08) == 0x08 ? Color.White : Color.Gray;
lblNamco.ForeColor = (header.SoundChips & 0x10) == 0x10 ? Color.White : Color.Gray; lblNamco.ForeColor = (header.SoundChips & 0x10) == 0x10 ? Color.White : Color.Gray;
lblSunsoft.ForeColor = (header.SoundChips & 0x20) == 0x20 ? Color.White : Color.Gray; lblSunsoft.ForeColor = (header.SoundChips & 0x20) == 0x20 ? Color.White : Color.Gray;
lblEpsg.ForeColor = (header.SoundChips & 0x40) == 0x40 ? Color.White : Color.Gray; lblEpsm.ForeColor = (header.SoundChips & 0x80) == 0x80 ? Color.White : Color.Gray;
if (InteropEmu.IsPaused()) { if (InteropEmu.IsPaused()) {
btnPause.Image = Properties.Resources.Play; btnPause.Image = Properties.Resources.Play;