📄 fastfred.c
字号:
16,16, /* 16*16 sprites */
128, /* 128 sprites */
3, /* 3 bits per pixel */
{ 0x2000*8, 0x1000*8, 0 }, /* the three bitplanes are separated */
{ 0, 1, 2, 3, 4, 5, 6, 7,
8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
32*8 /* every sprite takes 32 consecutive bytes */
};
static struct GfxLayout jumpcoas_spritelayout =
{
16,16, /* 16*16 sprites */
64, /* 64 sprites */
3, /* 3 bits per pixel */
{ 0x2000*8, 0x1000*8, 0 }, /* the three bitplanes are separated */
{ 0, 1, 2, 3, 4, 5, 6, 7,
8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
32*8 /* every sprite takes 32 consecutive bytes */
};
static struct GfxDecodeInfo fastfred_gfxdecodeinfo[] =
{
{ 1, 0x0000, &fastfred_charlayout, 0, 32 },
{ 1, 0x6000, &fastfred_spritelayout, 0, 32 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo jumpcoas_gfxdecodeinfo[] =
{
{ 1, 0x0000, &jumpcoas_charlayout, 0, 32 },
{ 1, 0x0800, &jumpcoas_spritelayout, 0, 32 },
{ -1 } /* end of array */
};
#define CLOCK 18432000 /* The crystal is 18.432Mhz */
static struct AY8910interface fastfred_ay8910_interface =
{
2, /* 2 chips */
CLOCK/6, /* 3.072 Mhz */
{ 255, 255 },
{ 0 },
{ 0 },
{ 0 },
{ 0 }
};
static struct AY8910interface jumpcoas_ay8910_interface =
{
1, /* 1 chip */
CLOCK/6, /* 3.072 Mhz */
{ 255 },
{ 0 },
{ 0 },
{ 0 },
{ 0 }
};
static struct MachineDriver fastfred_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
CLOCK/6, /* 3.072 Mhz */
0,
fastfred_readmem,fastfred_writemem,0,0,
nmi_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
CLOCK/12, /* 1.536 Mhz */
3,
sound_readmem,sound_writemem,0,0,
nmi_interrupt,4
}
},
60, CLOCK/16/60, /* 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 },
fastfred_gfxdecodeinfo,
256,32*8,
fastfred_vh_convert_color_prom,
VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
0,
generic_vh_start,
generic_vh_stop,
fastfred_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&fastfred_ay8910_interface
}
}
};
static struct MachineDriver jumpcoas_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
CLOCK/6, /* 3.072 Mhz */
0,
jumpcoas_readmem,jumpcoas_writemem,0,0,
nmi_interrupt,1
}
},
60, CLOCK/16/60, /* frames per second, vblank duration */
1, /* Single CPU game */
jumpcoas_init_machine,
/* video hardware */
32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
jumpcoas_gfxdecodeinfo,
256,32*8,
fastfred_vh_convert_color_prom,
VIDEO_TYPE_RASTER,
0,
generic_vh_start,
generic_vh_stop,
fastfred_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&jumpcoas_ay8910_interface
}
}
};
#undef CLOCK
/***************************************************************************
Game driver(s)
***************************************************************************/
ROM_START( fastfred_rom )
ROM_REGION(0x10000) /* 64k for main CPU */
ROM_LOAD( "ffr.01", 0x0000, 0x1000, 0x15032c13 )
ROM_LOAD( "ffr.02", 0x1000, 0x1000, 0xf9642744 )
ROM_LOAD( "ffr.03", 0x2000, 0x1000, 0xf0919727 )
ROM_LOAD( "ffr.04", 0x3000, 0x1000, 0xc778751e )
ROM_LOAD( "ffr.05", 0x4000, 0x1000, 0xcd6e160a )
ROM_LOAD( "ffr.06", 0x5000, 0x1000, 0x67f7f9b3 )
ROM_LOAD( "ffr.07", 0x6000, 0x1000, 0x2935c76a )
ROM_LOAD( "ffr.08", 0x7000, 0x1000, 0x0fb79e7b )
ROM_REGION_DISPOSE(0x9000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "ffr.14", 0x0000, 0x1000, 0xe8a00e81 )
ROM_LOAD( "ffr.17", 0x1000, 0x1000, 0x701e0f01 )
ROM_LOAD( "ffr.15", 0x2000, 0x1000, 0xb49b053f )
ROM_LOAD( "ffr.18", 0x3000, 0x1000, 0x4b208c8b )
ROM_LOAD( "ffr.16", 0x4000, 0x1000, 0x8c686bc2 )
ROM_LOAD( "ffr.19", 0x5000, 0x1000, 0x75b613f6 )
ROM_LOAD( "ffr.11", 0x6000, 0x1000, 0x0e1316d4 )
ROM_LOAD( "ffr.12", 0x7000, 0x1000, 0x94c06686 )
ROM_LOAD( "ffr.13", 0x8000, 0x1000, 0x3fcfaa8e )
ROM_REGION(0x300) /* color proms */
ROM_LOAD( "flyboy.red", 0x0000, 0x100, 0xcbff2caa )
ROM_LOAD( "flyboy.grn", 0x0100, 0x100, 0x7da063d0 )
ROM_LOAD( "flyboy.blu", 0x0200, 0x100, 0x448f9399 )
ROM_REGION(0x10000) /* 64k for audio CPU */
ROM_LOAD( "ffr.09", 0x0000, 0x1000, 0xa1ec8d7e )
ROM_LOAD( "ffr.10", 0x1000, 0x1000, 0x460ca837 )
ROM_END
ROM_START( flyboy_rom )
ROM_REGION(0x10000) /* 64k for main CPU */
ROM_LOAD( "rom1.cpu", 0x0000, 0x1000, 0xe9e1f527 )
ROM_LOAD( "rom2.cpu", 0x1000, 0x1000, 0x07fbe78c )
ROM_LOAD( "rom3.cpu", 0x2000, 0x1000, 0xd2f8f085 )
ROM_LOAD( "rom4.cpu", 0x3000, 0x1000, 0x19e5e15c )
ROM_LOAD( "rom5.cpu", 0x4000, 0x1000, 0xd56872ea )
ROM_LOAD( "rom6.cpu", 0x5000, 0x1000, 0xf5464c72 )
ROM_LOAD( "rom7.cpu", 0x6000, 0x1000, 0x50a1baff )
ROM_LOAD( "rom8.cpu", 0x7000, 0x1000, 0xfe2ae95d )
ROM_REGION_DISPOSE(0x9000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "rom14.rom", 0x0000, 0x1000, 0xaeb07260 )
ROM_LOAD( "rom17.rom", 0x1000, 0x1000, 0xa834325b )
ROM_LOAD( "rom15.rom", 0x2000, 0x1000, 0xc10c7ce2 )
ROM_LOAD( "rom18.rom", 0x3000, 0x1000, 0x2f196c80 )
ROM_LOAD( "rom16.rom", 0x4000, 0x1000, 0x719246b1 )
ROM_LOAD( "rom19.rom", 0x5000, 0x1000, 0x00c1c5d2 )
ROM_LOAD( "rom11.rom", 0x6000, 0x1000, 0xee7ec342 )
ROM_LOAD( "rom12.rom", 0x7000, 0x1000, 0x84d03124 )
ROM_LOAD( "rom13.rom", 0x8000, 0x1000, 0xfcb33ff4 )
ROM_REGION(0x300) /* color proms */
ROM_LOAD( "flyboy.red", 0x0000, 0x100, 0xcbff2caa )
ROM_LOAD( "flyboy.grn", 0x0100, 0x100, 0x7da063d0 )
ROM_LOAD( "flyboy.blu", 0x0200, 0x100, 0x448f9399 )
ROM_REGION(0x10000) /* 64k for audio CPU */
ROM_LOAD( "rom9.cpu", 0x0000, 0x1000, 0x5d05d1a0 )
ROM_LOAD( "rom10.cpu", 0x1000, 0x1000, 0x7a28005b )
ROM_END
ROM_START( jumpcoas_rom )
ROM_REGION(0x10000) /* 64k for code */
ROM_LOAD( "jumpcoas.001", 0x0000, 0x2000, 0x0778c953 )
ROM_LOAD( "jumpcoas.002", 0x2000, 0x2000, 0x57f59ce1 )
ROM_LOAD( "jumpcoas.003", 0x4000, 0x2000, 0xd9fc93be )
ROM_LOAD( "jumpcoas.004", 0x6000, 0x2000, 0xdc108fc1 )
ROM_REGION_DISPOSE(0x3000) /* temporary space for graphics (disposed after conversion) */
ROM_LOAD( "jumpcoas.005", 0x0000, 0x1000, 0x2dce6b07 )
ROM_LOAD( "jumpcoas.006", 0x1000, 0x1000, 0x0d24aa1b )
ROM_LOAD( "jumpcoas.007", 0x2000, 0x1000, 0x14c21e67 )
ROM_REGION(0x300) /* color proms */
ROM_LOAD( "jumpcoas.red", 0x0000, 0x100, 0x13714880 )
ROM_LOAD( "jumpcoas.gre", 0x0100, 0x100, 0x05354848 )
ROM_LOAD( "jumpcoas.blu", 0x0200, 0x100, 0xf4662db7 )
ROM_END
static int fastfred_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[0xc41c],"\x10",1) == 0)
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0xc400],0x45);
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void fastfred_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[0xc400],0x45);
osd_fclose(f);
}
}
static int flyboy_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[0xc41c],"\x50",1) == 0)
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0xc400],0x94);
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void flyboy_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[0xc400],0x94);
osd_fclose(f);
}
}
static int jumpcoas_hiload(void)
{
unsigned char *RAM = Machine->memory_region[Machine->drv->cpu[0].memory_region];
/* Note: the game doesn't seem to initialize the high score display
at the top of the screen. Even without high score loading, the
screen says that the high score is 0, even though the high score
table shows all 5000's */
/* check if the hi score table has already been initialized */
if (RAM[0xc421] == 0x11)
{
void *f;
if ((f = osd_fopen(Machine->gamedrv->name,0,OSD_FILETYPE_HIGHSCORE,0)) != 0)
{
osd_fread(f,&RAM[0xc400],0x45);
osd_fclose(f);
}
return 1;
}
else return 0; /* we can't load the hi scores yet */
}
static void jumpcoas_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[0xc400],0x45);
osd_fclose(f);
}
}
struct GameDriver flyboy_driver =
{
__FILE__,
0,
"flyboy",
"Fly-Boy (bootleg?)",
"1982",
"Kaneko",
"Zsolt Vasvari\nBrad Oliver (additional code)\nMarco Cassili (additional code)",
0,
&fastfred_machine_driver,
flyboy_init,
flyboy_rom,
0, 0,
0,
0, /* sound_prom */
flyboy_input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_90,
flyboy_hiload, flyboy_hisave
};
struct GameDriver fastfred_driver =
{
__FILE__,
&flyboy_driver,
"fastfred",
"Fast Freddie",
"1982",
"Atari",
"Zsolt Vasvari",
0,
&fastfred_machine_driver,
fastfred_init,
fastfred_rom,
0, 0,
0,
0, /* sound_prom */
fastfred_input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_90,
fastfred_hiload, fastfred_hisave
};
struct GameDriver jumpcoas_driver =
{
__FILE__,
0,
"jumpcoas",
"Jump Coaster",
"1983",
"Kaneko",
"Zsolt Vasvari",
0,
&jumpcoas_machine_driver,
0,
jumpcoas_rom,
0, 0,
0,
0, /* sound_prom */
jumpcoas_input_ports,
PROM_MEMORY_REGION(2), 0, 0,
ORIENTATION_ROTATE_90,
jumpcoas_hiload, jumpcoas_hisave
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -