|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!
April 10, 2006
|Ok, three main new features:
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!
April 5, 2006
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.
- Make sure it says fat…OK at the top of the screen
- Draw something
- Press ‘B’ — there should be a message at the top telling you it wrote … bytes
- Copy ‘img.bin’ to the same directory as ‘proc.exe’
- Drag ‘img.bin’ onto ‘proc.exe’…It should create an img.png
- Email it to me, or post it in the comments, so I can see!
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.
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
April 4, 2006
…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.
Screenshot of my app from emulator
Screenshot of Zaurus version.