Classic Computer Magazine Archive PROGRAM LISTING: 88-04/THROTTLE.M65


0100 ; TRIGGER THROTTLE, SOURCE CODE
0110 ; BY MATTHEW RATCLIFF
0120 ; (c)1987, ANTIC PUBLISHING
0130 JIFFY = $14
0140 CTL_S = 190     ; INTERNAL CODE
0150 CTL_Q = 175     ; INTERNAL CODE
0160 VVBLKD = $0224
0170 CH  =   $02FC
0180 ; Operating system equates:
0190 CIO =   $E456
0200 ICCOM = $0342
0210 ICBAL = $0344
0220 ICBAH = $0345
0230 ICBLL = $0348
0240 ICBLH = $0349
0250 ICAX1 = $034A
0260 ICAX2 = $034B
0270 TRIG0 = $D010   ;Joystick trig 0
0280 PUTBIN = $0B
0290 ;
0300     *=  $4000
0310 INIT
0320     LDA VVBLKD  ; Install
0330     STA VEXIT   ; VBI
0340     LDA VVBLKD+1 ; routine
0350     STA VEXIT+1
0360     LDA # <START
0370     LDY # >START
0380     LDX JIFFY
0390 HOLD
0400     CPX JIFFY   ; Sync so
0410     BEQ HOLD    ; VBI won't
0420 ;
0430     STA VVBLKD  ; crash the
0440     STY VVBLKD+1 ; installation
0450     LDA #CTL_S  ; procedure.
0460     STA THROTTLE
0470     LDX #0
0480     STX BUSYCTL ;Enable throt.
0490     LDA #PUTBIN ; Print title
0500     STA ICCOM   ; screen.
0510     LDA LEN
0520     STA ICBLL
0530     STX ICBLH
0540     LDA # <TITLE
0550     STA ICBAL
0560     LDA # >TITLE
0570     STA ICBAH
0580     JSR CIO
0590     RTS         ; Back to DOS
0600 ;
0610 TITLE
0620     .BYTE "}����������������������",155
0630     .BYTE "   By Matthew Ratcliff   ",155,155
0640     .BYTE "Press Joystick trigger to pause",155
0650     .BYTE "(send ^S) scrolling text from modem.",155
0660     .BYTE "Press trigger again to continue",155
0670     .BYTE "(send a ^Q).",155,155
0680 LEN
0690     .BYTE *-TITLE
0700 ;
0710 ; Trigger Throttle installed.
0720 ; Actual program is below.
0730 ;
0740     *=  $0100
0750 ; Place this code in the lower
0760 ; 62 bytes of the 256-byte
0770 ; system stack at $0100-$01FF.
0780 ; (Should be safe!)
0790 ;
0800 VEXIT
0810     .WORD 0     ;VBI exit vector
0820 THROTTLE
0830     .BYTE 0     ; Space or BS
0840 BUSYCTL
0850     .BYTE 0     ; Control flag
0860 START
0870     PHP         ; VBI starts
0880     PHA         ; Save all stats
0890     LDA BUSYCTL ; and regs.
0900     BNE TIMIT   ;ON
0910 ;
0920 TESTON
0930     LDA TRIG0   ; Busy on
0940 ;                 request?
0950     BNE EXIT    ; No. No change.
0960 ;
0970     INC BUSYCTL ;OFF, Turn it ON
0980     LDA THROTTLE ; Send next
0990 ;                throttle state.
1000     STA CH
1010     JSR TOGGLE  ;Change throttle
1020 ;                 state.
1030 EXIT
1040     PLA         ; Restore stats
1050     PLP         ; and reg & exit
1060     JMP (VEXIT)
1070 ;
1080 TIMIT
1090     LDA TRIG0   ; Trig released?
1100     BEQ EXIT    ; No, time-out
1110 ;
1120     LDA #0      ; Yes, re-enable
1130     STA BUSYCTL
1140     JMP EXIT
1150 ;
1160 TOGGLE ;        If ^s, then
1170     CMP #CTL_S  ; next is ^q
1180     BNE TOGQ
1190 ;
1200     LDA #CTL_Q
1210     STA THROTTLE
1220     RTS 
1230 ;
1240 TOGQ
1250     LDA #CTL_S
1260     STA THROTTLE
1270     RTS 
1280 ;
1290     *=  $02E0   ; init addr.
1300     .WORD INIT  ; for LOAD
1310     .END 

Back to previous page