Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: Volvo_0ne on February 16, 2018, 06:50:39 PM

Title: AMOS & Processing power?
Post by: Volvo_0ne on February 16, 2018, 06:50:39 PM
Is it possible to make AMOS claim all the processing power of a system from (say) a floppy boot?
Any hints/tips much appreciated

TIA
V1
Title: Re: AMOS & Processing power?
Post by: SamuraiCrow on February 16, 2018, 07:14:39 PM
Use an extension to bump the task priority to maximum and lose the keyboard handler or call the equivalent function using exec call.
Title: Re: AMOS & Processing power?
Post by: KevG on February 17, 2018, 12:35:03 PM
Hi Volvo_One

You could also disable multi-tasking completely. This gives you quite a speed boost. Some extensions support it like Turbo and AMCAF.

Slightly off topic, but being able to get the 'rastport' address that your AMOS screen is using is very handy as well as it allows you to use functions in the graphics library. Some are actually slower than AMOS but some are faster. Early versions of the Easylife extension support this as well as AMCAF.
Title: Re: AMOS & Processing power?
Post by: Volvo_0ne on February 18, 2018, 06:44:46 PM
Hi Volvo_One

You could also disable multi-tasking completely. This gives you quite a speed boost. Some extensions support it like Turbo and AMCAF.

Slightly off topic, but being able to get the 'rastport' address that your AMOS screen is using is very handy as well as it allows you to use functions in the graphics library. Some are actually slower than AMOS but some are faster. Early versions of the Easylife extension support this as well as AMCAF.
Thanks KevG
Is there any way to do this at startup (eg without using extensions) ?

I'm not a huge fan of them(extensions), as there almost always seems to be some kind of limitation  or faffing about to use their commands.
Thus I like to use pure AMOS and/or Compiler.

TIA
V1
Title: Re: AMOS & Processing power?
Post by: KevG on February 21, 2018, 10:35:18 AM
To disable multi-tasking use 'forbid()'
To enable multi-tasking use 'permit()'

Both functions are called from the Exec.library with an offset value.
for example....

D=Execall(-132) : Rem Disable multi-tasking
E=Execall(-138) : Rem Enable multi-tasking

These functions don't use additional arguments so the DREG and AREG arrays can be left alone.


Be careful though. Disabling multi-tasking can lock out the keyboard so you won't be
able to break out of a program if you wish.

What I do in my game loops is check for the right mouse button and if clicked
I jump to a routine to enable multi-tasking again.

As for getting the 'rastport', You will need to do a lot of research, unless you use an extension.

Hope this helps.
Title: Re: AMOS & Processing power?
Post by: Volvo_0ne on February 28, 2018, 08:59:10 PM
Thanks KevG
I'll give this some attention later in the week when I have the time...

Regards
V1
Title: Re: AMOS & Processing power?
Post by: adrazar on February 28, 2018, 10:22:33 PM
A test I just made indicated that the rastport address is located in Screen Base + 164.
Title: Re: AMOS & Processing power?
Post by: KevG on March 01, 2018, 09:32:58 AM
Quote
A test I just made indicated that the rastport address is located in Screen Base + 164.

Try quitting AMOS and run the program again with the same offset value of 164. The reason I ask this is because you tend to get different values when you reset AMOS. Also, try out a graphics library function for example writepixel to see if it works.
Title: Re: AMOS & Processing power?
Post by: KevG on March 01, 2018, 05:31:34 PM
Quote
A test I just made indicated that the rastport address is located in Screen Base + 164.

That is not correct. Post your test code below please.
Title: Re: AMOS & Processing power?
Post by: adrazar on March 01, 2018, 08:33:57 PM
Ops, I forgot to multiply the offset by 2! The address I found was actually Screen Base + 328.

Code: [Select]
For I=0 To 7
   Screen Open I,320,200,16,Lowres
   SB=Screen Base
   RASTPORT=Scrn Rastport
   Screen To Front 0 : Screen 0
   Print Hex$(RASTPORT,8),Hex$(Leek(SB+2*164),8)
Next I

Scrt Rastport is from the AMCAF extension.
(the test code was pretty simple: For I=-2000 to 2000 : If Leek(Screen Base+2*I)=Scrn Rastport Then Print I : Next I)
Title: Re: AMOS & Processing power?
Post by: KevG on March 02, 2018, 12:48:46 PM
Oh dear. Where do I start?

1. It does not work.
2. I know about the function in the AMCAF extension. Why are you using it here?
3. Why are you opening 8 screens?
4. There is no link from the AMOS Screen Base to the Rastport so why are you using it?
5. Do you actually know what a Rastport is?
6. You stated in a post above that you made a test that confirmed the Rastport is an offset from the Screen Base. This is not the case. You cannot get the Rastport from the Screen Base.
7. Your code is absolute nonsense.

Please explain to me why you posted this?
Title: Re: AMOS & Processing power?
Post by: adrazar on March 02, 2018, 04:55:37 PM
5. Do you actually know what a Rastport is?

No! ;D

So sorry about not making sense, my posts were based on the assumption that the said rastport was the address you would get by using Scrn Rastport from AMCAF.
Title: Re: AMOS & Processing power?
Post by: SamuraiCrow on March 02, 2018, 04:58:13 PM
A RastPort is made every time you open a new screen.  It sits at a different address every time.  It's dynamically allocated, in other words.
Title: Re: AMOS & Processing power?
Post by: adrazar on March 04, 2018, 06:04:07 PM
Wait a minute, it actually does work..!  :o
Code: [Select]
Areg(1)=Leek(Screen Base+328)
Dreg(0)=100 : Dreg(1)=100 : Ink 5
If Gfxcall(-324) Then Print "WritePixel failed"
A lot of the information referred to in the help section "AmigaDos --> Libraries" can be found here:
http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_2._guide/node000F.html (http://amigadev.elowar.com/read/ADCD_2.1/Includes_and_Autodocs_2._guide/node000F.html)
Title: Re: AMOS & Processing power?
Post by: KevG on March 04, 2018, 10:09:21 PM
Adrazar...

I give you top marks for your persistence but it is still not correct.
The highest offset in the AMOS screen base structure is 190 ($BE) and that
is the offset for the Autoback value. So your offset of 328 cannot be correct.

Although you are using the correct offset in the graphics library for the 'writepixel' function, it returns ZERO which indicates success. However, there is no pixel plotted on the screen.

The AMOS screen structure is described below for your information....
http://www.amigacoding.com/index.php/AMOS:Screenbase_structure (http://www.amigacoding.com/index.php/AMOS:Screenbase_structure)

As you can see, it is a lot different from a standard Intuition screen structure and there is no reference to the RASTPORT at all.

There must be another way to do it. I'll have a try myself once I get some spare time.


Title: Re: AMOS & Processing power?
Post by: adrazar on March 05, 2018, 12:25:54 AM
Although you are using the correct offset in the graphics library for the 'writepixel' function, it returns ZERO which indicates success. However, there is no pixel plotted on the screen.
Hmm, I got a green pixel at coordinate (100,100) when I ran the code in my previous post, so it's odd you didn't get the same result. ???

There is a file among the sources that seems dedicated to describe the AMOS screen structure, so I'll add it as an attachment. It doesn't contain any information beside the offsets and their names, but the names are often enough to guess the contents. (it supports that the rastport address is located in Screen Base+328; the list you referred to is probably incomplete (at least for v2.0!))
Title: Re: AMOS & Processing power?
Post by: KevG on March 05, 2018, 04:41:21 AM
Well that does explain why I was not getting results because I am using AMOS 1.3 not AMOS Pro.

Thank you for the file. I will take a look at it later and investigate further.
Title: Re: AMOS & Processing power?
Post by: KevG on March 05, 2018, 04:53:26 PM
Yes, the offset to that file will work because it has an offset for the Rastport address.
Unfortunately, this doesn't work with AMOS1.3 because the screen base offsets are different and there is no entry for the Rastport.

I think I need to look at the AMOS 1.3 eq.s source code to find out how it was done.
Title: Re: AMOS & Processing power?
Post by: Volvo_0ne on September 06, 2018, 10:00:43 PM
Yes, the offset to that file will work because it has an offset for the Rastport address.
Unfortunately, this doesn't work with AMOS1.3 because the screen base offsets are different and there is no entry for the Rastport.

I think I need to look at the AMOS 1.3 eq.s source code to find out how it was done.

and remember that this is the amos pro part of the forum  :D