From 110e54c562329ec115634aab195afdbef589fe58 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Mon, 1 Apr 2024 18:23:37 -0600 Subject: [PATCH] First compilation running owo --- CMakeLists.txt | 9 ++++++--- assets/yaml/us/ast_versus.yaml | 33 ++++++++++++++++----------------- include/variables.h | 3 ++- libultraship | 2 +- src/libultra/io/aisetfreq.c | 6 +++--- src/port/Engine.cpp | 10 +++++----- 6 files changed, 33 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dc85259..83d242ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,9 +90,12 @@ file(GLOB_RECURSE ALL_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} # Exclude specific files from the ALL_FILES list list(FILTER ALL_FILES EXCLUDE REGEX ".*.inc.c") -# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_demo.c") -# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_versus.c") -# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_edisplay.c") +list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_A4290_colheaders.c") +list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_edata_1C.c") +list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_rcp_setup.c") +list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_load_inits.c") +list(FILTER ALL_FILES EXCLUDE REGEX "src/overlays/ovl_ending/fox_end2_data.c") + # list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_hud.c") # list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_360.c") # list(FILTER ALL_FILES EXCLUDE REGEX "src/main/fox_beam.c") diff --git a/assets/yaml/us/ast_versus.yaml b/assets/yaml/us/ast_versus.yaml index edc77d54..ca70adc1 100644 --- a/assets/yaml/us/ast_versus.yaml +++ b/assets/yaml/us/ast_versus.yaml @@ -35,26 +35,26 @@ D_versus_3000380: D_versus_30003A0: { type: TEXTURE, ctype: u8, format: CI4, width: 64, height: 10, offset: 0x30003A0, symbol: D_versus_30003A0, tlut: 0x30004E0 } D_versus_30004E0: - { type: TEXTURE, ctype: u16, format: TLUT, colors: 16, offset: 0x30004E0, symbol: D_versus_30004E0 } + { type: TEXTURE, ctype: u16, format: TLUT, colors: 17, offset: 0x30004E0, symbol: D_versus_30004E0 } -BLOB_3000500: - { type: BLOB, size: 0x10, offset: 0x3000500, symbol: BLOB_3000500} # 17th color for D_versus_30004E0? +# BLOB_3000500: +# { type: BLOB, size: 0x10, offset: 0x3000500, symbol: BLOB_3000500} # 17th color for D_versus_30004E0? D_versus_3000510: { type: TEXTURE, ctype: u8, format: CI4, width: 80, height: 10, offset: 0x3000510, symbol: D_versus_3000510, tlut: 0x30006A0 } D_versus_30006A0: - { type: TEXTURE, ctype: u16, format: TLUT, colors: 16, offset: 0x30006A0, symbol: D_versus_30006A0 } + { type: TEXTURE, ctype: u16, format: TLUT, colors: 17, offset: 0x30006A0, symbol: D_versus_30006A0 } -BLOB_30006C0: - { type: BLOB, size: 0x10, offset: 0x30006C0, symbol: BLOB_30006C0} # 17th color for D_versus_30006A0? +# BLOB_30006C0: +# { type: BLOB, size: 0x10, offset: 0x30006C0, symbol: BLOB_30006C0} # 17th color for D_versus_30006A0? D_versus_30006D0: { type: TEXTURE, ctype: u8, format: CI4, width: 64, height: 10, offset: 0x30006D0, symbol: D_versus_30006D0, tlut: 0x3000810 } D_versus_3000810: - { type: TEXTURE, ctype: u16, format: TLUT, colors: 16, offset: 0x3000810, symbol: D_versus_3000810 } + { type: TEXTURE, ctype: u16, format: TLUT, colors: 17, offset: 0x3000810, symbol: D_versus_3000810 } -BLOB_3000830: - { type: BLOB, size: 0x10, offset: 0x3000830, symbol: BLOB_3000830} # 17th color for D_versus_3000810? +# BLOB_3000830: +# { type: BLOB, size: 0x10, offset: 0x3000830, symbol: BLOB_3000830} # 17th color for D_versus_3000810? D_versus_3000840: { type: TEXTURE, ctype: u8, format: CI4, width: 32, height: 10, offset: 0x3000840, symbol: D_versus_3000840, tlut: 0x30008E0 } @@ -738,25 +738,24 @@ D_versus_302F044: D_versus_302E56C: {type: VEC3F, count: 20, offset: 0x302E56C, symbol: D_versus_302E56C} - + D_versus_302E65C: {type: VEC3F, count: 20, offset: 0x302E65C, symbol: D_versus_302E65C} - + D_versus_302E74C: {type: VEC3F, count: 19, offset: 0x302E74C, symbol: D_versus_302E74C} - + D_versus_302E830: {type: VEC3F, count: 25, offset: 0x302E830, symbol: D_versus_302E830} - + D_versus_302E95C: {type: VEC3F, count: 20, offset: 0x302E95C, symbol: D_versus_302E95C} - + D_versus_302EA4C: {type: VEC3F, count: 20, offset: 0x302EA4C, symbol: D_versus_302EA4C} - + D_versus_302EB3C: {type: VEC3F, count: 19, offset: 0x302EB3C, symbol: D_versus_302EB3C} - + D_versus_302EC20: {type: VEC3F, count: 25, offset: 0x302EC20, symbol: D_versus_302EC20} - \ No newline at end of file diff --git a/include/variables.h b/include/variables.h index 8020ceec..e583edf1 100644 --- a/include/variables.h +++ b/include/variables.h @@ -201,6 +201,7 @@ extern u8 D_Tex_800DB4B8[]; extern Gfx D_Gfx_800D94D0[]; extern OSTime osClockRate; -u32 osViClock = 0x02E6D354; + +#define osViClock 0x02E6D354; #endif // VARIABLES_H diff --git a/libultraship b/libultraship index c3113ea8..8cbc5752 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit c3113ea894b91127262a31dafd1acb7827982011 +Subproject commit 8cbc575218515c5518319e91870c404b86e87c36 diff --git a/src/libultra/io/aisetfreq.c b/src/libultra/io/aisetfreq.c index c1bc23db..7d41f96d 100644 --- a/src/libultra/io/aisetfreq.c +++ b/src/libultra/io/aisetfreq.c @@ -1,12 +1,12 @@ #include -extern s32 osViClock; +s32 osViClock2 = 0x02E6D354; s32 osAiSetFrequency(u32 freq) { register u32 a1; register s32 a2; register float ftmp; - ftmp = osViClock / (float) freq + .5f; + ftmp = osViClock2 / (float) freq + .5f; a1 = ftmp; @@ -22,5 +22,5 @@ s32 osAiSetFrequency(u32 freq) { IO_WRITE(AI_DACRATE_REG, a1 - 1); IO_WRITE(AI_BITRATE_REG, a2 - 1); IO_WRITE(AI_CONTROL_REG, AI_CONTROL_DMA_ON); // enable dma - return osViClock / (s32) a1; + return osViClock2 / (s32) a1; } diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index b6a1f636..1375f958 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -17,10 +17,10 @@ GameEngine* GameEngine::Instance; GameEngine::GameEngine() { std::vector OTRFiles; - if (const std::string cube_path = LUS::Context::GetPathRelativeToAppDirectory("smcube.otr"); std::filesystem::exists(cube_path)) { - OTRFiles.push_back(cube_path); - } - if (const std::string sm64_otr_path = LUS::Context::GetPathRelativeToAppBundle("lylat.otr"); std::filesystem::exists(sm64_otr_path)) { + // if (const std::string cube_path = LUS::Context::GetPathRelativeToAppDirectory("lylat.otr"); std::filesystem::exists(cube_path)) { + // OTRFiles.push_back(cube_path); + // } + if (const std::string sm64_otr_path = LUS::Context::GetPathRelativeToAppBundle("sm64.otr"); std::filesystem::exists(sm64_otr_path)) { OTRFiles.push_back(sm64_otr_path); } if (const std::string patches_path = LUS::Context::GetPathRelativeToAppDirectory("mods"); !patches_path.empty() && std::filesystem::exists(patches_path)) { @@ -33,7 +33,7 @@ GameEngine::GameEngine() { } } this->context = LUS::Context::CreateInstance("Lylat64", "sf64", "lylat.cfg.json", OTRFiles, - {0xFF2B5A63, 0xE3DAA4E}, 3); + {}, 3); // this->context->GetResourceManager()->GetResourceLoader()->RegisterResourceFactory( // LUS::ResourceType::SAnim, "Animation", std::make_shared()); }