Merge in develop-zhora

This commit is contained in:
Christopher Leggett 2022-07-25 21:33:19 -04:00
commit 2ff5d54592
No known key found for this signature in database
GPG key ID: 7093AE5FF7037D79
68 changed files with 1682 additions and 209 deletions

View file

@ -179,7 +179,7 @@ all:
$(MAKE) $(TARGET)
setup:
cd ../OTRExporter && python3 extract_baserom.py
cd ../OTRExporter
$(MAKE) mpq
mpq:

280
soh/Makefile.switch Normal file
View file

@ -0,0 +1,280 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional)
#
# NO_ICON: if set to anything, do not use icon.
# NO_NACP: if set to anything, no .nacp file is generated.
# APP_TITLE is the name of the app stored in the .nacp file (Optional)
# APP_AUTHOR is the author of the app stored in the .nacp file (Optional)
# APP_VERSION is the version of the app stored in the .nacp file (Optional)
# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional)
# ICON is the filename of the icon (.jpg), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.jpg
# - icon.jpg
# - <libnx folder>/default_icon.jpg
#
# CONFIG_JSON is the filename of the NPDM config file (.json), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.json
# - config.json
# If a JSON file is provided or autodetected, an ExeFS PFS0 (.nsp) is built instead
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := switch
DATA :=
INCLUDES := \
. \
assets \
build \
include \
src \
../ZAPDTR/ZAPDUtils \
../libultraship/libultraship \
../libultraship/libultraship/Lib/spdlog/include \
../libultraship/libultraship/Lib/Fast3D/U64 \
../libultraship/libultraship/Lib/Fast3D/U64/PR
#-------------------------------------------------------------------------------
# source files
#-------------------------------------------------------------------------------
SOURCEFILES_C := \
$(shell find soh -type f -name "*.c") \
$(shell find src/boot -type f -name "*.c") \
$(shell find src/buffers -type f -name "*.c") \
$(shell find src/code -type f -name "*.c") \
$(shell find src/overlays -type f -name "*.c") \
src/libultra/gu/coss.c \
src/libultra/gu/guLookAt.c \
src/libultra/gu/guLookAtHilite.c \
src/libultra/gu/guPerspectiveF.c \
src/libultra/gu/guPosition.c \
src/libultra/gu/guS2DInitBg.c \
src/libultra/gu/ortho.c \
src/libultra/gu/rotate.c \
src/libultra/gu/sins.c \
src/libultra/gu/sintable.c \
src/libultra/libc/sprintf.c
SOURCEFILES_CPP := \
$(shell find soh -type f -name "*.cpp")
#---------------------------------------------------------------------------------
# app info
#---------------------------------------------------------------------------------
APP_TITLE := Ship of Harkinian
APP_AUTHOR := Harbour Masters
APP_VERSION := Rachael-Alfa
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffast-math -O3
CFLAGS := -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += $(INCLUDE) -D__SWITCH__ \
-DSPDLOG_NO_THREAD_ID \
-DSTBI_NO_THREAD_LOCALS \
`sdl2-config --cflags`
CXXFLAGS := $(CFLAGS) -std=gnu++20 -fpermissive
CFLAGS += -std=gnu11
# disable some warnings
CFLAGS += -Wno-incompatible-pointer-types -Wno-int-conversion \
-Wno-builtin-declaration-mismatch -Wno-implicit-function-declaration \
-Wno-stringop-overflow -Wno-discarded-qualifiers -Wno-switch-unreachable
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
STATIC_LIBS := $(SOH_TOP_DIR)/libultraship/lib/libultraship.a \
$(SOH_TOP_DIR)/ZAPDTR/ZAPDUtils/lib/libZAPDUtils.a \
$(SOH_TOP_DIR)/ZAPDTR/ZAPDUtils/lib/libZAPDUtils.a \
$(SOH_TOP_DIR)/StormLib/nxbuild/libstorm.a \
LIBS := -L$(SOH_TOP_DIR)/StormLib/nxbuild/ -lultraship -lZAPDUtils -lstorm -lz -lbz2 -lnx -lglad -lglapi -ldrm_nouveau -lm `sdl2-config --libs`
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX) $(SOH_TOP_DIR)/StormLib/nxbuild $(SOH_TOP_DIR)/libultraship $(SOH_TOP_DIR)/ZAPDTR/ZAPDUtils
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(foreach sf,$(SOURCEFILES_C),$(CURDIR)/$(dir $(sf))) \
$(foreach sf,$(SOURCEFILES_CPP),$(CURDIR)/$(dir $(sf)))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) \
$(foreach f,$(SOURCEFILES_C),$(notdir $(f)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) \
$(foreach f,$(SOURCEFILES_CPP),$(notdir $(f)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
ifeq ($(strip $(CONFIG_JSON)),)
jsons := $(wildcard *.json)
ifneq (,$(findstring $(TARGET).json,$(jsons)))
export APP_JSON := $(TOPDIR)/$(TARGET).json
else
ifneq (,$(findstring config.json,$(jsons)))
export APP_JSON := $(TOPDIR)/config.json
endif
endif
else
export APP_JSON := $(TOPDIR)/$(CONFIG_JSON)
endif
ifeq ($(strip $(ICON)),)
icons := $(wildcard *.jpg)
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
else
ifneq (,$(findstring icon.jpg,$(icons)))
export APP_ICON := $(TOPDIR)/icon.jpg
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
endif
ifeq ($(strip $(NO_ICON)),)
export NROFLAGS += --icon=$(APP_ICON)
endif
ifeq ($(strip $(NO_NACP)),)
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
endif
ifneq ($(APP_TITLEID),)
export NACPFLAGS += --titleid=$(APP_TITLEID)
endif
ifneq ($(ROMFS),)
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
endif
.PHONY: $(BUILD) clean all
#---------------------------------------------------------------------------------
all: $(BUILD)
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.switch
#---------------------------------------------------------------------------------
clean:
@echo clean ...
ifeq ($(strip $(APP_JSON)),)
@rm -fr $(BUILD) $(TARGET).nro $(TARGET).nacp $(TARGET).elf
else
@rm -fr $(BUILD) $(TARGET).nsp $(TARGET).nso $(TARGET).npdm $(TARGET).elf
endif
#---------------------------------------------------------------------------------
else
.PHONY: all
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
ifeq ($(strip $(APP_JSON)),)
all : $(OUTPUT).nro
ifeq ($(strip $(NO_NACP)),)
$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp
else
$(OUTPUT).nro : $(OUTPUT).elf
endif
else
all : $(OUTPUT).nsp
$(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm
$(OUTPUT).nso : $(OUTPUT).elf
endif
$(OUTPUT).elf : $(OFILES) \
$(STATIC_LIBS)
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

BIN
soh/icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

@ -60,7 +60,7 @@ void Locale_ResetRegion(void);
u32 func_80001F48(void);
u32 func_80001F8C(void);
u32 Locale_IsRegionNative(void);
#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__SWITCH__)
void __assert(const char* exp, const char* file, s32 line);
#endif
void isPrintfInit(void);
@ -1872,7 +1872,7 @@ void FaultDrawer_SetCharPad(s8, s8);
void FaultDrawer_SetCursor(s32, s32);
void FaultDrawer_FillScreen();
void* FaultDrawer_FormatStringFunc(void*, const char*, u32);
void FaultDrawer_VPrintf(const char*, char*);
void FaultDrawer_VPrintf(const char*, va_list);
void FaultDrawer_Printf(const char*, ...);
void FaultDrawer_DrawText(s32, s32, const char*, ...);
void FaultDrawer_SetDrawerFB(void*, u16, u16);

View file

@ -783,6 +783,8 @@ typedef struct {
/* 0x0E */ u8 ttl; // duration after which the DMA can be discarded
} SampleDma; // size = 0x10
#include <PR/ultra64/abi.h>
typedef struct {
/* 0x0000 */ char unk_0000;
/* 0x0001 */ s8 numSynthesisReverbs;

View file

@ -44,11 +44,6 @@ void BootCommands_ParseBootArgs(s32 argc, char** argv)
}
}
}
for (i = 0; i < argc; i++)
DebugArena_Free(argv[i]);
//DebugArena_Free(argv);
}
/*

View file

@ -8,6 +8,7 @@
#include <map>
#include <string>
#include <Cvar.h>
#include <PR/ultra64/types.h>
/**
* Colors variables
@ -93,10 +94,10 @@ const char* RainbowColorCvarList[] = {
"gCCRupeePrim", "gCCKeysPrim", "gDog1Col", "gDog2Col", "gCCVSOAPrim",
"gKeese1_Ef_Prim","gKeese2_Ef_Prim","gKeese1_Ef_Env","gKeese2_Ef_Env",
"gDF_Col", "gDF_Env",
"gNL_Diamond_Col", "gNL_Diamond_Env", "gNL_Orb_Col", "gNL_Orb_Env",
"gNL_Diamond_Col", "gNL_Diamond_Env", "gNL_Orb_Col", "gNL_Orb_Env",
"gTrailCol", "gCharged1Col", "gCharged1ColEnv", "gCharged2Col", "gCharged2ColEnv",
"gCCFileChoosePrim", "gCCFileChooseTextPrim", "gCCEquipmentsPrim", "gCCItemsPrim",
"gCCMapsPrim", "gCCQuestsPrim", "gCCSavePrim", "gCCGameoverPrim",
"gCCMapsPrim", "gCCQuestsPrim", "gCCSavePrim", "gCCGameoverPrim",
};
const char* MarginCvarList[] {
"gHearts", "gMagicBar", "gVSOA", "gBBtn", "gABtn", "gStartBtn",

View file

@ -10,6 +10,7 @@
#define NOGDI
#define WIN32_LEAN_AND_MEAN
#include <GlobalCtx2.h>
#include <PR/ultra64/types.h>
#define TICKS_PER_SEC 268123480.0

View file

@ -300,7 +300,7 @@ static void WriteLocation(
// node->SetAttribute("price", price);
// }
// if (!location->IsAddedToPool()) {
// #ifdef ENABLE_DEBUG
// #ifdef ENABLE_DEBUG
// node->SetAttribute("not-added", true);
// #endif
// }
@ -673,7 +673,7 @@ static void WriteHints(int language) {
static void WriteAllLocations(int language) {
for (const uint32_t key : allLocations) {
ItemLocation* location = Location(key);
switch (language) {
case 0:
default:
@ -725,7 +725,7 @@ const char* SpoilerLog_Write(int language) {
WriteHints(language);
//WriteShuffledEntrances(spoilerLog);
WriteAllLocations(language);
if (!std::filesystem::exists(Ship::GlobalCtx2::GetPathRelativeToAppDirectory("Randomizer"))) {
std::filesystem::create_directory(Ship::GlobalCtx2::GetPathRelativeToAppDirectory("Randomizer"));
}

View file

@ -51,6 +51,10 @@
#include <SDL2/SDL_scancode.h>
#endif
#ifdef __SWITCH__
#include "SwitchImpl.h"
#endif
#include <Audio.h>
OTRGlobals* OTRGlobals::Instance;
@ -105,6 +109,9 @@ extern "C" void OTRExtScanner() {
}
extern "C" void InitOTR() {
#ifdef __SWITCH__
Ship::Switch::Init(Ship::PreInitPhase);
#endif
OTRGlobals::Instance = new OTRGlobals();
SaveManager::Instance = new SaveManager();
CustomMessage::Instance = new CustomMessage();
@ -227,6 +234,7 @@ extern "C" void Graph_StartFrame() {
// C->C++ Bridge
extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
#ifndef __SWITCH__
if (!audio.initialized) {
audio.initialized = true;
std::thread([]() {
@ -253,19 +261,16 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
#define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 )
#define NUM_AUDIO_CHANNELS 2
int samples_left = AudioPlayer_Buffered();
u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW;
// printf("Audio samples: %d %u\n", samples_left, num_audio_samples);
// 3 is the maximum authentic frame divisor.
s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3];
for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) {
AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples);
}
//for (uint32_t i = 0; i < 2 * num_audio_samples; i++) {
// audio_buffer[i] = Rand_Next() & 0xFF;
//}
// printf("Audio samples before submitting: %d\n", audio_api->buffered());
AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE));
audio.processing = false;
@ -278,8 +283,9 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
std::unique_lock<std::mutex> Lock(audio.mutex);
audio.processing = true;
}
audio.cv_to_thread.notify_one();
#endif
audio.cv_to_thread.notify_one();
std::vector<std::unordered_map<Mtx*, MtxF>> mtx_replacements;
int target_fps = CVar_GetS32("gInterpolationFPS", 20);
static int last_fps;
@ -320,12 +326,14 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
last_fps = fps;
last_update_rate = R_UPDATE_RATE;
#ifndef __SWITCH__
{
std::unique_lock<std::mutex> Lock(audio.mutex);
while (audio.processing) {
audio.cv_from_thread.wait(Lock);
}
}
#endif
// OTRTODO: FIGURE OUT END FRAME POINT
/* if (OTRGlobals::Instance->context->GetWindow()->lastScancode != -1)
@ -1428,7 +1436,7 @@ extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBuff
price = 40;
break;
}
switch (language) {
switch (language) {
case 0: default:
scrubText += 0x12; // add the sound
scrubText += 0x38; // sound id
@ -1483,7 +1491,7 @@ extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBuff
scrubText += 0xA3; // message id
break;
}
return CopyStringToCharBuffer(scrubText, buffer, maxBufferSize);
}

View file

@ -49,6 +49,8 @@ SaveManager::SaveManager() {
}
void SaveManager::LoadRandomizerVersion1() {
if(!CVar_GetS32("gRandomizer", 0)) return;
for (int i = 0; i < ARRAY_COUNT(gSaveContext.itemLocations); i++) {
SaveManager::Instance->LoadData("get" + std::to_string(i), gSaveContext.itemLocations[i].get);
SaveManager::Instance->LoadData("check" + std::to_string(i), gSaveContext.itemLocations[i].check);
@ -88,6 +90,9 @@ void SaveManager::LoadRandomizerVersion1() {
}
void SaveManager::SaveRandomizer() {
if(!gSaveContext.n64ddFlag) return;
for (int i = 0; i < ARRAY_COUNT(gSaveContext.itemLocations); i++) {
SaveManager::Instance->SaveData("get" + std::to_string(i), gSaveContext.itemLocations[i].get);
SaveManager::Instance->SaveData("check" + std::to_string(i), gSaveContext.itemLocations[i].check);
@ -170,7 +175,7 @@ void SaveManager::Init() {
} else {
CreateDefaultGlobal();
}
// Load files to initialize metadata
for (int fileNum = 0; fileNum < MaxFiles; fileNum++) {
if (std::filesystem::exists(GetFileName(fileNum))) {
@ -906,7 +911,7 @@ void SaveManager::LoadArray(const std::string& name, const size_t size, LoadArra
}
currentJsonContext = saveJsonContext;
}
void SaveManager::LoadStruct(const std::string& name, LoadStructFunc func) {
// Create an empty struct and set it as the current load context, then call the function that loads the struct.

View file

@ -1,5 +1,6 @@
#include "global.h"
#ifndef __SWITCH__
void __assert(const char* exp, const char* file, s32 line) {
char msg[256];
@ -7,3 +8,4 @@ void __assert(const char* exp, const char* file, s32 line) {
sprintf(msg, "ASSERT: %s:%d(%d)", file, line, osGetThreadId(NULL));
Fault_AddHungupAndCrashImpl(msg, exp);
}
#endif

View file

@ -265,16 +265,14 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, u32 count) {
return arg;
}
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
void FaultDrawer_VPrintf(const char* str, va_list args) { // va_list
_Printf(FaultDrawer_FormatStringFunc, (char*)&sFaultDrawerStruct, str, args);
}
void FaultDrawer_Printf(const char* fmt, ...) {
va_list args;
va_start(args, fmt);
FaultDrawer_VPrintf(fmt, args);
va_end(args);
}
@ -284,7 +282,6 @@ void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...) {
FaultDrawer_SetCursor(x, y);
FaultDrawer_VPrintf(fmt, args);
va_end(args);
}

View file

@ -481,6 +481,22 @@ static void RunFrame()
uint64_t ticksA, ticksB;
ticksA = GetPerfCounter();
#ifdef __SWITCH__
#define SAMPLES_HIGH 752
#define SAMPLES_LOW 720
#define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 )
#define NUM_AUDIO_CHANNELS 2
int samples_left = AudioPlayer_Buffered();
u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW;
s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3];
for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) {
AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples);
}
AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE));
#endif
Graph_StartFrame();
// TODO: Workaround for rumble being too long. Implement os thread functions.

View file

@ -41,8 +41,6 @@ void main(int argc, char** argv)
GameConsole_Init();
InitOTR();
BootCommands_Init();
BootCommands_ParseBootArgs(argc - 1, (char**)&argv[1]);
Main(0);
}

View file

@ -996,6 +996,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->actor.shape.shadowScale = 0.3f;
this->actor.world.rot.x = 0x4000;
GetItem_Draw(globalCtx, GID_RUPEE_PURPLE);
break;
} else {
Actor_SetScale(&this->actor, 0.03f);
this->actor.shape.shadowScale = 6.0f;
@ -1231,27 +1232,40 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16
case GI_PRELUDE_OF_LIGHT:
color_slot = 5;
break;
case GI_STICK_UPGRADE_20:
case GI_STICK_UPGRADE_30:
color_slot = 6;
break;
case GI_NUT_UPGRADE_30:
case GI_NUT_UPGRADE_40:
color_slot = 7;
break;
}
s16* colors[7][3] = {
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
{ 177, 35, 35 }, // Bolero and Double Defense Colors
{ 115, 251, 253 }, // Serenade Color
{ 177, 122, 35 }, // Requiem Color
{ 177, 28, 212 }, // Nocturne Color
{ 255, 255, 92 }, // Prelude Color
{ 255, 255, 255} // White Color placeholder
s16* colors[9][3] = {
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
{ 177, 35, 35 }, // Bolero and Double Defense Colors
{ 115, 251, 253 }, // Serenade Color
{ 177, 122, 35 }, // Requiem Color
{ 177, 28, 212 }, // Nocturne Color
{ 255, 255, 92 }, // Prelude Color
{ 31, 152, 49 }, // Stick Upgrade Color
{ 222, 182, 20 }, // Nut Upgrade Color
{ 255, 255, 255 } // White Color placeholder
};
s16* colorsEnv[7][3] = {
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
{ 90, 10, 10 }, // Bolero and Double Defense Colors
{ 35, 35, 177 }, // Serenade Color
{ 70, 20, 10 }, // Requiem Color
{ 100, 20, 140 }, // Nocturne Color
{ 100, 100, 10 }, // Prelude Color
{ 154, 154, 154 } // White Color placeholder
s16* colorsEnv[9][3] = {
{ 30, 110, 30 }, // Minuet and Magic Upgrades Colors
{ 90, 10, 10 }, // Bolero and Double Defense Colors
{ 35, 35, 177 }, // Serenade Color
{ 70, 20, 10 }, // Requiem Color
{ 100, 20, 140 }, // Nocturne Color
{ 100, 100, 10 }, // Prelude Color
{ 5, 50, 10 }, // Stick Upgrade Color
{ 150, 100, 5 }, // Nut Upgrade Color
{ 154, 154, 154 } // White Color placeholder
};
static Vec3f velocity = { 0.0f, 0.2f, 0.0f };
static Vec3f accel = { 0.0f, 0.05f, 0.0f };
Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 };
@ -1304,7 +1318,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));
@ -1364,7 +1379,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
f32 mtxScale = 16.0f;
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));

View file

@ -111,7 +111,7 @@ void Message_ResetOcarinaNoteState(void) {
sOcarinaNoteCEnvR = 10;
sOcarinaNoteCEnvG = 10;
sOcarinaNoteCEnvB = 10;
if (CVar_GetS32("gHudColors", 1) == 0) {
if (CVar_GetS32("gHudColors", 1) == 0) {
sOcarinaNoteAPrimR = 80;
sOcarinaNoteAPrimG = 150;
sOcarinaNoteAPrimB = 255;
@ -240,8 +240,6 @@ void Message_DrawTextChar(GlobalContext* globalCtx, void* textureImage, Gfx** p)
s16 x = msgCtx->textPosX;
s16 y = msgCtx->textPosY;
gSPInvalidateTexCache(gfx++, textureImage);
gDPPipeSync(gfx++);
sCharTexSize = (R_TEXT_CHAR_SCALE / 100.0f) * 16.0f;
@ -1229,6 +1227,8 @@ void Message_Decode(GlobalContext* globalCtx) {
MessageContext* msgCtx = &globalCtx->msgCtx;
Font* font = &globalCtx->msgCtx.font;
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
globalCtx->msgCtx.textDelayTimer = 0;
globalCtx->msgCtx.textUnskippable = globalCtx->msgCtx.textDelay = globalCtx->msgCtx.textDelayTimer = 0;
sTextFade = false;
@ -1624,6 +1624,7 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
}
sMessageHasSetSfx = D_8014B2F4 = sTextboxSkipped = sTextIsCredits = 0;
gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, NULL);
if (textId >= 0x0500 && textId < 0x0600) { // text ids 0500 to 0600 are reserved for credits
sTextIsCredits = true;
@ -1731,7 +1732,7 @@ void Message_StartTextbox(GlobalContext* globalCtx, u16 textId, Actor* actor) {
// so we need to switch the order of these lines
if (gSaveContext.n64ddFlag && textId == 0x2053) {
msgCtx->talkActor = actor;
Message_OpenText(globalCtx, textId);
Message_OpenText(globalCtx, textId);
} else {
Message_OpenText(globalCtx, textId);
msgCtx->talkActor = actor;
@ -2052,7 +2053,7 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
if(CBtnB_2 > 255){CBtnB_2=255;};
s16 sOcarinaNoteCPrimColors_CUSTOM[][3] = {
{ CBtnR, CBtnG, CBtnB }, //Unified
{ CBtnR_2, CBtnG_2, CBtnB_2 },
{ CBtnR_2, CBtnG_2, CBtnB_2 },
{ CBtnRL, CBtnGL, CBtnBL }, //Left
{ CBtnRD, CBtnGD, CBtnBD }, //Down
{ CBtnRR, CBtnGR, CBtnBR }, //Right
@ -2642,15 +2643,15 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
Message_ContinueTextbox(globalCtx, msgCtx->lastPlayedSong + 0x893); // You played [song name]
Message_Decode(globalCtx);
msgCtx->msgMode = MSGMODE_DISPLAY_SONG_PLAYED_TEXT;
if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 || globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_TIME
if (CVar_GetS32("gFastOcarinaPlayback", 0) == 0 || globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_TIME
|| globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_STORMS ||
globalCtx->msgCtx.lastPlayedSong == OCARINA_SONG_SUNS) {
msgCtx->stateTimer = 20;
} else {
msgCtx->stateTimer = 1;
}
Message_DrawText(globalCtx, &gfx);
break;
case MSGMODE_DISPLAY_SONG_PLAYED_TEXT:

View file

@ -763,7 +763,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
color->r = CVar_GetS32("gTunic_Zora_R", sTunicColors[PLAYER_TUNIC_ZORA].r);
color->g = CVar_GetS32("gTunic_Zora_G", sTunicColors[PLAYER_TUNIC_ZORA].g);
color->b = CVar_GetS32("gTunic_Zora_B", sTunicColors[PLAYER_TUNIC_ZORA].b);
} else if (!CVar_GetS32("gUseTunicsCol",0)){
} else if (!CVar_GetS32("gUseTunicsCol",0)) {
if (tunic >= 3) {
color->r = sOriginalTunicColors[0].r;
color->g = sOriginalTunicColors[0].g;
@ -1712,7 +1712,6 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
// Link is idle so revert to 0
EquipedStance = 0;
}
if (SelectedMode == 16) {
// Apply Random function
s16 SwitchAtFrame = 0;
@ -1749,6 +1748,89 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime,
anim = PauseMenuAnimSet[SelectedAnim][EquipedStance];
}
FrameCountSinceLastAnim++;
} else if (SelectedMode == 17) {
// Apply Random function
s16 SwitchAtFrame = 0;
s16 CurAnimDuration = 0;
s16 LastAnim;
if (FrameCountSinceLastAnim == 0) {
// When opening Kaleido this will be passed one time
SelectedAnim = (rand() % (6 - 1 + 1)) + 1;
if (SelectedAnim == 0) {
// prevent loading 0 that would result to a crash.
SelectedAnim = 1;
}
} else if (FrameCountSinceLastAnim >= 1) {
SwitchAtFrame = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]);
CurAnimDuration = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]);
if (SwitchAtFrame < MinFrameCount) {
// Animation frame count is lower than minimal wait time then we wait for another round.
// This will be looped to always add current animation time if that still lower than minimum time
while (SwitchAtFrame < MinFrameCount) {
SwitchAtFrame = SwitchAtFrame + CurAnimDuration;
}
} else if (CurAnimDuration >= MinFrameCount) {
// Since we have more (or same) animation time than min duration we set the wait time to animation
// time.
SwitchAtFrame = CurAnimDuration;
}
if (FrameCountSinceLastAnim >= SwitchAtFrame) {
LastAnim = SelectedAnim;
if (LastAnim==1) {
if ((CUR_EQUIP_VALUE(EQUIP_SWORD)!=PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!= PLAYER_SHIELD_NONE)) { // if the player has a sword and shield equipped
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) { // if he's an adult or a kid with the deku shield
SelectedAnim = (rand() % (6 - 2 + 1)) + 2; // select any 5 animations that aren't the default standing anim
} else { //else if he's a child with a shield that isn't the deku shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) != PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has a sword equipped but no shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!=PLAYER_SHIELD_NONE)) { //if the player has a shield equipped but no sword
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) {// if he's an adult or a kid with the deku shield
s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations
if (randval==5) { //if its the sword anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
} else {
s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has no sword or shield equipped
s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations
if (randval==4) { //if its the shield anim
SelectedAnim==6; // set to yawn anim
} else {
SelectedAnim=randval;
}
}
} else {
SelectedAnim = 1;
}
if (SelectedAnim == 0) {
// prevent loading 0 that would result to a crash. Also makes sure default idle is every other anim
SelectedAnim = 1;
}
FrameCountSinceLastAnim = 1;
}
anim = PauseMenuAnimSet[SelectedAnim][EquipedStance];
}
FrameCountSinceLastAnim++;
} else if (SelectedMode == 15) {
// When opening Kaleido this will be passed one time
if (FrameCountSinceLastAnim < 1) {

View file

@ -53,6 +53,7 @@ void BossMo_UpdateCore(Actor* thisx, GlobalContext* globalCtx);
void BossMo_UpdateTent(Actor* thisx, GlobalContext* globalCtx);
void BossMo_DrawCore(Actor* thisx, GlobalContext* globalCtx);
void BossMo_DrawTent(Actor* thisx, GlobalContext* globalCtx);
void BossMo_Reset(void);
void BossMo_UpdateEffects(BossMo* this, GlobalContext* globalCtx);
void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx);
@ -131,7 +132,7 @@ const ActorInit Boss_Mo_InitVars = {
(ActorFunc)BossMo_Destroy,
(ActorFunc)BossMo_UpdateTent,
(ActorFunc)BossMo_DrawTent,
NULL,
(ActorResetFunc)BossMo_Reset,
};
static BossMo* sMorphaCore = NULL;

View file

@ -520,7 +520,8 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) {
break;
}
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
}
@ -534,7 +535,8 @@ void EnExItem_DrawHeartPiece(EnExItem* this, GlobalContext* globalCtx) {
if (gSaveContext.n64ddFlag) {
s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck(
RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));

View file

@ -139,7 +139,9 @@ typedef enum {
/* 9 */ ENGO2_ANIM_9,
/* 10 */ ENGO2_ANIM_10,
/* 11 */ ENGO2_ANIM_11,
/* 12 */ ENGO2_ANIM_12
/* 12 */ ENGO2_ANIM_12,
/* 13 */ ENGO2_ANIM_13, // Fixed Goron Wakeup Animation
/* 14 */ ENGO2_ANIM_14 // Fixed Biggoron Wakeup Animation
} EnGo2Animation;
static AnimationInfo sAnimationInfo[] = {
@ -149,7 +151,8 @@ static AnimationInfo sAnimationInfo[] = {
{ &gGoronAnim_002D80, 1.0f, 0.0f, -1.0f, 0x02, -8.0f }, { &gGoronAnim_00161C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
{ &gGoronAnim_001A00, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_0021D0, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
{ &gGoronAnim_004930, 0.0f, 0.0f, -1.0f, 0x01, -8.0f }, { &gGoronAnim_000750, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
{ &gGoronAnim_000D5C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
{ &gGoronAnim_000D5C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_004930, 0.0f, 0.0f, -1.0f, 0x00, 0.0f },
{ &gGoronAnim_004930, 0.0f, 1.0f, -1.0f, 0x01, 0.0f },
};
static EnGo2DustEffectData sDustEffectData[2][4] = {
@ -1341,10 +1344,10 @@ void EnGo2_WakeUp(EnGo2* this, GlobalContext* globalCtx) {
}
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
OnePointCutscene_Init(globalCtx, 4200, -99, &this->actor, MAIN_CAM);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ((CVar_GetS32("gGoronSpeen", 0) == 1) ? ENGO2_ANIM_10 : ENGO2_ANIM_14));
this->skelAnime.playSpeed = 0.5f;
} else {
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_1);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ((CVar_GetS32("gGoronSpeen", 0) == 1) ? ENGO2_ANIM_1 : ENGO2_ANIM_13));
this->skelAnime.playSpeed = 1.0f;
}
this->actionFunc = func_80A46B40;

View file

@ -230,7 +230,8 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) {
if(gSaveContext.n64ddFlag && globalCtx->sceneNum == 16) {
s32 randoGetItemId = GetChestGameRandoGetItemId(this->actor.room, this->giDrawId, globalCtx);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
if (randoGetItemId != GI_NONE) {
@ -255,7 +256,8 @@ void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) {
randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO);
}
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}

View file

@ -215,7 +215,8 @@ void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (gSaveContext.n64ddFlag) {
s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT);
if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) {
if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) ||
(randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) {
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId);
}
GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId));

View file

@ -924,7 +924,7 @@ void FileChoose_DrawOptionsImpl(GameState* thisx) {
gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language],
gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
gOptionsMenuSettings[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0);
}
@ -948,7 +948,7 @@ void FileChoose_DrawOptionsImpl(GameState* thisx) {
gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA,
G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language],
gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
gOptionsMenuSettings[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0);
}

View file

@ -333,6 +333,7 @@ void Title_Init(GameState* thisx) {
} else {
quote = SetQuote();
this->staticSegment = NULL;
//this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size);
osSyncPrintf("z_title.c\n");
//ASSERT(this->staticSegment != NULL);

View file

@ -98,9 +98,11 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) {
f32 scale;
Input* input = &globalCtx->state.input[0];
s16 RotationSpeed = 150 * CVar_GetS32("gPauseLiveLinkRotationSpeed", 0);
u8 AllowStickRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 3) ? true : false;
u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? true : false;
u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? true : false;
if (LINK_AGE_IN_YEARS == YEARS_CHILD) {
pos.x = 2.0f;
pos.y = -130.0f;
@ -120,22 +122,32 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) {
link_kaleido_rot.x = link_kaleido_rot.z = 0;
if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) ||
if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) || // rotate
(AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CLEFT))) {
link_kaleido_rot.y = link_kaleido_rot.y - RotationSpeed;
} else if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) ||
(AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CRIGHT))) {
link_kaleido_rot.y = link_kaleido_rot.y + RotationSpeed;
} else if(AllowStickRotation && input->cur.cam_x != 0){
link_kaleido_rot.y = link_kaleido_rot.y + (input->cur.cam_x*(((f32)RotationSpeed)/600.0f));
}
if ((AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP)) ||
if ((AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP)) || // reset rotation
(AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) {
link_kaleido_rot.y = 32300;
} else if ((AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CUP)) ||
(AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CDOWN))) {
link_kaleido_rot.y = 32300;
} else if (AllowStickRotation && input->cur.cam_y < -1200) {
link_kaleido_rot.y = 32300;
}
if (AllowStickRotation && input->cur.cam_y>0) { // Zoom in
scale = scale + input->cur.cam_y*.00005;
pos.y = pos.y - input->cur.cam_y*.25;
}
link_kaleido_rot.x = 0;
extern int fbTest;

View file

@ -1823,7 +1823,7 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
POLY_KAL_DISP = KaleidoScope_QuadTextureIA4(POLY_KAL_DISP, pauseCtx->nameSegment, 128, 16, 0);
}
if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gDebugEnabled", 0) != 0) {
if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gSkulltulaDebugEnabled", 0) != 0) {
if (YREG(7) != 0) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", YREG(6), GET_GS_FLAGS(YREG(6)),

5
soh/switch/pathconf.c Normal file
View file

@ -0,0 +1,5 @@
#include <unistd.h>
long pathconf(const char *path, int name) {
return -1;
}