home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.whtech.com
/
ftp.whtech.com.tar
/
ftp.whtech.com
/
Geneve
/
9640news
/
CAT14
/
JOYSTMC.ARK
< prev
next >
Wrap
Text File
|
2006-10-19
|
2KB
|
68 lines
?
******************************************
*** A routine to check for JOYST ***
*** for Monty Schmidt ***
*** ***
*** by Mack McCormack ***
*** Put >9800 in R13 ***
*** ***
******************************************
DEF JOYST
WS EQU >83E0
GRMRD EQU >9800 READ GROM DATA
GRMRA EQU >9802-GRMRD READ GROM ADDRESS
GRMWA EQU >9C02-GRMRD LOAD GROM ADDRESS
JOYST MOV R11,R10 SAVE THE RT ADDR
LWPI WS USE YOUR OWN WORKSPACE HERE
CLR R12 SET CRU BASE ADDRESS TO 0
LI R13,GRMRD GRMRD ADDRESS
BL @PUTSTK SAVE THE GROM STACK
SBO >15 P5 OFF-ALPHA LOCK LINE
LI R5,1 TYPE KEYBOARD
LI R0,>0FFF
CLR R6
LI R12,>24 ROW BASE
LDCR @>30(R5),3
LI R12,>0006 CRU BASE TO READ DATA
CLR R3
SETO R4 CLEAN REGISTER FOR READ
STCR R4,5 READ THE LINE
SRL R4,9
SLA R4,1 TIMES 2 = INDEX INTO TABLE
AI R4,>16E0 JOYSTICK TABLES IN GROM
MOVB R4,@GRMWA(R13)
MOVB @>83E9,@GRMWA(R13) FROM ADDRESS IS YOU R4LB
NOP ALLOW TIME
MOVB *R13,@>8376 WHEREVER YOU WANT THE ADDRESS (Y VALUE)
MOVB *R13,@>8377 THIS IS X VALUE
* THIS IS WHERE YOU CAN CHECK FOR THE CORRECT VALUE *
BL @GETSTK RESTORE THE STACK
JMP JOYST NEED TO LOOP HERE APPROPRIATELY
*OUT B *R10 HERES WHERE TO RT
*-- THIS IS THE SAVE STACK SUBROUTINE --* PAGE 00
PUTSTK INCT @>8373 SUBROUTINE STACK POINTER
MOVB @>8373,R4
SRL R4,8
MOVB @GRMRA(R13),@>8300(R4) SAVE ADDRESS ON STACK
MOVB @GRMRA(R13),@>8301(R4)
DEC @>8300(R4)
RT
*-- THIS ROUTINE RESTORES THE STACK --*
GETSTK MOVB @>8373,R4 LOAD ADDR OF SUBROUTINE STACK
SRL R4,8
DECT @>8373 NEW VALUE OF STACK POINTER
MOVB @>8300(R4),@GRMWA(R13)
MOVB @>8301(R4),@GRMWA(R13)
RT
END
Download complete. Turn off Capture File.