Dedicated to my friend Lionel, whom made me revisit my interest in playing the Rubik’s Cube Puzzle.

A Rubik’s Cube Timer, it is created to time time taken to solve the cube (Mine timings are usually between 1 and 3mins so no hours, or milliseconds implemented yet). The idea came after watching speed cubing videos online, we saw they had a special timer which they bang on to mark their completion.
Written in PaLib, here’s the code.
Visit this thread at PALib’s forums to download the files too.
/*
Zz85 Rubik Cube's Timer
App for Speed Cubing, for timing completion of puzzle.
RELEASES
Version 1.0 May 1, 2007 - Labour Day's Treat for my doctor-to-be friend Lionel
PLANS
Use hardware clock
Use nice sprints
Use sounds
*/
// Includes
#include <pa9 .h> // Include for PA_Lib
u16 RESET = 0;
u16 START = 1;
u16 END = 2;
u16 status = RESET;
void reset()
{
PA_OutputText(1, 6, 6, "%c1Ready...");
PA_OutputText(1, 6, 8, " ");
PA_OutputText(1, 6, 12, " ");
status = RESET;
}
void start()
{
PA_OutputText(1, 6, 6, " ");
PA_OutputText(1, 6, 8, "%c5Start!");
status = START;
}
void end()
{
PA_OutputText(1, 6, 12, "%c5End!");
status = END;
}
int main()
{
PA_Init(); // Initializes PA_Lib
PA_InitVBL(); // Initializes a standard VBL
PA_InitText(1, 2);
PA_OutputText(1, 4, 2, "%c4Zz85's %c1Rubik %c2Cube %c3Timer!");
PA_OutputText(1, 0, 16, "%c2Instructions:");
PA_OutputText(1, 0, 18, "%c2Press Start for reset. Any keys or touchpad to start and stop.");
PA_OutputText(1, 0, 21, "%c2Happy Cubing!");
u32 ticks = 0;
// Infinite loop to keep the program running
while (1)
{
if (status == END && Pad.Released.Start) reset();
else if (status == RESET)
{
ticks = 0;
if (Pad.Released.Anykey || Stylus.Released) start();
}
else if (status == START)
{
ticks++;
PA_OutputText(1, 6, 10, "%c5Time: %c0%d mins %d s ",(ticks/3600),(ticks/60 %60));
if (Pad.Newpress.Anykey || Stylus.Newpress) end();
}
PA_WaitForVBL(); // Wait for 1/60 of a second
}
return 0;
}

I think you need a proper (real) ticks counter. GPF made one for Nintendo DS, I don’t know if it will work with PALib but i don’t see any reason why it would not work.
Here is the copy-pasted code : http://rafb.net/p/5CYPfO81.html
Bye !
Hey… Thanks for the dedication. I guess in return I shall dedicate my first post from my PSP to you. This was typed outside Pizza Hut at Lot 1.
Hi JSR, thanks for your comments. (It was initially trapped under the spam trap)
I couldn’t access the link but its okay, so far the PaLib’s PA_WaitForVBL() seems to synchronise the 1/60s quite well. Of course, when I have the time, I hope I would use the real DS Clock, plus a few other cool features to this app (Hint: Hiscores).