Go to the documentation of this file.
10 #define _PCE_CONFIG_H_
23 #define __PCE_ROM_BANK_DECLARE(id, offset, size) \
24 asm(".global __rom_bank" #id "\n.global __rom_bank" #id \
25 "_size\n.equ __rom_bank" #id ", ((" #offset \
26 ") << 13)\n.equ __rom_bank" #id "_size, ((" #size ") << 13)\n")
28 #define __PCE_ROM_BANK_USE(id, offset) \
29 static inline void pce_rom_bank##id##_map(void) { \
30 __attribute__((leaf)) asm volatile("lda #__rom_bank" #id "_bank\n" \
31 "tam #(1 << " #offset ")\n" \
37 #define __PCE_ROM_BANK_CALLBACK_DECLARE(id, offset) \
39 leaf, callback(1), noinline, \
40 section("text.pce_rom_bank" #id \
41 "_call"))) void pce_rom_bank##id##_call(void (*method)(void)) { \
42 pce_bank##offset##_size1_push(); \
43 pce_rom_bank##id##_map(); \
45 pce_bank##offset##_size1_pop(); \
48 #define __PCE_ROM_BANK_CALLBACK_USE(id) \
49 __attribute__((leaf, callback(1))) void pce_rom_bank##id##_call( \
52 #ifdef PCE_CONFIG_IMPLEMENTATION
53 #define PCE_ROM_BANK_AT(id, offset) \
54 __PCE_ROM_BANK_DECLARE(id, offset, 1); \
55 __PCE_ROM_BANK_USE(id, offset) \
56 __PCE_ROM_BANK_CALLBACK_DECLARE(id, offset)
57 #define PCE_ROM_FIXED_BANK_SIZE(size) __PCE_ROM_BANK_DECLARE(0, 8 - size, size)
58 #define PCE_SGX_RAM(size) \
59 asm(".global __ram_bank_size\n.equ __ram_bank_size, ((" #size ") << 13)\n")
81 #define PCE_ROM_BANK_AT(id, offset) \
82 __PCE_ROM_BANK_USE(id, offset) \
83 __PCE_ROM_BANK_CALLBACK_USE(id)
89 #define PCE_ROM_FIXED_BANK_SIZE(size)
103 #define PCE_SGX_RAM(size)