Some useful stuff on interrupts

by qbguy (no login)

The regtype is defined as:

TYPE REGTYPE
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
FLAGS AS INTEGER
DS AS INTEGER
ES AS INTEGER
END TYPE


I found some other interrupts that might be "useful":

Interrupt &H05 does a print screen, MS-DOS style. It sends the text screen output to LPT1. This worked for me even on Windows XP with a USB printer mounted with NET USE. (Should QB64 send it to an actual printer or to the the device file "lpt1"?)
Ex:

DIM REGTYPE AS REGTYPE
CALL INTERRUPT (&H5, REGS, REGS)


Interrupt &H18 prints a message saying that NTVDM does not have a ROM BASIC. On the original IBM PC, I guess it would actually execute the ROM BASIC which I guess would be GW-BASIC / BASICA. (In QB64, it should say "QB64 does not have a ROM BASIC" or maybe run a BASIC interpreter even though [http://www.network54.com/Forum/178387/message/1208308121/]).

Interrupt &H33 can be used to do the mouse.

Interrupt &H33 if done with regs.ax set to 0 initializes/resets the driver.

If regs.ax is set to 1 it shows the mouse cursor.

If regs.ax is set to 2 it hides the mouse cursor and if it is called multiple times, you need to call interrupt &h33 with regs.ax set to 1 the same number of times to show it again (QB64 should probably fix this bug).

If regs.ax is set to 3 it returns the x position in regs.cx, the y position in regs.dx and the button status in regs.bx. The button status is like this: 1 = (left pressed), 2 = (right pressed), 4 = (middle pressed). The sum of that is the mouse status (yay binary). It doesn't actually detect the middle mouse (clicking the scroll wheel) on my XP in NTVDM.


If regs.ax is 4, it positions the mouse cursor, with the x position from regs.cx and the y position from regs.dx.

If regs.ax is 7, it limits the horizontal cursor range with regs.cx being the minimum and regs.dx being the maximum. If regs.ax is 8, it limits the vertical cursor range with regs.cx being the minimum and regs.dx being the maximum.

X coordinates for mouse are in the range 0-639. For screen 0 with 50 lines, y coordinates are in the range 0-399. For screen 0 with 25 lines or screen 13, y coordinates are in the range 0-199. For screen 12, y coordinates are in the range 0-479. The graphics coordinates can be converted to text coordinates for LOCATE, etc. by integer dividing by 8 and adding 1.







Posted on Apr 28, 2008, 3:35 PM
from IP address 75.9.211.189

Respond to this message   

Return to Index