home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Toolkit
/
ADDISKED075.ARC
/
DISK.4
< prev
next >
Wrap
Text File
|
2019-04-13
|
6KB
|
245 lines
;DISK.4
;
;--------------------------------
; SUBROUTINES #1
;--------------------------------
;
PRINTIT STX TEMP1:STY TEMP1+1
LDY #0:PRT1 LDA (TEMP1),Y
BEQ PRT2:PRT3 JSR PRINT:INY
BNE PRT1:INC TEMP1+1:JMP PRT1
PRT2 RTS
;
FLASH LDA CRSR+2:STA TEMP1
LDA #4:STA TEMP1+1
FLS3 LDY #0:FLASHD LDA #0:STA 162
STY TEMP3:LDA (TEMP1),Y:STA TEMP2
FLS4 LDA 162:BMI FLS5
LDY TEMP3:LDA (TEMP1),Y:EOR #128
STA (TEMP1),Y:LDX #15:FLS7 LDY #0
FLS6 DEY:BNE FLS6:DEX:BNE FLS7
LDA #235:STA 162
FLS5 JSR GETIN:BEQ FLS4
STA TEMP2+1:TAX:LDA TEMP2
LDY TEMP3:STA (TEMP1),Y:TXA:RTS
;
INPUT LDY #0
INP1 JSR FLASHD
INP2 CMP #13:BEQ RET
INP3 CMP #20:BEQ BCKUP
INP4 CMP #157:BEQ BCKUP
INP5 CMP #29:BEQ RGHT
INP6 CMP #$30:BCC INP1
CMP #$3A:BCC RGHT:LDX HEX:BEQ INP1
CMP #65:BCC INP1:CMP #71:BCS INP1
RGHT JSR PRINT
LDY TEMP3:CPY LEN
BEQ INP9:INY:JMP INP1
BCKUP LDY TEMP3:BEQ INP1:DEY
INP9 LDA #157:JSR PRINT:JMP INP1
RET LDY #255:INP7 INY:LDA (TEMP1),Y
STA XSTR,Y:CPY LEN:BNE INP7
LDY #0:STY XNUM:STY XNUM+1
STY TEMP1:STY TEMP1+1:DEY
LDA HEX:BNE INP10
INP8 INY:LDA XSTR,Y:CMP #32
BEQ INP11:ASL XNUM:ROL XNUM+1
ASL XNUM:ROL XNUM+1:CLC
LDA TEMP1:ADC XNUM:STA XNUM
LDA TEMP1+1:ADC XNUM+1:STA XNUM+1
ASL XNUM:ROL XNUM+1:LDA XSTR,Y
AND #$0F:CLC:ADC XNUM:STA XNUM
LDA #0:ADC XNUM+1:STA XNUM+1
LDA XNUM:STA TEMP1:LDA XNUM+1
STA TEMP1+1:INP11 CPY LEN
BNE INP8:RTS
INP10 INY:ASL XNUM:ROL XNUM+1
ASL XNUM:ROL XNUM+1:ASL XNUM
ROL XNUM+1:ASL XNUM:ROL XNUM+1
LDA XSTR,Y:CMP #$30:BCS INP12
CLC:ADC #9:INP12 AND #$0F:ORA XNUM
STA XNUM:CPY LEN:BNE INP10
LDA #0:STA HEX:RTS
;
OPN15 LDA #15:LDX DV:LDY #15
JSR SETLFS:LDA #0:JSR SETNAM
JSR OPEN:BCC OP1:TAX:PLA:PLA
TXA:JMP HNDERR:OP1 LDA #2
LDX DV:TAY:JSR SETLFS:LDA #1
LDX #<FLNM:LDY #>FLNM
JSR SETNAM:JSR OPEN:RTS
;
SNDCMD STX TEMP1:STY TEMP1+1
LDX #15:JSR CHKOUT:LDX TEMP1
STY TEMP1+1:JSR PRINTIT
LDA DR:JSR PRINT:LDA #$2C
JSR PRINT:LDA #0:LDX TRCK
JSR OUTNUM:LDA #$2C:JSR PRINT
LDA #0:LDX SCTR:JSR OUTNUM
LDA #13:JSR PRINT:JSR CLRCHN:RTS
;
RDERR LDX #15:JSR CHKIN:LDY #0
RD1 JSR GETIN:STA ERROR,Y
INY:CMP #13:BNE RD1:LDA #0
STA ERROR,Y:STA TEMP2:JSR CLRCHN
RTS
;
CLS15 LDA #2:JSR CLOSE
LDA #15:JSR CLOSE:JSR CLRCHN:RTS
;
HNDERR STA TEMP2:LDX #<DSKERR
LDY #>DSKERR:JSR PRINTIT
LDA TEMP2:CMP #5:BNE HND1
LDX #<DVNT:LDY #>DVNT:BNE HND2
HND1 LDX #<ERROR:LDY #>ERROR
HND2 JSR PRINTIT:LDA TEMP2
CMP #$2F:BCS HND3:LDX #<HAKC
LDY #>HAKC:BNE HND4
HND3 LDX #<QUST:LDY #>QUST
HND4 JSR PRINTIT
HND5 JSR GETIN:BEQ HND5
LDX TEMP2:CPX #$2F:BCS HND6
JSR CLS15:JMP START:HND6 CMP #89
BEQ HND7:JSR CLS15:JMP NWBLK
HND7 JMP NBK1
;
PRTHX2 CLC:JSR PLOT
LDA XNUM+1:LSR:LSR:LSR:LSR
CMP #$0A:BCC PHX1:CLC:ADC #7
PHX1 CLC:ADC #$30:JSR PRINT
LDA XNUM+1:AND #$0F:CMP #$0A
BCC PHX2:CLC:ADC #7
PHX2 CLC:ADC #$30:JSR PRINT
PHX5 LDA XNUM:LSR:LSR:LSR:LSR
CMP #$0A:BCC PHX3:CLC:ADC #7
PHX3 CLC:ADC #$30:JSR PRINT
LDA XNUM:AND #$0F:CMP #$0A
BCC PHX4:CLC:ADC #7
PHX4 CLC:ADC #$30:JSR PRINT:RTS
PRTHX1 CLC:JSR PLOT:JMP PHX5
;
PRTNUM2 CLC:JSR PLOT
LDY #0:LDA XNUM+1
CMP #$28:BCS PNM1:CMP #$27
BCC PNM2:LDA XNUM:CMP #$10
BCS PNM1:INY:BNE PNM1
PNM2 INY:CMP #$04:BCS PNM1
CMP #$03:BCC PNM3:LDA XNUM
CMP #$E8:BCS PNM1:INY:BNE PNM1
PNM3 INY:CMP #0:BNE PNM1
LDA XNUM:CMP #$64:BCS PNM1
INY:CMP #$0A:BCS PNM1
INY:PNM1 JSR PNM5:LDA XNUM+1
LDX XNUM:JSR OUTNUM:RTS
PRTNUM1 CLC:JSR PLOT
LDY #0:LDA XNUM
CMP #$64:BCS PNM4:INY:CMP #$0A
BCS PNM4:INY:PNM4 JSR PNM5
LDA #0:LDX XNUM:JSR OUTNUM:RTS
PNM5 CPY #0:BNE PNM6:RTS
PNM6 LDA #$30:JSR PRINT
DEY:BNE PNM6:RTS
;
HEXSCR LDA #$E8:STA TEMP1
STA TEMP2:LDA #5:STA TEMP1+1
LDA #$D9:STA TEMP2+1:LDY #0:LDX #0
LDA #6:STA TEMP3
HX1 LDA BLOCK,X:LSR:LSR:LSR:LSR
CMP #$0A:BCC HX2:SEC:SBC #$39
HX2 CLC:ADC #$30:STA (TEMP1),Y
LDA TEMP3:STA (TEMP2),Y
INY:LDA BLOCK,X:AND #$0F
CMP #$0A:BCC HX3:SEC:SBC #$39
HX3 CLC:ADC #$30:STA (TEMP1),Y
LDA TEMP3:STA (TEMP2),Y:INY
HX5 INC TEMP1:INC TEMP2:BNE HX4
INC TEMP1+1:INC TEMP2+1:HX4 DEY
BNE HX5:LDA TEMP3:EOR #8
STA TEMP3:INX:BNE HX1:RTS
;
UPDTE LDA #3:STA 646
LDA CRSR+2:STA XNUM
LDX #8:LDY #16:JSR PRTNUM1
LDX #8:LDY #21:JSR PRTHX1
LDY CRSR+2:LDA BLOCK,Y
STA XNUM:STA $0566:LDA #3
STA $D966:LDA BLOCK+1,Y
STA XNUM+1:LDX #8:LDY #24
JSR PRTNUM1:LDX #8:LDY #29
JSR PRTHX1:LDX #9:LDY #35
JSR PRTNUM2:LDX #10:LDY #36
JSR PRTHX2:LDX #10:LDY #22
JSR PRTBIN:LDA XNUM:CMP #13
BEQ UD1:CMP #141:BNE UD2
ORA #64:STA $0562:BNE UD3
UD1 ORA #128:STA $0562:BNE UD3
UD2 LDX #2:STX 212:STX 216
LDX #8:LDY #34:CLC:JSR PLOT
LDA XNUM:JSR PRINT
LDA #0:STA 212:UD3 LDA CRSR+2
CLC:ADC ADDR:STA XNUM
LDA #0:ADC ADDR+1:STA XNUM+1
LDX #10:LDY #9:JSR PRTNUM2
LDX #10:LDY #16:JSR PRTHX2
LDA BLOCK:STA XNUM:LDX #10
LDY #1:JSR PRTNUM1:LDA BLOCK+1
STA XNUM:LDX #10:LDY #5
JSR PRTNUM1
LDA #$D9:STA TEMP1+1
LDA #$E8:STA TEMP1:LDA CRSR+2
STA TEMP2:LDA #0:STA TEMP2+1
ASL TEMP2:ROL TEMP2+1:LDA TEMP2
CLC:ADC TEMP1:STA TEMP1
LDA TEMP2+1:ADC TEMP1+1
STA TEMP1+1:LDY #0:LDA #1
STA (TEMP1),Y:INY:STA (TEMP1),Y
RTS
;
PRTBIN CLC:JSR PLOT
LDA XNUM:STA TEMP1:LDY #7
PBN1 LDX #$30:LDA TEMP1:ASL
STA TEMP1:BCC PBN2:INX
PBN2 TXA:JSR PRINT:DEY:BPL PBN1
RTS
;
BLINK LDA #0:STA 162
STA ONOFF:LDA CRSR+2:LDX CRSR+3
CMP CRSR+3:BCC BLN10:STA TO
STX FROM:JMP BLN3:BLN10 STX TO
STA FROM:BLN3 LDA 162:BMI BLN5
LDY FROM:DEY:BLN4 INY
LDA $0400,Y:EOR #128
STA $0400,Y:CPY TO:BNE BLN4
LDX #15:BLN6 LDY #0:BLN7 DEY
BNE BLN7:DEX:BNE BLN6:LDA #235
STA 162:LDA ONOFF:EOR #1
STA ONOFF:BLN5 JSR GETIN:BEQ BLN3
PHA:LDA ONOFF:BEQ BLN9:LDY FROM
DEY:BLN8 INY:LDA $0400,Y
EOR #128:STA $0400,Y:CPY TO
BNE BLN8:BLN9 PLA:RTS
;
CLRHEX LDX #$5:STX TEMP1+1:INX
STX TEMP2+1:LDA #$E8:STA TEMP1
STA TEMP2:LDA #32:LDY #0
CHX1 STA (TEMP1),Y:STA (TEMP2),Y
INY:BNE CHX1:RTS
;
UPDT2 LDA #3:STA 646:LDX #8
LDY #24:LDA ENCDB:STA XNUM
JSR PRTNUM1:LDX #8:LDY #29
JSR PRTHX1:LDX #10:LDY #22
JSR PRTBIN:RTS
;
PRNTTP LDY #0:LDA #15:STA 646
LDX #0:LDY #0:CLC:JSR PLOT
PTP1 LDA BLOCK,Y:LDX SCRASC
BNE PTP2:JSR PRINTASC:BEQ PTP3
PTP2 STA $0400,Y:LDA #15
STA $D800,Y:PTP3 INY:BNE PTP1:RTS
;