Image Map Image Map
Page 3 of 6 FirstFirst 123456 LastLast
Results 21 to 30 of 52

Thread: Little Game Engine for MS DOS.

  1. #21

    Default

    No 286 code in xlib, so it works perfectly on 8088 emulated by PCem.

    Now I'll try to explain the only problem I see on mode X. I store data like the image below, so that I can copy tiles to the borders of the visible area very fast, and also copy and restore the bakground used by sprites:

    Untitled2.jpg

    The probelm I see, is scrolling down would be limited to the red line, because then I'll overwrite the tiles and the sprites bkg data.

    Is there some kind of tweak that makes the VGA to wrap around the red line, while leaving the bottom part untouched?. I mean, using the image above, imagine I enable the split screen, and the VRAM wraps only at the red line, so the bottom part of VRAM can't be overwritten.

    I read about the split screen function, and the "Address Wrap Select" register, but I don't know if this can be done.
    Attached Images Attached Images
    Last edited by Mills32; November 27th, 2018 at 01:08 PM.

  2. #22
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,730
    Blog Entries
    1

    Default

    IIRC, there is no such wrap-to-top option ("address wrap select" doesn't do that). But here's a workaround: When you scroll downward and draw the bottom row of tiles, you also draw them to the top just outside of the visible area, so that when you run out of VRAM scrolling downward you can "snap" the visible display to the top of VRAM, and it's already been drawn. Does that make sense?
    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)

  3. #23

    Thumbs up

    Quote Originally Posted by Trixter View Post
    IIRC, there is no such wrap-to-top option ("address wrap select" doesn't do that). But here's a workaround: When you scroll downward and draw the bottom row of tiles, you also draw them to the top just outside of the visible area, so that when you run out of VRAM scrolling downward you can "snap" the visible display to the top of VRAM, and it's already been drawn. Does that make sense?
    Yes, thanks, that should do it.

  4. #24

    Default

    Hi again, I'm having a lot of trouble with a function...

    It worked in the "non mode x" code, But now it stopped working.

    Code:
    //in other files:
    typedef struct tagMAP{					// structure for a map
    	word width;
    	word height;
    	word ntiles;
    	byte *data;
    	byte *collision;
    } MAP;
    
    MAP LT_map;
    
    //a function to allocate data;
    void function(){
    	LT_map.data = farcalloc(32767,sizeof(byte);
    }
    
    //The non working function
    void draw_map_column(word x, word y, word map_offset){
    	unsigned char *mapdata = LT_map.data;
    	word screen_offset = (y<<6)+(y<<4)+(y<<2)+(x>>2);
    	
    	word tile = LT_map.data[map_offset]<<6;     //This is working as expected
    	
    	outport(SC_INDEX, ((word)0xff << 8) + MAP_MASK); //select all planes
    	outport(GC_INDEX, 0x08); 
    	
    	asm{
    		push ds
    		push di
    		push si
    		
    		mov		ax,0A000h
    		mov		ds,ax						
    		mov		si,0C240h 		//590*(336/4);	ds:si Tile data VRAM address 
    	
    		//This is the same as "LT_map.data[map_offset]<<6"
    		//It looks like it does not get the address
    		mov		ax,map_offset
    		les		bx,[mapdata]    
    		add		bx,ax
    		mov		ax,es:[bx]
    		mov		cl,6
    		shl		ax,cl
    		add		si,ax       
     		//if I change this to: "add si,tile" it works as expected
    	}
    	
    	//here there is a lot of  working code to copy tiles
    
    	asm{//END
    		pop si
    		pop di
    		pop ds
    	}
    
    	outport(GC_INDEX + 1, 0x0ff);
    }

    So I just wanted to do "LT_map.data[map_offset]<<6" using the inline assembly.

    Thanks.
    Last edited by Mills32; December 2nd, 2018 at 11:05 AM.

  5. #25

    Default

    So many time wasted... I just had to read the mapdata as bytes (because I stored the tile number as byte).

    Code:
    		les		bx,[mapdata]
    		add		bx,map_offset
    		mov		al,byte ptr es:[bx]  // OK
    		mov		ah,0
    		mov		cl,6
    		shl		ax,cl
    		add		si,ax
    I wonder why it was working in the old mode 13 code.

  6. #26

    Default

    There it is, ported to mode-x (320x240 60Hz). It works perfect on PCem emulator(8086 8Mhz + VGA ISA 8 bit).
    I think the smooth panning is better now (I can't test on real vga).



    Source and code here as always:https://github.com/mills32/Little-Game-Engine-for-VGA
    Last edited by Mills32; December 11th, 2018 at 04:02 PM.

  7. #27
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,730
    Blog Entries
    1

    Default

    Awesome! I can test on PVGA1A 386sx-16 and IBM PS/2 Model 30-286 when I get home.
    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)

  8. #28
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    5,730
    Blog Entries
    1

    Default

    Works nearly perfectly on a 386sx-16 with a PVGA1A embedded VGA, except horizontal scrolling is jerky. Not sure why; I thought panning and addressing was latched, but it's been 20 years and I'd have to look it up to be sure.

    I'll try to test on real IBM PS/2 VGA tomorrow night.
    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)

  9. #29

    Default

    Quote Originally Posted by Trixter View Post
    Works nearly perfectly on a 386sx-16 with a PVGA1A embedded VGA, except horizontal scrolling is jerky. Not sure why; I thought panning and addressing was latched, but it's been 20 years and I'd have to look it up to be sure.

    I'll try to test on real IBM PS/2 VGA tomorrow night.
    I read somewhere you need double buffering for smooth horizontal scrolling, maybe they are right . that means i'll have to use more vram for buffering and i won't be able to store 256 tiles if i want the engine to work on slow cpu

    The weird thing is the scrolling is smooth in both dosbox, PCem, and also on real SVGA and modern cards emulating VGA.

  10. #30

    Default

    I uploaded "DOCVIEW". If that doesn't work, nothing will. DOCVIEW is an old doc viewer for EGA and VGA, and it claims to do smooth scrolling. If it works on real VGA, I'll have to copy exactly how it works.

    Also I think the smooth (hardware) scrolling has not been used in many games, and it may not be very compatible, people just used 286 and 386 fast instructions to redraw the whole screen every frame.

    Here is a proof some games did really use hardware scrolling, this is an 8086 with VGA running Double dragon 3:



    Is it using double buffering in that intro? I don't think it is needed, but I could be completely wrong.
    Attached Files Attached Files

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
  •