Home | Reviews | GUIpedia | Forum | Fun500
aguma | Screen modes n\' stuffHow do you tell what the current screen mode is? | 2008-08-28 | 9:19 PM |
Todd | Re:Screen modes n\' stuffAre you talking about it when you run a DOS program from a GUI it changes the screen mode and then when it returns the screen mode isn't changed? | 2008-08-28 | 9:59 PM |
aguma | Re:Screen modes n\' stuffno, just how do you tell whether it's in SCREEN 0 or SCREEN 12 or SCREEN 13 or any other screen mode? (In any point in the program)
Like if you run a program that CHAINs to another program, how do you know if it changed to SCREEN 12 or if it just stayed in SCREEN 0?
Sorry if that didn't clarify anything...:P | 2008-08-28 | 10:26 PM |
Todd | Re:Screen modes n\' stuffTell it whenever you CHAIN to another program, return to SCREEN 12 when it's done. | 2008-08-28 | 11:06 PM |
JacobPalm | Re:Screen modes n\' stuffI've sometimes used this procedure to determine the current screen mode.
[code]
' ScrSettings procedure.
'
' Gets the current Basic screen mode setting and width.
'
' Parameters:
' sMode - the current Basic screen mode. See the
' SCREEN statement for valid return values
' (0-13).
' sWidth - the current width of the display in
' characters.
'
SUB ScrSettings (sMode AS INTEGER, sWidth AS INTEGER)
' ==================================
' Gets current Basic screen mode and width setting.
' ==================================
DIM regs AS RegType
regs.ax = &HF00
INTERRUPT &H10, regs, regs ' &H10 returns video
' information.
sWidth = (regs.ax AND &HFF00) 256 ' High byte of AX (AH).
sMode = regs.ax AND &HFF ' Low byte of AX (AL).
SELECT CASE sMode ' Map MS-DOS video mode
CASE 3 ' number to Basic screen
sMode = 0 ' modes.
CASE 4
sMode = 1
CASE 6
sMode = 2
CASE 13
sMode = 7
CASE 14
sMode = 8
CASE 15
sMode = 10
CASE 16
sMode = 9
CASE 17
sMode = 11
CASE 18
sMode = 12
CASE 19
sMode = 13
CASE ELSE
sMode = 3
END SELECT
END SUB
[/code]
It returns both the screen mode and the width in pixels. It doesn't return the height, though. | 2008-08-29 | 11:30 AM |
aguma | Re:Screen modes n\' stuffTHANK YOU! That was what I was looking for. :) | 2008-08-29 | 5:50 PM |
BASIC Programming Help
2021 Brandon Cornell