summaryrefslogtreecommitdiff
path: root/mknes_mapper.h
blob: 923d7b8a11fdc12438bbc09249cf07ad3ad7271d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#include "mappers/mapper_000_0.h"
#include "mappers/mapper_001_0.h"
#include "mappers/mapper_002_2.h"
#include "mappers/mapper_003_0.h"
#include "mappers/mapper_003_1.h"
#include "mappers/mapper_003_2.h"
#include "mappers/mapper_004_0.h"
#include "mappers/mapper_005_0.h"
#include "mappers/mapper_007_2.h"
#include "mappers/mapper_011_0.h"
#include "mappers/mapper_066_0.h"

struct nes_state;

struct mapper_functions {
	uint8_t	(*prg_rom_read)(struct nes_state *state, uint32_t addr);
	void		(*prg_rom_write)(struct nes_state *state, uint32_t addr, uint8_t value);
	uint8_t	(*prg_ram_read)(struct nes_state *state, uint32_t addr);
	void		(*prg_ram_write)(struct nes_state *state, uint32_t addr, uint8_t value);
	uint8_t	(*chr_read)(struct nes_state *state, uint32_t addr);
	void		(*chr_write)(struct nes_state *state, uint32_t addr, uint8_t value);
	uint8_t	(*ciram_read)(struct nes_state *state, uint32_t addr);
	void		(*ciram_write)(struct nes_state *state, uint32_t addr, uint8_t value);
	void		(*tick)(struct nes_state *state, uint16_t scanline, uint16_t dot);
} __attribute__((aligned(64)));

union mapper_data {
	struct mapper_000_0 m000_0;
	struct mapper_001_0 m001_0;
	struct mapper_002_2 m002_2;
	struct mapper_003_0 m003_0;
	struct mapper_003_1 m003_1;
	struct mapper_003_2 m003_2;
	struct mapper_004_0 m004_0;
	struct mapper_005_0 m005_0;
	struct mapper_007_2 m007_2;
	struct mapper_011_0 m011_0;
	struct mapper_066_0 m066_0;
} __attribute__((aligned(64)));