[MN-dev] [mndiff]: r73 - trunk/vga600/vga600.asm

michael subversion at mplayerhq.hu
Fri Jul 6 01:05:45 CEST 2007


Author: michael
Date: Fri Jul  6 01:05:45 2007
New Revision: 73

Log:
version from 1997-06-25 23:06


Modified:
   trunk/vga600/vga600.asm

Modified: trunk/vga600/vga600.asm
==============================================================================
--- trunk/vga600/vga600.asm	(original)
+++ trunk/vga600/vga600.asm	Fri Jul  6 01:05:45 2007
@@ -1,5 +1,3 @@
-;350 text ???VDE =57h
-
 ;VGA600 ver 0.6 Beta Copyright (C) Michael Niedermayer 1997
 
 ;history:
@@ -14,22 +12,24 @@
 ideal
 P286
 
-cr           equ 0ah
-lf           equ 0dh
-paras        equ (end10h-int10h)/16+1
-paras_all    equ (end_all-start+100h)/16+1
-words        equ (end10h-int10h)/2+5
-SC_INDEX     equ 03c4h   
-CRTC_INDEX   equ 03d4h   
-MISC_OUTPUT  equ 03c2h   
-MISC_INPUT   equ 03cch   
-Attrib_INDEX equ 03c0h
-Grafix_INDEX equ 03ceh
-patch_size   equ patch_code_end-patch_code
-delay        equ 6
-delay2       equ 12
-FPx          equ 12
-FPx_1        equ 1 shl FPx
+cr            equ 0ah
+lf            equ 0dh
+paras         equ (end10h-int10h)/16+1
+paras_all     equ (end_all-start+100h)/16+1
+words         equ (end10h-int10h)/2+5
+SC_INDEX      equ 03c4h   
+CRTC_INDEX    equ 03d4h   
+MISC_OUTPUT   equ 03c2h   
+MISC_INPUT    equ 03cch   
+Attrib_INDEX  equ 03c0h
+Grafix_INDEX  equ 03ceh
+PatchCodeSize equ offset(PatchClockCode_end)-offset(PatchClockCode)
+PatchArgsSize equ offset(PatchArgs_end)-offset(PatchArgs)
+delay         equ 6
+delay2        equ 12
+FPx           equ 12
+FPx_1         equ 1 shl FPx
+ProbeTimes    equ 8
 
 segment code
 org 100h
@@ -38,7 +38,7 @@ assume cs:code, ds:code, es:code, ss:cod
 start:
 jmp install                           ;jmp to install code
 
-mcb_name db 'VGA600  '                ;ends up in mcb if it works
+mcb_name db 'VGA..600'                ;ends up in mcb if it works
 int10h:
  cmp ax,020FFh                        ;check for allredy installed call
   jne exit_10
@@ -80,14 +80,13 @@ decr:                        ;if(X>0) X1
   jnz exit_8                            ;get out if not zero
  mov [BYTE cs:counter-int10h],delay2    ;set new counter
 
-; call CheckSet
+ call CheckSet
 
 exit_8:                                 ;jmp to old int 8
 db 0eah
 old_int8h dd 0
  
 CheckSet:
-int 3
 pusha
 push ds
 push es
@@ -99,7 +98,7 @@ push es
 
  mov si,offset(where)-offset(int10h)        ;Read and convert Vga-Regs
  mov di,offset(what)-offset(int10h)
- mov bx,offset(OF2Real_code)-offset(int10h)
+ mov bx,offset(VSE2Real_code)-offset(int10h)
 
  mov dx,SC_INDEX
  mov al,1
@@ -126,6 +125,7 @@ chr_9:
  in al,dx
  stosb                                     ;save Misc-reg
 
+int 3
 get_regs:
  mov dl,low(CRTC_INDEX)                     ;!dh=3
  lodsb                                      ;read index from table1
@@ -134,7 +134,7 @@ get_regs:
  out dx,al                                  ;set index
  inc dx                                     ;dx= data_port
  in al,dx                                   ;get data
- push ax                                    ;save date
+ push ax                                    ;save data
  lodsw                                      ;get jmp_table_entry and inc si
  cbw                                        ;convert it to word
  add bx,ax                                  ;and add it to the last one
@@ -178,74 +178,79 @@ Not2_End_CheckSet:
  cmp ax,[MinLines-int10h]
   jb End2_CheckSet
 
+ int 3
  mov al,[MSL-int10h]
- mov bl,10011111b
+ and al,10011111b
  test [BYTE gm-int10h],1                     ;test if text
   jnz no_text
-  mov bl,10000000b
+  and al,10000000b
 no_text:
- and al,bl
+ test al,al
   jns no_cgax2                               ;test if cga like mode
-  mov al,1
+ cmp al,10000001b
+  jae End2_CheckSet                           ;get out if Real-CGA
+ mov al,1
 no_cgax2:
  and al,00011111b
- inc ax
+ inc ax                                      ;al=mult (msl=mult-1)
  cbw
  stosb                                       ;save lm
 
- mov bx,[VDE-int10h]                         ;get phys-lines
- xchg ax,bx                                  ;ax=phys-line / bx=line_mult
+ xchg ax,bx                                  ;bx=line_mult
+ mov ax,[VDE-int10h]                         ;ax=phys-lines
  cwd
  div bx                                      ;find logical_lines
  stosw                                       ;save ll
  xchg ax,di                                  ;di=logi-line / bx=line_mult
  mov cx,-1                                   ;cx=-1 (best_clock_index)
 
+;int 3
 FindBest:
  inc bx                                      ; inc line_mult
   js End_FindBest                            ; just in case VDE is very strange
  cmp bl,3                                    ;check line_mult<3
   jb n3
  test [BYTE gm-int10h],1                     ;test if text
-  jz End_FindBest                            ;get out if more then *3 + TEXT
+  jz End_FindBest                            ;get out if more then *2 + TEXT
 n3:
  mov ax,bx
  call FindSet_V                              ;find and set Vertical nums
  cmp si,[MaxLines-int10h]
   ja End_FindBest                            ; get out if toooo much
 
- mov si,FP8_ClockTable-int10h                ;si=pointer to clock_table
+ xor si,si                                   ;si=clock
  xor bp,bp                                   ;bp=best_clock (=0)
 
 FindBestClock:
- mov ax,[WORD si]                            ;get clock
- mul [WORD FP8_1-int10h]                     ;for more precision 
+ mov ax,[WORD si+FP8_ClockTable-int10h]      ;get clock
+ test [BYTE SCM-int10h],1000b                ;check if dotclk=mstclk/2
+ int 3
+  jz clk_ok                                  ;skip if not
+ shr ax,1                                    ;"double" ht if yes
+clk_ok:
+ mul [WORD K_1-int10h]                       ;convert to kHz
  div [WORD HT-int10h]                        ;find line_freq  HT MUST >256
- cmp ax,[FP8_MinLineFreq]                   ;check if < MinLineFreq
+ cmp ax,[FP8_MinLineFreq-int10h]             ;check if < MinLineFreq
   jb End_FindBestClock
- cmp ax,[FP8_MaxLineFreq]                   ;check if > MaxLineFreq
+ cmp ax,[FP8_MaxLineFreq-int10h]             ;check if > MaxLineFreq
   ja End_FindBestClock
- mul [WORD FP8_1-int10h]                     ;for more precision 
+ mul [WORD K_1-int10h]                       ;convert to Hz
  div [WORD VT-int10h]                        ;find refresh_freq VT>256
- cmp ax,[FP8_MinRefresh]                    ;check if < MinRefresh
+ cmp ax,[FP8_MinRefresh-int10h]              ;check if < MinRefresh
   jb End_FindBestClock
- cmp ax,[FP8_MaxRefresh]                    ;check if > MaxRefresh
+ cmp ax,[FP8_MaxRefresh-int10h]              ;check if > MaxRefresh
   ja End_FindBestClock
  cmp ax,bp                                   ;check if better than best
-  jb End_FindBestClock
+  jbe End_FindBestClock
  mov bp,ax                                   ;if yes save as best
  mov cx,si                                   ;cx=si
- sub cx,offset(FP8_ClockTable-int10h)        ;get BYTE FP8_ClockTable[cx]
  shr cx,1                                    ;get WORD FP8_ClockTable[cx]
+ or ch,bl                                    ;ch=line_mult   cl=Clock_index
 End_FindBestClock:
  inc si
  inc si                                      ;inc clock_pointer
- cmp si,offset(FP8_ClockTable_end-int10h)    ;check if all clocks where tested
-  jb FindBestClock
- test bp,bp                                  ;check if nothing found
-  jz FindBest_nothing
- or ch,bl                                    ;ch=line_mult   cl=Clock_index
-FindBest_nothing:
+ cmp si,offset(FP8_ClockTable_end-FP8_ClockTable);check if all clocks where tested
+  jb FindBestClock                           ;error ?jbe
  jmp FindBest
 End_FindBest:
 
@@ -257,21 +262,23 @@ End_CheckSet:
  popa
 ret
 Not_End_CheckSet:
+; int 3
  mov al,ch                                   ;set ax= best line_mult
  cbw
  call FindSet_V                              ;set Vertical Nums (in mem)
 
- mov bx,  0000000001111111b                  ;set and/or start masks
+ dec ch                                      ;ERROR should be rewritten ch=Mult-1 (for MSL)
+ mov bx,  0000000001011111b                  ;set and/or start masks(+clear VBS)
  test [BYTE gm-int10h],1                     ;test if text
   jnz no_text2
-  cmp cl,2                                   ;check if *2 & text
+  cmp ch,1                                   ;check if *2 & text
    jne end_SetMSL
    mov bh,10000000b                          ;set cga like doubling
  jmp end_SetMSL                              ;and get out
 no_text2:
-  mov bl,cl                                  ;set and-mask
-  mov bh,cl                                  ;set or-mask
-  or  bl,01100000b                           ;correct and-mask
+  mov bl,ch                                  ;set and-mask
+  mov bh,ch                                  ;set or-mask
+  or  bl,01000000b                           ;correct and-mask(+clear VBS)
   and bh,00011111b                           ;correct or-mask (xor bx,xxx...!!! limit line_mult)
 end_SetMSL:
  and [MSL-int10h],bl                         
@@ -289,47 +296,46 @@ end_SetMSL:
  out dx,al                                   ;write VSE
  dec dx                        
 
- mov si,offset(where_V)-offset(int10h)        ;Read and convert Vga-Regs
- mov di,offset(what_V)-offset(int10h)
- mov bx,offset(Real2HSE_code)-offset(int10h)
+ and [BYTE OF-int10h],00010000b           ;clear everithing witch will be set 
+
+ mov si,offset(where_backward)-offset(int10h)  ;Read and convert Vga-Regs
+ mov di,offset(what_backward)-offset(int10h)   ;backwards (hehe)
+ mov bx,offset(Real2VBE_code)-offset(int10h)
+ std
 
 set_regs:
- lodsb                                      ;read index from table1
+ lodsb                                      ;read delta
+ cbw                                        ;convert it to 16-bit
+ add bx,ax                                  ;add it to bx
+ dec si                                     ;skip foreward info
+ lodsb                                      ;get index
  test al,al                                 ;check for sign bit
   js end_set_regs                           ;get out is set
  out dx,al                                  ;set index
  inc dx                                     ;dx= data_port
- inc si                                     ;skip xxx2real_code
- lodsb                                      ;get jmp_table_entry
- cbw                                        ;convert it to word
- add bx,ax                                  ;and add it to the last one
  in al,dx                                   ;read (only VSE needs that now)
  mov ch,al                                  ;put into ch
  mov ax,[di]                                ;get data
- inc di                                     ;add di,2
- inc di
+ dec di                                     ;sub di,2
+ dec di
  mov cl,1                                   ;cl=1 (needed for some codes)
  call bx                                    ;call it
  out dx,al                                  ;set data
  dec dx                                     ;dx=data_port
 jmp set_regs
 end_set_regs:
-
- mov al,7
- mov ah,[OF-int10h]
- out dx,ax                                  ;write OF 
-
+ cld
 
  pop ax
  push offset(End_CheckSet-int10h) ; for return later
-patch_code2:
+PatchClockCode2:
  xchg ax,bx
  mov ah,bl                     ;ah=bl=clock
  shl ah,2
  mov dl,LOW(MISC_INPUT)       ;dh=3!    dont read from mem (clock_probing)
  in al,dx                      ;al=MiscOutput
  mov dl,LOW(MISC_OUTPUT)       ;dh=3!
-patch_code:
+PatchClockCode:
 et4000_clock:
  and ax,0000110011110011b      
  or al,ah
@@ -386,72 +392,74 @@ et4000_clock:
  out dx,al                     ;ET4000 SUCKs
 
 ret
-patch_code_end:
-
+PatchClockCode_end:
+    db 0FFh                     ;end-marker  \
+    db 0FFh                     ;end-marker   > (for upwards thingy)
+    db 0FFh                     ;end-marker  /
 where:
+    db 011h                     ;VSE / Protect 
+    db offset(VSE2Real_code)-offset(VSE2Real_code)
+    db offset(Real2VSE_code)-offset(Real2OF_code)
     db 007h                     ;OF
-    db offset(OF2Real_code)-offset(OF2Real_code)
-    db offset(Real2OF_code)-offset(Real2OF_code)
+    db offset(OF2Real_code)-offset(VSE2Real_code)
+    db offset(Real2OF_code)-offset(Real2MSL_code)
+    db 009h                     ;MSL
+    db offset(MSL2Real_code)-offset(OF2Real_code)
+    db offset(Real2MSL_code)-offset(Real2HT_code)
     db 000h                     ;HT
-    db offset(HT2Real_code)-offset(OF2Real_code)
-    db offset(Real2HT_code)-offset(Real2OF_code)
+    db offset(HT2Real_code)-offset(MSL2Real_code)
+    db offset(Real2HT_code)-offset(Real2HDE_code)
     db 001h                     ;HDE
     db offset(HDE2Real_code)-offset(HT2Real_code)
-    db offset(Real2HDE_code)-offset(Real2HT_code)
+    db offset(Real2HDE_code)-offset(Real2HBS_code)
     db 002h                     ;HBS
     db offset(HBS2Real_code)-offset(HDE2Real_code)
-    db offset(Real2HBS_code)-offset(Real2HDE_code)
+    db offset(Real2HBS_code)-offset(Real2HBE_code)
     db 003h                     ;HBE
     db offset(HBE2Real_code)-offset(HBS2Real_code)
-    db offset(Real2HBE_code)-offset(Real2HBS_code)
+    db offset(Real2HBE_code)-offset(Real2HSS_code)
     db 004h                     ;HSS
     db offset(HSS2Real_code)-offset(HBE2Real_code)
-    db offset(Real2HSS_code)-offset(Real2HBE_code)
+    db offset(Real2HSS_code)-offset(Real2HSE_code)
     db 005h                     ;HSE 
     db offset(HSE2Real_code)-offset(HSS2Real_code)
-    db offset(Real2HSE_code)-offset(Real2HSS_code)
-where_V:
+    db offset(Real2HSE_code)-offset(Real2VT_code)
     db 006h                     ;VT
     db offset(VT2Real_code)-offset(HSE2Real_code)
-    db offset(Real2VT_code)-offset(Real2HSE_code)
-    db 009h                     ;MSL 
-    db offset(MSL2Real_code)-offset(VT2Real_code)
-    db offset(Real2MSL_code)-offset(Real2VT_code)
+    db offset(Real2VT_code)-offset(Real2VSS_code)
     db 010h                     ;VSS
-    db offset(VSS2Real_code)-offset(MSL2Real_code)
-    db offset(Real2VSS_code)-offset(Real2MSL_code)
-    db 011h                     ;VSE / Protect
-    db offset(VSE2Real_code)-offset(VSS2Real_code)
-    db offset(Real2VSE_code)-offset(Real2VSS_code)
+    db offset(VSS2Real_code)-offset(VT2Real_code)
+    db offset(Real2VSS_code)-offset(Real2VDE_code)
     db 012h                     ;VDE
-    db offset(VDE2Real_code)-offset(VSE2Real_code)
-    db offset(Real2VDE_code)-offset(Real2VSE_code)
+    db offset(VDE2Real_code)-offset(VSS2Real_code)
+    db offset(Real2VDE_code)-offset(Real2VBS_code)
     db 015h                     ;VBS
     db offset(VBS2Real_code)-offset(VDE2Real_code)
-    db offset(Real2VBS_code)-offset(Real2VDE_code)
+    db offset(Real2VBS_code)-offset(Real2VBE_code)
     db 016h                     ;VBE
     db offset(VBE2Real_code)-offset(VBS2Real_code)
-    db offset(Real2VBE_code)-offset(Real2VBS_code)
+where_backward:
+    db offset(Real2VBE_code)-offset(Real2VBE_code)
     db 0FFh                     ;end-marker
 what:
 SCM db ?
 CHR_Clock dw ?
 GM  db ?
 MR  db ?
+VSE dw ?
 OF  dw ?
+MSL dw ?
 HT  dw ?
 HDE dw ?
 HBS dw ?
 HBE dw ?
 HSS dw ?
 HSE dw ?
-what_V:
 VT  dw ?
-MSL dw ?
 VSS dw ?
-VSE dw ?
 VDE dw ?
 VBS dw ?
+what_backward:
 VBE dw ?
 LM  db ?
 LL  dw ?
@@ -462,14 +470,11 @@ HDE2Real_code:
  inc ax
 HBS2Real_code:
 HSS2Real_code:
- mov cl,[chr_clock-int10h]
- mul cl
+ mul [BYTE chr_clock-int10h]
 HBE2Real_code:                           ;IGNORE FOR NOW
 HSE2Real_code:                           ;IGNORE FOR NOW
 OF2Real_code:                            ;OK
 MSL2Real_code:                           ;OK
-VSE2Real_code:                           ;OK/NEVER USED
-VBE2Real_code:                           ;OK/NEVER USED (?REAL OK)
 ret
 
 VSS2Real_code:
@@ -478,24 +483,51 @@ VDE2Real_code:
  inc cx
 VT2Real_code:                            ;cl must be 1
  mov ah,[BYTE OF-int10h]
- shr ah,cl
- pushf
- shr ah,4
- popf
- rcl ah,1
- and ah,00000011b
+ shr ah,cl                               
+ pushf                                   
+ shr ah,4                                
+ popf                                    
+ rcl ah,1                                
+ and ah,00000011b                        
+VSE2Real_code:                           ;OK/NEVER USED
+VBE2Real_code:                           ;OK/NEVER USED (?REAL OK)
  inc ax
 ret
 
 VBS2Real_code:                          
  mov ah,[BYTE OF-int10h]
  mov ch,[BYTE MSL-int10h]
- shr ah,3
- shr ch,4
+ shr ah,3      
+ shr ch,4      
  and ah,00000001b
  and ch,00000010b
  or ah,ch
-;inc ax              ;??
+ inc ax
+ret
+
+Real2VSS_code:
+ inc cx
+Real2VDE_code:
+ inc cx
+Real2VT_code:                            ;cl must be 1
+ dec ax
+ shr ah,1
+ pushf                   
+ shl ah,4                     
+ popf                    
+ rcl ah,cl                  
+ or [BYTE of-int10h],ah
+ret
+
+Real2VBS_code:
+ dec ax
+ shl ah,3
+ mov ch,ah
+ and ah,00001000b        
+ or [BYTE OF-int10h],ah
+ shl ch,1                
+ and ch,00100000b        
+ or [BYTE MSL-int10h],ch
 ret
 
 Real2HT_code:
@@ -508,40 +540,23 @@ Real2HSS_code:
  div cl
 Real2HBE_code:                           ;IGNORE FOR NOW
 Real2HSE_code:                           ;IGNORE FOR NOW
+ pop ax
+ inc ax
+ push ax                                 ;increase ret ip (skip OUT DX,AL)
 Real2OF_code:                            ;OK/NEVER_Called
 Real2MSL_code:                           ;OK
-Real2VBE_code:                           ;OK
-ret
-
-Real2VSE_code:
-and al,00001111b                         ;only 0-3 are used
-and ch,01110000b                         ;preserve 4-6
-or  ch,10000000b                         ;set write-protect-bit
-or al,ch
 ret
 
-Real2VSS_code:
- inc cx
-Real2VDE_code:
- inc cx
-Real2VT_code:                            ;cl must be 1
+Real2VBE_code:                           ;OK
  dec ax
- shr ah,1
- pushf
- shl ah,4                    
- popf
- rcl ah,cl                   
- or [BYTE of-int10h],ah
 ret
 
-Real2VBS_code:
- shl ah,3
- mov ch,ah
- and ah,00001000b
- or [BYTE OF-int10h],ah
- shl ch,1
- and ch,00100000b
- or [BYTE MSL-int10h],ch
+Real2VSE_code:
+ dec ax
+ and al,00001111b                         ;only 0-3 are used
+ and ch,01110000b                         ;preserve 4-6
+ or ch,10000000b                          ;set write-protect-bit
+ or al,ch
 ret
 
 FindSet_V:
@@ -549,9 +564,9 @@ FindSet_V:
  mov [VDE-int10h],ax                         ; save(phys_lines) as new
  mov si,ax                                   ; save(phys_lines) in si
  push ax                                     ; save(phys_lines) to stack
- mul [WORD FPx_1p5-int10h]                   ; find 1.5%
+ mul [WORD FPx_bor-int10h]                   ; find right-border-lenght
  div [WORD FPx_1_-int10h]                    ;could be replaced by shrd
- mov bp,ax                                   ; save 1.5% in bp
+ mov bp,ax                                   ; save in bp
  add si,ax                                   ; add to old phys
  mov [VBS-int10h],si                         ; save in VBS
  inc si                                      ; inc it
@@ -567,29 +582,33 @@ FindSet_V:
  div [WORD FPx_1_-int10h]                    ;could be replaced by shrd
  add si,ax                                   ;add it
  mov [VBE-int10h],si                         ; save in VBE
- add si,bp                                   ;add 1.5%
+ add si,bp                                   ;add left-border-lenght
  mov [VT-int10h],si                          ; save in VT
 ret
 
+K_1             dw 1000
 
-FP8_1            dw 256
+PatchArgs:
+FP8_1           dw 256
 FP8_MinRefresh  dw 60 shl 8
 FP8_MaxRefresh  dw 90 shl 8            
 FP8_MinLineFreq dw 28 shl 8            
 FP8_MaxLineFreq dw 72 shl 8            
                                         
-FP8_ClockTable   dw 32 dup (?)          
-FP8_ClockTable_end:
-
 FPx_1_  dw FPx_1
-
-FPx_1p5 dw FPx_1/67              ;1/.015=67
+FPx_bor dw FPx_1/67              ;1/.015=67
 FPx_VS  dw FPx_1/200             ;1/.005=200
 FPx_VB  dw FPx_1*7/100           ;1/.070=(100/7)
 
+MaxLines        dw 1023
+MinLines        dw 300
+PatchArgs_End:
+
+
+FP8_ClockTable   dw 128 dup (?)
+FP8_ClockTable_end:
+
 clock_d  db 0
-MaxLines dw 1023
-MinLines dw 300
 
 counter  db delay2
 temp db 0
@@ -602,126 +621,197 @@ install:
  cld                              ;clear dir_falg
  mov dx,offset(c_r)               ;dx=offset(copy-right)
  call wstring                     ;write it to screen
- mov si,80h                       ;si=offset(Num_ComLineArgs)
+
+ call chk_600                    ;check if installed (copy info from tsr)
+  jne NOT_Read
+  mov ds,bx                      ;es=cs of TSR
+  mov si,offset(PatchArgs)-offset(int10h)
+  mov di,offset(PatchArgs)
+  mov cx,PatchArgsSize
+  rep movsb                      ;Copy TSR Variables
+  mov al,[offset(CheckSet)-int10h];get En/Disable state
+  mov [cs:offset(CheckSet)],al   ;set En/Disable state
+NOT_Read:
+
+                                  ;Find corr path to executable
+ mov ds,[cs:02Ch]                 ;ds=EnvSeg
+ mov si,1                         
+ mov di,offset(FP8_ClockTable)    ;si=Temp Buffer
+GetPath_Loop:
+ dec si
+ lodsw
+ test ax,ax                       ;find 0,0
+  jnz GetPath_Loop
+ lodsw                            ;skip 2
+GetPath_Copy:
+ lodsb                            ;copy until 0
+ stosb
+ cmp al,'.'
+  jnz GetPath_NDot
+  mov bx,di                       ;bx=last .
+GetPath_NDot:
+ test al,al
+  jnz GetPath_Copy
+ push cs
+ pop ds                           ;restore ds
+ mov [WORD bx+1],'KL'             ;fix COM -> CLK
+
+
+
+ mov di,80h                       ;di=offset(Num_ComLineArgs)
  mov ch,0
- mov cl,[si]                      ;cx=Num_ComLineArgs
- inc si                           ;si=offset(ComLineArgsBuffer)
+ mov cl,[di]                      ;cx=Num_ComLineArgs
+ inc di                           ;di=offset(ComLineArgsBuffer)
  or cx,cx                         ;check if nothing there
-  jz Unk_Command
+  jz MSG_UnkCommand
+ add cx,di                        ;cx=ComLineEndPointer
  xor bp,bp                        ;set nothing_Specified
 
-SkipSpace:
- lodsb                            ;fetch 1-byte from ComLine
- cmp al,' '                       ;check if space
-loope SkipSpace                   ;loop until no space
- je nUnk_Command                  ;check if not at end
- test bp,bp                       ;check if no_VgaCardSpecified
-  jnz ComLineOK
-Unk_Command:                      ;print error-msg and exit
-  mov dx,offset(u_c)
-  call wstring
- int 20h
-nUnk_Command:
+
+CommLine:
+ call SkipSpace
+ mov al,[di]                      ;fetch byte from CommLine
+ inc di                           ;and inc pointer
 
  cmp al,'/'                       ;check if CommLineArg starts with /
   jz Ok_Comm                      ;go on if so
  cmp al,'-'                       ;check if CommLineArg starts with -
-  jnz Unk_Command                 ;get out if not
-Ok_Comm
+  jnz MSG_UnkCommand              ;get out if not
+Ok_Comm:
 
- mov di,si
  mov si,offset(CommLineOptionsTable)
- mov bx,offset(CLO_Enable)
+ mov bx,offset(CLO_Enable)            
 Next_CommLineArg:
+ cmp [BYTE si],0                       ;check if end of table reached
+  je MSG_UnkCommand
  push di                          ;Save di
 Next_CommLineArgByte:
  lodsb                            ;fetch byte from table
- or al,00100000b                  ;conv to lower-case
+ or [BYTE di],00100000b           ;conv to lower-case
  scasb                            ;compare if same at CommLine
   je Next_CommLineArgByte         ;if yes check next
- test al,al                       ;check if end reached
-  jnz Unk_Command                 ;SP not restored !
- dec di                           ;in case "/A1" instaed of "/A 1"
- mov al,' '
-Check_Space:
- scasb                            ;skip spaces
-  je Check_Space
- dec di
+ test al,al                       ;check if CommLineEqual
+  jz CommLineArgId                
+SkipTillZeroP1:
+ lodsb                            ;fetch next from Table
+ test al,al                       ;check if zero
+  jnz SkipTillZeroP1              
+ lodsb                            ;get call address from table
+ cbw                              ;convert to word
+ add bx,ax                        ;add to last
+ pop di                           ;di=old di
+jmp Next_CommLineArg
+CommLineArgId:
+
+ dec di                           ; for /V1 instaed of /V 1
  lodsb                            ;get call address from table
  cbw                              ;convert to word
  add bx,ax                        ;add to last
  call bx                          ;call it
  cbw                              ;convert to word
  or bp,ax                         ;set bit in bp
- pop di                           ;restore di
- lodsb                            ;fetch next
- dec di                           ;restore di
- test al,al                       ;check if end reached
-  jnz Next_CommLineArg
-jmp SkipSpace                     ;get next CommLineArg from CommLine
-CommLineOk:
+ pop ax                           ;corr stack
+jmp CommLine                      ;get next CommLineArg from CommLine
+
+EndCommLine:
+ test bp,bp                       ;check if no_VgaCardSpecified
+  jnz ComLineOK
+MSG_UnkCommand:                   ;print error-msg and exit
+  mov dx,offset(u_c)
+ jmp estring
+
+ComLineOk:
 
  push bp                          ;save bp
  shr bp,2                         ;remove OptionFlag and VgaCardSpecifiedFlag
+ test bp,bp                       ;check if zero (CRASH) 
+  jz ZERO_BP                      ;don't shr if yes
 CheckLine:
  shr bp,1                         ;remove rightmost flag
-  jnc CheckLine:                  ;if flag was 0 try next
+  jnc CheckLine                   ;if flag was 0 try next
+ZERO_BP:
  test bp,bp                       ;if not zero then error
-  jnz UnkCommand
+  jnz MSG_UnkCommand
  pop bp                           ;restore bp
 
  mov ax,bp                       ;ax=bp
- xor ah,al                       ;(ah=0) ah=~al
+ mov ah,al
+ not ah                          ;ah=~al
  cmp  al,00010000b               ;Check for UnInstall
   je UnInstall
  cmp  al,00100001b               ;Check for Probe(and vga_card)
-  je Probe
- test ax,0000000111111100b       ;Check for VgaCard w/o other stuff
+  je Probe2
+ test ax,0000000111110000b       ;Check for VgaCard/Options/E/D w/o other stuff
   jz GoTSR
  test al,11110001b               ;Check for Enable/Disable/options w/o other stuff
-  jz PassToTSR
- jmp UnkCommand
+  jnz MSG_UnkCommand
+ jmp PassToTSR
+Probe2:
+jmp Probe
 
+UnInstall:
+ call chk_600                     ;check if installed
+  je nMSG_NotInstalled
+MSG_NotInstalled:                 ;print "Not Installed"
+  mov dx,offset(n_i)
+ jmp estring
+nMSG_NotInstalled:
+push bx
+ mov ax,3510h
+ int 21h                          ;get int 10
+ pop bx
+ push bx                          ;bx=cs of TSR
+ mov ax,es                        ;ax=cs of Int10 Handler
+ cmp ax,bx                        ;check if equal
+  je nMSG_CantUnload              ;get out if not
+MSG_CantUnload:                   ;print "Not Installed"
+  mov dx,offset(n_u)
+ jmp estring
+nMSG_CantUnload:
 
- cmp al,33h
-  ja Unk_Command
- sub al,30h
-  jb Unk_Command
- push si
-  mov ah,0
-  xchg ax,bx
-  add bx,bx                ;shl bx,1
-  mov si,[WORD bx+code_table]
-  mov di,offset(patch_code)
-  mov cx,patch_size
-  rep movsb                      ;copy clock_code 
- pop si
+ mov ax,3508h
+ int 21h                          ;get int 8
+ pop bx                           ;bx=cs of TSR
+ mov ax,es                        ;ax=cs of Int8 Handler
+ cmp ax,bx                        ;check if equal
+  jne MSG_CantUnload              ;get out if not
 
- call chk_600
-  jne nalready_installed
-  mov dx,offset(p_a)
-  call wstring
-  mov es,bx
-  cli
-  mov di,offset(patch_code)-int10h
-  mov si,offset(patch_code)
-  mov cx,patch_size
-  rep movsb                                ;Update TSR Variables
- int 20h
+ mov dx,[es:offset(old_int10h)-int10h]
+ mov ds,[es:offset(old_int10h)-int10h+2]
+ mov ax,2510h
+ int 21h            ;set old int 10
+ mov dx,[es:offset(old_int8h)-int10h]
+ mov ds,[es:offset(old_int8h)-int10h+2]
+ mov ax,2508h
+ int 21h            ;set old int 8
+ mov ah,49h
+ int 21h            ;free mem
+int 20h
 
-enable_disable:
- call chk_600
-  je nnot_inst
-  jmp not_inst
-nnot_inst:
-  mov dx,offset(p_a)
-  call wstring
-  mov es,bx
-  mov al,[offset(CheckSet)]
-  mov [es:CheckSet-int10h],al
- int 20h
+GoTSR:
+ call chk_600                    ;check if installed
+  jne n2MSG_AlreadyInstalled
+  jmp MSG_AlreadyInstalled
+n2MSG_AlreadyInstalled:
 
-nalready_installed:
+ mov ax,3D00h                    ;open file for read
+ mov dx,offset(FP8_ClockTable)   ;CorrPath\vga600.clk
+ int 21h
+  jnc nMSG_FileError2
+MSG_FileError2:
+  mov dx,offset(f_e)
+ jmp estring
+nMSG_FileError2:
+ xchg ax,bx                      ;bx=file_handle
+
+ mov ah,3Fh                      ;read from file
+ mov dx,offset(FP8_ClockTable)   ;into ClockTable
+ mov cx,128*2                    ;128 Words
+ int 21h
+  jc MSG_FileError2
+
+ mov ah,3Fh
+ int 21h                         ;and close it
 
  mov ax,3510h
  int 21h                       ;get old int 10
@@ -733,20 +823,20 @@ nalready_installed:
  mov [offset(old_int8h)],bx
  mov [offset(old_int8h)+2],es
 
- mov sp,offset end_all+0FEh
+ mov sp,offset end_all+0FEh    ;shrink stack (less mem needed)
 
  push cs
- pop es
+ pop es                        ;es=cs
  mov ah,04Ah
  mov bx,paras_all+010h
- int 21h                       ;resize us 
+ int 21h                       ;shrink us
   jc mem_error 
 
  mov ah,048h                   ;!BX=paras_all+10h
  int 21h                       ;allocate mem for copy
   jc mem_error                  
 
- mov es,ax
+ mov es,ax                     ;es=cs of copy
  mov cx,offset end_all+0100h
  xor di,di
  xor si,si
@@ -756,41 +846,45 @@ nalready_installed:
  push offset cool_jmp
  retf                         ;mov cs,es 
 
-cool_jmp:                     ;
+cool_jmp:                     ;Now We are in the Copy
  push cs
- pop ss                    ;and the stack
+ pop ss                       ;and the stack Too
 
  mov ax,ds
- cmp [016h],ax
+ cmp [016h],ax                ;check if parent process seg addr old=oldcs
   jne ok2
- mov [es:016h],es
+ mov [es:016h],es             ;if yes set parent process seg addr new=newcs
 ok2:
- cmp [034h+2],ax
+ cmp [034h+2],ax              ;check if handle array pointer old=oldcs
   jne ok3
- mov [es:034h+2],es
+ mov [es:034h+2],es            ;if yes set handle array pointer new=newcs
 ok3:                          
 
  mov ah,50h
- mov bx,cs
- int 21h                     ;set addr of PSP
+ mov bx,cs                     ;bx=cs of copy
+ int 21h                       ;set addr of PSP
+
+ mov ax,cs
+ dec ax
+ mov es,ax                     ;es=cs-1 (MCB-Seg)
+ mov [es:1],cs                 ;set seg to itself
 
  push ds
  pop es
  mov ah,49h
- int 21h                      ;get rid of the old shit
+ int 21h                       ;get rid of the old shit
 
- mov ax,cs
- mov ds,ax
- dec ax
- mov es,ax
- mov [es:1],ds                 ;set seg to itself
+ push cs
+ pop ds                        ;ds=cs
 
  mov es,[2ch]                  ;es=env-seg
+ mov ah,49h                    ;free memory
+ int 21h                       ;free env-seg
  mov bx,paras
- mov ah,4ah
- int 21h                       ;resize env
- cmp bx,paras
-  je nmem_error
+ mov ah,48h                    ;alloc memory
+ int 21h                       ;alloc new seg
+ mov es,ax                     ;es=seg of new seg
+  jnc nmem_error
 mem_error:
   mov dx,offset(m_e)
   call wstring
@@ -816,192 +910,265 @@ nmem_error:
 
 exit_load:
  push cs
- pop es
- mov ah,49h
- int 21h                      
+ pop es                        ;es=cs
+ mov ah,49h                    ;free mem
+ int 21h                       ;free us (hope that doesnt kill us)
 mov ah,04ch
 int 21h                        ;get out (cool TSR)
 
-unload:
- call chk_600
-  je nnot_installed
-not_inst:
-  mov dx,offset(n_i)
-  call wstring
- int 20h
-nnot_installed:
- push bx
- mov ax,3510h
- int 21h             ;get int 10
- pop bx
- push bx
- mov ax,es
- cmp ax,bx
-  jne not_unload
-
- mov ax,3508h
- int 21h             ;get int 8
- pop bx
- mov ax,es
- cmp ax,bx
-  jne not_unload
-
- mov dx,[es:offset(old_int10h)-int10h]
- mov ds,[es:offset(old_int10h)-int10h+2]
- mov ax,2510h
- int 21h            ;set old int 10
- mov dx,[es:offset(old_int8h)-int10h]
- mov ds,[es:offset(old_int8h)-int10h+2]
- mov ax,2508h
- int 21h            ;set old int 8
- mov ah,49h
- int 21h            ;free mem
-int 20h
 
-not_unload:
- mov dx,offset(n_u)
- call wstring
-int 20h
+PassToTSR:
+ call chk_600                    ;check if installed
+  je n2MSG_NotInstalled
+  jmp MSG_NotInstalled
+n2MSG_NotInstalled:
+  mov dx,offset(p_a)             ;print "passing arguments to TSR"
+  call wstring
+  mov es,bx                      ;es=cs of TSR
+  cli                            ;better 
+  mov di,offset(PatchArgs)-offset(int10h)
+  mov si,offset(PatchArgs)
+  mov cx,PatchArgsSize
+  rep movsb                      ;Update TSR Variables
+  mov al,[offset(CheckSet)]      ;get En/Disable state
+  mov [es:CheckSet-int10h],al    ;set En/Disable state
+ int 20h                         ;get OUT
 
 probe:
  call chk_600
-  jne nprobeerror
+MSG_AlreadyInstalled:
+MSG_ProbeError:
+  jne nMSG_ProbeError
   mov dx,offset(p_e)
-  call wstring
-; int 20h
-nprobeerror:
+ jmp estring
+nMSG_ProbeError:
 
  mov ax,0013h
- int 10h   
+ int 10h                                ;set 320x200 (must be 25MHz)
 
- mov ax,3508h
- int 21h                       ;get old int 8
- mov [offset(old_int8xh)],bx
- mov [offset(old_int8xh)+2],es
+ call GetVSyncTime                      ;wait for end
+ call GetVSyncTime                      ;get Time
+ mov bp,1
+Probe_FindShift:                        ;BitScan
+ shl bp,1                               ;Double Divider
+ shr dx,1                               ;32bit shift
+ rcr ax,1
+ test dx,dx                             ;max 16bit
+  jnz Probe_FindShift
+ cmp ax,01000h                          ;max 25*16Mhz
+  jae Probe_FindShift
 
- mov dx,offset(int8_probe)
- mov ax,2508h
- int 21h                       ;set new int 8
 
+
+;MSG_InterError:                         ;print error-msg and exit
+;  mov dx,offset(d_e)
+; jmp estring
+
+ xchg bx,ax                             ;bx=lenght of refresh at 25Mhz
+
+ mov dx,offset(FP8_ClockTable)
+ xor cx,cx
+ mov ah,3Ch                            ;create file
+ int 21h
+  jnc nMSG_FileError
+MSG_FileError:                         ;print error-msg and exit
+  mov dx,offset(f_e)
+  jmp estring
+nMSG_FileError:
+ push ax                               ;save handle
+
+ mov si,dx
  xor di,di
- mov si,offset FP8_ClockTable
 
 probe_loop:
- mov ax,di
- call patch_code2
+ pusha                                  ;save regs
+ xchg ax,di                             ;ax=clock
+ mov dh,3                               
+ call PatchClockCode2                   ;set clock
+ popa                                   ;restore regs
 
- mov [WORD int8_counter],-1
-syncint8:
- cmp [WORD int8_counter],0
-  js syncint8
+ call GetVSyncTime                      ;wait for end
+ call GetVSyncTime                      ;get Time for refresh at 25.175Mhz
+ div bp                                 
 
- call waitvret
- xor cx,cx
-wait_loop:
- call waitvret
- inc cx
- cmp [WORD int8_counter],18
-  jb wait_loop
- shl cx,6   ;mul cx,64
- xchg ax,cx
- mov cl,179
- div cl
- mov [si],al
+ xchg cx,ax                             ;cx=lenght of refresh
+ mov ax,bx                              ;ax=lenght of refresh at 25Mhz
+ mov dx,6445                            ;25.175*256=6444.8
+ mul dx
+ div cx                                 ;ax=FP8_Clock
+
+ mov [si],ax                            ;save it
+ inc si                                 ;inc pointer
  inc si
- inc di
- cmp di,32
+ inc di                                 ;inc clock num
+ cmp di,128                              ;check if end
   jb probe_loop
-end1:
 
- mov ax,0003h
+ mov ax,0003h                           ;set text mode 3
  int 10h   
 
- mov si,offset FP8_ClockTable
+ pop bx                                  ;bx=FileHandle
 
- mov cx,32
-print_loop:
- test cl,111b
-  jnz no_crlf
- mov dx,offset crlf
- call wstring
-no_crlf:
- mov ah,0
- mov al,[si]
- inc si
- call wdez
- mov dx,offset Mhz
- call wstring
- loop print_loop
-end_print:
+ mov ah,40h                              ;write to file
+ mov cx,128*2                            ;how many bytes
+ mov dx,offset FP8_ClockTable            ;from where
+ int 21h
+  jc MSG_FileError
 
+ mov ah,3Fh
+ int 21h
+int 20h
 
 
- mov dx,[offset(old_int8xh)]
- mov ds,[offset(old_int8xh)+2]
- mov ax,2508h
- int 21h                       ;set old int 8
+GetVSyncTime:                      ;dx:ax=ticks for V-Refresh
+ push cx
+ mov cx,ProbeTimes
+ xor ax,ax
+ xor dx,dx
+WaitVSync:
+   add ax,1                         ;inc di:si
+   adc dx,0
+   cmp dx,ProbeTimes*64              ;check if to big
+    ja GetVSyncTimeEnd0
+   push dx
+   push ax
+   mov dx,03dah
+   in al,dx                         ;get data
+   test al,1000b                     ;mask v-sync-bit
+   pop ax
+   pop dx
+  jz WaitVSync                      
+WaitVEndSync:
+   add ax,1                         ;inc di:si
+   adc dx,0
+   cmp dx,ProbeTimes*64             ;check if too big
+    ja GetVSyncTimeEnd0
+   push dx
+   push ax
+   mov dx,03dah
+   in al,dx                         ;get data
+   test al,1000b                    ;mask v-sync-bit
+   pop ax
+   pop dx
+  jnz WaitVEndSync
+ loop WaitVSync 
+GetVSyncTimeEnd0:
+ pop cx
+ret
 
+estring:
+ call wstring
 int 20h
 
-waitvret:
- pusha
- mov dx,03dah
-waitsvret:
-  in al,dx
-  mov cl,1000b
-  and al,cl
- loope waitsvret
-waitevret:
-  in al,dx
-  mov cl,1000b
-  and al,cl
- loopne waitevret
- popa
+wstring:
+ mov ah,09h
+ int 21h                                 ;print string
 ret
 
-int8_probe:
- inc [WORD cs:int8_counter]
-db 0eah
-old_int8xh dd 0
+;wchar:
+; mov ah,02h
+; int 21h                                 ;print string
+;ret
 
-wstring:
- mov ah,09h
- int 21h
+;SetNumHex:
+; ror ax,12                             ;4 MSB of ax ->al
+; mov cx,4
+;SetNumHex_Next:
+; push ax                               ;save it
+; and al,0Fh                            
+; add al,030h                           ; conv to ascii
+; cmp al,03Ah                           ; check if A-F
+;  jl SetNumHex_NoChar
+; add al,7                              ; conv to ascii (A-F)
+;SetNumHex_NoChar:
+; xchg ax,dx                            ;put in dx
+; call wchar                            ; write it
+; pop ax                                ;restore old
+; rol ax,4                              ; rol to next
+;  loop SetNumHex_Next                  ; loop if not all written
+;ret
+
+GetNum:                                  ;ds:di !!
+ call SkipSpace
+ push dx
+ push bx                                 ;save bx/dx
+ mov bh,0
+ xor ax,ax                               ;bh/ax=0
+ mov dh,0FFh                             ;check if num exist (mul resets dx=0)
+GetNum_NextByte:
+ mov bl,[di]                             ;bl=ASC(num)
+ cmp bl,' '                              ;check for space
+  je GetNum_End
+ cmp di,cx
+  jae GetNum_End
+ inc di
+ sub bl,30h                              ;bl=num /check for <30h
+  jb xMSG_UnkCommand
+ cmp bl,9                                ;check for >39h
+  ja xMSG_UnkCommand                      
+ mul [n10]                               ;ax=OldNum*10
+ add ax,bx                               ;ax=OldNum*10+Num
+jmp GetNum_NextByte
+GetNum_End:
+ test dh,dh                              ;check if anything there
+  jz n2MSG_UnkCommand
+xMSG_UnkCommand:
+  jmp MSG_UnkCommand
+n2MSG_UnkCommand:
+ pop bx                                  ;restore bx/dx
+ pop dx                                  ;end
 ret
 
-wdez:
- pusha
- mov di,ax
- mov cx,5
- mov si,10000
- mov bx,10
-dez_loop:
- xor dx,dx
- div si
+GetNumFP8:                                ;ds:di !!
+ call SkipSpace
  push dx
- cmp cx,1
-  je nnope
- cmp dx,di
-  je nope
-nnope:
- xchg ax,dx
- mov ah,2
- add dl,30h
- int 21h
-nope:
- xchg si,ax
- xor dx,dx
- div bx
- xchg si,ax
- pop ax
-loop dez_loop
- popa
+ push bx
+ push bp                                  ;save bx/dx/bp/si
+ push si
+ mov bh,0
+ xor ax,ax                                ;ch/ax=0
+ mov bp,1
+ mov si,bp                                ;si=bp=1
+ mov dh,0FFh                             ;check if num exist (mul resets dx=0)
+GetNumFP8_NextByte:
+ mov bl,[di]                             ;bl=ASC(num)
+ cmp bl,' '                              ;check for space
+  je GetNumFP8_End
+ cmp di,cx
+  jae GetNumFP8_End
+ cmp bl,'.'
+  jne GetNumFP8_NotDot
+ mov si,10
+ inc di
+ jmp GetNumFP8_NextByte
+GetNumFP8_NotDot:
+ inc di
+ sub bl,30h                              ;bl=num /check for <30h
+  jb xMSG_UnkCommand
+ cmp bl,9                                ;check for >39h
+  ja xMSG_UnkCommand                      
+ xchg ax,bp
+ mul si
+ xchg ax,bp                              ;mul bp,si
+ mul [n10]                               ;ax=OldNum*10
+ add ax,bx                               ;ax=OldNum*10+Num
+jmp GetNumFP8_NextByte      
+GetNumFP8_End:
+ test dh,dh                              ;check if anything there
+  jnz xMSG_UnkCommand
+ mul [FP8_1]
+ div bp
+ pop si
+ pop bp
+ pop bx                                  ;restore bx/dx/bp/si
+ pop dx                                  ;end
 ret
 
+
 chk_600:
  mov ax,020FFh
  int 10h
- cmp ax,00600h
+ cmp ax,00600h                            ;if equal vga600 already installed
 ret
 
 vga_clock:
@@ -1038,12 +1205,6 @@ s3_clock:
  out dx,al
 ret
 
-alt_vga_clock:
- and ax,0001110011100011b      
- or al,ah
- out dx,al                             ;0-2
-ret
-
 CLO_Enable:
  mov [BYTE CheckSet],060h              ;set first oppcode to pusha
  mov al,00000100b                      ;set Enable-Flag
@@ -1055,10 +1216,23 @@ CLO_Disable:
 ret
 
 CLO_VgaCard:
+ call GetNum                           ;Get Number
+ pusha
+ cmp ax,2                              ;check if >2
+  jna OK_VgaCardNum
+  jmp MSG_UnkCommand                   ;get out if yes
+OK_VgaCardNum:
+ shl ax,1                              ;*2
+ xchg ax,si                            ;si=num*2 
+ mov si,[si+offset(ClockCodeTable)]    ;si=ClockCodeTable[num*2]
+ mov di,offset(PatchClockCode)         
+ mov cx,PatchCodeSize
+ rep movsb                             ;copy NewClockCode to PatchClockCode
+ popa
  mov al,00000001b                      ;set Vga_card_specified-flag
 ret
 
-CLO_UnInstatll:
+CLO_UnInstall:
  mov al,00010000b                      ;set UnInstall-Flag
 ret
 
@@ -1102,37 +1276,95 @@ CLO_MinLines:
  mov al,00000010b                       ;set Options-Flag
 ret
 
+CLO_Border:
+ call GetNumFP8
+ pusha
+ mov bx, (FPx_1/256)
+ mul bx
+ mov bx, 100
+ div bx
+ mov [FPx_bor],ax
+ popa
+ mov al,00000010b                       ;set Options-Flag
+ret
+
+CLO_VSync:
+ call GetNumFP8
+ pusha
+ mov bx, (FPx_1/256)
+ mul bx
+ mov bx, 100
+ div bx
+ mov [FPx_VS],ax
+ popa
+ mov al,00000010b                       ;set Options-Flag
+ret
+
+CLO_VBlank:
+ call GetNumFP8
+ pusha
+ mov bx, (FPx_1/256)
+ mul bx
+ mov bx, 100
+ div bx
+ mov [FPx_VB],ax
+ popa
+ mov al,00000010b                       ;set Options-Flag
+ret
+
+SkipSpace:                        ;!DS:DI
+ push ax
+ mov al,' '
+Check_Space:
+ scasb                            ;skip spaces
+  je Check_Space
+ dec di
+ pop ax
+ cmp di,cx
+  jae PopEndCommLine
+ret
+PopEndCommLine:
+pop ax
+jmp EndCommLine
+
 int8_counter dw 0
 
-code_table:
+n10 dw 10
+
+ClockCodeTable:
  dw offset(vga_clock)
  dw offset(et4000_clock)
  dw offset(s3_clock)
- dw offset(alt_vga_clock)
 
 CommLineOptionsTable:
- db 'e',0,offset(CLO_Enable)-offset(CLO_Enable)
- db 'd',0,offset(CLO_Disable)-offset(CLO_Enable)
- db 'v',0,offset(CLO_VgaCard)-offset(CLO_Disable)
- db 'u',0,offset(CLO_UnInstall)-offset(CLO_VgaCard)
- db 'p',0,offset(CLO_Probe)-offset(CLO_UnInstall)
+ db 'e',0,offset(CLO_Enable)       -offset(CLO_Enable)
+ db 'd',0,offset(CLO_Disable)      -offset(CLO_Enable)
+ db 'v',0,offset(CLO_VgaCard)      -offset(CLO_Disable)
+ db 'u',0,offset(CLO_UnInstall)    -offset(CLO_VgaCard)
+ db 'p',0,offset(CLO_Probe)        -offset(CLO_UnInstall)
  db 'alf',0,offset(CLO_MaxLineFreq)-offset(CLO_Probe)
  db 'ilf',0,offset(CLO_MinLineFreq)-offset(CLO_MaxLineFreq)
- db 'ar',0,offset(CLO_MaxRefresh)-offset(CLO_MinLineFreq)
- db 'ir',0,offset(CLO_MinRefresh)-offset(CLO_MaxRefresh)
- db 'al',0,offset(CLO_MaxLines)-offset(CLO_MinRefresh)
- db 'il',0,offset(CLO_MinLines)-offset(CLO_MaxLines)
+ db 'ar',0,offset(CLO_MaxRefresh)  -offset(CLO_MinLineFreq)
+ db 'ir',0,offset(CLO_MinRefresh)  -offset(CLO_MaxRefresh)
+ db 'al',0,offset(CLO_MaxLines)    -offset(CLO_MinRefresh)
+ db 'il',0,offset(CLO_MinLines)    -offset(CLO_MaxLines)
+ db 'bo',0,offset(CLO_Border)      -offset(CLO_MinLines)
+ db 'ys',0,offset(CLO_VSync)       -offset(CLO_Border)
+ db 'yb',0,offset(CLO_VBlank)      -offset(CLO_VSync)
  db 0
 
 c_r db 'VGA600 ver 0.6 Beta Copyright (C) Michael Niedermayer 1997',cr,lf,'$'
 u_c db 'VGA600 <options>|/U|/E|/D|/P',cr,lf
     db ' options: /V n   (VgaCard)     0=VGA 1=ET4000 2=S3(untested)',cr,lf
-    db '          /ALF n (MaxLineFreq) default=0',cr,lf
-    db '          /ILF n (MinLineFreq) default=28',cr,lf
-    db '          /AR n  (MaxRefresh)  default=70',cr,lf
-    db '          /IR n  (MinRefresh)  default=60',cr,lf
-    db '          /AL n  (MaxLines)    default=480',cr,lf
-    db '          /IL n  (MinLines)    default=300',cr,lf
+    db '          /ALF n (MaxLineFreq)    default=0.0',cr,lf
+    db '          /ILF n (MinLineFreq)    default=28.0',cr,lf
+    db '          /AR n  (MaxRefresh)     default=70.0',cr,lf
+    db '          /IR n  (MinRefresh)     default=60.0',cr,lf
+    db '          /AL n  (MaxLines)       default=480',cr,lf
+    db '          /IL n  (MinLines)       default=300',cr,lf
+    db '          /BO n  (Border)         default=1.5',cr,lf
+    db '          /YS n  (Vertical-Sync)  default=0.5',cr,lf
+    db '          /YB n  (Vertical-Blank) default=7.0',cr,lf
     db '          /E     (Enable)',cr,lf
     db '          /D     (Disable)',cr,lf
     db '          /P     (Probe for PixelClocks)',cr,lf
@@ -1142,9 +1374,8 @@ n_u db 'VGA600 is not unloadable!',cr,lf
 m_e db 'Mem allocating error!',cr,lf,'$'
 p_a db 'Passing arguments to TSR!',cr,lf,'$'
 p_e db 'Uninstall VGA600 first!',cr,lf,'$'
-Mhz db 'Mhz $'
-crlf db cr,lf,'$'
-
+d_e db 'Internal Error!',cr,lf,'$'
+f_e db 'Clock Data File Access Error!',cr,lf,'$'
 end_all:
 ends
 end start



More information about the Mndiff-dev mailing list