File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ void psx_spu_init(psx_spu_t* spu, psx_ic_t* ic) {
111
111
112
112
// Mute all voices
113
113
spu -> endx = 0x00ffffff ;
114
+ spu -> irq9addr = 0xffff ;
114
115
}
115
116
116
117
uint32_t psx_spu_read32 (psx_spu_t * spu , uint32_t offset ) {
@@ -703,6 +704,8 @@ uint32_t psx_spu_get_sample(psx_spu_t* spu) {
703
704
return clampl | (((uint32_t )clampr ) << 16 );
704
705
}
705
706
707
+ int counter = 0 ;
708
+
706
709
void psx_spu_update_cdda_buffer (psx_spu_t * spu , void * buf ) {
707
710
int16_t * ptr = buf ;
708
711
int16_t * ram = (int16_t * )spu -> ram ;
@@ -724,6 +727,18 @@ void psx_spu_update_cdda_buffer(psx_spu_t* spu, void* buf) {
724
727
ram [i + 0x000 ] = l / 8 ;
725
728
ram [i + 0x400 ] = r / 8 ;
726
729
}
730
+
731
+ // Simulate capture IRQ
732
+ if (spu -> ramdtc & 0xc ) {
733
+ if (spu -> irq9addr <= 0x1ff ) {
734
+ if (!counter ) {
735
+ psx_ic_irq (spu -> ic , IC_SPU );
736
+ }
737
+
738
+ counter ++ ;
739
+ counter &= 0x1 ;
740
+ }
741
+ }
727
742
}
728
743
729
744
#undef CLAMP
You can’t perform that action at this time.
0 commit comments