src/mame/machine/dc.c
| r7960 | r7961 | |
| 215 | 215 | dc_update_interrupt_status(machine); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | static TIMER_CALLBACK( ch2_dma_irq ) |
| 219 | { |
| 220 | dc_sysctrl_regs[SB_C2DLEN]=0; |
| 221 | dc_sysctrl_regs[SB_C2DST]=0; |
| 222 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_CH2; |
| 223 | dc_update_interrupt_status(machine); |
| 224 | } |
| 225 | |
| 226 | static TIMER_CALLBACK( yuv_fifo_irq ) |
| 227 | { |
| 228 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV; |
| 229 | dc_update_interrupt_status(machine); |
| 230 | } |
| 231 | |
| 218 | 232 | static void wave_dma_execute(const address_space *space) |
| 219 | 233 | { |
| 220 | 234 | UINT32 src,dst,size; |
| r7960 | r7961 | |
| 633 | 647 | switch (reg) |
| 634 | 648 | { |
| 635 | 649 | case SB_C2DST: |
| 636 | | address=dc_sysctrl_regs[SB_C2DSTAT]; |
| 637 | | ddtdata.destination=address; |
| 638 | | /* 0 rounding size = 16 Mbytes */ |
| 639 | | if(dc_sysctrl_regs[SB_C2DLEN] == 0) |
| 640 | | ddtdata.length = 0x1000000; |
| 641 | | else |
| 642 | | ddtdata.length = dc_sysctrl_regs[SB_C2DLEN]; |
| 643 | | ddtdata.size=1; |
| 644 | | ddtdata.direction=0; |
| 645 | | ddtdata.channel=2; |
| 646 | | ddtdata.mode=25; //011001 |
| 647 | | sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); |
| 648 | | #if DEBUG_SYSCTRL |
| 649 | | if ((address >= 0x11000000) && (address <= 0x11FFFFFF)) |
| 650 | | if (dc_sysctrl_regs[SB_LMMODE0]) |
| 651 | | printf("SYSCTRL: Ch2 direct display lists dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 1 |
| 650 | if(((old & 1) == 0) && (dat & 1)) // 0 -> 1 |
| 651 | { |
| 652 | address=(dc_sysctrl_regs[SB_C2DSTAT] & 0x03ffffe0) | 0x10000000; |
| 653 | if(dc_sysctrl_regs[SB_C2DSTAT] & 0x1f) |
| 654 | printf("C2DSTAT just used to reserved bits %02x\n",dc_sysctrl_regs[SB_C2DSTAT] & 0x1f); |
| 655 | |
| 656 | ddtdata.destination=address; |
| 657 | /* 0 rounding size = 16 Mbytes */ |
| 658 | if(dc_sysctrl_regs[SB_C2DLEN] == 0) |
| 659 | ddtdata.length = 0x1000000; |
| 652 | 660 | else |
| 653 | | mame_printf_verbose("SYSCTRL: Ch2 direct textures dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 0 |
| 654 | | else if ((address >= 0x13000000) && (address <= 0x13FFFFFF)) |
| 655 | | if (dc_sysctrl_regs[SB_LMMODE1]) |
| 656 | | printf("SYSCTRL: Ch2 direct display lists dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 1 |
| 661 | ddtdata.length = dc_sysctrl_regs[SB_C2DLEN]; |
| 662 | ddtdata.size=1; |
| 663 | ddtdata.direction=0; |
| 664 | ddtdata.channel=2; |
| 665 | ddtdata.mode=25; //011001 |
| 666 | sh4_dma_ddt(devtag_get_device(space->machine, "maincpu"),&ddtdata); |
| 667 | #if DEBUG_SYSCTRL |
| 668 | if ((address >= 0x11000000) && (address <= 0x11FFFFFF)) |
| 669 | if (dc_sysctrl_regs[SB_LMMODE0]) |
| 670 | printf("SYSCTRL: Ch2 direct display lists dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 1 |
| 671 | else |
| 672 | mame_printf_verbose("SYSCTRL: Ch2 direct textures dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 0 |
| 673 | else if ((address >= 0x13000000) && (address <= 0x13FFFFFF)) |
| 674 | if (dc_sysctrl_regs[SB_LMMODE1]) |
| 675 | printf("SYSCTRL: Ch2 direct display lists dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 1 |
| 676 | else |
| 677 | mame_printf_verbose("SYSCTRL: Ch2 direct textures dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 0 |
| 678 | else if ((address >= 0x10800000) && (address <= 0x10ffffff)) |
| 679 | printf("SYSCTRL: Ch2 YUV dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 680 | else if ((address >= 0x10000000) && (address <= 0x107fffff)) |
| 681 | mame_printf_verbose("SYSCTRL: Ch2 TA Display List dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 657 | 682 | else |
| 658 | | mame_printf_verbose("SYSCTRL: Ch2 direct textures dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); // 0 |
| 659 | | else if ((address >= 0x10800000) && (address <= 0x10ffffff)) |
| 660 | | mame_printf_verbose("SYSCTRL: Ch2 YUV dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 661 | | else if ((address >= 0x10000000) && (address <= 0x107fffff)) |
| 662 | | mame_printf_verbose("SYSCTRL: Ch2 TA Display List dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 663 | | else |
| 664 | | mame_printf_verbose("SYSCTRL: Ch2 unknown dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 665 | | #endif |
| 666 | | if ((address >= 0x10000000) && (address <= 0x10ffffff)) |
| 667 | | { |
| 668 | | dc_sysctrl_regs[SB_C2DSTAT]=address; |
| 683 | mame_printf_verbose("SYSCTRL: Ch2 unknown dma %x from %08x to %08x (lmmode0=%d lmmode1=%d)\n", dc_sysctrl_regs[SB_C2DLEN], ddtdata.source-ddtdata.length, dc_sysctrl_regs[SB_C2DSTAT],dc_sysctrl_regs[SB_LMMODE0],dc_sysctrl_regs[SB_LMMODE1]); |
| 684 | #endif |
| 685 | |
| 686 | if ((!(address & 0x01000000))) |
| 687 | dc_sysctrl_regs[SB_C2DSTAT]=address; |
| 688 | else //direct texture path |
| 689 | dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length; |
| 690 | |
| 691 | timer_set(space->machine, ATTOTIME_IN_USEC(200), NULL, 0, ch2_dma_irq); |
| 692 | /* simulate YUV FIFO processing here */ |
| 693 | if((address & 0x1800000) == 0x0800000) |
| 694 | timer_set(space->machine, ATTOTIME_IN_USEC(500), NULL, 0, yuv_fifo_irq); |
| 669 | 695 | } |
| 670 | | else |
| 671 | | { |
| 672 | | dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length; |
| 673 | | } |
| 674 | | |
| 675 | | dc_sysctrl_regs[SB_C2DLEN]=0; |
| 676 | | dc_sysctrl_regs[SB_C2DST]=0; |
| 677 | | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_CH2; |
| 678 | 696 | break; |
| 679 | 697 | |
| 680 | 698 | case SB_ISTNRM: |
| 681 | 699 | dc_sysctrl_regs[SB_ISTNRM] = old & ~(dat | 0xC0000000); // bits 31,30 ro |
| 700 | dc_update_interrupt_status(space->machine); |
| 682 | 701 | break; |
| 683 | 702 | |
| 684 | 703 | case SB_ISTEXT: |
| 685 | 704 | dc_sysctrl_regs[SB_ISTEXT] = old; |
| 705 | dc_update_interrupt_status(space->machine); |
| 686 | 706 | break; |
| 687 | 707 | |
| 688 | 708 | case SB_ISTERR: |
| 689 | 709 | dc_sysctrl_regs[SB_ISTERR] = old & ~dat; |
| 710 | dc_update_interrupt_status(space->machine); |
| 690 | 711 | break; |
| 691 | 712 | case SB_SDST: |
| 692 | | //#if DEBUG_SYSCTRL |
| 693 | | //mame_printf_verbose("SYSCTRL: Sort-DMA not supported yet !!!\n"); |
| 694 | | //#endif |
| 695 | 713 | if(dat & 1) |
| 696 | 714 | { |
| 697 | 715 | // TODO: Sort-DMA routine goes here |
| 698 | 716 | printf("Sort-DMA irq\n"); |
| 699 | 717 | |
| 718 | dc_sysctrl_regs[SB_SDST] = 0; |
| 700 | 719 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_SORT; |
| 701 | | dc_sysctrl_regs[SB_SDST] = 0; |
| 720 | dc_update_interrupt_status(space->machine); |
| 702 | 721 | } |
| 703 | 722 | break; |
| 704 | 723 | } |
| 705 | | dc_update_interrupt_status(space->machine); |
| 706 | 724 | |
| 707 | 725 | #if DEBUG_SYSCTRL |
| 708 | 726 | if ((reg != 0x40) && (reg != 0x42) && (reg > 2)) // filter out IRQ acks and ch2 dma |
| r7960 | r7961 | |
| 1378 | 1396 | wave_dma_execute(space); |
| 1379 | 1397 | break; |
| 1380 | 1398 | |
| 1399 | case SB_E1ST: |
| 1400 | case SB_E2ST: |
| 1401 | case SB_DDST: |
| 1402 | if(dat & 1) |
| 1403 | printf("Warning: enabled G2 Debug / External DMA %08x\n",reg); |
| 1404 | break; |
| 1405 | |
| 1381 | 1406 | case SB_ADSUSP: |
| 1382 | 1407 | case SB_E1SUSP: |
| 1383 | 1408 | case SB_E2SUSP: |
| r7960 | r7961 | |
| 1504 | 1529 | |
| 1505 | 1530 | reg = decode_reg3216_64(space->machine, offset, mem_mask, &shift); |
| 1506 | 1531 | mame_printf_verbose("RTC: Unmapped read %08x\n", 0x710000+reg*4); |
| 1532 | |
| 1507 | 1533 | return (UINT64)dc_rtcregister[reg] << shift; |
| 1508 | 1534 | } |
| 1509 | 1535 | |
src/mame/video/dc.c
| r7960 | r7961 | |
| 11 | 11 | #include "profiler.h" |
| 12 | 12 | #include "video/rgbutil.h" |
| 13 | 13 | |
| 14 | | static int vblc=0; |
| 15 | 14 | #define DEBUG_FIFO_POLY (0) |
| 16 | 15 | #define DEBUG_PVRTA (0) |
| 17 | 16 | #define DEBUG_PVRTA_REGS (0) |
| 18 | | #define DEBUG_PVRDLIST (1) |
| 17 | #define DEBUG_PVRDLIST (0) |
| 19 | 18 | #define DEBUG_PALRAM (1) |
| 20 | 19 | |
| 21 | 20 | #define NUM_BUFFERS 4 |
| r7960 | r7961 | |
| 54 | 53 | |
| 55 | 54 | /* |
| 56 | 55 | SPG_HBLANK |
| 57 | | ---- ---- --xx xxxx xxxx ---- ---- ---- vbend |
| 58 | | ---- ---- ---- ---- ---- --xx xxxx xxxx vbstart |
| 56 | ---- ---- --xx xxxx xxxx ---- ---- ---- hbend |
| 57 | ---- ---- ---- ---- ---- --xx xxxx xxxx hbstart |
| 59 | 58 | */ |
| 60 | 59 | #define spg_hbend ((pvrta_regs[SPG_HBLANK] & 0x03ff0000) >> 16) |
| 61 | 60 | #define spg_hbstart ((pvrta_regs[SPG_HBLANK] & 0x000003ff) >> 0) |
| r7960 | r7961 | |
| 138 | 137 | static UINT32 tafifo_buff[32]; |
| 139 | 138 | |
| 140 | 139 | static emu_timer *vbout_timer; |
| 140 | static emu_timer *vbin_timer; |
| 141 | 141 | static emu_timer *hbin_timer; |
| 142 | 142 | static emu_timer *endofrender_timer_isp; |
| 143 | 143 | static emu_timer *endofrender_timer_tsp; |
| r7960 | r7961 | |
| 1245 | 1245 | printf("TA_YUV_TEX_BASE initialized to %08x\n", dat); |
| 1246 | 1246 | |
| 1247 | 1247 | // hack, this interrupt is generated after transfering a set amount of data |
| 1248 | | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV; |
| 1249 | | dc_update_interrupt_status(space->machine); |
| 1248 | //dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV; |
| 1249 | //dc_update_interrupt_status(space->machine); |
| 1250 | 1250 | |
| 1251 | 1251 | break; |
| 1252 | case TA_YUV_TEX_CTRL: |
| 1253 | printf("TA_YUV_TEX_CTRL initialized to %08x\n", dat); |
| 1254 | break; |
| 1252 | 1255 | |
| 1256 | case SPG_VBLANK_INT: |
| 1257 | /* clear pending irqs and modify them with the updated ones */ |
| 1258 | timer_adjust_oneshot(vbin_timer, attotime_never, 0); |
| 1259 | timer_adjust_oneshot(vbout_timer, attotime_never, 0); |
| 1253 | 1260 | |
| 1261 | timer_adjust_oneshot(vbin_timer, video_screen_get_time_until_pos(space->machine->primary_screen, spg_vblank_in_irq_line_num, 0), 0); |
| 1262 | timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(space->machine->primary_screen, spg_vblank_out_irq_line_num, 0), 0); |
| 1263 | break; |
| 1264 | /* TODO: timer adjust for SPG_HBLANK_INT too */ |
| 1254 | 1265 | case TA_LIST_CONT: |
| 1255 | 1266 | #if DEBUG_PVRTA |
| 1256 | 1267 | mame_printf_verbose("List continuation processing\n"); |
| 1257 | 1268 | #endif |
| 1258 | | state_ta.tafifo_listtype= -1; // no list being received |
| 1259 | | state_ta.listtype_used |= (1+4); |
| 1269 | if(dat & 0x80000000) |
| 1270 | { |
| 1271 | state_ta.tafifo_listtype= -1; // no list being received |
| 1272 | state_ta.listtype_used |= (1+4); |
| 1273 | } |
| 1260 | 1274 | break; |
| 1261 | 1275 | case SPG_VBLANK: |
| 1262 | 1276 | case SPG_HBLANK: |
| r7960 | r7961 | |
| 1282 | 1296 | mame_printf_verbose("PVRTA: [%08x=%x] write %" I64FMT "x to %x (reg %x %x), mask %" I64FMT "x\n", 0x5f8000+reg*4, dat, data>>shift, offset, reg, (reg*4)+0x8000, mem_mask); |
| 1283 | 1297 | #endif |
| 1284 | 1298 | } |
| 1299 | |
| 1300 | static TIMER_CALLBACK( transfer_opaque_list_irq ) |
| 1301 | { |
| 1302 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPLST; |
| 1303 | dc_update_interrupt_status(machine); |
| 1304 | } |
| 1305 | |
| 1306 | static TIMER_CALLBACK( transfer_opaque_modifier_volume_list_irq ) |
| 1307 | { |
| 1308 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPMV; |
| 1309 | dc_update_interrupt_status(machine); |
| 1310 | } |
| 1311 | |
| 1312 | static TIMER_CALLBACK( transfer_translucent_list_irq ) |
| 1313 | { |
| 1314 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRLST; |
| 1315 | dc_update_interrupt_status(machine); |
| 1316 | } |
| 1317 | |
| 1318 | static TIMER_CALLBACK( transfer_translucent_modifier_volume_list_irq ) |
| 1319 | { |
| 1320 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRMV; |
| 1321 | dc_update_interrupt_status(machine); |
| 1322 | } |
| 1323 | |
| 1324 | static TIMER_CALLBACK( transfer_punch_through_list_irq ) |
| 1325 | { |
| 1326 | dc_sysctrl_regs[SB_ISTNRM] |= (1 << 21); |
| 1327 | dc_update_interrupt_status(machine); |
| 1328 | } |
| 1329 | |
| 1285 | 1330 | static void process_ta_fifo(running_machine* machine) |
| 1286 | 1331 | { |
| 1287 | | UINT32 a; |
| 1288 | | |
| 1289 | 1332 | /* first byte in the buffer is the Parameter Control Word |
| 1290 | 1333 | |
| 1291 | 1334 | pppp pppp gggg gggg oooo oooo oooo oooo |
| r7960 | r7961 | |
| 1366 | 1409 | #if DEBUG_PVRDLIST |
| 1367 | 1410 | mame_printf_verbose("Para Type 0 End of List\n"); |
| 1368 | 1411 | #endif |
| 1369 | | a=0; // 6-10 0-3 |
| 1412 | /* Process transfer FIFO done irqs here */ |
| 1413 | /* FIXME: timing of these */ |
| 1370 | 1414 | switch (state_ta.tafifo_listtype) |
| 1371 | 1415 | { |
| 1372 | | case 0: |
| 1373 | | a = 1 << 7; |
| 1374 | | break; |
| 1375 | | case 1: |
| 1376 | | a = 1 << 8; |
| 1377 | | break; |
| 1378 | | case 2: |
| 1379 | | a = 1 << 9; |
| 1380 | | break; |
| 1381 | | case 3: |
| 1382 | | a = 1 << 10; |
| 1383 | | break; |
| 1384 | | case 4: |
| 1385 | | a = 1 << 21; |
| 1386 | | break; |
| 1416 | case 0: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_opaque_list_irq); break; |
| 1417 | case 1: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_opaque_modifier_volume_list_irq); break; |
| 1418 | case 2: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_translucent_list_irq); break; |
| 1419 | case 3: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_translucent_modifier_volume_list_irq); break; |
| 1420 | case 4: timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, transfer_punch_through_list_irq); break; |
| 1387 | 1421 | } |
| 1388 | | |
| 1389 | | dc_sysctrl_regs[SB_ISTNRM] |= a; |
| 1390 | | dc_update_interrupt_status(machine); |
| 1391 | 1422 | state_ta.tafifo_listtype= -1; // no list being received |
| 1392 | 1423 | state_ta.listtype_used |= (2+8); |
| 1393 | 1424 | } |
| r7960 | r7961 | |
| 1622 | 1653 | reg = decode_reg_64(offset, mem_mask, &shift); |
| 1623 | 1654 | dat = (UINT32)(data >> shift); |
| 1624 | 1655 | |
| 1625 | | mame_printf_verbose("YUV FIFO: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x10800000+reg*4, dat, data, offset, mem_mask); |
| 1656 | // printf("YUV FIFO: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x %08x\n", 0x10800000+reg*4, dat, data, offset, mem_mask,test); |
| 1626 | 1657 | } |
| 1627 | 1658 | |
| 1628 | 1659 | /* test video start */ |
| r7960 | r7961 | |
| 1791 | 1822 | yy0 = round(y0); |
| 1792 | 1823 | yy1 = round(y1); |
| 1793 | 1824 | |
| 1825 | if((yy0 < 0 && y0 > 0) || (yy1 < 0 && y1 > 0)) //temp handling of int32 overflow, needed by hotd2/totd |
| 1826 | return; |
| 1827 | |
| 1794 | 1828 | dy = yy0+0.5-y0; |
| 1795 | 1829 | |
| 1796 | 1830 | if(0) |
| r7960 | r7961 | |
| 1908 | 1942 | v1->x, v0->x + dx02dy*dy01, v1->u, v0->u + du02dy*dy01, v1->v, v0->v + dv02dy*dy01, v1->w, v0->w + dw02dy*dy01, |
| 1909 | 1943 | dx12dy, dx02dy, du12dy, du02dy, dv12dy, dv02dy, dw12dy, dw02dy); |
| 1910 | 1944 | } else { |
| 1945 | |
| 1911 | 1946 | render_span(bitmap, ti, v0->y, v1->y, |
| 1912 | 1947 | v0->x, v0->x, v0->u, v0->u, v0->v, v0->v, v0->w, v0->w, |
| 1913 | 1948 | dx02dy, dx01dy, du02dy, du01dy, dv02dy, dv01dy, dw02dy, dw01dy); |
| r7960 | r7961 | |
| 2421 | 2456 | pvr_parameterconfig[a] = pvr_parameterconfig[a-1]; |
| 2422 | 2457 | } |
| 2423 | 2458 | |
| 2459 | static TIMER_CALLBACK(vbin) |
| 2460 | { |
| 2461 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt |
| 2462 | dc_update_interrupt_status(machine); |
| 2463 | |
| 2464 | timer_adjust_oneshot(vbin_timer, video_screen_get_time_until_pos(machine->primary_screen, spg_vblank_in_irq_line_num, 0), 0); |
| 2465 | } |
| 2466 | |
| 2424 | 2467 | static TIMER_CALLBACK(vbout) |
| 2425 | 2468 | { |
| 2426 | | UINT32 a; |
| 2427 | | //printf("vbout\n"); |
| 2428 | | |
| 2429 | | a=dc_sysctrl_regs[SB_ISTNRM] | IST_VBL_OUT; |
| 2430 | | dc_sysctrl_regs[SB_ISTNRM] = a; // V Blank-out interrupt |
| 2469 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt |
| 2431 | 2470 | dc_update_interrupt_status(machine); |
| 2432 | 2471 | |
| 2433 | | scanline = 0; |
| 2434 | | next_y = spg_line_comp_val; |
| 2435 | | timer_adjust_oneshot(vbout_timer, attotime_never, 0); |
| 2436 | | timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, spg_hblank_in_irq-1), 0); |
| 2472 | timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(machine->primary_screen, spg_vblank_out_irq_line_num, 0), 0); |
| 2437 | 2473 | } |
| 2438 | 2474 | |
| 2439 | 2475 | static TIMER_CALLBACK(hbin) |
| r7960 | r7961 | |
| 2457 | 2493 | |
| 2458 | 2494 | scanline++; |
| 2459 | 2495 | |
| 2496 | if(scanline >= spg_vblank_in_irq_line_num) |
| 2497 | { |
| 2498 | scanline = 0; |
| 2499 | next_y = spg_line_comp_val; |
| 2500 | } |
| 2501 | |
| 2460 | 2502 | timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, spg_hblank_in_irq-1), 0); |
| 2461 | 2503 | } |
| 2462 | 2504 | |
| r7960 | r7961 | |
| 2520 | 2562 | computedilated(); |
| 2521 | 2563 | |
| 2522 | 2564 | vbout_timer = timer_alloc(machine, vbout, 0); |
| 2523 | | timer_adjust_oneshot(vbout_timer, attotime_never, 0); |
| 2565 | timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(machine->primary_screen, spg_vblank_out_irq_line_num, 0), 0); |
| 2524 | 2566 | |
| 2567 | vbin_timer = timer_alloc(machine, vbin, 0); |
| 2568 | timer_adjust_oneshot(vbin_timer, video_screen_get_time_until_pos(machine->primary_screen, spg_vblank_in_irq_line_num, 0), 0); |
| 2569 | |
| 2525 | 2570 | hbin_timer = timer_alloc(machine, hbin, 0); |
| 2526 | | timer_adjust_oneshot(hbin_timer, attotime_never, 0); |
| 2571 | timer_adjust_oneshot(hbin_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, spg_hblank_in_irq-1), 0); |
| 2572 | |
| 2527 | 2573 | scanline = 0; |
| 2528 | 2574 | next_y = 0; |
| 2529 | 2575 | |
| r7960 | r7961 | |
| 2586 | 2632 | |
| 2587 | 2633 | return 0; |
| 2588 | 2634 | } |
| 2589 | | |
| 2590 | | void dc_vblank(running_machine *machine) |
| 2591 | | { |
| 2592 | | //printf("vblankin\n"); |
| 2593 | | |
| 2594 | | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt |
| 2595 | | dc_update_interrupt_status(machine); |
| 2596 | | vblc++; |
| 2597 | | |
| 2598 | | timer_adjust_oneshot(vbout_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0); |
| 2599 | | } |