[n64-jp-1.1] yaz0 (#1878)

* [n64-jp-1.1] yaz0

* PR suggestions
This commit is contained in:
Derek Hensley
2026-09-02 19:59:34 -07:00
committed by GitHub
parent 395be304f2
commit c85914172b
3 changed files with 12 additions and 0 deletions
+2
View File
@@ -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
+7
View File
@@ -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;
}
+3
View File
@@ -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
}
}