From b6220ce5a57a97e84170169c32f39a29aa23c50c Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Sun, 25 Aug 2013 23:01:09 +0000 Subject: [PATCH] Fixed H-Blank IN regression, made CH2 DMA to fire irq via CPU cycles, miscellanea --- src/emu/machine/saturn.c | 2 +- src/mame/machine/dc.c | 8 ++++---- src/mame/video/powervr2.c | 4 ++-- src/mess/drivers/dccons.c | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/emu/machine/saturn.c b/src/emu/machine/saturn.c index 56c669214c6..5e612c224a8 100644 --- a/src/emu/machine/saturn.c +++ b/src/emu/machine/saturn.c @@ -411,7 +411,7 @@ void saturn_state::scu_dma_direct(address_space &space, UINT8 dma_ch) if(LOG_SCU) printf("Start Add %04x Destination Add %04x\n",m_scu.src_add[dma_ch],m_scu.dst_add[dma_ch]); } - /* TODO: Game Basic and World Cup 98 trips this, according to the docs the SCU can't transfer from BIOS area (can't communicate from/to that bus) */ + /* Game Basic and World Cup 98 trips this, according to the docs the SCU can't transfer from BIOS area (can't communicate from/to that bus) */ if(BIOS_BUS(m_scu.src[dma_ch])) { popmessage("Warning: SCU transfer from BIOS area, contact MAMEdev"); diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 80cbc67d302..d767dc641bf 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -145,7 +145,7 @@ WRITE8_MEMBER(dc_state::pvr_irq) break; case powervr2_device::HBL_IN_IRQ: - dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; + dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; break; case powervr2_device::EOR_VIDEO_IRQ: @@ -431,9 +431,9 @@ WRITE64_MEMBER(dc_state::dc_sysctrl_w ) else //direct texture path dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length; - /* 200 usecs breaks sfz3upper */ - machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(dc_state::ch2_dma_irq),this)); - /* simulate YUV FIFO processing here */ + /* TODO: timing is a guess */ + machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(ddtdata.length/4), timer_expired_delegate(FUNC(dc_state::ch2_dma_irq),this)); + /* simulate YUV FIFO processing here (HACK! should go inside the YUV FIFO itself) */ if((address & 0x1800000) == 0x0800000) machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(dc_state::yuv_fifo_irq),this)); } diff --git a/src/mame/video/powervr2.c b/src/mame/video/powervr2.c index 619c9079ccb..f5e853c1fe7 100644 --- a/src/mame/video/powervr2.c +++ b/src/mame/video/powervr2.c @@ -3165,17 +3165,17 @@ void powervr2_device::device_reset() dc_framebuffer_ram = state->dc_framebuffer_ram.target(); } -/* called by TIMER_ADD_PERIODIC, in driver sections */ +/* called by TIMER_ADD_PERIODIC, in driver sections (controlled by SPG, that's a PVR sub-device) */ void powervr2_device::pvr_scanline_timer(int vpos) { int vbin_line = spg_vblank_int & 0x3ff; int vbout_line = (spg_vblank_int >> 16) & 0x3ff; + int spg_hblank_int & 0x3ff if(vbin_line == vpos) irq_cb(VBL_IN_IRQ); if(vbout_line == vpos) irq_cb(VBL_OUT_IRQ); - } diff --git a/src/mess/drivers/dccons.c b/src/mess/drivers/dccons.c index cbd590dd277..1a6f527db24 100644 --- a/src/mess/drivers/dccons.c +++ b/src/mess/drivers/dccons.c @@ -49,8 +49,8 @@ READ64_MEMBER(dc_cons_state::dcus_idle_skip_r ) { - if (space.device().safe_pc()==0xc0ba52a) - space.device().execute().spin_until_time(attotime::from_usec(2500)); + //if (space.device().safe_pc()==0xc0ba52a) + // space.device().execute().spin_until_time(attotime::from_usec(2500)); // device_spinuntil_int(&space.device()); return dc_ram[0x2303b0/8]; @@ -58,8 +58,8 @@ READ64_MEMBER(dc_cons_state::dcus_idle_skip_r ) READ64_MEMBER(dc_cons_state::dcjp_idle_skip_r ) { - if (space.device().safe_pc()==0xc0bac62) - space.device().execute().spin_until_time(attotime::from_usec(2500)); + //if (space.device().safe_pc()==0xc0bac62) + // space.device().execute().spin_until_time(attotime::from_usec(2500)); // device_spinuntil_int(&space.device()); return dc_ram[0x2302f8/8];