TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JERRY COFFIN
from: CHRISTOPHER BUTLER
date: 1997-06-19 16:12:00
subject: Graphics routines

Hi Jerry!
When Jerry Coffin wrote to Christopher Butler on Saturday June 14 1997, Jerry
was talking about Graphics routines.
 CB>> Question: How can I move a block (say 63780 bytes) of memory to
 CB>> another location (say from A000h to A140h)?
 JC> Different compilers have different functions, but _fmemmove is one
 JC> fairly common name for it.
Hmm.. I thought that might be it... it didn't seem to work for me though.
Tell me, is this code okay:
(type straight into the message from memory :)
int GraphicsScreen::Bounce()
{
    unsigned char *screen1 = MK_FP(0xA000,320);
    unsigned char *screen2 = MK_FP(0x9FFF,0xFEBF);
    _fmemmove(screen1,VgaScrn,63780);   // Note: VGAScrn is a member of       
GraphicsScreen, initialized in
                                                 the constructor to save      
initializing it every time.
    _fmemmove(VgaScrn,screen1,63780);
    _fmemmove(screen2,VgaScrn,63780);
    _fmemmove(VgaScrn,screen2,63780);
}
Although since writing that, someone has been talking about changing the 
tart
scan line of the VGA.. I'll probably do that instead.. its cleaner and 
faster...
 CB>> (guess what I'm trying to do now)
 JC> Animation perhaps?
Screen bouncing... (as you see in beat-em-ups when someone gets hurld to the
ground)...
 CB>> I've got a lot more in the class now:
 CB>> Palette routines, fade up, fade down, set and rotate.
 CB>> More drawing routines, line and circle.
 CB>> GetPixel.
 JC> Cool, except for GetPixel.  If at all possible, I'd avoid ever reading
 JC> from the screen.
Hmm... Why's that then? I've always thought its okay, and occaisionally,
practically essential. eg, a program I wrote in QuickBasic drew a random
starfield with a little text message bouncing around. I could leave the text 
and
starfield routines seperate, and just check whether the pixel I was about to
plot a star to was black, and if not, don't plot the pixel...
I've actually added some more, Clear screen, get palette entry and
waitretrace... not really much... I'm running out of ideas :)
Chris
--- FMail/Win32 1.22
---------------
* Origin: Death Butler BBS, +44-1582-620141, 24 Hours (2:257/135)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.