home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / DESQVIEW.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-02-13  |  4.8 KB  |  145 lines

  1. ; Desqview detection procedures for TP5.5
  2. ;
  3. ; (C) Copyright LiveSystems 1992,1993
  4. ;
  5. ; Written by Gerhard Hoogterp,
  6. ; Release 1 feb 1990
  7. ; version 1.1
  8. ;
  9.  
  10. TITLE DESQVIEW
  11. LOCALS @@
  12.  
  13. DATA SEGMENT WORD PUBLIC
  14.  
  15. ; Externals
  16.  
  17. EXTRN DVUSED      : BYTE   ; Is DV in use?
  18. EXTRN DVMAJOR       : BYTE   ; Major release nr
  19. EXTRN DVMINOR       : BYTE   ; Minor release nr.
  20. EXTRN VBUFSEG       : WORD   ; Videobuffer segment
  21. EXTRN VBUFOFS       : WORD   ; Videobuffer ofset
  22. EXTRN DIRECTVIDEO : BYTE   ; TP's Directvideo boolean.
  23.  
  24. TempSeg    DW   ?                       ; reserve a word
  25. Critical   DB   ?                       ; Reserve a byte
  26.  
  27. DATA ENDS
  28.  
  29. CODE SEGMENT BYTE PUBLIC
  30.  
  31.      ASSUME CS:CODE,DS:DATA
  32.  
  33. ; Procedure CheckDv
  34.  
  35.      PUBLIC CheckDv
  36.  
  37. CheckDv:
  38.  
  39.         PUSH BX                         ; Save BX
  40.         PUSH CX                         ;      Cx
  41.         PUSH DX                         ; and  Dx
  42.         MOV  CX,'DE'                    ; Set the needed values
  43.         MOV  DX,'SQ'                    ;
  44.         MOV  AX,2B01H                   ; Call the DOS SetDAte Routing
  45.         INT  21H                        ;
  46.         CMP  AL,0FFH                    ; If DOS sees it as illegal
  47.         JE   No_Desq                    ; (Ax=$FF) Then jump to No_Desq
  48.         MOV  DVUSED,01H                 ; Set DvUsed to True
  49.         MOV  DVMAJOR,BH                 ; Fill DvMajor with Bh
  50.         MOV  DVMINOR,BL                 ; Fill DvMinor with Bl
  51.         MOV  DIRECTVIDEO,00             ; Turn Directvideo on
  52.         JMP  END_CHECK                  ; Exit
  53.  
  54. No_Desq:                                ; DV is not running
  55.         MOV  DVUSED,00H                 ; Set DvUsed to false
  56.         XOR  AX,AX                      ; and Clear AX
  57. End_Check:
  58.         POP  DX                         ; Restore the used regs.
  59.         POP  CX
  60.         POP  BX
  61.         RET
  62.  
  63. ; Procedure Get_Video_Buffer;
  64.  
  65. PUBLIC Get_Video_Buffer
  66.  
  67. Get_Video_Buffer:
  68.         PUSH BP                         ; Store BP
  69.         MOV  BP,SP                      ; Put the Sp into Bp
  70.         PUSH DI                         ; store the used vars
  71.         PUSH ES                         ; Ds:Di
  72.         MOV  ES,VBUFSEG                 ; Put the already found values
  73.         MOV  TEMPSEG,ES
  74.         MOV  DI,VBUFOFS                 ; into Es:Di
  75.         MOV  AH,0FEH                    ; Call the Get Video bios routine
  76.         INT  10H                        ; through Int $10
  77.         MOV  VBUFSEG,ES                 ; put the found values into the vars
  78.         MOV  VBUFOFS,DI                 ;
  79.         MOV  AX,ES
  80.         CMP  TEMPSEG,AX                 ; Check if the segment has changed
  81.         POP  ES                         ; restore the used regs
  82.         POP  DI                         ; Es:Di
  83.         POP  BP                         ; restore the Bp
  84.         RET
  85.  
  86. api_Call:
  87.         PUSH AX                         ; Store AX
  88.         MOV AX,101AH                    ; Switch to the DV stack
  89.         INT 15H                         ;
  90.         MOV AX,BX                       ; Do the DV_Api_Call
  91.         INT 15H                         ;
  92.         MOV AX,1025H                    ; Switch back to appl.stack
  93.         INT 15H                         ;
  94.         POP AX                          ;
  95.         RET                             ;
  96.  
  97. ; Procedure Dv_Pause
  98.  
  99. PUBLIC DV_PAUSE
  100.  
  101. DV_PAUSE:
  102.         CMP  DVUSED,00H                 ; Check if DV is running
  103.         JZ   DV_P_EXIT                  ; If not, exit
  104.         PUSH BX                         ; save BX
  105.         MOV  BX,1000H                   ; Fill Bx with the API func. number
  106.         CALL API_CALL                   ; make the API call
  107.         POP  BX                         ; restore BX
  108. DV_P_EXIT:                              ;
  109.         RETF
  110.  
  111. ; PROCEDURE DV_START_CRITICAL
  112.  
  113. PUBLIC DV_START_CRITICAL
  114.  
  115. DV_START_CRITICAL:
  116.         CMP  DVUSED,00H                 ; Check if DV is running
  117.         JZ   DV_SQ_EXIT                 ; If not, exit
  118.         PUSH BX                         ; save BX
  119.         MOV  CRITICAL,01H
  120.         MOV  BX,101BH                   ; Fill Bx with the API func. number
  121.         CALL API_CALL                   ; make the API call
  122.         POP  BX                         ; restore BX
  123. DV_SQ_EXIT:                             ;
  124.         RETF
  125.  
  126. ; PROCEDURE DV_STOP_CRITICAL
  127.  
  128. PUBLIC DV_STOP_CRITICAL
  129.  
  130. DV_STOP_CRITICAL:
  131.         CMP  DVUSED,00H                 ; Check if DV is running
  132.         JZ   DV_SPQ_EXIT                ; If not, exit
  133.         CMP  CRITICAL,00H
  134.         JZ   DV_SPQ_EXIT
  135.         PUSH BX                         ; save BX
  136.         MOV  BX,101CH                   ; Fill Bx with the API func. number
  137.         CALL API_CALL                   ; make the API call
  138.         POP  BX                         ; restore BX
  139. DV_SPQ_EXIT:                            ;
  140.         RETF
  141.  
  142. CODE    ENDS
  143.  
  144.         END
  145.