TIP: Click on subject to list as thread! ANSI
echo: msged_echo
to: Andrew Clarke
from: Matthew Parker
date: 1997-04-19 11:28:12
subject: Msged windows detection

I was looking at the code in IBMSCRN.C and it looks as though it
never tries to detect windows and set the mtask variable as such.
Therefore neither dos version will release time slices when run under
windows.

 BTW I don't know if he has told you but just in case Paul Edwards was
suspended from fidonet for 6 weeks. There's about 3 weeks left but
he probably won't return.

[..Later..]
 I just fixed it.
   ----- diffy.2 begins -----
*** ../old/winntscr.c	Sun Feb  2 04:10:00 1997
--- winntscr.c	Sun Apr 20 07:54:26 1997
***************
*** 367,372 ****
--- 367,377 ----
      return 0;
  }
  
+ int win_running(void)
+ {
+     return 0;
+ }
+ 
  static int FullBuffer(void)
  {
      if (((ebufin + 1) % EBUFSZ) != ebufout)
*** ../old/ibmscrn.c	Sun Feb  2 04:10:00 1997
--- ibmscrn.c	Sun Apr 20 07:08:44 1997
***************
*** 457,462 ****
--- 457,467 ----
      return dvcheck();
  }
  
+ int win_running(void)
+ {
+     return wincheck();
+ }
+ 
  int TTopen(void)
  {
      int m = 0;
***************
*** 464,469 ****
--- 469,478 ----
      {
          mtask = T_DV;
      }
+     else
+         if(win_running())
+             mtask = T_WINDOWS;
+ 
      VIOopen();
      term.NRow = VIOrows();
      term.NCol = VIOcolumns();
*** ../old/os2scr.c	Sun Feb  2 04:10:00 1997
--- os2scr.c	Sun Apr 20 07:54:52 1997
***************
*** 577,582 ****
--- 577,587 ----
      return 0;
  }
  
+ int win_running(void)
+ {
+     return 0;
+ }
+ 
  static int FullBuffer(void)
  {
      if (((ebufin + 1) % EBUFSZ) != ebufout)
*** ../old/nshow.c	Sun Feb  2 04:10:00 1997
--- nshow.c	Sun Apr 20 07:58:58 1997
***************
*** 28,33 ****
--- 28,34 ----
  
  char *v7lookupsystem(ADDRESS * faddr, char *system);
  int dv_running(void);
+ int win_running(void);
  
  int InitScreen(void)
  {
***************
*** 187,192 ****
--- 188,199 ----
          {
              WndWriteStr(maxx - 7, 5, cm[CM_DTXT], "dv");
          }
+         else
+         {
+             if(win_running())
+                 WndWriteStr(maxx - 7, 5, cm[CM_DTXT], "win");
+         }
+ 
      }
      if (SW->usemouse)
      {
*** ../old/ansi.c	Sun Feb  2 04:10:00 1997
--- ansi.c	Sun Apr 20 07:53:28 1997
***************
*** 531,536 ****
--- 531,541 ----
      return 0;
  }
  
+ int win_running(void)
+ {
+     return 0;
+ }
+ 
  static int FullBuffer(void)
  {
      if (((ebufin + 1) % EBUFSZ) != ebufout)
*** ../old/dosasm.c	Sun Feb  2 04:10:00 1997
--- dosasm.c	Sun Apr 20 08:01:12 1997
***************
*** 82,87 ****
--- 82,101 ----
  #endif
  }
  
+ int wincheck(void)
+ {
+ #ifdef __FLAT__
+     RMINF.EAX=0x1600;
+     int86x(0x2f);
+     return (RMINF.EAX & 0xff) ? 1 : 0;
+ #else
+     union REGS r;
+     r.x.ax=0x1600;
+     int86(0x2f, &r, &r);
+     return r.h.al ? 1 : 0;
+ #endif
+ }
+ 
  int kbdhit(void)
  {
  #ifdef __FLAT__
*** ../old/dosasm.h	Sun Feb  2 04:10:00 1997
--- dosasm.h	Sun Apr 20 06:59:34 1997
***************
*** 13,18 ****
--- 13,19 ----
  void dvpause(void);
  void winpause(void);
  int dvcheck(void);
+ int wincheck(void);
  int kbdhit(void);
  unsigned int obtkey(void);
  unsigned int dosavmem(void);
   ----- diffy.2 ends -----
Matthew
@EOT:

--- Msged 4.10

SD®¯‡¾"
* Origin: Blueee Lilly Snowy (3:712/610.31)
SEEN-BY: 633/267 270
@PATH: 712/610 311 624 50/99 635/728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.