1
/***************************************************************************
5
****************************************************************************/
8
#include "video/atarimo.h"
9
#include "includes/offtwall.h"
13
/*************************************
17
*************************************/
19
static TILE_GET_INFO( get_playfield_tile_info )
21
offtwall_state *state = machine.driver_data<offtwall_state>();
22
UINT16 data1 = state->m_playfield[tile_index];
23
UINT16 data2 = state->m_playfield_upper[tile_index] >> 8;
24
int code = data1 & 0x7fff;
25
int color = 0x10 + (data2 & 0x0f);
26
SET_TILE_INFO(0, code, color, (data1 >> 15) & 1);
31
/*************************************
35
*************************************/
37
VIDEO_START( offtwall )
39
static const atarimo_desc modesc =
41
0, /* index to which gfx system */
42
1, /* number of motion object banks */
43
1, /* are the entries linked? */
44
0, /* are the entries split? */
45
0, /* render in reverse order? */
46
0, /* render in swapped X/Y order? */
47
0, /* does the neighbor bit affect the next object? */
48
8, /* pixels per SLIP entry (0 for no-slip) */
49
0, /* pixel offset for SLIPs */
50
0, /* maximum number of links to visit/scanline (0=all) */
52
0x100, /* base palette entry */
53
0x100, /* maximum number of colors */
54
0, /* transparent pen index */
56
{{ 0x00ff,0,0,0 }}, /* mask for the link */
57
{{ 0 }}, /* mask for the graphics bank */
58
{{ 0,0x7fff,0,0 }}, /* mask for the code index */
59
{{ 0 }}, /* mask for the upper code index */
60
{{ 0,0,0x000f,0 }}, /* mask for the color */
61
{{ 0,0,0xff80,0 }}, /* mask for the X position */
62
{{ 0,0,0,0xff80 }}, /* mask for the Y position */
63
{{ 0,0,0,0x0070 }}, /* mask for the width, in tiles*/
64
{{ 0,0,0,0x0007 }}, /* mask for the height, in tiles */
65
{{ 0,0x8000,0,0 }}, /* mask for the horizontal flip */
66
{{ 0 }}, /* mask for the vertical flip */
67
{{ 0 }}, /* mask for the priority */
68
{{ 0 }}, /* mask for the neighbor */
69
{{ 0 }}, /* mask for absolute coordinates */
71
{{ 0 }}, /* mask for the special value */
72
0, /* resulting value to indicate "special" */
73
0 /* callback routine for special entries */
75
offtwall_state *state = machine.driver_data<offtwall_state>();
77
/* initialize the playfield */
78
state->m_playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols, 8,8, 64,64);
80
/* initialize the motion objects */
81
atarimo_init(machine, 0, &modesc);
86
/*************************************
90
*************************************/
92
SCREEN_UPDATE( offtwall )
94
offtwall_state *state = screen->machine().driver_data<offtwall_state>();
95
atarimo_rect_list rectlist;
99
/* draw the playfield */
100
tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
102
/* draw and merge the MO */
103
mobitmap = atarimo_render(0, cliprect, &rectlist);
104
for (r = 0; r < rectlist.numrects; r++, rectlist.rect++)
105
for (y = rectlist.rect->min_y; y <= rectlist.rect->max_y; y++)
107
UINT16 *mo = (UINT16 *)mobitmap->base + mobitmap->rowpixels * y;
108
UINT16 *pf = (UINT16 *)bitmap->base + bitmap->rowpixels * y;
109
for (x = rectlist.rect->min_x; x <= rectlist.rect->max_x; x++)
116
/* erase behind ourselves */