diff --git a/cube/patches/Makefile b/cube/patches/Makefile index 518112f9..a838fc70 100644 --- a/cube/patches/Makefile +++ b/cube/patches/Makefile @@ -25,16 +25,16 @@ clean: build-sd: @echo Building SD Patch ... - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/base.S - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c sdgecko/sd.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/frag.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/igr.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/adp.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/base.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c sdgecko/sd.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/frag.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/igr.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/adp.c @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/Stream.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr_start.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr.c @$(LD) -o sd.elf base.o igr.o frag.o sd.o dvdinterface.o dvdqueue.o usbgecko.o adp.o Stream.o __DSPHandler.o appldr_start.o appldr.o --section-start .text=0x80001000 --gc-sections @@ -48,16 +48,16 @@ build-sd: build-ideexi-v1: @echo Building IDE-EXI-v1 Patch ... - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/base.S - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c ide-exi/hddread.c -DIDE_EXI_V1 - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/frag.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/igr.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/adp.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/base.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c ide-exi/hddread.c -DIDE_EXI_V1 + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/frag.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/igr.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/adp.c @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/Stream.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr_start.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr.c @$(LD) -o ideexi_v1.elf base.o igr.o frag.o hddread.o dvdinterface.o dvdqueue.o usbgecko.o adp.o Stream.o __DSPHandler.o appldr_start.o appldr.o --section-start .text=0x80001000 -gc-sections @@ -71,16 +71,16 @@ build-ideexi-v1: build-ideexi-v2: @echo Building IDE-EXI-v2 Patch ... - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/base.S - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c ide-exi/hddread.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/frag.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/igr.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/adp.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/base.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c ide-exi/hddread.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/frag.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/igr.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/adp.c @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/Stream.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr_start.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr.c @$(LD) -o ideexi_v2.elf base.o igr.o frag.o hddread.o dvdinterface.o dvdqueue.o usbgecko.o adp.o Stream.o __DSPHandler.o appldr_start.o appldr.o --section-start .text=0x80001000 -gc-sections @@ -94,13 +94,13 @@ build-ideexi-v2: build-dvd: @echo Building DVD Patch ... - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c dvd/base.S - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c dvd/dvd.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c sdgecko/sd.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/frag.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/igr.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c dvd/base.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c dvd/dvd.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c sdgecko/sd.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/frag.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/usbgecko.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/igr.c @$(LD) -o dvd.elf base.o igr.o frag.o sd.o dvd.o dvdqueue.o usbgecko.o --section-start .text=0x80001800 @rm -rf *.o @$(OBJDUMP) -D dvd.elf > $(DISASM)/dvd_disasm.txt @@ -112,17 +112,17 @@ build-dvd: build-usb: @echo Building USBGecko Patch ... - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/base.S - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c usbgecko/usbgecko.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/adp.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/base.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c usbgecko/usbgecko.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdqueue.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/dvdinterface.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/adp.c @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/Stream.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/__DSPHandler.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr_start.S @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/appldr.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/frag.c - @$(CC) -O2 -ffunction-sections -mmultiple -mstring -c base/igr.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/frag.c + @$(CC) -O1 -ffunction-sections -mmultiple -mstring -c base/igr.c @$(LD) -o usbgecko.elf base.o igr.o usbgecko.o dvdqueue.o dvdinterface.o adp.o Stream.o __DSPHandler.o appldr_start.o appldr.o frag.o --section-start .text=0x80001000 --gc-sections @rm -rf *.o @$(OBJDUMP) -D usbgecko.elf > $(DISASM)/usb_disasm.txt @@ -134,9 +134,9 @@ build-usb: build-wkf: @echo Building WKF Patch ... - @$(CC) -O2 -c wkf/base.S - @$(CC) -O2 -c wkf/wkf.c - @$(CC) -O2 -c base/usbgecko.c + @$(CC) -O1 -c wkf/base.S + @$(CC) -O1 -c wkf/wkf.c + @$(CC) -O1 -c base/usbgecko.c @$(LD) -o wkf.elf base.o wkf.o usbgecko.o --section-start .text=0x80001800 @rm -rf *.o @$(OBJDUMP) -D wkf.elf > $(DISASM)/wkf_disasm.txt diff --git a/cube/patches/base/Stream.c b/cube/patches/base/Stream.c index f2299224..ec7ce715 100644 --- a/cube/patches/base/Stream.c +++ b/cube/patches/base/Stream.c @@ -19,16 +19,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "../../reservedarea.h" - -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; -typedef signed short s16; +#include "common.h" #define ONE_BLOCK_SIZE 32 #define SAMPLES_PER_BLOCK 28 -void device_frag_read(void *dst, u32 len, u32 offset); void WritePCM48to32(u32 *buf_loc); void WritePCM48(u32 *buf_loc); @@ -66,7 +61,7 @@ void StreamUpdate() u32 r32k = ((*(u32*)(AI_CR)) & AI_32K); for(i = 0; i < (r32k ? CHUNK_48to32 : CHUNK_48); i += ONE_BLOCK_SIZE) { - ADPdecodebuffer((u8*)DECODE_WORK_AREA+i,(s16*)VAR_AS_OUTL,(s16*)VAR_AS_OUTR,(u32*)VAR_AS_HIST_0,(u32*)VAR_AS_HIST_1,(u32*)VAR_AS_HIST_2,(u32*)VAR_AS_HIST_3); + ADPdecodebuffer((u8*)DECODE_WORK_AREA+i,(s16*)VAR_AS_OUTL,(s16*)VAR_AS_OUTR,(long*)VAR_AS_HIST_0,(long*)VAR_AS_HIST_1,(long*)VAR_AS_HIST_2,(long*)VAR_AS_HIST_3); if(r32k) WritePCM48to32(&buf_loc); else WritePCM48(&buf_loc); } *(u8*)VAR_STREAM_CURBUF = *(u8*)VAR_STREAM_CURBUF ^ 1; @@ -168,7 +163,7 @@ void StreamStartStream(u32 CurrentStart, u32 CurrentSize) *(u8*)VAR_STREAM_LOOPING = 0; } -void StreamEndStream() +void StreamEndStream(void) { *(u32*)VAR_STREAM_CUR = 0; } diff --git a/cube/patches/base/appldr.c b/cube/patches/base/appldr.c index 7bf21d8e..e286501d 100644 --- a/cube/patches/base/appldr.c +++ b/cube/patches/base/appldr.c @@ -3,12 +3,8 @@ appldr.c for Swiss Copyright (C) 2015 FIX94 */ #include "../../reservedarea.h" +#include "common.h" -typedef volatile unsigned int vu32; -typedef unsigned int u32; -typedef int s32; -typedef unsigned short u16; -typedef unsigned char u8; typedef int (*app_main)(char **dst, u32 *size, u32 *offset); typedef void (*app_init)(int (*report)(const char *fmt, ...),u32 args); diff --git a/cube/patches/base/common.h b/cube/patches/base/common.h new file mode 100644 index 00000000..4456c6bc --- /dev/null +++ b/cube/patches/base/common.h @@ -0,0 +1,34 @@ +#ifndef _COMMON_H_ + +typedef volatile unsigned int vu32; +typedef unsigned int u32; +typedef int s32; +typedef unsigned short u16; +typedef signed short s16; +typedef unsigned char u8; + +#define mftb(rval) ({unsigned long u; do { \ + asm volatile ("mftbu %0" : "=r" (u)); \ + asm volatile ("mftb %0" : "=r" ((rval)->l)); \ + asm volatile ("mftbu %0" : "=r" ((rval)->u)); \ + } while(u != ((rval)->u)); }) + +typedef struct { + unsigned long l, u; +} tb_t; + +#define TB_CLOCK 40500000 + +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 StreamStartStream(u32 CurrentStart, u32 CurrentSize); +void StreamEndStream(void); +u32 process_queue(void* dst, u32 len, u32 offset, int readComplete); +unsigned long tb_diff_usec(tb_t* end, tb_t* start); + +int usb_sendbuffer_safe(const void *buffer,int size); + + +#endif diff --git a/cube/patches/base/dvdinterface.c b/cube/patches/base/dvdinterface.c index 0ef66e98..8355a31a 100644 --- a/cube/patches/base/dvdinterface.c +++ b/cube/patches/base/dvdinterface.c @@ -5,6 +5,7 @@ ***************************************************************************/ #include "../../reservedarea.h" +#include "common.h" #define DI_SR (0) #define DI_CVR (1) @@ -19,23 +20,6 @@ #define AGGRESSIVE_INT 1 -typedef struct { - unsigned long l, u; -} tb_t; - -#define mftb(rval) ({unsigned long u; do { \ - asm volatile ("mftbu %0" : "=r" (u)); \ - asm volatile ("mftb %0" : "=r" ((rval)->l)); \ - asm volatile ("mftbu %0" : "=r" ((rval)->u)); \ - } while(u != ((rval)->u)); }) - -//int usb_sendbuffer_safe(const void *buffer,int size); - -typedef unsigned int u32; -typedef int s32; -typedef unsigned short u16; -typedef unsigned char u8; - void trigger_dvd_interrupt() { volatile u32* realDVD = (volatile u32*)0xCC006000; if(!(realDVD[7]&1)) @@ -179,16 +163,16 @@ void DIUpdateRegisters() { { //execD, jump to our own handler *(u32*)dst = branch((u32)appldr_start, dst); - dcache_flush_icache_inv(dst, 0x20); + dcache_flush_icache_inv((void*)dst, 0x20); dvd[DI_DMALEN] = 0; diOpCompleted = 1; } else { // Read. We might not do the full read, depends how busy the game is - u32 amountRead = process_queue(dst, len, offset, readComplete); + u32 amountRead = process_queue((void*)dst, len, offset, readComplete); if(amountRead) { - dcache_flush_icache_inv(dst, amountRead); + dcache_flush_icache_inv((void*)dst, amountRead); dvd[DI_DMALEN] -= amountRead; dvd[DI_DMAADDR] += amountRead; dvd[DI_LBA] += amountRead>>2; diff --git a/cube/patches/base/dvdqueue.c b/cube/patches/base/dvdqueue.c index 11dad40a..b997782b 100644 --- a/cube/patches/base/dvdqueue.c +++ b/cube/patches/base/dvdqueue.c @@ -5,19 +5,13 @@ ***************************************************************************/ #include "../../reservedarea.h" - -int usb_sendbuffer_safe(const void *buffer,int size); - -typedef unsigned int u32; -typedef int s32; -typedef unsigned short u16; -typedef unsigned char u8; +#include "common.h" #define SAMPLE_SIZE_32KHZ_1MS 128 #define SAMPLE_SIZE_32KHZ_1MS_SHIFT 7 // Returns how much was read. -u32 process_queue(u32 dst, u32 len, u32 offset, int readComplete) { +u32 process_queue(void* dst, u32 len, u32 offset, int readComplete) { if(len) { // read a bit diff --git a/cube/patches/base/frag.c b/cube/patches/base/frag.c index 0f1e2ce9..01dc3269 100644 --- a/cube/patches/base/frag.c +++ b/cube/patches/base/frag.c @@ -7,12 +7,7 @@ */ #include "../../reservedarea.h" - -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; - -extern void do_read(void*, u32, u32, u32); +#include "common.h" // Returns the amount read from the given offset until a frag is hit u32 read_frag(void *dst, u32 len, u32 offset) { @@ -61,17 +56,6 @@ void device_frag_read(void *dst, u32 len, u32 offset) } } -#define mftb(rval) ({unsigned long u; do { \ - asm volatile ("mftbu %0" : "=r" (u)); \ - asm volatile ("mftb %0" : "=r" ((rval)->l)); \ - asm volatile ("mftbu %0" : "=r" ((rval)->u)); \ - } while(u != ((rval)->u)); }) - -typedef struct { - unsigned long l, u; -} tb_t; - -#define TB_CLOCK 40500000 unsigned long tb_diff_usec(tb_t* end, tb_t* start) { unsigned long upper, lower; diff --git a/cube/patches/base/igr.c b/cube/patches/base/igr.c index 02cbc965..6f5571ec 100644 --- a/cube/patches/base/igr.c +++ b/cube/patches/base/igr.c @@ -11,11 +11,76 @@ typedef int s32; typedef unsigned short u16; typedef unsigned char u8; +#define DOLHDRLENGTH 256 +#define MAXTEXTSECTION 7 +#define MAXDATASECTION 11 +typedef struct { + unsigned int textOffset[MAXTEXTSECTION]; + unsigned int dataOffset[MAXDATASECTION]; + + unsigned int textAddress[MAXTEXTSECTION]; + unsigned int dataAddress[MAXDATASECTION]; + + unsigned int textLength[MAXTEXTSECTION]; + unsigned int dataLength[MAXDATASECTION]; + + unsigned int bssAddress; + unsigned int bssLength; + + unsigned int entryPoint; + unsigned int unused[MAXTEXTSECTION]; +} DOLHEADER; +/* +void load_dol() { + + int i = 0; + DOLHEADER *hdr = (DOLHEADER *) data; + // Inspect text sections to see if what we found lies in here + for (i = 0; i < MAXTEXTSECTION; i++) { + if (hdr->textAddress[i] && hdr->textLength[i]) { + // Does what we found lie in this section? + if((offsetFoundAt >= hdr->textOffset[i]) && offsetFoundAt <= (hdr->textOffset[i] + hdr->textLength[i])) { + // Yes it does, return the load address + offsetFoundAt as that's where it'll end up! + return offsetFoundAt+hdr->textAddress[i]-hdr->textOffset[i]; + } + } + } + + // Inspect data sections (shouldn't really need to unless someone was sneaky..) + for (i = 0; i < MAXDATASECTION; i++) { + if (hdr->dataAddress[i] && hdr->dataLength[i]) { + // Does what we found lie in this section? + if((offsetFoundAt >= hdr->dataOffset[i]) && offsetFoundAt <= (hdr->dataOffset[i] + hdr->dataLength[i])) { + // Yes it does, return the load address + offsetFoundAt as that's where it'll end up! + return offsetFoundAt+hdr->dataAddress[i]-hdr->dataOffset[i]; + } + } + } + + // Read the binary file mapped to 0x60000000 (4MB max) + device_frag_read((void*)0x80003100, 4*1024*1024, 0x60000000); + void (*entrypoint)() = (void(*)())0x80003100; + entrypoint(); +} +*/ // exits to user preferred method void exit_to_pref(void) { u8 igr_exit_type = *(u8*)VAR_IGR_EXIT_TYPE; if(igr_exit_type == IGR_HARDRESET) { + // int i = 0; + // for (i = 0; i < 10; i++) { + // // renable qoob here + // volatile u32* exi = (volatile u32*)0xCC006800; + // exi[0] = (exi[0] & 0x405)|0xB0; // exi_select(0, 1, 3); + // exi[4] = 0xC0000000; + // exi[3] = 0x35; + // while (exi[3] & 1); // exi_write(0, &addr, 4); + // exi[4] = 0; + // exi[3] = 0x35; + // while (exi[3] & 1); // exi_write(0, &val, 4); + // exi[0] &= 0x405; // exi_deselect(0); + // } *((volatile u32*)0xCC003024) = 0; } else if (igr_exit_type == IGR_BOOTBIN) { @@ -33,10 +98,7 @@ void exit_to_pref(void) { _memReg[15] = 0xF; _memReg[16] = 0; _memReg[8] = 0xFF; - // Read the binary file mapped to 0x60000000 (4MB max) - device_frag_read((void*)0x80003100, 4*1024*1024, 0x60000000); - void (*entrypoint)() = (void(*)())0x80003100; - entrypoint(); + //load_dol(); } else if (igr_exit_type == IGR_USBGKOFLASH) { diff --git a/cube/patches/dvd/dvd.c b/cube/patches/dvd/dvd.c index ac78f5e1..e62c11ef 100644 --- a/cube/patches/dvd/dvd.c +++ b/cube/patches/dvd/dvd.c @@ -4,10 +4,7 @@ #**************************************************************************/ #include "../../reservedarea.h" - -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; +#include "../base/common.h" // Perform a debug spinup/etc instead of a hard dvd reset void handle_disc_swap() @@ -115,8 +112,8 @@ void dvd_read_patched_section() { } usb_sendbuffer_safe("FRAG READ!\r\n",12); #endif - device_frag_read(dst | 0x80000000, len, offset); - dcache_flush_icache_inv(dst | 0x80000000, len); + device_frag_read((void*)(dst | 0x80000000), len, offset); + dcache_flush_icache_inv((void*)(dst | 0x80000000), len); dvd[3] = 0; dvd[4] = 0x20; dvd[5] = 0; diff --git a/cube/patches/ide-exi/hddread.c b/cube/patches/ide-exi/hddread.c index ddf05871..08db9db2 100644 --- a/cube/patches/ide-exi/hddread.c +++ b/cube/patches/ide-exi/hddread.c @@ -4,6 +4,7 @@ ***************************************************************************/ #include "../../reservedarea.h" +#include "../base/common.h" // NOTE: cs0 then cs1! // ATA registers address val - cs0 cs1 a2 a1 a0 diff --git a/cube/patches/wkf/wkf.c b/cube/patches/wkf/wkf.c index 74f15d1f..ec28d9e6 100644 --- a/cube/patches/wkf/wkf.c +++ b/cube/patches/wkf/wkf.c @@ -4,17 +4,13 @@ ***************************************************************************/ #include "../../reservedarea.h" - -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; +#include "../base/common.h" extern char _readsector[]; extern int _readsectorsize; #define READ_SECTOR ((char*)&_readsector) #define READ_SECTOR_SIZE ((int)_readsectorsize) -extern int usb_sendbuffer_safe(const void *buffer,int size); extern void print_int_hex(unsigned int num); void wkfWriteOffset(u32 offset) {