Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions lib/src/osStopTimer.c

This file was deleted.

2 changes: 0 additions & 2 deletions sm64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ SECTIONS
BUILD_DIR/libultra.a:__osGetCause.o(.text);
BUILD_DIR/libultra.a:__osAtomicDec.o(.text);
BUILD_DIR/libultra.a:guLookAtRef.o(.text); /* Fast3DEX2 only */
BUILD_DIR/libultra.a:__osGetCurrFaultedThread.o(.text);
BUILD_DIR/libultra.a:osSyncPrintf.o(.text);
BUILD_DIR/libultra.a:osStopTimer.o(.text);
BUILD_DIR/lib/rsp.o(.text);

/* data */
Expand Down
192 changes: 0 additions & 192 deletions src/game/crash.c

This file was deleted.

9 changes: 0 additions & 9 deletions src/game/crash.h

This file was deleted.

38 changes: 0 additions & 38 deletions src/game/main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <ultra64.h>
#include <stdio.h>
#include "PR/os.h"

#include "sm64.h"
#include "audio/external.h"
Expand All @@ -12,14 +11,12 @@
#include "segments.h"
#include "segment_symbols.h"
#include "main.h"
#include "crash.h"

// Message IDs
#define MESG_SP_COMPLETE 100
#define MESG_DP_COMPLETE 101
#define MESG_VI_VBLANK 102
#define MESG_START_GFX_SPTASK 103
#define MESG_RCP_HUNG 105

OSThread gRmonThread; // unused?
OSThread gIdleThread;
Expand Down Expand Up @@ -315,27 +312,6 @@ void handle_dp_complete(void) {
sCurrentDisplaySPTask = NULL;
}

/////// FROM https://github.com/HackerN64/HackerSM64, START
#if defined(TARGET_N64)
OSTimerEx RCPHangTimer;
void start_rcp_hang_timer(void) {
if (RCPHangTimer.started == FALSE) {
osSetTimer(&RCPHangTimer.timer, OS_USEC_TO_CYCLES(3000000), (OSTime) 0, &gIntrMesgQueue, (OSMesg) MESG_RCP_HUNG);
RCPHangTimer.started = TRUE;
}
}

void stop_rcp_hang_timer(void) {
osStopTimer(&RCPHangTimer.timer);
RCPHangTimer.started = FALSE;
}

void alert_rcp_hung_up(void) {
error("RCP IS HUNG UP! Please check your display lists for any errors.");
}
#endif
/////// END

void thread3_main(UNUSED void *arg) {
create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20);
osStartThread(&gSoundThread);
Expand All @@ -347,9 +323,6 @@ void thread3_main(UNUSED void *arg) {
alloc_pool();
load_engine_code_segment(); // this line is not in the Feburary 1996 backup, but WHERE ELSE WOULD
// THE DATA BE LOADED THEN?
#if defined(TARGET_N64)
crash_log_init(); // this is not john nintendo approved
#endif

while (TRUE) {
OSMesg msg;
Expand All @@ -363,22 +336,11 @@ void thread3_main(UNUSED void *arg) {
handle_sp_complete();
break;
case MESG_DP_COMPLETE:
#if defined(TARGET_N64)
stop_rcp_hang_timer();
#endif
handle_dp_complete();
break;
case MESG_START_GFX_SPTASK:
#if defined(TARGET_N64)
start_rcp_hang_timer();
#endif
start_gfx_sptask();
break;
#if defined(TARGET_N64)
case MESG_RCP_HUNG:
alert_rcp_hung_up();
break;
#endif
}
CheckStackMemory();
}
Expand Down
12 changes: 0 additions & 12 deletions src/game/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ extern s8 D_8032C650;
extern s8 gShowProfiler;
extern s8 gShowDebugText;

/////// FROM https://github.com/HackerN64/HackerSM64, START
// Special struct that keeps track of whether its timer has been set.
// Without this check, there is a bug at high CPU loads in which
// the RCP timer gets set twice and the game tries to
// insert __osBaseTimer into a ring buffer that only contains itself,
// causing a particularly messy crash.
typedef struct {
u8 started;
OSTimer timer;
} OSTimerEx;
/////// END

void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg *msg);
void dispatch_audio_sptask(struct SPTask *spTask);
void exec_display_list(struct SPTask *spTask);
Expand Down