Make HVQM disableable, making IDO usable again

This commit is contained in:
CrashOveride95
2021-01-02 21:19:27 -05:00
parent c621be8f1d
commit 4eb3896bd8
13 changed files with 45 additions and 35 deletions

View File

@@ -145,6 +145,17 @@ $(eval $(call validate-option,UNF,0 1))
ifeq ($(UNF),1)
DEFINES += UNF=1
SRC_DIRS += src/usb
endif
# HVQM - whether to use HVQM fmv library
# 1 - includes code in ROM
# 0 - does not
HVQM ?= 0
$(eval $(call validate-option,HVQM,0 1))
ifeq ($(HVQM),1)
DEFINES += HVQM=1
SRC_DIRS += src/hvqm
endif
# Whether to hide commands or not
@@ -230,7 +241,7 @@ ACTOR_DIR := actors
LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
# Directories containing source files
SRC_DIRS := src src/usb src/engine src/game src/hvqm src/audio src/menu src/buffers actors levels bin data assets asm lib sound
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets asm lib sound
BIN_DIRS := bin bin/$(VERSION)
# File dependencies and variables for specific files
@@ -651,7 +662,8 @@ $(GLOBAL_ASM_DEP).$(NON_MATCHING):
# Generate version_data.h
$(BUILD_DIR)/src/game/version_data.h: tools/make_version.sh
tools/make_version.sh $(CROSS) > $@
@$(PRINT) "$(GREEN)Generating: $(BLUE)$@ $(NO_COL)\n"
$(V)tools/make_version.sh $(CROSS) > $@
#==============================================================================#
# Compilation Recipes #

15
sm64.ld
View File

@@ -85,9 +85,11 @@ SECTIONS
BEGIN_NOLOAD(buffers)
{
BUILD_DIR/src/buffers/buffers.o(.bss*);
#ifdef HVQM
BUILD_DIR/src/buffers/hvqmwork.o(.bss*);
BUILD_DIR/src/buffers/adpcmbuf.o(.bss*);
BUILD_DIR/src/buffers/hvqbuf.o(.bss*);
#endif
BUILD_DIR/src/audio/globals_start.o(.bss*);
BUILD_DIR/src/audio/synthesis.o(.bss*);
BUILD_DIR/src/audio/heap.o(.bss*);
@@ -114,7 +116,9 @@ SECTIONS
BUILD_DIR/asm/entry.o(.text);
BUILD_DIR/src/game*.o(.text);
#ifdef HVQM
BUILD_DIR/src/hvqm*.o(.text);
#endif
#ifdef UNF
BUILD_DIR/src/usb*.o(.text);
#endif
@@ -140,10 +144,14 @@ SECTIONS
*/libultra_rom.a:*.o(.data*);
*/libultra_rom.a:*.o(.sdata*);
#ifdef HVQM
*/libhvqm2.a:*.o(.data*);
#endif
BUILD_DIR/lib/rsp.o(.data*);
#ifdef HVQM
lib/PR/hvqm/hvqm2sp1.o(.data*);
#endif
/* rodata */
BUILD_DIR/src/game*.o(.rodata*);
@@ -153,10 +161,14 @@ SECTIONS
BUILD_DIR/src/audio*.o(.rodata*);
*/libultra_rom.a:*.o(.rodata*);
#ifdef HVQM
*/libhvqm2.a:*.o(.rodata*);
#endif
BUILD_DIR/lib/rsp.o(.rodata*);
#ifdef HVQM
lib/PR/hvqm/hvqm2sp1.o(.rodata*);
#endif
}
END_SEG(main)
BEGIN_NOLOAD(main)
@@ -361,12 +373,13 @@ SECTIONS
BUILD_DIR/sound/sound_data.o(.data);
}
END_SEG(assets)
#ifdef HVQM
BEGIN_SEG(capcom, __romPos) SUBALIGN(2)
{
BUILD_DIR/data/capcom.o(.data);
}
END_SEG(capcom)
#endif
#if 0
BEGIN_SEG(sein, __romPos) SUBALIGN(2)
{

View File

@@ -10,7 +10,9 @@
#include "game/level_update.h"
#include "game/object_list_processor.h"
#include "game/camera.h"
#ifdef UNF
#include "usb/debug.h"
#endif
#include "seq_ids.h"
#include "dialog_ids.h"

View File

@@ -2,7 +2,9 @@
#include <hvqm2dec.h>
#include "buffers.h"
#ifdef HVQM
#include <hvqm/hvqm.h>
#endif
#include "config.h"
ALIGNED8 u8 gDecompressionHeap[0xD000];

View File

@@ -3,4 +3,4 @@
#include "config.h"
// 0x70800 bytes
__attribute__((aligned (64))) u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];

View File

@@ -19,9 +19,13 @@
#include "segment2.h"
#include "segment_symbols.h"
#include "rumble_init.h"
#ifdef HVQM
#include <hvqm/hvqm.h>
#endif
#ifdef UNF
#include "usb/usb.h"
#include "usb/debug.h"
#endif
#include <prevent_bss_reordering.h>
// FIXME: I'm not sure all of these variables belong in this file, but I don't
@@ -602,53 +606,25 @@ void thread5_game_loop(UNUSED void *arg) {
struct LevelCommand *addr;
setup_game_memory();
#ifdef UNF
debug_printf("init_rumble_pak_scheduler_queue\n");
#endif
#if ENABLE_RUMBLE
init_rumble_pak_scheduler_queue();
#endif
#ifdef UNF
debug_printf("init_controllers\n");
#endif
init_controllers();
#if ENABLE_RUMBLE
#ifdef UNF
debug_printf("create_thread_6\n");
#endif
create_thread_6();
#endif
#ifdef UNF
debug_printf("createHvqmThread\n");
#endif
#ifdef HVQM
createHvqmThread();
#ifdef UNF
debug_printf("save_file_load_all\n");
#endif
save_file_load_all();
#ifdef UNF
debug_printf("set_vblank_handler\n");
#endif
set_vblank_handler(2, &gGameVblankHandler, &gGameVblankQueue, (OSMesg) 1);
#ifdef UNF
debug_printf("point addr to the entry point into the level script data.\n");
#endif
// point addr to the entry point into the level script data.
addr = segmented_to_virtual(level_script_entry);
#ifdef UNF
debug_printf("play_music\n");
#endif
play_music(SEQ_PLAYER_SFX, SEQUENCE_ARGS(0, SEQ_SOUND_PLAYER), 0);
#ifdef UNF
debug_printf("set_sound_mode\n");
#endif
set_sound_mode(save_file_get_sound_mode());
#ifdef UNF
debug_printf("rendering_init\n");
#endif
rendering_init();
while (TRUE) {

View File

@@ -13,8 +13,10 @@
#include "main.h"
#include "rumble_init.h"
#include "version.h"
#ifdef UNF
#include "usb/usb.h"
#include "usb/debug.h"
#endif
// Message IDs
#define MESG_SP_COMPLETE 100

View File

@@ -11,7 +11,10 @@
#include "memory.h"
#include "segment_symbols.h"
#include "segments.h"
#ifdef UNF
#include "usb/debug.h"
#endif
// round up to the next multiple
#define ALIGN4(val) (((val) + 0x3) & ~0x3)

View File

@@ -4,4 +4,4 @@
char __username__[] = __USERNAME__;
char __datetime__[] = __DATETIME__;
char __compiler__[] = __COMPILER__;
char __linker__[] = __LINKER__;
char __linker__[] = __LINKER__;

View File

@@ -6,4 +6,4 @@ extern char __datetime__[];
extern char __compiler__[];
extern char __linker__[];
#endif
#endif