Previous 199869 Revisions Next

r22580 Saturday 27th April, 2013 at 15:18:47 UTC by Carl
spu: Move cdda interrupt to play_cdda to make sure it happens at least once per sector.
---
Vibribbon doesn't crash now starting gameplay but there's no music.  It seems to copy the samples to the reverb loop address which doesn't appear to be mixed currently.
[src/emu/sound]spu.c
[src/mess/machine]psxcd.c

trunk/src/emu/sound/spu.c
r22579r22580
24822482         INT16 vl = ((sp[0]*voll)>>15);
24832483         INT16 vr = ((sp[1]*volr)>>15);
24842484
2485         *(signed short *)(spu_ram+m_cd_out_ptr)=vl;
2486         *(signed short *)(spu_ram+m_cd_out_ptr+0x400)=vr;
2485         // if the volume adjusted samples are stored here, vibribbon does nothing
2486         *(signed short *)(spu_ram+m_cd_out_ptr)=sp[0];
2487         *(signed short *)(spu_ram+m_cd_out_ptr+0x400)=sp[1];
24872488         m_cd_out_ptr=(m_cd_out_ptr+2)&0x3ff;
24882489
2489         if((m_cd_out_ptr == (spureg.irq_addr & ~0x401)) && (spureg.ctrl & spuctrl_irq_enable))
2490            m_irq_handler(1);
2490         //if((m_cd_out_ptr == ((spureg.irq_addr << 3) & ~0x400)) && (spureg.ctrl & spuctrl_irq_enable))
2491         //   m_irq_handler(1);
24912492
24922493         dp[0]=clamp(dp[0]+vl);
24932494         dp[1]=clamp(dp[1]+vr);
r22579r22580
25132514
25142515//      if (n>0) printf("cdda buffer underflow (n=%d cdda_in=%d spf=%d)\n",n,cdda_buffer->get_bytes_in(),cdda_spf);
25152516   }
2516   else if((spureg.irq_addr < 0x800) && (spureg.ctrl & spuctrl_irq_enable))
2517   else if(((spureg.irq_addr << 3) < 0x800) && (spureg.ctrl & spuctrl_irq_enable))
25172518   {
2518      UINT16 irq_addr = spureg.irq_addr & ~0x401;
2519      UINT16 irq_addr = (spureg.irq_addr << 3) & ~0x400;
25192520      UINT32 end = m_cd_out_ptr + (sz >> 1);
25202521      if(((m_cd_out_ptr < irq_addr) && (end > irq_addr)) || ((m_cd_out_ptr > (end & 0x3ff)) && ((end & 0x3ff) > irq_addr)))
25212522         m_irq_handler(1);
r22579r22580
30093010   }
30103011
30113012   // Return that we processed the sector
3012
30133013   return true;
30143014}
30153015
r22579r22580
30523052      flip[i] = flip[i+1];
30533053      flip[i+1] = temp;
30543054   }
3055   // this should be done in generate but sound_stream_update may not be called frequently enough
3056   if(((spureg.irq_addr << 3) < 0x800) && (spureg.ctrl & spuctrl_irq_enable))
3057      m_irq_handler(1);
30553058
30563059   return true;
30573060}
trunk/src/mess/machine/psxcd.c
r22579r22580
517517   verboselog(machine(), 1, "psxcd: mute\n");
518518
519519   m_mute = true;
520   send_result(intr_acknowledge);
520   send_result(intr_complete);
521521}
522522
523523void psxcd_device::cdcmd_demute()
r22579r22580
525525   verboselog(machine(), 1, "psxcd: demute\n");
526526
527527   m_mute = false;
528   send_result(intr_acknowledge);
528   send_result(intr_complete);
529529}
530530
531531void psxcd_device::cdcmd_setfilter()
r22579r22580
705705         break;
706706
707707      default:
708         verboselog(machine(), 0, "psxcd: unimplemented test cmd %02x", cmdbuf[0]);
708         verboselog(machine(), 0, "psxcd: unimplemented test cmd %02x\n", cmdbuf[0]);
709709         cmd_complete(prepare_result(intr_diskerror, NULL, 0, 0x10));
710710         break;
711711   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team