SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
Core/memory.h
1 #pragma once
2 #include "defs.h"
3 #include <stdint.h>
4
5 typedef uint8_t (*GB_read_memory_callback_t)(GB_gameboy_t *gb, uint16_t addr, uint8_t data);
6 typedef bool (*GB_write_memory_callback_t)(GB_gameboy_t *gb, uint16_t addr, uint8_t data); // Return false to prevent the write
7 void GB_set_read_memory_callback(GB_gameboy_t *gb, GB_read_memory_callback_t callback);
8 void GB_set_write_memory_callback(GB_gameboy_t *gb, GB_write_memory_callback_t callback);
9
10 uint8_t GB_read_memory(GB_gameboy_t *gb, uint16_t addr);
11 uint8_t GB_safe_read_memory(GB_gameboy_t *gb, uint16_t addr); // Without side effects
12 void GB_write_memory(GB_gameboy_t *gb, uint16_t addr, uint8_t value);
13 #ifdef GB_INTERNAL
14 internal void GB_dma_run(GB_gameboy_t *gb);
15 internal bool GB_is_dma_active(GB_gameboy_t *gb);
16 internal void GB_hdma_run(GB_gameboy_t *gb);
17 internal void GB_trigger_oam_bug(GB_gameboy_t *gb, uint16_t address);
18 internal uint8_t GB_read_oam(GB_gameboy_t *gb, uint8_t addr);
19 #endif
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.