mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-01-23 05:25:01 +03:00
O2R Support
This commit is contained in:
parent
56b80e3081
commit
16aebcd560
1
.gitignore
vendored
1
.gitignore
vendored
@ -16,6 +16,7 @@ ctx.c.m2c
|
|||||||
*.u64
|
*.u64
|
||||||
*.bin
|
*.bin
|
||||||
*.otr
|
*.otr
|
||||||
|
*.o2r
|
||||||
*.eeprom
|
*.eeprom
|
||||||
assets/yaml/us/ast_test.yaml
|
assets/yaml/us/ast_test.yaml
|
||||||
/audio_data
|
/audio_data
|
||||||
|
@ -545,16 +545,16 @@ add_custom_target(
|
|||||||
ExtractAssets
|
ExtractAssets
|
||||||
DEPENDS torch
|
DEPENDS torch
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
COMMAND ${TORCH_EXECUTABLE} otr baserom.z64
|
COMMAND ${TORCH_EXECUTABLE} o2r baserom.z64
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/sf64.otr" "${CMAKE_BINARY_DIR}/sf64.otr"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/sf64.o2r" "${CMAKE_BINARY_DIR}/sf64.o2r"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
GeneratePortOTR
|
GeneratePortOTR
|
||||||
DEPENDS torch
|
DEPENDS torch
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
COMMAND ${TORCH_EXECUTABLE} pack port starship.otr
|
COMMAND ${TORCH_EXECUTABLE} pack port starship.o2r o2r
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/starship.otr" "${CMAKE_BINARY_DIR}/starship.otr"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/starship.o2r" "${CMAKE_BINARY_DIR}/starship.o2r"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
|
@ -25,16 +25,16 @@ Your ROM needs to be in .z64 format. If it's in .n64 format, use the following t
|
|||||||
|
|
||||||
### 2. Download Starship from [Releases](https://github.com/HarbourMasters/Starship/releases)
|
### 2. Download Starship from [Releases](https://github.com/HarbourMasters/Starship/releases)
|
||||||
|
|
||||||
### 3. Generating the OTR from the ROM
|
### 3. Generating the O2R from the ROM
|
||||||
#### Windows
|
#### Windows
|
||||||
* Extract every file from the zip into a folder of your choosing.
|
* Extract every file from the zip into a folder of your choosing.
|
||||||
* Copy your ROM to the root of the folder you extracted the zip to.
|
* Copy your ROM to the root of the folder you extracted the zip to.
|
||||||
* Run "generate_otr.bat"
|
* Run "generate_o2r.bat"
|
||||||
|
|
||||||
#### MacOS
|
#### MacOS
|
||||||
* Extract every file from the zip into a folder of your choosing.
|
* Extract every file from the zip into a folder of your choosing.
|
||||||
* Copy your ROM to the root of the folder you extracted the zip to.
|
* Copy your ROM to the root of the folder you extracted the zip to.
|
||||||
* Run "generate_otr.sh"
|
* Run "generate_o2r.sh"
|
||||||
|
|
||||||
### 4. Play!
|
### 4. Play!
|
||||||
* Launch `Starship.exe`
|
* Launch `Starship.exe`
|
||||||
|
@ -17,7 +17,7 @@ f7475fb11e7e6830f82883412638e8390791ab87:
|
|||||||
sort: OFFSET
|
sort: OFFSET
|
||||||
# logging: ERROR
|
# logging: ERROR
|
||||||
output:
|
output:
|
||||||
binary: sf64.otr
|
binary: sf64.o2r
|
||||||
# code: src/assets
|
# code: src/assets
|
||||||
# headers: include/assets
|
# headers: include/assets
|
||||||
# modding: src/assets
|
# modding: src/assets
|
||||||
@ -47,7 +47,7 @@ d8b1088520f7c5f81433292a9258c1184afa1457:
|
|||||||
sort: OFFSET
|
sort: OFFSET
|
||||||
# logging: ERROR
|
# logging: ERROR
|
||||||
output:
|
output:
|
||||||
binary: sf64.otr
|
binary: sf64.o2r
|
||||||
# code: src/assets
|
# code: src/assets
|
||||||
# headers: include/assets
|
# headers: include/assets
|
||||||
# modding: src/assets
|
# modding: src/assets
|
||||||
@ -77,7 +77,7 @@ d064229a32cc05ab85e2381ce07744eb3ffaf530:
|
|||||||
sort: OFFSET
|
sort: OFFSET
|
||||||
logging: ERROR
|
logging: ERROR
|
||||||
output:
|
output:
|
||||||
binary: ./mods/sf64jp.otr
|
binary: ./mods/sf64jp.o2r
|
||||||
code: src/assets
|
code: src/assets
|
||||||
headers: include/assets
|
headers: include/assets
|
||||||
modding: src/assets
|
modding: src/assets
|
||||||
|
@ -22,7 +22,7 @@ It is recommended that you install Python and Git standalone, the install proces
|
|||||||
|
|
||||||
_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_
|
_Note: Be sure to either clone with the ``--recursive`` flag or do ``git submodule update --init`` after cloning to pull in the libultraship submodule!_
|
||||||
|
|
||||||
2. After setup and initial build, use the built-in OTR extraction to make your sf64.otr file.
|
2. After setup and initial build, use the built-in OTR extraction to make your sf64.o2r file.
|
||||||
|
|
||||||
_Note: Instructions assume using powershell_
|
_Note: Instructions assume using powershell_
|
||||||
```powershell
|
```powershell
|
||||||
@ -33,7 +33,7 @@ cd starship
|
|||||||
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
||||||
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
|
& 'C:\Program Files\CMake\bin\cmake' -S . -B "build/x64" -G "Visual Studio 17 2022" -T v143 -A x64
|
||||||
|
|
||||||
# Generate sf64.otr
|
# Generate sf64.o2r
|
||||||
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets
|
& 'C:\Program Files\CMake\bin\cmake.exe' --build .\build\x64 --target ExtractAssets
|
||||||
|
|
||||||
# Compile project
|
# Compile project
|
||||||
@ -130,7 +130,7 @@ git submodule update --init
|
|||||||
# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv
|
# Add `-DPython3_EXECUTABLE=$(which python3)` if you are using non-standard Python installations such as PyEnv
|
||||||
cmake -H. -Bbuild-cmake -GNinja
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
|
||||||
# Generate sf64.otr
|
# Generate sf64.o2r
|
||||||
cmake --build build-cmake --target ExtractAssets
|
cmake --build build-cmake --target ExtractAssets
|
||||||
|
|
||||||
# Compile the project
|
# Compile the project
|
||||||
@ -177,7 +177,7 @@ git submodule update --init
|
|||||||
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
# Add `-DCMAKE_BUILD_TYPE:STRING=Release` if you're packaging
|
||||||
cmake -H. -Bbuild-cmake -GNinja
|
cmake -H. -Bbuild-cmake -GNinja
|
||||||
|
|
||||||
# Generate sf64.otr
|
# Generate sf64.o2r
|
||||||
cmake --build build-cmake --target ExtractAssets
|
cmake --build build-cmake --target ExtractAssets
|
||||||
|
|
||||||
# Compile the project
|
# Compile the project
|
||||||
|
@ -58,14 +58,14 @@ GameEngine* GameEngine::Instance;
|
|||||||
static GamePool MemoryPool = { .chunk = 1024 * 512, .cursor = 0, .length = 0, .memory = nullptr };
|
static GamePool MemoryPool = { .chunk = 1024 * 512, .cursor = 0, .length = 0, .memory = nullptr };
|
||||||
|
|
||||||
GameEngine::GameEngine() {
|
GameEngine::GameEngine() {
|
||||||
std::vector<std::string> OTRFiles;
|
std::vector<std::string> archiveFiles;
|
||||||
if (const std::string cube_path = Ship::Context::GetPathRelativeToAppDirectory("starship.otr");
|
if (const std::string cube_path = Ship::Context::GetPathRelativeToAppDirectory("starship.o2r");
|
||||||
std::filesystem::exists(cube_path)) {
|
std::filesystem::exists(cube_path)) {
|
||||||
OTRFiles.push_back(cube_path);
|
archiveFiles.push_back(cube_path);
|
||||||
}
|
}
|
||||||
if (const std::string sm64_otr_path = Ship::Context::GetPathRelativeToAppDirectory("sf64.otr");
|
if (const std::string sm64_otr_path = Ship::Context::GetPathRelativeToAppDirectory("sf64.o2r");
|
||||||
std::filesystem::exists(sm64_otr_path)) {
|
std::filesystem::exists(sm64_otr_path)) {
|
||||||
OTRFiles.push_back(sm64_otr_path);
|
archiveFiles.push_back(sm64_otr_path);
|
||||||
}
|
}
|
||||||
if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods");
|
if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods");
|
||||||
!patches_path.empty() && std::filesystem::exists(patches_path)) {
|
!patches_path.empty() && std::filesystem::exists(patches_path)) {
|
||||||
@ -73,12 +73,12 @@ GameEngine::GameEngine() {
|
|||||||
for (const auto& p : std::filesystem::recursive_directory_iterator(patches_path)) {
|
for (const auto& p : std::filesystem::recursive_directory_iterator(patches_path)) {
|
||||||
const auto ext = p.path().extension().string();
|
const auto ext = p.path().extension().string();
|
||||||
if (StringHelper::IEquals(ext, ".otr") || StringHelper::IEquals(ext, ".o2r")) {
|
if (StringHelper::IEquals(ext, ".otr") || StringHelper::IEquals(ext, ".o2r")) {
|
||||||
OTRFiles.push_back(p.path().generic_string());
|
archiveFiles.push_back(p.path().generic_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringHelper::IEquals(ext, ".zip")) {
|
if (StringHelper::IEquals(ext, ".zip")) {
|
||||||
SPDLOG_WARN("Zip files should be only used for development purposes, not for distribution");
|
SPDLOG_WARN("Zip files should be only used for development purposes, not for distribution");
|
||||||
OTRFiles.push_back(p.path().generic_string());
|
archiveFiles.push_back(p.path().generic_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,12 +92,12 @@ GameEngine::GameEngine() {
|
|||||||
|
|
||||||
auto controlDeck = std::make_shared<LUS::ControlDeck>();
|
auto controlDeck = std::make_shared<LUS::ControlDeck>();
|
||||||
|
|
||||||
this->context->InitResourceManager(OTRFiles, {}, 3); // without this line InitWindow fails in Gui::Init()
|
this->context->InitResourceManager(archiveFiles, {}, 3); // without this line InitWindow fails in Gui::Init()
|
||||||
this->context->InitConsole(); // without this line the GuiWindow constructor fails in ConsoleWindow::InitElement()
|
this->context->InitConsole(); // without this line the GuiWindow constructor fails in ConsoleWindow::InitElement()
|
||||||
|
|
||||||
auto window = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({}));
|
auto window = std::make_shared<Fast::Fast3dWindow>(std::vector<std::shared_ptr<Ship::GuiWindow>>({}));
|
||||||
|
|
||||||
this->context->Init(OTRFiles, {}, 3, { 32000, 1024, 1680 }, window, controlDeck);
|
this->context->Init(archiveFiles, {}, 3, { 32000, 1024, 1680 }, window, controlDeck);
|
||||||
|
|
||||||
Ship::Context::GetInstance()->GetLogger()->set_level(
|
Ship::Context::GetInstance()->GetLogger()->set_level(
|
||||||
(spdlog::level::level_enum) CVarGetInteger("gDeveloperTools.LogLevel", 1));
|
(spdlog::level::level_enum) CVarGetInteger("gDeveloperTools.LogLevel", 1));
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 4459958deed7af3c9ed7343914789709d6ef6ef1
|
Subproject commit 94be71101cf5a81685949a6025a3870f2d798284
|
Loading…
Reference in New Issue
Block a user