src/mess/video/vic6567.c
| r3220 | r3221 | |
| 577 | 577 | |
| 578 | 578 | // sprites chenges are active only from the next raster line |
| 579 | 579 | // FIX ME : c65 have different width, left border width is 8 pixel wrong ?! |
| 580 | /* |
| 580 | 581 | if (!strncmp(machine->gamedrv->name, "c64", 3)) |
| 581 | 582 | { |
| 582 | 583 | if (startx > VIC2_FIRSTRASTERCOLUMNS) |
| r3220 | r3221 | |
| 595 | 596 | } |
| 596 | 597 | } |
| 597 | 598 | } |
| 598 | | |
| 599 | */ |
| 599 | 600 | } |
| 600 | 601 | |
| 601 | 602 | READ8_HANDLER ( vic2_port_r ) |
| r3220 | r3221 | |
| 1308 | 1309 | /* sprite priority, sprite overwrites lowerprior pixels */ |
| 1309 | 1310 | for (i = 7; i >= 0; i--) |
| 1310 | 1311 | { |
| 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) && |
| 1312 | 1345 | (yoff + ybegin >= SPRITE_Y_POS (i)) && |
| 1313 | 1346 | (yoff + ybegin - SPRITE_Y_POS (i) < (SPRITE_Y_EXPAND (i)? 21 * 2 : 21 )) && |
| 1314 | 1347 | (SPRITE_Y_POS (i) < 0)) |
| r3220 | r3221 | |
| 1429 | 1462 | } |
| 1430 | 1463 | for (i=0; i < 5; i++) |
| 1431 | 1464 | 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)); |
| 1434 | 1469 | vic2.rasterline_start_cpu_cycles = activecpu_gettotalcycles(); |
| 1435 | 1470 | |
| 1436 | 1471 | if (vic2.rasterline == vic2.lines) |