Thread: graphics optimization

  1. #1
    Registered User
    Join Date
    Feb 2002

    Cool graphics optimization

    Is there a way to do a DMA transfer from RAM to video memory in real-mode DOS programs using graphics mode 13H (a.k.a. 0x13 a.k.a. 19)?

    I am trying to optimize my graphics library so I can start programming games, and I'd like to be able to use a buffer in RAM that I can refresh to the screen with a superfast DMA transfer. I'm mostly just looking for port numbers/memory addresses and protocol for programming the video controller to use a DMA transfer, so the language doesn't matter, but in case anybody's curious I'm using a combination of Borland C++ 5.0 and Assembly. Thanks.

  2. #2
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    i wouldn't think so. also you could gain a great amount of speed using dirty rectangles with your back buffers.
    hasafraggin shizigishin oppashigger...

  3. #3
    Registered User
    Join Date
    Oct 2001
    Video cards are all pretty unique in that sort of thing unfortunately. Might try looking at a lib that already does what you want and figure out how they did it. Allegro for DOS is open source and giftware, might have what you're looking for.
    Allegro precompiled Installer for Dev-C++, MSVC, and Borland:

  4. #4
    If you're trying to optimize your graphics library, this _isn't_ the place to start. Moving data from RAM to video ram is handled by hardware. The video RAM is memory mapped to RAM in the computer. when data is stuffed into the RAM memory with the same map, the GPU scans that memory and copies the data into the VRAM.

    No, if you wrote the libraries, the speed increases are going to occur based on the logic of the code written, not by trying to beat hardware (which you won't succeed at).


  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    You will need that DMA later for sound programming. The best way to refresh the screen is by using a pointer and the flipping the pointer. You can also use a back buffer - but in assembly or inline asm you should be able to blit to 320x200x256 in milliseconds. I can blit to 320x200x32 bit color in DJGPP in the blink of an eye, w/o using assembly. To blit the screen just do a memcpy or code your own in assembly using 32-bit opcodes.

    Using the DMA to blit the screen would be a huge pain in the neck and I'm not even sure if you can do it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. Graphics Programming :: Approach and Books
    By kuphryn in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2004, 08:33 PM
  3. egavga.bgi problem
    By sunil21 in forum A Brief History of
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM
  4. Graphics Devices and Cprintf clash
    By etnies in forum C Programming
    Replies: 6
    Last Post: 05-09-2002, 11:14 AM