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

« back to all changes in this revision

Viewing changes to src/mame/video/pokechmp.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:
3
3
#include "emu.h"
4
4
#include "includes/pokechmp.h"
5
5
 
6
 
static tilemap_t *bg_tilemap;
7
6
 
8
7
WRITE8_HANDLER( pokechmp_videoram_w )
9
8
{
10
 
        pokechmp_state *state = space->machine->driver_data<pokechmp_state>();
11
 
        UINT8 *videoram = state->videoram;
 
9
        pokechmp_state *state = space->machine().driver_data<pokechmp_state>();
 
10
        UINT8 *videoram = state->m_videoram;
12
11
        videoram[offset] = data;
13
 
        tilemap_mark_tile_dirty(bg_tilemap, offset / 2);
 
12
        tilemap_mark_tile_dirty(state->m_bg_tilemap, offset / 2);
14
13
}
15
14
 
16
15
WRITE8_HANDLER( pokechmp_flipscreen_w )
17
16
{
18
 
        if (flip_screen_get(space->machine) != (data & 0x80))
 
17
        if (flip_screen_get(space->machine()) != (data & 0x80))
19
18
        {
20
 
                flip_screen_set(space->machine, data & 0x80);
21
 
                tilemap_mark_all_tiles_dirty_all(space->machine);
 
19
                flip_screen_set(space->machine(), data & 0x80);
 
20
                tilemap_mark_all_tiles_dirty_all(space->machine());
22
21
        }
23
22
}
24
23
 
25
24
static TILE_GET_INFO( get_bg_tile_info )
26
25
{
27
 
        pokechmp_state *state = machine->driver_data<pokechmp_state>();
28
 
        UINT8 *videoram = state->videoram;
 
26
        pokechmp_state *state = machine.driver_data<pokechmp_state>();
 
27
        UINT8 *videoram = state->m_videoram;
29
28
        int code = videoram[tile_index*2+1] + ((videoram[tile_index*2] & 0x3f) << 8);
30
29
        int color = videoram[tile_index*2] >> 6;
31
30
 
34
33
 
35
34
VIDEO_START( pokechmp )
36
35
{
37
 
        bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
 
36
        pokechmp_state *state = machine.driver_data<pokechmp_state>();
 
37
        state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
38
38
                 8, 8, 32, 32);
39
39
}
40
40
 
41
 
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
 
41
static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
42
42
{
43
 
        UINT8 *spriteram = machine->generic.spriteram.u8;
 
43
        pokechmp_state *state = machine.driver_data<pokechmp_state>();
 
44
        UINT8 *spriteram = state->m_spriteram;
44
45
        int offs;
45
46
 
46
 
        for (offs = 0;offs < machine->generic.spriteram_size;offs += 4)
 
47
        for (offs = 0;offs < state->m_spriteram_size;offs += 4)
47
48
        {
48
49
                if (spriteram[offs] != 0xf8)
49
50
                {
62
63
                                if (flipy) flipy=0; else flipy=1;
63
64
                        }
64
65
 
65
 
                        drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
 
66
                        drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
66
67
                                        spriteram[offs+3] + ((spriteram[offs+1] & 1) << 8),
67
68
                                        (spriteram[offs+1] & 0xf0) >> 4,
68
69
                                        flipx,flipy,
71
72
        }
72
73
}
73
74
 
74
 
VIDEO_UPDATE( pokechmp )
 
75
SCREEN_UPDATE( pokechmp )
75
76
{
76
 
        tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
77
 
        draw_sprites(screen->machine, bitmap, cliprect);
 
77
        pokechmp_state *state = screen->machine().driver_data<pokechmp_state>();
 
78
        tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
 
79
        draw_sprites(screen->machine(), bitmap, cliprect);
78
80
        return 0;
79
81
}