mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-22 01:31:33 +00:00
Fixed bugs, updated docs in Apple 2 module paddle
This commit is contained in:
parent
58bc426886
commit
1986abf96a
@ -1,19 +1,28 @@
|
||||
;Paddle Controller Constants and Functions for Apple II
|
||||
|
||||
PADDLS EQU #4 ;Maximum Numbers of Paddles
|
||||
PADDLS EQU 4 ;Maximum Numbers of Paddles
|
||||
|
||||
;Read Paddle
|
||||
;paddle(n) - Read Paddle n
|
||||
;Args: A = Paddle Number (0-3)
|
||||
;Returns: A, Y = Paddle Value (0-255)
|
||||
; Carry Set if P
|
||||
PADDLE: LDY #0 ;Set Result to 0
|
||||
CMP #PADDLS ;If Paddle# >= Max
|
||||
BCS PADDLZ ; Return # of Paddles & Carry Set
|
||||
BCS PADDLZ ; Return 0 & Carry Set
|
||||
TAX ;Copy Paddle# to X Register
|
||||
JSR $FB1E ;Execute Monitor PREAD Routine
|
||||
PADDLZ: TYA ;Copy Result to Accumulator
|
||||
RTS
|
||||
|
||||
BUTTNS EQU #2 ;Maximum Numbers of Buttons
|
||||
BUTTNS EQU 2 ;Maximum Numbers of Buttons
|
||||
|
||||
;Read Paddle Button
|
||||
;button(n) - Read Paddle Button n
|
||||
;Args: A = Button Number (0-1)
|
||||
;Returns: A, Y = Button State
|
||||
; 0 = Not Pressed
|
||||
; $FF = Pressed
|
||||
; X = Button Number
|
||||
; Carry Set if P
|
||||
BUTTON: LDY #0 ;Set Result to 0
|
||||
CMP #BUTTNS ;If Button# >= Max
|
||||
BCS BUTTOZ ; Return Zero & Carry Set
|
||||
|
@ -3,10 +3,11 @@
|
||||
#define PADDLS $04 //Number of Paddles
|
||||
#define BUTTNS $02 //Number of Paddle Buttons
|
||||
|
||||
/* Get Paddle Button Status *
|
||||
* Args: p = Paddle Number *
|
||||
* Returns: $FF if Button Pressed *
|
||||
* $00 if Not Pressed */
|
||||
/* Get Paddle Button Status *
|
||||
* Args: n = Button Number *
|
||||
* Returns: char p = Button Status *
|
||||
* $FF if Pressed *
|
||||
* $00 if Not */
|
||||
void button();
|
||||
|
||||
/* Get Paddle Status *
|
||||
|
Loading…
Reference in New Issue
Block a user