Add mapper 446 using mapper emulation cores that can be included in other multi-ASIC mappers.

This commit is contained in:
NewRisingSun
2025-09-01 01:13:46 +02:00
parent 3544ff567e
commit a2fdeee096
57 changed files with 3063 additions and 441 deletions

View File

@@ -19,7 +19,7 @@
*/
#include "mapinc.h"
#include "vrc2and4.h"
#include "asic_vrc2and4.h"
static uint8 *CHRRAM;
static uint32 CHRRAMSize;
@@ -43,14 +43,14 @@ static void sync () {
int bank;
VRC24_syncWRAM(0);
VRC24_syncPRG(0x01F, 0x000);
for (bank =0; bank <8; bank++) setchr1r((VRC24_chr[bank] &mask) ==compare? 0x10: 0x00, bank <<10, VRC24_chr[bank]);
for (bank =0; bank <8; bank++) setchr1r((VRC24_getCHRBank(bank) &mask) ==compare? 0x10: 0x00, bank <<10, VRC24_getCHRBank(bank));
setmirrorw(nt[0] &1, nt[1] &1, nt[2] &1, nt[3] &1);
}
static const uint8 compares[8] = { 0x28, 0x00, 0x4C, 0x64, 0x46, 0x7C, 0x04, 0xFF };
static DECLFW(Mapper544_interceptPPUWrite) {
if (~RefreshAddr &0x2000) {
int bank =VRC24_chr[RefreshAddr >>10 &7];
int bank =VRC24_getCHRBank(RefreshAddr >>10 &7);
if (bank &0x80) {
if (bank &0x10) {
mask =0x00;
@@ -60,13 +60,13 @@ static DECLFW(Mapper544_interceptPPUWrite) {
mask =bank &0x40? 0xFE: 0xFC;
compare =compares[index];
}
VRC24_Sync();
sync();
}
}
writePPU(A, V);
}
int Mapper544_getPRGBank(int bank) {
int Mapper544_getPRGBank(uint8 bank) {
return bank ==2? prg: VRC24_getPRGBank(bank);
}
@@ -75,7 +75,7 @@ DECLFW(Mapper544_externalSelect) {
nt[A &3] =V;
else
prg =V;
VRC24_Sync();
sync();
}
@@ -98,11 +98,9 @@ void Mapper544_close(void) {
}
void Mapper544_Init (CartInfo *info) {
VRC24_init(info, sync, 0x400, 0x800, 1, 1, 0);
VRC4_init(info, sync, 0x400, 0x800, 1, Mapper544_getPRGBank, NULL, NULL, NULL, Mapper544_externalSelect);
info->Power =Mapper544_power;
info->Close =Mapper544_close;
VRC24_GetPRGBank =Mapper544_getPRGBank;
VRC24_ExternalSelect =Mapper544_externalSelect;
AddExState(stateRegs, ~0, 0, 0);
CHRRAMSize =info->CHRRamSize +info->CHRRamSaveSize;