libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
evmu_memory_event.h
Go to the documentation of this file.
1/*! \file
2 * \brief EvmuRamEvent and related API
3 *
4 * \author 2023 Falco Girgis
5 * \copyright MIT License
6 */
7#ifndef EVMU_MEMORY_EVENT_H
8#define EVMU_MEMORY_EVENT_H
9
10#include <gimbal/meta/instances//gimbal_event.h>
11#include "../types/evmu_typedefs.h"
12
13#define EVMU_MEMORY_EVENT_TYPE (GBL_TYPEID(EvmuMemoryEvent))
14#define EVMU_MEMORY_EVENT(self) (GBL_CAST(EvmuMemoryEvent, self))
15#define EVMU_MEMORY_EVENT_CLASS(klass) (GBL_CLASS_CAST(EvmuMemoryEvent, klass))
16#define EVMU_MEMORY_EVENT_GET_CLASS(self) (GBL_CLASSOF(EvmuMemoryEvent, self))
17
18#define GBL_SELF_TYPE EvmuRamEvent
19
20GBL_DECLS_BEGIN
21
22GBL_DECLARE_ENUM(EVMU_MEMORY_EVENT_OP) {
23 EVMU_MEMORY_EVENT_OP_READ_LATCH,
24 EVMU_MEMORY_EVENT_OP_READ_PORT,
25 EVMU_MEMORY_EVENT_OP_WRITE
26};
27
28/*! \struct EvmuMemoryEventClass
29 * \extends GblEventClass
30 * \brief GblClass structure for EvmuRamEvent
31 */
32GBL_CLASS_DERIVE_EMPTY(EvmuMemoryEvent, GblEvent)
33
34/*! \struct EvmuMemoryEvent
35 * \extends EvmuEvent
36 * \brief GblEvent-derived type for memory-related events
37 */
38GBL_INSTANCE_DERIVE(EvmuMemoryEvent, GblEvent)
39 EVMU_MEMORY_EVENT_OP op;
40 EvmuAddress address;
41 EvmuWord value;
42GBL_INSTANCE_END
43
44EVMU_EXPORT GblType EvmuMemoryEvent_type(void) GBL_NOEXCEPT;
45
46GBL_DECLS_END
47
48#undef GBL_SELF_TYPE
49
50#endif // EVMU_MEMORY_EVENT_H
#define EVMU_EXPORT
Define used for adding attributes to export public symbols.
Definition evmu_api.h:18
uint8_t EvmuWord
Represents a single 8-bit CPU word.
uint32_t EvmuAddress
Represents a generic absolute address.
uintptr_t GblType
GblEvent-derived type for memory-related events.
#define GBL_CLASS_CAST(cType, klass)
#define GBL_CLASSOF(cType, self)
#define GBL_CAST(cType, self)