Jump to content
IGNORED

Fire Buttons


Tempest

Recommended Posts

Ok, now I'm trying to read the bottom fire button on the 5200 stick. I was using this code:

 

firebutton1

lda TRIG0

cmp #$00

bne mvplayer

lda #$65

sta sCOLPM0

sta sCOLPM1

 

This should turn my player purple if the button is pressed but it doesn't seem to work. From what I read in the 400/800 programming book TRIG0 will have a 0 if the button is pressed and a 1 otherwise. What am I doing wrong?

 

Tempest

Link to comment
Share on other sites

Ok, a few suggestions on this..

 

- You DO have to write the color values to the shadow registers. As Cafeman pointed out the hardware registers get overwritten by the shadows every v-blank.

 

- Trig0 is not shadowed so you have to read the hardware registers.

 

- Remeber the trig inputs only read the top triggers on the 5200 control. The bottom triggers are read via the keyboard scanning along with the rest of the keypad buttons.

 

Other then this, the code should work as written. You might want to check to be sure the color register isn't getting reset elsewhere in the code.

 

Dan

Link to comment
Share on other sites

quote:

Originally posted by Dan Boris:

- Remeber the trig inputs only read the top triggers on the 5200 control. The bottom triggers are read via the keyboard scanning along with the rest of the keypad buttons.

Dan

 

So are we to scan KBCODE for the top buttons? Is pressing the top buttons suppose to trigger an interrupt like the keypad?

Link to comment
Share on other sites

  • 2 months later...

I've been trying to use the upper fire button without success so far...

I tried the "SHIFT" approach (SKSTAT reading)- that works on the emulator but not on the real console (tried with 2 different controllers)...

Then, I tried to use the VBRK interrupt to handle that but again without success (it seems that my interrupt routine was never called although I eneabled it...)

 

Does anybody has any idea? Any hidden register's bit I need to set/clear somewhere?

 

Any help is appreciated,

Thanks,

OldGuru.

Link to comment
Share on other sites

firebutton1

lda TRIG0

cmp #$00

bne mvplayer

lda #$65

sta sCOLPM0

sta sCOLPM1

 

what about:

 

lda trig0

bne mvplayer

lda #$65

sta $d4xx ; can't remember the actual GTIA/antic register

sta $d4xx

mvplayer

...

 

should be faster. and if it is correct that the 5200 is nearly 800xl... do not use the shadow-registers. better use the antic/gtia registers directly... (who needs shadows anyway?)

 

or does the bios of 5200 does this for you? on 800xl we switch off completly the ROM...

 

i can not believe that you have to use the shadow registers which makes the whole code slower... try to use even zero page where possible...again faster on 6502...

Link to comment
Share on other sites

O.G. I'll just cover what I can remember off hand. Also know that I only did this on the VSS emulator using VTRIGR.

 

1) Set CONSOL high to enable the pots and set bits 0 and 1 to 0 to enable port 0 (I'm sure you did this because you helped me )

 

2) Enable the break interrupt by setting bit 7 of POKMSK and IRQEN.

 

3) Point your VTRIGR vector to your fire button routine.

 

This assumes that your VIMIRQ is set to $FC03. Also do a PLA before you return from this interrupt because VIMIRQ ($FC03) pushes the accumulator on the stack before executing. This of course is interesting as none of the other interrupts need to do this

 

 

I hope this helps you.

Link to comment
Share on other sites

  • 1 month later...

OK,

It was my console!

I got a new one last weekend (my old one is completely out of order) and had a chnace to test the upper fire button code.

 

Both known (to me) ways did work:

1. The VBRK interrupt is taking place when the upper fire button is pressed.

2. Checking bit D3 (If I remember correctly) of SKSTAT does reflect the status of the upper fire button. I use this method in my game now...

 

Hope that clears some confusion in respect to this matter.

DEBRO - Thanks for your help on that one.

O.G.

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...