mirror of
https://github.com/holub/mame
synced 2025-06-20 19:26:42 +03:00
- First batch of machine->screen[] access has been removed
- Added video_screen_auto_bitmap_alloc(screen) -- it is just a shorthand for auto_bitmap_alloc(video_screen_get_width(screen), video_screen_get_height(screen), video_screen_get_format(screen)) which is a common operation - The Dynax/Don Den Lover games now do their updating in VIDEO_UPDATE instead of VIDEO_EOF. This semmed to have fixed the palette problems - Went through some of these drivers and changed Machine to machine
This commit is contained in:
parent
bf88dd74e3
commit
77a58d253c
@ -9414,12 +9414,12 @@ static void HandleLocalCommandCheat(running_machine *machine, UINT32 type, UINT3
|
|||||||
/* ----- refresh rate ----- */
|
/* ----- refresh rate ----- */
|
||||||
case kCustomLocation_RefreshRate:
|
case kCustomLocation_RefreshRate:
|
||||||
{
|
{
|
||||||
screen_state *state = &machine->screen[0];
|
int width = video_screen_get_width(machine->primary_screen);
|
||||||
double refresh = data;
|
int height = video_screen_get_height(machine->primary_screen);
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
double refresh = data / 65536.0;
|
||||||
|
|
||||||
refresh /= 65536.0;
|
video_screen_configure(machine->primary_screen, width, height, visarea, HZ_TO_ATTOSECONDS(refresh));
|
||||||
|
|
||||||
video_screen_configure(machine->primary_screen, state->width, state->height, &state->visarea, HZ_TO_ATTOSECONDS(refresh));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -465,7 +465,7 @@ void render_container_set_overlay(render_container *container, bitmap_t *bitmap)
|
|||||||
/* return a pointer to the UI container */
|
/* return a pointer to the UI container */
|
||||||
render_container *render_container_get_ui(void);
|
render_container *render_container_get_ui(void);
|
||||||
|
|
||||||
/* return a pointer to the indexed screen container */
|
/* return a pointer to the container for the given screen */
|
||||||
render_container *render_container_get_screen(const device_config *screen);
|
render_container *render_container_get_screen(const device_config *screen);
|
||||||
|
|
||||||
/* set the opacity of a given palette entry */
|
/* set the opacity of a given palette entry */
|
||||||
|
@ -263,8 +263,8 @@ INLINE tilemap *indexed_tilemap(int index)
|
|||||||
|
|
||||||
void tilemap_init(running_machine *machine)
|
void tilemap_init(running_machine *machine)
|
||||||
{
|
{
|
||||||
screen_width = machine->screen[0].width;
|
screen_width = video_screen_get_width(machine->primary_screen);
|
||||||
screen_height = machine->screen[0].height;
|
screen_height = video_screen_get_height(machine->primary_screen);
|
||||||
|
|
||||||
if (screen_width != 0 && screen_height != 0)
|
if (screen_width != 0 && screen_height != 0)
|
||||||
{
|
{
|
||||||
|
34
src/emu/ui.c
34
src/emu/ui.c
@ -153,7 +153,7 @@ static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer
|
|||||||
static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
|
static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
|
||||||
static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg);
|
static INT32 slider_flicker(running_machine *machine, INT32 newval, char *buffer, int arg);
|
||||||
static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg);
|
static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, int arg);
|
||||||
static char *slider_get_screen_desc(int arg);
|
static char *slider_get_screen_desc(const device_config *screen);
|
||||||
#ifdef MAME_DEBUG
|
#ifdef MAME_DEBUG
|
||||||
static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg);
|
static INT32 slider_crossscale(running_machine *machine, INT32 newval, char *buffer, int arg);
|
||||||
static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
|
static INT32 slider_crossoffset(running_machine *machine, INT32 newval, char *buffer, int arg);
|
||||||
@ -1115,22 +1115,25 @@ int sprintf_game_info(char *buffer)
|
|||||||
|
|
||||||
for (screen = video_screen_first(Machine->config); screen != NULL; screen = video_screen_next(screen))
|
for (screen = video_screen_first(Machine->config); screen != NULL; screen = video_screen_next(screen))
|
||||||
{
|
{
|
||||||
int index = device_list_index(Machine->config->devicelist, VIDEO_SCREEN, screen->tag);
|
|
||||||
const screen_config *scrconfig = screen->inline_config;
|
const screen_config *scrconfig = screen->inline_config;
|
||||||
|
|
||||||
if (scrcount > 1)
|
if (scrcount > 1)
|
||||||
bufptr += sprintf(bufptr, "%s: ", slider_get_screen_desc(index));
|
bufptr += sprintf(bufptr, "%s: ", slider_get_screen_desc(screen));
|
||||||
|
|
||||||
if (scrconfig->type == SCREEN_TYPE_VECTOR)
|
if (scrconfig->type == SCREEN_TYPE_VECTOR)
|
||||||
bufptr += sprintf(bufptr, "Vector\n");
|
bufptr += sprintf(bufptr, "Vector\n");
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
bufptr += sprintf(bufptr, "%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
|
bufptr += sprintf(bufptr, "%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
|
||||||
Machine->screen[index].visarea.max_x - Machine->screen[index].visarea.min_x + 1,
|
visarea->max_x - visarea->min_x + 1,
|
||||||
Machine->screen[index].visarea.max_y - Machine->screen[index].visarea.min_y + 1,
|
visarea->max_y - visarea->min_y + 1,
|
||||||
(Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
|
(Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
|
||||||
ATTOSECONDS_TO_HZ(video_screen_get_frame_period(screen).attoseconds));
|
ATTOSECONDS_TO_HZ(video_screen_get_frame_period(screen).attoseconds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return bufptr - buffer;
|
return bufptr - buffer;
|
||||||
}
|
}
|
||||||
@ -1748,7 +1751,7 @@ static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer
|
|||||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
video_screen_configure(screen, width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
|
video_screen_configure(screen, width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
|
||||||
sprintf(buffer, "%s Refresh Rate %.3ffps", slider_get_screen_desc(arg), ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds));
|
sprintf(buffer, "%s Refresh Rate %.3ffps", slider_get_screen_desc(screen), ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds));
|
||||||
}
|
}
|
||||||
refresh = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
refresh = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
||||||
return floor((refresh - defrefresh) * 1000.0f + 0.5f);
|
return floor((refresh - defrefresh) * 1000.0f + 0.5f);
|
||||||
@ -1767,7 +1770,7 @@ static INT32 slider_brightness(running_machine *machine, INT32 newval, char *buf
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_brightness(container, (float)newval * 0.001f);
|
render_container_set_brightness(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s Brightness %.3f", slider_get_screen_desc(arg), render_container_get_brightness(container));
|
sprintf(buffer, "%s Brightness %.3f", slider_get_screen_desc(screen), render_container_get_brightness(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_brightness(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_brightness(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1785,7 +1788,7 @@ static INT32 slider_contrast(running_machine *machine, INT32 newval, char *buffe
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_contrast(container, (float)newval * 0.001f);
|
render_container_set_contrast(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s Contrast %.3f", slider_get_screen_desc(arg), render_container_get_contrast(container));
|
sprintf(buffer, "%s Contrast %.3f", slider_get_screen_desc(screen), render_container_get_contrast(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_contrast(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_contrast(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1802,7 +1805,7 @@ static INT32 slider_gamma(running_machine *machine, INT32 newval, char *buffer,
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_gamma(container, (float)newval * 0.001f);
|
render_container_set_gamma(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s Gamma %.3f", slider_get_screen_desc(arg), render_container_get_gamma(container));
|
sprintf(buffer, "%s Gamma %.3f", slider_get_screen_desc(screen), render_container_get_gamma(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_gamma(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_gamma(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1820,7 +1823,7 @@ static INT32 slider_xscale(running_machine *machine, INT32 newval, char *buffer,
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_xscale(container, (float)newval * 0.001f);
|
render_container_set_xscale(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Horiz Stretch", render_container_get_xscale(container));
|
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Horiz Stretch", render_container_get_xscale(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_xscale(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_xscale(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1838,7 +1841,7 @@ static INT32 slider_yscale(running_machine *machine, INT32 newval, char *buffer,
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_yscale(container, (float)newval * 0.001f);
|
render_container_set_yscale(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Vert Stretch", render_container_get_yscale(container));
|
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Vert Stretch", render_container_get_yscale(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_yscale(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_yscale(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1856,7 +1859,7 @@ static INT32 slider_xoffset(running_machine *machine, INT32 newval, char *buffer
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_xoffset(container, (float)newval * 0.001f);
|
render_container_set_xoffset(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Horiz Position", render_container_get_xoffset(container));
|
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Horiz Position", render_container_get_xoffset(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_xoffset(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_xoffset(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1874,7 +1877,7 @@ static INT32 slider_yoffset(running_machine *machine, INT32 newval, char *buffer
|
|||||||
if (buffer != NULL)
|
if (buffer != NULL)
|
||||||
{
|
{
|
||||||
render_container_set_yoffset(container, (float)newval * 0.001f);
|
render_container_set_yoffset(container, (float)newval * 0.001f);
|
||||||
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(arg), "Vert Position", render_container_get_yoffset(container));
|
sprintf(buffer, "%s %s %.3f", slider_get_screen_desc(screen), "Vert Position", render_container_get_yoffset(container));
|
||||||
}
|
}
|
||||||
return floor(render_container_get_yoffset(container) * 1000.0f + 0.5f);
|
return floor(render_container_get_yoffset(container) * 1000.0f + 0.5f);
|
||||||
}
|
}
|
||||||
@ -1917,10 +1920,9 @@ static INT32 slider_beam(running_machine *machine, INT32 newval, char *buffer, i
|
|||||||
description for a given screen index
|
description for a given screen index
|
||||||
-------------------------------------------------*/
|
-------------------------------------------------*/
|
||||||
|
|
||||||
static char *slider_get_screen_desc(int arg)
|
static char *slider_get_screen_desc(const device_config *screen)
|
||||||
{
|
{
|
||||||
const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, arg);
|
int screen_count = video_screen_count(screen->machine->config);
|
||||||
int screen_count = video_screen_count(Machine->config);
|
|
||||||
static char descbuf[256];
|
static char descbuf[256];
|
||||||
|
|
||||||
if (screen_count > 1)
|
if (screen_count > 1)
|
||||||
|
@ -1033,7 +1033,7 @@ static void tilemap_handle_keys(ui_gfx_state *state, int viswidth, int visheight
|
|||||||
|
|
||||||
static void tilemap_update_bitmap(ui_gfx_state *state, int width, int height)
|
static void tilemap_update_bitmap(ui_gfx_state *state, int width, int height)
|
||||||
{
|
{
|
||||||
bitmap_format screen_format = Machine->screen[0].format;
|
bitmap_format screen_format = video_screen_get_format(Machine->primary_screen);
|
||||||
int screen_texformat;
|
int screen_texformat;
|
||||||
|
|
||||||
/* convert the screen format to a texture format */
|
/* convert the screen format to a texture format */
|
||||||
|
@ -14,6 +14,10 @@
|
|||||||
#ifndef __VIDEO_H__
|
#ifndef __VIDEO_H__
|
||||||
#define __VIDEO_H__
|
#define __VIDEO_H__
|
||||||
|
|
||||||
|
#include "mamecore.h"
|
||||||
|
#include "devintrf.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
CONSTANTS
|
CONSTANTS
|
||||||
@ -47,6 +51,12 @@ enum
|
|||||||
#define video_screen_first(config) device_list_first((config)->devicelist, VIDEO_SCREEN)
|
#define video_screen_first(config) device_list_first((config)->devicelist, VIDEO_SCREEN)
|
||||||
#define video_screen_next(previous) device_list_next((previous), VIDEO_SCREEN)
|
#define video_screen_next(previous) device_list_next((previous), VIDEO_SCREEN)
|
||||||
|
|
||||||
|
#define video_screen_get_format(screen) (((screen_config *)(screen)->inline_config)->format)
|
||||||
|
|
||||||
|
/* allocates a bitmap that has the same dimensions and format as the passed in screen */
|
||||||
|
#define video_screen_auto_bitmap_alloc(screen) auto_bitmap_alloc(video_screen_get_width(screen), video_screen_get_height(screen), video_screen_get_format(screen))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -313,7 +313,7 @@ void generic_video_init(running_machine *machine)
|
|||||||
VIDEO_START( generic_bitmapped )
|
VIDEO_START( generic_bitmapped )
|
||||||
{
|
{
|
||||||
/* allocate the temporary bitmap */
|
/* allocate the temporary bitmap */
|
||||||
tmpbitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
|
tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
/* ensure the contents of the bitmap are saved */
|
/* ensure the contents of the bitmap are saved */
|
||||||
state_save_register_bitmap("video", 0, "tmpbitmap", tmpbitmap);
|
state_save_register_bitmap("video", 0, "tmpbitmap", tmpbitmap);
|
||||||
@ -450,8 +450,10 @@ void buffer_spriteram_2(UINT8 *ptr, int length)
|
|||||||
|
|
||||||
static void updateflip(void)
|
static void updateflip(void)
|
||||||
{
|
{
|
||||||
screen_state *state = &Machine->screen[0];
|
int width = video_screen_get_width(Machine->primary_screen);
|
||||||
rectangle visarea = state->visarea;
|
int height = video_screen_get_height(Machine->primary_screen);
|
||||||
|
attoseconds_t period = video_screen_get_frame_period(Machine->primary_screen).attoseconds;
|
||||||
|
rectangle visarea = *video_screen_get_visible_area(Machine->primary_screen);
|
||||||
|
|
||||||
tilemap_set_flip(ALL_TILEMAPS,(TILEMAP_FLIPX & flip_screen_x) | (TILEMAP_FLIPY & flip_screen_y));
|
tilemap_set_flip(ALL_TILEMAPS,(TILEMAP_FLIPX & flip_screen_x) | (TILEMAP_FLIPY & flip_screen_y));
|
||||||
|
|
||||||
@ -459,20 +461,20 @@ static void updateflip(void)
|
|||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
temp = state->width - visarea.min_x - 1;
|
temp = width - visarea.min_x - 1;
|
||||||
visarea.min_x = state->width - visarea.max_x - 1;
|
visarea.min_x = width - visarea.max_x - 1;
|
||||||
visarea.max_x = temp;
|
visarea.max_x = temp;
|
||||||
}
|
}
|
||||||
if (flip_screen_y)
|
if (flip_screen_y)
|
||||||
{
|
{
|
||||||
int temp;
|
int temp;
|
||||||
|
|
||||||
temp = state->height - visarea.min_y - 1;
|
temp = height - visarea.min_y - 1;
|
||||||
visarea.min_y = state->height - visarea.max_y - 1;
|
visarea.min_y = height - visarea.max_y - 1;
|
||||||
visarea.max_y = temp;
|
visarea.max_y = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
video_screen_configure(Machine->primary_screen, state->width, state->height, &visarea, video_screen_get_frame_period(Machine->primary_screen).attoseconds);
|
video_screen_configure(Machine->primary_screen, width, height, &visarea, period);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,7 +194,8 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
|
|||||||
tms.visarea.max_y = tms.top_border + 24*8 - 1 + MIN(intf->bordery, tms.bottom_border);
|
tms.visarea.max_y = tms.top_border + 24*8 - 1 + MIN(intf->bordery, tms.bottom_border);
|
||||||
|
|
||||||
/* configure the screen if we weren't overridden */
|
/* configure the screen if we weren't overridden */
|
||||||
if (machine->screen[0].width == LEFT_BORDER+32*8+RIGHT_BORDER && machine->screen[0].height == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
|
if (video_screen_get_width(machine->primary_screen) == LEFT_BORDER+32*8+RIGHT_BORDER &&
|
||||||
|
video_screen_get_height(machine->primary_screen) == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
|
||||||
video_screen_configure(machine->primary_screen, LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, &tms.visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
video_screen_configure(machine->primary_screen, LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, &tms.visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
||||||
|
|
||||||
/* Video RAM */
|
/* Video RAM */
|
||||||
@ -206,7 +207,7 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
|
|||||||
tms.dBackMem = (UINT8*)auto_malloc (IMAGE_SIZE);
|
tms.dBackMem = (UINT8*)auto_malloc (IMAGE_SIZE);
|
||||||
|
|
||||||
/* back bitmap */
|
/* back bitmap */
|
||||||
tms.tmpbmp = auto_bitmap_alloc (256, 192, machine->screen[0].format);
|
tms.tmpbmp = auto_bitmap_alloc (256, 192, video_screen_get_format(machine->primary_screen));
|
||||||
|
|
||||||
TMS9928A_reset ();
|
TMS9928A_reset ();
|
||||||
tms.LimitSprites = 1;
|
tms.LimitSprites = 1;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "deprecat.h"
|
|
||||||
#include "includes/amiga.h"
|
#include "includes/amiga.h"
|
||||||
#include "machine/laserdsc.h"
|
#include "machine/laserdsc.h"
|
||||||
|
|
||||||
@ -47,16 +46,18 @@ static TIMER_CALLBACK( response_timer );
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static int get_lightgun_pos(int player, int *x, int *y)
|
static int get_lightgun_pos(const device_config *screen, int player, int *x, int *y)
|
||||||
{
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
int xpos = readinputportbytag_safe((player == 0) ? "GUN1X" : "GUN2X", -1);
|
int xpos = readinputportbytag_safe((player == 0) ? "GUN1X" : "GUN2X", -1);
|
||||||
int ypos = readinputportbytag_safe((player == 0) ? "GUN1Y" : "GUN2Y", -1);
|
int ypos = readinputportbytag_safe((player == 0) ? "GUN1Y" : "GUN2Y", -1);
|
||||||
|
|
||||||
if (xpos == -1 || ypos == -1)
|
if (xpos == -1 || ypos == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*x = Machine->screen[0].visarea.min_x + xpos * (Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1) / 255;
|
*x = visarea->min_x + xpos * (visarea->max_x - visarea->min_x + 1) / 255;
|
||||||
*y = Machine->screen[0].visarea.min_y + ypos * (Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1) / 255;
|
*y = visarea->min_y + ypos * (visarea->max_y - visarea->min_y + 1) / 255;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ static VIDEO_START( alg )
|
|||||||
add_exit_callback(machine, video_cleanup);
|
add_exit_callback(machine, video_cleanup);
|
||||||
|
|
||||||
/* allocate Amiga bitmap */
|
/* allocate Amiga bitmap */
|
||||||
amiga_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, machine->screen[0].format);
|
amiga_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
/* standard video start */
|
/* standard video start */
|
||||||
VIDEO_START_CALL(amiga);
|
VIDEO_START_CALL(amiga);
|
||||||
@ -242,7 +243,7 @@ static CUSTOM_INPUT( lightgun_pos_r )
|
|||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
|
|
||||||
/* get the position based on the input select */
|
/* get the position based on the input select */
|
||||||
get_lightgun_pos(input_select, &x, &y);
|
get_lightgun_pos(machine->primary_screen, input_select, &x, &y);
|
||||||
return (y << 8) | (x >> 2);
|
return (y << 8) | (x >> 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,12 @@ static void update_interrupts(running_machine *machine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static WRITE16_HANDLER( blstroid_halt_until_hblank_0_w )
|
||||||
|
{
|
||||||
|
atarigen_halt_until_hblank_0(machine->primary_screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static MACHINE_RESET( blstroid )
|
static MACHINE_RESET( blstroid )
|
||||||
{
|
{
|
||||||
atarigen_eeprom_reset();
|
atarigen_eeprom_reset();
|
||||||
@ -91,7 +97,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
|
|||||||
AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITE(SMH_RAM) AM_BASE(&blstroid_priorityram)
|
AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITE(SMH_RAM) AM_BASE(&blstroid_priorityram)
|
||||||
AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_w)
|
AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_w)
|
||||||
AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_reset_w)
|
AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_reset_w)
|
||||||
AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_halt_until_hblank_0_w)
|
AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(blstroid_halt_until_hblank_0_w)
|
||||||
AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ(atarigen_sound_r)
|
AM_RANGE(0xff9400, 0xff9401) AM_MIRROR(0x7f83fe) AM_READ(atarigen_sound_r)
|
||||||
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ(input_port_0_word_r)
|
AM_RANGE(0xff9800, 0xff9801) AM_MIRROR(0x7f83f8) AM_READ(input_port_0_word_r)
|
||||||
AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ(input_port_1_word_r)
|
AM_RANGE(0xff9804, 0xff9805) AM_MIRROR(0x7f83f8) AM_READ(input_port_1_word_r)
|
||||||
|
@ -330,7 +330,6 @@ Notes:
|
|||||||
|
|
||||||
#include "driver.h"
|
#include "driver.h"
|
||||||
#include "cdrom.h"
|
#include "cdrom.h"
|
||||||
#include "deprecat.h"
|
|
||||||
#include "cpu/sh2/sh2.h"
|
#include "cpu/sh2/sh2.h"
|
||||||
#include "machine/intelfsh.h"
|
#include "machine/intelfsh.h"
|
||||||
#include "includes/cps3.h"
|
#include "includes/cps3.h"
|
||||||
@ -386,7 +385,7 @@ static rectangle renderbuffer_clip;
|
|||||||
#define CPS3_TRANSPARENCY_PEN_INDEX 2
|
#define CPS3_TRANSPARENCY_PEN_INDEX 2
|
||||||
#define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
|
#define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
|
||||||
|
|
||||||
INLINE void cps3_drawgfxzoom( bitmap_t *dest_bmp,const gfx_element *gfx,
|
INLINE void cps3_drawgfxzoom(running_machine *machine, bitmap_t *dest_bmp,const gfx_element *gfx,
|
||||||
unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
|
unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
|
||||||
const rectangle *clip,int transparency,int transparent_color,
|
const rectangle *clip,int transparency,int transparent_color,
|
||||||
int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
|
int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
|
||||||
@ -587,7 +586,7 @@ INLINE void cps3_drawgfxzoom( bitmap_t *dest_bmp,const gfx_element *gfx,
|
|||||||
if (c&0x02) dest[x] |= 0x4000;
|
if (c&0x02) dest[x] |= 0x4000;
|
||||||
if (c&0x04) dest[x] |= 0x8000;
|
if (c&0x04) dest[x] |= 0x8000;
|
||||||
if (c&0x08) dest[x] |= 0x10000;
|
if (c&0x08) dest[x] |= 0x10000;
|
||||||
if (c&0xf0) dest[x] |= mame_rand(Machine); // ?? not used?
|
if (c&0xf0) dest[x] |= mame_rand(machine); // ?? not used?
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -687,7 +686,7 @@ static const struct game_keys2 keys_table2[] =
|
|||||||
{ 0 } // end of table
|
{ 0 } // end of table
|
||||||
};
|
};
|
||||||
|
|
||||||
static void cps3_decrypt_bios(void)
|
static void cps3_decrypt_bios(running_machine *machine)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
UINT32 *coderegion = (UINT32*)memory_region(REGION_USER1);
|
UINT32 *coderegion = (UINT32*)memory_region(REGION_USER1);
|
||||||
@ -713,7 +712,7 @@ static void cps3_decrypt_bios(void)
|
|||||||
/* Dump to file */
|
/* Dump to file */
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
const char *gamename = Machine->gamedrv->name;
|
const char *gamename = machine->gamedrv->name;
|
||||||
char filename[256];
|
char filename[256];
|
||||||
sprintf(filename, "%s_bios.dump", gamename);
|
sprintf(filename, "%s_bios.dump", gamename);
|
||||||
|
|
||||||
@ -753,7 +752,7 @@ static DRIVER_INIT( cps3crpt )
|
|||||||
++k;
|
++k;
|
||||||
}
|
}
|
||||||
|
|
||||||
cps3_decrypt_bios();
|
cps3_decrypt_bios(machine);
|
||||||
decrypted_gamerom = auto_malloc(0x1000000);
|
decrypted_gamerom = auto_malloc(0x1000000);
|
||||||
|
|
||||||
/* just some NOPs for the game to execute if it crashes and starts executing unmapped addresses
|
/* just some NOPs for the game to execute if it crashes and starts executing unmapped addresses
|
||||||
@ -812,7 +811,7 @@ static int cps3_ss_ram_is_dirty;
|
|||||||
static UINT8* cps3_char_ram_dirty;
|
static UINT8* cps3_char_ram_dirty;
|
||||||
static int cps3_char_ram_is_dirty;
|
static int cps3_char_ram_is_dirty;
|
||||||
|
|
||||||
static void cps3_set_mame_colours( int colournum, UINT16 data, UINT32 fadeval )
|
static void cps3_set_mame_colours(running_machine *machine, int colournum, UINT16 data, UINT32 fadeval )
|
||||||
{
|
{
|
||||||
int r,g,b;
|
int r,g,b;
|
||||||
UINT16* dst = (UINT16*)cps3_colourram;
|
UINT16* dst = (UINT16*)cps3_colourram;
|
||||||
@ -847,50 +846,9 @@ static void cps3_set_mame_colours( int colournum, UINT16 data, UINT32 fadeval )
|
|||||||
|
|
||||||
cps3_mame_colours[colournum] = (r << (16+3)) | (g << (8+3)) | (b << (0+3));
|
cps3_mame_colours[colournum] = (r << (16+3)) | (g << (8+3)) | (b << (0+3));
|
||||||
|
|
||||||
if (colournum<0x10000) palette_set_color(Machine,colournum,cps3_mame_colours[colournum]/* MAKE_RGB(r<<3,g<<3,b<<3)*/);//cps3_mame_colours[colournum]);
|
if (colournum<0x10000) palette_set_color(machine,colournum,cps3_mame_colours[colournum]/* MAKE_RGB(r<<3,g<<3,b<<3)*/);//cps3_mame_colours[colournum]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef UNUSED_FUNCTION
|
|
||||||
static void decode_ssram(void)
|
|
||||||
{
|
|
||||||
if (cps3_ss_ram_dirty)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i=0;i<0x400;i++)
|
|
||||||
{
|
|
||||||
if (cps3_ss_ram_dirty[i])
|
|
||||||
{
|
|
||||||
decodechar(Machine->gfx[0], i, (UINT8*)cps3_ss_ram);
|
|
||||||
cps3_ss_ram_dirty[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cps3_ss_ram_is_dirty = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void decode_charram(void)
|
|
||||||
{
|
|
||||||
if (cps3_char_ram_is_dirty)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for (i=0;i<0x8000;i++)
|
|
||||||
{
|
|
||||||
if (cps3_char_ram_dirty[i])
|
|
||||||
{
|
|
||||||
decodechar(Machine->gfx[1], i, (UINT8*)cps3_char_ram);
|
|
||||||
cps3_char_ram_dirty[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cps3_char_ram_is_dirty = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static VIDEO_START(cps3)
|
static VIDEO_START(cps3)
|
||||||
{
|
{
|
||||||
@ -928,7 +886,7 @@ static VIDEO_START(cps3)
|
|||||||
|
|
||||||
// the renderbuffer can be twice the size of the screen, this allows us to handle framebuffer zoom values
|
// the renderbuffer can be twice the size of the screen, this allows us to handle framebuffer zoom values
|
||||||
// between 0x00 and 0x80 (0x40 is normal, 0x80 would be 'view twice as much', 0x20 is 'view half as much')
|
// between 0x00 and 0x80 (0x40 is normal, 0x80 would be 'view twice as much', 0x20 is 'view half as much')
|
||||||
renderbuffer_bitmap = auto_bitmap_alloc(512*2,224*2,machine->screen[0].format);
|
renderbuffer_bitmap = auto_bitmap_alloc(512*2,224*2,video_screen_get_format(machine->primary_screen));
|
||||||
|
|
||||||
renderbuffer_clip.min_x = 0;
|
renderbuffer_clip.min_x = 0;
|
||||||
renderbuffer_clip.max_x = cps3_screenwidth-1;
|
renderbuffer_clip.max_x = cps3_screenwidth-1;
|
||||||
@ -941,7 +899,7 @@ static VIDEO_START(cps3)
|
|||||||
|
|
||||||
// the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped)
|
// the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped)
|
||||||
|
|
||||||
static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
|
static void cps3_draw_tilemapsprite_line(running_machine *machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
|
||||||
{
|
{
|
||||||
UINT32* tmapregs[4] = { tilemap20_regs_base, tilemap30_regs_base, tilemap40_regs_base, tilemap50_regs_base };
|
UINT32* tmapregs[4] = { tilemap20_regs_base, tilemap30_regs_base, tilemap40_regs_base, tilemap50_regs_base };
|
||||||
UINT32* regs;
|
UINT32* regs;
|
||||||
@ -1015,15 +973,15 @@ static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_t *bitm
|
|||||||
yflip = (dat & 0x00000800)>>11;
|
yflip = (dat & 0x00000800)>>11;
|
||||||
xflip = (dat & 0x00001000)>>12;
|
xflip = (dat & 0x00001000)>>12;
|
||||||
|
|
||||||
if (!bpp) Machine->gfx[1]->color_granularity=256;
|
if (!bpp) machine->gfx[1]->color_granularity=256;
|
||||||
else Machine->gfx[1]->color_granularity=64;
|
else machine->gfx[1]->color_granularity=64;
|
||||||
|
|
||||||
if (cps3_char_ram_dirty[tileno])
|
if (cps3_char_ram_dirty[tileno])
|
||||||
{
|
{
|
||||||
decodechar(Machine->gfx[1], tileno, (UINT8*)cps3_char_ram);
|
decodechar(machine->gfx[1], tileno, (UINT8*)cps3_char_ram);
|
||||||
cps3_char_ram_dirty[tileno] = 0;
|
cps3_char_ram_dirty[tileno] = 0;
|
||||||
}
|
}
|
||||||
cps3_drawgfxzoom(bitmap, Machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,&clip,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
|
cps3_drawgfxzoom(machine, bitmap, machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,&clip,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1032,7 +990,8 @@ static void cps3_draw_tilemapsprite_line(int tmnum, int drawline, bitmap_t *bitm
|
|||||||
static VIDEO_UPDATE(cps3)
|
static VIDEO_UPDATE(cps3)
|
||||||
{
|
{
|
||||||
int y,x, count;
|
int y,x, count;
|
||||||
// int offset;
|
attoseconds_t period = video_screen_get_frame_period(screen).attoseconds;
|
||||||
|
rectangle visarea = *video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
int bg_drawn[4] = { 0, 0, 0, 0 };
|
int bg_drawn[4] = { 0, 0, 0, 0 };
|
||||||
|
|
||||||
@ -1049,24 +1008,20 @@ static VIDEO_UPDATE(cps3)
|
|||||||
{
|
{
|
||||||
if (cps3_screenwidth!=496)
|
if (cps3_screenwidth!=496)
|
||||||
{
|
{
|
||||||
screen_state *state = &screen->machine->screen[0];
|
|
||||||
rectangle visarea = state->visarea;
|
|
||||||
cps3_screenwidth = 496;
|
cps3_screenwidth = 496;
|
||||||
visarea.min_x = 0; visarea.max_x = 496-1;
|
visarea.min_x = 0; visarea.max_x = 496-1;
|
||||||
visarea.min_y = 0; visarea.max_y = 224-1;
|
visarea.min_y = 0; visarea.max_y = 224-1;
|
||||||
video_screen_configure(screen, 496, 224, &visarea, video_screen_get_frame_period(screen).attoseconds);
|
video_screen_configure(screen, 496, 224, &visarea, period);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cps3_screenwidth!=384)
|
if (cps3_screenwidth!=384)
|
||||||
{
|
{
|
||||||
screen_state *state = &screen->machine->screen[0];
|
|
||||||
rectangle visarea = state->visarea;
|
|
||||||
cps3_screenwidth = 384;
|
cps3_screenwidth = 384;
|
||||||
visarea.min_x = 0; visarea.max_x = 384-1;
|
visarea.min_x = 0; visarea.max_x = 384-1;
|
||||||
visarea.min_y = 0; visarea.max_y = 224-1;
|
visarea.min_y = 0; visarea.max_y = 224-1;
|
||||||
video_screen_configure(screen, 384, 224, &visarea, video_screen_get_frame_period(screen).attoseconds);
|
video_screen_configure(screen, 384, 224, &visarea, period);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1183,7 +1138,7 @@ static VIDEO_UPDATE(cps3)
|
|||||||
{
|
{
|
||||||
for (uu=0;uu<1023;uu++)
|
for (uu=0;uu<1023;uu++)
|
||||||
{
|
{
|
||||||
cps3_draw_tilemapsprite_line( tilemapnum, uu, renderbuffer_bitmap, &renderbuffer_clip );
|
cps3_draw_tilemapsprite_line(screen->machine, tilemapnum, uu, renderbuffer_bitmap, &renderbuffer_clip );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bg_drawn[tilemapnum] = 1;
|
bg_drawn[tilemapnum] = 1;
|
||||||
@ -1276,11 +1231,11 @@ static VIDEO_UPDATE(cps3)
|
|||||||
|
|
||||||
if (global_alpha || alpha)
|
if (global_alpha || alpha)
|
||||||
{
|
{
|
||||||
cps3_drawgfxzoom(renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
|
cps3_drawgfxzoom(screen->machine, renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cps3_drawgfxzoom(renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
|
cps3_drawgfxzoom(screen->machine, renderbuffer_bitmap, screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,&renderbuffer_clip,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
@ -1353,7 +1308,7 @@ static VIDEO_UPDATE(cps3)
|
|||||||
cps3_ss_ram_dirty[tile] = 0;
|
cps3_ss_ram_dirty[tile] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cps3_drawgfxzoom(bitmap, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,cliprect,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
|
cps3_drawgfxzoom(screen->machine, bitmap, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,cliprect,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2014,11 +1969,11 @@ static WRITE32_HANDLER( cps3_palettedma_w )
|
|||||||
|
|
||||||
//if (paldma_fade!=0) printf("%08x\n",paldma_fade);
|
//if (paldma_fade!=0) printf("%08x\n",paldma_fade);
|
||||||
|
|
||||||
cps3_set_mame_colours((paldma_dest+i)^1, coldata, paldma_fade);
|
cps3_set_mame_colours(machine, (paldma_dest+i)^1, coldata, paldma_fade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
|
cpunum_set_input_line(machine, 0,10, ASSERT_LINE);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2212,7 +2167,7 @@ static void cps3_do_alt_char_dma( UINT32 src, UINT32 real_dest, UINT32 real_leng
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cps3_process_character_dma(UINT32 address)
|
static void cps3_process_character_dma(running_machine *machine, UINT32 address)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -2239,14 +2194,14 @@ static void cps3_process_character_dma(UINT32 address)
|
|||||||
/* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */
|
/* We should probably copy this, but a pointer to it is fine for our purposes as the data doesn't change */
|
||||||
current_table_address = real_source;
|
current_table_address = real_source;
|
||||||
}
|
}
|
||||||
cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
|
cpunum_set_input_line(machine, 0,10, ASSERT_LINE);
|
||||||
}
|
}
|
||||||
else if ( (dat1&0x00e00000) ==0x00400000 )
|
else if ( (dat1&0x00e00000) ==0x00400000 )
|
||||||
{
|
{
|
||||||
/* 6bpp DMA decompression
|
/* 6bpp DMA decompression
|
||||||
- this is used for the majority of sprites and backgrounds */
|
- this is used for the majority of sprites and backgrounds */
|
||||||
cps3_do_char_dma( real_source, real_destination, real_length );
|
cps3_do_char_dma( real_source, real_destination, real_length );
|
||||||
cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
|
cpunum_set_input_line(machine, 0,10, ASSERT_LINE);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ( (dat1&0x00e00000) ==0x00600000 )
|
else if ( (dat1&0x00e00000) ==0x00600000 )
|
||||||
@ -2254,7 +2209,7 @@ static void cps3_process_character_dma(UINT32 address)
|
|||||||
/* 8bpp DMA decompression
|
/* 8bpp DMA decompression
|
||||||
- this is used on SFIII NG Sean's Stage ONLY */
|
- this is used on SFIII NG Sean's Stage ONLY */
|
||||||
cps3_do_alt_char_dma( real_source, real_destination, real_length);
|
cps3_do_alt_char_dma( real_source, real_destination, real_length);
|
||||||
cpunum_set_input_line(Machine, 0,10, ASSERT_LINE);
|
cpunum_set_input_line(machine, 0,10, ASSERT_LINE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2292,7 +2247,7 @@ static WRITE32_HANDLER( cps3_characterdma_w )
|
|||||||
list_address = (chardma_source | ((chardma_other&0x003f0000)));
|
list_address = (chardma_source | ((chardma_other&0x003f0000)));
|
||||||
|
|
||||||
//printf("chardma_w activated %08x %08x (address = cram %08x)\n", chardma_source, chardma_other, list_address*4 );
|
//printf("chardma_w activated %08x %08x (address = cram %08x)\n", chardma_source, chardma_other, list_address*4 );
|
||||||
cps3_process_character_dma(list_address);
|
cps3_process_character_dma(machine, list_address);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2311,12 +2266,12 @@ static WRITE32_HANDLER( cps3_characterdma_w )
|
|||||||
|
|
||||||
static WRITE32_HANDLER( cps3_irq10_ack_w )
|
static WRITE32_HANDLER( cps3_irq10_ack_w )
|
||||||
{
|
{
|
||||||
cpunum_set_input_line(Machine, 0,10, CLEAR_LINE); return;
|
cpunum_set_input_line(machine, 0,10, CLEAR_LINE); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE32_HANDLER( cps3_irq12_ack_w )
|
static WRITE32_HANDLER( cps3_irq12_ack_w )
|
||||||
{
|
{
|
||||||
cpunum_set_input_line(Machine, 0,12, CLEAR_LINE); return;
|
cpunum_set_input_line(machine, 0,12, CLEAR_LINE); return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE32_HANDLER( cps3_unk_vidregs_w )
|
static WRITE32_HANDLER( cps3_unk_vidregs_w )
|
||||||
@ -2337,12 +2292,12 @@ static WRITE32_HANDLER( cps3_colourram_w )
|
|||||||
|
|
||||||
if (ACCESSING_MSB32)
|
if (ACCESSING_MSB32)
|
||||||
{
|
{
|
||||||
cps3_set_mame_colours(offset*2, (data & 0xffff0000) >> 16, 0);
|
cps3_set_mame_colours(machine, offset*2, (data & 0xffff0000) >> 16, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ACCESSING_LSB32)
|
if (ACCESSING_LSB32)
|
||||||
{
|
{
|
||||||
cps3_set_mame_colours(offset*2+1, (data & 0x0000ffff) >> 0, 0);
|
cps3_set_mame_colours(machine, offset*2+1, (data & 0x0000ffff) >> 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2672,7 +2627,7 @@ static void copy_from_nvram(void)
|
|||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
const char *gamename = Machine->gamedrv->name;
|
const char *gamename = machine->gamedrv->name;
|
||||||
char filename[256];
|
char filename[256];
|
||||||
sprintf(filename, "%s_bios.dump", gamename);
|
sprintf(filename, "%s_bios.dump", gamename);
|
||||||
|
|
||||||
|
@ -36,12 +36,6 @@ Year + Game Board CPU Sound C
|
|||||||
98 Reach Ippatsu Z80 YM2413 + M6295 70C160F011
|
98 Reach Ippatsu Z80 YM2413 + M6295 70C160F011
|
||||||
-----------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Notes:
|
|
||||||
|
|
||||||
- the zooming Dynax logo in ddenlovr would flicker because the palette is
|
|
||||||
updated one frame after the bitmap. This is fixed using a framebuffer but I
|
|
||||||
don't think it's correct.
|
|
||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
|
||||||
@ -60,8 +54,6 @@ TODO:
|
|||||||
- ddenlovr: sometimes the colors of the girl in the presentation before the
|
- ddenlovr: sometimes the colors of the girl in the presentation before the
|
||||||
beginning of a stage are wrong, and they correct themselves when the board
|
beginning of a stage are wrong, and they correct themselves when the board
|
||||||
is drawn.
|
is drawn.
|
||||||
- The palette problems mentioned above happen in other games as well, e.g.
|
|
||||||
quizchq attract mode.
|
|
||||||
|
|
||||||
- the registers right after the palette bank selectors (e00048-e0004f in ddenlovr)
|
- the registers right after the palette bank selectors (e00048-e0004f in ddenlovr)
|
||||||
are not understood. They are related to the layer enable register and to the
|
are not understood. They are related to the layer enable register and to the
|
||||||
@ -104,7 +96,6 @@ TODO:
|
|||||||
|
|
||||||
|
|
||||||
UINT8 *ddenlovr_pixmap[8];
|
UINT8 *ddenlovr_pixmap[8];
|
||||||
static bitmap_t *framebuffer;
|
|
||||||
static int extra_layers;
|
static int extra_layers;
|
||||||
|
|
||||||
|
|
||||||
@ -171,8 +162,6 @@ VIDEO_START(ddenlovr)
|
|||||||
ddenlovr_scroll[i*2+0] = ddenlovr_scroll[i*2+1] = 0;
|
ddenlovr_scroll[i*2+0] = ddenlovr_scroll[i*2+1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
framebuffer = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
|
||||||
|
|
||||||
extra_layers = 0;
|
extra_layers = 0;
|
||||||
|
|
||||||
// older games do not set these !?
|
// older games do not set these !?
|
||||||
@ -607,7 +596,7 @@ INLINE void log_blit(int data)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blitter_w(int blitter, offs_t offset,UINT8 data,int irq_vector)
|
static void blitter_w(running_machine *machine, int blitter, offs_t offset,UINT8 data,int irq_vector)
|
||||||
{
|
{
|
||||||
static int ddenlovr_blit_reg[2];
|
static int ddenlovr_blit_reg[2];
|
||||||
int hi_bits;
|
int hi_bits;
|
||||||
@ -745,14 +734,14 @@ profiler_mark(PROFILER_VIDEO);
|
|||||||
|
|
||||||
if (irq_vector)
|
if (irq_vector)
|
||||||
/* quizchq */
|
/* quizchq */
|
||||||
cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, irq_vector);
|
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, irq_vector);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* ddenlovr */
|
/* ddenlovr */
|
||||||
if (ddenlovr_blitter_irq_enable)
|
if (ddenlovr_blitter_irq_enable)
|
||||||
{
|
{
|
||||||
ddenlovr_blitter_irq_flag = 1;
|
ddenlovr_blitter_irq_flag = 1;
|
||||||
cpunum_set_input_line(Machine, 0,1,HOLD_LINE);
|
cpunum_set_input_line(machine, 0,1,HOLD_LINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -770,7 +759,7 @@ profiler_mark(PROFILER_END);
|
|||||||
|
|
||||||
|
|
||||||
// differences wrt blitter_data_w: slightly different blitter commands
|
// differences wrt blitter_data_w: slightly different blitter commands
|
||||||
static void blitter_w_funkyfig(int blitter, offs_t offset,UINT8 data,int irq_vector)
|
static void blitter_w_funkyfig(running_machine *machine, int blitter, offs_t offset,UINT8 data,int irq_vector)
|
||||||
{
|
{
|
||||||
static int ddenlovr_blit_reg[2];
|
static int ddenlovr_blit_reg[2];
|
||||||
int hi_bits;
|
int hi_bits;
|
||||||
@ -912,7 +901,7 @@ profiler_mark(PROFILER_VIDEO);
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, irq_vector);
|
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, irq_vector);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1125,13 +1114,13 @@ profiler_mark(PROFILER_END);
|
|||||||
|
|
||||||
static WRITE8_HANDLER( rongrong_blitter_w )
|
static WRITE8_HANDLER( rongrong_blitter_w )
|
||||||
{
|
{
|
||||||
blitter_w(0,offset,data,0xf8);
|
blitter_w(machine, 0,offset,data,0xf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE16_HANDLER( ddenlovr_blitter_w )
|
static WRITE16_HANDLER( ddenlovr_blitter_w )
|
||||||
{
|
{
|
||||||
if (ACCESSING_LSB)
|
if (ACCESSING_LSB)
|
||||||
blitter_w(0,offset,data & 0xff,0);
|
blitter_w(machine, 0,offset,data & 0xff,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1210,16 +1199,6 @@ static void copylayer(bitmap_t *bitmap,const rectangle *cliprect,int layer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
VIDEO_UPDATE(ddenlovr)
|
VIDEO_UPDATE(ddenlovr)
|
||||||
{
|
|
||||||
copybitmap(bitmap,framebuffer,0,0,0,0,cliprect);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
I do the following in a eof handler, to avoid palette/gfx synchronization
|
|
||||||
issues with frameskipping
|
|
||||||
*/
|
|
||||||
VIDEO_EOF(ddenlovr)
|
|
||||||
{
|
{
|
||||||
static const int order[24][4] =
|
static const int order[24][4] =
|
||||||
{
|
{
|
||||||
@ -1257,7 +1236,7 @@ VIDEO_EOF(ddenlovr)
|
|||||||
if (input_code_pressed_once(KEYCODE_F)) { base++; while ((memory_region(REGION_GFX1)[base] & 0xf0) != 0x30) base++; }
|
if (input_code_pressed_once(KEYCODE_F)) { base++; while ((memory_region(REGION_GFX1)[base] & 0xf0) != 0x30) base++; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fillbitmap(framebuffer,ddenlovr_bgcolor,&machine->screen[0].visarea);
|
fillbitmap(bitmap,ddenlovr_bgcolor,cliprect);
|
||||||
|
|
||||||
#ifdef MAME_DEBUG
|
#ifdef MAME_DEBUG
|
||||||
if (input_code_pressed(KEYCODE_Z))
|
if (input_code_pressed(KEYCODE_Z))
|
||||||
@ -1297,10 +1276,10 @@ VIDEO_EOF(ddenlovr)
|
|||||||
pri = 0;
|
pri = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][0]);
|
copylayer(bitmap,cliprect,order[pri][0]);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][1]);
|
copylayer(bitmap,cliprect,order[pri][1]);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][2]);
|
copylayer(bitmap,cliprect,order[pri][2]);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][3]);
|
copylayer(bitmap,cliprect,order[pri][3]);
|
||||||
|
|
||||||
if (extra_layers)
|
if (extra_layers)
|
||||||
{
|
{
|
||||||
@ -1312,14 +1291,16 @@ VIDEO_EOF(ddenlovr)
|
|||||||
pri = 0;
|
pri = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][0]+4);
|
copylayer(bitmap,cliprect,order[pri][0]+4);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][1]+4);
|
copylayer(bitmap,cliprect,order[pri][1]+4);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][2]+4);
|
copylayer(bitmap,cliprect,order[pri][2]+4);
|
||||||
copylayer(framebuffer,&machine->screen[0].visarea,order[pri][3]+4);
|
copylayer(bitmap,cliprect,order[pri][3]+4);
|
||||||
}
|
}
|
||||||
|
|
||||||
ddenlovr_layer_enable = enab;
|
ddenlovr_layer_enable = enab;
|
||||||
ddenlovr_layer_enable2 = enab2;
|
ddenlovr_layer_enable2 = enab2;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static READ16_HANDLER( ddenlovr_special_r )
|
static READ16_HANDLER( ddenlovr_special_r )
|
||||||
@ -1518,8 +1499,8 @@ static READ8_HANDLER( quiz365_input_r )
|
|||||||
if (!(ddenlovr_select & 0x01)) return readinputport(3);
|
if (!(ddenlovr_select & 0x01)) return readinputport(3);
|
||||||
if (!(ddenlovr_select & 0x02)) return readinputport(4);
|
if (!(ddenlovr_select & 0x02)) return readinputport(4);
|
||||||
if (!(ddenlovr_select & 0x04)) return readinputport(5);
|
if (!(ddenlovr_select & 0x04)) return readinputport(5);
|
||||||
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(Machine);
|
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
|
||||||
if (!(ddenlovr_select & 0x10)) return 0xff;//mame_rand(Machine);
|
if (!(ddenlovr_select & 0x10)) return 0xff;//mame_rand(machine);
|
||||||
return 0xff;
|
return 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1831,8 +1812,8 @@ static READ8_HANDLER( rongrong_input_r )
|
|||||||
{
|
{
|
||||||
if (!(ddenlovr_select & 0x01)) return readinputport(3);
|
if (!(ddenlovr_select & 0x01)) return readinputport(3);
|
||||||
if (!(ddenlovr_select & 0x02)) return readinputport(4);
|
if (!(ddenlovr_select & 0x02)) return readinputport(4);
|
||||||
if (!(ddenlovr_select & 0x04)) return 0xff;//mame_rand(Machine);
|
if (!(ddenlovr_select & 0x04)) return 0xff;//mame_rand(machine);
|
||||||
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(Machine);
|
if (!(ddenlovr_select & 0x08)) return 0xff;//mame_rand(machine);
|
||||||
if (!(ddenlovr_select & 0x10)) return readinputport(5);
|
if (!(ddenlovr_select & 0x10)) return readinputport(5);
|
||||||
return 0xff;
|
return 0xff;
|
||||||
}
|
}
|
||||||
@ -1971,11 +1952,11 @@ static WRITE8_HANDLER( mmpanic_soundlatch_w )
|
|||||||
|
|
||||||
static WRITE8_HANDLER( mmpanic_blitter_w )
|
static WRITE8_HANDLER( mmpanic_blitter_w )
|
||||||
{
|
{
|
||||||
blitter_w(0,offset,data,0xdf); // RST 18
|
blitter_w(machine, 0,offset,data,0xdf); // RST 18
|
||||||
}
|
}
|
||||||
static WRITE8_HANDLER( mmpanic_blitter2_w )
|
static WRITE8_HANDLER( mmpanic_blitter2_w )
|
||||||
{
|
{
|
||||||
blitter_w(1,offset,data,0xdf); // RST 18
|
blitter_w(machine, 1,offset,data,0xdf); // RST 18
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A led for each of the 9 buttons */
|
/* A led for each of the 9 buttons */
|
||||||
@ -2134,7 +2115,7 @@ static READ8_HANDLER( funkyfig_busy_r )
|
|||||||
|
|
||||||
static WRITE8_HANDLER( funkyfig_blitter_w )
|
static WRITE8_HANDLER( funkyfig_blitter_w )
|
||||||
{
|
{
|
||||||
blitter_w_funkyfig(0,offset,data,0xe0);
|
blitter_w_funkyfig(machine, 0,offset,data,0xe0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( funkyfig_rombank_w )
|
static WRITE8_HANDLER( funkyfig_rombank_w )
|
||||||
@ -2373,7 +2354,7 @@ static WRITE8_HANDLER( hanakanz_palette_w )
|
|||||||
int g = ddenlovr_blit_reg & 0x1f;
|
int g = ddenlovr_blit_reg & 0x1f;
|
||||||
int r = data & 0x1f;
|
int r = data & 0x1f;
|
||||||
int b = ((data & 0xe0) >> 5) | ((ddenlovr_blit_reg & 0x60) >> 2);
|
int b = ((data & 0xe0) >> 5) | ((ddenlovr_blit_reg & 0x60) >> 2);
|
||||||
palette_set_color_rgb(Machine,(palette_index++)&0x1ff,pal5bit(r),pal5bit(g),pal5bit(b));
|
palette_set_color_rgb(machine,(palette_index++)&0x1ff,pal5bit(r),pal5bit(g),pal5bit(b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2384,7 +2365,7 @@ static WRITE8_HANDLER( hanakanz_oki_bank_w )
|
|||||||
|
|
||||||
static READ8_HANDLER( hanakanz_rand_r )
|
static READ8_HANDLER( hanakanz_rand_r )
|
||||||
{
|
{
|
||||||
return mame_rand(Machine);
|
return mame_rand(machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( hanakanz_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
static ADDRESS_MAP_START( hanakanz_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||||
@ -2553,7 +2534,7 @@ static WRITE8_HANDLER( mjchuuka_palette_w )
|
|||||||
int r = (rgb >> 0) & 0x1f;
|
int r = (rgb >> 0) & 0x1f;
|
||||||
int g = (rgb >> 8) & 0x1f;
|
int g = (rgb >> 8) & 0x1f;
|
||||||
int b = ((rgb >> 5) & 0x07) | ((rgb & 0x6000) >> 10);
|
int b = ((rgb >> 5) & 0x07) | ((rgb & 0x6000) >> 10);
|
||||||
palette_set_color_rgb(Machine,(palette_index++)&0x1ff,pal5bit(r),pal5bit(g),pal5bit(b));
|
palette_set_color_rgb(machine,(palette_index++)&0x1ff,pal5bit(r),pal5bit(g),pal5bit(b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2710,7 +2691,7 @@ static WRITE8_HANDLER( mjmyster_coincounter_w )
|
|||||||
|
|
||||||
static WRITE8_HANDLER( mjmyster_blitter_w )
|
static WRITE8_HANDLER( mjmyster_blitter_w )
|
||||||
{
|
{
|
||||||
blitter_w(0,offset,data,0xfc);
|
blitter_w(machine, 0,offset,data,0xfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( mjmyster_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
static ADDRESS_MAP_START( mjmyster_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||||
@ -2888,7 +2869,7 @@ static WRITE8_HANDLER( hginga_blitter_w )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blitter_w(0,offset,data,0xfc);
|
blitter_w(machine, 0,offset,data,0xfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ADDRESS_MAP_START( hginga_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
static ADDRESS_MAP_START( hginga_readport, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||||
@ -2929,9 +2910,9 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
static UINT8 hgokou_hopper;
|
static UINT8 hgokou_hopper;
|
||||||
|
|
||||||
static UINT8 hgokou_player_r(int player)
|
static UINT8 hgokou_player_r(running_machine *machine, int player)
|
||||||
{
|
{
|
||||||
UINT8 hopper_bit = ((hgokou_hopper && !(video_screen_get_frame_number(Machine->primary_screen)%10)) ? 0 : (1<<6));
|
UINT8 hopper_bit = ((hgokou_hopper && !(video_screen_get_frame_number(machine->primary_screen)%10)) ? 0 : (1<<6));
|
||||||
|
|
||||||
if (!(ddenlovr_select2 & 0x01)) return readinputport(player * 5 + 1) | hopper_bit;
|
if (!(ddenlovr_select2 & 0x01)) return readinputport(player * 5 + 1) | hopper_bit;
|
||||||
if (!(ddenlovr_select2 & 0x02)) return readinputport(player * 5 + 2) | hopper_bit;
|
if (!(ddenlovr_select2 & 0x02)) return readinputport(player * 5 + 2) | hopper_bit;
|
||||||
@ -2947,8 +2928,8 @@ static READ8_HANDLER( hgokou_input_r )
|
|||||||
switch (hginga_select)
|
switch (hginga_select)
|
||||||
{
|
{
|
||||||
case 0x20: return readinputport(0);
|
case 0x20: return readinputport(0);
|
||||||
case 0x21: return hgokou_player_r(1);
|
case 0x21: return hgokou_player_r(machine, 1);
|
||||||
case 0x22: return hgokou_player_r(0);
|
case 0x22: return hgokou_player_r(machine, 0);
|
||||||
case 0x23: return hginga_coins;
|
case 0x23: return hginga_coins;
|
||||||
}
|
}
|
||||||
logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select);
|
logerror("%06x: warning, unknown bits read, hginga_select = %02x\n", activecpu_get_pc(), hginga_select);
|
||||||
@ -3320,7 +3301,7 @@ static READ8_HANDLER( mjflove_blitter_r )
|
|||||||
|
|
||||||
static WRITE8_HANDLER( mjflove_blitter_w )
|
static WRITE8_HANDLER( mjflove_blitter_w )
|
||||||
{
|
{
|
||||||
blitter_w(0,offset,data,0);
|
blitter_w(machine, 0,offset,data,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( mjflove_coincounter_w )
|
static WRITE8_HANDLER( mjflove_coincounter_w )
|
||||||
@ -6537,8 +6518,8 @@ static MACHINE_DRIVER_START( ddenlovr )
|
|||||||
|
|
||||||
MDRV_PALETTE_LENGTH(0x100)
|
MDRV_PALETTE_LENGTH(0x100)
|
||||||
|
|
||||||
|
MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MDRV_VIDEO_START(ddenlovr)
|
MDRV_VIDEO_START(ddenlovr)
|
||||||
MDRV_VIDEO_EOF(ddenlovr)
|
|
||||||
MDRV_VIDEO_UPDATE(ddenlovr)
|
MDRV_VIDEO_UPDATE(ddenlovr)
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
@ -6652,8 +6633,8 @@ static MACHINE_DRIVER_START( quizchq )
|
|||||||
|
|
||||||
MDRV_PALETTE_LENGTH(0x100)
|
MDRV_PALETTE_LENGTH(0x100)
|
||||||
|
|
||||||
|
MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MDRV_VIDEO_START(ddenlovr)
|
MDRV_VIDEO_START(ddenlovr)
|
||||||
MDRV_VIDEO_EOF(ddenlovr)
|
|
||||||
MDRV_VIDEO_UPDATE(ddenlovr)
|
MDRV_VIDEO_UPDATE(ddenlovr)
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
@ -6727,8 +6708,8 @@ static MACHINE_DRIVER_START( mmpanic )
|
|||||||
|
|
||||||
MDRV_PALETTE_LENGTH(0x100)
|
MDRV_PALETTE_LENGTH(0x100)
|
||||||
|
|
||||||
|
MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MDRV_VIDEO_START(mmpanic) // extra layers
|
MDRV_VIDEO_START(mmpanic) // extra layers
|
||||||
MDRV_VIDEO_EOF(ddenlovr)
|
|
||||||
MDRV_VIDEO_UPDATE(ddenlovr)
|
MDRV_VIDEO_UPDATE(ddenlovr)
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
@ -6791,8 +6772,8 @@ static MACHINE_DRIVER_START( hanakanz )
|
|||||||
|
|
||||||
MDRV_PALETTE_LENGTH(0x200)
|
MDRV_PALETTE_LENGTH(0x200)
|
||||||
|
|
||||||
|
MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MDRV_VIDEO_START(hanakanz) // blitter commands in the roms are shuffled around
|
MDRV_VIDEO_START(hanakanz) // blitter commands in the roms are shuffled around
|
||||||
MDRV_VIDEO_EOF(ddenlovr)
|
|
||||||
MDRV_VIDEO_UPDATE(ddenlovr)
|
MDRV_VIDEO_UPDATE(ddenlovr)
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
|
@ -141,7 +141,8 @@ INLINE int scanline_to_vcount(int scanline)
|
|||||||
static TIMER_CALLBACK( ddragon_scanline_callback )
|
static TIMER_CALLBACK( ddragon_scanline_callback )
|
||||||
{
|
{
|
||||||
int scanline = param;
|
int scanline = param;
|
||||||
int vcount_old = scanline_to_vcount((scanline == 0) ? machine->screen[0].height - 1 : scanline - 1);
|
int screen_height = video_screen_get_height(machine->primary_screen);
|
||||||
|
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
|
||||||
int vcount = scanline_to_vcount(scanline);
|
int vcount = scanline_to_vcount(scanline);
|
||||||
|
|
||||||
/* update to the current point */
|
/* update to the current point */
|
||||||
@ -156,7 +157,7 @@ static TIMER_CALLBACK( ddragon_scanline_callback )
|
|||||||
cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
|
cpunum_set_input_line(machine, 0, M6809_FIRQ_LINE, ASSERT_LINE);
|
||||||
|
|
||||||
/* adjust for next scanline */
|
/* adjust for next scanline */
|
||||||
if (++scanline >= machine->screen[0].height)
|
if (++scanline >= screen_height)
|
||||||
scanline = 0;
|
scanline = 0;
|
||||||
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
|
|||||||
|
|
||||||
/* ZV03082007 - video_screen_get_vblank() doesn't work for Captain America, as it expects
|
/* ZV03082007 - video_screen_get_vblank() doesn't work for Captain America, as it expects
|
||||||
that this bit is NOT set in rows 0-7. */
|
that this bit is NOT set in rows 0-7. */
|
||||||
vblank = video_screen_get_vpos(machine->primary_screen) > machine->screen[0].visarea.max_y;
|
vblank = video_screen_get_vpos(machine->primary_screen) > video_screen_get_visible_area(machine->primary_screen)->max_y;
|
||||||
if (vblank)
|
if (vblank)
|
||||||
return 0xffffff80 | 0x1 | 0x10; /* Assume VBL takes priority over possible raster/lightgun irq */
|
return 0xffffff80 | 0x1 | 0x10; /* Assume VBL takes priority over possible raster/lightgun irq */
|
||||||
|
|
||||||
|
@ -307,8 +307,8 @@ INPUT_PORTS_END
|
|||||||
static VIDEO_START( dgpix )
|
static VIDEO_START( dgpix )
|
||||||
{
|
{
|
||||||
vram = auto_malloc(0x40000*2);
|
vram = auto_malloc(0x40000*2);
|
||||||
bitmaps[0] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
bitmaps[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
bitmaps[1] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
bitmaps[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VIDEO_UPDATE( dgpix )
|
static VIDEO_UPDATE( dgpix )
|
||||||
|
@ -192,7 +192,7 @@ static VIDEO_START( dleuro )
|
|||||||
{
|
{
|
||||||
VIDEO_START_CALL(dlair);
|
VIDEO_START_CALL(dlair);
|
||||||
|
|
||||||
overlay_bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
|
overlay_bitmap = auto_bitmap_alloc(video_screen_get_width(machine->primary_screen), video_screen_get_height(machine->primary_screen), BITMAP_FORMAT_INDEXED16);
|
||||||
fillbitmap(overlay_bitmap, 8, NULL);
|
fillbitmap(overlay_bitmap, 8, NULL);
|
||||||
overlay_texture = render_texture_alloc(NULL, NULL);
|
overlay_texture = render_texture_alloc(NULL, NULL);
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ static VIDEO_UPDATE( dleuro )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update the overlay */
|
/* update the overlay */
|
||||||
render_texture_set_bitmap(overlay_texture, overlay_bitmap, &screen->machine->screen[0].visarea, 0, TEXFORMAT_PALETTE16);
|
render_texture_set_bitmap(overlay_texture, overlay_bitmap, video_screen_get_visible_area(screen), 0, TEXFORMAT_PALETTE16);
|
||||||
|
|
||||||
/* get the current video and update the bitmap if different */
|
/* get the current video and update the bitmap if different */
|
||||||
seqid = laserdisc_get_video(discinfo, &vidbitmap);
|
seqid = laserdisc_get_video(discinfo, &vidbitmap);
|
||||||
|
@ -4068,9 +4068,9 @@ static MACHINE_DRIVER_START( htengoku )
|
|||||||
|
|
||||||
MDRV_PALETTE_LENGTH(16*256)
|
MDRV_PALETTE_LENGTH(16*256)
|
||||||
|
|
||||||
|
MDRV_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
|
||||||
MDRV_VIDEO_START(htengoku)
|
MDRV_VIDEO_START(htengoku)
|
||||||
MDRV_VIDEO_UPDATE(ddenlovr)
|
MDRV_VIDEO_UPDATE(htengoku)
|
||||||
MDRV_VIDEO_EOF(htengoku)
|
|
||||||
|
|
||||||
/* sound hardware */
|
/* sound hardware */
|
||||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||||
|
@ -69,8 +69,7 @@ AH
|
|||||||
|
|
||||||
#define SET_VISIBLE_AREA(_x_,_y_) \
|
#define SET_VISIBLE_AREA(_x_,_y_) \
|
||||||
{ \
|
{ \
|
||||||
screen_state *state = &machine->screen[0]; \
|
rectangle visarea = *video_screen_get_visible_area(machine->primary_screen); \
|
||||||
rectangle visarea = state->visarea; \
|
|
||||||
visarea.min_x = 0; \
|
visarea.min_x = 0; \
|
||||||
visarea.max_x = _x_-1; \
|
visarea.max_x = _x_-1; \
|
||||||
visarea.min_y = 0; \
|
visarea.min_y = 0; \
|
||||||
|
@ -70,7 +70,9 @@ static WRITE16_HANDLER( fuuki16_vregs_w )
|
|||||||
UINT16 new_data = COMBINE_DATA(&fuuki16_vregs[offset]);
|
UINT16 new_data = COMBINE_DATA(&fuuki16_vregs[offset]);
|
||||||
if ((offset == 0x1c/2) && old_data != new_data)
|
if ((offset == 0x1c/2) && old_data != new_data)
|
||||||
{
|
{
|
||||||
timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, new_data, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(machine->primary_screen));
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
attotime period = video_screen_get_frame_period(machine->primary_screen);
|
||||||
|
timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, new_data, visarea->max_x + 1), 0, period);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +532,7 @@ static TIMER_CALLBACK( level_1_interrupt_callback )
|
|||||||
static TIMER_CALLBACK( vblank_interrupt_callback )
|
static TIMER_CALLBACK( vblank_interrupt_callback )
|
||||||
{
|
{
|
||||||
cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ
|
cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
timer_set(video_screen_get_time_until_vblank_start(machine->primary_screen), NULL, 0, vblank_interrupt_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -550,9 +552,11 @@ static MACHINE_START( fuuki16 )
|
|||||||
|
|
||||||
static MACHINE_RESET( fuuki16 )
|
static MACHINE_RESET( fuuki16 )
|
||||||
{
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, 248, 0), NULL, 0, level_1_interrupt_callback);
|
timer_set(video_screen_get_time_until_pos(machine->primary_screen, 248, 0), NULL, 0, level_1_interrupt_callback);
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
timer_set(video_screen_get_time_until_vblank_start(machine->primary_screen), NULL, 0, vblank_interrupt_callback);
|
||||||
timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, machine->screen[0].visarea.max_x + 1), 0);
|
timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, visarea->max_x + 1), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,7 +259,9 @@ static WRITE32_HANDLER( fuuki32_vregs_w )
|
|||||||
COMBINE_DATA(&fuuki32_vregs[offset]);
|
COMBINE_DATA(&fuuki32_vregs[offset]);
|
||||||
if (offset == 0x1c/4)
|
if (offset == 0x1c/4)
|
||||||
{
|
{
|
||||||
timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, fuuki32_vregs[0x1c/4]>>16, Machine->screen[0].visarea.max_x + 1), 0, video_screen_get_frame_period(machine->primary_screen));
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
attotime period = video_screen_get_frame_period(machine->primary_screen);
|
||||||
|
timer_adjust_periodic(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, fuuki32_vregs[0x1c/4]>>16, visarea->max_x + 1), 0, period);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -556,7 +558,7 @@ static TIMER_CALLBACK( level_1_interrupt_callback )
|
|||||||
static TIMER_CALLBACK( vblank_interrupt_callback )
|
static TIMER_CALLBACK( vblank_interrupt_callback )
|
||||||
{
|
{
|
||||||
cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ
|
cpunum_set_input_line(machine, 0, 3, PULSE_LINE); // VBlank IRQ
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
timer_set(video_screen_get_time_until_vblank_start(machine->primary_screen), NULL, 0, vblank_interrupt_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -576,9 +578,11 @@ static MACHINE_START( fuuki32 )
|
|||||||
|
|
||||||
static MACHINE_RESET( fuuki32 )
|
static MACHINE_RESET( fuuki32 )
|
||||||
{
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, 248, 0), NULL, 0, level_1_interrupt_callback);
|
timer_set(video_screen_get_time_until_pos(machine->primary_screen, 248, 0), NULL, 0, level_1_interrupt_callback);
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
timer_set(video_screen_get_time_until_vblank_start(machine->primary_screen), NULL, 0, vblank_interrupt_callback);
|
||||||
timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, machine->screen[0].visarea.max_x + 1), 0);
|
timer_adjust_oneshot(raster_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, visarea->max_x + 1), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ static UINT8 read_port_and_t0(int port)
|
|||||||
static UINT8 read_port_and_t0_and_hblank(running_machine *machine, int port)
|
static UINT8 read_port_and_t0_and_hblank(running_machine *machine, int port)
|
||||||
{
|
{
|
||||||
UINT8 val = read_port_and_t0(port);
|
UINT8 val = read_port_and_t0(port);
|
||||||
if (video_screen_get_hpos(machine->primary_screen) < (machine->screen[0].width * 9 / 10))
|
if (video_screen_get_hpos(machine->primary_screen) < (video_screen_get_width(machine->primary_screen) * 9 / 10))
|
||||||
val ^= 0x04;
|
val ^= 0x04;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -369,16 +369,18 @@ static void K037122_tile_update(running_machine *machine, int chip)
|
|||||||
|
|
||||||
static void K037122_tile_draw(int chip, bitmap_t *bitmap, const rectangle *cliprect)
|
static void K037122_tile_draw(int chip, bitmap_t *bitmap, const rectangle *cliprect)
|
||||||
{
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
|
||||||
|
|
||||||
if (K037122_reg[chip][0xc] & 0x10000)
|
if (K037122_reg[chip][0xc] & 0x10000)
|
||||||
{
|
{
|
||||||
tilemap_set_scrolldx(K037122_layer[chip][1], Machine->screen[0].visarea.min_x, Machine->screen[0].visarea.min_x);
|
tilemap_set_scrolldx(K037122_layer[chip][1], visarea->min_x, visarea->min_x);
|
||||||
tilemap_set_scrolldy(K037122_layer[chip][1], Machine->screen[0].visarea.min_y, Machine->screen[0].visarea.min_y);
|
tilemap_set_scrolldy(K037122_layer[chip][1], visarea->min_y, visarea->min_y);
|
||||||
tilemap_draw(bitmap, cliprect, K037122_layer[chip][1], 0,0);
|
tilemap_draw(bitmap, cliprect, K037122_layer[chip][1], 0,0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tilemap_set_scrolldx(K037122_layer[chip][0], Machine->screen[0].visarea.min_x, Machine->screen[0].visarea.min_x);
|
tilemap_set_scrolldx(K037122_layer[chip][0], visarea->min_x, visarea->min_x);
|
||||||
tilemap_set_scrolldy(K037122_layer[chip][0], Machine->screen[0].visarea.min_y, Machine->screen[0].visarea.min_y);
|
tilemap_set_scrolldy(K037122_layer[chip][0], visarea->min_y, visarea->min_y);
|
||||||
tilemap_draw(bitmap, cliprect, K037122_layer[chip][0], 0,0);
|
tilemap_draw(bitmap, cliprect, K037122_layer[chip][0], 0,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ static WRITE16_HANDLER( igs_blit_flags_w )
|
|||||||
int gfx_size = memory_region_length(REGION_GFX1);
|
int gfx_size = memory_region_length(REGION_GFX1);
|
||||||
int gfx2_size = memory_region_length(REGION_GFX2);
|
int gfx2_size = memory_region_length(REGION_GFX2);
|
||||||
|
|
||||||
rectangle clip = Machine->screen[0].visarea;
|
const rectangle *clip = video_screen_get_visible_area(machine->primary_screen);
|
||||||
|
|
||||||
COMBINE_DATA(&blitter.flags);
|
COMBINE_DATA(&blitter.flags);
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ static WRITE16_HANDLER( igs_blit_flags_w )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// plot it
|
// plot it
|
||||||
if (x >= clip.min_x && x <= clip.max_x && y >= clip.min_y && y <= clip.max_y)
|
if (x >= clip->min_x && x <= clip->max_x && y >= clip->min_y && y <= clip->max_y)
|
||||||
{
|
{
|
||||||
if (clear) dest[x + y * 512] = clear_pen;
|
if (clear) dest[x + y * 512] = clear_pen;
|
||||||
else if (pen != trans_pen) dest[x + y * 512] = pen | pen_hi;
|
else if (pen != trans_pen) dest[x + y * 512] = pen | pen_hi;
|
||||||
|
@ -143,7 +143,7 @@ static VIDEO_START(igs_majhong)
|
|||||||
static VIDEO_UPDATE(igs_majhong)
|
static VIDEO_UPDATE(igs_majhong)
|
||||||
{
|
{
|
||||||
//??????????
|
//??????????
|
||||||
fillbitmap(bitmap,get_black_pen(screen->machine),&screen->machine->screen[0].visarea);
|
fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
|
||||||
|
|
||||||
//??????
|
//??????
|
||||||
tilemap_draw(bitmap,cliprect,igs_bg_tilemap,0,0);
|
tilemap_draw(bitmap,cliprect,igs_bg_tilemap,0,0);
|
||||||
|
@ -502,15 +502,18 @@ static TILE_GET_INFO( get_tile_info )
|
|||||||
|
|
||||||
static VIDEO_START( laserbat )
|
static VIDEO_START( laserbat )
|
||||||
{
|
{
|
||||||
|
int screen_width = video_screen_get_width(machine->primary_screen);
|
||||||
|
int screen_height = video_screen_get_height(machine->primary_screen);
|
||||||
|
|
||||||
bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
|
bg_tilemap = tilemap_create(get_tile_info,tilemap_scan_rows,8,8,32,32);
|
||||||
|
|
||||||
videoram = (UINT8 *)auto_malloc(0x400);
|
videoram = (UINT8 *)auto_malloc(0x400);
|
||||||
colorram = (UINT8 *)auto_malloc(0x400);
|
colorram = (UINT8 *)auto_malloc(0x400);
|
||||||
|
|
||||||
/* configure the S2636 chips */
|
/* configure the S2636 chips */
|
||||||
s2636_0 = s2636_config(s2636_0_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
|
s2636_0 = s2636_config(s2636_0_ram, screen_height, screen_width, 0, -19);
|
||||||
s2636_1 = s2636_config(s2636_1_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
|
s2636_1 = s2636_config(s2636_1_ram, screen_height, screen_width, 0, -19);
|
||||||
s2636_2 = s2636_config(s2636_2_ram, machine->screen[0].height, machine->screen[0].width, 0, -19);
|
s2636_2 = s2636_config(s2636_2_ram, screen_height, screen_width, 0, -19);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VIDEO_UPDATE( laserbat )
|
static VIDEO_UPDATE( laserbat )
|
||||||
|
@ -78,7 +78,7 @@ static VIDEO_START( lastfght )
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
lastfght_bitmap[i] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
lastfght_bitmap[i] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
colorram = auto_malloc(256*3);
|
colorram = auto_malloc(256*3);
|
||||||
}
|
}
|
||||||
|
@ -258,8 +258,7 @@ static UINT32 hit_check_x,hit_check_y;
|
|||||||
|
|
||||||
#define CRT_MODE(_x_,_y_,_flip_) \
|
#define CRT_MODE(_x_,_y_,_flip_) \
|
||||||
{ \
|
{ \
|
||||||
screen_state *state = &Machine->screen[0]; \
|
rectangle visarea = *video_screen_get_visible_area(machine->primary_screen); \
|
||||||
rectangle visarea = state->visarea; \
|
|
||||||
visarea.min_x = 0; \
|
visarea.min_x = 0; \
|
||||||
visarea.max_x = _x_-1; \
|
visarea.max_x = _x_-1; \
|
||||||
visarea.min_y = 0; \
|
visarea.min_y = 0; \
|
||||||
|
@ -69,14 +69,14 @@ static TIMER_CALLBACK( m107_scanline_interrupt )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* VBLANK interrupt */
|
/* VBLANK interrupt */
|
||||||
else if (scanline == machine->screen[0].visarea.max_y + 1)
|
else if (scanline == video_screen_get_visible_area(machine->primary_screen)->max_y + 1)
|
||||||
{
|
{
|
||||||
video_screen_update_partial(machine->primary_screen, scanline);
|
video_screen_update_partial(machine->primary_screen, scanline);
|
||||||
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M107_IRQ_0);
|
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M107_IRQ_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust for next scanline */
|
/* adjust for next scanline */
|
||||||
if (++scanline >= machine->screen[0].height)
|
if (++scanline >= video_screen_get_height(machine->primary_screen))
|
||||||
scanline = 0;
|
scanline = 0;
|
||||||
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ static TIMER_CALLBACK( m72_scanline_interrupt )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* adjust for next scanline */
|
/* adjust for next scanline */
|
||||||
if (++scanline >= machine->screen[0].height)
|
if (++scanline >= video_screen_get_height(machine->primary_screen))
|
||||||
scanline = 0;
|
scanline = 0;
|
||||||
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||||
}
|
}
|
||||||
|
@ -249,14 +249,14 @@ static TIMER_CALLBACK( m92_scanline_interrupt )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* VBLANK interrupt */
|
/* VBLANK interrupt */
|
||||||
else if (scanline == machine->screen[0].visarea.max_y + 1)
|
else if (scanline == video_screen_get_visible_area(machine->primary_screen)->max_y + 1)
|
||||||
{
|
{
|
||||||
video_screen_update_partial(machine->primary_screen, scanline);
|
video_screen_update_partial(machine->primary_screen, scanline);
|
||||||
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M92_IRQ_0);
|
cpunum_set_input_line_and_vector(machine, 0, 0, HOLD_LINE, M92_IRQ_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust for next scanline */
|
/* adjust for next scanline */
|
||||||
if (++scanline >= machine->screen[0].height)
|
if (++scanline >= video_screen_get_height(machine->primary_screen))
|
||||||
scanline = 0;
|
scanline = 0;
|
||||||
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||||
}
|
}
|
||||||
|
@ -456,9 +456,9 @@ static VIDEO_START( marinedt )
|
|||||||
tilemap_set_scrolldx(tx_tilemap, 0, 4*8);
|
tilemap_set_scrolldx(tx_tilemap, 0, 4*8);
|
||||||
tilemap_set_scrolldy(tx_tilemap, 0, -4*8);
|
tilemap_set_scrolldy(tx_tilemap, 0, -4*8);
|
||||||
|
|
||||||
tile = auto_bitmap_alloc(32 * 8, 32 * 8, machine->screen[0].format);
|
tile = auto_bitmap_alloc(32 * 8, 32 * 8, video_screen_get_format(machine->primary_screen));
|
||||||
obj1 = auto_bitmap_alloc(32,32,machine->screen[0].format);
|
obj1 = auto_bitmap_alloc(32,32,video_screen_get_format(machine->primary_screen));
|
||||||
obj2 = auto_bitmap_alloc(32,32,machine->screen[0].format);
|
obj2 = auto_bitmap_alloc(32,32,video_screen_get_format(machine->primary_screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,10 +104,10 @@ static bitmap_t * tmpbitmaps[4];
|
|||||||
|
|
||||||
static VIDEO_START( mazerbla )
|
static VIDEO_START( mazerbla )
|
||||||
{
|
{
|
||||||
tmpbitmaps[0] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
tmpbitmaps[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
tmpbitmaps[1] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
tmpbitmaps[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
tmpbitmaps[2] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
tmpbitmaps[2] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
tmpbitmaps[3] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
tmpbitmaps[3] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -2567,7 +2567,7 @@ VIDEO_START(megadriv)
|
|||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
render_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
render_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
megadrive_vdp_vram = auto_malloc(0x10000);
|
megadrive_vdp_vram = auto_malloc(0x10000);
|
||||||
megadrive_vdp_cram = auto_malloc(0x80);
|
megadrive_vdp_cram = auto_malloc(0x80);
|
||||||
|
@ -525,7 +525,7 @@ static TIMER_CALLBACK( invasn_gun_callback )
|
|||||||
|
|
||||||
/* generate another interrupt on the next scanline while we are within the BEAM_DY */
|
/* generate another interrupt on the next scanline while we are within the BEAM_DY */
|
||||||
beamy++;
|
beamy++;
|
||||||
if (beamy <= machine->screen[0].visarea.max_y && beamy <= gun_y[player] + BEAM_DY)
|
if (beamy <= video_screen_get_visible_area(machine->primary_screen)->max_y && beamy <= gun_y[player] + BEAM_DY)
|
||||||
timer_adjust_oneshot(gun_timer[player], video_screen_get_time_until_pos(machine->primary_screen, beamy, MAX(0, gun_x[player] - BEAM_DX)), player);
|
timer_adjust_oneshot(gun_timer[player], video_screen_get_time_until_pos(machine->primary_screen, beamy, MAX(0, gun_x[player] - BEAM_DX)), player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ static WRITE32_HANDLER( invasn_gun_w )
|
|||||||
UINT8 pmask = 0x04 << player;
|
UINT8 pmask = 0x04 << player;
|
||||||
if (((old_control ^ gun_control) & pmask) != 0 && (gun_control & pmask) == 0)
|
if (((old_control ^ gun_control) & pmask) != 0 && (gun_control & pmask) == 0)
|
||||||
{
|
{
|
||||||
const rectangle *visarea = &Machine->screen[0].visarea;
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
static const char *const names[2][2] =
|
static const char *const names[2][2] =
|
||||||
{
|
{
|
||||||
{ "GUNX1", "GUNY1" },
|
{ "GUNX1", "GUNY1" },
|
||||||
|
@ -205,7 +205,7 @@ static VIDEO_START(mlanding)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<8;i++)
|
for (i=0;i<8;i++)
|
||||||
ml_bitmap[i] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
ml_bitmap[i] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VIDEO_UPDATE(mlanding)
|
static VIDEO_UPDATE(mlanding)
|
||||||
|
@ -60,19 +60,21 @@ static VIDEO_START( mogura )
|
|||||||
|
|
||||||
static VIDEO_UPDATE( mogura )
|
static VIDEO_UPDATE( mogura )
|
||||||
{
|
{
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
/* tilemap layout is a bit strange ... */
|
/* tilemap layout is a bit strange ... */
|
||||||
rectangle clip;
|
rectangle clip;
|
||||||
clip.min_x = screen->machine->screen[0].visarea.min_x;
|
clip.min_x = visarea->min_x;
|
||||||
clip.max_x = 256-1;
|
clip.max_x = 256-1;
|
||||||
clip.min_y = screen->machine->screen[0].visarea.min_y;
|
clip.min_y = visarea->min_y;
|
||||||
clip.max_y = screen->machine->screen[0].visarea.max_y;
|
clip.max_y = visarea->max_y;
|
||||||
tilemap_set_scrollx(mogura_tilemap,0, 256);
|
tilemap_set_scrollx(mogura_tilemap,0, 256);
|
||||||
tilemap_draw(bitmap,&clip,mogura_tilemap,0,0);
|
tilemap_draw(bitmap,&clip,mogura_tilemap,0,0);
|
||||||
|
|
||||||
clip.min_x = 256;
|
clip.min_x = 256;
|
||||||
clip.max_x = 512-1;
|
clip.max_x = 512-1;
|
||||||
clip.min_y = screen->machine->screen[0].visarea.min_y;
|
clip.min_y = visarea->min_y;
|
||||||
clip.max_y = screen->machine->screen[0].visarea.max_y;
|
clip.max_y = visarea->max_y;
|
||||||
tilemap_set_scrollx(mogura_tilemap,0, -128);
|
tilemap_set_scrollx(mogura_tilemap,0, -128);
|
||||||
tilemap_draw(bitmap,&clip,mogura_tilemap,0,0);
|
tilemap_draw(bitmap,&clip,mogura_tilemap,0,0);
|
||||||
|
|
||||||
|
@ -342,8 +342,8 @@ static MACHINE_START( namcofl )
|
|||||||
|
|
||||||
static MACHINE_RESET( namcofl )
|
static MACHINE_RESET( namcofl )
|
||||||
{
|
{
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 3, 0), NULL, 0, network_interrupt_callback);
|
timer_set(video_screen_get_time_until_pos(machine->primary_screen, video_screen_get_visible_area(machine->primary_screen)->max_y + 3, 0), NULL, 0, network_interrupt_callback);
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
timer_set(video_screen_get_time_until_pos(machine->primary_screen, video_screen_get_visible_area(machine->primary_screen)->max_y + 1, 0), NULL, 0, vblank_interrupt_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ static VIDEO_START(rabbit)
|
|||||||
tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
|
||||||
tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
|
||||||
tilemap_set_transparent_pen(rabbit_tilemap[3],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[3],0x0);
|
||||||
rabbit_sprite_bitmap = auto_bitmap_alloc(0x1000,0x1000,machine->screen[0].format);
|
rabbit_sprite_bitmap = auto_bitmap_alloc(0x1000,0x1000,video_screen_get_format(machine->primary_screen));
|
||||||
rabbit_sprite_clip.min_x = 0;
|
rabbit_sprite_clip.min_x = 0;
|
||||||
rabbit_sprite_clip.max_x = 0x1000-1;
|
rabbit_sprite_clip.max_x = 0x1000-1;
|
||||||
rabbit_sprite_clip.min_y = 0;
|
rabbit_sprite_clip.min_y = 0;
|
||||||
@ -1144,7 +1144,7 @@ static VIDEO_START(tmmjprd)
|
|||||||
tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[1],0x0);
|
||||||
tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[2],0x0);
|
||||||
tilemap_set_transparent_pen(rabbit_tilemap[3],0x0);
|
tilemap_set_transparent_pen(rabbit_tilemap[3],0x0);
|
||||||
rabbit_sprite_bitmap = auto_bitmap_alloc(0x1000,0x1000,machine->screen[0].format);
|
rabbit_sprite_bitmap = auto_bitmap_alloc(0x1000,0x1000,video_screen_get_format(machine->primary_screen));
|
||||||
rabbit_sprite_clip.min_x = 0;
|
rabbit_sprite_clip.min_x = 0;
|
||||||
rabbit_sprite_clip.max_x = 0x1000-1;
|
rabbit_sprite_clip.max_x = 0x1000-1;
|
||||||
rabbit_sprite_clip.min_y = 0;
|
rabbit_sprite_clip.min_y = 0;
|
||||||
|
@ -102,7 +102,7 @@ static VIDEO_UPDATE(sbowling)
|
|||||||
|
|
||||||
static VIDEO_START(sbowling)
|
static VIDEO_START(sbowling)
|
||||||
{
|
{
|
||||||
tmpbitmap = auto_bitmap_alloc(32*8,32*8,machine->screen[0].format);
|
tmpbitmap = auto_bitmap_alloc(32*8,32*8,video_screen_get_format(machine->primary_screen));
|
||||||
sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
sb_tilemap = tilemap_create(get_sb_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ static TIMER_CALLBACK( scanline_callback )
|
|||||||
DAC_data_w(0, (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
|
DAC_data_w(0, (videoram[0x380 + 0x11] & (scanline >> 2)) ? 255 : 0);
|
||||||
|
|
||||||
/* on the VBLANK, read the pot and schedule an interrupt time for it */
|
/* on the VBLANK, read the pot and schedule an interrupt time for it */
|
||||||
if (scanline == machine->screen[0].visarea.max_y + 1)
|
if (scanline == video_screen_get_visible_area(machine->primary_screen)->max_y + 1)
|
||||||
{
|
{
|
||||||
UINT8 potvalue = readinputportbytag("PADDLE");
|
UINT8 potvalue = readinputportbytag("PADDLE");
|
||||||
timer_adjust_oneshot(pot_timer, video_screen_get_time_until_pos(machine->primary_screen, 72 + (potvalue / 2), (potvalue % 2) * 128), 0);
|
timer_adjust_oneshot(pot_timer, video_screen_get_time_until_pos(machine->primary_screen, 72 + (potvalue / 2), (potvalue % 2) * 128), 0);
|
||||||
@ -131,7 +131,7 @@ static TIMER_CALLBACK( scanline_callback )
|
|||||||
|
|
||||||
/* call us back in 4 scanlines */
|
/* call us back in 4 scanlines */
|
||||||
scanline += 4;
|
scanline += 4;
|
||||||
if (scanline >= machine->screen[0].height)
|
if (scanline >= video_screen_get_height(machine->primary_screen))
|
||||||
scanline = 0;
|
scanline = 0;
|
||||||
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ static WRITE8_HANDLER( coincount_w )
|
|||||||
static READ8_HANDLER( sync_r )
|
static READ8_HANDLER( sync_r )
|
||||||
{
|
{
|
||||||
int hpos = video_screen_get_hpos(machine->primary_screen);
|
int hpos = video_screen_get_hpos(machine->primary_screen);
|
||||||
sync2_value = (hpos >= 128 && hpos <= machine->screen[0].visarea.max_x);
|
sync2_value = (hpos >= 128 && hpos <= video_screen_get_visible_area(machine->primary_screen)->max_x);
|
||||||
return video_screen_get_vpos(machine->primary_screen);
|
return video_screen_get_vpos(machine->primary_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ static void *start_vdp(running_machine *machine, int type)
|
|||||||
memset(chip->sprite_renderline,0x00,256+32);
|
memset(chip->sprite_renderline,0x00,256+32);
|
||||||
|
|
||||||
chip->writemode = 0;
|
chip->writemode = 0;
|
||||||
chip->r_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
chip->r_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
chip->sms_scanline_timer = timer_alloc(sms_scanline_timer_callback, chip);
|
chip->sms_scanline_timer = timer_alloc(sms_scanline_timer_callback, chip);
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ static TIMER_CALLBACK( scanline_callback )
|
|||||||
case 65:
|
case 65:
|
||||||
case 129:
|
case 129:
|
||||||
case 193:
|
case 193:
|
||||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, scanline, machine->screen[0].visarea.max_x + 1), NULL, 0, irq2_gen);
|
timer_set(video_screen_get_time_until_pos(machine->primary_screen, scanline, video_screen_get_visible_area(machine->primary_screen)->max_x + 1), NULL, 0, irq2_gen);
|
||||||
next_scanline = scanline + 1;
|
next_scanline = scanline + 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -72,6 +72,12 @@ static void alpha_row_update(const device_config *screen, int scanline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static WRITE16_HANDLER( skullxbo_halt_until_hblank_0_w )
|
||||||
|
{
|
||||||
|
atarigen_halt_until_hblank_0(machine->primary_screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static MACHINE_RESET( skullxbo )
|
static MACHINE_RESET( skullxbo )
|
||||||
{
|
{
|
||||||
atarigen_eeprom_reset();
|
atarigen_eeprom_reset();
|
||||||
@ -120,7 +126,7 @@ static WRITE16_HANDLER( skullxbo_mobwr_w )
|
|||||||
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
|
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
|
||||||
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
AM_RANGE(0x000000, 0x07ffff) AM_ROM
|
||||||
AM_RANGE(0xff0000, 0xff07ff) AM_WRITE(skullxbo_mobmsb_w)
|
AM_RANGE(0xff0000, 0xff07ff) AM_WRITE(skullxbo_mobmsb_w)
|
||||||
AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(atarigen_halt_until_hblank_0_w)
|
AM_RANGE(0xff0800, 0xff0bff) AM_WRITE(skullxbo_halt_until_hblank_0_w)
|
||||||
AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE(atarigen_eeprom_enable_w)
|
AM_RANGE(0xff0c00, 0xff0fff) AM_WRITE(atarigen_eeprom_enable_w)
|
||||||
AM_RANGE(0xff1000, 0xff13ff) AM_WRITE(atarigen_video_int_ack_w)
|
AM_RANGE(0xff1000, 0xff13ff) AM_WRITE(atarigen_video_int_ack_w)
|
||||||
AM_RANGE(0xff1400, 0xff17ff) AM_WRITE(atarigen_sound_w)
|
AM_RANGE(0xff1400, 0xff17ff) AM_WRITE(atarigen_sound_w)
|
||||||
|
@ -441,8 +441,8 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
static VIDEO_START(sliver)
|
static VIDEO_START(sliver)
|
||||||
{
|
{
|
||||||
sliver_bitmap_bg = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
sliver_bitmap_bg = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
sliver_bitmap_fg = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
sliver_bitmap_fg = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VIDEO_UPDATE(sliver)
|
static VIDEO_UPDATE(sliver)
|
||||||
|
@ -67,6 +67,7 @@ static VIDEO_UPDATE( srmp5 )
|
|||||||
UINT16 *sprite_list=sprram;
|
UINT16 *sprite_list=sprram;
|
||||||
UINT16 *sprite_list_end=&sprram[0x1000]; //guess
|
UINT16 *sprite_list_end=&sprram[0x1000]; //guess
|
||||||
UINT8 *pixels=(UINT8 *)tileram;
|
UINT8 *pixels=(UINT8 *)tileram;
|
||||||
|
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||||
|
|
||||||
fillbitmap(bitmap,0,cliprect);
|
fillbitmap(bitmap,0,cliprect);
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ static VIDEO_UPDATE( srmp5 )
|
|||||||
|
|
||||||
if(pen)
|
if(pen)
|
||||||
{
|
{
|
||||||
if(xb+xs<=screen->machine->screen[0].visarea.max_x && xb+xs>=screen->machine->screen[0].visarea.min_x && yb+ys<=screen->machine->screen[0].visarea.max_y && yb+ys>=screen->machine->screen[0].visarea.min_y )
|
if(xb+xs<=visarea->max_x && xb+xs>=visarea->min_x && yb+ys<=visarea->max_y && yb+ys>=visarea->min_y )
|
||||||
{
|
{
|
||||||
UINT32 pixdata=paletteram32[pen+((sprite_sublist[SPRITE_PALETTE]&0xff)<<8)];
|
UINT32 pixdata=paletteram32[pen+((sprite_sublist[SPRITE_PALETTE]&0xff)<<8)];
|
||||||
*BITMAP_ADDR32(bitmap, yb+ys, xb+xs) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19);
|
*BITMAP_ADDR32(bitmap, yb+ys, xb+xs) = ((pixdata&0x7c00)>>7) | ((pixdata&0x3e0)<<6) | ((pixdata&0x1f)<<19);
|
||||||
|
@ -41,8 +41,10 @@ static emu_timer *setup_gun_timer;
|
|||||||
|
|
||||||
INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
|
INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
|
||||||
{
|
{
|
||||||
*x = (((readinputport(4 + player * 2) & 0xff) * (machine->screen[0].visarea.max_x - machine->screen[0].visarea.min_x)) >> 8) + machine->screen[0].visarea.min_x;
|
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||||
*y = (((readinputport(5 + player * 2) & 0xff) * (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y)) >> 8) + machine->screen[0].visarea.min_y;
|
|
||||||
|
*x = (((readinputport(4 + player * 2) & 0xff) * (visarea->max_x - visarea->min_x)) >> 8) + visarea->min_x;
|
||||||
|
*y = (((readinputport(5 + player * 2) & 0xff) * (visarea->max_y - visarea->min_y)) >> 8) + visarea->min_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ static VIDEO_START( tmaster )
|
|||||||
{
|
{
|
||||||
for (buffer = 0; buffer < 2; buffer++)
|
for (buffer = 0; buffer < 2; buffer++)
|
||||||
{
|
{
|
||||||
tmaster_bitmap[layer][buffer] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
tmaster_bitmap[layer][buffer] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
bitmap_fill(tmaster_bitmap[layer][buffer], NULL, 0xff);
|
bitmap_fill(tmaster_bitmap[layer][buffer], NULL, 0xff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,8 @@ static bitmap_t* render_bitmap;
|
|||||||
static WRITE16_HANDLER(wheelfir_blit_w)
|
static WRITE16_HANDLER(wheelfir_blit_w)
|
||||||
{
|
{
|
||||||
//wheelfir_blitdata[offset]=data;
|
//wheelfir_blitdata[offset]=data;
|
||||||
|
int width = video_screen_get_width(machine->primary_screen);
|
||||||
|
int height = video_screen_get_height(machine->primary_screen);
|
||||||
int vpage=0;
|
int vpage=0;
|
||||||
COMBINE_DATA(&wheelfir_blitdata[offset]);
|
COMBINE_DATA(&wheelfir_blitdata[offset]);
|
||||||
|
|
||||||
@ -263,7 +265,7 @@ static WRITE16_HANDLER(wheelfir_blit_w)
|
|||||||
pix = rom[offs];
|
pix = rom[offs];
|
||||||
|
|
||||||
|
|
||||||
if(pix && destx >0 && desty >0 && destx<Machine->screen[0].width && desty <Machine->screen[0].height)
|
if(pix && destx >0 && desty >0 && destx<width && desty <height)
|
||||||
*BITMAP_ADDR16(wheelfir_tmp_bitmap[vpage], desty, destx) = pix;
|
*BITMAP_ADDR16(wheelfir_tmp_bitmap[vpage], desty, destx) = pix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,11 +277,11 @@ static WRITE16_HANDLER(wheelfir_blit_w)
|
|||||||
static VIDEO_START(wheelfir)
|
static VIDEO_START(wheelfir)
|
||||||
{
|
{
|
||||||
|
|
||||||
wheelfir_tmp_bitmap[0] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
wheelfir_tmp_bitmap[0] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
wheelfir_tmp_bitmap[1] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
wheelfir_tmp_bitmap[1] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
wheelfir_tmp_bitmap[2] = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
wheelfir_tmp_bitmap[2] = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
render_bitmap = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
render_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +306,7 @@ static VIDEO_UPDATE(wheelfir)
|
|||||||
copybitmap(bitmap, wheelfir_tmp_bitmap[2], 0, 0, 0, 0, cliprect);
|
copybitmap(bitmap, wheelfir_tmp_bitmap[2], 0, 0, 0, 0, cliprect);
|
||||||
//copybitmap_trans(bitmap, wheelfir_tmp_bitmap[1], 0, 0, 0, 0, cliprect, 0);
|
//copybitmap_trans(bitmap, wheelfir_tmp_bitmap[1], 0, 0, 0, 0, cliprect, 0);
|
||||||
copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
|
copybitmap_trans(bitmap, wheelfir_tmp_bitmap[0], 0, 0, 0, 0, cliprect, 0);
|
||||||
fillbitmap(wheelfir_tmp_bitmap[0], 0,&machine->screen[0].visarea);
|
fillbitmap(wheelfir_tmp_bitmap[0], 0,video_screen_get_visible_area(screen));
|
||||||
|
|
||||||
if ( input_code_pressed(KEYCODE_R) )
|
if ( input_code_pressed(KEYCODE_R) )
|
||||||
{
|
{
|
||||||
@ -606,7 +608,7 @@ static TIMER_CALLBACK( scanline_timer_callback )
|
|||||||
static VIDEO_EOF( wheelfir )
|
static VIDEO_EOF( wheelfir )
|
||||||
{
|
{
|
||||||
scanline_counter = -1;
|
scanline_counter = -1;
|
||||||
fillbitmap(wheelfir_tmp_bitmap[0], 0,&machine->screen[0].visarea);
|
fillbitmap(wheelfir_tmp_bitmap[0], 0,video_screen_get_visible_area(machine->primary_screen));
|
||||||
|
|
||||||
timer_adjust_oneshot(frame_timer, attotime_zero, 0);
|
timer_adjust_oneshot(frame_timer, attotime_zero, 0);
|
||||||
timer_adjust_oneshot(scanline_timer, attotime_zero, 0);
|
timer_adjust_oneshot(scanline_timer, attotime_zero, 0);
|
||||||
|
@ -306,7 +306,7 @@ static READ32_HANDLER( boardconfig_r )
|
|||||||
111----- rev=5
|
111----- rev=5
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if( Machine->screen[0].height == 1024 )
|
if( video_screen_get_height(machine->primary_screen) == 1024 )
|
||||||
{
|
{
|
||||||
return 64|32|8;
|
return 64|32|8;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ VIDEO_UPDATE( hnoridur );
|
|||||||
VIDEO_UPDATE( sprtmtch );
|
VIDEO_UPDATE( sprtmtch );
|
||||||
VIDEO_UPDATE( mjdialq2 );
|
VIDEO_UPDATE( mjdialq2 );
|
||||||
VIDEO_UPDATE( jantouki );
|
VIDEO_UPDATE( jantouki );
|
||||||
VIDEO_EOF( htengoku );
|
VIDEO_UPDATE( htengoku );
|
||||||
|
|
||||||
PALETTE_INIT( sprtmtch );
|
PALETTE_INIT( sprtmtch );
|
||||||
|
|
||||||
@ -93,5 +93,4 @@ extern UINT8 *ddenlovr_pixmap[8];
|
|||||||
|
|
||||||
VIDEO_START(ddenlovr);
|
VIDEO_START(ddenlovr);
|
||||||
VIDEO_UPDATE(ddenlovr);
|
VIDEO_UPDATE(ddenlovr);
|
||||||
VIDEO_EOF(ddenlovr);
|
|
||||||
|
|
||||||
|
@ -1425,25 +1425,26 @@ int atarigen_get_hblank(const device_config *screen)
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
atarigen_halt_until_hblank_0_w: Halts CPU 0 until the
|
atarigen_halt_until_hblank_0: Halts CPU 0 until the
|
||||||
next HBLANK.
|
next HBLANK.
|
||||||
---------------------------------------------------------------*/
|
---------------------------------------------------------------*/
|
||||||
|
|
||||||
WRITE16_HANDLER( atarigen_halt_until_hblank_0_w )
|
void atarigen_halt_until_hblank_0(const device_config *screen)
|
||||||
{
|
{
|
||||||
/* halt the CPU until the next HBLANK */
|
/* halt the CPU until the next HBLANK */
|
||||||
int hpos = video_screen_get_hpos(machine->primary_screen); /* need to support scrnum */
|
int hpos = video_screen_get_hpos(screen);
|
||||||
int hblank = machine->screen[0].width * 9 / 10;
|
int width = video_screen_get_width(screen);
|
||||||
|
int hblank = width * 9 / 10;
|
||||||
double fraction;
|
double fraction;
|
||||||
|
|
||||||
/* if we're in hblank, set up for the next one */
|
/* if we're in hblank, set up for the next one */
|
||||||
if (hpos >= hblank)
|
if (hpos >= hblank)
|
||||||
hblank += machine->screen[0].width;
|
hblank += width;
|
||||||
|
|
||||||
/* halt and set a timer to wake up */
|
/* halt and set a timer to wake up */
|
||||||
fraction = (double)(hblank - hpos) / (double)machine->screen[0].width;
|
fraction = (double)(hblank - hpos) / (double)width;
|
||||||
timer_set(double_to_attotime(attotime_to_double(video_screen_get_scan_period(machine->primary_screen)) * fraction), NULL, 0, unhalt_cpu);
|
timer_set(double_to_attotime(attotime_to_double(video_screen_get_scan_period(screen)) * fraction), NULL, 0, unhalt_cpu);
|
||||||
cpunum_set_input_line(machine, 0, INPUT_LINE_HALT, ASSERT_LINE);
|
cpunum_set_input_line(screen->machine, 0, INPUT_LINE_HALT, ASSERT_LINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ WRITE16_HANDLER( atarigen_playfield2_latched_msb_w );
|
|||||||
|
|
||||||
void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanline_func update_graphics, int frequency);
|
void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanline_func update_graphics, int frequency);
|
||||||
int atarigen_get_hblank(const device_config *screen);
|
int atarigen_get_hblank(const device_config *screen);
|
||||||
WRITE16_HANDLER( atarigen_halt_until_hblank_0_w );
|
void atarigen_halt_until_hblank_0(const device_config *screen);
|
||||||
WRITE16_HANDLER( atarigen_666_paletteram_w );
|
WRITE16_HANDLER( atarigen_666_paletteram_w );
|
||||||
WRITE16_HANDLER( atarigen_expanded_666_paletteram_w );
|
WRITE16_HANDLER( atarigen_expanded_666_paletteram_w );
|
||||||
WRITE32_HANDLER( atarigen_666_paletteram32_w );
|
WRITE32_HANDLER( atarigen_666_paletteram32_w );
|
||||||
|
@ -1254,29 +1254,26 @@ VIDEO_UPDATE( mjdialq2 )
|
|||||||
|
|
||||||
// htengoku uses the mixer chip from ddenlovr
|
// htengoku uses the mixer chip from ddenlovr
|
||||||
|
|
||||||
static bitmap_t *framebuffer;
|
|
||||||
|
|
||||||
VIDEO_START(htengoku)
|
VIDEO_START(htengoku)
|
||||||
{
|
{
|
||||||
VIDEO_START_CALL(ddenlovr);
|
VIDEO_START_CALL(ddenlovr);
|
||||||
VIDEO_START_CALL(hnoridur);
|
VIDEO_START_CALL(hnoridur);
|
||||||
framebuffer = auto_bitmap_alloc(machine->screen[0].width,machine->screen[0].height,machine->screen[0].format);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VIDEO_EOF(htengoku)
|
VIDEO_UPDATE(htengoku)
|
||||||
{
|
{
|
||||||
int layer,x,y;
|
int layer,x,y;
|
||||||
|
|
||||||
// render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c"
|
// render the layers, one by one, "dynax.c" style. Then convert the pixmaps to "ddenlovr.c"
|
||||||
// format and let VIDEO_EOF(ddenlovr) do the final compositing (priorities + palettes)
|
// format and let VIDEO_UPDATE(ddenlovr) do the final compositing (priorities + palettes)
|
||||||
for (layer = 0; layer < 4; layer++)
|
for (layer = 0; layer < 4; layer++)
|
||||||
{
|
{
|
||||||
fillbitmap(framebuffer,0,&machine->screen[0].visarea);
|
fillbitmap(bitmap,0,cliprect);
|
||||||
hanamai_copylayer( framebuffer, &machine->screen[0].visarea, layer );
|
hanamai_copylayer( bitmap, cliprect, layer );
|
||||||
|
|
||||||
for (y=0; y < 256; y++)
|
for (y=0; y < 256; y++)
|
||||||
for (x=0; x < 512; x++)
|
for (x=0; x < 512; x++)
|
||||||
ddenlovr_pixmap[3-layer][y*512+x] = (UINT8)(*BITMAP_ADDR16(framebuffer, y,x));
|
ddenlovr_pixmap[3-layer][y*512+x] = (UINT8)(*BITMAP_ADDR16(bitmap, y,x));
|
||||||
}
|
}
|
||||||
VIDEO_EOF_CALL(ddenlovr);
|
return VIDEO_UPDATE_CALL(ddenlovr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user