diff --git a/src/Library/internal-include/BootLoader/color_debug.hpp b/src/Library/internal-include/BootLoader/color_debug.hpp new file mode 100644 index 00000000..d4d63fa8 --- /dev/null +++ b/src/Library/internal-include/BootLoader/color_debug.hpp @@ -0,0 +1,22 @@ +#pragma once +#include "../GPU/gpu_internal.hpp" +#include + +namespace JabyEngine { + #define __debug_boot_color_at(color, diag) { \ + ::JabyEngine::GPU::internal::quick_fill_fast(color, {{diag*64, diag*64}, {64, 64}}); \ + } + + #define __debug_boot_print_at(color, diag, ...) { \ + __debug_boot_color_at(color, diag); \ + printf(__VA_ARGS__); \ + } + + #define __debug_boot_color0(color) __debug_boot_color_at(color, 0) + #define __debug_boot_color1(color) __debug_boot_color_at(color, 1) + #define __debug_boot_color2(color) __debug_boot_color_at(color, 2) + + #define __debug_boot_print0(color, ...) __debug_boot_print_at(color, 0, __VA_ARGS__) + #define __debug_boot_print1(color, ...) __debug_boot_print_at(color, 1, __VA_ARGS__) + #define __debug_boot_print2(color, ...) __debug_boot_print_at(color, 2, __VA_ARGS__) +} \ No newline at end of file diff --git a/src/Library/src/BootLoader/start_boot.cpp b/src/Library/src/BootLoader/start_boot.cpp index 133ef08d..074316aa 100644 --- a/src/Library/src/BootLoader/start_boot.cpp +++ b/src/Library/src/BootLoader/start_boot.cpp @@ -1,4 +1,5 @@ #include "../../internal-include/BootLoader/boot_loader.hpp" +#include "../../internal-include/BootLoader/color_debug.hpp" #include "../../internal-include/GPU/gpu_internal.hpp" #include #include @@ -18,13 +19,18 @@ namespace JabyEngine { } static void setup() { + __debug_boot_color1(::JabyEngine::GPU::Color24::White()); enable_DMA(); + __debug_boot_color1(::JabyEngine::GPU::Color24::Red()); SPU::stop_voices(); + __debug_boot_color1(::JabyEngine::GPU::Color24::Green()); CD::setup(); + __debug_boot_color1(::JabyEngine::GPU::Color24::Blue()); Timer::setup(); + __debug_boot_color1(::JabyEngine::GPU::Color24::Yellow()); GPU::setup(); GPU::display_logo(); @@ -33,15 +39,14 @@ namespace JabyEngine { } } } - void start() { - printf("Starting Planschbecken\n"); + __debug_boot_print0(GPU::Color24::White(), "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); - printf("PLANSCHI from 0x%p to 0x%p\n", &__planschi_start, &__planschi_end); + __debug_boot_print0(GPU::Color24::Green(), "PLANSCHI from 0x%p to 0x%p\n", &__planschi_start, &__planschi_end); boot::Start::setup(); - printf("Running main...\n"); + __debug_boot_print0(GPU::Color24::Red(), "Running main...\n"); GPU::internal::wait_vsync(0); run(); }