Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
92 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ endif() | |
|
||
add_executable(batteryPercent | ||
batteryPercent.c | ||
blit.c | ||
draw.c | ||
font.c | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#ifndef __DRAW_H__ | ||
#define __DRAW_H__ | ||
|
||
#include <psp2/display.h> | ||
|
||
#define CYAN 0x00FFFF00 | ||
#define MAGENTA 0x00FF00FF | ||
#define YELLOW 0x0000FFFF | ||
#define WHITE 0x00FFFFFF | ||
#define BLACK 0x00000000 | ||
|
||
#define RGB(R, G, B) (((B) << 16) | ((G) << 8) | (R)) | ||
#define RGBT(R, G, B, T) (((T) << 24) | ((B) << 16) | ((G) << 8) | (R)) | ||
|
||
#define CENTER(num) ((960 / 2)-(num*(16/2))) | ||
|
||
/* | ||
* Sets up draw functions. | ||
*/ | ||
int drawInit(void); | ||
|
||
/* | ||
* This function sets the string colour, as well as the background colour. | ||
*/ | ||
void drawSetColour(int fg_col, int bg_col); | ||
|
||
/* | ||
* This function draws a string onto the screen. | ||
*/ | ||
int drawString(int sx, int sy, const char *msg); | ||
|
||
/* | ||
* This function draws a string onto the center of the screen. | ||
*/ | ||
int drawStringCenter(int sy, const char *msg); | ||
|
||
/* | ||
* This function draws a string onto the screen with string specifier formats. | ||
*/ | ||
int drawStringf(int sx, int sy, const char *msg, ...); | ||
|
||
/* | ||
* This function sets the frame buffer. | ||
*/ | ||
int drawSetFrameBuf(const SceDisplayFrameBuf *param); | ||
|
||
#endif |