Jump to content











Photo
- - - - -

Graphicsmode syntax


  • Please log in to reply
45 replies to this topic

#1 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 14 February 2012 - 03:08 AM

What's the correct syntax for graphicsmode in latest builds?

README_GRUB4DOS.txt suggests
graphicsmode 0x6A
This results in a tiny little unreadable line on the top of the screen on a typically troublesome Dell Latitude E6400.

From latest stock menu.lst
## set vbe mode

graphicsmode -1 640 480:800
This works fine on that laptop. Now can use longer lines in menu titles, thanks.

How to interpret this syntax "-1 640 480:800" ?

What is real world experience about properly displayed and supported modes?

#2 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 February 2012 - 04:17 AM

Correct syntax:

1. Using a given mode number for VESA VBE. Examples:

graphicsmode   0x100
graphicsmode   0x101

Note: You should be certain that your machine(or your video card) do support those modes.

2. Let grub4dos choose an optimized mode(or say, best mode):

graphicsmode   -1

Note: You do not have to know about (before hand) what mode numbers are actually supported by your hardware.

3. Optimized mode constrained by user-given criteria:

graphicsmode   -1 [ RANGE_X_RESOLUTION [ RANGE_Y_RESOLUTION [ RANGE_COLOR_DEPTH ] ] ]


Note: A value of -1 (that is, negative 1) for each RANGE means no restriction for the resolution(or color depth). And -1 is the default value for all RANGEs.
Note: One might want to use this one(or similar) for (good) compatibility to various hardwares:

graphicsmode   -1	100:1000	100:1000	24:32

Note: mode 0x6A is no longer supported with newer/later builds. Only 24-bit and 32-bit "Direct Color" modes are supported.

Note also: You can use "graphicsmode 3" to go back to text mode.

#3 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 14 February 2012 - 04:37 AM

Thanks a lot.

Does syntax allow omitting some of the values or not setting a range, as in

-1 640 480:800
or I am interpreting it wrong?

-1 - select best mode
640 - RANGE_X_RESOLUTION
480:800 - RANGE_Y_RESOLUTION
- RANGE_COLOR_DEPTH - omitted

Or in other words- select best mode with X_RESOLUTION 640 and Y_RESOLUTION between 480 and 800, no matter color depth.

Did I get it?

#4 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 14 February 2012 - 07:58 AM

Actually, (-1) means "no restriction" or "to collect all possibilities".

Among all these possibilities, graphicsmode finally can only choose one of them, which is the "best". The one will be chosen that has maximum product of (x_resolution * y_resolution * color_depth).

640 is also a range, thinking the range has only one element of "640".

If you want to specify color_depth but also omit x_resolution and/or y_resolution, you must specify (-1) for x_resolution and/or y_resolution.

>>> Did I get it?

Yes. I think so.

But for certainty, you should always specify the color depth as 24:32. If you do not specify color depth, it could (possibly) get a value of “4”, which is just as the case of mode 0x6A or 0x102. Modes 0x6A and 0x102 are actually not supported any more.

#5 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 14 February 2012 - 08:33 PM

Thanks Tinybit, that's quite informative and helpful.

#6 m041633n

m041633n

    Member

  • Tutorial Writer
  • 76 posts
  •  
    India

Posted 01 May 2012 - 03:14 PM

After including the graphicsmode in the menu.lst i cannot select the menu entry from the menu


title Graphics : 800x600

terminal console

graphicsmode 0x6a

terminal graphics



title Graphics : 640x480

terminal console

graphicsmode 0x12

terminal graphics


how do i include the graphicsmode with a specific resolution in my menu.lst

grub4dos version: 0.4.5c 2012-4-25

#7 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 01 May 2012 - 04:00 PM

Did you read post #4
Modes 0x6A and 0x102 are actually not supported any more.
??

Maybe try
graphicsmode -1 800 600 24:32
and

graphicsmode -1 640 480:600 24:32

#8 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 01 May 2012 - 09:15 PM

@m041633n

I recommend you use this one:

graphicsmode   -1	   100:1000		100:1000		24:32


graphics mode numbers less than 0x100, such as 0x6A and 0x12, are no longer supported.

Only 24-bit and 32-bit "Direct Color" graphics-modes are supported. So mode 0x102 is also unsupported.

With versions of 0.4.5c, you can omit "terminal console" and "terminal graphics" commands. The use of "graphicsmode ..." is enough.

The menu.lst should use UTF-8 character set with graphicsmode.

#9 m041633n

m041633n

    Member

  • Tutorial Writer
  • 76 posts
  •  
    India

Posted 02 May 2012 - 01:53 PM

thanks tinybit :) i'll try

#10 m041633n

m041633n

    Member

  • Tutorial Writer
  • 76 posts
  •  
    India

Posted 03 May 2012 - 06:55 AM


graphicsmode -1 100:1000 100:1000 24:32

timeout 30

default /default

gfxmenu /GFX/message


the code worked
Posted Image

but black screen after entering any of the menu entries

Posted Image



tested in VMware with grub4dos-0.4.5c-2012-04-25 with both ANSI and UTF-8 menu.lst

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 03 May 2012 - 08:03 AM

When in the menu, hit C and then type graphicsmode - what mode does it report?

#12 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 03 May 2012 - 09:17 AM

graphicsmode -1 100:1000 100:1000 24:32

timeout 30

default /default

gfxmenu /GFX/message

This code is problematic.

You'd beter not mix graphicsmode with gfxmenu.


Either use this


timeout 30

default /default

gfxmenu /GFX/message

or this


timeout 30

default /default

graphicsmode -1 100:1000 100:1000 24:32



#13 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 03 May 2012 - 09:19 AM

GFXMenu changes the graphics mode based on what x/y/ res has been set when the message file was compiled. So setting a graphics mode using grub4dos and then setting it again using GFXMenu may cause problems as tinybit says...

#14 m041633n

m041633n

    Member

  • Tutorial Writer
  • 76 posts
  •  
    India

Posted 03 May 2012 - 09:23 AM

hitting Esc key for textmode give me a blank screen with cursor

i tried without GFX-message and it shows

VB-2012-05-03-14-49-56.png

#15 m041633n

m041633n

    Member

  • Tutorial Writer
  • 76 posts
  •  
    India

Posted 03 May 2012 - 09:27 AM

graphicsmode -1 100:1000 100:1000 24:32

timeout 30

default /default

gfxmenu /GFX/message

This code is problematic.

You'd beter not mix graphicsmode with gfxmenu.


Either use this


timeout 30

default /default

gfxmenu /GFX/message

or this


timeout 30

default /default

graphicsmode -1 100:1000 100:1000 24:32


The code is working thanks tinybit

#16 memoarfaa

memoarfaa

    Member

  • Members
  • 82 posts
  •  
    Egypt

Posted 20 September 2014 - 03:14 PM


#17 memoarfaa

memoarfaa

    Member

  • Members
  • 82 posts
  •  
    Egypt

Posted 20 September 2014 - 03:30 PM

When in the menu, hit C and then type graphicsmode - what mode does it report?

 

hi steve this function is very useful to your Easy2Boot

i see that you wright many of big Variables to collecting between gfxmenu,Hotkey ,graphicsmode,splashimage

but finally you wright that in your Sample_MyE2B.cfg

 

#If you really want to use a gfxmenu or @DED-LEGO@ or GFX-RIPPER then specify the 'message' file here
#There are many gfxmenu limitations include (if error goes to text mode, no timeout or default option, number of ISOs cannot be displayed)
#Place your gfxmenu file in the /_ISO folder - see Tut 72a for details. Change the GFX= line to match the name of your file
 
if you use this function you will solve this problem easly 


#18 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 21 September 2014 - 06:12 AM

 

hi tinybit 

 

really This code is problematic

but You can mix graphicsmode with gfxmenu simply but in tow configfile

the instruction in boot-land site for gfxmenu at README_GRUB4DOS.txt at below of page

tell us that you can but another configfile after gfxmenu directory and grub4dos will

automatically load  this configfile  in case of grub4dos error or gfxmenu failure or exiting of gfxmenu

 

http://diddy.boot-la...les/gfxmenu.htm

 

 

i see that m041633n try to use graphicsmode in case of exist of gfxmenu

 

if m041633n want what i mean the code should be 

# The menu.lst file for gfxmenu 
timeout 30
default /default
gfxmenu /GFX/message
configfile /graphicsmode/graphicsmode.lst
title 1 ...........
root
# End of menu.lst 

and graphicsmode.lst should be 

# Begin graphicsmode.lst
graphicsmode -1 100:1000 100:1000 24:32
timeout 30
default /default
#BGAutoChange /boot/grub/BG/EN/
#splashimage /BOOT/GRUB/SNOW.LZMA
#MENUSETTING n 3 0 n n 6 71 17
Hotkey [F9] reboot 
Hotkey [F10] halt

title 1 ...........
root
# End of graphicsmode.lst

if you remove (#) from splashimage line you will never show text mode of grub4dos because of 

 

1-if there aren't gfxmenu message file specific in GFX folder grub4dos will automatically load graphicsmode.lst

2- if there an error at any title in menu.lst  grub4dos will automatically load graphicsmode.lst

3- if you exit gfxmenu by hit ESC key or CTRL+END in case of @DED-LEGO@ grub4dos will automatically load graphicsmode.lst

 

 

 

 

Reportedly someone encountered problems when using gfxmenu with grub4dos-0.4.5 or later versions. If you could avoid using gfxmenu, I suggest you do so, I mean, you should always use the builtin graphicsmode, and avoid using the gfxmenu feature.



#19 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 03 February 2015 - 02:26 PM

How can I get the current graphicsmode in grub4dos  (without clearing the screen)?

 

e.g.

graphicsmode -1 800

 

(now get graphicsmode number ???)

 

 

just graphicsmode on it's own seems to behave oddly - e.g.

 

graphicsmode -1 800

graphicsmode 3

graphicsmode

>>> caused graphicsmode 0x143 to be set and says 'graphicsmode number set to 0x143'



#20 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 04 February 2015 - 02:57 AM

you may make a request for redefining the graphics_mode variable at a fixed known address for users to access easily.

#21 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 24 June 2015 - 10:07 PM

Someone reported that 'graphicsmode 3' should be used instead of 'terminal console' after gfxmenu exits and before entering vbe mode with a 'graphicsmode ...' command.

The 'terminal console' command uses old VGA bios call to enter text mode, and it could fail(or even hang up) because the actual mode for gfxmenu is VBE.

The 'graphicsmode 3' command uses VBE bios call to enter text mode, and it will succeed in most VBE implementations.

#22 memoarfaa

memoarfaa

    Member

  • Members
  • 82 posts
  •  
    Egypt

Posted 04 July 2015 - 10:42 AM

Someone reported that 'graphicsmode 3' should be used instead of 'terminal console' after gfxmenu exits and before entering vbe mode with a 'graphicsmode ...' command.

The 'terminal console' command uses old VGA bios call to enter text mode, and it could fail(or even hang up) because the actual mode for gfxmenu is VBE.

The 'graphicsmode 3' command uses VBE bios call to enter text mode, and it will succeed in most VBE implementations.

 
hi tinybit
 
so you can work with gfxmenu+graphicsmode  with these 
 
 
graphicsmode 3
graphicsmode -1 800 600 24:32
timeout 30
default /default
gfxmenu /BOOT/BOOT.gfx 
 
 
in the fact  i didn't want to use gfxmenu
 
i use gfxmenu only because of its fully supported my language  
 
one option in gfxmenu called  rtl language dirction i can't get it with Graphicsmode syntax
 
Some languages (arabic/persian/malay/hebrew) and others are written from right to left
 
https://en.wikipedia...i/Right-to-left
 
 i search how gfxmenu can support such as language i fond they are use (Bi-directional text)
 
https://en.wikipedia...irectional_text
 
most of gnu project use GNU FriBidi 
 
http://fribidi.org/ 
 
so i try to do the same thing with grub4dos terminal without gfxmenu
 
1- unifont.hex.gz that fully support Bi-directional text
 
2-menu.lst  with (Bi-directional text)
 
i download FriBidi for windows and use 
 
"fribid.exe -c, --charset UTF-8 --nopad --clean mymenu.lst > menu.lst"
now menu.lst support Bi-directional text
 
3-Graphicsmode syntax 
 
 
graphicsmode 0x100
graphicsmode 0x101
the above codes dosn't support Bi-directional from menu.lst  and unifont.hex.gz
 
graphicsmode 0x115
graphicsmode 0x118
the above codes can support Bi-directional from menu.lst  and unifont.hex.gz
 
but as you say at the first of this topic the best Graphicsmode syntax 
that can can support Bi-directional from menu.lst  and unifont.hex.gz is:
 
 
graphicsmode -1 


or


graphicsmode -1 [ RANGE_X_RESOLUTION [ RANGE_Y_RESOLUTION [ RANGE_COLOR_DEPTH ] ] ]
 
only remain one thing to make grub4dos terminal full support rtl language it's:
 
align menu text from right to left option
 
at first i try MENUSETTING.gz but didn't work 
 
then i try echo -p:xxyy but didn't work 
 
i look at grub4dos source code 

* Print entries in the menu box.  */
static void
print_entries (int first, int entryno, char *menu_entries)
{
  int i;
  //int main_menu = (menu_entries == (char *)titles);
 
  gotoxy (MENU_BOX_E, MENU_BOX_Y);
 
grub4dos use gotoxy function to print the titles to the left position of the menu but i'm not sure
 
i hope tinybit can help me how i can align menu text from right to left and add auto numbering form right not left  
 
if there aren't any method now to support this 
 
i hope that can be included in the next version of grub4dos 
 
this is tow image that show how can gfxmenu
align menu text from right to left and grub4dos Graphicsmode syntax can't
 
 
grub.jpg
 
 
gfx.jpg

Edited by memoarfaa, 04 July 2015 - 11:35 AM.


#23 memoarfaa

memoarfaa

    Member

  • Members
  • 82 posts
  •  
    Egypt

Posted 04 July 2015 - 10:44 AM

sorry thes was double post

Edited by memoarfaa, 04 July 2015 - 11:01 AM.


#24 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 July 2015 - 01:26 PM

Maybe stupid idea :unsure:, but what happens if you simply (temporarily until a "proper" solution is found) "pad" the lines with spaces up to the max allowed length?

 

:duff:

Wonko



#25 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 July 2015 - 10:21 AM

I am working on right-to-left support in Easy2Boot.

Could someone provide me with a UTF-8 encoded menu.lst (e.g. save using Notepad as UTF-8) so that I can test it.

It must be a text file.

The characters must be in the correct order, E2B will just right-align them in the menu.

I need Arabic, Hebrew and Urdu (and any more you like).

Edit - I need freshly made files using Notepad made on a system that is set to the correct language and with the correct keyboard, locale settings, etc.). I have made my own sample files by cutting/pasting, but the encoding may not be the same.


Edited by steve6375, 05 July 2015 - 11:16 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users