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

« back to all changes in this revision

Viewing changes to src/mame/drivers/good.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
                : driver_device(machine, config) { }
43
43
 
44
44
        /* memory pointers */
45
 
        UINT16 *  bg_tilemapram;
46
 
        UINT16 *  fg_tilemapram;
47
 
        UINT16 *  sprites;
48
 
//  UINT16 *  paletteram;   // currently this uses generic palette handling
 
45
        UINT16 *  m_bg_tilemapram;
 
46
        UINT16 *  m_fg_tilemapram;
 
47
        UINT16 *  m_sprites;
 
48
//  UINT16 *  m_paletteram;   // currently this uses generic palette handling
49
49
 
50
50
        /* video-related */
51
 
        tilemap_t  *bg_tilemap,*fg_tilemap;
 
51
        tilemap_t  *m_bg_tilemap;
 
52
        tilemap_t  *m_fg_tilemap;
52
53
};
53
54
 
54
55
 
55
56
static WRITE16_HANDLER( fg_tilemapram_w )
56
57
{
57
 
        good_state *state = space->machine->driver_data<good_state>();
58
 
        COMBINE_DATA(&state->fg_tilemapram[offset]);
59
 
        tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
 
58
        good_state *state = space->machine().driver_data<good_state>();
 
59
        COMBINE_DATA(&state->m_fg_tilemapram[offset]);
 
60
        tilemap_mark_tile_dirty(state->m_fg_tilemap, offset / 2);
60
61
}
61
62
 
62
63
static TILE_GET_INFO( get_fg_tile_info )
63
64
{
64
 
        good_state *state = machine->driver_data<good_state>();
65
 
        int tileno = state->fg_tilemapram[tile_index * 2];
66
 
        int attr = state->fg_tilemapram[tile_index * 2 + 1] & 0xf;
 
65
        good_state *state = machine.driver_data<good_state>();
 
66
        int tileno = state->m_fg_tilemapram[tile_index * 2];
 
67
        int attr = state->m_fg_tilemapram[tile_index * 2 + 1] & 0xf;
67
68
        SET_TILE_INFO(0, tileno, attr, 0);
68
69
}
69
70
 
70
71
static WRITE16_HANDLER( bg_tilemapram_w )
71
72
{
72
 
        good_state *state = space->machine->driver_data<good_state>();
73
 
        COMBINE_DATA(&state->bg_tilemapram[offset]);
74
 
        tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
 
73
        good_state *state = space->machine().driver_data<good_state>();
 
74
        COMBINE_DATA(&state->m_bg_tilemapram[offset]);
 
75
        tilemap_mark_tile_dirty(state->m_bg_tilemap, offset / 2);
75
76
}
76
77
 
77
78
static TILE_GET_INFO( get_bg_tile_info )
78
79
{
79
 
        good_state *state = machine->driver_data<good_state>();
80
 
        int tileno = state->bg_tilemapram[tile_index * 2];
81
 
        int attr = state->bg_tilemapram[tile_index * 2 + 1] & 0xf;
 
80
        good_state *state = machine.driver_data<good_state>();
 
81
        int tileno = state->m_bg_tilemapram[tile_index * 2];
 
82
        int attr = state->m_bg_tilemapram[tile_index * 2 + 1] & 0xf;
82
83
        SET_TILE_INFO(1, tileno, attr, 0);
83
84
}
84
85
 
86
87
 
87
88
static VIDEO_START( good )
88
89
{
89
 
        good_state *state = machine->driver_data<good_state>();
90
 
        state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
91
 
        state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
92
 
        tilemap_set_transparent_pen(state->fg_tilemap, 0xf);
 
90
        good_state *state = machine.driver_data<good_state>();
 
91
        state->m_bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
 
92
        state->m_fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
 
93
        tilemap_set_transparent_pen(state->m_fg_tilemap, 0xf);
93
94
}
94
95
 
95
 
static VIDEO_UPDATE( good )
 
96
static SCREEN_UPDATE( good )
96
97
{
97
 
        good_state *state = screen->machine->driver_data<good_state>();
98
 
        tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
99
 
        tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
 
98
        good_state *state = screen->machine().driver_data<good_state>();
 
99
        tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);
 
100
        tilemap_draw(bitmap, cliprect, state->m_fg_tilemap, 0, 0);
100
101
        return 0;
101
102
}
102
103
 
103
 
static ADDRESS_MAP_START( good_map, ADDRESS_SPACE_PROGRAM, 16 )
 
104
static ADDRESS_MAP_START( good_map, AS_PROGRAM, 16 )
104
105
        AM_RANGE(0x000000, 0x01ffff) AM_ROM
105
106
 
106
107
        //AM_RANGE(0x270000, 0x270007) AM_RAM // scroll?
112
113
 
113
114
        AM_RANGE(0x800000, 0x8007ff) AM_RAM_WRITE(paletteram16_xRRRRRGGGGGBBBBB_word_w) AM_BASE_GENERIC(paletteram)
114
115
 
115
 
        AM_RANGE(0x820000, 0x820fff) AM_RAM_WRITE(fg_tilemapram_w) AM_BASE_MEMBER(good_state, fg_tilemapram)
116
 
        AM_RANGE(0x822000, 0x822fff) AM_RAM_WRITE(bg_tilemapram_w) AM_BASE_MEMBER(good_state, bg_tilemapram)
 
116
        AM_RANGE(0x820000, 0x820fff) AM_RAM_WRITE(fg_tilemapram_w) AM_BASE_MEMBER(good_state, m_fg_tilemapram)
 
117
        AM_RANGE(0x822000, 0x822fff) AM_RAM_WRITE(bg_tilemapram_w) AM_BASE_MEMBER(good_state, m_bg_tilemapram)
117
118
 
118
119
        AM_RANGE(0xff0000, 0xffefff) AM_RAM
119
120
ADDRESS_MAP_END
286
287
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
287
288
        MCFG_SCREEN_SIZE(32*16, 32*16)
288
289
        MCFG_SCREEN_VISIBLE_AREA(1*16, 23*16-1, 0*16, 14*16-1)
 
290
        MCFG_SCREEN_UPDATE(good)
289
291
 
290
292
        MCFG_PALETTE_LENGTH(0x400)
291
293
 
292
294
        MCFG_VIDEO_START(good)
293
 
        MCFG_VIDEO_UPDATE(good)
294
295
 
295
296
        MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
296
297