Skip to content
Open
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
3 changes: 3 additions & 0 deletions sm64.ld
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ SECTIONS
/* data */
BUILD_DIR/asm/n64_assert.o(.*data*);
BUILD_DIR/src/boot*.o(.*data*);
BUILD_DIR/src/hvqm*.o(.*data*);
BUILD_DIR/src/usb*.o(.*data*);
BUILD_DIR/src/audio*.o(.*data*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.*data*);
Expand All @@ -208,6 +210,7 @@ SECTIONS
/* rodata */
BUILD_DIR/src/boot*.o(.rodata*);
BUILD_DIR/src/usb*.o(.rodata*);
BUILD_DIR/src/hvqm*.o(.rodata*);
BUILD_DIR/src/audio*.o(.rodata*);
#ifdef S2DEX_TEXT_ENGINE
BUILD_DIR/src/s2d_engine*.o(.rodata*);
Expand Down
12 changes: 6 additions & 6 deletions src/game/game_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,10 @@ void setup_game_memory(void) {
load_segment_decompress(SEGMENT_SEGMENT2, _segment2_mio0SegmentRomStart, _segment2_mio0SegmentRomEnd);
}



extern struct SPTask *sCurrentDisplaySPTask;

/**
* Main game loop thread. Runs forever as long as the game continues.
*/
Expand Down Expand Up @@ -858,7 +862,9 @@ void thread5_game_loop(UNUSED void *arg) {
read_controller_inputs(THREAD_5_GAME_LOOP);
profiler_update(PROFILER_TIME_CONTROLLERS, 0);
profiler_collision_reset();

addr = level_script_execute(addr);

profiler_collision_completed();
#if !defined(PUPPYPRINT_DEBUG) && defined(VISUAL_DEBUG)
debug_box_input();
Expand All @@ -875,12 +881,6 @@ void thread5_game_loop(UNUSED void *arg) {
// amount of free space remaining.
print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead);
}
#endif
#if 0
if (gPlayer1Controller->buttonPressed & L_TRIG) {
osStartThread(&hvqmThread);
osRecvMesg(&gDmaMesgQueue, NULL, OS_MESG_BLOCK);
}
#endif
}
}
8 changes: 8 additions & 0 deletions src/game/sound_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "puppyprint.h"
#include "profiling.h"

#ifdef HVQM
#include <hvqm/hvqm.h>
#endif

#include "config/config_audio.h"

#define MUSIC_NONE 0xFFFF
Expand Down Expand Up @@ -373,7 +377,11 @@ void thread4_sound(UNUSED void *arg) {

osRecvMesg(&sSoundMesgQueue, &msg, OS_MESG_BLOCK);
profiler_audio_started(); // also starts PROFILER_TIME_SUB_AUDIO_UPDATE inside
#ifdef HVQM
if (gResetTimer < 25 && gHvqmPlayState == 0) {
#else
if (gResetTimer < 25) {
#endif
struct SPTask *spTask = create_next_audio_frame_task();
if (spTask != NULL) {
dispatch_audio_sptask(spTask);
Expand Down
4 changes: 4 additions & 0 deletions src/hvqm/cfbkeep.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <HVQM2File.h>
#include "hvqm.h"
#include "buffers/framebuffers.h"
#include "game/debug.h"

/***********************************************************************
* Array maintaining the state of the frame buffer
Expand Down Expand Up @@ -98,12 +99,15 @@ int
get_cfb()
{
int cfbno;
int loop_count = 0;

for ( ; ; ) {
for ( cfbno = 0; cfbno < NUM_CFBs; cfbno++ )
if ( cfb_status[cfbno] == 0 )
return cfbno;
osYieldThread();
loop_count++;
aggress(loop_count < 1000000, "HVQM: get_cfb: all framebuffers busy for too long");
}
}

Expand Down
Loading