1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-14 19:14:50 +00:00

[iQue] Match gzip/zlib decompression (#2416)

* [iQue] Match gzip/zlib decompression

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Update missed renames in disassembly

* Fix some formatting

---------

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
cadmic 2025-01-10 05:31:20 -08:00 committed by GitHub
parent 84e5afabf9
commit 26f91bd3bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 1039 additions and 6 deletions

View file

@ -569,9 +569,9 @@ ifeq ($(PLATFORM),IQUE)
# Some files are compiled with EGCS on iQue
EGCS_O_FILES += $(BUILD_DIR)/src/boot/boot_main.o
EGCS_O_FILES += $(BUILD_DIR)/src/boot/idle.o
EGCS_O_FILES += $(BUILD_DIR)/src/boot/inflate.o
EGCS_O_FILES += $(BUILD_DIR)/src/boot/z_locale.o
EGCS_O_FILES += $(BUILD_DIR)/src/boot/z_std_dma.o
EGCS_O_FILES += $(BUILD_DIR)/src/boot/zlib.o
# EGCS_O_FILES += $(BUILD_DIR)/src/code/z_actor.o
EGCS_O_FILES += $(BUILD_DIR)/src/code/z_common_data.o
EGCS_O_FILES += $(BUILD_DIR)/src/code/z_construct.o

View file

@ -12,7 +12,11 @@ void ViConfig_UpdateBlack(void);
void* Yaz0_FirstDMA(void);
void* Yaz0_NextDMA(u8* curSrcPos);
void Yaz0_DecompressImpl(u8* src, u8* dst);
#if !PLATFORM_IQUE
void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
#else
void gzip_decompress(uintptr_t romStart, u8* dst, size_t size);
#endif
void Locale_Init(void);
void Locale_ResetRegion(void);
#if DEBUG_FEATURES

4
spec
View file

@ -23,7 +23,11 @@ beginseg
#endif
include "$(BUILD_DIR)/src/boot/carthandle.o"
include "$(BUILD_DIR)/src/boot/z_std_dma.o"
#if !PLATFORM_IQUE
include "$(BUILD_DIR)/src/boot/yaz0.o"
#else
include "$(BUILD_DIR)/src/boot/inflate.o"
#endif
include "$(BUILD_DIR)/src/boot/z_locale.o"
#if PLATFORM_N64
include "$(BUILD_DIR)/src/boot/cic6105.o"

1003
src/boot/inflate.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -441,7 +441,13 @@ void DmaMgr_ProcessRequest(DmaRequest* req) {
// Reduce the thread priority and decompress the file, the decompression routine handles the DMA
// in chunks. Restores the thread priority when done.
osSetThreadPri(NULL, THREAD_PRI_DMAMGR_LOW);
#if !PLATFORM_IQUE
Yaz0_Decompress(romStart, ram, romSize);
#else
gzip_decompress(romStart, ram, romSize);
#endif
osSetThreadPri(NULL, THREAD_PRI_DMAMGR);
found = true;

View file

@ -3,7 +3,7 @@ offset,vram,.text
140,80000590,src/boot/idle
390,800007E0,src/boot/viconfig
4D0,80000920,src/boot/z_std_dma
B50,80000FA0,src/boot/zlib
B50,80000FA0,src/boot/inflate
2830,80002C80,src/boot/z_locale
2870,80002CC0,src/boot/is_debug
2890,80002CE0,src/boot/driverominit
@ -96,7 +96,7 @@ offset,vram,.data
98F0,80009D40,src/boot/viconfig
9910,80009D60,src/boot/carthandle
9920,80009D70,src/boot/z_std_dma
9930,80009D80,src/boot/zlib
9930,80009D80,src/boot/inflate
9AB0,80009F00,src/boot/z_locale
9AC0,80009F10,src/boot/driverominit
9AD0,80009F20,src/libu64/stackcheck
@ -133,7 +133,7 @@ A750,8000ABA0,data/boot_common_8000ABA0
A7A0,8000ABF0,src/boot/boot_main
B190,8000B5E0,src/boot/idle
BD90,8000C1E0,src/boot/z_std_dma
C500,8000C950,src/boot/zlib
C500,8000C950,src/boot/inflate
10310,80010760,src/boot/driverominit
10390,800107E0,src/libultra/io/vimgr
115B0,80011A00,src/libultra/io/pimgr

1 offset vram .text
3 140 80000590 src/boot/idle
4 390 800007E0 src/boot/viconfig
5 4D0 80000920 src/boot/z_std_dma
6 B50 80000FA0 src/boot/zlib src/boot/inflate
7 2830 80002C80 src/boot/z_locale
8 2870 80002CC0 src/boot/is_debug
9 2890 80002CE0 src/boot/driverominit
96 9910 80009D60 src/boot/carthandle
97 9920 80009D70 src/boot/z_std_dma
98 9930 80009D80 src/boot/zlib src/boot/inflate
99 9AB0 80009F00 src/boot/z_locale
100 9AC0 80009F10 src/boot/driverominit
101 9AD0 80009F20 src/libu64/stackcheck
102 9AE0 80009F30 src/libultra/os/thread
133 C500 8000C950 src/boot/zlib src/boot/inflate
134 10310 80010760 src/boot/driverominit
135 10390 800107E0 src/libultra/io/vimgr
136 115B0 80011A00 src/libultra/io/pimgr
137 12940 80012D90 data/boot_common_80012D90
138 12BF0 80013040 .end
139

View file

@ -15,6 +15,22 @@ DmaMgr_ThreadEntry = 0x80000D60; // type:func
DmaMgr_RequestAsync = 0x80000DC4; // type:func
DmaMgr_RequestSync = 0x80000E14; // type:func
DmaMgr_Init = 0x80000EAC; // type:func
gzip_malloc = 0x80000FA0; // type:func
gzip_free = 0x80000FE8; // type:func
huft_build = 0x80001004; // type:func
huft_free = 0x800015E8; // type:func
inflate_codes = 0x8000162C; // type:func
inflate_stored = 0x80001BCC; // type:func
inflate_fixed = 0x80001E4C; // type:func
inflate_dynamic = 0x80002018; // type:func
inflate_block = 0x80002808; // type:func
inflate = 0x800029B0; // type:func
gzip_read = 0x80002A88; // type:func
unzip = 0x80002B14; // type:func
clear_bufs = 0x80002B50; // type:func
fill_inbuf = 0x80002B68; // type:func
flush_window = 0x80002C2C; // type:func
gzip_decompress = 0x80002C3C; // type:func
Locale_Init = 0x80002C80; // type:func
Locale_ResetRegion = 0x80002CB4; // type:func
osSyncPrintfUnused = 0x80002CC0; // type:func
@ -10285,7 +10301,7 @@ EnGe1_Init = 0x80A8EFD0; // type:func
EnGe1_Destroy = 0x80A8F294; // type:func
EnGe1_SetTalkAction = 0x80A8F2C0; // type:func
EnGe1_SetAnimationIdle = 0x80A8F3A0; // type:func
EnGe1_CheckCarpentersFreed = 0x80A8F424; // type:func
EnGe1_CheckAllCarpentersRescued = 0x80A8F424; // type:func
EnGe1_KickPlayer = 0x80A8F460; // type:func
EnGe1_SpotPlayer = 0x80A8F540; // type:func
EnGe1_WatchForPlayerFrontOnly = 0x80A8F5A0; // type:func
@ -11822,7 +11838,7 @@ EnGe2_Init = 0x80B25578; // type:func
EnGe2_Destroy = 0x80B25790; // type:func
Ge2_DetectPlayerInAction = 0x80B257BC; // type:func
Ge2_DetectPlayerInUpdate = 0x80B25868; // type:func
EnGe2_CheckCarpentersFreed = 0x80B25998; // type:func
EnGe2_CheckAllCarpentersRescued = 0x80B25998; // type:func
EnGe2_CaptureClose = 0x80B259C4; // type:func
EnGe2_CaptureCharge = 0x80B25A98; // type:func
EnGe2_CaptureTurn = 0x80B25BCC; // type:func