📄 mcr3.c
字号:
{ -1 } /* end of table */
};
static struct IOWritePort rm_writeport[] =
{
{ 0, 0xff, rampage_writeport },
{ -1 } /* end of table */
};
static struct IOWritePort mr_writeport[] =
{
{ 0, 0xff, maxrpm_writeport },
{ -1 } /* end of table */
};
static struct IOWritePort sa_writeport[] =
{
{ 0, 0xff, sarge_writeport },
{ -1 } /* end of table */
};
static struct IOWritePort dt_writeport[] =
{
{ 0, 0xff, dotron_writeport },
{ -1 } /* end of table */
};
/***************************************************************************
Graphics layouts
***************************************************************************/
/* generic character layouts */
/* note that characters are half the resolution of sprites in each direction, so we generate
them at double size */
/* 1024 characters; used by tapper, timber, rampage */
static struct GfxLayout mcr3_charlayout_1024 =
{
16, 16,
1024,
4,
{ 1024*16*8, 1024*16*8+1, 0, 1 },
{ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14 },
{ 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 },
16*8
};
/* 512 characters; used by dotron, destderb */
static struct GfxLayout mcr3_charlayout_512 =
{
16, 16,
512,
4,
{ 512*16*8, 512*16*8+1, 0, 1 },
{ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14 },
{ 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 },
16*8
};
/* generic sprite layouts */
/* 512 sprites; used by rampage */
#define X (512*128*8)
#define Y (2*X)
#define Z (3*X)
static struct GfxLayout mcr3_spritelayout_512 =
{
32,32,
512,
4,
{ 0, 1, 2, 3 },
{ Z+0, Z+4, Y+0, Y+4, X+0, X+4, 0, 4, Z+8, Z+12, Y+8, Y+12, X+8, X+12, 8, 12,
Z+16, Z+20, Y+16, Y+20, X+16, X+20, 16, 20, Z+24, Z+28, Y+24, Y+28,
X+24, X+28, 24, 28 },
{ 0, 32, 32*2, 32*3, 32*4, 32*5, 32*6, 32*7, 32*8, 32*9, 32*10, 32*11,
32*12, 32*13, 32*14, 32*15, 32*16, 32*17, 32*18, 32*19, 32*20, 32*21,
32*22, 32*23, 32*24, 32*25, 32*26, 32*27, 32*28, 32*29, 32*30, 32*31 },
128*8
};
#undef X
#undef Y
#undef Z
/* 256 sprites; used by tapper, timber, destderb, spyhunt */
#define X (256*128*8)
#define Y (2*X)
#define Z (3*X)
static struct GfxLayout mcr3_spritelayout_256 =
{
32,32,
256,
4,
{ 0, 1, 2, 3 },
{ Z+0, Z+4, Y+0, Y+4, X+0, X+4, 0, 4, Z+8, Z+12, Y+8, Y+12, X+8, X+12, 8, 12,
Z+16, Z+20, Y+16, Y+20, X+16, X+20, 16, 20, Z+24, Z+28, Y+24, Y+28,
X+24, X+28, 24, 28 },
{ 0, 32, 32*2, 32*3, 32*4, 32*5, 32*6, 32*7, 32*8, 32*9, 32*10, 32*11,
32*12, 32*13, 32*14, 32*15, 32*16, 32*17, 32*18, 32*19, 32*20, 32*21,
32*22, 32*23, 32*24, 32*25, 32*26, 32*27, 32*28, 32*29, 32*30, 32*31 },
128*8
};
#undef X
#undef Y
#undef Z
/* 128 sprites; used by dotron */
#define X (128*128*8)
#define Y (2*X)
#define Z (3*X)
static struct GfxLayout mcr3_spritelayout_128 =
{
32,32,
128,
4,
{ 0, 1, 2, 3 },
{ Z+0, Z+4, Y+0, Y+4, X+0, X+4, 0, 4, Z+8, Z+12, Y+8, Y+12, X+8, X+12, 8, 12,
Z+16, Z+20, Y+16, Y+20, X+16, X+20, 16, 20, Z+24, Z+28, Y+24, Y+28,
X+24, X+28, 24, 28 },
{ 0, 32, 32*2, 32*3, 32*4, 32*5, 32*6, 32*7, 32*8, 32*9, 32*10, 32*11,
32*12, 32*13, 32*14, 32*15, 32*16, 32*17, 32*18, 32*19, 32*20, 32*21,
32*22, 32*23, 32*24, 32*25, 32*26, 32*27, 32*28, 32*29, 32*30, 32*31 },
128*8
};
#undef X
#undef Y
#undef Z
/***************************** spyhunt layouts **********************************/
/* 128 32x16 characters; used by spyhunt */
static struct GfxLayout spyhunt_charlayout_128 =
{
32, 32, /* we pixel double and split in half */
128,
4,
{ 0, 1, 128*128*8, 128*128*8+1 },
{ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14, 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30 },
{ 0, 0, 8*8, 8*8, 16*8, 16*8, 24*8, 24*8, 32*8, 32*8, 40*8, 40*8, 48*8, 48*8, 56*8, 56*8,
64*8, 64*8, 72*8, 72*8, 80*8, 80*8, 88*8, 88*8, 96*8, 96*8, 104*8, 104*8, 112*8, 112*8, 120*8, 120*8 },
128*8
};
/* of course, Spy Hunter just *had* to be different than everyone else... */
static struct GfxLayout spyhunt_alphalayout =
{
16, 16,
256,
2,
{ 0, 1 },
{ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14 },
{ 0, 0, 2*8, 2*8, 4*8, 4*8, 6*8, 6*8, 8*8, 8*8, 10*8, 10*8, 12*8, 12*8, 14*8, 14*8 },
16*8
};
static struct GfxDecodeInfo tapper_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_1024, 0, 4 },
{ 1, 0x8000, &mcr3_spritelayout_256, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo dotron_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_512, 0, 4 },
{ 1, 0x4000, &mcr3_spritelayout_128, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo destderb_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_512, 0, 4 },
{ 1, 0x4000, &mcr3_spritelayout_256, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo timber_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_1024, 0, 4 },
{ 1, 0x8000, &mcr3_spritelayout_256, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo rampage_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_1024, 0, 4 },
{ 1, 0x8000, &mcr3_spritelayout_512, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo sarge_gfxdecodeinfo[] =
{
{ 1, 0x0000, &mcr3_charlayout_512, 0, 4 },
{ 1, 0x4000, &mcr3_spritelayout_256, 0, 4 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo spyhunt_gfxdecodeinfo[] =
{
{ 1, 0x0000, &spyhunt_charlayout_128, 1*16, 1 }, /* top half */
{ 1, 0x0004, &spyhunt_charlayout_128, 1*16, 1 }, /* bottom half */
{ 1, 0x8000, &mcr3_spritelayout_256, 0*16, 1 },
{ 1, 0x28000, &spyhunt_alphalayout, 8*16, 1 },
{ -1 } /* end of array */
};
static struct GfxDecodeInfo crater_gfxdecodeinfo[] =
{
{ 1, 0x0000, &spyhunt_charlayout_128, 3*16, 1 }, /* top half */
{ 1, 0x0004, &spyhunt_charlayout_128, 3*16, 1 }, /* bottom half */
{ 1, 0x8000, &mcr3_spritelayout_256, 0*16, 4 },
{ 1, 0x28000, &spyhunt_alphalayout, 8*16, 1 },
{ -1 } /* end of array */
};
/***************************************************************************
Sound interfaces
***************************************************************************/
static struct AY8910interface ay8910_interface =
{
2, /* 2 chips */
2000000, /* 2 MHz ?? */
{ 255, 255 },
{ 0 },
{ 0 },
{ 0 },
{ 0 }
};
static struct DACinterface dac_interface =
{
1,
{ 255 }
};
static struct TMS5220interface tms5220_interface =
{
640000,
192,
0
};
/***************************************************************************
Machine drivers
***************************************************************************/
static struct MachineDriver tapper_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
5000000, /* 5 Mhz */
0,
readmem,writemem,readport,writeport,
mcr_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
2000000, /* 2 Mhz */
2,
sound_readmem,sound_writemem,0,0,
interrupt,26
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - sound CPU has enough interrupts to handle synchronization */
mcr_init_machine,
/* video hardware */
32*16, 30*16, { 0, 32*16-1, 0, 30*16-1 },
tapper_gfxdecodeinfo,
8*16, 8*16,
mcr3_vh_convert_color_prom,
VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,
0,
generic_vh_start,
generic_vh_stop,
mcr3_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&ay8910_interface
}
}
};
static struct MachineDriver dotron_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
5000000, /* 5 Mhz */
0,
readmem,writemem,dt_readport,dt_writeport,
dotron_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
2000000, /* 2 Mhz */
2,
sound_readmem,sound_writemem,0,0,
interrupt,26
},
{
CPU_M6802 | CPU_AUDIO_CPU,
3580000/4, /* .8 Mhz */
3,
snt_readmem,snt_writemem,0,0,
ignore_interrupt,1
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - sound CPU has enough interrupts to handle synchronization */
dotron_init_machine,
/* video hardware */
/* 32*16, 30*16, { 0, 32*16-1, 0, 30*16-1 }, - MAB 09/30/98, changed the screen size for the backdrop */
800, 600, { 0, 800-1, 0, 600-1 },
dotron_gfxdecodeinfo,
254, 4*16, /* The extra colors are for the backdrop */
mcr3_vh_convert_color_prom,
VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,
0,
dotron_vh_start,
dotron_vh_stop,
dotron_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&ay8910_interface
},
{
SOUND_TMS5220,
&tms5220_interface
}
}
};
static struct MachineDriver destderb_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
5000000, /* 5 Mhz */
0,
readmem,writemem,destderb_readport,writeport,
mcr_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
2000000, /* 2 Mhz */
2,
sound_readmem,sound_writemem,0,0,
interrupt,26
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - sound CPU has enough interrupts to handle synchronization */
mcr_init_machine,
/* video hardware */
32*16, 30*16, { 0, 32*16-1, 0, 30*16-1 },
destderb_gfxdecodeinfo,
8*16, 8*16,
mcr3_vh_convert_color_prom,
VIDEO_TYPE_RASTER|VIDEO_SUPPORTS_DIRTY|VIDEO_MODIFIES_PALETTE,
0,
generic_vh_start,
generic_vh_stop,
mcr3_vh_screenrefresh,
/* sound hardware */
0,0,0,0,
{
{
SOUND_AY8910,
&ay8910_interface
}
}
};
static struct MachineDriver timber_machine_driver =
{
/* basic machine hardware */
{
{
CPU_Z80,
5000000, /* 5 Mhz */
0,
readmem,writemem,readport,writeport,
mcr_interrupt,1
},
{
CPU_Z80 | CPU_AUDIO_CPU,
2000000, /* 2 Mhz */
2,
timber_sound_readmem,timber_sound_writemem,0,0,
interrupt,26
}
},
30, DEFAULT_30HZ_VBLANK_DURATION, /* frames per second, vblank duration */
1, /* 1 CPU slice per frame - sound CPU has enough interrupts to handle synchronization */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -