Ultimate Amiga

Please login or register.

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

Author Topic: Fast RAM on AMOS  (Read 216 times)

0 Members and 1 Guest are viewing this topic.

DarkN3mo

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 22
  • Generic Amiga User
Fast RAM on AMOS
« on: August 09, 2024, 10:29:42 AM »

Has anyone ever tried copying from a BOB to a fast bank and vice versa?
The aim is to have several bob data in fast, and copy on bank 1 of bob 1.

the bob data must be in CHIP at the TIME you use it.
But it's perfectly possible to manually copy blocks of data between chip and fast, which is commonly done in commercial games.
The problem with Amos is finding where the bob data is stored and then making a copy using peek and poke.

Logged

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 69
  • Generic Amiga User
Re: Fast RAM on AMOS
« Reply #1 on: August 22, 2024, 01:20:38 PM »

The aim is to have several bob data in fast, and copy on bank 1 of bob 1.

The procedure to accomplish this is a bit complicated :-\

However, what needs to be known about the data structures is readily found on this page in the manual
https://www.ultimateamiga.co.uk/HostedProjects/AMOSFactory/AMOSProManual/14/1430.html
and on the top of the next page (next-button is located in bottom right corner).

So to create a custom sprite bank, the manual says you can do this:
Code: [Select]
IMAGES=1
Reserve As Work 1,2+8*IMAGES
Doke Start(1)-12,5

Then you need to reserve some chip memory for the image data, and loke the address of this memory block into
Code: [Select]
Start(1)+2+8*(IMAGE-1)
This chip memory block can be larger than required for a given bob image, which means you may theoretically use the same memory block for images of different sizes. All that remains to be done is then to copy the image data from fast ram into this memory block (you should use the Copy instruction for this).

Things to keep in mind:
  • It will get hard to avoid memory leak problems if you let amos compute masks for your images. Either set the mask address to -1 OR keep a precomputed mask in fast ram for each bob image (which you copy to chip ram the same way as with the ordinary image data).
  • You must always do Doke Start(1)-12,0 before erasing bank 1.
  • It is probably a good idea to make sure the value of Deek(Start(1)) is always the same as the highest-numbered image in the bank.
« Last Edit: August 27, 2024, 08:53:46 AM by adrazar »
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022