Skip to content

Commit

Permalink
Merge branch 'develop' into DanaModels
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepper0ni committed Oct 15, 2024
2 parents 2cd0386 + 4dbb86e commit 449b63a
Show file tree
Hide file tree
Showing 85 changed files with 1,626 additions and 998 deletions.
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment ve
project(Ship VERSION 8.0.6 LANGUAGES C CXX)
include(CMake/soh-cvars.cmake)
include(CMake/lus-cvars.cmake)
set(PROJECT_BUILD_NAME "MacReady Golf" CACHE STRING "" FORCE)

set(NATO_PHONETIC_ALPHABET
"Alfa" "Bravo" "Charlie" "Delta" "Echo" "Foxtrot" "Golf" "Hotel"
"India" "Juliett" "Kilo" "Lima" "Mike" "November" "Oscar" "Papa"
"Quebec" "Romeo" "Sierra" "Tango" "Uniform" "Victor" "Whiskey"
"Xray" "Yankee" "Zulu"
)

# Get the patch version number from the project version
math(EXPR PATCH_INDEX "${PROJECT_VERSION_PATCH}")

# Use the patch number to select the correct word
list(GET NATO_PHONETIC_ALPHABET ${PATCH_INDEX} PROJECT_PATCH_WORD)

set(PROJECT_BUILD_NAME "MacReady ${PROJECT_PATCH_WORD}" CACHE STRING "" FORCE)
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "" FORCE)

execute_process(
Expand Down Expand Up @@ -121,6 +135,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(GBI_UCODE F3DEX_GBI_2)

################################################################################
# Set CONTROLLERBUTTONS_T
################################################################################
add_compile_definitions(CONTROLLERBUTTONS_T=uint32_t)

################################################################################
# Sub-projects
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion OTRExporter
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,17 @@ Congratulations, you are now sailing with the Ship of Harkinian! Have fun!
| Tab | Toggle Alternate assets |
| Ctrl+R | Reset |

# Project Overview
Ship of Harkinian (SOH) is built atop a custom library dubbed libultraship (LUS). Back in the N64 days, there was an SDK distributed to developers named libultra; LUS is designed to mimic the functionality of libultra on modern hardware. In addition, we are dependant on the source code provided by the OOT decompilation project.

In order for the game to function, you will require a **legally aquired** ROM for Ocarina of Time. Click [here](https://ship.equipment/) to check the compatability of your specific rom. Any copyrighted assets are extracted from the ROM and reformated as a .otr archive file which the code uses.

### Graphics Backends
Currently, there are three rendering APIs supported: DirectX11 (Windows), OpenGL (all platforms), and Metal (MacOS). You can change which API to use in the `Settings` menu of the menubar, which requires a restart. If you're having an issue with crashing, you can change the API in the `shipofharkinian.json` file by finding the line `gfxbackend:""` and changing the value to `sdl` for OpenGL. DirectX 11 is the default on Windows.

# Custom Assets

Custom assets are packed in `.otr` files. To use custom assets, place them in the `mods` folder.
Custom assets are packed in `.otr` archive files. To use custom assets, place them in the `mods` folder.

If you're interested in creating and/or packing your own custom asset `.otr` files, check out the following tools:
* [**retro - OTR generator**](https://github.com/HarbourMasters64/retro)
Expand All @@ -93,6 +98,15 @@ If you want to playtest a continuous integration build, you can find them at the
* [macOS](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-mac.zip)
* [Linux](https://nightly.link/HarbourMasters/Shipwright/workflows/generate-builds/develop/soh-linux.zip)

### Further Reading
More detailed documentation can be found in the 'docs' directory, including the afformentioned [building instructions](docs/BUILDING.md).

*[Credits](docs/CREDITS.md)
*[Custom Music](docs/CUSTOM_MUSIC.md)
*[Controler Maping](docs/GAME_CONTROLLER_DB.md)
*[Modding](docs/MODDING.md)
*[Versioning](docs/VERSIONING.md)

<a href="https://github.com/Kenix3/libultraship/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./docs/poweredbylus.darkmode.png">
Expand Down
4 changes: 2 additions & 2 deletions soh/assets/xml/GC_MQ_D/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0x110CC0" RangeEnd="0x110D00">
<Mtx Name="gMtxClear" Offset="0x110CC0"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x1CE60" RangeStart="0x110CC0" RangeEnd="0x110D00">
<Mtx Name="gMtxClear" Offset="0x110CC0"/>
</File>
</Root>
4 changes: 2 additions & 2 deletions soh/assets/xml/GC_MQ_PAL_F/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0xEAD00" RangeEnd="0xEAD40">
<Mtx Name="gMtxClear" Offset="0xEAD00"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x10F00" RangeStart="0xEAD00" RangeEnd="0xEAD40">
<Mtx Name="gMtxClear" Offset="0xEAD00"/>
</File>
</Root>
4 changes: 2 additions & 2 deletions soh/assets/xml/GC_NMQ_D/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0x110CE0" RangeEnd="0x110D20">
<Mtx Name="gMtxClear" Offset="0x110CE0"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x1CE60" RangeStart="0x110CE0" RangeEnd="0x110D20">
<Mtx Name="gMtxClear" Offset="0x110CE0"/>
</File>
</Root>
4 changes: 2 additions & 2 deletions soh/assets/xml/GC_NMQ_PAL_F/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0xEAD20" RangeEnd="0xEAD60">
<Mtx Name="gMtxClear" Offset="0xEAD20"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x10F00" RangeStart="0xEAD20" RangeEnd="0xEAD60">
<Mtx Name="gMtxClear" Offset="0xEAD20"/>
</File>
</Root>
4 changes: 2 additions & 2 deletions soh/assets/xml/N64_PAL_10/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0xEB620" RangeEnd="0xEB660">
<Mtx Name="gMtxClear" Offset="0xEB620"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x116E0" RangeStart="0xEB620" RangeEnd="0xEB660">
<Mtx Name="gMtxClear" Offset="0xEB620"/>
</File>
</Root>
4 changes: 2 additions & 2 deletions soh/assets/xml/N64_PAL_11/code/sys_matrix.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Root>
<File Name="code" OutName="sys_matrix" RangeStart="0xEB660" RangeEnd="0xEB6A0">
<Mtx Name="gMtxClear" Offset="0xEB660"/>
<File Name="code" OutName="sys_matrix" BaseAddress="0x116E0" RangeStart="0xEB660" RangeEnd="0xEB6A0">
<Mtx Name="gMtxClear" Offset="0xEB660"/>
</File>
</Root>
1 change: 0 additions & 1 deletion soh/include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ extern GraphicsContext* __gfxCtx;
#define POLY_XLU_DISP __gfxCtx->polyXlu.p
// #region SOH [General]
// Upstream TODO: Document reasoning for these only existing in SoH
#define WORLD_OVERLAY_DISP __gfxCtx->worldOverlay.p
#define POLY_KAL_DISP __gfxCtx->polyKal.p
// #endregion
#define OVERLAY_DISP __gfxCtx->overlay.p
Expand Down
3 changes: 0 additions & 3 deletions soh/include/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ typedef struct {
/* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC
/* 0x00008 */ Gfx polyOpaBuffer[0x2FC0];
/* 0x0BF08 */ Gfx polyXluBuffer[0x1000];
/* 0xXXXXX */ Gfx worldOverlayBuffer[0x1000];
/* 0x0BF08 */ Gfx polyKalBuffer[0x1000];
/* 0x0FF08 */ Gfx overlayBuffer[0x800];
/* 0x11F08 */ Gfx workBuffer[0x100];
Expand Down Expand Up @@ -140,7 +139,6 @@ typedef struct OSScTask {
typedef struct GraphicsContext {
/* 0x0000 */ Gfx* polyOpaBuffer; // Pointer to "Zelda 0"
/* 0x0004 */ Gfx* polyXluBuffer; // Pointer to "Zelda 1"
/* 0xXXX */ Gfx* worldOverlayBuffer; // Pointer to "Paris"
/* 0xXXX */ Gfx* polyKalBuffer; // Pointer to "Rome"
/* 0x0008 */ char unk_008[0x08]; // Unused, could this be pointers to "Zelda 2" / "Zelda 3"
/* 0x0010 */ Gfx* overlayBuffer; // Pointer to "Zelda 4"
Expand All @@ -160,7 +158,6 @@ typedef struct GraphicsContext {
/* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
/* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"
/* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1"
/* 0x0XXX */ TwoHeadGfxArena worldOverlay; // When in Paris...
/* 0x0XXX */ TwoHeadGfxArena polyKal; // When in Rome...
/* 0x02D8 */ u32 gfxPoolIdx;
/* 0x02DC */ u16* curFrameBuffer;
Expand Down
1 change: 1 addition & 0 deletions soh/include/z64save.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ typedef struct {
/* */ u8 pendingIceTrapCount;
/* */ SohStats sohStats;
/* */ FaroresWindData backupFW;
/* */ u8 maskMemory;
// #endregion
// #region SOH [Randomizer]
// Upstream TODO: Move these to their own struct or name to more obviously specific to Randomizer
Expand Down
4 changes: 2 additions & 2 deletions soh/soh/Enhancements/controls/InputViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void InputViewer::DrawElement() {
if (CVarGetInteger(CVAR_INPUT_VIEWER("Mod1"), 0)) {
ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos);
RenderButton("Modifier-1", "Modifier-1 Outline", pads[0].button & BTN_MODIFIER1, scaledBGSize,
RenderButton("Modifier-1", "Modifier-1 Outline", pads[0].button & BTN_CUSTOM_MODIFIER1, scaledBGSize,
useGlobalOutlineMode
? buttonOutlineMode
: CVarGetInteger(CVAR_INPUT_VIEWER("Mod1OutlineMode"), BUTTON_OUTLINE_NOT_PRESSED));
Expand All @@ -320,7 +320,7 @@ void InputViewer::DrawElement() {
if (CVarGetInteger(CVAR_INPUT_VIEWER("Mod2"), 0)) {
ImGui::SetNextItemAllowOverlap();
ImGui::SetCursorPos(aPos);
RenderButton("Modifier-2", "Modifier-2 Outline", pads[0].button & BTN_MODIFIER2, scaledBGSize,
RenderButton("Modifier-2", "Modifier-2 Outline", pads[0].button & BTN_CUSTOM_MODIFIER2, scaledBGSize,
useGlobalOutlineMode
? buttonOutlineMode
: CVarGetInteger(CVAR_INPUT_VIEWER("Mod2OutlineMode"), BUTTON_OUTLINE_NOT_PRESSED));
Expand Down
Loading

0 comments on commit 449b63a

Please sign in to comment.