delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/13/05:31:54

From: Gary Preston <gary AT prestons DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Mode 320x400..
Date: Mon, 12 May 1997 16:32:20 +0100
Organization: None
Distribution: world
Message-ID: <h6bF7DAEgzdzEwr8@prestons.demon.co.uk>
NNTP-Posting-Host: prestons.demon.co.uk
MIME-Version: 1.0
Lines: 35
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

 Hi,

 I'm trying to convert some asm code from Zen of graphics garus chap 9
(l9-1.asm) into C. The code is used to set VGA mode 320x400x256 I
translated as follows. 

void Set320x400Mode( void )
{
union REGS r;

  r.x.ax = 0x0013;      /* Set standard 320x200 VGA mode */
  int86( 0x10, &r, &r);

  outportb( SC_INDEX, MEMORY_MODE );
  outportb( SC_DATA, (inportb(SC_DATA & 0xF7 ) | 0x04 ) );
  outportb( GC_INDEX, GRAPHICS_MODE );
  outportb( GC_DATA, inportb( GC_DATA & 0xEF ) );
  outportb( GC_INDEX, MISCELLANEOUS );
  outportb( GC_DATA, inportb( GC_DATA & 0xFD ) );
  outportb( CRTC_INDEX, MAX_SCAN_LINE );
  outportb( CRTC_DATA, inportb( CRTC_DATA & 0xE0 ) );

}

I have'nt cleared the mem yet but it doesn't even produce a garbaged
screen let alone plot a pixel. Have I got the right idea here and where
have I gone wrong? Since I have never used any modes other than 13h
the above code is probably compleat rubbish if so how should I set mode
320x400x256?

Thanks,
-- 
Gary Preston

Turnpike evaluation. For Turnpike information, mailto:info AT turnpike DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019