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

« back to all changes in this revision

Viewing changes to src/mame/video/finalizr.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:
15
15
        int i;
16
16
 
17
17
        /* allocate the colortable */
18
 
        machine->colortable = colortable_alloc(machine, 0x20);
 
18
        machine.colortable = colortable_alloc(machine, 0x20);
19
19
 
20
20
        /* create a lookup table for the palette */
21
21
        for (i = 0; i < 0x20; i++)
24
24
                int g = pal4bit(color_prom[i + 0x00] >> 4);
25
25
                int b = pal4bit(color_prom[i + 0x20] >> 0);
26
26
 
27
 
                colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
 
27
                colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
28
28
        }
29
29
 
30
30
        /* color_prom now points to the beginning of the lookup table */
33
33
        for (i = 0; i < 0x100; i++)
34
34
        {
35
35
                UINT8 ctabentry = (color_prom[i] & 0x0f) | 0x10;
36
 
                colortable_entry_set_value(machine->colortable, i, ctabentry);
 
36
                colortable_entry_set_value(machine.colortable, i, ctabentry);
37
37
        }
38
38
 
39
39
        for (i = 0x100; i < 0x200; i++)
40
40
        {
41
41
                UINT8 ctabentry = color_prom[i] & 0x0f;
42
 
                colortable_entry_set_value(machine->colortable, i, ctabentry);
 
42
                colortable_entry_set_value(machine.colortable, i, ctabentry);
43
43
        }
44
44
}
45
45
 
46
46
static TILE_GET_INFO( get_bg_tile_info )
47
47
{
48
 
        finalizr_state *state = machine->driver_data<finalizr_state>();
49
 
        int attr = state->colorram[tile_index];
50
 
        int code = state->videoram[tile_index] + ((attr & 0xc0) << 2) + (state->charbank << 10);
 
48
        finalizr_state *state = machine.driver_data<finalizr_state>();
 
49
        int attr = state->m_colorram[tile_index];
 
50
        int code = state->m_videoram[tile_index] + ((attr & 0xc0) << 2) + (state->m_charbank << 10);
51
51
        int color = attr & 0x0f;
52
52
        int flags = TILE_FLIPYX((attr & 0x30) >> 4);
53
53
 
56
56
 
57
57
static TILE_GET_INFO( get_fg_tile_info )
58
58
{
59
 
        finalizr_state *state = machine->driver_data<finalizr_state>();
60
 
        int attr = state->colorram2[tile_index];
61
 
        int code = state->videoram2[tile_index] + ((attr & 0xc0) << 2);
 
59
        finalizr_state *state = machine.driver_data<finalizr_state>();
 
60
        int attr = state->m_colorram2[tile_index];
 
61
        int code = state->m_videoram2[tile_index] + ((attr & 0xc0) << 2);
62
62
        int color = attr & 0x0f;
63
63
        int flags = TILE_FLIPYX((attr & 0x30) >> 4);
64
64
 
67
67
 
68
68
VIDEO_START( finalizr )
69
69
{
70
 
        finalizr_state *state = machine->driver_data<finalizr_state>();
 
70
        finalizr_state *state = machine.driver_data<finalizr_state>();
71
71
 
72
 
        state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
73
 
        state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
 
72
        state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
 
73
        state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
74
74
}
75
75
 
76
76
 
77
77
 
78
78
WRITE8_HANDLER( finalizr_videoctrl_w )
79
79
{
80
 
        finalizr_state *state = space->machine->driver_data<finalizr_state>();
81
 
        state->charbank = data & 3;
82
 
        state->spriterambank = data & 8;
 
80
        finalizr_state *state = space->machine().driver_data<finalizr_state>();
 
81
        state->m_charbank = data & 3;
 
82
        state->m_spriterambank = data & 8;
83
83
        /* other bits unknown */
84
84
}
85
85
 
86
86
 
87
87
 
88
 
VIDEO_UPDATE( finalizr )
 
88
SCREEN_UPDATE( finalizr )
89
89
{
90
 
        finalizr_state *state = screen->machine->driver_data<finalizr_state>();
 
90
        finalizr_state *state = screen->machine().driver_data<finalizr_state>();
91
91
        int offs;
92
92
 
93
 
        tilemap_mark_all_tiles_dirty(state->bg_tilemap);
94
 
        tilemap_mark_all_tiles_dirty(state->fg_tilemap);
 
93
        tilemap_mark_all_tiles_dirty(state->m_bg_tilemap);
 
94
        tilemap_mark_all_tiles_dirty(state->m_fg_tilemap);
95
95
 
96
 
        tilemap_set_scrollx(state->bg_tilemap, 0, *state->scroll - 32);
97
 
        tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
 
96
        tilemap_set_scrollx(state->m_bg_tilemap, 0, *state->m_scroll - 32);
 
97
        tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
98
98
 
99
99
        /* Draw the sprites. */
100
100
        {
101
 
                const gfx_element *gfx1 = screen->machine->gfx[1];
102
 
                const gfx_element *gfx2 = screen->machine->gfx[2];
103
 
 
104
 
                UINT8 *sr = state->spriterambank ? state->spriteram_2 : state->spriteram;
105
 
 
106
 
 
107
 
                for (offs = 0; offs <= state->spriteram_size - 5; offs += 5)
 
101
                const gfx_element *gfx1 = screen->machine().gfx[1];
 
102
                const gfx_element *gfx2 = screen->machine().gfx[2];
 
103
 
 
104
                UINT8 *sr = state->m_spriterambank ? state->m_spriteram_2 : state->m_spriteram;
 
105
 
 
106
 
 
107
                for (offs = 0; offs <= state->m_spriteram_size - 5; offs += 5)
108
108
                {
109
109
                        int sx, sy, flipx, flipy, code, color, size;
110
110
 
122
122
 
123
123
                        if (size >= 0x10)       /* 32x32 */
124
124
                        {
125
 
                                if (flip_screen_get(screen->machine))
 
125
                                if (flip_screen_get(screen->machine()))
126
126
                                {
127
127
                                        sx = 256 - sx;
128
128
                                        sy = 224 - sy;
153
153
                        }
154
154
                        else
155
155
                        {
156
 
                                if (flip_screen_get(screen->machine))
 
156
                                if (flip_screen_get(screen->machine()))
157
157
                                {
158
158
                                        sx = ((size & 0x08) ? 280:272) - sx;
159
159
                                        sy = ((size & 0x04) ? 248:240) - sy;
219
219
                /* draw top status region */
220
220
                clip.min_x = visarea.min_x;
221
221
                clip.max_x = visarea.min_x + 31;
222
 
                tilemap_set_scrolldx(state->fg_tilemap,  0,-32);
223
 
                tilemap_draw(bitmap, &clip, state->fg_tilemap, 0, 0);
 
222
                tilemap_set_scrolldx(state->m_fg_tilemap,  0,-32);
 
223
                tilemap_draw(bitmap, &clip, state->m_fg_tilemap, 0, 0);
224
224
        }
225
225
        return 0;
226
226
}