Integrate all the progress into master #6

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

View File

@ -1,4 +1,5 @@
#pragma once
#include <PSX/File/file_types.hpp>
#include <PSX/GPU/gpu_types.hpp>
namespace JabyEngine {

View File

@ -8,6 +8,6 @@ namespace JabyEngine {
.FontSize = {12, 16}
};
static void load(GPU::PositionU16 vram_dst);
static void load(uint32_t* work_area, SimpleTIM vram_dst);
};
}

View File

@ -3,6 +3,6 @@
namespace JabyEngine {
struct FontWriter {
static void setup(GPU::PositionU16 vram_pos, const FontInfo& font_info);
static void setup(SimpleTIM vram_dst, const FontInfo& font_info);
};
}

View File

@ -1,9 +1,24 @@
#include "default_font_data.hpp"
#include <FontWriter/default_font.hpp>
#include <PSX/File/Processor/file_processor.hpp>
#include <PSX/Auxiliary/lz4_decompressor.hpp>
#include <stdio.h>
namespace JabyEngine {
void DefaultFont :: load(GPU::PositionU16 vram_dst) {
printf("Loading DefaultFont @0x%p -> %lu\n", default_font_data, sizeof(default_font_data));
static size_t decompress_font(uint32_t* work_area) {
LZ4Decompressor lz4_decomp(reinterpret_cast<uint8_t*>(work_area));
const auto [progress, bytes_ready] = lz4_decomp.process(ArrayRange(default_font_data, sizeof(default_font_data)), true);
if(progress == Progress::Error) {
return 0;
}
return bytes_ready;
}
void DefaultFont :: load(uint32_t* work_area, SimpleTIM vram_dst) {
const auto bytes_ready = decompress_font(work_area);
auto processor = FileProcessor::create(work_area, vram_dst);
processor.process(bytes_ready);
}
}

View File

@ -2,7 +2,7 @@
#include <stdio.h>
namespace JabyEngine {
void FontWriter :: setup(GPU::PositionU16 vram_pos, const FontInfo& font_info) {
void FontWriter :: setup(SimpleTIM vram_dst, const FontInfo& font_info) {
printf("Hello Planschi c:\n");
}
}

View File

@ -15,10 +15,10 @@ using NewFontWriter = ::JabyEngine::FontWriter;
static object::Paco paco;
static void setup() {
static constexpr auto VRAMFontDst = GPU::PositionU16::create(320, 0);
static constexpr auto FontTIM = SimpleTIM(320, 0, 320, DefaultFont::Info.VRAMSize.height);
DefaultFont::load(VRAMFontDst);
NewFontWriter::setup(VRAMFontDst, DefaultFont::Info);
DefaultFont::load(&__heap_start, FontTIM);
NewFontWriter::setup(FontTIM, DefaultFont::Info);
Assets::load_for_main();
FontWriter::FontWriter::setup();