Created
October 10, 2020 16:32
-
-
Save ppe/e9cb3f4b3842129f1f7cb0fd9e513b86 to your computer and use it in GitHub Desktop.
XModem receiver for Black Box Sinclair QL, See https://qlforum.co.uk/viewtopic.php?f=11&t=1221&p=10128&hilit=xmrecv_bas#p10128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1000 def proc recv | |
1005 loc filename$,serdev$,ignore$,status,total_bytes | |
1010 input "File name to write? "!filename$ | |
1020 input "Serial device (e.g. ser1r)? "!serdev$ | |
1025 input "Press enter to start receiving..."!ignore$ | |
1030 open #3,serdev$ | |
1040 call base,3 | |
1045 close #3 | |
1050 status = peek(base + 4) | |
1060 if status = 0 then | |
1065 total_bytes = peek_l(base+10) | |
1070 print "Received "&total_bytes&" bytes, saving "&filename$&"..." | |
1080 sbytes filename$,peek_l(base+6),total_bytes | |
1090 print "Done saving "&total_bytes&" bytes!" | |
1100 else | |
1110 print "Error while receiving file, not saving." | |
1120 end if | |
1999 end def | |
29000 def proc load_code | |
29005 loc i,n,w | |
29010 base = respr(32000):i=base:n=0 | |
29020 restore 30000 | |
29025 print "Start loading... "! | |
29030 rep load_loop | |
29040 if eof then exit load_loop | |
29050 read w | |
29060 poke_w i,w | |
29070 i=i+2:n=n+2 | |
29075 if (n mod 50) = 0 then print !n! | |
29080 end rep load_loop | |
29090 print:print "Done loading "&n&" bytes at "&base&"." | |
29999 end def | |
30000 data 24576,46,0,6,9786,0,23172,19450,584,15036,0,17402,628,14357,24832,526 | |
30001 data 15036,1,17402,614,14357,24832,512,20085,8193,24832,452,19072,26112,444,17402,534 | |
30002 data 8840,17402,532,12988,0,17402,666,17914,-74,9417,9353,17914,514,9353,17402,-90 | |
30003 data 12988,0,17402,492,12988,1,32277,17402,482,14353,17402,492,24832,434,-16836,21 | |
30004 data 26112,6,24832,400,4615,28677,30258,20035,18944,27392,354,32277,24832,92,-20356,-1 | |
30005 data 26368,254,19008,27136,34,17402,428,12817,21057,-19844,20,28160,286,12929,17402,462 | |
30006 data 14337,24832,360,24576,-90,17402,390,12817,-20479,26368,16,17402,418,14336,24832,334 | |
30007 data 24576,-56,21057,12929,17402,366,12988,0,32262,24576,-134,24832,234,19072,26112,130 | |
30008 data -19908,4,26368,118,-19908,1,26112,114,24832,208,19072,26112,104,7169,24832,196 | |
30009 data 19072,26112,92,31487,-26111,-17403,26112,82,17914,296,8786,10313,13372,128,13884,200 | |
30010 data 28675,20035,19072,26112,74,-19844,128,26112,66,9353,17402,278,14337,24832,208,24832 | |
30011 data 130,19072,26112,26,14849,8780,24832,124,-17855,26112,16,28672,4102,20085,28927,20085 | |
30012 data 28926,20085,17402,314,14337,24832,160,28926,20085,17402,256,14336,24832,146,28926,20085 | |
30013 data 4668,6,28677,30258,20035,17914,174,9298,4642,-19908,26,26368,-8,21130,8202,18426 | |
30014 data 294,-28533,17402,-444,8832,17402,-456,12988,0,28672,20085,17402,-468,12988,-1,28672 | |
30015 data 20085,30258,28673,20035,20085,12348,127,29184,-11751,20936,-4,20085,-16132,40,-12114,48 | |
30016 data -20306,52,27660,8246,2048,27398,8256,28672,20085,28922,20085,30258,28673,20035,19072,27392 | |
30017 data 8,24576,-12,20085,28672,20085,12040,8316,1,1,13432,208,20114,12804,13432,206 | |
30018 data 20114,17402,138,13432,208,20114,8287,20085,14337,183,33,5,0,6,-32454,12817 | |
30019 data -20479,8,21091,30240,25196,27424,12,21093,24932,8290,31092,25971,14880,15,20341,29728 | |
30020 data 28518,8307,25969,8290,27755,8192,6,21093,29810,31008,18,17505,29793,8306,25953,25632 | |
30021 data 26209,26988,25956,14880,7,17259,29557,27962,8192,12,17249,27747,8291,27507,30061,14880 | |
30022 data 12,17259,29557,27936,26209,26988,14880,1,2560,20035,19072,26112,0,-19844,128,26112 | |
30023 data 0,9353,17402,13432 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment