diff --git a/include/yaz0.h b/include/yaz0.h index 1efb5ac3cf..7f05fb293e 100644 --- a/include/yaz0.h +++ b/include/yaz0.h @@ -5,6 +5,8 @@ void Yaz0_Decompress(uintptr_t romStart, void* dst, size_t size); +#if MM_VERSION >= N64_US extern void* gYaz0DecompressDstEnd; +#endif #endif diff --git a/src/boot/yaz0.c b/src/boot/yaz0.c index 16d8d32458..82d7016223 100644 --- a/src/boot/yaz0.c +++ b/src/boot/yaz0.c @@ -11,7 +11,9 @@ uintptr_t sYaz0CurRomStart; size_t sYaz0CurSize; u8* sYaz0MaxPtr; +#if MM_VERSION >= N64_US void* gYaz0DecompressDstEnd; +#endif #include "yaz0.h" @@ -83,6 +85,9 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) { u32 magic = ((Yaz0Header*)src)->magic; if (magic != YAZ0_MAGIC) { + PRINTF(T("slidstart_szs IDが違います (%02x %02x %02x %02x %08x)\n", + "The slidstart_szs ID is incorrect (%02x %02x %02x %02x %08x)\n"), + src[0], src[1], src[2], src[3], magic); return -1; } @@ -123,7 +128,9 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) { bitIndex--; } while (dst != dstEnd); +#if MM_VERSION >= N64_US gYaz0DecompressDstEnd = dstEnd; +#endif return 0; } diff --git a/src/code/sys_cmpdma.c b/src/code/sys_cmpdma.c index adf41de49e..ad94ced93d 100644 --- a/src/code/sys_cmpdma.c +++ b/src/code/sys_cmpdma.c @@ -2,6 +2,7 @@ #include "libc64/malloc.h" #include "color.h" +#include "versions.h" #include "yaz0.h" #include "z64dma.h" @@ -116,6 +117,8 @@ void CmpDma_LoadAllFiles(uintptr_t segmentVrom, void* dst, size_t size) { for (i = 0; i < end; i++) { CmpDma_LoadFileImpl(rom, i, nextDst, 0); +#if MM_VERSION >= N64_US nextDst = gYaz0DecompressDstEnd; +#endif } }