Ultimate Amiga

Please login or register.

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

Author Topic: Scrolling screen issue  (Read 9938 times)

0 Members and 1 Guest are viewing this topic.

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: Scrolling screen issue
« Reply #15 on: May 07, 2015, 08:40:10 PM »

understood. but is that it? just say reverse as fast blah blah blah and it automatically knows to use fast ram instead of chip ram? No other thing need to be done?

I don't recall a reserve as fast instruction. I just read page 05.09.03 (Memory Banks) of the digital version of the AMOS Pro manual.
It seems that Reserve As uses fast RAM as default (if detected) and Reserve As Chip forces it to use chip RAM only.

Apparently this program (found on the aforementioned page) can tell whether it's using fast RAM to store the bank or not (I have not tested it):

Code: [Select]
M=Fast Free : Rem Give the amount of available FAST memory
   Reserve As Work 10,1000
   If M<>Fast Free
     Print "The Data has been stored in FAST Ram"
   Else
     Print "Sorry, there is only CHIP Ram available"
   End If
Logged

Xertese

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 47
  • Generic Amiga User
Re: Scrolling screen issue
« Reply #16 on: May 07, 2015, 08:54:46 PM »

Like i said 15 years but its all coming back  :D
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: Scrolling screen issue
« Reply #17 on: May 07, 2015, 09:49:46 PM »

understood. but is that it? just say reverse as fast blah blah blah and it automatically knows to use fast ram instead of chip ram? No other thing need to be done?

I don't recall a reserve as fast instruction. I just read page 05.09.03 (Memory Banks) of the digital version of the AMOS Pro manual.
It seems that Reserve As uses fast RAM as default (if detected) and Reserve As Chip forces it to use chip RAM only.

Apparently this program (found on the aforementioned page) can tell whether it's using fast RAM to store the bank or not (I have not tested it):

Code: [Select]
M=Fast Free : Rem Give the amount of available FAST memory
   Reserve As Work 10,1000
   If M<>Fast Free
     Print "The Data has been stored in FAST Ram"
   Else
     Print "Sorry, there is only CHIP Ram available"
   End If

There is no way that data is stored in fast ram since there is no other line telling it that the print command uses fast ram. It should technically always say "Sorry, there is only CHIP Ram available" because that print command is used in Chip RAM. Otherwise with that logic, all I had to do is say:

reverse as work 10,1000 and followed by
LEVELOBJECTS(361)

So technically these two lines there will make the program use Fast RAM instead of Chip RAM. If that's all it takes I can do it in less than 1 second command line. However, I was informed that is not enough and that there is a lot more complex code need to be done to force AMOS to put things in Fast RAM.
Logged

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Scrolling screen issue
« Reply #18 on: May 08, 2015, 02:44:21 AM »

AMOS WILL ALWAYS USE CHIP RAM FIRST UNLESS TOLD OTHERWISE.
Where on earth did you get that idea?

AMOS Pro allocates RAM according to requirements.  So, for Memory Banks, it will allocate according to what you specify.  The ONLY exception is if it runs out of available fast RAM.  Then it will still allocate the required memory but has no choice other than to use chip RAM:

Reserve as Work BankNumber,LengthInBytes
Allocates a temporary bank in fast RAM.  The bank will no longer be available when AMOS closes and its memory will be freed.
Reserve as Chip Work BankNumber,LengthInBytes
Allocates a temporary bank in chip RAM.  The bank will no longer be available when AMOS closes and its memory will be freed.
Reserve as Data BankNumber,LengthInBytes
Allocates a permanent bank in fast RAM.  The bank will be integrated into the currently loaded program.  It will load and save with the program.
Reserve as Chip Data BankNumber,LengthInBytes
Allocates a permanent bank in chip RAM.  The bank will be integrated into the currently loaded program.  It will load and save with the program.

In all the above cases, chip RAM will be used if no fast RAM is available.
For permanent banks, they retain their characteristics when integrated into a program and loaded with it.
AMOS Pro takes care of all memory allocation and clean up.  So no action is required from the user.  If you crash AMOS however, be aware that you may have allocated memory (i.e. "known" to AmigaOS) that hasn't been de-allocated.

There is no way that data is stored in fast ram since there is no other line telling it that the print command uses fast ram. It should technically always say "Sorry, there is only CHIP Ram available" because that print command is used in Chip RAM. Otherwise with that logic, all I had to do is say:

reverse as work 10,1000 and followed by
LEVELOBJECTS(361)

So technically these two lines there will make the program use Fast RAM instead of Chip RAM. If that's all it takes I can do it in less than 1 second command line. However, I was informed that is not enough and that there is a lot more complex code need to be done to force AMOS to put things in Fast RAM.
Get a grip!  AMOS Pro allocates all variables, strings and arrays in fast RAM, if it's available.  The only chip RAM it uses is for whatever samples, sprites, bobs, screens and windows are used in a program.

Do not confuse allocating an array with allocating a bank:

  • An array is a component of AMOS Pro Basic.  It is something that AMOS controls.  You can just use it without worrying about the details.  Incidentally, if you're using arrays of strings, or a lot of string manipulation, AMOS Pro will switch in its garbage collection every now and again.  This may come at an unexpected and inconvenient time in your program.  You can dictate when this happens by simply adding a line X=Free to force string garbage cleanup when you want it to happen.
  • A Memory Bank is a chunk of memory that you've requested.  Apart from knowing where it is, what length it is and putting it into its allocated memory list, AMOS knows nothing about what you want to do with it.  If it's a Work bank, AMOS will clean up your mess when you quit.  If it's a Data bank, it will be saved with your program.  And AMOS will still clean up your mess when you quit.
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: Scrolling screen issue
« Reply #19 on: May 08, 2015, 05:38:52 AM »

Thank you for everything and please forgive me for sounding rude or aggressive. :)
Logged

Xertese

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 47
  • Generic Amiga User
Re: Scrolling screen issue
« Reply #20 on: May 09, 2015, 05:15:53 PM »

Well that's the end of me giving any advice seems bruceuncle has all the answers.
Logged

bruceuncle

  • AMOS Dev
  • A500
  • *****
  • Karma: 6
  • Offline Offline
  • Gender: Male
  • Posts: 425
  • WINUAE Amiga User
Re: Scrolling screen issue
« Reply #21 on: May 10, 2015, 10:30:12 AM »

Well that's the end of me giving any advice seems bruceuncle has all the answers.
Certainly not all  ;D .  It's just a by-product of the bug fixing and correcting the docs/help file.  I have to check and test each instruction (apart from a few device ones, where I don't have the hardware).  So it's inevitable that I've built up an in-depth knowledge of the AMOS instruction set.  However, that doesn't mean I've got a lot of knowledge about using AMOS.  So please don't let my posts put you off posting to the forum.  My apologies if I come across a bit heavy handed at times.  Just put it down to "grumpy old man" syndrome...  ;)
Logged
Repeat after me ...  "The AMOS Pro architecture is complex but it is not complicated."

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: Scrolling screen issue
« Reply #22 on: May 11, 2015, 09:29:37 PM »

Well that's the end of me giving any advice seems bruceuncle has all the answers.
Certainly not all  ;D .  It's just a by-product of the bug fixing and correcting the docs/help file.  I have to check and test each instruction (apart from a few device ones, where I don't have the hardware).  So it's inevitable that I've built up an in-depth knowledge of the AMOS instruction set.  However, that doesn't mean I've got a lot of knowledge about using AMOS.  So please don't let my posts put you off posting to the forum.  My apologies if I come across a bit heavy handed at times.  Just put it down to "grumpy old man" syndrome...  ;)

Agreed.

As in most forums, you'll always have a few 'experts' on a subject. Sometimes other people beat you to helping someone, and sometimes they will correct things that have been said in error.

It's the nature of forums, and personally I like having others back me up on things that I said, or correct me on things I got wrong.
Logged
Pages: 1 [2]   Go Up
 

TinyPortal 2.2.2 © 2005-2022