⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 thepit.c

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 C
📖 第 1 页 / 共 3 页
字号:

	ROM_REGION(0x10000)     /* 64k for audio CPU */
	ROM_LOAD( "ic22.7",       0x0000, 0x0800, 0x1a7cc392 )
	ROM_LOAD( "ic23.6",       0x0800, 0x0800, 0x91ca7097 )
ROM_END

ROM_START( portman_rom )
	ROM_REGION(0x10000)     /* 64k for main CPU */
	ROM_LOAD( "pe1",       0x0000, 0x1000, 0xa5cf6083 )
	ROM_LOAD( "pe2",       0x1000, 0x1000, 0x0b53d48a )
	ROM_LOAD( "pe3",       0x2000, 0x1000, 0x1c923057 )
	ROM_LOAD( "pe4",       0x3000, 0x1000, 0x555c71ef )
	ROM_LOAD( "pe5",       0x4000, 0x1000, 0xf749e2d4 )

	ROM_REGION_DISPOSE(0x2000)      /* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "pe8",       0x0000, 0x1000, 0x4d8c2974 )
	ROM_LOAD( "pe9",       0x1000, 0x1000, 0x4e4ea162 )

	ROM_REGION(0x0020)      /* Color PROM */
	ROM_LOAD( "ic3",       0x0000, 0x0020, 0x6440dc61 )

	ROM_REGION(0x10000)     /* 64k for audio CPU */
	ROM_LOAD( "pe7",       0x0000, 0x0800, 0xd2094e4a )
	ROM_LOAD( "pe6",       0x0800, 0x0800, 0x1cf447f4 )
ROM_END

ROM_START( suprmous_rom )
	ROM_REGION(0x10000)	    /* 64k for main CPU */
	ROM_LOAD( "sm.1",         0x0000, 0x1000, 0x9db2b786 )
	ROM_LOAD( "sm.2",         0x1000, 0x1000, 0x0a3d91d3 )
	ROM_LOAD( "sm.3",         0x2000, 0x1000, 0x32af6285 )
	ROM_LOAD( "sm.4",         0x3000, 0x1000, 0x46091524 )
	ROM_LOAD( "sm.5",         0x4000, 0x1000, 0xf15fd5d2 )

	ROM_REGION_DISPOSE(0x3000)	    /* temporary space for graphics (disposed after conversion) */
	ROM_LOAD( "sm.7",         0x0000, 0x1000, 0x1d476696 )
	ROM_LOAD( "sm.8",         0x1000, 0x1000, 0x2f81ab5f )
	ROM_LOAD( "sm.9",         0x2000, 0x1000, 0x8463af89 )

	ROM_REGION(0x0040)      /* Color PROM */
	/* We don't have this yet */

	ROM_REGION(0x10000)	   /* 64k for audio CPU */
	ROM_LOAD( "sm.6",         0x0000, 0x1000, 0xfba71785 )
ROM_END



static int thepit_hiload(void)
{
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	/* check if the hi score table has already been initialized */
	if (memcmp(&RAM[0x8297],"\x16",1) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x8039],0x0f);
			osd_fread(f,&RAM[0x8280],0x20);
			osd_fclose(f);
		}

		return 1;
	}
	else return 0;  /* we can't load the hi scores yet */
}

static void thepit_hisave(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x8039],0x0f);
		osd_fwrite(f,&RAM[0x8280],0x20);
		osd_fclose(f);
	}
}


static int roundup_suprmous_common_hiload(int address)
{
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	/* check if the hi score table has already been initialized */
	if (videoram_r(0x0181) == 0x00 &&
		videoram_r(0x01a1) == 0x24)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			int pos;

			osd_fread(f,&RAM[address],0x03);
			osd_fclose(f);

			/* Copy it to the screen and remove leading zeroes */
			videoram_w(0x0221, RAM[address  ] >> 4);
			videoram_w(0x0201, RAM[address  ] & 0x0f);
			videoram_w(0x01e1, RAM[address+1] >> 4);
			videoram_w(0x01c1, RAM[address+1] & 0x0f);
			videoram_w(0x01a1, RAM[address+2] >> 4);
			videoram_w(0x0181, RAM[address+2] & 0x0f);

			for (pos = 0x0221; pos >= 0x01a1; pos -= 0x20 )
			{
				if (videoram_r(pos) != 0x00) break;

				videoram_w(pos, 0x24);
			}
		}

		return 1;
	}
	else return 0;  /* we can't load the hi scores yet */
}

static int roundup_hiload(void)
{
	return roundup_suprmous_common_hiload(0x8050);
}

static void roundup_hisave(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x8050],0x03);
		osd_fclose(f);
	}
}


static int intrepid_hiload(void)
{
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	/* check if the hi score table has already been initialized */
	if (memcmp(&RAM[0x8078],"\xfd",1) == 0)
	{
		void *f;


		if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
		{
			osd_fread(f,&RAM[0x803d],0x3c);
			RAM[0x8035] = RAM[0x803d];
			RAM[0x8036] = RAM[0x803e];
			RAM[0x8037] = RAM[0x803f];
			osd_fclose(f);
		}

		return 1;
	}
	else return 0;  /* we can't load the hi scores yet */
}

static void intrepid_hisave(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x803d],0x3c);
		osd_fclose(f);
	}
}


static int suprmous_hiload(void)
{
	return roundup_suprmous_common_hiload(0x804a);
}

static void suprmous_hisave(void)
{
	void *f;
	unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];


	if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,1)) != 0)
	{
		osd_fwrite(f,&RAM[0x804a],0x03);
		osd_fclose(f);
	}
}

struct GameDriver thepit_driver =
{
	__FILE__,
	0,
	"thepit",
	"The Pit",
	"1982",
	"Centuri",
	"Zsolt Vasvari",
	GAME_IMPERFECT_COLORS,
	&thepit_machine_driver,
	0,

	thepit_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	thepit_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,

	thepit_hiload, thepit_hisave
};


struct GameDriver roundup_driver =
{
	__FILE__,
	0,
	"roundup",
	"Round-Up",
	"1981",
	"Amenip/Centuri",
	"Zsolt Vasvari",
	GAME_IMPERFECT_COLORS,
	&thepit_machine_driver,
	0,

	roundup_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	roundup_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,

	roundup_hiload, roundup_hisave
};


struct GameDriver intrepid_driver =
{
	__FILE__,
	0,
	"intrepid",
	"Intrepid",
	"1983",
	"Nova Games Ltd.",
	"Zsolt Vasvari",
	GAME_IMPERFECT_COLORS,
	&intrepid_machine_driver,
	0,

	intrepid_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	intrepid_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,

	intrepid_hiload, intrepid_hisave
};

struct GameDriver portman_driver =
{
	__FILE__,
	0,
	"portman",
	"Port Man",
	"1982",
	"Nova Games Ltd.",
	"Zsolt Vasvari",
	GAME_IMPERFECT_COLORS,
	&intrepid_machine_driver,
	0,

	portman_rom,
	0, 0,
	0,
	0,      /* sound_prom */

	portman_input_ports,

	PROM_MEMORY_REGION(2), 0, 0,
	ORIENTATION_ROTATE_90,

	0, 0
};

struct GameDriver suprmous_driver =
{
	__FILE__,
	0,
	"suprmous",
	"Super Mouse",
	"1982",
	"Taito",
	"Brad Oliver",
	GAME_WRONG_COLORS,
	&suprmous_machine_driver,
	0,

	suprmous_rom,
	0, 0,
	0,
	0,	/* sound_prom */

	suprmous_input_ports,

	0, 0, 0,
	ORIENTATION_ROTATE_90,

	suprmous_hiload, suprmous_hisave
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -