Image Map Image Map
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: VGA programming for 8086 / 286, overscan.

  1. #11
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,427
    Blog Entries
    1

    Default

    It does not work on real hardware:



    Sorry.
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Documentation and original disks for: Panasonic Sr. Partner, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  2. #12

    Default

    Thanks a lot for testing!!. Hope that does not damage the screen . (At least I see the blue background and the red and green ship colours there).

    The engine has a lot of memory leaks because I had trouble with malloc, that's surelly the cause for not returning clean to dos.

    I changed again the register values, (I think I'm doing it correctly because I read some online books about VGA registers and related things).

    This is another scene I'm working on.
    IMG_20181007_001221.jpg

    Now my pentium 200 MMX shows the overscan, and the game even works on windows 98 without screen corruption. I also disabled cache in the bios, so that the cpu now runs at 10% speed, tested again and working perfect.

    I'll upload a source this week I think, the code surelly has a lot of bad things to fix.
    Last edited by Mills32; October 8th, 2018 at 08:09 AM.

  3. #13
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,427
    Blog Entries
    1

    Default

    I'll keep this system set up until Saturday, so if you provide another test binary before then, I can test it.
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Documentation and original disks for: Panasonic Sr. Partner, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  4. #14

    Default

    Quote Originally Posted by Trixter View Post
    I'll keep this system set up until Saturday, so if you provide another test binary before then, I can test it.
    I should have provided a complete sample code from the beginning .

    The engine source is a mess, so to make things simpler (and show something on screen), I uploaded a program testing a sprite without transparency, and a background created using one tile.

    If you use "set_mode13(0)" the program (game0.exe) will just enable the known 320x200 mode, without touching anything else, so it should work on any monitor.
    And "set_mode13(1)" (game.exe) changes the visible screen resolution to 304x176, but I think more registers have to be modified so that it works on a real crt.

    I compiled it using turbo C 3.0.

    I'm assuming any modern VGA monitor/tv you connect to a 8086/286 would just work "fine", as it worked on my ms-dos laptop.

    Thanks again for testing it.
    Attached Files Attached Files

  5. #15
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,427
    Blog Entries
    1

    Default

    Thanks, will test tonight.
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Documentation and original disks for: Panasonic Sr. Partner, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  6. #16
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,427
    Blog Entries
    1

    Default

    Some good news and bad news. The good news is that both modes initialize without any distortion and the program runs as normal. The bad news is that the screen is distorted because you aren't pixel-panning correctly. Your code:

    Code:
    void MCGA_Scroll(word x, word y){
    	byte pix = x % 8; 	//pixel panning 
    	x=x>>2;				//x/4
    	y=(y<<6)+(y<<4);	//(y*64)+(y*16) = y*80;
    
    	//change pixel panning register 
    	inp(0x3da);
    	outp(0x3c0, 0x33);		
    	outp(0x3c0, pix<<1);
    	
    	//change scroll registers: HIGH_ADDRESS 0x0C; LOW_ADDRESS 0x0D
    	outport(CRTC_INDEX, 0x0C | (x+y & 0xff00));
    	outport(CRTC_INDEX, 0x0D | (x+y << 8));
    	
    	//wait vertical  sync
    	while ((inp(0x03da) & 0x08));
    	while (!(inp(0x03da) & 0x08));
    }
    ...is malformed. Your understanding of the pixel panning register is incorrect; please read http://www.osdever.net/FreeVGA/vga/vgafx.htm#smooth for more info. What I'm seeing on the screen is "In 256 color graphics modes, due to the way the hardware makes a 256 color value by combining 2 16-bit values, the Pixel Shift Count field is only defined for values 0, 2, 4, and 6. Values 1, 3, 5, and 7 cause the screen to be distorted due to the hardware combining 4 bits from each of 2 adjacent pixels. The Byte Panning field is added to the Start Address Register when determining the address of the top-left hand corner of the screen, and has the value from 0-3. Combined, both panning fields allow a shift of 15, 31, or 35 pixels, dependent upon the video mode. Note that programming the Pixel Shift Count field to an undefined value may cause undesired effects and these effects are not guaranteed to be identical on all chipsets, so it is best to be avoided.".

    Here's the video I shot before I did the above research: https://photos.app.goo.gl/uERPffGUccyWi3TA8
    Offering a bounty for:
    - The software "Overhead Express" (doesn't have to be original, can be a copy)
    - A working Sanyo MBC-775, Olivetti M24, or Logabax 1600
    - Documentation and original disks for: Panasonic Sr. Partner, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)

  7. #17

    Cool

    Quote Originally Posted by Trixter View Post
    Some good news and bad news. The good news is that both modes initialize without any distortion and the program runs as normal. The bad news is that the screen is distorted because you aren't pixel-panning correctly. Your code:

    Code:
    void MCGA_Scroll(word x, word y){
    	byte pix = x % 8; 	//pixel panning 
    	x=x>>2;				//x/4
    	y=(y<<6)+(y<<4);	//(y*64)+(y*16) = y*80;
    
    	//change pixel panning register 
    	inp(0x3da);
    	outp(0x3c0, 0x33);		
    	outp(0x3c0, pix<<1);
    	
    	//change scroll registers: HIGH_ADDRESS 0x0C; LOW_ADDRESS 0x0D
    	outport(CRTC_INDEX, 0x0C | (x+y & 0xff00));
    	outport(CRTC_INDEX, 0x0D | (x+y << 8));
    	
    	//wait vertical  sync
    	while ((inp(0x03da) & 0x08));
    	while (!(inp(0x03da) & 0x08));
    }
    ...is malformed. Your understanding of the pixel panning register is incorrect; please read http://www.osdever.net/FreeVGA/vga/vgafx.htm#smooth for more info. What I'm seeing on the screen is "In 256 color graphics modes, due to the way the hardware makes a 256 color value by combining 2 16-bit values, the Pixel Shift Count field is only defined for values 0, 2, 4, and 6. Values 1, 3, 5, and 7 cause the screen to be distorted due to the hardware combining 4 bits from each of 2 adjacent pixels. The Byte Panning field is added to the Start Address Register when determining the address of the top-left hand corner of the screen, and has the value from 0-3. Combined, both panning fields allow a shift of 15, 31, or 35 pixels, dependent upon the video mode. Note that programming the Pixel Shift Count field to an undefined value may cause undesired effects and these effects are not guaranteed to be identical on all chipsets, so it is best to be avoided.".

    Here's the video I shot before I did the above research: https://photos.app.goo.gl/uERPffGUccyWi3TA8
    Thank you very much for testing it, and for all the info.

    My laptop with SVGA also shows the flashing colours when scrolling, so I'll read the link you provided and fix it.

    The program with the 304x176 resolution, works as I expected, I wanted the overscan to hide the tile updates.

    The rest of the code of the "engine" is just to load maps and music, and it was not interfering with the screen issue.

    Thanks again.

Tags for this Thread

Bookmarks

Posting Permissions

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