~ubuntu-branches/ubuntu/karmic/xmame/karmic

« back to all changes in this revision

Viewing changes to src/vidhrdw/thoop2.c

  • Committer: Bazaar Package Importer
  • Author(s): Bruno Barrera C.
  • Date: 2007-02-16 10:06:54 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070216100654-iztas2cl47k5j039
Tags: 0.106-2
* Added Italian debconf templates translation. (closes: #382672)
* Added German debconf templates translation. (closes: #396610)
* Added Japanese debconf templates translation. (closes: #400011)
* Added Portuguese debconf templates translation. (closes: #409960)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
***************************************************************************/
11
11
 
12
12
#include "driver.h"
13
 
#include "tilemap.h"
14
 
#include "vidhrdw/generic.h"
15
13
 
16
 
data16_t *thoop2_vregs;
17
 
data16_t *thoop2_videoram;
18
 
data16_t *thoop2_spriteram;
 
14
UINT16 *thoop2_vregs;
 
15
UINT16 *thoop2_videoram;
 
16
UINT16 *thoop2_spriteram;
19
17
 
20
18
static int sprite_count[5];
21
19
static int *sprite_table[5];
22
 
static struct tilemap *pant[2];
 
20
static tilemap *pant[2];
23
21
 
24
22
 
25
23
/***************************************************************************
26
24
 
27
 
        Callbacks for the TileMap code
 
25
    Callbacks for the TileMap code
28
26
 
29
27
***************************************************************************/
30
28
 
31
29
/*
32
 
        Tile format
33
 
        -----------
34
 
 
35
 
        Screen 0 & 1: (32*32, 16x16 tiles)
36
 
 
37
 
        Word | Bit(s)                    | Description
38
 
        -----+-FEDCBA98-76543210-+--------------------------
39
 
          0  | -------- ------xx | code (high bits)
40
 
          0  | xxxxxxxx xxxxxx-- | code (low bits)
41
 
          1  | -------- --xxxxxx | color
42
 
          1      | -------- xx------ | priority
43
 
          1  | --xxxxxx -------- | not used
44
 
          1  | -x------ -------- | flip x
45
 
          1  | x------- -------- | flip y
 
30
    Tile format
 
31
    -----------
 
32
 
 
33
    Screen 0 & 1: (32*32, 16x16 tiles)
 
34
 
 
35
    Word | Bit(s)            | Description
 
36
    -----+-FEDCBA98-76543210-+--------------------------
 
37
      0  | -------- ------xx | code (high bits)
 
38
      0  | xxxxxxxx xxxxxx-- | code (low bits)
 
39
      1  | -------- --xxxxxx | color
 
40
      1  | -------- xx------ | priority
 
41
      1  | --xxxxxx -------- | not used
 
42
      1  | -x------ -------- | flip x
 
43
      1  | x------- -------- | flip y
46
44
*/
47
45
 
48
46
static void get_tile_info_thoop2_screen0(int tile_index)
70
68
 
71
69
/***************************************************************************
72
70
 
73
 
        Memory Handlers
 
71
    Memory Handlers
74
72
 
75
73
***************************************************************************/
76
74
 
85
83
 
86
84
/***************************************************************************
87
85
 
88
 
        Start/Stop the video hardware emulation.
 
86
    Start/Stop the video hardware emulation.
89
87
 
90
88
***************************************************************************/
91
89
 
104
102
 
105
103
        for (i = 0; i < 5; i++){
106
104
                sprite_table[i] = auto_malloc(512*sizeof(int));
107
 
                if (!sprite_table[i]){
108
 
                        return 1;
109
 
                }
110
105
        }
111
106
 
112
107
        return 0;
114
109
 
115
110
/***************************************************************************
116
111
 
117
 
        Sprites
 
112
    Sprites
118
113
 
119
114
***************************************************************************/
120
115
 
145
140
}
146
141
 
147
142
/*
148
 
        Sprite Format
149
 
        -------------
 
143
    Sprite Format
 
144
    -------------
150
145
 
151
 
        Word | Bit(s)                    | Description
152
 
        -----+-FEDCBA98-76543210-+--------------------------
153
 
          0  | -------- xxxxxxxx | y position
154
 
          0  | -----xxx -------- | not used
155
 
          0  | ----x--- -------- | sprite size
156
 
          0  | --xx---- -------- | sprite priority
157
 
          0  | -x------ -------- | flipx
158
 
          0  | x------- -------- | flipy
159
 
          1  | xxxxxxxx xxxxxxxx | not used
160
 
          2  | -------x xxxxxxxx | x position
161
 
          2  | -xxxxxx- -------- | sprite color
162
 
          3      | -------- ------xx | sprite code (high bits)
163
 
          3  | xxxxxxxx xxxxxx-- | sprite code (low bits)
 
146
    Word | Bit(s)            | Description
 
147
    -----+-FEDCBA98-76543210-+--------------------------
 
148
      0  | -------- xxxxxxxx | y position
 
149
      0  | -----xxx -------- | not used
 
150
      0  | ----x--- -------- | sprite size
 
151
      0  | --xx---- -------- | sprite priority
 
152
      0  | -x------ -------- | flipx
 
153
      0  | x------- -------- | flipy
 
154
      1  | xxxxxxxx xxxxxxxx | not used
 
155
      2  | -------x xxxxxxxx | x position
 
156
      2  | -xxxxxx- -------- | sprite color
 
157
      3  | -------- ------xx | sprite code (high bits)
 
158
      3  | xxxxxxxx xxxxxx-- | sprite code (low bits)
164
159
*/
165
160
 
166
 
static void gaelco_draw_sprites(struct mame_bitmap *bitmap, const struct rectangle *cliprect, int pri)
 
161
static void gaelco_draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect, int pri)
167
162
{
168
163
        int j, x, y, ex, ey;
169
 
        const struct GfxElement *gfx = Machine->gfx[0];
 
164
        const gfx_element *gfx = Machine->gfx[0];
170
165
 
171
166
        static int x_offset[2] = {0x0,0x2};
172
167
        static int y_offset[2] = {0x0,0x1};
210
205
 
211
206
/***************************************************************************
212
207
 
213
 
        Display Refresh
 
208
    Display Refresh
214
209
 
215
210
***************************************************************************/
216
211