~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/video/gundealr.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
static TILE_GET_INFO( get_bg_tile_info )
20
20
{
21
 
        gundealr_state *state = machine->driver_data<gundealr_state>();
22
 
        UINT8 attr = state->bg_videoram[2 * tile_index + 1];
 
21
        gundealr_state *state = machine.driver_data<gundealr_state>();
 
22
        UINT8 attr = state->m_bg_videoram[2 * tile_index + 1];
23
23
        SET_TILE_INFO(
24
24
                        0,
25
 
                        state->bg_videoram[2 * tile_index] + ((attr & 0x07) << 8),
 
25
                        state->m_bg_videoram[2 * tile_index] + ((attr & 0x07) << 8),
26
26
                        (attr & 0xf0) >> 4,
27
27
                        0);
28
28
}
35
35
 
36
36
static TILE_GET_INFO( get_fg_tile_info )
37
37
{
38
 
        gundealr_state *state = machine->driver_data<gundealr_state>();
39
 
        UINT8 attr = state->fg_videoram[2 * tile_index + 1];
 
38
        gundealr_state *state = machine.driver_data<gundealr_state>();
 
39
        UINT8 attr = state->m_fg_videoram[2 * tile_index + 1];
40
40
        SET_TILE_INFO(
41
41
                        1,
42
 
                        state->fg_videoram[2 * tile_index] + ((attr & 0x03) << 8),
 
42
                        state->m_fg_videoram[2 * tile_index] + ((attr & 0x03) << 8),
43
43
                        (attr & 0xf0) >> 4,
44
44
                        0);
45
45
}
54
54
 
55
55
VIDEO_START( gundealr )
56
56
{
57
 
        gundealr_state *state = machine->driver_data<gundealr_state>();
58
 
        state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
59
 
        state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, gundealr_scan, 16, 16, 64, 32);
 
57
        gundealr_state *state = machine.driver_data<gundealr_state>();
 
58
        state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 8, 8, 32, 32);
 
59
        state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, gundealr_scan, 16, 16, 64, 32);
60
60
 
61
 
        tilemap_set_transparent_pen(state->fg_tilemap, 15);
 
61
        tilemap_set_transparent_pen(state->m_fg_tilemap, 15);
62
62
}
63
63
 
64
64
 
71
71
 
72
72
WRITE8_HANDLER( gundealr_bg_videoram_w )
73
73
{
74
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
75
 
        state->bg_videoram[offset] = data;
76
 
        tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
 
74
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
 
75
        state->m_bg_videoram[offset] = data;
 
76
        tilemap_mark_tile_dirty(state->m_bg_tilemap, offset / 2);
77
77
}
78
78
 
79
79
WRITE8_HANDLER( gundealr_fg_videoram_w )
80
80
{
81
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
82
 
        state->fg_videoram[offset] = data;
83
 
        tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
 
81
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
 
82
        state->m_fg_videoram[offset] = data;
 
83
        tilemap_mark_tile_dirty(state->m_fg_tilemap, offset / 2);
84
84
}
85
85
 
86
86
WRITE8_HANDLER( gundealr_paletteram_w )
87
87
{
88
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
 
88
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
89
89
        int r,g,b,val;
90
90
 
91
 
        state->paletteram[offset] = data;
 
91
        state->m_paletteram[offset] = data;
92
92
 
93
 
        val = state->paletteram[offset & ~1];
 
93
        val = state->m_paletteram[offset & ~1];
94
94
        r = (val >> 4) & 0x0f;
95
95
        g = (val >> 0) & 0x0f;
96
96
 
97
 
        val = state->paletteram[offset | 1];
 
97
        val = state->m_paletteram[offset | 1];
98
98
        b = (val >> 4) & 0x0f;
99
99
        /* TODO: the bottom 4 bits are used as well, but I'm not sure about the meaning */
100
100
 
101
 
        palette_set_color_rgb(space->machine, offset / 2, pal4bit(r), pal4bit(g), pal4bit(b));
 
101
        palette_set_color_rgb(space->machine(), offset / 2, pal4bit(r), pal4bit(g), pal4bit(b));
102
102
}
103
103
 
104
104
WRITE8_HANDLER( gundealr_fg_scroll_w )
105
105
{
106
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
107
 
        state->scroll[offset] = data;
108
 
        tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[1] | ((state->scroll[0] & 0x03) << 8));
109
 
        tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll[3] | ((state->scroll[2] & 0x03) << 8));
 
106
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
 
107
        state->m_scroll[offset] = data;
 
108
        tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_scroll[1] | ((state->m_scroll[0] & 0x03) << 8));
 
109
        tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_scroll[3] | ((state->m_scroll[2] & 0x03) << 8));
110
110
}
111
111
 
112
112
WRITE8_HANDLER( yamyam_fg_scroll_w )
113
113
{
114
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
115
 
        state->scroll[offset] = data;
116
 
        tilemap_set_scrollx(state->fg_tilemap, 0, state->scroll[0] | ((state->scroll[1] & 0x03) << 8));
117
 
        tilemap_set_scrolly(state->fg_tilemap, 0, state->scroll[2] | ((state->scroll[3] & 0x03) << 8));
 
114
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
 
115
        state->m_scroll[offset] = data;
 
116
        tilemap_set_scrollx(state->m_fg_tilemap, 0, state->m_scroll[0] | ((state->m_scroll[1] & 0x03) << 8));
 
117
        tilemap_set_scrolly(state->m_fg_tilemap, 0, state->m_scroll[2] | ((state->m_scroll[3] & 0x03) << 8));
118
118
}
119
119
 
120
120
WRITE8_HANDLER( gundealr_flipscreen_w )
121
121
{
122
 
        gundealr_state *state = space->machine->driver_data<gundealr_state>();
123
 
        state->flipscreen = data;
124
 
        tilemap_set_flip_all(space->machine, state->flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
 
122
        gundealr_state *state = space->machine().driver_data<gundealr_state>();
 
123
        state->m_flipscreen = data;
 
124
        tilemap_set_flip_all(space->machine(), state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
125
125
}
126
126
 
127
127
 
132
132
 
133
133
***************************************************************************/
134
134
 
135
 
VIDEO_UPDATE( gundealr )
 
135
SCREEN_UPDATE( gundealr )
136
136
{
137
 
        gundealr_state *state = screen->machine->driver_data<gundealr_state>();
138
 
        tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
139
 
        tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
 
137
        gundealr_state *state = screen->machine().driver_data<gundealr_state>();
 
138
        tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
 
139
        tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
140
140
        return 0;
141
141
}