You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Merge branch 'master' into puppycamera2
This commit is contained in:
2
Makefile
2
Makefile
@@ -337,7 +337,7 @@ ACTOR_DIR := actors
|
||||
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
|
||||
|
||||
# Directories containing source files
|
||||
SRC_DIRS += src src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound
|
||||
SRC_DIRS += src src/boot src/game src/engine src/audio src/menu src/buffers actors levels bin data assets asm lib sound
|
||||
LIBZ_SRC_DIRS := src/libz
|
||||
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
|
||||
BIN_DIRS := bin bin/$(VERSION)
|
||||
|
||||
@@ -6,7 +6,7 @@ index f50b7622..124c7ec6 100644
|
||||
$(BUILD_DIR)/src/menu/file_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/menu/star_select.o: $(BUILD_DIR)/include/text_strings.h
|
||||
$(BUILD_DIR)/src/game/ingame_menu.o: $(BUILD_DIR)/include/text_strings.h
|
||||
+$(BUILD_DIR)/src/game/mem_error_screen.o: $(BUILD_DIR)/include/text_strings.h
|
||||
+$(BUILD_DIR)/src/boot/mem_error_screen.o: $(BUILD_DIR)/include/text_strings.h
|
||||
|
||||
|
||||
#==============================================================================#
|
||||
@@ -137,14 +137,14 @@ index d41a91c8..7d047236 100644
|
||||
|
||||
struct LevelCommand *level_script_execute(struct LevelCommand *cmd);
|
||||
|
||||
diff --git a/src/game/main.c b/src/game/main.c
|
||||
diff --git a/src/boot/main.c b/src/boot/main.c
|
||||
index 1a9d9e7e..f4f7a9e5 100644
|
||||
--- a/src/game/main.c
|
||||
+++ b/src/game/main.c
|
||||
--- a/src/boot/main.c
|
||||
+++ b/src/boot/main.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "segments.h"
|
||||
#include "main.h"
|
||||
#include "rumble_init.h"
|
||||
#include "game/main.h"
|
||||
#include "game/rumble_init.h"
|
||||
+#include "mem_error_screen.h"
|
||||
|
||||
// Message IDs
|
||||
@@ -172,11 +172,11 @@ index 1a9d9e7e..f4f7a9e5 100644
|
||||
osStartThread(&gGameLoopThread);
|
||||
|
||||
while (TRUE) {
|
||||
diff --git a/src/game/mem_error_screen.c b/src/game/mem_error_screen.c
|
||||
diff --git a/src/boot/mem_error_screen.c b/src/boot/mem_error_screen.c
|
||||
new file mode 100644
|
||||
index 00000000..f432927c
|
||||
--- /dev/null
|
||||
+++ b/src/game/mem_error_screen.c
|
||||
+++ b/src/boot/mem_error_screen.c
|
||||
@@ -0,0 +1,104 @@
|
||||
+/* clang-format off */
|
||||
+/*
|
||||
|
||||
16
sm64.ld
16
sm64.ld
@@ -148,9 +148,8 @@ SECTIONS
|
||||
{
|
||||
KEEP(BUILD_DIR/asm/entry.o(.text));
|
||||
|
||||
BUILD_DIR/src/game*.o(.text);
|
||||
BUILD_DIR/src/boot*.o(.text);
|
||||
BUILD_DIR/src/hvqm*.o(.text);
|
||||
BUILD_DIR/src/gdb*.o(.text);
|
||||
BUILD_DIR/src/usb*.o(.text);
|
||||
BUILD_DIR/src/audio*.o(.text);
|
||||
#ifdef S2DEX_TEXT_ENGINE
|
||||
@@ -169,8 +168,7 @@ SECTIONS
|
||||
lib/PR/hvqm/hvqm2sp1.o(.text);
|
||||
|
||||
/* data */
|
||||
BUILD_DIR/src/game*.o(.*data*);
|
||||
BUILD_DIR/src/gdb*.o(.*data*);
|
||||
BUILD_DIR/src/boot*.o(.*data*);
|
||||
BUILD_DIR/src/usb*.o(.*data*);
|
||||
BUILD_DIR/src/audio*.o(.*data*);
|
||||
#ifdef S2DEX_TEXT_ENGINE
|
||||
@@ -188,8 +186,7 @@ SECTIONS
|
||||
lib/PR/hvqm/hvqm2sp1.o(.data*);
|
||||
|
||||
/* rodata */
|
||||
BUILD_DIR/src/game*.o(.rodata*);
|
||||
BUILD_DIR/src/gdb*.o(.*rodata*);
|
||||
BUILD_DIR/src/boot*.o(.rodata*);
|
||||
BUILD_DIR/src/usb*.o(.rodata*);
|
||||
BUILD_DIR/src/audio*.o(.rodata*);
|
||||
#ifdef S2DEX_TEXT_ENGINE
|
||||
@@ -212,9 +209,8 @@ SECTIONS
|
||||
#endif
|
||||
BEGIN_NOLOAD(main)
|
||||
{
|
||||
BUILD_DIR/src/game*.o(.*bss*);
|
||||
BUILD_DIR/src/boot*.o(.*bss*);
|
||||
BUILD_DIR/src/hvqm*.o(.*bss*);
|
||||
BUILD_DIR/src/gdb*.o(.*bss*);
|
||||
BUILD_DIR/src/usb*.o(.*bss*);
|
||||
BUILD_DIR/src/audio*.o(.*bss*);
|
||||
#ifdef S2DEX_TEXT_ENGINE
|
||||
@@ -239,16 +235,20 @@ SECTIONS
|
||||
|
||||
BEGIN_SEG(engine, .)
|
||||
{
|
||||
BUILD_DIR/src/game*.o(.text);
|
||||
BUILD_DIR/src/engine*.o(.text);
|
||||
/* data */
|
||||
BUILD_DIR/src/game*.o(.*data*);
|
||||
BUILD_DIR/src/engine*.o(.data*);
|
||||
BUILD_DIR/src/engine*.o(.sdata*);
|
||||
/* rodata */
|
||||
BUILD_DIR/src/game*.o(.rodata*);
|
||||
BUILD_DIR/src/engine*.o(.rodata*);
|
||||
}
|
||||
END_SEG(engine)
|
||||
BEGIN_NOLOAD(engine)
|
||||
{
|
||||
BUILD_DIR/src/game*.o(.*bss*);
|
||||
BUILD_DIR/src/engine*.o(.bss*);
|
||||
. = ALIGN(0x40);
|
||||
}
|
||||
|
||||
@@ -292,6 +292,7 @@ void note_vibrato_init(struct Note *note) {
|
||||
|
||||
vib = ¬e->vibratoState;
|
||||
|
||||
/* This code was probably removed from EU and SH for a reason; probably because it's dumb and makes vibrato harder to use well.
|
||||
#if defined(VERSION_JP) || defined(VERSION_US)
|
||||
if (note->parentLayer->seqChannel->vibratoExtentStart == 0
|
||||
&& note->parentLayer->seqChannel->vibratoExtentTarget == 0
|
||||
@@ -300,6 +301,7 @@ void note_vibrato_init(struct Note *note) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
|
||||
vib->active = TRUE;
|
||||
vib->time = 0;
|
||||
|
||||
@@ -340,7 +340,7 @@ extern s32 D_SH_80315EE8;
|
||||
void sound_init_main_pools(s32 sizeForAudioInitPool) {
|
||||
sound_alloc_pool_init(&gAudioInitPool, gAudioHeap, sizeForAudioInitPool);
|
||||
sound_alloc_pool_init(&gAudioSessionPool, gAudioHeap + sizeForAudioInitPool, gAudioHeapSize - sizeForAudioInitPool);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
audioPool[0] = sizeForAudioInitPool;
|
||||
audioPool[1] = gAudioHeapSize - sizeForAudioInitPool;
|
||||
#endif
|
||||
@@ -356,7 +356,7 @@ void session_pools_init(struct PoolSplit *a) {
|
||||
gAudioSessionPool.cur = gAudioSessionPool.start;
|
||||
sound_alloc_pool_init(&gNotesAndBuffersPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gSeqAndBankPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantCustom), a->wantCustom);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
audioPool[2] = a->wantSeq;
|
||||
audioPool[3] = a->wantCustom;
|
||||
#endif
|
||||
@@ -366,7 +366,7 @@ void seq_and_bank_pool_init(struct PoolSplit2 *a) {
|
||||
gSeqAndBankPool.cur = gSeqAndBankPool.start;
|
||||
sound_alloc_pool_init(&gPersistentCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantPersistent), a->wantPersistent);
|
||||
sound_alloc_pool_init(&gTemporaryCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantTemporary), a->wantTemporary);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
audioPool[4] = a->wantPersistent;
|
||||
audioPool[5] = a->wantTemporary;
|
||||
#endif
|
||||
@@ -377,7 +377,7 @@ void persistent_pools_init(struct PoolSplit *a) {
|
||||
sound_alloc_pool_init(&gSeqLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gBankLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantBank), a->wantBank);
|
||||
sound_alloc_pool_init(&gUnusedLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantUnused), a->wantUnused);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
audioPool[6] = a->wantSeq;
|
||||
audioPool[7] = a->wantBank;
|
||||
audioPool[8] = a->wantUnused;
|
||||
@@ -392,7 +392,7 @@ void temporary_pools_init(struct PoolSplit *a) {
|
||||
sound_alloc_pool_init(&gSeqLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantSeq), a->wantSeq);
|
||||
sound_alloc_pool_init(&gBankLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantBank), a->wantBank);
|
||||
sound_alloc_pool_init(&gUnusedLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantUnused), a->wantUnused);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
audioPool[9] = a->wantSeq;
|
||||
audioPool[10] = a->wantBank;
|
||||
audioPool[11] = a->wantUnused;
|
||||
@@ -1275,7 +1275,7 @@ void audio_reset_session(void) {
|
||||
|
||||
if (toggleBetterReverb && betterReverbWindowsSize >= 0)
|
||||
reverbWindowSize = betterReverbWindowsSize;
|
||||
|
||||
|
||||
if (gReverbDownsampleRate < (1 << (reverbConsole - 1)))
|
||||
gReverbDownsampleRate = (1 << (reverbConsole - 1));
|
||||
reverbWindowSize /= gReverbDownsampleRate;
|
||||
|
||||
@@ -142,12 +142,12 @@ u8 audioString49[] = "BANK LOAD MISS! FOR %d\n";
|
||||
* Performs an asynchronus (normal priority) DMA copy
|
||||
*/
|
||||
void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
osInvalDCache(vAddr, nbytes);
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
@@ -157,7 +157,7 @@ void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQ
|
||||
* to 0x1000 bytes transfer at once.
|
||||
*/
|
||||
void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remaining, OSMesgQueue *queue, OSIoMesg *mesg) {
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
#if defined(VERSION_EU)
|
||||
@@ -170,7 +170,7 @@ void audio_dma_partial_copy_async(uintptr_t *devAddr, u8 **vAddr, ssize_t *remai
|
||||
osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, *devAddr, *vAddr, transfer, queue);
|
||||
*devAddr += transfer;
|
||||
*vAddr += transfer;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
@@ -220,7 +220,7 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
u32 dmaIndex;
|
||||
ssize_t bufferPos;
|
||||
UNUSED u32 pad;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -248,12 +248,12 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
dma->ttl = 60;
|
||||
*dmaIndexRef = (u8) i;
|
||||
#if defined(VERSION_EU)
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return &dma->buffer[(devAddr - dma->source)];
|
||||
#else
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return (devAddr - dma->source) + dma->buffer;
|
||||
@@ -296,12 +296,12 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
}
|
||||
dma->ttl = 2;
|
||||
#if defined(VERSION_EU)
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return dma->buffer + (devAddr - dma->source);
|
||||
#else
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return (devAddr - dma->source) + dma->buffer;
|
||||
@@ -329,7 +329,7 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL,
|
||||
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = dmaIndex;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return (devAddr - dmaDevAddr) + dma->buffer;
|
||||
@@ -338,7 +338,7 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL,
|
||||
OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = dmaIndex;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaAudioTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return dma->buffer + (devAddr - dmaDevAddr);
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
|
||||
#include "sm64.h"
|
||||
#include "audio/external.h"
|
||||
#include "game_init.h"
|
||||
#include "memory.h"
|
||||
#include "sound_init.h"
|
||||
#include "profiler.h"
|
||||
#include "game/game_init.h"
|
||||
#include "game/memory.h"
|
||||
#include "game/sound_init.h"
|
||||
#include "game/profiler.h"
|
||||
#include "buffers/buffers.h"
|
||||
#include "segments.h"
|
||||
#include "main.h"
|
||||
#include "rumble_init.h"
|
||||
#include "version.h"
|
||||
#include "game/main.h"
|
||||
#include "game/rumble_init.h"
|
||||
#include "game/version.h"
|
||||
#ifdef UNF
|
||||
#include "usb/usb.h"
|
||||
#include "usb/debug.h"
|
||||
#endif
|
||||
#include "puppyprint.h"
|
||||
#include "game/puppyprint.h"
|
||||
|
||||
// Message IDs
|
||||
#define MESG_SP_COMPLETE 100
|
||||
@@ -189,7 +189,7 @@ void start_gfx_sptask(void) {
|
||||
if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL
|
||||
&& sCurrentDisplaySPTask->state == SPTASK_STATE_NOT_STARTED) {
|
||||
profiler_log_gfx_time(TASKS_QUEUED);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
rspDelta = osGetTime();
|
||||
#endif
|
||||
start_sptask(M_GFXTASK);
|
||||
@@ -237,7 +237,7 @@ void handle_vblank(void) {
|
||||
if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL
|
||||
&& sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) {
|
||||
profiler_log_gfx_time(TASKS_QUEUED);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
rspDelta = osGetTime();
|
||||
#endif
|
||||
start_sptask(M_GFXTASK);
|
||||
@@ -272,7 +272,7 @@ void handle_sp_complete(void) {
|
||||
// The gfx task completed before we had time to interrupt it.
|
||||
// Mark it finished, just like below.
|
||||
curSPTask->state = SPTASK_STATE_FINISHED;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(rspGenTime, rspDelta);
|
||||
#endif
|
||||
profiler_log_gfx_time(RSP_COMPLETE);
|
||||
@@ -305,7 +305,7 @@ void handle_sp_complete(void) {
|
||||
// The SP process is done, but there is still a Display Processor notification
|
||||
// that needs to arrive before we can consider the task completely finished and
|
||||
// null out sCurrentDisplaySPTask. That happens in handle_dp_complete.
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(rspGenTime, rspDelta);
|
||||
#endif
|
||||
profiler_log_gfx_time(RSP_COMPLETE);
|
||||
@@ -503,10 +503,10 @@ extern u32 gISVFlag;
|
||||
void osInitialize_fakeisv() {
|
||||
/* global flag to skip `__checkHardware_isv` from being called. */
|
||||
gISVFlag = 0x49533634; // 'IS64'
|
||||
|
||||
|
||||
/* printf writes go to this address, cen64(1) has this hardcoded. */
|
||||
gISVDbgPrnAdrs = 0x13FF0000;
|
||||
|
||||
|
||||
/* `__printfunc`, used by `osSyncPrintf` will be set. */
|
||||
__osInitialize_isv();
|
||||
}
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "buffers/buffers.h"
|
||||
#include "slidec.h"
|
||||
#include "game_init.h"
|
||||
#include "main.h"
|
||||
#include "memory.h"
|
||||
#include "game/game_init.h"
|
||||
#include "game/main.h"
|
||||
#include "game/memory.h"
|
||||
#include "segment_symbols.h"
|
||||
#include "segments.h"
|
||||
#ifdef GZIP
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "usb/usb.h"
|
||||
#include "usb/debug.h"
|
||||
#endif
|
||||
#include "puppyprint.h"
|
||||
#include "game/puppyprint.h"
|
||||
|
||||
|
||||
// round up to the next multiple
|
||||
@@ -135,7 +135,7 @@ void main_pool_init(void *start, void *end) {
|
||||
sPoolListHeadL->next = NULL;
|
||||
sPoolListHeadR->prev = NULL;
|
||||
sPoolListHeadR->next = NULL;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
mempool = sPoolFreeSpace;
|
||||
#endif
|
||||
}
|
||||
@@ -260,7 +260,7 @@ u32 main_pool_pop_state(void) {
|
||||
*/
|
||||
void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
||||
u32 size = ALIGN16(srcEnd - srcStart);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -276,7 +276,7 @@ void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) {
|
||||
srcStart += copySize;
|
||||
size -= copySize;
|
||||
}
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
dmaTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
@@ -355,7 +355,7 @@ void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side, u8 *bssStart
|
||||
set_segment_base_addr(segment, addr);
|
||||
}
|
||||
}
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
ramsizeSegment[segment+nameTable-2] = (s32)srcEnd- (s32)srcStart;
|
||||
#endif
|
||||
return addr;
|
||||
@@ -435,7 +435,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
|
||||
}
|
||||
} else {
|
||||
}
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
ramsizeSegment[segment+nameTable-2] = (s32)srcEnd - (s32)srcStart;
|
||||
#endif
|
||||
return dest;
|
||||
@@ -977,7 +977,7 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f
|
||||
f32 length;
|
||||
Vec3f chk_hit_pos;
|
||||
f32 top, bottom;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -1011,7 +1011,7 @@ void find_surface_on_ray_list(struct SurfaceNode *list, Vec3f orig, Vec3f dir, f
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
||||
s32 numCollisions = 0;
|
||||
s32 x = colData->x;
|
||||
s32 z = colData->z;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -217,7 +217,7 @@ s32 find_wall_collisions(struct WallCollisionData *colData) {
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.wall += 1;
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
@@ -307,7 +307,7 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
|
||||
f32 height = CELL_HEIGHT_LIMIT;
|
||||
f32 dynamicHeight = CELL_HEIGHT_LIMIT;
|
||||
s32 x, y, z;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -345,7 +345,7 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) {
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.ceil += 1;
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
@@ -574,7 +574,7 @@ f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfl
|
||||
*/
|
||||
f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
s32 cellZ, cellX;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -594,13 +594,13 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
*pfloor = NULL;
|
||||
|
||||
if (x <= -LEVEL_BOUNDARY_MAX || x >= LEVEL_BOUNDARY_MAX) {
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return height;
|
||||
}
|
||||
if (z <= -LEVEL_BOUNDARY_MAX || z >= LEVEL_BOUNDARY_MAX) {
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
return height;
|
||||
@@ -649,7 +649,7 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) {
|
||||
// Increment the debug tracker.
|
||||
gNumCalls.floor += 1;
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
@@ -710,7 +710,7 @@ s32 find_water_level_and_floor(s32 x, s32 z, struct Surface **pfloor) {
|
||||
s32 waterLevel = FLOOR_LOWER_LIMIT;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
struct Surface *floor = NULL;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -743,7 +743,7 @@ s32 find_water_level_and_floor(s32 x, s32 z, struct Surface **pfloor) {
|
||||
*pfloor = floor;
|
||||
}
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
@@ -761,7 +761,7 @@ s32 find_water_level(s32 x, s32 z) {
|
||||
s32 waterLevel = FLOOR_LOWER_LIMIT;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
struct Surface *floor;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -792,7 +792,7 @@ s32 find_water_level(s32 x, s32 z) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
@@ -809,7 +809,7 @@ s32 find_poison_gas_level(s32 x, s32 z) {
|
||||
s32 loX, hiX, loZ, hiZ;
|
||||
s32 gasLevel = FLOOR_LOWER_LIMIT;
|
||||
TerrainData *p = gEnvironmentRegions;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -838,7 +838,7 @@ s32 find_poison_gas_level(s32 x, s32 z) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -604,7 +604,7 @@ u32 get_area_terrain_size(TerrainData *data) {
|
||||
void load_area_terrain(s32 index, TerrainData *data, RoomData *surfaceRooms, s16 *macroObjects) {
|
||||
s32 terrainLoadType;
|
||||
TerrainData *vertexData = NULL;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -654,7 +654,7 @@ void load_area_terrain(s32 index, TerrainData *data, RoomData *surfaceRooms, s16
|
||||
|
||||
gNumStaticSurfaceNodes = gSurfaceNodesAllocated;
|
||||
gNumStaticSurfaces = gSurfacesAllocated;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
@@ -784,7 +784,7 @@ void load_object_surfaces(TerrainData **data, TerrainData *vertexData) {
|
||||
*/
|
||||
void load_object_collision_model(void) {
|
||||
TerrainData vertexData[600];
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
@@ -821,7 +821,7 @@ void load_object_collision_model(void) {
|
||||
} else {
|
||||
gCurrentObject->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
|
||||
}
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
collisionTime[perfIteration] += osGetTime()-first;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void render_game(void) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
puppyprint_render_profiler();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -716,7 +716,7 @@ void setup_game_memory(void) {
|
||||
*/
|
||||
void thread5_game_loop(UNUSED void *arg) {
|
||||
struct LevelCommand *addr;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime lastTime = 0;
|
||||
#endif
|
||||
|
||||
@@ -755,7 +755,7 @@ void thread5_game_loop(UNUSED void *arg) {
|
||||
continue;
|
||||
}
|
||||
profiler_log_thread5_time(THREAD5_START);
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
while (TRUE)
|
||||
{
|
||||
lastTime = osGetTime();
|
||||
@@ -777,10 +777,10 @@ void thread5_game_loop(UNUSED void *arg) {
|
||||
select_gfx_pool();
|
||||
read_controller_inputs();
|
||||
addr = level_script_execute(addr);
|
||||
#if defined(VISUAL_DEBUG) && !defined(PUPPYPRINT)
|
||||
#if PUPPYPRINT_DEBUG == 0 && defined(VISUAL_DEBUG)
|
||||
debug_box_input();
|
||||
#endif
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(scriptTime, lastTime);
|
||||
if (benchmarkLoop > 0 && benchOption == 0)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "course_table.h"
|
||||
#include "rumble_init.h"
|
||||
#include "puppycam2.h"
|
||||
#include "puppyprint.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@@ -563,7 +564,7 @@ void check_instant_warp(void) {
|
||||
#ifdef INSTANT_WARP_OFFSET_FIX
|
||||
gMarioObject->header.gfx.pos[0] = gMarioState->pos[0];
|
||||
gMarioObject->header.gfx.pos[1] = gMarioState->pos[1];
|
||||
gMarioObject->header.gfx.pos[2] = gMarioState->pos[2];
|
||||
gMarioObject->header.gfx.pos[2] = gMarioState->pos[2];
|
||||
#endif
|
||||
cameraAngle = gMarioState->area->camera->yaw;
|
||||
|
||||
@@ -1187,6 +1188,10 @@ s32 update_level(void) {
|
||||
|
||||
s32 init_level(void) {
|
||||
s32 val4 = 0;
|
||||
#if PUPPYPRINT_DEBUG
|
||||
char textBytes[64];
|
||||
OSTime first = osGetTime();
|
||||
#endif
|
||||
|
||||
set_play_mode(PLAY_MODE_NORMAL);
|
||||
|
||||
@@ -1260,6 +1265,10 @@ s32 init_level(void) {
|
||||
sound_banks_disable(SEQ_PLAYER_SFX, SOUND_BANKS_DISABLED_DURING_INTRO_CUTSCENE);
|
||||
}
|
||||
|
||||
#if PUPPYPRINT_DEBUG
|
||||
sprintf(textBytes, "Level loaded in %dus", (s32)(OS_CYCLES_TO_USEC(osGetTime() - first)));
|
||||
append_puppyprint_log(textBytes);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -626,7 +626,7 @@ UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) {
|
||||
*/
|
||||
void update_objects(UNUSED s32 unused) {
|
||||
s64 cycleCounts[30];
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
OSTime first = osGetTime();
|
||||
OSTime colTime = collisionTime[perfIteration];
|
||||
#endif
|
||||
@@ -688,7 +688,7 @@ void update_objects(UNUSED s32 unused) {
|
||||
}
|
||||
|
||||
gPrevFrameObjectCount = gObjectCounter;
|
||||
#ifdef PUPPYPRINT
|
||||
#if PUPPYPRINT_DEBUG
|
||||
profiler_update(behaviourTime, first);
|
||||
behaviourTime[perfIteration] -= collisionTime[perfIteration]+colTime;
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user