Merge branch 'develop' into ComboBox-Simplification

This commit is contained in:
Baoulettes 2022-05-29 18:02:21 +02:00 committed by GitHub
commit 14ca2ab377
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 1241 additions and 612 deletions

View File

@ -41,9 +41,9 @@ cp /usr/local/lib/libGLEW.a external
cd soh cd soh
# Extract the assets/Compile the exporter/Run the exporter # Extract the assets/Compile the exporter/Run the exporter
make setup -j$(nproc) OPTFLAGS=-O0 DEBUG=0 make setup -j$(nproc) OPTFLAGS=-O2 DEBUG=0
# Compile the code # Compile the code
make -j $(nproc) OPTFLAGS=-O0 DEBUG=0 make -j $(nproc) OPTFLAGS=-O2 DEBUG=0
``` ```
# Compatible Roms # Compatible Roms

View File

@ -12,13 +12,15 @@ The Ship does not include assets and as such requires a prior copy of the game t
4) Launch `soh.exe` 4) Launch `soh.exe`
### Supported Games ### Supported Games
Ocarina of Time Debug (not Master Quest) #### Ocarina of Time Debug (not Master Quest)
> Currently the recommended option
``` ```
Build team: `zelda@srd022j` Build team: `zelda@srd022j`
Build date: `03-02-21 00:49:18` (year-month-day) Build date: `03-02-21 00:49:18` (year-month-day)
sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099 sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099
``` ```
Ocarina of Time PAL GameCube #### Ocarina of Time PAL GameCube
> May lead to crashes and instability
``` ```
sha1: 0227d7c0074f2d0ac935631990da8ec5914597b4 sha1: 0227d7c0074f2d0ac935631990da8ec5914597b4
``` ```
@ -65,7 +67,7 @@ Refer to the [building instructions](BUILDING.md) to compile SoH.
- Affirm that `zapd.exe` exists in the `/assets/extractor` folder - Affirm that `zapd.exe` exists in the `/assets/extractor` folder
## Nightly Builds ## Nightly Builds
Nightly builds of Ship of Harkinian are available at [https://builds.shipofharkinian.com/job/SoH_Multibranch/job/develop] Nightly builds of Ship of Harkinian are available [here](https://builds.shipofharkinian.com/job/SoH_Multibranch/job/develop)
## The Harbour Masters Are... ## The Harbour Masters Are...

View File

@ -54,14 +54,12 @@ namespace Game {
} }
void InitSettings() { void InitSettings() {
ModInternal::registerHookListener({ AUDIO_INIT, [](HookEvent ev) { ModInternal::RegisterHook<ModInternal::AudioInit>(UpdateAudio);
UpdateAudio(); ModInternal::RegisterHook<ModInternal::GfxInit>([] {
}});
ModInternal::registerHookListener({ GFX_INIT, [](HookEvent ev) {
gfx_get_current_rendering_api()->set_texture_filter((FilteringMode) CVar_GetS32("gTextureFilter", THREE_POINT)); gfx_get_current_rendering_api()->set_texture_filter((FilteringMode) CVar_GetS32("gTextureFilter", THREE_POINT));
SohImGui::console->opened = CVar_GetS32("gConsoleEnabled", 0); SohImGui::console->opened = CVar_GetS32("gConsoleEnabled", 0);
UpdateAudio(); UpdateAudio();
}}); });
} }
void SetSeqPlayerVolume(SeqPlayers playerId, float volume) { void SetSeqPlayerVolume(SeqPlayers playerId, float volume) {

View File

@ -2710,9 +2710,7 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, co
//gfx_lookup_or_create_shader_program(precomp_shaders[i]); //gfx_lookup_or_create_shader_program(precomp_shaders[i]);
} }
ModInternal::bindHook(GFX_INIT); ModInternal::ExecuteHooks<ModInternal::GfxInit>();
ModInternal::initBindHook(0);
ModInternal::callBindHook(0);
} }
struct GfxRenderingAPI *gfx_get_current_rendering_api(void) { struct GfxRenderingAPI *gfx_get_current_rendering_api(void) {

View File

@ -5,121 +5,6 @@
#include <stdarg.h> #include <stdarg.h>
#include <iostream> #include <iostream>
std::map<std::string, std::vector<HookFunc>> listeners; void ModInternal_ExecuteAudioInitHooks() {
std::string hookName; ModInternal::ExecuteHooks<ModInternal::AudioInit>();
std::map<std::string, void*> initArgs;
std::map<std::string, void*> hookArgs;
/*
#############################
Module: Hook C++ Handle
#############################
*/
namespace ModInternal {
void registerHookListener(HookListener listener) {
listeners[listener.hookName].push_back(listener.callback);
}
bool handleHook(std::shared_ptr<HookCall> call) {
std::string hookName = std::string(call->name);
for (size_t l = 0; l < listeners[hookName].size(); l++) {
(listeners[hookName][l])(call);
}
return call->cancelled;
}
void bindHook(std::string name) {
hookName = name;
}
void initBindHook(int length, ...) {
if (length > 0) {
va_list args;
va_start(args, length);
for (int i = 0; i < length; i++) {
HookParameter currentParam = va_arg(args, struct HookParameter);
initArgs[currentParam.name] = currentParam.parameter;
}
va_end(args);
}
}
bool callBindHook(int length, ...) {
if (length > 0) {
va_list args;
va_start(args, length);
for (int i = 0; i < length; i++) {
HookParameter currentParam = va_arg(args, struct HookParameter);
hookArgs[currentParam.name] = currentParam.parameter;
}
va_end(args);
}
HookCall call = {
.name = hookName,
.baseArgs = initArgs,
.hookedArgs = hookArgs
};
const bool cancelled = handleHook(std::make_shared<HookCall>(call));
hookName = "";
initArgs.clear();
hookArgs.clear();
return cancelled;
}
}
/*
#############################
Module: Hook C Handle
#############################
*/
extern "C" {
void bind_hook(char* name) {
hookName = std::string(name);
}
void init_hook(int length, ...) {
if (length > 0) {
va_list args;
va_start(args, length);
for (int i = 0; i < length; i++) {
HookParameter currentParam = va_arg(args, struct HookParameter);
initArgs[currentParam.name] = currentParam.parameter;
}
va_end(args);
}
}
bool call_hook(int length, ...) {
if (length > 0) {
va_list args;
va_start(args, length);
for (int i = 0; i < length; i++) {
HookParameter currentParam = va_arg(args, struct HookParameter);
hookArgs[currentParam.name] = currentParam.parameter;
}
va_end(args);
}
HookCall call = {
.name = hookName,
.baseArgs = initArgs,
.hookedArgs = hookArgs
};
const bool cancelled = ModInternal::handleHook(std::make_shared<HookCall>(call));
hookName = "";
initArgs.clear();
hookArgs.clear();
return cancelled;
}
} }

View File

@ -1,80 +1,50 @@
#pragma once #pragma once
struct HookParameter {
const char* name;
void* parameter;
};
#define LOOKUP_TEXTURE "F3D::LookupCacheTexture"
#define GRAYOUT_TEXTURE "Kaleido::GrayOutTexture"
#define INVALIDATE_TEXTURE "GBI::gSPInvalidateTexCache"
#define CONTROLLER_READ "N64::ControllerRead"
#define AUDIO_INIT "AudioMgr::Init"
#define LOAD_TEXTURE "ResourceMgr::LoadTexByName"
#define UPDATE_VOLUME "AudioVolume::Bind"
#define IMGUI_API_INIT "ImGuiApiInit"
#define IMGUI_API_DRAW "ImGuiApiDraw"
#define WINDOW_API_INIT "WApiInit"
#define WINDOW_API_HANDLE_EVENTS "WApiHandleEvents"
#define WINDOW_API_START_FRAME "WApiStartFrame"
// Graphics API Hooks
#define GFX_PRE_START_FRAME "GFXApiPreStartFrame"
#define GFX_POST_START_FRAME "GFXApiPostStartFrame"
#define GFX_PRE_END_FRAME "GFXApiPreEndFrame"
#define GFX_POST_END_FRAME "GFXApiPostEndFrame"
#define GFX_ON_REZISE "GFXApiOnResize"
#define GFX_INIT "GFXApiInit"
#define GFX_SHUTDOWN "GFXApiShutdown"
// End
#ifdef __cplusplus #ifdef __cplusplus
#define HOOK_PARAMETER(name, ptr) HookParameter({ name, static_cast<void*>(ptr) })
#define BIND_HOOK(name, func) ModInternal::registerHookListener({ name, [this](HookEvent call) { func(call); }})
#define BIND_PTR(name, type) static_cast<type>(call->baseArgs[name])
#define BIND_VAR(name, type) *BIND_PTR(name, type)
#include <functional> #include <functional>
#include <string>
#include <map>
#include <memory>
struct HookCall { #include "UltraController.h"
std::string name;
std::map<std::string, void*> baseArgs;
std::map<std::string, void*> hookedArgs;
bool cancelled = false;
};
typedef std::shared_ptr<HookCall> HookEvent; #define DEFINE_HOOK(name, type) struct name { typedef std::function<type> fn; }
typedef std::function<void(HookEvent)> HookFunc;
struct HookListener {
std::string hookName;
HookFunc callback;
int priority = 0;
};
namespace ModInternal { namespace ModInternal {
void registerHookListener(HookListener listener);
void bindHook(std::string name); template <typename H>
void initBindHook(int length, ...); struct RegisteredHooks {
bool callBindHook(int length, ...); inline static std::vector<typename H::fn> functions;
};
template <typename H>
void RegisterHook(typename H::fn h) {
RegisteredHooks<H>::functions.push_back(h);
} }
#else template <typename H, typename... Args>
void ExecuteHooks(Args&&... args) {
for (auto& fn : RegisteredHooks<H>::functions) {
fn(std::forward<Args>(args)...);
}
}
void bind_hook(char* name); DEFINE_HOOK(ControllerRead, void(OSContPad* cont_pad));
void init_hook(int length, ...);
bool call_hook(int length, ...); DEFINE_HOOK(AudioInit, void());
DEFINE_HOOK(LoadTexture, void(const char* path, uint8_t** texture));
DEFINE_HOOK(GfxInit, void());
}
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
void ModInternal_ExecuteAudioInitHooks();
#ifdef __cplusplus
}
#endif

View File

@ -65,19 +65,28 @@ namespace SohImGui {
bool needs_save = false; bool needs_save = false;
std::vector<const char*> CustomTexts; std::vector<const char*> CustomTexts;
int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French
int SelectedHUD = CVar_GetS32("gHudColors", 1); //Default colors to Gamecube.
float hearts_colors[3] = {0,0,0};
float hearts_dd_colors[3] = {0,0,0};
float a_btn_colors[3] = {0,0,0};
float b_btn_colors[3] = {0,0,0};
float c_btn_colors[3] = {0,0,0};
float start_btn_colors[3] = {0,0,0};
float magic_border_colors[3] = {0,0,0};
float magic_remaining_colors[3] = {0,0,0};
float magic_use_colors[3] = {0,0,0};
float minimap_colors[3] = {0,0,0};
float rupee_colors[3] = {0,0,0};
float smolekey_colors[3] = {0,0,0};
float kokiri_col[3] = { 0.118f, 0.41f, 0.106f }; float kokiri_col[3] = { 0.118f, 0.41f, 0.106f };
float goron_col[3] = { 0.392f, 0.078f, 0.0f }; float goron_col[3] = { 0.392f, 0.078f, 0.0f };
float zora_col[3] = { 0.0f, 0.235f, 0.392f }; float zora_col[3] = { 0.0f, 0.235f, 0.392f };
float navi_idle_i_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_idle_i_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_idle_o_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_idle_o_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_npc_i_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_npc_i_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_npc_o_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_npc_o_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_enemy_i_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_enemy_i_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_enemy_o_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_enemy_o_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_prop_i_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_prop_i_col[3] = { 0.0f, 0.0f, 0.0f };
float navi_prop_o_col[3] = { 0.0f, 0.0f, 0.0f }; float navi_prop_o_col[3] = { 0.0f, 0.0f, 0.0f };
@ -104,50 +113,6 @@ namespace SohImGui {
break; break;
} }
// OTRTODO: This gameplay specific stuff should not be in libultraship. This needs to be moved to soh and use sTunicColors
kokiri_col[0] = 30 / 255.0f;
kokiri_col[1] = 105 / 255.0f;
kokiri_col[2] = 27 / 255.0f;
goron_col[0] = 100 / 255.0f;
goron_col[1] = 20 / 255.0f;
goron_col[2] = 0;
zora_col[0] = 0;
zora_col[1] = 60 / 255.0f;
zora_col[2] = 100 / 255.0f;
navi_idle_i_col[0] = 0;
navi_idle_i_col[1] = 0;
navi_idle_i_col[2] = 0;
navi_idle_o_col[0] = 0;
navi_idle_o_col[1] = 0;
navi_idle_o_col[2] = 0;
navi_npc_i_col[0] = 0;
navi_npc_i_col[1] = 0;
navi_npc_i_col[2] = 0;
navi_npc_o_col[0] = 0;
navi_npc_o_col[1] = 0;
navi_npc_o_col[2] = 0;
navi_enemy_i_col[0] = 0;
navi_enemy_i_col[1] = 0;
navi_enemy_i_col[2] = 0;
navi_enemy_o_col[0] = 0;
navi_enemy_o_col[1] = 0;
navi_enemy_o_col[2] = 0;
navi_prop_i_col[0] = 0;
navi_prop_i_col[1] = 0;
navi_prop_i_col[2] = 0;
navi_prop_o_col[0] = 0;
navi_prop_o_col[1] = 0;
navi_prop_o_col[2] = 0;
} }
void ImGuiBackendInit() { void ImGuiBackendInit() {
@ -275,6 +240,85 @@ namespace SohImGui {
stbi_image_free(img_data); stbi_image_free(img_data);
} }
void LoadInterfaceEditor(){//This function is necessary as without it IMGui wont load the updated float array.
hearts_colors[0] = (float)CVar_GetS32("gCCHeartsPrimR", 255)/255;
hearts_colors[1] = (float)CVar_GetS32("gCCHeartsPrimG", 70)/255;
hearts_colors[2] = (float)CVar_GetS32("gCCHeartsPrimB", 50)/255;
hearts_dd_colors[0] = (float)CVar_GetS32("gDDCCHeartsPrimR", 255)/255;
hearts_dd_colors[1] = (float)CVar_GetS32("gDDCCHeartsPrimG", 255)/255;
hearts_dd_colors[2] = (float)CVar_GetS32("gDDCCHeartsPrimB", 255)/255;
a_btn_colors[0] = (float)CVar_GetS32("gCCABtnPrimR", 90)/255;
a_btn_colors[1] = (float)CVar_GetS32("gCCABtnPrimG", 90)/255;
a_btn_colors[2] = (float)CVar_GetS32("gCCABtnPrimB", 255)/255;
b_btn_colors[0] = (float)CVar_GetS32("gCCBBtnPrimR", 0)/255;
b_btn_colors[1] = (float)CVar_GetS32("gCCBBtnPrimG", 150)/255;
b_btn_colors[2] = (float)CVar_GetS32("gCCBBtnPrimB", 0)/255;
c_btn_colors[0] = (float)CVar_GetS32("gCCCBtnPrimR", 255)/255;
c_btn_colors[1] = (float)CVar_GetS32("gCCCBtnPrimG", 160)/255;
c_btn_colors[2] = (float)CVar_GetS32("gCCCBtnPrimB", 0)/255;
start_btn_colors[0] = (float)CVar_GetS32("gCCStartBtnPrimR", 120)/255;
start_btn_colors[1] = (float)CVar_GetS32("gCCStartBtnPrimG", 120)/255;
start_btn_colors[2] = (float)CVar_GetS32("gCCStartBtnPrimB", 120)/255;
magic_border_colors[0] = (float)CVar_GetS32("gCCMagicBorderPrimR", 255)/255;
magic_border_colors[1] = (float)CVar_GetS32("gCCMagicBorderPrimG", 255)/255;
magic_border_colors[2] = (float)CVar_GetS32("gCCMagicBorderPrimB", 255)/255;
magic_use_colors[0] = (float)CVar_GetS32("gCCMagicPrimR", 250)/255;
magic_use_colors[1] = (float)CVar_GetS32("gCCMagicPrimG", 250)/255;
magic_use_colors[2] = (float)CVar_GetS32("gCCMagicPrimB", 0)/255;
magic_remaining_colors[0] = (float)CVar_GetS32("gCCMagicUsePrimR", 0)/255;
magic_remaining_colors[1] = (float)CVar_GetS32("gCCMagicUsePrimG", 200)/255;
magic_remaining_colors[2] = (float)CVar_GetS32("gCCMagicUsePrimB", 0)/255;
minimap_colors[0] = (float)CVar_GetS32("gCCMinimapPrimR", 0)/255;
minimap_colors[1] = (float)CVar_GetS32("gCCMinimapPrimG", 255)/255;
minimap_colors[2] = (float)CVar_GetS32("gCCMinimapPrimB", 255)/255;
rupee_colors[0] = (float)CVar_GetS32("gCCRupeePrimR", 200)/255;
rupee_colors[1] = (float)CVar_GetS32("gCCRupeePrimG", 255)/255;
rupee_colors[2] = (float)CVar_GetS32("gCCRupeePrimB", 100)/255;
smolekey_colors[0] = (float)CVar_GetS32("gCCKeysPrimR", 200)/255;
smolekey_colors[1] = (float)CVar_GetS32("gCCKeysPrimG", 230)/255;
smolekey_colors[2] = (float)CVar_GetS32("gCCKeysPrimB", 255)/255;
kokiri_col[0] = (float)CVar_GetS32("gTunic_Kokiri_R", 30)/255;
kokiri_col[1] = (float)CVar_GetS32("gTunic_Kokiri_G", 105)/255;
kokiri_col[2] = (float)CVar_GetS32("gTunic_Kokiri_B", 27)/255;
goron_col[0] = (float)CVar_GetS32("gTunic_Goron_R", 100)/255;
goron_col[1] = (float)CVar_GetS32("gTunic_Goron_G", 20)/255;
goron_col[2] = (float)CVar_GetS32("gTunic_Goron_B", 0)/255;
zora_col[0] = (float)CVar_GetS32("gTunic_Zora_R", 0)/255;
zora_col[1] = (float)CVar_GetS32("gTunic_Zora_G", 60)/255;
zora_col[2] = (float)CVar_GetS32("gTunic_Zora_B", 100)/255;
navi_idle_i_col[0] = (float)CVar_GetS32("gNavi_Idle_Inner_R", 255)/255;
navi_idle_i_col[1] = (float)CVar_GetS32("gNavi_Idle_Inner_G", 255)/255;
navi_idle_i_col[2] = (float)CVar_GetS32("gNavi_Idle_Inner_B", 255)/255;
navi_idle_o_col[0] = (float)CVar_GetS32("gNavi_Idle_Outer_R", 115)/255;
navi_idle_o_col[1] = (float)CVar_GetS32("gNavi_Idle_Outer_G", 230)/255;
navi_idle_o_col[2] = (float)CVar_GetS32("gNavi_Idle_Outer_B", 255)/255;
navi_npc_i_col[0] = (float)CVar_GetS32("gNavi_NPC_Inner_R", 100)/255;
navi_npc_i_col[1] = (float)CVar_GetS32("gNavi_NPC_Inner_G", 100)/255;
navi_npc_i_col[2] = (float)CVar_GetS32("gNavi_NPC_Inner_B", 255)/255;
navi_npc_o_col[0] = (float)CVar_GetS32("gNavi_NPC_Outer_R", 90)/255;
navi_npc_o_col[1] = (float)CVar_GetS32("gNavi_NPC_Outer_G", 90)/255;
navi_npc_o_col[2] = (float)CVar_GetS32("gNavi_NPC_Outer_B", 255)/255;
navi_enemy_i_col[0] = (float)CVar_GetS32("gNavi_Enemy_Inner_R", 255)/255;
navi_enemy_i_col[1] = (float)CVar_GetS32("gNavi_Enemy_Inner_G", 255)/255;
navi_enemy_i_col[2] = (float)CVar_GetS32("gNavi_Enemy_Inner_B", 0)/255;
navi_enemy_o_col[0] = (float)CVar_GetS32("gNavi_Enemy_Outer_R", 220)/255;
navi_enemy_o_col[1] = (float)CVar_GetS32("gNavi_Enemy_Outer_G", 220)/255;
navi_enemy_o_col[2] = (float)CVar_GetS32("gNavi_Enemy_Outer_B", 0)/255;
navi_prop_i_col[0] = (float)CVar_GetS32("gNavi_Prop_Inner_R", 0)/255;
navi_prop_i_col[1] = (float)CVar_GetS32("gNavi_Prop_Inner_G", 255)/255;
navi_prop_i_col[2] = (float)CVar_GetS32("gNavi_Prop_Inner_B", 0)/255;
navi_prop_o_col[0] = (float)CVar_GetS32("gNavi_Prop_Outer_R", 0)/255;
navi_prop_o_col[1] = (float)CVar_GetS32("gNavi_Prop_Outer_G", 220)/255;
navi_prop_o_col[2] = (float)CVar_GetS32("gNavi_Prop_Outer_B", 0)/255;
if (CVar_GetS32("gHudColors", 1) ==0) {
SelectedHUD = 0;
} else if (CVar_GetS32("gHudColors", 1) == 1) {
SelectedHUD = 1;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
SelectedHUD = 2;
}
}
void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint) { void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint) {
GfxRenderingAPI* api = gfx_get_current_rendering_api(); GfxRenderingAPI* api = gfx_get_current_rendering_api();
const auto res = static_cast<Ship::Texture*>(GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(path).get()); const auto res = static_cast<Ship::Texture*>(GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(path).get());
@ -304,10 +348,10 @@ namespace SohImGui {
} }
for (size_t pixel = 0; pixel < texBuffer.size() / 4; pixel++) { for (size_t pixel = 0; pixel < texBuffer.size() / 4; pixel++) {
texBuffer[pixel * 4 + 0] *= tint.x; texBuffer[pixel * 4 + 0] *= (uint8_t)tint.x;
texBuffer[pixel * 4 + 1] *= tint.y; texBuffer[pixel * 4 + 1] *= (uint8_t)tint.y;
texBuffer[pixel * 4 + 2] *= tint.z; texBuffer[pixel * 4 + 2] *= (uint8_t)tint.z;
texBuffer[pixel * 4 + 3] *= tint.w; texBuffer[pixel * 4 + 3] *= (uint8_t)tint.w;
} }
const auto asset = new GameAsset{ api->new_texture() }; const auto asset = new GameAsset{ api->new_texture() };
@ -327,6 +371,9 @@ namespace SohImGui {
io = &ImGui::GetIO(); io = &ImGui::GetIO();
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; io->ConfigFlags |= ImGuiConfigFlags_DockingEnable;
io->Fonts->AddFontDefault(); io->Fonts->AddFontDefault();
if (CVar_GetS32("gOpenMenuBar", 0) != 1) {
SohImGui::overlay->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu");
}
if (UseViewports()) { if (UseViewports()) {
io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
@ -336,8 +383,7 @@ namespace SohImGui {
ImGuiWMInit(); ImGuiWMInit();
ImGuiBackendInit(); ImGuiBackendInit();
ModInternal::registerHookListener({ GFX_INIT, [](const HookEvent ev) { ModInternal::RegisterHook<ModInternal::GfxInit>([] {
if (GlobalCtx2::GetInstance()->GetWindow()->IsFullscreen()) if (GlobalCtx2::GetInstance()->GetWindow()->IsFullscreen())
ShowCursor(CVar_GetS32("gOpenMenuBar", 0), Dialogues::dLoadSettings); ShowCursor(CVar_GetS32("gOpenMenuBar", 0), Dialogues::dLoadSettings);
@ -352,7 +398,7 @@ namespace SohImGui {
LoadTexture("C-Right", "assets/ship_of_harkinian/buttons/CRight.png"); LoadTexture("C-Right", "assets/ship_of_harkinian/buttons/CRight.png");
LoadTexture("C-Up", "assets/ship_of_harkinian/buttons/CUp.png"); LoadTexture("C-Up", "assets/ship_of_harkinian/buttons/CUp.png");
LoadTexture("C-Down", "assets/ship_of_harkinian/buttons/CDown.png"); LoadTexture("C-Down", "assets/ship_of_harkinian/buttons/CDown.png");
} }); });
for (const auto& [i, controllers] : Ship::Window::Controllers) for (const auto& [i, controllers] : Ship::Window::Controllers)
{ {
@ -361,9 +407,9 @@ namespace SohImGui {
needs_save = true; needs_save = true;
} }
ModInternal::registerHookListener({ CONTROLLER_READ, [](const HookEvent ev) { ModInternal::RegisterHook<ModInternal::ControllerRead>([](OSContPad* cont_pad) {
pads = static_cast<OSContPad*>(ev->baseArgs["cont_pad"]); pads = cont_pad;
} }); });
Game::InitSettings(); Game::InitSettings();
} }
@ -390,6 +436,7 @@ namespace SohImGui {
} }
} }
void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue = 0){ void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue = 0){
if (FirstTimeValue <= 0){ if (FirstTimeValue <= 0){
FirstTimeValue = 0; FirstTimeValue = 0;
@ -411,7 +458,7 @@ namespace SohImGui {
} }
} }
void EnhancementRadioButton(std::string text, std::string cvarName, int id) { void EnhancementRadioButton(const char* text, const char* cvarName, int id) {
/*Usage : /*Usage :
EnhancementRadioButton("My Visible Name","gMyCVarName", MyID); EnhancementRadioButton("My Visible Name","gMyCVarName", MyID);
First arg is the visible name of the Radio button First arg is the visible name of the Radio button
@ -422,120 +469,122 @@ namespace SohImGui {
EnhancementRadioButton("German", "gLanguages", 1); EnhancementRadioButton("German", "gLanguages", 1);
EnhancementRadioButton("French", "gLanguages", 2); EnhancementRadioButton("French", "gLanguages", 2);
*/ */
int val = CVar_GetS32(cvarName.c_str(), 0); int val = CVar_GetS32(cvarName, 0);
if (ImGui::RadioButton(text.c_str(), id == val)) { if (ImGui::RadioButton(text, id == val)) {
CVar_SetS32(cvarName.c_str(), (int)id); CVar_SetS32(cvarName, id);
needs_save = true; needs_save = true;
} }
} }
void EnhancementCheckbox(std::string text, std::string cvarName) void EnhancementCheckbox(const char* text, const char* cvarName)
{ {
bool val = (bool)CVar_GetS32(cvarName.c_str(), 0); bool val = (bool)CVar_GetS32(cvarName, 0);
if (ImGui::Checkbox(text.c_str(), &val)) { if (ImGui::Checkbox(text, &val)) {
CVar_SetS32(cvarName.c_str(), val); CVar_SetS32(cvarName, val);
needs_save = true; needs_save = true;
} }
} }
void EnhancementButton(std::string text, std::string cvarName) void EnhancementButton(const char* text, const char* cvarName)
{ {
bool val = (bool)CVar_GetS32(cvarName.c_str(), 0); bool val = (bool)CVar_GetS32(cvarName, 0);
if (ImGui::Button(text.c_str())) { if (ImGui::Button(text)) {
CVar_SetS32(cvarName.c_str(), !val); CVar_SetS32(cvarName, !val);
CVar_SetS32(cvarName, !val);
needs_save = true; needs_save = true;
} }
} }
void EnhancementSliderInt(std::string text, std::string id, std::string cvarName, int min, int max, std::string format) void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format)
{ {
int val = CVar_GetS32(cvarName.c_str(), 0); int val = CVar_GetS32(cvarName, 0);
ImGui::Text(text.c_str(), val); ImGui::Text(text, val);
if (ImGui::SliderInt(id.c_str(), &val, min, max, format.c_str())) if (ImGui::SliderInt(id, &val, min, max, format))
{ {
CVar_SetS32(cvarName.c_str(), val); CVar_SetS32(cvarName, val);
needs_save = true; needs_save = true;
} }
if (val < min) if (val < min)
{ {
val = min; val = min;
CVar_SetS32(cvarName.c_str(), val); CVar_SetS32(cvarName, val);
needs_save = true; needs_save = true;
} }
if (val > max) if (val > max)
{ {
val = max; val = max;
CVar_SetS32(cvarName.c_str(), val); CVar_SetS32(cvarName, val);
needs_save = true; needs_save = true;
} }
} }
void EnhancementSliderFloat(std::string text, std::string id, std::string cvarName, float min, float max, std::string format, float defaultValue, bool isPercentage) void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage)
{ {
float val = CVar_GetFloat(cvarName.c_str(), defaultValue); float val = CVar_GetFloat(cvarName, defaultValue);
if (!isPercentage) if (!isPercentage)
ImGui::Text(text.c_str(), val); ImGui::Text(text, val);
else else
ImGui::Text(text.c_str(), static_cast<int>(100 * val)); ImGui::Text(text, static_cast<int>(100 * val));
if (ImGui::SliderFloat(id.c_str(), &val, min, max, format.c_str())) if (ImGui::SliderFloat(id, &val, min, max, format))
{ {
CVar_SetFloat(cvarName.c_str(), val); CVar_SetFloat(cvarName, val);
needs_save = true; needs_save = true;
} }
if (val < min) if (val < min)
{ {
val = min; val = min;
CVar_SetFloat(cvarName.c_str(), val); CVar_SetFloat(cvarName, val);
needs_save = true; needs_save = true;
} }
if (val > max) if (val > max)
{ {
val = max; val = max;
CVar_SetFloat(cvarName.c_str(), val); CVar_SetFloat(cvarName, val);
needs_save = true; needs_save = true;
} }
} }
void EnhancementColor3(std::string text, std::string cvarName, float defaultColors[3]) int ClampFloatToInt(float value, int min, int max) {
{ return fmin(fmax(value, min), max);
int r = CVar_GetS32((cvarName + "_Red").c_str(), (defaultColors[0] * 255.0f)); }
int g = CVar_GetS32((cvarName + "_Green").c_str(), (defaultColors[1] * 255.0f));
int b = CVar_GetS32((cvarName + "_Blue").c_str(), (defaultColors[2] * 255.0f));
float colors[3]; void EnhancementColor3(const char* text, const char* cvarName, float ColorRGB[3], bool TitleSameLine) {
colors[0] = r / 255.0f; //Simplified.
colors[1] = g / 255.0f; std::string cvarNameString(cvarName);
colors[2] = b / 255.0f; ImGuiColorEditFlags flags = ImGuiColorEditFlags_None;
{ if (!TitleSameLine) {
if (ImGui::ColorEdit3(text.c_str(), colors)) ImGui::Text("%s", text);
{ flags = ImGuiColorEditFlags_NoLabel;
CVar_SetS32((cvarName + "_Red").c_str(), (int)(colors[0] * 255)); }
CVar_SetS32((cvarName + "_Green").c_str(), (int)(colors[1] * 255)); if (ImGui::ColorEdit3(text, ColorRGB, flags)) {
CVar_SetS32((cvarName + "_Blue").c_str(), (int)(colors[2] * 255)); CVar_SetS32((cvarNameString + "R").c_str(), ClampFloatToInt(ColorRGB[0] * 255, 0, 255));
CVar_SetS32((cvarNameString + "G").c_str(), ClampFloatToInt(ColorRGB[1] * 255, 0, 255));
CVar_SetS32((cvarNameString + "B").c_str(), ClampFloatToInt(ColorRGB[2] * 255, 0, 255));
needs_save = true; needs_save = true;
} }
} }
}
void Tooltip(std::string text) {
void Tooltip(const char* text) {
if (ImGui::IsItemHovered()) if (ImGui::IsItemHovered())
ImGui::SetTooltip("%s", text.c_str()); ImGui::SetTooltip("%s", text);
} }
void DrawMainMenuAndCalculateGameSize() { void DrawMainMenuAndCalculateGameSize(void) {
console->Update(); console->Update();
ImGuiBackendNewFrame(); ImGuiBackendNewFrame();
ImGuiWMNewFrame(); ImGuiWMNewFrame();
ImGui::NewFrame(); ImGui::NewFrame();
LoadInterfaceEditor();
const std::shared_ptr<Window> wnd = GlobalCtx2::GetInstance()->GetWindow(); const std::shared_ptr<Window> wnd = GlobalCtx2::GetInstance()->GetWindow();
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground |
@ -610,7 +659,7 @@ namespace SohImGui {
auto menuLabel = "Controller " + std::to_string(i + 1); auto menuLabel = "Controller " + std::to_string(i + 1);
if (ImGui::BeginMenu(menuLabel.c_str())) if (ImGui::BeginMenu(menuLabel.c_str()))
{ {
EnhancementSliderFloat("Gyro Sensitivity: %d %%", "##GYROSCOPE", StringHelper::Sprintf("gCont%i_GyroSensitivity", i), 0.0f, 1.0f, "", 1.0f, true); EnhancementSliderFloat("Gyro Sensitivity: %d %%", "##GYROSCOPE", StringHelper::Sprintf("gCont%i_GyroSensitivity", i).c_str(), 0.0f, 1.0f, "", 1.0f, true);
if (ImGui::Button("Recalibrate Gyro")) if (ImGui::Button("Recalibrate Gyro"))
{ {
@ -621,7 +670,7 @@ namespace SohImGui {
ImGui::Separator(); ImGui::Separator();
EnhancementSliderFloat("Rumble Strength: %d %%", "##RUMBLE", StringHelper::Sprintf("gCont%i_RumbleStrength", i), 0.0f, 1.0f, "", 1.0f, true); EnhancementSliderFloat("Rumble Strength: %d %%", "##RUMBLE", StringHelper::Sprintf("gCont%i_RumbleStrength", i).c_str(), 0.0f, 1.0f, "", 1.0f, true);
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -689,7 +738,10 @@ namespace SohImGui {
Tooltip("Allows equiping the tunic and boots to c-buttons"); Tooltip("Allows equiping the tunic and boots to c-buttons");
EnhancementCheckbox("MM Bunny Hood", "gMMBunnyHood"); EnhancementCheckbox("MM Bunny Hood", "gMMBunnyHood");
Tooltip("Wearing the Bunny Hood grants a speed increase like in Majora's Mask"); Tooltip("Wearing the Bunny Hood grants a speed increase like in Majora's Mask");
EnhancementCheckbox("Better Owl", "gBetterOwl");
Tooltip("The default response to Kaepora Gaebora is always that you understood what he said");
EnhancementCheckbox("Disable Navi Call Audio", "gDisableNaviCallAudio");
Tooltip("Disables the voice audio when Navi calls you");
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -715,6 +767,8 @@ namespace SohImGui {
Tooltip("Show dungeon entrances icon only when it should be"); Tooltip("Show dungeon entrances icon only when it should be");
EnhancementCheckbox("Fix Two Handed idle animations", "gTwoHandedIdle"); EnhancementCheckbox("Fix Two Handed idle animations", "gTwoHandedIdle");
Tooltip("Makes two handed idle animation play, a seemingly finished animation that was disabled on accident in the original game"); Tooltip("Makes two handed idle animation play, a seemingly finished animation that was disabled on accident in the original game");
EnhancementCheckbox("Fix Deku Nut upgrade", "gDekuNutUpgradeFix");
Tooltip("Prevents the Forest Stage Deku Nut upgrade from becoming unobtainable after receiving the Poacher's Saw");
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -728,27 +782,20 @@ namespace SohImGui {
ImGui::EndMenu(); ImGui::EndMenu();
} }
if (ImGui::BeginMenu("Cosmetics")) if (ImGui::BeginMenu("Cosmetics")) {
{ EnhancementCheckbox("Cosmetics editor", "gCosmticsEditor");
ImGui::Text("Tunics"); Tooltip("Edit Navi and Link's Tunics color.");
ImGui::Separator(); EnhancementCheckbox("HUD Margins editor", "gUseMargins");
EnhancementRadioButton("N64 interface", "gHudColors", 0);
EnhancementColor3("Kokiri Tunic", "gTunic_Kokiri", kokiri_col); Tooltip("Change interface color to N64 style.");
EnhancementColor3("Goron Tunic", "gTunic_Goron", goron_col); EnhancementRadioButton("Gamecube interface", "gHudColors", 1);
EnhancementColor3("Zora Tunic", "gTunic_Zora", zora_col); Tooltip("Change interface color to Gamecube style.");
EnhancementRadioButton("Custom interface", "gHudColors", 2);
ImGui::Text("Navi"); Tooltip("Change interface color to your own made style.");
ImGui::Separator(); if (CVar_GetS32("gHudColors", 1) == 2) {
EnhancementCheckbox("Interface editor", "gColorsEditor");
EnhancementColor3("Navi Idle Inner", "gNavi_Idle_Inner", navi_idle_i_col); Tooltip("Edit the colors used for your own interface");
EnhancementColor3("Navi Idle Outer", "gNavi_Idle_Outer", navi_idle_o_col); }
EnhancementColor3("Navi NPC Inner", "gNavi_NPC_Inner", navi_npc_i_col);
EnhancementColor3("Navi NPC Outer", "gNavi_NPC_Outer", navi_npc_o_col);
EnhancementColor3("Navi Enemy Inner", "gNavi_Enemy_Inner", navi_enemy_i_col);
EnhancementColor3("Navi Enemy Outer", "gNavi_Enemy_Outer", navi_enemy_o_col);
EnhancementColor3("Navi Prop Inner", "gNavi_Prop_Inner", navi_prop_i_col);
EnhancementColor3("Navi Prop Outer", "gNavi_Prop_Outer", navi_prop_o_col);
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -786,6 +833,11 @@ namespace SohImGui {
{ {
EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled"); EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled");
Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip with L + D-pad Right,\nand open the debug menu with L on the pause screen"); Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip with L + D-pad Right,\nand open the debug menu with L on the pause screen");
EnhancementCheckbox("Fast File Select", "gSkipLogoTitle");
Tooltip("Directly load the game to selected slot bellow\nUse slot number 4 to load directly in Zelda Map Select\n(Do not require debug menu but you will be unable to save there)\n(you can also load Zelda map select with Debug mod + slot 0).\nWith Slot : 0 you can go directly in File Select menu\nAttention, Loading an empty save will result in crash");
if (CVar_GetS32("gSkipLogoTitle",0)) {
EnhancementSliderInt("Loading %d", "##SaveFileID", "gSaveFileID", 0, 4, "");
}
ImGui::Separator(); ImGui::Separator();
EnhancementCheckbox("Stats", "gStatsEnabled"); EnhancementCheckbox("Stats", "gStatsEnabled");
Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on"); Tooltip("Shows the stats window, with your FPS and frametimes, and the OS you're playing on");
@ -796,6 +848,126 @@ namespace SohImGui {
ImGui::EndMenu(); ImGui::EndMenu();
} }
bool Margins_isOpen = CVar_GetS32("gUseMargins", 0);
bool Cosmetics_isOpen = CVar_GetS32("gCosmticsEditor", 0);
bool Interface_isOpen = CVar_GetS32("gColorsEditor", 0);
if (Margins_isOpen) {
if (!Margins_isOpen) {
return;
}
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::Begin("Margins Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Margins Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Interface margins")) {
EnhancementCheckbox("Use margins", "gHUDMargins");
Tooltip("Enable/Disable custom margins. \nIf disabled you will have original margins");
EnhancementSliderInt("Top : %dx", "##UIMARGINT", "gHUDMargin_T", -20, 20, "");
EnhancementSliderInt("Left: %dx", "##UIMARGINL", "gHUDMargin_L", -25, 25, "");
EnhancementSliderInt("Right: %dx", "##UIMARGINR", "gHUDMargin_R", -25, 25, "");
EnhancementSliderInt("Bottom: %dx", "##UIMARGINB", "gHUDMargin_B", -20, 20, "");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::PopStyleColor();
ImGui::End();
}
if (Cosmetics_isOpen) {
if (!Cosmetics_isOpen) {
return;
}
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::Begin("Cosmetics Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Cosmetics Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Navi")) {
EnhancementCheckbox("Custom colors for Navi", "gUseNaviCol");
Tooltip("Enable/Disable custom Navi's colors. \nIf disabled you will have original colors for Navi.\nColors are refreshed when Navi goes back in your pockets");
EnhancementColor3("Navi Idle Inner", "gNavi_Idle_Inner_", navi_idle_i_col, false);
Tooltip("Inner color for Navi (idle flying around)");
EnhancementColor3("Navi Idle Outer", "gNavi_Idle_Outer_", navi_idle_o_col, false);
Tooltip("Outer color for Navi (idle flying around)");
ImGui::Separator();
EnhancementColor3("Navi NPC Inner", "gNavi_NPC_Inner_", navi_npc_i_col, false);
Tooltip("Inner color for Navi (when Navi fly around NPCs)");
EnhancementColor3("Navi NPC Outer", "gNavi_NPC_Outer_", navi_npc_o_col, false);
Tooltip("Outer color for Navi (when Navi fly around NPCs)");
ImGui::Separator();
EnhancementColor3("Navi Enemy Inner", "gNavi_Enemy_Inner_", navi_enemy_i_col, false);
Tooltip("Inner color for Navi (when Navi fly around Enemies or Bosses)");
EnhancementColor3("Navi Enemy Outer", "gNavi_Enemy_Outer_", navi_enemy_o_col, false);
Tooltip("Outer color for Navi (when Navi fly around Enemies or Bosses)");
ImGui::Separator();
EnhancementColor3("Navi Prop Inner", "gNavi_Prop_Inner_", navi_prop_i_col, false);
Tooltip("Inner color for Navi (when Navi fly around props (signs etc))");
EnhancementColor3("Navi Prop Outer", "gNavi_Prop_Outer_", navi_prop_o_col, false);
Tooltip("Outer color for Navi (when Navi fly around props (signs etc))");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Tunics")) {
EnhancementCheckbox("Custom colors on tunics", "gUseTunicsCol");
Tooltip("Enable/Disable custom Link's tunics colors. \nIf disabled you will have original colors for Link's tunics");
EnhancementColor3("Kokiri Tunic", "gTunic_Kokiri_", kokiri_col, false);
ImGui::Separator();
EnhancementColor3("Goron Tunic", "gTunic_Goron_", goron_col, false);
ImGui::Separator();
EnhancementColor3("Zora Tunic", "gTunic_Zora_", zora_col, false);
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::PopStyleColor();
ImGui::End();
}
if (Interface_isOpen) {
if (!Interface_isOpen) {
return;
}
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0));
ImGui::Begin("Interface Editor", nullptr, ImGuiWindowFlags_NoFocusOnAppearing);
if (ImGui::BeginTabBar("Interface Editor", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) {
if (ImGui::BeginTabItem("Hearts")) {
EnhancementColor3("Hearts inner", "gCCHeartsPrim", hearts_colors, false);
Tooltip("Hearts inner color (red in original)\nAffect both Normal Hearts and the ones in Double Defense");
EnhancementColor3("Hearts double def", "gDDCCHeartsPrim", hearts_dd_colors, false);
Tooltip("Hearts outline color (white in original)\nAffect Double Defense outline only");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Buttons")) {
EnhancementColor3("A Buttons", "gCCABtnPrim", a_btn_colors, false);
Tooltip("A Buttons colors (Green in original Gamecube)\nAffect A buttons colors on interface, in shops, messages boxes, ocarina notes and inventory cursors");
EnhancementColor3("B Buttons", "gCCBBtnPrim", b_btn_colors, false);
Tooltip("B Button colors (Red in original Gamecube)\nAffect B button colors on interface");
EnhancementColor3("C Buttons", "gCCCBtnPrim", c_btn_colors, false);
Tooltip("C Buttons colors (Yellowish / Oranges in originals)\nAffect C buttons colors on interface, in inventory and ocarina notes");
EnhancementColor3("Start Buttons", "gCCStartBtnPrim", start_btn_colors, false);
Tooltip("Start Button colors (gray in Gamecube)\nAffect Start button colors in inventory");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Magic Bar")) {
EnhancementColor3("Magic bar borders", "gCCMagicBorderPrim", magic_border_colors, false);
Tooltip("Affect the border of the magic bar when being used\nWhite flash in original game");
EnhancementColor3("Magic bar main color", "gCCMagicPrim", magic_remaining_colors, false);
Tooltip("Affect the magic bar color\nGreen in original game");
EnhancementColor3("Magic bar being used", "gCCMagicUsePrim", magic_use_colors, false);
Tooltip("Affect the magic bar when being used\nYellow in original game");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Misc")) {
EnhancementColor3("Minimap color", "gCCMinimapPrim", minimap_colors, false);
Tooltip("Affect the Dungeon and Overworld minimaps");
EnhancementColor3("Rupee icon color", "gCCRupeePrim", rupee_colors, false);
Tooltip("Affect the Rupee icon on interface\nGreen by default");
EnhancementColor3("Small Keys icon color", "gCCKeysPrim", smolekey_colors, false);
Tooltip("Affect the Small keys icon on interface\nGray by default");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
ImGui::PopStyleColor();
ImGui::End();
}
for (const auto& category : windowCategories) { for (const auto& category : windowCategories) {
if (ImGui::BeginMenu(category.first.c_str())) { if (ImGui::BeginMenu(category.first.c_str())) {
for (const std::string& name : category.second) { for (const std::string& name : category.second) {
@ -803,7 +975,7 @@ namespace SohImGui {
varName.erase(std::ranges::remove_if(varName, isspace).begin(), varName.end()); varName.erase(std::ranges::remove_if(varName, isspace).begin(), varName.end());
std::string toggleName = "g" + varName + "Enabled"; std::string toggleName = "g" + varName + "Enabled";
EnhancementCheckbox(name, toggleName); EnhancementCheckbox(name.c_str(), toggleName.c_str());
customWindows[name].enabled = CVar_GetS32(toggleName.c_str(), 0); customWindows[name].enabled = CVar_GetS32(toggleName.c_str(), 0);
} }
ImGui::EndMenu(); ImGui::EndMenu();
@ -854,19 +1026,19 @@ namespace SohImGui {
main_pos.y -= top_left_pos.y; main_pos.y -= top_left_pos.y;
ImVec2 size = ImGui::GetContentRegionAvail(); ImVec2 size = ImGui::GetContentRegionAvail();
ImVec2 pos = ImVec2(0, 0); ImVec2 pos = ImVec2(0, 0);
gfx_current_dimensions.width = size.x * gfx_current_dimensions.internal_mul; gfx_current_dimensions.width = (uint32_t)(size.x * gfx_current_dimensions.internal_mul);
gfx_current_dimensions.height = size.y * gfx_current_dimensions.internal_mul; gfx_current_dimensions.height = (uint32_t)(size.y * gfx_current_dimensions.internal_mul);
gfx_current_game_window_viewport.x = main_pos.x; gfx_current_game_window_viewport.x = (int16_t)main_pos.x;
gfx_current_game_window_viewport.y = main_pos.y; gfx_current_game_window_viewport.y = (int16_t)main_pos.y;
gfx_current_game_window_viewport.width = size.x; gfx_current_game_window_viewport.width = (int16_t)size.x;
gfx_current_game_window_viewport.height = size.y; gfx_current_game_window_viewport.height = (int16_t)size.y;
if (CVar_GetS32("gN64Mode", 0)) if (CVar_GetS32("gN64Mode", 0))
{ {
gfx_current_dimensions.width = 320; gfx_current_dimensions.width = 320;
gfx_current_dimensions.height = 240; gfx_current_dimensions.height = 240;
const int sw = size.y * 320 / 240; const int sw = size.y * 320 / 240;
gfx_current_game_window_viewport.x += (size.x - sw) / 2; gfx_current_game_window_viewport.x += ((int)size.x - sw) / 2;
gfx_current_game_window_viewport.width = sw; gfx_current_game_window_viewport.width = sw;
pos = ImVec2(size.x / 2 - sw / 2, 0); pos = ImVec2(size.x / 2 - sw / 2, 0);
size = ImVec2(sw, size.y); size = ImVec2(sw, size.y);
@ -875,12 +1047,12 @@ namespace SohImGui {
overlay->Draw(); overlay->Draw();
} }
void DrawFramebufferAndGameInput() { void DrawFramebufferAndGameInput(void) {
ImVec2 main_pos = ImGui::GetWindowPos(); const ImVec2 main_pos = ImGui::GetWindowPos();
ImVec2 size = ImGui::GetContentRegionAvail(); ImVec2 size = ImGui::GetContentRegionAvail();
ImVec2 pos = ImVec2(0, 0); ImVec2 pos = ImVec2(0, 0);
if (CVar_GetS32("gN64Mode", 0)) { if (CVar_GetS32("gN64Mode", 0)) {
const int sw = size.y * 320 / 240; const float sw = size.y * 320.0f / 240.0f;
pos = ImVec2(size.x / 2 - sw / 2, 0); pos = ImVec2(size.x / 2 - sw / 2, 0);
size = ImVec2(sw, size.y); size = ImVec2(sw, size.y);
} }

View File

@ -64,11 +64,15 @@ namespace SohImGui {
void Init(WindowImpl window_impl); void Init(WindowImpl window_impl);
void Update(EventImpl event); void Update(EventImpl event);
void EnhancementRadioButton(std::string text, std::string cvarName, int value); void EnhancementRadioButton(const char* text, const char* cvarName, int id);
void EnhancementCheckbox(std::string text, std::string cvarName); void EnhancementCheckbox(const char* text, const char* cvarName);
void EnhancementSliderInt(std::string text, std::string id, std::string cvarName, int min, int max, std::string format); void EnhancementButton(const char* text, const char* cvarName);
void EnhancementSliderFloat(std::string text, std::string id, std::string cvarName, float min, float max, std::string format, float defaultValue); void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format);
void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage);
void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue); void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue);
void Tooltip(const char* text);
void EnhancementColor3(const char* text, const char* cvarName, float defaultColors[3], bool TitleSameLine);
void DrawMainMenuAndCalculateGameSize(void); void DrawMainMenuAndCalculateGameSize(void);
@ -79,6 +83,7 @@ namespace SohImGui {
void BindCmd(const std::string& cmd, CommandEntry entry); void BindCmd(const std::string& cmd, CommandEntry entry);
void AddWindow(const std::string& category, const std::string& name, WindowDrawFunc drawFunc); void AddWindow(const std::string& category, const std::string& name, WindowDrawFunc drawFunc);
void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint = ImVec4(1, 1, 1, 1)); void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint = ImVec4(1, 1, 1, 1));
void LoadInterfaceEditor();
ImTextureID GetTextureByID(int id); ImTextureID GetTextureByID(int id);
ImTextureID GetTextureByName(const std::string& name); ImTextureID GetTextureByName(const std::string& name);
} }

View File

@ -1,5 +1,7 @@
#include "TextureMod.h" #include "TextureMod.h"
#if 0
#include <map> #include <map>
#include <string> #include <string>
#include <iostream> #include <iostream>
@ -122,3 +124,5 @@ namespace Ship {
LoadedOTRS.clear(); LoadedOTRS.clear();
} }
} }
#endif

View File

@ -3,6 +3,8 @@
#include <PR/ultra64/gbi.h> #include <PR/ultra64/gbi.h>
#include "Lib/Fast3D/gfx_pc.h" #include "Lib/Fast3D/gfx_pc.h"
#if 0
namespace Ship { namespace Ship {
enum TextureMod { enum TextureMod {
GRAYSCALE, GRAYSCALE,
@ -49,3 +51,5 @@ namespace Ship {
} }
} }
} }
#endif

View File

@ -112,11 +112,7 @@ extern "C" {
} }
} }
ModInternal::bindHook(CONTROLLER_READ); ModInternal::ExecuteHooks<ModInternal::ControllerRead>(pad);
ModInternal::initBindHook(1,
HookParameter({ .name = "cont_pad", .parameter = (void*)pad })
);
ModInternal::callBindHook(0);
} }
const char* ResourceMgr_GetNameByCRC(uint64_t crc) { const char* ResourceMgr_GetNameByCRC(uint64_t crc) {
@ -168,12 +164,7 @@ extern "C" {
if (hashStr != nullptr) { if (hashStr != nullptr) {
const auto res = static_cast<Ship::Texture*>(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(hashStr->c_str()).get()); const auto res = static_cast<Ship::Texture*>(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(hashStr->c_str()).get());
ModInternal::bindHook(LOAD_TEXTURE); ModInternal::ExecuteHooks<ModInternal::LoadTexture>(hashStr->c_str(), &res->imageData);
ModInternal::initBindHook(2,
HookParameter({.name = "path", .parameter = (void*)hashStr->c_str() }),
HookParameter({.name = "texture", .parameter = static_cast<void*>(&res->imageData) })
);
ModInternal::callBindHook(0);
return reinterpret_cast<char*>(res->imageData); return reinterpret_cast<char*>(res->imageData);
} else { } else {
@ -200,12 +191,7 @@ extern "C" {
char* ResourceMgr_LoadTexByName(char* texPath) { char* ResourceMgr_LoadTexByName(char* texPath) {
const auto res = static_cast<Ship::Texture*>(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(texPath).get()); const auto res = static_cast<Ship::Texture*>(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(texPath).get());
ModInternal::bindHook(LOAD_TEXTURE); ModInternal::ExecuteHooks<ModInternal::LoadTexture>(texPath, &res->imageData);
ModInternal::initBindHook(2,
HookParameter({ .name = "path", .parameter = (void*)texPath }),
HookParameter({ .name = "texture", .parameter = static_cast<void*>(&res->imageData) })
);
ModInternal::callBindHook(0);
return (char*)res->imageData; return (char*)res->imageData;
} }

View File

@ -1,6 +1,6 @@
<Root> <Root>
<File Name="object_triforce_spot" Segment="6"> <File Name="object_triforce_spot" Segment="6">
<Array Name="gTriforceVtx" Count="32" Offset="0x0000"> <Array Name="gTriforceVtx" Count="96" Offset="0x0000">
<Vtx/> <Vtx/>
</Array> </Array>

View File

@ -28,9 +28,13 @@ void BootCommands_Init()
CVar_RegisterS32("gRumbleEnabled", 0); CVar_RegisterS32("gRumbleEnabled", 0);
CVar_RegisterS32("gUniformLR", 1); CVar_RegisterS32("gUniformLR", 1);
CVar_RegisterS32("gTwoHandedIdle", 0); CVar_RegisterS32("gTwoHandedIdle", 0);
CVar_RegisterS32("gDekuNutUpgradeFix", 1);
CVar_RegisterS32("gNewDrops", 0); CVar_RegisterS32("gNewDrops", 0);
CVar_RegisterS32("gVisualAgony", 0); CVar_RegisterS32("gVisualAgony", 0);
CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French
CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom
CVar_RegisterS32("gUseNaviCol", 0);
CVar_RegisterS32("gUseTunicsCol", 0);
} }
//void BootCommands_ParseBootArgs(char* str) //void BootCommands_ParseBootArgs(char* str)

View File

@ -19,9 +19,50 @@ MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) {
if (file == nullptr) if (file == nullptr)
return nullptr; return nullptr;
MessageTableEntry* table = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file->messages.size()); // Allocate room for an additional message
MessageTableEntry* table = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * (file->messages.size() + 1));
for (int i = 0; i < file->messages.size(); i++) { for (int i = 0; i < file->messages.size(); i++) {
// Look for Owl Text
if (file->messages[i].id == 0x2066) {
// Create a new message based on the Owl Text
char* kaeporaPatch = (char*)malloc(sizeof(char) * file->messages[i].msg.size());
file->messages[i].msg.copy(kaeporaPatch, file->messages[i].msg.size(), 0);
// Swap the order of yes and no in this new message
if (filePath == "text/nes_message_data_static/nes_message_data_static") {
kaeporaPatch[26] = 'Y';
kaeporaPatch[27] = 'e';
kaeporaPatch[28] = 's';
kaeporaPatch[29] = 1;
kaeporaPatch[30] = 'N';
kaeporaPatch[31] = 'o';
} else if (filePath == "text/ger_message_data_static/ger_message_data_static") {
kaeporaPatch[30] = 'J';
kaeporaPatch[31] = 'a';
kaeporaPatch[32] = '!';
kaeporaPatch[33] = 1;
kaeporaPatch[34] = 'N';
kaeporaPatch[35] = 'e';
kaeporaPatch[36] = 'i';
kaeporaPatch[37] = 'n';
} else {
kaeporaPatch[26] = 'O';
kaeporaPatch[27] = 'u';
kaeporaPatch[28] = 'i';
kaeporaPatch[29] = 1;
kaeporaPatch[30] = 'N';
kaeporaPatch[31] = 'o';
kaeporaPatch[32] = 'n';
}
// load data into message
table[file->messages.size()].textId = 0x71B3;
table[file->messages.size()].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos;
table[file->messages.size()].segment = kaeporaPatch;
table[file->messages.size()].msgSize = file->messages[i].msg.size();
}
table[i].textId = file->messages[i].id; table[i].textId = file->messages[i].id;
table[i].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos; table[i].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos;
table[i].segment = file->messages[i].msg.c_str(); table[i].segment = file->messages[i].msg.c_str();

View File

@ -108,9 +108,7 @@ void AudioMgr_Init(AudioMgr* audioMgr, void* stack, OSPri pri, OSId id, SchedCon
AudioLoad_SetDmaHandler(DmaMgr_DmaHandler); AudioLoad_SetDmaHandler(DmaMgr_DmaHandler);
Audio_InitSound(); Audio_InitSound();
osSendMesg(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK); osSendMesg(&audioMgr->unk_C8, NULL, OS_MESG_BLOCK);
bind_hook(AUDIO_INIT); ModInternal_ExecuteAudioInitHooks();
init_hook(0);
call_hook(0);
// Removed due to crash // Removed due to crash
//IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->unk_74); //IrqMgr_AddClient(audioMgr->irqMgr, &irqClient, &audioMgr->unk_74);
hasInitialized = true; hasInitialized = true;

View File

@ -335,38 +335,59 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, GlobalContext* g
void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) { void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) {
NaviColor* naviColor = &sNaviColorList[actorCategory]; NaviColor* naviColor = &sNaviColorList[actorCategory];
if (CVar_GetS32("gUseNaviCol",0) != 1 ) {
if (actorCategory == ACTORCAT_PLAYER) { if (actorCategory == ACTORCAT_PLAYER) {
naviColor->inner.r = CVar_GetS32("gNavi_Idle_Inner_Red", naviColor->inner.r); naviColor->inner.r = 255; naviColor->inner.g = 255; naviColor->inner.b = 255;
naviColor->inner.g = CVar_GetS32("gNavi_Idle_Inner_Green", naviColor->inner.g); naviColor->outer.r = 115; naviColor->outer.g = 230; naviColor->outer.b = 255;
naviColor->inner.b = CVar_GetS32("gNavi_Idle_Inner_Blue", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Idle_Outer_Red", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Idle_Outer_Green", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Idle_Outer_Blue", naviColor->outer.b);
} }
if (actorCategory == ACTORCAT_NPC) { if (actorCategory == ACTORCAT_NPC) {
naviColor->inner.r = CVar_GetS32("gNavi_NPC_Inner_Red", naviColor->inner.r); naviColor->inner.r = 100; naviColor->inner.g = 100; naviColor->inner.b = 255;
naviColor->inner.g = CVar_GetS32("gNavi_NPC_Inner_Green", naviColor->inner.g); naviColor->outer.r = 90; naviColor->outer.g = 90; naviColor->outer.b = 255;
naviColor->inner.b = CVar_GetS32("gNavi_NPC_Inner_Blue", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_NPC_Outer_Red", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_NPC_Outer_Green", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_NPC_Outer_Blue", naviColor->outer.b);
} }
if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) { if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) {
naviColor->inner.r = CVar_GetS32("gNavi_Enemy_Inner_Red", naviColor->inner.r); naviColor->inner.r = 255; naviColor->inner.g = 255; naviColor->inner.b = 0;
naviColor->inner.g = CVar_GetS32("gNavi_Enemy_Inner_Green", naviColor->inner.g); naviColor->outer.r = 220; naviColor->outer.g = 220; naviColor->outer.b = 0;
naviColor->inner.b = CVar_GetS32("gNavi_Enemy_Inner_Blue", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Enemy_Outer_Red", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Enemy_Outer_Green", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Enemy_Outer_Blue", naviColor->outer.b);
} }
if (actorCategory == ACTORCAT_PROP) { if (actorCategory == ACTORCAT_PROP) {
naviColor->inner.r = CVar_GetS32("gNavi_Prop_Inner_Red", naviColor->inner.r); naviColor->inner.r = 0; naviColor->inner.g = 255; naviColor->inner.b = 90;
naviColor->inner.g = CVar_GetS32("gNavi_Prop_Inner_Green", naviColor->inner.g); naviColor->outer.r = 0; naviColor->outer.g = 220; naviColor->outer.b = 0;
naviColor->inner.b = CVar_GetS32("gNavi_Prop_Inner_Blue", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Prop_Outer_Red", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Prop_Outer_Green", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Prop_Outer_Blue", naviColor->outer.b);
} }
} else {
if (actorCategory == ACTORCAT_PLAYER) {
naviColor->inner.r = CVar_GetS32("gNavi_Idle_Inner_R", naviColor->inner.r);
naviColor->inner.g = CVar_GetS32("gNavi_Idle_Inner_G", naviColor->inner.g);
naviColor->inner.b = CVar_GetS32("gNavi_Idle_Inner_B", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Idle_Outer_R", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Idle_Outer_G", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Idle_Outer_B", naviColor->outer.b);
}
if (actorCategory == ACTORCAT_NPC) {
naviColor->inner.r = CVar_GetS32("gNavi_NPC_Inner_R", naviColor->inner.r);
naviColor->inner.g = CVar_GetS32("gNavi_NPC_Inner_G", naviColor->inner.g);
naviColor->inner.b = CVar_GetS32("gNavi_NPC_Inner_B", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_NPC_Outer_R", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_NPC_Outer_G", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_NPC_Outer_B", naviColor->outer.b);
}
if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) {
naviColor->inner.r = CVar_GetS32("gNavi_Enemy_Inner_R", naviColor->inner.r);
naviColor->inner.g = CVar_GetS32("gNavi_Enemy_Inner_G", naviColor->inner.g);
naviColor->inner.b = CVar_GetS32("gNavi_Enemy_Inner_B", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Enemy_Outer_R", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Enemy_Outer_G", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Enemy_Outer_B", naviColor->outer.b);
}
if (actorCategory == ACTORCAT_PROP) {
naviColor->inner.r = CVar_GetS32("gNavi_Prop_Inner_R", naviColor->inner.r);
naviColor->inner.g = CVar_GetS32("gNavi_Prop_Inner_G", naviColor->inner.g);
naviColor->inner.b = CVar_GetS32("gNavi_Prop_Inner_B", naviColor->inner.b);
naviColor->outer.r = CVar_GetS32("gNavi_Prop_Outer_R", naviColor->outer.r);
naviColor->outer.g = CVar_GetS32("gNavi_Prop_Outer_G", naviColor->outer.g);
naviColor->outer.b = CVar_GetS32("gNavi_Prop_Outer_B", naviColor->outer.b);
}
}
targetCtx->naviRefPos.x = actor->focus.pos.x; targetCtx->naviRefPos.x = actor->focus.pos.x;
targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y);
targetCtx->naviRefPos.z = actor->focus.pos.z; targetCtx->naviRefPos.z = actor->focus.pos.z;

View File

@ -1,6 +1,11 @@
#include "global.h" #include "global.h"
#include "textures/parameter_static/parameter_static.h" #include "textures/parameter_static/parameter_static.h"
s16 Top_LM_Margin = 0;
s16 Left_LM_Margin = 0;
s16 Right_LM_Margin = 0;
s16 Bottom_LM_Margin = 0;
static s16 sHeartsPrimColors[3][3] = { static s16 sHeartsPrimColors[3][3] = {
{ HEARTS_PRIM_R, HEARTS_PRIM_G, HEARTS_PRIM_B }, { HEARTS_PRIM_R, HEARTS_PRIM_G, HEARTS_PRIM_B },
{ HEARTS_BURN_PRIM_R, HEARTS_BURN_PRIM_G, HEARTS_BURN_PRIM_B }, // unused { HEARTS_BURN_PRIM_R, HEARTS_BURN_PRIM_G, HEARTS_BURN_PRIM_B }, // unused
@ -106,6 +111,9 @@ static s16 sHeartsDDEnvFactors[3][3] = {
}; };
// Current colors for the double defense hearts // Current colors for the double defense hearts
s16 HeartInner[3] = {HEARTS_PRIM_R,HEARTS_PRIM_G,HEARTS_PRIM_B};
s16 HeartDDOutline[3] = {HEARTS_DD_PRIM_R,HEARTS_DD_PRIM_G,HEARTS_DD_PRIM_B};
s16 HeartDDInner[3] = {HEARTS_DD_ENV_R,HEARTS_DD_ENV_G,HEARTS_DD_ENV_B};
s16 sBeatingHeartsDDPrim[3]; s16 sBeatingHeartsDDPrim[3];
s16 sBeatingHeartsDDEnv[3]; s16 sBeatingHeartsDDEnv[3];
s16 sHeartsDDPrim[2][3]; s16 sHeartsDDPrim[2][3];
@ -113,35 +121,47 @@ s16 sHeartsDDEnv[2][3];
void HealthMeter_Init(GlobalContext* globalCtx) { void HealthMeter_Init(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
if (CVar_GetS32("gHudColors", 1) == 2) {
HeartInner[0] = CVar_GetS32("gCCHeartsPrimR", 90);
HeartInner[1] = CVar_GetS32("gCCHeartsPrimG", 90);
HeartInner[2] = CVar_GetS32("gCCHeartsPrimB", 90);
HeartDDOutline[0] = CVar_GetS32("gDDCCHeartsPrimR", 90);
HeartDDOutline[1] = CVar_GetS32("gDDCCHeartsPrimG", 90);
HeartDDOutline[2] = CVar_GetS32("gDDCCHeartsPrimB", 90);
}
interfaceCtx->unk_228 = 0x140; interfaceCtx->unk_228 = 0x140;
interfaceCtx->unk_226 = gSaveContext.health; interfaceCtx->unk_226 = gSaveContext.health;
interfaceCtx->unk_22A = interfaceCtx->unk_1FE = 0; interfaceCtx->unk_22A = interfaceCtx->unk_1FE = 0;
interfaceCtx->unk_22C = interfaceCtx->unk_200 = 0; interfaceCtx->unk_22C = interfaceCtx->unk_200 = 0;
interfaceCtx->heartsPrimR[0] = HEARTS_PRIM_R; interfaceCtx->heartsPrimR[0] = HeartInner[0];
interfaceCtx->heartsPrimG[0] = HEARTS_PRIM_G; interfaceCtx->heartsPrimG[0] = HeartInner[1];
interfaceCtx->heartsPrimB[0] = HEARTS_PRIM_B; interfaceCtx->heartsPrimB[0] = HeartInner[2];
interfaceCtx->heartsEnvR[0] = HEARTS_ENV_R; interfaceCtx->heartsEnvR[0] = HEARTS_ENV_R;
interfaceCtx->heartsEnvG[0] = HEARTS_ENV_G; interfaceCtx->heartsEnvG[0] = HEARTS_ENV_G;
interfaceCtx->heartsEnvB[0] = HEARTS_ENV_B; interfaceCtx->heartsEnvB[0] = HEARTS_ENV_B;
interfaceCtx->heartsPrimR[1] = HEARTS_PRIM_R; interfaceCtx->heartsPrimR[1] = HeartInner[0];
interfaceCtx->heartsPrimG[1] = HEARTS_PRIM_G; interfaceCtx->heartsPrimG[1] = HeartInner[1];
interfaceCtx->heartsPrimB[1] = HEARTS_PRIM_B; interfaceCtx->heartsPrimB[1] = HeartInner[2];
interfaceCtx->heartsEnvR[1] = HEARTS_ENV_R; interfaceCtx->heartsEnvR[1] = HEARTS_ENV_R;
interfaceCtx->heartsEnvG[1] = HEARTS_ENV_G; interfaceCtx->heartsEnvG[1] = HEARTS_ENV_G;
interfaceCtx->heartsEnvB[1] = HEARTS_ENV_B; interfaceCtx->heartsEnvB[1] = HEARTS_ENV_B;
sHeartsDDPrim[0][0] = sHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R; sHeartsDDPrim[0][0] = sHeartsDDPrim[1][0] = HeartDDOutline[0];
sHeartsDDPrim[0][1] = sHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G; sHeartsDDPrim[0][1] = sHeartsDDPrim[1][1] = HeartDDOutline[1];
sHeartsDDPrim[0][2] = sHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B; sHeartsDDPrim[0][2] = sHeartsDDPrim[1][2] = HeartDDOutline[2];
sHeartsDDEnv[0][0] = sHeartsDDEnv[1][0] = HEARTS_DD_ENV_R; sHeartsDDPrim[2][0] = HeartInner[0];
sHeartsDDEnv[0][1] = sHeartsDDEnv[1][1] = HEARTS_DD_ENV_G; sHeartsDDPrim[2][1] = HeartInner[1];
sHeartsDDEnv[0][2] = sHeartsDDEnv[1][2] = HEARTS_DD_ENV_B; sHeartsDDPrim[2][2] = HeartInner[2];
sHeartsDDEnv[0][0] = sHeartsDDEnv[1][0] = HeartDDInner[0];
sHeartsDDEnv[0][1] = sHeartsDDEnv[1][1] = HeartDDInner[1];
sHeartsDDEnv[0][2] = sHeartsDDEnv[1][2] = HeartDDInner[2];
} }
void HealthMeter_Update(GlobalContext* globalCtx) { void HealthMeter_Update(GlobalContext* globalCtx) {
@ -154,7 +174,33 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
s16 gFactor; s16 gFactor;
s16 bFactor; s16 bFactor;
if (interfaceCtx) {} if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_LM_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_LM_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_LM_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_LM_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_LM_Margin = 0;
Left_LM_Margin = 0;
Right_LM_Margin = 0;
Bottom_LM_Margin = 0;
}
if (CVar_GetS32("gHudColors", 1) == 2) {
HeartInner[0] = CVar_GetS32("gCCHeartsPrimR", sHeartsPrimColors[0][0]);
HeartInner[1] = CVar_GetS32("gCCHeartsPrimG", sHeartsPrimColors[0][1]);
HeartInner[2] = CVar_GetS32("gCCHeartsPrimB", sHeartsPrimColors[0][2]);
HeartDDOutline[0] = CVar_GetS32("gDDCCHeartsPrimR", sHeartsDDPrim[0][0]);
HeartDDOutline[1] = CVar_GetS32("gDDCCHeartsPrimG", sHeartsDDPrim[0][1]);
HeartDDOutline[2] = CVar_GetS32("gDDCCHeartsPrimB", sHeartsDDPrim[0][2]);
} else {
HeartInner[0] = sHeartsPrimColors[0][0];
HeartInner[1] = sHeartsPrimColors[0][1];
HeartInner[2] = sHeartsPrimColors[0][2];
HeartDDOutline[0] = sHeartsDDPrim[0][0];
HeartDDOutline[1] = sHeartsDDPrim[0][1];
HeartDDOutline[2] = sHeartsDDPrim[0][2];
}
if (interfaceCtx->unk_200 != 0) { if (interfaceCtx->unk_200 != 0) {
interfaceCtx->unk_1FE--; interfaceCtx->unk_1FE--;
@ -172,17 +218,23 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
ddFactor = factor; ddFactor = factor;
interfaceCtx->heartsPrimR[0] = HEARTS_PRIM_R; interfaceCtx->heartsPrimR[0] = HeartInner[0];
interfaceCtx->heartsPrimG[0] = HEARTS_PRIM_G; interfaceCtx->heartsPrimG[0] = HeartInner[1];
interfaceCtx->heartsPrimB[0] = HEARTS_PRIM_B; interfaceCtx->heartsPrimB[0] = HeartInner[2];
interfaceCtx->heartsEnvR[0] = HEARTS_ENV_R; interfaceCtx->heartsEnvR[0] = HEARTS_ENV_R;
interfaceCtx->heartsEnvG[0] = HEARTS_ENV_G; interfaceCtx->heartsEnvG[0] = HEARTS_ENV_G;
interfaceCtx->heartsEnvB[0] = HEARTS_ENV_B; interfaceCtx->heartsEnvB[0] = HEARTS_ENV_B;
if (CVar_GetS32("gHudColors", 1) == 2) {
interfaceCtx->heartsPrimR[1] = HeartInner[0];
interfaceCtx->heartsPrimG[1] = HeartInner[1];
interfaceCtx->heartsPrimB[1] = HeartInner[2];
} else {
interfaceCtx->heartsPrimR[1] = sHeartsPrimColors[type][0]; interfaceCtx->heartsPrimR[1] = sHeartsPrimColors[type][0];
interfaceCtx->heartsPrimG[1] = sHeartsPrimColors[type][1]; interfaceCtx->heartsPrimG[1] = sHeartsPrimColors[type][1];
interfaceCtx->heartsPrimB[1] = sHeartsPrimColors[type][2]; interfaceCtx->heartsPrimB[1] = sHeartsPrimColors[type][2];
}
interfaceCtx->heartsEnvR[1] = sHeartsEnvColors[type][0]; interfaceCtx->heartsEnvR[1] = sHeartsEnvColors[type][0];
interfaceCtx->heartsEnvG[1] = sHeartsEnvColors[type][1]; interfaceCtx->heartsEnvG[1] = sHeartsEnvColors[type][1];
@ -192,28 +244,64 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
gFactor = sHeartsPrimFactors[0][1] * factor; gFactor = sHeartsPrimFactors[0][1] * factor;
bFactor = sHeartsPrimFactors[0][2] * factor; bFactor = sHeartsPrimFactors[0][2] * factor;
interfaceCtx->beatingHeartPrim[0] = (u8)(rFactor + HEARTS_PRIM_R) & 0xFF; interfaceCtx->beatingHeartPrim[0] = (u8)(rFactor + HeartInner[0]) & 0xFF;
interfaceCtx->beatingHeartPrim[1] = (u8)(gFactor + HEARTS_PRIM_G) & 0xFF; interfaceCtx->beatingHeartPrim[1] = (u8)(gFactor + HeartInner[1]) & 0xFF;
interfaceCtx->beatingHeartPrim[2] = (u8)(bFactor + HEARTS_PRIM_B) & 0xFF; interfaceCtx->beatingHeartPrim[2] = (u8)(bFactor + HeartInner[2]) & 0xFF;
rFactor = sHeartsEnvFactors[0][0] * factor; rFactor = sHeartsEnvFactors[0][0] * factor;
gFactor = sHeartsEnvFactors[0][1] * factor; gFactor = sHeartsEnvFactors[0][1] * factor;
bFactor = sHeartsEnvFactors[0][2] * factor; bFactor = sHeartsEnvFactors[0][2] * factor;
if (1) {}
ddType = type;
interfaceCtx->beatingHeartEnv[0] = (u8)(rFactor + HEARTS_ENV_R) & 0xFF; interfaceCtx->beatingHeartEnv[0] = (u8)(rFactor + HEARTS_ENV_R) & 0xFF;
interfaceCtx->beatingHeartEnv[1] = (u8)(gFactor + HEARTS_ENV_G) & 0xFF; interfaceCtx->beatingHeartEnv[1] = (u8)(gFactor + HEARTS_ENV_G) & 0xFF;
interfaceCtx->beatingHeartEnv[2] = (u8)(bFactor + HEARTS_ENV_B) & 0xFF; interfaceCtx->beatingHeartEnv[2] = (u8)(bFactor + HEARTS_ENV_B) & 0xFF;
sHeartsDDPrim[0][0] = HEARTS_DD_PRIM_R; ddType = type;
sHeartsDDPrim[0][1] = HEARTS_DD_PRIM_G;
sHeartsDDPrim[0][2] = HEARTS_DD_PRIM_B;
sHeartsDDEnv[0][0] = HEARTS_DD_ENV_R; sHeartsDDPrim[0][0] = HeartDDOutline[0];
sHeartsDDEnv[0][1] = HEARTS_DD_ENV_G; sHeartsDDPrim[0][1] = HeartDDOutline[1];
sHeartsDDEnv[0][2] = HEARTS_DD_ENV_B; sHeartsDDPrim[0][2] = HeartDDOutline[2];
sHeartsDDEnv[0][0] = HeartDDInner[0];
sHeartsDDEnv[0][1] = HeartDDInner[1];
sHeartsDDEnv[0][2] = HeartDDInner[2];
if (CVar_GetS32("gHudColors", 1) == 2) {
sHeartsDDPrim[2][0] = HeartInner[0];
sHeartsDDPrim[2][1] = HeartInner[1];
sHeartsDDPrim[2][2] = HeartInner[2];
sHeartsDDPrim[1][0] = HeartDDOutline[0];
sHeartsDDPrim[1][1] = HeartDDOutline[1];
sHeartsDDPrim[1][2] = HeartDDOutline[2];
sHeartsDDEnv[1][0] = HeartDDInner[0];
sHeartsDDEnv[1][1] = HeartDDInner[1];
sHeartsDDEnv[1][2] = HeartDDInner[2];
HeartDDInner[0] = HeartInner[0];
HeartDDInner[1] = HeartInner[1];
HeartDDInner[2] = HeartInner[2];
rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDPrimFactors[ddType][2] * ddFactor;
sBeatingHeartsDDPrim[0] = (u8)(rFactor + HeartDDOutline[0]) & 0xFF;
sBeatingHeartsDDPrim[1] = (u8)(gFactor + HeartDDOutline[1]) & 0xFF;
sBeatingHeartsDDPrim[2] = (u8)(bFactor + HeartDDOutline[2]) & 0xFF;
rFactor = sHeartsDDEnvFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor;
sBeatingHeartsDDEnv[0] = (u8)(rFactor + HeartDDInner[0]) & 0xFF;
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF;
} else {
sHeartsDDPrim[2][0] = HeartInner[0];
sHeartsDDPrim[2][1] = HeartInner[1];
sHeartsDDPrim[2][2] = HeartInner[2];
sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0]; sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0];
sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1]; sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1];
@ -227,17 +315,19 @@ void HealthMeter_Update(GlobalContext* globalCtx) {
gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor; gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDPrimFactors[ddType][2] * ddFactor; bFactor = sHeartsDDPrimFactors[ddType][2] * ddFactor;
sBeatingHeartsDDPrim[0] = (u8)(rFactor + HEARTS_DD_PRIM_R) & 0xFF; sBeatingHeartsDDPrim[0] = (u8)(rFactor + HeartDDOutline[0]) & 0xFF;
sBeatingHeartsDDPrim[1] = (u8)(gFactor + HEARTS_DD_PRIM_G) & 0xFF; sBeatingHeartsDDPrim[1] = (u8)(gFactor + HeartDDOutline[1]) & 0xFF;
sBeatingHeartsDDPrim[2] = (u8)(bFactor + HEARTS_DD_PRIM_B) & 0xFF; sBeatingHeartsDDPrim[2] = (u8)(bFactor + HeartDDOutline[2]) & 0xFF;
rFactor = sHeartsDDEnvFactors[ddType][0] * ddFactor; rFactor = sHeartsDDEnvFactors[ddType][0] * ddFactor;
gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor; gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor;
bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor; bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor;
sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_DD_ENV_R) & 0xFF; sBeatingHeartsDDEnv[0] = (u8)(rFactor + HeartDDInner[0]) & 0xFF;
sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_DD_ENV_G) & 0xFF; sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF;
sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_DD_ENV_B) & 0xFF; sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF;
}
} }
s32 func_80078E18(GlobalContext* globalCtx) { s32 func_80078E18(GlobalContext* globalCtx) {
@ -322,8 +412,8 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
} }
curColorSet = -1; curColorSet = -1;
offsetY = 0.0f; offsetY = 0.0f+(Top_LM_Margin*-1);
offsetX = OTRGetDimensionFromLeftEdge(0.0f); offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1);
for (i = 0; i < totalHeartCount; i++) { for (i = 0; i < totalHeartCount; i++) {
if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) { if ((ddHeartCountMinusOne < 0) || (i > ddHeartCountMinusOne)) {
@ -483,7 +573,7 @@ void HealthMeter_Draw(GlobalContext* globalCtx) {
offsetX += 10.0f; offsetX += 10.0f;
if (i == 9) { if (i == 9) {
offsetY += 10.0f; offsetY += 10.0f;
offsetX = OTRGetDimensionFromLeftEdge(0.0f); offsetX = OTRGetDimensionFromLeftEdge(0.0f)+(Left_LM_Margin*-1);
} }
} }

View File

@ -12,6 +12,11 @@ s16 sPlayerInitialPosZ = 0;
s16 sPlayerInitialDirection = 0; s16 sPlayerInitialDirection = 0;
s16 sEntranceIconMapIndex = 0; s16 sEntranceIconMapIndex = 0;
s16 Top_MM_Margin = 0;
s16 Left_MM_Margin = 0;
s16 Right_MM_Margin = 0;
s16 Bottom_MM_Margin = 0;
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) { void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx); Player* player = GET_PLAYER(globalCtx);
@ -604,11 +609,11 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(OVERLAY_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
tempX = player->actor.world.pos.x; tempX = player->actor.world.pos.x+Right_MM_Margin;
tempZ = player->actor.world.pos.z; tempZ = player->actor.world.pos.z+Bottom_MM_Margin;
tempX /= R_COMPASS_SCALE_X; tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y; tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + tempX) / 10.0f), (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
Matrix_Scale(0.4f, 0.4f, 0.4f, MTXMODE_APPLY); Matrix_Scale(0.4f, 0.4f, 0.4f, MTXMODE_APPLY);
Matrix_RotateX(-1.6f, MTXMODE_APPLY); Matrix_RotateX(-1.6f, MTXMODE_APPLY);
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400; tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
@ -619,11 +624,11 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 0, 255);
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL); gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
tempX = sPlayerInitialPosX; tempX = sPlayerInitialPosX+Right_MM_Margin;
tempZ = sPlayerInitialPosZ; tempZ = sPlayerInitialPosZ+Bottom_MM_Margin;
tempX /= R_COMPASS_SCALE_X; tempX /= R_COMPASS_SCALE_X;
tempZ /= R_COMPASS_SCALE_Y; tempZ /= R_COMPASS_SCALE_Y;
Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X + tempX) / 10.0f), (R_COMPASS_OFFSET_Y - tempZ) / 10.0f, 0.0f, MTXMODE_NEW); Matrix_Translate(OTRGetDimensionFromRightEdge((R_COMPASS_OFFSET_X+(Right_MM_Margin*10) + tempX) / 10.0f), (R_COMPASS_OFFSET_Y+((Bottom_MM_Margin*10)*-1) - tempZ) / 10.0f, 0.0f, MTXMODE_NEW);
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY); Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY); Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY); Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
@ -662,17 +667,22 @@ void Minimap_Draw(GlobalContext* globalCtx) {
TEXEL0, 0, PRIMITIVE, 0); TEXEL0, 0, PRIMITIVE, 0);
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) { if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) {
if (CVar_GetS32("gHudColors", 1) == 2) { //Dungeon minimap
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha);
}
gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->mapSegment); gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->mapSegment);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_I, 96, 85, 0, gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_I, 96, 85, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X); const s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + Right_MM_Margin);
const s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Bottom_MM_Margin;
gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, R_DGN_MINIMAP_Y << 2, gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, dgnMiniMapY << 2,
(dgnMiniMapX + 96) << 2, (R_DGN_MINIMAP_Y + 85) << 2, G_TX_RENDERTILE, (dgnMiniMapX + 96) << 2, (dgnMiniMapY + 85) << 2, G_TX_RENDERTILE,
0, 0, 1 << 10, 1 << 10); 0, 0, 1 << 10, 1 << 10);
} }
@ -719,27 +729,35 @@ void Minimap_Draw(GlobalContext* globalCtx) {
func_80094520(globalCtx->state.gfxCtx); func_80094520(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MINIMAP_COLOR(0), R_MINIMAP_COLOR(1), R_MINIMAP_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 2) {//Overworld minimap
interfaceCtx->minimapAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMinimapPrimR", R_MINIMAP_COLOR(0)), CVar_GetS32("gCCMinimapPrimG", R_MINIMAP_COLOR(1)), CVar_GetS32("gCCMinimapPrimB", R_MINIMAP_COLOR(2)), interfaceCtx->minimapAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MINIMAP_COLOR(0), R_MINIMAP_COLOR(1), R_MINIMAP_COLOR(2), interfaceCtx->minimapAlpha);
}
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_IA, gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_IA,
gMapData->owMinimapWidth[mapIndex], gMapData->owMinimapHeight[mapIndex], 0, gMapData->owMinimapWidth[mapIndex], gMapData->owMinimapHeight[mapIndex], 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X); const s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(R_OW_MINIMAP_X + Right_MM_Margin);
const s16 oWMiniMapY = R_OW_MINIMAP_Y + Bottom_MM_Margin;
gSPWideTextureRectangle(OVERLAY_DISP++, oWMiniMapX << 2, R_OW_MINIMAP_Y << 2, gSPWideTextureRectangle(OVERLAY_DISP++, oWMiniMapX << 2, oWMiniMapY << 2,
(oWMiniMapX + gMapData->owMinimapWidth[mapIndex]) << 2, (oWMiniMapX + gMapData->owMinimapWidth[mapIndex]) << 2,
(R_OW_MINIMAP_Y + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0, (oWMiniMapY + gMapData->owMinimapHeight[mapIndex]) << 2, G_TX_RENDERTILE, 0,
0, 1 << 10, 1 << 10); 0, 1 << 10, 1 << 10);
if (CVar_GetS32("gHudColors", 1) != 2) {//This need to be added else it will color dungeon entrance icon too. (it re-init prim color to default color)
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MINIMAP_COLOR(0), R_MINIMAP_COLOR(1), R_MINIMAP_COLOR(2), interfaceCtx->minimapAlpha);
}
if (((globalCtx->sceneNum != SCENE_SPOT01) && (globalCtx->sceneNum != SCENE_SPOT04) && if (((globalCtx->sceneNum != SCENE_SPOT01) && (globalCtx->sceneNum != SCENE_SPOT04) &&
(globalCtx->sceneNum != SCENE_SPOT08)) || (globalCtx->sceneNum != SCENE_SPOT08)) ||
(LINK_AGE_IN_YEARS != YEARS_ADULT)) { (LINK_AGE_IN_YEARS != YEARS_ADULT)) {
s16 IconSize = 8; s16 IconSize = 8;
s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex]; s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex]+Right_MM_Margin;
s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex]; s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex]+Bottom_MM_Margin;
//gFixDungeonMinimapIcon fix both Y position of visible icon and hide these non needed. //gFixDungeonMinimapIcon fix both Y position of visible icon and hide these non needed.
if (CVar_GetS32("gFixDungeonMinimapIcon", 1) != 0){ if (CVar_GetS32("gFixDungeonMinimapIcon", 1) != 0){
//No idea why and how Original value work but this does actually fix them all. //No idea why and how Original value work but this does actually fix them all.
@ -766,14 +784,20 @@ void Minimap_Draw(GlobalContext* globalCtx) {
} }
} }
const s16 entranceX = OTRGetRectDimensionFromRightEdge(270 + Right_MM_Margin);
const s16 entranceY = 154 + Bottom_MM_Margin;
if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) { if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
8, 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);
gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} else if ((globalCtx->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 8, 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); G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 entranceX = OTRGetRectDimensionFromRightEdge(270); gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2,
gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, 154 << 2, (entranceX + 32) << 2, (154 + 8) << 2,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} }
@ -809,6 +833,18 @@ void Map_Update(GlobalContext* globalCtx) {
s16 floor; s16 floor;
s16 i; s16 i;
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_MM_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_MM_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_MM_Margin = 0;
Left_MM_Margin = 0;
Right_MM_Margin = 0;
Bottom_MM_Margin = 0;
}
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) { if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
switch (globalCtx->sceneNum) { switch (globalCtx->sceneNum) {
case SCENE_YDAN: case SCENE_YDAN:

View File

@ -108,6 +108,22 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha);
s16 Top_MC_Margin = 0;
s16 Left_MC_Margin = 0;
s16 Right_MC_Margin = 0;
s16 Bottom_MC_Margin = 0;
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_MC_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_MC_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_MC_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_MC_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_MC_Margin = 0;
Left_MC_Margin = 0;
Right_MC_Margin = 0;
Bottom_MC_Margin = 0;
}
markPoint = &mapMarkIconData->points[0]; markPoint = &mapMarkIconData->points[0];
for (i = 0; i < mapMarkIconData->count; i++) { for (i = 0; i < mapMarkIconData->count; i++) {
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) { if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
@ -118,8 +134,8 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP, markInfo->textureWidth, markInfo->textureHeight, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
rectLeft = (GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x) + 204) << 2; rectLeft = (GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+Right_MC_Margin) + 204) << 2;
rectTop = (GREG(95) + markPoint->y + 140) << 2; rectTop = (GREG(95) + markPoint->y + Bottom_MC_Margin + 140) << 2;
gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft, gSPTextureRectangle(OVERLAY_DISP++, rectLeft, rectTop, markInfo->rectWidth + rectLeft,
rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx, rectTop + markInfo->rectHeight, G_TX_RENDERTILE, 0, 0, markInfo->dsdx,
markInfo->dtdy); markInfo->dtdy);

View File

@ -272,6 +272,13 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) {
const char** languageSegmentTable; const char** languageSegmentTable;
Font* font; Font* font;
const char* seg; const char* seg;
u16 bufferId = textId;
// Use the better owl message if better owl is enabled
if (CVar_GetS32("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B ||
bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A))
{
bufferId = 0x71B3;
}
if (gSaveContext.language == LANGUAGE_GER) if (gSaveContext.language == LANGUAGE_GER)
messageTableEntry = sGerMessageEntryTablePtr; messageTableEntry = sGerMessageEntryTablePtr;
@ -287,7 +294,7 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) {
while (messageTableEntry->textId != 0xFFFF) { while (messageTableEntry->textId != 0xFFFF) {
font = &globalCtx->msgCtx.font; font = &globalCtx->msgCtx.font;
if (messageTableEntry->textId == textId) { if (messageTableEntry->textId == bufferId) {
foundSeg = messageTableEntry->segment; foundSeg = messageTableEntry->segment;
font->charTexBuf[0] = messageTableEntry->typePos; font->charTexBuf[0] = messageTableEntry->typePos;
@ -298,14 +305,14 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) {
// "Message found!!!" // "Message found!!!"
osSyncPrintf(" メッセージが,見つかった!!! = %x " osSyncPrintf(" メッセージが,見つかった!!! = %x "
"(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n",
textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); bufferId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg);
return; return;
} }
messageTableEntry++; messageTableEntry++;
} }
// "Message not found!!!" // "Message not found!!!"
osSyncPrintf(" メッセージが,見つからなかった!!! = %x\n", textId); osSyncPrintf(" メッセージが,見つからなかった!!! = %x\n", bufferId);
font = &globalCtx->msgCtx.font; font = &globalCtx->msgCtx.font;
messageTableEntry = sNesMessageEntryTablePtr; messageTableEntry = sNesMessageEntryTablePtr;
@ -446,6 +453,46 @@ void Message_DrawTextboxIcon(GlobalContext* globalCtx, Gfx** p, s16 x, s16 y) {
static s16 sIconEnvR = 0; static s16 sIconEnvR = 0;
static s16 sIconEnvG = 0; static s16 sIconEnvG = 0;
static s16 sIconEnvB = 0; static s16 sIconEnvB = 0;
if (CVar_GetS32("gHudColors", 1) == 0) {
sIconPrimColors[0][0] = 4;
sIconPrimColors[0][1] = 84;
sIconPrimColors[0][2] = 204;
sIconPrimColors[1][0] = 45;
sIconPrimColors[1][1] = 125;
sIconPrimColors[1][2] = 255;
sIconEnvColors[0][0] = 0;
sIconEnvColors[0][1] = 0;
sIconEnvColors[0][2] = 0;
sIconEnvColors[1][0] = 0;
sIconEnvColors[1][1] = 70;
sIconEnvColors[1][2] = 255;
} else if (CVar_GetS32("gHudColors", 1) == 1) {
sIconPrimColors[0][0] = 4;
sIconPrimColors[0][1] = 200;
sIconPrimColors[0][2] = 80;
sIconPrimColors[1][0] = 50;
sIconPrimColors[1][1] = 255;
sIconPrimColors[1][2] = 130;
sIconEnvColors[0][0] = 0;
sIconEnvColors[0][1] = 0;
sIconEnvColors[0][2] = 0;
sIconEnvColors[1][0] = 0;
sIconEnvColors[1][1] = 255;
sIconEnvColors[1][2] = 130;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
sIconPrimColors[0][0] = (CVar_GetS32("gCCABtnPrimR", 50)/255)*95;
sIconPrimColors[0][1] = (CVar_GetS32("gCCABtnPrimG", 255)/255)*95;
sIconPrimColors[0][2] = (CVar_GetS32("gCCABtnPrimB", 130)/255)*95;
sIconPrimColors[1][0] = CVar_GetS32("gCCABtnPrimR", 50);
sIconPrimColors[1][1] = CVar_GetS32("gCCABtnPrimG", 255);
sIconPrimColors[1][2] = CVar_GetS32("gCCABtnPrimB", 130);
sIconEnvColors[0][0] = 0;
sIconEnvColors[0][1] = 0;
sIconEnvColors[0][2] = 0;
sIconEnvColors[1][0] = 10;
sIconEnvColors[1][1] = 10;
sIconEnvColors[1][2] = 10;
}
MessageContext* msgCtx = &globalCtx->msgCtx; MessageContext* msgCtx = &globalCtx->msgCtx;
Font* font = &msgCtx->font; Font* font = &msgCtx->font;
Gfx* gfx = *p; Gfx* gfx = *p;
@ -1841,6 +1888,7 @@ void Message_DrawTextBox(GlobalContext* globalCtx, Gfx** p) {
MessageContext* msgCtx = &globalCtx->msgCtx; MessageContext* msgCtx = &globalCtx->msgCtx;
Gfx* gfx = *p; Gfx* gfx = *p;
gSPInvalidateTexCache(gfx++, msgCtx->textboxSegment);
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
gDPSetPrimColor(gfx++, 0, 0, msgCtx->textboxColorRed, msgCtx->textboxColorGreen, msgCtx->textboxColorBlue, gDPSetPrimColor(gfx++, 0, 0, msgCtx->textboxColorRed, msgCtx->textboxColorGreen, msgCtx->textboxColorBlue,
msgCtx->textboxColorAlphaCurrent); msgCtx->textboxColorAlphaCurrent);
@ -2826,12 +2874,22 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
gDPPipeSync(gfx++); gDPPipeSync(gfx++);
if (sOcarinaNoteBuf[i] == OCARINA_NOTE_A) { if (sOcarinaNoteBuf[i] == OCARINA_NOTE_A) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteAPrimR, sOcarinaNoteAPrimG, sOcarinaNoteAPrimB, if (CVar_GetS32("gHudColors", 1) == 0) { //A buttons :)
sOcarinaNotesAlphaValues[i]); gDPSetPrimColor(gfx++, 0, 0, 80, 150, 255, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteAPrimR, sOcarinaNoteAPrimG, sOcarinaNoteAPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCABtnPrimR", 0), CVar_GetS32("gCCABtnPrimG", 0), CVar_GetS32("gCCABtnPrimB", 0), sOcarinaNotesAlphaValues[i]);
}
gDPSetEnvColor(gfx++, sOcarinaNoteAEnvR, sOcarinaNoteAEnvG, sOcarinaNoteAEnvB, 0); gDPSetEnvColor(gfx++, sOcarinaNoteAEnvR, sOcarinaNoteAEnvG, sOcarinaNoteAEnvB, 0);
} else { } else {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, if (CVar_GetS32("gHudColors", 1) == 0) { //C buttons :)
sOcarinaNotesAlphaValues[i]); gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(gfx++, 0, 0, sOcarinaNoteCPrimR, sOcarinaNoteCPrimG, sOcarinaNoteCPrimB, sOcarinaNotesAlphaValues[i]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(gfx++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 0), CVar_GetS32("gCCCBtnPrimG", 0), CVar_GetS32("gCCCBtnPrimB", 0), sOcarinaNotesAlphaValues[i]);
}
gDPSetEnvColor(gfx++, sOcarinaNoteCEnvR, sOcarinaNoteCEnvG, sOcarinaNoteCEnvB, 0); gDPSetEnvColor(gfx++, sOcarinaNoteCEnvR, sOcarinaNoteCEnvG, sOcarinaNoteCEnvB, 0);
} }

View File

@ -15,6 +15,11 @@
#define DO_ACTION_TEX_HEIGHT 16 #define DO_ACTION_TEX_HEIGHT 16
#define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex)) #define DO_ACTION_TEX_SIZE ((DO_ACTION_TEX_WIDTH * DO_ACTION_TEX_HEIGHT) / 2) // (sizeof(gCheckDoActionENGTex))
s16 Top_HUD_Margin = 0;
s16 Left_HUD_Margin = 0;
s16 Right_HUD_Margin = 0;
s16 Bottom_HUD_Margin = 0;
typedef struct { typedef struct {
/* 0x00 */ u8 scene; /* 0x00 */ u8 scene;
/* 0x01 */ u8 flags1; /* 0x01 */ u8 flags1;
@ -1803,7 +1808,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
} }
} }
} else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) { } else if ((item >= ITEM_WEIRD_EGG) && (item <= ITEM_CLAIM_CHECK)) {
if (item == ITEM_SAW) { if ((item == ITEM_SAW) && CVar_GetS32("gDekuNutUpgradeFix", 0) == 0) {
gSaveContext.itemGetInf[1] |= 0x8000; gSaveContext.itemGetInf[1] |= 0x8000;
} }
@ -2159,6 +2164,7 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) {
if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling && if (((naviCallState == 0x1D) || (naviCallState == 0x1E)) && !interfaceCtx->naviCalling &&
(globalCtx->csCtx.state == CS_STATE_IDLE)) { (globalCtx->csCtx.state == CS_STATE_IDLE)) {
if (!CVar_GetS32("gDisableNaviCallAudio", 0)) {
// clang-format off // clang-format off
if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4, if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &D_801333D4, 4,
&D_801333E0, &D_801333E0, &D_801333E8); } &D_801333E0, &D_801333E0, &D_801333E8); }
@ -2167,6 +2173,7 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) {
if (naviCallState == 0x1D) { if (naviCallState == 0x1D) {
func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32);
} }
}
interfaceCtx->naviCalling = 1; interfaceCtx->naviCalling = 1;
sCUpInvisible = 0; sCUpInvisible = 0;
@ -2441,6 +2448,25 @@ void Interface_UpdateMagicBar(GlobalContext* globalCtx) {
{ 255, 255, 150 }, { 255, 255, 150 },
{ 255, 255, 50 }, { 255, 255, 50 },
}; };
if (CVar_GetS32("gHudColors", 1) == 2) { //This will make custom color based on users selected colors.
sMagicBorderColors[0][0] = CVar_GetS32("gCCMagicBorderPrimR", 255);
sMagicBorderColors[0][1] = CVar_GetS32("gCCMagicBorderPrimG", 255);
sMagicBorderColors[0][2] = CVar_GetS32("gCCMagicBorderPrimB", 255);
sMagicBorderColors[1][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/2;
sMagicBorderColors[1][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/2;
sMagicBorderColors[1][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/2;
sMagicBorderColors[2][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/3;
sMagicBorderColors[2][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/3;
sMagicBorderColors[2][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/3;
sMagicBorderColors[3][0] = CVar_GetS32("gCCMagicBorderPrimR", 255)/2;
sMagicBorderColors[3][1] = CVar_GetS32("gCCMagicBorderPrimG", 255)/2;
sMagicBorderColors[3][2] = CVar_GetS32("gCCMagicBorderPrimB", 255)/2;
}
static s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 }; static s16 sMagicBorderIndexes[] = { 0, 1, 1, 0 };
static s16 sMagicBorderRatio = 2; static s16 sMagicBorderRatio = 2;
static s16 sMagicBorderStep = 1; static s16 sMagicBorderStep = 1;
@ -2631,27 +2657,31 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) {
if (gSaveContext.magicLevel != 0) { if (gSaveContext.magicLevel != 0) {
if (gSaveContext.healthCapacity > 0xA0) { if (gSaveContext.healthCapacity > 0xA0) {
magicBarY = R_MAGIC_BAR_LARGE_Y; magicBarY = R_MAGIC_BAR_LARGE_Y + (Top_HUD_Margin*-1);
} else { } else {
magicBarY = R_MAGIC_BAR_SMALL_Y; magicBarY = R_MAGIC_BAR_SMALL_Y + (Top_HUD_Margin*-1);
} }
func_80094520(globalCtx->state.gfxCtx); func_80094520(globalCtx->state.gfxCtx);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, sMagicBorderR, sMagicBorderG, sMagicBorderB, interfaceCtx->magicAlpha);
if (CVar_GetS32("gHudColors", 1) == 2) {//Original game add color there so to prevent miss match we make it all white :)
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
} else {
gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255); gDPSetEnvColor(OVERLAY_DISP++, 100, 50, 50, 255);
}
OVERLAY_DISP = OVERLAY_DISP =
Gfx_TextureIA8(OVERLAY_DISP, gMagicBarEndTex, 8, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X), Gfx_TextureIA8(OVERLAY_DISP, gMagicBarEndTex, 8, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1)),
magicBarY, 8, 16, 1 << 10, 1 << 10); magicBarY, 8, 16, 1 << 10, 1 << 10);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicBarMidTex, 24, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X) + 8, magicBarY, OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicBarMidTex, 24, 16, OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1)) + 8, magicBarY,
gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10); gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10);
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicBarEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 16, 0, gDPLoadTextureBlock(OVERLAY_DISP++, gMagicBarEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 16, 0,
G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
const s16 rMagicBarX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X); const s16 rMagicBarX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_BAR_X + (Left_HUD_Margin*-1));
gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2, gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2,
((rMagicBarX + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE, ((rMagicBarX + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE,
@ -2662,11 +2692,15 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) {
ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE); ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
const s16 rMagicFillX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_FILL_X); const s16 rMagicFillX = OTRGetRectDimensionFromLeftEdge(R_MAGIC_FILL_X + (Left_HUD_Margin*-1));
if (gSaveContext.unk_13F0 == 4) { if (gSaveContext.unk_13F0 == 4) {
// Yellow part of the bar indicating the amount of magic to be subtracted // Yellow part of the bar indicating the amount of magic to be subtracted
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicUsePrimR", 250), CVar_GetS32("gCCMagicUsePrimG", 250), CVar_GetS32("gCCMagicUsePrimB", 0), interfaceCtx->magicAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 250, 0, interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 250, 250, 0, interfaceCtx->magicAlpha);
}
gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicBarFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0, gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicBarFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
@ -2678,16 +2712,22 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) {
// Fill the rest of the bar with the normal magic color // Fill the rest of the bar with the normal magic color
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 2) {
interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicPrimR", 0), CVar_GetS32("gCCMagicPrimG", 200), CVar_GetS32("gCCMagicPrimB", 0), interfaceCtx->magicAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha);
}
gSPWideTextureRectangle(OVERLAY_DISP++, rMagicFillX << 2, (magicBarY + 3) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, rMagicFillX << 2, (magicBarY + 3) << 2,
(rMagicFillX + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, (rMagicFillX + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE,
0, 0, 1 << 10, 1 << 10); 0, 0, 1 << 10, 1 << 10);
} else { } else {
// Fill the whole bar with the normal magic color // Fill the whole bar with the normal magic color
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 2) {
interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCMagicPrimR", 0), CVar_GetS32("gCCMagicPrimG", 200), CVar_GetS32("gCCMagicPrimB", 0), interfaceCtx->magicAlpha);
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_MAGIC_FILL_COLOR(0), R_MAGIC_FILL_COLOR(1), R_MAGIC_FILL_COLOR(2), interfaceCtx->magicAlpha);
}
gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicBarFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0, gDPLoadMultiBlock_4b(OVERLAY_DISP++, gMagicBarFillTex, 0, G_TX_RENDERTILE, G_IM_FMT_I, 16, 16, 0,
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
@ -2761,51 +2801,83 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
s16 width; s16 width;
s16 height; s16 height;
s16 C_Left_BTN_Pos[] = { C_LEFT_BUTTON_X+Right_HUD_Margin, C_LEFT_BUTTON_Y+(Top_HUD_Margin*-1) }; //(X,Y)
s16 C_Right_BTN_Pos[] = { C_RIGHT_BUTTON_X+Right_HUD_Margin, C_RIGHT_BUTTON_Y+(Top_HUD_Margin*-1) };
s16 C_Up_BTN_Pos[] = { C_UP_BUTTON_X+Right_HUD_Margin, C_UP_BUTTON_Y+(Top_HUD_Margin*-1) };
s16 C_Down_BTN_Pos[] = { C_DOWN_BUTTON_X+Right_HUD_Margin, C_DOWN_BUTTON_Y+(Top_HUD_Margin*-1) };
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 2900); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 2900);
// B Button Color & Texture // B Button Color & Texture
// Also loads the Item Button Texture reused by other buttons afterwards // Also loads the Item Button Texture reused by other buttons afterwards
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 150, 0, interfaceCtx->bAlpha);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), interfaceCtx->bAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_B_BTN_COLOR(0), R_B_BTN_COLOR(1), R_B_BTN_COLOR(2), interfaceCtx->bAlpha);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCBBtnPrimR", R_B_BTN_COLOR(0)), CVar_GetS32("gCCBBtnPrimG", R_B_BTN_COLOR(1)), CVar_GetS32("gCCBBtnPrimB", R_B_BTN_COLOR(2)), interfaceCtx->bAlpha);
}
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
OVERLAY_DISP = OVERLAY_DISP =
Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(0)), R_ITEM_BTN_Y(0), Gfx_TextureIA8(OVERLAY_DISP, gButtonBackgroundTex, 32, 32, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(0)+Right_HUD_Margin), R_ITEM_BTN_Y(0)+(Top_HUD_Margin*-1),
R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) << 1, R_ITEM_BTN_DD(0) << 1); R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_WIDTH(0), R_ITEM_BTN_DD(0) << 1, R_ITEM_BTN_DD(0) << 1);
// C-Left Button Color & Texture // C-Left Button Color & Texture
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 0) {
interfaceCtx->cLeftAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha);
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(1)) << 2, R_ITEM_BTN_Y(1) << 2, } else if (CVar_GetS32("gHudColors", 1) == 1) {
(OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(1)) + R_ITEM_BTN_WIDTH(1)) << 2, gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cLeftAlpha);
(R_ITEM_BTN_Y(1) + R_ITEM_BTN_WIDTH(1)) << 2, } else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cLeftAlpha);
}
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Left_BTN_Pos[0]) << 2, C_Left_BTN_Pos[1] << 2,
(OTRGetRectDimensionFromRightEdge(C_Left_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(1)) << 2,
(C_Left_BTN_Pos[1] + R_ITEM_BTN_WIDTH(1)) << 2,
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) << 1, R_ITEM_BTN_DD(1) << 1); G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(1) << 1, R_ITEM_BTN_DD(1) << 1);
// C-Down Button Color & Texture // C-Down Button Color & Texture
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 0) {
interfaceCtx->cDownAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha);
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(2)) << 2, R_ITEM_BTN_Y(2) << 2, } else if (CVar_GetS32("gHudColors", 1) == 1) {
(OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(2)) + R_ITEM_BTN_WIDTH(2)) << 2, gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cDownAlpha);
(R_ITEM_BTN_Y(2) + R_ITEM_BTN_WIDTH(2)) << 2, } else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cDownAlpha);
}
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Down_BTN_Pos[0]) << 2, C_Down_BTN_Pos[1] << 2,
(OTRGetRectDimensionFromRightEdge(C_Down_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(2)) << 2,
(C_Down_BTN_Pos[1] + R_ITEM_BTN_WIDTH(2)) << 2,
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) << 1, R_ITEM_BTN_DD(2) << 1); G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(2) << 1, R_ITEM_BTN_DD(2) << 1);
// C-Right Button Color & Texture // C-Right Button Color & Texture
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 0) {
interfaceCtx->cRightAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha);
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(3)) << 2, R_ITEM_BTN_Y(3) << 2, } else if (CVar_GetS32("gHudColors", 1) == 1) {
(OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(3)) + R_ITEM_BTN_WIDTH(3)) << 2, gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), interfaceCtx->cRightAlpha);
(R_ITEM_BTN_Y(3) + R_ITEM_BTN_WIDTH(3)) << 2, } else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cRightAlpha);
}
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(C_Right_BTN_Pos[0]) << 2, C_Right_BTN_Pos[1] << 2,
(OTRGetRectDimensionFromRightEdge(C_Right_BTN_Pos[0]) + R_ITEM_BTN_WIDTH(3)) << 2,
(C_Right_BTN_Pos[1] + R_ITEM_BTN_WIDTH(3)) << 2,
G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1); G_TX_RENDERTILE, 0, 0, R_ITEM_BTN_DD(3) << 1, R_ITEM_BTN_DD(3) << 1);
if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) { if ((pauseCtx->state < 8) || (pauseCtx->state >= 18)) {
if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) { if ((globalCtx->pauseCtx.state != 0) || (globalCtx->pauseCtx.debugState != 0)) {
// Start Button Texture, Color & Label // Start Button Texture, Color & Label
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 0, 0, interfaceCtx->startAlpha);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 120, 120, interfaceCtx->startAlpha);
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]) << 2, 68, } else if (CVar_GetS32("gHudColors", 1) == 2) {
(OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]) + 22) << 2, 156, gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCStartBtnPrimR", 120), CVar_GetS32("gCCStartBtnPrimG", 120), CVar_GetS32("gCCStartBtnPrimB", 120), interfaceCtx->startAlpha);
}
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]+Right_HUD_Margin) << 2, 68+((Top_HUD_Margin*-1)*4),
(OTRGetRectDimensionFromRightEdge(startButtonLeftPos[gSaveContext.language]+Right_HUD_Margin) + 22) << 2, 156+((Top_HUD_Margin*-1)*4),
G_TX_RENDERTILE, 0, 0, 1462, 1462); G_TX_RENDERTILE, 0, 0, 1462, 1462);
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->startAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->startAlpha);
@ -2813,6 +2885,25 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
//There is probably a more elegant way to do it.
char* doAction = actionsTbl[3];
char newName[512];
if (gSaveContext.language != LANGUAGE_ENG) {
size_t length = strlen(doAction);
strcpy(newName, doAction);
if (gSaveContext.language == LANGUAGE_FRA) {
newName[length - 6] = 'F';
newName[length - 5] = 'R';
newName[length - 4] = 'A';
} else if (gSaveContext.language == LANGUAGE_GER) {
newName[length - 6] = 'G';
newName[length - 5] = 'E';
newName[length - 4] = 'R';
}
doAction = newName;
}
memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, ResourceMgr_LoadTexByName(doAction), DO_ACTION_TEX_SIZE);
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA, gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA,
DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
@ -2820,11 +2911,11 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
dxdy = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); dxdy = (1 << 10) / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
width = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); width = DO_ACTION_TEX_WIDTH / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
height = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f); height = DO_ACTION_TEX_HEIGHT / (R_START_LABEL_DD(gSaveContext.language) / 100.0f);
const s16 rStartLabelX = OTRGetRectDimensionFromRightEdge(R_START_LABEL_X(gSaveContext.language)); const s16 rStartLabelX = OTRGetRectDimensionFromRightEdge(R_START_LABEL_X(gSaveContext.language)+Right_HUD_Margin);
gSPWideTextureRectangle( gSPWideTextureRectangle(
OVERLAY_DISP++, rStartLabelX << 2, OVERLAY_DISP++, rStartLabelX << 2,
R_START_LABEL_Y(gSaveContext.language) << 2, (rStartLabelX + width) << 2, R_START_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) << 2, (rStartLabelX + width) << 2,
(R_START_LABEL_Y(gSaveContext.language) + height) << 2, G_TX_RENDERTILE, 0, 0, dxdy, dxdy); (R_START_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) + height) << 2, G_TX_RENDERTILE, 0, 0, dxdy, dxdy);
} }
} }
@ -2843,12 +2934,18 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
temp = interfaceCtx->healthAlpha; temp = interfaceCtx->healthAlpha;
} }
const s16 rCUpBtnX = OTRGetRectDimensionFromRightEdge(R_C_UP_BTN_X); const s16 rCUpBtnX = OTRGetRectDimensionFromRightEdge(R_C_UP_BTN_X+Right_HUD_Margin);
const s16 rCUPIconX = OTRGetRectDimensionFromRightEdge(R_C_UP_ICON_X); const s16 rCUPIconX = OTRGetRectDimensionFromRightEdge(R_C_UP_ICON_X+Right_HUD_Margin);
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), temp);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), temp);
}
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gSPWideTextureRectangle(OVERLAY_DISP++, rCUpBtnX << 2, R_C_UP_BTN_Y << 2, (rCUpBtnX + 16) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, rCUpBtnX << 2, R_C_UP_BTN_Y+(Top_HUD_Margin*-1) << 2, (rCUpBtnX + 16) << 2,
(R_C_UP_BTN_Y + 16) << 2, G_TX_RENDERTILE, 0, 0, 2 << 10, 2 << 10); (R_C_UP_BTN_Y+(Top_HUD_Margin*-1) + 16) << 2, G_TX_RENDERTILE, 0, 0, 2 << 10, 2 << 10);
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, temp); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, temp);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
@ -2859,8 +2956,8 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD); G_TX_NOLOD, G_TX_NOLOD);
gSPWideTextureRectangle(OVERLAY_DISP++, rCUPIconX << 2, R_C_UP_ICON_Y << 2, (rCUPIconX + 32) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, rCUPIconX << 2, R_C_UP_ICON_Y+(Top_HUD_Margin*-1) << 2, (rCUPIconX + 32) << 2,
(R_C_UP_ICON_Y + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); (R_C_UP_ICON_Y+(Top_HUD_Margin*-1) + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
} }
sCUpTimer--; sCUpTimer--;
@ -2886,8 +2983,13 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
interfaceCtx->cRightAlpha); interfaceCtx->cRightAlpha);
} }
if (CVar_GetS32("gHudColors", 1) == 2) {
//This later will feature color per C button right now that it.
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), interfaceCtx->cRightAlpha);
}
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex), 32, 32, OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, ((u8*)gButtonBackgroundTex), 32, 32,
OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)), R_ITEM_BTN_Y(temp), R_ITEM_BTN_WIDTH(temp), OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)+Right_HUD_Margin), R_ITEM_BTN_Y(temp)+(Top_HUD_Margin*-1), R_ITEM_BTN_WIDTH(temp),
R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1); R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1);
const char* cButtonIcons[] = { gButtonBackgroundTex, gEquippedItemOutlineTex, gEmptyCLeftArrowTex, const char* cButtonIcons[] = { gButtonBackgroundTex, gEquippedItemOutlineTex, gEmptyCLeftArrowTex,
@ -2895,7 +2997,7 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) {
}; };
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, cButtonIcons[(temp + 1)], 32, 32, OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, cButtonIcons[(temp + 1)], 32, 32,
OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)), R_ITEM_BTN_Y(temp), R_ITEM_BTN_WIDTH(temp), OTRGetRectDimensionFromRightEdge(R_ITEM_BTN_X(temp)+Right_HUD_Margin), R_ITEM_BTN_Y(temp)+(Top_HUD_Margin*-1), R_ITEM_BTN_WIDTH(temp),
R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1); R_ITEM_BTN_WIDTH(temp), R_ITEM_BTN_DD(temp) << 1, R_ITEM_BTN_DD(temp) << 1);
} }
} }
@ -2909,9 +3011,9 @@ void Interface_DrawItemIconTexture(GlobalContext* globalCtx, void* texture, s16
gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, gDPLoadTextureBlock(OVERLAY_DISP++, texture, G_IM_FMT_RGBA, G_IM_SIZ_32b, 32, 32, 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); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_ICON_X(button)) << 2, R_ITEM_ICON_Y(button) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, OTRGetRectDimensionFromRightEdge(R_ITEM_ICON_X(button)+Right_HUD_Margin) << 2, R_ITEM_ICON_Y(button)+(Top_HUD_Margin*-1) << 2,
(OTRGetRectDimensionFromRightEdge(R_ITEM_ICON_X(button)) + R_ITEM_ICON_WIDTH(button)) << 2, (OTRGetRectDimensionFromRightEdge(R_ITEM_ICON_X(button)+Right_HUD_Margin) + R_ITEM_ICON_WIDTH(button)) << 2,
(R_ITEM_ICON_Y(button) + R_ITEM_ICON_WIDTH(button)) << 2, G_TX_RENDERTILE, 0, 0, (R_ITEM_ICON_Y(button)+(Top_HUD_Margin*-1) + R_ITEM_ICON_WIDTH(button)) << 2, G_TX_RENDERTILE, 0, 0,
R_ITEM_ICON_DD(button) << 1, R_ITEM_ICON_DD(button) << 1); R_ITEM_ICON_DD(button) << 1, R_ITEM_ICON_DD(button) << 1);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3094); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3094);
@ -2972,11 +3074,11 @@ void Interface_DrawAmmoCount(GlobalContext* globalCtx, s16 button, s16 alpha) {
if (i != 0) { if (i != 0) {
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[i], 8, 8, OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[i], 8, 8,
OTRGetRectDimensionFromRightEdge(R_ITEM_AMMO_X(button)), R_ITEM_AMMO_Y(button), 8, 8, 1 << 10, 1 << 10); OTRGetRectDimensionFromRightEdge(R_ITEM_AMMO_X(button)+Right_HUD_Margin), R_ITEM_AMMO_Y(button)+(Top_HUD_Margin*-1), 8, 8, 1 << 10, 1 << 10);
} }
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ammo], 8, 8, OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, (u8*)_gAmmoDigit0Tex[ammo], 8, 8,
OTRGetRectDimensionFromRightEdge(R_ITEM_AMMO_X(button)) + 6, R_ITEM_AMMO_Y(button), 8, 8, 1 << 10, 1 << 10); OTRGetRectDimensionFromRightEdge(R_ITEM_AMMO_X(button)+Right_HUD_Margin) + 6, R_ITEM_AMMO_Y(button)+(Top_HUD_Margin*-1), 8, 8, 1 << 10, 1 << 10);
} }
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3158); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3158);
@ -3195,10 +3297,16 @@ void Interface_Draw(GlobalContext* globalCtx) {
rColor = &rupeeWalletColors[0]; rColor = &rupeeWalletColors[0];
} }
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCRupeePrimR", rColor[0]), CVar_GetS32("gCCRupeePrimG", rColor[1]), CVar_GetS32("gCCRupeePrimB", rColor[2]), interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); //We reset this here so it match user color :)
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), }
206, 16, 16, 1 << 10, 1 << 10);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26+(Left_HUD_Margin*-1)),
206+(Bottom_HUD_Margin), 16, 16, 1 << 10, 1 << 10);
switch (globalCtx->sceneNum) { switch (globalCtx->sceneNum) {
case SCENE_BMORI1: case SCENE_BMORI1:
@ -3218,9 +3326,15 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) { if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) {
// Small Key Icon // Small Key Icon
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCKeysPrimR", 200), CVar_GetS32("gCCKeysPrimG", 230), CVar_GetS32("gCCKeysPrimB", 255), interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); //We reset this here so it match user color :)
} else {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 230, 255, interfaceCtx->magicAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 230, 255, interfaceCtx->magicAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), 190, 16, 16, }
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26+(Left_HUD_Margin*-1)), 190+(Bottom_HUD_Margin), 16, 16,
1 << 10, 1 << 10); 1 << 10, 1 << 10);
// Small Key Counter // Small Key Counter
@ -3237,17 +3351,17 @@ void Interface_Draw(GlobalContext* globalCtx) {
interfaceCtx->counterDigits[3] -= 10; interfaceCtx->counterDigits[3] -= 10;
} }
svar3 = OTRGetRectDimensionFromLeftEdge(42); svar3 = OTRGetRectDimensionFromLeftEdge(42+(Left_HUD_Margin*-1));
if (interfaceCtx->counterDigits[2] != 0) { if (interfaceCtx->counterDigits[2] != 0) {
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8,
16, svar3, 190, 8, 16, 1 << 10, 1 << 10); 16, svar3, 190+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10);
svar3 += 8; svar3 += 8;
} }
OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP,
((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16,
svar3, 190, 8, 16, 1 << 10, 1 << 10); svar3, 190+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10);
} }
break; break;
default: default:
@ -3291,7 +3405,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) { for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) {
OVERLAY_DISP = OVERLAY_DISP =
Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16,
OTRGetRectDimensionFromLeftEdge(svar3), 206, 8, 16, 1 << 10, 1 << 10); OTRGetRectDimensionFromLeftEdge(svar3+(Left_HUD_Margin*-1)), 206+(Bottom_HUD_Margin), 8, 16, 1 << 10, 1 << 10);
} }
} }
else { else {
@ -3353,8 +3467,8 @@ void Interface_Draw(GlobalContext* globalCtx) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
R_B_LABEL_DD = (1 << 10) / (WREG(37 + gSaveContext.language) / 100.0f); R_B_LABEL_DD = (1 << 10) / (WREG(37 + gSaveContext.language) / 100.0f);
const s16 rBLabelX = OTRGetRectDimensionFromRightEdge(R_B_LABEL_X(gSaveContext.language)); const s16 rBLabelX = OTRGetRectDimensionFromRightEdge(R_B_LABEL_X(gSaveContext.language)+Right_HUD_Margin);
gSPWideTextureRectangle(OVERLAY_DISP++, rBLabelX << 2, R_B_LABEL_Y(gSaveContext.language) << 2, gSPWideTextureRectangle(OVERLAY_DISP++, rBLabelX << 2, R_B_LABEL_Y(gSaveContext.language)+(Top_HUD_Margin*-1) << 2,
(rBLabelX + DO_ACTION_TEX_WIDTH) << 2, (rBLabelX + DO_ACTION_TEX_WIDTH) << 2,
(R_B_LABEL_Y(gSaveContext.language) + DO_ACTION_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0, (R_B_LABEL_Y(gSaveContext.language) + DO_ACTION_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0,
R_B_LABEL_DD, R_B_LABEL_DD); R_B_LABEL_DD, R_B_LABEL_DD);
@ -3401,24 +3515,29 @@ void Interface_Draw(GlobalContext* globalCtx) {
// A Button // A Button
func_80094A14(globalCtx->state.gfxCtx); func_80094A14(globalCtx->state.gfxCtx);
const f32 rABtnX = OTRGetDimensionFromRightEdge(R_A_BTN_X); const f32 rABtnX = OTRGetDimensionFromRightEdge(R_A_BTN_X+Right_HUD_Margin);
//func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, rABtnX, rABtnX + 45); //func_8008A8B8(globalCtx, R_A_BTN_Y, R_A_BTN_Y + 45, rABtnX, rABtnX + 45);
gSPClearGeometryMode(OVERLAY_DISP++, G_CULL_BOTH); gSPClearGeometryMode(OVERLAY_DISP++, G_CULL_BOTH);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2), if (CVar_GetS32("gHudColors", 1) == 0) {
interfaceCtx->aAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 90, 90, 255, interfaceCtx->aAlpha);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2), interfaceCtx->aAlpha);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", R_A_BTN_COLOR(0)), CVar_GetS32("gCCABtnPrimG", R_A_BTN_COLOR(1)), CVar_GetS32("gCCABtnPrimB", R_A_BTN_COLOR(2)), interfaceCtx->aAlpha);
}
if (fullUi) { if (fullUi) {
Interface_DrawActionButton(globalCtx, rABtnX, R_A_BTN_Y); Interface_DrawActionButton(globalCtx, rABtnX, R_A_BTN_Y+(Top_HUD_Margin*-1));
} }
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
const f32 rAIconX = OTRGetDimensionFromRightEdge(R_A_ICON_X); const f32 rAIconX = OTRGetDimensionFromRightEdge(R_A_ICON_X+Right_HUD_Margin);
//func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, rAIconX, rAIconX + 45); //func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, rAIconX, rAIconX + 45);
gSPSetGeometryMode(OVERLAY_DISP++, G_CULL_BACK); gSPSetGeometryMode(OVERLAY_DISP++, G_CULL_BACK);
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->aAlpha);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
Matrix_Translate(-138.0f + rAIconX, 98.0f - R_A_ICON_Y, WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW); Matrix_Translate(-138.0f + rAIconX, 98.0f - (R_A_ICON_Y+(Top_HUD_Margin*-1)), WREG(46 + gSaveContext.language) / 10.0f, MTXMODE_NEW);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY); Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY); Matrix_RotateX(interfaceCtx->unk_1F4 / 10000.0f, MTXMODE_APPLY);
gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701), gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_parameter.c", 3701),
@ -3987,6 +4106,18 @@ void Interface_Update(GlobalContext* globalCtx) {
u16 action; u16 action;
Input* debugInput = &globalCtx->state.input[2]; Input* debugInput = &globalCtx->state.input[2];
if (CVar_GetS32("gHUDMargins", 0) != 0) {
Top_HUD_Margin = CVar_GetS32("gHUDMargin_T", 0);
Left_HUD_Margin = CVar_GetS32("gHUDMargin_L", 0);
Right_HUD_Margin = CVar_GetS32("gHUDMargin_R", 0);
Bottom_HUD_Margin = CVar_GetS32("gHUDMargin_B", 0);
} else {
Top_HUD_Margin = 0;
Left_HUD_Margin = 0;
Right_HUD_Margin = 0;
Bottom_HUD_Margin = 0;
}
if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) { if (CHECK_BTN_ALL(debugInput->press.button, BTN_DLEFT)) {
gSaveContext.language = LANGUAGE_ENG; gSaveContext.language = LANGUAGE_ENG;
osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language); osSyncPrintf("J_N=%x J_N=%x\n", gSaveContext.language, &gSaveContext.language);

View File

@ -744,24 +744,25 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
#else #else
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[eyeIndex])); gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[eyeIndex]));
#endif #endif
Color_RGB8 sTemp; Color_RGB8 NewColor[3];
color = &sTemp; color = &sTunicColors[tunic];
if (tunic == PLAYER_TUNIC_KOKIRI) { if (CVar_GetS32("gUseTunicsCol",0) == 1) {
color->r = CVar_GetS32("gTunic_Kokiri_Red", sTunicColors[PLAYER_TUNIC_KOKIRI].r); if (tunic == PLAYER_TUNIC_KOKIRI || tunic == PLAYER_TUNIC_GORON || tunic == PLAYER_TUNIC_ZORA) {
color->g = CVar_GetS32("gTunic_Kokiri_Green", sTunicColors[PLAYER_TUNIC_KOKIRI].g); NewColor[PLAYER_TUNIC_KOKIRI].r = CVar_GetS32("gTunic_Kokiri_R", sTunicColors[PLAYER_TUNIC_KOKIRI].r);
color->b = CVar_GetS32("gTunic_Kokiri_Blue", sTunicColors[PLAYER_TUNIC_KOKIRI].b); NewColor[PLAYER_TUNIC_KOKIRI].g = CVar_GetS32("gTunic_Kokiri_G", sTunicColors[PLAYER_TUNIC_KOKIRI].g);
} else if (tunic == PLAYER_TUNIC_GORON) { NewColor[PLAYER_TUNIC_KOKIRI].b = CVar_GetS32("gTunic_Kokiri_B", sTunicColors[PLAYER_TUNIC_KOKIRI].b);
color->r = CVar_GetS32("gTunic_Goron_Red", sTunicColors[PLAYER_TUNIC_GORON].r); NewColor[PLAYER_TUNIC_GORON].r = CVar_GetS32("gTunic_Goron_R", sTunicColors[PLAYER_TUNIC_GORON].r);
color->g = CVar_GetS32("gTunic_Goron_Green", sTunicColors[PLAYER_TUNIC_GORON].g); NewColor[PLAYER_TUNIC_GORON].g = CVar_GetS32("gTunic_Goron_G", sTunicColors[PLAYER_TUNIC_GORON].g);
color->b = CVar_GetS32("gTunic_Goron_Blue", sTunicColors[PLAYER_TUNIC_GORON].b); NewColor[PLAYER_TUNIC_GORON].b = CVar_GetS32("gTunic_Goron_B", sTunicColors[PLAYER_TUNIC_GORON].b);
} else if (tunic == PLAYER_TUNIC_ZORA) { NewColor[PLAYER_TUNIC_ZORA].r = CVar_GetS32("gTunic_Zora_R", sTunicColors[PLAYER_TUNIC_ZORA].r);
color->r = CVar_GetS32("gTunic_Zora_Red", sTunicColors[PLAYER_TUNIC_ZORA].r); NewColor[PLAYER_TUNIC_ZORA].g = CVar_GetS32("gTunic_Zora_G", sTunicColors[PLAYER_TUNIC_ZORA].g);
color->g = CVar_GetS32("gTunic_Zora_Green", sTunicColors[PLAYER_TUNIC_ZORA].g); NewColor[PLAYER_TUNIC_ZORA].b = CVar_GetS32("gTunic_Zora_B", sTunicColors[PLAYER_TUNIC_ZORA].b);
color->b = CVar_GetS32("gTunic_Zora_Blue", sTunicColors[PLAYER_TUNIC_ZORA].b);
} else { } else {
color->r = CVar_GetS32("gTunic_Kokiri_Red", sTunicColors[PLAYER_TUNIC_KOKIRI].r); NewColor[PLAYER_TUNIC_KOKIRI].r = CVar_GetS32("gTunic_Kokiri_R", sTunicColors[PLAYER_TUNIC_KOKIRI].r);
color->g = CVar_GetS32("gTunic_Kokiri_Green", sTunicColors[PLAYER_TUNIC_KOKIRI].g); NewColor[PLAYER_TUNIC_KOKIRI].g = CVar_GetS32("gTunic_Kokiri_G", sTunicColors[PLAYER_TUNIC_KOKIRI].g);
color->b = CVar_GetS32("gTunic_Kokiri_Blue", sTunicColors[PLAYER_TUNIC_KOKIRI].b); NewColor[PLAYER_TUNIC_KOKIRI].b = CVar_GetS32("gTunic_Kokiri_B", sTunicColors[PLAYER_TUNIC_KOKIRI].b);
}
color = NewColor;
} }
gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0); gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0);

View File

@ -836,7 +836,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
for (i = 0; i < ARRAY_COUNTU(sZeldaMagic) - 3; i++) { for (i = 0; i < ARRAY_COUNTU(sZeldaMagic) - 3; i++) {
if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != sramCtx->readBuff[i + SRAM_HEADER_MAGIC]) { if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != sramCtx->readBuff[i + SRAM_HEADER_MAGIC]) {
osSyncPrintf("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !" osSyncPrintf("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !"
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; gSaveContext.language = CVar_GetS32("gLanguages", 0);
memcpy(sramCtx->readBuff, sZeldaMagic, sizeof(sZeldaMagic)); memcpy(sramCtx->readBuff, sZeldaMagic, sizeof(sZeldaMagic));
sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language; sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language;
Sram_WriteSramHeader(sramCtx); Sram_WriteSramHeader(sramCtx);
@ -845,7 +845,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3; gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3;
gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1; gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1;
gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; gSaveContext.language = CVar_GetS32("gLanguages", 0);
if (gSaveContext.language >= LANGUAGE_MAX) { if (gSaveContext.language >= LANGUAGE_MAX) {
gSaveContext.language = LANGUAGE_ENG; gSaveContext.language = LANGUAGE_ENG;

View File

@ -1887,9 +1887,19 @@ void EnOssan_UpdateCursorAnim(EnOssan* this) {
this->cursorAnimState = 0; this->cursorAnimState = 0;
} }
} }
if (CVar_GetS32("gHudColors", 1) == 0) {
this->cursorColorR = ColChanMix(0, 0.0f, t);
this->cursorColorG = ColChanMix(80, 80.0f, t);
this->cursorColorB = ColChanMix(255, 0.0f, t);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
this->cursorColorR = ColChanMix(0, 0.0f, t); this->cursorColorR = ColChanMix(0, 0.0f, t);
this->cursorColorG = ColChanMix(255, 80.0f, t); this->cursorColorG = ColChanMix(255, 80.0f, t);
this->cursorColorB = ColChanMix(80, 0.0f, t); this->cursorColorB = ColChanMix(80, 0.0f, t);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
this->cursorColorR = ColChanMix(CVar_GetS32("gCCABtnPrimR", 90), ((CVar_GetS32("gCCABtnPrimR", 90)/255)*100), t);
this->cursorColorG = ColChanMix(CVar_GetS32("gCCABtnPrimG", 90), ((CVar_GetS32("gCCABtnPrimG", 90)/255)*100), t);
this->cursorColorB = ColChanMix(CVar_GetS32("gCCABtnPrimB", 90), ((CVar_GetS32("gCCABtnPrimB", 90)/255)*100), t);
}
this->cursorColorA = ColChanMix(255, 0.0f, t); this->cursorColorA = ColChanMix(255, 0.0f, t);
this->cursorAnimTween = t; this->cursorAnimTween = t;
} }

View File

@ -366,7 +366,9 @@ void func_80ACA7E0(EnOwl* this, GlobalContext* globalCtx) {
void EnOwl_ConfirmKokiriMessage(EnOwl* this, GlobalContext* globalCtx) { void EnOwl_ConfirmKokiriMessage(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x2065); Message_ContinueTextbox(globalCtx, 0x2065);
break; break;
@ -393,7 +395,9 @@ void EnOwl_WaitOutsideKokiri(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACA998(EnOwl* this, GlobalContext* globalCtx) { void func_80ACA998(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x2069); Message_ContinueTextbox(globalCtx, 0x2069);
this->actionFunc = func_80ACAA54; this->actionFunc = func_80ACAA54;
@ -437,7 +441,9 @@ void EnOwl_WaitHyruleCastle(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACAB88(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAB88(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
// obtained zelda's letter // obtained zelda's letter
if (gSaveContext.eventChkInf[4] & 1) { if (gSaveContext.eventChkInf[4] & 1) {
@ -478,7 +484,9 @@ void EnOwl_WaitKakariko(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACAD34(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAD34(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x206F); Message_ContinueTextbox(globalCtx, 0x206F);
this->actionFunc = func_80ACADF0; this->actionFunc = func_80ACADF0;
@ -514,7 +522,9 @@ void EnOwl_WaitGerudo(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACAEB8(EnOwl* this, GlobalContext* globalCtx) { void func_80ACAEB8(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x2071); Message_ContinueTextbox(globalCtx, 0x2071);
this->actionFunc = func_80ACAF74; this->actionFunc = func_80ACAF74;
@ -634,7 +644,9 @@ void EnOwl_WaitDeathMountainShortcut(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB344(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB344(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x607A); Message_ContinueTextbox(globalCtx, 0x607A);
break; break;
@ -657,7 +669,9 @@ void func_80ACB3E0(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB440(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB440(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x10C1); Message_ContinueTextbox(globalCtx, 0x10C1);
this->actionFunc = func_80ACB4FC; this->actionFunc = func_80ACB4FC;
@ -692,7 +706,9 @@ void EnOwl_WaitLWPreSaria(EnOwl* this, GlobalContext* globalCtx) {
void func_80ACB5C4(EnOwl* this, GlobalContext* globalCtx) { void func_80ACB5C4(EnOwl* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(globalCtx)) {
switch (globalCtx->msgCtx.choiceIndex) { // swap the order of the responses if better owl is enabled
uint8_t index = CVar_GetS32("gBetterOwl", 0) == 0 ? globalCtx->msgCtx.choiceIndex : (1 - globalCtx->msgCtx.choiceIndex);
switch (index) {
case OWL_REPEAT: case OWL_REPEAT:
Message_ContinueTextbox(globalCtx, 0x10C5); Message_ContinueTextbox(globalCtx, 0x10C5);
this->actionFunc = func_80ACB680; this->actionFunc = func_80ACB680;

View File

@ -10324,6 +10324,14 @@ void func_80848EF8(Player* this, GlobalContext* globalCtx) {
int rectHeight = 24; //Texture Heigh int rectHeight = 24; //Texture Heigh
int DefaultIconA= 50; //Default icon alphe (55 on 255) int DefaultIconA= 50; //Default icon alphe (55 on 255)
if (CVar_GetS32("gHUDMargins", 0) != 0) {
rectLeft = OTRGetRectDimensionFromLeftEdge(26+(CVar_GetS32("gHUDMargin_L", 0)*-1));
rectTop = 60+(CVar_GetS32("gHUDMargin_T", 0)*-1);
} else {
rectTop = 60;
rectLeft = OTRGetRectDimensionFromLeftEdge(26);
}
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 2824); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 2824);
gDPPipeSync(OVERLAY_DISP++); gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA);

View File

@ -222,6 +222,72 @@ void Title_Draw(TitleContext* this) {
void Title_Main(GameState* thisx) { void Title_Main(GameState* thisx) {
TitleContext* this = (TitleContext*)thisx; TitleContext* this = (TitleContext*)thisx;
if (CVar_GetS32("gSkipLogoTitle",0)!=0) {
gSaveContext.language = CVar_GetS32("gLanguages", 0);
Sram_InitSram(&this->state, &this->sramCtx);
s16 selectedfile = CVar_GetS32("gSaveFileID", 0);
if (selectedfile == 4) {
selectedfile = 0xFF;
} else if(selectedfile == 0){
gSaveContext.fileNum = selectedfile;
gSaveContext.gameMode = 0;
this->state.running = false;
SET_NEXT_GAMESTATE(&this->state, FileChoose_Init, SelectContext);
return;
} else {
selectedfile--;
if (selectedfile < 0) {
selectedfile = 0xFF;
}
}
if (selectedfile == 0xFF) {
gSaveContext.fileNum = selectedfile;
Sram_OpenSave(&this->sramCtx);
gSaveContext.gameMode = 0;
this->state.running = false;
SET_NEXT_GAMESTATE(&this->state, Select_Init, SelectContext);
} else {
gSaveContext.fileNum = selectedfile;
Sram_OpenSave(&this->sramCtx);
gSaveContext.gameMode = 0;
this->state.running = false;
//return;
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
}
gSaveContext.respawn[0].entranceIndex = -1;
gSaveContext.respawnFlag = 0;
gSaveContext.seqId = (u8)NA_BGM_DISABLED;
gSaveContext.natureAmbienceId = 0xFF;
gSaveContext.showTitleCard = true;
gSaveContext.dogParams = 0;
gSaveContext.timer1State = 0;
gSaveContext.timer2State = 0;
gSaveContext.eventInf[0] = 0;
gSaveContext.eventInf[1] = 0;
gSaveContext.eventInf[2] = 0;
gSaveContext.eventInf[3] = 0;
gSaveContext.unk_13EE = 0x32;
gSaveContext.nayrusLoveTimer = 0;
gSaveContext.healthAccumulator = 0;
gSaveContext.unk_13F0 = 0;
gSaveContext.unk_13F2 = 0;
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.skyboxTime = 0;
gSaveContext.nextTransition = 0xFF;
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.unk_13C3 = 0;
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] = gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = gSaveContext.unk_13F4 = 0;
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.magicLevel = gSaveContext.magic;
gSaveContext.naviTimer = 0;
return;
}
OPEN_DISPS(this->state.gfxCtx, "../z_title.c", 494); OPEN_DISPS(this->state.gfxCtx, "../z_title.c", 494);
gSPSegment(POLY_OPA_DISP++, 0, NULL); gSPSegment(POLY_OPA_DISP++, 0, NULL);

View File

@ -494,9 +494,21 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
if (D_8082A124[sp218] == 0) { if (D_8082A124[sp218] == 0) {
if (CVar_GetS32("gHudColors", 1) == 0) { // A Button notes
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[sp218]); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", 80), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 150), D_8082A150[sp218]);
}
} else { } else {
if (CVar_GetS32("gHudColors", 1) == 0) { // C Buttons notes
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[sp218]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), D_8082A150[sp218]);
}
} }
gDPSetEnvColor(POLY_KAL_DISP++, 10, 10, 10, 0); gDPSetEnvColor(POLY_KAL_DISP++, 10, 10, 10, 0);
@ -524,9 +536,21 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
if (pauseCtx->unk_1E4 == 8) { if (pauseCtx->unk_1E4 == 8) {
if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == 0) { if (gOcarinaSongNotes[sp224].notesIdx[phi_s3] == 0) {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, 200);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, 200); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, 200);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", 80), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 150), 200);
}
} else { } else {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, 200);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 255), CVar_GetS32("gCCCBtnPrimB", 50), 200);
}
} }
} else { } else {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 150, 150, 150, 150); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 150, 150, 150, 150);
@ -579,9 +603,21 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
if (D_8082A124[phi_s3] == 0) { if (D_8082A124[phi_s3] == 0) {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 150, 255, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[phi_s3]); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 80, 255, 150, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", 80), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 150), D_8082A150[phi_s3]);
}
} else { } else {
if (CVar_GetS32("gHudColors", 1) == 0) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 50, D_8082A150[phi_s3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", 255), CVar_GetS32("gCCCBtnPrimG", 160), CVar_GetS32("gCCCBtnPrimB", 0), D_8082A150[phi_s3]);
}
} }
gDPSetEnvColor(POLY_KAL_DISP++, 10, 10, 10, 0); gDPSetEnvColor(POLY_KAL_DISP++, 10, 10, 10, 0);

View File

@ -975,6 +975,20 @@ void KaleidoScope_DrawCursor(GlobalContext* globalCtx, u16 pageIndex) {
temp = pauseCtx->unk_1E4; temp = pauseCtx->unk_1E4;
if (CVar_GetS32("gHudColors", 1) == 0) {
sCursorColors[2][0] = 0;
sCursorColors[2][1] = 50;
sCursorColors[2][2] = 255;
} else if (CVar_GetS32("gHudColors", 1) == 1) {
sCursorColors[2][0] = 0;
sCursorColors[2][1] = 255;
sCursorColors[2][2] = 50;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
sCursorColors[2][0] = CVar_GetS32("gCCABtnPrimR", 0);
sCursorColors[2][1] = CVar_GetS32("gCCABtnPrimG", 255);
sCursorColors[2][2] = CVar_GetS32("gCCABtnPrimB", 50);
}
if ((((pauseCtx->unk_1E4 == 0) || (temp == 8)) && (pauseCtx->state == 6)) || if ((((pauseCtx->unk_1E4 == 0) || (temp == 8)) && (pauseCtx->state == 6)) ||
((pauseCtx->pageIndex == PAUSE_QUEST) && ((temp < 3) || (temp == 5) || (temp == 8)))) { ((pauseCtx->pageIndex == PAUSE_QUEST) && ((temp < 3) || (temp == 5) || (temp == 8)))) {
@ -1045,6 +1059,28 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
{ 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 255, 255, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 255, 255, 0 }, { 0, 0, 0 },
{ 0, 0, 0 }, { 255, 255, 0 }, { 0, 255, 50 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 255, 50 }, { 0, 0, 0 }, { 255, 255, 0 }, { 0, 255, 50 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 255, 50 },
}; };
if (CVar_GetS32("gHudColors", 1) == 0) {
D_8082ACF4[8][0] = 0;
D_8082ACF4[8][1] = 50;
D_8082ACF4[8][2] = 255;
D_8082ACF4[11][0] = 0;
D_8082ACF4[11][1] = 50;
D_8082ACF4[11][2] = 255;
} else if (CVar_GetS32("gHudColors", 1) == 1) {
D_8082ACF4[8][0] = 0;
D_8082ACF4[8][1] = 255;
D_8082ACF4[8][2] = 50;
D_8082ACF4[11][0] = 0;
D_8082ACF4[11][1] = 255;
D_8082ACF4[11][2] = 50;
} else if (CVar_GetS32("gHudColors", 1) == 2) {
D_8082ACF4[8][0] = CVar_GetS32("gCCABtnPrimR", 0);
D_8082ACF4[8][1] = CVar_GetS32("gCCABtnPrimG", 255);
D_8082ACF4[8][2] = CVar_GetS32("gCCABtnPrimB", 50);
D_8082ACF4[11][0] = CVar_GetS32("gCCABtnPrimR", 0);
D_8082ACF4[11][1] = CVar_GetS32("gCCABtnPrimG", 255);
D_8082ACF4[11][2] = CVar_GetS32("gCCABtnPrimB", 50);
}
static s16 D_8082AD3C = 20; static s16 D_8082AD3C = 20;
static s16 D_8082AD40 = 0; static s16 D_8082AD40 = 0;
static s16 D_8082AD44 = 0; static s16 D_8082AD44 = 0;
@ -1373,7 +1409,13 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0, gDPSetCombineLERP(POLY_KAL_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0, TEXEL0,
0, PRIMITIVE, 0); 0, PRIMITIVE, 0);
if (CVar_GetS32("gHudColors", 1) == 0) {//Save prompt cursor colour
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 100, 255, VREG(61));
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61)); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 100, 255, 100, VREG(61));
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", 100), CVar_GetS32("gCCABtnPrimG", 255), CVar_GetS32("gCCABtnPrimB", 100), VREG(61)); //Save prompt cursor colour
}
if (pauseCtx->promptChoice == 0) { if (pauseCtx->promptChoice == 0) {
gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL); gSPDisplayList(POLY_KAL_DISP++, gPromptCursorLeftDL);
@ -1432,6 +1474,10 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) {
} }
void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
static s16 gABtnTexColour[][4] = { //A button colors
{ 0, 255, 100, 255 },//Gamecube
{ 0, 100, 255, 255 },//Original N64
};
static void* D_8082AD54[3] = { static void* D_8082AD54[3] = {
gPauseToEquipENGTex, gPauseToEquipENGTex,
gPauseToEquipGERTex, gPauseToEquipGERTex,
@ -1757,8 +1803,16 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = D_8082ADE0[gSaveContext.language] pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = D_8082ADE0[gSaveContext.language]
<< 5; << 5;
if (CVar_GetS32("gHudColors", 1) == 0) {//A icon to decide in save prompt
gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[0][0], gABtnTexColour[0][1], gABtnTexColour[0][2], gABtnTexColour[0][3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", gABtnTexColour[0][0]), CVar_GetS32("gCCABtnPrimG", gABtnTexColour[0][1]), CVar_GetS32("gCCABtnPrimB", gABtnTexColour[0][2]), gABtnTexColour[0][3]);
}
//gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL);//This is changed to load the texture only so we can prim color it.
gDPLoadTextureBlock(POLY_KAL_DISP++, gABtnSymbolTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255);
@ -1804,7 +1858,16 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] =
D_8082ADD8[gSaveContext.language] << 5; D_8082ADD8[gSaveContext.language] << 5;
gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); if (CVar_GetS32("gHudColors", 1) == 0) {//To equip text C button icon
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, R_C_BTN_COLOR(0), R_C_BTN_COLOR(1), R_C_BTN_COLOR(2), 255);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCCBtnPrimR", R_C_BTN_COLOR(0)), CVar_GetS32("gCCCBtnPrimG", R_C_BTN_COLOR(1)), CVar_GetS32("gCCCBtnPrimB", R_C_BTN_COLOR(2)), 255);
}
//gSPDisplayList(POLY_KAL_DISP++, gCButtonIconsDL); //Same reason for every A button, to be able to recolor them.
gDPLoadTextureBlock(POLY_KAL_DISP++, gCBtnSymbolsTex, G_IM_FMT_IA, G_IM_SIZ_8b, 48, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255);
@ -1838,7 +1901,16 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] =
D_8082ADE8[gSaveContext.language] << 5; D_8082ADE8[gSaveContext.language] << 5;
gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL); if (CVar_GetS32("gHudColors", 1) == 0) {//To play melody A button
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[0][0], gABtnTexColour[0][1], gABtnTexColour[0][2], gABtnTexColour[0][3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", gABtnTexColour[0][0]), CVar_GetS32("gCCABtnPrimG", gABtnTexColour[0][1]), CVar_GetS32("gCCABtnPrimB", gABtnTexColour[0][2]), gABtnTexColour[0][3]);
}
//gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL);
gDPLoadTextureBlock(POLY_KAL_DISP++, gABtnSymbolTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255);
@ -1864,7 +1936,16 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) {
pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] = pauseCtx->infoPanelVtx[21].v.tc[0] = pauseCtx->infoPanelVtx[23].v.tc[0] =
D_8082ADD8[gSaveContext.language] << 5; D_8082ADD8[gSaveContext.language] << 5;
gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL); //gSPDisplayList(POLY_KAL_DISP++, gAButtonIconDL);
if (CVar_GetS32("gHudColors", 1) == 0) {//To equip A button
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[1][0], gABtnTexColour[1][1], gABtnTexColour[1][2], gABtnTexColour[1][3]);
} else if (CVar_GetS32("gHudColors", 1) == 1) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, gABtnTexColour[0][0], gABtnTexColour[0][1], gABtnTexColour[0][2], gABtnTexColour[0][3]);
} else if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, CVar_GetS32("gCCABtnPrimR", gABtnTexColour[0][0]), CVar_GetS32("gCCABtnPrimG", gABtnTexColour[0][1]), CVar_GetS32("gCCABtnPrimB", gABtnTexColour[0][2]), gABtnTexColour[0][3]);
}
gDPLoadTextureBlock(POLY_KAL_DISP++, gABtnSymbolTex, G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0);
gDPPipeSync(POLY_KAL_DISP++); gDPPipeSync(POLY_KAL_DISP++);
gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, 255);
@ -2867,14 +2948,6 @@ void KaleidoScope_GrayOutTextureRGBA32(u32* texture, u16 pixelCount) {
u16 gray; u16 gray;
u16 i; u16 i;
bind_hook( GRAYOUT_TEXTURE);
init_hook(2,
(struct HookParameter){ .name = "texture", .parameter = &texture },
(struct HookParameter){ .name = "pixelCount", .parameter = &pixelCount }
);
if (!call_hook(0))
return;
texture = ResourceMgr_LoadTexByName(texture); texture = ResourceMgr_LoadTexByName(texture);
for (i = 0; i < pixelCount; i++) { for (i = 0; i < pixelCount; i++) {