home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 1
- ---------------------------------------------------------------------
-
- RUNNING YOUR PROGRAM IN A SMALL WINDOW
-
- Programs that call DOS or the ROM BIOS to display information on the
- screen run in a small window with no modifications. These programs
- are referred to as "well-behaved". "Misbehaved" programs are programs
- that write directly into the hardware video buffer and/or move the
- cursor by directly manipulating the hardware. These programs can only
- be run in a full-screen window and cannot be run in background.
- "Misbehaved" programs can be made to behave using the following
- techniques:
-
- Programs the write directly to the video buffer typically determine
- during initialization whether they should run on a monochrome or color
- monitor. They select a video buffer address of B000:0000H for
- monochrome or B800:0000H for color displays. DESQview provides a new
- BIOS call that supplies the caller with an alternate video buffer
- address. The program can write into this buffer exactly as if it were
- the hardware video buffer. DESQview will automatically take care of
- displaying only the information that falls within the current window
- area.
- The following code sequence checks for DESQview's presence and then
- requests the alternate buffer address:
-
- MOV AX,2B01H ; set date & check DV version
- MOV CX,'DE' ; set CX DX to DESQ
- MOV DX,'SQ' ; for the date (invalid)
- INT 21H ; call DOS
- CMP AL,FFH ; check for invalid
- JZ NO_DESQVIEW ; DESQview is not running
- MOV MAJOR_VERSION,BH ; DV Version number
- MOV MINOR_VERSION,BL ; (no real need to store these)
- ; Since DESQview is running, get the alternate buffer
- MOV AX,0B800H ; load hardware buffer address
- MOV ES,AX ; into ES:DI (0B000H for monochrome)
- MOV DI,0
- MOV AH,0FEH ; load function code into AH
- INT 10H ; ask for alternate buffer address
- ; ES:DI now has alternate buffer address
-
- The first section of this code checks to be sure that DESQview is run-
- ning. If it is not, then there is no need to check for an alternate
- buffer address. If DESQview is running, then ES:DI contains the al-
- ternate buffer address after the INT 10 call. There is no need to
- synchronize with video retrace when writing into this buffer;
- DESQview will automatically synchronize when the information is writ-
- ten to the "real" screen. Users familiar with IBM's TopView program
- will note that TopView supports an equivalent call to find an alter-
- nate screen buffer. TopView requires, however, that another call be
- made every time you write into the buffer to tell TopView that some-
- thing changed (the 0FFH function code). DESQview supports these calls
-
- but DOES NOT require them. Note that if TopView or DESQview is not
- running, ES:DI are returned unchanged.
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 2
- ---------------------------------------------------------------------
-
- MANAGING THE CURSOR
- Programs that manipulate the hardware to move the cursor must be
- modified so that all cursor movement is done through the ROM BIOS.
- The following code sequence moves the cursor to row 5, column 30:
-
- MOV DH,5 ; specify row 5
- MOV DL,30 ; specify column 30
- MOV BH,0 ; specify display page 0
- MOV AH,2 ; load function code
- INT 10H ; move the cursor
-
- Coordinates are zero based starting in the upper left corner of the
- screen. The display page is almost always 0 unless your program makes
- special use of the extra text pages on a color graphics adapter.
- DESQview will insure that the current cursor position will always be
- visible in the window. Please note that this function is very easy to
- use and is actually quite fast.
-
- That's all it takes to make a program run in a small window. The
- various loader programs that Quarterdeck supplies with DESQview per-
- form these modifications automatically for several popular software
- packages. Let us know if you have any problems converting your
- program.
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 3
- ---------------------------------------------------------------------
-
- LINKABLE INTERFACE
-
- The following routines can be assembled with the IBM or Microsoft
- Assembler and then linked into your program. We believe they will
- work as-is when linked to Assembler and MS Pascal programs. They may
- also work with "C". We know that they are not linkable as-is to Turbo
- Pascal or Compiled BASIC although you may be able to adapt them by
- studying the code. Perhaps we can provide examples for other lan-
- guages in the future. This source is also available as an ASM and OBJ
- file on the Quarterdeck Bulletin Board System. Contact Quarterdeck
- for information on the Bulletin Board.
-
- Functions provided:
-
- DV_GET_VERSION - Allows a program to determine if it is run-
- ning in DESQview and returns the DESQview
- version number.
-
- DV_PAUSE - Allows application to give up the rest of
- its time slice when engaged in processor
- intensive, but non-critical activity
- (Example: testing for keyboard input on
- menus). Users of this call are eligible
- for the Multi-tasker's Good Citizen Award.
-
- DV_BEGIN_CRITICAL - When used with the DV_END_CRITICAL call,
- defines a section of code that DESQview
- will not slice out of. Use for timing
- critical operations.
-
- DV_END_CRITICAL - See DV_BEGIN_CRITICAL.
-
- DV_GET_VIDEO_BUFFER - If your program writes directly to screen
- buffer, use this routine in the module
- where you determine screen address. Put
- the address on the stack and call the
- routine. Routine determines if DESQview is
- running and if so, returns in AX the
- address to use in DESQview.
-
- (code begins next page)
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 4
- ---------------------------------------------------------------------
-
- NAME DVINT
- TITLE DESQview Interfaces
- PAGE 66,132
-
- DVINT_SEG SEGMENT 'CODE'
- ASSUME CS:DVINT_SEG
-
- PUBLIC DV_GET_VERSION
- PUBLIC DV_PAUSE
- PUBLIC DV_BEGIN_CRITICAL
- PUBLIC DV_END_CRITICAL
- PUBLIC DV_GET_VIDEO_BUFFER
-
- IN_DV DB 1
-
- GET_VERSION PROC
- PUSH BX
- PUSH CX
- PUSH DX
- MOV AX,2B01H ; DV get version
- ; request
- MOV CX,'DE'
- MOV DX,'SQ'
- INT 21H
- CMP AL,0FFH ; Are we in DV?
- JE NO_DV ; Jump if not
- MOV AX,BX ; We are; put
- ; the version
- ; number in AX
- MOV CS:IN_DV,1 ; Set the local
- IN_DV flag
- JMP SHORT DVGV_EXIT
- NO_DV: SUB AX,AX ; Clear AX
- MOV CS:IN_DV,AL ; And the local
- ; flag
- DVGV_EXIT:
- POP DX
- POP CX
- POP BX
- RET
- GET_VERSION ENDP
-
- ; DV_GET_VERSION returns the DV version number in AX, or 0 if not
- ;in DV. This should be called before any other DV functions.
-
- DV_GET_VERSION PROC FAR
- CALL GET_VERSION
- RET
- DV_GET_VERSION ENDP
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 5
- ---------------------------------------------------------------------
-
- ; API_CALL is a local routine that goes on stack, does whatever
- ;call is passed it in BX, and then goes off stack
- API_CALL PROC
- PUSH AX
- MOV AX,101AH
- INT 15H ; OSTACK
- MOV AX,BX
- INT 15H ; Parameter
- MOV AX,1025H
- INT 15H ; USTACK
- POP AX
- RET
- API_CALL ENDP
-
- ; DV_PAUSE gives up the rest of its time slice when called.
- DV_PAUSE PROC FAR
- CMP CS:IN_DV,1 ; Are we in DV?
- JNE DVP_END ; Jump if not
- PUSH BX
- MOV BX,1000H ; PAUSE function
- ; call
- CALL API_CALL
- POP BX
- DVP_END:
- RET
- DV_PAUSE ENDP
-
- ; Begins a critical region. This is a section of code which DV
- ;will not slice out of. It MUST be ended with a DV_END_CRITICAL
- ;call.
- DV_BEGIN_CRITICAL PROC FAR
- CMP CS:IN_DV,1 ; Are we in DV?
- JNE DVBC_END ; Jump if not
- PUSH BX
- MOV BX,101BH ; BEGINC
- CALL API_CALL
- POP BX
- DVBC_END:
- RET
- DV_BEGIN_CRITICAL ENDP
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 6
- ---------------------------------------------------------------------
-
- ; Ends a critical region.
- DV_END_CRITICAL PROC FAR
- CMP CS:IN_DV,1 ; Are we in DV?
- JNE DVEC_END ; Jump if not
- PUSH BX
- MOV BX,101CH ; ENDC
- CALL API_CALL
- POP BX
- DVEC_END:
- RET
- DV_END_CRITICAL ENDP
-
- ; Passed on the stack the video buffer address to use outside of
- ; DV. Returns the video buffer address to use instead.
- ; If what it returns is different, then video synching is not
- ; necessary. Also, this call does a DV_GET_VERSION call itself,
- ; so if you get the video buffer, it is not required that you get
- ; the version.
- DV_GET_VIDEO_BUFFER PROC FAR
- PUSH BP
- MOV BP,SP
- PUSH BX
- PUSH DI
- PUSH ES
- MOV ES,[BP+6] ; Put the starting
- ; segment in ES
- CALL GET_VERSION
- TEST AX,AX ; Are we in
- ; DESQview?
- JZ DVGVB_END ; Jump if not
- SUB DI,DI ; Clear DI
- MOV AH,0FEH ; Get video buffer
- ; function call
- INT 10H
- DVGVB_END:
- MOV AX,ES
- POP ES
- POP DI
- POP BX
- POP BP
- RET 2
- DV_GET_VIDEO_BUFFER ENDP
-
- DVINT_SEG ENDS
-
- END
- ;(end of file)
-
-
-
-
-
-
- DESQview Technical Notes
- Revised: April 18, 1986 Page 7
- ---------------------------------------------------------------------
-
- Use of DESQview .DVP files
-
- Once a program has been installed in DESQview. DESQview creates
- a file which is loaded in the \DV directory that has the filename
-
- ??-PIF.DVP
-
- where "??" represents the two keys used to open the window.
- After installing your program, you will find a file in the \DV
- directory that corresponds to the keys you chose to open your
- program window. This file contains all of the configuration
- parameters necessary to run your program properly in DESQview.
-
- It is important for you to know that Quarterdeck holds no
- copyright to these .DVP files and that you are free to distribute
- them with your software. In fact, we encourage you to do so.
-
- If one of these files is present in the drive and subdirectory in
- which your program is installed and a user is adding the program
- to DESQview, DESQview will automatically find the .DVP file and
- allow the user to install the program by selecting it from the
- Add Program menu.
-
- If you are planning to include both a DESQview .DVP file and a
- TopView PIF, you may want to add a (DV) to the program name field
- in the DVP so that the DESQview user will know which file to
- select. The DESQview "Add a Program" utility will find both the
- DVP and the PIF and display the program name from each, so it is
- important that the program name distinguish which is which.
-
- When programs are added in this fashion, it ensures that the user
- will get them installed right the first time. This makes users
- happy and eliminates a lot of support calls, which I'm sure will
- make both of our companies happy.
-
- The file is only 416 bytes in size. All that is necessary on
- your part is to include it on your distribution disk. Then when
- your install program transfers your program to the user's floppy
- or hard drive be sure that the .DVP file is also transferred.
-
- If you have any questions or need help in setting up your program
- in DESQview, don't hesitate to call us at Quarterdeck.
-