Results 1 to 6 of 6

Thread: Change screen resolution to 320 x 200 ?

  1. #1

    Change screen resolution to 320 x 200 ?

    how is this possible, do I have to use direct X

    Thanks

    - Sk

  2. #2
    Addicted Member
    Join Date
    Aug 02
    Location
    Baltimore, MD
    Posts
    230
    You don't have to use DirectX, but it's very bad form to change the user's resolution if you're not running full-screen. Also, why would you ever want to use a resolution of 320 x 200?

  3. #3
    Addicted Member jmiller's Avatar
    Join Date
    Jul 02
    Location
    University of Michigan
    Posts
    238
    i don't think that today's monitors even support that low of a resolution; and i'm not sure if newer operating systems like xp do. In fact, i didn't think that it was even possible to run lower than 640x480 with win95

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 01
    Location
    In a microchip!
    Posts
    11,594
    They do, but not via API. Windows won't accept any resolution lower than 640x480, you have to use DX for such low resolutions.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  5. #5
    PowerPoster
    Join Date
    Feb 02
    Location
    Canada, Toronto
    Posts
    5,691
    You can do it in C with interrupt 10h mode 13h

    I used to program in 13h about 5 years ago...
    Unfortunatelly in this mode you have to program everything, I mean to draw a line, you have to make your own function to draw that line, same with everything else.
    here are some functions I used...

    Code:
    //pointer to graphic mode (pixelated)
    unsigned char *vga    = (unsigned char *)MK_FP(0xA000, 0);
    
    // mode for 300x200 is 0x13 (hex 13)
    void vga_init(char mode)
    {
    //	union REGS inregs, outregs;
    
    	asm mov ah, 0
    	asm mov al, mode
    	asm int 0x10
    
    //	inregs.h.ah=0;
    //	inregs.h.al=mode;
    //	int86(0x10, &inregs, &outregs);
    }
    
    char vga_getmode()
    {
    	char mode;
    
    	asm mov ah,0x0f
    	asm int 0x10
    	asm mov mode,al
    
    	return mode;
    }
    
    void WaitRast()
    {
    	asm mov dx,0x3da
    bra1:
    	asm in  al,dx
    	asm and al,8
    	asm jnz bra1
    bra2:
    	asm in  al,dx
    	asm and al,8
    	asm jz bra2
    }
    
    int getpix(int x, int y, unsigned char far *v)
    {
    	int color = -1;
    	if(x < 320 && x > -1 && y < 200 && y > -1)
    		color = v[(y<<8) + (y<<6) + x];
    
    	return color;
    }
    
    void putpix(int x, int y, unsigned char color, unsigned char far *v)
    {
    	if(x < 320 && x > -1 && y < 200 && y > -1)
    		v[(y<<8) + (y<<6) + x] = color;
    
    //	if(x < 640 && x > -1 && y < 480 && y > -1)
    //	{	//v[(y<<9) + (y<<7) + x] = color;
    //		v[(640*y)+x] = color;
    //	}
    	return;
    }
    
    #define uint  unsigned int
    void putpixel(uint x, uint y, uchar col)
    {
    	uint width = 320;
    
    	asm mov ax, 0xA000
    	asm mov es, ax
    
    	asm mov ax, width
    	asm mov bx,[y]
    	asm mul bx
    	asm add ax,[x]
    	asm mov di, ax
    
    	asm mov al,[col]
    	asm mov [es:di], al
    }

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 01
    Location
    In a microchip!
    Posts
    11,594
    WinNT/2k/XP will block that and immediatly kill your app most likely. Unless it's a real DOS application, then they even might let them do it. But then it's not a VB app.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •