Monday, August 4, 2008

Alpha uploaded

Here you go guys. Finally got the alpha uploaded. Its current up on a geocities account (hey, its free) for download. Doubt there will be many of you downloading this, but wanted to share. Hoping new improved alpha will be out by the end of the month. See previous post for Known Bug list. Please leave a comment if you find any other bugs I do not know about.

eBook Reader alpha 0.1

PS I will be trying to set up a SourceForge account sometime this week. However, if that doesn't work out for some reason, if anyone knows of any websites that allow for free file upload and download, please leave a comment about it.

Alpha 0.1 is complete!!

I am happy to announce that the alpha release of my eBook reader is ready!! After fighting with it this (or is it last) night, I was able to get it completed. It is running and has most of the functionality I hope it would have. :) It reads from a hard wired text file, so you must have a text file named "text.txt" in the root directory of your flash card in order for it to work. ATM it displays the paresed text into pages that fit on the screens of the NDS and allows you to turn to the next or previous page in the "book".

Known Bugs:
  • Turn to the previous page at the first page of the book causes the program to get stuck in an unknow, blank page
  • The amount of text read into the program is not the entire text file. This is due to the size of character arrays. This is my own fault as I didn't think about the memory restraints C put on the program. This will be the first fix for the next alpha release
I know it look quick and dirty, but getting this far took a lot of work. I am "releasing" this alpha as a milestone marker. Also, this build is what I am going to present during my "final" in Senior Project. I am going to continue working on this as time permits. I really want to get this working as well as the other eBook readers I have seen on the NDS, complete with GUI, by the end of the year. After that happens, I will work on including RTF support into the reader. I will uplod the file sometime tomorrow as I am converting my virtual machines ATM. I recently got my hands on Parallels and wanted to compair it to VM Fusion, which I use for my NDS development purposes. Parallels is suppoed to be able to convert VMWare images for use with Parallels, but my first attempt ended up with me losing all my work in the "converted" virtual machine. Thankfully the original for VM Fusion was fine. I am trying it agian just to see what happens.

Anyway, I hope to get the alpha up before my presentation tomorrow (or is it today) in the morning. At the latest, it will be up Monday night. Now its time for me to get some well deserved rest. See ya.

Tuesday, July 29, 2008

Solve one problem......

run into another.

ATM I have again run into a problem with the eBook Reader alpha. While I was able to get the file system library working last night, I have now run into a problem reading the text from a file on the flash card. Seems that the loop used to read in the file is not stopping. For some reason it just keeps reading indefinitely for some reason. I can't tell if this is a NDS programming or C problem. I am currently hunting for answers online and at the PALib forums. I will also be talking to one of the programers I work with about it. He has a lot of C programming experience, so he might have an idea of the problem and how to fix it.

So that's it for today. Tomorrow I go into work, so I will not have time to work on the project. Expect an update no earlier then Thursday afternoon unless I find a fix and get it working sometime tomorrow.

Monday, July 28, 2008

Problems solved!!!

That was fast. With the help of some people from the PSLib forums (schlegel11 and ThemePark), I was able to find out what the problem was. Seems that the make file needs to be explicitly told what libraries to include. I don't use MakeFiles all that often, so I would have never thought to check there without their help.

I haven't tested the program out on my NDS yet since its late. Thankfully, with the library problem fixed, I should be able to finish porting the code over in a hour or two tomorrow. If all works out with the program, I will post the "alpha".

ATM the only thing I need to worry about with the port is getting the sideways text to work properly. Hopefully I will get some more help from the people at PALib.

Problems yet again

Having problems yet again. This time they are not totally caused by me. I am currently porting my parsing code from my command-line test program to the actual DS program. The problem I am having is that the library for reading the FAT file system of the flash card is not being found during compiling. So the code is there and working, but I can't test it because the NDS program can't read the text file to be parsed.

Currently I am hounding the PALib help forum for answers to why the library isn't being recognized or found. Hopefully I will get an answer tonight. I wanted to have the code ported over by tonight so I could work on the button inputs tomorrow. As of right now, I am dead in the water till I either figure out a way to fix this myself, or get help from someone in the PALib forums.

:sighs: I am soo close to getting the beta working..... why can't this work right now?!?!?!?!?

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.