Jump to content
IGNORED

How to read BoosterGrip buttons ?


Danjovic

Recommended Posts

I am writing a simple controller test ROM and I need to show the status of the CBS Booster Grip state as well.

My first approach was to read the INPT0..3 variables with inline assembly:

   asm
   lda INPT0
   sta tempINPT 
end
   if tempINPT{7} then ...

and of course configure Stella accordingly

image.png.cc744cc39aaf8cfb1bb0aab79d7c84b7.png

 

No need to say that it does not worked, though the generated assembly coded looked ok to me.

2031  f582  a5 08         lda    INPT0
2032  f584  
2033  f584  85 d8         sta    tempINPT
2034  f586  
2035  f586      .L053   ;  if tempINPT{7} then score  =  score  +  010000
		   
2036  f586  
2037  f586  24 d8         BIT    tempINPT
2038  f588  10 09         BPL    .skipL053
2039  f58a      .condpart10
2040  f58a  f8            SED
2041  f58b  18            CLC
2042  f58c  a5 93         LDA    score
2043  f58e  69 01         ADC    #$01
2044  f590  85 93         STA    score
2045  f592  d8            CLD
2046  f593      .skipL053

 

Then I did another test, and used INPT4 on the inline assembly, and I could verify that the code worked (also for INPT5)

   asm
   lda INPT4
   sta tempINPT 
end
   if tempINPT{7} then ...

 

Then my question is:

Does anybody have already performed the reading of the BoosterGrip buttons using Batari Basic (during the development) ? If so, is there any special procedure that I have to perform  ?

 

Thanks!

 

 

 

 

 

  • Like 1
Link to comment
Share on other sites

Thanks Randon Terrain.

 

I have read the thread then changed the section of the standard kernel that discharges the capacitors and now the tester works both on Stella and on Z26. Additionally the code was simplified (changed the asm sections to the simpler INPTx{7} syntax!

 

By the way, I am using the score to register the state of every button input, from joystick 1 and joystick 2.

As the Fire buttons are pulled up, the logic level on idle is 1, while the other buttons are kept low being pushed high by the top Boost and the Trigger buttons.

 

Source code and ROM attached.

 

image.png.3608097a7c60b3f249b2ea68f6272cff.png

 

DualJoyTester.bas DualJoyTester.bas.bin

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...