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

« back to all changes in this revision

Viewing changes to src/vidhrdw/toki.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:
7
7
***************************************************************************/
8
8
 
9
9
#include "driver.h"
10
 
#include "vidhrdw/generic.h"
11
 
 
12
 
static struct tilemap *background_layer,*foreground_layer,*text_layer;
13
 
 
14
 
data16_t *toki_background1_videoram16;
15
 
data16_t *toki_background2_videoram16;
16
 
data16_t *toki_scrollram16;
 
10
 
 
11
static tilemap *background_layer,*foreground_layer,*text_layer;
 
12
 
 
13
UINT16 *toki_background1_videoram16;
 
14
UINT16 *toki_background2_videoram16;
 
15
UINT16 *toki_scrollram16;
17
16
static unsigned int toki_background_xscroll[256];
18
17
static unsigned int toki_foreground_xscroll[256];
19
18
 
20
19
/*************************************************************************
21
 
                                        RASTER EFFECTS
 
20
                    RASTER EFFECTS
22
21
 
23
22
Xscroll can be altered per scanline to create rowscroll effect.
24
23
 
119
118
 
120
119
/*************************************
121
120
 *
122
 
 *              Start/Stop
 
121
 *      Start/Stop
123
122
 *
124
123
 *************************************/
125
124
 
167
166
}
168
167
 
169
168
/***************************************************************************
170
 
                                        SPRITES
171
 
 
172
 
        Original Spriteram
173
 
        ------------------
174
 
 
175
 
        It's not clear what purpose is served by marking tiles as being part of
176
 
        big sprites. (Big sprites in the attract abduction scene have all tiles
177
 
        marked as "first" unlike big sprites in-game.)
178
 
 
179
 
        We just ignore this top nibble (although perhaps in theory the bits
180
 
        enable X/Y offsets in the low byte).
181
 
 
182
 
        +0   x....... ........  sprite disable ??
 
169
                    SPRITES
 
170
 
 
171
    Original Spriteram
 
172
    ------------------
 
173
 
 
174
    It's not clear what purpose is served by marking tiles as being part of
 
175
    big sprites. (Big sprites in the attract abduction scene have all tiles
 
176
    marked as "first" unlike big sprites in-game.)
 
177
 
 
178
    We just ignore this top nibble (although perhaps in theory the bits
 
179
    enable X/Y offsets in the low byte).
 
180
 
 
181
    +0   x....... ........  sprite disable ??
183
182
      +0   .xx..... ........  tile is part of big sprite (4=first, 6=middle, 2=last)
184
 
        +0   .....x.. ........  ??? always set? (could be priority - see Bloodbro)
185
 
        +0   .......x ........  Flip x
186
 
        +0   ........ xxxx....  X offset: add (this * 16) to X coord
187
 
        +0   ........ ....xxxx  Y offset: add (this * 16) to Y coord
188
 
 
189
 
        +1   xxxx.... ........  Color bank
190
 
        +1   ....xxxx xxxxxxxx  Tile number (lo bits)
191
 
        +2   x....... ........  Tile number (hi bit)
192
 
        +2   .???.... ........  (set in not yet used entries)
193
 
        +2   .......x xxxxxxxx  X coordinate
194
 
        +3   .......x xxxxxxxx  Y coordinate
195
 
 
196
 
        f000 0000 f000 0000     entry not yet used: unless this is honored there
197
 
                                will be junk sprites in top left corner
198
 
        ffff ???? ???? ????     sprite marked as dead: unless this is honored
199
 
                                there will be junk sprites after floating monkey machine
200
 
 
201
 
 
202
 
        Bootleg Spriteram
203
 
        -----------------
204
 
 
205
 
        +0   .......x xxxxxxxx  Sprite Y coordinate
206
 
        +1   ...xxxxx xxxxxxxx  Sprite tile number
207
 
        +1   .x...... ........  Sprite flip x
208
 
        +2   xxxx.... ........  Sprite color bank
209
 
        +3   .......x xxxxxxxx  Sprite X coordinate
210
 
 
211
 
        f100 ???? ???? ????     dead / unused sprite ??
212
 
        ???? ???? 0000 ????     dead / unused sprite ??
 
183
    +0   .....x.. ........  ??? always set? (could be priority - see Bloodbro)
 
184
    +0   .......x ........  Flip x
 
185
    +0   ........ xxxx....  X offset: add (this * 16) to X coord
 
186
    +0   ........ ....xxxx  Y offset: add (this * 16) to Y coord
 
187
 
 
188
    +1   xxxx.... ........  Color bank
 
189
    +1   ....xxxx xxxxxxxx  Tile number (lo bits)
 
190
    +2   x....... ........  Tile number (hi bit)
 
191
    +2   .???.... ........  (set in not yet used entries)
 
192
    +2   .......x xxxxxxxx  X coordinate
 
193
    +3   .......x xxxxxxxx  Y coordinate
 
194
 
 
195
    f000 0000 f000 0000     entry not yet used: unless this is honored there
 
196
                            will be junk sprites in top left corner
 
197
    ffff ???? ???? ????     sprite marked as dead: unless this is honored
 
198
                            there will be junk sprites after floating monkey machine
 
199
 
 
200
 
 
201
    Bootleg Spriteram
 
202
    -----------------
 
203
 
 
204
    +0   .......x xxxxxxxx  Sprite Y coordinate
 
205
    +1   ...xxxxx xxxxxxxx  Sprite tile number
 
206
    +1   .x...... ........  Sprite flip x
 
207
    +2   xxxx.... ........  Sprite color bank
 
208
    +3   .......x xxxxxxxx  Sprite X coordinate
 
209
 
 
210
    f100 ???? ???? ????     dead / unused sprite ??
 
211
    ???? ???? 0000 ????     dead / unused sprite ??
213
212
 
214
213
 
215
214
***************************************************************************/
216
215
 
217
216
 
218
 
void toki_draw_sprites (struct mame_bitmap *bitmap,const struct rectangle *cliprect)
 
217
void toki_draw_sprites (mame_bitmap *bitmap,const rectangle *cliprect)
219
218
{
220
219
        int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs;
221
 
        data16_t *sprite_word;
 
220
        UINT16 *sprite_word;
222
221
 
223
222
        for (offs = (spriteram_size/2)-4;offs >= 0;offs -= 4)
224
223
        {
259
258
}
260
259
 
261
260
 
262
 
void tokib_draw_sprites (struct mame_bitmap *bitmap,const struct rectangle *cliprect)
 
261
void tokib_draw_sprites (mame_bitmap *bitmap,const rectangle *cliprect)
263
262
{
264
263
        int x,y,tile,flipx,color,offs;
265
 
        data16_t *sprite_word;
 
264
        UINT16 *sprite_word;
266
265
 
267
266
        for (offs = 0;offs < spriteram_size / 2;offs += 4)
268
267
        {
299
298
 
300
299
/*************************************
301
300
 *
302
 
 *              Master update function
 
301
 *      Master update function
303
302
 *
304
303
 *************************************/
305
304