Atari.Org
Click Here
HomeNewsServicesForumsSupport

Talk Atari

Atari.Org Forums


16/32-Bit

8-Bits

Classics

Emulation

Jaguar

Lynx

Classic Consoles Forum 8-Bits Forum 16/32 Forum
Emulation Forum Jaguar Forum Lynx Forum
 
 Subject: RE: setscreen() function usage
Author: earx (gw-ehv05.pnl.philips.com)
Date:   01-10-2003 14:23

well, you could declare arrays. a bit like you said. but you don't need 32000 longs (=128000 bytes). you need 32000 _bytes_.

320*200*4bit=64000*4bit=256000bits=32000bytes..


/* note the 256 byte boundary we have to keep in mind */
unsigned char buf1[32000+256];
unsigned char buf2[32000+256];

/* the pointers */
unsigned char *phys;
unsigned char *log;

void main()
{
unsigned char* temp; /* temp pointer for swap */

/*
* initialize pointers...
* note that they are put on 256byte bounds
*/
phys=(buf1+255)&0xFFFFFF00;
log=(buf2+255)&0xFFFFFF00;

/* your loop */
while(!kbhit())
{
/* paint some stuff */


/* swap pointers */
temp=phys;
phys=log;
log=temp;

/* wait for vbl with some xbios call.. */

/* setscreen */
}

/* read some key here, otherwise os nags ;) */

/* ehmm.. end ;) */
}


this was just some stuff i wrote in 2 secs, i didn't check to see if it was 100% correct.

good luck!

 Topics Author  Date
  setscreen() function usage new Steve Ollett 01-09-2003 23:33 
   RE: setscreen() function usage new earx 01-10-2003 09:23 
   RE: setscreen() function usage new Adam Klobukowski 01-10-2003 09:25 
    RE: setscreen() function usage new earx 01-10-2003 09:44 
     RE: setscreen() function usage new Steve Ollett 01-10-2003 12:59 
      RE: setscreen() function usage  earx 01-10-2003 14:23 
    RE: setscreen() function usage new Mr. B.B.C. 01-10-2003 23:26 
     RE: setscreen() function usage new Steve Ollett 01-13-2003 21:56 

 Reply To This Message
 Your Name:
 Your Email:
 Subject:
 Human verification:   What's this?
               _    __     _ _     
 _ __  ___ _ _| |_ / _|___| (_)___ 
| '_ \/ _ \ '_|  _|  _/ _ \ | / _ \
| .__/\___/_|  \__|_| \___/_|_\___/
|_|                                
    



Copyright © 1997-2024 Atari.Org 
Atari is registered trademark of Infogrames