Compare commits

...

3 Commits

Author SHA1 Message Date
Potter360 49a30e87b8 Add color argument in dclear() 2024-03-20 21:27:26 +01:00
Potter360 bd4f926a13 Add #pragma once in display.h 2024-03-20 21:26:03 +01:00
Potter360 0214642db3 Remove omega.a from Makefile 2024-03-20 21:25:24 +01:00
4 changed files with 7 additions and 5 deletions

View File

@ -36,6 +36,6 @@ uninstall:
rm $(DESTDIR)/local/lib/omega.a
rm -r $(DESTDIR)/local/include/omega
clean:
rm -rf build omega.a
rm -rf build
.PHONY: all compile clean

View File

@ -1,3 +1,5 @@
#pragma once
#include <stdint.h>
#define rgb565(r, g, b) (((r & 0x1F) << 11) | ((g & 0x3F) << 5) | (b & 0x1F))
#define C_BLACK rgb565(0,0,0)
@ -23,7 +25,7 @@ void dupdate(void);
// initialize vram with white pixels
void dinit(void);
void dimage(int x, int y, image_t *image);
void dclear(void);
void dclear(uint16_t color);
void dtext(int x, int y, char *str, uint16_t color);
void dprintf(int x, int y, uint16_t color, char *format, ...);
void drect(int x1, int y1, int x2, int y2, uint16_t color);

View File

@ -39,7 +39,7 @@ ONORETURN void cpu_panic(void)
while(1)
{
dclear();
dclear(C_WHITE);
drect(0,0,DWIDTH,10,C_RED);
dprintf(1,1,C_WHITE, "An exception occured !");
dprintf(1,20,C_BLACK, "%x : %s", code, name);

View File

@ -68,11 +68,11 @@ void dline(int x0, int y0, int x1, int y1, uint16_t color)
x=x+1;
}
}
void dclear(void)
void dclear(uint16_t color)
{
for(int i = 0;i<DWIDTH;i++){
for(int j=0;j<DHEIGHT;j++){
dpixel(i,j,0xffff);
dpixel(i,j,color);
}
}