mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
Next batch of machine->screen[] removal
This commit is contained in:
parent
7ec1537d22
commit
19b68f421f
@ -907,7 +907,6 @@ struct _ext_inp_header
|
||||
***************************************************************************/
|
||||
|
||||
void input_port_init(running_machine *machine, const input_port_token *ipt);
|
||||
void input_port_post_init(running_machine *machine);
|
||||
const char *input_port_string_from_token(const input_port_token token);
|
||||
|
||||
input_port_entry *input_port_initialize(input_port_init_params *params, UINT32 type, const char *tag, UINT32 mask, UINT32 defval);
|
||||
|
@ -1416,7 +1416,8 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3
|
||||
for (item = target->curview->itemlist[layer]; item != NULL; item = item->next)
|
||||
if (item->element == NULL)
|
||||
{
|
||||
const screen_config *scrconfig = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, item->index)->inline_config;
|
||||
const device_config *screen = device_list_find_by_index(Machine->config->devicelist, VIDEO_SCREEN, item->index);
|
||||
const screen_config *scrconfig = screen->inline_config;
|
||||
const rectangle vectorvis = { 0, 639, 0, 479 };
|
||||
const rectangle *visarea = NULL;
|
||||
render_container *container = get_screen_container_by_index(item->index);
|
||||
@ -1426,8 +1427,8 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3
|
||||
/* we may be called very early, before Machine->visible_area is initialized; handle that case */
|
||||
if (scrconfig->type == SCREEN_TYPE_VECTOR)
|
||||
visarea = &vectorvis;
|
||||
else if (Machine->screen[item->index].visarea.max_x > Machine->screen[item->index].visarea.min_x)
|
||||
visarea = &Machine->screen[item->index].visarea;
|
||||
else if (screen->token != NULL)
|
||||
visarea = video_screen_get_visible_area(screen);
|
||||
else
|
||||
visarea = &scrconfig->visarea;
|
||||
|
||||
|
@ -48,6 +48,9 @@
|
||||
typedef struct _internal_screen_state internal_screen_state;
|
||||
struct _internal_screen_state
|
||||
{
|
||||
/* screen attributes */
|
||||
rectangle visarea; /* current visible area (HBLANK end/start, VBLANK end/start) */
|
||||
|
||||
/* textures and bitmaps */
|
||||
render_texture * texture[2]; /* 2x textures for the screen bitmap */
|
||||
bitmap_t * bitmap[2]; /* 2x bitmaps for rendering */
|
||||
@ -279,6 +282,11 @@ void video_init(running_machine *machine)
|
||||
const device_config *screen;
|
||||
const char *filename;
|
||||
|
||||
/* validate */
|
||||
assert(machine != NULL);
|
||||
assert(machine->config != NULL);
|
||||
assert(machine->config->devicelist != NULL);
|
||||
|
||||
/* request a callback upon exiting */
|
||||
add_exit_callback(machine, video_exit);
|
||||
|
||||
@ -322,7 +330,6 @@ void video_init(running_machine *machine)
|
||||
internal_state->scanline0_timer = timer_alloc(scanline0_callback, (void *)screen);
|
||||
|
||||
/* configure the screen with the default parameters */
|
||||
state->format = config->format;
|
||||
video_screen_configure(screen, config->width, config->height, &config->visarea, config->refresh);
|
||||
|
||||
/* configure the default cliparea */
|
||||
@ -373,6 +380,14 @@ void video_init(running_machine *machine)
|
||||
/* reset video statics and get out of here */
|
||||
pdrawgfx_shadow_lowpri = 0;
|
||||
|
||||
/* create a render target for snapshots */
|
||||
if (machine->primary_screen != NULL)
|
||||
{
|
||||
global.snap_target = render_target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
|
||||
assert(global.snap_target != NULL);
|
||||
render_target_set_layer_config(global.snap_target, 0);
|
||||
}
|
||||
|
||||
/* start recording movie if specified */
|
||||
filename = options_get_string(mame_options(), OPTION_MNGWRITE);
|
||||
if ((filename[0] != 0) && (machine->primary_screen != NULL))
|
||||
@ -389,6 +404,10 @@ static void video_exit(running_machine *machine)
|
||||
const device_config *screen;
|
||||
int i;
|
||||
|
||||
/* validate */
|
||||
assert(machine != NULL);
|
||||
assert(machine->config != NULL);
|
||||
|
||||
/* stop recording any movie */
|
||||
if (machine->primary_screen != NULL)
|
||||
video_movie_end_recording(machine->primary_screen);
|
||||
@ -682,7 +701,7 @@ void video_screen_configure(const device_config *screen, int width, int height,
|
||||
/* if we're too small to contain this width/height, reallocate our bitmaps and textures */
|
||||
if (width > curwidth || height > curheight)
|
||||
{
|
||||
bitmap_format screen_format = state->format;
|
||||
bitmap_format screen_format = config->format;
|
||||
|
||||
/* free what we have currently */
|
||||
if (internal_state->texture[0] != NULL)
|
||||
@ -724,7 +743,7 @@ void video_screen_configure(const device_config *screen, int width, int height,
|
||||
/* now fill in the new parameters */
|
||||
state->width = width;
|
||||
state->height = height;
|
||||
state->visarea = *visarea;
|
||||
internal_state->visarea = *visarea;
|
||||
|
||||
/* compute timing parameters */
|
||||
internal_state->frame_period = frame_period;
|
||||
@ -777,6 +796,12 @@ void video_screen_set_visarea(const device_config *screen, int min_x, int max_x,
|
||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
||||
rectangle visarea;
|
||||
|
||||
/* validate arguments */
|
||||
assert(min_x >= 0);
|
||||
assert(min_y >= 0);
|
||||
assert(min_x < max_x);
|
||||
assert(min_y < max_y);
|
||||
|
||||
visarea.min_x = min_x;
|
||||
visarea.max_x = max_x;
|
||||
visarea.min_y = min_y;
|
||||
@ -796,7 +821,10 @@ void video_screen_update_partial(const device_config *screen, int scanline)
|
||||
{
|
||||
screen_state *state = get_safe_token(screen);
|
||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
||||
rectangle clip = state->visarea;
|
||||
rectangle clip = internal_state->visarea;
|
||||
|
||||
/* validate arguments */
|
||||
assert(scanline >= 0);
|
||||
|
||||
LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%s, %d): ", screen->tag, scanline));
|
||||
|
||||
@ -900,7 +928,7 @@ int video_screen_get_vpos(const device_config *screen)
|
||||
vpos = delta / internal_state->scantime;
|
||||
|
||||
/* adjust for the fact that VBLANK starts at the bottom of the visible area */
|
||||
return (state->visarea.max_y + 1 + vpos) % state->height;
|
||||
return (internal_state->visarea.max_y + 1 + vpos) % state->height;
|
||||
}
|
||||
|
||||
|
||||
@ -940,8 +968,9 @@ int video_screen_get_hpos(const device_config *screen)
|
||||
int video_screen_get_vblank(const device_config *screen)
|
||||
{
|
||||
screen_state *state = get_safe_token(screen);
|
||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
||||
int vpos = video_screen_get_vpos(screen);
|
||||
return (vpos < state->visarea.min_y || vpos > state->visarea.max_y);
|
||||
return (vpos < internal_state->visarea.min_y || vpos > internal_state->visarea.max_y);
|
||||
}
|
||||
|
||||
|
||||
@ -953,8 +982,9 @@ int video_screen_get_vblank(const device_config *screen)
|
||||
int video_screen_get_hblank(const device_config *screen)
|
||||
{
|
||||
screen_state *state = get_safe_token(screen);
|
||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
||||
int hpos = video_screen_get_hpos(screen);
|
||||
return (hpos < state->visarea.min_x || hpos > state->visarea.max_x);
|
||||
return (hpos < internal_state->visarea.min_x || hpos > internal_state->visarea.max_x);
|
||||
}
|
||||
|
||||
|
||||
@ -987,7 +1017,8 @@ int video_screen_get_height(const device_config *screen)
|
||||
const rectangle *video_screen_get_visible_area(const device_config *screen)
|
||||
{
|
||||
screen_state *state = get_safe_token(screen);
|
||||
return &state->visarea;
|
||||
internal_screen_state *internal_state = (internal_screen_state *)state->private_data;
|
||||
return &internal_state->visarea;
|
||||
}
|
||||
|
||||
|
||||
@ -1004,8 +1035,12 @@ attotime video_screen_get_time_until_pos(const device_config *screen, int vpos,
|
||||
attoseconds_t curdelta = attotime_to_attoseconds(attotime_sub(timer_get_time(), internal_state->vblank_start_time));
|
||||
attoseconds_t targetdelta;
|
||||
|
||||
/* validate arguments */
|
||||
assert(vpos >= 0);
|
||||
assert(hpos >= 0);
|
||||
|
||||
/* since we measure time relative to VBLANK, compute the scanline offset from VBLANK */
|
||||
vpos += state->height - (state->visarea.max_y + 1);
|
||||
vpos += state->height - (internal_state->visarea.max_y + 1);
|
||||
vpos %= state->height;
|
||||
|
||||
/* compute the delta for the given X,Y position */
|
||||
@ -1196,8 +1231,8 @@ void video_screen_register_global_vbl_cb(vblank_state_changed_global_func vbl_cb
|
||||
|
||||
static DEVICE_START( video_screen )
|
||||
{
|
||||
int scrindex = device_list_index(device->machine->config->devicelist, VIDEO_SCREEN, device->tag);
|
||||
return &device->machine->screen[scrindex];
|
||||
int scrnum = device_list_index(device->machine->config->devicelist, VIDEO_SCREEN, device->tag);
|
||||
return &device->machine->screen[scrnum];
|
||||
}
|
||||
|
||||
|
||||
@ -1355,8 +1390,8 @@ static TIMER_CALLBACK( scanline_update_callback )
|
||||
|
||||
/* compute the next visible scanline */
|
||||
scanline++;
|
||||
if (scanline > state->visarea.max_y)
|
||||
scanline = state->visarea.min_y;
|
||||
if (scanline > internal_state->visarea.max_y)
|
||||
scanline = internal_state->visarea.min_y;
|
||||
timer_adjust_oneshot(internal_state->scanline_timer, video_screen_get_time_until_pos(screen, scanline, 0), scanline);
|
||||
}
|
||||
|
||||
@ -1373,6 +1408,10 @@ void video_frame_update(running_machine *machine, int debug)
|
||||
int skipped_it = global.skipping_this_frame;
|
||||
int phase = mame_get_phase(machine);
|
||||
|
||||
/* validate */
|
||||
assert(machine != NULL);
|
||||
assert(machine->config != NULL);
|
||||
|
||||
/* only render sound and video if we're in the running phase */
|
||||
if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(machine) || global.update_in_pause))
|
||||
{
|
||||
@ -1545,6 +1584,9 @@ const char *video_get_speed_text(running_machine *machine)
|
||||
static char buffer[1024];
|
||||
char *dest = buffer;
|
||||
|
||||
/* validate */
|
||||
assert(machine != NULL);
|
||||
|
||||
/* if we're paused, just display Paused */
|
||||
if (paused)
|
||||
dest += sprintf(dest, "paused");
|
||||
@ -2018,6 +2060,10 @@ void video_screen_save_snapshot(const device_config *screen, mame_file *fp)
|
||||
png_error error;
|
||||
char text[256];
|
||||
|
||||
/* validate */
|
||||
assert(screen != NULL);
|
||||
assert(fp != NULL);
|
||||
|
||||
/* create the bitmap to pass in */
|
||||
create_snapshot_bitmap(screen);
|
||||
|
||||
@ -2046,6 +2092,10 @@ void video_save_active_screen_snapshots(running_machine *machine)
|
||||
mame_file *fp;
|
||||
const device_config *screen;
|
||||
|
||||
/* validate */
|
||||
assert(machine != NULL);
|
||||
assert(machine->config != NULL);
|
||||
|
||||
/* write one snapshot per visible screen */
|
||||
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
|
||||
if (render_is_live_screen(screen))
|
||||
@ -2072,16 +2122,9 @@ static void create_snapshot_bitmap(const device_config *screen)
|
||||
INT32 width, height;
|
||||
int view_index;
|
||||
|
||||
/* lazy create snap target */
|
||||
if (global.snap_target == NULL)
|
||||
{
|
||||
global.snap_target = render_target_alloc(layout_snap, RENDER_CREATE_SINGLE_FILE | RENDER_CREATE_HIDDEN);
|
||||
assert(global.snap_target != NULL);
|
||||
render_target_set_layer_config(global.snap_target, 0);
|
||||
}
|
||||
|
||||
/* select the appropriate view in our dummy target */
|
||||
view_index = device_list_index(screen->machine->config->devicelist, VIDEO_SCREEN, screen->tag);
|
||||
assert(view_index != -1);
|
||||
render_target_set_view(global.snap_target, view_index);
|
||||
|
||||
/* get the minimum width/height and set it on the target */
|
||||
|
@ -71,8 +71,6 @@ typedef struct _screen_state screen_state;
|
||||
struct _screen_state
|
||||
{
|
||||
int width, height; /* current total width/height (HTOTAL, VTOTAL) */
|
||||
rectangle visarea; /* current visible area (HBLANK end/start, VBLANK end/start) */
|
||||
bitmap_format format; /* bitmap format (a copy of screen_config) */
|
||||
void * private_data; /* pointer to the private data structure */
|
||||
};
|
||||
|
||||
|
@ -386,7 +386,7 @@ static TIMER_CALLBACK( scanline_callback )
|
||||
cia_clock_tod(1);
|
||||
|
||||
/* render up to this scanline */
|
||||
if (scanline < machine->screen[0].visarea.min_y)
|
||||
if (scanline < video_screen_get_visible_area(machine->primary_screen)->min_y)
|
||||
amiga_render_scanline(machine, NULL, scanline);
|
||||
else
|
||||
video_screen_update_partial(machine->primary_screen, scanline);
|
||||
|
@ -1119,17 +1119,16 @@ int K055555GX_decode_osmixcolor(int layer, int *color) // (see p.63, p.49-50 and
|
||||
return(emx);
|
||||
}
|
||||
|
||||
static void gx_wipezbuf(int noshadow)
|
||||
static void gx_wipezbuf(running_machine *machine, int noshadow)
|
||||
{
|
||||
UINT8 *zptr;
|
||||
int w, h;
|
||||
register int ecx;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
w = Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1;
|
||||
h = Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1;
|
||||
int w = visarea->max_x - visarea->min_x + 1;
|
||||
int h = visarea->max_y - visarea->min_y + 1;
|
||||
|
||||
UINT8 *zptr = gx_objzbuf;
|
||||
int ecx = h;
|
||||
|
||||
zptr = gx_objzbuf;
|
||||
ecx = h;
|
||||
do { memset(zptr, -1, w); zptr += GX_ZBUFW; } while (--ecx);
|
||||
|
||||
if (!noshadow)
|
||||
@ -1265,7 +1264,7 @@ void konamigx_mixer(running_machine *machine, bitmap_t *bitmap, const rectangle
|
||||
if (mixerflags & GXMIX_NOZBUF)
|
||||
mixerflags |= GXMIX_NOSHADOW;
|
||||
else
|
||||
gx_wipezbuf(mixerflags & GXMIX_NOSHADOW);
|
||||
gx_wipezbuf(machine, mixerflags & GXMIX_NOSHADOW);
|
||||
|
||||
// cache global parameters
|
||||
konamigx_precache_registers();
|
||||
|
@ -629,10 +629,12 @@ WRITE32_HANDLER( n64_vi_reg_w )
|
||||
case 0x00/4: // VI_CONTROL_REG
|
||||
if ((n64_vi_control & 0x40) != (data & 0x40))
|
||||
{
|
||||
screen_state *state = &Machine->screen[0];
|
||||
rectangle visarea = state->visarea;
|
||||
int width = video_screen_get_width(machine->primary_screen);
|
||||
rectangle visarea = *video_screen_get_visible_area(machine->primary_screen);
|
||||
attoseconds_t period = video_screen_get_frame_period(machine->primary_screen).attoseconds;
|
||||
|
||||
visarea.max_y = (data & 0x40) ? 479 : 239;
|
||||
video_screen_configure(machine->primary_screen, state->width, visarea.max_y + 1, &visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
||||
video_screen_configure(machine->primary_screen, width, visarea.max_y + 1, &visarea, period);
|
||||
}
|
||||
n64_vi_control = data;
|
||||
break;
|
||||
@ -644,10 +646,12 @@ WRITE32_HANDLER( n64_vi_reg_w )
|
||||
case 0x08/4: // VI_WIDTH_REG
|
||||
if (n64_vi_width != data && data > 0)
|
||||
{
|
||||
screen_state *state = &Machine->screen[0];
|
||||
rectangle visarea = state->visarea;
|
||||
int height = video_screen_get_height(machine->primary_screen);
|
||||
rectangle visarea = *video_screen_get_visible_area(machine->primary_screen);
|
||||
attoseconds_t period = video_screen_get_frame_period(machine->primary_screen).attoseconds;
|
||||
|
||||
visarea.max_x = data-1;
|
||||
video_screen_configure(machine->primary_screen, visarea.max_x + 1, state->height, &visarea, video_screen_get_frame_period(machine->primary_screen).attoseconds);
|
||||
video_screen_configure(machine->primary_screen, visarea.max_x + 1, height, &visarea, period);
|
||||
}
|
||||
n64_vi_width = data;
|
||||
fb_width = data;
|
||||
|
@ -1085,8 +1085,7 @@ WRITE8_HANDLER( snes_w_io )
|
||||
case BGMODE: /* BG mode and character size settings */
|
||||
snes_ppu.mode = data & 0x7;
|
||||
{
|
||||
screen_state *state = &Machine->screen[0];
|
||||
rectangle visarea = state->visarea;
|
||||
rectangle visarea = *video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
visarea.min_x = visarea.min_y = 0;
|
||||
visarea.max_y = snes_ppu.beam.last_visible_line - 1;
|
||||
|
@ -278,6 +278,7 @@ VIDEO_START( angelkds )
|
||||
|
||||
VIDEO_UPDATE( angelkds )
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
rectangle clip;
|
||||
|
||||
fillbitmap(bitmap,0x3f,cliprect); /* is there a register controling the colour?, we currently use the last colour of the tx palette */
|
||||
@ -285,8 +286,8 @@ VIDEO_UPDATE( angelkds )
|
||||
/* draw top of screen */
|
||||
clip.min_x = 8*0;
|
||||
clip.max_x = 8*16-1;
|
||||
clip.min_y = screen->machine->screen[0].visarea.min_y;
|
||||
clip.max_y = screen->machine->screen[0].visarea.max_y;
|
||||
clip.min_y = visarea->min_y;
|
||||
clip.max_y = visarea->max_y;
|
||||
if ((angelkds_layer_ctrl & 0x80) == 0x00) tilemap_draw(bitmap,&clip,bgtop_tilemap,0,0);
|
||||
draw_sprites(screen->machine, bitmap,&clip, 0x80);
|
||||
if ((angelkds_layer_ctrl & 0x20) == 0x00) tilemap_draw(bitmap,&clip,tx_tilemap,0,0);
|
||||
@ -294,8 +295,8 @@ VIDEO_UPDATE( angelkds )
|
||||
/* draw bottom of screen */
|
||||
clip.min_x = 8*16;
|
||||
clip.max_x = 8*32-1;
|
||||
clip.min_y = screen->machine->screen[0].visarea.min_y;
|
||||
clip.max_y = screen->machine->screen[0].visarea.max_y;
|
||||
clip.min_y = visarea->min_y;
|
||||
clip.max_y = visarea->max_y;
|
||||
if ((angelkds_layer_ctrl & 0x40) == 0x00) tilemap_draw(bitmap,&clip,bgbot_tilemap,0,0);
|
||||
draw_sprites(screen->machine, bitmap,&clip, 0x40);
|
||||
if ((angelkds_layer_ctrl & 0x20) == 0x00) tilemap_draw(bitmap,&clip,tx_tilemap,0,0);
|
||||
|
@ -321,7 +321,7 @@ static TIMER_CALLBACK( force_update )
|
||||
video_screen_update_partial(machine->primary_screen, scanline - 1);
|
||||
|
||||
scanline += 64;
|
||||
if (scanline >= machine->screen[0].visarea.max_y)
|
||||
if (scanline >= video_screen_get_visible_area(machine->primary_screen)->max_y)
|
||||
scanline = 0;
|
||||
timer_adjust_oneshot(force_update_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
|
||||
}
|
||||
@ -696,7 +696,7 @@ bitmap_t *atarimo_render(running_machine *machine, int map, const rectangle *cli
|
||||
|
||||
/* compute minimum Y and wrap around if necessary */
|
||||
bandclip.min_y = ((band << mo->slipshift) - mo->yscroll + mo->slipoffset) & mo->bitmapymask;
|
||||
if (bandclip.min_y > machine->screen[0].visarea.max_y)
|
||||
if (bandclip.min_y > video_screen_get_visible_area(machine->primary_screen)->max_y)
|
||||
bandclip.min_y -= mo->bitmapheight;
|
||||
|
||||
/* maximum Y is based on the minimum */
|
||||
@ -815,8 +815,8 @@ if ((temp & 0xff00) == 0xc800)
|
||||
/* adjust the final coordinates */
|
||||
xpos &= mo->bitmapxmask;
|
||||
ypos &= mo->bitmapymask;
|
||||
if (xpos > machine->screen[0].visarea.max_x) xpos -= mo->bitmapwidth;
|
||||
if (ypos > machine->screen[0].visarea.max_y) ypos -= mo->bitmapheight;
|
||||
if (xpos > video_screen_get_visible_area(machine->primary_screen)->max_x) xpos -= mo->bitmapwidth;
|
||||
if (ypos > video_screen_get_visible_area(machine->primary_screen)->max_y) ypos -= mo->bitmapheight;
|
||||
|
||||
/* is this one special? */
|
||||
if (mo->specialmask.mask != 0 && EXTRACT_DATA(entry, mo->specialmask) == mo->specialvalue)
|
||||
|
@ -308,7 +308,7 @@ void atarirle_init(int map, const atarirle_desc *desc)
|
||||
mo->romlength = memory_region_length(desc->region);
|
||||
mo->objectcount = count_objects(base, mo->romlength);
|
||||
|
||||
mo->cliprect = Machine->screen[0].visarea;
|
||||
mo->cliprect = *video_screen_get_visible_area(Machine->primary_screen);
|
||||
if (desc->rightclip)
|
||||
{
|
||||
mo->cliprect.min_x = desc->leftclip;
|
||||
@ -840,6 +840,7 @@ if (hilite)
|
||||
|
||||
do
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
|
||||
int scaled_width = (scale * info->width + 0x7fff) >> 12;
|
||||
int scaled_height = (scale * info->height + 0x7fff) >> 12;
|
||||
int dx, dy, ex, ey, sx = x, sy = y, tx, ty;
|
||||
@ -855,27 +856,27 @@ if (hilite)
|
||||
ey = sy + scaled_height - 1;
|
||||
|
||||
/* left edge clip */
|
||||
if (sx < Machine->screen[0].visarea.min_x)
|
||||
sx = Machine->screen[0].visarea.min_x;
|
||||
if (sx > Machine->screen[0].visarea.max_x)
|
||||
if (sx < visarea->min_x)
|
||||
sx = visarea->min_x;
|
||||
if (sx > visarea->max_x)
|
||||
break;
|
||||
|
||||
/* right edge clip */
|
||||
if (ex > Machine->screen[0].visarea.max_x)
|
||||
ex = Machine->screen[0].visarea.max_x;
|
||||
else if (ex < Machine->screen[0].visarea.min_x)
|
||||
if (ex > visarea->max_x)
|
||||
ex = visarea->max_x;
|
||||
else if (ex < visarea->min_x)
|
||||
break;
|
||||
|
||||
/* top edge clip */
|
||||
if (sy < Machine->screen[0].visarea.min_y)
|
||||
sy = Machine->screen[0].visarea.min_y;
|
||||
else if (sy > Machine->screen[0].visarea.max_y)
|
||||
if (sy < visarea->min_y)
|
||||
sy = visarea->min_y;
|
||||
else if (sy > visarea->max_y)
|
||||
break;
|
||||
|
||||
/* bottom edge clip */
|
||||
if (ey > Machine->screen[0].visarea.max_y)
|
||||
ey = Machine->screen[0].visarea.max_y;
|
||||
else if (ey < Machine->screen[0].visarea.min_y)
|
||||
if (ey > visarea->max_y)
|
||||
ey = visarea->max_y;
|
||||
else if (ey < visarea->min_y)
|
||||
break;
|
||||
|
||||
for (ty = sy; ty <= ey; ty++)
|
||||
@ -917,7 +918,7 @@ void draw_rle(atarirle_data *mo, bitmap_t *bitmap, int code, int color, int hfli
|
||||
if (hflip)
|
||||
scaled_xoffs = ((xscale * info->width) >> 12) - scaled_xoffs;
|
||||
|
||||
//if (clip->min_y == Machine->screen[0].visarea.min_y)
|
||||
//if (clip->min_y == video_screen_get_visible_area(Machine->primary_screen)->min_y)
|
||||
//logerror(" Sprite: c=%04X l=%04X h=%d X=%4d (o=%4d w=%3d) Y=%4d (o=%4d h=%d) s=%04X\n",
|
||||
// code, color, hflip,
|
||||
// x, -scaled_xoffs, (xscale * info->width) >> 12,
|
||||
|
@ -345,7 +345,7 @@ WRITE16_HANDLER( atarisy1_yscroll_w )
|
||||
/* because this latches a new value into the scroll base,
|
||||
we need to adjust for the scanline */
|
||||
adjusted_scroll = newscroll;
|
||||
if (scanline <= Machine->screen[0].visarea.max_y)
|
||||
if (scanline <= video_screen_get_visible_area(machine->primary_screen)->max_y)
|
||||
adjusted_scroll -= (scanline + 1);
|
||||
tilemap_set_scrolly(atarigen_playfield_tilemap, 0, adjusted_scroll);
|
||||
|
||||
|
@ -1445,10 +1445,12 @@ static void register_state (void)
|
||||
|
||||
static VIDEO_START( avg_common )
|
||||
{
|
||||
xmin = machine->screen[0].visarea.min_x;
|
||||
ymin = machine->screen[0].visarea.min_y;
|
||||
xmax = machine->screen[0].visarea.max_x;
|
||||
ymax = machine->screen[0].visarea.max_y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
xmin = visarea->min_x;
|
||||
ymin = visarea->min_y;
|
||||
xmax = visarea->max_x;
|
||||
ymax = visarea->max_y;
|
||||
|
||||
xcenter = ((xmax - xmin) / 2) << 16;
|
||||
ycenter = ((ymax - ymin) / 2) << 16;
|
||||
@ -1472,11 +1474,13 @@ static VIDEO_START( avg_common )
|
||||
|
||||
VIDEO_START( dvg )
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
vgc = &dvg_default;
|
||||
vg = &vgd;
|
||||
|
||||
xmin = machine->screen[0].visarea.min_x;
|
||||
ymin = machine->screen[0].visarea.min_y;
|
||||
xmin = visarea->min_x;
|
||||
ymin = visarea->min_y;
|
||||
|
||||
vg_halt_timer = timer_alloc(vg_set_halt_callback, NULL);
|
||||
vg_run_timer = timer_alloc(run_state_machine, NULL);
|
||||
|
@ -83,10 +83,12 @@ WRITE16_HANDLER( aztarac_ubr_w )
|
||||
|
||||
VIDEO_START( aztarac )
|
||||
{
|
||||
int xmin = machine->screen[0].visarea.min_x;
|
||||
int ymin = machine->screen[0].visarea.min_y;
|
||||
int xmax = machine->screen[0].visarea.max_x;
|
||||
int ymax = machine->screen[0].visarea.max_y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
int xmin = visarea->min_x;
|
||||
int ymin = visarea->min_y;
|
||||
int xmax = visarea->max_x;
|
||||
int ymax = visarea->max_y;
|
||||
|
||||
xcenter=((xmax + xmin) / 2) << 16;
|
||||
ycenter=((ymax + ymin) / 2) << 16;
|
||||
|
@ -67,16 +67,13 @@ VIDEO_START( blockout )
|
||||
|
||||
|
||||
|
||||
static void updatepixels(int x,int y)
|
||||
static void update_pixels(const device_config *screen, int x, int y)
|
||||
{
|
||||
UINT16 front,back;
|
||||
int color;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
|
||||
if (x < Machine->screen[0].visarea.min_x ||
|
||||
x > Machine->screen[0].visarea.max_x ||
|
||||
y < Machine->screen[0].visarea.min_y ||
|
||||
y > Machine->screen[0].visarea.max_y)
|
||||
if (x < visarea->min_x || x > visarea->max_x || y < visarea->min_y || y > visarea->max_y)
|
||||
return;
|
||||
|
||||
front = blockout_videoram[y*256+x/2];
|
||||
@ -99,9 +96,7 @@ WRITE16_HANDLER( blockout_videoram_w )
|
||||
COMBINE_DATA(&blockout_videoram[offset]);
|
||||
|
||||
if (oldword != blockout_videoram[offset])
|
||||
{
|
||||
updatepixels((offset % 256)*2,(offset / 256) % 256);
|
||||
}
|
||||
update_pixels(machine->primary_screen, (offset % 256)*2, (offset / 256) % 256);
|
||||
}
|
||||
|
||||
|
||||
|
@ -257,7 +257,7 @@ static void draw_bullets(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
}
|
||||
|
||||
|
||||
static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
if (1)
|
||||
{
|
||||
@ -282,7 +282,7 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
{
|
||||
if (flip_screen_get()) x += 64;
|
||||
|
||||
if (y >= machine->screen[0].visarea.min_y && y <= machine->screen[0].visarea.max_y)
|
||||
if (y >= cliprect->min_y && y <= cliprect->max_y)
|
||||
*BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[star_cntr].col;
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ VIDEO_UPDATE( bosco )
|
||||
}
|
||||
|
||||
fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
|
||||
draw_stars(screen->machine, bitmap,cliprect);
|
||||
draw_stars(bitmap,cliprect);
|
||||
|
||||
tilemap_draw(bitmap,&bg_clip,bg_tilemap,0,0);
|
||||
tilemap_draw(bitmap,&fg_clip,fg_tilemap,0,0);
|
||||
|
@ -780,7 +780,7 @@ static void sprite_init_cave(running_machine *machine)
|
||||
}
|
||||
|
||||
|
||||
static void cave_sprite_check(running_machine *machine, const rectangle *clip )
|
||||
static void cave_sprite_check(const device_config *screen, const rectangle *clip )
|
||||
{
|
||||
{ /* set clip */
|
||||
int left = clip->min_x;
|
||||
@ -800,6 +800,8 @@ static void cave_sprite_check(running_machine *machine, const rectangle *clip )
|
||||
int i[4]={0,0,0,0};
|
||||
int priority_check = 0;
|
||||
int spritetype = cave_spritetype2;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
while( sprite<finish )
|
||||
{
|
||||
if( sprite->x + sprite->total_width > blit.clip_left && sprite->x < blit.clip_right &&
|
||||
@ -831,19 +833,19 @@ static void cave_sprite_check(running_machine *machine, const rectangle *clip )
|
||||
|
||||
case CAVE_SPRITETYPE_ZOOM | CAVE_SPRITETYPE_ZBUF:
|
||||
cave_sprite_draw = sprite_draw_cave_zbuf;
|
||||
if (clip->min_y == machine->screen[0].visarea.min_y)
|
||||
if (clip->min_y == visarea->min_y)
|
||||
{
|
||||
if(!(sprite_zbuf_baseval += MAX_SPRITE_NUM))
|
||||
fillbitmap(sprite_zbuf,0,&machine->screen[0].visarea);
|
||||
fillbitmap(sprite_zbuf,0,visarea);
|
||||
}
|
||||
break;
|
||||
|
||||
case CAVE_SPRITETYPE_ZBUF:
|
||||
cave_sprite_draw = sprite_draw_donpachi_zbuf;
|
||||
if (clip->min_y == machine->screen[0].visarea.min_y)
|
||||
if (clip->min_y == visarea->min_y)
|
||||
{
|
||||
if(!(sprite_zbuf_baseval += MAX_SPRITE_NUM))
|
||||
fillbitmap(sprite_zbuf,0,&machine->screen[0].visarea);
|
||||
fillbitmap(sprite_zbuf,0,visarea);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1523,7 +1525,7 @@ VIDEO_UPDATE( cave )
|
||||
}
|
||||
#endif
|
||||
|
||||
cave_sprite_check(screen->machine, cliprect);
|
||||
cave_sprite_check(screen, cliprect);
|
||||
|
||||
fillbitmap(bitmap,background_color,cliprect);
|
||||
|
||||
|
@ -123,15 +123,10 @@ WRITE16_HANDLER( cchasm_refresh_control_w )
|
||||
|
||||
VIDEO_START( cchasm )
|
||||
{
|
||||
int xmin, xmax, ymin, ymax;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
xmin=machine->screen[0].visarea.min_x;
|
||||
ymin=machine->screen[0].visarea.min_y;
|
||||
xmax=machine->screen[0].visarea.max_x;
|
||||
ymax=machine->screen[0].visarea.max_y;
|
||||
|
||||
xcenter=((xmax+xmin)/2) << 16;
|
||||
ycenter=((ymax+ymin)/2) << 16;
|
||||
xcenter=((visarea->max_x + visarea->min_x)/2) << 16;
|
||||
ycenter=((visarea->max_y + visarea->min_y)/2) << 16;
|
||||
|
||||
VIDEO_START_CALL(vector);
|
||||
}
|
||||
|
@ -49,13 +49,14 @@ static UINT8 last_control;
|
||||
|
||||
void cinemat_vector_callback(INT16 sx, INT16 sy, INT16 ex, INT16 ey, UINT8 shift)
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
|
||||
int intensity = 0xff;
|
||||
|
||||
/* adjust for slop */
|
||||
sx = sx - Machine->screen[0].visarea.min_x;
|
||||
ex = ex - Machine->screen[0].visarea.min_x;
|
||||
sy = sy - Machine->screen[0].visarea.min_y;
|
||||
ey = ey - Machine->screen[0].visarea.min_y;
|
||||
sx = sx - visarea->min_x;
|
||||
ex = ex - visarea->min_x;
|
||||
sy = sy - visarea->min_y;
|
||||
ey = ey - visarea->min_y;
|
||||
|
||||
/* point intensity is determined by the shift value */
|
||||
if (sx == ex && sy == ey)
|
||||
|
@ -165,12 +165,12 @@ VIDEO_START( contra )
|
||||
private_spriteram = auto_malloc(0x800);
|
||||
private_spriteram_2 = auto_malloc(0x800);
|
||||
|
||||
bg_clip = machine->screen[0].visarea;
|
||||
bg_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
bg_clip.min_x += 40;
|
||||
|
||||
fg_clip = bg_clip;
|
||||
|
||||
tx_clip = machine->screen[0].visarea;
|
||||
tx_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
tx_clip.max_x = 39;
|
||||
tx_clip.min_x = 0;
|
||||
|
||||
|
@ -134,7 +134,7 @@ VIDEO_UPDATE( copsnrob )
|
||||
{
|
||||
if (val & mask1)
|
||||
{
|
||||
for (y = 0; y <= screen->machine->screen[0].visarea.max_y; y++)
|
||||
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
|
||||
if (copsnrob_bulletsram[y] & mask2)
|
||||
*BITMAP_ADDR16(bitmap, y, 256-x) = 1;
|
||||
}
|
||||
|
@ -357,20 +357,17 @@ VIDEO_UPDATE( cvs )
|
||||
UINT8 x = (stars[offs].x + stars_scroll) >> 1;
|
||||
UINT8 y = stars[offs].y + ((stars_scroll + stars[offs].x) >> 9);
|
||||
|
||||
if (y >= screen->machine->screen[0].visarea.min_y &&
|
||||
y <= screen->machine->screen[0].visarea.max_y)
|
||||
if ((y & 1) ^ ((x >> 4) & 1))
|
||||
{
|
||||
if ((y & 1) ^ ((x >> 4) & 1))
|
||||
{
|
||||
if (flip_screen_x_get())
|
||||
x = ~x;
|
||||
if (flip_screen_x_get())
|
||||
x = ~x;
|
||||
|
||||
if (flip_screen_y_get())
|
||||
y = ~y;
|
||||
if (flip_screen_y_get())
|
||||
y = ~y;
|
||||
|
||||
if (colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0)
|
||||
*BITMAP_ADDR16(bitmap, y, x) = BULLET_STAR_PEN;
|
||||
}
|
||||
if ((y >= cliprect->min_y) && (y <= cliprect->max_y) &&
|
||||
(colortable_entry_get_value(screen->machine->colortable, *BITMAP_ADDR16(bitmap, y, x)) == 0))
|
||||
*BITMAP_ADDR16(bitmap, y, x) = BULLET_STAR_PEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -592,11 +592,11 @@ VIDEO_START( decocass )
|
||||
tilemap_set_transparent_pen( bg_tilemap_r, 0 );
|
||||
tilemap_set_transparent_pen( fg_tilemap, 0 );
|
||||
|
||||
bg_tilemap_l_clip = machine->screen[0].visarea;
|
||||
bg_tilemap_l_clip.max_y = machine->screen[0].height / 2;
|
||||
bg_tilemap_l_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
bg_tilemap_l_clip.max_y = video_screen_get_height(machine->primary_screen) / 2;
|
||||
|
||||
bg_tilemap_r_clip = machine->screen[0].visarea;
|
||||
bg_tilemap_r_clip.min_y = machine->screen[0].height / 2;
|
||||
bg_tilemap_r_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
bg_tilemap_r_clip.min_y = video_screen_get_height(machine->primary_screen) / 2;
|
||||
|
||||
/* background videroam bits D0-D3 are shared with the tileram */
|
||||
decocass_bgvideoram = decocass_tileram;
|
||||
|
@ -761,9 +761,8 @@ static void radarscp_step(running_machine *machine, int line_cnt)
|
||||
|
||||
}
|
||||
|
||||
static void radarscp_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
static void radarscp_draw_background(dkong_state *state, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
dkong_state *state = machine->driver_data;
|
||||
const UINT8 *htable = NULL;
|
||||
int x,y;
|
||||
UINT8 draw_ok;
|
||||
@ -772,11 +771,11 @@ static void radarscp_draw_background(running_machine *machine, bitmap_t *bitmap,
|
||||
if (state->hardware_type == HARDWARE_TRS01)
|
||||
htable = memory_region(REGION_GFX4);
|
||||
|
||||
y = machine->screen[0].visarea.min_y;
|
||||
while (y <= machine->screen[0].visarea.max_y)
|
||||
y = cliprect->min_y;
|
||||
while (y <= cliprect->max_y)
|
||||
{
|
||||
x = machine->screen[0].visarea.min_x;
|
||||
while (x <= machine->screen[0].visarea.max_x)
|
||||
x = cliprect->min_x;
|
||||
while (x <= cliprect->max_x)
|
||||
{
|
||||
pixel = BITMAP_ADDR16(bitmap, y, x);
|
||||
draw_ok = !(*pixel & 0x01) && !(*pixel & 0x02);
|
||||
@ -800,10 +799,11 @@ static TIMER_CALLBACK( scanline_callback )
|
||||
UINT16 *pixel;
|
||||
static int counter=0;
|
||||
int scanline = param;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
y = scanline;
|
||||
radarscp_step(machine, y);
|
||||
if (y <= machine->screen[0].visarea.min_y || y > machine->screen[0].visarea.max_y)
|
||||
if (y <= visarea->min_y || y > visarea->max_y)
|
||||
counter = 0;
|
||||
offset = (state->flip ^ state->rflip_sig) ? 0x000 : 0x400;
|
||||
x = 0;
|
||||
@ -937,7 +937,7 @@ VIDEO_UPDATE( dkong )
|
||||
case HARDWARE_TRS02:
|
||||
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, 0x40, 1);
|
||||
radarscp_draw_background(screen->machine, bitmap, cliprect);
|
||||
radarscp_draw_background(state, bitmap, cliprect);
|
||||
break;
|
||||
default:
|
||||
fatalerror("Invalid hardware type in dkong_video_update");
|
||||
|
@ -46,10 +46,11 @@ UINT16 *splndrbt_scrollx, *splndrbt_scrolly;
|
||||
static void video_init_common(running_machine *machine)
|
||||
{
|
||||
int i;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
// set defaults
|
||||
maskwidth = 8;
|
||||
maskheight = machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y + 1;
|
||||
maskheight = visarea->max_y - visarea->min_y + 1;
|
||||
maskcolor = get_black_pen(machine);
|
||||
scrollx = scrolly = 0;
|
||||
for (i=0; i<4; i++) bgcolor[i] = 0;
|
||||
@ -226,7 +227,7 @@ VIDEO_START( splndrbt )
|
||||
|
||||
assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_INDEXED16);
|
||||
|
||||
halfclip = machine->screen[0].visarea;
|
||||
halfclip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
i = halfclip.max_y - halfclip.min_y + 1;
|
||||
halfclip.max_y = halfclip.min_y + (i >> 1) - 1;
|
||||
|
||||
@ -250,7 +251,7 @@ VIDEO_START( splndrbt )
|
||||
memset(dirtybuf, 1, 0x800);
|
||||
|
||||
prestep = auto_malloc(i * sizeof(struct PRESTEP_TYPE));
|
||||
splndrbt_prestep(prestep, &machine->screen[0].visarea, BMW, 434, 96, 480);
|
||||
splndrbt_prestep(prestep, video_screen_get_visible_area(machine->primary_screen), BMW, 434, 96, 480);
|
||||
|
||||
defcharram = videoram16 + videoram_size / 2;
|
||||
|
||||
|
@ -68,7 +68,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
|
||||
*ram2 = indx_ram; // current sprite pointer in indx_ram
|
||||
|
||||
// wheelrun is the only game with a smaller visible area
|
||||
int special = (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y + 1) < 0x100;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int special = (visarea->max_y - visarea->min_y + 1) < 0x100;
|
||||
|
||||
for ( ; ram < indx_ram; ram += 8,ram2++)
|
||||
{
|
||||
|
@ -111,10 +111,10 @@ VIDEO_START( fastlane )
|
||||
|
||||
tilemap_set_scroll_rows( layer0, 32 );
|
||||
|
||||
clip0 = machine->screen[0].visarea;
|
||||
clip0 = *video_screen_get_visible_area(machine->primary_screen);
|
||||
clip0.min_x += 40;
|
||||
|
||||
clip1 = machine->screen[0].visarea;
|
||||
clip1 = *video_screen_get_visible_area(machine->primary_screen);
|
||||
clip1.max_x = 39;
|
||||
clip1.min_x = 0;
|
||||
}
|
||||
|
@ -132,6 +132,7 @@ WRITE8_HANDLER( flkatck_k007121_regs_w )
|
||||
VIDEO_UPDATE( flkatck )
|
||||
{
|
||||
rectangle final_clip[2];
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
#if 0
|
||||
popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x",
|
||||
@ -140,10 +141,10 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
|
||||
#endif
|
||||
if (k007121_flip_screen)
|
||||
{
|
||||
k007121_clip[0] = screen->machine->screen[0].visarea;
|
||||
k007121_clip[0] = *visarea;
|
||||
k007121_clip[0].max_x -= 40;
|
||||
|
||||
k007121_clip[1] = screen->machine->screen[0].visarea;
|
||||
k007121_clip[1] = *visarea;
|
||||
k007121_clip[1].min_x = k007121_clip[1].max_x-40;
|
||||
|
||||
tilemap_set_scrollx(k007121_tilemap[0],0,K007121_ctrlram[0][0x00] - 56 );
|
||||
@ -152,10 +153,10 @@ popmessage("%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x %02x-%02x-%02x-%02x-%02x-%0
|
||||
}
|
||||
else
|
||||
{
|
||||
k007121_clip[0] = screen->machine->screen[0].visarea;
|
||||
k007121_clip[0] = *visarea;
|
||||
k007121_clip[0].min_x += 40;
|
||||
|
||||
k007121_clip[1] = screen->machine->screen[0].visarea;
|
||||
k007121_clip[1] = *visarea;
|
||||
k007121_clip[1].max_x = 39;
|
||||
k007121_clip[1].min_x = 0;
|
||||
|
||||
|
@ -80,10 +80,10 @@ VIDEO_UPDATE( flyball )
|
||||
|
||||
for (y = bally; y < bally + 2; y++)
|
||||
for (x = ballx; x < ballx + 2; x++)
|
||||
if (x >= screen->machine->screen[0].visarea.min_x &&
|
||||
x <= screen->machine->screen[0].visarea.max_x &&
|
||||
y >= screen->machine->screen[0].visarea.min_y &&
|
||||
y <= screen->machine->screen[0].visarea.max_y)
|
||||
if (x >= cliprect->min_x &&
|
||||
x <= cliprect->max_x &&
|
||||
y >= cliprect->min_y &&
|
||||
y <= cliprect->max_y)
|
||||
*BITMAP_ADDR16(bitmap, y, x) = 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -307,7 +307,7 @@ WRITE8_HANDLER( fromance_crtc_data_w )
|
||||
{
|
||||
/* only register we know about.... */
|
||||
case 0x0b:
|
||||
timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_pos(machine->primary_screen, Machine->screen[0].visarea.max_y + 1, 0), (data > 0x80) ? 2 : 1);
|
||||
timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_vblank_start(machine->primary_screen), (data > 0x80) ? 2 : 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -330,9 +330,10 @@ WRITE8_HANDLER( fromance_crtc_register_w )
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority)
|
||||
static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int draw_priority)
|
||||
{
|
||||
static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
int offs;
|
||||
|
||||
/* draw the sprites */
|
||||
@ -365,14 +366,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
yzoom = 16 - zoomtable[yzoom] / 8;
|
||||
|
||||
/* wrap around */
|
||||
if (x > machine->screen[0].visarea.max_x) x -= 0x200;
|
||||
if (y > machine->screen[0].visarea.max_y) y -= 0x200;
|
||||
if (x > visarea->max_x) x -= 0x200;
|
||||
if (y > visarea->max_y) y -= 0x200;
|
||||
|
||||
/* flip ? */
|
||||
if (flipscreen)
|
||||
{
|
||||
y = machine->screen[0].visarea.max_y - y - 16 * ytiles - 4;
|
||||
x = machine->screen[0].visarea.max_x - x - 16 * xtiles - 24;
|
||||
y = visarea->max_y - y - 16 * ytiles - 4;
|
||||
x = visarea->max_x - x - 16 * xtiles - 24;
|
||||
xflip=!xflip;
|
||||
yflip=!yflip;
|
||||
}
|
||||
@ -383,10 +384,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (yt = 0; yt < ytiles; yt++)
|
||||
for (xt = 0; xt < xtiles; xt++, code++)
|
||||
if (!zoomed)
|
||||
drawgfx(bitmap, machine->gfx[2], code, color, 0, 0,
|
||||
drawgfx(bitmap, screen->machine->gfx[2], code, color, 0, 0,
|
||||
x + xt * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
|
||||
else
|
||||
drawgfxzoom(bitmap, machine->gfx[2], code, color, 0, 0,
|
||||
drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 0, 0,
|
||||
x + xt * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
|
||||
0x1000 * xzoom, 0x1000 * yzoom);
|
||||
}
|
||||
@ -397,10 +398,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (yt = 0; yt < ytiles; yt++)
|
||||
for (xt = 0; xt < xtiles; xt++, code++)
|
||||
if (!zoomed)
|
||||
drawgfx(bitmap, machine->gfx[2], code, color, 1, 0,
|
||||
drawgfx(bitmap, screen->machine->gfx[2], code, color, 1, 0,
|
||||
x + (xtiles - 1 - xt) * 16, y + yt * 16, cliprect, TRANSPARENCY_PEN, 15);
|
||||
else
|
||||
drawgfxzoom(bitmap, machine->gfx[2], code, color, 1, 0,
|
||||
drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 1, 0,
|
||||
x + (xtiles - 1 - xt) * xzoom, y + yt * yzoom, cliprect, TRANSPARENCY_PEN, 15,
|
||||
0x1000 * xzoom, 0x1000 * yzoom);
|
||||
}
|
||||
@ -411,10 +412,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (yt = 0; yt < ytiles; yt++)
|
||||
for (xt = 0; xt < xtiles; xt++, code++)
|
||||
if (!zoomed)
|
||||
drawgfx(bitmap, machine->gfx[2], code, color, 0, 1,
|
||||
drawgfx(bitmap, screen->machine->gfx[2], code, color, 0, 1,
|
||||
x + xt * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
|
||||
else
|
||||
drawgfxzoom(bitmap, machine->gfx[2], code, color, 0, 1,
|
||||
drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 0, 1,
|
||||
x + xt * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
|
||||
0x1000 * xzoom, 0x1000 * yzoom);
|
||||
}
|
||||
@ -425,10 +426,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (yt = 0; yt < ytiles; yt++)
|
||||
for (xt = 0; xt < xtiles; xt++, code++)
|
||||
if (!zoomed)
|
||||
drawgfx(bitmap, machine->gfx[2], code, color, 1, 1,
|
||||
drawgfx(bitmap, screen->machine->gfx[2], code, color, 1, 1,
|
||||
x + (xtiles - 1 - xt) * 16, y + (ytiles - 1 - yt) * 16, cliprect, TRANSPARENCY_PEN, 15);
|
||||
else
|
||||
drawgfxzoom(bitmap, machine->gfx[2], code, color, 1, 1,
|
||||
drawgfxzoom(bitmap, screen->machine->gfx[2], code, color, 1, 1,
|
||||
x + (xtiles - 1 - xt) * xzoom, y + (ytiles - 1 - yt) * yzoom, cliprect, TRANSPARENCY_PEN, 15,
|
||||
0x1000 * xzoom, 0x1000 * yzoom);
|
||||
}
|
||||
@ -466,7 +467,7 @@ VIDEO_UPDATE( pipedrm )
|
||||
tilemap_draw(bitmap,cliprect, bg_tilemap, 0, 0);
|
||||
tilemap_draw(bitmap,cliprect, fg_tilemap, 0, 0);
|
||||
|
||||
draw_sprites(screen->machine,bitmap,cliprect, 0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect, 1);
|
||||
draw_sprites(screen,bitmap,cliprect, 0);
|
||||
draw_sprites(screen,bitmap,cliprect, 1);
|
||||
return 0;
|
||||
}
|
||||
|
@ -144,12 +144,13 @@ VIDEO_START( fuuki16 )
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
int max_x = machine->screen[0].visarea.max_x+1;
|
||||
int max_y = machine->screen[0].visarea.max_y+1;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
int max_x = visarea->max_x+1;
|
||||
int max_y = visarea->max_y+1;
|
||||
|
||||
/* Draw them backwards, for pdrawgfx */
|
||||
for ( offs = (spriteram_size-8)/2; offs >=0; offs -= 8/2 )
|
||||
@ -201,7 +202,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (x = xstart; x != xend; x += xinc)
|
||||
{
|
||||
if (xzoom == (16*8) && yzoom == (16*8))
|
||||
pdrawgfx( bitmap,machine->gfx[0],
|
||||
pdrawgfx( bitmap,screen->machine->gfx[0],
|
||||
code++,
|
||||
attr & 0x3f,
|
||||
flipx, flipy,
|
||||
@ -209,7 +210,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
cliprect,TRANSPARENCY_PEN,15,
|
||||
pri_mask );
|
||||
else
|
||||
pdrawgfxzoom( bitmap,machine->gfx[0],
|
||||
pdrawgfxzoom( bitmap,screen->machine->gfx[0],
|
||||
code++,
|
||||
attr & 0x3f,
|
||||
flipx, flipy,
|
||||
@ -347,7 +348,7 @@ VIDEO_UPDATE( fuuki16 )
|
||||
fuuki16_draw_layer(bitmap,cliprect, tm_middle, 0, 2);
|
||||
fuuki16_draw_layer(bitmap,cliprect, tm_front, 0, 4);
|
||||
|
||||
draw_sprites(screen->machine, bitmap, cliprect);
|
||||
draw_sprites(screen, bitmap, cliprect);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -159,12 +159,13 @@ VIDEO_START( fuuki32 )
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
int max_x = machine->screen[0].visarea.max_x+1;
|
||||
int max_y = machine->screen[0].visarea.max_y+1;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
int max_x = visarea->max_x+1;
|
||||
int max_y = visarea->max_y+1;
|
||||
|
||||
UINT32 *src = buffered_spriteram32_2; /* Use spriteram buffered by 2 frames, need palette buffered by one frame? */
|
||||
|
||||
@ -233,7 +234,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
for (x = xstart; x != xend; x += xinc)
|
||||
{
|
||||
if (xzoom == (16*8) && yzoom == (16*8))
|
||||
pdrawgfx( bitmap,machine->gfx[0],
|
||||
pdrawgfx( bitmap,screen->machine->gfx[0],
|
||||
code++,
|
||||
attr & 0x3f,
|
||||
flipx, flipy,
|
||||
@ -241,7 +242,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
cliprect,TRANSPARENCY_PEN,15,
|
||||
pri_mask );
|
||||
else
|
||||
pdrawgfxzoom( bitmap,machine->gfx[0],
|
||||
pdrawgfxzoom( bitmap,screen->machine->gfx[0],
|
||||
code++,
|
||||
attr & 0x3f,
|
||||
flipx, flipy,
|
||||
@ -373,7 +374,7 @@ VIDEO_UPDATE( fuuki32 )
|
||||
fuuki32_draw_layer(bitmap,cliprect, tm_middle, 0, 2);
|
||||
fuuki32_draw_layer(bitmap,cliprect, tm_front, 0, 4);
|
||||
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
draw_sprites(screen,bitmap,cliprect);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -339,17 +339,17 @@ VIDEO_START( gaelco2_dual )
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs)
|
||||
static void draw_sprites(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, int mask, int xoffs)
|
||||
{
|
||||
int j, x, y, ex, ey, px, py;
|
||||
const gfx_element *gfx = machine->gfx[0];
|
||||
const gfx_element *gfx = screen->machine->gfx[0];
|
||||
|
||||
/* get sprite ram start and end offsets */
|
||||
int start_offset = (gaelco2_vregs[1] & 0x10)*0x100;
|
||||
int end_offset = start_offset + 0x1000;
|
||||
|
||||
/* sprite offset is based on the visible area */
|
||||
int spr_x_adjust = (machine->screen[0].visarea.max_x - 320 + 1) - (511 - 320 - 1) - ((gaelco2_vregs[0] >> 4) & 0x01) + xoffs;
|
||||
int spr_x_adjust = (video_screen_get_visible_area(screen)->max_x - 320 + 1) - (511 - 320 - 1) - ((gaelco2_vregs[0] >> 4) & 0x01) + xoffs;
|
||||
|
||||
for (j = start_offset; j < end_offset; j += 8){
|
||||
int data = buffered_spriteram16[(j/2) + 0];
|
||||
@ -460,7 +460,7 @@ VIDEO_UPDATE( gaelco2 )
|
||||
|
||||
tilemap_draw(bitmap, cliprect, pant[1], 0, 0);
|
||||
tilemap_draw(bitmap, cliprect, pant[0], 0, 0);
|
||||
draw_sprites(screen->machine, bitmap, cliprect, 0, 0);
|
||||
draw_sprites(screen, bitmap, cliprect, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -494,13 +494,13 @@ VIDEO_UPDATE( gaelco2_dual )
|
||||
{
|
||||
/* monitor 2 output */
|
||||
tilemap_draw(bitmap,cliprect,pant[1], 0, 0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect, 0x8000, 0);
|
||||
draw_sprites(screen,bitmap,cliprect, 0x8000, 0);
|
||||
}
|
||||
else if (screen == left_screen)
|
||||
{
|
||||
/* monitor 1 output */
|
||||
tilemap_draw(bitmap,cliprect,pant[0], 0, 0);
|
||||
draw_sprites(screen->machine,bitmap,cliprect, 0x0000, 0);
|
||||
draw_sprites(screen,bitmap,cliprect, 0x0000, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -127,10 +127,10 @@ VIDEO_START( gaelco3d )
|
||||
(repeat these two for each additional point in the fan)
|
||||
*/
|
||||
|
||||
static void render_poly(UINT32 *polydata)
|
||||
static void render_poly(const device_config *screen, UINT32 *polydata)
|
||||
{
|
||||
float midx = Machine->screen[0].width / 2;
|
||||
float midy = Machine->screen[0].height / 2;
|
||||
float midx = video_screen_get_width(screen) / 2;
|
||||
float midy = video_screen_get_height(screen) / 2;
|
||||
float z0 = convert_tms3203x_fp_to_float(polydata[0]);
|
||||
float voz_dy = convert_tms3203x_fp_to_float(polydata[1]) * 256.0f;
|
||||
float voz_dx = convert_tms3203x_fp_to_float(polydata[2]) * 256.0f;
|
||||
@ -198,17 +198,19 @@ static void render_poly(UINT32 *polydata)
|
||||
/* if we have a valid number of verts, render them */
|
||||
if (vertnum >= 3)
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
/* special case: no Z buffering and no perspective correction */
|
||||
if (color != 0x7f00 && z0 < 0 && ooz_dx == 0 && ooz_dy == 0)
|
||||
poly_render_triangle_fan(poly, screenbits, &Machine->screen[0].visarea, render_noz_noperspective, 0, vertnum, &vert[0]);
|
||||
poly_render_triangle_fan(poly, screenbits, visarea, render_noz_noperspective, 0, vertnum, &vert[0]);
|
||||
|
||||
/* general case: non-alpha blended */
|
||||
else if (color != 0x7f00)
|
||||
poly_render_triangle_fan(poly, screenbits, &Machine->screen[0].visarea, render_normal, 0, vertnum, &vert[0]);
|
||||
poly_render_triangle_fan(poly, screenbits, visarea, render_normal, 0, vertnum, &vert[0]);
|
||||
|
||||
/* color 0x7f seems to be hard-coded as a 50% alpha blend */
|
||||
else
|
||||
poly_render_triangle_fan(poly, screenbits, &Machine->screen[0].visarea, render_alphablend, 0, vertnum, &vert[0]);
|
||||
poly_render_triangle_fan(poly, screenbits, visarea, render_alphablend, 0, vertnum, &vert[0]);
|
||||
|
||||
polygons += vertnum - 2;
|
||||
}
|
||||
@ -375,7 +377,7 @@ void gaelco3d_render(void)
|
||||
#if DISPLAY_STATS
|
||||
{
|
||||
int scan = video_screen_get_vpos(machine->primary_screen);
|
||||
popmessage("Polys = %4d Timeleft = %3d", polygons, (lastscan < scan) ? (scan - lastscan) : (scan + (lastscan - Machine->screen[0].visarea.max_y)));
|
||||
popmessage("Polys = %4d Timeleft = %3d", polygons, (lastscan < scan) ? (scan - lastscan) : (scan + (lastscan - video_screen_get_visible_area(Machine->primary_screen)->max_y)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -404,7 +406,7 @@ WRITE32_HANDLER( gaelco3d_render_w )
|
||||
{
|
||||
if (polydata_count >= 18 && (polydata_count % 2) == 1 && IS_POLYEND(polydata_buffer[polydata_count - 2]))
|
||||
{
|
||||
render_poly(&polydata_buffer[0]);
|
||||
render_poly(machine->primary_screen, &polydata_buffer[0]);
|
||||
polydata_count = 0;
|
||||
}
|
||||
video_changed = TRUE;
|
||||
|
@ -542,7 +542,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
}
|
||||
|
||||
|
||||
static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
static void draw_stars(bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
/* draw the stars */
|
||||
|
||||
@ -566,14 +566,11 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
|
||||
if ( (set_a == star_seed_tab[star_cntr].set) || ( set_b == star_seed_tab[star_cntr].set) )
|
||||
{
|
||||
|
||||
x = (star_seed_tab[star_cntr].x + stars_scrollx) % 256 + 16;
|
||||
y = (112 + star_seed_tab[star_cntr].y + stars_scrolly) % 256;
|
||||
/* 112 is a tweak to get alignment about perfect */
|
||||
|
||||
|
||||
|
||||
if (y >= machine->screen[0].visarea.min_y && y <= machine->screen[0].visarea.max_y)
|
||||
if (y >= cliprect->min_y && y <= cliprect->max_y)
|
||||
*BITMAP_ADDR16(bitmap, y, x) = STARS_COLOR_BASE + star_seed_tab[ star_cntr ].col;
|
||||
}
|
||||
|
||||
@ -584,7 +581,7 @@ static void draw_stars(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
VIDEO_UPDATE( galaga )
|
||||
{
|
||||
fillbitmap(bitmap,get_black_pen(screen->machine),cliprect);
|
||||
draw_stars(screen->machine,bitmap,cliprect);
|
||||
draw_stars(bitmap,cliprect);
|
||||
draw_sprites(screen->machine,bitmap,cliprect);
|
||||
tilemap_draw(bitmap,cliprect,tx_tilemap,0,0);
|
||||
return 0;
|
||||
|
@ -106,39 +106,39 @@ static emu_timer *stars_blink_timer;
|
||||
static emu_timer *stars_scroll_timer;
|
||||
static UINT8 timer_adjusted;
|
||||
void galaxian_init_stars(running_machine *machine, int colors_offset);
|
||||
static void (*draw_stars)(running_machine *, bitmap_t *); /* function to call to draw the star layer */
|
||||
static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap);
|
||||
static void (*draw_stars)(running_machine *machine, bitmap_t *, const rectangle *); /* function to call to draw the star layer */
|
||||
static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void start_stars_blink_timer(double ra, double rb, double c);
|
||||
static void start_stars_scroll_timer(running_machine *machine);
|
||||
|
||||
/* bullets circuit */
|
||||
static UINT8 darkplnt_bullet_color;
|
||||
static void (*draw_bullets)(running_machine *, bitmap_t *,int,int,int); /* function to call to draw a bullet */
|
||||
static void galaxian_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void gteikob2_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void scramble_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void theend_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y);
|
||||
static void (*draw_bullets)(bitmap_t *,int,int,int,const rectangle *); /* function to call to draw a bullet */
|
||||
static void galaxian_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
static void gteikob2_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
static void theend_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect);
|
||||
|
||||
/* background circuit */
|
||||
static UINT8 background_enable;
|
||||
static UINT8 background_red, background_green, background_blue;
|
||||
static void (*draw_background)(running_machine *, bitmap_t *); /* function to call to draw the background */
|
||||
static void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void scramble_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void turtles_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void frogger_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap);
|
||||
static void (*draw_background)(bitmap_t *, const rectangle *cliprect); /* function to call to draw the background */
|
||||
static void galaxian_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void frogger_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect);
|
||||
|
||||
static UINT16 rockclim_v;
|
||||
static UINT16 rockclim_h;
|
||||
@ -805,9 +805,9 @@ VIDEO_START( scorpion )
|
||||
modify_spritecode = batman2_modify_spritecode;
|
||||
}
|
||||
|
||||
static void rockclim_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void rockclim_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
tilemap_draw(bitmap,0,rockclim_tilemap, 0,0);
|
||||
tilemap_draw(bitmap,cliprect,rockclim_tilemap, 0,0);
|
||||
}
|
||||
|
||||
static void rockclim_modify_spritecode(UINT8 *spriteram,int *code,int *flipx,int *flipy,int offs)
|
||||
@ -1403,7 +1403,7 @@ static void frogger_modify_ypos(UINT8 *sy)
|
||||
|
||||
/* bullet drawing functions */
|
||||
|
||||
static void galaxian_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void galaxian_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1412,8 +1412,7 @@ static void galaxian_draw_bullets(running_machine *machine, bitmap_t *bitmap, in
|
||||
{
|
||||
x--;
|
||||
|
||||
if (x >= machine->screen[0].visarea.min_x &&
|
||||
x <= machine->screen[0].visarea.max_x)
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
{
|
||||
int color;
|
||||
|
||||
@ -1426,39 +1425,33 @@ static void galaxian_draw_bullets(running_machine *machine, bitmap_t *bitmap, in
|
||||
}
|
||||
}
|
||||
|
||||
static void gteikob2_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void gteikob2_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
galaxian_draw_bullets(machine, bitmap, offs, 260 - x, y);
|
||||
galaxian_draw_bullets(bitmap, offs, 260 - x, y, cliprect);
|
||||
}
|
||||
|
||||
static void scramble_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void scramble_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
if (flipscreen_x) x++;
|
||||
|
||||
x = x - 6;
|
||||
|
||||
if (x >= machine->screen[0].visarea.min_x &&
|
||||
x <= machine->screen[0].visarea.max_x)
|
||||
{
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
/* yellow bullets */
|
||||
*BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
|
||||
}
|
||||
}
|
||||
|
||||
static void darkplnt_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void darkplnt_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
if (flipscreen_x) x++;
|
||||
|
||||
x = x - 6;
|
||||
|
||||
if (x >= machine->screen[0].visarea.min_x &&
|
||||
x <= machine->screen[0].visarea.max_x)
|
||||
{
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
*BITMAP_ADDR16(bitmap, y, x) = 32 + darkplnt_bullet_color;
|
||||
}
|
||||
}
|
||||
|
||||
static void theend_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void theend_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1468,15 +1461,12 @@ static void theend_draw_bullets(running_machine *machine, bitmap_t *bitmap, int
|
||||
{
|
||||
x--;
|
||||
|
||||
if (x >= machine->screen[0].visarea.min_x &&
|
||||
x <= machine->screen[0].visarea.max_x)
|
||||
{
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
*BITMAP_ADDR16(bitmap, y, x) = BULLETS_COLOR_BASE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, int offs, int x, int y)
|
||||
static void dambustr_draw_bullets(bitmap_t *bitmap, int offs, int x, int y, const rectangle *cliprect)
|
||||
{
|
||||
int i, color;
|
||||
|
||||
@ -1497,11 +1487,8 @@ static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, in
|
||||
x--;
|
||||
}
|
||||
|
||||
if (x >= machine->screen[0].visarea.min_x &&
|
||||
x <= machine->screen[0].visarea.max_x)
|
||||
{
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
*BITMAP_ADDR16(bitmap, y, x) = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1509,28 +1496,28 @@ static void dambustr_draw_bullets(running_machine *machine, bitmap_t *bitmap, in
|
||||
|
||||
/* background drawing functions */
|
||||
|
||||
static void galaxian_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void galaxian_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
/* plain black background */
|
||||
fillbitmap(bitmap,0,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
}
|
||||
|
||||
static void scramble_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void scramble_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
if (background_enable)
|
||||
fillbitmap(bitmap,BACKGROUND_COLOR_BASE,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,BACKGROUND_COLOR_BASE,cliprect);
|
||||
else
|
||||
fillbitmap(bitmap,0,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
}
|
||||
|
||||
static void turtles_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void turtles_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int color = (background_blue << 2) | (background_green << 1) | background_red;
|
||||
|
||||
fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,BACKGROUND_COLOR_BASE + color,cliprect);
|
||||
}
|
||||
|
||||
static void frogger_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void frogger_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
/* color split point verified on real machine */
|
||||
if (flipscreen_x)
|
||||
@ -1545,7 +1532,7 @@ static void frogger_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
}
|
||||
}
|
||||
|
||||
static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void stratgyx_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
UINT8 x;
|
||||
UINT8 *prom;
|
||||
@ -1580,7 +1567,7 @@ static void stratgyx_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
}
|
||||
}
|
||||
|
||||
static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void minefld_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
if (background_enable)
|
||||
{
|
||||
@ -1596,10 +1583,10 @@ static void minefld_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
|
||||
}
|
||||
else
|
||||
fillbitmap(bitmap,0,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
}
|
||||
|
||||
static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void rescue_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
if (background_enable)
|
||||
{
|
||||
@ -1614,10 +1601,10 @@ static void rescue_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
plot_box(bitmap, 248, 0, 16, 256, BACKGROUND_COLOR_BASE);
|
||||
}
|
||||
else
|
||||
fillbitmap(bitmap,0,&machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,0,cliprect);
|
||||
}
|
||||
|
||||
static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void mariner_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
UINT8 x;
|
||||
UINT8 *prom;
|
||||
@ -1659,7 +1646,7 @@ static void mariner_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
}
|
||||
}
|
||||
|
||||
static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
static void dambustr_draw_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int col1 = BACKGROUND_COLOR_BASE + dambustr_bg_color_1;
|
||||
int col2 = BACKGROUND_COLOR_BASE + dambustr_bg_color_2;
|
||||
@ -1677,7 +1664,7 @@ static void dambustr_draw_background(running_machine *machine, bitmap_t *bitmap)
|
||||
|
||||
}
|
||||
|
||||
static void dambustr_draw_upper_background(bitmap_t *bitmap)
|
||||
static void dambustr_draw_upper_background(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
static rectangle clip = { 0, 0, 0, 0 };
|
||||
|
||||
@ -1774,29 +1761,23 @@ void galaxian_init_stars(running_machine *machine, int colors_offset)
|
||||
}
|
||||
}
|
||||
|
||||
static void plot_star(running_machine *machine, bitmap_t *bitmap, int x, int y, int color)
|
||||
static void plot_star(bitmap_t *bitmap, int x, int y, int color, const rectangle *cliprect)
|
||||
{
|
||||
if (y < machine->screen[0].visarea.min_y ||
|
||||
y > machine->screen[0].visarea.max_y ||
|
||||
x < machine->screen[0].visarea.min_x ||
|
||||
x > machine->screen[0].visarea.max_x)
|
||||
return;
|
||||
|
||||
|
||||
if (flipscreen_x)
|
||||
x = 255 - x;
|
||||
|
||||
if (flipscreen_y)
|
||||
y = 255 - y;
|
||||
|
||||
*BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
|
||||
if ((x >= cliprect->min_x) && (x <= cliprect->max_x) && (y >= cliprect->min_y) && (y <= cliprect->max_y))
|
||||
*BITMAP_ADDR16(bitmap, y, x) = stars_colors_start + color;
|
||||
}
|
||||
|
||||
static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
static void noop_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
}
|
||||
|
||||
void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -1818,12 +1799,12 @@ void galaxian_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
|
||||
if ((y & 0x01) ^ ((x >> 3) & 0x01))
|
||||
{
|
||||
plot_star(machine, bitmap, x, y, stars[offs].color);
|
||||
plot_star(bitmap, x, y, stars[offs].color, cliprect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -1862,12 +1843,12 @@ static void scramble_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
break;
|
||||
}
|
||||
|
||||
plot_star(machine, bitmap, x, y, stars[offs].color);
|
||||
plot_star(bitmap, x, y, stars[offs].color, cliprect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -1908,12 +1889,12 @@ static void rescue_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
break;
|
||||
}
|
||||
|
||||
plot_star(machine, bitmap, x, y, stars[offs].color);
|
||||
plot_star(bitmap, x, y, stars[offs].color, cliprect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
UINT8 *prom;
|
||||
@ -1942,13 +1923,13 @@ static void mariner_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
{
|
||||
if (prom[(x/8 + 1) & 0x1f] & 0x04)
|
||||
{
|
||||
plot_star(machine, bitmap, x, y, stars[offs].color);
|
||||
plot_star(bitmap, x, y, stars[offs].color, cliprect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -1994,7 +1975,7 @@ static void jumpbug_draw_stars(running_machine *machine, bitmap_t *bitmap)
|
||||
/* no stars in the status area */
|
||||
if (x >= 240) continue;
|
||||
|
||||
plot_star(machine, bitmap, x, y, stars[offs].color);
|
||||
plot_star(bitmap, x, y, stars[offs].color, cliprect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2056,7 +2037,7 @@ static TILE_GET_INFO( rockclim_get_tile_info )
|
||||
SET_TILE_INFO(2, code, 0, 0);
|
||||
}
|
||||
|
||||
static void draw_bullets_common(running_machine *machine, bitmap_t *bitmap)
|
||||
static void draw_bullets_common(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int offs;
|
||||
|
||||
@ -2068,13 +2049,9 @@ static void draw_bullets_common(running_machine *machine, bitmap_t *bitmap)
|
||||
sy = 255 - galaxian_bulletsram[offs + 1];
|
||||
sx = 255 - galaxian_bulletsram[offs + 3];
|
||||
|
||||
if (sy < machine->screen[0].visarea.min_y ||
|
||||
sy > machine->screen[0].visarea.max_y)
|
||||
continue;
|
||||
|
||||
if (flipscreen_y) sy = 255 - sy;
|
||||
|
||||
draw_bullets(machine, bitmap, offs, sx, sy);
|
||||
draw_bullets(bitmap, offs, sx, sy, cliprect);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2147,12 +2124,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, UINT8 *spri
|
||||
|
||||
VIDEO_UPDATE( galaxian )
|
||||
{
|
||||
draw_background(screen->machine, bitmap);
|
||||
draw_background(bitmap, cliprect);
|
||||
|
||||
|
||||
if (galaxian_stars_on)
|
||||
{
|
||||
draw_stars(screen->machine, bitmap);
|
||||
draw_stars(screen->machine, bitmap, cliprect);
|
||||
}
|
||||
|
||||
|
||||
@ -2161,7 +2138,7 @@ VIDEO_UPDATE( galaxian )
|
||||
|
||||
if (draw_bullets)
|
||||
{
|
||||
draw_bullets_common(screen->machine, bitmap);
|
||||
draw_bullets_common(bitmap, cliprect);
|
||||
}
|
||||
|
||||
|
||||
@ -2180,21 +2157,21 @@ VIDEO_UPDATE( dambustr )
|
||||
int i, j;
|
||||
UINT8 color;
|
||||
|
||||
draw_background(screen->machine, bitmap);
|
||||
draw_background(bitmap, cliprect);
|
||||
|
||||
if (galaxian_stars_on)
|
||||
{
|
||||
draw_stars(screen->machine, bitmap);
|
||||
draw_stars(screen->machine, bitmap, cliprect);
|
||||
}
|
||||
|
||||
/* save the background for drawing it again later, if background has priority over characters */
|
||||
copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, &screen->machine->screen[0].visarea);
|
||||
copybitmap(dambustr_tmpbitmap, bitmap, 0, 0, 0, 0, NULL);
|
||||
|
||||
tilemap_draw(bitmap, 0, bg_tilemap, 0, 0);
|
||||
|
||||
if (draw_bullets)
|
||||
{
|
||||
draw_bullets_common(screen->machine, bitmap);
|
||||
draw_bullets_common(bitmap, cliprect);
|
||||
}
|
||||
|
||||
draw_sprites(screen->machine, bitmap, galaxian_spriteram, galaxian_spriteram_size);
|
||||
@ -2202,7 +2179,7 @@ VIDEO_UPDATE( dambustr )
|
||||
if (dambustr_bg_priority)
|
||||
{
|
||||
/* draw the upper part of the background, as it has priority */
|
||||
dambustr_draw_upper_background(bitmap);
|
||||
dambustr_draw_upper_background(bitmap, cliprect);
|
||||
|
||||
/* only rows with color code > 3 are stronger than the background */
|
||||
memset(dambustr_videoram2, 0x20, 0x0400);
|
||||
|
@ -122,7 +122,7 @@ static int collision_check(running_machine *machine, grchamp_state *state, bitma
|
||||
{
|
||||
int bgcolor = machine->pens[0];
|
||||
int sprite_transp = machine->pens[0x24];
|
||||
const rectangle *clip = &machine->screen[0].visarea;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int y0 = 240 - state->cpu0_out[3];
|
||||
int x0 = 256 - state->cpu0_out[2];
|
||||
int x,y,sx,sy;
|
||||
@ -150,8 +150,8 @@ static int collision_check(running_machine *machine, grchamp_state *state, bitma
|
||||
if( pixel != sprite_transp ){
|
||||
sx = x+x0;
|
||||
sy = y+y0;
|
||||
if( (sx >= clip->min_x) && (sx <= clip->max_x) &&
|
||||
(sy >= clip->min_y) && (sy <= clip->max_y) )
|
||||
if( (sx >= visarea->min_x) && (sx <= visarea->max_x) &&
|
||||
(sy >= visarea->min_y) && (sy <= visarea->max_y) )
|
||||
{
|
||||
// Collision check uses only 16 pens!
|
||||
pixel = *BITMAP_ADDR16(bitmap, sy, sx) % 16;
|
||||
|
@ -248,13 +248,8 @@ static void MB60553_draw(running_machine *machine, int numchip, bitmap_t* screen
|
||||
rectangle clip;
|
||||
MB60553_cur_chip = &MB60553[numchip];
|
||||
|
||||
|
||||
|
||||
|
||||
clip.min_x = machine->screen[0].visarea.min_x;
|
||||
clip.max_x = machine->screen[0].visarea.max_x;
|
||||
clip.min_y = machine->screen[0].visarea.min_y;
|
||||
clip.max_y = machine->screen[0].visarea.max_y;
|
||||
clip.min_x = video_screen_get_visible_area(machine->primary_screen)->min_x;
|
||||
clip.max_x = video_screen_get_visible_area(machine->primary_screen)->max_x;
|
||||
|
||||
for (line = 0; line < 224;line++)
|
||||
{
|
||||
|
@ -519,6 +519,7 @@ static int prev_poly_type;
|
||||
static void render_polygons(void)
|
||||
{
|
||||
int i, j;
|
||||
const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
|
||||
|
||||
// mame_printf_debug("K001005_fifo_ptr = %08X\n", K001005_3d_fifo_ptr);
|
||||
|
||||
@ -559,9 +560,9 @@ static void render_polygons(void)
|
||||
++index;
|
||||
|
||||
extra->color = color;
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, 4, v);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, 4, v);
|
||||
|
||||
i = index - 1;
|
||||
}
|
||||
@ -666,13 +667,13 @@ static void render_polygons(void)
|
||||
|
||||
if (num_verts < 3)
|
||||
{
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
|
||||
if (prev_poly_type)
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0]);
|
||||
// if (prev_poly_type)
|
||||
// poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0], &v[1]);
|
||||
// poly_render_quad(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &prev_v[3], &v[0], &v[1]);
|
||||
// else
|
||||
// poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
|
||||
// poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &prev_v[2], &v[0], &v[1]);
|
||||
|
||||
memcpy(&prev_v[0], &prev_v[2], sizeof(poly_vertex));
|
||||
memcpy(&prev_v[1], &prev_v[3], sizeof(poly_vertex));
|
||||
@ -681,10 +682,10 @@ static void render_polygons(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
|
||||
if (num_verts > 3)
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, num_verts, v);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, num_verts, v);
|
||||
|
||||
memcpy(prev_v, v, sizeof(poly_vertex) * 4);
|
||||
}
|
||||
@ -765,10 +766,10 @@ static void render_polygons(void)
|
||||
|
||||
extra->color = color;
|
||||
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[0], &v[1], &v[2]);
|
||||
if (new_verts > 1)
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline_tex, 4, new_verts + 2, v);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline_tex, 4, new_verts + 2, v);
|
||||
|
||||
memcpy(prev_v, v, sizeof(poly_vertex) * 4);
|
||||
};
|
||||
@ -824,10 +825,10 @@ static void render_polygons(void)
|
||||
|
||||
extra->color = color;
|
||||
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
if (num_verts > 3)
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, num_verts, v);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[2], &v[3], &v[0]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, num_verts, v);
|
||||
|
||||
memcpy(prev_v, v, sizeof(poly_vertex) * 4);
|
||||
|
||||
@ -883,10 +884,10 @@ static void render_polygons(void)
|
||||
|
||||
extra->color = color;
|
||||
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[1], &v[2]);
|
||||
if (new_verts > 1)
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], &Machine->screen[0].visarea, draw_scanline, 1, new_verts + 2, v);
|
||||
poly_render_triangle(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, &v[0], &v[2], &v[3]);
|
||||
// poly_render_polygon(poly, K001005_bitmap[K001005_bitmap_page], visarea, draw_scanline, 1, new_verts + 2, v);
|
||||
|
||||
memcpy(prev_v, v, sizeof(poly_vertex) * 4);
|
||||
};
|
||||
|
@ -225,7 +225,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
* Or maybe it switches from fading by scaling to fading using absolute addition and subtraction...
|
||||
* Or maybe they set transition type (there seems to be a cute scaling-squares transition in there somewhere)...
|
||||
*/
|
||||
static void transition_control(running_machine *machine, bitmap_t *bitmap)
|
||||
static void transition_control(bitmap_t *bitmap, const rectangle *cliprect)
|
||||
{
|
||||
int i, j ;
|
||||
|
||||
@ -247,9 +247,9 @@ static void transition_control(running_machine *machine, bitmap_t *bitmap)
|
||||
brigG = (INT32)((hng64_tcram[0x0000000a] >> 8) & 0xff) ;
|
||||
brigB = (INT32)((hng64_tcram[0x0000000a] >> 16) & 0xff) ;
|
||||
|
||||
for (i = machine->screen[0].visarea.min_x; i < machine->screen[0].visarea.max_x; i++)
|
||||
for (i = cliprect->min_x; i < cliprect->max_x; i++)
|
||||
{
|
||||
for (j = machine->screen[0].visarea.min_y; j < machine->screen[0].visarea.max_y; j++)
|
||||
for (j = cliprect->min_y; j < cliprect->max_y; j++)
|
||||
{
|
||||
UINT32* thePixel = BITMAP_ADDR32(bitmap, j, i);
|
||||
|
||||
@ -374,6 +374,7 @@ static void draw3d(running_machine *machine, bitmap_t *bitmap, const rectangle *
|
||||
UINT32 numPolys = 0 ;
|
||||
|
||||
struct polygon lastPoly = { 0 } ;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
// Set some matrices to the identity...
|
||||
SetIdentity(projectionMatrix) ;
|
||||
@ -860,11 +861,11 @@ static void draw3d(running_machine *machine, bitmap_t *bitmap, const rectangle *
|
||||
ndCoords[3] = polys[numPolys].vert[m].clipCoords[3] ;
|
||||
|
||||
// Final pixel values are garnered here :
|
||||
windowCoords[0] = (ndCoords[0]+1.0f) * ((float)(machine->screen[0].visarea.max_x) / 2.0f) + 0.0f ;
|
||||
windowCoords[1] = (ndCoords[1]+1.0f) * ((float)(machine->screen[0].visarea.max_y) / 2.0f) + 0.0f ;
|
||||
windowCoords[0] = (ndCoords[0]+1.0f) * ((float)(visarea->max_x) / 2.0f) + 0.0f ;
|
||||
windowCoords[1] = (ndCoords[1]+1.0f) * ((float)(visarea->max_y) / 2.0f) + 0.0f ;
|
||||
windowCoords[2] = (ndCoords[2]+1.0f) * 0.5f ;
|
||||
|
||||
windowCoords[1] = (float)machine->screen[0].visarea.max_y - windowCoords[1] ; // Flip Y
|
||||
windowCoords[1] = (float)visarea->max_y - windowCoords[1] ; // Flip Y
|
||||
|
||||
// Store the points in a list for later use...
|
||||
polys[numPolys].vert[m].clipCoords[0] = windowCoords[0] ;
|
||||
@ -913,7 +914,7 @@ static void draw3d(running_machine *machine, bitmap_t *bitmap, const rectangle *
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
// Reset the depth buffer...
|
||||
for (i = 0; i < (machine->screen[0].visarea.max_x)*(machine->screen[0].visarea.max_y); i++)
|
||||
for (i = 0; i < (visarea->max_x)*(visarea->max_y); i++)
|
||||
depthBuffer[i] = 100.0f ;
|
||||
|
||||
for (i = 0; i < numPolys; i++)
|
||||
@ -1058,6 +1059,8 @@ static void plotTilemap3Line(running_machine *machine,
|
||||
|
||||
float pixStride, pixOffset ;
|
||||
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
// mame_printf_debug("(%d,%d) (%d,%d)\n", startX, startY, endX, endY) ;
|
||||
|
||||
// CLAMP - BUT I'M PRETTY SURE THIS ISN'T QUITE RIGHT !!! ???
|
||||
@ -1068,7 +1071,7 @@ static void plotTilemap3Line(running_machine *machine,
|
||||
|
||||
numPix = gatherPixelsForLine(tilemapBitmap, startX, startY, endX, endY, penList) ;
|
||||
|
||||
pixStride = (float)numPix / (float)(machine->screen[0].visarea.max_x-1) ;
|
||||
pixStride = (float)numPix / (float)(visarea->max_x-1) ;
|
||||
pixOffset = 0 ;
|
||||
|
||||
if (numPix == 0)
|
||||
@ -1077,7 +1080,7 @@ static void plotTilemap3Line(running_machine *machine,
|
||||
// mame_printf_debug("numpix %d ps %f po %f s(%d,%d) e(%d,%d)\n", numPix, pixStride, pixOffset, startX, startY, endX, endY) ;
|
||||
|
||||
// Draw out the screen's line...
|
||||
for (i = machine->screen[0].visarea.min_x; i < machine->screen[0].visarea.max_x; i++)
|
||||
for (i = visarea->min_x; i < visarea->max_x; i++)
|
||||
{
|
||||
// Nearest-neighbor interpolation for now (but i doubt it does linear)
|
||||
UINT16 tmPen = penList[(int)pixOffset] ;
|
||||
@ -1093,10 +1096,11 @@ static void hng64_drawtilemap3(running_machine *machine, bitmap_t *bitmap, const
|
||||
int i ;
|
||||
|
||||
bitmap_t *srcbitmap = tilemap_get_pixmap( hng64_tilemap3 );
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
// usrintf_showmessage("%d", hng64_hackTm3Count) ;
|
||||
|
||||
if (hng64_hackTm3Count/4 < machine->screen[0].visarea.max_y)
|
||||
if (hng64_hackTm3Count/4 < visarea->max_y)
|
||||
{
|
||||
for (i = 0; i < hng64_hackTm3Count/4; i++)
|
||||
{
|
||||
@ -1113,7 +1117,7 @@ static void hng64_drawtilemap3(running_machine *machine, bitmap_t *bitmap, const
|
||||
(INT16)((hng64_videoram[address+0x2]&0xffff0000) >> 16),
|
||||
(INT16)((hng64_videoram[address+0x1]&0xffff0000) >> 16),
|
||||
(INT16)((hng64_videoram[address+0x3]&0xffff0000) >> 16),
|
||||
(machine->screen[0].visarea.max_y-1)-i,
|
||||
(visarea->max_y-1)-i,
|
||||
bitmap) ;
|
||||
}
|
||||
}
|
||||
@ -1285,7 +1289,7 @@ VIDEO_UPDATE( hng64 )
|
||||
/* AJG */
|
||||
// if(input_code_pressed(KEYCODE_D))
|
||||
|
||||
transition_control(screen->machine, bitmap) ;
|
||||
transition_control(bitmap, cliprect) ;
|
||||
|
||||
// mame_printf_debug("FRAME DONE %d\n", frameCount) ;
|
||||
frameCount++ ;
|
||||
@ -1296,6 +1300,8 @@ VIDEO_UPDATE( hng64 )
|
||||
|
||||
VIDEO_START( hng64 )
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
hng64_tilemap0 = tilemap_create(get_hng64_tile0_info, tilemap_scan_rows, 8, 8, 128,128); /* 128x128x4 = 0x10000 */
|
||||
hng64_tilemap1 = tilemap_create(get_hng64_tile1_info, tilemap_scan_rows, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
|
||||
hng64_tilemap2 = tilemap_create(get_hng64_tile2_info, tilemap_scan_rows, 16, 16, 128,128); /* 128x128x4 = 0x10000 */
|
||||
@ -1306,7 +1312,7 @@ VIDEO_START( hng64 )
|
||||
tilemap_set_transparent_pen(hng64_tilemap3,0);
|
||||
|
||||
// 3d Buffer Allocation
|
||||
depthBuffer = (float*)auto_malloc((machine->screen[0].visarea.max_x)*(machine->screen[0].visarea.max_y)*sizeof(float)) ;
|
||||
depthBuffer = (float*)auto_malloc((visarea->max_x)*(visarea->max_y)*sizeof(float)) ;
|
||||
|
||||
// The general display list of polygons in the scene...
|
||||
// !! This really should be a dynamic array !!
|
||||
@ -1708,7 +1714,7 @@ INLINE void FillSmoothTexPCHorizontalLine(running_machine *machine, bitmap_t *Co
|
||||
float g_start, float g_delta, float b_start, float b_delta,
|
||||
float s_start, float s_delta, float t_start, float t_delta)
|
||||
{
|
||||
float *dp = &(depthBuffer[y*machine->screen[0].visarea.max_x+x_start]);
|
||||
float *dp = &(depthBuffer[y*video_screen_get_visible_area(machine->primary_screen)->max_x+x_start]);
|
||||
|
||||
const UINT8 *gfx = memory_region(REGION_GFX3);
|
||||
const UINT8 *textureOffset ;
|
||||
|
@ -237,10 +237,12 @@ static void blitter_x1800x01_xxxxxx_xxxxxx(UINT32 command, UINT32 a1flags, UINT3
|
||||
|
||||
INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
|
||||
{
|
||||
int width = machine->screen[0].visarea.max_x + 1 - machine->screen[0].visarea.min_x;
|
||||
int height = machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y;
|
||||
*x = machine->screen[0].visarea.min_x + (((readinputport(3 + player * 2) & 0xff) * width) >> 8);
|
||||
*y = machine->screen[0].visarea.min_y + (((readinputport(4 + player * 2) & 0xff) * height) >> 8);
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
int width = visarea->max_x + 1 - visarea->min_x;
|
||||
int height = visarea->max_y + 1 - visarea->min_y;
|
||||
*x = visarea->min_x + (((readinputport(3 + player * 2) & 0xff) * width) >> 8);
|
||||
*y = visarea->min_y + (((readinputport(4 + player * 2) & 0xff) * height) >> 8);
|
||||
}
|
||||
|
||||
|
||||
@ -756,12 +758,13 @@ static TIMER_CALLBACK( cojag_scanline_update )
|
||||
{
|
||||
int vc = param & 0xffff;
|
||||
int hdb = param >> 16;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
/* only run if video is enabled and we are past the "display begin" */
|
||||
if ((gpu_regs[VMODE] & 1) && vc >= (gpu_regs[VDB] & 0x7ff))
|
||||
{
|
||||
UINT32 *dest = BITMAP_ADDR32(screen_bitmap, vc / 2, 0);
|
||||
int maxx = machine->screen[0].visarea.max_x;
|
||||
int maxx = visarea->max_x;
|
||||
int hde = effective_hvalue(gpu_regs[HDE]) / 2;
|
||||
UINT16 scanline[360];
|
||||
int x;
|
||||
@ -770,7 +773,7 @@ static TIMER_CALLBACK( cojag_scanline_update )
|
||||
if (ENABLE_BORDERS && vc % 2 == 0)
|
||||
{
|
||||
rgb_t border = MAKE_RGB(gpu_regs[BORD1] & 0xff, gpu_regs[BORD1] >> 8, gpu_regs[BORD2] & 0xff);
|
||||
for (x = machine->screen[0].visarea.min_x; x <= machine->screen[0].visarea.max_x; x++)
|
||||
for (x = visarea->min_x; x <= visarea->max_x; x++)
|
||||
dest[x] = border;
|
||||
}
|
||||
|
||||
|
@ -148,30 +148,18 @@ static void pandora_draw(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
(tilecolour & 0xf0) >> 4,
|
||||
flipx, flipy,
|
||||
sx,sy,
|
||||
&machine->screen[0].visarea,TRANSPARENCY_PEN,0);
|
||||
cliprect,TRANSPARENCY_PEN,0);
|
||||
}
|
||||
}
|
||||
|
||||
void pandora_eof(running_machine *machine)
|
||||
{
|
||||
rectangle clip;
|
||||
|
||||
/* draw top of screen */
|
||||
clip.min_x = machine->screen[0].visarea.min_x;
|
||||
clip.max_x = machine->screen[0].visarea.max_x;
|
||||
clip.min_y = machine->screen[0].visarea.min_y;
|
||||
clip.max_y = machine->screen[0].visarea.max_y;
|
||||
|
||||
if (!pandora_spriteram)
|
||||
{
|
||||
printf("ERROR: pandora_eof with no pandora_spriteram\n");
|
||||
return;
|
||||
}
|
||||
assert(pandora_spriteram != NULL);
|
||||
|
||||
// the games can disable the clearing of the sprite bitmap, to leave sprite trails
|
||||
if (pandora_clear_bitmap) fillbitmap(pandora_sprites_bitmap,0,&clip);
|
||||
if (pandora_clear_bitmap) fillbitmap(pandora_sprites_bitmap,0,video_screen_get_visible_area(machine->primary_screen));
|
||||
|
||||
pandora_draw(machine, pandora_sprites_bitmap, &clip);
|
||||
pandora_draw(machine, pandora_sprites_bitmap, video_screen_get_visible_area(machine->primary_screen));
|
||||
}
|
||||
|
||||
void pandora_start(UINT8 region, int x, int y)
|
||||
|
@ -153,7 +153,7 @@ VIDEO_START( kaneko16_1xVIEW2 )
|
||||
case 256: dx = 0x5b; break;
|
||||
default: dx = 0;
|
||||
}
|
||||
switch (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y + 1)
|
||||
switch (video_screen_get_visible_area(machine->primary_screen)->max_y - video_screen_get_visible_area(machine->primary_screen)->min_y + 1)
|
||||
{
|
||||
case 240- 8: dy = +0x08; break; /* blazeon */
|
||||
case 240-16: dy = -0x08; break; /* berlwall, bakubrk */
|
||||
@ -193,7 +193,7 @@ VIDEO_START( kaneko16_2xVIEW2 )
|
||||
case 256: dx = 0x5b; break;
|
||||
default: dx = 0;
|
||||
}
|
||||
switch (machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y + 1)
|
||||
switch (video_screen_get_visible_area(machine->primary_screen)->max_y - video_screen_get_visible_area(machine->primary_screen)->min_y + 1)
|
||||
{
|
||||
case 240- 8: dy = +0x08; break;
|
||||
case 240-16: dy = -0x08; break;
|
||||
@ -377,12 +377,12 @@ static int kaneko16_parse_sprite_type012(running_machine *machine, int i, struct
|
||||
if (kaneko16_sprite_flipy)
|
||||
{
|
||||
s->yoffs -= kaneko16_sprites_regs[0x2/2];
|
||||
s->yoffs -= machine->screen[0].visarea.min_y<<6;
|
||||
s->yoffs -= video_screen_get_visible_area(machine->primary_screen)->min_y<<6;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->yoffs -= kaneko16_sprites_regs[0x2/2];
|
||||
s->yoffs += machine->screen[0].visarea.min_y<<6;
|
||||
s->yoffs += video_screen_get_visible_area(machine->primary_screen)->min_y<<6;
|
||||
}
|
||||
|
||||
return ( (attr & 0x2000) ? USE_LATCHED_XY : 0 ) |
|
||||
|
@ -187,17 +187,18 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
const gfx_element *gfx = machine->gfx[1 + sprite_bank];
|
||||
int i, j;
|
||||
static const int pribase[4]={0x0180, 0x0080, 0x0100, 0x0000};
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
/* score covers sprites */
|
||||
if (flipscreen)
|
||||
{
|
||||
if (clip.max_y > machine->screen[0].visarea.max_y - 64)
|
||||
clip.max_y = machine->screen[0].visarea.max_y - 64;
|
||||
if (clip.max_y > visarea->max_y - 64)
|
||||
clip.max_y = visarea->max_y - 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (clip.min_y < machine->screen[0].visarea.min_y + 64)
|
||||
clip.min_y = machine->screen[0].visarea.min_y + 64;
|
||||
if (clip.min_y < visarea->min_y + 64)
|
||||
clip.min_y = visarea->min_y + 64;
|
||||
}
|
||||
|
||||
for (i=0; i<4; i++)
|
||||
|
@ -3782,7 +3782,7 @@ void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, i
|
||||
|
||||
if (VERBOSE)
|
||||
{
|
||||
if (machine->screen[0].format == BITMAP_FORMAT_RGB32)
|
||||
if (video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_RGB32)
|
||||
{
|
||||
if ((machine->config->video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS)
|
||||
popmessage("driver missing SHADOWS or HIGHLIGHTS flag");
|
||||
@ -7295,12 +7295,13 @@ void K054338_fill_backcolor(running_machine *machine, bitmap_t *bitmap, int mode
|
||||
int clipx, clipy, clipw, cliph, i, dst_pitch;
|
||||
int BGC_CBLK, BGC_SET;
|
||||
UINT32 *dst_ptr, *pal_ptr;
|
||||
register int bgcolor;
|
||||
int bgcolor;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
clipx = machine->screen[0].visarea.min_x & ~3;
|
||||
clipy = machine->screen[0].visarea.min_y;
|
||||
clipw = (machine->screen[0].visarea.max_x - clipx + 4) & ~3;
|
||||
cliph = machine->screen[0].visarea.max_y - clipy + 1;
|
||||
clipx = visarea->min_x & ~3;
|
||||
clipy = visarea->min_y;
|
||||
clipw = (visarea->max_x - clipx + 4) & ~3;
|
||||
cliph = visarea->max_y - clipy + 1;
|
||||
|
||||
dst_ptr = BITMAP_ADDR32(bitmap, clipy, 0);
|
||||
dst_pitch = bitmap->rowpixels;
|
||||
@ -7769,7 +7770,7 @@ void K053250_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *c
|
||||
static int pmode[2] = {-1,-1};
|
||||
static int kc=-1, kk=0, kxx=-105, kyy=0;
|
||||
|
||||
const rectangle area = machine->screen[0].visarea;
|
||||
const rectangle area = *video_screen_get_visible_area(machine->primary_screen);
|
||||
UINT16 *line;
|
||||
int delta, dim1, dim1_max, dim2_max;
|
||||
UINT32 mask1, mask2;
|
||||
|
@ -131,10 +131,10 @@ VIDEO_START( labyrunr )
|
||||
tilemap_set_transparent_pen(layer0,0);
|
||||
tilemap_set_transparent_pen(layer1,0);
|
||||
|
||||
clip0 = machine->screen[0].visarea;
|
||||
clip0 = *video_screen_get_visible_area(machine->primary_screen);
|
||||
clip0.min_x += 40;
|
||||
|
||||
clip1 = machine->screen[0].visarea;
|
||||
clip1 = *video_screen_get_visible_area(machine->primary_screen);
|
||||
clip1.max_x = 39;
|
||||
clip1.min_x = 0;
|
||||
|
||||
|
@ -93,7 +93,7 @@ static TILE_GET_INFO( get_tile_info )
|
||||
|
||||
VIDEO_START( lemmings )
|
||||
{
|
||||
bitmap0 = auto_bitmap_alloc(2048,256,machine->screen[0].format);
|
||||
bitmap0 = auto_bitmap_alloc(2048,256,video_screen_get_format(machine->primary_screen));
|
||||
vram_tilemap = tilemap_create(get_tile_info,tilemap_scan_cols,8,8,64,32);
|
||||
|
||||
vram_buffer = (UINT8*)auto_malloc(2048*64); /* 64 bytes per VRAM character */
|
||||
|
@ -36,8 +36,10 @@ static UINT8 blank_palette;
|
||||
|
||||
INLINE void get_crosshair_xy(running_machine *machine, int player, int *x, int *y)
|
||||
{
|
||||
int width = machine->screen[0].visarea.max_x + 1 - machine->screen[0].visarea.min_x;
|
||||
int height = machine->screen[0].visarea.max_y + 1 - machine->screen[0].visarea.min_y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int width = visarea->max_x + 1 - visarea->min_x;
|
||||
int height = visarea->max_y + 1 - visarea->min_y;
|
||||
|
||||
*x = ((readinputport(2 + player * 2) & 0xff) * width) / 255;
|
||||
*y = ((readinputport(3 + player * 2) & 0xff) * height) / 255;
|
||||
}
|
||||
|
@ -199,15 +199,17 @@ static void lorddgun_calc_gun_scr(int i)
|
||||
|
||||
void lordgun_update_gun(int i)
|
||||
{
|
||||
const rectangle *visarea = video_screen_get_visible_area(Machine->primary_screen);
|
||||
|
||||
lordgun_gun[i].hw_x = readinputport(5+i);
|
||||
lordgun_gun[i].hw_y = readinputport(7+i);
|
||||
|
||||
lorddgun_calc_gun_scr(i);
|
||||
|
||||
if ( (lordgun_gun[i].scr_x < Machine->screen[0].visarea.min_x) ||
|
||||
(lordgun_gun[i].scr_x > Machine->screen[0].visarea.max_x) ||
|
||||
(lordgun_gun[i].scr_y < Machine->screen[0].visarea.min_y) ||
|
||||
(lordgun_gun[i].scr_y > Machine->screen[0].visarea.max_y) )
|
||||
if ( (lordgun_gun[i].scr_x < visarea->min_x) ||
|
||||
(lordgun_gun[i].scr_x > visarea->max_x) ||
|
||||
(lordgun_gun[i].scr_y < visarea->min_y) ||
|
||||
(lordgun_gun[i].scr_y > visarea->max_y) )
|
||||
lordgun_gun[i].hw_x = lordgun_gun[i].hw_y = 0;
|
||||
}
|
||||
|
||||
|
@ -301,6 +301,7 @@ WRITE8_HANDLER( alpha1v_flipscreen_w )
|
||||
static void draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int xpos, int ypos, int image)
|
||||
{
|
||||
rectangle rect;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
if (flip_screen_get())
|
||||
{
|
||||
@ -331,8 +332,8 @@ static void draw_background(running_machine *machine, bitmap_t *bitmap, const re
|
||||
cliprect,
|
||||
TRANSPARENCY_PEN, 0);
|
||||
|
||||
rect.min_x = machine->screen[0].visarea.min_x;
|
||||
rect.max_x = machine->screen[0].visarea.max_x;
|
||||
rect.min_x = visarea->min_x;
|
||||
rect.max_x = visarea->max_x;
|
||||
|
||||
if (flip_screen_get())
|
||||
{
|
||||
|
@ -180,11 +180,16 @@ static UINT32 yard_tilemap_scan_rows( UINT32 col, UINT32 row, UINT32 num_cols, U
|
||||
|
||||
VIDEO_START( yard )
|
||||
{
|
||||
bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, 8, 8, 64, 32);
|
||||
tilemap_set_scrolldx(bg_tilemap, machine->screen[0].visarea.min_x, machine->screen[0].width - (machine->screen[0].visarea.max_x + 1));
|
||||
tilemap_set_scrolldy(bg_tilemap, machine->screen[0].visarea.min_y - 8, machine->screen[0].height + 16 - (machine->screen[0].visarea.max_y + 1));
|
||||
int width = video_screen_get_width(machine->primary_screen);
|
||||
int height = video_screen_get_height(machine->primary_screen);
|
||||
bitmap_format format = video_screen_get_format(machine->primary_screen);
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
scroll_panel_bitmap = auto_bitmap_alloc(SCROLL_PANEL_WIDTH, machine->screen[0].height, machine->screen[0].format);
|
||||
bg_tilemap = tilemap_create(yard_get_bg_tile_info, yard_tilemap_scan_rows, 8, 8, 64, 32);
|
||||
tilemap_set_scrolldx(bg_tilemap, visarea->min_x, width - (visarea->max_x + 1));
|
||||
tilemap_set_scrolldy(bg_tilemap, visarea->min_y - 8, height + 16 - (visarea->max_y + 1));
|
||||
|
||||
scroll_panel_bitmap = auto_bitmap_alloc(SCROLL_PANEL_WIDTH, height, format);
|
||||
}
|
||||
|
||||
|
||||
@ -217,6 +222,7 @@ WRITE8_HANDLER( yard_flipscreen_w )
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
|
||||
{
|
||||
int offs;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
for (offs = spriteram_size - 4; offs >= 0; offs -= 4)
|
||||
{
|
||||
@ -254,8 +260,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
sy2 = sy1 + 0x10;
|
||||
}
|
||||
|
||||
DRAW_SPRITE(code1 + 256 * bank, machine->screen[0].visarea.min_y + sy1)
|
||||
DRAW_SPRITE(code2 + 256 * bank, machine->screen[0].visarea.min_y + sy2)
|
||||
DRAW_SPRITE(code1 + 256 * bank, visarea->min_y + sy1)
|
||||
DRAW_SPRITE(code2 + 256 * bank, visarea->min_y + sy2)
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,14 +288,15 @@ static void draw_panel( running_machine *machine, bitmap_t *bitmap, const rectan
|
||||
1*8, 31*8-1
|
||||
};
|
||||
rectangle clip = flip_screen_get() ? clippanelflip : clippanel;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int sx = flip_screen_get() ? cliprect->min_x - 8 : cliprect->max_x + 1 - SCROLL_PANEL_WIDTH;
|
||||
int yoffs = flip_screen_get() ? -40 : -16;
|
||||
|
||||
clip.min_y += machine->screen[0].visarea.min_y + yoffs;
|
||||
clip.max_y += machine->screen[0].visarea.max_y + yoffs;
|
||||
clip.min_y += visarea->min_y + yoffs;
|
||||
clip.max_y += visarea->max_y + yoffs;
|
||||
|
||||
copybitmap(bitmap, scroll_panel_bitmap, flip_screen_get(), flip_screen_get(),
|
||||
sx, machine->screen[0].visarea.min_y + yoffs, &clip);
|
||||
sx, visarea->min_y + yoffs, &clip);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ VIDEO_START( magmax )
|
||||
prom_tab = auto_malloc(256 * sizeof(UINT32));
|
||||
|
||||
/* Allocate temporary bitmap */
|
||||
tmpbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
|
||||
tmpbitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
|
||||
|
||||
for (i=0; i<256; i++)
|
||||
{
|
||||
@ -107,7 +107,7 @@ VIDEO_UPDATE( magmax )
|
||||
UINT32 scroll_v = (*magmax_scroll_y) & 0xff;
|
||||
|
||||
/*clear background-over-sprites bitmap*/
|
||||
fillbitmap(tmpbitmap, 0, &screen->machine->screen[0].visarea);
|
||||
fillbitmap(tmpbitmap, 0, NULL);
|
||||
|
||||
for (v = 2*8; v < 30*8; v++) /*only for visible area*/
|
||||
{
|
||||
|
@ -166,7 +166,7 @@ VIDEO_START( marvins )
|
||||
tx_tilemap = tilemap_create(get_tx_tilemap_info,tilemap_scan_cols,8,8,32,32);
|
||||
|
||||
{
|
||||
tilemap_clip = machine->screen[0].visarea;
|
||||
tilemap_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
if (snk_gamegroup != 1) // not Mad Crasher
|
||||
{
|
||||
tilemap_clip.max_x-=16;
|
||||
|
@ -125,11 +125,13 @@ WRITE8_HANDLER( matmania_paletteram_w )
|
||||
***************************************************************************/
|
||||
VIDEO_START( matmania )
|
||||
{
|
||||
/* Mat Mania has a virtual screen twice as large as the visible screen */
|
||||
tmpbitmap = auto_bitmap_alloc(machine->screen[0].width,2* machine->screen[0].height,machine->screen[0].format);
|
||||
int width = video_screen_get_width(machine->primary_screen);
|
||||
int height = video_screen_get_height(machine->primary_screen);
|
||||
bitmap_format format = video_screen_get_format(machine->primary_screen);
|
||||
|
||||
/* Mat Mania has a virtual screen twice as large as the visible screen */
|
||||
tmpbitmap2 = auto_bitmap_alloc(machine->screen[0].width,2 * machine->screen[0].height,machine->screen[0].format);
|
||||
tmpbitmap = auto_bitmap_alloc(width, 2*height, format);
|
||||
tmpbitmap2 = auto_bitmap_alloc(width, 2*height, format);
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,7 +188,7 @@ WRITE16_HANDLER( zwackery_spriteram_w )
|
||||
|
||||
static void mcr68_update_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority)
|
||||
{
|
||||
rectangle sprite_clip = machine->screen[0].visarea;
|
||||
rectangle sprite_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
int offs;
|
||||
|
||||
/* adjust for clipping */
|
||||
|
@ -109,7 +109,7 @@ WRITE8_HANDLER( megazone_flipscreen_w )
|
||||
|
||||
VIDEO_START( megazone )
|
||||
{
|
||||
tmpbitmap = auto_bitmap_alloc(256,256,machine->screen[0].format);
|
||||
tmpbitmap = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
|
||||
|
@ -737,6 +737,7 @@ static void draw_tilemap(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
tilemap_draw(bitmap,cliprect,tmap, flags, priority);
|
||||
#else
|
||||
int x,y,i;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
/* sub tile placement */
|
||||
// sx = sx - (wx & ~7) + (wx & 7);
|
||||
@ -765,17 +766,17 @@ static void draw_tilemap(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
clip.max_x = clip.min_x + (WIN_NX-1)*8 - 1;
|
||||
clip.max_y = clip.min_y + (WIN_NY-1)*8 - 1;
|
||||
|
||||
if (clip.min_x > machine->screen[0].visarea.max_x) continue;
|
||||
if (clip.min_y > machine->screen[0].visarea.max_y) continue;
|
||||
if (clip.min_x > visarea->max_x) continue;
|
||||
if (clip.min_y > visarea->max_y) continue;
|
||||
|
||||
if (clip.max_x < machine->screen[0].visarea.min_x) continue;
|
||||
if (clip.max_y < machine->screen[0].visarea.min_y) continue;
|
||||
if (clip.max_x < visarea->min_x) continue;
|
||||
if (clip.max_y < visarea->min_y) continue;
|
||||
|
||||
if (clip.min_x < machine->screen[0].visarea.min_x) clip.min_x = machine->screen[0].visarea.min_x;
|
||||
if (clip.max_x > machine->screen[0].visarea.max_x) clip.max_x = machine->screen[0].visarea.max_x;
|
||||
if (clip.min_x < visarea->min_x) clip.min_x = visarea->min_x;
|
||||
if (clip.max_x > visarea->max_x) clip.max_x = visarea->max_x;
|
||||
|
||||
if (clip.min_y < machine->screen[0].visarea.min_y) clip.min_y = machine->screen[0].visarea.min_y;
|
||||
if (clip.max_y > machine->screen[0].visarea.max_y) clip.max_y = machine->screen[0].visarea.max_y;
|
||||
if (clip.min_y < visarea->min_y) clip.min_y = visarea->min_y;
|
||||
if (clip.max_y > visarea->max_y) clip.max_y = visarea->max_y;
|
||||
|
||||
/* The clip region's width must be a multiple of 8!
|
||||
This fact renderes the function useless, as far as
|
||||
|
@ -98,87 +98,6 @@ if (offs >= mexico86_objectram_size+0x1c0) continue;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//AT
|
||||
#if 0 // old code
|
||||
VIDEO_UPDATE( kikikai )
|
||||
{
|
||||
int offs;
|
||||
int sx,sy,xc,yc;
|
||||
int gfx_num,gfx_attr,gfx_offs;
|
||||
|
||||
|
||||
/* Bubble Bobble doesn't have a real video RAM. All graphics (characters */
|
||||
/* and sprites) are stored in the same memory region, and information on */
|
||||
/* the background character columns is stored inthe area dd00-dd3f */
|
||||
|
||||
/* This clears & redraws the entire screen each pass */
|
||||
fillbitmap(bitmap,255,&machine->screen[0].visarea);
|
||||
|
||||
sx = 0;
|
||||
/* the score display seems to be outside of the main objectram. */
|
||||
for (offs = 0;offs < mexico86_objectram_size+0x200;offs += 4)
|
||||
{
|
||||
int height;
|
||||
|
||||
if (offs >= mexico86_objectram_size && offs < mexico86_objectram_size+0x180) continue;
|
||||
if (offs >= mexico86_objectram_size+0x1c0) continue;
|
||||
|
||||
/* skip empty sprites */
|
||||
/* this is dword aligned so the UINT32 * cast shouldn't give problems */
|
||||
/* on any architecture */
|
||||
if (*(UINT32 *)(&mexico86_objectram[offs]) == 0)
|
||||
continue;
|
||||
|
||||
gfx_num = mexico86_objectram[offs + 1];
|
||||
gfx_attr = mexico86_objectram[offs + 3];
|
||||
|
||||
if ((gfx_num & 0x80) == 0) /* 16x16 sprites */
|
||||
{
|
||||
gfx_offs = ((gfx_num & 0x1f) * 0x80) + ((gfx_num & 0x60) >> 1) + 12;
|
||||
height = 2;
|
||||
}
|
||||
else /* tilemaps (each sprite is a 16x256 column) */
|
||||
{
|
||||
gfx_offs = ((gfx_num & 0x3f) * 0x80);
|
||||
height = 32;
|
||||
}
|
||||
|
||||
if ((gfx_num & 0xc0) == 0xc0) /* next column */
|
||||
sx += 16;
|
||||
else
|
||||
{
|
||||
sx = mexico86_objectram[offs + 2];
|
||||
// if (gfx_attr & 0x40) sx -= 256;
|
||||
}
|
||||
sy = 256 - height*8 - (mexico86_objectram[offs + 0]);
|
||||
|
||||
for (xc = 0;xc < 2;xc++)
|
||||
{
|
||||
for (yc = 0;yc < height;yc++)
|
||||
{
|
||||
int goffs,code,color,flipx,flipy,x,y;
|
||||
|
||||
goffs = gfx_offs + xc * 0x40 + yc * 0x02;
|
||||
code = mexico86_videoram[goffs] + ((mexico86_videoram[goffs + 1] & 0x1f) << 8);
|
||||
color = (mexico86_videoram[goffs + 1] & 0xe0) >> 5;
|
||||
flipx = 0;
|
||||
flipy = 0;
|
||||
// x = sx + xc * 8;
|
||||
x = (sx + xc * 8) & 0xff;
|
||||
y = (sy + yc * 8) & 0xff;
|
||||
|
||||
drawgfx(bitmap,machine->gfx[0],
|
||||
code,
|
||||
color,
|
||||
flipx,flipy,
|
||||
x,y,
|
||||
&machine->screen[0].visarea,TRANSPARENCY_PEN,15);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
VIDEO_UPDATE( kikikai )
|
||||
{
|
||||
@ -245,4 +164,3 @@ VIDEO_UPDATE( kikikai )
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
//ZT
|
||||
|
@ -366,7 +366,7 @@ static void process_dma_queue(running_machine *machine)
|
||||
extra->dither = ((dma_data[0] & 0x2000) != 0);
|
||||
|
||||
/* render as a quad */
|
||||
poly_render_quad(poly, dest, &machine->screen[0].visarea, callback, textured ? 2 : 0, &vert[0], &vert[1], &vert[2], &vert[3]);
|
||||
poly_render_quad(poly, dest, video_screen_get_visible_area(machine->primary_screen), callback, textured ? 2 : 0, &vert[0], &vert[1], &vert[2], &vert[3]);
|
||||
}
|
||||
|
||||
|
||||
@ -572,7 +572,7 @@ VIDEO_UPDATE( midvunit )
|
||||
|
||||
/* adjust the offset */
|
||||
offset += xoffs;
|
||||
offset += 512 * (cliprect->min_y - screen->machine->screen[0].visarea.min_y);
|
||||
offset += 512 * (cliprect->min_y - video_screen_get_visible_area(screen)->min_y);
|
||||
|
||||
/* loop over rows */
|
||||
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
|
||||
|
@ -23,8 +23,8 @@ static UINT8 *mjsister_videoram0, *mjsister_videoram1;
|
||||
|
||||
VIDEO_START( mjsister )
|
||||
{
|
||||
mjsister_tmpbitmap0 = auto_bitmap_alloc(256,256,machine->screen[0].format);
|
||||
mjsister_tmpbitmap1 = auto_bitmap_alloc(256,256,machine->screen[0].format);
|
||||
mjsister_tmpbitmap0 = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
|
||||
mjsister_tmpbitmap1 = auto_bitmap_alloc(256,256,video_screen_get_format(machine->primary_screen));
|
||||
mjsister_videoram0 = auto_malloc(0x8000);
|
||||
mjsister_videoram1 = auto_malloc(0x8000);
|
||||
}
|
||||
|
@ -2703,8 +2703,9 @@ static void model2_exit(running_machine *machine)
|
||||
|
||||
VIDEO_START(model2)
|
||||
{
|
||||
int width = machine->screen[0].visarea.max_x - machine->screen[0].visarea.min_x;
|
||||
int height = machine->screen[0].visarea.max_y - machine->screen[0].visarea.min_y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int width = visarea->max_x - visarea->min_x;
|
||||
int height = visarea->max_y - visarea->min_y;
|
||||
|
||||
sys24_tile_vh_start(machine, 0x3fff);
|
||||
sys24_bitmap = bitmap_alloc(width, height+4, BITMAP_FORMAT_INDEXED16);
|
||||
|
@ -43,7 +43,7 @@ VIDEO_START(moo)
|
||||
{
|
||||
int offsx, offsy;
|
||||
|
||||
assert(machine->screen[0].format == BITMAP_FORMAT_RGB32);
|
||||
assert(video_screen_get_format(machine->primary_screen) == BITMAP_FORMAT_RGB32);
|
||||
|
||||
alpha_enabled = 0;
|
||||
|
||||
|
@ -39,7 +39,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
const gfx_element *gfx = machine->gfx[0];
|
||||
const UINT8 *source = spriteram;
|
||||
const UINT8 *finish = source+0x100;
|
||||
rectangle clip = machine->screen[0].visarea;
|
||||
rectangle clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
clip.max_x -= 24;
|
||||
clip.min_x += 16;
|
||||
while( source<finish ){
|
||||
|
@ -59,7 +59,7 @@ WRITE8_HANDLER( mnchmobl_sprite_tile_w ){ mnchmobl_sprite_tile[offset] = data; }
|
||||
|
||||
VIDEO_START( mnchmobl )
|
||||
{
|
||||
tmpbitmap = auto_bitmap_alloc(512,512,machine->screen[0].format);
|
||||
tmpbitmap = auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
static void draw_status(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
|
||||
|
@ -98,6 +98,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
{
|
||||
rectangle clip = *cliprect;
|
||||
const gfx_element *gfx = machine->gfx[1];
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
int offs;
|
||||
|
||||
for (offs = 0;offs < spriteram_size;offs += 4)
|
||||
@ -113,12 +114,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
code+=(attr&0x0c)<<6;
|
||||
|
||||
if ((control_byte & 0xa))
|
||||
clip.max_y = machine->screen[0].visarea.max_y;
|
||||
clip.max_y = visarea->max_y;
|
||||
else
|
||||
if (flip_screen_get())
|
||||
clip.min_y = machine->screen[0].visarea.min_y + 56;
|
||||
clip.min_y = visarea->min_y + 56;
|
||||
else
|
||||
clip.max_y = machine->screen[0].visarea.max_y - 56;
|
||||
clip.max_y = visarea->max_y - 56;
|
||||
|
||||
if (flip_screen_get())
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ VIDEO_START( naughtyb )
|
||||
palreg = bankreg = 0;
|
||||
|
||||
/* Naughty Boy has a virtual screen twice as large as the visible screen */
|
||||
tmpbitmap = auto_bitmap_alloc(68*8,28*8,machine->screen[0].format);
|
||||
tmpbitmap = auto_bitmap_alloc(68*8,28*8,video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
|
||||
|
@ -555,7 +555,7 @@ static void mbmj8688_gfxdraw(int gfxtype)
|
||||
|
||||
static void common_video_start(running_machine *machine)
|
||||
{
|
||||
mjsikaku_tmpbitmap = auto_bitmap_alloc(512, 256, machine->screen[0].format);
|
||||
mjsikaku_tmpbitmap = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen));
|
||||
mjsikaku_videoram = auto_malloc(512 * 256 * sizeof(UINT16));
|
||||
nbmj8688_clut = auto_malloc(0x20 * sizeof(UINT8));
|
||||
memset(mjsikaku_videoram, 0, (512 * 256 * sizeof(UINT16)));
|
||||
|
@ -103,7 +103,7 @@ VIDEO_START( bioship )
|
||||
tx_tilemap = tilemap_create(macross_get_tx_tile_info,tilemap_scan_cols,8,8,32,32);
|
||||
spriteram_old = auto_malloc(0x1000);
|
||||
spriteram_old2 = auto_malloc(0x1000);
|
||||
background_bitmap = auto_bitmap_alloc(8192,512,machine->screen[0].format);
|
||||
background_bitmap = auto_bitmap_alloc(8192,512,video_screen_get_format(machine->primary_screen));
|
||||
|
||||
tilemap_set_transparent_pen(bg_tilemap,15);
|
||||
tilemap_set_transparent_pen(tx_tilemap,15);
|
||||
|
@ -180,10 +180,10 @@ VIDEO_START(pitnrun)
|
||||
fg = tilemap_create( get_tile_info1,tilemap_scan_rows,8,8,32,32 );
|
||||
bg = tilemap_create( get_tile_info2,tilemap_scan_rows,8,8,32*4,32 );
|
||||
tilemap_set_transparent_pen( fg, 0 );
|
||||
tmp_bitmap[0] = auto_bitmap_alloc(128,128,machine->screen[0].format);
|
||||
tmp_bitmap[1] = auto_bitmap_alloc(128,128,machine->screen[0].format);
|
||||
tmp_bitmap[2] = auto_bitmap_alloc(128,128,machine->screen[0].format);
|
||||
tmp_bitmap[3] = auto_bitmap_alloc(128,128,machine->screen[0].format);
|
||||
tmp_bitmap[0] = auto_bitmap_alloc(128,128,video_screen_get_format(machine->primary_screen));
|
||||
tmp_bitmap[1] = auto_bitmap_alloc(128,128,video_screen_get_format(machine->primary_screen));
|
||||
tmp_bitmap[2] = auto_bitmap_alloc(128,128,video_screen_get_format(machine->primary_screen));
|
||||
tmp_bitmap[3] = auto_bitmap_alloc(128,128,video_screen_get_format(machine->primary_screen));
|
||||
pitnrun_spotlights();
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ VIDEO_UPDATE( playch10 )
|
||||
}
|
||||
else /* Single Monitor version */
|
||||
{
|
||||
rectangle top_monitor = screen->machine->screen[0].visarea;
|
||||
rectangle top_monitor = *video_screen_get_visible_area(screen);
|
||||
|
||||
top_monitor.max_y = ( top_monitor.max_y - top_monitor.min_y ) / 2;
|
||||
|
||||
|
@ -247,28 +247,22 @@ static TILE_GET_INFO( get_fg_tile_info )
|
||||
VIDEO_START( skyskipr )
|
||||
{
|
||||
popeye_bitmapram = auto_malloc(popeye_bitmapram_size);
|
||||
|
||||
tmpbitmap2 = auto_bitmap_alloc(1024,1024,machine->screen[0].format); /* actually 1024x512 but not rolling over vertically? */
|
||||
tmpbitmap2 = auto_bitmap_alloc(1024,1024,video_screen_get_format(machine->primary_screen)); /* actually 1024x512 but not rolling over vertically? */
|
||||
|
||||
bitmap_type = TYPE_SKYSKIPR;
|
||||
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
|
||||
16, 16, 32, 32);
|
||||
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
}
|
||||
|
||||
VIDEO_START( popeye )
|
||||
{
|
||||
popeye_bitmapram = auto_malloc(popeye_bitmapram_size);
|
||||
|
||||
tmpbitmap2 = auto_bitmap_alloc(512,512,machine->screen[0].format);
|
||||
tmpbitmap2 = auto_bitmap_alloc(512,512,video_screen_get_format(machine->primary_screen));
|
||||
|
||||
bitmap_type = TYPE_POPEYE;
|
||||
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows,
|
||||
16, 16, 32, 32);
|
||||
|
||||
fg_tilemap = tilemap_create(get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
|
||||
tilemap_set_transparent_pen(fg_tilemap, 0);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ WRITE8_HANDLER( popper_flipscreen_w )
|
||||
popper_flipscreen = data;
|
||||
tilemap_set_flip( ALL_TILEMAPS,popper_flipscreen?(TILEMAP_FLIPX|TILEMAP_FLIPY):0 );
|
||||
|
||||
tilemap_clip = Machine->screen[0].visarea;
|
||||
tilemap_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
if (popper_flipscreen)
|
||||
tilemap_clip.min_x=tilemap_clip.max_x-15;
|
||||
@ -170,7 +170,7 @@ VIDEO_START( popper )
|
||||
tilemap_set_transmask(popper_ol_p0_tilemap, 0,0x0f,0x0e);
|
||||
tilemap_set_transmask(popper_ol_p0_tilemap, 1,0x0e,0x0f);
|
||||
|
||||
tilemap_clip = machine->screen[0].visarea;
|
||||
tilemap_clip = *video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
state_save_register_global(popper_flipscreen);
|
||||
// state_save_register_global(popper_e002);
|
||||
|
@ -303,7 +303,7 @@ void ppu2c0x_init(running_machine *machine, const ppu2c0x_interface *interface )
|
||||
chips[i].scan_scale = 1;
|
||||
|
||||
/* allocate a screen bitmap, videoram and spriteram, a dirtychar array and the monochromatic colortable */
|
||||
chips[i].bitmap = auto_bitmap_alloc( VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, machine->screen[0].format );
|
||||
chips[i].bitmap = auto_bitmap_alloc( VISIBLE_SCREEN_WIDTH, VISIBLE_SCREEN_HEIGHT, video_screen_get_format(machine->primary_screen));
|
||||
chips[i].videoram = auto_malloc( VIDEORAM_SIZE );
|
||||
chips[i].spriteram = auto_malloc( SPRITERAM_SIZE );
|
||||
chips[i].dirtychar = auto_malloc( CHARGEN_NUM_CHARS );
|
||||
|
@ -98,7 +98,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
|
||||
if((!scr && flipscreen1) || (scr && flipscreen2))
|
||||
{
|
||||
ypos = machine->screen[0].visarea.max_y+1 - ypos - high*16; /* Screen Height depends on game */
|
||||
ypos = video_screen_get_visible_area(machine->primary_screen)->max_y+1 - ypos - high*16; /* Screen Height depends on game */
|
||||
xpos = 40*8 - xpos - wide*16;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
|
@ -1034,7 +1034,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
sprintf(buf, "%X",xdim/16); /* Display Zoom in 16.16 */
|
||||
if (machine->gamedrv->flags & ORIENTATION_SWAP_XY) {
|
||||
x = ypos;
|
||||
y = machine->screen[0].visarea.max_x - xpos; /* ORIENTATION_FLIP_Y */
|
||||
y = video_screen_get_visible_area(machine->primary_screen)->max_x - xpos; /* ORIENTATION_FLIP_Y */
|
||||
}
|
||||
else {
|
||||
x = xpos;
|
||||
|
@ -551,7 +551,7 @@ static void locomotn_draw_sprites(running_machine *machine, bitmap_t *bitmap, co
|
||||
int flip = spriteram[offs] & 2;
|
||||
|
||||
/* handle reduced visible area in some games */
|
||||
if (flip_screen_get() && machine->screen[0].visarea.max_x == 32*8-1) sx += 32;
|
||||
if (flip_screen_get() && (video_screen_get_visible_area(machine->primary_screen)->max_x == 32*8-1)) sx += 32;
|
||||
|
||||
pdrawgfx(bitmap,machine->gfx[1],
|
||||
((spriteram[offs] & 0x7c) >> 2) + 0x20*(spriteram[offs] & 0x01) + ((spriteram[offs] & 0x80) >> 1),
|
||||
@ -625,7 +625,7 @@ static void locomotn_draw_bullets(running_machine *machine, bitmap_t *bitmap, co
|
||||
y = 252 - rallyx_radary[offs];
|
||||
|
||||
/* handle reduced visible area in some games */
|
||||
if (flip_screen_get() && machine->screen[0].visarea.max_x == 32*8-1) x += 32;
|
||||
if (flip_screen_get() && (video_screen_get_visible_area(machine->primary_screen)->max_x == 32*8-1)) x += 32;
|
||||
|
||||
drawgfx(bitmap,machine->gfx[2],
|
||||
(rallyx_radarattr[offs & 0x0f] & 0x07) ^ 0x07,
|
||||
|
@ -154,33 +154,18 @@ WRITE16_HANDLER( realbrk_vram_2_w )
|
||||
VIDEO_START(realbrk)
|
||||
{
|
||||
/* Backgrounds */
|
||||
tilemap_0 = tilemap_create( get_tile_info_0, tilemap_scan_rows,
|
||||
|
||||
16,16,
|
||||
0x40, 0x20);
|
||||
|
||||
tilemap_1 = tilemap_create( get_tile_info_1, tilemap_scan_rows,
|
||||
|
||||
16,16,
|
||||
0x40, 0x20);
|
||||
tilemap_0 = tilemap_create(get_tile_info_0, tilemap_scan_rows, 16, 16, 0x40, 0x20);
|
||||
tilemap_1 = tilemap_create(get_tile_info_1, tilemap_scan_rows, 16, 16, 0x40, 0x20);
|
||||
|
||||
/* Text */
|
||||
tilemap_2 = tilemap_create( get_tile_info_2, tilemap_scan_rows,
|
||||
|
||||
8,8,
|
||||
0x40, 0x20);
|
||||
tilemap_2 = tilemap_create(get_tile_info_2, tilemap_scan_rows, 8, 8, 0x40, 0x20);
|
||||
|
||||
tilemap_set_transparent_pen(tilemap_0,0);
|
||||
tilemap_set_transparent_pen(tilemap_1,0);
|
||||
tilemap_set_transparent_pen(tilemap_2,0);
|
||||
|
||||
tmpbitmap0 = auto_bitmap_alloc( 32,
|
||||
32,
|
||||
machine->screen[0].format);
|
||||
|
||||
tmpbitmap1 = auto_bitmap_alloc( 32,
|
||||
32,
|
||||
machine->screen[0].format);
|
||||
tmpbitmap0 = auto_bitmap_alloc(32,32, video_screen_get_format(machine->primary_screen));
|
||||
tmpbitmap1 = auto_bitmap_alloc(32,32, video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -500,7 +500,7 @@ VIDEO_UPDATE( wizdfire )
|
||||
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
|
||||
|
||||
/* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
|
||||
fillbitmap(bitmap,screen->machine->pens[512],&screen->machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,screen->machine->pens[512],cliprect);
|
||||
|
||||
deco16_tilemap_4_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
|
||||
wizdfire_draw_sprites(screen->machine,bitmap,cliprect,buffered_spriteram16,4,3);
|
||||
@ -529,7 +529,7 @@ VIDEO_UPDATE( nitrobal )
|
||||
deco16_pf34_update(deco16_pf3_rowscroll,deco16_pf4_rowscroll);
|
||||
|
||||
/* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */
|
||||
fillbitmap(bitmap,screen->machine->pens[512],&screen->machine->screen[0].visarea);
|
||||
fillbitmap(bitmap,screen->machine->pens[512],cliprect);
|
||||
fillbitmap(priority_bitmap,0,NULL);
|
||||
deco16_clear_sprite_priority_bitmap();
|
||||
|
||||
|
@ -165,7 +165,7 @@ WRITE16_HANDLER( rpunch_crtc_data_w )
|
||||
{
|
||||
/* only register we know about.... */
|
||||
case 0x0b:
|
||||
timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_pos(machine->primary_screen, machine->screen[0].visarea.max_y + 1, 0), (data == 0xc0) ? 2 : 1);
|
||||
timer_adjust_oneshot(crtc_timer, video_screen_get_time_until_vblank_start(machine->primary_screen), (data == 0xc0) ? 2 : 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -328,8 +328,8 @@ VIDEO_START( sega )
|
||||
{
|
||||
assert_always(vectorram_size != 0, "vectorram==0");
|
||||
|
||||
min_x =machine->screen[0].visarea.min_x;
|
||||
min_y =machine->screen[0].visarea.min_y;
|
||||
min_x =video_screen_get_visible_area(machine->primary_screen)->min_x;
|
||||
min_y =video_screen_get_visible_area(machine->primary_screen)->min_y;
|
||||
|
||||
VIDEO_START_CALL(vector);
|
||||
}
|
||||
|
@ -2606,7 +2606,7 @@ for (showclip = 0; showclip < 4; showclip++)
|
||||
rect.min_x = (visarea->max_x + 1) - ((system32_videoram[0x1ff64/2 + i * 4] & 0x1ff) + 1);
|
||||
rect.min_y = (visarea->max_y + 1) - ((system32_videoram[0x1ff66/2 + i * 4] & 0x0ff) + 1);
|
||||
}
|
||||
sect_rect(&rect, &screen->machine->screen[screen].visarea);
|
||||
sect_rect(&rect, video_screen_get_visible_area(screen));
|
||||
|
||||
if (rect.min_y <= rect.max_y && rect.min_x <= rect.max_x)
|
||||
{
|
||||
|
@ -903,7 +903,8 @@ static VIDEO_UPDATE( seta_layers )
|
||||
int order = 0;
|
||||
int flip = (spriteram16[ 0x600/2 ] & 0x40) >> 6;
|
||||
|
||||
int vis_dimy = screen->machine->screen[0].visarea.max_y - screen->machine->screen[0].visarea.min_y + 1;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
int vis_dimy = visarea->max_y - visarea->min_y + 1;
|
||||
|
||||
flip ^= tilemaps_flip;
|
||||
|
||||
|
@ -136,7 +136,7 @@ WRITE16_HANDLER( skullxbo_yscroll_w )
|
||||
video_screen_update_partial(machine->primary_screen, scanline);
|
||||
|
||||
/* adjust the effective scroll for the current scanline */
|
||||
if (scanline > Machine->screen[0].visarea.max_y)
|
||||
if (scanline > video_screen_get_visible_area(machine->primary_screen)->max_y)
|
||||
scanline = 0;
|
||||
effscroll = (newscroll >> 7) - scanline;
|
||||
|
||||
|
@ -17,7 +17,7 @@ static bitmap_t *helper;
|
||||
|
||||
VIDEO_START( skyraid )
|
||||
{
|
||||
helper = auto_bitmap_alloc(128, 240, machine->screen[0].format);
|
||||
helper = auto_bitmap_alloc(128, 240, video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
|
||||
|
@ -67,7 +67,7 @@ VIDEO_START( snk )
|
||||
{
|
||||
snk_blink_parity = 0;
|
||||
|
||||
tmpbitmap = auto_bitmap_alloc( 512, 512, machine->screen[0].format );
|
||||
tmpbitmap = auto_bitmap_alloc(512, 512, video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
/**************************************************************************************/
|
||||
@ -241,7 +241,7 @@ VIDEO_UPDATE( tnk3 )
|
||||
|
||||
VIDEO_START( sgladiat )
|
||||
{
|
||||
tmpbitmap = auto_bitmap_alloc( 512, 256, machine->screen[0].format );
|
||||
tmpbitmap = auto_bitmap_alloc(512, 256, video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
static void sgladiat_draw_background(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int scrollx, int scrolly )
|
||||
|
@ -147,6 +147,7 @@ VIDEO_EOF( sprint2 )
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
/*
|
||||
* Collisions are detected for both player cars:
|
||||
@ -165,14 +166,14 @@ VIDEO_EOF( sprint2 )
|
||||
rect.max_x = get_sprite_x(i) + machine->gfx[1]->width - 1;
|
||||
rect.max_y = get_sprite_y(i) + machine->gfx[1]->height - 1;
|
||||
|
||||
if (rect.min_x < machine->screen[0].visarea.min_x)
|
||||
rect.min_x = machine->screen[0].visarea.min_x;
|
||||
if (rect.min_y < machine->screen[0].visarea.min_y)
|
||||
rect.min_y = machine->screen[0].visarea.min_y;
|
||||
if (rect.max_x > machine->screen[0].visarea.max_x)
|
||||
rect.max_x = machine->screen[0].visarea.max_x;
|
||||
if (rect.max_y > machine->screen[0].visarea.max_y)
|
||||
rect.max_y = machine->screen[0].visarea.max_y;
|
||||
if (rect.min_x < visarea->min_x)
|
||||
rect.min_x = visarea->min_x;
|
||||
if (rect.min_y < visarea->min_y)
|
||||
rect.min_y = visarea->min_y;
|
||||
if (rect.max_x > visarea->max_x)
|
||||
rect.max_x = visarea->max_x;
|
||||
if (rect.max_y > visarea->max_y)
|
||||
rect.max_y = visarea->max_y;
|
||||
|
||||
/* check for sprite-tilemap collisions */
|
||||
|
||||
|
@ -113,7 +113,7 @@ VIDEO_EOF( sprint4 )
|
||||
rect.max_x = horz - 15 + machine->gfx[1]->width - 1;
|
||||
rect.max_y = vert - 15 + machine->gfx[1]->height - 1;
|
||||
|
||||
sect_rect(&rect, &machine->screen[0].visarea);
|
||||
sect_rect(&rect, video_screen_get_visible_area(machine->primary_screen));
|
||||
|
||||
tilemap_draw(helper, &rect, playfield, 0, 0);
|
||||
|
||||
|
@ -179,19 +179,20 @@ VIDEO_EOF( sprint8 )
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
tilemap_draw(helper2, &machine->screen[0].visarea, tilemap2, 0, 0);
|
||||
tilemap_draw(helper2, visarea, tilemap2, 0, 0);
|
||||
|
||||
fillbitmap(helper1, 0x20, &machine->screen[0].visarea);
|
||||
fillbitmap(helper1, 0x20, visarea);
|
||||
|
||||
draw_sprites(machine, helper1, &machine->screen[0].visarea);
|
||||
draw_sprites(machine, helper1, visarea);
|
||||
|
||||
for (y = machine->screen[0].visarea.min_y; y <= machine->screen[0].visarea.max_y; y++)
|
||||
for (y = visarea->min_y; y <= visarea->max_y; y++)
|
||||
{
|
||||
const UINT16* p1 = BITMAP_ADDR16(helper1, y, 0);
|
||||
const UINT16* p2 = BITMAP_ADDR16(helper2, y, 0);
|
||||
|
||||
for (x = machine->screen[0].visarea.min_x; x <= machine->screen[0].visarea.max_x; x++)
|
||||
for (x = visarea->min_x; x <= visarea->max_x; x++)
|
||||
if (p1[x] != 0x20 && p2[x] == 0x23)
|
||||
timer_set(video_screen_get_time_until_pos(machine->primary_screen, y + 24, x), NULL,
|
||||
colortable_entry_get_value(machine->colortable, p1[x]),
|
||||
|
@ -159,7 +159,7 @@ static void srmp3_draw_sprites_map(running_machine *machine, bitmap_t *bitmap, c
|
||||
|
||||
int sx = x + xoffs + (offs & 1) * 16;
|
||||
int sy = -(y + yoffs) + (offs / 2) * 16 -
|
||||
(machine->screen[0].height-(machine->screen[0].visarea.max_y + 1));
|
||||
(video_screen_get_height(machine->primary_screen) - (video_screen_get_visible_area(machine->primary_screen)->max_y + 1));
|
||||
|
||||
if (upper & (1 << col)) sx += 256;
|
||||
|
||||
@ -322,7 +322,7 @@ static void mjyuugi_draw_sprites_map(running_machine *machine, bitmap_t *bitmap,
|
||||
|
||||
int sx = x + xoffs + (offs & 1) * 16;
|
||||
int sy = -(y + yoffs) + (offs / 2) * 16 -
|
||||
(machine->screen[0].height-(machine->screen[0].visarea.max_y + 1));
|
||||
(video_screen_get_height(machine->primary_screen) - (video_screen_get_visible_area(machine->primary_screen)->max_y + 1));
|
||||
|
||||
if (upper & (1 << col)) sx += 256;
|
||||
|
||||
@ -416,7 +416,7 @@ static void mjyuugi_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
|
||||
if (flip)
|
||||
{
|
||||
y = max_y - y
|
||||
+(machine->screen[0].height-(machine->screen[0].visarea.max_y + 1));
|
||||
+(video_screen_get_height(machine->primary_screen) - (video_screen_get_visible_area(machine->primary_screen)->max_y + 1));
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ static void draw_row(running_machine *machine, bitmap_t *bitmap, const rectangle
|
||||
static void draw_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int nr)
|
||||
{
|
||||
int sy;
|
||||
for ( sy = 0; sy <= machine->screen[0].visarea.max_y; sy += 0x40 )
|
||||
for ( sy = 0; sy <= video_screen_get_visible_area(machine->primary_screen)->max_y; sy += 0x40 )
|
||||
draw_row(machine, bitmap, cliprect, 0, sy, nr);
|
||||
}
|
||||
|
||||
|
@ -635,7 +635,7 @@ VIDEO_UPDATE( st0016 )
|
||||
//super eagle shot
|
||||
int x,y,dy;
|
||||
|
||||
fillbitmap(speglsht_bitmap,0,&screen->machine->screen[0].visarea);
|
||||
fillbitmap(speglsht_bitmap,0,NULL);
|
||||
dy=(speglsht_videoreg&0x20)?(256*512):0; //visible frame
|
||||
|
||||
for(y=0;y<256;y++)
|
||||
|
@ -55,11 +55,11 @@ WRITE8_HANDLER( starcrus_p2_y_w ) { p2_y = data^0xff; }
|
||||
|
||||
VIDEO_START( starcrus )
|
||||
{
|
||||
ship1_vid = auto_bitmap_alloc(16,16,machine->screen[0].format);
|
||||
ship2_vid = auto_bitmap_alloc(16,16,machine->screen[0].format);
|
||||
ship1_vid = auto_bitmap_alloc(16,16,video_screen_get_format(machine->primary_screen));
|
||||
ship2_vid = auto_bitmap_alloc(16,16,video_screen_get_format(machine->primary_screen));
|
||||
|
||||
proj1_vid = auto_bitmap_alloc(16,16,machine->screen[0].format);
|
||||
proj2_vid = auto_bitmap_alloc(16,16,machine->screen[0].format);
|
||||
proj1_vid = auto_bitmap_alloc(16,16,video_screen_get_format(machine->primary_screen));
|
||||
proj2_vid = auto_bitmap_alloc(16,16,video_screen_get_format(machine->primary_screen));
|
||||
}
|
||||
|
||||
WRITE8_HANDLER( starcrus_ship_parm_1_w )
|
||||
|
@ -334,7 +334,7 @@ static void draw_circle(bitmap_t* bitmap)
|
||||
}
|
||||
|
||||
|
||||
static int spaceship_collision(bitmap_t *bitmap, rectangle *rect)
|
||||
static int spaceship_collision(bitmap_t *bitmap, const rectangle *rect)
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
@ -361,7 +361,7 @@ static int point_in_circle(int x, int y, int center_x, int center_y, int r)
|
||||
}
|
||||
|
||||
|
||||
static int circle_collision(rectangle *rect)
|
||||
static int circle_collision(const rectangle *rect)
|
||||
{
|
||||
int center_x = get_circle_hpos();
|
||||
int center_y = get_circle_vpos();
|
||||
@ -407,6 +407,7 @@ VIDEO_UPDATE( starshp1 )
|
||||
VIDEO_EOF( starshp1 )
|
||||
{
|
||||
rectangle rect;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
rect.min_x = get_sprite_hpos(13);
|
||||
rect.min_y = get_sprite_vpos(13);
|
||||
@ -422,12 +423,12 @@ VIDEO_EOF( starshp1 )
|
||||
if (rect.max_y > helper->height - 1)
|
||||
rect.max_y = helper->height - 1;
|
||||
|
||||
fillbitmap(helper, 0, &machine->screen[0].visarea);
|
||||
fillbitmap(helper, 0, visarea);
|
||||
|
||||
if (starshp1_attract == 0)
|
||||
draw_spaceship(machine, helper, &machine->screen[0].visarea);
|
||||
draw_spaceship(machine, helper, visarea);
|
||||
|
||||
if (circle_collision(&machine->screen[0].visarea))
|
||||
if (circle_collision(visarea))
|
||||
starshp1_collision_latch |= 1;
|
||||
|
||||
if (circle_collision(&rect))
|
||||
@ -436,6 +437,6 @@ VIDEO_EOF( starshp1 )
|
||||
if (spaceship_collision(helper, &rect))
|
||||
starshp1_collision_latch |= 4;
|
||||
|
||||
if (spaceship_collision(helper, &machine->screen[0].visarea))
|
||||
if (spaceship_collision(helper, visarea))
|
||||
starshp1_collision_latch |= 8;
|
||||
}
|
||||
|
@ -4819,9 +4819,7 @@ static void stv_vdp2_draw_rotation_screen(running_machine *machine, bitmap_t *bi
|
||||
else
|
||||
{
|
||||
if ( stv_vdp2_roz_bitmap[iRP-1] == NULL )
|
||||
{
|
||||
stv_vdp2_roz_bitmap[iRP-1] = auto_bitmap_alloc( 4096, 4096, machine->screen[0].format );
|
||||
}
|
||||
stv_vdp2_roz_bitmap[iRP-1] = auto_bitmap_alloc(4096, 4096, video_screen_get_format(machine->primary_screen));
|
||||
|
||||
roz_clip_rect.min_x = roz_clip_rect.min_y = 0;
|
||||
if ( (iRP == 1 && STV_VDP2_RAOVR == 3) ||
|
||||
@ -5232,7 +5230,7 @@ READ32_HANDLER ( stv_vdp2_regs_r )
|
||||
case 0x8/4:
|
||||
/*H/V Counter Register*/
|
||||
/*H-Counter V-Counter */
|
||||
stv_vdp2_regs[offset] = (((Machine->screen[0].visarea.max_x - 1)<<16)&0x3ff0000)|(((Machine->screen[0].visarea.max_y - 1)<<0)& ((STV_VDP2_LSMD == 3) ? 0x7ff : 0x3ff));
|
||||
stv_vdp2_regs[offset] = (((video_screen_get_visible_area(machine->primary_screen)->max_x - 1)<<16)&0x3ff0000)|(((video_screen_get_visible_area(machine->primary_screen)->max_y - 1)<<0)& ((STV_VDP2_LSMD == 3) ? 0x7ff : 0x3ff));
|
||||
if(LOG_VDP2) logerror("CPU #%d PC(%08x) = VDP2: H/V counter read : %08x\n",cpu_getactivecpu(),activecpu_get_pc(),stv_vdp2_regs[offset]);
|
||||
stv_vdp2_regs[offset] = 0;
|
||||
break;
|
||||
|
@ -60,8 +60,8 @@ VIDEO_START( pbillian )
|
||||
|
||||
VIDEO_START( superqix )
|
||||
{
|
||||
fg_bitmap[0] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
|
||||
fg_bitmap[1] = auto_bitmap_alloc(256, 256, machine->screen[0].format);
|
||||
fg_bitmap[0] = auto_bitmap_alloc(256, 256, video_screen_get_format(machine->primary_screen));
|
||||
fg_bitmap[1] = auto_bitmap_alloc(256, 256, video_screen_get_format(machine->primary_screen));
|
||||
bg_tilemap = tilemap_create(sqix_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
|
||||
|
||||
tilemap_set_transmask(bg_tilemap,0,0xffff,0x0000); /* split type 0 is totally transparent in front half */
|
||||
|
@ -550,12 +550,12 @@ void skns_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectang
|
||||
if (sprite_flip&2)
|
||||
{
|
||||
xflip ^= 1;
|
||||
sx = machine->screen[0].visarea.max_x+1 - sx;
|
||||
sx = video_screen_get_visible_area(machine->primary_screen)->max_x+1 - sx;
|
||||
}
|
||||
if (sprite_flip&1)
|
||||
{
|
||||
yflip ^= 1;
|
||||
sy = machine->screen[0].visarea.max_y+1 - sy;
|
||||
sy = video_screen_get_visible_area(machine->primary_screen)->max_y+1 - sy;
|
||||
}
|
||||
|
||||
/* Palette linking */
|
||||
|
@ -169,21 +169,22 @@ VIDEO_UPDATE( suprridr )
|
||||
{
|
||||
rectangle subclip;
|
||||
int i;
|
||||
const rectangle *visarea = video_screen_get_visible_area(screen);
|
||||
|
||||
/* render left 4 columns with no scroll */
|
||||
subclip = screen->machine->screen[0].visarea;
|
||||
subclip = *visarea;;
|
||||
subclip.max_x = subclip.min_x + (flipx ? 1*8 : 4*8) - 1;
|
||||
sect_rect(&subclip, cliprect);
|
||||
tilemap_draw(bitmap, &subclip, bg_tilemap_noscroll, 0, 0);
|
||||
|
||||
/* render right 1 column with no scroll */
|
||||
subclip = screen->machine->screen[0].visarea;
|
||||
subclip = *visarea;;
|
||||
subclip.min_x = subclip.max_x - (flipx ? 4*8 : 1*8) + 1;
|
||||
sect_rect(&subclip, cliprect);
|
||||
tilemap_draw(bitmap, &subclip, bg_tilemap_noscroll, 0, 0);
|
||||
|
||||
/* render the middle columns normally */
|
||||
subclip = screen->machine->screen[0].visarea;
|
||||
subclip = *visarea;;
|
||||
subclip.min_x += flipx ? 1*8 : 4*8;
|
||||
subclip.max_x -= flipx ? 4*8 : 1*8;
|
||||
sect_rect(&subclip, cliprect);
|
||||
|
@ -186,13 +186,13 @@ INLINE int get_sprite_bottom_y(int spr_number)
|
||||
}
|
||||
#endif
|
||||
|
||||
INLINE void draw_pixel(bitmap_t *bitmap,
|
||||
INLINE void draw_pixel(running_machine *machine, bitmap_t *bitmap,
|
||||
int x,int y,int x_flipped,int y_flipped,
|
||||
int spr_number,int color)
|
||||
{
|
||||
int xr,yr;
|
||||
int sprite_onscreen;
|
||||
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
|
||||
if (x < 0 || x >= Machine->screen[0].width ||
|
||||
y < 0 || y >= Machine->screen[0].height)
|
||||
@ -206,10 +206,10 @@ INLINE void draw_pixel(bitmap_t *bitmap,
|
||||
|
||||
sprite_onscreen_map[256*y+x] = spr_number;
|
||||
|
||||
if (x_flipped >= Machine->screen[0].visarea.min_x ||
|
||||
x_flipped <= Machine->screen[0].visarea.max_x ||
|
||||
y_flipped >= Machine->screen[0].visarea.min_y ||
|
||||
y_flipped <= Machine->screen[0].visarea.max_y)
|
||||
if (x_flipped >= visarea->min_x ||
|
||||
x_flipped <= visarea->max_x ||
|
||||
y_flipped >= visarea->min_y ||
|
||||
y_flipped <= visarea->max_y)
|
||||
{
|
||||
*BITMAP_ADDR16(bitmap, y_flipped, x_flipped) = color;
|
||||
}
|
||||
@ -254,7 +254,7 @@ WRITE8_HANDLER( system1_sprites_collisionram_w )
|
||||
system1_sprites_collisionram[offset] = 0x7e;
|
||||
}
|
||||
|
||||
static void draw_sprite(bitmap_t *bitmap,int spr_number)
|
||||
static void draw_sprite(running_machine *machine, bitmap_t *bitmap,int spr_number)
|
||||
{
|
||||
int sy,row,height,src,bank;
|
||||
UINT8 *sprite_base;
|
||||
@ -322,13 +322,13 @@ static void draw_sprite(bitmap_t *bitmap,int spr_number)
|
||||
|
||||
if (color1 == 15) break;
|
||||
if (color1)
|
||||
draw_pixel(bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color1);
|
||||
draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color1);
|
||||
x++;
|
||||
x_flipped += flip_screen_get() ? -1 : 1;
|
||||
|
||||
if (color2 == 15) break;
|
||||
if (color2)
|
||||
draw_pixel(bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color2);
|
||||
draw_pixel(machine,bitmap,x,y,x_flipped,y_flipped,spr_number,sprite_palette_base+color2);
|
||||
x++;
|
||||
x_flipped += flip_screen_get() ? -1 : 1;
|
||||
}
|
||||
@ -336,7 +336,7 @@ static void draw_sprite(bitmap_t *bitmap,int spr_number)
|
||||
}
|
||||
|
||||
|
||||
static void draw_sprites(bitmap_t *bitmap)
|
||||
static void draw_sprites(running_machine *machine, bitmap_t *bitmap)
|
||||
{
|
||||
int spr_number,sprite_bottom_y,sprite_top_y;
|
||||
UINT8 *sprite_base;
|
||||
@ -350,7 +350,7 @@ static void draw_sprites(bitmap_t *bitmap)
|
||||
sprite_top_y = sprite_base[SPR_Y_TOP];
|
||||
sprite_bottom_y = sprite_base[SPR_Y_BOTTOM];
|
||||
if (sprite_bottom_y && (sprite_bottom_y-sprite_top_y > 0))
|
||||
draw_sprite(bitmap,spr_number);
|
||||
draw_sprite(machine, bitmap,spr_number);
|
||||
}
|
||||
}
|
||||
|
||||
@ -531,7 +531,7 @@ VIDEO_UPDATE( system1 )
|
||||
drawn = system1_draw_fg(screen->machine, bitmap, cliprect, 0);
|
||||
/* redraw low priority bg tiles if necessary */
|
||||
if (drawn) system1_draw_bg(screen->machine, bitmap, cliprect, 0);
|
||||
draw_sprites(bitmap);
|
||||
draw_sprites(screen->machine, bitmap);
|
||||
system1_draw_bg(screen->machine, bitmap, cliprect, 1);
|
||||
system1_draw_fg(screen->machine, bitmap, cliprect, 1);
|
||||
|
||||
@ -672,7 +672,7 @@ VIDEO_UPDATE( choplifter )
|
||||
drawn = system1_draw_fg(screen->machine, bitmap, cliprect, 0);
|
||||
/* redraw low priority bg tiles if necessary */
|
||||
if (drawn) chplft_draw_bg(screen->machine, bitmap, cliprect, 0);
|
||||
draw_sprites(bitmap);
|
||||
draw_sprites(screen->machine, bitmap);
|
||||
chplft_draw_bg(screen->machine, bitmap, cliprect, 1);
|
||||
system1_draw_fg(screen->machine, bitmap, cliprect, 1);
|
||||
|
||||
@ -803,7 +803,7 @@ static void wbml_draw_fg(running_machine *machine, bitmap_t *bitmap, const recta
|
||||
VIDEO_UPDATE( wbml )
|
||||
{
|
||||
wbml_draw_bg(screen->machine, bitmap, cliprect, 0);
|
||||
draw_sprites(bitmap);
|
||||
draw_sprites(screen->machine, bitmap);
|
||||
wbml_draw_bg(screen->machine, bitmap, cliprect, 1);
|
||||
wbml_draw_fg(screen->machine, bitmap, cliprect);
|
||||
|
||||
@ -873,7 +873,7 @@ static void ufosensi_draw_bg(running_machine *machine, bitmap_t *bitmap, const r
|
||||
VIDEO_UPDATE( ufosensi )
|
||||
{
|
||||
ufosensi_draw_bg(screen->machine, bitmap, cliprect, 0);
|
||||
draw_sprites(bitmap);
|
||||
draw_sprites(screen->machine, bitmap);
|
||||
ufosensi_draw_bg(screen->machine, bitmap, cliprect, 1);
|
||||
wbml_draw_fg(screen->machine, bitmap, cliprect);
|
||||
|
||||
@ -894,7 +894,7 @@ VIDEO_UPDATE( blockgal )
|
||||
drawn = system1_draw_fg(screen->machine, bitmap, cliprect, 0);
|
||||
/* redraw low priority bg tiles if necessary */
|
||||
if (drawn) system1_draw_bg(screen->machine, bitmap, cliprect, 0);
|
||||
draw_sprites(bitmap);
|
||||
draw_sprites(screen->machine, bitmap);
|
||||
system1_draw_bg(screen->machine, bitmap, cliprect, 1);
|
||||
system1_draw_fg(screen->machine, bitmap, cliprect, 1);
|
||||
|
||||
|
@ -203,8 +203,8 @@ static TILE_GET_INFO( get_tx_tile_info )
|
||||
|
||||
static VIDEO_START( taitob_core )
|
||||
{
|
||||
framebuffer[0] = auto_bitmap_alloc(512,256,machine->screen[0].format);
|
||||
framebuffer[1] = auto_bitmap_alloc(512,256,machine->screen[0].format);
|
||||
framebuffer[0] = auto_bitmap_alloc(512,256, video_screen_get_format(machine->primary_screen));
|
||||
framebuffer[1] = auto_bitmap_alloc(512,256, video_screen_get_format(machine->primary_screen));
|
||||
pixel_bitmap = NULL; /* only hitice needs this */
|
||||
|
||||
bg_tilemap = tilemap_create(get_bg_tile_info,tilemap_scan_rows, 16,16,64,64);
|
||||
@ -277,7 +277,7 @@ VIDEO_START( hitice )
|
||||
{
|
||||
VIDEO_START_CALL(taitob_color_order0);
|
||||
|
||||
pixel_bitmap = auto_bitmap_alloc(1024,512,machine->screen[0].format);
|
||||
pixel_bitmap = auto_bitmap_alloc(1024,512,video_screen_get_format(machine->primary_screen));
|
||||
|
||||
state_save_register_global_bitmap(pixel_bitmap);
|
||||
}
|
||||
@ -625,11 +625,11 @@ VIDEO_UPDATE( taitob )
|
||||
VIDEO_EOF( taitob )
|
||||
{
|
||||
if (~video_control & 0x01)
|
||||
fillbitmap(framebuffer[framebuffer_page],0,&machine->screen[0].visarea);
|
||||
fillbitmap(framebuffer[framebuffer_page],0,video_screen_get_visible_area(machine->primary_screen));
|
||||
|
||||
if (~video_control & 0x80)
|
||||
framebuffer_page ^= 1;
|
||||
|
||||
draw_sprites(machine, framebuffer[framebuffer_page],&machine->screen[0].visarea);
|
||||
draw_sprites(machine, framebuffer[framebuffer_page],video_screen_get_visible_area(machine->primary_screen));
|
||||
}
|
||||
|
||||
|
@ -2937,8 +2937,9 @@ INLINE void f3_drawgfxzoom(bitmap_t *dest_bmp,const gfx_element *gfx,
|
||||
|
||||
static void get_sprite_info(running_machine *machine, const UINT32 *spriteram32_ptr)
|
||||
{
|
||||
const int min_x=machine->screen[0].visarea.min_x,max_x=machine->screen[0].visarea.max_x;
|
||||
const int min_y=machine->screen[0].visarea.min_y,max_y=machine->screen[0].visarea.max_y;
|
||||
const rectangle *visarea = video_screen_get_visible_area(machine->primary_screen);
|
||||
const int min_x=visarea->min_x,max_x=visarea->max_x;
|
||||
const int min_y=visarea->min_y,max_y=visarea->max_y;
|
||||
int offs,spritecont,flipx,flipy,old_x,old_y,color,x,y;
|
||||
int sprite,global_x=0,global_y=0,subglobal_x=0,subglobal_y=0;
|
||||
int block_x=0, block_y=0;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user