コード例 #1
0
ファイル: dc_dino.cpp プロジェクト: 0nem4n/ggpofba
static int DinohInit()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1; Cps1QsHack=1;
  nCpsRomLen= 4*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 4*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100000,2,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x180000,3,1); if (nRet!=0) return 1;

  // Patch Q-Sound Test
  CpsRom[0xaacf5]=0x4e;
  CpsRom[0xaacf4]=0x71;

  // Load graphics roms
  CpsLoadTiles(CpsGfx         , 4);
  CpsLoadTiles(CpsGfx+0x200000, 8);

  nCpsLcReg=0x66;
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x04;
  CpsLayEn[3]=0x08;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Board ID improvments by KEV. 0x00,0x0000
  CpsBID[0]=0x00;
  CpsBID[1]=0x00;
  CpsBID[2]=0x00;

  MaskAddr[0]=0x68;
  MaskAddr[1]=0x6a;
  MaskAddr[2]=0x6c;
  MaskAddr[3]=0x6e;

  nRet=BurnLoadRom(CpsZRom,12,1);
  dino_decode();

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,13,1);
  nRet=BurnLoadRom(pqs+0x080000,14,1);
  nRet=BurnLoadRom(pqs+0x100000,15,1);
  nRet=BurnLoadRom(pqs+0x180000,16,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #2
0
ファイル: dc_avsp.cpp プロジェクト: tmaul/finalburnalpha_2001
static int DrvInit()
{
	int nRet=0;
	int i=0;
	unsigned char *pqs=NULL;

	Cps=2;
	nCpsRomLen=  4*0x080000;
	nCpsCodeLen= 2*0x080000;
	nCpsGfxLen=   0x1000000;
	nCpsZRomLen= 1*0x020000;
	nCpsQSamLen= 2*0x200000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	for (i=0; i<4; i++)
	{
		nRet=BurnLoadRom(CpsRom+0x080000*i,2+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

	memcpy(CpsCode,CpsRom,nCpsCodeLen);
	for (i=0; i<2; i++)
	{
		nRet=BurnXorRom(CpsCode+0x080000*i,0+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

	nRet=Cps2LoadTiles(CpsGfx          ,6);
	nRet=Cps2LoadTiles(CpsGfx+0x0800000,10);

	nRet=BurnLoadRom(CpsZRom,14,1);

	pqs=(unsigned char *)CpsQSam;
	nRet=BurnLoadRom(pqs         ,15,1);
	nRet=BurnLoadRom(pqs+0x200000,16,1);
	BurnByteswap(pqs,nCpsQSamLen);
	





	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	return 0;
}
コード例 #3
0
ファイル: dc_dino.cpp プロジェクト: 0nem4n/ggpofba
static int DrvInit()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1;
  nCpsRomLen= 3*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 4*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100000,2,1); if (nRet!=0) return 1; // Already byteswapped

  // Load graphics roms
  CpsLoadTiles(CpsGfx         , 3);
  CpsLoadTiles(CpsGfx+0x200000, 7);

  nCpsLcReg=0x4a; // Layer control register is at 0x4a
  CpsLayEn[1]=0x16;
  CpsLayEn[2]=0x16;
  CpsLayEn[3]=0x16;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Board ID improvments by KEV. 0x00,0x0000
  CpsBID[0]=0x00;
  CpsBID[1]=0x00;
  CpsBID[2]=0x00;

  MaskAddr[0]=0x4c;
  MaskAddr[1]=0x4e;
  MaskAddr[2]=0x40;
  MaskAddr[3]=0x42;

  nRet=BurnLoadRom(CpsZRom,11,1);
  dino_decode();

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,12,1);
  nRet=BurnLoadRom(pqs+0x080000,13,1);
  nRet=BurnLoadRom(pqs+0x100000,14,1);
  nRet=BurnLoadRom(pqs+0x180000,15,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #4
0
ファイル: dc_wof.cpp プロジェクト: 0nem4n/ggpofba
static int Drvq1Init()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1;
  nCpsRomLen= 2*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 4*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTiles(CpsGfx         , 2);
  CpsLoadTiles(CpsGfx+0x200000, 6);

  nCpsLcReg=0x62; // Layer control register is at 0x62
  CpsLayEn[1]=0x10;
  CpsLayEn[2]=0x08;
  CpsLayEn[3]=0x04;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Start of Board ID improvments by KEV. 0x00,0x0000
  CpsBID[0]=0x00;
  CpsBID[1]=0x00;
  CpsBID[2]=0x00;
  //end

  MaskAddr[0]=0x64;
  MaskAddr[1]=0x66;
  MaskAddr[2]=0x68;
  MaskAddr[3]=0x6a;

  nRet=BurnLoadRom(CpsZRom,10,1);
  wof_decode();

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,11,1);
  nRet=BurnLoadRom(pqs+0x080000,12,1);
  nRet=BurnLoadRom(pqs+0x100000,13,1);
  nRet=BurnLoadRom(pqs+0x180000,14,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #5
0
ファイル: dc_cawing.cpp プロジェクト: SiN13/pifba
static int CawingjInit()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen =  0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen =4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080001,4,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,5,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0001,6,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0000,7,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTilesByte(CpsGfx, 8);
  CpsLoadTilesByte(CpsGfx+(8*0x020000), 8+8);

  nCpsLcReg=0x4c; // Layer control register is at 0x4c
  CpsLayEn[1]=0x10;
  CpsLayEn[2]=0x0a;
  CpsLayEn[3]=0x0a;

  // Start of Board ID improvments by KEV. 0x40,0x0406
  CpsBID[0]=0x40;
  CpsBID[1]=0x04;
  CpsBID[2]=0x06;

  MaskAddr[0]=0x4a;
  MaskAddr[1]=0x48;
  MaskAddr[2]=0x46;
  MaskAddr[3]=0x44;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,24,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,25,1);
  nRet=BurnLoadRom(CpsAd+0x20000,26,1);


  nRet=CpsRunInit();

  if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #6
0
ファイル: dc_mtwins.cpp プロジェクト: 0nem4n/ggpofba
static int DrvInit()
{
   int nRet=0;
   Cps=1;
   nCpsRomLen=   0x100000;
   nCpsCodeLen=0; // not encrypted
   nCpsGfxLen= 4*0x080000;
   nCpsZRomLen=  0x010000;
   nCpsAdLen  =2*0x020000;
   nRet=CpsInit(); if (nRet!=0) return 1;

   // Load program roms
   nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
   nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
   nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
   nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
   nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1; // Already byteswapped

   // Load graphics roms
   CpsLoadTiles(CpsGfx,5);

   //-----------------------------------------------------
   nCpsLcReg =0x52;
   CpsLayEn[1]=0x08;
   CpsLayEn[2]=0x30;
   CpsLayEn[3]=0x30;

   //-----------------------------------------------------
   CpsBID[0]=0x5e;
   CpsBID[1]=0x04;
   CpsBID[2]=0x04;
   //-----------------------------------------------------

   MaskAddr[0]=0x54;
   MaskAddr[1]=0x56;
   MaskAddr[2]=0x58;
   MaskAddr[3]=0x5a;

   EndScroll[SCROLL_2]=0x3fff;
   StartScroll[SCROLL_3]=0x0e00;

   // Load Z80 Rom
   nRet=BurnLoadRom(CpsZRom,9,1);

   // Load ADPCM data
   nRet=BurnLoadRom(CpsAd        ,10,1);
   nRet=BurnLoadRom(CpsAd+0x20000,11,1);


   nRet=CpsRunInit(); if (nRet!=0) return 1;
   // Ready to go
   return 0;
}
コード例 #7
0
ファイル: dc_cworld2j.cpp プロジェクト: SiN13/pifba
static int DrvInit()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080001,4,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,5,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0001,6,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0000,7,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTilesByte(CpsGfx, 8);
  CpsLoadTilesByte(CpsGfx+(8*0x020000), 8+8);

  nCpsLcReg=0x60; // Layer control register is at 0x60
  CpsLayEn[1]=0x20;
  CpsLayEn[2]=0x14;
  CpsLayEn[3]=0x14;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  MaskAddr[0]=0x6e;
  MaskAddr[1]=0x6c;
  MaskAddr[2]=0x6a;
  MaskAddr[3]=0x68;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,24,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,25,1);
  nRet=BurnLoadRom(CpsAd+0x20000,26,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #8
0
ファイル: dc_varth.cpp プロジェクト: zloop1982/ggpo-next
static int VarthjInit()
{
  int nRet=0;

  Cps=1; Varth=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080001,4,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,5,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0001,6,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0000,7,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTiles(CpsGfx,8);

  nCpsLcReg=0x60; // Layer control register is at 0x60
  CpsLayEn[1]=0x20;
  CpsLayEn[2]=0x06;
  CpsLayEn[3]=0x06;

  // Protection enable code by KEV - Looks like only the JAP version uses this
  CpsMProt[0]=0x4e;
  CpsMProt[1]=0x4c;
  CpsMProt[2]=0x4a;
  CpsMProt[3]=0x48;

  MaskAddr[0]=0x6e;
  MaskAddr[1]=0x6c;
  MaskAddr[2]=0x6a;
  MaskAddr[3]=0x68;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,12,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,13,1);
  nRet=BurnLoadRom(CpsAd+0x20000,14,1);

  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #9
0
ファイル: dc_ffight.cpp プロジェクト: SiN13/pifba
static int Ffightj1Init()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 16*0x020000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1; // Already byteswapped

  // Load graphics roms
  CpsLoadTilesByte(CpsGfx, 5);
  CpsLoadTilesByte(CpsGfx+(8*0x020000), 5+8);

  nCpsLcReg=0x6c; // Layer control register is at 0x6c
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x04;
  CpsLayEn[3]=0x08;

  MaskAddr[0]=0x6a;
  MaskAddr[1]=0x68;
  MaskAddr[2]=0x66;
  MaskAddr[3]=0x64;

  CpsBID[0]=0x60;
  CpsBID[1]=0x00;
  CpsBID[2]=0x02;

  StartScroll[SCROLL_2]=1;
  StartScroll[SCROLL_3]=1;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,21,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,22,1);
  nRet=BurnLoadRom(CpsAd+0x20000,23,1);

  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #10
0
ファイル: dc_1941.cpp プロジェクト: 0nem4n/ggpofba
static int DrvInit()
{
    int nRet=0;
	Cps=1;
	nCpsRomLen= 0x100000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 4*0x080000;
	nCpsZRomLen= 0x010000;
	nCpsAdLen =2*0x020000;
	nRet=CpsInit(); if (nRet!=0) return 1;

    // Load program roms
	nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
	nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
	nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
	nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
	nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1; // Already byteswapped

    // Load graphics roms
	CpsLoadTiles(CpsGfx,5);

	nCpsLcReg=0x68;   // Layer control register is at 0x6e
    CpsLayEn[1]=0x02; //layer enable 1 is different
    CpsLayEn[2]=0x08;
    CpsLayEn[3]=0x20; // Layer enable is different

    // Board ID improvments by KEV. 0x60,0x0005
    CpsBID[0]=0x60;
    CpsBID[1]=0x00;
    CpsBID[2]=0x05;

	MaskAddr[0]=0x6a;
    MaskAddr[1]=0x6c;
    MaskAddr[2]=0x6e;
    MaskAddr[3]=0x70;

    StartScroll[SCROLL_3]=0x0400;
	EndScroll[SCROLL_3]=0x07ff;

    // Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,9,1);

    // Load ADPCM data
	nRet=BurnLoadRom(CpsAd ,10,1);
	nRet=BurnLoadRom(CpsAd+0x20000,11,1);
	nRet=CpsRunInit(); if (nRet!=0) return 1;

	// Ready to go
	return 0;
}
コード例 #11
0
ファイル: dc_captcomm.cpp プロジェクト: SiN13/pifba
static int DrvInit()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen=   0x140000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100000,3,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTiles(CpsGfx+0x000000,4+0*4);
  CpsLoadTiles(CpsGfx+0x200000,4+1*4);

  nCpsLcReg=0x60; // Layer control register is at 0x60
  CpsLayEn[1]=0x20;
  CpsLayEn[2]=0x12;
  CpsLayEn[3]=0x12;

  // Protection enable code by KEV
  CpsMProt[0]=0x46;
  CpsMProt[1]=0x44;
  CpsMProt[2]=0x42;
  CpsMProt[3]=0x40;

  MaskAddr[0]=0x6e;
  MaskAddr[1]=0x6c;
  MaskAddr[2]=0x6a;
  MaskAddr[3]=0x68;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,12,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,13,1);
  nRet=BurnLoadRom(CpsAd+0x20000,14,1);

  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #12
0
ファイル: cps.cpp プロジェクト: carstene1ns/fbagx
int Cps2Init()
{
	Cps = 2;

	if (CpsGetROMs(false)) {
		return 1;
	}

	CpsInit();

	if (CpsGetROMs(true)) {
		return 1;
	}

	return CpsRunInit();
}
コード例 #13
0
ファイル: dc_ffight.cpp プロジェクト: SiN13/pifba
static int FfightInit()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nCPS68KClockspeed = 10000000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,4,1); if (nRet!=0) return 1; // Already byteswapped

  // Load graphics roms
  CpsLoadTiles(CpsGfx,5);

  nCpsLcReg=0x6e; // Layer control register is at 0x6e
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x0c;
  CpsLayEn[3]=0x0c;

  MaskAddr[0]=0x66;
  MaskAddr[1]=0x70;
  MaskAddr[2]=0x68;
  MaskAddr[3]=0x72;

  StartScroll[SCROLL_2]=1;
  StartScroll[SCROLL_3]=1;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,9,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,10,1);
  nRet=BurnLoadRom(CpsAd+0x20000,11,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #14
0
ファイル: dc_varth.cpp プロジェクト: zloop1982/ggpo-next
static int VarthInit()
{
  int nRet=0;

  Cps=1; Varth=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040001,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x040000,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080001,4,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,5,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0001,6,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0000,7,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTiles(CpsGfx,8);

  nCpsLcReg=0x6e; // Layer control register is at 0x6e
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x0c;
  CpsLayEn[3]=0x0c;

  MaskAddr[0]=0x66;
  MaskAddr[1]=0x70;
  MaskAddr[2]=0x68;
  MaskAddr[3]=0x62;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,12,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,13,1);
  nRet=BurnLoadRom(CpsAd+0x20000,14,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #15
0
ファイル: dc_sfzch.cpp プロジェクト: stevewaffles/pifba
static int DrvInit()
{
    int nRet=0;
    int i=0;
    Cps=3;
    nCpsRomLen= 4*0x080000;
    nCpsCodeLen=0; // not encrypted
    nCpsGfxLen=16*0x080000;
    nCpsZRomLen=  0x010000;
    nCpsAdLen  =2*0x020000;
    nRet=CpsInit();
    if (nRet!=0) return 1;

    // Load program roms (they are already byteswapped)
    for (i=0; i<4; i++)
    {
        nRet=BurnLoadRom(CpsRom+0x080000*i,0+i,1);
        if (nRet!=0) return 1;
    }

    // Load graphics roms
    for (i=0; i<4; i++)
    {
        // Load up and interleve each set of 4 roms to make the 16x16 tiles
        CpsLoadTiles(CpsGfx+0x200000*i,4+i*4);
    }

    MaskAddr[0]=0x68;
    MaskAddr[1]=0x6a;
    MaskAddr[2]=0x6c;
    MaskAddr[3]=0x6e;

    // Load Z80 Rom
    nRet=BurnLoadRom(CpsZRom,20,1);

    // Load ADPCM data
    nRet=BurnLoadRom(CpsAd        ,21,1);
    nRet=BurnLoadRom(CpsAd+0x20000,22,1);

    nRet=CpsRunInit();
    if (nRet!=0) return 1;
    // Ready to go
    return 0;
}
コード例 #16
0
ファイル: dc_pnickj.cpp プロジェクト: SiN13/pifba
static int DrvInit()
{
  int nRet=0;
  Cps=1;
  nCpsRomLen=   0x100000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 4*0x080000;
  nCpsZRomLen=  0x010000;
  nCpsAdLen  =2*0x020000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000001,0,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x000000,1,2); if (nRet!=0) return 1;

  // Load graphics roms
  CpsLoadTilesByte(CpsGfx, 2);
  CpsLoadTilesByte(CpsGfx+(8*0x020000), 2+8);

  nCpsLcReg=0x66; // Layer control register is at 0x66
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x04;
  CpsLayEn[3]=0x08;

  MaskAddr[0]=0x68;
  MaskAddr[1]=0x6a;
  MaskAddr[2]=0x6c;
  MaskAddr[3]=0x6e;

  // Load Z80 Rom
  nRet=BurnLoadRom(CpsZRom,18,1);

  // Load ADPCM data
  nRet=BurnLoadRom(CpsAd        ,19,1);
  nRet=BurnLoadRom(CpsAd+0x20000,20,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #17
0
ファイル: dc_sf2t.cpp プロジェクト: tmaul/finalburnalpha_2001
static int Sf2rb2Init()
{
	int nRet=0;
	int i=0;
	Cps=1;
	nCpsRomLen =8*0x20000+0x80000;
	nCpsGfxLen =3*0x200000;
	nCpsZRomLen=  0x010000;
	nCpsAdLen  =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000000,0,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x000001,1,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x040000,2,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x040001,3,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x080000,4,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x080001,5,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x0c0000,6,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x0c0001,7,2);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_BYTE
	}
	nRet=BurnLoadRom(CpsRom+0x100000,8,1);
	if (nRet!=0)
	{
		return 1;    //ROM_LOAD16_WORD_SWAP
	}

	// Stuff to patch the copy protection for sf2rb2 starts here
	BurnByteswap(CpsRom,0x080000*2);  // must byteswap the 2 new code roms
	CpsRom[0xe5333]=0x60;
	CpsRom[0xe5332]=0x14;
	// Ends here

	// Load up and interleve each set of 4 roms to make the 16x16 tiles
	for (i=0; i<3; i++)
	{
		CpsLoadTiles(CpsGfx+i*0x200000,9+i*4);
	}

	nCpsGfxScroll[1]=nCpsGfxScroll[2]=nCpsGfxScroll[3]=0x400000; // Offset to Scroll tiles

	MaskAddr[0]=0x68;
	MaskAddr[1]=0x6a;
	MaskAddr[2]=0x6c;
	MaskAddr[3]=0x6e;

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,21,1);
	

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd        ,22,1);
	nRet=BurnLoadRom(CpsAd+0x20000,23,1);

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x03,0x60);
	// Start of Board ID improvments by KEV. 0x48,0x0407
	CpsBID[0]=0x48;
	CpsBID[1]=0x04;
	CpsBID[2]=0x07;
	//end
	nPsndIrqPeriod=(60<<10)/250; //OLDTST


	ConstructDIPSWList();

	nRet=CpsRunInit();

	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #18
0
ファイル: dc_mvsc.cpp プロジェクト: tmaul/finalburnalpha_2001
static int DrvInit()
{
	int nRet=0;
	int i=0;
	unsigned char *pqs=NULL;

	Cps=2;
	nCpsRomLen=  8*0x080000;
	nCpsCodeLen= 2*0x080000;
	nCpsGfxLen=  8*0x400000;
	nCpsZRomLen= 2*0x020000;
	nCpsQSamLen= 2*0x400000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

// Load program roms (as they are on the roms) for CpsRom
	for (i=0; i<8; i++)
	{
		nRet=BurnLoadRom(CpsRom+0x080000*i,2+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

// Make decrypted rom
	memcpy(CpsCode,CpsRom,nCpsCodeLen);
	nRet=BurnXorRom(CpsCode         ,0,1);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnXorRom(CpsCode+0x080000,1,1);
	if (nRet!=0)
	{
		return 1;
	}

// Load graphics roms
	nRet=Cps2LoadTiles(CpsGfx           ,10);
	nRet=Cps2LoadTiles(CpsGfx+4*0x400000,14);

// Load Z80 Roms
	nRet=BurnLoadRom(CpsZRom         ,18,1);
	nRet=BurnLoadRom(CpsZRom+ 0x20000,19,1);

// Load Q Sample Roms
	pqs=(unsigned char *)CpsQSam;
	nRet=BurnLoadRom(pqs         ,20,1);
	nRet=BurnLoadRom(pqs+0x400000,21,1);
	BurnByteswap(pqs,nCpsQSamLen);
	



	nRet=CpsRunInit();

	nStateNVMin = 0x019990;
	nStateAllMin = 0x019990;

	if (nRet!=0)
	{
		return 1;
	}
// Ready to go
	return 0;
}
コード例 #19
0
ファイル: dc_qad.cpp プロジェクト: tmaul/finalburnalpha_2001
static int QadInit()
{
	int nRet=0;
	Cps=1;
	Qad=1;
	nCpsRomLen=   0x100000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 4*0x080000;
	nCpsZRomLen=  0x010000;
	nCpsAdLen  =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000001,0,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x000000,1,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040001,2,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040000,3,2);
	if (nRet!=0)
	{
		return 1;
	}
	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x03,0x60);
	// Load graphics roms
	CpsLoadTilesByte(CpsGfx, 4);

	nCpsLcReg=0x6c; // Layer control register is at 0x6c
	CpsLayEn[1]=0x14;
	CpsLayEn[2]=0x02;
	CpsLayEn[3]=0x14;

	// Protection enable code by KEV
	CpsMProt[0]=0x00;
	CpsMProt[1]=0x00;
	CpsMProt[2]=0x00;
	CpsMProt[3]=0x00;

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,12,1);
	nPsndIrqPeriod=(60<<10)/250; //OLDTST
	

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd        ,13,1);
	nRet=BurnLoadRom(CpsAd+0x20000,14,1);


	ConstructDIPSWList();

	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #20
0
static int DrvInit()
{
	int nRet=0;
	int i=0;
	unsigned char *pqs=NULL;

	Cps=2;
	nCpsRomLen=  7*0x080000;
	nCpsCodeLen= 4*0x080000;
	nCpsGfxLen=  4*0x400000;
	nCpsZRomLen= 2*0x020000;
	nCpsQSamLen= 2*0x200000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

// Load program roms (as they are on the roms) for CpsRom
	for (i=0; i<7; i++)
	{
		nRet=BurnLoadRom(CpsRom+0x080000*i,4+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

	memcpy(CpsCode,CpsRom,nCpsCodeLen);
	for (i=0; i<4; i++)
	{
		nRet=BurnXorRom(CpsCode+0x080000*i,0+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

// Load graphics roms
	nRet=Cps2LoadTiles(CpsGfx           ,11);

// Load Z80 Roms
	nRet=BurnLoadRom(CpsZRom         ,15,1);
	nRet=BurnLoadRom(CpsZRom+ 0x20000,16,1);

// Load Q Sample Roms
	pqs=(unsigned char *)CpsQSam;
	nRet=BurnLoadRom(pqs         ,17,1);
	nRet=BurnLoadRom(pqs+0x200000,18,1);
	BurnByteswap(pqs,nCpsQSamLen);
	



	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
// Ready to go
	return 0;
}
コード例 #21
0
ファイル: dc_1941.cpp プロジェクト: tmaul/finalburnalpha_2001
static int DrvInit()
{
	int nRet=0;
	nRet=RotInit();
	if (nRet!=0)
	{
		return 1;
	}
	Cps=1;
	nCpsRomLen= 0x100000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 4*0x080000;
	nCpsZRomLen= 0x010000;
	nCpsAdLen =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000001,0,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x000000,1,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040001,2,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040000,3,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080000,4,1);
	if (nRet!=0)
	{
		return 1;    // Already byteswapped
	}

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x03,0x60)

	// Load graphics roms
	CpsLoadTiles(CpsGfx,5);

	nCpsLcReg=0x68;   // Layer control register is at 0x6e
	CpsLayEn[1]=0x02; //layer enable 1 is different
	CpsLayEn[2]=0x08;
	CpsLayEn[3]=0x20; // Layer enable is different

	// Board ID improvments by KEV. 0x60,0x0005
	CpsBID[0]=0x60;
	CpsBID[1]=0x00;
	CpsBID[2]=0x05;

	MaskAddr[0]=0x6a;
	MaskAddr[1]=0x6c;
	MaskAddr[2]=0x6e;
	MaskAddr[3]=0x70;

	StartScroll[SCROLL_3]=0x0400;
	EndScroll[SCROLL_3]=0x07ff;

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,9,1);
	nPsndIrqPeriod=(60<<10)/250; //OLDTST
	

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd ,10,1);
	nRet=BurnLoadRom(CpsAd+0x20000,11,1);

	ConstructDIPSWList();
	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Ready to go
	return 0;
}
コード例 #22
0
ファイル: main.c プロジェクト: andrey-mcs/start-finish-system
/*******************************************************************************
* Function Name: main()
********************************************************************************
* Summary:
*  Main function for the project.
*
* Parameters:
*  None
*
* Return:
*  None
*
* Theory:
*  The function starts BLE and UART components.
*  This function process all BLE events and also implements the low power 
*  functionality.
*
*******************************************************************************/
int main()
{
    CyGlobalIntEnable; 

#if (DEBUG_UART_ENABLED == ENABLED)
    UART_DEB_Start();
#endif /* (DEBUG_UART_ENABLED == ENABLED) */ 
    DBG_PRINTF("BLE Cycling Sensor Example Project \r\n");
    Disconnect_LED_Write(LED_OFF);
    Advertising_LED_Write(LED_OFF);

    CyBle_Start(AppCallback);

    /* Start CYBLE component and register generic event handler */
    CyBle_Start(AppCallback);
    /* Register service specific callback functions */
    CscsInit();
    CpsInit();
    WDT_Start();

    /***************************************************************************
    * Main polling loop
    ***************************************************************************/
	while(1) 
    {   
        /* CyBle_ProcessEvents() allows BLE stack to process pending events */
        CyBle_ProcessEvents();

        /* To achieve low power in the device */
        LowPowerImplementation();

        /***********************************************************************
        * Wait for connection established with Central device
        ***********************************************************************/
        if(CyBle_GetState() == CYBLE_STATE_CONNECTED)
        {
            /*******************************************************************
            *  Periodically simulate Cycling characteristics and send 
            *  results to the Client
            *******************************************************************/        
            if(mainTimer != 0u)
            {
                mainTimer = 0u;

                SimulateCyclingPower();

                CyBle_ProcessEvents();

                SimulateCyclingSpeed();
            }

            /* Store bounding data to flash only when all debug information has been sent */
        #if (DEBUG_UART_ENABLED == ENABLED)
            if((cyBle_pendingFlashWrite != 0u) &&
               ((UART_DEB_SpiUartGetTxBufferSize() + UART_DEB_GET_TX_FIFO_SR_VALID) == 0u))
        #else
            if(cyBle_pendingFlashWrite != 0u)
        #endif /* (DEBUG_UART_ENABLED == ENABLED) */
            {
                CYBLE_API_RESULT_T apiResult;

                apiResult = CyBle_StoreBondingData(0u);
                (void)apiResult;
                DBG_PRINTF("Store bonding data, status: %x \r\n", apiResult);
            }
        }
	}   
}
コード例 #23
0
static int Pang3jInit()
{
	int nRet=0;
	int i,src,dst;
	Cps=1;
	PangEEP=1;
	nCpsRomLen=   0x100000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 4*0x200000;
	nCpsZRomLen=  0x010000;
	nCpsAdLen  =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000000,0,1);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080000,1,1);
	if (nRet!=0)
	{
		return 1;    // Already byteswapped
	}

	for (i = 0x80000; i < 0x100000; i += 2)
	{
		/* only the low 8 bits of each word are encrypted */
		src = CpsRom[i];
		dst = src & 0xff00;
		if ( src & 0x01)
		{
			dst ^= 0x04;
		}
		if ( src & 0x02)
		{
			dst ^= 0x21;
		}
		if ( src & 0x04)
		{
			dst ^= 0x01;
		}
		if (~src & 0x08)
		{
			dst ^= 0x50;
		}
		if ( src & 0x10)
		{
			dst ^= 0x40;
		}
		if ( src & 0x20)
		{
			dst ^= 0x06;
		}
		if ( src & 0x40)
		{
			dst ^= 0x08;
		}
		if (~src & 0x80)
		{
			dst ^= 0x88;
		}
		CpsRom[i] = (unsigned char)dst;
	}

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x00,0x00);

	// Load graphics roms
	CpsLoadTilesPang(CpsGfx,2);

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,4,1);
	nPsndIrqPeriod=(60<<10)/250; //OLDTST
	
	nCpsLcReg=0x66; // Layer control register is at 0x6e
	CpsLayEn[1]=0x02; //layer enable 1 is different
	CpsLayEn[2]=0x04;
	CpsLayEn[3]=0x08; // Layer enable is different

	MaskAddr[0]=0x68;
	MaskAddr[1]=0x6a;
	MaskAddr[2]=0x6c;
	MaskAddr[3]=0x6e;

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd        ,5,1);
	nRet=BurnLoadRom(CpsAd+0x20000,6,1);


	ConstructDIPSWList();

	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #24
0
static int DuoInit()
{
	int nRet=0;
	unsigned char *pqs=NULL;
	Cps=1;
	Cps1Qs=1;
	slamPro=1;
	nCpsRomLen= 4*0x080000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 12*0x080000;
	nCpsZRomLen= 2*0x020000;
	nCpsQSamLen= 8*0x080000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000001,0,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x000000,1,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040001,2,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040000,3,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080001,4,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080000,5,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x0c0001,6,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x0c0000,7,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x100000,8,1);
	if (nRet!=0)
	{
		return 1;    // Already byteswapped
	}
	nRet=BurnLoadRom(CpsRom+0x180000,9,1);
	if (nRet!=0)
	{
		return 1;    // Already byteswapped
	}

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x00,0x00);

	// Load graphics roms
	CpsLoadTiles(CpsGfx         , 10);
	CpsLoadTiles(CpsGfx+0x200000, 14);
	CpsLoadTiles(CpsGfx+0x400000, 18);

	nCpsLcReg=0x6a; // Layer control register is at 0x6a
	CpsLayEn[1]=0x04;
	CpsLayEn[2]=0x08;
	CpsLayEn[3]=0x10;

	// Protection enable code by KEV
	CpsMProt[0]=0x00;
	CpsMProt[1]=0x00;
	CpsMProt[2]=0x00;
	CpsMProt[3]=0x00;

	// Start of Board ID improvments by KEV. 0x5e,0x0c02
	CpsBID[0]=0x5e;
	CpsBID[1]=0x0c;
	CpsBID[2]=0x02;
	//end

	MaskAddr[0]=0x6c;
	MaskAddr[1]=0x6e;
	MaskAddr[2]=0x70;
	MaskAddr[3]=0x72;

	nRet=BurnLoadRom(CpsZRom,22,1);
	slammast_decode();
	nRet=BurnLoadRom(CpsEncZRom,22,1);

	pqs=(unsigned char *)CpsQSam;
	nRet=BurnLoadRom(pqs         ,23,1);
	nRet=BurnLoadRom(pqs+0x080000,24,1);
	nRet=BurnLoadRom(pqs+0x100000,25,1);
	nRet=BurnLoadRom(pqs+0x180000,26,1);
	nRet=BurnLoadRom(pqs+0x200000,27,1);
	nRet=BurnLoadRom(pqs+0x280000,28,1);
	nRet=BurnLoadRom(pqs+0x300000,29,1);
	nRet=BurnLoadRom(pqs+0x380000,30,1);
	


	ConstructDIPSWList();

	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #25
0
static int DrvInit()
{
	int nRet=0;
	Cps=1;
	PangEEP=1;
	nCpsRomLen=   0x100000;
	nCpsCodeLen=0; // not encrypted
	nCpsGfxLen= 4*0x200000;
	nCpsZRomLen=  0x010000;
	nCpsAdLen  =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000000,0,1);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080000,1,1);
	if (nRet!=0)
	{
		return 1;    // Already byteswapped
	}

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x00,0x00);

	// Load graphics roms
	CpsLoadTilesPang(CpsGfx,2);

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,4,1);
	nPsndIrqPeriod=(60<<10)/250; //OLDTST
	
	nCpsLcReg=0x66; // Layer control register is at 0x6e
	CpsLayEn[1]=0x02; //layer enable 1 is different
	CpsLayEn[2]=0x04;
	CpsLayEn[3]=0x08; // Layer enable is different

	MaskAddr[0]=0x68;
	MaskAddr[1]=0x6a;
	MaskAddr[2]=0x6c;
	MaskAddr[3]=0x6e;

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd        ,5,1);
	nRet=BurnLoadRom(CpsAd+0x20000,6,1);


	ConstructDIPSWList();

	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #26
0
static int DrvInit()
{
	int nRet=0;
	Cps=1;
	Ghouls=1;
	nCpsRomLen=  0x100000;
	nCpsGfxLen=  0x300000;
	nCpsZRomLen= 0x010000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms
	nRet=BurnLoadRom(CpsRom+0x000001,0,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x000000,1,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040001,2,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x040000,3,2);
	if (nRet!=0)
	{
		return 1;
	}
	nRet=BurnLoadRom(CpsRom+0x080000,4,1);
	if (nRet!=0)
	{
		return 1;
	}
	BurnByteswap(CpsRom+0x080000,0x080000);
	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x03,0x60);
	// Load graphics roms
	CpsLoadTiles    (CpsGfx         ,  5);
	CpsLoadTilesByte(CpsGfx+0x200000,  9);
	CpsLoadTilesByte(CpsGfx+0x280000, 17);

	MaskAddr[0]=0x68;
	MaskAddr[1]=0x6a;
	MaskAddr[2]=0x6c;
	MaskAddr[3]=0x6e;

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,25,1);
	


	ConstructDIPSWList();

	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}
コード例 #27
0
ファイル: dc_slammast.cpp プロジェクト: zloop1982/ggpo-next
static int DrvInit()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1;
  nCpsRomLen= 4*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 12*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 8*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1; // Already byteswapped
  nRet=BurnLoadRom(CpsRom+0x080001,1,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,2,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0001,3,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x0c0000,4,2); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100000,5,1); if (nRet!=0) return 1; // Already byteswapped
  nRet=BurnLoadRom(CpsRom+0x180000,6,1); if (nRet!=0) return 1; // Already byteswapped

// Load graphics roms
  CpsLoadTiles(CpsGfx         , 7);
  CpsLoadTiles(CpsGfx+0x200000, 11);
  CpsLoadTiles(CpsGfx+0x400000, 15);

  nCpsLcReg=0x56; // Layer control register is at 0x56
  CpsLayEn[1]=0x04;
  CpsLayEn[2]=0x08;
  CpsLayEn[3]=0x10;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Start of Board ID improvments by KEV. 0x6e,0x0c01
  CpsBID[0]=0x6e;
  CpsBID[1]=0x0c;
  CpsBID[2]=0x01;
  //end

  MaskAddr[0]=0x40;
  MaskAddr[1]=0x42;
  MaskAddr[2]=0x68;
  MaskAddr[3]=0x6a;

  nRet=BurnLoadRom(CpsZRom,19,1);
  slammast_decode();
  nRet=BurnLoadRom(CpsEncZRom,19,1);

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,20,1);
  nRet=BurnLoadRom(pqs+0x080000,21,1);
  nRet=BurnLoadRom(pqs+0x100000,22,1);
  nRet=BurnLoadRom(pqs+0x180000,23,1);
  nRet=BurnLoadRom(pqs+0x200000,24,1);
  nRet=BurnLoadRom(pqs+0x280000,25,1);
  nRet=BurnLoadRom(pqs+0x300000,26,1);
  nRet=BurnLoadRom(pqs+0x380000,27,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
コード例 #28
0
ファイル: dc_sf2t.cpp プロジェクト: tmaul/finalburnalpha_2001
static int Sf2rbInit()
{
	int nRet=0;
	int i=0;
	Cps=1;
	nCpsRomLen =3*0x080000;
	nCpsGfxLen =3*0x200000;
	nCpsZRomLen=  0x010000;
	nCpsAdLen  =2*0x020000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	// Load program roms (they are already byteswapped)
	for (i=0; i<3; i++)
	{
		nRet=BurnLoadRom(CpsRom+0x080000*i,0+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}


	// Stuff to patch the copy protection for sf2rb starts here
	BurnByteswap(CpsRom,0x080000*2);  // must byteswap the 2 new code roms
	CpsRom[0xe5465]=0x60;
	CpsRom[0xe5464]=0x12;
	// Ends here

	// Load up and interleve each set of 4 roms to make the 16x16 tiles
	CpsLoadTiles(CpsGfx+0x000000,3+0*4);
	CpsLoadTiles(CpsGfx+0x200000,3+1*4);
	CpsLoadTiles(CpsGfx+0x400000,3+2*4);

	nCpsGfxScroll[1]=nCpsGfxScroll[2]=nCpsGfxScroll[3]=0x400000; // Offset to Scroll tiles

	MaskAddr[0]=0x68;
	MaskAddr[1]=0x6a;
	MaskAddr[2]=0x6c;
	MaskAddr[3]=0x6e;

	// Load Z80 Rom
	nRet=BurnLoadRom(CpsZRom,15,1);
	

	// Load ADPCM data
	nRet=BurnLoadRom(CpsAd        ,16,1);
	nRet=BurnLoadRom(CpsAd+0x20000,17,1);

	// Set dip switches
	SETUP_DIPSW_3(Cpi01A,Cpi01C,Cpi01E,0x00,0x03,0x60);
	// Start of Board ID improvments by KEV. 0x48,0x0407
	CpsBID[0]=0x48;
	CpsBID[1]=0x04;
	CpsBID[2]=0x07;
	//end
	nPsndIrqPeriod=(60<<10)/250; //OLDTST


	ConstructDIPSWList();

	nRet=CpsRunInit();

	if (nRet!=0)
	{
		return 1;
	}
	// Ready to go
	return 0;
}