Previous 15994 Revisions Next

r3221 Wednesday 10th September, 2008 at 21:50:37 UTC by Roberto Zandonà
[C64] fixed crash related to vic ii
[src/mess/video]vic6567.c

src/mess/video/vic6567.c
r3220r3221
577577
578578   // sprites chenges are active only from the next raster line
579579   // FIX ME : c65 have different width, left border width is 8 pixel wrong ?!
580/*
580581   if (!strncmp(machine->gamedrv->name, "c64", 3))
581582   {
582583      if (startx > VIC2_FIRSTRASTERCOLUMNS)
r3220r3221
595596         }
596597      }
597598   }
598
599*/
599600}
600601
601602READ8_HANDLER ( vic2_port_r )
r3220r3221
13081309      /* sprite priority, sprite overwrites lowerprior pixels */
13091310      for (i = 7; i >= 0; i--)
13101311      {
1311         if    (SPRITEON (i) &&
1312      if (vic2.sprites[i].line || vic2.sprites[i].repeat) // FIX ME: sprite warp is wrong
1313         {
1314            syend = yend;
1315            if (SPRITE_Y_EXPAND (i))
1316            {
1317               if ((21 - vic2.sprites[i].line) * 2 - vic2.sprites[i].repeat < yend - ybegin + 1)
1318               syend = ybegin + (21 - vic2.sprites[i].line) * 2 - vic2.sprites[i].repeat - 1;
1319            }
1320            else
1321            {
1322               if (vic2.sprites[i].line + yend - ybegin + 1 > 20)
1323               syend = ybegin + 20 - vic2.sprites[i].line;
1324            }
1325            if (yoff + syend > YPOS + 200)
1326               syend = YPOS + 200 - yoff - 1;
1327            if (yoff + ybegin < 0)
1328            {
1329               ybegin = -yoff;
1330               yend = - yoff;
1331            }
1332
1333            if (SPRITE_MULTICOLOR (i))
1334               vic2_draw_sprite_multi (i, yoff, ybegin, syend, start_x, end_x);
1335            else
1336               vic2_draw_sprite (i, yoff, ybegin, syend,  start_x, end_x);
1337            if ((syend != yend) || (vic2.sprites[i].line > 20))
1338            {
1339               vic2.sprites[i].line = vic2.sprites[i].repeat = 0;
1340               for (j = syend; j <= yend; j++)
1341                  vic2.sprites[i].paintedline[j] = 0;
1342            }
1343         }
1344         else if (SPRITEON (i) &&
13121345               (yoff + ybegin >= SPRITE_Y_POS (i)) &&
13131346               (yoff + ybegin - SPRITE_Y_POS (i) < (SPRITE_Y_EXPAND (i)? 21 * 2 : 21 )) &&
13141347               (SPRITE_Y_POS (i) < 0))
r3220r3221
14291462   }
14301463   for (i=0; i < 5; i++)
14311464      vic2.spritemulti[i] = vic2.spritemulti_buffer[i];
1432   //if (input_code_pressed(KEYCODE_Q)) { cpunum_suspend(0, SUSPEND_ANY_REASON, 40); cpunum_resume(0, SUSPEND_ANY_REASON); }
1433   //printf("%04x    ", (int)(activecpu_gettotalcycles() - vic2.rasterline_start_cpu_cycles));
1465   if (input_code_pressed(KEYCODE_Q)) { cpunum_set_clock(machine, 0, 0x93203); }
1466   if (input_code_pressed(KEYCODE_W)) { cpunum_set_clock(machine, 0, 0xf08a0); }
1467   // if (input_code_pressed(KEYCODE_E)) printf("%04x    ",cpunum_get_clock(0));
1468   // if (input_code_pressed(KEYCODE_R)) printf("%04x    ", (int)(cpunum_get_clock(0)*63/103));
14341469   vic2.rasterline_start_cpu_cycles = activecpu_gettotalcycles();
14351470
14361471   if (vic2.rasterline == vic2.lines)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team