bget LDA bgetfl BEQ bgetbuffered LDA bgeteof BEQ bget.norm bget.eof LDA #0 SEC RTS bget.norm LDY chan JSR &FFD7 BCC bget.ptr INC bgeteof LDA #0 RTS bgetbuffered LDA bgetptr CMP bgetend BNE bget2 LDA bgetptr+1 CMP bgetend+1 BNE bget2 LDA bgeteof BNE bget.eof TXA ; Oh for the joys of 65c02 PHA JSR bgetload PLA TAX JMP bgetbuffered bget2 LDY #0 LDA bgetptr STA ostemp LDA bgetptr+1 STA ostemp+1 LDA (ostemp),Y INC bgetptr BNE bget.ptr INC bgetptr+1 bget.ptr INC fileptr BNE bget.end INC fileptr+1 BNE bget.end INC fileptr+2 BNE bget.end INC fileptr+3 bget.end CLC bget.no RTS bgetload.if LDA bgetptr CMP bgetend BNE bget.no LDA bgetptr+1 CMP bgetend+1 BNE bget.no LDA bgeteof BNE bget.no bgetload LDA bgetfl BNE bget.no LDA file.bl STA ostemp LDA file.bl+1 STA ostemp+1 LDY #0 LDA chan STA (ostemp),Y INY LDA buffer STA (ostemp),Y INY LDA buffer+1 STA (ostemp),Y OSBYTE 130 TYA LDY #4 STA (ostemp),Y DEY TXA STA (ostemp),Y INY INY LDA bufferend SEC SBC buffer STA (ostemp),Y INY LDA bufferend+1 SBC buffer+1 STA (ostemp),Y INY LDA #0 STA (ostemp),Y INY STA (ostemp),Y INY LDA fileptr STA fileptr2 STA (ostemp),Y INY LDA fileptr+1 STA fileptr2+1 STA (ostemp),Y INY LDA fileptr+2 STA fileptr2+2 STA (ostemp),Y INY LDA fileptr+3 STA fileptr2+3 STA (ostemp),Y LDX file.bl LDY file.bl+1 LDA #3 JSR &FFD1 LDA #0 ROL A STA bgeteof LDY #1 LDA file.bl STA ostemp LDA file.bl+1 STA ostemp+1 LDA (ostemp),Y STA bgetend INY LDA (ostemp),Y STA bgetend+1 LDA buffer STA bgetptr LDA buffer+1 STA bgetptr+1 RTS put.ptr LDA bgetfl BNE put.ptr.2 LDA fileptr SEC SBC fileptr2 LDA fileptr+1 SBC fileptr2+1 LDA fileptr+2 SBC fileptr2+2 LDA fileptr+3 SBC fileptr2+3 BCC newload LDA fileptr SEC SBC fileptr2 PHA LDA fileptr+1 SBC fileptr2+1 TAX PLA CLC ADC buffer STA bgetptr TXA ADC buffer+1 STA bgetptr+1 RTS newload LDA #0 STA bgeteof STA bgetptr STA bgetptr+1 STA bgetend STA bgetend+1 RTS put.ptr.2 LDA fileptr STA ostemp LDA fileptr+1 STA ostemp+1 LDA fileptr+2 STA ostemp+2 LDA fileptr+3 STA ostemp+3 LDA #1 LDX #ostemp LDY chan JMP &FFDA bput LDY bgetfl BEQ bput.2 LDY chan JMP &FFD4 bput.2 LDY bgetptr CPY bufferend BNE bput.3 LDY bgetptr+1 CPY bufferend+1 BNE bput.3 PHA TXA PHA JSR bputsave PLA TAX PLA JMP bput.2 bput.3 LDY bgetptr STY ostemp LDY bgetptr+1 STY ostemp+1 LDY #0 STA (ostemp),Y INC bgetptr BNE bput.end INC bgetptr+1 bput.end RTS bputsave LDA bgetfl BNE bput.end LDA file.bl STA ostemp LDA file.bl+1 STA ostemp+1 LDY #0 LDA chan STA (ostemp),Y INY LDA buffer STA (ostemp),Y INY LDA buffer+1 STA (ostemp),Y OSBYTE 130 TYA LDY #4 STA (ostemp),Y DEY TXA STA (ostemp),Y INY INY LDA bgetptr SEC SBC buffer STA (ostemp),Y INY LDA bgetptr+1 SBC buffer+1 STA (ostemp),Y INY LDA #0 STA (ostemp),Y INY STA (ostemp),Y LDX file.bl LDY file.bl+1 LDA #2 JSR &FFD1 LDA buffer STA bgetptr LDA buffer+1 STA bgetptr+1 RTS pdec STA bl STX bl+1 STY bl+2 LDX #0 pdec2 LDA #0 LDY #&10 pdec3 ASL bl+1 ROL bl+2 ROL A CMP #10 BCC pdec4 SBC #10 INC bl+1 pdec4 DEY BNE pdec3 PHA INX LDA bl+1 ORA bl+2 BNE pdec2 LDA bl BEQ pdec6 TXA PHA LDA #'0' pdec5 CPX bl BCS pdec5end JSR oswrch INX JMP pdec5 pdec5end PLA TAX pdec6 PLA CLC ADC #48 JSR oswrch DEX BNE pdec6 RTS phex PHA LSR A LSR A LSR A LSR A JSR phex2 PLA phex2 AND #15 CMP #10 BCC phex3 ADC #6 phex3 ADC #48 JMP oswrch pr.number STX bl STY bl+1 STA bl+2 LDX #0 pr.number2 LDA #0 LDY #&18 pr.number3 ASL bl ROL bl+1 ROL bl+2 ROL A CMP #10 BCC pr.number4 SBC #10 INC bl pr.number4 DEY BNE pr.number3 PHA INX LDA bl ORA bl+1 ORA bl+2 BNE pr.number2 pr.number5 PLA CLC ADC #48 JSR oswrch DEX BNE pr.number5 pr.numberend RTS getkey JSR in BCS nogetkey CMP #13 BNE getkeyokay LDA #95 getkeyokay CLC nogetkey RTS in OSBYTE 145,0 BCC in.end LDA rsflag AND #1 BEQ in.end OSBYTE 145,1 in.end TYA RTS removedir LDA osword_orig CLC ADC #6 STA &A8 LDA osword_orig+1 ADC #0 STA &A9 LDY #0 removedir.lo LDA (&A8),Y CMP #33 BCC removedir.e INY BNE removedir.lo removedir.e CPY #0 BEQ removedir.end LDA (&A8),Y CMP #'.' BEQ removedir.dot DEY JMP removedir.e removedir.dot INY removedir.end RTS getosbl LDA osword_orig STA &A8 LDA osword_orig+1 STA &A9 LDA osword_orig CLC ADC #6 LDY #&80 STA (&A8),Y INY LDA osword_orig+1 ADC #0 STA (&A8),Y LDA osword_orig CLC ADC #&80 TAX LDA osword_orig+1 ADC #0 TAY LDA #5 JSR &FFDD PHA LDA osword_orig STA &A8 LDA osword_orig+1 STA &A9 LDY #&80 LDX #0 storeosbl LDA (&A8),Y STA osbl,X INX INY CPX #&12 BNE storeosbl PLA RTS openup OSBYTE 218,0,0 OSBYTE 13,2,0 STX oldfx13_2 OSBYTE 3,20 STX rsflag TXA AND #1 BEQ nortson OSBYTE 2,2 STX oldfx2 nortson RTS closedown LDY chan BEQ closedown2 LDA #0 JSR &FFCE closedown2 LDA #0 LDY osword_orig STY &A8 LDY osword_orig+1 STY &A9 LDY #&FF STA (&A8),Y LDA rsflag AND #1 BEQ closedown3 LDA #2 LDX oldfx2 JSR &FFF4 closedown3 LDA oldfx13_2 BEQ closedown4 OSBYTE 14,2 closedown4 OSBYTE 21,0 OSBYTE 21,1 LDA #3 LDX rsflag JMP &FFF4 checkforSRAM PHA LDA &8000 EOR #&FF STA &8000 CMP &8000 BNE noSRAM EOR #&FF STA &8000 PLA RTS noSRAM BRK "Needs To Be In SRAM",1 framescounted ASC "Frames: " DFB &FF dloadcetpr DFB 31 ASC "~FCET Chosen - *02 to quit" DFB &FF xmodeminfo DFB 31 ASC "~FXmodem - Bash Ctrl X 3 times to quit " DFB 17 DFB &FF cetorxmodem DFB 31 ASC "~AChoose:~G(C)ET (X)modem (Q)uit" DFB &FF starcommpr DFB 31,[20]32 STR "~FUse *02 to quit" DFB 130,42,17 DFB &FF framecopr DFB 31,131 framecopr2 STR "Please wait, counting frames" DFB &FF head1pr DFB [4]10 ASC "~A~]~CXmodem/CET Real Time Transfer @version ~\" DFB [3]10 ASC "~BFile : " DFB &FF head2pr ASC "|M|J|J~BLength: " DFB &FF head3pr ASC "|M|J~BLoad : " DFB &FF head4pr ASC "|M|J~BExec : " DFB &FF head5pr ASC "|M|J|J~BFrames: " DFB &FF head6pr DFB 13,[4]10,[4]32 ASC "~C~]~APress f5 to download file ~\|M|J|J|J" DFB &FF hash DFB 31 ASC "~FPress _ to continue" DFB &FF xmod.blockpr DFB 13 ASC "Block " DFB &FF DSEND.title DFB 12,10 TXT "8-bit Transfer" TXT "Xmodem (CRC) chosen|J" ASC "File : " DFB &FF DSEND.title2 ASC "|M|JLoad : " DFB &FF DSEND.title3 ASC "|M|JExec : " DFB &FF DSEND.title4 ASC "|M|JLength : " DFB &FF DSEND.title5 ASC "|M|JBlocks : " DFB &FF DSEND.titleX TXT "|M|J|JSending file - Bash CTRL X to quit|J" DFB &FF DREC.titleX TXT "|M|J|JReceiving file - Bash CTRL X to quit|J" DFB &FF tab024 DFB 30,[24]9,&FF tab815 DFB 30,[9]9,[15]10,&FF offsettab DFB 0,192,64,96,128,160 rsflag DS 1 term.fl DS 1 oldfx2 DS 1 oldfx13_2 DS 1 check DS 2 chan DS 1 eof DS 1 char DS 1 head DS 1 block DS 1 block.type DS 1 crc.fl seq DS 1 offset DS 1 xtemp DS 1 ytemp DS 1 frames DS 3 obl DS 1 oseq DS 1 ooffset DS 1 obl2 DS 1 oseq2 DS 1 ooffset2 DS 1 bl DS 3 text DS 2 topname DS 25 osbl DS &12 load EQU osbl+2 exec EQU osbl+6 len EQU osbl+&A attr EQU osbl+&E flag DS 1 fsp2 DS &80 data DS &400 optr DS 4 optr2 DS 4 oswrch_A DS 1 oswrch_X DS 1 oswrch_Y DS 1 fileptr DS 4 fileptr2 DS 4 bgetfl DS 1 bgeteof DS 1 bgetptr DS 2 bgetend DS 2 file.bl DS 2 oshwm DS 2 buffer DS 2 bufferend DS 2 osword_orig DS 2 ;net.chan DS 1 ;net.port DS 1