File tree Expand file tree Collapse file tree 4 files changed +15
-26
lines changed
Expand file tree Collapse file tree 4 files changed +15
-26
lines changed Original file line number Diff line number Diff line change 1717 // from TOMB5
1818 // https://github.com/TOMB5/TOMB5/blob/master/EMULATOR/LIBSPU.H
1919 #define SPU_CDONLY 5
20- SpuReadDecodedData (& sdata -> SpuDecodedData [0 ], SPU_CDONLY );
20+ SpuReadDecodedData (& sdata -> SpuDecodedBuf [0 ], SPU_CDONLY );
2121
2222 if (
2323 (sdata -> XA_boolFinished == 0 ) &&
Original file line number Diff line number Diff line change 22
33void DECOMP_CDSYS_SpuEnableIRQ ()
44{
5- int * ptr = & sdata -> SpuDecodedData [0 ];
5+ // erase 0x400 bytes
6+ int * ptr = & sdata -> SpuDecodedBuf [0 ];
67 for (int i = 0 ; i < 0x100 ; i ++ )
78 ptr [i ] = 0 ;
89
Original file line number Diff line number Diff line change 22
33void DECOMP_CDSYS_SpuGetMaxSample (void )
44{
5- int endIndex ;
6- int currIndex ;
7- int index2 ;
8-
5+ int index2 ;
96 short sample ;
107 short max ;
8+ max = 0 ;
119
12- // if you are not using CD, quit
10+ #if 0 // impossible
1311 if (sdata -> boolUseDisc == false) return ;
14-
15- // range {0x0 - 0x100}
16- if (sdata -> irqAddr == 0 )
17- {
18- currIndex = 0 ;
19- endIndex = 0x100 ;
20- }
21- // otherwise, range {0x100 - 0x200}
22- else
23- {
24- currIndex = 0x100 ;
25- endIndex = 0x200 ;
26- }
12+ #endif
13+
14+ short * ptrSpuBuf =
15+ & sdata -> SpuDecodedBuf [sdata -> irqAddr ];
2716
2817 // loop through region
29- for (max = 0 ; currIndex < endIndex ; currIndex ++ )
18+ for (int i = 0 ; i < 0x100 ; i ++ )
3019 {
3120 // absolute value
32- sample = sdata -> SpuDecodedData [ currIndex ];
21+ sample = ptrSpuBuf [ i ];
3322 if (sample < 0 ) sample = - sample ;
3423
3524 // find max
@@ -57,9 +46,8 @@ void DECOMP_CDSYS_SpuGetMaxSample(void)
5746 // set max to zero
5847 sdata -> XA_MaxSampleValInArr = 0 ;
5948
60- currIndex = sdata -> XA_SampleMaxIndex1 ;
49+ int currIndex = sdata -> XA_SampleMaxIndex1 ;
6150 index2 = sdata -> XA_SampleMaxIndex2 ;
62-
6351 if (index2 == 0 ) return ;
6452
6553 for (; index2 != -1 ; index2 -- )
Original file line number Diff line number Diff line change @@ -4508,9 +4508,9 @@ struct sData
45084508 // 80091198 -- JpnRetail
45094509 // see FUN_8001c8e4
45104510 #if BUILD == SepReview
4511- short SpuDecodedData [ 0x800 ];
4511+ char SpuDecodedBuf [ 0x1000 ];
45124512 #elif BUILD >= UsaRetail
4513- short SpuDecodedData [ 0x400 ];
4513+ char SpuDecodedBuf [ 0x800 ];
45144514 #endif
45154515
45164516 // 8008E528
You can’t perform that action at this time.
0 commit comments