📄 pooyan.c
字号:
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
64*8 /* every sprite takes 64 consecutive bytes */
};
static struct GfxDecodeInfo gfxdecodeinfo[] =
{
{ 1, 0x0000, &charlayout, 0, 16 },
{ 1, 0x2000, &spritelayout, 16*16, 16 },
{ -1 } /* end of array */
};
static struct AY8910interface ay8910_interface =
{
2, /* 2 chips */
1789750, /* 1.78975 MHz ? (same as other Konami games) */
{ 0x30ff, 0x30ff },
{ soundlatch_r },
{ pooyan_portB_r },
{ 0 },
{ 0 }
};
static struct MachineDriver machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
3072000, /* 3.072 Mhz (?) */
0,
readmem,writemem,0,0,
nmi_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
14318180/4, /* ???? same as other Konami games */
3, /* memory region #3 */
sound_readmem,sound_writemem,0,0,
ignore_interrupt,1 /* interrupts are triggered by the main CPU */
}
},
60, DEFAULT_60HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
0,
/* video hardware */
32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
gfxdecodeinfo,
32,16*16+16*16,
pooyan_vh_convert_color_prom,
VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY,
0,
generic_vh_start,
generic_vh_stop,
pooyan_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&ay8910_interface
}
}
};
/***************************************************************************
Game driver(s)
***************************************************************************/
ROM_START( pooyan_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "1.4a", 0x0000, 0x2000, 0xbb319c63 )
ROM_LOAD( "2.5a", 0x2000, 0x2000, 0xa1463d98 )
ROM_LOAD( "3.6a", 0x4000, 0x2000, 0xfe1a9e08 )
ROM_LOAD( "4.7a", 0x6000, 0x2000, 0x9e0f9bcc )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "8.10g", 0x0000, 0x1000, 0x931b29eb )
ROM_LOAD( "7.9g", 0x1000, 0x1000, 0xbbe6d6e4 )
ROM_LOAD( "6.9a", 0x2000, 0x1000, 0xb2d8c121 )
ROM_LOAD( "5.8a", 0x3000, 0x1000, 0x1097c2b6 )
ROM_REGION(0x0220) /* color proms */
ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, 0xa06a6d0e ) /* palette */
ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, 0x82748c0b ) /* sprites */
ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, 0x8cd4cd60 ) /* characters */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "xx.7a", 0x0000, 0x1000, 0xfbe2b368 )
ROM_LOAD( "xx.8a", 0x1000, 0x1000, 0xe1795b3d )
ROM_END
ROM_START( pooyans_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "ic22_a4.cpu", 0x0000, 0x2000, 0x916ae7d7 )
ROM_LOAD( "ic23_a5.cpu", 0x2000, 0x2000, 0x8fe38c61 )
ROM_LOAD( "ic24_a6.cpu", 0x4000, 0x2000, 0x2660218a )
ROM_LOAD( "ic25_a7.cpu", 0x6000, 0x2000, 0x3d2a10ad )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "ic13_g10.cpu", 0x0000, 0x1000, 0x7433aea9 )
ROM_LOAD( "ic14_g9.cpu", 0x1000, 0x1000, 0x87c1789e )
ROM_LOAD( "6.9a", 0x2000, 0x1000, 0xb2d8c121 )
ROM_LOAD( "5.8a", 0x3000, 0x1000, 0x1097c2b6 )
ROM_REGION(0x0220) /* color proms */
ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, 0xa06a6d0e ) /* palette */
ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, 0x82748c0b ) /* sprites */
ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, 0x8cd4cd60 ) /* characters */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "xx.7a", 0x0000, 0x1000, 0xfbe2b368 )
ROM_LOAD( "xx.8a", 0x1000, 0x1000, 0xe1795b3d )
ROM_END
ROM_START( pootan_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "poo_ic22.bin", 0x0000, 0x2000, 0x41b23a24 )
ROM_LOAD( "poo_ic23.bin", 0x2000, 0x2000, 0xc9d94661 )
ROM_LOAD( "3.6a", 0x4000, 0x2000, 0xfe1a9e08 )
ROM_LOAD( "poo_ic25.bin", 0x6000, 0x2000, 0x8ae459ef )
ROM_REGION_DISPOSE(0x4000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "poo_ic13.bin", 0x0000, 0x1000, 0x0be802e4 )
ROM_LOAD( "poo_ic14.bin", 0x1000, 0x1000, 0xcba29096 )
ROM_LOAD( "6.9a", 0x2000, 0x1000, 0xb2d8c121 )
ROM_LOAD( "5.8a", 0x3000, 0x1000, 0x1097c2b6 )
ROM_REGION(0x0220) /* color proms */
ROM_LOAD( "pooyan.pr1", 0x0000, 0x0020, 0xa06a6d0e ) /* palette */
ROM_LOAD( "pooyan.pr2", 0x0020, 0x0100, 0x82748c0b ) /* sprites */
ROM_LOAD( "pooyan.pr3", 0x0120, 0x0100, 0x8cd4cd60 ) /* characters */
ROM_REGION(0x10000) /* 64k for the audio CPU */
ROM_LOAD( "xx.7a", 0x0000, 0x1000, 0xfbe2b368 )
ROM_LOAD( "xx.8a", 0x1000, 0x1000, 0xe1795b3d )
ROM_END
static int 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[0x8a00],"\x00\x00\x01",3) == 0 &&
memcmp(&RAM[0x8a1b],"\x00\x00\x01",3) == 0)
{
void *f;
static int first_loop;
if (first_loop++ <= 1) return 0; /* wait a little more, otherwise the times */
/* will be overwritten */
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0x89c0],3*10);
osd_fread(f,&RAM[0x8a00],3*10);
osd_fread(f,&RAM[0x8e00],3*10);
RAM[0x88a8] = RAM[0x8a00];
RAM[0x88a9] = RAM[0x8a01];
RAM[0x88aa] = RAM[0x8a02];
osd_fclose(f);
}
first_loop = 0;
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void 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[0x89c0],3*10);
osd_fwrite(f,&RAM[0x8a00],3*10);
osd_fwrite(f,&RAM[0x8e00],3*10);
osd_fclose(f);
}
}
struct GameDriver pooyan_driver =
{
__FILE__,
0,
"pooyan",
"Pooyan (Konami)",
"1982",
"Konami",
"Mike Cuddy (hardware info)\nAllard Van Der Bas (Pooyan emulator)\nNicola Salmoria (MAME driver)\nMartin Binder (color info)\nMarco Cassili",
0,
&machine_driver,
0,
pooyan_rom,
0, 0,
0,
0, /* sound_prom */
input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_270,
hiload, hisave
};
struct GameDriver pooyans_driver =
{
__FILE__,
&pooyan_driver,
"pooyans",
"Pooyan (Stern)",
"1982",
"Stern",
"Mike Cuddy (hardware info)\nAllard Van Der Bas (Pooyan emulator)\nNicola Salmoria (MAME driver)\nMartin Binder (color info)\nMarco Cassili",
0,
&machine_driver,
0,
pooyans_rom,
0, 0,
0,
0, /* sound_prom */
input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_270,
hiload, hisave
};
struct GameDriver pootan_driver =
{
__FILE__,
&pooyan_driver,
"pootan",
"Pootan",
"1982",
"bootleg",
"Mike Cuddy (hardware info)\nAllard Van Der Bas (Pooyan emulator)\nNicola Salmoria (MAME driver)\nMartin Binder (color info)\nMarco Cassili",
0,
&machine_driver,
0,
pootan_rom,
0, 0,
0,
0, /* sound_prom */
input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_270,
hiload, hisave
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -