This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#9270 - moonrock, calculates the current moonphase.
Attached to Project:
Rockbox
Opened by federico pelupessy (fip) - Tuesday, 12 August 2008, 23:09 GMT+2
Last edited by Bertrik Sikken (bertrik) - Thursday, 28 July 2011, 12:10 GMT+2
Opened by federico pelupessy (fip) - Tuesday, 12 August 2008, 23:09 GMT+2
Last edited by Bertrik Sikken (bertrik) - Thursday, 28 July 2011, 12:10 GMT+2
|
Detailsthis is a simple plugin called 'moonrock' which shows the phase of the
moon. It is not the most earthshatteringly original thing but nevertheless the effect is pretty nice. Hopefully someone else likes this! For targets with CONFIG_RTC, it either shows a text description or, for HAVE_LCD_BITMAP and at least greyscale targets, a (pre-calculated) picture of the moon. But only if the data file (moonrock.dat) is present and found in the apps/ directory. (it should be attached to this post, I hope it shows up here, as the file is 3MB). (time of the player is assumed to be GMT) you can switch between picture and text with select button, and choose a new date with play (which does not change the internal clock). The patche changes some small things in the api and in the bitmap reading routines to be able to do things easily. |
This task depends upon
I have included it here split in two:
on linux systems:
cat moonrock.dat.aa moonrock.dat.ab > moonrock.dat
fixes the data file...
What's the reasoning behind the value 320?
It is worthwhile, though, to consider increasing the size allowed by the buffer in the read_bmp routine.
(also, the buffer is for one image line: the penalty is not the full image size)
Is there another way to read in bmp with sizes bigger than the screen?
btw, I guess one could adapt the read_bmp_fd file to read blocks of limited size (=LCD_WIDTH),
but repeatedly, along the lines of the included patch.
It's possible that all the affected files but moonrock.c are ok.
moonrock.c it seems to be too much far from the actual svn sources, so I'm not able to re-sync it.
Any volunteers? ;-)
ok, I was able to apply the patch for the current release and it seems to work so far and nicely.
But you should mention, thet the patch has to be applied from the /rockbox/-Project directory and has to be run with the -p0 parameter.
I had to copy the moonrock.dat manually to the /.rockbox/rocks/apps-directory on my player to see the moon picture. Is that correct?
I am very interested in further development of this rock. I plan to do some extensions of displaying the calculations.
More soon (tonight?)
that is correct - the picture data is relatively big so had to come seperately
(lately a png decoder has been added to rockbox, so this may be improved)
note also: since syncing to r23223.(but maybe earlier) it may corrupt
music playback (after pausing music after running the plugin), so some
debugging/improvement is definitely needed....
cheers..
so far it runs. I've started to investigate the source and going to add some more informations since I am very interested in astronomical calculations
Here a very quick and dirty screenshot with dummy placeholders, but you should image what it does mean.
The main problem at the time, that the Rockbox-Time handler does not (?) have got an informations about time shift or time zones, but astronomical algoriths usually need at least UTC for reference.
My proposal as a workaround would be to add a .moonrockrc (run command) file where e.g. the UTC shift and font-size could be stored.
What do you think about? Are you interested in?
Regards, Marek
looks nice!
yes, at the moment the plugin assumes that the time zone is GMT - so time zone info would be necessary - ideally this would be something settable within the plugin..
I wonder if it's a big deal to include this in the firmware time struct....
here some more hacking effort:
* implemented UTC shift by means of julian time conversion
* implemented calculation of easter date
* implemented output of week day names and moth names
The source code needs tidy up and optimization, hat to write some own functions or workaraound, since a lot of simple mathematical functions like modf are not (?) implemented to Rockbox compiler, therefore the orgies with the castings.
Runs on Simulator for Sansa e200V1, can not compile for hardware so far :-(
Ho to apply this patch?
First apply plugins-9270moonrock3.0.patch from above. Run it from the /rockbox project directory with -p0 parameter
Then cd /apps/plugins and apply my patch. It works only on moonrock .c, do not forget to backup it with -b parameter.
run make. run make install to your simulator or copy the firmware to your player. do not forget to copy moonrock.dat to apps/plugins directory.
Ok, for the rest of the evening, let's celebrate year's change!
Regards
Should compile on Simulator and Hardware. Added a function to print double numbers in strings, since the platform compiler does not support double output in snprintf.
Still looking forward to implement phasehunt and prediction of next phases.
It now uses the view text and jpg functions from the lib.
apply patch from root with patch -p0 < moonrock_21082010.patch
and copy the data file to apps/plugins/
I have put in Marek's ideas, except the easter dates calculation, can be added later...
the patch still changes 1 little api thing: it adds the set_time_screen, function for an easy dialog to obtain new dates.
My .dat file seems to be broken when I run the plugin: I need to check.
have you checked the version of the dat file (you should use the approx 250kb one)?
(haven't had a chance to try latest rockbox)
But not it data aborts.
The file is not a "normal" jpeg image, is it?
then make. It seems to work - does it exit the plugin or does it give an error ("no image data") and go into main menu?
(the dat file is combination of jpg files and data)
I would be happy if it went into the trunk! :-)