2
3
4
5
6
7
11#include "../types/evmu_peripheral.h"
12#include "../types/evmu_imemory.h"
15
16
17
18#define EVMU_WRAM_TYPE (GBL_TYPEID
(EvmuWram))
19#define EVMU_WRAM(self) (GBL_CAST(EvmuWram, self))
21#define EVMU_WRAM_GET_CLASS(self) (GBL_CLASSOF(EvmuWram, self))
24#define EVMU_WRAM_NAME "wram"
27
28
29
30#define EVMU_WRAM_BANK_COUNT 2
31#define EVMU_WRAM_BANK_SIZE 256
35#define GBL_SELF_TYPE EvmuWram
39GBL_FORWARD_DECLARE_STRUCT(EvmuWram);
42
43
44
45
46
47
48
49
50GBL_CLASS_DERIVE_EMPTY(EvmuWram, EvmuPeripheral, EvmuIMemory)
53
54
55
56
57
58
59
60
61
68 (dataChanged, GBL_GENERIC, (READ, WRITE, OVERRIDE),
GBL_BOOL_TYPE),
80
81
82
83
93
94
95
96
104 size_t* pSize) GBL_NOEXCEPT;
113 size_t* pSize) GBL_NOEXCEPT;
#define EVMU_EXPORT
Define used for adding attributes to export public symbols.
uint8_t EvmuWord
Represents a single 8-bit CPU word.
uint32_t EvmuAddress
Represents a generic absolute address.
#define EVMU_WRAM_BANK_COUNT
Number of banks in WRAM.
#define EVMU_WRAM_BANK_SIZE
Size of each bank in WRAM.
GblType EvmuWram_type(void)
Returns the GblType UUID associated with EvmuWram.
#define GBL_PROPERTIES(object,...)
GblInstance structure for EvmuWram.
EvmuAddress EvmuWram_accessAddress(const EvmuWram *pSelf)
Returns the target address created by using VRMAD1 the low byte, and VRMAD2 as the bank.
EVMU_RESULT EvmuWram_readBytes(const EvmuWram *pSelf, EvmuAddress address, void *pData, size_t *pSize)
Reads pSize bytes from WRAM into pData, starting at address, writing back the number of bytes read.
GblBool EvmuWram_mapleTransferring(const EvmuWram *pSelf)
Returns GBL_TRUE of a Maple transfer from the Dreamcast is in progress, disallowing VMU access.
GblBool dataChanged
User toggle: will be set after a WRAM value changes, you can reset and poll for changes.
EVMU_RESULT EvmuWram_setAccessAddress(EvmuWram *pSelf, EvmuAddress addr)
Configures the values of VRMAD1 and VRMAD2 so that they point to the address given by addr.
EvmuWord EvmuWram_readByte(const EvmuWram *pSelf, EvmuAddress address)
Returns the byte value located at the given WRAM address.
EVMU_RESULT EvmuWram_writeByte(EvmuWram *pSelf, EvmuAddress address, EvmuWord byte)
Writes the byte value to the WRAM address.
EVMU_RESULT EvmuWram_writeBytes(EvmuWram *pSelf, EvmuAddress address, const void *pData, size_t *pSize)
Writes pSize bytes to WRAM from pData, starting at address, writing back the number of bytes written.
#define GBL_CLASS_CAST(cType, klass)
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)