This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
forked from SourMesen/Mesen
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from NovaSquirrel/master
Mapper updates
- Loading branch information
Showing
36 changed files
with
1,929 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#pragma once | ||
#include "stdafx.h" | ||
#include "MMC3.h" | ||
|
||
class MMC3_267 : public MMC3 | ||
{ | ||
private: | ||
uint8_t _outerBank = 0; | ||
|
||
protected: | ||
virtual uint16_t RegisterStartAddress() override { return 0x6000; } | ||
virtual uint16_t RegisterEndAddress() override { return 0xFFFF; } | ||
|
||
virtual void Reset(bool softreset) override | ||
{ | ||
_outerBank = 0; | ||
MMC3::UpdateState(); | ||
} | ||
|
||
virtual void StreamState(bool saving) override | ||
{ | ||
MMC3::StreamState(saving); | ||
Stream(_outerBank); | ||
} | ||
|
||
virtual void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override | ||
{ | ||
page &= 0x7F; | ||
page |= (((_outerBank >> 2) & 0x08) | (_outerBank & 0x06)) << 6; | ||
MMC3::SelectCHRPage(slot, page, memoryType); | ||
} | ||
|
||
virtual void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override | ||
{ | ||
page &= 0x1F; | ||
page |= (((_outerBank >> 2) & 0x08) | (_outerBank & 0x06)) << 4; | ||
MMC3::SelectPRGPage(slot, page, memoryType); | ||
} | ||
|
||
void WriteRegister(uint16_t addr, uint8_t value) override | ||
{ | ||
if(addr < 0x8000) { | ||
if(!(_outerBank & 0x80)) { | ||
_outerBank = value; | ||
MMC3::UpdatePrgMapping(); | ||
MMC3::UpdateChrMapping(); | ||
} | ||
} else { | ||
MMC3::WriteRegister(addr, value); | ||
} | ||
} | ||
}; |
Oops, something went wrong.