English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 21 April 2017, 01:03   #1
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Post amiblitz 2 avoid fpu usage

I'm coding a little game with amiblitz2 but i would like to know what commands made use of the fpu to can avoid them.
I know is a difficult answer but I'm sure you know a few of them.

Greetings mates.
tolkien is offline  
AdSense AdSense  
Old 21 April 2017, 10:48   #2
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
It's hard to tell. The main one I've found is Val() (you can replace it for integer conversions with vallong() ), however other commands may use similar code conditionally. For example, NPrint is mentioned as requiring an FPU, but I haven't had any problems with it myself. Your best bet would be to extensively test any executable in WinUAE to make sure it works without an FPU.

Alternatively, you could also use the latest Blitz 2.1 version, which is guaranteed to be FPU code free (and 68020 code free).
Daedalus is offline  
Old 21 April 2017, 22:34   #3
Anakirob
Unregistered User
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 35
Posts: 858
Quote:
Originally Posted by tolkien View Post
I'm coding a little game with amiblitz2 but i would like to know what commands made use of the fpu to can avoid them.
I wrote you a really good answer and my shitty 64-bit PC had to crash when I went to post. So now you get a crappy short answer.

Which AmiBlitz commands need the FPU you ask? Pretty much all of them mate!
And the ones which don't are available in regular old Acid Blitz 2.1!

If the classic Amiga is your target then save yourself a lot of trouble and be sure to use Blitz 2.1 and avoid AmiBlitz. AmiBlitz is really for developing OS3.9 or OS 4 applications.

I know that this is a generalisation, but I'm not typing 1000's of characters to give a decent explanation when Opera could easily take down my entire OS again while I'm half-way through writing the damned thing!
Anakirob is offline  
Old 21 April 2017, 23:17   #4
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Thanks mates...well, it seems the easy way is to go to bb2.
I was confortable with ab2 but the use of a fpu is so stupid...
Thanks again!
tolkien is offline  
Old 22 April 2017, 11:21   #5
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
Well, as I said, it's possible to create code that doesn't use the FPU - I do it all the time. However you could also compromise and do your development in AmiBlitz, but the final compile in Blitz 2, which is also what I tend to do. The problem there being you can't take advantage of all the nice AmiBlitz includes without also porting them over to Blitz 2.1, something I'm slowly working on as I need them...
Daedalus is offline  
Old 22 April 2017, 11:27   #6
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
I'm nor using the includes right now so that is not a problem.
I have tried to compile with bb2 and had a few problems. Need to see what is different. Basicaly, from memory, something like *pointer.bitmap= addr bitmap(bm) give me error. Will look what happends and what are the differences between two blitzs)

Thanks again.
tolkien is offline  
Old 22 April 2017, 17:37   #7
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
Assigning pointers and NewTypes like that should work fine in both versions. However, the definitions are stored in a resident file so perhaps that's the issue? In Blitz 2.1 you need to specify the full path to the resident file, whereas in AmiBlitz you just specify the filename. So it should be Blitzlibs:Bb2objtypes.bb in Blitz 2.1, and just Bb2objtypes.bb or all.res under AmiBlitz. Once that's in place, the same code should work.
Daedalus is offline  
Old 22 April 2017, 17:50   #8
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Thanks...just now am reading about that.
Does bb2 have all.res or can one be created?
I'm thinking then to use ab2 and the final executable be done in bb2.
tolkien is offline  
Old 22 April 2017, 18:17   #9
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
BB2 doesn't come with an all.res, but the AmiBlitz one might work with BB2 since it's just precompiled definitions. If not, it's easy enough to make your own by importing the definitions you need, but you probably only need a couple of the separate files anyway, such as the BBObjects and amigalibs ones.
Daedalus is offline  
Old 22 April 2017, 19:46   #10
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
I have it! Thanks so much. Now I can concentrate in coding
tolkien is offline  
Old 23 April 2017, 00:29   #11
Cylon
Registered User

 
Join Date: Oct 2014
Location: Europe
Posts: 466
I think 'optimize...' causes alot of FPU dependencies in the executable. I mostly use BB2 for all below RTG&060+; this seems to work out quite ok.
Cylon is offline  
Old 23 April 2017, 22:37   #12
tolkien
AmigaMan

tolkien's Avatar
 
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 452
Sure Optimize has a party with the fpu!

I have a problem with *pointer.BitMap = Addr BitMap(0)
It works with Amiblitz2 but no with bb2 or ab3. I add all necessary resident files but donīt know what happends.
I will try *pointer.BitMap = Peek.l(Addr BitMap(0)) again
tolkien is offline  
Old 27 September 2017, 22:33   #13
asrael
Registered User

 
Join Date: Apr 2017
Location: Germany
Posts: 3
Already a while ago.

But is it not possible to avoid FPU code in resulting executable if 'optimize 2' is not specified?



Manfred
asrael is offline  
Old 28 September 2017, 10:37   #14
Daedalus
Registered User

Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 2,279
No, not entirely. You can avoid certain commands that always use the FPU, but there's always a chance that your code still uses an FPU register or opcode at some point. Best to extensively test your executable afterwards to make sure it works fine without an FPU.
Daedalus is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Block ID errors, how do I avoid them? -Acid- support.Hardware 12 21 November 2015 04:23
Games To Avoid (WHDLoad) Tempest 2084 Amiga scene 42 25 August 2009 14:59
How to avoid tearing with E-UAE? Maverick support.OtherUAE 19 06 November 2005 19:18
FPU usage without crystal! r6stu Amiga scene 2 12 October 2005 07:31
Avoid debug output? Flinx support.WinUAE 0 23 July 2002 10:35

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:15.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.19439 seconds with 12 queries