Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
8 changed files with 110 additions and 20 deletions
Showing only changes of commit 9efcf87ecc - Show all commits

View File

@ -0,0 +1,12 @@
#pragma once
#include <PSX/File/cd_file_types.hpp>
namespace Assets {
using namespace JabyEngine;
namespace Main {
static constexpr auto PacoTIM = SimpleTIM(896, 0, 960, 510);
void load();
}
}

View File

@ -0,0 +1,32 @@
#include "../include/asset_mgr.hpp"
#include "include/paco.hpp"
#include <stdio.h>
using namespace JabyEngine;
// Do we want this namespace?
// Do we want Paco to be HERE?!
static object::Paco paco;
static void setup() {
Assets::Main::load();
paco.setup();
}
static void update() {
paco.update();
}
static void render() {
paco.render();
}
void main() {
setup();
while(true) {
update();
GPU::swap_buffers_vsync(1);
render();
}
}

View File

@ -0,0 +1,47 @@
#include "../include/asset_mgr.hpp"
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/AutoLBA/auto_lba.hpp>
#include <PSX/AutoLBA/auto_lba_declaration.hpp>
#include <stdio.h>
namespace Assets {
enum LBA {
__jabyengine_start_lba_request
__jabyengine_request_lba_for(PACO, "ASSETS/MAIN/PACO.BIN"),
__jabyengine_end_lba_request
};
__declare_lba_header(LBA);
static void load(const CDFile* assets, size_t size) {
const auto buffer_cfg = CDFileProcessor::BufferConfiguration::new_default();
CDFileProcessor file_processor;
file_processor.setup(lba, CDFileProcessor::JobArray{assets, size}, buffer_cfg);
while(true) {
switch(file_processor.process()) {
case Progress::InProgress:
break;
case Progress::Done:
if(!file_processor.next(lba, buffer_cfg)) {
return;
}
break;
case Progress::Error:
printf("Error detected! Aborting load\n");
return;
}
}
}
namespace Main {
static const CDFile Files[] = {
CDFileBuilder::simple_tim(LBA::PACO, PacoTIM)
};
void load() {
::Assets::load(Files, sizeof(Files)/sizeof(Files[0]));
}
}
}

View File

@ -1,14 +1,12 @@
#pragma once
#include <PSX/File/Processor/cd_file_processor.hpp>
#include <PSX/GPU/gpu.hpp>
#include "../../include/asset_mgr.hpp"
#include <PSX/GPU/make_gpu_primitives.hpp>
#include <PSX/Timer/frame_timer.hpp>
namespace object {
using namespace JabyEngine;
class Paco {
public:
static constexpr auto TIM = SimpleTIM(896, 0, 960, 510);
private:
static const GPU::Color24 Colors[];
@ -19,12 +17,12 @@ namespace object {
public:
constexpr Paco() :
tex_page(GPU::TexPage::create(GPU::PositionU16::create(
TIM.get_texture_x(), TIM.get_texture_y()),
tex_page(Make::TexPage(Make::PositionU16(
Assets::Main::PacoTIM.get_texture_x(), Assets::Main::PacoTIM.get_texture_y()),
GPU::TexturePageColor::$4bit).linked()),
sprite(GPU::SPRT::create(
GPU::AreaI16::create(GPU::PositionI16::create(0, 100), GPU::SizeI16::create(120, 128)),
GPU::OffsetPageWithClut(GPU::PageOffset::create(0, 0), GPU::PageClut::create(TIM.get_clut_x(), TIM.get_clut_y())),
sprite(Make::SPRT(
Make::AreaI16(Make::PositionI16(0, 100), Make::SizeI16(120, 128)),
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(Assets::Main::PacoTIM.get_clut_x(), Assets::Main::PacoTIM.get_clut_y())),
GPU::Color24::Blue()).linked()),
timer(),
color_idx(0) {}

View File

@ -1,11 +1,19 @@
#include "paco.hpp"
#include "include/paco.hpp"
namespace object {
const GPU::Color24 Paco :: Colors[] = {GPU::Color24::Red(), GPU::Color24::Green(), GPU::Color24::Blue(), GPU::Color24::Yellow()};
void Paco :: setup() {
/*this->tex_page = Make::TexPage(Make::PositionU16(
Assets::Main::PacoTIM.get_texture_x(), Assets::Main::PacoTIM.get_texture_y()),
GPU::TexturePageColor::$4bit).linked();
this->sprite = Make::SPRT(
Make::AreaI16(Make::PositionI16(0, 100), Make::SizeI16(120, 128)),
Make::OffsetPageWithClut(Make::PageOffset(0, 0), Make::PageClut(Assets::Main::PacoTIM.get_clut_x(), Assets::Main::PacoTIM.get_clut_y())),
GPU::Color24::Blue()).linked();*/
this->timer.reset();
// This should only work on elements that are linkable - but it didn't
this->tex_page.concat(this->sprite);
}

View File

@ -2,7 +2,7 @@ include $(JABY_ENGINE_DIR)/mkfile/ExportPath.mk
include $(JABY_ENGINE_DIR)/mkfile/RebuildTarget.mk
OUTPUT_DIR = bin
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/YoshiFont.bin $(OUTPUT_DIR)/Paco.bin
INPUT = $(OUTPUT_DIR)/TexturePage.bin $(OUTPUT_DIR)/IconTexture.bin $(OUTPUT_DIR)/Paco.bin
$(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
@mkdir -p $(OUTPUT_DIR)
@ -12,9 +12,6 @@ $(OUTPUT_DIR)/IconTexture.bin: IconTexture.png
@mkdir -p $(OUTPUT_DIR)
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --semi-trans --color-trans
$(OUTPUT_DIR)/YoshiFont.bin: YoshiFont.png
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans
$(OUTPUT_DIR)/Paco.bin: Paco.png
jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4 --color-trans

BIN
examples/PoolBox/assets/YoshiFont.png (Stored with Git LFS)

Binary file not shown.

View File

@ -5,10 +5,9 @@
</Description>
<Track>
<File name = "SYSTEM.CNF">System.cnf</File>
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/main_assets.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/asset_mgr.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
<Directory name="ASSETS" hidden = "true">
<Directory name = "MAIN">
<File name = "FONT.BIN" lz4 = "already">../assets/bin/YoshiFont.bin</File>
<File name = "PACO.BIN" lz4 = "already">../assets/bin/Paco.bin</File>
</Directory>
<File name = "FONT.BIN" lz4 = "already">../assets/bin/TexturePage.bin</File>