Integrate all the progress into master #6

Merged
jaby merged 595 commits from ToolBox into main 2025-01-01 13:17:44 +00:00
4 changed files with 29 additions and 38 deletions
Showing only changes of commit fe62aa4e16 - Show all commits

View File

@ -20,7 +20,7 @@ namespace FontWriter {
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(LibraryFontTIM, JabyEngine::DefaultFont::Info);//(JabyEngine::BIOSFont::TIM, JabyEngine::BIOSFont::Info); bios_font_writer.setup(JabyEngine::BIOSFont::TIM, JabyEngine::BIOSFont::Info);
timer.reset(); timer.reset();
} }

View File

@ -66,7 +66,7 @@ namespace JabyEngine {
GPU::internal::DMA::Receive::prepare(); GPU::internal::DMA::Receive::prepare();
load_special_chars(start_pos, Specials); load_special_chars(start_pos, Specials);
load_alpha_num(start_pos, AlphaNumeric); load_alpha_num(start_pos, AlphaNumeric);
font_buffer.flush(); font_buffer.shutdown();
} }
} }
} }

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "../../../internal-include/GPU/gpu_internal.hpp"
#include <PSX/GPU/gpu_auto_load_font.hpp> #include <PSX/GPU/gpu_auto_load_font.hpp>
namespace JabyEngine { namespace JabyEngine {
@ -30,60 +31,50 @@ namespace JabyEngine {
}; };
// Letters are actually only 16x15 but should be treated 16x16 // Letters are actually only 16x15 but should be treated 16x16
// FIXME: This is to big for Linked Lists. Maybe we do not buffer this at all? Or just double buffer it? struct Letter {
struct Letter /*: public GPU::internal::LinkedElementCreator<Letter>*/ { PositionU16 position;
CPU2VRAM cmd;
Line lines[BIOS_Font::Size.height - 1]; Line lines[BIOS_Font::Size.height - 1];
Line empty_line; Line empty_line;
void setup(const SizeU16& size) { void setup() {
this->cmd.cmd = GPU_IO::Command::CPU2VRAM_Blitting();
this->cmd.size = GPU_IO::Command::WidthHeight(size);
this->empty_line.load(0); this->empty_line.load(0);
} }
void load_to(const PositionU16& pos, const uint16_t* bit_map) { void load_to(const PositionU16& pos, const uint16_t* bit_map) {
this->cmd.pos = GPU_IO::Command::TopLeftPosition(pos); this->position = pos;
for(auto& cur_line : this->lines) { for(auto& cur_line : this->lines) {
cur_line.load(__builtin_bswap16(*bit_map++)); cur_line.load(__builtin_bswap16(*bit_map++));
} }
} }
}; };
// v ::Linked v double buffer do not change size without adjusting // v double buffer do not change size without adjusting
Letter letter_buffer[2*4]; Letter letter_buffer[2];
uint8_t free_idx; uint8_t free_idx;
void setup() { void setup() {
for(auto& letter : this->letter_buffer) { for(auto& letter : this->letter_buffer) {
letter.setup(SizeU16::create(16/4, 16)); letter.setup();
//letter.set_link_identitiy();
} }
this->free_idx = 0; this->free_idx = 0;
GPU::internal::DMA::Receive::prepare();
}
void shutdown() {
GPU::internal::DMA::wait();
GPU::internal::DMA::end();
} }
void load_to(const PositionU16& pos, const uint16_t* bit_map) { void load_to(const PositionU16& pos, const uint16_t* bit_map) {
auto& cur_letter = this->letter_buffer[this->free_idx++]; auto& cur_letter = this->letter_buffer[this->free_idx];
this->free_idx ^= 1;
cur_letter.load_to(pos, bit_map); cur_letter.load_to(pos, bit_map);
if((this->free_idx&0x3) == 0) { GPU::internal::DMA::wait();
//cur_letter.terminate(); GPU::internal::DMA::Receive::set_src(reinterpret_cast<uintptr_t>(cur_letter.lines));
//GPU::render(this->letter_buffer[this->free_idx - 4]); // v 4 Pixel per byte
this->free_idx &= ~0x7; GPU::internal::DMA::Receive::set_dst(cur_letter.position, SizeU16::create(16/4, 16));
} GPU::internal::DMA::Receive::start(sizeof(Line) >> 2);
else {
//cur_letter.concat(this->letter_buffer[this->free_idx]);
}
}
void flush() {
if((this->free_idx&0x3) != 0) {
//this->letter_buffer[this->free_idx - 1].terminate();
const auto idx = this->free_idx > 3 ? 4 : 0;
//GPU::render(this->letter_buffer[idx]);
}
} }
static PositionU16 vram_offset(uint16_t tile_id) { static PositionU16 vram_offset(uint16_t tile_id) {

View File

@ -112,11 +112,11 @@ namespace JabyEngine {
static constexpr auto DebugY = 0; static constexpr auto DebugY = 0;
static constexpr auto DebugScale = 1.0; static constexpr auto DebugScale = 1.0;
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale); __debug_boot_color_at(::JabyEngine::GPU::Color24::Grey(), DebugX, DebugY, DebugScale);
Periphery::setup(); enable_DMA();
__debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale); __debug_boot_color_at(::JabyEngine::GPU::Color24::White(), DebugX, DebugY, DebugScale);
enable_DMA(); Periphery::setup();
__debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale); __debug_boot_color_at(::JabyEngine::GPU::Color24::Red(), DebugX, DebugY, DebugScale);
SPU::stop_voices(); SPU::stop_voices();