Merge branch 'develop/2.1.0' of https://github.com/HackerN64/HackerSM64 into develop/2.1.0-four-controllers-base

This commit is contained in:
Arceveti committed 2023-09-05 12:57:54 -07:00
commit 50b4ebf051
142 files changed
+20123 -3946

No files matched your search

+3 -27
View File
@@ -15,7 +15,6 @@
#include "game/main.h"
#include "game/rumble_init.h"
#include "game/version.h"
#include "game/vc_check.h"
#ifdef UNF
#include "usb/usb.h"
#include "usb/debug.h"
@@ -23,8 +22,7 @@
#include "game/puppyprint.h"
#include "game/puppylights.h"
#include "game/profiling.h"
#include "game/vc_check.h"
#include "game/emutest.h"
// Message IDs
enum MessageIDs {
@@ -318,21 +316,6 @@ void alert_rcp_hung_up(void) {
error("RCP is HUNG UP!! Oh! MY GOD!!");
}
void check_cache_emulation() {
// Disable interrupts to ensure that nothing evicts the variable from cache while we're using it.
u32 saved = __osDisableInt();
// Create a variable with an initial value of 1. This value will remain cached.
volatile u8 sCachedValue = 1;
// Overwrite the variable directly in RDRAM without going through cache.
// This should preserve its value of 1 in dcache if dcache is emulated correctly.
*(u8*)(K0_TO_K1(&sCachedValue)) = 0;
// Read the variable back from dcache, if it's still 1 then cache is emulated correctly.
// If it's zero, then dcache is not emulated correctly.
gCacheEmulated = sCachedValue;
// Restore interrupts
__osRestoreInt(saved);
}
/**
* Increment the first and last values of the stack.
* If they're different, that means an error has occured, so trigger a crash.
@@ -366,7 +349,7 @@ void thread3_main(UNUSED void *arg) {
setup_mesg_queues();
alloc_pool();
load_engine_code_segment();
gIsVC = IS_VC();
detect_emulator();
#ifndef UNF
crash_screen_init();
#endif
@@ -384,14 +367,8 @@ void thread3_main(UNUSED void *arg) {
osSyncPrintf("Linker : %s\n", __linker__);
#endif
if (IO_READ(DPC_CLOCK_REG) == 0) {
gIsConsole = FALSE;
if (!(gEmulator & EMU_CONSOLE)) {
gBorderHeight = BORDER_HEIGHT_EMULATOR;
if (!gIsVC) {
check_cache_emulation();
} else {
gCacheEmulated = FALSE;
}
#ifdef RCVI_HACK
VI.comRegs.vSync = 525*20;
change_vi(&VI, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -400,7 +377,6 @@ void thread3_main(UNUSED void *arg) {
osViSetSpecialFeatures(OS_VI_GAMMA_OFF);
#endif
} else {
gIsConsole = TRUE;
gBorderHeight = BORDER_HEIGHT_CONSOLE;
}
#ifdef DEBUG
-36
View File
@@ -419,42 +419,6 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
return dest;
}
void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd) {
UNUSED void *dest = NULL;
#ifdef GZIP
u32 compSize = (srcEnd - 4 - srcStart);
#else
u32 compSize = ALIGN16(srcEnd - srcStart);
#endif
u8 *compressed = main_pool_alloc(compSize, MEMORY_POOL_RIGHT);
#ifdef GZIP
// Decompressed size from end of gzip
u32 *size = (u32 *) (compressed + compSize);
#endif
if (compressed != NULL) {
#ifdef UNCOMPRESSED
dma_read(gDecompressionHeap, srcStart, srcEnd);
#else
dma_read(compressed, srcStart, srcEnd);
#endif
#ifdef GZIP
expand_gzip(compressed, gDecompressionHeap, compSize, (u32)size);
#elif RNC1
Propack_UnpackM1(compressed, gDecompressionHeap);
#elif RNC2
Propack_UnpackM2(compressed, gDecompressionHeap);
#elif YAY0
slidstart(compressed, gDecompressionHeap);
#elif MIO0
decompress(compressed, gDecompressionHeap);
#endif
set_segment_base_addr(segment, gDecompressionHeap);
main_pool_free(compressed);
}
return gDecompressionHeap;
}
void load_engine_code_segment(void) {
void *startAddr = (void *) _engineSegmentStart;
u32 totalSize = _engineSegmentEnd - _engineSegmentStart;