summaryrefslogtreecommitdiff
path: root/mapper_0003.c
diff options
context:
space:
mode:
authorPeter Fors <peter.fors@mindkiller.com>2025-04-06 12:27:12 +0200
committerPeter Fors <peter.fors@mindkiller.com>2025-04-06 12:27:12 +0200
commit39715ca6bf65d2e2dd889cdef4b39d584464d9e7 (patch)
tree39390f6fadd0ddbe913ae66e11847b8b3e7b16bb /mapper_0003.c
parentdabd7a5848e6aa55e91cf4c804f6236b4f7fe30e (diff)
added more mappers (buggy)
Diffstat (limited to 'mapper_0003.c')
-rw-r--r--mapper_0003.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mapper_0003.c b/mapper_0003.c
new file mode 100644
index 0000000..743df51
--- /dev/null
+++ b/mapper_0003.c
@@ -0,0 +1,25 @@
+
+
+static void mapper_0003_init(struct nes_state *state) {
+ state->map.m0003.chr_ptr = state->chr_rom;
+}
+
+static uint8_t mapper_0003_prg_read(struct nes_state *state, uint32_t addr) {
+ if(addr >= 0x8000) {
+ return state->prg_rom[addr - 0x8000];
+ }
+ return 0;
+}
+
+static void mapper_0003_prg_write(struct nes_state *state, uint32_t addr, uint8_t value) {
+ if(addr >= 0x8000) {
+ state->map.m0003.chr_ptr = state->chr_rom + (value & 3) * 0x2000;
+ }
+}
+
+static uint8_t mapper_0003_chr_read(struct nes_state *state, uint32_t addr) {
+ return state->map.m0003.chr_ptr[addr];
+}
+
+static void mapper_0003_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) {
+}