Hi DOSEMU and FreDOS developers,

FreeDOS 'more' command (tried both 4.2 and 4.3 versions) isn't working
correctly under DOSEMU when used in screen resolutions other than 80
columns x 25 rows. From its code (function GetScreenSize() in more.c)
it seems as more compute no. of screen rows from BIOS data area, from
40h:4Ah (Columns on screen) and 40h:4Ch (Video page size) values,
using formula:
ROWS=Video page size / Columns on screen / 2

which in this case give bad results, as Video page sizes are multiples
of 4k (number of columns is OK). Here is what Video page size values
are returned in certain text modes:

80x25   - 40:4C=0x1000=4096, more has 25 rows. 80x25x2=4000=0xFA0
80x43   - 40:4C=0x2000=8192, more has 51 rows. 80x43x2=6880=0x1AE0
80x50   - 40:4C=0x2000=8192, more has 51 rows. 80x50x2=8000=0x1F40
80x60   - 40:4C=0x3000=12288, more has 76 rows. 80x60x2=9600=0x2580
132x25  - 40:4C=0x2000=8192, more has 31 rows. 132x25x2=6600=0x19C8
132x43  - 40:4C=0x3000=12288, more has 46 rows. 132x43x2=11352=0x2C58
132x60  - 40:4C=0x4000=16384, more has 62 rows. 132x60x2=15840=0x3DE0

>From some informations on net (e.g. here:
http://marc.info/?l=freedos-dev&m=106291977718089&w=2
) it seems as video page size isn't reliable/suitable for no. of rows
on screen computing - but I'm not sure, as this may be DOSEMU bug
as well. I want to report a bug, but what? DOSEMU, or 'more' command?

Note that 'mode con' properly report no. of cols/rows, and when I in
'more' use 40h:84h (Rows on screen minus one) value (i.e. patch as

--- more.c.old  2007-09-23 13:04:00.000000000 +0200
+++ more.c      2014-05-04 00:26:47.948102176 +0200
@@ -84,15 +84,15 @@
 void GetScreenSize(void)
 {
     unsigned char  bios_screencols = *(unsigned char  far *)MK_FP(0x40,0x4a);
-    unsigned short bios_screensize = *(unsigned short far *)MK_FP(0x40,0x4c);
-
+    unsigned char  bios_screenrows = *(unsigned char  far *)MK_FP(0x40,0x84);
+
     if (bios_screencols != 0)
        {
        COLS = bios_screencols;
        
-       if (bios_screensize != 0)
+       if (bios_screenrows != 0)
                {
-               LINES= bios_screensize/bios_screencols/2;
+               LINES= bios_screenrows + 1;
             }

         /* printf("BIOS screen size = %u/%u\n",LINES,COLS);    */

then more works OK in all modes.

Thanks, Franta Hanzlik


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dosemu-devel

Reply via email to