MS-DOS-可以对24位图形进行编程吗? [英] MS-DOS - Is it possible to program 24 bit graphics?

查看:127
本文介绍了MS-DOS-可以对24位图形进行编程吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在DOS机器上以24位色深进行编程?我知道VGA支持8位色深,但是有没有办法淘汰24位?对Google的研究并未发现任何问题.我在FreeDOS而不是MS-DOS上编程,如果那会影响答案.

Is it possible to program in a color depth of 24 bits on a DOS machine? I know VGA supports 8 bit color depth, but is there a way to finagle out 24 bits? Research on Google has turned up nothing. I am programming on FreeDOS instead of MS-DOS, if that affects the answer.

推荐答案

是的,有可能.您应该阅读有关 VESA 这里有几个功能

Yes, it is possible. You should read about VESA and appropriate drivers. Here is several functions

那么您将能够做到:

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

如果启动VESA并设置为103h(800x600x256)模式,这通常为ax提供004fh,例如,您可以使用11bh(1280x1024x16M)(

This usually provides ax with 004fh if VESA is inited and 103h (800x600x256) mode is set, you may use 11bh (1280x1024x16M) for example (http://www.delorie.com/djgpp/doc/rbinter/it/83/0.html)

更新:我正在从非常非常老的pascal程序中附加一些代码:

UPDATE: I'm attaching some code from my very very very old pascal program:

{ 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);

这篇关于MS-DOS-可以对24位图形进行编程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆