#15: 'color' command doesn't accept -------------------------------------+-------------------------------------- Reporter: hawke@hawkesnest.net | Owner: oxygene Type: defect | Status: closed Priority: minor | Milestone: Component: FILO | Version: Resolution: fixed | Keywords: Dependencies: | Patchstatus: patch has been committed -------------------------------------+--------------------------------------
Comment(by hawke@hawkesnest.net):
Looks like QEmu doesn't work like a real VGA display then.
This was a bad patch. The background color in traditional VGA has no 'bright' bit, and therefore only 8 colors.
So the problem is definitely in the error message, rather than in how the color strings are interpreted.
It turns out the error message comes in when the fallback from color_number() tries to do a safe_parse_maxint() on the string. It assumes that if it's not a valid color specifier string, then it must be an integer rather than simply an invalid color specifier. Naturally it should try to parse it as an integer as well, but if it's not an integer either it should handle that properly.
On another, related note:
The bits in the color byte *as used in filo* are: 7: foreground bright 6: foreground blue 5: foreground green 4: foreground red 3: foreground blink 2: background blue 1: background green 0: background red
This is in contrast with pretty much every VGA color setting method out there:
7: 1 = blinking on; 0 = blinking off 6: Background red component on/off 5: Background green component on/off 4: Background blue component on/off 3: High-intensity foreground on/off 2: Foreground red component on/off 1: Foreground green component on/off 0: Foreground blue component on/off
I've attached a patch which: * Reverts the previous patch * Makes the FILO color byte match the VGA color byte * Makes the 'BG' part optional (black is assumed if it's not specified) * Makes the color command use ERR_BAD_ARGUMENT instead of the ERR_NUMBER_PARSING from safe_parse_maxint()