Skip to content

Conversation

@j4mm3r
Copy link

@j4mm3r j4mm3r commented Apr 6, 2012

Hi fattire,

Good work on the boot menu so far and I figured landscape mode should be the default on the nook, so I implemented a few things to make it happen.

There are some changes to the console handling stuff and also the bit map drawing routine to enable one to set a custom offset for a square region of the screen which can then be used as a reference to draw everything else within it. In our case we can only afford a max area of 600 x 600, so the rest of the code assumes just that. Hence if you switch to portrait mode (uncomment line 578 in main.c), no changes are required in the rest of the menu code.

I had to rotate all the logos 90 degrees clockwise to get my bmp drawing routine to handle the orientation change automatically.

Let me know what you think and if possible pull these commits into your repo and make it official

/j4mm3r.

j4mm3r added 2 commits April 6, 2012 17:27
All Console output now restricted to a 600 x 600 pixel
square area which can be centered within the screen in
either portrait or landscape mode.

This makes writing the menu code easier and it does not
change even if the orientations are switched.
@j4mm3r
Copy link
Author

j4mm3r commented Apr 6, 2012

Oh and I forgot to add that my IDE ran astyle on all the modified files so there would appear to be a large number of changes for each file. Most of them don't change anything except move a bracket here, add a tab there etc.

You should be able to identify the core areas of change which are mostly in encore_boot() and some routines in lcd.c. Boot menu items are a bit changed because of the limited real estate in landscape.

@fat-tire
Copy link
Collaborator

fat-tire commented Apr 7, 2012

Hey j4mm3r--

First off, thanks so much for the contribution! I'll add it, but I have a few requests, if possible to fix first...

  1. The compile was broken until I changed this in common/lcd.c, line 145.

    from: lcd_drawchar(console_col * VIDEO_FONT_WIDTH,
    to: lcd_putc_xy (console_col * VIDEO_FONT_WIDTH,

  2. I thought the original work (which I thought you had done previously) to rotate the tablet to portrait FROM landscape (its default behavior) was because portrait was the "correct" or natural orientation for the nook (this way the volume keys orient properly to the direction of the menu as well.) Is this not the case any more?

  3. I have a cool idea. Since it's so easy to flip back and forth between landscape/portrait, why don't we pick one to be the 'default' (which I think should likely be portrait but I'm certainly open to discussion-- or we can put it in the forums if more people want to discuss it... (?)) Why don't we just set it as another preference in /rom/u-boot.landscape. We can check using the mechanism in menu.c (which we can move to wherever) to check if the file = "1", and if so, switch the orientation. It would either mean rotating the image in memory or including both oreintations in the file, which shouldn't be a big deal.

  4. One final thought-- can we put the "E 0" and "menu by..." stuff at "true" column zero? it looks a little "squished" now, if that makes sense... I didn't delve into any code yet aside from figuring why it didn't build, but if you like I can do this...

Anyway, again, nice work-- don't worry about the ide stuff; it's probably just making everything easier for me to read anyway :) When we're all done, I'll probably port this over to the Nook Tablet as well-- if you wanna help, let me know.. Basic functionality is already in and working, but now the NC is ahead of the NT :)

@fat-tire
Copy link
Collaborator

fat-tire commented Apr 8, 2012

Thinking about it a little more--

Maybe we should have the placement of the boot info/credits as well as the menu options themselves be calculated off the screen resolution/orientation rather than hard-coded? That way, the same menu coding can be used for devices of any resolution without having to re-position all the elements... let me know what you think.

@j4mm3r
Copy link
Author

j4mm3r commented Apr 9, 2012

Hi fattire,

Thanks for your comments and continued support.

I guess the lcd.c change must've been in a hurry, ill sort that out and get it fixed. I think a forward declaration of lcd_drawchars is all that is required to get it to compile.

About the other points, well... yes the original intention of the portrait mode was because it was more natural for the nook considering the button placements etc. but then with ICS the default seems to be landscape, I mean the boot animation and also the initial lock screen presented when you boot is all landscape.

I guess its a matter of personal preference which orientation is preferred and I also thought of making it configurable by adding a preferences file... but then I was wary of adding more files than there are already. Maybe its time to have a single preferences file instead of several? Then it would also require an update to dalingrin's nook color tweaks tool as well.

UI design is a killer for me and it is really hard to come up with a really pleasing layout (What you did before was amazing by the way). In any case, lets do this:

I'll try to rework and implement a set of core lcd/console handling functions which can probably also let the code from main.c and menu.c query and get information about the present state and dimensions of the drawing areas.

For the stuff like "E 0" and credits etc, what do you say to have a special area of the screen dedicated to these pieces of info and then have an API to print to it? I'm thinking bottom right corner of the screen irrespective of the screen orientation?

Lets see, I'll send you a draft of the layout and you tell me what you think.

/j4mm4r

@fat-tire
Copy link
Collaborator

fat-tire commented Apr 9, 2012

So in no particular order..

  1. Thanks.. your menu was the inspiration, truly. I think my UI changes to it were a decent "phase B" for the "green logo" version, but I think this could be really cool final design once we get it all together. I honestly know nothing about UI design, and I initially did the new menu for the Nook Tablet without actually having a Nook Tablet to test with, so it's not until now that I have a running system I can experiment with. And "tonsofquestions" did another pass and refactored some stuff I hadn't bothered to make more efficient...
  2. I'm all for a unified config-- whatever we do we'll want to make portable to the NT, which is nearly identical. I think the u-boot for NT is far better organized, but the menu.c/.h stuff can be almost copied verbatim, with a few changes being that /rom is called "/bootdata" on the NT, the LCD stuff is in a slightly different place, and menus are interpreted differently. If you need access to that source, or are just curious, check out goo-inside.me under /dev/fattire
  3. Yeah, let's consolidate the E 0, credits stuff... whatever else... and an API is good too. (We can also make the credits a menu option itself if we wanted to, or eliminate entirely...)
  4. Looking forward to a mockup or whatever you want.. Do we want to copy/migrate this conversation to the cyanoboot thread on xda to solicit the input of anyone else who might be curious? (including whether default should be landscape or portrait... I don't care too much but I'm curious what other people think.. my only thought had to do with the volume button orientation...)

@j4mm3r
Copy link
Author

j4mm3r commented Apr 9, 2012

Yes lets put it on the XDA thread for more discussion and ideas. Ill take a crack at the NT u-boot code to see what we have there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants