2019-07-25 22:22:09 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "DebugTypes.h"
|
|
|
|
|
|
|
|
class IMemoryHandler;
|
|
|
|
|
|
|
|
class MemoryMappings
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
IMemoryHandler* _handlers[0x100 * 0x10] = {};
|
|
|
|
|
|
|
|
public:
|
2021-03-10 11:13:28 -05:00
|
|
|
void RegisterHandler(uint8_t startBank, uint8_t endBank, uint16_t startPage, uint16_t endPage, vector<unique_ptr<IMemoryHandler>>& handlers, uint16_t pageIncrement = 0, uint16_t startPageNumber = 0);
|
|
|
|
void RegisterHandler(uint8_t startBank, uint8_t endBank, uint16_t startAddr, uint16_t endAddr, IMemoryHandler* handler);
|
2019-07-25 22:22:09 -04:00
|
|
|
|
|
|
|
IMemoryHandler* GetHandler(uint32_t addr);
|
|
|
|
AddressInfo GetAbsoluteAddress(uint32_t addr);
|
2020-02-23 15:58:14 -05:00
|
|
|
int GetRelativeAddress(AddressInfo& absAddress, uint8_t startBank = 0);
|
2019-07-25 22:22:09 -04:00
|
|
|
|
|
|
|
uint8_t Peek(uint32_t addr);
|
|
|
|
uint16_t PeekWord(uint32_t addr);
|
2021-03-10 11:13:28 -05:00
|
|
|
void PeekBlock(uint32_t addr, uint8_t * dest);
|
2020-01-02 19:26:56 -05:00
|
|
|
|
|
|
|
void DebugWrite(uint32_t addr, uint8_t value);
|
2019-07-25 22:22:09 -04:00
|
|
|
};
|