# New Cube Timer for Nintendo DS



## Zarxrax (Jan 16, 2009)

I just tossed together a very very basic timer for nintendo ds. 
I am no longer developing this, but the code is available if anyone else wants to.

Features:
- stackmat-style start/stop
- displays the last 12 times (no averages though)
- screen can be flipped
- "algorithm viewer" for helping you practice and learn your algorithms. Requires you to supply your own images

Of course the main advantage of this application is that the nintendo ds is very portable, so you can time yourself wherever you go.

In order to use this, you just need a flash cart.

Download CuTiDS v0.5: http://amvhell.com/stuff/ds/CuTiDS-0.5.zip
Code Repository: http://code.google.com/p/cutids/


----------



## cookingfat (Jan 16, 2009)

I will try this right away and post back.

edit - 12 move scrambles fail. sorry


----------



## Zarxrax (Jan 16, 2009)

I just started cubing about 2 weeks ago. Whats a good size? 24?


----------



## cookingfat (Jan 16, 2009)

use 25, same as cct which is what I use.

It would be good if it could somehow show your times in a list. Even better an average as well, but I know nothing about programming, so I'll leave that to you.


----------



## Zarxrax (Jan 16, 2009)

I've updated it to use 25.

Yea, time records are something that I'm thinking of possibly implementing, but it's difficult. And that would probably come later after I make it look a bit more pretty.

Other features I'm thinking of are an inspection time, and a "stackmat mode", where you have to hold buttons on both sides of the ds, then the timer starts when you let go.


----------



## cookingfat (Jan 16, 2009)

sounds like a good project, you should continue it and let us know.

It's much better with the new scrambles too. the Ds look weird in that font though.


----------



## panyan (Jan 16, 2009)

FANTASTIC, THANKS!


----------



## 36duong (Jan 17, 2009)

few questions before i try it,

does it calculate averages of 5 and 12?

does it store time? (i wouldn't imagine creating a .sav file would be hard)

are any other cube sizes going to be added in the new future? (eg. 2x2x2 wouldn't be hard, just make the code to use R, F and U)

I would try it, except I am currently in the United States for SFO 09, and don't have a micro sd card reader.


----------



## Musturd (Jan 17, 2009)

Please continue working on it!
Maybe add a function to touch the touch-screen to start/stop the timer\
Also adding a background picture would be nice

If you need help with PAlib, I have _some_ experience with it but not much...


----------



## Zarxrax (Jan 17, 2009)

36duong said:


> does it calculate averages of 5 and 12?
> does it store time? (i wouldn't imagine creating a .sav file would be hard)


It only does what I said in the first post, so no. Simply saving times isn't necessarily hard in itself, but theres a lot of other little stuff that goes along with it. For instance, if it saves times, then you probably want to view some of the previous times as well. This requires creating some sort of interface for viewing times. Then there are questions such as how many times should it store? All times? Should it keep a database so you can look at your times from a year ago and see how you progressed? It's suddenly turned into a very complex problem.



36duong said:


> are any other cube sizes going to be added in the new future? (eg. 2x2x2 wouldn't be hard, just make the code to use R, F and U)


I hadn't thought of it, but its a possibility. This complicates the previous issue of storing times, though.



Musturd said:


> Please continue working on it!
> Maybe add a function to touch the touch-screen to start/stop the timer\
> Also adding a background picture would be nice
> 
> If you need help with PAlib, I have _some_ experience with it but not much...



I had thought of using the touch screen, but it doesn't always register a touch if you slap at the screen, which I imagine most people would do, so it's probably better to just leave the bottom screen open for selecting options and such. If you want to help, its definitely welcome, because I *suuuuck* at programming.


----------



## *LukeMayn* (Jan 17, 2009)

YAY I have all I need


----------



## julesv (Jan 17, 2009)

This is OK. I emulated it on my mac and it works fine. Could have better graphics. The Font is good. I would also make longer scrambles. I have a question... Did you use the DS developer kit to make this if not what?


----------



## cookingfat (Jan 17, 2009)

julesv said:


> The Font is good.



I kinda disagree, but it's only minor detail. Hopefully the op with carry on developing this to make it better, it's a good idea. Also, you don't really need scrambles longer than 25.


----------



## julesv (Jan 17, 2009)

Another thing would be to fill the top screen at least a bit more.


----------



## TurbulentTurtle (Jan 17, 2009)

I am very interested by this. Maybe it could do averages of 5 and 12 (or just a running average and you can stop whenever you want) and it would save a maximum of say, 5-10 solves depending on whether you want to save the session or not.
The DS would be viable for the touchpad type deal since buttons are located on opposite sides of the DS.

Saving times wouldn't even be a priority, I think as long as it generates good scrambles and allows handy start/stop functions then it will already be a very good cube timer. I bring my DS around with me anyway, so this would actually be pretty useful.
It is better than that cube scrambler on my phone which only provides scrambles and doesn't record time.


----------



## Bounb (Jan 17, 2009)

Cool, I started making one a while ago but never finished it.
Would you mind disclosing your source code?


----------



## Musturd (Jan 17, 2009)

Yes, open your source please!
(or just PM it to me  )

Back in the summer, I noticed that someone was developing a homebrew game that I was really interested in, so I asked if I could work on it. When he sent me the source code, though, this is what it looked like:


```
while (1)
	{			
		MyCounter++;
		Move10--;
		Move11--;
		Move12--;
		Move13--;
		Move14--;
		Move15--;
		Move16--;
		Move17--;
		...
		hit10++;
		hit11++;
		hit12++;
		hit13++;
		hit14++;
		hit15++;
		hit16++;
		hit17++;
		hit18++;
		hit19++;
		hit20++;
		hit21++;
		hit22++;
		hit23++;
		hit24++;
		hit25++;
		hit26++;
		hit27++;
		hit28++;
		hit29++;
		hit30++;
		hit31++;
		...
		hit51++;
		hit52++;
		hit53++;
                ...
                if (MyCounter == 1){ note = 10; Move10 = 270; hit10 = 0; PA_SetSpriteY(1,10,6);}//g
		if (MyCounter == 2){ note = 22; Move22 = 270; hit22 = 0; PA_SetSpriteY(1,22,53);}//r
		if (MyCounter == 22){ note = 11; Move11 = 270; hit11 = 0; PA_SetSpriteY(1,11,6);}//g
		if (MyCounter == 23){ note = 23; Move23 = 270; hit23 = 0; PA_SetSpriteY(1,23,53);}//r
		if (MyCounter == 30){ note = 12; Move12 = 270; hit12 = 0; PA_SetSpriteY(1,12,6);}//g
                ...
                if (MyCounter == 15630){ note = 28; Move28 = 270; hit28 = 0; PA_SetSpriteY(1,28,53);}//r
		if (MyCounter == 15631){ note = 38; Move38 = 270; hit38 = 0; PA_SetSpriteY(1,38,101);}//y
		if (MyCounter == 15650){ note = 29; Move29 = 270; hit29 = 0; PA_SetSpriteY(1,29,53);}//r
		if (MyCounter == 15651){ note = 39; Move39 = 270; hit39 = 0; PA_SetSpriteY(1,39,101);}//y
```

This code was so terrible I basically started over... and ended up not finishing, but that's beside the point. If you are new to programming, you need to get in the habit of organizing your code. Obviously you shouldn't have that much code right now because the app is pretty basic, but just so you know...

Anyway, I'd love to have a look at your source and work on your app with you.



> Did you use the DS developer kit to make this if not what?


He used PAlib which is a wrapper for a library in the unofficial DS development kit, devkitPro, called libnds. PAlib is 1000x easier to understand if you are not experienced with low level programming (and I am not). I tried to develop without PAlib for a few weeks, but there are not many tutorials for libnds out there. PAlib is very well documented and has very good tutorials.
Hopefully this makes sense...


----------



## panyan (Jan 17, 2009)

a few ideas:
1) use touchpad and have two areas that you need to touch with your hands like a stackmat
2) saves your best three solves
3) more cubes/puzzles
4) official scramble length
5) logs your solves and gives statistics about them


----------



## *LukeMayn* (Jan 17, 2009)

panyan said:


> a few ideas:
> 1) use touchpad and have two areas that you need to touch with your hands like a stackmat
> 2) saves your best three solves
> 3) more cubes/puzzles
> ...



1. no he shouldn't cos you might damage the screen slamming your hands down
2. no opinion
3. for sure
4. it is :/
5. this is a *MUST*
I think you should have the timer bigger to... like the whole top screen and then have the scramble on the bottom screen.
I also think that you should be able to hold down a button and when you RELEASE it, the timer starts.


----------



## Zarxrax (Jan 17, 2009)

Ok I have posted a new version (ill call this v0.1), with larger, better fonts. It's rather sad that it took me the entire day today to figure out how to do that :\
Source code is also up now.


----------



## Musturd (Jan 17, 2009)

Looks great!
Do you mind if I write a function or two for you?
I'll just PM you the updated source or something and you can approve or deny whatever I do.

EDIT: BTW, I'm liking your source code

EDIT2: I made a few updates to the source (not a function, but whatever)
I added an inspection period before the timer starts (but it counts up to 15, instead of counting down).
After the first 15 seconds it starts like it normally does.
I also changed the CheckKeys function so that the timer starts on release (as requested), hopefully Zarxar liked what I did, but you all will have to wait until he posts it just in case he doesn't...


----------



## Zarxrax (Jan 18, 2009)

Wow, that was fast. I want to add in an option on the bottom screen to enable or disable the inspection period, and a sound effect for when its up. Also maybe it would be better to count down instead of up? Do you want to make those changes or shall I? 
Making touch interface options is sort of a pain, but I've done it in another app before, so I have something to copy from. I'm really slow though.


----------



## Musturd (Jan 18, 2009)

The reason it was fast was because I didn't do anything too major...
I don't really know how to make it count down, so if you have any ideas - and as I was typing this I think I just figured it out.
I'm pretty much garbage at designing graphics and menus and what not. I probably could do the touch-screen button pressing (which is annoying I know), but I cannot design the graphics for it.

Also, during the week I have practically no free time, so don't expect me to work on it (although I might), but I definitely would like to work on it.

I've never done anything with sounds in PAlib, but it shouldn't be too hard to figure out.

Just tell me what you want me to do, and I'll do it.

Oh, and I think we should eventually work on creating a way to save recent times (and delete them) and show them somewhere on the bottom screen, so if you design a touch menu make sure to leave room for those times. If you are bad at graphic design too, then maybe someone else can draw up a menu for us.

EDIT: Made the inspection timer countdown (except it starts at 14.99 and it blinks at 0, but I think it works pretty well) check your PM box!


----------



## Zarxrax (Jan 18, 2009)

Alright thanks, I'll try to do some of that stuff tomorrow and see how it goes.


----------



## Musturd (Jan 18, 2009)

Keep me posted if you have something for me to do.


----------



## Bounb (Jan 18, 2009)

I'm also interested in collaborating,

I can add graphics, saving of times, support (scrambles etc) for multiple puzzles, touch screen interaction etc.

Will work on some stuff later and post if I make something nice 

Thanks for the source.

Using the Touch Screen Stackmat Timer Style - will add graphics later
Note: works best with one hand to start/stop


Add TextInit to main

```
// Initilize simple text on both screens
PA_InitText(0,1);
PA_InitText(1,1);
```

New CheckKeys function

```
// Function: CheckKeys
bool CheckKeys(bool timer_running)
{
   if (Pad.Held.Anykey || Stylus.Held)
   {
                       
   if (timer_running==true)
      {
      	PA_VBLCounterPause(0); 
      }  	
      else
      {
      PA_OutputSimpleText(0,0,0,"Ready...");
      } 
                       
   }
     
   if (Pad.Released.Anykey || Stylus.Released)
   {
      if (timer_running==true)
      {
      PA_VBLCounterPause(0);
      return false;
      }  	
      else
      { 
      PA_OutputSimpleText(0,0,0,"        "); 
      PA_Clear8bitBg(1);
      Scramble();
      PA_VBLCounterStart(0); 
      return true;
      } 
   }
}
```


----------



## Zarxrax (Jan 18, 2009)

Bounb: thanks but I don't think using touch screen will work great for many reasons already stated, most importantly of which is that we need the screen for options and stuff.

I'm going to work on a menu on bottom screen today, so maybe you can do either saving times, or multiple puzzle support (it will have to be set up to save different times for separate puzzles)?


----------



## Bounb (Jan 18, 2009)

Yeah, after testing the touch screen support for a while I find it works much better using the buttons as opposed to touch screen, but only if you use the touch screen with a hand/fingers (ie. a stylus works fine). This is because the low resolution nature of your finger gives false starts etc. The same effect happens if you use two buttons at once to start - sometimes it won't start. 
Obviously a stylus is out of the question - however I think the stackmat style button hold, ready message and release to start the timer should remain. 

Anyway - I'll have a go at multipuzzle/time saving. I'm not sure how it will display the saved times when you have lots of them.


----------



## Zarxrax (Jan 18, 2009)

I have a stackmat-style button hold implemented in my dev build right now which is working well.

As for displaying times, here is what I had in mind, but it's just an idea:
Display important times on the top screen, such as best time, average, 10of12, etc.
Then on the bottom screen, there will be various options, so I was thinking there can be a button which opens up a "time editor" menu, where you can view all of your times, and selectively delete them if one was a mistake.


----------



## panyan (Jan 18, 2009)

this looks like it comgin along well guys, cant wait to see version 0.2!


----------



## Musturd (Jan 18, 2009)

Eventually I think there could be an option to show an algorithm that you are trying to learn. For example: we touch the button that says pll algorithms, then the touch screen menu changes and lists all of the algs by name, and if you touch one, it would show a picture of the pll and list the turns to solve it.

That probably shouldn't be implemented until after saving times and displaying them, though.

I think someone(or me) should start a google code page, so that we can be looking at the same source code at all times (I think it automatically updates when changed, but maybe it doesn't, I'm not sure)


----------



## kickinwing2112 (Jan 18, 2009)

wow this is a great idea.


----------



## Zarxrax (Jan 18, 2009)

Ok I have posted version 0.2 of the program, and a link to the new google code repository, back in the first post.


----------



## Musturd (Jan 19, 2009)

Wow you did a lot of work on it today!

EDIT: Can you PM me authentication for the SVN Repository?


----------



## Musturd (Jan 21, 2009)

I tried to add support to NxNxN sized cubes, but now the timer doesn't work 20ish% of the time, so...
It probably has to do with the fact that I tried to not use a global variable for the size of the cube, and I suck at pointers (though I don't know how that would affect the timer?)
I'll see if I can work out the bugs...


----------



## Bounb (Jan 21, 2009)

I'm not sure how to download the latest revision from Google Code. Time saving is coming along...


----------



## Musturd (Jan 22, 2009)

Can I use a global?
I can't deal with pointers...
How bad are a few global variables?


----------



## Zarxrax (Jan 22, 2009)

Bounb said:


> I'm not sure how to download the latest revision from Google Code. Time saving is coming along...


If you give me a gmail email address i can give you access to it. Then you can use an svn client like turtlesvn to access it.



Musturd said:


> Can I use a global?
> I can't deal with pointers...
> How bad are a few global variables?



I don't have a huge problem with globals myself, except that I have always heard everyone say how evil they are. I dont really know what the problem is, honestly. Just write code however you need to to accomplish something, and if its bad maybe it can be changed around.


----------



## ThePizzaGuy92 (Jan 22, 2009)

suggestion: AVERAGES! haha


----------



## dmchale (Jan 22, 2009)

just wanted to chime in i think this is a great idea. Have to dig my card reader out (off to bed now but will def do this tomorrow) but am looking forward to seeing how this is coming along.


----------



## TurbulentTurtle (Jan 22, 2009)

I played around with this in class the other day and it actually works pretty well. So far, I am very pleased with it and it could actually remain like this without any crazy add-ons and I would be pretty happy with it.
Averages and time saving functions would be a pretty nice plus though, but otherwise this is a very well done timer.


----------



## panyan (Jan 23, 2009)

when is 0.3 due?


----------



## linkmaster03 (Jan 25, 2009)

Wow I always thought how cool something like this would be. It works great! Seems like the timer is not in stackmat fashion though. I can just use one button. Maybe I'm missing something.

What if you had the timer on the bottom screen in a digital-like font and the scramble filling the top screen? I think that would be cool.

Thanks for making this, I hope you keep improving it!


----------



## Zarxrax (Jan 25, 2009)

linkmaster03 said:


> Wow I always thought how cool something like this would be. It works great! Seems like the timer is not in stackmat fashion though. I can just use one button. Maybe I'm missing something.



Yes, one button works, but you can also hold the buttons on each side. You can use either method that you prefer.
How does a real stackmat handle inspection time (or does it at all)?


----------



## Zeroknight (Jan 26, 2009)

dang, I wish I had a ds flash drive...
I support this 100%, and with my limited programming skills, pm me if you need help.


----------



## dmchale (Jan 28, 2009)

I think it would be nice to offer two options... stackmat-style button control, or "any button counts". I can see where people would like stackmat-style (IMO make it so any d-pad direction along with any of XYBA, exclude the LR buttons) but I also like just being able to press any button and be done with it. To me the one-button method is safer for my hardware, I'd probably end up breaking something otherwise  

echoing panyan, is 0.3 in the works? Not trying to be impatient, just looking forward to any updates done here as well.


----------



## shoot1510 (Jan 28, 2009)

I know other timers for other type of phone. 
*Mult-stop watch* for iphone and itouch, you can get at the appstore.(Free and _no jailbreak_ needed)

*Timers* for PSP. (required to hack your psp to use it)


----------



## Zarxrax (Jan 28, 2009)

dmchale said:


> I think it would be nice to offer two options... stackmat-style button control, or "any button counts". I can see where people would like stackmat-style (IMO make it so any d-pad direction along with any of XYBA, exclude the LR buttons) but I also like just being able to press any button and be done with it. To me the one-button method is safer for my hardware, I'd probably end up breaking something otherwise
> 
> echoing panyan, is 0.3 in the works? Not trying to be impatient, just looking forward to any updates done here as well.



Well like I said just two posts above yours, it *does* work like that. You can either press one button, OR you can do the stackmat style.

As for the next version, right now I'm just waiting to see if any code gets contributed by Musturd or Bounb. Aside from that I'm probably going to add an option to end the inspection time early as soon as I get some time.


----------



## Bounb (Jan 28, 2009)

I need to get the timer to return a value so I can store that in a file. Everything I've tried so far has returned junk to the file. Here's the code I have at the moment.

You need libfat.


```
#include <fat.h> 

fatInitDefault();

 if (fatInitDefault == false) 
 {
//Display error
 }

  FILE * sTimes;
  char buffer[] = { "time" };
  sTimes = fopen ( "times.sav" , "wb" );
  fwrite (buffer , 1 , sizeof(buffer) , sTimes );
  fclose (sTimes);
  return 0;
```


----------



## Musturd (Jan 28, 2009)

I have a ton of work for school right now, so I probably won't have time to work on anything substantial for a while...


----------



## panyan (Jan 28, 2009)

Musturd said:


> I have a ton of work for school right now, so I probably won't have time to work on anything substantial for a while...



cant wait to have you back but i also have january modules so i dont blame you


----------



## Zarxrax (Jan 28, 2009)

Bounb said:


> I need to get the timer to return a value so I can store that in a file. Everything I've tried so far has returned junk to the file. Here's the code I have at the moment.



Have you tried saving to sram instead of a file? http://palib.info/Doc/PAlibDoc Eng/group___saves.html

It might be easier. I don't really have much experience with either one though.
Also, have you converted the time to a string? Might be worth a shot instead of binary data.


----------



## linkmaster03 (Jan 29, 2009)

I did try holding down two buttons in stackmat fashion, but after that you can still stop it with one button. Am I missing something?


----------



## pcharles93 (Jan 29, 2009)

DSs don't function as multi-touch screens. If you try to push on two points, it'll register as the midpoint. Try playing with that in pictochat.


----------



## linkmaster03 (Jan 29, 2009)

I know that. This program doesn't even use the touch screen. I'm talking about the hard buttons.


----------



## Zarxrax (Jan 29, 2009)

linkmaster03 said:


> I did try holding down two buttons in stackmat fashion, but after that you can still stop it with one button. Am I missing something?



Ah so you are saying you dont want it to stop unless you press both sides... hmmm, I hadn't considered that.


----------



## *LukeMayn* (Jan 29, 2009)

you DEFINATLY need an average thing.. maybe like www.cubetimer.com or JNetCube


----------



## linkmaster03 (Jan 29, 2009)

Zarxrax said:


> linkmaster03 said:
> 
> 
> > I did try holding down two buttons in stackmat fashion, but after that you can still stop it with one button. Am I missing something?
> ...



Yes, that's how a stackmat works. If implemented you should have an option to choose one button or stackmat mode.


----------



## Zarxrax (Jan 29, 2009)

linkmaster03 said:


> Zarxrax said:
> 
> 
> > linkmaster03 said:
> ...



Hmm, well I'm wondering if it's really worth it. I assume the most important thing here is keeping both hands off the cube when the timer *starts*, as once it's finished I don't think it would make any difference in your time whether you stop the timer with one hand or both hands (am I wrong?). Trying to slap both ends of a ds at the same time to stop it should actually be much harder to accomplish than slapping a stackmat, and would probably harm your times, I would think. (if you tend to miss or something )

As it is, you *can* slap both ends to stop it, it will just stop as soon as the first press is recognized. Is this that unacceptable? If it is I can try to change it this weekend.


----------



## dmchale (Jan 29, 2009)

i actually found two close button presses restarted the timer again - granted those were two INDEPENDENT button presses, eg: 2 hits in quick succession. If you hit a button on the right side and then hit the dpad, it currently doesn't affect anything but it still takes the FIRST hit as the "stop timer" signal. The drawback of the current implementation is if someone TRIED to hit two buttons and succeeded in doing a "tap-tap" instead, the timer just starts counting again. Won't be as big a deal once time saving becomes part of the program, I suppose. But when I first started playing with the system I accidentally "wiped" some of my own times by having my finger roll from one button to another which caused the timer to just start at zero. Oops 

I agree with whomever said it above - for the DS's capabilities I think simply trying to emulate what cubetimer.com does would be fantastic. Can save times, delete individual times from your list, have it generate Ao5/Ao12/best etc summarily. Build everything with the intent to then "branch" support later for other puzzles so that, same as cubetimer, you can have your 3x3x3 times, megaminx times, magic times, whatever. 

i havent played with ds development myself, and only played with HAM *years* ago for the gba. wish i had the time myself to pitch in on this project but I'm unfortunately already spinning too many plates... cheers tho, like I said I think it's great so far and many of us just want to give our ideas towards what could make it even better


----------



## Zarxrax (Jan 29, 2009)

I could probably put in a slight delay after the timer is stopped in order to prevent accidentally restarting it.


----------



## linkmaster03 (Jan 30, 2009)

Zarxrax said:


> linkmaster03 said:
> 
> 
> > Zarxrax said:
> ...



I see what you are saying. Especially since you can't "throw" the cube down because it would hit the top screen.  I think using one button is fine.


----------



## Zarxrax (Jan 31, 2009)

Well I was trying to implement a very basic form of tracking times today, but its too big of a problem for me to easily solve and I didn't really feel like thinking about it too hard 

I think I might try working on the idea someone had about displaying a list of algorithms.


----------



## Musturd (Jan 31, 2009)

My idea 
March vacation I'll start programming again.

May I suggest PLL algs first, from http://badmephisto.dyndns.org/site/pll.php

If you haven't done it by march, I'll do it myself


----------



## Zarxrax (Feb 2, 2009)

I updated the SVN repository today. I didn't really know what I was doing though, so I deleted everything from it and then uploaded all new files. I'm going to have to learn how to use this thing...

anyway, I have added 3 buttons to the interface: Time Editor, Change Puzzle, and Algorithm Viewer. The first two buttons do not do anything, they are just there for future use. I have added a file browser which is brought up when you press the Algorithm Viewer button. I will be implementing the algorithm page through this file browser. I suspect that the file browser code might also be useful for displaying a list of times.

Also, I made a small change to keep people from accidentally restarting the timer right after they stop it.

There is no new release of the program at the moment, as none of these changes offer a significant change for users.


----------



## Musturd (Feb 2, 2009)

OH
If you want a code snippet to parse a txt file, I have one from my old project.
Don't forget to inlude fat.h, stdio.h, and string.h
Also, don't have time to go over it right now (have to right an essay for tomorrow and it's 10:00 PM where I live)
If you don't understand it, I'll try and explain it a little later, basically I needed it for my game because it had editable maps, and the maps would be embedded in a txt file.

```
void loadMap(void)
{	
	FILE *lvlset;
	//brick br[144];
	int p = 0;
	int num = 2;
	int x = 5;
	int y = 5;
	int rowCount = 0;
	char nameline[17];
	char temp = 'n';
	char grid[145];
	lvlset = fopen("Diamonds.txt","r");
	PA_LoadSpritePal(0, 1, (void*)block_lb_Pal);
	//PA_CreateSprite(0, 10, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, 50, 50); // Added this back just to see what a block shoudl look like
	if(lvlset==NULL)
		while(1);
	else
	{
		//PA_OutputText(1,1,1,"file open"); //testing line
		//PA_WaitFor(Pad.Newpress.Start); //testing line
		if(prev == LEVEL)
		{
			lvlset += counter;
			while(temp != '/')
			{
				temp = fgetc(lvlset);
				nameline[p] = temp;
				p++;
				counter++;
			}
			nameline[p-1] = '\0'; //to terminate your string - I had a mistake here, should be p-1 not p or p+1...
			PA_OutputText(1,0,0,"%s",nameline);   //testing line
			
			//PA_WaitFor(Pad.Newpress.Start);  //testing line
			p = 0;
			prev = NAME;
		}
		//here you could start parsing the grid. I noticed that there was an extra / after the first grid line below Simpleton, so you'll want to remove that.
		//Also there are spaces at the end of each line so that can pose a problem if you kept using fgetc to pick up each grid item
		//okay, so the level grid could be char grid[145] or something like that (1 larger than 12x12) or... possibly you could have an
		// integer array instead and if a certain character were met in the file the array would be filled with a particular number. Each number would have to
		//refer to some character and you'd end up needing another key of some kind if you went that way...
		//anyway, there are options from here forward so let me know if you need any more help!
		if(prev == NAME)
		{
			lvlset += counter;
			while(temp != '/')
			{
				temp = fgetc(lvlset);
				grid[p] = temp;
				p++;
				counter++;
			}
			grid[p-1] = '\0';
			
			p = 0;
			
			while(p != 145)
			{
				if(grid[p] == '~')
				{
					PA_CreateSprite(0, num, (void*)block_Sprite, OBJ_SIZE_32X32, 1, 1, x, y);
					num++;
				}
				x += 20;
				rowCount++;
				if(rowCount == 12)
				{
					x = 5;
					y += 12;
				}
				p++;
			}
			
			p = 0;
			prev = LEVEL;
		}
		fclose(lvlset);
	}

}
```


----------



## panyan (Feb 5, 2009)

keep up the good work! i cant wait for the next version


----------



## Zarxrax (Feb 5, 2009)

Bounb, you ever have any luck with saving the times to a file? If not I can maybe take a look and see if I can figure out whats wrong with it.


----------



## Musturd (Feb 10, 2009)

I suggest this program should be liscensed under WTFPL:


> DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
> Version 2, December 2004
> 
> Copyright (C) 2004 Sam Hocevar
> ...



This is an example, obviously your name is not Sam whatever and you don't live in Paris. Unless it is and you do, and in that case, keep it the way it is.


----------



## Zarxrax (Feb 10, 2009)

Lol, not a bad license, but the google code page wont let me use a custom one like that.

I worked on the algorithm viewer a bit more today, its sort of starting to come together.


----------



## Bounb (Feb 10, 2009)

Sorry I have not had a chance to look into time saving further. You just need to pass the time to a buffer or what ever, the rest of the code for writing to file I already posted.


----------



## Zarxrax (Feb 10, 2009)

Ok, I'm probably going to look into rewriting the time so it works a bit better.

Before that, can anyone think of any changes that I should make to the inspection time feature? I don't want to have to redo this more than once


----------



## Zarxrax (Feb 12, 2009)

Somewhat good news! I've got my algorithm viewer sort of working! It's riddled with bugs right now though 
Hopefully I'll pop out a new release this weekend.


----------



## Zarxrax (Feb 13, 2009)

Ok, I have the algorithm viewer fully functional! But before I release it, I would like someone to please help me out with generating the content for it.

The algorithm viewer is really just a simple image viewer. My idea is to have images of each case, like on the wiki: http://www.speedsolving.com/wiki/index.php/OLL

However, instead of having the algorithms written in text, they need to be contained in the image itself. The nds screen size is 256x192, and images must be in the GIF format.
Would anyone like to help with this?
(users will be able to add their own custom images if they don't like the default ones, I just want to have some default content for it)


----------



## Zarxrax (Feb 13, 2009)

I just released version 0.4 (download in the first post).
This version has added an algorithm viewer, and a list of your last 12 times.

The times are currently not saved when you turn the power off. I have only included a handful of algorithms for the algorithm viewer at the moment, just to demonstrate this feature.


----------



## TurbulentTurtle (Feb 14, 2009)

Very cool, I especially like the no inspection countdown thing being just 0 instead of 00:00.01.
So for this algorithm viewer, do I need to put the gifs on my SD card or something? Like do I need to make a separate folder? Cause when I press on Algorithm Viewer it says "no files found in /CuTiDS/".


----------



## Zarxrax (Feb 14, 2009)

Yes, you need to have a folder on your card called "CuTiDS" (one is included in the zip file) and put the gifs inside it.


----------



## cookingfat (Feb 14, 2009)

This is way better than the fist release, well done everyone involved. (better font too)

The algorithm viewer is neat, it would be easy to create and add your own too. 

Would be even better if it displayed the rolling 3/5 average of the last 5 solves


----------



## panyan (Feb 14, 2009)

fantastic! i love it, i need nore algs though!


----------



## Zarxrax (Mar 1, 2009)

linkmaster03 said:


> I see what you are saying. Especially since you can't "throw" the cube down because it would hit the top screen.



I was thinking about this, and I decided that it would be a good idea to flip the top screen upside down. This way you can use the ds just like a stackmat timer, with it between yourself and the cube. Just make sure not to throw your cube down on the ds.

I released version 0.5 today with the option to flip the screen. It turned out to be a much more difficult problem than I had anticipated, but it worked out fairly well. As a side effect, your list of times will disappear whenever the timer is running, but that shouldn't be a problem since you don't need to be looking at the ds when the timer is running anyway.

I was trying really hard to implement averages and other stats in this version, but it turned out to be a very difficult problem, and I was not able to work out how to accomplish it. I think development has gone about as far as I can take it. I'm going to need help from here on out if anything else gets done.


----------



## Deleted member 2864 (Mar 1, 2009)

do you think it will work with the DSi when it comes up???


----------



## Sg.Speedcuber (Mar 1, 2009)

Why not just use a stackmat timer?


----------



## Deleted member 2864 (Mar 1, 2009)

because a ds timer is AWESOME!!! And a ds isn't so awkward to fit in your pocket.


----------



## Zarxrax (Mar 1, 2009)

Cause a stackmat timer costs like 20 bucks, wheras this is free.
Of course, the amount of hours I have put into this must far exceed $20 in value at this point... so, I concur with aznmortalx 

And yes, it should work on a dsi as long as you have a flash cart that is compatible with it.


----------



## Musturd (Mar 1, 2009)

My vacation starts on Wednesday, so hopefully I can work on the code then.



aznmortalx said:


> do you think it will work with the DSi when it comes up???



Yes it will. You will need a new flash cart though. Make sure you research and find a flash cart that works with a DSi, because most don't (some do though).
Seriously though, don't get a DSi -- it's a waste of money.


----------



## TurbulentTurtle (Mar 1, 2009)

I am getting a DSi whether it is a waste of money or not. 
Also, Nintendo (and other companies) are taking action in stamping out flash cards, so it might be kind of hard to find one that would be compatible with the DSi right as it comes out. I am just going to carry both DS and DSi with me.

Oh there might be inappropriate material on that site. So be warned.


----------



## Musturd (Mar 16, 2009)

Actually, there are (is at least one) flash cart(s) that would work. I remember it was a big deal back in December or November or something.
http://lmgtfy.com/?q=flashcart+for+dsi
^^First couple of results


----------



## PharaohsVizier (Mar 19, 2009)

There are plenty of carts that work with the DSi, the best being either the AceKard 2i or the EZ Flash Vi. Stay away from crap like the R4i and DSTTi.

anyway the problem right now is because the Japanese release and the American release are so staggered some people believe that although these carts work on the Japanese DSi, Nintendo may have changed things around so that they won't work on the American DSi. This is merely speculation, I for one don't believe it.


----------



## jms_gears1 (Jul 14, 2009)

Sg.Speedcuber said:


> Why not just use a stackmat timer?


Its not that we dont want to buy a stackmat its more like we (programmers) look for reasons to program things that arnt really needed this just happens to be one of those times.


PharaohsVizier said:


> There are plenty of carts that work with the DSi, the best being either the AceKard 2i or the EZ Flash Vi. Stay away from crap like the R4i and DSTTi.
> 
> anyway the problem right now is because the Japanese release and the American release are so staggered some people believe that although these carts work on the Japanese DSi, Nintendo may have changed things around so that they won't work on the American DSi. This is merely speculation, I for one don't believe it.


why is nintendo wanting to ban carts? its not hurting them is it? or am i missing something


----------



## milkolate (Jul 15, 2009)

i can't download the file. is this available?


----------



## Zarxrax (Jul 21, 2009)

I've updated the download link.


----------

