- Changed the crtc6845 to be handle based -- adjusted all drivers

- Changed qix.c to RGB32 mode and made its videoram_w do the partial updating instead of a per scanline timer
This commit is contained in:
Zsolt Vasvari 2008-02-12 12:33:10 +00:00
parent 1b1f5abc16
commit e12664a5ae
28 changed files with 744 additions and 442 deletions

View File

@ -11,9 +11,7 @@
#define LOG (0)
typedef struct _crtc6845_state crtc6845_state;
struct _crtc6845_state
struct _crtc6845_t
{
const crtc6845_interface *intf;
@ -48,173 +46,159 @@ struct _crtc6845_state
int has_valid_parameters;
};
static crtc6845_state crtc6845;
static void crtc6845_state_save_postload(void *param);
static void configure_screen(crtc6845_state *chip, int postload);
static void update_timer(crtc6845_state *chip);
static void configure_screen(crtc6845_t *crtc6845, int postload);
static void update_timer(crtc6845_t *crtc6845);
static TIMER_CALLBACK( display_enable_changed_timer_cb );
void crtc6845_init(void)
crtc6845_t *crtc6845_config(const crtc6845_interface *intf)
{
crtc6845_state *chip = &crtc6845;
int which = 0;
crtc6845_t *crtc6845;
state_save_register_func_postload_ptr(crtc6845_state_save_postload, chip);
/* allocate the object that holds the state */
crtc6845 = auto_malloc(sizeof(*crtc6845));
memset(crtc6845, 0, sizeof(*crtc6845));
state_save_register_item("crtc6845", which, chip->address_latch);
state_save_register_item("crtc6845", which, chip->horiz_total);
state_save_register_item("crtc6845", which, chip->horiz_disp);
state_save_register_item("crtc6845", which, chip->horiz_sync_pos);
state_save_register_item("crtc6845", which, chip->sync_width);
state_save_register_item("crtc6845", which, chip->vert_total);
state_save_register_item("crtc6845", which, chip->vert_total_adj);
state_save_register_item("crtc6845", which, chip->vert_disp);
state_save_register_item("crtc6845", which, chip->vert_sync_pos);
state_save_register_item("crtc6845", which, chip->intl_skew);
state_save_register_item("crtc6845", which, chip->max_ras_addr);
state_save_register_item("crtc6845", which, chip->cursor_start_ras);
state_save_register_item("crtc6845", which, chip->cursor_end_ras);
state_save_register_item("crtc6845", which, chip->start_addr);
state_save_register_item("crtc6845", which, chip->cursor);
state_save_register_item("crtc6845", which, chip->light_pen);
/* do not configure the screen */
chip->intf = 0;
chip->has_valid_parameters = FALSE;
}
void crtc6845_config(int which, const crtc6845_interface *intf)
{
crtc6845_state *chip = &crtc6845;
memset(chip, 0, sizeof(*chip));
crtc6845_init();
chip->intf = intf;
crtc6845->intf = intf;
/* create the timer if the user is interested in getting display enable
notifications */
if (intf->display_enable_changed)
chip->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, chip);
if (intf && intf->display_enable_changed)
crtc6845->display_enable_changed_timer = timer_alloc(display_enable_changed_timer_cb, crtc6845);
/* register for state saving */
state_save_register_func_postload_ptr(crtc6845_state_save_postload, crtc6845);
state_save_register_item("crtc6845", 0, crtc6845->address_latch);
state_save_register_item("crtc6845", 0, crtc6845->horiz_total);
state_save_register_item("crtc6845", 0, crtc6845->horiz_disp);
state_save_register_item("crtc6845", 0, crtc6845->horiz_sync_pos);
state_save_register_item("crtc6845", 0, crtc6845->sync_width);
state_save_register_item("crtc6845", 0, crtc6845->vert_total);
state_save_register_item("crtc6845", 0, crtc6845->vert_total_adj);
state_save_register_item("crtc6845", 0, crtc6845->vert_disp);
state_save_register_item("crtc6845", 0, crtc6845->vert_sync_pos);
state_save_register_item("crtc6845", 0, crtc6845->intl_skew);
state_save_register_item("crtc6845", 0, crtc6845->max_ras_addr);
state_save_register_item("crtc6845", 0, crtc6845->cursor_start_ras);
state_save_register_item("crtc6845", 0, crtc6845->cursor_end_ras);
state_save_register_item("crtc6845", 0, crtc6845->start_addr);
state_save_register_item("crtc6845", 0, crtc6845->cursor);
state_save_register_item("crtc6845", 0, crtc6845->light_pen);
return crtc6845;
}
static void crtc6845_state_save_postload(void *param)
{
crtc6845_state *chip = (crtc6845_state *)param;
crtc6845_t *crtc6845 = (crtc6845_t *)param;
configure_screen(chip, TRUE);
configure_screen(crtc6845, TRUE);
}
READ8_HANDLER( crtc6845_register_r )
void crtc6845_address_w(crtc6845_t *crtc6845, UINT8 data)
{
crtc6845_state *chip = &crtc6845;
crtc6845->address_latch = data & 0x1f;
}
UINT8 crtc6845_register_r(crtc6845_t *crtc6845)
{
UINT8 ret = 0xff;
switch (chip->address_latch)
switch (crtc6845->address_latch)
{
case 14:
ret = chip->cursor >> 8;
ret = crtc6845->cursor >> 8;
break;
case 15:
ret = chip->cursor;
ret = crtc6845->cursor;
break;
case 16:
ret = chip->light_pen >> 8;
ret = crtc6845->light_pen >> 8;
break;
case 17:
ret = chip->light_pen;
ret = crtc6845->light_pen;
break;
default:
/* all other registers are write only */
break;
}
return ret;
}
WRITE8_HANDLER( crtc6845_address_w )
void crtc6845_register_w(crtc6845_t *crtc6845, UINT8 data)
{
crtc6845_state *chip = &crtc6845;
chip->address_latch = data & 0x1f;
}
WRITE8_HANDLER( crtc6845_register_w )
{
crtc6845_state *chip = &crtc6845;
int call_configure_screen = FALSE;
if (LOG) logerror("CRT #0 PC %04x: CRTC6845 reg 0x%02x = 0x%02x\n", activecpu_get_pc(), chip->address_latch, data);
if (LOG) logerror("CRT #0 PC %04x: CRTC6845 reg 0x%02x = 0x%02x\n", activecpu_get_pc(), crtc6845->address_latch, data);
switch (chip->address_latch)
switch (crtc6845->address_latch)
{
case 0:
chip->horiz_total = data;
crtc6845->horiz_total = data;
call_configure_screen = TRUE;
break;
case 1:
chip->horiz_disp = data;
crtc6845->horiz_disp = data;
call_configure_screen = TRUE;
break;
case 2:
chip->horiz_sync_pos = data;
crtc6845->horiz_sync_pos = data;
break;
case 3:
chip->sync_width = data & 0x0f;
crtc6845->sync_width = data & 0x0f;
break;
case 4:
chip->vert_total = data & 0x7f;
crtc6845->vert_total = data & 0x7f;
call_configure_screen = TRUE;
break;
case 5:
chip->vert_total_adj = data & 0x1f;
crtc6845->vert_total_adj = data & 0x1f;
call_configure_screen = TRUE;
break;
case 6:
chip->vert_disp = data & 0x7f;
crtc6845->vert_disp = data & 0x7f;
call_configure_screen = TRUE;
break;
case 7:
chip->vert_sync_pos = data & 0x7f;
crtc6845->vert_sync_pos = data & 0x7f;
break;
case 8:
chip->intl_skew = data & 0x03;
crtc6845->intl_skew = data & 0x03;
break;
case 9:
chip->max_ras_addr = data & 0x1f;
crtc6845->max_ras_addr = data & 0x1f;
call_configure_screen = TRUE;
break;
case 10:
chip->cursor_start_ras = data & 0x7f;
crtc6845->cursor_start_ras = data & 0x7f;
break;
case 11:
chip->cursor_end_ras = data & 0x1f;
crtc6845->cursor_end_ras = data & 0x1f;
break;
case 12:
chip->start_addr &= 0x00ff;
chip->start_addr |= (data & 0x3f) << 8;
crtc6845->start_addr &= 0x00ff;
crtc6845->start_addr |= (data & 0x3f) << 8;
call_configure_screen = TRUE;
break;
case 13:
chip->start_addr &= 0xff00;
chip->start_addr |= data;
crtc6845->start_addr &= 0xff00;
crtc6845->start_addr |= data;
call_configure_screen = TRUE;
break;
case 14:
chip->cursor &= 0x00ff;
chip->cursor |= (data & 0x3f) << 8;
crtc6845->cursor &= 0x00ff;
crtc6845->cursor |= (data & 0x3f) << 8;
break;
case 15:
chip->cursor &= 0xff00;
chip->cursor |= data;
crtc6845->cursor &= 0xff00;
crtc6845->cursor |= data;
break;
case 16: /* read-only */
break;
@ -225,33 +209,33 @@ WRITE8_HANDLER( crtc6845_register_w )
}
if (call_configure_screen)
configure_screen(chip, FALSE);
configure_screen(crtc6845, FALSE);
}
static void configure_screen(crtc6845_state *chip, int postload)
static void configure_screen(crtc6845_t *crtc6845, int postload)
{
if (chip->intf)
if (crtc6845->intf)
{
/* compute the screen sizes */
UINT16 horiz_total = (chip->horiz_total + 1) * chip->intf->hpixels_per_column;
UINT16 vert_total = (chip->vert_total + 1) * (chip->max_ras_addr + 1) + chip->vert_total_adj;
UINT16 horiz_total = (crtc6845->horiz_total + 1) * crtc6845->intf->hpixels_per_column;
UINT16 vert_total = (crtc6845->vert_total + 1) * (crtc6845->max_ras_addr + 1) + crtc6845->vert_total_adj;
/* determine the visible area, avoid division by 0 */
UINT16 max_x = chip->horiz_disp * chip->intf->hpixels_per_column - 1;
UINT16 max_y = chip->vert_disp * (chip->max_ras_addr + 1) - 1;
UINT16 max_x = crtc6845->horiz_disp * crtc6845->intf->hpixels_per_column - 1;
UINT16 max_y = crtc6845->vert_disp * (crtc6845->max_ras_addr + 1) - 1;
/* update only if screen parameters changed, unless we are coming here after loading the saved state */
if (postload ||
(horiz_total != chip->last_horiz_total) || (vert_total != chip->last_vert_total) ||
(max_x != chip->last_max_x) || (max_y != chip->last_max_y))
(horiz_total != crtc6845->last_horiz_total) || (vert_total != crtc6845->last_vert_total) ||
(max_x != crtc6845->last_max_x) || (max_y != crtc6845->last_max_y))
{
/* update the screen only if we have valid data */
if ((chip->horiz_total > 0) && (max_x < horiz_total) && (chip->vert_total > 0) && (max_y < vert_total))
if ((crtc6845->horiz_total > 0) && (max_x < horiz_total) && (crtc6845->vert_total > 0) && (max_y < vert_total))
{
rectangle visarea;
attoseconds_t refresh = HZ_TO_ATTOSECONDS(chip->intf->clock) * (chip->horiz_total + 1) * vert_total;
attoseconds_t refresh = HZ_TO_ATTOSECONDS(crtc6845->intf->clock) * (crtc6845->horiz_total + 1) * vert_total;
visarea.min_x = 0;
visarea.min_y = 0;
@ -261,59 +245,59 @@ static void configure_screen(crtc6845_state *chip, int postload)
if (LOG) logerror("CRTC6845 config screen: HTOTAL: %x VTOTAL: %x MAX_X: %x MAX_Y: %x FPS: %f\n",
horiz_total, vert_total, max_x, max_y, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
video_screen_configure(chip->intf->scrnum, horiz_total, vert_total, &visarea, refresh);
video_screen_configure(crtc6845->intf->scrnum, horiz_total, vert_total, &visarea, refresh);
chip->has_valid_parameters = TRUE;
crtc6845->has_valid_parameters = TRUE;
}
else
chip->has_valid_parameters = FALSE;
crtc6845->has_valid_parameters = FALSE;
chip->last_horiz_total = horiz_total;
chip->last_vert_total = vert_total;
chip->last_max_x = max_x;
chip->last_max_y = max_y;
crtc6845->last_horiz_total = horiz_total;
crtc6845->last_vert_total = vert_total;
crtc6845->last_max_x = max_x;
crtc6845->last_max_y = max_y;
update_timer(chip);
update_timer(crtc6845);
}
}
}
static int is_display_enabled(crtc6845_state *chip)
static int is_display_enabled(crtc6845_t *crtc6845)
{
UINT16 y = video_screen_get_vpos(chip->intf->scrnum);
UINT16 x = video_screen_get_hpos(chip->intf->scrnum);
UINT16 y = video_screen_get_vpos(crtc6845->intf->scrnum);
UINT16 x = video_screen_get_hpos(crtc6845->intf->scrnum);
return (y <= chip->last_max_y) && (x <= chip->last_max_x);
return (y <= crtc6845->last_max_y) && (x <= crtc6845->last_max_x);
}
static void update_timer(crtc6845_state *chip)
static void update_timer(crtc6845_t *crtc6845)
{
INT16 next_y;
UINT16 next_x;
attotime duration;
if (chip->has_valid_parameters && (chip->display_enable_changed_timer != 0))
if (crtc6845->has_valid_parameters && (crtc6845->display_enable_changed_timer != 0))
{
if (is_display_enabled(chip))
if (is_display_enabled(crtc6845))
{
/* we are in a display region,
get the location of the next blanking start */
/* normally, it's at end the current raster line */
next_y = video_screen_get_vpos(chip->intf->scrnum);
next_x = chip->last_max_x + 1;
next_y = video_screen_get_vpos(crtc6845->intf->scrnum);
next_x = crtc6845->last_max_x + 1;
/* but if visible width = horiz_total, then we need
to go to the beginning of VBLANK */
if (next_x == chip->last_horiz_total)
if (next_x == crtc6845->last_horiz_total)
{
next_y = chip->last_max_y + 1;
next_y = crtc6845->last_max_y + 1;
next_x = 0;
/* abnormal case, no vertical blanking, either */
if (next_y == chip->last_vert_total)
if (next_y == crtc6845->last_vert_total)
next_y = -1;
}
}
@ -322,42 +306,40 @@ static void update_timer(crtc6845_state *chip)
/* we are in a blanking region,
get the location of the next display start */
next_x = 0;
next_y = (video_screen_get_vpos(chip->intf->scrnum) + 1) % chip->last_vert_total;
next_y = (video_screen_get_vpos(crtc6845->intf->scrnum) + 1) % crtc6845->last_vert_total;
/* if we would now fall in the vertical blanking, we need
to go to the top of the screen */
if (next_y > chip->last_max_y)
if (next_y > crtc6845->last_max_y)
next_y = 0;
}
if (next_y != -1)
duration = video_screen_get_time_until_pos(chip->intf->scrnum, next_y, next_x);
duration = video_screen_get_time_until_pos(crtc6845->intf->scrnum, next_y, next_x);
else
duration = attotime_never;
timer_adjust_oneshot(chip->display_enable_changed_timer, duration, 0);
timer_adjust_oneshot(crtc6845->display_enable_changed_timer, duration, 0);
}
}
static TIMER_CALLBACK( display_enable_changed_timer_cb )
{
crtc6845_state *chip = ptr;
crtc6845_t *crtc6845 = ptr;
/* call the callback function -- we know it exists */
chip->intf->display_enable_changed(is_display_enabled(chip));
crtc6845->intf->display_enable_changed(is_display_enabled(crtc6845));
update_timer(chip);
update_timer(crtc6845);
}
UINT16 crtc6845_get_ma(int which)
UINT16 crtc6845_get_ma(crtc6845_t *crtc6845)
{
crtc6845_state *chip = &crtc6845;
UINT16 ret;
if (chip->has_valid_parameters)
if (crtc6845->has_valid_parameters)
{
/* get the current raster positions and clamp them to the visible region */
int y = video_screen_get_vpos(0);
@ -365,15 +347,15 @@ UINT16 crtc6845_get_ma(int which)
/* since the MA counter stops in the blanking regions, if we are in a
VBLANK, both X and Y are at their max */
if ((y > chip->last_max_y) || (x > chip->last_max_x))
x = chip->last_max_x;
if ((y > crtc6845->last_max_y) || (x > crtc6845->last_max_x))
x = crtc6845->last_max_x;
if (y > chip->last_max_y)
y = chip->last_max_y;
if (y > crtc6845->last_max_y)
y = crtc6845->last_max_y;
ret = (chip->start_addr +
(y / (chip->max_ras_addr + 1)) * chip->horiz_disp +
(x / chip->intf->hpixels_per_column)) & 0x3fff;
ret = (crtc6845->start_addr +
(y / (crtc6845->max_ras_addr + 1)) * crtc6845->horiz_disp +
(x / crtc6845->intf->hpixels_per_column)) & 0x3fff;
}
else
ret = 0;
@ -382,21 +364,19 @@ UINT16 crtc6845_get_ma(int which)
}
UINT8 crtc6845_get_ra(int which)
UINT8 crtc6845_get_ra(crtc6845_t *crtc6845)
{
crtc6845_state *chip = &crtc6845;
UINT8 ret;
if (chip->has_valid_parameters)
if (crtc6845->has_valid_parameters)
{
/* get the current vertical raster position and clamp it to the visible region */
int y = video_screen_get_vpos(0);
if (y > chip->last_max_y)
y = chip->last_max_y;
if (y > crtc6845->last_max_y)
y = crtc6845->last_max_y;
ret = y % (chip->max_ras_addr + 1);
ret = y % (crtc6845->max_ras_addr + 1);
}
else
ret = 0;
@ -405,41 +385,37 @@ UINT8 crtc6845_get_ra(int which)
}
VIDEO_UPDATE( crtc6845 )
void crtc6845_update(crtc6845_t *crtc6845, mame_bitmap *bitmap, const rectangle *cliprect)
{
crtc6845_state *chip = &crtc6845;
if (chip->has_valid_parameters)
if (crtc6845->has_valid_parameters)
{
UINT16 y;
/* call the set up function if any */
void *param = 0;
if (chip->intf->begin_update)
param = chip->intf->begin_update(machine, screen, bitmap, cliprect);
if (crtc6845->intf->begin_update)
param = crtc6845->intf->begin_update(bitmap, cliprect);
/* read the start address at the beginning of the frame */
if (cliprect->min_y == 0)
chip->current_ma = chip->start_addr;
crtc6845->current_ma = crtc6845->start_addr;
/* for each row in the visible region */
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
UINT8 ra = y % (chip->max_ras_addr + 1);
UINT8 ra = y % (crtc6845->max_ras_addr + 1);
/* call the external system to draw it */
chip->intf->update_row(bitmap, cliprect, chip->current_ma, ra, y, chip->horiz_disp, param);
crtc6845->intf->update_row(bitmap, cliprect, crtc6845->current_ma, ra, y, crtc6845->horiz_disp, param);
/* update MA if the last raster address */
if (ra == chip->max_ras_addr)
chip->current_ma = (chip->current_ma + chip->horiz_disp) & 0x3fff;
if (ra == crtc6845->max_ras_addr)
crtc6845->current_ma = (crtc6845->current_ma + crtc6845->horiz_disp) & 0x3fff;
}
/* call the tear down function if any */
if (chip->intf->end_update)
chip->intf->end_update(bitmap, cliprect, param);
if (crtc6845->intf->end_update)
crtc6845->intf->end_update(bitmap, cliprect, param);
}
return 0;
}

View File

@ -4,8 +4,13 @@
**********************************************************************/
#ifndef CRTC6845
#define CRTC6845
typedef struct _crtc6845_t crtc6845_t;
typedef struct _crtc6845_interface crtc6845_interface;
struct _crtc6845_interface
{
int scrnum; /* screen we are acting on */
@ -15,8 +20,7 @@ struct _crtc6845_interface
/* if specified, this gets called before any pixel update,
optionally return a pointer that will be passed to the
update and tear down callbacks */
void * (*begin_update)(running_machine *machine, int screen,
mame_bitmap *bitmap, const rectangle *cliprect);
void * (*begin_update)(mame_bitmap *bitmap, const rectangle *cliprect);
/* this gets called for every row, the driver must output
x_count * hpixels_per_column pixels */
@ -31,32 +35,28 @@ struct _crtc6845_interface
};
/* Deprectated - use crtc6845_init to set up for save states only, but not to configure the screen */
void crtc6845_init(void);
/* use crtc6845_init to set up for save states AND to configure the screen
the 'which' argument is currently a dummy as only one instance is supported */
void crtc6845_config(int which, const crtc6845_interface *intf);
/* use crtc6845_init to set up for save states.
if intf is NULL, the emulator will NOT call video_configure_screen() */
crtc6845_t *crtc6845_config(const crtc6845_interface *intf);
/* selects one of the registers for reading or writing */
WRITE8_HANDLER( crtc6845_address_w );
#define crtc6845_0_address_w crtc6845_address_w
void crtc6845_address_w(crtc6845_t *crtc6845, UINT8 data);
/* reads the currently selected register */
READ8_HANDLER( crtc6845_register_r );
#define crtc6845_0_register_r crtc6845_register_r
UINT8 crtc6845_register_r(crtc6845_t *crtc6845);
/* writes the currently selected register */
WRITE8_HANDLER( crtc6845_register_w );
#define crtc6845_0_register_w crtc6845_register_w
void crtc6845_register_w(crtc6845_t *crtc6845, UINT8 data);
/* return the current value on the MA0-MA13 pins */
UINT16 crtc6845_get_ma(int which);
UINT16 crtc6845_get_ma(crtc6845_t *crtc6845);
/* return the current value on the RA0-RA4 pins */
UINT8 crtc6845_get_ra(int which);
UINT8 crtc6845_get_ra(crtc6845_t *crtc6845);
/* updates the screen -- this will call begin_update(),
followed by update_row() reapeatedly and after all row
updating is complete, end_update() */
VIDEO_UPDATE( crtc6845 );
void crtc6845_update(crtc6845_t *crtc6845, mame_bitmap *bitmap, const rectangle *cliprect);
#endif

View File

@ -47,6 +47,20 @@ Emulation Notes:
#include "video/crtc6845.h"
static UINT8* carrera_tileram;
static crtc6845_t *crtc6845;
static WRITE8_HANDLER( carrera_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( carrera_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x4fff) AM_READ(MRA8_ROM)
@ -57,8 +71,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x4fff) AM_WRITE(MWA8_ROM)
AM_RANGE(0xe000, 0xe7ff) AM_WRITE(MWA8_RAM)
AM_RANGE(0xe800, 0xe800) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xe801, 0xe801) AM_WRITE(crtc6845_register_w)
AM_RANGE(0xe800, 0xe800) AM_WRITE(carrera_crtc6845_address_w)
AM_RANGE(0xe801, 0xe801) AM_WRITE(carrera_crtc6845_register_w)
AM_RANGE(0xf000, 0xffff) AM_WRITE(MWA8_RAM) AM_BASE(&carrera_tileram)
ADDRESS_MAP_END
@ -245,6 +259,7 @@ GFXDECODE_END
static VIDEO_START(carrera)
{
crtc6845 = crtc6845_config(NULL);
}
static VIDEO_UPDATE(carrera)

View File

@ -29,6 +29,7 @@
static UINT8 *attr_ram1, *attr_ram2;
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
static UINT8 question_adr[4];
@ -115,6 +116,16 @@ static WRITE8_HANDLER( question_w )
question_adr[offset] = data;
}
static WRITE8_HANDLER( coinmstr_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( coinmstr_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
// Common memory map
static ADDRESS_MAP_START( coinmstr_map, ADDRESS_SPACE_PROGRAM, 8 )
@ -138,8 +149,8 @@ static ADDRESS_MAP_START( quizmstr_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x50, 0x53) AM_READNOP
AM_RANGE(0x50, 0x53) AM_WRITENOP
AM_RANGE(0x58, 0x5b) AM_READWRITE(pia_2_r, pia_2_w)
AM_RANGE(0x70, 0x70) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x71, 0x71) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x70, 0x70) AM_WRITE(coinmstr_crtc6845_address_w)
AM_RANGE(0x71, 0x71) AM_WRITE(coinmstr_crtc6845_register_w)
AM_RANGE(0xc0, 0xc3) AM_READNOP
AM_RANGE(0xc0, 0xc3) AM_WRITENOP
ADDRESS_MAP_END
@ -148,8 +159,8 @@ static ADDRESS_MAP_START( trailblz_io_map, ADDRESS_SPACE_IO, 8 )
ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
AM_RANGE(0x00, 0x00) AM_READ(question_r)
AM_RANGE(0x00, 0x03) AM_WRITE(question_w)
AM_RANGE(0x40, 0x40) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x41, 0x41) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x40, 0x40) AM_WRITE(coinmstr_crtc6845_address_w)
AM_RANGE(0x41, 0x41) AM_WRITE(coinmstr_crtc6845_register_w)
AM_RANGE(0x48, 0x48) AM_WRITE(AY8910_control_port_0_w)
AM_RANGE(0x49, 0x49) AM_READWRITE(AY8910_read_port_0_r, AY8910_write_port_0_w)
AM_RANGE(0x50, 0x53) AM_READWRITE(pia_0_r, pia_0_w) //?
@ -165,8 +176,8 @@ static ADDRESS_MAP_START( supnudg2_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x40, 0x41) AM_READNOP
AM_RANGE(0x40, 0x43) AM_WRITENOP
AM_RANGE(0x43, 0x43) AM_READNOP
AM_RANGE(0x48, 0x48) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x49, 0x49) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x48, 0x48) AM_WRITE(coinmstr_crtc6845_address_w)
AM_RANGE(0x49, 0x49) AM_WRITE(coinmstr_crtc6845_register_w)
AM_RANGE(0x50, 0x51) AM_READNOP
AM_RANGE(0x50, 0x53) AM_WRITENOP
AM_RANGE(0x53, 0x53) AM_READNOP
@ -533,6 +544,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( coinmstr )
{
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 8, 8, 46, 64);
}

View File

@ -39,6 +39,7 @@ Provided to you by Thierry (ShinobiZ) & Gerald (COY)
#include "video/crtc6845.h"
static tilemap *bg_tilemap;
static crtc6845_t *crtc6845;
static UINT8 *vram_lo,*vram_hi;
static UINT8 *backup_ram;
@ -53,6 +54,16 @@ x-x- ---- ---- ---- extra tile number.
---- ---- xxxx xxxx tile number
*/
static WRITE8_HANDLER( couple_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( couple_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static TILE_GET_INFO( get_tile_info )
{
UINT16 vram_data = (((vram_hi[tile_index] & 0xff) << 8) | (vram_lo[tile_index] & 0xff));
@ -65,6 +76,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( couple )
{
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,64,32);
}
@ -146,8 +158,8 @@ static ADDRESS_MAP_START( merit_mem, ADDRESS_SPACE_PROGRAM, 8 )
// AM_RANGE( 0xc000, 0xc00f ) AM_READ(dummy_inputs_r)
// AM_RANGE( 0xc008, 0xc008 ) AM_READ(input_port_0_r)
// AM_RANGE( 0xc00a, 0xc00a ) AM_READ(input_port_1_r)
AM_RANGE( 0xe000, 0xe000 ) AM_WRITE(crtc6845_address_w)
AM_RANGE( 0xe001, 0xe001 ) AM_WRITE(crtc6845_register_w)
AM_RANGE( 0xe000, 0xe000 ) AM_WRITE(couple_crtc6845_address_w)
AM_RANGE( 0xe001, 0xe001 ) AM_WRITE(couple_crtc6845_register_w)
AM_RANGE( 0xe800, 0xefff ) AM_READWRITE(MRA8_RAM, couple_vram_hi_w) AM_BASE(&vram_hi)
AM_RANGE( 0xf000, 0xf7ff ) AM_READWRITE(MRA8_RAM, couple_vram_lo_w) AM_BASE(&vram_lo)
AM_RANGE( 0xf800, 0xfbff ) AM_RAM /*extra VRAM?*/

View File

@ -29,7 +29,6 @@
#include "driver.h"
#include "sound/ay8910.h"
#include "cpu/i8039/i8039.h"
#include "video/crtc6845.h"
static tilemap *bg_tilemap;

View File

@ -801,19 +801,21 @@
#include "driver.h"
#include "sound/ay8910.h"
#include "video/crtc6845.h"
#include "machine/6821pia.h"
#include "funworld.lh"
/* from video */
extern WRITE8_HANDLER( funworld_videoram_w );
extern WRITE8_HANDLER( funworld_colorram_w );
extern PALETTE_INIT( funworld );
extern VIDEO_START( funworld );
extern VIDEO_START( magiccrd );
extern VIDEO_START( snookr10 );
extern VIDEO_UPDATE( funworld );
WRITE8_HANDLER( funworld_videoram_w );
WRITE8_HANDLER( funworld_colorram_w );
WRITE8_HANDLER( funworld_crtc6845_address_w );
READ8_HANDLER( funworld_crtc6845_register_r );
WRITE8_HANDLER( funworld_crtc6845_register_w );
PALETTE_INIT( funworld );
VIDEO_START( funworld );
VIDEO_START( magiccrd );
VIDEO_START( snookr10 );
VIDEO_UPDATE( funworld );
/**********************
@ -851,8 +853,8 @@ static ADDRESS_MAP_START( funworld_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_crtc6845_register_r, funworld_crtc6845_register_w)
AM_RANGE(0x2000, 0x2fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x3000, 0x3fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x4000, 0x4000) AM_READNOP
@ -866,8 +868,8 @@ static ADDRESS_MAP_START( magiccrd_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_crtc6845_register_r, funworld_crtc6845_register_w)
AM_RANGE(0x3600, 0x36ff) AM_RAM // some games use $3603-05 range for protection.
AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
@ -880,8 +882,8 @@ static ADDRESS_MAP_START( cuoreuno_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0a00, 0x0a03) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x0c00, 0x0c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
AM_RANGE(0x0c01, 0x0c01) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0e00, 0x0e00) AM_WRITE(funworld_crtc6845_address_w)
AM_RANGE(0x0e01, 0x0e01) AM_READWRITE(funworld_crtc6845_register_r, funworld_crtc6845_register_w)
AM_RANGE(0x2000, 0x2000) AM_READNOP // some unknown reads
AM_RANGE(0x3e00, 0x3fff) AM_RAM // some games use $3e03-05 range for protection.
AM_RANGE(0x6000, 0x6fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
@ -895,8 +897,8 @@ static ADDRESS_MAP_START( royalmcu_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x2a00, 0x2a03) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x2c00, 0x2c00) AM_READWRITE(AY8910_read_port_0_r, AY8910_control_port_0_w)
AM_RANGE(0x2c01, 0x2c01) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x2e00, 0x2e00) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x2e01, 0x2e01) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x2e00, 0x2e00) AM_WRITE(funworld_crtc6845_address_w)
AM_RANGE(0x2e01, 0x2e01) AM_READWRITE(funworld_crtc6845_register_r, funworld_crtc6845_register_w)
AM_RANGE(0x4000, 0x4fff) AM_RAM AM_WRITE(funworld_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x5000, 0x5fff) AM_RAM AM_WRITE(funworld_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x6000, 0xffff) AM_ROM

View File

@ -236,15 +236,17 @@
#include "driver.h"
#include "sound/ay8910.h"
#include "video/crtc6845.h"
#include "machine/6821pia.h"
/* from video */
extern WRITE8_HANDLER( gdrawpkr_videoram_w );
extern WRITE8_HANDLER( gdrawpkr_colorram_w );
extern PALETTE_INIT( gdrawpkr );
extern VIDEO_START( gdrawpkr );
extern VIDEO_UPDATE( gdrawpkr );
WRITE8_HANDLER( gdrawpkr_videoram_w );
WRITE8_HANDLER( gdrawpkr_colorram_w );
WRITE8_HANDLER( gdrawpkr_crtc6845_address_w );
READ8_HANDLER( gdrawpkr_crtc6845_register_r );
WRITE8_HANDLER( gdrawpkr_crtc6845_register_w );
PALETTE_INIT( gdrawpkr );
VIDEO_START( gdrawpkr );
VIDEO_UPDATE( gdrawpkr );
/*************************
@ -255,8 +257,8 @@ static ADDRESS_MAP_START( gdrawpkr_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x0880, 0x0880) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0880, 0x0880) AM_WRITE(gdrawpkr_crtc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_READWRITE(gdrawpkr_crtc6845_register_r, gdrawpkr_crtc6845_register_w)
AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(gdrawpkr_videoram_w) AM_BASE(&videoram)
@ -268,8 +270,8 @@ static ADDRESS_MAP_START( elgrande_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0x0840, 0x0840) AM_WRITE(AY8910_control_port_0_w)
AM_RANGE(0x0841, 0x0841) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x0880, 0x0880) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0880, 0x0880) AM_WRITE(gdrawpkr_crtc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_READWRITE(gdrawpkr_crtc6845_register_r, gdrawpkr_crtc6845_register_w)
AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w)
AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(gdrawpkr_videoram_w) AM_BASE(&videoram)

View File

@ -30,6 +30,8 @@ static UINT8 madalien_headlight_pos;
static UINT8 madalien_shift_count;
static UINT8 madalien_shift_data;
static crtc6845_t *crtc6845;
static tilemap* tilemap_fg;
static tilemap* tilemap_edge1[4];
@ -85,6 +87,22 @@ static PALETTE_INIT( madalien )
}
static WRITE8_HANDLER( madalien_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( madalien_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( madalien_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static void update_edges(int area)
{
UINT8* map = memory_region(REGION_GFX2) + 0x200 * area;
@ -172,7 +190,7 @@ static VIDEO_START( madalien )
NULL /* call back for display state changes */
};
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
tilemap_fg = tilemap_create(get_tile_info_FG,
tilemap_scan_cols_flip_x, 8, 8, 32, 32);
@ -497,8 +515,8 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x6400, 0x67ff) AM_RAM
AM_RANGE(0x6800, 0x7fff) AM_RAM AM_BASE(&madalien_charram)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x8000, 0x8000) AM_MIRROR(0x0ff0) AM_WRITE(madalien_crtc6845_address_w)
AM_RANGE(0x8001, 0x8001) AM_MIRROR(0x0ff0) AM_READWRITE(madalien_crtc6845_register_r, madalien_crtc6845_register_w)
AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x0ff0) AM_WRITE(madalien_screen_control_w)
AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x0ff0) AM_WRITE(madalien_output_w)
AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x0ff0) AM_READWRITE(soundlatch2_r, madalien_sound_command_w)

View File

@ -321,6 +321,7 @@
* Video Hardware *
*************************/
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
static WRITE8_HANDLER( magicfly_videoram_w )
@ -335,6 +336,21 @@ static WRITE8_HANDLER( magicfly_colorram_w )
tilemap_mark_tile_dirty(bg_tilemap, offset);
}
static WRITE8_HANDLER( magicfly_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( magicfly_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( magicfly_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static TILE_GET_INFO( get_magicfly_tile_info )
{
/* - bits -
@ -363,8 +379,8 @@ static TILE_GET_INFO( get_magicfly_tile_info )
static VIDEO_START(magicfly)
{
bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows,
8, 8, 32, 29);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_magicfly_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static TILE_GET_INFO( get_7mezzo_tile_info )
@ -454,8 +470,8 @@ static WRITE8_HANDLER( mux_w )
static ADDRESS_MAP_START( magicfly_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* MK48Z02B NVRAM */
AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w) /* MC6845P register addressing */
AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w) /* MC6845P register values */
AM_RANGE(0x0800, 0x0800) AM_WRITE(magicfly_crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(magicfly_crtc6845_register_r, magicfly_crtc6845_register_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(magicfly_videoram_w) AM_BASE(&videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */
AM_RANGE(0x1800, 0x1bff) AM_RAM AM_WRITE(magicfly_colorram_w) AM_BASE(&colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */
AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r) /* multiplexed input port */

View File

@ -131,6 +131,7 @@
* Video Hardware *
*************************/
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
static WRITE8_HANDLER( miniboy7_videoram_w )
@ -145,6 +146,21 @@ static WRITE8_HANDLER( miniboy7_colorram_w )
tilemap_mark_tile_dirty(bg_tilemap, offset);
}
static WRITE8_HANDLER( miniboy7_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( miniboy7_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( miniboy7_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static TILE_GET_INFO( get_bg_tile_info )
{
/* - bits -
@ -166,8 +182,8 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( miniboy7 )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
8, 8, 37, 37);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 37, 37);
}
static VIDEO_UPDATE( miniboy7 )
@ -187,8 +203,8 @@ static ADDRESS_MAP_START( miniboy7_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1000, 0x17ff) AM_RAM AM_WRITE(miniboy7_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1800, 0x25ff) AM_RAM /* looks like videoram */
AM_RANGE(0x2600, 0x27ff) AM_RAM
AM_RANGE(0x2800, 0x2800) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x2801, 0x2801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x2800, 0x2800) AM_WRITE(miniboy7_crtc6845_address_w)
AM_RANGE(0x2801, 0x2801) AM_READWRITE(miniboy7_crtc6845_register_r, miniboy7_crtc6845_register_w)
// AM_RANGE(0x3000, 0x3001) ????? R/W
// AM_RANGE(0x3080, 0x3083) AM_READWRITE(pia_0_r, pia_0_w)
// AM_RANGE(0x3800, 0x3800) ????? R

View File

@ -191,6 +191,8 @@ TODO: - Confirm that MC6850 emulation is sufficient.
#define VIDEO_MASTER_CLOCK (10000000)
static crtc6845_t *crtc6845;
static UINT8 m6840_irq_state;
static UINT8 m6850_irq_state;
static UINT8 scn2674_irq_state;
@ -434,7 +436,7 @@ static UINT8 IR12_scn2674_split_register_1;
static UINT8 IR13_scn2674_scroll_end;
static UINT8 IR13_scn2674_split_register_2;
VIDEO_UPDATE( mpu4_vid )
static VIDEO_UPDATE( mpu4_vid )
{
int i;
@ -499,12 +501,12 @@ VIDEO_UPDATE( mpu4_vid )
return 0;
}
READ16_HANDLER( mpu4_vid_vidram_r )
static READ16_HANDLER( mpu4_vid_vidram_r )
{
return mpu4_vid_vidram[offset];
}
WRITE16_HANDLER( mpu4_vid_vidram_w )
static WRITE16_HANDLER( mpu4_vid_vidram_w )
{
COMBINE_DATA(&mpu4_vid_vidram[offset]);
offset <<= 1;
@ -877,7 +879,7 @@ static void scn2674_write_command(UINT8 data)
}
READ16_HANDLER( mpu4_vid_scn2674_r )
static READ16_HANDLER( mpu4_vid_scn2674_r )
{
/*
Offset: Purpose
@ -925,7 +927,7 @@ READ16_HANDLER( mpu4_vid_scn2674_r )
return 0xffff;
}
WRITE16_HANDLER( mpu4_vid_scn2674_w )
static WRITE16_HANDLER( mpu4_vid_scn2674_w )
{
/*
Offset: Purpose
@ -960,7 +962,7 @@ WRITE16_HANDLER( mpu4_vid_scn2674_w )
}
}
VIDEO_START( mpu4_vid )
static VIDEO_START( mpu4_vid )
{
/* if anything uses tile sizes other than 8x8 we can't really do it this way.. we'll have to draw tiles by hand.
maybe we will anyway, but for now we don't need to */
@ -1252,7 +1254,7 @@ static INPUT_PORTS_START( dealem )
INPUT_PORTS_END
INTERRUPT_GEN(mpu4_vid_irq)
static INTERRUPT_GEN(mpu4_vid_irq)
{
LOGSTUFF(("scn2674_irq_mask %02x\n",scn2674_irq_mask));
if (cpu_getiloops()==0) // vbl
@ -1465,7 +1467,22 @@ static GFXDECODE_START( dealem )
GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dealemcharlayout, 0, 32 )
GFXDECODE_END
UINT8 *dealem_videoram;
static UINT8 *dealem_videoram;
static WRITE8_HANDLER( dealem_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( dealem_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( dealem_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
/***************************************************************************
@ -1486,7 +1503,7 @@ UINT8 *dealem_videoram;
***************************************************************************/
PALETTE_INIT( dealem )
static PALETTE_INIT( dealem )
{
int i;
for (i = 0;i < memory_region_length(REGION_PROMS);i++)
@ -1515,11 +1532,12 @@ PALETTE_INIT( dealem )
}
VIDEO_START(dealem)
static VIDEO_START(dealem)
{
crtc6845 = crtc6845_config(NULL);
}
VIDEO_UPDATE(dealem)
static VIDEO_UPDATE(dealem)
{
int x,y;
int count = 0;
@ -1541,8 +1559,8 @@ static ADDRESS_MAP_START( dealem_memmap, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0800, 0x0800) AM_WRITE(dealem_crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(dealem_crtc6845_register_r, dealem_crtc6845_register_w)
// AM_RANGE(0x0850, 0x0850) AM_WRITE(bankswitch_w) // write bank (rom page select)
@ -1656,7 +1674,7 @@ static MACHINE_DRIVER_START( dealem )
MACHINE_DRIVER_END
DRIVER_INIT (crmaze)
static DRIVER_INIT (crmaze)
{
int x;
static const UINT8 chr_table[72]={0x00,0x84,0x94,0x3C,0xEC,0x5C,0xEC,0x50,
@ -1675,7 +1693,7 @@ DRIVER_INIT (crmaze)
}
}
DRIVER_INIT (mating)
static DRIVER_INIT (mating)
{
int x;
static const UINT8 chr_table[72]={0x00,0x18,0xC8,0xA4,0x0C,0x80,0x0C,0x90,

View File

@ -97,12 +97,25 @@ val (hex): 27 20 22 04 26 00 20 20 00 07 00 00 80 00 00 00 ns
#include "driver.h"
#include "video/crtc6845.h"
static crtc6845_t *crtc6845;
static UINT8 *murogem_videoram;
static WRITE8_HANDLER( murogem_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( murogem_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static ADDRESS_MAP_START( murogem_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x007f) AM_RAM
AM_RANGE(0x4000, 0x4000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x4001, 0x4001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x4000, 0x4000) AM_WRITE(murogem_crtc6845_address_w)
AM_RANGE(0x4001, 0x4001) AM_WRITE(murogem_crtc6845_register_w)
AM_RANGE(0x5000, 0x5000) AM_READ(input_port_0_r)
AM_RANGE(0x5800, 0x5800) AM_READ(input_port_1_r)
AM_RANGE(0x7000, 0x7000) AM_WRITE(MWA8_NOP) // sound? payout?
@ -167,6 +180,7 @@ static PALETTE_INIT(murogem)
static VIDEO_START(murogem)
{
crtc6845 = crtc6845_config(NULL);
}
static VIDEO_UPDATE(murogem)

View File

@ -83,6 +83,7 @@
#define AUDIO_CPU_2_CLOCK (AUDIO_2_MASTER_CLOCK)
static crtc6845_t *crtc6845;
static UINT8 *nyny_videoram_1;
static UINT8 *nyny_videoram_2;
static UINT8 *nyny_colorram_1;
@ -269,14 +270,25 @@ static MACHINE_RESET( nyny )
#define NUM_PENS (8)
static WRITE8_HANDLER( nyny_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( nyny_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static WRITE8_HANDLER( flipscreen_w )
{
flipscreen = data ? 0 : 1;
}
static void *nyny_begin_update(running_machine *machine, int screen,
mame_bitmap *bitmap, const rectangle *cliprect)
static void *nyny_begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
{
/* create the pens */
offs_t i;
@ -418,7 +430,15 @@ static const crtc6845_interface crtc6845_intf =
static VIDEO_START( nyny )
{
/* configure the CRT controller */
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
}
static VIDEO_UPDATE( nyny )
{
crtc6845_update(crtc6845, bitmap, cliprect);
return 0;
}
@ -521,8 +541,8 @@ static ADDRESS_MAP_START( nyny_main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x6000, 0x7fff) AM_RAM AM_BASE(&nyny_colorram_2)
AM_RANGE(0x8000, 0x9fff) AM_RAM
AM_RANGE(0xa000, 0xa0ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* SRAM (coin counter, shown when holding F2) */
AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_WRITE(crtc6845_register_w)
AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x00fe) AM_WRITE(nyny_crtc6845_address_w)
AM_RANGE(0xa101, 0xa101) AM_MIRROR(0x00fe) AM_WRITE(nyny_crtc6845_register_w)
AM_RANGE(0xa200, 0xa20f) AM_MIRROR(0x00f0) AM_READWRITE(nyny_pia_1_2_r, nyny_pia_1_2_w)
AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x00ff) AM_READWRITE(soundlatch3_r, audio_1_command_w)
AM_RANGE(0xa400, 0xa7ff) AM_NOP
@ -674,7 +694,7 @@ static MACHINE_DRIVER_START( nyny )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_VIDEO_START(nyny)
MDRV_VIDEO_UPDATE(crtc6845)
MDRV_VIDEO_UPDATE(nyny)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)

View File

@ -380,8 +380,24 @@
* Video Hardware *
*************************/
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
static WRITE8_HANDLER( pmpoker_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( pmpoker_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( pmpoker_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static WRITE8_HANDLER( pmpoker_videoram_w )
{
videoram[offset] = data;
@ -415,8 +431,8 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( pmpoker )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 29);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static VIDEO_UPDATE( pmpoker )
@ -468,8 +484,8 @@ static PALETTE_INIT( pottnpkr )
static ADDRESS_MAP_START( pmpoker_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */
AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_crtc6845_register_r, pmpoker_crtc6845_register_w)
AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w)
AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram)
@ -480,8 +496,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( jokerpkr_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* battery backed RAM */
AM_RANGE(0x0800, 0x0800) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0x0800, 0x0800) AM_WRITE(pmpoker_crtc6845_address_w)
AM_RANGE(0x0801, 0x0801) AM_READWRITE(pmpoker_crtc6845_register_r, pmpoker_crtc6845_register_w)
AM_RANGE(0x0844, 0x0847) AM_READWRITE(pia_0_r, pia_0_w)
AM_RANGE(0x0848, 0x084b) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_WRITE(pmpoker_videoram_w) AM_BASE(&videoram)

View File

@ -225,7 +225,6 @@ Interrupts:
#include "qix.h"
#include "cpu/m6805/m6805.h"
#include "machine/6821pia.h"
#include "video/crtc6845.h"
#include "sound/sn76496.h"
#include "sound/discrete.h"
@ -290,8 +289,8 @@ static ADDRESS_MAP_START( video_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE(&qix_videoaddress)
AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(qix_scanline_r)
AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(crtc6845_0_address_w)
AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(crtc6845_0_register_r, crtc6845_0_register_w)
AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_crtc6845_address_w)
AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_crtc6845_register_r, qix_crtc6845_register_w)
AM_RANGE(0xa000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -308,8 +307,8 @@ static ADDRESS_MAP_START( zoo_video_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x9400, 0x9400) AM_MIRROR(0x03fc) AM_READWRITE(qix_addresslatch_r, qix_addresslatch_w)
AM_RANGE(0x9402, 0x9403) AM_MIRROR(0x03fc) AM_WRITE(MWA8_RAM) AM_BASE(&qix_videoaddress)
AM_RANGE(0x9800, 0x9800) AM_MIRROR(0x03ff) AM_READ(qix_scanline_r)
AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(crtc6845_0_address_w)
AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(crtc6845_0_register_r, crtc6845_0_register_w)
AM_RANGE(0x9c00, 0x9c00) AM_MIRROR(0x03fe) AM_WRITE(qix_crtc6845_address_w)
AM_RANGE(0x9c01, 0x9c01) AM_MIRROR(0x03fe) AM_READWRITE(qix_crtc6845_register_r, qix_crtc6845_register_w)
AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1)
AM_RANGE(0xc000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -631,12 +630,11 @@ static MACHINE_DRIVER_START( qix )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_PALETTE_LENGTH(1024)
MDRV_VIDEO_START(qix)
MDRV_VIDEO_UPDATE(crtc6845)
MDRV_VIDEO_UPDATE(qix)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
MDRV_SCREEN_RAW_PARAMS(QIX_CHARACTER_CLOCK*8, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
/* sound hardware */

View File

@ -48,6 +48,7 @@ RAM = 4116 (x11)
#define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16)
static crtc6845_t *crtc6845;
static UINT8 *r2dtank_videoram;
static UINT8 *r2dtank_colorram;
static UINT8 flipscreen;
@ -303,14 +304,25 @@ static MACHINE_RESET( r2dtank )
#define NUM_PENS (8)
static WRITE8_HANDLER( r2dtank_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( r2dtank_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static WRITE8_HANDLER( flipscreen_w )
{
flipscreen = !data;
}
static void *begin_update(running_machine *machine, int screen,
mame_bitmap *bitmap, const rectangle *cliprect)
static void *begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
{
/* create the pens */
offs_t i;
@ -396,7 +408,15 @@ static const crtc6845_interface crtc6845_intf =
static VIDEO_START( r2dtank )
{
/* configure the CRT controller */
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
}
static VIDEO_UPDATE( r2dtank )
{
crtc6845_update(crtc6845, bitmap, cliprect);
return 0;
}
@ -420,8 +440,8 @@ static ADDRESS_MAP_START( r2dtank_main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x6000, 0x7fff) AM_RAM
AM_RANGE(0x8000, 0x8003) AM_READWRITE(pia_0_r, pia_comp_0_w)
AM_RANGE(0x8004, 0x8004) AM_READWRITE(audio_answer_r, audio_command_w)
AM_RANGE(0xb000, 0xb000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0xb000, 0xb000) AM_WRITE(r2dtank_crtc6845_address_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(r2dtank_crtc6845_register_w)
AM_RANGE(0xc000, 0xc007) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0xc800, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -540,7 +560,7 @@ static MACHINE_DRIVER_START( r2dtank )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_VIDEO_START(r2dtank)
MDRV_VIDEO_UPDATE(crtc6845)
MDRV_VIDEO_UPDATE(r2dtank)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)

View File

@ -265,7 +265,6 @@ 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/crtc6845.h"
#include "sound/sn76477.h"
#include "sound/custom.h"
#include "sound/samples.h"
@ -285,24 +284,26 @@ Stephh's notes (based on the games M6502 code and some tests) :
extern UINT8 *rockola_videoram2;
extern UINT8 *rockola_charram;
extern WRITE8_HANDLER( rockola_videoram_w );
extern WRITE8_HANDLER( rockola_videoram2_w );
extern WRITE8_HANDLER( rockola_colorram_w );
extern WRITE8_HANDLER( rockola_charram_w );
extern WRITE8_HANDLER( rockola_flipscreen_w );
extern WRITE8_HANDLER( rockola_scrollx_w );
extern WRITE8_HANDLER( rockola_scrolly_w );
WRITE8_HANDLER( rockola_videoram_w );
WRITE8_HANDLER( rockola_videoram2_w );
WRITE8_HANDLER( rockola_colorram_w );
WRITE8_HANDLER( rockola_charram_w );
WRITE8_HANDLER( rockola_crtc6845_address_w );
WRITE8_HANDLER( rockola_crtc6845_register_w );
WRITE8_HANDLER( rockola_flipscreen_w );
WRITE8_HANDLER( rockola_scrollx_w );
WRITE8_HANDLER( rockola_scrolly_w );
extern PALETTE_INIT( rockola );
extern VIDEO_START( rockola );
extern VIDEO_UPDATE( rockola );
PALETTE_INIT( rockola );
VIDEO_START( rockola );
VIDEO_UPDATE( rockola );
extern WRITE8_HANDLER( satansat_charram_w );
extern WRITE8_HANDLER( satansat_b002_w );
extern WRITE8_HANDLER( satansat_backcolor_w );
WRITE8_HANDLER( satansat_charram_w );
WRITE8_HANDLER( satansat_b002_w );
WRITE8_HANDLER( satansat_backcolor_w );
extern PALETTE_INIT( satansat );
extern VIDEO_START( satansat );
PALETTE_INIT( satansat );
VIDEO_START( satansat );
/* audio */
@ -370,8 +371,8 @@ static ADDRESS_MAP_START( sasuke_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_crtc6845_register_w)
AM_RANGE(0x4000, 0x8fff) AM_ROM
AM_RANGE(0xb000, 0xb001) AM_WRITE(sasuke_sound_w)
AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w) /* flip screen & irq enable */
@ -389,8 +390,8 @@ static ADDRESS_MAP_START( satansat_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_crtc6845_register_w)
AM_RANGE(0x4000, 0x97ff) AM_ROM
AM_RANGE(0xb000, 0xb001) AM_WRITE(satansat_sound_w)
AM_RANGE(0xb002, 0xb002) AM_WRITE(satansat_b002_w) /* flip screen & irq enable */
@ -408,8 +409,8 @@ static ADDRESS_MAP_START( vanguard_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
AM_RANGE(0x3000, 0x3000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x3000, 0x3000) AM_WRITE(rockola_crtc6845_address_w)
AM_RANGE(0x3001, 0x3001) AM_WRITE(rockola_crtc6845_register_w)
AM_RANGE(0x3100, 0x3102) AM_WRITE(vanguard_sound_w)
AM_RANGE(0x3103, 0x3103) AM_WRITE(rockola_flipscreen_w)
AM_RANGE(0x3104, 0x3104) AM_READ_PORT("IN0")
@ -429,8 +430,8 @@ static ADDRESS_MAP_START( fantasy_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_WRITE(rockola_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
AM_RANGE(0x2000, 0x2000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x2001, 0x2001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x2000, 0x2000) AM_WRITE(rockola_crtc6845_address_w)
AM_RANGE(0x2001, 0x2001) AM_WRITE(rockola_crtc6845_register_w)
AM_RANGE(0x2100, 0x2103) AM_WRITE(fantasy_sound_w)
AM_RANGE(0x2104, 0x2104) AM_READ_PORT("IN0")
AM_RANGE(0x2105, 0x2105) AM_READ_PORT("IN1")
@ -450,8 +451,8 @@ static ADDRESS_MAP_START( pballoon_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_WRITE(rockola_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1000, 0x1fff) AM_RAM AM_WRITE(rockola_charram_w) AM_BASE(&rockola_charram)
AM_RANGE(0x3000, 0x9fff) AM_ROM
AM_RANGE(0xb000, 0xb000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(crtc6845_register_w)
AM_RANGE(0xb000, 0xb000) AM_WRITE(rockola_crtc6845_address_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(rockola_crtc6845_register_w)
AM_RANGE(0xb100, 0xb103) AM_WRITE(fantasy_sound_w)
AM_RANGE(0xb104, 0xb104) AM_READ_PORT("IN0")
AM_RANGE(0xb105, 0xb105) AM_READ_PORT("IN1")

View File

@ -203,6 +203,7 @@
#define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16)
static crtc6845_t *crtc6845;
static UINT8 *spiders_ram;
static UINT8 flipscreen;
static UINT16 gfx_rom_address;
@ -409,14 +410,31 @@ static MACHINE_RESET( spiders )
#define NUM_PENS (8)
static WRITE8_HANDLER( spiders_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static READ8_HANDLER( spiders_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
static WRITE8_HANDLER( spiders_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static WRITE8_HANDLER( flipscreen_w )
{
flipscreen = data;
}
static void *begin_update(running_machine *machine, int screen,
mame_bitmap *bitmap, const rectangle *cliprect)
static void *begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
{
/* create the pens */
offs_t i;
@ -512,7 +530,15 @@ static const crtc6845_interface crtc6845_intf =
static VIDEO_START( spiders )
{
/* configure the CRT controller */
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
}
static VIDEO_UPDATE( spiders )
{
crtc6845_update(crtc6845, bitmap, cliprect);
return 0;
}
@ -565,8 +591,8 @@ static READ8_HANDLER( gfx_rom_r )
static ADDRESS_MAP_START( spiders_main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0xbfff) AM_RAM AM_BASE(&spiders_ram)
AM_RANGE(0xc000, 0xc000) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xc001, 0xc001) AM_READWRITE(crtc6845_register_r, crtc6845_register_w)
AM_RANGE(0xc000, 0xc000) AM_WRITE(spiders_crtc6845_address_w)
AM_RANGE(0xc001, 0xc001) AM_READWRITE(spiders_crtc6845_register_r, spiders_crtc6845_register_w)
AM_RANGE(0xc020, 0xc027) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0xc044, 0xc047) AM_READWRITE(pia_1_r, pia_1_w)
AM_RANGE(0xc048, 0xc04b) AM_READWRITE(pia_2_alt_r, pia_2_alt_w)
@ -702,7 +728,7 @@ static MACHINE_DRIVER_START( spiders )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)
MDRV_VIDEO_START(spiders)
MDRV_VIDEO_UPDATE(crtc6845)
MDRV_VIDEO_UPDATE(spiders)
MDRV_SCREEN_ADD("main", 0)
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)

View File

@ -25,6 +25,7 @@
#include "sound/ay8910.h"
#include "video/crtc6845.h"
static crtc6845_t *crtc6845;
static UINT8 *ssingles_videoram;
static UINT8 *ssingles_colorram;
static UINT8 prot_data;
@ -104,9 +105,21 @@ static WRITE8_HANDLER(ssingles_colorram_w)
ssingles_colorram[offset]=data;
}
static WRITE8_HANDLER( ssingles_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
static WRITE8_HANDLER( ssingles_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
static VIDEO_START(ssingles)
{
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
{
int i;
@ -118,6 +131,14 @@ static VIDEO_START(ssingles)
}
static VIDEO_UPDATE( ssingles )
{
crtc6845_update(crtc6845, bitmap, cliprect);
return 0;
}
static READ8_HANDLER(c000_r)
{
return prot_data;
@ -171,8 +192,8 @@ static ADDRESS_MAP_START( ssingles_io_map, ADDRESS_SPACE_IO, 8 )
AM_RANGE(0x18, 0x18) AM_READ(input_port_3_r)
AM_RANGE(0x1c, 0x1c) AM_READ(controls_r)
AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video/crt related
AM_RANGE(0xfe, 0xfe) AM_WRITE(crtc6845_address_w)
AM_RANGE(0xff, 0xff) AM_WRITE(crtc6845_register_w)
AM_RANGE(0xfe, 0xfe) AM_WRITE(ssingles_crtc6845_address_w)
AM_RANGE(0xff, 0xff) AM_WRITE(ssingles_crtc6845_register_w)
ADDRESS_MAP_END
@ -263,7 +284,7 @@ static MACHINE_DRIVER_START( ssingles )
MDRV_PALETTE_LENGTH(4) //guess
MDRV_VIDEO_START(ssingles)
MDRV_VIDEO_UPDATE(crtc6845)
MDRV_VIDEO_UPDATE(ssingles)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -24,22 +24,22 @@ Sound: AY-3-8912
*/
#include "driver.h"
#include "video/crtc6845.h"
#include "sound/ay8910.h"
/* video */
WRITE8_HANDLER( usg_videoram_w );
WRITE8_HANDLER( usg_charram_w );
VIDEO_START(usg);
PALETTE_INIT(usg);
VIDEO_UPDATE(usg);
extern tilemap *usg_tilemap;
WRITE8_HANDLER( usgames_videoram_w );
WRITE8_HANDLER( usgames_charram_w );
WRITE8_HANDLER( usgames_crtc6845_address_w );
WRITE8_HANDLER( usgames_crtc6845_register_w );
VIDEO_START(usgames);
PALETTE_INIT(usgames);
VIDEO_UPDATE(usgames);
extern UINT8 *usg_videoram,*usg_charram;
extern UINT8 *usgames_videoram,*usgames_charram;
static WRITE8_HANDLER( usg_rombank_w )
static WRITE8_HANDLER( usgames_rombank_w )
{
UINT8 *RAM = memory_region(REGION_CPU1);
@ -68,7 +68,7 @@ static WRITE8_HANDLER( lamps2_w )
static ADDRESS_MAP_START( usg_readmem, ADDRESS_SPACE_PROGRAM, 8 )
static ADDRESS_MAP_START( usgames_readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_READ(MRA8_RAM)
AM_RANGE(0x2000, 0x2000) AM_READ(input_port_1_r)
@ -96,22 +96,22 @@ static ADDRESS_MAP_START( usg185_readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x8000, 0xffff) AM_READ(MRA8_ROM)
ADDRESS_MAP_END
static ADDRESS_MAP_START( usg_writemem, ADDRESS_SPACE_PROGRAM, 8 )
static ADDRESS_MAP_START( usgames_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x1fff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)
AM_RANGE(0x2020, 0x2020) AM_WRITE(lamps1_w)
AM_RANGE(0x2030, 0x2030) AM_WRITE(lamps2_w)
AM_RANGE(0x2040, 0x2040) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x2041, 0x2041) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x2040, 0x2040) AM_WRITE(usgames_crtc6845_address_w)
AM_RANGE(0x2041, 0x2041) AM_WRITE(usgames_crtc6845_register_w)
AM_RANGE(0x2400, 0x2400) AM_WRITE(AY8910_control_port_0_w)
AM_RANGE(0x2401, 0x2401) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x2060, 0x2060) AM_WRITE(usg_rombank_w)
AM_RANGE(0x2060, 0x2060) AM_WRITE(usgames_rombank_w)
AM_RANGE(0x2800, 0x2fff) AM_WRITE(usg_charram_w) AM_BASE(&usg_charram)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(usg_videoram_w) AM_BASE(&usg_videoram)
AM_RANGE(0x2800, 0x2fff) AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram)
AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM)
AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
ADDRESS_MAP_END
@ -122,16 +122,16 @@ static ADDRESS_MAP_START( usg185_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x2420, 0x2420) AM_WRITE(lamps1_w)
AM_RANGE(0x2430, 0x2430) AM_WRITE(lamps2_w)
AM_RANGE(0x2440, 0x2440) AM_WRITE(crtc6845_address_w)
AM_RANGE(0x2441, 0x2441) AM_WRITE(crtc6845_register_w)
AM_RANGE(0x2440, 0x2440) AM_WRITE(usgames_crtc6845_address_w)
AM_RANGE(0x2441, 0x2441) AM_WRITE(usgames_crtc6845_register_w)
AM_RANGE(0x2000, 0x2000) AM_WRITE(AY8910_control_port_0_w)
AM_RANGE(0x2001, 0x2001) AM_WRITE(AY8910_write_port_0_w)
AM_RANGE(0x2460, 0x2460) AM_WRITE(usg_rombank_w)
AM_RANGE(0x2460, 0x2460) AM_WRITE(usgames_rombank_w)
AM_RANGE(0x2800, 0x2fff) AM_WRITE(usg_charram_w) AM_BASE(&usg_charram)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(usg_videoram_w) AM_BASE(&usg_videoram)
AM_RANGE(0x2800, 0x2fff) AM_WRITE(usgames_charram_w) AM_BASE(&usgames_charram)
AM_RANGE(0x3000, 0x3fff) AM_WRITE(usgames_videoram_w) AM_BASE(&usgames_videoram)
AM_RANGE(0x4000, 0x7fff) AM_WRITE(MWA8_ROM)
AM_RANGE(0x8000, 0xffff) AM_WRITE(MWA8_ROM)
ADDRESS_MAP_END
@ -286,11 +286,11 @@ GFXDECODE_END
static MACHINE_DRIVER_START( usg )
static MACHINE_DRIVER_START( usg32 )
/* basic machine hardware */
MDRV_CPU_ADD_TAG("main", M6809, 2000000) /* ?? */
MDRV_CPU_PROGRAM_MAP(usg_readmem,usg_writemem)
MDRV_CPU_PROGRAM_MAP(usgames_readmem,usgames_writemem)
MDRV_CPU_VBLANK_INT(irq0_line_hold,5) /* ?? */
MDRV_SCREEN_REFRESH_RATE(60)
@ -307,9 +307,9 @@ static MACHINE_DRIVER_START( usg )
MDRV_PALETTE_LENGTH(16)
MDRV_COLORTABLE_LENGTH(2*256)
MDRV_PALETTE_INIT(usg)
MDRV_VIDEO_START(usg)
MDRV_VIDEO_UPDATE(usg)
MDRV_PALETTE_INIT(usgames)
MDRV_VIDEO_START(usgames)
MDRV_VIDEO_UPDATE(usgames)
/* sound hardware */
MDRV_SPEAKER_STANDARD_MONO("mono")
@ -319,7 +319,7 @@ static MACHINE_DRIVER_START( usg )
MACHINE_DRIVER_END
static MACHINE_DRIVER_START( usg185 )
MDRV_IMPORT_FROM(usg)
MDRV_IMPORT_FROM(usg32)
MDRV_CPU_MODIFY("main")
MDRV_CPU_PROGRAM_MAP(usg185_readmem,usg185_writemem)
MACHINE_DRIVER_END
@ -443,10 +443,10 @@ ROM_START( usg252 )
ROM_END
GAME( 1987, usg32, 0, usg, usg32, 0, ROT0, "U.S. Games", "Super Duper Casino (California V3.2)", 0 )
GAME( 1988, usg83, 0, usg, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3", 0 )
GAME( 1988, usg83x, usg83, usg, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3X", 0 )
GAME( 1988, usg82, usg83, usg, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.2" , 0) // "Feb.08,1988"
GAME( 1987, usg32, 0, usg32, usg32, 0, ROT0, "U.S. Games", "Super Duper Casino (California V3.2)", 0 )
GAME( 1988, usg83, 0, usg32, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3", 0 )
GAME( 1988, usg83x, usg83, usg32, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.3X", 0 )
GAME( 1988, usg82, usg83, usg32, usg83, 0, ROT0, "U.S. Games", "Super Ten V8.2" , 0) // "Feb.08,1988"
GAME( 1989, usg182, 0, usg185, usg83, 0, ROT0, "U.S. Games", "Games V18.2", 0 )
GAME( 1991, usg185, 0, usg185, usg83, 0, ROT0, "U.S. Games", "Games V18.7C", 0 )
GAME( 1992, usg252, 0, usg185, usg83, 0, ROT0, "U.S. Games", "Games V25.4X", 0 )

View File

@ -125,7 +125,6 @@ out:
#include "driver.h"
#include "deprecat.h"
#include "video/crtc6845.h"
#include "cpu/tms32010/tms32010.h"
#include "twincobr.h"
#include "sound/3812intf.h"

View File

@ -50,7 +50,11 @@ extern UINT8 *qix_videoaddress;
extern UINT8 qix_cocktail_flip;
VIDEO_START( qix );
VIDEO_UPDATE( qix );
WRITE8_HANDLER( qix_crtc6845_address_w );
READ8_HANDLER( qix_crtc6845_register_r );
WRITE8_HANDLER( qix_crtc6845_register_w );
READ8_HANDLER( qix_scanline_r );
READ8_HANDLER( qix_videoram_r );
WRITE8_HANDLER( qix_videoram_w );

View File

@ -47,7 +47,9 @@
#include "driver.h"
#include "video/crtc6845.h"
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
@ -94,6 +96,21 @@ WRITE8_HANDLER( funworld_colorram_w )
tilemap_mark_tile_dirty(bg_tilemap, offset);
}
WRITE8_HANDLER( funworld_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
READ8_HANDLER( funworld_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
WRITE8_HANDLER( funworld_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
/**** normal hardware limit ****
- bits -
7654 3210
@ -119,20 +136,20 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START(funworld)
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
4, 8, 96, 29);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 96, 29);
}
VIDEO_START(magiccrd)
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
4, 8, 112, 34);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 112, 34);
}
VIDEO_START(snookr10)
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
4, 8, 128, 32);
// crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 4, 8, 128, 32);
}
VIDEO_UPDATE(funworld)

View File

@ -8,6 +8,9 @@
***********************************************************************************/
#include "driver.h"
#include "video/crtc6845.h"
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
WRITE8_HANDLER( gdrawpkr_videoram_w )
@ -41,10 +44,25 @@ static TILE_GET_INFO( get_bg_tile_info )
SET_TILE_INFO(bank, code, color, 0);
}
WRITE8_HANDLER( gdrawpkr_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
READ8_HANDLER( gdrawpkr_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
WRITE8_HANDLER( gdrawpkr_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
VIDEO_START( gdrawpkr )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 31);
crtc6845 = crtc6845_config(NULL);
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 31);
}
VIDEO_UPDATE( gdrawpkr )

View File

@ -7,13 +7,8 @@
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "qix.h"
#include "video/crtc6845.h"
/* Constants */
#define SCANLINE_INCREMENT 1
#include "qix.h"
/* Globals */
@ -22,10 +17,10 @@ UINT8 qix_cocktail_flip;
/* Local variables */
static crtc6845_t *crtc6845;
static UINT8 vram_mask;
static UINT8 qix_palettebank;
static UINT8 leds;
static emu_timer *scanline_timer;
static UINT8 scanline_latch;
@ -38,12 +33,7 @@ static UINT8 scanline_latch;
static void qix_display_enable_changed(int display_enabled);
static TIMER_CALLBACK( scanline_callback );
static void *qix_begin_update(running_machine *machine,
int screen,
mame_bitmap *bitmap,
const rectangle *cliprect);
static void *qix_begin_update(mame_bitmap *bitmap, const rectangle *cliprect);
static void qix_update_row(mame_bitmap *bitmap,
const rectangle *cliprect,
@ -76,7 +66,7 @@ static const crtc6845_interface crtc6845_intf =
VIDEO_START( qix )
{
/* configure the CRT controller */
crtc6845_config(0, &crtc6845_intf);
crtc6845 = crtc6845_config(&crtc6845_intf);
/* allocate memory for the full video RAM */
videoram = auto_malloc(256 * 256);
@ -84,10 +74,6 @@ VIDEO_START( qix )
/* initialize the mask for games that don't use it */
vram_mask = 0xff;
/* allocate a timer */
scanline_timer = timer_alloc(scanline_callback, NULL);
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, 1, 0), 1);
/* set up save states */
state_save_register_global_pointer(videoram, 256 * 256);
state_save_register_global(qix_cocktail_flip);
@ -98,28 +84,6 @@ VIDEO_START( qix )
/*************************************
*
* Scanline caching
*
*************************************/
static TIMER_CALLBACK( scanline_callback )
{
int scanline = param;
/* force a partial update */
video_screen_update_partial(0, scanline - 1);
/* set a timer for the next increment */
scanline += SCANLINE_INCREMENT;
if (scanline > machine->screen[0].visarea.max_y)
scanline = SCANLINE_INCREMENT;
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(0, scanline, 0), scanline);
}
/*************************************
*
* Current scanline read
@ -131,8 +95,8 @@ static void qix_display_enable_changed(int display_enabled)
/* on the rising edge, latch the scanline */
if (display_enabled)
{
UINT16 ma = crtc6845_get_ma(0);
UINT8 ra = crtc6845_get_ra(0);
UINT16 ma = crtc6845_get_ma(crtc6845);
UINT8 ra = crtc6845_get_ra(crtc6845);
/* RA0-RA2 goes to D0-D2 and MA5-MA9 goes to D3-D7 */
scanline_latch = ((ma >> 2) & 0xf8) | (ra & 0x07);
@ -188,6 +152,10 @@ READ8_HANDLER( qix_videoram_r )
WRITE8_HANDLER( qix_videoram_w )
{
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
/* add in the upper bit of the address latch */
offset += (qix_videoaddress[0] & 0x80) << 8;
@ -238,8 +206,41 @@ WRITE8_HANDLER( qix_addresslatch_w )
*
*************************************/
#define NUM_PENS (0x100)
WRITE8_HANDLER( qix_paletteram_w )
{
UINT8 old_data = paletteram[offset];
/* set the palette RAM value */
paletteram[offset] = data;
/* trigger an update if a currently visible pen has changed */
if (((offset >> 8) == qix_palettebank) &&
(old_data != data))
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
}
WRITE8_HANDLER( qix_palettebank_w )
{
/* set the bank value */
if (qix_palettebank != (data & 3))
{
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
qix_palettebank = data & 3;
}
/* LEDs are in the upper 6 bits */
leds = ~data & 0xfc;
}
static void get_pens(pen_t *pens)
{
offs_t offs;
/* this conversion table should be about right. It gives a reasonable */
/* gray scale in the test screen, and the red, green and blue squares */
/* in the same screen are barely visible, as the manual requires. */
@ -262,57 +263,74 @@ WRITE8_HANDLER( qix_paletteram_w )
0xb6, /* value = 3, intensity = 2 */
0xff /* value = 3, intensity = 3 */
};
int bits, intensity, red, green, blue;
/* set the palette RAM value */
paletteram[offset] = data;
/* compute R, G, B from the table */
intensity = (data >> 0) & 0x03;
bits = (data >> 6) & 0x03;
red = table[(bits << 2) | intensity];
bits = (data >> 4) & 0x03;
green = table[(bits << 2) | intensity];
bits = (data >> 2) & 0x03;
blue = table[(bits << 2) | intensity];
/* update the palette */
palette_set_color(Machine, offset, MAKE_RGB(red, green, blue));
}
WRITE8_HANDLER( qix_palettebank_w )
{
/* set the bank value */
if (qix_palettebank != (data & 3))
for (offs = qix_palettebank << 8; offs < (qix_palettebank << 8) + NUM_PENS; offs++)
{
video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
qix_palettebank = data & 3;
}
int bits, intensity, r, g, b;
/* LEDs are in the upper 6 bits */
leds = ~data & 0xfc;
UINT8 data = paletteram[offs];
/* compute R, G, B from the table */
intensity = (data >> 0) & 0x03;
bits = (data >> 6) & 0x03;
r = table[(bits << 2) | intensity];
bits = (data >> 4) & 0x03;
g = table[(bits << 2) | intensity];
bits = (data >> 2) & 0x03;
b = table[(bits << 2) | intensity];
/* update the palette */
pens[offs & 0xff] = MAKE_RGB(r, g, b);
}
}
/*************************************
*
* CRTC callbacks for updating
* M6845 access
*
*************************************/
WRITE8_HANDLER( qix_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
READ8_HANDLER( qix_crtc6845_register_r )
{
return crtc6845_register_r(crtc6845);
}
WRITE8_HANDLER( qix_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
/*************************************
*
* M6845 callbacks for updating
* the screen
*
*************************************/
static void *qix_begin_update(running_machine *machine, int screen,
mame_bitmap *bitmap, const rectangle *cliprect)
static void *qix_begin_update(mame_bitmap *bitmap, const rectangle *cliprect)
{
#if 0
// note the confusing bit order!
popmessage("self test leds: %d%d %d%d%d%d",BIT(leds,7),BIT(leds,5),BIT(leds,6),BIT(leds,4),BIT(leds,2),BIT(leds,3));
#endif
/* return the pens we are going to use to update the display */
return (void *)&machine->pens[qix_palettebank * 256];
/* create the pens */
static pen_t pens[NUM_PENS];
get_pens(pens);
return pens;
}
@ -333,3 +351,18 @@ static void qix_update_row(mame_bitmap *bitmap, const rectangle *cliprect,
draw_scanline8(bitmap, 0, y, x_count * 8, scanline, pens, -1);
}
/*************************************
*
* Standard video update
*
*************************************/
VIDEO_UPDATE( qix )
{
crtc6845_update(crtc6845, bitmap, cliprect);
return 0;
}

View File

@ -8,6 +8,8 @@
#include "driver.h"
#include "deprecat.h"
#include "video/crtc6845.h"
UINT8 *rockola_videoram2;
UINT8 *rockola_charram;
@ -15,7 +17,9 @@ UINT8 *rockola_charram;
static int charbank;
static int backcolor;
static tilemap *bg_tilemap, *fg_tilemap;
static crtc6845_t *crtc6845;
static tilemap *bg_tilemap;
static tilemap *fg_tilemap;
static rgb_t palette[64];
@ -110,6 +114,19 @@ WRITE8_HANDLER( rockola_charram_w )
}
}
WRITE8_HANDLER( rockola_crtc6845_address_w )
{
crtc6845_address_w(crtc6845, data);
}
WRITE8_HANDLER( rockola_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
WRITE8_HANDLER( rockola_flipscreen_w )
{
int bank;
@ -176,11 +193,10 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( rockola )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
crtc6845 = crtc6845_config(NULL);
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
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);
tilemap_set_transparent_pen(fg_tilemap, 0);
}
@ -299,11 +315,10 @@ static TILE_GET_INFO( satansat_get_fg_tile_info )
VIDEO_START( satansat )
{
bg_tilemap = tilemap_create(satansat_get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
crtc6845 = crtc6845_config(NULL);
fg_tilemap = tilemap_create(satansat_get_fg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
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);
tilemap_set_transparent_pen(fg_tilemap, 0);
}

View File

@ -1,14 +1,16 @@
#include "driver.h"
#include "video/crtc6845.h"
#include "deprecat.h"
UINT8 *usg_videoram,*usg_charram;
UINT8 *usgames_videoram,*usgames_charram;
static tilemap *usg_tilemap;
static crtc6845_t *crtc6845;
static tilemap *usgames_tilemap;
PALETTE_INIT(usg)
PALETTE_INIT(usgames)
{
int j;
@ -35,41 +37,53 @@ PALETTE_INIT(usg)
static TILE_GET_INFO( get_usg_tile_info )
static TILE_GET_INFO( get_usgames_tile_info )
{
int tileno, colour;
tileno = usg_videoram[tile_index*2];
colour = usg_videoram[tile_index*2+1];
tileno = usgames_videoram[tile_index*2];
colour = usgames_videoram[tile_index*2+1];
SET_TILE_INFO(0,tileno,colour,0);
}
VIDEO_START(usg)
VIDEO_START(usgames)
{
usg_tilemap = tilemap_create(get_usg_tile_info,tilemap_scan_rows, 8, 8,64,32);
crtc6845 = crtc6845_config(NULL);
usgames_tilemap = tilemap_create(get_usgames_tile_info,tilemap_scan_rows, 8, 8,64,32);
}
WRITE8_HANDLER( usg_videoram_w )
WRITE8_HANDLER( usgames_videoram_w )
{
usg_videoram[offset] = data;
tilemap_mark_tile_dirty(usg_tilemap,offset/2);
usgames_videoram[offset] = data;
tilemap_mark_tile_dirty(usgames_tilemap,offset/2);
}
WRITE8_HANDLER( usg_charram_w )
WRITE8_HANDLER( usgames_charram_w )
{
usg_charram[offset] = data;
usgames_charram[offset] = data;
decodechar(Machine->gfx[0], offset/8, usg_charram);
decodechar(Machine->gfx[0], offset/8, usgames_charram);
tilemap_mark_all_tiles_dirty(usg_tilemap);
tilemap_mark_all_tiles_dirty(usgames_tilemap);
}
VIDEO_UPDATE(usg)
WRITE8_HANDLER( usgames_crtc6845_address_w )
{
tilemap_draw(bitmap,cliprect,usg_tilemap,0,0);
crtc6845_address_w(crtc6845, data);
}
WRITE8_HANDLER( usgames_crtc6845_register_w )
{
crtc6845_register_w(crtc6845, data);
}
VIDEO_UPDATE(usgames)
{
tilemap_draw(bitmap,cliprect,usgames_tilemap,0,0);
return 0;
}