Integrate all the progress into master #6
|
@ -54,16 +54,10 @@ namespace JabyEngine {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Row {
|
Line lines[FontSize.height];
|
||||||
Line character[AmountOfChars];
|
|
||||||
};
|
|
||||||
|
|
||||||
Row rows[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++));
|
cur_line.load(__builtin_bswap16(*bit_map++));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,20 +94,23 @@ namespace JabyEngine {
|
||||||
static const auto LowerCaseLetter = RangeChar{{0x81, 64}, 26};
|
static const auto LowerCaseLetter = RangeChar{{0x81, 64}, 26};
|
||||||
|
|
||||||
void load() {
|
void load() {
|
||||||
FontBuffer buffer;
|
FontBuffer buffer[2];
|
||||||
|
|
||||||
for(size_t n = 0; n < 4; n++) {
|
|
||||||
buffer.load_char(n, SysCall::Krom2RawAdd(0x8200 | (UpperCaseLetter.start_char.base_offset + n)));
|
|
||||||
}
|
|
||||||
|
|
||||||
GPU::internal::DMA::Receive::prepare();
|
GPU::internal::DMA::Receive::prepare();
|
||||||
GPU::internal::DMA::Receive::set_dst(PositionU16::create(0, 0), SizeU16::create(16*4, 16));
|
for(size_t n = 0; n < 4; n++) {
|
||||||
GPU::internal::DMA::Receive::set_src(reinterpret_cast<const uintptr_t>(&buffer.rows));
|
auto& cur_buffer = buffer[n&0x1];
|
||||||
printf("Sending...\n");
|
const auto vram_pos = PositionU16::create(16*n, 0);
|
||||||
GPU::internal::DMA::Receive::start(sizeof(buffer)/4/16);
|
|
||||||
|
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::wait();
|
||||||
GPU::internal::DMA::end();
|
GPU::internal::DMA::end();
|
||||||
printf("Done!\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue