From: sparky4 Date: Mon, 7 Jul 2014 02:31:31 +0000 (-0500) Subject: modified: 16/DOS_GFX.EXE X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d274f7cdb66fd39016a2d342ed8b9d5a548c15fe;p=16.git modified: 16/DOS_GFX.EXE modified: 16/DOS_GFX.OBJ new file: 16/GAMECOLR.PAL new file: 16/MODEX16.ZIP new file: 16/VGAPA.PCX new file: 16/lib/modex105/DEMOS/C/C_UTILS.LST modified: 16/lib/modex105/DEMOS/C/C_UTILS.OBJ new file: 16/lib/modex105/DEMOS/C/C_UTILS.SBR modified: 16/lib/modex105/DEMOS/C/X-DEMO.C deleted: 16/lib/modex105/MODEX.COM new file: 16/lib/modex105/PALEDIT/BAKAPI.PAL renamed: 16/scrasm/DIAGONAL.PAL -> 16/lib/modex105/PALEDIT/DIAGONAL.PAL renamed: 16/scrasm/SCROLL.PAL -> 16/lib/modex105/PALEDIT/SCROLL.PAL new file: 16/modex16/DP_BPAL.$$$ new file: 16/modex16/DP_CPAL.$$$ new file: 16/modex16/DP_OPAL.$$$ new file: 16/modex16/DP_PREFS new file: 16/modex16/DP_SPAL.$$$ new file: 16/modex16/ED.PCX new file: 16/modex16/GFX.PAL new file: 16/modex16/MAKEFILE new file: 16/modex16/MODEX16.C renamed: 16/modex16/modex16.h -> 16/modex16/MODEX16.H new file: 16/modex16/MODEX16.OBJ new file: 16/modex16/PALETTEC.C new file: 16/modex16/PCXTEST.C new file: 16/modex16/PCXTEST.EXE new file: 16/modex16/PCXTEST.OBJ renamed: 16/modex16/test.c -> 16/modex16/TEST.C modified: 16/modex16/TEST.EXE new file: 16/modex16/TEST.OBJ new file: 16/modex16/TEST.TXT renamed: 16/modex16/types.h -> 16/modex16/TYPES.H deleted: 16/modex16/W deleted: 16/modex16/makefile deleted: 16/modex16/modex16.c deleted: 16/modex16/modex16.obj deleted: 16/modex16/test.obj modified: 16/scrasm/DIAGONAL.PAL modified: 16/scrasm/SCROLL.PAL modified: 16/vgap.pcx --- diff --git a/16/DOS_GFX.EXE b/16/DOS_GFX.EXE index 33f8bba9..10e536c5 100644 Binary files a/16/DOS_GFX.EXE and b/16/DOS_GFX.EXE differ diff --git a/16/DOS_GFX.OBJ b/16/DOS_GFX.OBJ index b159b50c..69225db8 100644 Binary files a/16/DOS_GFX.OBJ and b/16/DOS_GFX.OBJ differ diff --git a/16/GAMECOLR.PAL b/16/GAMECOLR.PAL new file mode 100644 index 00000000..621b1e5e Binary files /dev/null and b/16/GAMECOLR.PAL differ diff --git a/16/MODEX16.ZIP b/16/MODEX16.ZIP new file mode 100644 index 00000000..feed2125 Binary files /dev/null and b/16/MODEX16.ZIP differ diff --git a/16/VGAPA.PCX b/16/VGAPA.PCX new file mode 100644 index 00000000..18335bfd Binary files /dev/null and b/16/VGAPA.PCX differ diff --git a/16/lib/modex105/DEMOS/C/C_UTILS.LST b/16/lib/modex105/DEMOS/C/C_UTILS.LST new file mode 100644 index 00000000..f9664ba0 --- /dev/null +++ b/16/lib/modex105/DEMOS/C/C_UTILS.LST @@ -0,0 +1,597 @@ +Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Page 1 - 1 + + + ;======================================================= + ;=== C_UTILS.ASM - Asm Utilities for C/C++ === + ;======================================================= + + PAGE 255, 132 + + .MODEL Medium + .286 + + ; ==== MACROS ==== + + ; macros to PUSH and POP multiple registers + + PUSHx MACRO R1, R2, R3, R4, R5, R6, R7, R8 + IFNB + push R1 ; Save R1 + PUSHx R2, R3, R4, R5, R6, R7, R8 + ENDIF + ENDM + + POPx MACRO R1, R2, R3, R4, R5, R6, R7, R8 + IFNB + pop R1 ; Restore R1 + POPx R2, R3, R4, R5, R6, R7, R8 + ENDIF + ENDM + + ; Macro to Clear a Register to 0 + + CLR MACRO Register + xor Register, Register ; Set Register = 0 + ENDM + + ; Macros to Decrement Counter & Jump on Condition + + LOOPx MACRO Register, Destination + dec Register ; Counter-- + jnz Destination ; Jump if not 0 + ENDM + + LOOPjz MACRO Register, Destination + dec Register ; Counter-- + jz Destination ; Jump if 0 + ENDM + + + ; ==== General Constants ==== + + = 0000 False EQU 0 + =-0001 True EQU -1 + = 0000 nil EQU 0 + + = BYTE PTR b EQU BYTE PTR + = WORD PTR w EQU WORD PTR + = DWORD PTR d EQU DWORD PTR + = OFFSET o EQU OFFSET + = FAR PTR f EQU FAR PTR + = SHORT s EQU SHORT + = ?,?,?,? ?x4 EQU + = ?,?,? ?x3 EQU + + + 0000 .Data + + EVEN + + 0000 1CE5 7307 0322 RND_Seed DW 7397, 29447, 802 + 0006 00B3 00B7 00B6 RND_Mult DW 179, 183, 182 + 000C 8003 800B 800F RND_ModV DW 32771, 32779, 32783 + + 0012 0D 0A CR_LF DB 13, 10 ; the CRLF data + + 0000 .Code + + ;=========================================== + ;void far pascal dos_print (far char *Text) + ;=========================================== + ; + ; - Print Text Directly to DOS console w/ CR/LF + ; + + PUBLIC DOS_PRINT + + 0010 DP_Stack STRUC + 0000 0000 0000 0000 DW ?x4 ; DI, SI, DS, BP + 0000 + 0008 00000000 DD ? ; Caller + 000C 00000000 DP_Text DD ? ; Far Address of Text to print + DP_Stack ENDS + + + 0000 DOS_PRINT PROC FAR + + PUSHx BP, DS, SI, DI ; Preserve Important Registers + 0000 55 1 push BP ; Save R1 + 0001 1E 2 push DS ; Save R1 + 0002 56 3 push SI ; Save R1 + 0003 57 4 push DI ; Save R1 + 0004 8B EC mov BP, SP ; Set up Stack Frame + + 0006 C5 56 0C lds DX, [BP].DP_Text ; Get Addr of Text$ descriptor + + ; Compute Length of string + + CLR CX ; Length = 0 + 0009 33 C9 1 xor CX, CX ; Set Register = 0 + 000B 8B F2 mov SI, DX ; DS:SI = String data + + 000D @@DP_Scan_it: + + 000D 80 3C 00 cmp b [SI], 0 ; Null Byte found? + 0010 74 04 je @@DP_Got_Len ; exit loop if so + + 0012 41 inc CX ; Len++ + 0013 46 inc SI ; Point to next char + 0014 EB F7 jmp s @@DP_Scan_it ; check again... + + 0016 @@DP_Got_len: + + 0016 E3 07 jcxz @No_Print ; Don't Print if empty + + 0018 BB 0001 mov BX, 1 ; 1= DOS Handle for Display + 001B B4 40 mov AH, 40h ; Write Text Function + 001D CD 21 int 21h ; Call DOS to do it + + 001F @No_Print: + 001F B8 ---- R mov AX, SEG DGROUP ; Restore DGroup + 0022 8E D8 mov DS, AX + + 0024 BA 0012 R mov DX, o CR_LF ; Get Addr of CR/LF pair + 0027 B9 0002 mov CX, 2 ; 2 Characters to Write + 002A BB 0001 mov BX, 1 ; 1= DOS Handle for Display + + 002D B4 40 mov AH, 40h ; Write Text Function + 002F CD 21 int 21h ; Call DOS to do it + + 0031 FC cld ; Reset Direction Flag + POPx DI, SI, DS, BP ; Restore Saved Registers + 0032 5F 1 pop DI ; Restore R1 + 0033 5E 2 pop SI ; Restore R1 + 0034 1F 3 pop DS ; Restore R1 + 0035 5D 4 pop BP ; Restore R1 + 0036 CA 0004 ret 4 ; Exit & Clean Up Stack + + 0039 DOS_PRINT ENDP + + + ;=========================================== + ;void far pascal dos_prints (char far *Text) + ;=========================================== + ; + ; Print Text Directly to DOS console + ; without a trailing CR/LF + ; + + PUBLIC DOS_PRINTS + + 0039 DOS_PRINTS PROC FAR + + PUSHx BP, DS, SI, DI ; Preserve Important Registers + 0039 55 1 push BP ; Save R1 + 003A 1E 2 push DS ; Save R1 + 003B 56 3 push SI ; Save R1 + 003C 57 4 push DI ; Save R1 + 003D 8B EC mov BP, SP ; Set up Stack Frame + + 003F C5 56 0C lds DX, [BP].DP_Text ; Get Addr of Text$ descriptor + + ; Compute Length of string + + CLR CX ; Length = 0 + 0042 33 C9 1 xor CX, CX ; Set Register = 0 + 0044 8B F2 mov SI, DX ; DS:SI = String data + + 0046 @@DPS_Scan_it: + + 0046 80 3C 00 cmp b [SI], 0 ; Null Byte found? + 0049 74 04 je @@DPS_Got_Len ; exit loop if so + + 004B 41 inc CX ; Len++ + 004C 46 inc SI ; Point to next char + 004D EB F7 jmp s @@DPS_Scan_it ; check again... + + 004F @@DPS_Got_len: + + 004F E3 07 jcxz @DPS_Exit ; Don't Print if empty + + 0051 BB 0001 mov BX, 1 ; 1= DOS Handle for Display + 0054 B4 40 mov AH, 40h ; Write Text Function + 0056 CD 21 int 21h ; Call DOS to do it + + 0058 @DPS_Exit: + 0058 FC cld ; Reset Direction Flag + POPx DI, SI, DS, BP ; Restore Saved Registers + 0059 5F 1 pop DI ; Restore R1 + 005A 5E 2 pop SI ; Restore R1 + 005B 1F 3 pop DS ; Restore R1 + 005C 5D 4 pop BP ; Restore R1 + 005D CA 0002 ret 2 ; Exit & Clean Up Stack + + 0060 DOS_PRINTS ENDP + + + ;========================================= + ;void far pascal set_video_mode (int Mode) + ;========================================= + ; + ; Sets the Video Mode through the BIOS + ; + + PUBLIC SET_VIDEO_MODE + + 000E SVM_Stack STRUC + 0000 0000 0000 0000 DW ?x4 ; DI, SI, DS, BP + 0000 + 0008 00000000 DD ? ; Caller + 000C 00 00 SVM_Mode DB ?,? ; Desired Video Mode + SVM_Stack ENDS + + + 0060 SET_VIDEO_MODE PROC FAR + + PUSHx BP, DS, SI, DI ; Preserve Important Registers + 0060 55 1 push BP ; Save R1 + 0061 1E 2 push DS ; Save R1 + 0062 56 3 push SI ; Save R1 + 0063 57 4 push DI ; Save R1 + 0064 8B EC mov BP, SP ; Set up Stack Frame + + CLR AH ; Function 0 + 0066 32 E4 1 xor AH, AH ; Set Register = 0 + 0068 8A 46 0C mov AL, [BP].SVM_Mode ; Get Mode # + + 006B CD 10 int 10H ; Change Video Modes + + 006D @SVM_Exit: + POPx DI, SI, DS, BP ; Restore Saved Registers + 006D 5F 1 pop DI ; Restore R1 + 006E 5E 2 pop SI ; Restore R1 + 006F 1F 3 pop DS ; Restore R1 + 0070 5D 4 pop BP ; Restore R1 + 0071 CA 0002 ret 2 ; Exit & Clean Up Stack + + 0074 SET_VIDEO_MODE ENDP + + + ;=================================== + ;int far pascal scan_keyboard (void) + ;=================================== + ; + ; Function to scan keyboard for a pressed key + ; + + PUBLIC SCAN_KEYBOARD + + 0074 SCAN_KEYBOARD PROC FAR + + PUSHx BP, DS, SI, DI ; Preserve Important Registers + 0074 55 1 push BP ; Save R1 + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Page 2 - 1 + + + 0075 1E 2 push DS ; Save R1 + 0076 56 3 push SI ; Save R1 + 0077 57 4 push DI ; Save R1 + + 0078 B4 01 mov AH, 01H ; Function #1 + 007A CD 16 INT 16H ; Call Keyboard Driver + 007C 74 0C JZ @SK_NO_KEY ; Exit if Zero flag set + + 007E B4 00 mov AH, 00H ; Remove Key from Buffer + 0080 CD 16 INT 16H ; Get Keycode in AX + + 0082 0A C0 OR AL, AL ; Low Byte Set (Ascii?) + 0084 74 06 JZ @SK_Exit ; if not, it's a F-Key + + CLR AH ; Clear ScanCode if Ascii + 0086 32 E4 1 xor AH, AH ; Set Register = 0 + 0088 EB 02 JMP s @SK_Exit ; Return Key in AX + + 008A @SK_NO_KEY: + CLR AX ; Return Nil (no Keypress) + 008A 33 C0 1 xor AX, AX ; Set Register = 0 + + 008C @SK_Exit: + 008C FC cld ; Reset Direction Flag + POPx DI, SI, DS, BP ; Restore Saved Registers + 008D 5F 1 pop DI ; Restore R1 + 008E 5E 2 pop SI ; Restore R1 + 008F 1F 3 pop DS ; Restore R1 + 0090 5D 4 pop BP ; Restore R1 + 0091 CB ret ; Exit & Clean Up Stack + + 0092 SCAN_KEYBOARD ENDP + + + ;======================================== + ;int far pascal random_int (int MaxValue) + ;======================================== + ; + ; Returns a pseudo-random number in the range of (0.. MaxInt-1) + ; + + + PUBLIC RANDOM_INT + + 0008 RI_Stack STRUC + 0000 0000 DW ? ; BP + 0002 00000000 DD ? ; Caller + 0006 0000 RI_MaxVal DW ? ; Maximum Value to Return + 1 + RI_Stack ENDS + + + 0092 RANDOM_INT PROC FAR + + 0092 55 push BP ; Preserve Important Registers + 0093 8B EC mov BP, SP ; Set up Stack Frame + + CLR BX ; BX is the data index + 0095 33 DB 1 xor BX, BX ; Set Register = 0 + CLR CX ; CX is the accumulator + 0097 33 C9 1 xor CX, CX ; Set Register = 0 + + REPT 3 + mov AX, RND_Seed[BX] ; load the initial seed + mul RND_Mult[BX] ; multiply it + div RND_ModV[BX] ; and obtain the Mod value + mov RND_Seed[BX], DX ; save that for the next time + + add CX, DX ; add it into the accumulator + inc BX + inc BX ; point to the next set of values + ENDM + 0099 8B 87 0000 R 1 mov AX, RND_Seed[BX] ; load the initial seed + 009D F7 A7 0006 R 1 mul RND_Mult[BX] ; multiply it + 00A1 F7 B7 000C R 1 div RND_ModV[BX] ; and obtain the Mod value + 00A5 89 97 0000 R 1 mov RND_Seed[BX], DX ; save that for the next time + 00A9 03 CA 1 add CX, DX ; add it into the accumulator + 00AB 43 1 inc BX + 00AC 43 1 inc BX ; point to the next set of values + 00AD 8B 87 0000 R 1 mov AX, RND_Seed[BX] ; load the initial seed + 00B1 F7 A7 0006 R 1 mul RND_Mult[BX] ; multiply it + 00B5 F7 B7 000C R 1 div RND_ModV[BX] ; and obtain the Mod value + 00B9 89 97 0000 R 1 mov RND_Seed[BX], DX ; save that for the next time + 00BD 03 CA 1 add CX, DX ; add it into the accumulator + 00BF 43 1 inc BX + 00C0 43 1 inc BX ; point to the next set of values + 00C1 8B 87 0000 R 1 mov AX, RND_Seed[BX] ; load the initial seed + 00C5 F7 A7 0006 R 1 mul RND_Mult[BX] ; multiply it + 00C9 F7 B7 000C R 1 div RND_ModV[BX] ; and obtain the Mod value + 00CD 89 97 0000 R 1 mov RND_Seed[BX], DX ; save that for the next time + 00D1 03 CA 1 add CX, DX ; add it into the accumulator + 00D3 43 1 inc BX + 00D4 43 1 inc BX ; point to the next set of values + + 00D5 8B C1 mov AX, CX ; AX = Random # + CLR DX ; DX = 0 + 00D7 33 D2 1 xor DX, DX ; Set Register = 0 + 00D9 F7 76 06 div [BP].RI_MaxVal ; DX = DX:AX / MAxVal Remainder + + 00DC 8B C2 mov AX, DX + + 00DE 5D pop BP ; Restore BP + 00DF CA 0002 ret 2 ; back to BASIC with AX holding the result + + 00E2 RANDOM_INT ENDP + + + ;================================== + ;void far pascal init_random (void) + ;================================== + ; + ; Scrambles the psuedo-random number sequence + ; (XOR's the seed value with the timer) + ; + + PUBLIC INIT_RANDOM + + 00E2 INIT_RANDOM PROC FAR + + CLR AX ; Segment = 0000 + 00E2 33 C0 1 xor AX, AX ; Set Register = 0 + 00E4 8E C0 mov ES, AX + 00E6 26: A1 046C mov AX, ES:[046Ch] ; Get Timer Lo Word + + 00EA 31 06 0000 R xor RND_Seed, AX ; Scramble 1st Seed + + 00EE CB ret ; Exit & Clean Up Stack + + 00EF INIT_RANDOM ENDP + + ;========================================= + ;int far pascal int_sqr (int X, int Round) + ;========================================= + ; + ; Returns the Integer Square Root of (X) + ; Round allows the return value to be rounded to the + ; nearest integer value by passing 0x80. Passing 0 + ; return the Integer Portion only. The rounding amound is + ; a number from 0 to 1 multiplied by 256, thus + ; 0.5 * 0x100 = 0x80! + ; + + 000C ISQ_Stack STRUC + 0000 0000 0000 DW ?,? ; BP, DI + 0004 00000000 DD ? ; Caller + 0008 0000 ISQ_Round DW ? ; Amount to Round Result * 256 + 000A 0000 ISQ_X DW ? ; "X" + ISQ_Stack ENDS + + PUBLIC INT_SQR + + 00EF INT_SQR PROC FAR + + PUSHx BP, DI ; Save BP + 00EF 55 1 push BP ; Save R1 + 00F0 57 2 push DI ; Save R1 + 00F1 8B EC mov BP, SP ; Set up Stack Frame + + 00F3 33 C0 xor AX, AX ; {xor eax,eax} + 00F5 33 D2 xor DX, DX ; {xor edx,edx} + 00F7 8B 7E 0A mov DI, [BP].ISQ_X ; {mov edi,x} + + 00FA B9 0010 mov CX, 16 ; {mov cx, 32} + + 00FD @ISQ_L: + + 00FD D1 E7 shl DI, 1 ; {shl edi,1} + 00FF D1 D2 rcl DX, 1 ; {rcl edx,1} + 0101 D1 E7 shl DI, 1 ; {shl edi,1} + 0103 D1 D2 rcl DX, 1 ; {rcl edx,1} + 0105 D1 E0 shl AX, 1 ; {shl eax,1} + 0107 8B D8 mov BX, AX ; {mov ebx,eax} + 0109 D1 E3 shl BX, 1 ; {shl ebx,1} + 010B 43 inc BX ; {inc ebx} + 010C 3B D3 cmp DX, BX ; {cmp edx,ebx} + 010E 7C 03 jl @ISQ_S + + 0110 2B D3 sub DX, BX ; {sub edx,ebx} + 0112 40 inc AX ; {inc eax} + + 0113 @ISQ_S: + 0113 E2 E8 loop @ISQ_L + + 0115 03 46 08 add ax, [BP].ISQ_Round ; {add eax,$00008000} + ; {*round* result in hi word: ie. +0 + .5} + 0118 C1 E8 08 shr ax, 8 ; {shr eax,16} {to ax (result)} + + POPx DI, BP ; Restore Registers + 011B 5F 1 pop DI ; Restore R1 + 011C 5D 2 pop BP ; Restore R1 + 011D CA 0004 ret 4 ; Exit + + 0120 INT_SQR ENDP + + ;================================= + ;int far pascal timer_count (void) + ;================================= + ; + ; Returns the current timer value as an integer/long integer + ; + + PUBLIC TIMER_COUNT + + 0120 TIMER_COUNT PROC FAR + + CLR AX ; Segment = 0000 + 0120 33 C0 1 xor AX, AX ; Set Register = 0 + 0122 8E C0 mov ES, AX + 0124 26: A1 046C mov AX, ES:[046Ch] ; Get Timer Lo Word + 0128 26: 8B 16 046E mov DX, ES:[046Eh] ; Get Timer Hi Word + 012D CB ret ; Exit & Clean Up Stack + + 012E TIMER_COUNT ENDP + + + END + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Symbols 3 - 1 + + + + +Macros: + + N a m e Type + +CLR . . . . . . . . . . . . . . Proc +LOOPjz . . . . . . . . . . . . . Proc +LOOPx . . . . . . . . . . . . . Proc +POPx . . . . . . . . . . . . . . Proc +PUSHx . . . . . . . . . . . . . Proc + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Symbols 4 - 1 + + + + +Structures and Unions: + + N a m e Size + Offset Type + +DP_Stack . . . . . . . . . . . . 0010 + DP_Text . . . . . . . . . . . 000C DWord +ISQ_Stack . . . . . . . . . . . 000C + ISQ_Round . . . . . . . . . . 0008 Word + ISQ_X . . . . . . . . . . . . 000A Word +RI_Stack . . . . . . . . . . . . 0008 + RI_MaxVal . . . . . . . . . . 0006 Word +SVM_Stack . . . . . . . . . . . 000E + SVM_Mode . . . . . . . . . . . 000C Byte + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Symbols 5 - 1 + + + + +Segments and Groups: + + N a m e Size Length Align Combine Class + +C_UTILS_TEXT . . . . . . . . . . 16 Bit 012E Word Public 'CODE' +DGROUP . . . . . . . . . . . . . GROUP +_DATA . . . . . . . . . . . . . 16 Bit 0014 Word Public 'DATA' + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Symbols 6 - 1 + + + + +Procedures, parameters and locals: + + N a m e Type Value Attr + +DOS_PRINTS . . . . . . . . . . . P Far 0039 C_UTILS_TEXT Length= 0027 Public +DOS_PRINT . . . . . . . . . . . P Far 0000 C_UTILS_TEXT Length= 0039 Public +INIT_RANDOM . . . . . . . . . . P Far 00E2 C_UTILS_TEXT Length= 000D Public +INT_SQR . . . . . . . . . . . . P Far 00EF C_UTILS_TEXT Length= 0031 Public +RANDOM_INT . . . . . . . . . . . P Far 0092 C_UTILS_TEXT Length= 0050 Public +SCAN_KEYBOARD . . . . . . . . . P Far 0074 C_UTILS_TEXT Length= 001E Public +SET_VIDEO_MODE . . . . . . . . . P Far 0060 C_UTILS_TEXT Length= 0014 Public +TIMER_COUNT . . . . . . . . . . P Far 0120 C_UTILS_TEXT Length= 000E Public + Microsoft (R) Macro Assembler Version 6.11 07/03/14 12:38:18 +c_utils.asm Symbols 7 - 1 + + + + +Symbols: + + N a m e Type Value Attr + +?x3 . . . . . . . . . . . . . . Text ?,?,? +?x4 . . . . . . . . . . . . . . Text ?,?,?,? +@@DPS_Got_len . . . . . . . . . L Near 004F C_UTILS_TEXT +@@DPS_Scan_it . . . . . . . . . L Near 0046 C_UTILS_TEXT +@@DP_Got_len . . . . . . . . . . L Near 0016 C_UTILS_TEXT +@@DP_Scan_it . . . . . . . . . . L Near 000D C_UTILS_TEXT +@CodeSize . . . . . . . . . . . Number 0001h +@DPS_Exit . . . . . . . . . . . L Near 0058 C_UTILS_TEXT +@DataSize . . . . . . . . . . . Number 0000h +@ISQ_L . . . . . . . . . . . . . L Near 00FD C_UTILS_TEXT +@ISQ_S . . . . . . . . . . . . . L Near 0113 C_UTILS_TEXT +@Interface . . . . . . . . . . . Number 0000h +@Model . . . . . . . . . . . . . Number 0004h +@No_Print . . . . . . . . . . . L Near 001F C_UTILS_TEXT +@SK_Exit . . . . . . . . . . . . L Near 008C C_UTILS_TEXT +@SK_NO_KEY . . . . . . . . . . . L Near 008A C_UTILS_TEXT +@SVM_Exit . . . . . . . . . . . L Near 006D C_UTILS_TEXT +@code . . . . . . . . . . . . . Text C_UTILS_TEXT +@data . . . . . . . . . . . . . Text DGROUP +@fardata? . . . . . . . . . . . Text FAR_BSS +@fardata . . . . . . . . . . . . Text FAR_DATA +@stack . . . . . . . . . . . . . Text DGROUP +CR_LF . . . . . . . . . . . . . Byte 0012 _DATA +False . . . . . . . . . . . . . Number 0000h +RND_ModV . . . . . . . . . . . . Word 000C _DATA +RND_Mult . . . . . . . . . . . . Word 0006 _DATA +RND_Seed . . . . . . . . . . . . Word 0000 _DATA +True . . . . . . . . . . . . . . Number -0001h +b . . . . . . . . . . . . . . . Text BYTE PTR +d . . . . . . . . . . . . . . . Text DWORD PTR +f . . . . . . . . . . . . . . . Text FAR PTR +nil . . . . . . . . . . . . . . Number 0000h +o . . . . . . . . . . . . . . . Text OFFSET +s . . . . . . . . . . . . . . . Text SHORT +w . . . . . . . . . . . . . . . Text WORD PTR + + 0 Warnings + 0 Errors diff --git a/16/lib/modex105/DEMOS/C/C_UTILS.OBJ b/16/lib/modex105/DEMOS/C/C_UTILS.OBJ index 075a2da1..ee6bc67f 100644 Binary files a/16/lib/modex105/DEMOS/C/C_UTILS.OBJ and b/16/lib/modex105/DEMOS/C/C_UTILS.OBJ differ diff --git a/16/lib/modex105/DEMOS/C/C_UTILS.SBR b/16/lib/modex105/DEMOS/C/C_UTILS.SBR new file mode 100644 index 00000000..0301171b Binary files /dev/null and b/16/lib/modex105/DEMOS/C/C_UTILS.SBR differ diff --git a/16/lib/modex105/DEMOS/C/X-DEMO.C b/16/lib/modex105/DEMOS/C/X-DEMO.C index a5ac59b1..2d0621ee 100644 --- a/16/lib/modex105/DEMOS/C/X-DEMO.C +++ b/16/lib/modex105/DEMOS/C/X-DEMO.C @@ -507,8 +507,8 @@ char *Error1 = "Failure during SET_VGA_MODEX (0, 360, 240, 3) call"; int Last_Objects[2], Visible_Objects; -int Screen_X = 360; -int Screen_Y = 240; +int Screen_X = 384; +int Screen_Y = 672; int x, y, z; int c, dc; diff --git a/16/lib/modex105/MODEX.COM b/16/lib/modex105/MODEX.COM deleted file mode 100644 index e69de29b..00000000 diff --git a/16/lib/modex105/PALEDIT/BAKAPI.PAL b/16/lib/modex105/PALEDIT/BAKAPI.PAL new file mode 100644 index 00000000..d4d4a6a0 Binary files /dev/null and b/16/lib/modex105/PALEDIT/BAKAPI.PAL differ diff --git a/16/lib/modex105/PALEDIT/DIAGONAL.PAL b/16/lib/modex105/PALEDIT/DIAGONAL.PAL new file mode 100644 index 00000000..5dee1969 Binary files /dev/null and b/16/lib/modex105/PALEDIT/DIAGONAL.PAL differ diff --git a/16/lib/modex105/PALEDIT/SCROLL.PAL b/16/lib/modex105/PALEDIT/SCROLL.PAL new file mode 100644 index 00000000..5dee1969 Binary files /dev/null and b/16/lib/modex105/PALEDIT/SCROLL.PAL differ diff --git a/16/modex16/DP_BPAL.$$$ b/16/modex16/DP_BPAL.$$$ new file mode 100644 index 00000000..06d74050 Binary files /dev/null and b/16/modex16/DP_BPAL.$$$ differ diff --git a/16/modex16/DP_CPAL.$$$ b/16/modex16/DP_CPAL.$$$ new file mode 100644 index 00000000..06d74050 Binary files /dev/null and b/16/modex16/DP_CPAL.$$$ differ diff --git a/16/modex16/DP_OPAL.$$$ b/16/modex16/DP_OPAL.$$$ new file mode 100644 index 00000000..1edf0273 Binary files /dev/null and b/16/modex16/DP_OPAL.$$$ differ diff --git a/16/modex16/DP_PREFS b/16/modex16/DP_PREFS new file mode 100644 index 00000000..d27b7ecb Binary files /dev/null and b/16/modex16/DP_PREFS differ diff --git a/16/modex16/DP_SPAL.$$$ b/16/modex16/DP_SPAL.$$$ new file mode 100644 index 00000000..06d74050 Binary files /dev/null and b/16/modex16/DP_SPAL.$$$ differ diff --git a/16/modex16/ED.PCX b/16/modex16/ED.PCX new file mode 100644 index 00000000..41e56317 Binary files /dev/null and b/16/modex16/ED.PCX differ diff --git a/16/modex16/GFX.PAL b/16/modex16/GFX.PAL new file mode 100644 index 00000000..e98ae60e Binary files /dev/null and b/16/modex16/GFX.PAL differ diff --git a/16/modex16/MAKEFILE b/16/modex16/MAKEFILE new file mode 100644 index 00000000..b5a3fb34 --- /dev/null +++ b/16/modex16/MAKEFILE @@ -0,0 +1,17 @@ +FLAGS=-0 +all: test.exe pcxtest.exe + +test.exe: test.obj modex16.obj + wcl $(FLAGS) test.obj modex16.obj + +pcxtest.exe: pcxtest.obj modex16.obj + wcl $(FLAGS) pcxtest.obj modex16.obj + +test.obj: test.c modex16.h + wcl $(FLAGS) -c test.c + +pcxtest.obj: pcxtest.c modex16.h + wcl $(FLAGS) -c pcxtest.c + +modex16.obj: modex16.h modex16.c + wcl $(FLAGS) -c modex16.c diff --git a/16/modex16/MODEX16.C b/16/modex16/MODEX16.C new file mode 100644 index 00000000..05ac9d92 --- /dev/null +++ b/16/modex16/MODEX16.C @@ -0,0 +1,420 @@ +#include +#include +#include +#include +#include +#include +#include "modex16.h" + + +byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ + +static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); +static byte tmppal[PAL_SIZE]; +static struct pcxHeader { + byte id; + byte version; + byte encoding; + byte bpp; + word xmin; + word ymin; + word xmax; + word ymax; + word hres; + word vres; + byte pal16[48]; + byte res1; + word bpplane; + word palType; + word hScreenSize; + word vScreenSize; + byte padding[54]; +}; + + +static void +vgaSetMode(byte mode) +{ + union REGS regs; + + regs.h.ah = SET_MODE; + regs.h.al = mode; + int86(VIDEO_INT, ®s, ®s); +} + + +/* -========================= Entry Points ==========================- */ +void +modexEnter() { + word i; + dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ + word CRTParms[] = { + 0x0d06, /* vertical total */ + 0x3e07, /* overflow (bit 8 of vertical counts) */ + 0x4109, /* cell height (2 to double-scan */ + 0xea10, /* v sync start */ + 0xac11, /* v sync end and protect cr0-cr7 */ + 0xdf12, /* vertical displayed */ + 0x0014, /* turn off dword mode */ + 0xe715, /* v blank start */ + 0x0616, /* v blank end */ + 0xe317 /* turn on byte mode */ + }; + int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]); + + /* TODO save current video mode and palette */ + vgaSetMode(VGA_256_COLOR_MODE); + + /* disable chain4 mode */ + outpw(SC_INDEX, 0x0604); + + /* synchronous reset while setting Misc Output */ + outpw(SC_INDEX, 0x0100); + + /* select 25 MHz dot clock & 60 Hz scanning rate */ + outp(MISC_OUTPUT, 0xe3); + + /* undo reset (restart sequencer) */ + outpw(SC_INDEX, 0x0300); + + /* reprogram the CRT controller */ + outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */ + outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */ + + /* send the CRTParms */ + for(i=0; iwidth; px+=4) { + offset=px; + for(py=0; pyheight; py++) { + if(!sprite || bmp->data[offset]) + page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset]; + offset+=bmp->width; + } + } + } +} + + +/* fade and flash */ +void +modexFadeOn(word fade, byte *palette) { + fadePalette(-fade, 64, 64/fade+1, palette); +} + + +void +modexFadeOff(word fade, byte *palette) { + fadePalette(fade, 0, 64/fade+1, palette); +} + + +void +modexFlashOn(word fade, byte *palette) { + fadePalette(fade, -64, 64/fade+1, palette); +} + + +void +modexFlashOff(word fade, byte *palette) { + fadePalette(-fade, 0, 64/fade+1, palette); +} + + +static void +fadePalette(sbyte fade, sbyte start, word iter, byte *palette) { + word i; + byte dim = start; + + /* handle the case where we just update */ + if(iter == 0) { + modexPalUpdate(palette); + return; + } + + while(iter > 0) { /* FadeLoop */ + for(i=0; i 127) { + tmppal[i] = 0; + } else if(tmppal[i] > 63) { + tmppal[i] = 63; + } + } + modexPalUpdate(tmppal); + iter--; + dim += fade; + } +} + + +/* save and load */ +void +modexPalSave(byte *palette) { + int i; + + outp(PAL_READ_REG, 0); /* start at palette entry 0 */ + for(i=0; i> 2; + } + } else { + /* use the 16 color palette */ + for(index=0; index<48; index++) { + result.palette[index] = head.pal16[index]; + } + } + + fclose(file); + + return result; +} diff --git a/16/modex16/modex16.h b/16/modex16/MODEX16.H similarity index 50% rename from 16/modex16/modex16.h rename to 16/modex16/MODEX16.H index 4502fa08..7bd92bc1 100644 --- a/16/modex16/modex16.h +++ b/16/modex16/MODEX16.H @@ -7,18 +7,49 @@ #include "types.h" /* -========================== Types & Macros ==========================- */ -#define PAGE_OFFSET(x,y) ((y<<6)+(y<<4)+(x>>2)) +#define PAGE_OFFSET(x,y) (((y)<<6)+((y)<<4)+((x)>>2)) #define PLANE(x) (1<< (x&3)) typedef byte far* page_t; #define SELECT_ALL_PLANES() outpw(0x03c4, 0xff02) +typedef struct { + byte *data; + word width; + word height; + byte *palette; +} bitmap_t; /* -============================ Functions =============================- */ +/* mode switching, page, and plane functions */ void modexEnter(); void modexLeave(); void modexShowPage(page_t page); void modexPanPage(page_t *page, int dx, int dy); void modexSelectPlane(byte plane); void modexClearRegion(page_t page, int x, int y, int w, int h, byte color); +void modexDrawBmp(page_t page, int x, int y, bitmap_t *bmp, byte sprite); + +/* Palette fade and flash effects */ +void modexFadeOn(word fade, byte *palette); +void modexFadeOff(word fade, byte *palette); +void modexFlashOn(word fade, byte *palette); +void modexFlashOff(word fade, byte *palette); + +/* palette loading and saving */ +void modexPalSave(byte *palette); +byte *modexNewPal(); +void modexLoadPalFile(char *filename, byte **palette); +void modexSavePalFile(char *filename, byte *palette); + +/* fixed palette functions */ +void modexPalBlack(); +void modexPalWhite(); + +/* utility functions */ +void modexPalUpdate(byte *p); +void modexWaitBorder(); + +/* bitmap functions */ +bitmap_t modexLoadPcx(char *filename); /* -======================= Constants & Vars ==========================- */ extern byte far* VGA; /* The VGA Memory */ @@ -41,4 +72,8 @@ extern byte far* VGA; /* The VGA Memory */ #define INPUT_STATUS_1 0x03da #define DISPLAY_ENABLE 0x01 #define MAP_MASK 0x02 +#define PAL_READ_REG 0x03C7 /* Color register, read address */ +#define PAL_WRITE_REG 0x03C8 /* Color register, write address */ +#define PAL_DATA_REG 0x03C9 /* Color register, data port */ +#define PAL_SIZE (256 * 3) #endif diff --git a/16/modex16/MODEX16.OBJ b/16/modex16/MODEX16.OBJ new file mode 100644 index 00000000..a8b6c13f Binary files /dev/null and b/16/modex16/MODEX16.OBJ differ diff --git a/16/modex16/PALETTEC.C b/16/modex16/PALETTEC.C new file mode 100644 index 00000000..340a9303 --- /dev/null +++ b/16/modex16/PALETTEC.C @@ -0,0 +1,16 @@ +#include "modex16.h" + +void +main() { + byte *pal; + + modexEnter(); + + pal = modexNewPal(); + modexPalSave(pal); + + modexSavePalFile("gfx.pal", pal); + + modexLeave(); + +} diff --git a/16/modex16/PCXTEST.C b/16/modex16/PCXTEST.C new file mode 100644 index 00000000..63ce473f --- /dev/null +++ b/16/modex16/PCXTEST.C @@ -0,0 +1,33 @@ +#include +#include "modex16.h" + +void main() { + bitmap_t bmp; + int index; + int ch=0x0; + + bmp = modexLoadPcx("ed.pcx"); + modexEnter(); + + /* fix up the palette and everything */ + modexPalUpdate(bmp.palette); + + /* don't show the drawing page */ + modexShowPage(VGA + PAGE_SIZE); + + /* clear and draw one sprite and one bitmap */ + modexClearRegion(VGA, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1); + modexDrawBmp(VGA, 20, 20, &bmp, 1); + modexDrawBmp(VGA, 100, 20, &bmp, 0); + modexShowPage(VGA); +// for(index = 0; index<500; index++) { +while(!kbhit()){ // conditions of screen saver + modexWaitBorder(); + ch=getch(); + if(ch==0x71)break; // 'q' + if(ch==0x1b)break; // 'ESC' + } + modexLeave(); + + return; +} diff --git a/16/modex16/PCXTEST.EXE b/16/modex16/PCXTEST.EXE new file mode 100644 index 00000000..58dc4d3f Binary files /dev/null and b/16/modex16/PCXTEST.EXE differ diff --git a/16/modex16/PCXTEST.OBJ b/16/modex16/PCXTEST.OBJ new file mode 100644 index 00000000..c57a8e2a Binary files /dev/null and b/16/modex16/PCXTEST.OBJ differ diff --git a/16/modex16/test.c b/16/modex16/TEST.C similarity index 56% rename from 16/modex16/test.c rename to 16/modex16/TEST.C index 48ecf0b9..74a9b801 100644 --- a/16/modex16/test.c +++ b/16/modex16/TEST.C @@ -10,8 +10,19 @@ void main() { page_t page, page2; word far* ptr; float elapsed; + byte *pal, *pal2=NULL; + + /* load our palette */ + modexLoadPalFile("gfx.pal", &pal2); + + /* save the palette */ + pal = modexNewPal(); + modexPalSave(pal); + modexFadeOff(1, pal); + modexPalBlack();; modexEnter(); + modexPalBlack(); page= VGA; page2=VGA+PAGE_SIZE; @@ -22,6 +33,13 @@ void main() { modexClearRegion(page, 17, 12, 30, 30, 19); modexShowPage(page); + /* fade in */ + modexFadeOn(1, pal2); + + /* fill page2 up */ + modexClearRegion(page2, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 128); + + start = *clock; for(i=0; i<500; i++) { modexShowPage(page); @@ -29,7 +47,12 @@ void main() { } end = *clock; + /* fade back to text mode */ + modexFadeOff(1, pal2); + modexPalBlack(); modexLeave(); + modexPalBlack(); + modexFadeOn(1, pal); elapsed = (end-start)/18.2; printf("500 frames in %f seconds for %f fps\n", elapsed, 500.0/elapsed); } diff --git a/16/modex16/TEST.EXE b/16/modex16/TEST.EXE index bfcdf91a..f8f28a6a 100644 Binary files a/16/modex16/TEST.EXE and b/16/modex16/TEST.EXE differ diff --git a/16/modex16/TEST.OBJ b/16/modex16/TEST.OBJ new file mode 100644 index 00000000..788b5c6e Binary files /dev/null and b/16/modex16/TEST.OBJ differ diff --git a/16/modex16/TEST.TXT b/16/modex16/TEST.TXT new file mode 100644 index 00000000..05adc9ec --- /dev/null +++ b/16/modex16/TEST.TXT @@ -0,0 +1,258 @@ +64 x 64 Pixels + +0 0 0 +20 0 0 +0 20 0 +20 20 0 +0 0 20 +20 0 20 +0 20 20 +30 30 30 +30 37 30 +29 32 3c +3f 3f 33 +3f 3f 26 +3f 3f 19 +3f 3f c +3f 33 3f +3f 33 33 +3f 33 26 +3f 33 19 +3f 33 c +3f 33 0 +3f 26 3f +3f 26 33 +3f 26 26 +3f 26 19 +3f 26 c +3f 26 0 +3f 19 3f +3f 19 33 +3f 19 26 +3f 19 19 +3f 19 c +3f 19 0 +3f c 3f +3f c 33 +3f c 26 +3f c 19 +3f c c +3f c 0 +3f 0 33 +3f 0 26 +3f 0 19 +3f 0 c +33 3f 3f +33 3f 33 +33 3f 26 +33 3f 19 +33 3f c +33 3f 0 +33 33 3f +33 33 33 +33 33 26 +33 33 19 +33 33 c +33 33 0 +33 26 3f +33 26 33 +33 26 26 +33 26 19 +33 26 c +33 26 0 +33 19 3f +33 19 33 +33 19 26 +33 19 19 +33 19 c +33 19 0 +33 c 3f +33 c 33 +33 c 26 +33 c 19 +33 c c +33 c 0 +33 0 3f +33 0 33 +33 0 26 +33 0 19 +33 0 c +33 0 0 +26 3f 3f +26 3f 33 +26 3f 26 +26 3f 19 +26 3f c +26 3f 0 +26 33 3f +26 33 33 +26 33 26 +26 33 19 +26 33 c +26 33 0 +26 26 3f +26 26 33 +26 26 26 +26 26 19 +26 26 c +26 26 0 +26 19 3f +26 19 33 +26 19 26 +26 19 19 +26 19 c +26 19 0 +26 c 3f +26 c 33 +26 c 26 +26 c 19 +26 c c +26 c 0 +26 0 3f +26 0 33 +26 0 26 +26 0 19 +26 0 c +26 0 0 +19 3f 3f +19 3f 33 +19 3f 26 +19 3f 19 +19 3f c +19 3f 0 +19 33 3f +19 33 33 +19 33 26 +19 33 19 +19 33 c +19 33 0 +19 26 3f +19 26 33 +19 26 26 +19 26 19 +19 26 c +19 26 0 +19 19 3f +19 19 33 +19 19 26 +19 19 19 +19 19 c +19 19 0 +19 c 3f +19 c 33 +19 c 26 +19 c 19 +19 c c +19 c 0 +19 0 3f +19 0 33 +19 0 26 +19 0 19 +19 0 c +19 0 0 +c 3f 3f +c 3f 33 +c 3f 26 +c 3f 19 +c 3f c +c 3f 0 +c 33 3f +c 33 33 +c 33 26 +c 33 19 +c 33 c +c 33 0 +c 26 3f +c 26 33 +c 26 26 +c 26 19 +c 26 c +c 26 0 +c 19 3f +c 19 33 +c 19 26 +c 19 19 +c 19 c +c 19 0 +c c 3f +c c 33 +c c 26 +c c 19 +c c c +c c 0 +c 0 3f +c 0 33 +c 0 26 +c 0 19 +c 0 c +c 0 0 +0 3f 33 +0 3f 26 +0 3f 19 +0 3f c +0 33 3f +0 33 33 +0 33 26 +0 33 19 +0 33 c +0 33 0 +0 26 3f +0 26 33 +0 26 26 +0 26 19 +0 26 c +0 26 0 +0 19 3f +0 19 33 +0 19 26 +0 19 19 +0 19 c +0 19 0 +0 c 3f +0 c 33 +0 c 26 +0 c 19 +0 c c +0 c 0 +0 0 33 +0 0 26 +0 0 19 +0 0 c +20 3f 3f +10 20 20 +20 3f 0 +10 10 0 +3f 3f 20 +3f 20 0 +3f 20 20 +20 10 0 +20 0 3f +20 0 10 +10 20 3f +0 10 20 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +3f 3e 3c +28 28 29 +20 20 20 +3f 0 0 +0 3f 0 +3f 3f 0 +0 0 3f +3f 0 3f +0 3f 3f +3f 3f 3f \ No newline at end of file diff --git a/16/modex16/types.h b/16/modex16/TYPES.H similarity index 86% rename from 16/modex16/types.h rename to 16/modex16/TYPES.H index 43a42c55..039653f2 100644 --- a/16/modex16/types.h +++ b/16/modex16/TYPES.H @@ -6,5 +6,6 @@ typedef unsigned char byte; typedef unsigned short word; typedef unsigned long dword; +typedef signed char sbyte; typedef signed short sword; typedef signed long sdword; diff --git a/16/modex16/W b/16/modex16/W deleted file mode 100644 index 4b697d8e..00000000 --- a/16/modex16/W +++ /dev/null @@ -1 +0,0 @@ -500 frames in 8.351648 seconds for 59.868421 fps diff --git a/16/modex16/makefile b/16/modex16/makefile deleted file mode 100644 index f4f4c19d..00000000 --- a/16/modex16/makefile +++ /dev/null @@ -1,10 +0,0 @@ -all: test.exe - -test.exe: test.obj modex16.obj - wcl -0 -d2 test.obj modex16.obj - -test.obj: test.c modex16.h - wcl -0 -d2 -c test.c - -modex16.obj: modex16.h modex16.c - wcl -0 -d2 -c modex16.c diff --git a/16/modex16/modex16.c b/16/modex16/modex16.c deleted file mode 100644 index 47a59687..00000000 --- a/16/modex16/modex16.c +++ /dev/null @@ -1,127 +0,0 @@ -#include -#include -#include -#include -#include "modex16.h" - - -byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ - -static void -vgaSetMode(byte mode) -{ - union REGS regs; - - regs.h.ah = SET_MODE; - regs.h.al = mode; - int86(VIDEO_INT, ®s, ®s); -} - - -/* -========================= Entry Points ==========================- */ -void -modexEnter() { - word i; - dword far*ptr=(dword far*)VGA; /* used for faster screen clearing */ - word CRTParms[] = { - 0x0d06, /* vertical total */ - 0x3e07, /* overflow (bit 8 of vertical counts) */ - 0x4109, /* cell height (2 to double-scan */ - 0xea10, /* v sync start */ - 0xac11, /* v sync end and protect cr0-cr7 */ - 0xdf12, /* vertical displayed */ - 0x0014, /* turn off dword mode */ - 0xe715, /* v blank start */ - 0x0616, /* v blank end */ - 0xe317 /* turn on byte mode */ - }; - int CRTParmCount = sizeof(CRTParms) / sizeof(CRTParms[0]); - - /* TODO save current video mode and palette */ - vgaSetMode(VGA_256_COLOR_MODE); - - /* disable chain4 mode */ - outpw(SC_INDEX, 0x0604); - - /* synchronous reset while setting Misc Output */ - outpw(SC_INDEX, 0x0100); - - /* select 25 MHz dot clock & 60 Hz scanning rate */ - outp(MISC_OUTPUT, 0xe3); - - /* undo reset (restart sequencer) */ - outpw(SC_INDEX, 0x0300); - - /* reprogram the CRT controller */ - outp(CRTC_INDEX, 0x11); /* VSync End reg contains register write prot */ - outp(CRTC_DATA, 0x7f); /* get current write protect on varios regs */ - - /* send the CRTParms */ - for(i=0; i