~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
/* TTL text plane stuff */
14
14
 
15
15
static int ttl_gfx_index;
16
 
static tilemap *ttl_tilemap;
17
 
static UINT16 ttl_vram[0x800];
 
16
static tilemap *ttl_tilemap, *roz_tilemap;
 
17
static UINT16 ttl_vram[0x800], roz_vram[0x800];
18
18
 
19
19
/* TTL text plane */
20
20
 
29
29
        SET_TILE_INFO(ttl_gfx_index, code, attr, 0);
30
30
}
31
31
 
 
32
static TILE_GET_INFO( roz_get_tile_info )
 
33
{
 
34
        int attr, code;
 
35
 
 
36
        attr = (roz_vram[tile_index] >> 12) + 16;       // roz base palette is palette 16
 
37
        code = roz_vram[tile_index] & 0x3ff;
 
38
 
 
39
        SET_TILE_INFO(0, code, attr, 0);
 
40
}
 
41
 
32
42
READ32_HANDLER( polygonet_ttl_ram_r )
33
43
{
34
44
        UINT32 *vram = (UINT32 *)ttl_vram;
46
56
        tilemap_mark_tile_dirty(ttl_tilemap, offset*2+1);
47
57
}
48
58
 
 
59
READ32_HANDLER( polygonet_roz_ram_r )
 
60
{
 
61
        UINT32 *vram = (UINT32 *)roz_vram;
 
62
 
 
63
        return(vram[offset]);
 
64
}
 
65
 
 
66
WRITE32_HANDLER( polygonet_roz_ram_w )
 
67
{
 
68
        UINT32 *vram = (UINT32 *)roz_vram;
 
69
 
 
70
        COMBINE_DATA(&vram[offset]);
 
71
 
 
72
        tilemap_mark_tile_dirty(roz_tilemap, offset*2);
 
73
        tilemap_mark_tile_dirty(roz_tilemap, offset*2+1);
 
74
}
 
75
 
49
76
static TILEMAP_MAPPER( plygonet_scan )
50
77
{
51
78
        return row * num_cols + (col^1);
52
79
}
53
80
 
 
81
static TILEMAP_MAPPER( plygonet_scan_cols )
 
82
{
 
83
        return col * num_rows + (row^1);
 
84
}
 
85
 
54
86
VIDEO_START( polygonet )
55
87
{
56
88
        static const gfx_layout charlayout =
80
112
        tilemap_set_transparent_pen(ttl_tilemap, 0);
81
113
 
82
114
        state_save_register_global_array(machine, ttl_vram);
 
115
 
 
116
        // set up the roz t-map too
 
117
        roz_tilemap = tilemap_create(machine, roz_get_tile_info, plygonet_scan_cols, 16, 16, 32, 64);
 
118
        tilemap_set_transparent_pen(roz_tilemap, 0);
83
119
}
84
120
 
85
121
VIDEO_UPDATE( polygonet )
86
122
{
87
 
        bitmap_fill(priority_bitmap, NULL, 0);
 
123
        bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
88
124
        bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
89
125
 
 
126
        K053936_0_zoom_draw(bitmap, cliprect, roz_tilemap, 0, 0, 0);
 
127
 
90
128
        tilemap_draw(bitmap, cliprect, ttl_tilemap, 0, 1<<0);
91
129
        return 0;
92
130
}