diff --git a/cube/patches/base/Stream.c b/cube/patches/base/Stream.c index ec7ce715..c6f9abcb 100644 --- a/cube/patches/base/Stream.c +++ b/cube/patches/base/Stream.c @@ -70,7 +70,7 @@ void StreamUpdate() void WritePCM48to32(u32 *buf_loc) { u32 CurBuf = (*(u8*)VAR_STREAM_CURBUF == 0) ? DECODED_BUFFER_0 : DECODED_BUFFER_1; - unsigned int j; + u32 j; for(j = 0; j < SAMPLES_PER_BLOCK; j++) { *(u8*)VAR_AS_SAMPLECNT = *(u8*)VAR_AS_SAMPLECNT+1; @@ -92,7 +92,7 @@ void WritePCM48to32(u32 *buf_loc) void WritePCM48(u32 *buf_loc) { u32 CurBuf = (*(u8*)VAR_STREAM_CURBUF == 0) ? DECODED_BUFFER_0 : DECODED_BUFFER_1; - unsigned int j; + u32 j; for(j = 0; j < SAMPLES_PER_BLOCK; j++) { write16INC(CurBuf, buf_loc, *(((s16*)VAR_AS_OUTL)+j)); diff --git a/cube/patches/base/adp.c b/cube/patches/base/adp.c index f006c09d..5e494b5c 100644 --- a/cube/patches/base/adp.c +++ b/cube/patches/base/adp.c @@ -11,10 +11,13 @@ // uses same algorithm as XA, apparently // ADP decoder function by hcs, reversed from dtkmake (trkmake v1.4) +#include "../../reservedarea.h" +#include "common.h" + #define ONE_BLOCK_SIZE 32 #define SAMPLES_PER_BLOCK 28 -short ADPDecodeSample( int bits, int q, long * hist1p, long * hist2p) { +short ADPDecodeSample( s32 bits, s32 q, long * hist1p, long * hist2p) { long hist=0,cur; long hist1=*hist1p,hist2=*hist2p; @@ -53,12 +56,11 @@ short ADPDecodeSample( int bits, int q, long * hist1p, long * hist2p) { } // decode 32 bytes of input (28 samples), assume stereo -int ADPdecodebuffer(unsigned char *input, short *outl, short * outr, long *histl1, long *histl2, long *histr1, long *histr2) { - int i; +void ADPdecodebuffer(unsigned char *input, short *outl, short * outr, long *histl1, long *histl2, long *histr1, long *histr2) { + u32 i; for( i = 0; i < SAMPLES_PER_BLOCK; i++ ) { outl[i] = ADPDecodeSample( input[i + (ONE_BLOCK_SIZE - SAMPLES_PER_BLOCK)] & 0xf, input[0], histl1, histl2 ); outr[i] = ADPDecodeSample( input[i + (ONE_BLOCK_SIZE - SAMPLES_PER_BLOCK)] >> 4, input[1], histr1, histr2 ); } - return 0; } diff --git a/cube/patches/base/common.h b/cube/patches/base/common.h index 4456c6bc..5a143d60 100644 --- a/cube/patches/base/common.h +++ b/cube/patches/base/common.h @@ -1,11 +1,11 @@ #ifndef _COMMON_H_ -typedef volatile unsigned int vu32; -typedef unsigned int u32; -typedef int s32; +typedef unsigned long u32; +typedef long s32; typedef unsigned short u16; typedef signed short s16; typedef unsigned char u8; +typedef volatile u32 vu32; #define mftb(rval) ({unsigned long u; do { \ asm volatile ("mftbu %0" : "=r" (u)); \ @@ -22,7 +22,7 @@ typedef struct { void do_read(void* dst, u32 len, u32 offset, u32 sector); void device_frag_read(void* dst, u32 len, u32 offset); void dcache_flush_icache_inv(void* dst, u32 len); -int ADPdecodebuffer(unsigned char *input, short *outl, short * outr, long *histl1, long *histl2, long *histr1, long *histr2); +void ADPdecodebuffer(unsigned char *input, short *outl, short * outr, long *histl1, long *histl2, long *histr1, long *histr2); void StreamStartStream(u32 CurrentStart, u32 CurrentSize); void StreamEndStream(void); u32 process_queue(void* dst, u32 len, u32 offset, int readComplete); diff --git a/cube/patches/ide-exi/hddread.c b/cube/patches/ide-exi/hddread.c index 08db9db2..79997865 100644 --- a/cube/patches/ide-exi/hddread.c +++ b/cube/patches/ide-exi/hddread.c @@ -36,10 +36,6 @@ #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define SECTOR_SIZE 512 -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; - #define _ata48bit *(u32*)VAR_TMP1 #define exi_freq (*(u32*)VAR_EXI_FREQ) diff --git a/cube/patches/usbgecko/usbgecko.c b/cube/patches/usbgecko/usbgecko.c index 6bb2bf54..1698bf8b 100644 --- a/cube/patches/usbgecko/usbgecko.c +++ b/cube/patches/usbgecko/usbgecko.c @@ -6,11 +6,6 @@ #include "../../reservedarea.h" #include "../base/common.h" -typedef unsigned int u32; -typedef int s32; -typedef unsigned short u16; -typedef unsigned char u8; - typedef struct { unsigned int offset; // Offset in the file unsigned int size; // size to read