Skip to content

Commit a225880

Browse files
authored
Add files via upload
1 parent 2feb659 commit a225880

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

source/program/main.cpp

+5-30
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ extern "C" {
8888
typedef void (*SjisToUtf8)(char const* src, int bufferSize, char* dst);
8989
void* _ZN4Nmpl15MemoryInterface14allocateMemoryEm(size_t size);
9090
void _ZN4Nmpl15MemoryInterface10freeMemoryEPv(void* buffer);
91-
void _ZN4Nmpl4Core9CCompress7autoDecEPvjRPhRjj(uint8_t* in_buffer, size_t unc_size, void** out_buffer, uint32_t* unk, size_t com_size);
91+
void _ZN4Nmpl4Core9CCompress7autoDecEPvjRPhRjj(uint8_t* in_buffer, size_t com_size, void** out_buffer, uint32_t* unk, uint32_t unc_size);
9292
FILE* FDKfopen(const char * filename, const char * mode);
9393
int FDKfclose(FILE* stream);
9494
int FDKfprintf(FILE* stream, const char* format, ...);
@@ -587,15 +587,12 @@ nn::os::MutexType _mutex;
587587
#endif
588588

589589
HOOK_DEFINE_TRAMPOLINE(Decompress) {
590-
static void Callback(uint8_t* in_buffer, size_t com_size, void** out_buffer, uint32_t* unk, size_t unc_size) {
590+
static void Callback(uint8_t* in_buffer, size_t com_size, void** out_buffer, uint32_t* unk, uint32_t unc_size) {
591591
#ifdef mutex_on
592592
nn::os::LockMutex(&_mutex);
593593
#endif
594-
static bool init = false;
595-
if (!init) {
596-
nn::fs::MountSdCardForDebug("sdmc");
597-
init = true;
598-
}
594+
if (unc_size == 0xFFFFFFFF) //This is used for saves
595+
return Orig(in_buffer, com_size, out_buffer, unk, unc_size);
599596
XXH64_hash_t hash_output = XXH3_64bits((void*)in_buffer, ((com_size < 0x1000) ? com_size : 0x1000));
600597
auto index = compareHashes0(hash_output);
601598
if (ShinHaya_set) index = compareHashes1(hash_output);
@@ -642,7 +639,7 @@ HOOK_DEFINE_TRAMPOLINE(Decompress) {
642639
#ifdef mutex_on
643640
nn::os::UnlockMutex(&_mutex);
644641
#endif
645-
return Orig(in_buffer, unc_size, out_buffer, unk, com_size);
642+
return Orig(in_buffer, com_size, out_buffer, unk, unc_size);
646643
}
647644
};
648645

@@ -681,28 +678,6 @@ HOOK_DEFINE_INLINE(ReplaceFont) {
681678
}
682679
};
683680

684-
HOOK_DEFINE_INLINE(NOP1_1) {
685-
686-
static void Callback(exl::hook::nx64::InlineCtx* ctx) {
687-
return;
688-
}
689-
};
690-
691-
HOOK_DEFINE_INLINE(NOP1_2) {
692-
693-
static void Callback(exl::hook::nx64::InlineCtx* ctx) {
694-
return;
695-
}
696-
};
697-
698-
HOOK_DEFINE_INLINE(NOP2) {
699-
700-
static void Callback(exl::hook::nx64::InlineCtx* ctx) {
701-
ctx->W[21] = *(uint32_t*)(((ctx->X[25] * ctx->X[22]) + ctx->X[19]) + 0xD0);
702-
return;
703-
}
704-
};
705-
706681
HOOK_DEFINE_TRAMPOLINE(LoadModule) {
707682

708683
static Result Callback(nn::ro::Module* pOutModule, const void* pImage, void* buffer, size_t bufferSize, int flag) {

0 commit comments

Comments
 (0)