llvm-mos-sdk
ines.h
Go to the documentation of this file.
1 // Copyright 2023 LLVM-MOS Project
2 // Licensed under the Apache License, Version 2.0 with LLVM Exceptions.
3 // See https://github.com/llvm-mos/llvm-mos-sdk/blob/main/LICENSE for license
4 // information.
5 
6 #ifndef _INES_H_
7 #define _INES_H_
8 
9 // INES header configuration macros
10 //
11 // Define any of these in one .c/.cpp file to configure the project's INES
12 // header. Additional defines are provided on some subtargets via <mapper.h>.
13 
14 #define MAPPER_PRG_ROM_KB(kb) \
15  asm(".globl __prg_rom_size\n__prg_rom_size = " #kb)
16 #define MAPPER_PRG_RAM_KB(kb) \
17  asm(".globl __prg_ram_size\n__prg_ram_size = " #kb)
18 #define MAPPER_PRG_NVRAM_KB(kb) \
19  asm(".globl __prg_nvram_size\n__prg_nvram_size = " #kb)
20 #define MAPPER_CHR_ROM_KB(kb) \
21  asm(".globl __chr_rom_size\n__chr_rom_size = " #kb)
22 #define MAPPER_CHR_RAM_KB(kb) \
23  asm(".globl __chr_ram_size\n__chr_ram_size = " #kb)
24 #define MAPPER_CHR_NVRAM_KB(kb) \
25  asm(".globl __chr_nvram_size\n__chr_nvram_size = " #kb)
26 
27 #define MAPPER_USE_HORIZONTAL_MIRRORING \
28  asm(".globl __mirroring\n__mirroring = 0")
29 
30 #define MAPPER_USE_VERTICAL_MIRRORING \
31  asm(".globl __mirroring\n__mirroring = 1")
32 
33 #define MAPPER_USE_BATTERY \
34  asm(".globl __battery\n__battery = 1")
35 
36 #define INES_TIMING(id) \
37  asm(".globl __timing\n__timing = " #id)
38 #define INES_TIMING_RP2C02 \
39  asm(".globl __timing\n__timing = 0")
40 #define INES_TIMING_RP2C07 \
41  asm(".globl __timing\n__timing = 1")
42 #define INES_TIMING_MULTIREGION \
43  asm(".globl __timing\n__timing = 2")
44 #define INES_TIMING_UA6538 \
45  asm(".globl __timing\n__timing = 3")
46 #define INES_DEFAULT_EXPANSION(id) \
47  asm(".globl __default_expansion_device\n__default_expansion_device = " #id)
48 
49 #endif // _INES_H_