Ultimate Amiga

Please login or register.

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

Author Topic: AMOS PRO AMAL Problem  (Read 1991 times)

0 Members and 1 Guest are viewing this topic.

DarkN3mo

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 22
  • Generic Amiga User
AMOS PRO AMAL Problem
« on: April 25, 2022, 11:40:38 AM »

In AMAL, I have a problem restarting an animation. It plays the animation well once, but when I restart the routine, nothing happens.
--------------------------------------
  Bob 3,80,60,SPELLEDIMG
   C$="Let X=R0 ; Anim 1,"
   For I=SPELLEDIMG To SPELLEDIMG+9
      C$=C$+"("+Str$(I)-" "+",5)"
   Next
   C$=C$+";"
   Channel 3 To Bob 3
   Amal Off 3
   Amal 3,C$
  ------------------------------------
-------------------------------------------
Procedure _ANIMSPELL
   If Chanan(3)=False
      Amreg(3,0)=80+Rnd(10)
      Amal On 3
      Anim On 3
   End If
End Proc
Logged

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 69
  • Generic Amiga User
Re: AMOS PRO AMAL Problem
« Reply #1 on: April 30, 2022, 05:37:52 PM »

Amal On does nothing when the channel is already on. The only way to restart an arbitrary AMAL program from the beginning that I know of, is to use Amal Off and then reload it with Amal. However, the AMAL programs that you write will not be arbitrary in this sense. By writing them in a certain way they can be given the ability to restart: Add a label right at the beginning of your AMAL program, and you can make the program start over simply by jumping to it (given some appropriate condition, for instance by checking if register 9 has been set to some specific value).

So in this case you could consider replacing the Amal On instruction in _ANIMSPELL with an Amreg instruction, and modify the AMAL program such that it ends with this kind of loop: "B: IR9=1JA; PJB;". Anim On is not required when using the AMAL version of Anim, by the way.
« Last Edit: April 30, 2022, 06:01:24 PM by adrazar »
Logged

DarkN3mo

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 22
  • Generic Amiga User
Re: AMOS PRO AMAL Problem
« Reply #2 on: January 10, 2023, 03:34:34 AM »

yes thanks, it work :)
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022