Support BIOS Font
This commit is contained in:
parent
a67a634fd8
commit
771257d813
|
@ -3,7 +3,7 @@
|
||||||
#include <PSX/GPU/gpu_auto_load_font.hpp>
|
#include <PSX/GPU/gpu_auto_load_font.hpp>
|
||||||
#include <PSX/GPU/make_gpu_primitives.hpp>
|
#include <PSX/GPU/make_gpu_primitives.hpp>
|
||||||
#include <PSX/Timer/frame_timer.hpp>
|
#include <PSX/Timer/frame_timer.hpp>
|
||||||
#include <FontWriter/default_font.hpp>
|
#include <FontWriter/fonts.hpp>
|
||||||
|
|
||||||
using JabyEngine::Make::PositionI8;
|
using JabyEngine::Make::PositionI8;
|
||||||
|
|
||||||
|
@ -21,10 +21,7 @@ void font_writer_setup() {
|
||||||
JabyEngine::GlobalFontPrimitivePool::setup(font_buffer);
|
JabyEngine::GlobalFontPrimitivePool::setup(font_buffer);
|
||||||
|
|
||||||
new_font_writer.setup(LibraryFontTIM, JabyEngine::DefaultFont::Info);
|
new_font_writer.setup(LibraryFontTIM, JabyEngine::DefaultFont::Info);
|
||||||
bios_font_writer.setup(JabyEngine::GPU::BIOS_Font::as_simple_tim(), {
|
bios_font_writer.setup(JabyEngine::BIOSFont::TIM, JabyEngine::BIOSFont::Info);
|
||||||
.texture_size = {64, 80},
|
|
||||||
.font_size = {16, 16}
|
|
||||||
});
|
|
||||||
timer.reset();
|
timer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +31,7 @@ void font_writer_update() {
|
||||||
auto state = JabyEngine::State::create(JabyEngine::Make::PositionI16(8, 8), wiggle_count);
|
auto state = JabyEngine::State::create(JabyEngine::Make::PositionI16(8, 8), wiggle_count);
|
||||||
new_font_writer.write(state, "012345 ABCDEFGHIJKL\nabcedfghijkl\n", JabyEngine::GPU::Color24::Blue(), &wiggle);
|
new_font_writer.write(state, "012345 ABCDEFGHIJKL\nabcedfghijkl\n", JabyEngine::GPU::Color24::Blue(), &wiggle);
|
||||||
new_font_writer.write(state, "%i (0x%p)\nWiggle (%s)\n", JabyEngine::GPU::Color24::Green(), &wiggle, wiggle_count, 0xAABBCCDD, Text[wiggle_count&0x1]);
|
new_font_writer.write(state, "%i (0x%p)\nWiggle (%s)\n", JabyEngine::GPU::Color24::Green(), &wiggle, wiggle_count, 0xAABBCCDD, Text[wiggle_count&0x1]);
|
||||||
bios_font_writer.write(state, "!!PLANSCHBECKEN!!");
|
bios_font_writer.write(state, "!!PLANSCHBECKEN!!", JabyEngine::GPU::Color24::White());
|
||||||
|
|
||||||
if(timer.is_expired_for(50_ms)) {
|
if(timer.is_expired_for(50_ms)) {
|
||||||
timer.reset();
|
timer.reset();
|
||||||
|
|
|
@ -30,10 +30,6 @@ namespace JabyEngine {
|
||||||
static constexpr OffsetPageWithClut get_offset_page_with_clut() {
|
static constexpr OffsetPageWithClut get_offset_page_with_clut() {
|
||||||
return OffsetPageWithClut::create(BIOS_Font::get_offset_page(), BIOS_Font::get_page_clut());
|
return OffsetPageWithClut::create(BIOS_Font::get_offset_page(), BIOS_Font::get_page_clut());
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr SimpleTIM as_simple_tim() {
|
|
||||||
return SimpleTIM(BIOS_Font::TextureLoadPos.x, BIOS_Font::TextureLoadPos.y, BIOS_Font::CLUTLoadPos.x, BIOS_Font::CLUTLoadPos.y);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,13 +0,0 @@
|
||||||
#pragma once
|
|
||||||
#include "Type/types.hpp"
|
|
||||||
|
|
||||||
namespace JabyEngine {
|
|
||||||
struct DefaultFont {
|
|
||||||
static constexpr auto Info = FontInfo {
|
|
||||||
.texture_size = {64, 80},
|
|
||||||
.font_size = {12, 16}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void load(uint32_t* work_area, SimpleTIM vram_dst);
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
#pragma once
|
||||||
|
#include "Type/types.hpp"
|
||||||
|
#include <PSX/GPU/gpu_auto_load_font.hpp>
|
||||||
|
|
||||||
|
namespace JabyEngine {
|
||||||
|
struct DefaultFont {
|
||||||
|
static constexpr auto Info = FontInfo {
|
||||||
|
.texture_size = {64, 80},
|
||||||
|
.font_size = {12, 16}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void load(uint32_t* work_area, SimpleTIM vram_dst);
|
||||||
|
};
|
||||||
|
|
||||||
|
struct BIOSFont {
|
||||||
|
static constexpr auto Info = FontInfo {
|
||||||
|
.texture_size = {64, 96},
|
||||||
|
.font_size = {16, 16}
|
||||||
|
};
|
||||||
|
|
||||||
|
static constexpr auto TIM = SimpleTIM(JabyEngine::GPU::BIOS_Font::TextureLoadPos.x, JabyEngine::GPU::BIOS_Font::TextureLoadPos.y, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.x, JabyEngine::GPU::BIOS_Font::CLUTLoadPos.y);
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
#include "default_font_data.hpp"
|
#include "default_font_data.hpp"
|
||||||
#include <FontWriter/default_font.hpp>
|
#include <FontWriter/fonts.hpp>
|
||||||
#include <PSX/File/Processor/file_processor.hpp>
|
#include <PSX/File/Processor/file_processor.hpp>
|
||||||
#include <PSX/Auxiliary/lz4_decompressor.hpp>
|
#include <PSX/Auxiliary/lz4_decompressor.hpp>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
Loading…
Reference in New Issue