Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Need help understanding Synchro and synchro off commands  (Read 3207 times)

0 Members and 1 Guest are viewing this topic.

MichaelVParent

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 62
Need help understanding Synchro and synchro off commands
« on: May 17, 2008, 09:20:11 PM »

Hi everyone,

I'm working on a demo and need to animate many more than 16 bobs.  I know that synchro off and synchro are the commands I need to do so, but dont understand how to use it porperly.  I tried to use it and suddenly all the movement timing was lost and the bobs were moving at lightning speed. (not the desire result ;) )

anyone interrested in making a quick example for its proper use so I can move and animate more than 16 bobs at a time?

thanks much.

Mike (Holymonkey)
Logged

selur

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 83
Re: Need help understanding Synchro and synchro off commands
« Reply #1 on: May 17, 2008, 10:03:45 PM »

Hello Holymonkey

Well i don't understand your problem because you pick up right commands.
Yes, you should use Synchro and Synchro Off commands as I remember it should be something like that:

Double buffer
Synchro Off

Bob 1,x,y,image
..
Rem putting 64 Bobs on screen
...
Bob 63,x,y,image
Bob 64,x,y,image

for i=1 to 64
channel i to bob i
next i

for i =1 to 64
amal i,"...................."
next i

Amal On

repeat
Synchro
Wait Vbl
until mouse key
Logged

MichaelVParent

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 62
Re: Need help understanding Synchro and synchro off commands
« Reply #2 on: May 18, 2008, 03:14:23 AM »

So, maybe my problem is I was trying to use synchro off and synchro with the stos compatible animation commands and was not using amal.  I'll have to give that a shot.

Thank much for the reply. :)
Logged

MichaelVParent

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 62
Re: Need help understanding Synchro and synchro off commands
« Reply #3 on: May 18, 2008, 08:20:53 PM »

I swithced all the animation and movement commands to amal and then it worked just as you described.  I still wonder about wheter things will move and animate at very different rates on different amiga systems. (faster processors)
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Need help understanding Synchro and synchro off commands
« Reply #4 on: May 18, 2008, 08:37:00 PM »

Wait VBL will limit the animation to the frame rate of the host computer.  A PAL system will run at 50 frames per second and an NTSC system will run at 60 frames per second.
Logged

MichaelVParent

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 62
Re: Need help understanding Synchro and synchro off commands
« Reply #5 on: May 18, 2008, 10:10:34 PM »

hmmm...that is a pretty drasitc difference in timing....Is there any easy way you know of to insure it runs the same speed ?
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: Need help understanding Synchro and synchro off commands
« Reply #6 on: May 19, 2008, 12:05:42 AM »

If the NTSC function returns true, you'll know it runs at 60 FPS.  Otherwise it will run at 50.  It is possible to write 2 versions of your program and then have an introduction program that shows a few credits and then loads the proper version of your program with the Run command.
Logged

Sidewinder

  • Forum Mod
  • A600
  • *****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 155
    • http://www.liquido2.com/
Re: Need help understanding Synchro and synchro off commands
« Reply #7 on: May 22, 2008, 01:44:09 AM »

I wasn't aware the the difference in timing between PAL and NTSC was that noticeable.  At least I've never heard of problems.

Most games don't make that high of a frame rate anyway.  The Wait Vbl command tells the program to pause until the next vertical blanking period of the monitor.  It's ideal to perform any drawing or buffer swapping during the vertical blank to avoid flickering animations (caused when the drawing is not in sync with the beam) or partially drawn images (caused when the image is copied onto a screen in the middle of a frame).  The program may actually spend much longer than a vertical blank period drawing to a back buffer, computing AI, and all the other tasks necessary to build the frame.  The Wait Vbl is called to wait for the first vertical blank after the frame is built, and then the back buffer is swapped to the front so that by the time the beam starts drawing again it has the new image data to use for the next frame.

The Synchro command is specifically used with AMAL.  Synchro Off turns off the automatic, interrupt driven AMAL system which is limited to 16 channels.  There are two advantages to using the Synchro command yourself rather than the automatic Synchro:

1.  You can use up to 64 different AMAL programs to animate different objects, rather than only 16.
2.  You can directly control when the AMAL programs are run using Synchro.  Executing this command before you redraw the objects will ensure the objects are all moved before the drawing begins.  If you left the automatic synchro on, then the movements may skip frames and appear to jump rather than move smoothly.

The main disadvantage to using Synchro is that the AMAL programs will not be run at specific intervals and so the movements may appear to slow down when drawing frames with a lot of objects (especially Bobs).  The choice is between the possibility of slow movements with Synchro Off, or jerky movements with Synchro On.
Logged
- Sidewinder
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022