Saturday, July 26, 2008

Parser now working

Hello all. Just post a quick update. I have gotten the parser working in the command-line code. It parses text from a file into pages made up of 17 lines with 23 characters each. Pointers to prev pages seem to be working also. Tomorrow I will be taking the code and reworking it for the DS. Hopefully by the end of the day Sunday, I will have an "alpha" build running.

As promised, here is a pic of the working parser.

Thursday, July 24, 2008

Pic of Parser Test

Just wanted to post a pic of my progress before heading home for the night. This is just a pic of a emulator running the parser test program.

Here it is for ya.
Enjoy it, I guess. Will be posting Blog updates with Pics to show progress from now on.

At long last, an Update!!!

Finally getting back to work. Just a quick update for those of you that actually take a look at my progress. Earlier this week I was having a major problem with parsing the incoming text. (For those of you who don't know what a parser does, it breaks up all the text into chuncks. In this case it breaks up the text into 23-letter lines that can be displayed easily on the DS's screens.) At first I thought it was a problem with the parser, then after having some problems display text, I thought it was the display functions.

Turns out it was both. I ended up taking my C functions and re-working them using XCode (Mac IDE from Apple). One of the problems was the way I was having the text put inside of the arrays. Turns out in C, you need a NULL character (basically a character that represents nothing) at the end of each line to mark the end of it. If you don't, when you try to print the line out, it goes into the next lines until it hits the last line or a NULL character. Thankfully I was able to find this problem while working on a plain, text-based program for PC and fix it.

The display problemis another matter. Seems I have my coordinets all mixed up. I need to do some research on the proper way to use the display function I am using (the one that can print text sideways). For now, I am just displaying text normally (IE not book-style) for debugging of the parser. Hopefully this weekend I will be able to fix the text printing problem. If not, I will just have to move on and use normal text displaying. I am on a tight timetable.

Goals for Weekend:
  • Get parser working for multipile pages in PC "test" program and DS "alpha" program
  • Get text displaying properly in book-style mode in DS "alpha"
  • Get page turning working
  • Start work on GUI
The first three tasks are the most important for me to get working. I can spend next week working on the GUI. Getting the code to work is the most important thing. I really need to show my book "storage" structure is more efficient then what other's have used in the past. I don't need a GUI for that.

Will post an update on Saturday and Sunday for those of you who want to know my progress. See you then.

PS Not sure if anyone will care, but I did end up getting a Mac. I ended up getting a MacBook Pro instead of the iMac and it has really helped with the development. Also, its a nice machine to boot. After using it for over a week, I decided against installing Windows XP and Ubuntu (Linux) on it. I am doing all command line/"test" programming in Leopard and actual DS programming in a Windows XP Virtual Machine under VM Fusion. Seems to be working out nicely.

Monday, June 16, 2008

User Interface, data structures, and a new dev environment

I have had a busy weekend that did not allow me to do much coding, but I was able to finally work out the kinks in the user interface for the eBook reader. Below is a pic I have come up with to show the user interface.



At first, I was going to implement a totally touch-based UI, but after thinking it over and playing some games with bad touch detection, I decided against it. The face buttons of the NDS are more then enough to browser through an ebook easily. I have come up with a right- and left-handed UI to make it easier for people to use (my girlfriend is left-handed and will be helping me beta-test the program, so it became a necessity). In right-handed "mode" the up and down buttons will turn the pages backward and forward respectively. In left-handed mode, the B and X buttons will be used in their place. The trigger buttons (R-trigger for right-handed, L-trigger for left-handed) will bring up the options menu on the touch-screen. This menu will allow the user to save their place in the ebook, jump to any page, or load up a new file.

I also put some though into the data structures I will be using to store the eBook once it is read by a file. Reading text from the file every time a page is turned seems like a waste as it there will be a pause between pages while the text is being read in. Also, the file must be open while it is being views, which is a waste of resources. I have decided to use an array of strings or chars to hold the text that will be on each page. X amount of characters will be read into an element of the array that is equal to the number of characters that will fit on the screen. The only drawback to this is that the number of characters that can be on each screen at one time must be predetermined. To do this, I must have a fixed font size. I wanted to allow a variable font size, but at this time, it doesn't seem practical when there is more important work to be done. This can be added into a later release, but right now, I want to focus on getting the text read from the file easily.

As for the coding, I have found myself faced with a slight problem. Linux is starting to become a hassle to deal with between the lack of a proper IDE and the emulator I am using to test the code has been giving me problem. I plan on getting around this by using a virtual machine running Windows XP for most of my coding and testing. I can use Visual Studio C++ Express as a development environment and the Windows version of the emulator I am using seems to work without problems. I would rather stick with Linux, but with the problems I have been running into during development and presentations, I made the decision to not fiddle with it anymore. Here's hoping I can fix these problems in the future as I love having the freedom that comes with running a Linux OS.

The other benefit of using a virtual machine for development is that it is portable. I will be getting a iMac soon (hopefully by the end of the month) and would like to code on that due to the larger keyboard and screen compared to my current dev system (my laptop). However, setting up a NDS dev environment on a Mac is not easy; From what I have read, its even harder to set up then on a Linux OS. With the virtual machine, I can just copy it over to the iMac and run it. I will have all the tools I need right away with no extra time wasted on setup. Also, during presentations I can just copy the VM to the Windows partition on my laptop to show my work, saving me the trouble of setting up the deb environment there also.

I hope to have a complete running beta (minus any visual menus) by the end of next week, and a Release Canidate by the second week of July. I have vacation the first week, which will allow me to focus on the project more. This week, I will be working on the first beta, which will read in a text file, break it into "pages" in an array and allow the user to look through it page by page. The filename will be hard-coded just to make life easier for myself. Here's hoping I will have it ready by early next week so I can post it here for people to test.

Saturday, May 31, 2008

Basics of the project

Finally getting around to posting again. Today, I thought I would post a general outline for the project. What I am hoping to accomplish is to develop a eBook reader that will utilize the RTF file format to allow for font and text format. As of right now there are a few eBook reader already released to the homebrew community (DS Reader, DSlibirs, Read More), but only one (DSlibris) allows for font formatting. This is done by using XHTML as a file format. I have read forum posts about people having issues converting their eBooks into XHTML and wishing for an easier format to work with. I decided that RTF (Rich Text Format) would an easier way to do this. Most word processors can save in RTF, making it easier for people to convert existing files into this format. Also, their are less tags used in RTF then XHTML, which should make it easier to parse.

I also hope to add PDF like functionality to the reader by modifying the RTF file format into a custom file format that allows for chapter "tagging" without needed the extra horsepower to open and read PDF files, which that DS just doesn't have.

Right now, I have the basic idea of the program down. I have also come up with steps that I need to take to keep the project on track and show the progress I have made.

1. Create basic text reader program
2. Allow text to be read while holding DS in "book style" (Holding the DS on its side)
3. Add in ability to read in RTF format
4. Create custom GUI interface for user

If these goals are reached in a timely manner, I will try coming up with a custom file format to implement PDF-like functionality into the reader.

I am currently working on getting text read from a file and displayed on the screen. I have found a function that will display text to the screen and auto-wrap the text once it reaches a pre-defined length. This will greatly help because once I know how many characters will fit on the screen using a specific font and font size, I can just break the file down into chunks that will fit on a screen. As of right now, I am just using a the default font provided by the libraries I am using just to simplify the testing process. I'm hoping by this time next week, I will be able to display the text with the proper spacing and allow the user to "turn pages" for files that contain more text than can be displayed on the screens at once.

I am going to try and record video of this "test" and post it to the blog. If anyone knows of a way for me to record my actions on my monitor under Linux (which means I can't user Hypercam or FRAPS), please give me a heads up. Worse comes to worse, I should be able to get a Hypercam working on my laptop under Windows. I would rather test under the same environment that I develop under, but you do what you have to do.

Wednesday, May 28, 2008

And so it begins.......

I have finally finally gotten my blog account open and can now start posting my progress as I develop and program a eBook Reader for the Nintendo DS (or NDS). I am doing this as a Senior Project and as such, many of the posts will be about coding issues, weekely progress and such. I will also be posting others things for others who take a look at this blog.

Well, that's it for today. I'll be posting a bunch of info tomorrow after I get some sleep.