Removed some DOS only code from other ports.
This commit is contained in:
@@ -38,7 +38,7 @@ EXTSYM DSPDisable,SBInt,PICMaskP,SBIrq,SBHandler,InitSB,handler8h
|
||||
EXTSYM handler9h,init60hz,Interror,init18_2hz,DeInitSPC,GUIinit36_4hz
|
||||
EXTSYM GUIoldhand9s,GUIoldhand9o,GUIoldhand8s,GUIoldhand8o,GUIhandler9h
|
||||
EXTSYM GUIhandler8h,GUIinit18_2hz,dosmakepal,doschangepal,dosinitvideo
|
||||
EXTSYM dosinitvideo2,DosDrawScreen,cvidmode,vidbuffer,GUICPC,DosDrawScreenB
|
||||
EXTSYM DosDrawScreen,cvidmode,vidbuffer,GUICPC,DosDrawScreenB
|
||||
EXTSYM DOSClearScreen,DosUpdateDevices,DOSJoyRead,pl1contrl,pl2contrl,pl3contrl
|
||||
EXTSYM pl4contrl,pl5contrl
|
||||
EXTSYM GrayscaleMode
|
||||
@@ -871,8 +871,6 @@ NEWSYM saveselectpal
|
||||
; ** init video mode functions **
|
||||
NEWSYM initvideo ; Returns 1 in videotroub if trouble occurs
|
||||
jmp dosinitvideo
|
||||
NEWSYM initvideo2 ; ModeQ scanline re-init (Keep blank on non-dos ports)
|
||||
jmp dosinitvideo2
|
||||
NEWSYM deinitvideo
|
||||
mov al,[previdmode]
|
||||
mov ah,0
|
||||
|
||||
@@ -22,23 +22,13 @@
|
||||
|
||||
%include "macros.mac"
|
||||
|
||||
EXTSYM InitVesa2,cbitmode,cvidmode,makepal,scanlines,selcA000,vesa2_bits
|
||||
EXTSYM vesa2_x,vesa2_y,vesa2selec,InitVesa12,videotroub
|
||||
|
||||
%ifdef __MSDOS__
|
||||
EXTSYM cscopymodeq,cscopymodex
|
||||
%endif
|
||||
|
||||
SECTION .bss
|
||||
|
||||
NEWSYM clearfilter, resw 1
|
||||
NEWSYM res640, resb 1
|
||||
NEWSYM res480, resb 1
|
||||
EXTSYM InitVesa2,cbitmode,cvidmode,dosmakepal,scanlines,selcA000,vesa2_bits
|
||||
EXTSYM vesa2_x,vesa2_y,vesa2selec,InitVesa12,videotroub,cscopymodeq,cscopymodex
|
||||
EXTSYM res640,res480
|
||||
|
||||
|
||||
SECTION .text
|
||||
|
||||
NEWSYM dosinitvideo2
|
||||
NEWSYM initvideo2
|
||||
cmp byte[cvidmode],2
|
||||
jne .nomodeq
|
||||
jmp dosinitvideo.initmodeq256
|
||||
@@ -103,11 +93,9 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodeq224
|
||||
%ifdef __MSDOS__
|
||||
SetVGAMode .Mode256x224c
|
||||
call cscopymodeq
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
@@ -115,11 +103,9 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodeq240
|
||||
%ifdef __MSDOS__
|
||||
SetVGAMode .Mode256x240c
|
||||
call cscopymodeq
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
@@ -127,7 +113,6 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodeq256
|
||||
%ifdef __MSDOS__
|
||||
cmp byte[scanlines],1
|
||||
je near .scanlines
|
||||
SetVGAMode .Mode256x256c
|
||||
@@ -137,8 +122,7 @@ NEWSYM dosinitvideo
|
||||
jmp .done
|
||||
.done
|
||||
call cscopymodeq
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
|
||||
@@ -147,11 +131,9 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodex224
|
||||
%ifdef __MSDOS__
|
||||
SetVGAMode .Mode320x224
|
||||
call cscopymodex
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
@@ -159,11 +141,9 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodex240
|
||||
%ifdef __MSDOS__
|
||||
SetVGAMode .Mode320x240
|
||||
call cscopymodex
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
;*******************************************************
|
||||
@@ -171,7 +151,6 @@ NEWSYM dosinitvideo
|
||||
;*******************************************************
|
||||
|
||||
.initmodex256
|
||||
%ifdef __MSDOS__
|
||||
cmp byte[scanlines],1
|
||||
je near .scanlines2
|
||||
SetVGAMode .Mode320x256
|
||||
@@ -181,8 +160,7 @@ NEWSYM dosinitvideo
|
||||
jmp .done2
|
||||
.done2
|
||||
call cscopymodex
|
||||
%endif
|
||||
call makepal
|
||||
call dosmakepal
|
||||
ret
|
||||
|
||||
|
||||
@@ -200,7 +178,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble
|
||||
ret
|
||||
.notrouble
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (320*240 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
@@ -258,7 +236,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble3
|
||||
ret
|
||||
.notrouble3
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (640*480 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
@@ -318,7 +296,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble11
|
||||
ret
|
||||
.notrouble11
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (800*600 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
@@ -377,7 +355,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble5
|
||||
ret
|
||||
.notrouble5
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (320*480 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
@@ -436,7 +414,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble7
|
||||
ret
|
||||
.notrouble7
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (512*384 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
@@ -494,7 +472,7 @@ NEWSYM dosinitvideo
|
||||
jne .notrouble9
|
||||
ret
|
||||
.notrouble9
|
||||
call makepal
|
||||
call dosmakepal
|
||||
; clear screen (640*400 bytes)
|
||||
push es
|
||||
mov ax,[vesa2selec]
|
||||
|
||||
@@ -22,11 +22,15 @@
|
||||
|
||||
%include "macros.mac"
|
||||
|
||||
EXTSYM WhichSW,_SW1,_SW2,_readSideWinder,_SWCount,_SW3,_SW4,delay,pl1contrl
|
||||
EXTSYM WhichSW,delay,pl1contrl
|
||||
EXTSYM pl2contrl,pl1p209,pl2p209,pl3p209,pl4p209,pl3contrl,pl4contrl,pressed
|
||||
EXTSYM read_gpp,pl5contrl,pl5p209,CalibXmin,CalibYmin,CalibXmax,CalibYmax
|
||||
EXTSYM pl5contrl,pl5p209,CalibXmin,CalibYmin,CalibXmax,CalibYmax
|
||||
EXTSYM CalibXmin209,CalibYmin209,CalibXmax209,CalibYmax209
|
||||
|
||||
%ifdef __MSDOS__
|
||||
EXTSYM read_gpp,_readSideWinder,_SW1,_SW2,_SW3,_SW4,_SWCount
|
||||
%endif
|
||||
|
||||
SECTION .data
|
||||
NEWSYM JoyAltrn2, db 2
|
||||
SECTION .bss
|
||||
@@ -188,6 +192,7 @@ NEWSYM GetCoords3
|
||||
sti
|
||||
ret
|
||||
|
||||
%ifdef __MSDOS__
|
||||
NEWSYM DosUpdateDevices
|
||||
mov byte[PPad],0
|
||||
mov byte[JoyQuant],0
|
||||
@@ -494,10 +499,6 @@ NEWSYM DosUpdateDevices
|
||||
.none2
|
||||
ret
|
||||
|
||||
SECTION .data
|
||||
NEWSYM JoyReadControl, db 0
|
||||
SECTION .text
|
||||
|
||||
JoyRead209:
|
||||
cmp byte[JoyAltrn],1
|
||||
jne near .noanalog
|
||||
@@ -907,7 +908,7 @@ GamePadPro2:
|
||||
.error
|
||||
ret
|
||||
|
||||
NEWSYM SideWinder
|
||||
SideWinder:
|
||||
mov al,[NumSWs]
|
||||
mov [_SWCount],al
|
||||
mov dx,201h
|
||||
@@ -1089,7 +1090,7 @@ GamePadPro2209:
|
||||
.error
|
||||
ret
|
||||
|
||||
NEWSYM SideWinder209
|
||||
SideWinder209:
|
||||
mov al,[NumSWs209]
|
||||
mov [_SWCount],al
|
||||
mov dx,209h
|
||||
@@ -1223,7 +1224,7 @@ NEWSYM SideWinder209
|
||||
%%nobutton
|
||||
%endmacro
|
||||
|
||||
NEWSYM GetParallelPlayer1
|
||||
GetParallelPlayer1:
|
||||
mov dx, 0378h
|
||||
mov byte[pressed+180h],0
|
||||
mov byte[pressed+181h],0
|
||||
@@ -1251,7 +1252,7 @@ NEWSYM GetParallelPlayer1
|
||||
PPortHelp 0F9h, 40h, 18Bh
|
||||
ret
|
||||
|
||||
NEWSYM GetParallelPlayer2
|
||||
GetParallelPlayer2:
|
||||
mov dx, 0378h
|
||||
mov byte[pressed+190h],0
|
||||
mov byte[pressed+191h],0
|
||||
@@ -1279,7 +1280,7 @@ NEWSYM GetParallelPlayer2
|
||||
PPortHelp 0F9h, 20h, 19Bh
|
||||
ret
|
||||
|
||||
NEWSYM GetParallelPlayer3
|
||||
GetParallelPlayer3:
|
||||
mov dx, 0378h
|
||||
mov byte[pressed+1A0h],0
|
||||
mov byte[pressed+1A1h],0
|
||||
@@ -1307,7 +1308,7 @@ NEWSYM GetParallelPlayer3
|
||||
PPortHelp 0F9h, 10h, 1ABh
|
||||
ret
|
||||
|
||||
NEWSYM GetParallelPlayer4
|
||||
GetParallelPlayer4:
|
||||
mov dx, 0378h
|
||||
mov byte[pressed+1B0h],0
|
||||
mov byte[pressed+1B1h],0
|
||||
@@ -1335,7 +1336,7 @@ NEWSYM GetParallelPlayer4
|
||||
PPortHelp 0F9h, 08h, 1BBh
|
||||
ret
|
||||
|
||||
NEWSYM GetParallelPlayer5
|
||||
GetParallelPlayer5:
|
||||
mov dx, 0378h
|
||||
mov byte[pressed+1c0h],0
|
||||
mov byte[pressed+1c1h],0
|
||||
@@ -1674,3 +1675,4 @@ NEWSYM SetInputDevice209
|
||||
.nopp5
|
||||
.exit
|
||||
ret
|
||||
%endif
|
||||
|
||||
@@ -37,25 +37,25 @@ NEWSYM granadd, resd 1
|
||||
SECTION .text
|
||||
|
||||
NEWSYM VESA12EXITTODOS
|
||||
mov ax,0003h
|
||||
int 10h
|
||||
push edx
|
||||
mov edx,.exitfromvesa12
|
||||
mov ah,9
|
||||
int 21h
|
||||
pop edx
|
||||
mov ah,9
|
||||
int 21h
|
||||
mov edx,.return
|
||||
mov ah,9
|
||||
int 21h
|
||||
mov ax,0003h
|
||||
int 10h
|
||||
push edx
|
||||
mov edx,.exitfromvesa12
|
||||
mov ah,9
|
||||
int 21h
|
||||
pop edx
|
||||
mov ah,9
|
||||
int 21h
|
||||
mov edx,.return
|
||||
mov ah,9
|
||||
int 21h
|
||||
|
||||
mov dl,[InitDrive]
|
||||
mov ebx,InitDir
|
||||
call Change_Dir
|
||||
mov dl,[InitDrive]
|
||||
mov ebx,InitDir
|
||||
call Change_Dir
|
||||
|
||||
mov byte[videotroub],1
|
||||
jmp DosExit
|
||||
mov byte[videotroub],1
|
||||
jmp DosExit
|
||||
|
||||
|
||||
SECTION .data
|
||||
@@ -64,153 +64,152 @@ SECTION .data
|
||||
SECTION .text
|
||||
|
||||
;*******************************************************
|
||||
; Set up Vesa 2
|
||||
; Set up Vesa 2
|
||||
;*******************************************************
|
||||
|
||||
NEWSYM InitVesa12
|
||||
;-------------------------------------------------;
|
||||
; First - allocate some bytes in DOS memory for ;
|
||||
; communication with VBE ;
|
||||
; communication with VBE ;
|
||||
;-------------------------------------------------;
|
||||
|
||||
mov eax,0100h
|
||||
mov ebx,512/16 ; 512 bytes
|
||||
int 31h ; Function 31h,100h - Allocate DOS memory (512 bytes)
|
||||
jnc .gotmem
|
||||
mov edx,.nomemmessage
|
||||
jmp VESA12EXITTODOS
|
||||
mov eax,0100h
|
||||
mov ebx,512/16 ; 512 bytes
|
||||
int 31h ; Function 31h,100h - Allocate DOS memory (512 bytes)
|
||||
jnc .gotmem
|
||||
mov edx,.nomemmessage
|
||||
jmp VESA12EXITTODOS
|
||||
.gotmem
|
||||
mov fs,dx ; FS now points to the DOS buffer
|
||||
mov fs,dx ; FS now points to the DOS buffer
|
||||
|
||||
|
||||
;--------------------------------------------------;
|
||||
; Now, get information about the video card into ;
|
||||
; a data structure ;
|
||||
;--------------------------------------------------;
|
||||
;--------------------------------------------------;
|
||||
; Now, get information about the video card into ;
|
||||
; a data structure ;
|
||||
;--------------------------------------------------;
|
||||
|
||||
mov edi,RMREGS
|
||||
mov dword[fs:0],'VBE1' ; Request VBE 2.0 info
|
||||
mov dword[RMREGS.eax],4f00h
|
||||
mov word[RMREGS.es],ax ; Real mode segment of DOS
|
||||
; buffer
|
||||
mov dword[RMREGS.edi],0
|
||||
mov edi,RMREGS
|
||||
mov dword[fs:0],'VBE1' ; Request VBE 2.0 info
|
||||
mov dword[RMREGS.eax],4f00h
|
||||
mov [RMREGS.es],ax ; Real mode segment of DOS buffer
|
||||
mov dword[RMREGS.edi],0
|
||||
|
||||
push es
|
||||
push ds
|
||||
pop es
|
||||
mov eax,300h
|
||||
mov ebx,10h
|
||||
xor ecx,ecx
|
||||
int 31h ; Simulate real mode interrupt
|
||||
pop es
|
||||
push es
|
||||
push ds
|
||||
pop es
|
||||
mov eax,300h
|
||||
mov ebx,10h
|
||||
xor ecx,ecx
|
||||
int 31h ; Simulate real mode interrupt
|
||||
pop es
|
||||
|
||||
jnc .int1ok
|
||||
mov edx,.noint1message
|
||||
jmp VESA12EXITTODOS
|
||||
jnc .int1ok
|
||||
mov edx,.noint1message
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
.int1ok ; Real mode int successful!!!
|
||||
mov eax,[RMREGS.eax]
|
||||
cmp al,4fh ; Check vbe interrupt went OK
|
||||
jz .vbedetected
|
||||
mov edx,.novbemessage
|
||||
jmp VESA12EXITTODOS
|
||||
.int1ok ; Real mode int successful!!!
|
||||
mov eax,[RMREGS.eax]
|
||||
cmp al,4fh ; Check vbe interrupt went OK
|
||||
jz .vbedetected
|
||||
mov edx,.novbemessage
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
.vbedetected
|
||||
cmp dword[fs:0000],'VESA'
|
||||
jz .vesadetected ; Check for presence of vesa
|
||||
mov edx,.novesamessage
|
||||
jmp VESA12EXITTODOS
|
||||
.vbedetected
|
||||
cmp dword[fs:0000],'VESA'
|
||||
jz .vesadetected ; Check for presence of vesa
|
||||
mov edx,.novesamessage
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
|
||||
.vesadetected
|
||||
cmp word[fs:0004],102h
|
||||
jae .vesa12detected ; Check we've got VESA 1.2 or greater
|
||||
mov edx,.novesa2message
|
||||
jmp VESA12EXITTODOS
|
||||
.vesadetected
|
||||
cmp word[fs:0004],102h
|
||||
jae .vesa12detected ; Check we've got VESA 1.2 or greater
|
||||
mov edx,.novesa2message
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
|
||||
;-----------------------------------------------------;
|
||||
; OK - vesa 2.0 or greater has been detected. Copy ;
|
||||
; mode information into VESAmodelist ;
|
||||
;-----------------------------------------------------;
|
||||
;-----------------------------------------------------;
|
||||
; OK - vesa 2.0 or greater has been detected. Copy ;
|
||||
; mode information into VESAmodelist ;
|
||||
;-----------------------------------------------------;
|
||||
|
||||
.vesa12detected
|
||||
mov ax,[fs:12h] ; Get no. of 64k blocks
|
||||
mov [noblocks],ax
|
||||
mov ax, 2
|
||||
mov bx,[fs:10h]
|
||||
int 31h
|
||||
mov ax,[fs:12h] ; Get no. of 64k blocks
|
||||
mov [noblocks],ax
|
||||
mov ax, 2
|
||||
mov bx,[fs:10h]
|
||||
int 31h
|
||||
|
||||
jnc .wegottheselector
|
||||
mov edx, .oopsnoselector
|
||||
jmp VESA12EXITTODOS
|
||||
jnc .wegottheselector
|
||||
mov edx, .oopsnoselector
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
.wegottheselector
|
||||
.wegottheselector
|
||||
|
||||
mov gs,ax
|
||||
xor eax,eax
|
||||
mov ebp,VESAmodelist
|
||||
mov ecx,512
|
||||
mov ax,[fs:0eh]
|
||||
mov gs,ax
|
||||
xor eax,eax
|
||||
mov ebp,VESAmodelist
|
||||
mov ecx,512
|
||||
mov ax,[fs:0eh]
|
||||
|
||||
.loopcopymodes
|
||||
mov bx,[gs:eax]
|
||||
mov [ebp],bx
|
||||
cmp bx,0ffffh
|
||||
jz .copiedmodes
|
||||
add ebp,2
|
||||
add eax,2
|
||||
dec ecx
|
||||
jz .outofmodelistspace
|
||||
jmp .loopcopymodes
|
||||
.loopcopymodes
|
||||
mov bx,[gs:eax]
|
||||
mov [ebp],bx
|
||||
cmp bx,0ffffh
|
||||
jz .copiedmodes
|
||||
add ebp,2
|
||||
add eax,2
|
||||
dec ecx
|
||||
jz .outofmodelistspace
|
||||
jmp .loopcopymodes
|
||||
|
||||
.outofmodelistspace
|
||||
mov edx,.outofmodelistspacemessage
|
||||
jmp VESA12EXITTODOS
|
||||
.outofmodelistspace
|
||||
mov edx,.outofmodelistspacemessage
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
;----------------------------------------------;
|
||||
; OK - Scan the mode list to find a matching ;
|
||||
; mode for vesa2_x, vesa2_y and vesa2_depth ;
|
||||
;----------------------------------------------;
|
||||
;----------------------------------------------;
|
||||
; OK - Scan the mode list to find a matching ;
|
||||
; mode for vesa2_x, vesa2_y and vesa2_depth ;
|
||||
;----------------------------------------------;
|
||||
|
||||
.copiedmodes
|
||||
|
||||
mov ebp,VESAmodelist
|
||||
xor ecx,ecx
|
||||
mov ebp,VESAmodelist
|
||||
xor ecx,ecx
|
||||
|
||||
.loopcheckmodes
|
||||
mov cx, [ebp]
|
||||
cmp cx, 0ffffh
|
||||
jnz .notendoflist
|
||||
mov cx, [ebp]
|
||||
cmp cx, 0ffffh
|
||||
jnz .notendoflist
|
||||
|
||||
mov edx,.endoflist
|
||||
jmp VESA12EXITTODOS
|
||||
mov edx,.endoflist
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
.notendoflist
|
||||
|
||||
mov edi, RMREGS
|
||||
mov dword[RMREGS.eax],4f01h
|
||||
mov dword[RMREGS.ebx],0
|
||||
mov [RMREGS.ecx],ecx
|
||||
mov dword[RMREGS.edi],0
|
||||
mov edi, RMREGS
|
||||
mov dword[RMREGS.eax],4f01h
|
||||
mov dword[RMREGS.ebx],0
|
||||
mov [RMREGS.ecx],ecx
|
||||
mov dword[RMREGS.edi],0
|
||||
|
||||
push es
|
||||
push ds
|
||||
pop es
|
||||
mov eax,300h
|
||||
mov ebx,10h
|
||||
xor ecx,ecx
|
||||
int 31h ; Simulate real mode interrupt
|
||||
pop es
|
||||
jnc .modecheckok
|
||||
mov edx,.modecheckfail
|
||||
jmp VESA12EXITTODOS
|
||||
push es
|
||||
push ds
|
||||
pop es
|
||||
mov eax,300h
|
||||
mov ebx,10h
|
||||
xor ecx,ecx
|
||||
int 31h ; Simulate real mode interrupt
|
||||
pop es
|
||||
jnc .modecheckok
|
||||
mov edx,.modecheckfail
|
||||
jmp VESA12EXITTODOS
|
||||
|
||||
.modecheckok
|
||||
add ebp,2
|
||||
.modecheckok
|
||||
add ebp,2
|
||||
|
||||
test word[fs:0000h],1b
|
||||
jz near .loopcheckmodes ; If mode is not available
|
||||
test word[fs:0000h],1b
|
||||
jz near .loopcheckmodes ; If mode is not available
|
||||
|
||||
;
|
||||
; xor eax,eax
|
||||
@@ -233,15 +232,15 @@ NEWSYM InitVesa12
|
||||
; mov dl,10
|
||||
; int 21h
|
||||
|
||||
mov eax,[vesa2_x]
|
||||
cmp [fs:12h],ax ; Check that the height matches
|
||||
jnz near .loopcheckmodes
|
||||
mov eax,[vesa2_y]
|
||||
cmp [fs:14h],ax ; Check that the width matches
|
||||
jnz near .loopcheckmodes
|
||||
mov al,[vesa2_bits]
|
||||
cmp [fs:19h],al ; Check bits/pixel for match
|
||||
jnz near .loopcheckmodes
|
||||
mov eax,[vesa2_x]
|
||||
cmp [fs:12h],ax ; Check that the height matches
|
||||
jnz near .loopcheckmodes
|
||||
mov eax,[vesa2_y]
|
||||
cmp [fs:14h],ax ; Check that the width matches
|
||||
jnz near .loopcheckmodes
|
||||
mov al,[vesa2_bits]
|
||||
cmp [fs:19h],al ; Check bits/pixel for match
|
||||
jnz near .loopcheckmodes
|
||||
|
||||
; mov ah,07h
|
||||
; int 21h
|
||||
@@ -257,23 +256,23 @@ NEWSYM InitVesa12
|
||||
; 1 = Window is writeable
|
||||
; D3-D7 = Reserved
|
||||
|
||||
mov byte[.whichwin],0
|
||||
mov al,[fs:2] ; Get window A attributes
|
||||
and al,0100b
|
||||
cmp al,0100b
|
||||
je .foundwin ; Mode supported
|
||||
mov al,[fs:3] ; Get window B attributes
|
||||
and al,0100b
|
||||
cmp al,0100b
|
||||
jne .foundwin ; Mode not supported
|
||||
mov byte[.whichwin],1
|
||||
mov byte[.whichwin],0
|
||||
mov al,[fs:2] ; Get window A attributes
|
||||
and al,0100b
|
||||
cmp al,0100b
|
||||
je .foundwin ; Mode supported
|
||||
mov al,[fs:3] ; Get window B attributes
|
||||
and al,0100b
|
||||
cmp al,0100b
|
||||
jne .foundwin ; Mode not supported
|
||||
mov byte[.whichwin],1
|
||||
.foundwin
|
||||
|
||||
; Success - a match has been found!!
|
||||
; Success - a match has been found!!
|
||||
|
||||
sub ebp,2
|
||||
mov ax,[ebp]
|
||||
mov [vesamode],ax ; Store vesa 1.2 mode number
|
||||
sub ebp,2
|
||||
mov ax,[ebp]
|
||||
mov [vesamode],ax ; Store vesa 1.2 mode number
|
||||
; and eax,0FFFFh
|
||||
; push eax
|
||||
; mov ax,0003h
|
||||
@@ -282,229 +281,227 @@ NEWSYM InitVesa12
|
||||
; call printnum
|
||||
; jmp DosExit
|
||||
|
||||
mov ax,[fs:10h]
|
||||
mov byte[vesa2red10],0
|
||||
mov byte[vesa2_rposng],11
|
||||
mov byte[vesa2_gposng],6
|
||||
mov byte[vesa2_bposng],0
|
||||
mov dword[vesa2_clbitng],1111011111011110b
|
||||
mov dword[vesa2_clbitng2],11110111110111101111011111011110b
|
||||
mov dword[vesa2_clbitng2+4],11110111110111101111011111011110b
|
||||
mov dword[vesa2_clbitng3],0111101111101111b
|
||||
mov [bytesperscanline],ax ; Store bytes per scan line
|
||||
cmp byte[fs:20h],10
|
||||
jne .nored10
|
||||
mov byte[fs:20h],11
|
||||
mov byte[vesa2red10],1
|
||||
mov byte[vesa2_rposng],10
|
||||
mov byte[vesa2_gposng],5
|
||||
mov dword[vesa2_clbitng],0111101111011110b
|
||||
mov dword[vesa2_clbitng2],01111011110111100111101111011110b
|
||||
mov dword[vesa2_clbitng2+4],01111011110111100111101111011110b
|
||||
mov dword[vesa2_clbitng3],0011110111101111b
|
||||
mov ax,[fs:10h]
|
||||
mov byte[vesa2red10],0
|
||||
mov byte[vesa2_rposng],11
|
||||
mov byte[vesa2_gposng],6
|
||||
mov byte[vesa2_bposng],0
|
||||
mov dword[vesa2_clbitng],1111011111011110b
|
||||
mov dword[vesa2_clbitng2],11110111110111101111011111011110b
|
||||
mov dword[vesa2_clbitng2+4],11110111110111101111011111011110b
|
||||
mov dword[vesa2_clbitng3],0111101111101111b
|
||||
mov [bytesperscanline],ax ; Store bytes per scan line
|
||||
cmp byte[fs:20h],10
|
||||
jne .nored10
|
||||
mov byte[fs:20h],11
|
||||
mov byte[vesa2red10],1
|
||||
mov byte[vesa2_rposng],10
|
||||
mov byte[vesa2_gposng],5
|
||||
mov dword[vesa2_clbitng],0111101111011110b
|
||||
mov dword[vesa2_clbitng2],01111011110111100111101111011110b
|
||||
mov dword[vesa2_clbitng2+4],01111011110111100111101111011110b
|
||||
mov dword[vesa2_clbitng3],0011110111101111b
|
||||
.nored10
|
||||
; fix up bit lengths
|
||||
mov al,16
|
||||
sub al,[fs:20h]
|
||||
mov ah,[fs:22h]
|
||||
sub ah,[fs:20h]
|
||||
mov bl,[fs:24h]
|
||||
sub bl,[fs:20h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1
|
||||
mov bh,ah
|
||||
; fix up bit lengths
|
||||
mov al,16
|
||||
sub al,[fs:20h]
|
||||
mov ah,[fs:22h]
|
||||
sub ah,[fs:20h]
|
||||
mov bl,[fs:24h]
|
||||
sub bl,[fs:20h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1
|
||||
mov bh,ah
|
||||
.scheck1
|
||||
cmp bh,bl
|
||||
jb .scheck2
|
||||
mov bh,bl
|
||||
cmp bh,bl
|
||||
jb .scheck2
|
||||
mov bh,bl
|
||||
.scheck2
|
||||
mov byte[fs:19h],5
|
||||
mov byte[fs:19h],5
|
||||
|
||||
mov al,16
|
||||
sub al,[fs:22h]
|
||||
mov ah,[fs:20h]
|
||||
sub ah,[fs:22h]
|
||||
mov bl,[fs:24h]
|
||||
sub bl,[fs:22h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1b
|
||||
mov bh,ah
|
||||
mov al,16
|
||||
sub al,[fs:22h]
|
||||
mov ah,[fs:20h]
|
||||
sub ah,[fs:22h]
|
||||
mov bl,[fs:24h]
|
||||
sub bl,[fs:22h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1b
|
||||
mov bh,ah
|
||||
.scheck1b
|
||||
cmp bh,bl
|
||||
jb .scheck2b
|
||||
mov bh,bl
|
||||
cmp bh,bl
|
||||
jb .scheck2b
|
||||
mov bh,bl
|
||||
.scheck2b
|
||||
mov [fs:21h],bh
|
||||
mov [fs:21h],bh
|
||||
|
||||
mov al,16
|
||||
sub al,[fs:24h]
|
||||
mov ah,[fs:20h]
|
||||
sub ah,[fs:24h]
|
||||
mov bl,[fs:22h]
|
||||
sub bl,[fs:24h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1c
|
||||
mov bh,ah
|
||||
mov al,16
|
||||
sub al,[fs:24h]
|
||||
mov ah,[fs:20h]
|
||||
sub ah,[fs:24h]
|
||||
mov bl,[fs:22h]
|
||||
sub bl,[fs:24h]
|
||||
mov bh,al
|
||||
cmp bh,ah
|
||||
jb .scheck1c
|
||||
mov bh,ah
|
||||
.scheck1c
|
||||
cmp bh,bl
|
||||
jb .scheck2c
|
||||
mov bh,bl
|
||||
cmp bh,bl
|
||||
jb .scheck2c
|
||||
mov bh,bl
|
||||
.scheck2c
|
||||
mov [fs:23h],bh
|
||||
mov [fs:23h],bh
|
||||
|
||||
mov word[vesa2_clbit],0
|
||||
mov word[vesa2_clbit],0
|
||||
|
||||
cmp byte[fs:20h],10
|
||||
jne .nottopbit
|
||||
mov word[vesa2_usbit],8000h
|
||||
cmp byte[fs:20h],10
|
||||
jne .nottopbit
|
||||
mov word[vesa2_usbit],8000h
|
||||
.nottopbit
|
||||
|
||||
; Process Red Stuff
|
||||
mov al,[fs:20h] ; bit sizes = [fs:19h,21h,23h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:19h],6
|
||||
jne .no6bit
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
; Process Red Stuff
|
||||
mov al,[fs:20h] ; bit sizes = [fs:19h,21h,23h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:19h],6
|
||||
jne .no6bit
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
.no6bit
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_rpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrr
|
||||
shl bx,cl
|
||||
jmp .shlr
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_rpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrr
|
||||
shl bx,cl
|
||||
jmp .shlr
|
||||
.shrr
|
||||
shr bx,1
|
||||
shr bx,1
|
||||
.shlr
|
||||
mov [vesa2_rfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_rtrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_rtrcla],bx
|
||||
mov [vesa2_rfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_rtrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_rtrcla],bx
|
||||
|
||||
; Process Green Stuff
|
||||
mov al,[fs:22h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:21h],6
|
||||
jne .no6bitb
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
; Process Green Stuff
|
||||
mov al,[fs:22h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:21h],6
|
||||
jne .no6bitb
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
.no6bitb
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_gpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrg
|
||||
shl bx,cl
|
||||
jmp .shlg
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_gpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrg
|
||||
shl bx,cl
|
||||
jmp .shlg
|
||||
.shrg
|
||||
shr bx,1
|
||||
shr bx,1
|
||||
.shlg
|
||||
mov [vesa2_gfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_gtrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_gtrcla],bx
|
||||
mov [vesa2_gfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_gtrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_gtrcla],bx
|
||||
|
||||
; Process Blue Stuff
|
||||
mov al,[fs:24h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:23h],6
|
||||
jne .no6bitc
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
; Process Blue Stuff
|
||||
mov al,[fs:24h]
|
||||
mov cl,al
|
||||
mov bx,1
|
||||
shl bx,cl
|
||||
cmp byte[fs:23h],6
|
||||
jne .no6bitc
|
||||
mov [vesa2_usbit],bx
|
||||
inc al
|
||||
.no6bitc
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_bpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrb
|
||||
shl bx,cl
|
||||
jmp .shlb
|
||||
or [vesa2_clbit],bx
|
||||
mov [vesa2_bpos],al
|
||||
dec al
|
||||
mov cl,al
|
||||
mov bx,001Fh
|
||||
cmp cl,0FFh
|
||||
je .shrb
|
||||
shl bx,cl
|
||||
jmp .shlb
|
||||
.shrb
|
||||
shr bx,1
|
||||
shr bx,1
|
||||
.shlb
|
||||
mov [vesa2_bfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_btrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_btrcla],bx
|
||||
mov [vesa2_bfull],bx
|
||||
add al,5
|
||||
mov bx,1
|
||||
mov cl,al
|
||||
shl bx,cl
|
||||
mov [vesa2_btrcl],bx
|
||||
xor bx,0FFFFh
|
||||
mov [vesa2_btrcla],bx
|
||||
|
||||
xor word[vesa2_clbit],0FFFFh
|
||||
xor word[vesa2_clbit],0FFFFh
|
||||
|
||||
mov ax,[fs:4]
|
||||
mov [granularity],ax
|
||||
xor edx,edx
|
||||
mov ax,64
|
||||
mov bx,[granularity]
|
||||
div bx
|
||||
mov [granadd],ax
|
||||
mov ax,[fs:4]
|
||||
mov [granularity],ax
|
||||
xor edx,edx
|
||||
mov ax,64
|
||||
mov bx,[granularity]
|
||||
div bx
|
||||
mov [granadd],ax
|
||||
|
||||
call genfulladdtab
|
||||
call genfulladdtab
|
||||
|
||||
xor eax,eax
|
||||
xor ebx,ebx
|
||||
xor ecx,ecx
|
||||
xor edx,edx
|
||||
mov ax,4f02h
|
||||
mov bx,[vesamode]
|
||||
int 10h ; Set the vesa mode
|
||||
cmp ax,004fh
|
||||
jz .modesetok
|
||||
mov edx,.unableset
|
||||
jmp VESA12EXITTODOS ; Failure!!!
|
||||
xor eax,eax
|
||||
xor ebx,ebx
|
||||
xor ecx,ecx
|
||||
xor edx,edx
|
||||
mov ax,4f02h
|
||||
mov bx,[vesamode]
|
||||
int 10h ; Set the vesa mode
|
||||
cmp ax,004fh
|
||||
jz .modesetok
|
||||
mov edx,.unableset
|
||||
jmp VESA12EXITTODOS ; Failure!!!
|
||||
|
||||
.modesetok
|
||||
.modesetok
|
||||
;******************************* EXTRA BIT ****************************
|
||||
|
||||
ret
|
||||
ret
|
||||
|
||||
; Check logical scanline length
|
||||
mov eax,4f06h
|
||||
mov ebx,1
|
||||
int 10h
|
||||
cmp cx,[vesa2_x]
|
||||
je .correctwidth
|
||||
; Check logical scanline length
|
||||
mov eax,4f06h
|
||||
mov ebx,1
|
||||
int 10h
|
||||
cmp cx,[vesa2_x]
|
||||
je .correctwidth
|
||||
|
||||
mov eax,4f06h ; VBE Set/Get logical scan line
|
||||
; length
|
||||
mov ebx,0 ; Set scan line length in
|
||||
; pixels
|
||||
mov ecx, [vesa2_x] ; Desired screen width
|
||||
int 10h
|
||||
cmp ax,04fh
|
||||
jz .correctwidth
|
||||
mov edx, .unablescan
|
||||
jmp VESA12EXITTODOS ; Failure!!!
|
||||
mov eax,4f06h ; VBE Set/Get logical scan line length
|
||||
mov ebx,0 ; Set scan line length in pixels
|
||||
mov ecx, [vesa2_x] ; Desired screen width
|
||||
int 10h
|
||||
cmp ax,04fh
|
||||
jz .correctwidth
|
||||
mov edx, .unablescan
|
||||
jmp VESA12EXITTODOS ; Failure!!!
|
||||
|
||||
.correctwidth
|
||||
.correctwidth
|
||||
|
||||
ret
|
||||
ret
|
||||
|
||||
SECTION .data
|
||||
.nomemmessage db ': Unable to locate DOS memory.$'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,6 @@
|
||||
|
||||
; by kode54, stainless
|
||||
|
||||
%ifdef __MSDOS__
|
||||
%macro SetVGAMode 1
|
||||
mov byte[cbitmode],0
|
||||
|
||||
@@ -152,5 +151,3 @@ SECTION .data
|
||||
|
||||
|
||||
SECTION .text
|
||||
%endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user