home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Set of Apple II Hard Drive Images
/
eric.hdv
/
SOURCE
/
TESTCTRL.SC1.txt
< prev
next >
Wrap
Text File
|
2020-08-13
|
2KB
|
109 lines
;
;
; JOYCTRL - JOYSTICK MIDI CONTROLLERS WITH MIDI THRU
;
;
MAINLOOP JSR CHKMIDI
CHKQUEUE LDA QTAIL
CMP QHEAD
BEQ JOY
LDY #$00
QDATA LDA (QTAIL),Y
STA $C0A9 ;SEND MIDI MSGS FROM QUEUE
WAITTDRE LDA $C0A8
AND #$02
BEQ WAITTDRE
INC QTAIL
LDA QTAIL
CMP QHEAD
BNE QDATA
;
JSR CHKMIDI
;
JOY LDX #$00
LDY #$00
LDA #$80
SEC
BIT PTRIG
JOY1 BIT XTOUT
BPL JOY2
INX
BNE JOY3
JOY2 NOP
NOP
JOY3 BIT YTOUT
BPL JOY4
INY
BNE JOY5
JOY4 NOP
NOP
JOY5 PHA
LDA $C0A8 ;CHECK MIDI
AND #$01
BEQ CONT1
LDA $C0A9 ;MIDI THRU
CMP #$F8
BCS CONT2A
STA $C0A9
CONT0 CLV
BVC CONT2
CONT1 NOP
NOP
CONT2A NOP
NOP
NOP
NOP
CONT2 PLA
SBC #$01
BCS JOY1
LDA XTABLE,X
STA JOYX
LDA YTABLE,Y
STA JOYY
;
JSR CHKMIDI
;
CHKPDL0C LDA JOYX
CMP JOYXPREV ;DID PADDLE X CHANGE
BEQ CHKPDL1C
STA JOYXPREV
;
LDY XUPDBYTE ;STORE PADDLE VALUE IN MESSAGE
STA XMSG0,Y
;
LDY #$00
LDA XMSG0
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
LDA XMSG1
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
LDA XMSG2
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
;
JSR CHKMIDI
;
CHKPDL1C LDA JOYY
CMP JOYYPREV ;DID PADDLE Y CHANGE
BEQ JMPBACK
STA JOYYPREV
;
LDY YUPDBYTE ;STORE PADDLE VALUE IN MESSAGE
STA YMSG0,Y
;
LDY #$00
LDA YMSG0
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
LDA YMSG1
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
LDA YMSG2
STA (QHEAD),Y ;STORE MIDI MESSAGE
INC QHEAD
;
JMPBACK JMP MAINLOOP
;
CHN TESTCTRL.SC2