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

« back to all changes in this revision

Viewing changes to src/mame/video/ssozumo.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:
42
42
 
43
43
WRITE8_HANDLER( ssozumo_videoram_w )
44
44
{
45
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
45
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
46
46
 
47
 
        state->videoram[offset] = data;
48
 
        tilemap_mark_tile_dirty(state->bg_tilemap, offset);
 
47
        state->m_videoram[offset] = data;
 
48
        tilemap_mark_tile_dirty(state->m_bg_tilemap, offset);
49
49
}
50
50
 
51
51
WRITE8_HANDLER( ssozumo_colorram_w )
52
52
{
53
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
53
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
54
54
 
55
 
        state->colorram[offset] = data;
56
 
        tilemap_mark_tile_dirty(state->bg_tilemap, offset);
 
55
        state->m_colorram[offset] = data;
 
56
        tilemap_mark_tile_dirty(state->m_bg_tilemap, offset);
57
57
}
58
58
 
59
59
WRITE8_HANDLER( ssozumo_videoram2_w )
60
60
{
61
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
61
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
62
62
 
63
 
        state->videoram2[offset] = data;
64
 
        tilemap_mark_tile_dirty(state->fg_tilemap, offset);
 
63
        state->m_videoram2[offset] = data;
 
64
        tilemap_mark_tile_dirty(state->m_fg_tilemap, offset);
65
65
}
66
66
 
67
67
WRITE8_HANDLER( ssozumo_colorram2_w )
68
68
{
69
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
69
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
70
70
 
71
 
        state->colorram2[offset] = data;
72
 
        tilemap_mark_tile_dirty(state->fg_tilemap, offset);
 
71
        state->m_colorram2[offset] = data;
 
72
        tilemap_mark_tile_dirty(state->m_fg_tilemap, offset);
73
73
}
74
74
 
75
75
WRITE8_HANDLER( ssozumo_paletteram_w )
76
76
{
77
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
77
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
78
78
        int     bit0, bit1, bit2, bit3, val;
79
79
        int     r, g, b;
80
80
        int     offs2;
81
81
 
82
 
        state->paletteram[offset] = data;
 
82
        state->m_paletteram[offset] = data;
83
83
        offs2 = offset & 0x0f;
84
84
 
85
 
        val = state->paletteram[offs2];
 
85
        val = state->m_paletteram[offs2];
86
86
        bit0 = (val >> 0) & 0x01;
87
87
        bit1 = (val >> 1) & 0x01;
88
88
        bit2 = (val >> 2) & 0x01;
89
89
        bit3 = (val >> 3) & 0x01;
90
90
        r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
91
91
 
92
 
        val = state->paletteram[offs2 | 0x10];
 
92
        val = state->m_paletteram[offs2 | 0x10];
93
93
        bit0 = (val >> 0) & 0x01;
94
94
        bit1 = (val >> 1) & 0x01;
95
95
        bit2 = (val >> 2) & 0x01;
96
96
        bit3 = (val >> 3) & 0x01;
97
97
        g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
98
98
 
99
 
        val = state->paletteram[offs2 | 0x20];
 
99
        val = state->m_paletteram[offs2 | 0x20];
100
100
        bit0 = (val >> 0) & 0x01;
101
101
        bit1 = (val >> 1) & 0x01;
102
102
        bit2 = (val >> 2) & 0x01;
103
103
        bit3 = (val >> 3) & 0x01;
104
104
        b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
105
105
 
106
 
        palette_set_color(space->machine, offs2 + 64, MAKE_RGB(r, g, b));
 
106
        palette_set_color(space->machine(), offs2 + 64, MAKE_RGB(r, g, b));
107
107
}
108
108
 
109
109
WRITE8_HANDLER( ssozumo_scroll_w )
110
110
{
111
 
        ssozumo_state *state = space->machine->driver_data<ssozumo_state>();
 
111
        ssozumo_state *state = space->machine().driver_data<ssozumo_state>();
112
112
 
113
 
        tilemap_set_scrolly(state->bg_tilemap, 0, data);
 
113
        tilemap_set_scrolly(state->m_bg_tilemap, 0, data);
114
114
}
115
115
 
116
116
WRITE8_HANDLER( ssozumo_flipscreen_w )
117
117
{
118
 
        flip_screen_set(space->machine, data & 0x80);
 
118
        flip_screen_set(space->machine(), data & 0x80);
119
119
}
120
120
 
121
121
static TILE_GET_INFO( get_bg_tile_info )
122
122
{
123
 
        ssozumo_state *state = machine->driver_data<ssozumo_state>();
124
 
        int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 0x08) << 5);
125
 
        int color = (state->colorram[tile_index] & 0x30) >> 4;
 
123
        ssozumo_state *state = machine.driver_data<ssozumo_state>();
 
124
        int code = state->m_videoram[tile_index] + ((state->m_colorram[tile_index] & 0x08) << 5);
 
125
        int color = (state->m_colorram[tile_index] & 0x30) >> 4;
126
126
        int flags = ((tile_index % 32) >= 16) ? TILE_FLIPY : 0;
127
127
 
128
128
        SET_TILE_INFO(1, code, color, flags);
130
130
 
131
131
static TILE_GET_INFO( get_fg_tile_info )
132
132
{
133
 
        ssozumo_state *state = machine->driver_data<ssozumo_state>();
134
 
        int code = state->videoram2[tile_index] + 256 * (state->colorram2[tile_index] & 0x07);
135
 
        int color = (state->colorram2[tile_index] & 0x30) >> 4;
 
133
        ssozumo_state *state = machine.driver_data<ssozumo_state>();
 
134
        int code = state->m_videoram2[tile_index] + 256 * (state->m_colorram2[tile_index] & 0x07);
 
135
        int color = (state->m_colorram2[tile_index] & 0x30) >> 4;
136
136
 
137
137
        SET_TILE_INFO(0, code, color, 0);
138
138
}
139
139
 
140
140
VIDEO_START( ssozumo )
141
141
{
142
 
        ssozumo_state *state = machine->driver_data<ssozumo_state>();
 
142
        ssozumo_state *state = machine.driver_data<ssozumo_state>();
143
143
 
144
 
        state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x,
 
144
        state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x,
145
145
                 16, 16, 16, 32);
146
146
 
147
 
        state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols_flip_x,
 
147
        state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols_flip_x,
148
148
                 8, 8, 32, 32);
149
149
 
150
 
        tilemap_set_transparent_pen(state->fg_tilemap, 0);
 
150
        tilemap_set_transparent_pen(state->m_fg_tilemap, 0);
151
151
}
152
152
 
153
 
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
 
153
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
154
154
{
155
 
        ssozumo_state *state = machine->driver_data<ssozumo_state>();
156
 
        UINT8 *spriteram = state->spriteram;
 
155
        ssozumo_state *state = machine.driver_data<ssozumo_state>();
 
156
        UINT8 *spriteram = state->m_spriteram;
157
157
        int offs;
158
158
 
159
 
        for (offs = 0; offs < state->spriteram_size; offs += 4)
 
159
        for (offs = 0; offs < state->m_spriteram_size; offs += 4)
160
160
        {
161
161
                if (spriteram[offs] & 0x01)
162
162
                {
176
176
                        }
177
177
 
178
178
                        drawgfx_transpen(bitmap, cliprect,
179
 
                                machine->gfx[2],
 
179
                                machine.gfx[2],
180
180
                                code, color,
181
181
                                flipx, flipy,
182
182
                                sx, sy, 0);
184
184
        }
185
185
}
186
186
 
187
 
VIDEO_UPDATE( ssozumo )
 
187
SCREEN_UPDATE( ssozumo )
188
188
{
189
 
        ssozumo_state *state = screen->machine->driver_data<ssozumo_state>();
 
189
        ssozumo_state *state = screen->machine().driver_data<ssozumo_state>();
190
190
 
191
 
        tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
192
 
        tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
193
 
        draw_sprites(screen->machine, bitmap, cliprect);
 
191
        tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
 
192
        tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
 
193
        draw_sprites(screen->machine(), bitmap, cliprect);
194
194
        return 0;
195
195
}