Post by clippy on Oct 26, 2007 4:18:18 GMT
I found this Interrupt code on the web and tried it. Everything worked fine until I tried to use it in a SCREEN 12 program. The code for the numbers of columns and rows read 80 and 30 correctly, but somehow it resized the SCREEN 12 width setting wider for my monitor! SCREEN 13 worked fine and it reported 40 and 25.
I had to reset it by reverting to the original settings and the width was fixed. If you try the commented lower code, make sure that your monitor settings can be reset first! I am just wondering how the setting was changed and what the value sent should be for the columns if it is wrong.
I cannot check to see how the other monitor stuff works because most of the types are hard to find anymore. The code does not look for monochrome monitors at all. I have another routine that checks for most of them, but EGA is the default if nothing else is found. I was also looking to adapt this code for the other routine when all hell broke loose!
Thanks for any ideas in advance,
Ted
PS: Never heard of PGA before.
I had to reset it by reverting to the original settings and the width was fixed. If you try the commented lower code, make sure that your monitor settings can be reset first! I am just wondering how the setting was changed and what the value sent should be for the columns if it is wrong.
'$INCLUDE: 'QB.BI'
DEFINT A-Z
DIM SHARED Regs AS RegTypeX
DIM Console AS STRING * 3
Setup
SUB Setup
'----------------------------------
'Get memory size (extended mem, kB)
'----------------------------------
OUT &H70, &H15
b% = INP(&H71)
OUT &H70, &H16
b1% = INP(&H71)
BaseMem = CVI(CHR$(b%) + CHR$(b1%))
OUT &H70, &H17
b% = INP(&H71)
OUT &H70, &H18
b1% = INP(&H71)
ExtMem = CVI(CHR$(b%) + CHR$(b1%))
TotalMem = BaseMem + ExtMem
PRINT "Base Memory:"; BaseMem; "k + Extended:"; ExtMem; "k ="; TotalMem
'-----------------
'Check for EGA/VGA
'-----------------
Regs.AX = &H1A00
CALL INTERRUPTX (&H10, Regs, Regs)
IF (Regs.AX AND &HFF) = &H1A THEN
Code = Regs.BX AND &HFF
SELECT CASE Code
CASE 1: Console = "MDA"
CASE 2: Console = "CGA"
CASE 4 to 5: Console = "EGA"
CASE 6: Console = "PGA"
CASE 7 to 8: Console = "VGA"
END SELECT
END IF
' WARNING! CODE BELOW MAY RESET YOUR MONITOR SETTINGS!
' MAKE SURE YOU CAN RESET THEM!
'Regs.AX = &H1130
'Regs.BX = &H0
'CALL INTERRUPTX (&H10, Regs, Regs)
'ScrRows = (Regs.DX and 255) + 1
'Regs.AX = &HF00
'CALL INTERRUPTX (&H10, Regs, Regs)
'ScrCols = (Regs.AX and 65280) / 256
'PRINT Monitor = "; Console; "Rows ="; ScrRows; "Columns ="; ScrCols
END SUB
I cannot check to see how the other monitor stuff works because most of the types are hard to find anymore. The code does not look for monochrome monitors at all. I have another routine that checks for most of them, but EGA is the default if nothing else is found. I was also looking to adapt this code for the other routine when all hell broke loose!
Thanks for any ideas in advance,
Ted
PS: Never heard of PGA before.