Added some functions. You can now make REAL games with this lib !

This commit is contained in:
mibi88 2023-01-15 20:49:48 +01:00
parent f8e00a91d4
commit fef708ab6c
5 changed files with 74 additions and 0 deletions

View File

@ -29,6 +29,15 @@ in the VRAM.
void srect(int x1, int y1, int x2, int y2);
/* void sline(int x1, int y1, int x2, int y2, int color);
Draws a line with a width of one pixel from (x1, y1) to (x2, y2) in the VRAM of
color color.
The available colors are SWHITE or SBLACK.
*/
void sline(int x1, int y1, int x2, int y2, int color);
/* void spixel(int x, int y, int color);
Set the pixel at (x, y) in the color color in the VRAM.
@ -94,5 +103,21 @@ Wait ms miliseconds.
*/
void tsleep_ms(int ms);
/* void tgetticks(void);
Get 1/128 seconds ticks since midnight.
*/
void tgetticks(void);
/* int tiselapsed(int start, int ms);
Check if ms where elapsed since start (ticks that you can
get with tgetticks).
Returns 1 if ms is elapsed and 0 if it is not.
*/
int tiselapsed(int start, int ms);
#endif

View File

@ -11,6 +11,8 @@ void _Bdisp_SetPoint_VRAM(int x, int y, int color);
void _PrintXY(int x, int y, unsigned char *text, int type);
void _locate(int x, int y);
void _Print(unsigned char *text);
void _Bdisp_DrawLineVRAM(int x1, int y1, int x2, int y2);
void _Bdisp_ClearLineVRAM(int x1, int y1, int x2, int y2);
/* Microfx */
@ -30,6 +32,14 @@ void srect(int x1, int y1, int x2, int y2) {
_Bdisp_DrawRectangle(x1, y1, x2, y2);
}
void sline(int x1, int y1, int x2, int y2, int color) {
if(color){
_Bdisp_DrawLineVRAM(x1, y1, x2, y2);
}else{
_Bdisp_ClearLineVRAM(x1, y1, x2, y2);
}
}
void stext(int x, int y, char *text) {
_PrintXY(x, y, (unsigned char*)text, 0);
}
@ -94,3 +104,11 @@ void tsleep_ms(int ms) {
_Sleep(ms);
}
void tgetticks(void) {
_RTC_GetTicks();
}
int tiselapsed(int start, int ms) {
return _RTC_Elapsed_ms(start, ms);
}

View File

@ -8,6 +8,8 @@
.global __PrintXY
.global __locate
.global __Print
.global __Bdisp_DrawLineVRAM
.global __Bdisp_ClearLineVRAM
/* Keyboard */
.global __Keyboard_GetPressedTime
.global __Keyboard_IsKeyPressed
@ -47,6 +49,10 @@ __locate:
syscall(0x807)
__Print:
syscall(0x808)
__Bdisp_DrawLineVRAM:
syscall(0x030)
__Bdisp_ClearLineVRAM:
syscall(0x031)
/* Keyboard */
__Keyboard_GetPressedTime:
syscall(0x249)

View File

@ -29,6 +29,15 @@ in the VRAM.
void srect(int x1, int y1, int x2, int y2);
/* void sline(int x1, int y1, int x2, int y2, int color);
Draws a line with a width of one pixel from (x1, y1) to (x2, y2) in the VRAM of
color color.
The available colors are SWHITE or SBLACK.
*/
void sline(int x1, int y1, int x2, int y2, int color);
/* void spixel(int x, int y, int color);
Set the pixel at (x, y) in the color color in the VRAM.
@ -94,5 +103,21 @@ Wait ms miliseconds.
*/
void tsleep_ms(int ms);
/* void tgetticks(void);
Get 1/128 seconds ticks since midnight.
*/
void tgetticks(void);
/* int tiselapsed(int start, int ms);
Check if ms where elapsed since start (ticks that you can
get with tgetticks).
Returns 1 if ms is elapsed and 0 if it is not.
*/
int tiselapsed(int start, int ms);
#endif

Binary file not shown.