7 static uint8 master,chrm;
9 static void DoPRG215(void)
13 setprg16(0x8000,master&0x1F);
14 setprg16(0xc000,master&0x1F);
18 setprg8(0x8000,regs[4]); 6
19 setprg8(0xA000,regs[6]); 7 0, 2, 5, 3, 6, 1, 7, 4
26 static void DoCHR215(void)
28 uint32 base=(cmd&0x80)<<5;
29 int orie=(chrm&0x4)<<6;
31 setchr2(0x0000^base,(orie|regs[0])>>1); 0
32 setchr2(0x0800^base,(orie|regs[5])>>1); 1
34 setchr1(0x1000,orie|regs[1]); 2
35 setchr1(0x1400,orie|regs[3]); 3
36 setchr1(0x1800,orie|regs[7]); 4
37 setchr1(0x1c00,orie|regs[2]); 5
40 static DECLFW(Write215_write)
44 case 0xF001:IRQCount=V+2;break;
45 case 0xF000:X6502_IRQEnd(FCEU_IQEXT);break;
61 case 0xC000:setmirror(((V|(V>>7))&1)^1);break;
62 case 0xa000:cmd=V;cmdin=1;DoCHR215();break;
63 case 0x8001:if(!cmdin) break;
72 static void hooko215(void)
79 X6502_IRQBegin(FCEU_IQEXT);
84 void Mapper215_init(void)
87 for(x=0;x<8;x++) regs[x]=0;
88 master=chrm=cmd=cmdin=IRQCount=0;
89 GameHBIRQHook=hooko215;
90 SetReadHandler(0x8000,0xFFFF,CartBR);
91 SetWriteHandler(0x5000,0xFFFF,Write215_write);