mirror of
https://github.com/SourMesen/Mesen.git
synced 2025-04-02 10:52:48 -04:00
Hard reset now resets NES ram
This commit is contained in:
parent
3daf877133
commit
586b72e081
3 changed files with 11 additions and 0 deletions
|
@ -98,6 +98,8 @@ void Console::ResetComponents(bool softReset)
|
|||
_ppu->Reset();
|
||||
_apu->Reset();
|
||||
_cpu->Reset(softReset);
|
||||
_memoryManager->Reset(softReset);
|
||||
|
||||
if(softReset) {
|
||||
MessageManager::SendNotification(ConsoleNotificationType::GameReset);
|
||||
} else {
|
||||
|
|
|
@ -41,6 +41,13 @@ MemoryManager::~MemoryManager()
|
|||
delete[] _vramWriteHandlers;
|
||||
}
|
||||
|
||||
void MemoryManager::Reset(bool softReset)
|
||||
{
|
||||
if(!softReset) {
|
||||
memset(_internalRAM, 0, InternalRAMSize);
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t MemoryManager::ReadRegister(uint16_t addr)
|
||||
{
|
||||
if(_ramReadHandlers[addr]) {
|
||||
|
|
|
@ -41,6 +41,8 @@ class MemoryManager: public Snapshotable
|
|||
MemoryManager(shared_ptr<BaseMapper> mapper);
|
||||
~MemoryManager();
|
||||
|
||||
void Reset(bool softReset);
|
||||
|
||||
void InitializeMemoryHandlers(IMemoryHandler** memoryHandlers, IMemoryHandler* handler, vector<uint16_t> *addresses);
|
||||
void RegisterIODevice(IMemoryHandler *handler);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue