📄 williams.c
字号:
void robotron_init_machine(void);
void joust_init_machine(void);
void stargate_init_machine(void);
void bubbles_init_machine(void);
void sinistar_init_machine(void);
void defender_init_machine(void);
void splat_init_machine(void);
void blaster_init_machine(void);
void colony7_init_machine(void);
void lottofun_init_machine(void);
int williams_interrupt(void);
void williams_vram_select_w(int offset,int data);
extern unsigned char *robotron_catch;
int robotron_catch_loop_r(int offset);
extern unsigned char *stargate_catch;
int stargate_catch_loop_r(int offset);
extern unsigned char *mayday_catch;
int mayday_catch_loop_r(int offset);
extern unsigned char *defender_catch;
extern unsigned char *defender_bank_base;
int defender_catch_loop_r(int offset);
void defender_bank_select_w(int offset,int data);
void colony7_bank_select_w(int offset,int data);
extern void defcomnd_bank_select_w(int offset,int data);
extern unsigned char *blaster_catch;
extern unsigned char *blaster_bank2_base;
int blaster_catch_loop_r(int offset);
void blaster_bank_select_w(int offset,int data);
void blaster_vram_select_w(int offset,int data);
extern unsigned char *splat_catch;
int splat_catch_loop_r(int offset);
/**** from vidhrdw/williams.h ****/
extern unsigned char *williams_blitterram;
extern unsigned char *williams_remap_select;
void williams_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
int williams_vh_start(void);
int williams_vh_start_sc2(void);
int blaster_vh_start(void);
void williams_vh_stop(void);
void williams_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
void williams_videoram_w(int offset,int data);
void williams_blitter_w(int offset,int data);
void williams_remap_select_w(int offset, int data);
extern unsigned char *blaster_color_zero_table;
extern unsigned char *blaster_color_zero_flags;
extern unsigned char *blaster_video_bits;
void blaster_vh_convert_color_prom (unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
void blaster_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
void blaster_video_bits_w(int offset, int data);
int sinistar_vh_start(void);
void defender_videoram_w(int offset,int data);
static void defndjeu_decode(void);
/***************************************************************************
Memory handlers
***************************************************************************/
/*
* Read/Write mem for Robotron Joust Stargate Bubbles
*/
static struct MemoryReadAddress robotron_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x9810, 0x9810, robotron_catch_loop_r, &robotron_catch },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryReadAddress joust_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryReadAddress stargate_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x9c39, 0x9c39, stargate_catch_loop_r, &stargate_catch },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryReadAddress bubbles_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress williams_writemem[] =
{
{ 0x0000, 0x97ff, williams_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xc00f, paletteram_BBGGGRRR_w, &paletteram },
{ 0xc804, 0xc807, pia_1_w },
{ 0xc80c, 0xc80f, pia_2_w },
{ 0xc900, 0xc900, williams_vram_select_w }, /* bank */
{ 0xca00, 0xca07, williams_blitter_w, &williams_blitterram }, /* blitter */
{ 0xcbff, 0xcbff, watchdog_reset_w }, /* WatchDog (have to be $39) */
{ 0xcc00, 0xcfff, MWA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Splat
*/
static struct MemoryReadAddress splat_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x984b, 0x984b, splat_catch_loop_r, &splat_catch },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress splat_writemem[] =
{
{ 0x0000, 0x97ff, williams_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xc00f, paletteram_BBGGGRRR_w, &paletteram },
{ 0xc804, 0xc807, pia_1_w },
{ 0xc80c, 0xc80f, pia_2_w },
{ 0xc900, 0xc900, williams_vram_select_w }, /* bank */
{ 0xca00, 0xca07, williams_blitter_w, &williams_blitterram }, /* blitter */
{ 0xcbff, 0xcbff, watchdog_reset_w }, /* WatchDog (have to be $39) */
{ 0xcc00, 0xcfff, MWA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Sinistar
*/
static struct MemoryReadAddress sinistar_readmem[] =
{
{ 0x0000, 0x97ff, MRA_BANK1, &williams_bank_base },
{ 0x9800, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xdfff, MRA_RAM }, /* for Sinistar */
{ 0xe000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress sinistar_writemem[] =
{
{ 0x0000, 0x97ff, williams_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xc00f, paletteram_BBGGGRRR_w, &paletteram },
{ 0xc804, 0xc807, pia_1_w },
{ 0xc80c, 0xc80f, pia_2_w },
{ 0xc900, 0xc900, williams_vram_select_w }, /* bank */
{ 0xca00, 0xca07, williams_blitter_w, &williams_blitterram }, /* blitter */
{ 0xcbff, 0xcbff, watchdog_reset_w }, /* WatchDog (have to be $39) */
{ 0xcc00, 0xcfff, MWA_RAM }, /* CMOS */
{ 0xd000, 0xdfff, MWA_RAM }, /* for Sinistar */
{ 0xe000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Blaster
*/
static struct MemoryReadAddress blaster_readmem[] =
{
{ 0x0000, 0x3fff, MRA_BANK1, &williams_bank_base },
{ 0x4000, 0x96ff, MRA_BANK2, &blaster_bank2_base },
/* { 0x9700, 0x9700, blaster_catch_loop_r, &blaster_catch },*/
{ 0x9700, 0xbfff, MRA_RAM },
{ 0xc804, 0xc807, pia_1_r },
{ 0xc80c, 0xc80f, pia_2_r },
{ 0xcb00, 0xcb00, MRA_RAM, &williams_video_counter },
{ 0xcc00, 0xcfff, MRA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress blaster_writemem[] =
{
{ 0x0000, 0x96ff, williams_videoram_w, &videoram, &videoram_size },
{ 0x9700, 0xbaff, MWA_RAM },
{ 0xbb00, 0xbbff, MWA_RAM, &blaster_color_zero_table }, /* Color 0 for each line */
{ 0xbc00, 0xbcff, MWA_RAM, &blaster_color_zero_flags }, /* Color 0 flags, latch color only if bit 0 = 1 */
{ 0xbd00, 0xbfff, MWA_RAM },
{ 0xc000, 0xc00f, paletteram_BBGGGRRR_w, &paletteram },
{ 0xc804, 0xc807, pia_1_w },
{ 0xc80c, 0xc80f, pia_2_w },
{ 0xc900, 0xc900, blaster_vram_select_w }, /* VRAM bank */
{ 0xc940, 0xc940, williams_remap_select_w, &williams_remap_select }, /* select remap colors in Remap prom */
{ 0xc980, 0xc980, blaster_bank_select_w }, /* Bank Select */
{ 0xc9C0, 0xc9c0, blaster_video_bits_w, &blaster_video_bits },/* Video related bits */
{ 0xca00, 0xca07, williams_blitter_w, &williams_blitterram }, /* blitter */
{ 0xcbff, 0xcbff, watchdog_reset_w }, /* WatchDog (have to be $39) */
{ 0xcc00, 0xcfff, MWA_RAM }, /* CMOS */
{ 0xd000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Defender
*/
static struct MemoryReadAddress defender_readmem[] =
{
{ 0xa05d, 0xa05d, defender_catch_loop_r, &defender_catch },
{ 0x0000, 0xbfff, MRA_RAM },
{ 0xc000, 0xcfff, MRA_BANK1 }, /* i/o / rom */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress defender_writemem[] =
{
{ 0x0000, 0x97ff, defender_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xcfff, MWA_BANK1, &defender_bank_base }, /* non map */
{ 0xc000, 0xc00f, MWA_RAM, &paletteram }, /* here only to initialize the pointers */
{ 0xd000, 0xd000, defender_bank_select_w }, /* Bank Select */
{ 0xd001, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Defense Command
*/
static struct MemoryReadAddress defcomnd_readmem[] =
{
{ 0x0000, 0xbfff, MRA_RAM },
{ 0xc000, 0xcfff, MRA_BANK1 }, /* i/o / rom */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress defcomnd_writemem[] =
{
{ 0x0000, 0x97ff, defender_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xcfff, MWA_BANK1, &defender_bank_base }, /* non map */
{ 0xc000, 0xc00f, MWA_RAM, &paletteram }, /* here only to initialize the pointers */
{ 0xd000, 0xdfff, defcomnd_bank_select_w },
{ 0xe000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Mayday
*
* Don't know where busy loop is: E7EA or D665...
*/
static struct MemoryReadAddress mayday_readmem[] =
{
{ 0x0000, 0xbfff, MRA_RAM },
{ 0xc000, 0xcfff, MRA_BANK1 }, /* i/o / rom */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress mayday_writemem[] =
{
{ 0x0000, 0x97ff, defender_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xcfff, MWA_BANK1, &defender_bank_base }, /* non map */
{ 0xc000, 0xc00f, MWA_RAM, &paletteram }, /* here only to initialize the pointers */
{ 0xd000, 0xd000, defender_bank_select_w }, /* Bank Select */
{ 0xd001, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* Read/Write mem for Colony7
*/
static struct MemoryReadAddress colony7_readmem[] =
{
{ 0x0000, 0xbfff, MRA_RAM },
{ 0xc000, 0xcfff, MRA_BANK1 }, /* i/o / rom */
{ 0xd000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress colony7_writemem[] =
{
{ 0x0000, 0x97ff, defender_videoram_w, &videoram, &videoram_size },
{ 0x9800, 0xbfff, MWA_RAM },
{ 0xc000, 0xcfff, MWA_BANK1, &defender_bank_base }, /* non map */
{ 0xc000, 0xc00f, MWA_RAM, &paletteram }, /* here only to initialize the pointers */
{ 0xd000, 0xd000, colony7_bank_select_w }, /* Bank Select */
{ 0xd001, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* memory handlers for the audio CPU
*/
static struct MemoryReadAddress sound_readmem[] =
{
{ 0x0000, 0x007f, MRA_RAM },
{ 0x0400, 0x0403, pia_3_r },
{ 0xf000, 0xffff, MRA_ROM },
{ -1 } /* end of table */
};
static struct MemoryWriteAddress sound_writemem[] =
{
{ 0x0000, 0x007f, MWA_RAM },
{ 0x0400, 0x0403, pia_3_w },
{ 0xf000, 0xffff, MWA_ROM },
{ -1 } /* end of table */
};
/*
* memory handlers for the Colony 7 audio CPU
*/
static struct MemoryReadAddress colony7_sound_readmem[] =
{
{ 0x0000, 0x007f, MRA_RAM },
{ 0x8400, 0x8403, pia_3_r },
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -