void sceGuClear(int flags) { Color* dest = getVramDrawBuffer(); for (int n = 0; n < PSP_LINE_SIZE*SCREEN_HEIGHT; n++) { dest[n] = clear_color; } }
void fillScreenRect(Color color, int x0, int y0, int width, int height) { if (!initialized) return; int skipX = PSP_LINE_SIZE - width; int x, y; Color* data = getVramDrawBuffer() + x0 + y0 * PSP_LINE_SIZE; for (y = 0; y < height; y++, data += skipX) { for (x = 0; x < width; x++, data++) *data = color; } }
void sceGuDrawArray(int prim, int vtype, int count, const void* indices, const void* vertices) { Vertex* v = (Vertex*) vertices; int sx = v[0].u; int sy = v[0].v; int dx = v[0].x; int dy = v[0].y; int width = v[1].x - v[0].x; int height = v[1].y - v[0].y; int x, y; Color* dest = getVramDrawBuffer(); for (y = 0; y < height; y++) { for (x = 0; x < width; x++) { Color color = ((Color*)currentTexture)[x + sx + (y + sy) * currentTextureWidth]; if (color & 0xFF000000) dest[x + dx + (y + dy) * 512] = color; } } }
void putPixelScreen(Color color, int x, int y) { Color* vram = getVramDrawBuffer(); vram[PSP_LINE_SIZE * y + x] = color; }