diff --git a/src/Library/internal-include/BootLoader/color_debug.hpp b/src/Library/internal-include/BootLoader/color_debug.hpp index 14f52593..ea88ee28 100644 --- a/src/Library/internal-include/BootLoader/color_debug.hpp +++ b/src/Library/internal-include/BootLoader/color_debug.hpp @@ -3,6 +3,18 @@ #include namespace JabyEngine { + static void render_num(uint8_t value, uint16_t x, uint16_t y) { + static constexpr auto BitCount = 8; + + for(size_t n = 0; n < BitCount; n++) { + const uint16_t sub_x = (16*((BitCount - 1) - n)); + const uint16_t sub_y = (n&1)*16; + + GPU::internal::quick_fill_fast((value & (1 << n)) ? GPU::Color24::Blue() : GPU::Color24::Red(), {{static_cast(x + sub_x), static_cast(y + sub_y)}, {16, 16}}); + } + } + +#ifdef __USE_DEBUG_COLOR__ #define __debug_boot_color_at(color, x, y, scale) { \ ::JabyEngine::GPU::internal::quick_fill_fast(color, {{64*x, 64*y}, {static_cast(64*scale), static_cast(64*scale)}}); \ } @@ -11,4 +23,8 @@ namespace JabyEngine { __debug_boot_color_at(color, x, y, scale); \ printf(__VA_ARGS__); \ } +#else + #define __debug_boot_color_at(...) + #define __debug_boot_print_at(color, x, y, scale, ...) printf(__VA_ARGS__) +#endif // __USE_DEBUG_COLOR__ } \ No newline at end of file