![]() |
![]() |
#1 |
Prototron
Join Date: Mar 2015
Location: UK
Posts: 384
|
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. |
![]() |
![]() |
#2 |
Registered User
Join Date: Sep 2019
Location: Leicester / England
Posts: 196
|
Try:
If Not(Xfire(1,1)) |
![]() |
![]() |
#3 |
Prototron
Join Date: Mar 2015
Location: UK
Posts: 384
|
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. |
![]() |
![]() |
#4 |
Registered User
![]() Join Date: Nov 2004
Location: Germany
Posts: 623
|
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 |
![]() |
![]() |
#5 | |
Prototron
Join Date: Mar 2015
Location: UK
Posts: 384
|
Quote:
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. |
|
![]() |
![]() |
#6 |
Registered User
![]() Join Date: Nov 2004
Location: Germany
Posts: 623
|
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 00:21. |
![]() |
![]() |
#7 | |
Prototron
Join Date: Mar 2015
Location: UK
Posts: 384
|
Quote:
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. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga 4000 Right mouse Button always pressed | esel | support.Hardware | 3 | 13 June 2019 02:12 |
Keys c,v,n,m don't work when pressed once | ClockworkCoder | support.Hardware | 16 | 04 October 2018 13:20 |
Slamtilt and keys kept pressed | cybermat | support.FS-UAE | 8 | 07 August 2015 15:23 |
Kickstarter: New A1200 Housings Pressed From New Molds | sbergmann | News | 1 | 22 July 2015 20:33 |
Launch asl requester when button is pressed | tolkien | Coders. System | 0 | 14 July 2015 13:36 |
|
|