diff --git a/examples/PoolBox/application/src/Overlay/GTETest/gte_test.cpp b/examples/PoolBox/application/src/Overlay/GTETest/gte_test.cpp index 25830a54..db9c39cb 100644 --- a/examples/PoolBox/application/src/Overlay/GTETest/gte_test.cpp +++ b/examples/PoolBox/application/src/Overlay/GTETest/gte_test.cpp @@ -1,6 +1,7 @@ #include "../../../include/asset_mgr.hpp" #include "../../../include/shared.hpp" #include "include/GTE_Sprite.hpp" +#include "include/gte_test_assets.hpp" #include #include @@ -8,6 +9,12 @@ namespace GTETest { using namespace JabyEngine; using namespace GTETest; + static auto jaby_star_base = Make::SPRT( + // TODO: improve magic numbers + Make::AreaI16(GPU::Display::Width - 64, GPU::Display::Height - 64, 64, 64), + Make::OffsetPageWithClut(JabySTARTim.get_page_offset_clut4(), Make::PageClut(JabySTARTim.get_clut_position())) + ); + static auto doener_fish = GTE_Sprite::create(Make::POLY_FT4( Make::AreaI16(Make::PositionI16(0, 0), Assets::Main::DoenerFishInfo.size), Assets::Main::DoenerFishInfo.tim.get_page_offset_clut4(), @@ -15,6 +22,7 @@ namespace GTETest { Make::PageClut(Assets::Main::DoenerFishInfo.tim.get_clut_position()), GPU::Color24::Grey() )); + static auto rotation = 0.0_deg; static void setup() { @@ -41,6 +49,7 @@ namespace GTETest { static void render() { doener_fish.render(); + GPU::render(jaby_star_base); Shared::back_menu.render(); } diff --git a/examples/PoolBox/application/src/Overlay/GTETest/gte_test_assets.cpp b/examples/PoolBox/application/src/Overlay/GTETest/gte_test_assets.cpp new file mode 100644 index 00000000..bf42db7e --- /dev/null +++ b/examples/PoolBox/application/src/Overlay/GTETest/gte_test_assets.cpp @@ -0,0 +1,15 @@ +#include "include/gte_test_assets.hpp" +#include + +namespace GTETest { + enum LBA { + __jabyengine_start_lba_request + __jabyengine_request_lba_for(JABY_STAR, "ASSETS/GTE/JABY.BIN"), + __jabyengine_end_lba_request + }; + __declare_lba_header(LBA); + + CDFile Assets[1] = { + CDFileBuilder::simple_tim(LBA::JABY_STAR, JabySTARTim), + }; +} \ No newline at end of file diff --git a/examples/PoolBox/application/src/Overlay/GTETest/include/gte_test_assets.hpp b/examples/PoolBox/application/src/Overlay/GTETest/include/gte_test_assets.hpp index c5a9576a..16c9a768 100644 --- a/examples/PoolBox/application/src/Overlay/GTETest/include/gte_test_assets.hpp +++ b/examples/PoolBox/application/src/Overlay/GTETest/include/gte_test_assets.hpp @@ -1,6 +1,13 @@ #pragma once +#include "../../../../include/asset_mgr.hpp" #include namespace GTETest { using namespace JabyEngine; + + static constexpr auto JabySTARTim = SimpleTIM( + // v Doenerfisch rotates so we need some space + Assets::Main::DoenerFishInfo.tim.get_texture_x(), Assets::Main::DoenerFishInfo.tim.get_texture_y() + Assets::Main::DoenerFishInfo.size.height + 2, + Assets::Main::DoenerFishInfo.tim.get_clut_x() + 16, Assets::Main::DoenerFishInfo.tim.get_clut_y() + ); } \ No newline at end of file diff --git a/examples/PoolBox/application/src/Overlay/Overlays.hpp b/examples/PoolBox/application/src/Overlay/Overlays.hpp index 9ea7096c..5dc9b236 100644 --- a/examples/PoolBox/application/src/Overlay/Overlays.hpp +++ b/examples/PoolBox/application/src/Overlay/Overlays.hpp @@ -20,6 +20,9 @@ namespace GPUTest { } namespace GTETest { + extern const volatile JabyEngine::AutoLBAEntry lba[]; + extern JabyEngine::CDFile Assets[1]; + void main(); } diff --git a/examples/PoolBox/application/src/asset_mgr.cpp b/examples/PoolBox/application/src/asset_mgr.cpp index 7253d9ce..20251ef3 100644 --- a/examples/PoolBox/application/src/asset_mgr.cpp +++ b/examples/PoolBox/application/src/asset_mgr.cpp @@ -95,7 +95,7 @@ namespace Assets { } void load_gte_test() { - load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start)); + load(CDFileBuilder::overlay(LBA::GTE_TEST_OVL, &__gpu_tests_start), GTETest::lba, GTETest::Assets); } void load_font_cycler() { diff --git a/examples/PoolBox/assets/JabyStar.png b/examples/PoolBox/assets/JabyStar.png new file mode 100644 index 00000000..33a61509 --- /dev/null +++ b/examples/PoolBox/assets/JabyStar.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e991f3c3c3b81f34df3b81669ff5ce77632ba29aa7964430c8614d486349ed7a +size 5123 diff --git a/examples/PoolBox/assets/Makefile b/examples/PoolBox/assets/Makefile index f859be34..6dec1d67 100644 --- a/examples/PoolBox/assets/Makefile +++ b/examples/PoolBox/assets/Makefile @@ -2,8 +2,9 @@ include $(JABY_ENGINE_DIR)/mkfile/common/ExportPath.mk include $(JABY_ENGINE_DIR)/mkfile/common/RebuildTarget.mk OUTPUT_DIR = bin -INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin $(OUTPUT_DIR)/Controller.bin $(OUTPUT_DIR)/doener_fish.bin +INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin $(OUTPUT_DIR)/Controller.bin $(OUTPUT_DIR)/doener_fish.bin $(OUTPUT_DIR)/JabyStar.bin +# TODO: Simplyfy all of these? $(OUTPUT_DIR)/TexturePage.bin: TexturePage.png @mkdir -p $(OUTPUT_DIR) jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 @@ -21,6 +22,9 @@ $(OUTPUT_DIR)/Controller.bin: Controller.png $(OUTPUT_DIR)/doener_fish.bin: doener_fish.png jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans +$(OUTPUT_DIR)/JabyStar.bin: JabyStar.png + jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans + all: $(INPUT) clean: diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index 03a54e97..683a589a 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -4,12 +4,13 @@ %PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT + System.cnf.subst
../application/bin/%PSX_TV_FORMAT%/PSX-release/PoolBox.psexe
../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.bios_info - ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests - ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests - ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests + ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests + ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests + ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.font_cycler ../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center @@ -23,6 +24,10 @@ ../assets/bin/Controller.bin + + ../assets/bin/JabyStar.bin + + ../assets/bin/TexturePage.bin ../assets/bin/IconTexture.bin diff --git a/include/math.hpp b/include/math.hpp index 0761a0c0..9efee370 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -5,7 +5,7 @@ namespace math { template struct raw_math { constexpr T operator-() const { - return T{.raw = -(static_cast(*this).raw)}; + return T{.raw = static_cast(-(static_cast(*this).raw))}; } constexpr T operator+(const T& obj) const {