Merge branch 'ToolBox_FontWriter_BSS-Improvement' into ToolBox_FontWriter

This commit is contained in:
jaby 2023-08-27 21:56:03 +02:00
commit d2d58db6fc
1 changed files with 13 additions and 0 deletions

View File

@ -1,11 +1,24 @@
#include <PSX/GPU/gpu_primitives.hpp>
#include <stdio.h>
extern "C" uint32_t __bss_start;
extern "C" uint32_t __bss_end;
extern void main();
namespace JabyEngine {
static void clear_bss() {
uint32_t* bss_adr = &__bss_start;
while(bss_adr < &__bss_end) {
printf("Free: 0x%p\n", bss_adr);
*bss_adr = 0;
bss_adr++;
}
}
// Executes the game
void __no_return run() {
clear_bss();
main();
printf("Stop!!\n");
while(true);