Solved

Scrolling

Posted on 1997-09-22
5
259 Views
Last Modified: 2012-05-04
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.
0
Comment
Question by:jason_brown
5 Comments
 
LVL 3

Expert Comment

by:jaba
Comment Utility
Did you try to move contents of the vido memory ? Its more fast method.
0
 
LVL 15

Expert Comment

by:Tommy Hui
Comment Utility
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_.

0
 

Author Comment

by:jason_brown
Comment Utility
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.
0
 
LVL 1

Accepted Solution

by:
navigator010897 earned 50 total points
Comment Utility
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:)
0
 

Author Comment

by:jason_brown
Comment Utility
Thanks for the encouragement.  I'll check out that library.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now