Send char by char
This commit is contained in:
parent
6d97cc4e74
commit
9d2b8d902d
|
@ -54,16 +54,10 @@ namespace JabyEngine {
|
|||
}
|
||||
};
|
||||
|
||||
struct Row {
|
||||
Line character[AmountOfChars];
|
||||
};
|
||||
|
||||
Row rows[FontSize.height];
|
||||
Line lines[FontSize.height];
|
||||
|
||||
void load_char(int32_t chr_idx, const uint16_t* bit_map) {
|
||||
for(auto& cur_row : this->rows) {
|
||||
auto& cur_line = cur_row.character[chr_idx];
|
||||
|
||||
void load_char(const uint16_t* bit_map) {
|
||||
for(auto& cur_line : this->lines) {
|
||||
cur_line.load(__builtin_bswap16(*bit_map++));
|
||||
}
|
||||
}
|
||||
|
@ -100,20 +94,23 @@ namespace JabyEngine {
|
|||
static const auto LowerCaseLetter = RangeChar{{0x81, 64}, 26};
|
||||
|
||||
void load() {
|
||||
FontBuffer buffer;
|
||||
|
||||
for(size_t n = 0; n < 4; n++) {
|
||||
buffer.load_char(n, SysCall::Krom2RawAdd(0x8200 | (UpperCaseLetter.start_char.base_offset + n)));
|
||||
}
|
||||
FontBuffer buffer[2];
|
||||
|
||||
GPU::internal::DMA::Receive::prepare();
|
||||
GPU::internal::DMA::Receive::set_dst(PositionU16::create(0, 0), SizeU16::create(16*4, 16));
|
||||
GPU::internal::DMA::Receive::set_src(reinterpret_cast<const uintptr_t>(&buffer.rows));
|
||||
printf("Sending...\n");
|
||||
GPU::internal::DMA::Receive::start(sizeof(buffer)/4/16);
|
||||
for(size_t n = 0; n < 4; n++) {
|
||||
auto& cur_buffer = buffer[n&0x1];
|
||||
const auto vram_pos = PositionU16::create(16*n, 0);
|
||||
|
||||
cur_buffer.load_char(SysCall::Krom2RawAdd(0x8200 | (UpperCaseLetter.start_char.base_offset + n)));
|
||||
|
||||
GPU::internal::DMA::wait();
|
||||
GPU::internal::DMA::Receive::set_dst(vram_pos, SizeU16::create(16, 16));
|
||||
GPU::internal::DMA::Receive::set_src(reinterpret_cast<const uintptr_t>(&cur_buffer.lines));
|
||||
GPU::internal::DMA::Receive::start(sizeof(FontBuffer)/4/16);
|
||||
}
|
||||
|
||||
GPU::internal::DMA::wait();
|
||||
GPU::internal::DMA::end();
|
||||
printf("Done!\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue