aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/vidcontrol
diff options
context:
space:
mode:
authorYoshihiro Takahashi <nyan@FreeBSD.org>2005-05-15 08:04:46 +0000
committerYoshihiro Takahashi <nyan@FreeBSD.org>2005-05-15 08:04:46 +0000
commit947d66c070193f1626f1ec92dfb6155cae64117e (patch)
treeaac3982acdcf992f882f823a971b32704d8904e2 /usr.sbin/vidcontrol
parent2d8cb12d2087d2c8c089c487576fb85fbfde020f (diff)
downloadsrc-947d66c070193f1626f1ec92dfb6155cae64117e.tar.gz
src-947d66c070193f1626f1ec92dfb6155cae64117e.zip
A foreground color number on pc98 console is 7 not 15.
Notes
Notes: svn path=/head/; revision=146237
Diffstat (limited to 'usr.sbin/vidcontrol')
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 90817516c73e..577b12749d91 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -653,15 +653,27 @@ show_info(char *arg)
static void
test_frame(void)
{
- int i;
+ int i, cur_mode, fore;
+
+ fore = 15;
+
+ if (ioctl(0, CONS_GET, &cur_mode) < 0)
+ err(1, "must be on a virtual console");
+ switch (cur_mode) {
+ case M_PC98_80x25:
+ case M_PC98_80x30:
+ fore = 7;
+ break;
+ }
fprintf(stdout, "\e[=0G\n\n");
for (i=0; i<8; i++) {
- fprintf(stdout, "\e[=15F\e[=0G %2d \e[=%dF%-16s"
- "\e[=15F\e[=0G %2d \e[=%dF%-16s "
- "\e[=15F %2d \e[=%dGBACKGROUND\e[=0G\n",
- i, i, legal_colors[i], i+8, i+8,
- legal_colors[i+8], i, i);
+ fprintf(stdout, "\e[=%dF\e[=0G %2d \e[=%dF%-16s"
+ "\e[=%dF\e[=0G %2d \e[=%dF%-16s "
+ "\e[=%dF %2d \e[=%dGBACKGROUND\e[=0G\n",
+ fore, i, i, legal_colors[i],
+ fore, i+8, i+8, legal_colors[i+8],
+ fore, i, i);
}
fprintf(stdout, "\e[=%dF\e[=%dG\e[=%dH\e[=%dI\n",
info.mv_norm.fore, info.mv_norm.back,