Previous 15994 Revisions Next

r2584 Friday 9th May, 2008 at 06:00:30 UTC by Roberto Zandonà
[C64, C65, C128] Implentation of sprite wrapping at the top of the screen (bug #1159)
[src/mess/video]vic4567.c vic6567.c

src/mess/video/vic4567.c
r2583r2584
306306                  vic2.sprites[i].paintedline[j] = 0;
307307            }
308308         }
309         // sprite wrap y at the top of the screen
310         else if (SPRITEON (i) && (yoff == 1 + yend - ybegin) && (SPRITE_Y_POS (i) < 1 + yend - ybegin))
311         {
312            int wrapped = 1 + yend - ybegin - SPRITE_Y_POS (i);
313            syend = yend;
314
315            if (SPRITE_Y_EXPAND (i))
316            {
317               if (wrapped & 1) vic2.sprites[i].repeat = 1;
318               wrapped >>= 1;
319               syend = 21 * 2 - 1 - wrapped * 2;
320               if (syend > (yend - ybegin)) syend = yend - ybegin;
321            }
322            else
323            {
324               syend = 21 - 1 - wrapped;
325               if (syend > (yend - ybegin)) syend = yend - ybegin;
326            }
327
328            vic2.sprites[i].line = wrapped;
329
330            if (SPRITE_MULTICOLOR (i))
331               vic2_draw_sprite_multi (i, yoff, 0 , syend);
332            else
333               vic2_draw_sprite (i, yoff, 0 , syend);
334
335            if ((syend != yend) || (vic2.sprites[i].line > 20))
336            {
337               for (j = syend; j <= yend; j++)
338                  vic2.sprites[i].paintedline[j] = 0;
339               vic2.sprites[i].line = vic2.sprites[i].repeat = 0;
340            }
341         }
309342         else if (SPRITEON (i) && (yoff + ybegin <= SPRITE_Y_POS (i))
310343                && (yoff + yend >= SPRITE_Y_POS (i)))
311344         {
src/mess/video/vic6567.c
r2583r2584
12521252                  vic2.sprites[i].paintedline[j] = 0;
12531253            }
12541254         }
1255         // sprite wrap y at the top of the screen
1256         else if (SPRITEON (i) && (yoff == 1 + yend - ybegin) && (SPRITE_Y_POS (i) < 1 + yend - ybegin))
1257         {
1258            int wrapped = 1 + yend - ybegin - SPRITE_Y_POS (i);
1259            syend = yend;
1260
1261            if (SPRITE_Y_EXPAND (i))
1262            {
1263               if (wrapped & 1) vic2.sprites[i].repeat = 1;
1264               wrapped >>= 1;
1265               syend = 21 * 2 - 1 - wrapped * 2;
1266               if (syend > (yend - ybegin)) syend = yend - ybegin;
1267            }
1268            else
1269            {
1270               syend = 21 - 1 - wrapped;
1271               if (syend > (yend - ybegin)) syend = yend - ybegin;
1272            }
1273
1274            vic2.sprites[i].line = wrapped;
1275
1276            if (SPRITE_MULTICOLOR (i))
1277               vic2_draw_sprite_multi (i, yoff, 0 , syend);
1278            else
1279               vic2_draw_sprite (i, yoff, 0 , syend);
1280
1281            if ((syend != yend) || (vic2.sprites[i].line > 20))
1282            {
1283               for (j = syend; j <= yend; j++)
1284                  vic2.sprites[i].paintedline[j] = 0;
1285               vic2.sprites[i].line = vic2.sprites[i].repeat = 0;
1286            }
1287         }
12551288         else if (SPRITEON (i) && (yoff + ybegin <= SPRITE_Y_POS (i))
12561289                && (yoff + yend >= SPRITE_Y_POS (i)))
12571290         {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team