Bus: Add memory region access helpers
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
#include "types.h"
|
||||
#include <array>
|
||||
#include <bitset>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -149,4 +150,23 @@ ALWAYS_INLINE TickCount GetDMARAMTickCount(u32 word_count)
|
||||
return static_cast<TickCount>(word_count + ((word_count + 15) / 16));
|
||||
}
|
||||
|
||||
enum class MemoryRegion
|
||||
{
|
||||
RAM,
|
||||
RAMMirror1,
|
||||
RAMMirror2,
|
||||
RAMMirror3,
|
||||
EXP1,
|
||||
Scratchpad,
|
||||
BIOS,
|
||||
Count
|
||||
};
|
||||
|
||||
std::optional<MemoryRegion> GetMemoryRegionForAddress(PhysicalMemoryAddress address);
|
||||
PhysicalMemoryAddress GetMemoryRegionStart(MemoryRegion region);
|
||||
PhysicalMemoryAddress GetMemoryRegionEnd(MemoryRegion region);
|
||||
u8* GetMemoryRegionPointer(MemoryRegion region);
|
||||
std::optional<PhysicalMemoryAddress> SearchMemory(PhysicalMemoryAddress start_address, const u8* pattern,
|
||||
const u8* mask, u32 pattern_length);
|
||||
|
||||
} // namespace Bus
|
||||
|
||||
Reference in New Issue
Block a user