Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category LCD
  • Assigned To No-one
  • Operating System iPod 5G
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
  • Private
Attached to Project: Rockbox
Opened by pijulius - 2006-08-29
Last edited by jdgordon - 2008-04-17

FS#5898 - Custom Display Width for 16Bitmap LCDs

This patch adds support for the lcd-16bit.c to define a custom width for the display, so you can have for e.g. scrolling text in a defined x/y coordinate with a defined width.

The new function is called:
lcd_set_custom_width(int width)

You won’t see any changes if you apply this patch, it is only useful for other patches like  FS#5900  (Custom WPS Line with x/y/width coordinates and font face/color settings).

I hope it will be helpful to those who try to make new wps-es with more freedom for art :)
Bests,
Julius

Closed by  jdgordon
2008-04-17 13:03
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

OOD and viewports would do this anyway

Hmm, ok, people are asking for all the customline/font/etc to be included into my build. Soo, one question: Is this patch compatible with the scroll margins? I tried to patch only scroll margins and this patch and got loads of rejects. Ok, I can work through them, but in principle, are they compatible? Do you have any idea?

Thanks a lot and all the best
Norbert

Yeah, they are compatible because this patch only adds a new tag %e, so if you don’t use this tag everything should work fine as it did before, but if you notice some problems don’t hesitate to write me.

Btw: I will try to add scrolling capabilities to this patch, just I have a lot on my head (again) so it may not happen in the near future, but I really plan to do it.

Cheers,
Julius

KyleV commented on 2006-08-31 04:41

scroll_margins_20060829.patch is not compatible with this patch.
The problem is apps/gui/gwps-common.c

I tried applying both, along with someother patches (I know what i did, i’ve been patching daily for 2 months now), and they cannot be both applied.

They contain different variable names and similar procedures. Trying to patch one after the other of course gave me a reject file. I fixed up /apps/gui/gwps-common.c, replacing some code applied by this patch with that of the scroll margins patch.

In trying to build rockbox for my 5G ipod with Cygwin, after about 30 lines, i came up with three errors.
I just forgot to take them down…sorry :(

Anyway, i hope that scroll margins can be done somehow, either by fixing up one of these two patches, or by adding that feature to this patch, as you wish P.I.Julius

I will check it out KyleV and get back to you as soon as possible.

For me the biggest problem seems to be the file lcd-16bit.c
If you also applied the scroll_margins patch

Most of the times the scroll_margin patch has replaced LCD_WIDTH
already with e.g. rightmargin

So your changes to use lcd_get_custom_width() instead of LCD_WIDTH
will conflict even if the patch would apply IMHO

OOo I see what you mean Max, did you try to simply return the rightmargin value on the lcd_get_custom_width() function? Btw: if I fix the scrolling text in the customline.patch we won’t need any scrolling margins will we? :)

I can try if you tell me that the resulting code will make sense :-)

I do builds for X5 for some people from the audiophile.net forums
and they literally begging to include your patch :-)

And yes if your patch does also scrolling I would be very happy :-)

Yeah, it would make sense because with the lcd_set_custom_width() I set the value custom_width value as it would be an x2 margin, so returning the rightmargin variable on the get_custom_width function would make sense.

Happy to hear that the patches are usable, and I really hope I will be able to implement scrolling for the customline.patch in the next weeks.
Cheers,
Julius

Ok scroll_margins still work :-) How can I test the new features of your patch?
(I am not a wps expert and writer :-))
I only have a X5 and the simulator

Hi Max! Hi Julius!
Would it be possible for one of you to create a patch which applies on top of the scroll_margins patch?

People ask for the inclusion of these patches into my H300 builds, and I wouldn’t mind.

Thanks a lot and all the best

Norbert

I will try to provide it tonight

Hi Max,

Thanks a lot for your help on this!
Regarding your question: “How can I test the new features of your patch?” it depends, what patches did you apply to your source? I’m asking because this patch only adds a function do define a custom width for the screen, but you have to use it to see some result :) for e.g. see customline patch (#5900) or customlistwidth patch (#5899). I hope this will help you to understand what it does and how to use it.

Cheers,
Julius

I have a lot of patches applied :-)

Since I have only a X5 I cannot use customlistwidth right?
I have also applied customline and read the description there
So I only need to use some %e in my wps?

I was hoping to get some ready wps that makes testing easier :-) I cannot use the jClix theme on X5 right?

Here is the patch based on scroll_margins_20060829
Please check if it still doing the right thing :-)

Thanks for the patch Max!, btw: I think you should be able to use the customwidth on X5 too because X5 uses the lcd-16bit.c doesn’t it? So just add %e to you wps as described in the customline.patch and it should work.

Hi Max!
Thanks a lot, I am a bit further on. Now it breaks in the customline patch, as it adds a line:
display→setmargins(data→line_xpos, data→line_ypos);
in gwps-common.c. I tried to fix it but didn’t find any trivial solution (although it might exist).
I used the following patches:
custom_display_width-scroll_margins
custom_list_position
customline
multifont-20060828
multifont-userfonts-20060828

So if you have any idea, let me know, otherwise I just dump it until we can replace the scrollmargins with the custom_* stuff.

Thanks a lot and all the best

Norbert

I changed the line to

display→setmargins(data→line_xpos, data→line_xpos+data→line_width, data→line_ypos);

I hope this is correct

Hi Max!
Thanks. It does no compile. Testing will follow soon.

BTW: Do you use/patch also the custom_font patches? What did you do with the FONT_UI stuff which was undefined …?

Bye

Norbert

Which file do you mean?
Just look in the file font.h line 72 and use the appropriate from the enums

Ooops, of course it does not compile without the multifont stuff. Grmm.

I finally got it to compile with all the patches by replacing FONT_UI several times. But loading the stuff onto my H340 I got in IOO or something at rockbox loading time. Pity.

I have no more time currently, so no more builds trying. It is all probably too many patches mixed together.

Thanks anyway

Norbert

KyleV commented on 2006-09-11 00:31

The custom_display_width-scroll_margins.patch submitted by Max Weninger (maxwen); is it a combination or is it an addition to the two patches?

If it is a combination, it is smaller than either of the patches.

If it is an addition, in what other am I to then apply the three patches for best results and least hastle (meaning the least amount of code to manually add in due to rejections).

It is a change to custom_display_width to apply on an already applied
scroll_margins patch. You need to apply scroll_margins before!

It is smaller because both patches do very similar things

BTW: a wps should NOT use both scroll_margins AND custom_display_width

KyleV commented on 2006-09-11 23:15

So in this order of applying :-
scroll_margins patch
custom_display_width-scroll_margins patch
custom_display_width

I’ll try it out… If i get problems then i have to do it in the reverse order…

You dont need custom_display_width afterwards
to reverse just use patch -R

The patch makes a change to drivers/lcd-16bit.c. One of the changes is on line 752.

bits = font_get_bits(pf, ch,curfont);

to

bits = font_get_bits(pf, ch);

Apparently, if ,curfont is removed, trying to make the source fails. Thought I’d point this out.

which patch do you mean exactly?
But I dont found a change that you described above
in both custom_display_width.patch and custom_display_width-scroll_margins.patch

it looks like a change from the mutlifont patch

KyleV commented on 2006-09-15 21:11

I use the following in this order :-
scroll_margins_20060829.patch
custom_display_width-scroll_margins.patch
multifont-20060828.patch
multifont-userfonts-20060828.patch
customline.patch
custom_list_position.patch

and i get a couple of errors when trying to compile for my 5G.
I’ll try another build tonight and post the errors

KyleV commented on 2006-09-17 03:23

Okay… Using Cygwin and make a build for my 5G using rockbox source of 2006/09/16, and using only the following pacthes in that order :-
scroll_margins_20060829.patch
custom_display_width-scroll_margins.patch
multifont-20060828.patch
multifont-userfonts-20060828.patch
customline.patch
custom_list_position.patch

… I got the following errors :-
gui/gwps-common.c: In function ‘format_display’:
gui/gwps-common.c:1361: warning: implicit declaration of function ‘hex_to_rgb’ CC gui/icon.c
CC gui/list.c
CC gui/logo.c
CC gui/option_select.c
CC gui/quickscreen.c
CC gui/scrollbar.c
CC gui/splash.c
CC gui/statusbar.c
gui/statusbar.c: In function ‘gui_statusbar_draw’:
gui/statusbar.c:152: error: ‘struct screen’ has no member named ‘getxmargin’ make[1]: * [/home/rockbox-src/build/apps/gui/statusbar.o] Error 1
make:
* [all] Error 2

Which pacth(s) is causing this?
NOTE :- parts of multifont-20060828.patch & customline.patch had to be applied manually since reject files were created.

Hi Kyle,

First of al you shouldn’t apply these patches together with the scrolling_margins patch because they dont seem to work.
Second: your problem is related to custom_list_position wich changes the statusbar.c, just replace the display→getxmargin with lcd_getxmargin and it should work.

Cheers,
Julius

KyleV commented on 2006-09-17 11:56

OK, thanks, will do.
I apply all of those cause i want all the features, and actually thats just 1/4 of all the pacthes i usually apply.

I think you can apply both scoll_margins and this patch
but you must not use both in the same WPS

All my scroll_margin WPS works fine and also
the WPS that use this patch together with customline work

Hi all!
I think the whole set of custom/multi stuff slowly needs a rehaul. The settings code has changed significantly.
Max, can you do this, and IF you do, can you upload your current versions to the tracker.
Thanks a lot and all the best
Norbert

Hi norbert!
Sorry I have currently very limited time for RB.
Give me some days.
Max

Patches however

In file included from powermgmt.c:38:
export/lcd.h:309:20: error: #if with no expression
make[1]: *** [/home/crispy/rockbox/ipod/firmware/powermgmt.o] Error 1

Gets this error with current SVN

Heres an attempt to sync to SVN 2007-04-30
Same build date as the multifont rewrite of maxwen.
Sacha (Angryman)

Many failed hunks with current SVN… can anyone possibly sync?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing