📄 gng.c
字号:
ROM_START( gngt_rom )
ROM_REGION(0x18000) /* 64k for code * 5 pages */
ROM_LOAD( "mm03", 0x08000, 0x8000, 0xfb040b42 )
ROM_LOAD( "mm04", 0x04000, 0x4000, 0x652406f6 ) /* 4000-5fff is page 0 */
ROM_LOAD( "mm05", 0x10000, 0x8000, 0x8f7cff61 ) /* page 1, 2, 3 and 4 */
ROM_REGION_DISPOSE(0x34000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "gg1.bin", 0x00000, 0x4000, 0xecfccf07 ) /* characters */
ROM_LOAD( "gg11.bin", 0x04000, 0x4000, 0xddd56fa9 ) /* tiles 0-1 Plane 1*/
ROM_LOAD( "gg10.bin", 0x08000, 0x4000, 0x7302529d ) /* tiles 2-3 Plane 1*/
ROM_LOAD( "gg9.bin", 0x0c000, 0x4000, 0x20035bda ) /* tiles 0-1 Plane 2*/
ROM_LOAD( "gg8.bin", 0x10000, 0x4000, 0xf12ba271 ) /* tiles 2-3 Plane 2*/
ROM_LOAD( "gg7.bin", 0x14000, 0x4000, 0xe525207d ) /* tiles 0-1 Plane 3*/
ROM_LOAD( "gg6.bin", 0x18000, 0x4000, 0x2d77e9b2 ) /* tiles 2-3 Plane 3*/
ROM_LOAD( "gg17.bin", 0x1c000, 0x4000, 0x93e50a8f ) /* sprites 0 Plane 1-2 */
ROM_LOAD( "gg16.bin", 0x20000, 0x4000, 0x06d7e5ca ) /* sprites 1 Plane 1-2 */
ROM_LOAD( "gg15.bin", 0x24000, 0x4000, 0xbc1fe02d ) /* sprites 2 Plane 1-2 */
ROM_LOAD( "gg14.bin", 0x28000, 0x4000, 0x6aaf12f9 ) /* sprites 0 Plane 3-4 */
ROM_LOAD( "gg13.bin", 0x2c000, 0x4000, 0xe80c3fca ) /* sprites 1 Plane 3-4 */
ROM_LOAD( "gg12.bin", 0x30000, 0x4000, 0x7780a925 ) /* sprites 2 Plane 3-4 */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "gg2.bin", 0x0000, 0x8000, 0x615f5b6f ) /* Audio CPU is a Z80 */
ROM_END
ROM_START( gngcross_rom )
ROM_REGION(0x18000) /* 64k for code * 5 pages */
ROM_LOAD( "gng.n9", 0x08000, 0x4000, 0xb6b91cfb )
ROM_LOAD( "gng.n8", 0x0c000, 0x4000, 0xa5cfa928 )
ROM_LOAD( "gng.n10", 0x04000, 0x4000, 0x60343188 )
ROM_LOAD( "gng.n13", 0x10000, 0x4000, 0xfd9a8dda )
ROM_LOAD( "gng.n12", 0x14000, 0x4000, 0x13cf6238 )
ROM_REGION_DISPOSE(0x34000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "gg1.bin", 0x00000, 0x4000, 0xecfccf07 ) /* characters */
ROM_LOAD( "gg11.bin", 0x04000, 0x4000, 0xddd56fa9 ) /* tiles 0-1 Plane 1*/
ROM_LOAD( "gg10.bin", 0x08000, 0x4000, 0x7302529d ) /* tiles 2-3 Plane 1*/
ROM_LOAD( "gg9.bin", 0x0c000, 0x4000, 0x20035bda ) /* tiles 0-1 Plane 2*/
ROM_LOAD( "gg8.bin", 0x10000, 0x4000, 0xf12ba271 ) /* tiles 2-3 Plane 2*/
ROM_LOAD( "gg7.bin", 0x14000, 0x4000, 0xe525207d ) /* tiles 0-1 Plane 3*/
ROM_LOAD( "gg6.bin", 0x18000, 0x4000, 0x2d77e9b2 ) /* tiles 2-3 Plane 3*/
ROM_LOAD( "gng13.n4", 0x1c000, 0x4000, 0x4613afdc ) /* sprites 0 Plane 1-2 */
ROM_LOAD( "gg16.bin", 0x20000, 0x4000, 0x06d7e5ca ) /* sprites 1 Plane 1-2 */
ROM_LOAD( "gg15.bin", 0x24000, 0x4000, 0xbc1fe02d ) /* sprites 2 Plane 1-2 */
ROM_LOAD( "gng16.l4", 0x28000, 0x4000, 0x608d68d5 ) /* sprites 0 Plane 3-4 */
ROM_LOAD( "gg13.bin", 0x2c000, 0x4000, 0xe80c3fca ) /* sprites 1 Plane 3-4 */
ROM_LOAD( "gg12.bin", 0x30000, 0x4000, 0x7780a925 ) /* sprites 2 Plane 3-4 */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "gg2.bin", 0x0000, 0x8000, 0x615f5b6f ) /* Audio CPU is a Z80 */
ROM_END
ROM_START( gngjap_rom )
ROM_REGION(0x18000) /* 64k for code * 5 pages */
ROM_LOAD( "8n.rom", 0x08000, 0x8000, 0x9612d66c )
ROM_LOAD( "10n.rom", 0x04000, 0x4000, 0x81e567e0 ) /* 4000-5fff is page 0 */
ROM_LOAD( "12n.rom", 0x10000, 0x8000, 0x65a6a97b ) /* page 1, 2, 3 and 4 */
ROM_REGION_DISPOSE(0x34000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "gg1.bin", 0x00000, 0x4000, 0xecfccf07 ) /* characters */
ROM_LOAD( "gg11.bin", 0x04000, 0x4000, 0xddd56fa9 ) /* tiles 0-1 Plane 1*/
ROM_LOAD( "gg10.bin", 0x08000, 0x4000, 0x7302529d ) /* tiles 2-3 Plane 1*/
ROM_LOAD( "gg9.bin", 0x0c000, 0x4000, 0x20035bda ) /* tiles 0-1 Plane 2*/
ROM_LOAD( "gg8.bin", 0x10000, 0x4000, 0xf12ba271 ) /* tiles 2-3 Plane 2*/
ROM_LOAD( "gg7.bin", 0x14000, 0x4000, 0xe525207d ) /* tiles 0-1 Plane 3*/
ROM_LOAD( "gg6.bin", 0x18000, 0x4000, 0x2d77e9b2 ) /* tiles 2-3 Plane 3*/
ROM_LOAD( "gg17.bin", 0x1c000, 0x4000, 0x93e50a8f ) /* sprites 0 Plane 1-2 */
ROM_LOAD( "gg16.bin", 0x20000, 0x4000, 0x06d7e5ca ) /* sprites 1 Plane 1-2 */
ROM_LOAD( "gg15.bin", 0x24000, 0x4000, 0xbc1fe02d ) /* sprites 2 Plane 1-2 */
ROM_LOAD( "gg14.bin", 0x28000, 0x4000, 0x6aaf12f9 ) /* sprites 0 Plane 3-4 */
ROM_LOAD( "gg13.bin", 0x2c000, 0x4000, 0xe80c3fca ) /* sprites 1 Plane 3-4 */
ROM_LOAD( "gg12.bin", 0x30000, 0x4000, 0x7780a925 ) /* sprites 2 Plane 3-4 */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "gg2.bin", 0x0000, 0x8000, 0x615f5b6f ) /* Audio CPU is a Z80 */
ROM_END
ROM_START( diamond_rom )
ROM_REGION(0x1a000) /* 64k for code * 6 pages (is it really 6?) */
ROM_LOAD( "d5", 0x00000, 0x8000, 0x453f3f9e )
ROM_LOAD( "d3", 0x08000, 0x8000, 0xf436d6fa )
ROM_LOAD( "d3o", 0x04000, 0x2000, 0xba4bf9f1 ) /* 4000-5fff is page 0 */
ROM_CONTINUE( 0x18000, 0x2000 )
ROM_LOAD( "d5o", 0x10000, 0x8000, 0xae58bd3a ) /* page 1, 2, 3 and 4 */
ROM_REGION_DISPOSE(0x34000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "d1", 0x00000, 0x4000, 0x3a24e504 ) /* characters */
ROM_LOAD( "d11", 0x04000, 0x4000, 0x754357d7 ) /* tiles 0-1 Plane 1*/
ROM_LOAD( "d10", 0x08000, 0x4000, 0x7531edcd ) /* tiles 2-3 Plane 1*/
ROM_LOAD( "d9", 0x0c000, 0x4000, 0x22eeca08 ) /* tiles 0-1 Plane 2*/
ROM_LOAD( "d8", 0x10000, 0x4000, 0x6b61be60 ) /* tiles 2-3 Plane 2*/
ROM_LOAD( "d7", 0x14000, 0x4000, 0xfd595274 ) /* tiles 0-1 Plane 3*/
ROM_LOAD( "d6", 0x18000, 0x4000, 0x7f51dcd2 ) /* tiles 2-3 Plane 3*/
ROM_LOAD( "d17", 0x1c000, 0x4000, 0x8164b005 ) /* sprites 0 Plane 1-2 */
/* empty space for unused sprites 1 Plane 1-2 */
/* empty space for unused sprites 2 Plane 1-2 */
ROM_LOAD( "d14", 0x28000, 0x4000, 0x6f132163 ) /* sprites 0 Plane 3-4 */
/* empty space for unused sprites 1 Plane 3-4 */
/* empty space for unused sprites 2 Plane 3-4 */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "d2", 0x0000, 0x8000, 0x615f5b6f ) /* Audio CPU is a Z80 */
ROM_END
static int gng_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[0x152c],"\x00\x01\x00\x00",4) == 0 &&
memcmp(&RAM[0x156b],"\x00\x01\x00\x00",4) == 0)
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
int offs;
osd_fread(f,&RAM[0x1518],9*10);
offs = RAM[0x1518] * 256 + RAM[0x1519];
RAM[0x00d0] = RAM[offs];
RAM[0x00d1] = RAM[offs+1];
RAM[0x00d2] = RAM[offs+2];
RAM[0x00d3] = RAM[offs+3];
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void gng_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[0x1518],9*10);
osd_fclose(f);
}
}
static int diamond_hiload(void)
{
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* We're just going to blast the hi score table into ROM and be done with it */
if (memcmp(&RAM[0xC10E],"KLE",3) == 0)
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0xC10E],0x80);
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void diamond_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)
{
/* The RAM location of the hi score table */
osd_fwrite(f,&RAM[0x1200],0x80);
osd_fclose(f);
}
}
struct GameDriver gng_driver =
{
__FILE__,
0,
"gng",
"Ghosts'n Goblins (World?)",
"1985",
"Capcom",
"Roberto Ventura\nMirko Buffoni\nNicola Salmoria\nGabrio Secco\nMarco Cassili",
0,
&machine_driver,
0,
gng_rom,
0, 0,
0,
0, /* sound_prom */
gng_input_ports,
0, 0, 0,
ORIENTATION_DEFAULT,
gng_hiload, gng_hisave
};
struct GameDriver gngt_driver =
{
__FILE__,
&gng_driver,
"gngt",
"Ghosts'n Goblins (US)",
"1985",
"Capcom (Taito America license)",
"Roberto Ventura\nMirko Buffoni\nNicola Salmoria\nGabrio Secco\nMarco Cassili",
0,
&machine_driver,
0,
gngt_rom,
0, 0,
0,
0, /* sound_prom */
gng_input_ports,
0, 0, 0,
ORIENTATION_DEFAULT,
gng_hiload, gng_hisave
};
struct GameDriver gngcross_driver =
{
__FILE__,
&gng_driver,
"gngcross",
"Ghosts'n Goblins (Cross)",
"1985",
"Capcom",
"Roberto Ventura\nMirko Buffoni\nNicola Salmoria\nGabrio Secco\nMarco Cassili",
0,
&machine_driver,
0,
gngcross_rom,
0, 0,
0,
0, /* sound_prom */
gng_input_ports,
0, 0, 0,
ORIENTATION_DEFAULT,
gng_hiload, gng_hisave
};
struct GameDriver gngjap_driver =
{
__FILE__,
&gng_driver,
"gngjap",
"Makai-Mura",
"1985",
"Capcom",
"Roberto Ventura\nMirko Buffoni\nNicola Salmoria\nGabrio Secco\nMarco Cassili",
0,
&machine_driver,
0,
gngjap_rom,
0, 0,
0,
0, /* sound_prom */
gngjap_input_ports,
0, 0, 0,
ORIENTATION_DEFAULT,
gng_hiload, gng_hisave
};
struct GameDriver diamond_driver =
{
__FILE__,
0,
"diamond",
"Diamond Run",
"1989",
"KH Video",
"Roberto Ventura\nMirko Buffoni\nNicola Salmoria\nMike Balfour",
0,
&machine_driver,
0,
diamond_rom,
0, 0,
0,
0, /* sound_prom */
diamond_input_ports,
0, 0, 0,
ORIENTATION_DEFAULT,
diamond_hiload, diamond_hisave
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -