home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / MODS1.ZIP / GAF008.MOD < prev    next >
Text File  |  1995-04-19  |  4KB  |  160 lines

  1. ┌────────────────────────────────────────────────────────────────────────────┐
  2. │ Mod Name: GAF008.MOD              Date:  January 19, 1994                  │
  3. │ Difficulty:  █▒▒▒▒▒▒▒▒▒▒          Mod Authors:  Gaf Man                    │
  4. │ WWIV Version:  4.23                             1@4513 WWIVnet             │
  5. │ Files Affected: LILO.C                          1@1    DriftNet            │
  6. │ Description:  Displays CPU Processor Speed.     1@12   EarthNet            │
  7. └────────────────────────────────────────────────────────────────────────────┘
  8.  
  9. Step 1:
  10. ~~~~~~~
  11. Open up LILO.C and block copy the following at the top.
  12.  
  13. #include "vars.h"  /* Already exists */
  14. #include "vars.h"  /* Already exists */
  15.  
  16. #pragma hdrstop    /* Already exists */ 
  17.  
  18.  
  19. #define         _8088           0      /* Start Here */
  20. #define         _NECV20         1
  21. #define         _80188          2
  22. #define         _80286          3
  23. #define         _80386          4
  24. #define         _80486          5
  25.  
  26. char *CPUStrings[] =
  27.                 {
  28.                    "8088/8086",
  29.                    "NEC V20/V30",
  30.                    "80188/80186",
  31.                    "80286",
  32.                    "80386",
  33.                    "80486"
  34.                 };
  35.  
  36. int CPUInfo( void )
  37. {
  38.     int present_386,present_486;
  39.     
  40.     
  41.    asm { 
  42.     
  43.     MOV    BX, SP
  44.     PUSH   SP
  45.     POP    AX
  46.     XCHG   BX, SP
  47.     
  48.     }
  49.     
  50.     if ( _AX == _BX ) {
  51.        
  52.        asm {
  53.         
  54.         MOV    AX, 7000h
  55.         PUSH   AX
  56.         POPF
  57.         PUSHF
  58.         POP    AX
  59.  
  60.         }
  61.  
  62.         if ( ( _AX & 0x7000 )==0x0000 )
  63.             return( _80286 );
  64.         else {
  65.             
  66.             asm {    
  67.                 mov     bx,sp
  68.                 and     sp,not 3
  69.                 db      66h
  70.                 pushf
  71.                 db      66h
  72.                 pop     ax 
  73.                 db      66h
  74.                 mov     cx,ax
  75.                 db      66h
  76.                 xor     ax,0
  77.                 dw      4
  78.                 db      66h
  79.                 push    ax
  80.                 db      66h
  81.                 popf
  82.                 db      66h
  83.                 pushf
  84.                 db      66h
  85.                 pop     ax
  86.                 db      66h
  87.                 xor     ax,cx
  88.                 mov     present_386,1
  89.                 je      check
  90.  
  91.                 mov     present_386,0
  92.                 mov     present_486,1
  93.                 
  94.               }
  95.              
  96.              check:
  97.              if (present_386)
  98.               return( _80386 );
  99.              else
  100.               return( _80486 );
  101.         }
  102.     }
  103.  
  104.   asm {  
  105.   
  106.     MOV    AL, 0FFh
  107.     MOV    CL, 21h
  108.     SHR    AL, CL
  109.  
  110.     }
  111.  
  112.     if ( _AL != 0x00 )
  113.         return( _80188 );
  114.  
  115.     enable();
  116.     
  117.   asm {
  118.     
  119.     PUSH   SI
  120.     MOV    CX, 0FFFFh
  121.    
  122.    }
  123.     
  124.     __emit__(0xF3,0x26,0xAC);                   /* REP LODS BPTR ES:[SI]*/
  125.    
  126.    asm { 
  127.     
  128.     POP    SI
  129.     
  130.     }
  131.  
  132.     if ( _CX == 0x00 )
  133.         return( _NECV20 );
  134.     
  135.     return(  _8088 );
  136. }                                       /* Stop Block Copy */
  137.  
  138.  
  139. Step 2:
  140. ~~~~~~~
  141. Add this line here in void logon(void):
  142.  
  143.     /* this line right here */
  144.     npr("9Current Processor0. 2%s\r\n", CPUStrings[ CPUInfo() ]);0
  145.     /* right before this code */
  146.  
  147.     if (multitasker) {
  148.       outstr(get_string(1169));
  149.       switch (multitasker) {
  150.         case 1 :
  151.           dv=get_dv_version();
  152.           npr("DESQView 1%d.%02d\r\n",dv/256,dv%256);0
  153.         break;
  154.  
  155. Step 3:
  156. ~~~~~~~
  157. Save LILO.C and recompile the BBS and copy BBS.EXE over the old one.  Thats it.
  158. If you use this mod please e-mail me.  I like to know how many people use my
  159. mods.
  160.