This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#2272 - Etch A Sketch
Attached to Project:
Rockbox
Opened by zeekoe (zeekoe) - Friday, 16 July 2004, 19:55 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Monday, 30 July 2007, 12:36 GMT+2
Opened by zeekoe (zeekoe) - Friday, 16 July 2004, 19:55 GMT+2
Last edited by Jonathan Gordon (jdgordon) - Monday, 30 July 2007, 12:36 GMT+2
|
DetailsMy 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, 12:36 GMT+2
Reason for closing: Out of Date
Additional comments about closing: way out of date, and superceded by rockpaint anyway
Monday, 30 July 2007, 12:36 GMT+2
Reason for closing: Out of Date
Additional comments about closing: way out of date, and superceded by rockpaint anyway
hm... so submitting a file is not enough and i had to check a
box... whatever :)
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
feasible.
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,
BC
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 :-)
BlueChip
LinusN
midk
zeekoe
just shout if i forget something :-)
And here's the lame bitmap viewer, which will become less
lame when someone knows how to reverse this:
[code]
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] >>
shift)
& 0x01) << (7-i);
}
}
}
[/code]
and if that someone implements it... :-)
I suggest you try it on simulator only for now, but I think it's
rockbox-safe.
attempt to implement loading of pictures, and an alternative
save format for easy loading (because i'm lame... but you
already knew that)
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.
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?
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
viewers/
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?