Skip to content

Commit

Permalink
- Switch DOL compression over to dolxz by FIX94 (https://github.com/F…
Browse files Browse the repository at this point in the history
  • Loading branch information
emukidid committed Oct 5, 2016
1 parent 97886a4 commit 40f83b3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
18 changes: 9 additions & 9 deletions Makefile
Expand Up @@ -16,11 +16,11 @@ PATCHES = $(SOURCES)/patches
AR_SOURCES = $(SOURCES)/actionreplay

ifeq ($(OS),Windows_NT)
DOLLZ = $(BUILDTOOLS)/dollz3.exe
DOLXZ = $(BUILDTOOLS)/dolxz.exe
DOL2GCI = $(BUILDTOOLS)/dol2gci.exe
MKISOFS = $(BUILDTOOLS)/mkisofs.exe
else
DOLLZ = $(BUILDTOOLS)/dollz3
DOLXZ = wine $(BUILDTOOLS)/dolxz.exe
DOL2GCI = wine $(BUILDTOOLS)/dol2gci.exe
MKISOFS = mkisofs
endif
Expand Down Expand Up @@ -64,9 +64,9 @@ build:
@mkdir $(DIST)/GCI
@cp $(SOURCES)/swiss/swiss.dol $(DIST)/DOL/$(SVN_REVISION).dol
@cp $(SOURCES)/swiss/swiss.elf $(DIST)/DOL/$(SVN_REVISION).elf
@$(DOLLZ) $(DIST)/DOL/$(SVN_REVISION).dol $(DIST)/DOL/Viper/$(SVN_REVISION)-lz-viper.dol -m -v
@$(DOLLZ) $(DIST)/DOL/$(SVN_REVISION).dol $(DIST)/DOL/$(SVN_REVISION)-compressed.dol -m
@cp $(DIST)/DOL/$(SVN_REVISION)-compressed.dol $(DIST)/ActionReplay/swiss-lz.dol
@$(DOLXZ) $(DIST)/DOL/$(SVN_REVISION).dol $(DIST)/DOL/Viper/$(SVN_REVISION)-xz-viper.dol -cube
@$(DOLXZ) $(DIST)/DOL/$(SVN_REVISION).dol $(DIST)/DOL/$(SVN_REVISION)-compressed.dol -cube
@cp $(DIST)/DOL/$(SVN_REVISION)-compressed.dol $(DIST)/ActionReplay/swiss-xz.dol
@cp $(DIST)/DOL/$(SVN_REVISION)-compressed.dol $(DIST)/ISO/DOL/$(SVN_REVISION)-compressed.dol
# make ISOs and WKF firmware
# NTSC
Expand Down Expand Up @@ -114,13 +114,13 @@ package: # create distribution package
#------------------------------------------------------------------

build-AR: # make ActionReplay
@$(BIN2S) $(DIST)/ActionReplay/swiss-lz.dol > $(AR_SOURCES)/swiss-lz.s
@$(BIN2S) $(DIST)/ActionReplay/swiss-xz.dol > $(AR_SOURCES)/swiss-xz.s
@$(CC) -O2 -c $(AR_SOURCES)/startup.s -o $(AR_SOURCES)/startup.o
@$(CC) -O2 -c $(AR_SOURCES)/swiss-lz.s -o $(AR_SOURCES)/swiss-lz.o
@$(CC) -O2 -c $(AR_SOURCES)/swiss-xz.s -o $(AR_SOURCES)/swiss-xz.o
@$(CC) -O2 -c $(AR_SOURCES)/main.c -o $(AR_SOURCES)/main.o
@$(LD) -o $(AR_SOURCES)/sdloader.elf $(AR_SOURCES)/startup.o $(AR_SOURCES)/main.o $(AR_SOURCES)/swiss-lz.o --section-start .text=0x81700000
@$(LD) -o $(AR_SOURCES)/sdloader.elf $(AR_SOURCES)/startup.o $(AR_SOURCES)/main.o $(AR_SOURCES)/swiss-xz.o --section-start .text=0x81700000
@$(OBJCOPY) -O binary $(AR_SOURCES)/sdloader.elf $(DIST)/ActionReplay/SDLOADER.BIN
@rm -f $(AR_SOURCES)/*.o $(AR_SOURCES)/*.elf $(DIST)/ActionReplay/*swiss-lz.dol $(AR_SOURCES)/swiss-lz.s
@rm -f $(AR_SOURCES)/*.o $(AR_SOURCES)/*.elf $(DIST)/ActionReplay/*swiss-xz.dol $(AR_SOURCES)/swiss-xz.s

#------------------------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions buildtools/SWISS_FILE_DESCRIPTIONS.txt
Expand Up @@ -55,7 +55,11 @@ NOTE: Must have swiss.dol on SD Card also
- swissserver : for use with USBGecko
Allows for serving files from PC to Gamecube over USBGecko.

----------------------------------------------------------

- boot.gci : Swiss in memory card format to be loaded via memory card save game exploits.

----------------------------------------------------------



Expand Down
Binary file added buildtools/dolxz.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions cube/actionreplay/main.c
Expand Up @@ -19,8 +19,8 @@ typedef struct {
unsigned int unused[MAXTEXTSECTION];
} DOLHEADER;

extern unsigned char swiss_lz_dol[];
extern unsigned long swiss_lz_dol_size;
extern unsigned char swiss_xz_dol[];
extern unsigned long swiss_xz_dol_size;

void _memcpy(void* dest, const void* src, int count) {
char* tmp = (char*)dest,* s = (char*)src;
Expand All @@ -37,19 +37,19 @@ void _memset(void* s, int c, int count) {
void boot_dol()
{
int i;
DOLHEADER *hdr = (DOLHEADER *) swiss_lz_dol;
DOLHEADER *hdr = (DOLHEADER *) swiss_xz_dol;

// 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]) {
_memcpy((void*)hdr->textAddress[i], ((unsigned char*)swiss_lz_dol) + hdr->textOffset[i], hdr->textLength[i]);
_memcpy((void*)hdr->textAddress[i], ((unsigned char*)swiss_xz_dol) + hdr->textOffset[i], hdr->textLength[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]) {
_memcpy((void*)hdr->dataAddress[i], ((unsigned char*)swiss_lz_dol) + hdr->dataOffset[i], hdr->dataLength[i]);
_memcpy((void*)hdr->dataAddress[i], ((unsigned char*)swiss_xz_dol) + hdr->dataOffset[i], hdr->dataLength[i]);
}
}

Expand Down

0 comments on commit 40f83b3

Please sign in to comment.