trunk/src/mame/includes/stv.h
| r21813 | r21814 | |
| 162 | 162 | TIMER_CALLBACK_MEMBER(dma_lv0_ended); |
| 163 | 163 | TIMER_CALLBACK_MEMBER(dma_lv1_ended); |
| 164 | 164 | TIMER_CALLBACK_MEMBER(dma_lv2_ended); |
| 165 | TIMER_CALLBACK_MEMBER(vdp1_draw_end); |
| 165 | 166 | void scu_single_transfer(address_space &space, UINT32 src, UINT32 dst,UINT8 *src_shift); |
| 166 | 167 | void scu_dma_direct(address_space &space, UINT8 dma_ch); |
| 167 | 168 | void scu_dma_indirect(address_space &space,UINT8 dma_ch); |
trunk/src/emu/video/stvvdp2.c
| r21813 | r21814 | |
| 4456 | 4456 | /* Langrisser III bit 3 normal, bit 1 during battle field */ |
| 4457 | 4457 | /* Metal Slug bit 0 during gameplay */ |
| 4458 | 4458 | /* Bug! Sega Away Logo onward 0x470 */ |
| 4459 | | if(STV_VDP2_SFSEL & ~0x47b) |
| 4459 | /* Command & Conquer 0x0004 0xc000 */ |
| 4460 | if(STV_VDP2_SFSEL & ~0x47f) |
| 4460 | 4461 | popmessage("Special Function Code Select enable %04x %04x, contact MAMEdev",STV_VDP2_SFSEL,STV_VDP2_SFCODE); |
| 4461 | 4462 | |
| 4462 | 4463 | /* Albert Odyssey Gaiden 0x0001 */ |
trunk/src/emu/video/stvvdp1.c
| r21813 | r21814 | |
| 1663 | 1663 | } |
| 1664 | 1664 | |
| 1665 | 1665 | |
| 1666 | |
| 1667 | |
| 1666 | 1668 | void saturn_state::stv_vdp1_draw_normal_sprite(const rectangle &cliprect, int sprite_type) |
| 1667 | 1669 | { |
| 1668 | 1670 | //UINT16 *destline; |
| r21813 | r21814 | |
| 1745 | 1747 | } |
| 1746 | 1748 | } |
| 1747 | 1749 | |
| 1750 | TIMER_CALLBACK_MEMBER(saturn_state::vdp1_draw_end ) |
| 1751 | { |
| 1752 | /* set CEF to 1*/ |
| 1753 | CEF_1; |
| 1754 | |
| 1755 | if(!(m_scu.ism & IRQ_VDP1_END)) |
| 1756 | { |
| 1757 | m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d); |
| 1758 | scu_do_transfer(6); |
| 1759 | } |
| 1760 | else |
| 1761 | m_scu.ist |= (IRQ_VDP1_END); |
| 1762 | } |
| 1763 | |
| 1764 | |
| 1748 | 1765 | void saturn_state::stv_vdp1_process_list( void ) |
| 1749 | 1766 | { |
| 1750 | 1767 | int position; |
| r21813 | r21814 | |
| 1776 | 1793 | // position = 0; |
| 1777 | 1794 | // } |
| 1778 | 1795 | |
| 1796 | spritecount++; |
| 1797 | |
| 1779 | 1798 | stv2_current_sprite.CMDCTRL = (m_vdp1_vram[position * (0x20/4)+0] & 0xffff0000) >> 16; |
| 1780 | 1799 | |
| 1781 | 1800 | if (stv2_current_sprite.CMDCTRL == 0x8000) |
| r21813 | r21814 | |
| 1969 | 1988 | } |
| 1970 | 1989 | } |
| 1971 | 1990 | |
| 1972 | | spritecount++; |
| 1973 | | |
| 1974 | 1991 | } |
| 1975 | 1992 | |
| 1976 | 1993 | |
| 1977 | 1994 | end: |
| 1978 | | /* set CEF to 1*/ |
| 1979 | | CEF_1; |
| 1980 | 1995 | m_vdp1.copr = (position * 0x20) >> 3; |
| 1981 | 1996 | |
| 1997 | /* TODO: what's the exact formula? Guess it should be a mix between number of pixels written and actual command data fetched. */ |
| 1998 | machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(spritecount*16), timer_expired_delegate(FUNC(saturn_state::vdp1_draw_end),this)); |
| 1999 | |
| 1982 | 2000 | if (VDP1_LOG) logerror ("End of list processing!\n"); |
| 1983 | 2001 | } |
| 1984 | 2002 | |
trunk/src/emu/machine/saturn.c
| r21813 | r21814 | |
| 479 | 479 | if(!(DWUP(dma_ch))) m_scu.dst[dma_ch] = tmp_dst; |
| 480 | 480 | |
| 481 | 481 | { |
| 482 | | /*TODO: change DMA into DRQ model. Timing is a guess. */ |
| 482 | /*TODO: Timing is a guess. */ |
| 483 | 483 | switch(dma_ch) |
| 484 | 484 | { |
| 485 | 485 | case 0: machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(total_size/4), timer_expired_delegate(FUNC(saturn_state::dma_lv0_ended),this)); break; |
| r21813 | r21814 | |
| 825 | 825 | |
| 826 | 826 | //popmessage("%08x %d T0 %d T1 %d %08x",m_scu.ism ^ 0xffffffff,max_y,m_scu_regs[36],m_scu_regs[37],m_scu_regs[38]); |
| 827 | 827 | |
| 828 | | if(scanline == (0)*y_step) |
| 829 | | { |
| 830 | | video_update_vdp1(); |
| 831 | | |
| 832 | | if(STV_VDP1_VBE) |
| 833 | | m_vdp1.framebuffer_clear_on_next_frame = 1; |
| 834 | | |
| 835 | | if(!(m_scu.ism & IRQ_VDP1_END)) |
| 836 | | { |
| 837 | | m_maincpu->set_input_line_and_vector(0x2, HOLD_LINE, 0x4d); |
| 838 | | scu_do_transfer(6); |
| 839 | | } |
| 840 | | else |
| 841 | | m_scu.ist |= (IRQ_VDP1_END); |
| 842 | | } |
| 843 | | |
| 844 | 828 | if(scanline == 0*y_step) |
| 845 | 829 | { |
| 846 | 830 | if(!(m_scu.ism & IRQ_VBLANK_OUT)) |
| r21813 | r21814 | |
| 861 | 845 | } |
| 862 | 846 | else |
| 863 | 847 | m_scu.ist |= (IRQ_VBLANK_IN); |
| 848 | |
| 849 | /* TODO: when Automatic Draw actually happens? Night Striker S is very fussy on this, and it looks like that VDP1 starts at more or less vblank-in time ... */ |
| 850 | video_update_vdp1(); |
| 864 | 851 | } |
| 865 | 852 | else if((scanline % y_step) == 0 && scanline < vblank_line*y_step) |
| 866 | 853 | { |
| r21813 | r21814 | |
| 873 | 860 | m_scu.ist |= (IRQ_HBLANK_IN); |
| 874 | 861 | } |
| 875 | 862 | |
| 863 | if(scanline == (vblank_line+1)*y_step) |
| 864 | { |
| 865 | /* docs mentions that VBE happens one line after vblank-in. */ |
| 866 | if(STV_VDP1_VBE) |
| 867 | m_vdp1.framebuffer_clear_on_next_frame = 1; |
| 868 | } |
| 869 | |
| 870 | |
| 876 | 871 | if(scanline == (m_scu_regs[36] & 0x3ff)*y_step) |
| 877 | 872 | { |
| 878 | 873 | if(!(m_scu.ism & IRQ_TIMER_0)) |