Quote:
void show_msg(char *message, uint32 fc, uint32 bc)
{
struct texVertex *vertices;
pspDebugScreenSetOffset(DEBUG_BUF);
pspDebugScreenSetBackColor(bc);
pspDebugScreenSetTextColor(fc);
pspDebugScreenSetXY(0, 0);
pspDebugScreenPrintf("%s", message);
sceGuEnable(GU_TEXTURE_2D);
sceGuTexMode(GU_PSM_8888,0,0,0);
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
sceGuTexFilter(GU_LINEAR, GU_LINEAR);
sceGuTexImage(0, 512, 8, 512, (void *)(0x40000000 | (uint32)sceGeEdramGetAddr() + DEBUG_BUF));
sceGuTexSync();
vertices = (struct texVertex*)sceGuGetMemory(2 * sizeof(struct texVertex));
vertices[0].u = 0;
vertices[1].u = strlen(message)*7;
vertices[0].v = 0;
vertices[1].v = 8;
vertices[0].x = (SCR_WIDTH-strlen(message)*7)/2;
vertices[1].x = vertices[0].x + strlen(message)*7;
vertices[0].y = SCR_HEIGHT-48;
vertices[1].y = vertices[0].y + 8;
vertices[0].z = 0;
vertices[1].z = 0;
sceGuDrawArray(GU_SPRITES,GU_TEXTURE_16BIT|GU_VERT EX_16BIT|GU_TRANSFORM_2D, 2,0,vertices);
}
That uses pspDebugScreenSetOffset() to make the subsequent pspDebugScreenPrintf() draw to a place designated as the debug text texture buffer. It's just one line worth of space - 512x8x4.