📄 williams.c
字号:
static struct MachineDriver blaster_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1000000, /* ? Mhz */
0, /* memory region */
blaster_readmem, /* MemoryReadAddress */
blaster_writemem, /* MemoryWriteAddress */
0, /* IOReadPort */
0, /* IOWritePort */
williams_interrupt, /* interrupt routine */
64 /* interrupts per frame (64 times/frame for video counter) */
},
{
CPU_M6808 | CPU_AUDIO_CPU,
894750, /* 0.89475 Mhz (3.579 / 4) */
2, /* memory region #2 */
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 */
blaster_init_machine, /* init machine routine */
/* video hardware */
304, 256, /* screen_width, screen_height */
{ 6, 298-1, 7, 247-1 }, /* struct rectangle visible_area */
0, /* GfxDecodeInfo * */
16+256, /* 16 colors for the real palette, 256 colors for the background */
0, /* color table length */
blaster_vh_convert_color_prom, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
0, /* vh_init routine */
blaster_vh_start, /* vh_start routine */
williams_vh_stop, /* vh_stop routine */
blaster_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_DAC,
&dac_interface
}
}
};
/*
* Colony 7 driver
*/
static struct MachineDriver colony7_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1000000, /* 1 Mhz */
0, /* memory region */
colony7_readmem, /* MemoryReadAddress */
colony7_writemem, /* MemoryWriteAddress */
0, /* IOReadPort */
0, /* IOWritePort */
williams_interrupt, /* interrupt routine */
64 /* interrupts per frame (64 times/frame for video counter) */
},
{
CPU_M6808 | CPU_AUDIO_CPU,
894750, /* 0.89475 Mhz (3.579 / 4) */
2, /* memory region #2 */
colony7_sound_readmem,colony7_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 */
colony7_init_machine, /* init machine routine */
/* video hardware */
304, 256, /* screen_width, screen_height */
{ 6, 298-1, 7, 247-1 }, /* struct rectangle visible_area */
0, /* GfxDecodeInfo * */
16, /* total colors */
0, /* color table length */
williams_vh_convert_color_prom, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
0, /* vh_init routine */
williams_vh_start, /* vh_start routine */
williams_vh_stop, /* vh_stop routine */
williams_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_DAC,
&dac_interface
}
}
};
/*
* Lotto Fun driver
*/
static struct MachineDriver lottofun_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1000000, /* ? Mhz */
0, /* memory region */
bubbles_readmem, /* MemoryReadAddress */
williams_writemem, /* MemoryWriteAddress */
0, /* IOReadPort */
0, /* IOWritePort */
williams_interrupt, /* interrupt routine */
64 /* interrupts per frame (64 times/frame for video counter) */
},
{
CPU_M6808 | CPU_AUDIO_CPU,
894750, /* 0.89475 Mhz (3.579 / 4) */
2, /* memory region #2 */
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 */
lottofun_init_machine, /* init machine routine */
/* video hardware */
304, 256, /* screen_width, screen_height */
{ 6, 298-1, 7, 247-1 }, /* struct rectangle visible_area */
0, /* GfxDecodeInfo * */
16, /* total colors */
0, /* color table length */
williams_vh_convert_color_prom, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
0, /* vh_init routine */
williams_vh_start, /* vh_start routine */
williams_vh_stop, /* vh_stop routine */
williams_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_DAC,
&dac_interface
}
}
};
/*
* Defense Command driver
*/
static struct MachineDriver defcomnd_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1200000, /* ? Mhz */ /*Defender do not like 1 mhz. Collect at least 9 humans, when you depose them, the game stuck */
0, /* memory region */
defcomnd_readmem, /* MemoryReadAddress */
defcomnd_writemem, /* MemoryWriteAddress */
0, /* IOReadPort */
0, /* IOWritePort */
williams_interrupt, /* interrupt routine */
64 /* interrupts per frame (64 times/frame for video counter) */
},
{
CPU_M6808 | CPU_AUDIO_CPU,
894750, /* 0.89475 Mhz (3.579 / 4) */
2, /* memory region #2 */
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 */
defender_init_machine, /* init machine routine */
/* video hardware */
304, 256, /* screen_width, screen_height */
{ 6, 298-1, 7, 247-1 }, /* struct rectangle visible_area */
0, /* GfxDecodeInfo * */
16, /* total colors */
0, /* color table length */
williams_vh_convert_color_prom, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
0, /* vh_init routine */
williams_vh_start, /* vh_start routine */
williams_vh_stop, /* vh_stop routine */
williams_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_DAC,
&dac_interface
}
}
};
/*
* Mayday Driver
*/
static struct MachineDriver mayday_machine_driver =
{
/* basic machine hardware */
{
{
CPU_M6809,
1200000, /* ? Mhz */ /*Defender do not like 1 mhz. Collect at least 9 humans, when you depose them, the game stuck */
0, /* memory region */
mayday_readmem, /* MemoryReadAddress */
mayday_writemem, /* MemoryWriteAddress */
0, /* IOReadPort */
0, /* IOWritePort */
williams_interrupt, /* interrupt routine */
64 /* interrupts per frame (64 times/frame for video counter) */
},
{
CPU_M6808 | CPU_AUDIO_CPU,
894750, /* 0.89475 Mhz (3.579 / 4) */
2, /* memory region #2 */
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 */
defender_init_machine, /* init machine routine */
/* video hardware */
304, 256, /* screen_width, screen_height */
{ 6, 298-1, 7, 247-1 }, /* struct rectangle visible_area */
0, /* GfxDecodeInfo * */
16, /* total colors */
0, /* color table length */
williams_vh_convert_color_prom, /* convert color prom routine */
VIDEO_TYPE_RASTER|VIDEO_MODIFIES_PALETTE|VIDEO_SUPPORTS_DIRTY,
0, /* vh_init routine */
williams_vh_start, /* vh_start routine */
williams_vh_stop, /* vh_stop routine */
williams_vh_screenrefresh, /* vh_update routine */
/* sound hardware */
0,0,0,0,
{
{
SOUND_DAC,
&dac_interface
}
}
};
/***************************************************************************
High score/CMOS save/load
***************************************************************************/
static int cmos_load(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,0)) != 0)
{
osd_fread(f,&RAM[0xcc00],0x400);
osd_fclose (f);
}
return 1;
}
static void cmos_save(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[0xcc00],0x400);
osd_fclose (f);
}
}
static int defender_cmos_load(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,0)) != 0)
{
osd_fread(f,&RAM[0xc400],0x100);
osd_fclose (f);
}
return 1;
}
static void defender_cmos_save(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],0x100);
osd_fclose (f);
}
}
/***************************************************************************
Color PROM data
***************************************************************************/
static unsigned char blaster_remap_prom[] =
{
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x04,0x01,0x03,0x09,0x0A,0x01,0x0C,0x0D,0x0F,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x0C,0x0D,0x0A,0x09,0x0A,0x0C,0x0C,0x0D,0x0B,0x0F,
0x00,0x01,0x02,0x03,0x04,0x0C,0x0F,0x01,0x01,0x09,0x0A,0x07,0x0C,0x0D,0x06,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x01,0x09,0x0E,0x09,0x09,0x0B,0x0E,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x04,0x0C,0x0D,0x05,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x0C,0x09,0x0E,0x09,0x09,0x0B,0x0E,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x09,0x09,0x0E,0x01,0x0A,0x09,0x0C,0x0D,0x09,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0C,0x0A,0x09,0x0C,0x0D,0x0B,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x05,0x0B,0x0E,0x0C,0x0B,0x06,0x0E,0x0D,0x07,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x05,0x06,0x0E,0x0C,0x06,0x01,0x0E,0x0D,0x03,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x05,0x01,0x0E,0x0C,0x01,0x0B,0x0E,0x0D,0x0D,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x05,0x0B,0x0E,0x0C,0x0B,0x0C,0x0E,0x0D,0x0D,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x04,0x0A,0x05,0x0C,0x0D,0x01,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x05,0x0C,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x05,0x01,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x06,0x03,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0C,0x0B,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0E,0x01,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0E,0x0B,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x01,0x0B,0x0B,0x0C,0x0D,0x0E,0x0F,
0x00,0x01,0x02,0x03,0x04,0x0E,0x01,0x04,0x03,0x09,0x0B,0x0C,0x0C,0x0D,0x0B,0x0F,
0x00,0x0F,0x02,0x0D,0x0C,0x0B,0x0A,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,
0x00,0x03,0x02,0x07,0x09,0x0B,0x0D,0x0F,0x05,0x04,0x06,0x08,0x0A,0x0C,0x0E,0x01,
0x00,0x03,0x02,0x0E,0x07,0x01,0x0F,0x09,0x0D,0x06,0x08,0x0A,0x0C,0x05,0x04,0x0B,
0x00,0x0B,0x02,0x05,0x0C,0x0A,0x04,0x06,0x0D,0x09,0x0F,0x01,0x07,0x0E,0x08,0x03,
0x00,0x06,0x02,0x0A,0x0C,0x05,0x04,0x0B,0x03,0x08,0x0E,0x07,0x01,0x0F,0x09,0x0D,
0x00,0x07,0x02,0x0D,0x0F,0x0C,0x04,0x0B,0x05,0x0A,0x06,0x09,0x01,0x03,0x08,0x0E,
0x00,0x09,0x02,0x05,0x03,0x07,0x01,0x0D,0x0A,0x04,0x08,0x0F,0x06,0x0C,0x0B,0x0E,
0x00,0x01,0x02,0x01,0x01,0x01,0x01,0x01,0x05,0x09,0x0C,0x01,0x0C,0x01,0x01,0x05,
0x00,0x05,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x09,0x0C,0x01,0x0C,0x01,0x01,0x05,
0x00,0x05,0x02,0x05,0x01,0x01,0x01,0x01,0x01,0x09,0x0C,0x01,0x0C,0x01,0x01,0x01,
0x00,0x01,0x02,0x05,0x05,0x01,0x01,0x01,0x01,0x09,0x0C,0x01,0x0C,0x01,0x01,0x01,
0x00,0x01,0x02,0x01,0x05,0x05,0x01,0x01,0x01,0x09,0x0C,0x01,0x0C,0x01,0x01,0x01,
0x00,0x01,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x09,0x05,0x05,0x05,0x05,0x05,0x01,
0x00,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -