Esempio n. 1
0
static DECLFW(RAMBO1_write)
{
  switch(A&0xF001)
  {
    case 0xa000: mir=V&1;
//                 if(!nomirror)
                   setmirror(mir^1);
                 break;
    case 0x8000: cmd = V;
                 break;
    case 0x8001: if((cmd&0xF)<10)
                   DRegs[cmd&0xF]=V;
                 else if((cmd&0xF)==0xF)
                   DRegs[10]=V;
                 Synco();
                 break;
    case 0xc000: IRQLatch=V;
                 if(rmode==1)
                   IRQCount=IRQLatch;
                 break;
    case 0xc001: rmode=1;
                 IRQCount=IRQLatch;
                 IRQmode=V&1;
                 break;
    case 0xE000: IRQa=0;
                 X6502_IRQEnd(FCEU_IQEXT);
                 if(rmode==1)
                   IRQCount=IRQLatch;
                 break;
    case 0xE001: IRQa=1;
                 if(rmode==1)
                   IRQCount=IRQLatch;
                 break;
  }
}
Esempio n. 2
0
static int StateAction(StateMem *sm, int load, int data_only)
{
 SFORMAT StateRegs[]={
        {&cmd, 1, "CMD"},
        {&mir, 1, "MIR"},
        {&rmode, 1, "RMOD"},
        {&IRQmode, 1, "IRQM"},
        {&IRQCount, 1, "IRQC"},
        {&IRQa, 1, "IRQA"},
        {&IRQLatch, 1, "IRQL"},
        {DRegs, 11, "DREG"},
        SFEND
 };

 int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "MAPR");

 if(load)
 {
  Synco();
  if(!nomirror)
   setmirror(mir^1);
 }

 return(ret);
}
Esempio n. 3
0
void Mapper51_init(void)
{
 SetWriteHandler(0x6000,0xFFFF,Write);
 SetReadHandler(0x6000,0xFFFF,CartBR);
 mapbyte1[0]=1;
 mapbyte1[1]=0;
 Synco();
}
Esempio n. 4
0
static DECLFW(Write)
{
 if(A&0x8000) mapbyte1[1]=V&0xF;
 else mapbyte1[0]=(mapbyte1[0]&2)|((V>>1)&1);

 if(A&0x4000) mapbyte1[0]=(mapbyte1[0]&1)|((V>>3)&2);
 Synco();
}
Esempio n. 5
0
static void Power(CartInfo *info)
{
	int x;

        for(x=0;x<11;x++)
         DRegs[x]=~0;
        cmd=0;
        mir=0;
        if(!nomirror)
         setmirror(1);
        Synco();
	setprg8(0xe000, 0xFF);
}
Esempio n. 6
0
static void RAMBO1_init(void)
{
  int x;
  for(x=0;x<11;x++)
     DRegs[x]=~0;
  cmd=mir=0;
//  if(!nomirror)
    setmirror(1);
  Synco();
  GameHBIRQHook=RAMBO1_hb;
  MapIRQHook=RAMBO1_IRQHook;
  GameStateRestore=RAMBO1_Restore;
  SetWriteHandler(0x8000,0xffff,RAMBO1_write);
  AddExState(Rambo_StateRegs, ~0, 0, 0);
}
Esempio n. 7
0
static DECLFW(RAMBO1_write)
{
 //if(A>=0xC000 && A<=0xFFFF) printf("$%04x:$%02x, %d, %d\n",A,V,scanline,timestamp);
 switch(A&0xF001)
 {
        case 0xa000:mir=V&1;
		    if(!nomirror)
		     setmirror(mir^1);
		    break;
        case 0x8000:cmd = V;
		    break;
        case 0x8001:
		    if((cmd&0xF)<10)
		     DRegs[cmd&0xF]=V;
		    else if((cmd&0xF)==0xF)
		     DRegs[10]=V;
		    Synco();
		    break;
        case 0xc000:IRQLatch=V;
                    if(rmode==1)
                     {
                      IRQCount=IRQLatch;
                     }
                    break;
        case 0xc001:rmode=1;
                    IRQCount=IRQLatch;
		    IRQmode=V&1;
                    break;
        case 0xE000:IRQa=0;X6502_IRQEnd(MDFN_IQEXT);
                    if(rmode==1)
                     {IRQCount=IRQLatch;}
                    break;
        case 0xE001:IRQa=1;
                    if(rmode==1)
                     {IRQCount=IRQLatch;}
                    break;
  }	
}
Esempio n. 8
0
static void RAMBO1_Restore(int version)
{
  Synco();
//  if(!nomirror)
    setmirror(mir^1);
}