FS#2272 - Etch A Sketch

Attached to Project: Rockbox
Opened by zeekoe (zeekoe) - Friday, 16 July 2004, 17:55 GMT
Last edited by Jonathan Gordon (jdgordon) - Monday, 30 July 2007, 10:36 GMT
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


My Truly Lame Etch A Sketch program (TM) (R)
Well, it's a bit lame, but there wasn't anything like it in
the plugins. And submitting can't hurt, would it?
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Monday, 30 July 2007, 10:36 GMT
Reason for closing:  Out of Date
Additional comments about closing:  way out of date, and superceded by rockpaint anyway
Comment by zeekoe (zeekoe) - Friday, 16 July 2004, 17:57 GMT

hm... so submitting a file is not enough and i had to check a
box... whatever :)
Comment by Blue Chip (bluechip) - Saturday, 17 July 2004, 00:37 GMT

You have no screen boundary checking.

Calling drawpixel to plot an off-screen coordinate will
have unpredictable results on rockbox ...if you are
*lucky*, it will just crash, but pretty much anything is

You must either add screen boundary checking, or if you
prefer you can use the Cyborg Systems Graphics Library
which will take care of this for you.

Good luck,

Comment by zeekoe (zeekoe) - Sunday, 01 August 2004, 14:40 GMT

new version with:
- boundary checking
- clear the screen
- save the screen to a bitmap
- startup screen
- move-around-while-not-drawing
- lame bitmap viewer (nobody around at irc by now...)

features suggested and implemented by (alphabetically,
case-(in)sensitive :-)

just shout if i forget something :-)
Comment by zeekoe (zeekoe) - Sunday, 01 August 2004, 14:43 GMT

And here's the lame bitmap viewer, which will become less
lame when someone knows how to reverse this:
rb->memset(buf2, 0, sizeof(buf2));

for(y = 0;y < 64;y++)
shift = y & 7;

for(x = 0;x < 112/8;x++)
for(i = 0;i < 8;i++)
buf2[y*112/8+x] |= ((buf[y/8*112+x*8+i] >>
& 0x01) << (7-i);
and if that someone implements it... :-)
I suggest you try it on simulator only for now, but I think it's
Comment by zeekoe (zeekoe) - Thursday, 19 August 2004, 19:14 GMT

attempt to implement loading of pictures, and an alternative
save format for easy loading (because i'm lame... but you
already knew that)
Comment by zeekoe (zeekoe) - Thursday, 19 August 2004, 20:21 GMT

Works correct now, F3 is save, put it in viewers to load stuff,
and F2 is export to bmp. If you put it in viewers you can view
the saved .etch files.
Comment by Daniel Stenberg (bagder) - Wednesday, 25 August 2004, 11:01 GMT

Is it ready for inclusion?

Is the BMP viewer fine to use as a viewer plugin? What
happens if you through a large BMP image on it?
Comment by zeekoe (zeekoe) - Wednesday, 25 August 2004, 19:34 GMT

etchasketch.c is ready for inclusion, i think. I didn't get the
bitmap viewer to work, still because of this:
buf2[y*112/8+x] |= ((buf[y/8*112+x*8+i] >> shift) & 0x01)
<< (7-i);
If I was able to decipher this beast, and reverse the process,
true bitmap loading can be possible.
etchasketch.c now doubles as a plugin and a viewer. It has its
own native saving format, just raw screendumping. It can
actually export to bmps too, but not load them. I can't get
extra viewers to work though, on my own box, no matter what
I change in viewers.config and no matter what I put in
About loading large files: it only loads the first 112*8 bytes, so
no overflowing of the framebuffer.
Problem might be that this program is both plugin _and_
viewer, so which dir to choose?