Made screen.h use correct resolution instead of assuming

This commit is contained in:
2024-04-26 13:32:26 +02:00
parent e8c25ba41e
commit 642a5e2599
4 changed files with 73 additions and 17 deletions
+4 -4
View File
@@ -18,9 +18,9 @@
#define rgb(r,g,b) ( ((r) << 16 | (g) << 8 | (b)) & 0x00ffffff )
void drawPixel(int32_t x, int32_t y, uint32_t color) {
uint32_t* vidmem = *(uint32_t**)(MODE_INFO_BLOCK + 40);
uint32_t* vidmem = (uint32_t*)gfxMode->physicalBasePtr;
uint32_t offset = (y * WIDTH) + x;
uint32_t offset = (y * gfxMode->xRes) + x;
vidmem[offset] = color;
}
@@ -96,9 +96,9 @@ void drawCircle(int32_t x, int32_t y, uint16_t radius, uint32_t color) {
// Recursive (may need large stack)
void boundaryFill(int32_t x, int32_t y, uint32_t fillColor, uint32_t boundaryColor) {
uint32_t* vidmem = *(uint32_t**)(MODE_INFO_BLOCK + 40);
uint32_t* vidmem = (uint32_t*)gfxMode->physicalBasePtr;
uint32_t offset = y * WIDTH + x;
uint32_t offset = y * gfxMode->xRes + x;
if (vidmem[offset] != fillColor && vidmem[offset] != boundaryColor) {
vidmem[offset] = fillColor;