Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define RETRO_MEMDOMAINS_FLAG_INVALID (1 << 0) /* One or more of the memory domains have been invalidated. Request memory domains again. */
- #define RETRO_MEMDOMAIN_FLAG_INVALID (1 << 0) /* This memory domain is has been invalidated and must not be used. Request memory domains again. */
- #define RETRO_MEMDOMAIN_FLAG_INVALID_PTR (1 << 1) /* This memory domain's pointer is has been invalidated at some point. Use RETRO_MEMDOMAIN_OP_REFRESH_PTR to clear this. */
- #define RETRO_MEMDOMAIN_FLAG_IO_R (1 << 2) /* Can be read or peeked */
- #define RETRO_MEMDOMAIN_FLAG_IO_W (1 << 3) /* Can be written or poked */
- #define RETRO_MEMDOMAIN_FLAG_UNIT8 (1 << 4) /* Resource is fundamentally addressed in 8 bit units (this is almost universally the case */
- #define RETRO_MEMDOMAIN_FLAG_UNIT16 (1 << 5) /* Resource is fundamentally addressed in 16 bit units; more granular addressing is not sensible */
- #define RETRO_MEMDOMAIN_FLAG_UNIT32 (1 << 6) /* Resource is fundamentally addressed in 32 bit units; more granular addressing is not sensible */
- #define RETRO_MEMDOMAIN_FLAG_UNIT64 (1 << 7) /* Resource is fundamentally addressed in 64 bit units; more granular addressing is not sensible */
- #define RETRO_MEMDOMAIN_FLAG_READ (1 << 8) /* Advice: Is conceptually readable; the user may be permitted to read it, regardless */
- #define RETRO_MEMDOMAIN_FLAG_WRITE (1 << 9) /* Advice: Is conceptually writable; the user may be permitted to write it, regardless */
- #define RETRO_MEMDOMAIN_FLAG_BIGENDIAN (1 << 10) /* Advice: known to be typically accessed in a big endian pattern */
- #define RETRO_MEMDOMAIN_FLAG_LITTLEENDIAN (1 << 11) /* Advice: known to be typically accessed in a little endian pattern */
- #define RETRO_MEMDOMAIN_FLAG_ALIGN_1 (1 << 12) /* Advice: aAdresses must be a multiple of 2 */
- #define RETRO_MEMDOMAIN_FLAG_ALIGN_2 (1 << 13) /* Advice: aAdresses must be a multiple of 2 */
- #define RETRO_MEMDOMAIN_FLAG_ALIGN_4 (1 << 14) /* Advice: addresses must be a multiple of 4 */
- #define RETRO_MEMDOMAIN_FLAG_ALIGN_8 (1 << 15) /* Advice: addresses must be a multiple of 8 */
- #define RETRO_MEMDOMAIN_FLAG_WORDSIZE_2 (1 << 16) /* Advice: values are accessed 1 byte at a time */
- #define RETRO_MEMDOMAIN_FLAG_WORDSIZE_2 (1 << 17) /* Advice: values are accessed 2 bytes at a time */
- #define RETRO_MEMDOMAIN_FLAG_WORDSIZE_4 (1 << 18) /* Advice: values are accessed 4 bytes at a time */
- #define RETRO_MEMDOMAIN_FLAG_WORDSIZE_8 (1 << 19) /* Advice: values are accessed 8 bytes at a time */
- #define RETRO_MEMDOMAIN_FLAG_CAN_HOOK_R (1 << 20) /* Read operations can be hooked (not supported; for future use) */
- #define RETRO_MEMDOMAIN_FLAG_CAN_HOOK_W (1 << 21) /* Write operations can be hooked (not supported; for future use) */
- #define RETRO_MEMDOMAIN_FLAG_CAN_HOOK_X (1 << 22) /* Execute operations can be hooked (not supported; for future use) */
- #define RETRO_MEMDOMAIN_FLAG_CAN_HOOK_F (1 << 23) /* Fetch (for execute) operations can be hooked (not supported; for future use) */
- #define RETRO_MEMDOMAIN_FLAG_CAN_TEST_DIRTY (1 << 24) /* Indicates whether the memdomain can test whether it's dirty */
- #define RETRO_MEMDOMAIN_FLAG_CAN_TRACK_DIRTY (1 << 25) /* Indicates whether the memdomain tracks whether it's dirty (testing will be instantaneous, and the flag can be cleared) */
- #define RETRO_MEMDOMAIN_FLAG_TAG_ARTIFICIAL (1 << 26) /* Tags the memory domain as being somewhat fictitious, provided for convenience */
- #define RETRO_MEMDOMAIN_FLAG_TAG_HIDDEN (1 << 27) /* Tags the memory domain as being intended for internal use, and hidden from most users */
- #define RETRO_MEMDOMAIN_FLAG_TAG_CHEATSEARCH (1 << 28) /* Tags the memory domain as being suitable for cheat searching */
- #define RETRO_MEMDOMAIN_FLAG_TAG_BUS (1 << 29) /* Tags the memory domain as being bus-like */
- #define RETRO_MEMDOMAIN_FLAG_TAG_FILE (1 << 30) /* Tags the memory domain as being file-like (a raw representation of a loaded ROM file, for instance) */
- #define RETRO_MEMDOMAIN_FLAG_TAG_MEMORY (1 << 31) /* Tags the memory domain as being a memory-like resource */
- #define RETRO_MEMDOMAIN_FLAG_TAG_DEFAULT (1 << 32) /* Tags the memory domain as being the ideal for a certain purpose. ex. DEFAULT BUS will be the main cpu's sysbus */
- #define RETRO_MEMDOMAIN_IO_READ (0) /* Specifies a read with concrete properties determined by the core, including side effects */
- #define RETRO_MEMDOMAIN_IO_PEEK (1) /* Specifies a synthetic read, avoiding side effects where sensible and possible */
- #define RETRO_MEMDOMAIN_IO_WRITE (2) /* Specifies a write with concrete properties determined by the core, including side effects */
- #define RETRO_MEMDOMAIN_IO_POKE (3) /* Specifies a synthetic write, avoiding side effects where sensible and possible */
- /* reserved */
- #define RETRO_MEMDOMAIN_IO_SIZE8 (1<<24)
- #define RETRO_MEMDOMAIN_IO_SIZE16 (1<<25)
- #define RETRO_MEMDOMAIN_IO_SIZE32 (1<<26)
- #define RETRO_MEMDOMAIN_IO_SIZE64 (1<<27)
- /* reserved */
- #define RETRO_MEMDOMAIN_IO_BIGENDIAN (1<<31) /* Not completely sure what this means or if it makes sense */
- #define RETRO_MEMDOMAIN_OP_STORE (0) /* Stores a buffer into the memory domain */
- #define RETRO_MEMDOMAIN_OP_DUMP (1) /* Dumps from the memory domain into a buffer */
- #define RETRO_MEMDOMAIN_OP_TEST_DIRTY (2) /* Returns whether the memory domain is dirty; returns 1 for dirty and 0 for not */
- #define RETRO_MEMDOMAIN_OP_CLEAR_DIRTY (3) /* Clears the dirty status (if it's tracked) */
- #define RETRO_MEMDOMAIN_OP_REFRESH_PTR (4) /* Clears the RETRO_MEMDOMAIN_FLAG_INVALID_PTR flag on this memory domain */
- #define RETRO_MEMDOMAIN_OP_MAP (5) /* TODO: IDEA: Attempts to map the resource address to a system bus address; see elsewhere for more details*/
- #define RETRO_MEMDOMAINS_SIGNAL_FLAG_INVALIDATED (1<<0)
- /* Implements an IO for a memory domain (e.g. peek, write) */
- typedef uint64_t (*retro_memdomain_io_t)(uint32_t ioflags, uint64_t address, uint64_t value);
- /* Implements a misc or bulk operation */
- typedef uint64_t (*retro_memdomain_op_t)(uint32_t ioflags, uint32_t opflags, uint64_t address, void* buffer, uint64_t length);
- struct retro_memdomains_signal_args
- {
- /* flags for the signal (really, just the signal type) */
- uint32_t flags;
- /* argument for the signal */
- void* arg;
- /* the callback argument that was passed into retro_memdomains_get_t */
- void* user_arg;
- };
- /* Details about a single memory domain IO interface */
- struct retro_memdomain_iodef
- {
- /* RETRO_MEMDOMAIN_IO flags determining the type of the IO */
- uint32_t flags;
- /* the corresponding callback. */
- retro_memdomain_io_t cb;
- /* Human-readable memo/errata, in ASCII English. */
- const char* memo;
- };
- struct retro_memdomain
- {
- /* A set of RETRO_MEMDOMAIN_FLAG values */
- uint64_t flags;
- /* Reserved for future use */
- uint64_t flags2;
- /* A pointer to the resource; may be NULL, in which case callbacks would need to be provided */
- void* ptr;
- /* Size of the memory domain; it's the size of `ptr` if that is provided; otherwise it's the count of units that can be addressed through the callbacks */
- uint64_t size;
- /* NULL-terminated lists of available IOs. Any of these may be empty lists. */
- const retro_memdomain_iodef *read, *peek, *write, *poke;
- /* The name of the memory domain. TODO: What characters are allowed? */
- const char* name;
- /* A category used to namespace the memory domain; should be an empty string if unset, which should be most cases. */
- const char* category;
- /* Human-readable description, in ASCII English. */
- const char* desc;
- /* callback for miscellaneous or bulk operations; may be NULL if not supported. */
- retro_memdomain_op_t op;
- /* If this can correlate directly to a RETRO_MEMORY value, it's specified here. Otherwise it's 0xFFFFFFFF */
- uint32_t retro_get_memory_type;
- };
- struct retro_memdomains
- {
- /* count of defined domains */
- uint32_t num_domains;
- /* pointer to all defined domains */
- const retro_memdomain* domains;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement