src/mame/video/stvvdp1.c
| r11888 | r11889 | |
| 154 | 154 | #define STV_VDP1_EDSR ((state->m_vdp1_regs[0x010/4] >> 16)&0x0000ffff) |
| 155 | 155 | #define STV_VDP1_CEF (STV_VDP1_EDSR & 2) |
| 156 | 156 | #define STV_VDP1_BEF (STV_VDP1_EDSR & 1) |
| 157 | | #define CEF_1 state->m_vdp1_regs[0x010/4]|=0x00020000 |
| 158 | | #define CEF_0 state->m_vdp1_regs[0x010/4]&=~0x00020000 |
| 159 | 157 | /**/ |
| 160 | 158 | |
| 161 | 159 | |
| r11888 | r11889 | |
| 347 | 345 | if ( STV_VDP1_TVM & 1 ) |
| 348 | 346 | { |
| 349 | 347 | /* 8-bit mode */ |
| 348 | printf("%08x %02x\n",offset,data); |
| 350 | 349 | } |
| 351 | 350 | else |
| 352 | 351 | { |
| r11888 | r11889 | |
| 370 | 369 | if ( STV_VDP1_TVM & 1 ) |
| 371 | 370 | { |
| 372 | 371 | /* 8-bit mode */ |
| 372 | printf("%08x\n",offset); |
| 373 | 373 | } |
| 374 | 374 | else |
| 375 | 375 | { |
| r11888 | r11889 | |
| 1768 | 1768 | stv_clear_gouraud_shading(); |
| 1769 | 1769 | |
| 1770 | 1770 | /*Set CEF bit to 0*/ |
| 1771 | | CEF_0; |
| 1771 | //CEF_0; |
| 1772 | 1772 | |
| 1773 | 1773 | while (spritecount<10000) // if its drawn this many sprites something is probably wrong or sega were crazy ;-) |
| 1774 | 1774 | { |
| r11888 | r11889 | |
| 1978 | 1978 | |
| 1979 | 1979 | end: |
| 1980 | 1980 | /*set CEF to 1*/ |
| 1981 | | CEF_1; |
| 1981 | //CEF_1; |
| 1982 | 1982 | |
| 1983 | 1983 | /* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */ |
| 1984 | 1984 | // if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/ |
src/mame/drivers/saturn.c
| r11888 | r11889 | |
| 2578 | 2578 | |
| 2579 | 2579 | SCU register[36] is the timer zero compare register. |
| 2580 | 2580 | SCU register[40] is for IRQ masking. |
| 2581 | |
| 2582 | TODO: |
| 2583 | - VDP1 timing and CEF emulation isn't accurate at all. |
| 2581 | 2584 | */ |
| 2582 | 2585 | |
| 2583 | 2586 | |
| r11888 | r11889 | |
| 2598 | 2601 | //popmessage("%08x %d %08x %08x",state->m_scu_regs[40] ^ 0xffffffff,max_y,state->m_scu_regs[36],state->m_scu_regs[38]); |
| 2599 | 2602 | |
| 2600 | 2603 | if(scanline == 0*y_step) |
| 2604 | { |
| 2601 | 2605 | device_set_input_line_and_vector(state->m_maincpu, 0xe, (stv_irq.vblank_out) ? HOLD_LINE : CLEAR_LINE , 0x41); |
| 2606 | CEF_0; |
| 2607 | } |
| 2602 | 2608 | else if(scanline == vblank_line*y_step) |
| 2609 | { |
| 2603 | 2610 | device_set_input_line_and_vector(state->m_maincpu, 0xf, (stv_irq.vblank_in) ? HOLD_LINE : CLEAR_LINE , 0x40); |
| 2611 | device_set_input_line_and_vector(state->m_maincpu, 0x2, (stv_irq.vdp1_end) ? HOLD_LINE : CLEAR_LINE, 0x4d); |
| 2612 | CEF_1; |
| 2613 | } |
| 2604 | 2614 | else if((scanline % y_step) == 0 && scanline < vblank_line*y_step) |
| 2605 | 2615 | device_set_input_line_and_vector(state->m_maincpu, 0xd, (stv_irq.hblank_in) ? HOLD_LINE : CLEAR_LINE, 0x42); |
| 2606 | 2616 | |
| r11888 | r11889 | |
| 2611 | 2621 | if(scanline == (state->m_scu_regs[36] & 0x3ff)*y_step) |
| 2612 | 2622 | device_set_input_line_and_vector(state->m_maincpu, 0xc, (stv_irq.timer_0) ? HOLD_LINE : CLEAR_LINE, 0x43 ); |
| 2613 | 2623 | |
| 2614 | | if(scanline == 64) //TODO: emulate the timing of this |
| 2615 | | device_set_input_line_and_vector(state->m_maincpu, 0x2, (stv_irq.vdp1_end) ? HOLD_LINE : CLEAR_LINE, 0x4d); |
| 2616 | 2624 | } |
| 2617 | 2625 | |
| 2618 | 2626 | static READ32_HANDLER( saturn_cart_dram0_r ) |