mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 08:59:05 +02:00
+ enabled the 320x200x256c VGA mode in the graph unit for i8086-msdos
git-svn-id: trunk@25675 -
This commit is contained in:
parent
009037f9d9
commit
dbc851eda3
@ -2343,7 +2343,7 @@ End;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
(*
|
|
||||||
{************************************************************************}
|
{************************************************************************}
|
||||||
{* 320x200x256c Routines *}
|
{* 320x200x256c Routines *}
|
||||||
{************************************************************************}
|
{************************************************************************}
|
||||||
@ -2361,7 +2361,6 @@ End;
|
|||||||
|
|
||||||
Procedure PutPixel320(X,Y : smallint; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
|
Procedure PutPixel320(X,Y : smallint; Pixel: Word); {$ifndef fpc}far;{$endif fpc}
|
||||||
{ x,y -> must be in local coordinates. Clipping if required. }
|
{ x,y -> must be in local coordinates. Clipping if required. }
|
||||||
{$ifndef fpc}
|
|
||||||
Begin
|
Begin
|
||||||
X:= X + StartXViewPort;
|
X:= X + StartXViewPort;
|
||||||
Y:= Y + StartYViewPort;
|
Y:= Y + StartYViewPort;
|
||||||
@ -2379,60 +2378,17 @@ End;
|
|||||||
mov di, [X]
|
mov di, [X]
|
||||||
xchg ah, al { The value of Y must be in AH }
|
xchg ah, al { The value of Y must be in AH }
|
||||||
add di, ax
|
add di, ax
|
||||||
shr ax, 2
|
shr ax, 1
|
||||||
|
shr ax, 1
|
||||||
add di, ax
|
add di, ax
|
||||||
add di, [VideoOfs] { point to correct page.. }
|
// add di, [VideoOfs] { point to correct page.. }
|
||||||
mov ax, [Pixel]
|
mov ax, [Pixel]
|
||||||
mov es:[di], al
|
mov es:[di], al
|
||||||
end;
|
end ['ax','di'];
|
||||||
{$else fpc}
|
|
||||||
assembler;
|
|
||||||
asm
|
|
||||||
push eax
|
|
||||||
push ebx
|
|
||||||
push ecx
|
|
||||||
push edi
|
|
||||||
{$IFDEF REGCALL}
|
|
||||||
movsx edi, ax
|
|
||||||
movsx ebx, dx
|
|
||||||
mov al, cl
|
|
||||||
{$ELSE REGCALL}
|
|
||||||
movsx edi, x
|
|
||||||
movsx ebx, y
|
|
||||||
{$ENDIF REGCALL}
|
|
||||||
cmp clippixels, 0
|
|
||||||
je @putpix320noclip
|
|
||||||
test edi, edi
|
|
||||||
jl @putpix320done
|
|
||||||
test ebx, ebx
|
|
||||||
jl @putpix320done
|
|
||||||
cmp di, ViewWidth
|
|
||||||
jg @putpix320done
|
|
||||||
cmp bx, ViewHeight
|
|
||||||
jg @putpix320done
|
|
||||||
@putpix320noclip:
|
|
||||||
movsx ecx, StartYViewPort
|
|
||||||
movsx edx, StartXViewPort
|
|
||||||
add ebx, ecx
|
|
||||||
add edi, edx
|
|
||||||
{ add edi, [VideoOfs] no multiple pages in 320*200*256 }
|
|
||||||
{$IFNDEF REGCALL}
|
|
||||||
mov ax, [pixel]
|
|
||||||
{$ENDIF REGCALL}
|
|
||||||
shl ebx, 6
|
|
||||||
add edi, ebx
|
|
||||||
mov fs:[edi+ebx*4+$a0000], al
|
|
||||||
@putpix320done:
|
|
||||||
pop edi
|
|
||||||
pop ecx
|
|
||||||
pop ebx
|
|
||||||
pop eax
|
|
||||||
{$endif fpc}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Function GetPixel320(X,Y: smallint):word; {$ifndef fpc}far;{$endif fpc}
|
Function GetPixel320(X,Y: smallint):word; {$ifndef fpc}far;{$endif fpc}
|
||||||
{$ifndef fpc}
|
|
||||||
Begin
|
Begin
|
||||||
X:= X + StartXViewPort;
|
X:= X + StartXViewPort;
|
||||||
Y:= Y + StartYViewPort;
|
Y:= Y + StartYViewPort;
|
||||||
@ -2442,40 +2398,14 @@ End;
|
|||||||
mov di, [X]
|
mov di, [X]
|
||||||
xchg ah, al { The value of Y must be in AH }
|
xchg ah, al { The value of Y must be in AH }
|
||||||
add di, ax
|
add di, ax
|
||||||
shr ax, 2
|
shr ax, 1
|
||||||
|
shr ax, 1
|
||||||
add di, ax
|
add di, ax
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
add di, [VideoOfs] { point to correct gfx page ... }
|
// add di, [VideoOfs] { point to correct gfx page ... }
|
||||||
mov al,es:[di]
|
mov al,es:[di]
|
||||||
mov @Result,ax
|
mov @Result,ax
|
||||||
end;
|
end ['ax','di'];
|
||||||
{$else fpc}
|
|
||||||
assembler;
|
|
||||||
asm
|
|
||||||
push ebx
|
|
||||||
push ecx
|
|
||||||
push edx
|
|
||||||
push edi
|
|
||||||
{$IFDEF REGCALL}
|
|
||||||
movsx edi, ax
|
|
||||||
movsx ebx, dx
|
|
||||||
{$ELSE REGCALL}
|
|
||||||
movsx edi, x
|
|
||||||
movsx ebx, y
|
|
||||||
{$ENDIF REGCALL}
|
|
||||||
movsx ecx, StartYViewPort
|
|
||||||
movsx edx, StartXViewPort
|
|
||||||
add ebx, ecx
|
|
||||||
add edi, edx
|
|
||||||
{ add edi, [VideoOfs] no multiple pages in 320*200*256 }
|
|
||||||
shl ebx, 6
|
|
||||||
add edi, ebx
|
|
||||||
movzx eax, byte ptr fs:[edi+ebx*4+$a0000]
|
|
||||||
pop edi
|
|
||||||
pop edx
|
|
||||||
pop ecx
|
|
||||||
pop ebx
|
|
||||||
{$endif fpc}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2554,7 +2484,7 @@ End;
|
|||||||
begin
|
begin
|
||||||
VideoOfs := 0;
|
VideoOfs := 0;
|
||||||
end;
|
end;
|
||||||
|
(*
|
||||||
{************************************************************************}
|
{************************************************************************}
|
||||||
{* Mode-X related routines *}
|
{* Mode-X related routines *}
|
||||||
{************************************************************************}
|
{************************************************************************}
|
||||||
@ -3671,7 +3601,7 @@ const CrtAddress: word = 0;
|
|||||||
AddMode(mode);
|
AddMode(mode);
|
||||||
|
|
||||||
|
|
||||||
(* InitMode(mode);
|
InitMode(mode);
|
||||||
{ now add all standard VGA modes... }
|
{ now add all standard VGA modes... }
|
||||||
mode.DriverNumber:= LowRes;
|
mode.DriverNumber:= LowRes;
|
||||||
mode.HardwarePages:= 0;
|
mode.HardwarePages:= 0;
|
||||||
@ -3693,7 +3623,7 @@ const CrtAddress: word = 0;
|
|||||||
mode.YAspect := 10000;
|
mode.YAspect := 10000;
|
||||||
AddMode(mode);
|
AddMode(mode);
|
||||||
|
|
||||||
{ now add all standard VGA modes... }
|
(* { now add all standard VGA modes... }
|
||||||
InitMode(mode);
|
InitMode(mode);
|
||||||
mode.DriverNumber:= LowRes;
|
mode.DriverNumber:= LowRes;
|
||||||
mode.ModeNumber:=1;
|
mode.ModeNumber:=1;
|
||||||
|
Loading…
Reference in New Issue
Block a user