Clear bss section
This commit is contained in:
parent
ac4d788c4c
commit
5b0b303ddd
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue