Birthday coding frenzy
Well yesterday was my birthday, 33 years old and I’m already looking for a major project to work on while my unemployment continues.
A couple of days ago I was attempting to assist someone on the devkitPro forums without sounding like a complete know all and making them look like idiots (the post was not submitted as I could not put my response in a polite manor at the time) for attempting to do a directory search for there NDS file on a card, they had linked to a site with instructions on how to do a recursive search of the SD card to find your NDS file. Well I was curious a little and wanted to know what the site was, and what the owner of the site was attempting to do. It’s a site dedicated to a homebrew games developer that is blogging about the game they are working on. From what I gathered on the site the game idea is something that is only in Japan and I could not understand it at all. What did peek my interest in the site was the small projects that they had wrote to test various parts of the game engine that they are working on, well one thing that got me was the Japanese version of a Rick Roll, a small anime video that looped with some music repeating in the background – it was a nice idea, something simple to test their animation format I thought, until I looked a little closer. The animation format was actually 40-odd frames long, and each frame was a full screen raw image that was read into memory and then dmaCopied into video ram. After talking to a few people in the dsdev IRC channel, I remembered about the FLI / FLC video format from the good old days of DOS VGA video modes (320×200 256 mode 13h) and the PC’s then being little more than a 486 DX4 100 or even the Pentium CPU’s that were introduced in 1993. The FLIC video format was created by Autodesk for their Autodesk Animator and Autodesk Animator Pro applications, it’s an easy to understand format and was designed for the 320×200 video resolution of the day (FLI had to be 320×200, using 8 bit / 256 colours and was compressed using fast RLE compression techniques). I then had a look around for a program to make FLI files from series of images, but unable to find anything that was free I decided to look for some example files. After locating a couple of possible test files I prepared myself for the following day’s onslaught of coding.
After my daily job search (I’m still unemployed) and finding a job I could possibly do (WOO HOO) I started work on the decoding of a simple FLI file that I had selected as the test file. After about an hour or two I managed to get the header, colour chunk and the first data frame read correctly. Taking a break for lunch and some visitors to the house I got back to coding the next hurdle the most common, yet hardest to understand chunk the chuck that is the difference between what’s on the screen, and what should be on the screen. I got the code working straight away to decode the frame information, but it just was not correctly updating the screen, a little debugging and I still could not sort it out. It took me another 4 hours to get the code working, actually it was working correctly all along, I was just forgetting that the video format was wrote for 8bit display modes accessed in 8bit increments, not the 16 that the DS insists on, which means that the skip unchanged pixels was being added incorrectly to the offsets, which resulted in strange shimmering of the screen display, coupled onto this that I was pre-scaling the output display to show the entire 320×200 video on the 256×192 display and screaming at the emulator about screwing up and only updating 1 pixel at a time and not the 2 I was telling it to. Once I worked out the issue, the video ran smooth as it should, and in fact at about the correct speed as well, as I ran the original video scaled down to 256×160 on the QuickTime player and had my DS next to it. They ran in sync for a while, but the QuickTime player slowly pulled ahead. I was not bothered about that, as this was only a prototype test of the possibility of displaying FLIC files on the DS, I have a couple of idea for increasing the speed, but so far it’s working.
Console Update
A quick update on the state of play with my console, I’ve managed to get the console to display utf8 encoded characters with minimal of fuss, the only issue is that you need 3 font files for 1 utf8 decryption, and the only characters available are the ones from the DS’s normal input keyboards (use pictochat and you will see what I mean). Using a loading screen from Overlord II as a backdrop I have also managed to update a couple of the functions so that you can have text on top of an image with out the image getting corrupted.
File Links for the above examples
You can download the test files for the above two entries below:
FLI Player test application – no source code this
If you don’t have a nitroFS aware home brew launcher, then you will need this file, put it in a directory called fli in the root of your SD card to run it on hardware that does not like libfilesystem based applications.
UTF8 Test application this will run on any emulator that exposes a user profile (not many that I know of) but will run best on a DS if your DS user profile has non-Latin characters in it they will be displayed correctly (I hope
)
So yeah it’s crappy XD. Anyway what I’m hopefully going to do is a nice GUI for it, something along the lines of the DSi’s new interface. I’ve already got the basic sprites designed, and a quick test with the sprites put at static positions looks ok, so far. I’ve still got some work to do on getting the application to work correctly. Since the bottom screen is used only for the application the top screen can be used for other things, at the moment I’m looking at putting a calendar on there along with some of the features of the old DS firmware (Profile name, time, etc).
This is a simple little engine that I wrote to see if the DS was capable of producing a working voxel terrain landscape. It can, but it takes a little long to produce the landscape using the code I have here. I would like to make this little tech demo better / faster at some point, so that it becomes something useable in a game – Valley flying game where you have to shoot things, or something better.
A nice little extension to the normal console output that is supplied with libnds. The font’s are from the