-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.c
40 lines (33 loc) · 786 Bytes
/
ui.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <libgte.h>
#include <libgpu.h>
#include "ui.h"
#include "display.h"
#include "padEx.h"
void ui_LoadTexture(u_long* tim, TIM_IMAGE* tparam) {
OpenTIM(tim);
ReadTIM(tparam);
// Upload pixel data to framebuffer
LoadImage(tparam->prect, tparam->paddr);
DrawSync(0);
// Upload CLUT to framebuffer
if (tparam->mode & 0x8) {
LoadImage(tparam->crect, tparam->caddr);
DrawSync(0);
}
}
SPRTDATA ui_LoadSpriteData(TIM_IMAGE* tparam) {
SPRTDATA data = { 0 };
data.prect = *tparam->prect;
data.crect = *tparam->crect;
data.mode = tparam->mode;
return data;
}
void ui_DrawSprite(SPRTDATA data, uint8_t color[3]) {
disp_DrawSprite(data, color);
}
void ui_SetTPage(SPRTDATA data) {
disp_SetDrawTPage(data);
}