Go to the documentation of this file.
10 #define _PCE_CONFIG_H_
23 #define __PCE_RAM_BANK_DECLARE(id, offset, size) \
24 asm(".global __ram_bank" #id "\n.global __ram_bank" #id \
25 "_size\n.equ __ram_bank" #id ", ((" #offset \
26 ") << 13)\n.equ __ram_bank" #id "_size, ((" #size ") << 13)\n")
28 #define __PCE_RAM_BANK_USE(id, offset) \
29 static inline void pce_ram_bank##id##_map(void) { \
30 __attribute__((leaf)) asm volatile("lda #__ram_bank" #id "_bank\n" \
31 "tam #(1 << " #offset ")\n" \
37 #define __PCE_RAM_BANK_CALLBACK_DECLARE(id, offset) \
39 leaf, callback(1), noinline, \
40 section("text.pce_ram_bank" #id \
41 "_call"))) void pce_ram_bank##id##_call(void (*method)(void)) { \
42 pce_bank##offset##_size1_push(); \
43 pce_ram_bank##id##_map(); \
45 pce_bank##offset##_size1_pop(); \
48 #define __PCE_RAM_BANK_CALLBACK_USE(id) \
49 __attribute__((leaf, callback(1))) void pce_ram_bank##id##_call( \
52 #ifdef PCE_CONFIG_IMPLEMENTATION
53 #define PCE_RAM_BANK_AT(id, offset) \
54 __PCE_RAM_BANK_DECLARE(id, offset, 1); \
55 __PCE_RAM_BANK_USE(id, offset) \
56 __PCE_RAM_BANK_CALLBACK_DECLARE(id, offset)
57 #define PCE_CDB_USE_PSG_DRIVER(value) \
58 asm(".global __pce_cdb_use_psg\n.equ __pce_cdb_use_psg, " #value "\n")
59 #define PCE_CDB_USE_GRAPHICS_DRIVER(value) \
60 asm(".global __pce_cdb_use_graphics\n.equ __pce_cdb_use_graphics, " #value \
83 #define PCE_RAM_BANK_AT(id, offset) \
84 __PCE_RAM_BANK_USE(id, offset) \
85 __PCE_RAM_BANK_CALLBACK_USE(id)
90 #define PCE_CDB_USE_PSG_DRIVER(value)
95 #define PCE_CDB_USE_GRAPHICS_DRIVER(value)