llvm-mos-sdk
nes-gtrom
mapper.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 _MAPPER_H_
7
#define _MAPPER_H_
8
9
#include <stdbool.h>
10
#include <
ines.h
>
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
16
#define PRG_BANK_MASK 0x0F
17
#define PRG_BANK_SHIFT 0
18
#define CHR_BANK_MASK 0x10
19
#define CHR_BANK_SHIFT 4
20
#define CHR_BANK_0 0x00
21
#define CHR_BANK_1 0x10
22
#define NT_BANK_MASK 0x20
23
#define NT_BANK_SHIFT 5
24
#define NT_BANK_0 0x00
25
#define NT_BANK_1 0x20
26
#define MAPPER_RED_LED 0x40
27
#define MAPPER_GREEN_LED 0x80
28
34
__attribute__((leaf))
char
get_bank_state(
void
);
35
42
__attribute__((leaf))
char
set_bank_state(
char
value);
43
50
__attribute__((leaf, callback(2))) void banked_call(
char
bank_id
,
51
void
(*
method
)(
void
));
52
58
__attribute__((leaf))
char
get_prg_bank(
void
);
59
66
__attribute__((leaf))
char
set_prg_bank(
char
bank_id
);
67
71
__attribute__((leaf))
char
set_mapper_red_led(
bool
value);
72
76
__attribute__((leaf))
char
set_mapper_green_led(
bool
value);
77
83
__attribute__((leaf))
void
set_chr_bank(
char
bank_id
);
84
92
__attribute__((leaf))
void
swap_chr_bank(
char
bank_id
);
93
101
__attribute__((leaf))
void
split_chr_bank(
char
bank_id
);
102
108
__attribute__((leaf))
void
set_nt_bank(
char
bank_id
);
109
117
__attribute__((leaf))
void
swap_nt_bank(
char
bank_id
);
118
126
__attribute__((leaf))
void
split_nt_bank(
char
bank_id
);
127
128
#ifdef __cplusplus
129
}
130
#endif
131
132
#endif // _MAPPER_H_
ines.h
method
void(* method)(void))
Definition:
mapper.h:41
bank_id
char bank_id
Definition:
mapper.h:97
Generated by
1.8.17