Rockbox

Tasklist

FS#5898 - Custom Display Width for 16Bitmap LCDs

Attached to Project: Rockbox
Opened by P.I.Julius (pijulius) - Tuesday, 29 August 2006, 15:18 GMT
Last edited by Jonathan Gordon (jdgordon) - Thursday, 17 April 2008, 13:03 GMT
Task Type Patches
Category LCD
Status Closed
Assigned To No-one
Operating System iPod 5G
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

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
This task depends upon

Closed by  Jonathan Gordon (jdgordon)
Thursday, 17 April 2008, 13:03 GMT
Reason for closing:  Out of Date
Additional comments about closing:  OOD and viewports would do this anyway
Comment by Norbert Preining (norbusan) - Wednesday, 30 August 2006, 14:33 GMT
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
Comment by P.I.Julius (pijulius) - Wednesday, 30 August 2006, 14:54 GMT
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
Comment by Kyle P. Vincent (KyleV) - Thursday, 31 August 2006, 04:41 GMT
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
Comment by P.I.Julius (pijulius) - Friday, 01 September 2006, 07:30 GMT
I will check it out KyleV and get back to you as soon as possible.
Comment by Max Weninger (maxwen) - Monday, 04 September 2006, 20:09 GMT
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
Comment by P.I.Julius (pijulius) - Monday, 04 September 2006, 20:16 GMT
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? :)
Comment by Max Weninger (maxwen) - Monday, 04 September 2006, 20:24 GMT
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 :-)
Comment by P.I.Julius (pijulius) - Monday, 04 September 2006, 20:30 GMT
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
Comment by Max Weninger (maxwen) - Monday, 04 September 2006, 20:44 GMT
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
Comment by Norbert Preining (norbusan) - Tuesday, 05 September 2006, 09:45 GMT
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
Comment by Max Weninger (maxwen) - Tuesday, 05 September 2006, 10:22 GMT
I will try to provide it tonight
Comment by P.I.Julius (pijulius) - Tuesday, 05 September 2006, 10:35 GMT
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
Comment by Max Weninger (maxwen) - Tuesday, 05 September 2006, 11:51 GMT
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?

Comment by Max Weninger (maxwen) - Tuesday, 05 September 2006, 19:03 GMT
Here is the patch based on scroll_margins_20060829
Please check if it still doing the right thing :-)
Comment by P.I.Julius (pijulius) - Tuesday, 05 September 2006, 19:22 GMT
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.
Comment by Norbert Preining (norbusan) - Tuesday, 05 September 2006, 20:07 GMT
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
Comment by Max Weninger (maxwen) - Tuesday, 05 September 2006, 20:21 GMT
I changed the line to

display->setmargins(data->line_xpos, data->line_xpos+data->line_width, data->line_ypos);

I hope this is correct
Comment by Norbert Preining (norbusan) - Tuesday, 05 September 2006, 20:33 GMT
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
Comment by Max Weninger (maxwen) - Tuesday, 05 September 2006, 20:47 GMT
Which file do you mean?
Just look in the file font.h line 72 and use the appropriate from the enums
Comment by Norbert Preining (norbusan) - Tuesday, 05 September 2006, 21:23 GMT
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
Comment by Kyle P. Vincent (KyleV) - Monday, 11 September 2006, 00:31 GMT
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).
Comment by Max Weninger (maxwen) - Monday, 11 September 2006, 10:25 GMT
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
Comment by Kyle P. Vincent (KyleV) - Monday, 11 September 2006, 23:15 GMT
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...
Comment by Max Weninger (maxwen) - Tuesday, 12 September 2006, 09:31 GMT
You dont need custom_display_width afterwards
to reverse just use patch -R
Comment by Chris Olin (Landus) - Friday, 15 September 2006, 02:25 GMT
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.
Comment by Max Weninger (maxwen) - Friday, 15 September 2006, 10:45 GMT
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
Comment by Kyle P. Vincent (KyleV) - Friday, 15 September 2006, 21:11 GMT
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
Comment by Kyle P. Vincent (KyleV) - Sunday, 17 September 2006, 03:23 GMT
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.
Comment by P.I.Julius (pijulius) - Sunday, 17 September 2006, 07:33 GMT
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
Comment by Kyle P. Vincent (KyleV) - Sunday, 17 September 2006, 11:56 GMT
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.
Comment by Max Weninger (maxwen) - Sunday, 17 September 2006, 18:48 GMT
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
Comment by Norbert Preining (norbusan) - Saturday, 27 January 2007, 23:20 GMT
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
Comment by Max Weninger (maxwen) - Sunday, 28 January 2007, 12:26 GMT
Hi norbert!
Sorry I have currently very limited time for RB.
Give me some days.
Max
Comment by Chris (decayed.cell) - Saturday, 24 February 2007, 03:25 GMT
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
Comment by Sacha (Angyman) - Thursday, 10 May 2007, 11:15 GMT
Heres an attempt to sync to SVN 2007-04-30
Same build date as the multifont rewrite of maxwen.
Sacha (Angryman)


Comment by David Maliniak (major_works) - Thursday, 25 October 2007, 22:54 GMT
Many failed hunks with current SVN... can anyone possibly sync?

Loading...