Here is the prx source code:
Code: Select all
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <time.h>
#include "graphics.h"
PSP_MODULE_INFO("bnr", 0, 1, 0);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int binary(int arg){
int vysledok = 0;
int jan = 1;
while(arg>0){
if(arg %2 == 1)
vysledok += jan;
arg /= 2;
jan *= 10;
}
return vysledok;
}
int main(){
sceKernelDelayThread(4000000);
time_t cas;
initGraphics();
int minuty, hodiny, i;
while(1){
cas = time(NULL);
minuty = binary((cas/60)%60);
hodiny = binary((cas/60/60+2)%24);
for(i=0; i<6; i++){
if(hodiny%10 == 1)
fillScreenRect(0xffffffff, 330, 35 - 6 * i, 5, 5);
hodiny /= 10;
}
for(i=0; i<6; i++){
if(minuty%10 == 1)
fillScreenRect(0xffffffff, 336, 35 - 6 * i, 5, 5);
minuty /= 10;
}
flipScreen();
sceDisplayWaitVblankStart();
sceKernelDelayThread(10000);
}
return 0;
}