mirror of
https://git.freebsd.org/ports.git
synced 2025-06-26 23:20:30 -04:00
A year or so ago I emailed these patches to the maintainer and didn't get any feedback. Just rediscovered them so figured I should submit them before they get lost... patch-bioscursor Fixes the BIOS cursor handling so that programs such as the DOS edit.com and qbasic.exe work correctly patch-desqview-timeslice Allows INT15 timeslicing so that programs which support it can avoid 100% CPU utilization patch-quitemode Adds a -Q option which suppresses all video IO. Also helps optimize the input behavior especially when polling for input. patch-fossil-support Adds a -F option which enables support for FOSSIL IO using stdio. PR: ports/114615 Submitted by: Stephen Hurd <shurd@sasktel.net> Approved by: maintainer timeout
114 lines
2.3 KiB
Text
114 lines
2.3 KiB
Text
--- /usr/ports/emulators/doscmd/work/doscmd-20040330/tty.c Mon May 1 18:38:07 2006
|
|
+++ tty.c Mon May 1 18:38:51 2006
|
|
@@ -125,6 +125,7 @@
|
|
#define row (CursRow0)
|
|
#define col (CursCol0)
|
|
|
|
+
|
|
/* Local functions */
|
|
static void _kbd_event(int, int, void *, regcontext_t *);
|
|
static void Failure(void *);
|
|
@@ -1427,7 +1428,9 @@
|
|
tty_move(int r, int c)
|
|
{
|
|
row = r;
|
|
+ BIOS_CursRow0 = r;
|
|
col = c;
|
|
+ BIOS_CursCol0 = c;
|
|
SetVREGCur();
|
|
}
|
|
|
|
@@ -1459,6 +1462,7 @@
|
|
vmem[(height - 1) * width + i] = vattr | ' ';
|
|
}
|
|
}
|
|
+ BIOS_CursRow0 = row; /* Sync back with row */
|
|
SetVREGCur();
|
|
}
|
|
|
|
@@ -1489,21 +1493,27 @@
|
|
case 0x08:
|
|
if (row > (height - 1) || col > width)
|
|
break;
|
|
- if (col > 0)
|
|
+ if (col > 0) {
|
|
--col;
|
|
+ BIOS_CursCol0 = col;
|
|
+ }
|
|
vmem[row * width + col] &= 0xff00;
|
|
break;
|
|
case '\t':
|
|
- if (row > (height - 1))
|
|
+ if (row > (height - 1)) {
|
|
row = 0;
|
|
+ BIOS_CursRow0 = 0;
|
|
+ }
|
|
col = (col + 8) & ~0x07;
|
|
if (col > width) {
|
|
col = 0;
|
|
tty_index(1);
|
|
}
|
|
+ BIOS_CursCol0 = col;
|
|
break;
|
|
case '\r':
|
|
col = 0;
|
|
+ BIOS_CursCol0 = col;
|
|
break;
|
|
case '\n':
|
|
tty_index(1);
|
|
@@ -1511,10 +1521,13 @@
|
|
default:
|
|
if (col >= width) {
|
|
col = 0;
|
|
+ BIOS_CursCol0 = 0;
|
|
tty_index(1);
|
|
}
|
|
- if (row > (height - 1))
|
|
+ if (row > (height - 1)) {
|
|
row = 0;
|
|
+ BIOS_CursRow0 = 0;
|
|
+ }
|
|
if (attr >= 0)
|
|
vmem[row * width + col] = attr & 0xff00;
|
|
else
|
|
@@ -1554,7 +1567,9 @@
|
|
vmem[row * width + col++] |= c;
|
|
}
|
|
row = srow;
|
|
+ BIOS_CursRow0 = srow;
|
|
col = scol;
|
|
+ BIOS_CursCol0 = scol;
|
|
SetVREGCur();
|
|
}
|
|
|
|
@@ -1582,7 +1597,9 @@
|
|
col++;
|
|
}
|
|
row = srow;
|
|
+ BIOS_CursRow0 = srow;
|
|
col = scol;
|
|
+ BIOS_CursCol0 = scol;
|
|
SetVREGCur();
|
|
|
|
return;
|
|
--- /home/admin/doscmd-20040330/video.c Mon May 1 17:41:16 2006
|
|
+++ video.c Mon May 1 18:08:12 2006
|
|
@@ -167,14 +167,18 @@
|
|
cp &= 0xff;
|
|
cp |= value << 8;
|
|
row = cp / DpyCols;
|
|
+ BIOS_CursRow0 = row;
|
|
col = cp % DpyCols;
|
|
+ BIOS_CursCol0 = col;
|
|
break;
|
|
case CRTC_CurLocLo: /* Update cursor position in BIOS */
|
|
cp = row * DpyCols + col;
|
|
cp &= 0xff00;
|
|
cp |= value;
|
|
row = cp / DpyCols;
|
|
+ BIOS_CursRow0 = row;
|
|
col = cp % DpyCols;
|
|
+ BIOS_CursCol0 = col;
|
|
break;
|
|
default:
|
|
debug(D_VIDEO, "VGA: outb 0x%04x, 0x%02x at index 0x%02x\n",
|