Torch v0.1 (#12)

* Splitted version yamls and implemented wip geo and dlist extraction

* Fixed linux compilation

* Added PoC WSL 2 detection

* Add undefined behaviour

* Added gfxdis as submodule

* update

* Removed gfxdis as a submodule

* Code works

* Replace ByteSwap with BSWAP

* Cleanup vertice factory

* readability

* readability 2

* Cleanup gfxfactory

* last one

* Rename name to symbol

* More implementation

* Implemented first PoC of C file generation

* Added output formatting on factories

* changes

* Moved generated dlists onto their respective folder

* Migrated more factories onto the new extractor system

* Fully ported all factories and added header generation

* Some updates

* Added Lights factory

* fix

* Fixed vtx extraction

* Lights work now

* delete old startup_logo yaml

* Generate all sections in single file

* Added support to generate header and code for textures

* Added O3 for release builds

* Added WIP dlist extraction and moved to use f3dold microcode

* Added segment support, autogeneration and fixed C generation

* Added symbol names on display list extraction

* Removed warnings

* Moved back to transform and replace

* Removed unnecesary macros

* Added extraction order and reversed vtx order

* Implemented true backwards sort

* [WIP] Implemented runtime gbi, more headers and a few config features

* Fix CLI11 on WSL and variety of fixes

* Fixes

* Update DisplayListFactory.h

* Update TextureFactory.cpp

* wip lights

* fix

* Correct callback

* Added waypoints

* Update ceremony_data.yml

* Changes

* Update TextureFactory.cpp

* Update commandline args

* Update comment

* Remove printf

* Update couple commands

* Renamed cubeos  to torch

* Removed unused stuff and added an example config file

---------

Co-authored-by: KiritoDv <kiritodev01@gmail.com>
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
This commit is contained in:
Lywx
2023-11-15 15:11:15 -06:00
committed by GitHub
co-authored by MegaMech
parent a66b259d7c
commit eaddecd0b4
332 changed files with 8698 additions and 66885 deletions
+2
View File
@@ -8,5 +8,7 @@ debug/
!src/factories/debug/
*.z64
*.n64
headers/
build/
code/
.vscode/
+39 -5
View File
@@ -1,17 +1,37 @@
cmake_minimum_required(VERSION 3.12)
project(CubeOS)
project(torch)
include(FetchContent)
set(CMAKE_CXX_STANDARD 20)
# Link libgfxd
# Because libgfxd is not a CMake project, we have to manually fetch it and add it to the build
FetchContent_Declare(
libgfxd
GIT_REPOSITORY https://github.com/glankk/libgfxd.git
GIT_TAG 96fd3b849f38b3a7c7b7f3ff03c5921d328e6cdf
)
FetchContent_GetProperties(libgfxd)
if(NOT libgfxd_POPULATED)
FetchContent_Populate(libgfxd)
include_directories(${libgfxd_SOURCE_DIR})
set(LGFXD_SRC gfxd.c uc_f3d.c uc_f3db.c uc_f3dex.c uc_f3dexb.c uc_f3dex2.c)
foreach (LGFXD_FILE ${LGFXD_SRC})
list(APPEND LGFXD_FILES "${libgfxd_SOURCE_DIR}/${LGFXD_FILE}")
endforeach()
endif()
# Source files
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/lib)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
file(GLOB_RECURSE CXX_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.cpp)
file(GLOB_RECURSE CXX_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/lib/strhash64/*.cpp)
file(GLOB C_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.c ${CMAKE_CURRENT_SOURCE_DIR}/lib/**/*.c)
set(SRC_DIR ${CXX_FILES} ${C_FILES})
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(SRC_DIR ${CXX_FILES} ${C_FILES} ${LGFXD_FILES})
set(USE_STANDALONE ON)
set(VPKTOOL_BUILD_GUI OFF)
@@ -26,9 +46,24 @@ else()
add_library(${PROJECT_NAME} SHARED ${SRC_DIR})
endif()
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
endif()
# Fetch Dependencies
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/binarytools)
if(EXISTS "/mnt/c/WINDOWS/system32/wsl.exe")
FetchContent_Declare(
GSL
GIT_REPOSITORY https://github.com/Microsoft/GSL.git
GIT_TAG a3534567187d2edc428efd3f13466ff75fe5805c
)
FetchContent_MakeAvailable(GSL)
target_link_libraries(${PROJECT_NAME} PRIVATE GSL)
endif()
# Link BinaryTools
add_dependencies(${PROJECT_NAME} BinaryTools)
target_link_libraries(${PROJECT_NAME} PRIVATE BinaryTools)
@@ -46,7 +81,6 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG f7320141120f720aecc4c32be25586e7da9eb978
)
set(YAML_CPP_BUILD_TESTS OFF)
FetchContent_MakeAvailable(yaml-cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp)
+5 -1
View File
@@ -1,6 +1,10 @@
# CubeOS
# Torch - [T]orch is [O]ur [R]esource [C]onversion [H]elper
A generic asset processor for N64 games
## Usage
`./torch otr baserom.z64`
`./torch code baserom.z64`
# Windows
## Visual Studio
+8
View File
@@ -0,0 +1,8 @@
hud/health:
type: TEXTURE
size: 512
width: 16
height: 16
offset: 0xFF
format: RGBA16
symbol: health_icon_FF
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More