I have some code to check for the fire button, set a bit as a button restrainer if fire is hit and play a sound, or clear the bit if the fire button is not pressed. It works fine, but it seems like an awful lot of code to me. Is there a more optimal way to accomplish this than what I am doing here? Here are the relevant bits of code:
Boolean ds 1 FireHitBit0 = Boolean bit0 = %00000001 bit0mask = %11111110
bit INPT4 bmi ____no_button_press lda FireHitBit0 and #bit0 bne ____end_button_check lda FireHitBit0 ora #bit0 sta FireHitBit0 lda #31 sta AUDF0 lda #4 sta AUDC0 lda #$F sta AUDV0 jmp ____end_button_check ____no_button_press lda FireHitBit0 and #bit0mask sta FireHitBit0 ____end_button_check
Thanks in advance for any input.