games/nes: added uxrom (mapper 2)

This commit is contained in:
aiju 2014-02-24 19:50:02 +01:00
parent 9486df09c2
commit 60c3c3b3db

View file

@ -137,6 +137,36 @@ t:
} }
} }
static void
uxrom(int p, u8int v)
{
static u8int b;
if(p < 0)
switch(p){
case INIT:
prgsh = 14;
chrsh = 13;
prgb[1] = prg + (nprg - 1) * 0x4000;
chrb[0] = chr;
break;
case SAVE:
put8(b);
return;
case RSTR:
b = get8();
break;
case SCAN:
return;
default:
nope(p);
return;
}
else
b = v % nprg;
prgb[0] = prg + b * 0x4000;
}
static void static void
mmc3(int p, u8int v) mmc3(int p, u8int v)
{ {
@ -258,6 +288,7 @@ axrom(int p, u8int v)
void (*mapper[256])(int, u8int) = { void (*mapper[256])(int, u8int) = {
[0] nrom, [0] nrom,
[1] mmc1, [1] mmc1,
[2] uxrom,
[4] mmc3, [4] mmc3,
[7] axrom, [7] axrom,
}; };