7
7
***************************************************************************/
10
#include "vidhrdw/generic.h"
12
static struct tilemap *background_layer,*foreground_layer,*text_layer;
14
data16_t *toki_background1_videoram16;
15
data16_t *toki_background2_videoram16;
16
data16_t *toki_scrollram16;
11
static tilemap *background_layer,*foreground_layer,*text_layer;
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];
20
19
/*************************************************************************
23
22
Xscroll can be altered per scanline to create rowscroll effect.
169
168
/***************************************************************************
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.)
179
We just ignore this top nibble (although perhaps in theory the bits
180
enable X/Y offsets in the low byte).
182
+0 x....... ........ sprite disable ??
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.)
178
We just ignore this top nibble (although perhaps in theory the bits
179
enable X/Y offsets in the low byte).
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
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
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
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
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
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
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
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
210
f100 ???? ???? ???? dead / unused sprite ??
211
???? ???? 0000 ???? dead / unused sprite ??
215
214
***************************************************************************/
218
void toki_draw_sprites (struct mame_bitmap *bitmap,const struct rectangle *cliprect)
217
void toki_draw_sprites (mame_bitmap *bitmap,const rectangle *cliprect)
220
219
int x,y,xoffs,yoffs,tile,flipx,flipy,color,offs;
221
data16_t *sprite_word;
223
222
for (offs = (spriteram_size/2)-4;offs >= 0;offs -= 4)