mirror of
https://github.com/RevCurtisP/C02.git
synced 2025-02-16 14:30:33 +00:00
Added lgtpen module for C64
This commit is contained in:
parent
271d0bd009
commit
a3fa942e30
20
include/c64/lgtpen.a02
Normal file
20
include/c64/lgtpen.a02
Normal file
@ -0,0 +1,20 @@
|
||||
;Lightpen Assembly Language Module for C64
|
||||
|
||||
LGTPNS EQU #$FF ;Light Pen Status (Supported)
|
||||
|
||||
;Read Light Pen
|
||||
;Returns: A = X Position / 2
|
||||
; Y = Y Position
|
||||
; X = Trigger Status ($FF = Pressed)
|
||||
LGTPEN: LDX #0 ;Initialize X to FALSE (0)
|
||||
LDA $D41A ;Check Paddle 1 (Magnum Light Phaser)
|
||||
BPL LGTPET ;If Trigger Pulled, Set X tp $FF
|
||||
LDA $DC01 ;Read Joystick Switches
|
||||
EOR #$FF ;Invert and
|
||||
AND #$1F ;Mask Bits
|
||||
BEQ LGTPEP ;If Trigger Pulled
|
||||
LGTPET: DEX ; Set X to TRUE ($FF)
|
||||
LGTPEP: LDY $D014 ;Read Y Position into Y
|
||||
LDA $D013 ;Read X Position into A
|
||||
RTS
|
||||
|
5
include/c64/lgtpen.h02
Normal file
5
include/c64/lgtpen.h02
Normal file
@ -0,0 +1,5 @@
|
||||
/* Lightpen Module Header File for C64 */
|
||||
|
||||
#define LGTPNS $FF //Light Pen Status (Supported)
|
||||
|
||||
char lgtpen(); //Read Light Pen
|
Loading…
x
Reference in New Issue
Block a user