Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Plugins
  • Assigned To No-one
  • Operating System
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by zeekoe - 2004-07-16
Last edited by jdgordon - 2007-07-30

FS#2272 - Etch A Sketch

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?

Closed by  jdgordon
2007-07-30 10:36
Reason for closing:  Out of Date
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

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.

Project Manager

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) & 0×01)
« (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?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing