| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
gcc 4.6 warns on variables set but not used, so remove them.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
| |
This fixes the issue in hdt.c32 that Kent Robotti noticed where
exiting directly from Menu Mode caused the cursor to not be displayed.
This same issue also affects com32/cmenu/simple.c32 and probably
others using showmenus().
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
Add proper sleep() and msleep() functions, which among other things
call syslinux_idle(), and make Lua use them.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Fix a signedness error, which in turn was caused by needlessly
complicated code.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
| |
Make it a prototype
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
| |
Is this really correct?!
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
() is not a prototype, and means (...) not (void) in C.
Replace with (void).
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
| |
() means the same as (...) in C, not the same as (void) as it does in
C++. It is generally misused to mean (void), though. Actually write
what we mean... this is C, after all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
Impact: avoid memory corruption with hdt
Some users reported systems with 89 pci devices. This case requires to
increase theses values
|
| |
|
|
|
|
|
|
|
|
| |
Reset the cursor at the top left corner of the screen when exiting the
menu. This fixes odd behaviors when switching back and forth between CLI
and menu in HDT.
Closes: #14
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
| |
Use ^ and v as hints for scrolling. Use \141 from the Special Characters and
Line Drawing Character Set as the scrollbox.
Note: printf "\016\141\017" doesn't seem to work well on xterm, although
it does work on the vga console.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After exiting the keys_handler, reset_ui() is not enough since it
only resets the status line and title. The current menu needs to be redrawn.
Note: only a submenu will be redrawn, not its parents. This means that not
all the UI will be displayed after exiting the handler if invoked from whithin a
submenu. We have already this problem nowadays when exiting a submenu
of a submenu. The root parent is not redrawn, leading to some ugly states
(the background color overrides part of the root menu).
This will be fixed when we implement a real hierarchy (each submenu having
access to its parents).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
| |
cmenu currently redraws everything after each key press. This doesn't scale
well, especially over serial. Instead, redraw only the previous/current selected
entries. A full redraw is still needed when scrolling though.
Misc.: add CTRL-L combo to force a redraw of the current menu.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
The keys_handler can change the UI (e.g. the help system draws a black
background by default). We need to redraw the background and title on exit.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
| |
The manual states that the help filename format is hlp<NNNNN>.txt where
<NNNNN> is the helpid.
If the helpid contains less than 5 digits, pad with zero, not spaces,
i.e. look for hlp00023.txt, not hlp 23.txt.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Remove legacy scrollupwindow definition and checkkbdbuf declaration.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
With the recent changes in cmenu, the help feature was completely broken.
Fix it.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
Syslinux already uses a get_key library to handle stdin. Let's leverage it.
cmenu now works over serial completely.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
To have a blue background on the console (serial), we need to fill
the screen with a printable character (e.g. space).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
CHABSATTR and CHRELATTR have been replaced by SO/SI.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Lines are now printed via the Line Drawing Character Set.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
| |
A lot of code was duplicated between regular and normal menus
(menu printing and selection handling). This patch unifies this logic
by adding an extra bool in printmenu() and getmenuoption() to distinguish
between the two types of menus.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
| |
Auto wrap made the menu scroll because of the status line (when printing
the last character of the bottom right of the screen, the ansicon scrolled
the whole menu).
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |\ |
|
| | |
| |
| |
| |
| |
| | |
Make cmenu use libansi.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| | |
| |
| |
| |
| |
| |
| | |
We don't change the attribute in the help screen. Refactor the code
to simply use printf.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There is no real need to do putch('x', 0x07), 0x07 being the default
VGA attribute. Use putchar instead.
Note that showhelp will trigger a drawbox first with 0x07 as attribute.
Since we don't update the attribute, it is guaranteed to still be 0x07
when invoking putch.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |/
|
|
|
|
|
|
|
| |
The simple menu system already uses getscreensize. Another step towards
unification.
Impact: exported getnumcols and getnumrows are now deprecated.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
hpa advised not to use ANSI sequence 22, as it may not work everywhere.
Instead, let's reset attributes and set last_attr to unknown. The next
background/foreground tests are then guaranteed to fire. We take a small
hit in terms of performance though.
Misc.: change initialization of last_attr to 0x300 (unknown) to trigger
properly the tests the first time.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
| |
The menu highlights some characters to mark them as key shortcuts.
To switch the bold attribute off, we were printing the reset code,
resetting the background color in the same time.
Use ANSI sequence 22 instead.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
| |
Let's not rely on the geometry returned by the BIOS for the
terminal size - we don't know anything about the one used via serial.
We now default to 80x25, regardless of what the BIOS returns.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Fix a compiler warning and a header documentation.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
| |
The cmenu used to display the help on a separate page. Since we
can't have multi pages on the serial line, get rid of them completely.
This has a fairly big impact as the external cmenu API has changed.
adv_menu.tpl and HDT have been patched accordingly.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Use plain '<' as the "back" symbol.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
| |
Use the alternate character set to draw horizontal lines (menu
separator). Refactor the c*print functions in the same time as they
were severely broken.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
| |
» doesn't exist in the alternate character set. Use plain
> instead.
Misc.: fix SO/SI invocation, putchar takes a char, fputs a string.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
getboxchars is not used anymore in drawbox. Let's get rid of it.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Fix build warnings and remove old cls declaration.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Now that cprint is smarter, cswprint can be simplified.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
| |
Simplify the printmenuitem function, now that putch is smarter.
|
| |
|
|
|
|
| |
Use \007 to make the system beep. Note "\007" works, but not '\007'.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
| |
Some refactoring:
* Make cprint_vga2ansi static, as it is an internal function.
* Simplify the logic in cprint().
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Use the Special Characters and Line Drawing Character Set as
described in http://www.vt100.net/docs/vt102-ug/table5-13.html
to draw boxes around the menus.
Note that to work in xterm, G1 needs to be initialized (to point
to the alternate character set). This is done in the cls function
("\033)0").
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
Not needed anymore: we use a lookup table (ansi_char)
in cprint_vga2ansi now to reverse Background and Foreground bits..
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
| |
hpa suggested a better implementation, that also fixes some color
issues and invalid ANSI codes. Thanks hpa!
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
First step towards a usable menu. Color is now sent over serial.
Testing Done: launched HDT over serial. The background got drawn blue,
as expected.
Note: vga attributes need to be converted to ansi codes.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
char getchar(void) doesn't seem to be used.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
| |
Use the ANSI SU - Scroll Up escape sequence to scrollup the window.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |
|
|
|
|
|
|
|
|
|
| |
Use ansicon and the ANSI CUP - CUrsor Position escape sequence
to implement the gotoxy function.
Note: page switching is not supported (yet).
Testing Done: ran com32/cmenu/test.c32 in qemu.
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
com32/cmenu/libmenu/com32io.h
com32/gplinclude/dmi/dmi.h
com32/gplinclude/dmi/dmi_base_board.h
com32/gplinclude/dmi/dmi_memory.h
com32/gplinclude/dmi/dmi_system.h
com32/gpllib/dmi/dmi.c
com32/gpllib/dmi/dmi_memory.c
com32/include/sys/pci.h
com32/lib/pci/scan.c
com32/modules/Makefile
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
|