Help getting around PCOPY 
Author Message
 Help getting around PCOPY

I am making a game where you drive around in a tank.  It's very basic
right now, but you get full 360 degree movement, an automap, and some
other nice features.  I've only come across 1 problem though.  I consider
myself a decent (or better) programmer.  I usually use C++ (much faster).
PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
and just get horrendous flicker, the game runs VERY smoothly.  I have a
486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
mine, it's slow.  I'd like to make it, for the most part, machine
indepentant.

E-Mail if you think you can help.



Fri, 06 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY

Quote:

>I am making a game where you drive around in a tank.  It's very basic
>right now, but you get full 360 degree movement, an automap, and some
>other nice features.  I've only come across 1 problem though.  I consider
>myself a decent (or better) programmer.  I usually use C++ (much faster).
>PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
>and just get horrendous flicker, the game runs VERY smoothly.  I have a
>486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
>mine, it's slow.  I'd like to make it, for the most part, machine
>indepentant.

use LINE(0,0)-(320,200),0,bf instead of CLS and right before the PCOPY
do: WAIT &H3DA,8 and then WAIT &H3DA,8,8

That oughta help a bit
Bye! :)



Fri, 06 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY


Quote:


>>I am making a game where you drive around in a tank.  It's very basic
>>right now, but you get full 360 degree movement, an automap, and some
>>other nice features.  I've only come across 1 problem though.  I consider
>>myself a decent (or better) programmer.  I usually use C++ (much faster).
>>PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
>>and just get horrendous flicker, the game runs VERY smoothly.  I have a
>>486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
>>mine, it's slow.  I'd like to make it, for the most part, machine
>>indepentant.
>use LINE(0,0)-(320,200),0,bf instead of CLS and right before the PCOPY
>do: WAIT &H3DA,8 and then WAIT &H3DA,8,8

>That oughta help a bit
>Bye! :)

Just for curiosity's sake, could you explain those commands?

Does the line function just radiate a line from the center of the
screen in all directions to clear it? What is the "bf" for? What do
the "&H3DA,8" and the "&H3DA,8,8" commands mean?

Thanx.

Brad



Fri, 06 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY


Quote:


>>I am making a game where you drive around in a tank.  It's very basic
>>right now, but you get full 360 degree movement, an automap, and some
>>other nice features.  I've only come across 1 problem though.  I consider
>>myself a decent (or better) programmer.  I usually use C++ (much faster).
>>PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
>>and just get horrendous flicker, the game runs VERY smoothly.  I have a
>>486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
>>mine, it's slow.  I'd like to make it, for the most part, machine
>>indepentant.
>use LINE(0,0)-(320,200),0,bf instead of CLS and right before the PCOPY
>do: WAIT &H3DA,8 and then WAIT &H3DA,8,8

>That oughta help a bit
>Bye! :)

Just for curiosity's sake, could you explain those commands?

Does the line function just radiate a line from the center of the
screen in all directions to clear it? What is the "bf" for? What do
the "&H3DA,8" and the "&H3DA,8,8" commands mean?

Thanx.

Brad



Fri, 06 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY

Quote:

>Does the line function just radiate a line from the center of the
>screen in all directions to clear it? What is the "bf" for? What do
>the "&H3DA,8" and the "&H3DA,8,8" commands mean?

the "line" goes from the top left to the bottom  right, BF fills with
the selected color.
the WAIT commands poll the video card until it's done updating the
screen and the electron gun is heading back to the top again...

Bye! :)



Fri, 06 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY


Quote:


>>I am making a game where you drive around in a tank.  It's very basic
>>right now, but you get full 360 degree movement, an automap, and some
>>other nice features.  I've only come across 1 problem though.  I consider
>>myself a decent (or better) programmer.  I usually use C++ (much faster).
>>PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
>>and just get horrendous flicker, the game runs VERY smoothly.  I have a
>>486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
>>mine, it's slow.  I'd like to make it, for the most part, machine
>>indepentant.
>use LINE(0,0)-(320,200),0,bf instead of CLS and right before the PCOPY
>do: WAIT &H3DA,8 and then WAIT &H3DA,8,8

>That oughta help a bit
>Bye! :)

Just for curiosity's sake, could you explain those commands?

Does the line function just radiate a line from the center of the
screen in all directions to clear it? What is the "bf" for? What do
the "&H3DA,8" and the "&H3DA,8,8" commands mean?

Thanx.

Brad

LINE(0,0)-(320,200),0,BF instead of CLS

this will draw a box filled with black, that's the meaning of BF. BF = Box
Fill



Sat, 07 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY



Quote:
> I am making a game where you drive around in a tank.  It's very basic
> right now, but you get full 360 degree movement, an automap, and some
> other nice features.  I've only come across 1 problem though.  I consider
> myself a decent (or better) programmer.  I usually use C++ (much faster).
> PCOPY is slowing down my game a LOT.  When I get rid of the pageflipping,
> and just get horrendous flicker, the game runs VERY smoothly.  I have a
> 486 at 66MHz.  On my friend's Pentium 125, it runs fine with PCOPY.  On
> mine, it's slow.  I'd like to make it, for the most part, machine
> indepentant.

PCOPY isn't technically page flipping... it's page copying. It's slower
than the real page flipping. The real page flipping is done through the
SCREEN command:

  SCREEN ,,, visiblePage

If you set the visiblePage to 0, you'll see page 0 on your screen. If you
change to 1, you'll see page 1 on your screen.

This technique can replace PCOPY. When you use PCOPY you display page 0,
write data to page 1, then PCOPY page 1 to page 0. Afterwards you do the
same thing over -- write data to page 1, then PCOPY page 1 to page 0. Then
you do the same thing over and over to achieve an animation effect.
  Using the page flipping technique, you can display page 0, write data to
page 1, then switch the visiblePage to page 1. After that, you write data
to page 0 (as opposed to page 1 as you do with PCOPY technique), then
switch the visiblePage back to page 0.

Why is switching the visiblePage is faster than PCOPY? Switching the
visiblePage requires BASIC only to execute a single OUT statement (and
change some variables to let other parts of the program to know the
visiblePage value changed). PCOPY, on the other hand, copies the entire
screen data byte-by-byte to another memory location. Naturally, a single
OUT statement is much faster than a series of copy instructions.

Oh, and copiling the program will speed up the process quite a bit, too, if
you haven't done that.

--
Mark K. Kim

http://members.aol.com/vindaci/
http://members.aol.com/markkkim/



Tue, 10 Aug 1999 03:00:00 GMT  
 Help getting around PCOPY


: Just for curiosity's sake, could you explain those commands?

: Does the line function just radiate a line from the center of the
: screen in all directions to clear it? What is the "bf" for? What do
: the "&H3DA,8" and the "&H3DA,8,8" commands mean?

The line (0,0)-(320,200),0,bf draws a box (BF meaning Box Filled), top
left co-ordinates (0,0), bottom right (320,200) (ie covering the whole
screen) in colour 0 (black). This is the same as a CLS.[1]
The OUT commands are a wait for the screen to do a vertical retrace; if
you draw everything while the screen is retracing, then you don't get the
flicker.
Me, I'd use page flipping, since I hate PCOPY; this is done by using the
screen command: SCREEN ,,activePage,visiblePage. You they draw to the
active page, and the visible page is displayed. When you've drawn the next
frame, flip the pages again. Nice and smooth. (Just some unsolicited
advice :)

Aq.

[1] Is doing this really faster than a CLS? I've never found it to be
so.....

--
"The grand plan that is Aquarius proceeds apace." - 'Ronin', Frank Miller.

I would not bet against the existence of time machines. My opponent might
------ have seen the future and know the answer. - Stephen Hawking -------



Mon, 16 Aug 1999 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Help with Pcopy and sprite animation?

2. Getting around docmd cancel error

3. Getting around Outlook E-mail security update

4. Getting Around Modal Forms

5. BETA: Getting Around Guard Model

6. Getting around Modal Forms

7. Getting around form fileld length limit

8. Programming question....getting around threads....

9. getting around databound

10. Getting around 32k limit.

11. Getting around this error

12. getting a control to float around the screen

 

 
Powered by phpBB® Forum Software