gpt4 book ai didi

assembly - MS-DOS - 是否可以对 24 位图形进行编程?

转载 作者:行者123 更新时间:2023-12-02 21:46:20 25 4
gpt4 key购买 nike

是否可以在 DOS 机器上以 24 位颜色深度进行编程?我知道 VGA 支持 8 位色深,但是有没有办法弄出 24 位色深?谷歌的研究没有发现任何结果。我正在 FreeDOS 而不是 MS-DOS 上编程,如果这会影响答案。

最佳答案

是的,这是可能的。您应该阅读 VESAappropriate driversHere is several functions

然后你将能够做到:

  mov ax,4f02h
mov bx,103h
int 10h

如果初始化了 VESA 并设置了 103h (800x600x256) 模式,通常会为 ax 提供 004fh,您可以使用 11bh (1280x1024x16M) 例如 ( http://www.delorie.com/djgpp/doc/rbinter/it/83/0.html )

更新:我附上了我非常非常老的 pascal 程序的一些代码:

{ preserve space for vesa info structure, in asm it will look like sets of db, dw }
tmodes=array[0..0] of word;
tvesainfo=
record
abSignature:array[1..4] of char;
lwVersion,hwVersion:byte;
pfszOEMStr:pchar;
rAbilities:longint;
{$F+}
pfawModes:^tmodes;
{$F-}
abData:array[1..238] of byte;
end;

{ just pascal function, which calls ax 4f00 int 10h, passes address of structure above to fetch information from vesa driver, can be just simplified to asm block in it }
function vesatest(var vi:tvesainfo):boolean;
var
os,sg:word;
res:word;
begin
os:=seg(vi);
sg:=ofs(vi);
asm
mov ax,4f00h
mov es,os
mov di,sg
int 10h
mov res,ax
end;
if res=$004f then vesatest:=true
else vesatest:=false;
end;

{ call function above and display basic information about vesa driver installed }
if vesatest(vesainfo)=false then
begin
writeln('This computer doesn''t have VESA');
halt(254);
end;
writeln('VESA signature - ',vesainfo.abSignature);
writeln('VESA version - ',vesainfo.hwVersion,'.',vesainfo.lwVersion);
writeln('VESA manufacturer - ',vesainfo.pfszOEMStr);

关于assembly - MS-DOS - 是否可以对 24 位图形进行编程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19460508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com