; MaxYpos = The Desired Virtual Screen Height\r
; Pages = The Desired # of Video Pages\r
;\r
-; EXIT: AX = Success Flag: 0 = Failure / -1= Success\r
+; EXIT: AX = Success Flag: >0 = Failure / 0 = Success\r
;\r
\r
SVM_STACK STRUC\r
\r
MOV BX, [BP].SVM_Mode ; Get Requested Mode #\r
CMP BX, NUM_MODES ; Is it 0..7?\r
- JAE @SVM_BadModeSetup ; If Not, Error out\r
+ JAE @SVM_BadModeSetup1 ; If Not, Error out\r
\r
SHL BX, 1 ; Scale BX\r
MOV SI, w MODE_TABLE[BX] ; CS:SI -> Mode Info\r
;CLR CH ; Set Hi Word = 0!\r
mov ch,0 ; Set Hi Word = 0!\r
CMP CL, CS:[SI].M_Pages ; Check # Pages for mode\r
- JA @SVM_BadModeSetup ; Report Error if too Many Pages\r
- JCXZ @SVM_BadModeSetup ; Report Error if 0 Pages\r
+ JA @SVM_BadModeSetup2 ; Report Error if too Many Pages\r
+ JCXZ @SVM_BadModeSetup3 ; Report Error if 0 Pages\r
\r
; Check Validity of X Size\r
\r
\r
MOV AX, [BP].SVM_XSize ; Get Logical Screen Width\r
CMP AX, CS:[SI].M_XSize ; Check against Displayed X\r
- JB @SVM_BadModeSetup ; Report Error if too small\r
+ JB @SVM_BadModeSetup4 ; Report Error if too small\r
CMP AX, CS:[SI].M_XMax ; Check against Max X\r
- JA @SVM_BadModeSetup ; Report Error if too big\r
+ JA @SVM_BadModeSetup5 ; Report Error if too big\r
\r
; Check Validity of Y Size\r
\r
MOV BX, [BP].SVM_YSize ; Get Logical Screen Height\r
CMP BX, CS:[SI].M_YSize ; Check against Displayed Y\r
- JB @SVM_BadModeSetup ; Report Error if too small\r
+ JB @SVM_BadModeSetup6 ; Report Error if too small\r
CMP BX, CS:[SI].M_YMax ; Check against Max Y\r
- JA @SVM_BadModeSetup ; Report Error if too big\r
+ JA @SVM_BadModeSetup7 ; Report Error if too big\r
\r
; Enough memory to Fit it all?\r
\r
OR DX, AX ; (DX = 1, AX = 0000)\r
JZ @SVM_Continue ; if so, it's valid...\r
\r
-@SVM_BadModeSetup:\r
-\r
- mov ax,0 ; Return Value = False\r
+@SVM_BadModeSetup1:\r
+ mov ax,1 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup2:\r
+ mov ax,2 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup3:\r
+ mov ax,3 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup4:\r
+ mov ax,4 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup5:\r
+ mov ax,5 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup6:\r
+ mov ax,6 ; Return Value = False\r
+ JMP @SVM_Exit ; Normal Exit\r
+@SVM_BadModeSetup7:\r
+ mov ax,7 ; Return Value = False\r
JMP @SVM_Exit ; Normal Exit\r
\r
@SVM_Continue:\r
void page_demo ()\r
{\r
\r
-char *Error1 = "Failure during SET_VGA_MODEX (4, 320, 240, 2) call";\r
+char *Error1 = "Failure during SET_VGA_MODEX (0, 320, 200, 2) call";\r
\r
int Last_Objects[2], Visible_Objects;\r
\r
-int Screen_X = 352;\r
-int Screen_Y = 544;\r
+int Screen_X = 384;\r
+int Screen_Y = 272;\r
\r
int x, y, z;\r
int c, dc;\r
int Demo_Running = True;\r
int redo, code;\r
\r
- if (set_vga_modex(Mode_320x240, Screen_X, Screen_Y, 2) == 0)\r
+int pee;\r
+pee = set_vga_modex(Mode_320x240, Screen_X, Screen_Y, 1);\r
+ if ( pee > 0)\r
{\r
- set_modex (Mode_320x240);\r
+ set_video_mode (3);\r
+ dos_print (Error1);\r
+ fprintf(stdout, "return value is %d\n", pee);\r
//error_out (Error1);\r
+ exit (EXIT_SUCCESS);\r
}\r
- //set_vga_modex(Mode_320x240, Screen_X, Screen_Y, 2);\r
\r
set_active_page (0);\r
clear_vga_screen (c_BLACK);\r