mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
- Changed all drivers using the MC6845 chip to use the device interface
- Removed mc6845_config - Minor changes to the Qix driver
This commit is contained in:
parent
72a9167032
commit
10e5c35068
@ -15,6 +15,9 @@
|
||||
(1) as per the document at
|
||||
http://www.6502.org/users/andre/hwinfo/crtc/diffs.html
|
||||
|
||||
The various speed rated devices are identified by a letter,
|
||||
for example M68A45, M68B45, etc.
|
||||
|
||||
The chip is originally designed by Hitachi, not by Motorola.
|
||||
|
||||
**********************************************************************/
|
||||
@ -69,48 +72,6 @@ static void update_timer(mc6845_t *mc6845);
|
||||
static TIMER_CALLBACK( display_enable_changed_timer_cb );
|
||||
|
||||
|
||||
mc6845_t *mc6845_config(running_machine *machine, const mc6845_interface *intf)
|
||||
{
|
||||
mc6845_t *mc6845;
|
||||
|
||||
assert(machine != NULL);
|
||||
|
||||
/* allocate the object that holds the state */
|
||||
mc6845 = auto_malloc(sizeof(*mc6845));
|
||||
memset(mc6845, 0, sizeof(*mc6845));
|
||||
|
||||
mc6845->machine = machine;
|
||||
mc6845->intf = intf;
|
||||
|
||||
/* create the timer if the user is interested in getting display enable
|
||||
notifications */
|
||||
if (intf && intf->display_enable_changed)
|
||||
mc6845->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, mc6845);
|
||||
|
||||
/* register for state saving */
|
||||
state_save_register_func_postload_ptr(mc6845_state_save_postload, mc6845);
|
||||
|
||||
state_save_register_item("mc6845", 0, mc6845->address_latch);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_total);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_disp);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_sync_pos);
|
||||
state_save_register_item("mc6845", 0, mc6845->sync_width);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_total);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_total_adj);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_disp);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_sync_pos);
|
||||
state_save_register_item("mc6845", 0, mc6845->intl_skew);
|
||||
state_save_register_item("mc6845", 0, mc6845->max_ras_addr);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor_start_ras);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor_end_ras);
|
||||
state_save_register_item("mc6845", 0, mc6845->start_addr);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor);
|
||||
state_save_register_item("mc6845", 0, mc6845->light_pen);
|
||||
|
||||
return mc6845;
|
||||
}
|
||||
|
||||
|
||||
static void mc6845_state_save_postload(void *param)
|
||||
{
|
||||
mc6845_t *mc6845 = (mc6845_t *)param;
|
||||
@ -451,7 +412,43 @@ void mc6845_update(mc6845_t *mc6845, mame_bitmap *bitmap, const rectangle *clipr
|
||||
/* device interface */
|
||||
static void *mc6845_start(running_machine *machine, const void *static_config, const void *inline_config)
|
||||
{
|
||||
return mc6845_config(machine, static_config);
|
||||
mc6845_t *mc6845;
|
||||
|
||||
assert(machine != NULL);
|
||||
|
||||
/* allocate the object that holds the state */
|
||||
mc6845 = auto_malloc(sizeof(*mc6845));
|
||||
memset(mc6845, 0, sizeof(*mc6845));
|
||||
|
||||
mc6845->machine = machine;
|
||||
mc6845->intf = static_config;
|
||||
|
||||
/* create the timer if the user is interested in getting display enable
|
||||
notifications */
|
||||
if (mc6845->intf && mc6845->intf->display_enable_changed)
|
||||
mc6845->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, mc6845);
|
||||
|
||||
/* register for state saving */
|
||||
state_save_register_func_postload_ptr(mc6845_state_save_postload, mc6845);
|
||||
|
||||
state_save_register_item("mc6845", 0, mc6845->address_latch);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_total);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_disp);
|
||||
state_save_register_item("mc6845", 0, mc6845->horiz_sync_pos);
|
||||
state_save_register_item("mc6845", 0, mc6845->sync_width);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_total);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_total_adj);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_disp);
|
||||
state_save_register_item("mc6845", 0, mc6845->vert_sync_pos);
|
||||
state_save_register_item("mc6845", 0, mc6845->intl_skew);
|
||||
state_save_register_item("mc6845", 0, mc6845->max_ras_addr);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor_start_ras);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor_end_ras);
|
||||
state_save_register_item("mc6845", 0, mc6845->start_addr);
|
||||
state_save_register_item("mc6845", 0, mc6845->cursor);
|
||||
state_save_register_item("mc6845", 0, mc6845->light_pen);
|
||||
|
||||
return mc6845;
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,10 +56,6 @@ struct _mc6845_interface
|
||||
/* device interface */
|
||||
void mc6845_get_info(running_machine *machine, void *token, UINT32 state, deviceinfo *info);
|
||||
|
||||
/* use mc6845_init to set up for save states.
|
||||
if intf is NULL, the emulator will NOT call video_configure_screen() */
|
||||
mc6845_t *mc6845_config(running_machine *machine, const mc6845_interface *intf);
|
||||
|
||||
/* select one of the registers for reading or writing */
|
||||
void mc6845_address_w(mc6845_t *mc6845, UINT8 data);
|
||||
|
||||
|
@ -259,7 +259,7 @@ GFXDECODE_END
|
||||
|
||||
static VIDEO_START(carrera)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(carrera)
|
||||
@ -323,6 +323,8 @@ static MACHINE_DRIVER_START( carrera )
|
||||
MDRV_VIDEO_START(carrera)
|
||||
MDRV_VIDEO_UPDATE(carrera)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -544,7 +544,7 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
static VIDEO_START( coinmstr )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 8, 8, 46, 64);
|
||||
}
|
||||
|
||||
@ -653,6 +653,8 @@ static MACHINE_DRIVER_START( coinmstr )
|
||||
MDRV_VIDEO_START(coinmstr)
|
||||
MDRV_VIDEO_UPDATE(coinmstr)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -76,7 +76,7 @@ static TILE_GET_INFO( get_tile_info )
|
||||
|
||||
static VIDEO_START( couple )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
|
||||
}
|
||||
|
||||
@ -463,6 +463,8 @@ static MACHINE_DRIVER_START( couple )
|
||||
MDRV_VIDEO_START(couple)
|
||||
MDRV_VIDEO_UPDATE(couple)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
MDRV_SOUND_ADD(AY8910, 4000000)
|
||||
|
@ -800,8 +800,9 @@
|
||||
#define MASTER_CLOCK XTAL_16MHz
|
||||
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "video/mc6845.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
#include "funworld.lh"
|
||||
|
||||
@ -1475,6 +1476,8 @@ static MACHINE_DRIVER_START( funworld )
|
||||
MDRV_VIDEO_START(funworld)
|
||||
MDRV_VIDEO_UPDATE(funworld)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
// sound hardware
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -1546,6 +1549,8 @@ static MACHINE_DRIVER_START( snookr10 )
|
||||
// MDRV_SCREEN_SIZE((124+1)*4, (30+1)*8)
|
||||
// MDRV_SCREEN_VISIBLE_AREA(0*4, 96*4-1, 0*8, 29*8-1)
|
||||
|
||||
// MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
MDRV_GFXDECODE(sn10)
|
||||
|
||||
// MDRV_DEFAULT_LAYOUT(layout_funworld)
|
||||
|
@ -235,8 +235,9 @@
|
||||
#define MASTER_CLOCK 10000000
|
||||
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "video/mc6845.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
/* from video */
|
||||
WRITE8_HANDLER( gdrawpkr_videoram_w );
|
||||
@ -586,6 +587,8 @@ static MACHINE_DRIVER_START( gdrawpkr )
|
||||
MDRV_VIDEO_START(gdrawpkr)
|
||||
MDRV_VIDEO_UPDATE(gdrawpkr)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
// sound hardware
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
MDRV_SOUND_ADD(AY8912, MASTER_CLOCK/12) /* guessing again... */
|
||||
|
@ -379,7 +379,7 @@ static TILE_GET_INFO( get_magicfly_tile_info )
|
||||
|
||||
static VIDEO_START(magicfly)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
|
||||
}
|
||||
|
||||
@ -411,7 +411,7 @@ static TILE_GET_INFO( get_7mezzo_tile_info )
|
||||
|
||||
static VIDEO_START( 7mezzo )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_7mezzo_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
|
||||
}
|
||||
|
||||
@ -680,6 +680,7 @@ static MACHINE_DRIVER_START( magicfly )
|
||||
MDRV_VIDEO_START(magicfly)
|
||||
MDRV_VIDEO_UPDATE(magicfly)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
static MACHINE_DRIVER_START( 7mezzo )
|
||||
|
@ -182,7 +182,7 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
static VIDEO_START( miniboy7 )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 37, 37);
|
||||
}
|
||||
|
||||
@ -290,6 +290,8 @@ static MACHINE_DRIVER_START( miniboy7 )
|
||||
|
||||
MDRV_VIDEO_START(miniboy7)
|
||||
MDRV_VIDEO_UPDATE(miniboy7)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
|
@ -1548,7 +1548,7 @@ static PALETTE_INIT( dealem )
|
||||
|
||||
static VIDEO_START(dealem)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(dealem)
|
||||
@ -1685,6 +1685,7 @@ static MACHINE_DRIVER_START( dealem )
|
||||
MDRV_PALETTE_LENGTH(32)
|
||||
MDRV_PALETTE_INIT(dealem)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
static DRIVER_INIT (crmaze)
|
||||
|
@ -180,7 +180,7 @@ static PALETTE_INIT(murogem)
|
||||
|
||||
static VIDEO_START(murogem)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(murogem)
|
||||
@ -229,6 +229,8 @@ static MACHINE_DRIVER_START( murogem )
|
||||
MDRV_PALETTE_INIT(murogem)
|
||||
MDRV_VIDEO_START(murogem)
|
||||
MDRV_VIDEO_UPDATE(murogem)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
|
||||
|
@ -429,8 +429,7 @@ static const mc6845_interface mc6845_intf =
|
||||
|
||||
static VIDEO_START( nyny )
|
||||
{
|
||||
/* configure the CRT controller */
|
||||
mc6845 = mc6845_config(machine, &mc6845_intf);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
|
||||
@ -700,6 +699,9 @@ static MACHINE_DRIVER_START( nyny )
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
|
||||
MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
|
||||
/* audio hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -431,7 +431,7 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
static VIDEO_START( pmpoker )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
|
||||
}
|
||||
|
||||
@ -1023,6 +1023,8 @@ static MACHINE_DRIVER_START( pmpoker )
|
||||
|
||||
MDRV_VIDEO_START(pmpoker)
|
||||
MDRV_VIDEO_UPDATE(pmpoker)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MACHINE_DRIVER_END
|
||||
|
||||
static MACHINE_DRIVER_START( jokerpkr )
|
||||
|
@ -1018,7 +1018,6 @@ ROM_END
|
||||
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Game-specific initialization
|
||||
@ -1089,6 +1088,7 @@ static DRIVER_INIT( kram3 )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( zookeep )
|
||||
{
|
||||
/* configure the banking */
|
||||
@ -1112,19 +1112,19 @@ static DRIVER_INIT( slither )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
GAME( 1981, qix, 0, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qixa, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qixb, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 3)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qix2, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix II (Tournament)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, sdungeon, 0, mcu, sdungeon, 0, ROT270, "Taito America Corporation", "Space Dungeon", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, elecyoyo, 0, mcu, elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, elecyoy2, elecyoyo, mcu, elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram, 0, mcu, kram, 0, ROT0, "Taito America Corporation", "Kram (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram2, kram, mcu, kram, 0, ROT0, "Taito America Corporation", "Kram (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram3, kram, qix, kram, kram3, ROT0, "Taito America Corporation", "Kram (encrypted)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep, 0, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep2, zookeep, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep3, zookeep, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 3)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, slither, 0, slither, slither, slither, ROT270, "Century II", "Slither (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, slithera, slither, slither, slither, slither, ROT270, "Century II", "Slither (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1984, complexx, 0, qix, complexx, 0, ROT270, "Taito America Corporation", "Complex X", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qix, 0, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qixa, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qixb, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix (set 3)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, qix2, qix, qix, qix, 0, ROT270, "Taito America Corporation", "Qix II (Tournament)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, sdungeon, 0, mcu, sdungeon, 0, ROT270, "Taito America Corporation", "Space Dungeon", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, elecyoyo, 0, mcu, elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, elecyoy2, elecyoyo, mcu, elecyoyo, 0, ROT270, "Taito America Corporation", "The Electric Yo-Yo (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram, 0, mcu, kram, 0, ROT0, "Taito America Corporation", "Kram (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram2, kram, mcu, kram, 0, ROT0, "Taito America Corporation", "Kram (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, kram3, kram, qix, kram, kram3, ROT0, "Taito America Corporation", "Kram (encrypted)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep, 0, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep2, zookeep, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, zookeep3, zookeep, zookeep, zookeep, zookeep, ROT0, "Taito America Corporation", "Zoo Keeper (set 3)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, slither, 0, slither, slither, slither, ROT270, "Century II", "Slither (set 1)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1982, slithera, slither, slither, slither, slither, ROT270, "Century II", "Slither (set 2)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1984, complexx, 0, qix, complexx, 0, ROT270, "Taito America Corporation", "Complex X", GAME_SUPPORTS_SAVE )
|
||||
|
@ -407,8 +407,7 @@ static const mc6845_interface mc6845_intf =
|
||||
|
||||
static VIDEO_START( r2dtank )
|
||||
{
|
||||
/* configure the CRT controller */
|
||||
mc6845 = mc6845_config(machine, &mc6845_intf);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
|
||||
@ -566,6 +565,9 @@ static MACHINE_DRIVER_START( r2dtank )
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
|
||||
MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
|
||||
/* audio hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -265,6 +265,7 @@ Stephh's notes (based on the games M6502 code and some tests) :
|
||||
#include "driver.h"
|
||||
#include "deprecat.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "video/mc6845.h"
|
||||
#include "sound/sn76477.h"
|
||||
#include "sound/custom.h"
|
||||
#include "sound/samples.h"
|
||||
@ -1099,6 +1100,8 @@ static MACHINE_DRIVER_START( sasuke )
|
||||
MDRV_VIDEO_START(satansat)
|
||||
MDRV_VIDEO_UPDATE(rockola)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
// sound hardware
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
@ -1171,6 +1174,8 @@ static MACHINE_DRIVER_START( vanguard )
|
||||
MDRV_VIDEO_START(rockola)
|
||||
MDRV_VIDEO_UPDATE(rockola)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
// sound hardware
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -529,8 +529,7 @@ static const mc6845_interface mc6845_intf =
|
||||
|
||||
static VIDEO_START( spiders )
|
||||
{
|
||||
/* configure the CRT controller */
|
||||
mc6845 = mc6845_config(machine, &mc6845_intf);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
}
|
||||
|
||||
|
||||
@ -734,6 +733,9 @@ static MACHINE_DRIVER_START( spiders )
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
|
||||
MDRV_SCREEN_RAW_PARAMS(PIXEL_CLOCK, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
|
||||
/* audio hardware */
|
||||
MDRV_IMPORT_FROM(spiders_audio)
|
||||
|
||||
|
@ -119,7 +119,7 @@ static WRITE8_HANDLER( ssingles_mc6845_register_w )
|
||||
|
||||
static VIDEO_START(ssingles)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, &mc6845_intf);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
|
||||
{
|
||||
int i;
|
||||
@ -286,6 +286,9 @@ static MACHINE_DRIVER_START( ssingles )
|
||||
MDRV_VIDEO_START(ssingles)
|
||||
MDRV_VIDEO_UPDATE(ssingles)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -24,6 +24,7 @@ Sound: AY-3-8912
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "video/mc6845.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
/* video */
|
||||
@ -310,6 +311,8 @@ static MACHINE_DRIVER_START( usg32 )
|
||||
MDRV_VIDEO_START(usgames)
|
||||
MDRV_VIDEO_UPDATE(usgames)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
|
||||
|
@ -29,9 +29,9 @@ struct _qix_state
|
||||
mc6845_t *mc6845;
|
||||
UINT8 *videoram;
|
||||
UINT8 *videoram_address;
|
||||
UINT8 *videoram_mask;
|
||||
UINT8 *paletteram;
|
||||
UINT8 flip_screen;
|
||||
UINT8 vram_mask;
|
||||
UINT8 palette_bank;
|
||||
UINT8 leds;
|
||||
UINT8 *scanline_latch;
|
||||
@ -45,7 +45,7 @@ MACHINE_START( qixmcu );
|
||||
MACHINE_START( slither );
|
||||
MACHINE_RESET( qix );
|
||||
|
||||
WRITE8_HANDLER( zoo_bankswitch_w );
|
||||
WRITE8_HANDLER( zookeep_bankswitch_w );
|
||||
|
||||
READ8_HANDLER( qix_data_firq_r );
|
||||
READ8_HANDLER( qix_data_firq_ack_r );
|
||||
|
@ -281,7 +281,7 @@ INTERRUPT_GEN( qix_vblank_start )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
WRITE8_HANDLER( zoo_bankswitch_w )
|
||||
WRITE8_HANDLER( zookeep_bankswitch_w )
|
||||
{
|
||||
memory_set_bank(1, (data >> 2) & 1);
|
||||
/* not necessary, but technically correct */
|
||||
|
@ -136,19 +136,19 @@ static TILE_GET_INFO( get_bg_tile_info )
|
||||
|
||||
VIDEO_START(funworld)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 96, 29);
|
||||
}
|
||||
|
||||
VIDEO_START(magiccrd)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 112, 34);
|
||||
}
|
||||
|
||||
VIDEO_START(snookr10)
|
||||
{
|
||||
// mc6845 = mc6845_config(machine, NULL);
|
||||
// mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ WRITE8_HANDLER( gdrawpkr_mc6845_register_w )
|
||||
|
||||
VIDEO_START( gdrawpkr )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 31);
|
||||
}
|
||||
|
||||
|
@ -160,18 +160,7 @@ static VIDEO_START( madalien )
|
||||
16, 16, 32, 32
|
||||
};
|
||||
|
||||
static const mc6845_interface mc6845_intf =
|
||||
{
|
||||
0, /* screen we are acting on */
|
||||
PIXEL_CLOCK / 8, /* the clock of the chip */
|
||||
8, /* number of pixels per video memory address */
|
||||
NULL, /* before pixel update callback */
|
||||
NULL, /* row update callback */
|
||||
NULL, /* after pixel update callback */
|
||||
NULL /* call back for display state changes */
|
||||
};
|
||||
|
||||
mc6845 = mc6845_config(machine, &mc6845_intf);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
|
||||
tilemap_fg = tilemap_create(get_tile_info_FG, tilemap_scan_cols_flip_x, 8, 8, 32, 32);
|
||||
tilemap_set_transparent_pen(tilemap_fg, 0);
|
||||
@ -407,6 +396,18 @@ static GFXDECODE_START( madalien )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static const mc6845_interface mc6845_intf =
|
||||
{
|
||||
0, /* screen we are acting on */
|
||||
PIXEL_CLOCK / 8, /* the clock of the chip */
|
||||
8, /* number of pixels per video memory address */
|
||||
NULL, /* before pixel update callback */
|
||||
NULL, /* row update callback */
|
||||
NULL, /* after pixel update callback */
|
||||
NULL /* call back for display state changes */
|
||||
};
|
||||
|
||||
|
||||
MACHINE_DRIVER_START( madalien_video )
|
||||
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
|
||||
@ -417,4 +418,7 @@ MACHINE_DRIVER_START( madalien_video )
|
||||
MDRV_PALETTE_INIT(madalien)
|
||||
MDRV_VIDEO_START(madalien)
|
||||
MDRV_VIDEO_UPDATE(madalien)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
MACHINE_DRIVER_END
|
||||
|
@ -41,35 +41,19 @@ static void qix_update_row(running_machine *machine,
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const mc6845_interface mc6845_intf =
|
||||
{
|
||||
0, /* screen we are acting on */
|
||||
QIX_CHARACTER_CLOCK, /* the clock (pin 21) of the chip */
|
||||
8, /* number of pixels per video memory address */
|
||||
qix_begin_update, /* before pixel update callback */
|
||||
qix_update_row, /* row update callback */
|
||||
0, /* after pixel update callback */
|
||||
qix_display_enable_changed /* call back for display state changes */
|
||||
};
|
||||
|
||||
|
||||
static VIDEO_START( qix )
|
||||
{
|
||||
qix_state *state = machine->driver_data;
|
||||
|
||||
/* get the pointer to the mc6845 object */
|
||||
state->mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
state->mc6845 = devtag_get_token(machine, MC6845, "vid-u18");
|
||||
|
||||
/* allocate memory for the full video RAM */
|
||||
state->videoram = auto_malloc(256 * 256);
|
||||
|
||||
/* initialize the mask for games that don't use it */
|
||||
state->vram_mask = 0xff;
|
||||
|
||||
/* set up save states */
|
||||
state_save_register_global_pointer(state->videoram, 256 * 256);
|
||||
state_save_register_global(state->flip_screen);
|
||||
state_save_register_global(state->vram_mask);
|
||||
state_save_register_global(state->palette_bank);
|
||||
state_save_register_global(state->leds);
|
||||
}
|
||||
@ -99,24 +83,6 @@ static void qix_display_enable_changed(running_machine *machine, mc6845_t *mc684
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Video RAM mask
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static WRITE8_HANDLER( slither_vram_mask_w )
|
||||
{
|
||||
qix_state *state = Machine->driver_data;
|
||||
|
||||
/* Slither appears to extend the basic hardware by providing */
|
||||
/* a mask register which controls which data bits get written */
|
||||
/* to video RAM */
|
||||
state->vram_mask = data;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Cocktail flip
|
||||
@ -168,8 +134,24 @@ static WRITE8_HANDLER( qix_videoram_w )
|
||||
/* add in the upper bit of the address latch */
|
||||
offset += (state->videoram_address[0] & 0x80) << 8;
|
||||
|
||||
/* write the data */
|
||||
state->videoram[offset] = data;
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_HANDLER( slither_videoram_w )
|
||||
{
|
||||
qix_state *state = Machine->driver_data;
|
||||
|
||||
/* update the screen in case the game is writing "behind" the beam -
|
||||
Zookeeper likes to do this */
|
||||
video_screen_update_now(0);
|
||||
|
||||
/* add in the upper bit of the address latch */
|
||||
offset += (state->videoram_address[0] & 0x80) << 8;
|
||||
|
||||
/* blend the data */
|
||||
state->videoram[offset] = (state->videoram[offset] & ~state->vram_mask) | (data & state->vram_mask);
|
||||
state->videoram[offset] = (state->videoram[offset] & ~*state->videoram_mask) | (data & *state->videoram_mask);
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +181,6 @@ static READ8_HANDLER( qix_addresslatch_r )
|
||||
}
|
||||
|
||||
|
||||
|
||||
static WRITE8_HANDLER( qix_addresslatch_w )
|
||||
{
|
||||
qix_state *state = Machine->driver_data;
|
||||
@ -207,8 +188,20 @@ static WRITE8_HANDLER( qix_addresslatch_w )
|
||||
/* compute the value at the address latch */
|
||||
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
|
||||
|
||||
/* write the data */
|
||||
state->videoram[offset] = data;
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_HANDLER( slither_addresslatch_w )
|
||||
{
|
||||
qix_state *state = Machine->driver_data;
|
||||
|
||||
/* compute the value at the address latch */
|
||||
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
|
||||
|
||||
/* blend the data */
|
||||
state->videoram[offset] = (state->videoram[offset] & ~state->vram_mask) | (data & state->vram_mask);
|
||||
state->videoram[offset] = (state->videoram[offset] & ~*state->videoram_mask) | (data & *state->videoram_mask);
|
||||
}
|
||||
|
||||
|
||||
@ -425,7 +418,7 @@ static ADDRESS_MAP_START( zookeep_video_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x8000, 0x83ff) AM_RAM AM_SHARE(1)
|
||||
AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
|
||||
AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03fe) AM_WRITE(qix_palettebank_w)
|
||||
AM_RANGE(0x8801, 0x8801) AM_MIRROR(0x03fe) AM_WRITE(zoo_bankswitch_w)
|
||||
AM_RANGE(0x8801, 0x8801) AM_MIRROR(0x03fe) AM_WRITE(zookeep_bankswitch_w)
|
||||
AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x03fe) AM_READWRITE(qix_data_firq_r, qix_data_firq_w)
|
||||
AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_video_firq_ack_r, qix_video_firq_ack_w)
|
||||
AM_RANGE(0x9000, 0x93ff) AM_READWRITE(MRA8_RAM, qix_paletteram_w) AM_BASE_MEMBER(qix_state, paletteram)
|
||||
@ -440,15 +433,15 @@ ADDRESS_MAP_END
|
||||
|
||||
|
||||
static ADDRESS_MAP_START( slither_video_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_READWRITE(qix_videoram_r, qix_videoram_w)
|
||||
AM_RANGE(0x0000, 0x7fff) AM_READWRITE(qix_videoram_r, slither_videoram_w)
|
||||
AM_RANGE(0x8000, 0x83ff) AM_RAM AM_SHARE(1)
|
||||
AM_RANGE(0x8400, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
|
||||
AM_RANGE(0x8800, 0x8800) AM_MIRROR(0x03ff) AM_WRITE(qix_palettebank_w)
|
||||
AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x03fe) AM_READWRITE(qix_data_firq_r, qix_data_firq_w)
|
||||
AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_video_firq_ack_r, qix_video_firq_ack_w)
|
||||
AM_RANGE(0x9000, 0x93ff) AM_READWRITE(MRA8_RAM, qix_paletteram_w) AM_BASE_MEMBER(qix_state, paletteram)
|
||||
AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
|
||||
AM_RANGE(0x9401, 0x9401) AM_MIRROR(0x03fc) AM_WRITE(slither_vram_mask_w)
|
||||
AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, slither_addresslatch_w)
|
||||
AM_RANGE(0x9401, 0x9401) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_mask)
|
||||
AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE_MEMBER(qix_state, videoram_address)
|
||||
AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(MRA8_RAM) AM_BASE_MEMBER(qix_state, scanline_latch)
|
||||
AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_mc6845_address_w)
|
||||
@ -464,6 +457,18 @@ ADDRESS_MAP_END
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static const mc6845_interface mc6845_intf =
|
||||
{
|
||||
0, /* screen we are acting on */
|
||||
QIX_CHARACTER_CLOCK, /* the clock (pin 21) of the chip */
|
||||
8, /* number of pixels per video memory address */
|
||||
qix_begin_update, /* before pixel update callback */
|
||||
qix_update_row, /* row update callback */
|
||||
0, /* after pixel update callback */
|
||||
qix_display_enable_changed /* call back for display state changes */
|
||||
};
|
||||
|
||||
|
||||
MACHINE_DRIVER_START( qix_video )
|
||||
MDRV_CPU_ADD_TAG("video", M6809, MAIN_CLOCK_OSC/4/4) /* 1.25 MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(qix_video_map,0)
|
||||
@ -472,7 +477,7 @@ MACHINE_DRIVER_START( qix_video )
|
||||
MDRV_VIDEO_START(qix)
|
||||
MDRV_VIDEO_UPDATE(qix)
|
||||
|
||||
MDRV_DEVICE_ADD("crtc", MC6845, 0)
|
||||
MDRV_DEVICE_ADD("vid-u18", MC6845, 0)
|
||||
MDRV_DEVICE_CONFIG(mc6845_intf)
|
||||
|
||||
MDRV_SCREEN_ADD("main", 0)
|
||||
|
@ -193,7 +193,7 @@ static TILE_GET_INFO( get_fg_tile_info )
|
||||
|
||||
VIDEO_START( rockola )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
@ -315,7 +315,7 @@ static TILE_GET_INFO( satansat_get_fg_tile_info )
|
||||
|
||||
VIDEO_START( satansat )
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
|
||||
bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
|
@ -51,7 +51,7 @@ static TILE_GET_INFO( get_usgames_tile_info )
|
||||
|
||||
VIDEO_START(usgames)
|
||||
{
|
||||
mc6845 = mc6845_config(machine, NULL);
|
||||
mc6845 = devtag_get_token(machine, MC6845, "crtc");
|
||||
usgames_tilemap = tilemap_create(get_usgames_tile_info,tilemap_scan_rows, 8, 8,64,32);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user