delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/09/19:43:57

Message-Id: <199605092338.TAA14370@eelab.newpaltz.edu>
Comments: Authenticated sender is <fortin44 AT eelab DOT newpaltz DOT edu>
From: "John Fortin" <fortin44 AT eelab DOT newpaltz DOT edu>
To: djgpp AT delorie DOT com
Date: Thu, 9 May 1996 18:35:14 +0000
Subject: something strange with printf

#include "svga.h"

void main(void)
{
    __dpmi_regs regs;
    _VGAInfoBlock VGAInfoBlock;
    BYTE OEMString[256],i;
    WORD VideoModeInfo[256];
    DWORD ADDRESS,segment,offset;
	
    regs.x.ax=0x4f00;	        
    regs.x.es = __tb/16;
    regs.x.di=0;
    __dpmi_int(0x10,&regs);

    if(regs.h.ah) return;
	printf("TB Address %lx %lx\n",__tb, (__tb/16)&0xffff);
    dosmemget(__tb, sizeof(VGAInfoBlock), &VGAInfoBlock);
    
    printf("VGAInfoBlock size %lu\n", sizeof(VGAInfoBlock)); 
    printf("VESASignature %c%c%c%c\n",	VGAInfoBlock.VESASignature,
    				    				VGAInfoBlock.VESASignature>>8,      
    				    				VGAInfoBlock.VESASignature>>16,
				    				VGAInfoBlock.VESASignature>>24);
    printf("VESA Version %hu.%hu\n",	VGAInfoBlock.VESAVersion>>8,
    				    				VGAInfoBlock.VESAVersion);				    
    printf("VESA Capabilities %lu\n", 	VGAInfoBlock.Capabilities&0x01);
    printf("# of 64k Blocks %hu\n", 	VGAInfoBlock.TotalMemory);				    

    ADDRESS=VGAInfoBlock.OEMStringPointer;     
    offset= (ADDRESS&0x0000ffff);
    segment=  ADDRESS>>16;
    printf("OEMString Address: %lx %lx\n", OEMString, ADDRESS); 
    printf("SEGMENT %lx OFFSET %lx\n",segment,offset);
    ADDRESS=16*segment+offset;
    _dosmemgetb(ADDRESS,256,OEMString);
    i=0;
    while(OEMString[i]!=0)
    {
    	printf("%c",OEMString[i]);
     i++;
    }
    printf("%c",'\n');
    
    ADDRESS=VGAInfoBlock.VideoModePointer;     
    offset= ADDRESS&0xffff;
    segment=  (ADDRESS>>16)&0x0000ffff;
    printf("VideoModePointer Address: %lx %lx\n", VideoModeInfo, ADDRESS); 
    printf("SEGMENT %lx OFFSET %lx\n",segment,offset);
    ADDRESS=16*segment+offset;	    			
    _dosmemgetw(ADDRESS,256,VideoModeInfo);
    i=0xffff;



   /* do
    {    		i++;
    		printf("%hu:%hx ,",(WORD)i,VideoModeInfo[i]&0x01FF);
    } while(VideoModeInfo[i]!=0xffff);   				    
  */ 				    
}
    

- Raw text -


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