[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:


What is the best way to write a scrolling routine for Turbo/C.  Using the putpixel command gives me a frame rate of about 1 per sec. with a 166mmx.  Or, where is a good library collection for C where I might find such a routine.  My main interest is in DOS game programming.
1 Solution
Did you try to move contents of the vido memory ? Its more fast method.
Tommy HuiCommented:
You don't want to use putpixel because you're doing things one at a time. To optimize things, you want to do as much stuff in bigger blocks as possible. For example, instead of moving pixels, try moving entire lines. Another possibility is to use the hardware to your advantage. The VGA card has scrolling built-in. If you want to use this method, then you will need to look at any of the graphics book by Michael Abrash e.g. _Zen Of Graphics Programming_.

jason_brownAuthor Commented:
I would need more information about moving a whole line at once.  Do you mean as in redefining ascii characters and printing them or using a compression algorithym?  I just thought there might be  a nice routine that does it all for you without me having to know how to use dos calls and interupts.  I'm lazy in that way I guess, I would still like a URL of a good graphics library for TURBO C, though.
There are a couple of good libraries you can use - one is FastGraph (there is a shareware fully functional version available) and there is another package by another group called Ground Up Software - their package Ground Up Graphics (GUG) is still available free (they also have a FANTASTIC audio package that I have messed around with - I Was very impressed) their site is:  http://www.groundup.com/gug.html

My strongest suggestion is to move to a 32bit compiler like Watcom.  It makes game programming 1000% simpler.  I did some scrolling code on my own, thought it out - and made it work almost on the first try (worked on the third) in 32 bit FLAT memory mode - never got it quite right in standard memory models.

I am not sure if GUG is 32 bit only - I've only looked at it a while back, and still have the notes on it.  

I do know - although FastGraph is a retail package (~250) - it is a fantastic package, will access Mode X, scrolling, super fast pixel blits to the screen, etc.  - I own this package, and I like it.

I have written stuff for Mode 13h (320x200) that has been pretty fast, and very smooth, but like I said before, scrolling only really worked well for me in 32bit flat mode when I was doing my own code.

That is the nice thing about FastGraph - it can do it without having Flat mode memory models - it actually re-shapes video memory so it is a bit bigger then the screen, and then uses page flipping to create ultra smooth - crisp scrolling effects.  You can get the persons book that includes the shareware version of FastGraph - it is called :  Action Arcade, it is written by Diana (I think is her first name, can't read the book this far away at the moment) Gruber (last name I am sure of) - it has tons of source and explanation on how to make the scrolling smooth.

If you want to do 13h scrolling in 32bit flat mode, and would like to see some code, I'd be happy to share as I am not a professional game programmer (just tinkered a little to see:)
jason_brownAuthor Commented:
Thanks for the encouragement.  I'll check out that library.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now