English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 21 July 2020, 21:02   #1
Brick Nash
Prototron

Brick Nash's Avatar
 
Join Date: Mar 2015
Location: UK
Posts: 297
How to check if Xfire is NOT pressed

Sorry, I'm having a little moment here which I can't seem to solve.

I'm using the Amcaf extension's "Xfire" function to be able to use two buttons in my game. It works fine, but I need to check when one of the buttons is NOT pressed (ie, released) and I can't for the life of me figure it out.

With the regular Fire(1) instruction I just do "If Fire(1)<>-1" or "If Fire(1)=0" and that's fine, but I just realised that with Xfire it seems to just check for when it's on.

There's no "=" or way to manually check the state of the bit. The instruction is just "If Xfire(1,1)". I've tried "If Xfire(1,1)<>-1", but it does nothing.

The section for Xfire in the Amcaf manual is literally just four lines of explanation and no examples of how to use it in certain contexts, so maybe I'm using it wrong, but either way I'm kind of lost.

Thanks.
Brick Nash is offline  
Old 21 July 2020, 21:50   #2
Exodous
Registered User

 
Join Date: Sep 2019
Location: Leicester / England
Posts: 97
Try:

If Not(Xfire(1,1))
Exodous is online now  
Old 21 July 2020, 22:06   #3
Brick Nash
Prototron

Brick Nash's Avatar
 
Join Date: Mar 2015
Location: UK
Posts: 297
Bingo! Thank you.

That's very useful, I must have missed it in the manual. I've been wondering if there was an equivalent of GML's "!" in AMOS Basic, so I guess that's it.
Brick Nash is offline  
Old 21 July 2020, 22:20   #4
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 543
hmm, this works too, i have just tested it with amos for windows (which has the amcaf extension installed)

Code:
Do 
   If Xfire(1,1)=-1
      TXT$="ok"
   Else 
      TXT$="nop"
   End If 

   If Xfire(1,0)=0
      TXT1$="nop"
   Else 
      TXT1$="ok"
   End If 

Print TXT$+" / "+TXT1$
Loop
Dan is offline  
Old 21 July 2020, 22:46   #5
Brick Nash
Prototron

Brick Nash's Avatar
 
Join Date: Mar 2015
Location: UK
Posts: 297
Quote:
Originally Posted by Dan View Post
hmm, this works too, i have just tested it with amos for windows (which has the amcaf extension installed)

Code:
Do 
   If Xfire(1,1)=-1
      TXT$="ok"
   Else 
      TXT$="nop"
   End If 

   If Xfire(1,0)=0
      TXT1$="nop"
   Else 
      TXT1$="ok"
   End If 

Print TXT$+" / "+TXT1$
Loop
That's odd? It didn't work for me at all. Especially weird since I'm using Amos for Windows as well.

I think my version may be ropy though as there is a few glitches with it, such as procedures visually corrupting when include files are active, and I can't switch to Cycle Exact without the CPU nosediving to about 2-4%. That's just loading AMOS up, and it stays that way.

The last one is a concern as I can't test my game at a "real" Amiga speed so I've no idea how efficient my code actually is.
Brick Nash is offline  
Old 22 July 2020, 01:05   #6
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 543
Yes, Amos for Windows is crawling when set to Standard/cycle exact. But it maybe up to the 68040 being selected and aga and etc.

There is a way to make Amos for Windows run-able on kickstart 1.3, by copying some files from the workbench to the A4W folder, but the "Intuition.lib" is crashing the Amos (at least here), so it needs to be removed from the configuration (while amos pro is running) .

Last edited by Dan; 22 July 2020 at 01:21.
Dan is offline  
Old 22 July 2020, 11:27   #7
Brick Nash
Prototron

Brick Nash's Avatar
 
Join Date: Mar 2015
Location: UK
Posts: 297
Quote:
Originally Posted by Dan View Post
Yes, Amos for Windows is crawling when set to Standard/cycle exact. But it maybe up to the 68040 being selected and aga and etc.

There is a way to make Amos for Windows run-able on kickstart 1.3, by copying some files from the workbench to the A4W folder, but the "Intuition.lib" is crashing the Amos (at least here), so it needs to be removed from the configuration (while amos pro is running) .
Good to know, thanks. I'll give that a try, but I think I'll be going back to my old setup soon where I was running AMOS from my actual WinUAE HDD setup.

I do like AMOS For Windows a lot for its convenience, and the fact that it has everything pre-installed (extensions/compiler etc.) but it seems a bit flaky in some areas. I shouldn't be be so negative though as I know the developer has passed on, and it has been a great tool so far.
Brick Nash is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Amiga 4000 Right mouse Button always pressed esel support.Hardware 3 13 June 2019 03:12
Keys c,v,n,m don't work when pressed once ClockworkCoder support.Hardware 16 04 October 2018 14:20
Slamtilt and keys kept pressed cybermat support.FS-UAE 8 07 August 2015 16:23
Kickstarter: New A1200 Housings Pressed From New Molds sbergmann News 1 22 July 2015 21:33
Launch asl requester when button is pressed tolkien Coders. System 0 14 July 2015 14:36

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 10:32.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.07455 seconds with 13 queries