// Public source: https://vccplus-git.brianholman.com/VCCPlus/VCCPlusOSS/src/branch/main/src/core/CpuMemory.h
// Selected code lines: 22; selection, not the full current source.
// Original copyright/license notice and selected code follow unchanged.
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
// CPU bus contract. By default this uses the real MMU and I/O decoder.
void MemWrite8(unsigned char value, unsigned short address);
void MemWrite16(unsigned short value, unsigned short address);
unsigned char MemRead8(unsigned short address);
unsigned short MemRead16(unsigned short address);
void SetMapType(unsigned char type);
namespace VCC {
// Optional isolated CPU bus (e.g. instruction tests). Install outside execution,
// retain until detached, and restore nullptr for the actual machine MMU.
class CpuMemoryBus {
public:
virtual ~CpuMemoryBus() = default;
virtual unsigned char Read(unsigned short address) = 0;
virtual void Write(unsigned char value, unsigned short address) = 0;
virtual void SelectMap(unsigned char type) = 0;
};
void SetCpuMemoryBus(CpuMemoryBus* bus);
}
Evidence record
snippets/cpu-memory.hpp.inc
From Windows Application to Portable Emulation Platform
1,113 bytes
SHA-2568bea1bf856ba08b31fc1cdb28c4eac3bbceb11d31cf15dfed8ad9e5e4e6195c9