Video display modes: Difference between revisions

Added solution for Action!
(Added solution for Action!)
Line 20:
* Regardless of whether you use CGA or EGA, the same text-related commands and service calls will work just as they do in MS-DOS mode. The only difference is the font which is a lot larger and supports the change of text color.
* If you use <code>mov ax,4C00h int 21h</code> to return to DOS while in a different video mode, you will still be in that video mode when you return.
 
=={{header|Action!}}==
<lang Action!>PROC ShowMode(BYTE m,split,gr
CARD w, BYTE h,
CARD size,
CHAR ARRAY descr)
BYTE CH=$02FC
CARD i
BYTE POINTER ptr
 
Graphics(0)
PrintF("Next video mode: %B%E",m)
IF split THEN
PrintF("Split video mode%E%EUpper part:%E")
FI
 
IF gr THEN
Print("Graphics")
ELSE
Print("Text")
FI
PrintF(" mode, %Ux%B, %S%E",w,h,descr)
 
IF split THEN
PrintF("%ELower part:%EText mode 40x4, 2 luminances%E")
FI
PrintF("%EPress any key to change video mode.")
 
DO UNTIL CH#$FF OD
CH=$FF
 
Graphics(m)
ptr=PeekC(88)
 
FOR i=1 TO size
DO
ptr^=Rand(0)
ptr==+1
OD
 
DO UNTIL CH#$FF OD
CH=$FF
RETURN
 
PROC Main()
ShowMode(0,0,0,40,24,960,"2 luminances")
ShowMode(1,1,0,20,20,640,"5 colors")
ShowMode(2,1,0,20,10,400,"5 colors")
ShowMode(3,1,1,40,20,400,"4 colors")
ShowMode(4,1,1,80,40,640,"2 colors")
ShowMode(5,1,1,80,40,1120,"4 colors")
ShowMode(6,1,1,160,80,2080,"2 colors")
ShowMode(7,1,1,160,80,4000,"4 colors")
ShowMode(8,1,1,320,160,7856,"2 luminances")
ShowMode(9,0,1,80,192,7680,"16 luminances")
ShowMode(10,0,1,80,192,7680,"9 colors")
ShowMode(11,0,1,80,192,7680,"16 hues")
ShowMode(12,1,0,40,20,1120,"5 colors")
ShowMode(13,1,0,40,10,640,"5 colors")
ShowMode(14,1,1,160,160,4000,"2 colors")
ShowMode(15,1,1,160,160,7856,"4 colors")
ShowMode(17,0,0,20,24,480,"5 colors")
ShowMode(18,0,0,20,12,240,"5 colors")
ShowMode(19,0,1,40,24,240,"4 colors")
ShowMode(20,0,1,80,48,480,"2 colors")
ShowMode(21,0,1,80,48,960,"4 colors")
ShowMode(22,0,1,160,96,1920,"2 colors")
ShowMode(23,0,1,160,96,3840,"4 colors")
ShowMode(24,0,1,320,192,7680,"2 luminances")
ShowMode(28,0,0,40,24,960,"5 colors")
ShowMode(29,0,0,40,12,480,"5 colors")
ShowMode(30,0,1,160,192,3840,"2 colors")
ShowMode(31,0,1,160,192,7680,"4 colors")
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Video_display_modes.png Screenshot from Atari 8-bit computer]
 
=={{header|AmigaBASIC}}==
Anonymous user