Mercurial > repos > blastem
annotate sft_mapper.c @ 2354:a773b8f09292
Remove old refresh hack that is causing VDPFifoTesting to have a failed test
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 19 Oct 2023 23:27:57 -0700 |
parents | fd68fe5f723e |
children |
rev | line source |
---|---|
2253
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #include "genesis.h" |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 void* sft_wukong_write_b(uint32_t address, void *context, uint8_t value) |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 if (!(address & 1)) { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 return context; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 } |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 m68k_context *m68k = context; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 genesis_context *gen = m68k->system; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 printf("wukong mapper write: %X - %X\n", address, value); |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 uint16_t *old = m68k->mem_pointers[gen->mapper_start_index]; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 if (value & 0x80) { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 m68k->mem_pointers[gen->mapper_start_index] = gen->cart; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } else { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 m68k->mem_pointers[gen->mapper_start_index] = gen->cart + 1 * 1024 * 1024; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 } |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 if (old != m68k->mem_pointers[gen->mapper_start_index]) { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 m68k_invalidate_code_range(m68k, 0x200000, 0x3C0000); |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 return context; |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 } |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 void* sft_wukong_write_w(uint32_t address, void *context, uint16_t value) |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 { |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 return sft_wukong_write_b(address | 1, context, value); |
fd68fe5f723e
Add support for mapper used in Super Fighter Team release of Legend of Wukong
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 } |