diff --git a/Makefile b/Makefile index d9133f81..16dacd33 100644 --- a/Makefile +++ b/Makefile @@ -416,10 +416,10 @@ ifeq ($(TARGET_SWITCH),1) CXX := $(CROSS)g++ STRIP := $(CROSS)strip NXARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE - APP_TITLE := Moon64 - [$(GIT_BRANCH)] - APP_AUTHOR := Nintendo, n64decomp team, UnderVolt team - APP_VERSION := $(GIT_HASH) - APP_ICON := $(CURDIR)/textures/logo/moon64-logo.jpg + APP_TITLE := Saturn: Moon Edition + APP_AUTHOR := Llennpie + APP_VERSION := $(GIT_BRANCH) $(GIT_HASH) + APP_ICON := $(CURDIR)/textures/logo/saturn-logo.jpg INCLUDE_CFLAGS += -I$(LIBNX)/include -I$(PORTLIBS)/include OPT_FLAGS := -O2 LIBDIRS := $(PORTLIBS) $(LIBNX) diff --git a/actors/n64/model.inc.c b/actors/n64/model.inc.c index 29f00ede..1a6583bf 100755 --- a/actors/n64/model.inc.c +++ b/actors/n64/model.inc.c @@ -1,18 +1,18 @@ Lights1 n64_N64_Green_lights = gdSPDefLights1( - 0x3, 0x49, 0x18, - 0x6, 0x93, 0x30, 0x28, 0x28, 0x28); + 0x7f, 0x7f, 0x7f, + 0xff, 0xff, 0xff, 0x28, 0x28, 0x28); Lights1 n64_N64_Blue_lights = gdSPDefLights1( - 0x0, 0xE, 0x54, - 0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28); + 0x67, 0x67, 0x67, + 0xce, 0xce, 0xce, 0x28, 0x28, 0x28); Lights1 n64_N64_Red_lights = gdSPDefLights1( - 0x7F, 0xF, 0xA, - 0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28); + 0x60, 0x7f, 0x66, + 0xc0, 0xff, 0xee, 0x28, 0x28, 0x28); Lights1 n64_N64_Yellow_lights = gdSPDefLights1( - 0x7F, 0x60, 0x0, - 0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28); + 0x60, 0x60, 0x60, + 0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28); Vtx n64_N_Logo_mesh_vtx_0[56] = { {{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}}, diff --git a/levels/intro/leveldata.c b/levels/intro/leveldata.c index 93471e2f..1485ae7d 100644 --- a/levels/intro/leveldata.c +++ b/levels/intro/leveldata.c @@ -3394,20 +3394,20 @@ const f32 intro_seg7_table_0700C880[] = { }; Lights1 n64logo_N64_Green_lights = gdSPDefLights1( - 0x3, 0x49, 0x18, - 0x6, 0x93, 0x30, 0x28, 0x28, 0x28); + 0x60, 0x7f, 0x66, + 0xc0, 0xff, 0xee, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Blue_lights = gdSPDefLights1( - 0x0, 0xE, 0x54, - 0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28); + 0x67, 0x67, 0x67, + 0xce, 0xce, 0xce, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Red_lights = gdSPDefLights1( - 0x7F, 0xF, 0xA, - 0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28); + 0x60, 0x7f, 0x66, + 0xc0, 0xff, 0xee, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Yellow_lights = gdSPDefLights1( - 0x7F, 0x60, 0x0, - 0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28); + 0x60, 0x60, 0x60, + 0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28); Vtx n64logo_N64_mesh_vtx_0[56] = { {{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}}, diff --git a/levels/n64logo/model.inc.c b/levels/n64logo/model.inc.c index 3ee26250..67622797 100755 --- a/levels/n64logo/model.inc.c +++ b/levels/n64logo/model.inc.c @@ -1,18 +1,18 @@ Lights1 n64logo_N64_Green_lights = gdSPDefLights1( - 0x3, 0x49, 0x18, - 0x6, 0x93, 0x30, 0x28, 0x28, 0x28); + 0x7f, 0x7f, 0x7f, + 0xff, 0xff, 0xff, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Blue_lights = gdSPDefLights1( - 0x0, 0xE, 0x54, - 0x1, 0x1D, 0xA9, 0x28, 0x28, 0x28); + 0x67, 0x67, 0x67, + 0xce, 0xce, 0xce, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Red_lights = gdSPDefLights1( - 0x7F, 0xF, 0xA, - 0xFE, 0x1F, 0x15, 0x28, 0x28, 0x28); + 0x60, 0x7f, 0x66, + 0xc0, 0xff, 0xee, 0x28, 0x28, 0x28); Lights1 n64logo_N64_Yellow_lights = gdSPDefLights1( - 0x7F, 0x60, 0x0, - 0xFE, 0xC1, 0x0, 0x28, 0x28, 0x28); + 0x60, 0x60, 0x60, + 0xc0, 0xc0, 0xc0, 0x28, 0x28, 0x28); Vtx n64logo_N64_mesh_vtx_0[56] = { {{{106, 1, -107},0, {486, 496},{0x0, 0x4E, 0x9B, 0xFF}}}, diff --git a/src/.vscode/settings.json b/src/.vscode/settings.json index 7cdca651..b4426a9d 100644 --- a/src/.vscode/settings.json +++ b/src/.vscode/settings.json @@ -69,6 +69,7 @@ "concepts": "cpp", "ranges": "cpp", "surface_collision.h": "c", - "math_util.h": "c" + "math_util.h": "c", + "controller_keyboard.h": "c" } } \ No newline at end of file diff --git a/src/moon/imgui/imgui_impl.cpp b/src/moon/imgui/imgui_impl.cpp index 5b59f958..bd6adfa6 100644 --- a/src/moon/imgui/imgui_impl.cpp +++ b/src/moon/imgui/imgui_impl.cpp @@ -20,6 +20,8 @@ #include "icons/IconsForkAwesome.h" #include "icons/IconsMaterialDesign.h" #include "moon/utils/moon-env.h" +#include "pc/controller/controller_keyboard.h" +#include "moon/ui/screens/addons/addons-view.h" #include @@ -765,6 +767,8 @@ namespace MoonInternal { ImGui::Begin("Appearance", NULL, ImGuiWindowFlags_None); ImGui::InputText(".gs", bufname, IM_ARRAYSIZE(bufname)); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; if (ImGui::Button("Save to File")) { apply_cc_from_editor(); @@ -790,22 +794,46 @@ namespace MoonInternal { if (ImGui::BeginTabItem("CC Editor")) { ImGui::Text("Shirt/Cap"); ImGui::ColorEdit4("Hat Main", (float*)&uiHatColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Hat Shade", (float*)&uiHatShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Text("Overalls"); ImGui::ColorEdit4("Overalls Main", (float*)&uiOverallsColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Overalls Shade", (float*)&uiOverallsShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Text("Gloves"); ImGui::ColorEdit4("Gloves Main", (float*)&uiGlovesColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Gloves Shade", (float*)&uiGlovesShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Text("Shoes"); ImGui::ColorEdit4("Shoes Main", (float*)&uiShoesColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Shoes Shade", (float*)&uiShoesShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Text("Skin"); ImGui::ColorEdit4("Skin Main", (float*)&uiSkinColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Skin Shade", (float*)&uiSkinShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Text("Hair"); ImGui::ColorEdit4("Hair Main", (float*)&uiHairColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::ColorEdit4("Hair Shade", (float*)&uiHairShadeColor, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_NoLabel); + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::EndTabItem(); ImGui::Dummy(ImVec2(0, 5)); @@ -817,7 +845,8 @@ namespace MoonInternal { } if (ImGui::BeginTabItem("GameShark")) { ImGui::InputTextMultiline("###gameshark_box", cc_gameshark, IM_ARRAYSIZE(cc_gameshark), ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 25), ImGuiInputTextFlags_CharsUppercase); - + if (ImGui::IsItemActivated()) accept_input = false; + if (ImGui::IsItemDeactivated()) accept_input = true; ImGui::Dummy(ImVec2(0, 5)); if (ImGui::Button("Paste GS Code")) { @@ -928,6 +957,36 @@ namespace MoonInternal { ImGui::Checkbox("Skip Intro", &configSkipIntro); ImGui::Checkbox("Enable Yoshi", &enable_yoshi); } + if (ImGui::CollapsingHeader("Addons")) { + { + ImGuiWindowFlags window_flags = ImGuiWindowFlags_None; + ImGui::BeginChild("addon_child", ImVec2(ImGui::GetWindowContentRegionWidth(), 130), false, window_flags); + for (int n = 0; n < texturePackList.size(); n++) + { + currentPack = texturePackList[n]; + ImGui::Selectable(currentPack->name.c_str()); + + if (ImGui::IsItemHovered()) { + ImGui::SetMouseCursor(2); + } + + if (ImGui::IsItemActive() && !ImGui::IsItemHovered()) + { + int n_next = n + (ImGui::GetMouseDragDelta(0).y < 0.f ? -1 : 1); + if (n_next >= 0 && n_next < texturePackList.size()) + { + texturePackList[n] = texturePackList[n_next]; + texturePackList[n_next] = currentPack; + ImGui::ResetMouseDragDelta(); + } + } + } + ImGui::EndChild(); + } + if (ImGui::Button("Reload Addons")) { + rebuildTextureCache(); + } + } ImGui::End(); ImGui::PopStyleColor(); diff --git a/src/moon/saturn/saturn.cpp b/src/moon/saturn/saturn.cpp index c8255fdb..afc3d5d3 100644 --- a/src/moon/saturn/saturn.cpp +++ b/src/moon/saturn/saturn.cpp @@ -3,7 +3,10 @@ #include "moon/utils/moon-env.h" #include "moon/fs/moonfs.h" +#include "moon/ui/screens/addons/addons-view.h" +#include "moon/mod-engine/engine.h" #include "pc/configfile.h" +#include "pc/controller/controller_keyboard.h" #include "saturn_colors.h" #include "saturn_textures.h" @@ -82,6 +85,13 @@ namespace MoonInternal { saturn_load_stache_array(); saturn_load_button_array(); saturn_load_sideburn_array(); + + if(texturePackList.empty()){ + texturePackList.clear(); + copy(Moon::addons.begin(), Moon::addons.end(), back_inserter(texturePackList)); + reverse(texturePackList.begin(), texturePackList.end()); + } + currentPack = NULL; }}); Moon::registerHookListener({.hookName = WINDOW_API_HANDLE_EVENTS, .callback = [&](HookCall call){ @@ -89,15 +99,9 @@ namespace MoonInternal { switch (ev->type){ case SDL_KEYDOWN: if(ev->key.keysym.sym == SDLK_f){ - if (!show_menu_bar) + if (accept_input) freeze_camera(); } - if(ev->key.keysym.sym == SDLK_x){ - //cycle_eye_state(1); - } - if(ev->key.keysym.sym == SDLK_z){ - //cycle_eye_state(-1); - } if(ev->key.keysym.sym == SDLK_F1){ show_menu_bar = !show_menu_bar; } @@ -105,12 +109,6 @@ namespace MoonInternal { if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_UP) { freeze_camera(); } - if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_RIGHT) { - //cycle_eye_state(1); - } - if (ev->cbutton.button == SDL_CONTROLLER_BUTTON_DPAD_LEFT) { - //cycle_eye_state(-1); - } if(ev->cbutton.button == SDL_CONTROLLER_BUTTON_BACK){ show_menu_bar = !show_menu_bar; } diff --git a/src/moon/ui/screens/addons/addons-view.cpp b/src/moon/ui/screens/addons/addons-view.cpp index fbeaa920..fd6171e5 100644 --- a/src/moon/ui/screens/addons/addons-view.cpp +++ b/src/moon/ui/screens/addons/addons-view.cpp @@ -56,8 +56,8 @@ void rebuildTextureCache(){ } reverse(order.begin(), order.end()); MoonInternal::buildTextureCache(order); - MoonInternal::buildAudioCache(order); - MoonInternal::resetSoundSystem(); + //MoonInternal::buildAudioCache(order); + //MoonInternal::resetSoundSystem(); } void MoonAddonsScreen::changeScroll(int idx){ diff --git a/src/moon/ui/screens/addons/addons-view.h b/src/moon/ui/screens/addons/addons-view.h index 0e0e549a..5272e726 100644 --- a/src/moon/ui/screens/addons/addons-view.h +++ b/src/moon/ui/screens/addons/addons-view.h @@ -13,5 +13,12 @@ private: void changeScroll(int idx); }; +#include +#include "moon/mod-engine/interfaces/bit-module.h" + +extern BitModule* currentPack; +extern std::vector texturePackList; + +extern void rebuildTextureCache(); #endif \ No newline at end of file diff --git a/src/pc/configfile.c b/src/pc/configfile.c index d445f539..0f2bb859 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -56,11 +56,11 @@ ConfigWindow configWindow = { }; ImGuiConfig configImGui = { - .s_stats = false, + .s_stats = true, .texture_debug = false, - .s_toggles = false, - .s_machinima = false, - .s_appearance = false, + .s_toggles = true, + .s_machinima = true, + .s_appearance = true, .s_options = false, .jaboMode = false }; diff --git a/src/pc/controller/controller_keyboard.c b/src/pc/controller/controller_keyboard.c index da597328..5c23c98c 100644 --- a/src/pc/controller/controller_keyboard.c +++ b/src/pc/controller/controller_keyboard.c @@ -10,6 +10,8 @@ #include "../configfile.h" #include "controller_keyboard.h" +bool accept_input = true; + static int keyboard_buttons_down; #define MAX_KEYBINDS 64 @@ -29,6 +31,8 @@ static int keyboard_map_scancode(int scancode) { } bool keyboard_on_key_down(int scancode) { + if (!accept_input) return false; + int mapped = keyboard_map_scancode(scancode); keyboard_buttons_down |= mapped; keyboard_lastkey = scancode; @@ -36,6 +40,8 @@ bool keyboard_on_key_down(int scancode) { } bool keyboard_on_key_up(int scancode) { + if (!accept_input) return false; + int mapped = keyboard_map_scancode(scancode); keyboard_buttons_down &= ~mapped; if (keyboard_lastkey == (u32) scancode) diff --git a/src/pc/controller/controller_keyboard.h b/src/pc/controller/controller_keyboard.h index 028d2e85..d0e97e3a 100644 --- a/src/pc/controller/controller_keyboard.h +++ b/src/pc/controller/controller_keyboard.h @@ -16,6 +16,7 @@ void keyboard_on_all_keys_up(void); } #endif +extern bool accept_input; extern struct ControllerAPI controller_keyboard; #endif diff --git a/textures/logo/saturn-logo.jpg b/textures/logo/saturn-logo.jpg new file mode 100644 index 00000000..56dca52a Binary files /dev/null and b/textures/logo/saturn-logo.jpg differ