Robots w/Lasers

April 12, 2006

libpng for DS

Ok, I’ve packged up libpng and zlib for use on the DS. I also included a small makefile which should build both of them and install them for use. Please let me know if it does not work for you.

Basically, I only had to comment out one line in libpng (but man did it take me a while to find that line), in the png_zalloc() function, and then I changed the makefiles to use arm-elf-gcc instead of gcc (same for ranlib, ar)

Filed under: Draw,Nintendo DS — davr @ 11:16 am

April 10, 2006

libpng defeated!

Hah! Turned out there were two problems with libpng on the nds:1. png_zalloc(), which allocates memory for zlib, was refusing to allocate any memory, thinking it was too much. I just removed that check and it works. Boy this was annoying to track down.
2. I forgot a FAT_fclose() in there, so the file was 0 bytes (since it never got flushed to disk)

Latest update — now no more confusion over .bin or .rle, since it directly spits out png’s!

my drawing test
Filed under: Draw,Nintendo DS — davr @ 10:11 pm

RLE compression, Color Picker

Ok, three main new features:

  • Color Picker! Press L to bring it up, then tap the color you want
  • Multiple Saves! Each image is saved with the current date & time
  • RLE Compression! The saved image size is a lot smaller, to save space on your CF/SD card. (Press Y to save with compression, B to save without) UPDATE: Now saves to PNG directly on the CF/SD card in R7

Previous versions tested to work on GBAMP, M3-CF, M3-SD. Please post your results so I can see, as well as your device type so I know where it works. Thanks!
Latest update

lame drawing
Filed under: Draw,Nintendo DS — davr @ 1:07 pm

April 5, 2006

Save image to file

Added save support to my drawing test…for now it just saves raw data, and I’ve included a tool which will convert it into a .png file.

Extracting images:

  1. Make sure it says fat…OK at the top of the screen
  2. Draw something
  3. Press ‘B’ — there should be a message at the top telling you it wrote … bytes
  4. Copy ‘img.bin’ to the same directory as ‘proc.exe’
  5. Drag ‘img.bin’ onto ‘proc.exe’…It should create an img.png
  6. Email it to me, or post it in the comments, so I can see!

Latest update

Save to image tested working with: GBAMP, M3-SD

Next update will let you save directly to a .png file (no more need for steps 4 & 5)

UPDATE: Known bug: The red & blue bytes are swapped accidently when converting the img.bin to png. I’m having trouble getting PNG compression to work on DS (some kind of memory error from zlib, which is used by libpng internally), so I may release a fixed version without built in png-saving.

Multiple image saving, and loading as well, would be nice. I’m not sure how far I’ll go with this app, it was originally just a test to see how that drawing algorithm would work on the DS. But it seems to have generated interest, and if this guy doesn’t incorporate comparable drawing functionality, then I will probably see what I can do about making it a more complete app.

Filed under: Draw — davr @ 6:41 pm

Drawing update

Quick update…I optimized the code a bit so it shouldn’t lag anymore, speed feels very good now, and added very very basic color selection (you can pick from 7 colors). Download .nds – R2 (see update below)

UPDATE: I’m trying to get the touchscreen code to be better. I’m trying various other people’s code in an attempt to stop the ‘jumping lines’ problem. I’ve made it slightly better, however at the cost of discarding the first few readings after you touch. This is a bit annoying when you like to draw with many small marks. But as long as you don’t press softly, it seems to be overall better results. Download .nds – R3 (see update below)

UPDATE AGAIN: Made some more progress on touchscreen code, it’s better, but still not perfect yet. This has to be solvable, but maybe nobody in the homebrew community has solved it completely yet? There aren’t too many apps besides drawing ones where you need accuracy. Download .nds – R4 see this update

Filed under: Draw,Nintendo DS — davr @ 9:26 am

April 4, 2006

Sketches of Q

…is the name of my favorite sketching app. It was written to run on Sharp’s Linux-based Zaurus PDA. The features that make it stand out, are:

  • The canvas is actually twice the resolution of the screen, and as you draw, it draws onto the larger canvas, which is then scaled down smoothly to give nice smooth, sketchy lines
  • The paint bucket tool: Instead of instantly filling all connected areas, ink would slowly pour out as long as you held the pen on the screen. This let you fill shapes that weren’t completely closed

I’ve duplicated the first feature in a proof-of-concept app for Nintendo’s DS handheld.

Download .nds (see update)

View Sourcecode

Draw screenshot
Screenshot of my app from emulator
Sketches of Q
Screenshot of Zaurus version.
Filed under: Draw,Nintendo DS — davr @ 9:52 pm
« Previous Page

Powered by WordPress

Bad Behavior has blocked 1081 access attempts in the last 7 days.