~ubuntu-branches/ubuntu/raring/mame/raring-proposed

« back to all changes in this revision

Viewing changes to mess/src/mame/video/offtwall.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 
3
 
    Atari "Round" hardware
4
 
 
5
 
****************************************************************************/
6
 
 
7
 
#include "emu.h"
8
 
#include "video/atarimo.h"
9
 
#include "includes/offtwall.h"
10
 
 
11
 
 
12
 
 
13
 
/*************************************
14
 
 *
15
 
 *  Tilemap callbacks
16
 
 *
17
 
 *************************************/
18
 
 
19
 
static TILE_GET_INFO( get_playfield_tile_info )
20
 
{
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);
27
 
}
28
 
 
29
 
 
30
 
 
31
 
/*************************************
32
 
 *
33
 
 *  Video system start
34
 
 *
35
 
 *************************************/
36
 
 
37
 
VIDEO_START( offtwall )
38
 
{
39
 
        static const atarimo_desc modesc =
40
 
        {
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) */
51
 
 
52
 
                0x100,                          /* base palette entry */
53
 
                0x100,                          /* maximum number of colors */
54
 
                0,                                      /* transparent pen index */
55
 
 
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 */
70
 
 
71
 
                {{ 0 }},                        /* mask for the special value */
72
 
                0,                                      /* resulting value to indicate "special" */
73
 
                0                                       /* callback routine for special entries */
74
 
        };
75
 
        offtwall_state *state = machine.driver_data<offtwall_state>();
76
 
 
77
 
        /* initialize the playfield */
78
 
        state->m_playfield_tilemap = tilemap_create(machine, get_playfield_tile_info, tilemap_scan_cols,  8,8, 64,64);
79
 
 
80
 
        /* initialize the motion objects */
81
 
        atarimo_init(machine, 0, &modesc);
82
 
}
83
 
 
84
 
 
85
 
 
86
 
/*************************************
87
 
 *
88
 
 *  Main refresh
89
 
 *
90
 
 *************************************/
91
 
 
92
 
SCREEN_UPDATE( offtwall )
93
 
{
94
 
        offtwall_state *state = screen->machine().driver_data<offtwall_state>();
95
 
        atarimo_rect_list rectlist;
96
 
        bitmap_t *mobitmap;
97
 
        int x, y, r;
98
 
 
99
 
        /* draw the playfield */
100
 
        tilemap_draw(bitmap, cliprect, state->m_playfield_tilemap, 0, 0);
101
 
 
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++)
106
 
                {
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++)
110
 
                                if (mo[x])
111
 
                                {
112
 
                                        /* not yet verified
113
 
                    */
114
 
                                        pf[x] = mo[x];
115
 
 
116
 
                                        /* erase behind ourselves */
117
 
                                        mo[x] = 0;
118
 
                                }
119
 
                }
120
 
        return 0;
121
 
}