/* Verbosely displays the current graphics status. Calls GetGPUStatus() and interprets. Author : Jimb Esser */ void DisplayStatus() { PsxUInt32 s = GetGPUStatus(); PsxUInt32 t; printf("Status : 0x%X :\n", s); t = s & 0xf; printf(" Texture Page: x:%d y:%d ", t*64, (s&0x10)?256:0); s = s >> 5; printf("abr: %d ", s&0x3); s = s>>2; printf("texpage : "); switch (s & 0x3) { case 0: printf("4bit CLUT"); break; case 1: printf("8bit CLUT"); break; case 2: printf("15bit"); break; } s = s >> 2; printf(" dither: %s\n", (s&1)?"on":"off"); s = s >> 1; printf(" draw2display: %s", (s&1)?"on":"off"); s = s >> 1; printf(" applymask: %s", (s&1)?"on":"off"); s = s >> 1; printf(" nodraw2mask: %s\n", (s&1)?"on":"off"); s = s >> 1; s = s >> 3; // unused bits; if (s&1) { printf(" 384x"); } else { switch ((s >> 1)&3) { case 0: printf(" 256x"); break; case 1: printf(" 320x"); break; case 2: printf(" 512x"); break; case 3: printf(" 640x"); break; } } s = s >> 3; printf("%d ", (s&1)?480:240); s = s >> 1; printf("%s ", (s&1)?"PAL":"NTSC"); s = s >> 1; printf("%s ", (s&1)?"24bit":"15bit"); s = s >> 1; printf("Interlace %s, ", (s&1)?"on":"off"); s = s >> 1; printf("Display %s, ", (s&1)?"off":"on"); s = s >> 1; s = s >> 2; // Unused bits printf("GPU %s, ", (s&1)?"idle":"busy"); s = s >> 1; printf("img %s,\n", (s&1)?"ready":"not ready"); s = s >> 1; printf("Command %s, ", (s&1)?"ready":"not ready"); s = s >> 1; printf("DMA: "); switch (s&3) { case 0: printf("off"); break; case 1: printf("unknown"); break; case 2: printf("CPU->GPU"); break; case 3: printf("GPU->CPU"); break; } s = s >> 2; printf(", drawing %s\n", (s&1)?"odd":"even"); s = s >> 1; }