Load a BIOS font
This commit is contained in:
parent
c448d3a720
commit
09650431e2
|
@ -148,18 +148,25 @@ namespace JabyEngine {
|
|||
return __syscall_function_cast(Table_B, uint32_t(*)(uint32_t))(event);
|
||||
}
|
||||
|
||||
static __always_inline int TestEvent(uint32_t event) {
|
||||
static __always_inline int32_t TestEvent(uint32_t event) {
|
||||
register uint32_t FuncID asm("t1") = 0x0B;
|
||||
|
||||
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
||||
return __syscall_function_cast(Table_B, int (*)(uint32_t))(event);
|
||||
return __syscall_function_cast(Table_B, int32_t (*)(uint32_t))(event);
|
||||
}
|
||||
|
||||
static __always_inline int EnableEvent(uint32_t event) {
|
||||
static __always_inline int32_t EnableEvent(uint32_t event) {
|
||||
register uint32_t FuncID asm("t1") = 0x0C;
|
||||
|
||||
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
||||
return __syscall_function_cast(Table_B, int (*)(uint32_t))(event);
|
||||
return __syscall_function_cast(Table_B, int32_t (*)(uint32_t))(event);
|
||||
}
|
||||
|
||||
static __always_inline const uint16_t* Krom2RawAdd(uint16_t sjis_code) {
|
||||
register uint32_t FuncID asm("t1") = 0x51;
|
||||
|
||||
__asm__ volatile("" : "=r"(FuncID) : "r"(FuncID));
|
||||
return __syscall_function_cast(Table_B, const uint16_t* (*)(uint16_t))(sjis_code);
|
||||
}
|
||||
|
||||
void printf(const char* txt, ...);
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include <PSX/System/IOPorts/dma_io.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <PSX/System/syscalls.hpp>
|
||||
|
||||
extern "C" uint32_t __heap_start;
|
||||
extern "C" uint32_t __bss_start;
|
||||
extern "C" uint32_t __bss_end;
|
||||
|
@ -42,6 +44,24 @@ namespace JabyEngine {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void test_bios_font() {
|
||||
static constexpr uint16_t SJIS = 0x83B5;
|
||||
|
||||
const auto* font = SysCall::Krom2RawAdd(SJIS);
|
||||
const auto*const font_end = font + 16;
|
||||
printf("Loading SJIS from @0x%p\n", font);
|
||||
|
||||
for(; font < font_end; font++) {
|
||||
const auto cur_char = __builtin_bswap16(*font);
|
||||
for(uint16_t shift = 1 << 15; shift; shift = shift >> 1) {
|
||||
printf(cur_char & shift ? "#" : " ");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void start() {
|
||||
static constexpr auto DebugX = 0;
|
||||
static constexpr auto DebugY = 0;
|
||||
|
@ -50,6 +70,7 @@ namespace JabyEngine {
|
|||
__debug_boot_print_at(GPU::Color24::White(), DebugX, DebugY, DebugScale, "Starting Planschbecken\n");
|
||||
printf("Heap starts @0x%p\n", &__heap_start);
|
||||
printf("BSS from 0x%p to 0x%p (%u)\n", &__bss_start, &__bss_end, __bss_len);
|
||||
test_bios_font();
|
||||
__debug_boot_print_at(GPU::Color24::Green(), DebugX, DebugY, DebugScale, "PLANSCHI from 0x%p to 0x%p\n", &__planschi_start, &__planschi_end);
|
||||
boot::Start::setup();
|
||||
|
||||
|
|
Loading…
Reference in New Issue