10
20
30
40
50
60
70
80
90
100
110 :
120 load$ ="Z80Tube120"
130 oswFF$="OswFFv3"
140 save$ ="Z80Tube122"
150 :
160 DIM mem% &FFF,ctrl% 19,name% 19
170 OSCLI"Load "+load$+" "+STR$~mem%
180 IF mem%!&2A6<>&30322E31:PRINT"Not v1.20 Client ROM":END
190 PROCasm
200 OSCLI"Save "+save$+" "+STR$~mem%+"+1000 0 FFFBBC00"
210 ON ERROR END
220 OSCLI"Stamp "+save$
230 END
240 :
250 DEFPROCasm
260 REBOOT=&FCAF:PROG=&FCA8
270 FOR P=0 TO 1
280 P%=mem%-&F000+&F7FC
290 [OPT P*3
300 \ &F7FC: LD A,(HL):LD DE,copystr-mem%+&F000:LD B,4
310 \ &F802: .loop
320 \ &F802: LD A,(DE):CP (HL):JR NZ,LF826
330 \ &F806: INC HL:INC DE:DJNZ loop
340 \ &F80A: POP HL:DEC HL
350 \ &F80C: LD A,(REBOOT)
360 \ &F80F: OR A:JR NZ,LF829
370 \ &F812: LD A,(HL):AND &4F
380 \ &F815: CP &40:JR C,boot
390 \ &F819: CP &48:JR NZ,boot
400 \ &F81D: .code_enter
410 \ &F81D: CP A:LD HL,(PROG):JP (HL)
420 \ &F822:
430 \ &F822: .boot
440 \ &F822: CP A:JP &F4A9
450 \ &F823: \JP RunExec2 :\ BBC BASIC patch
460 \ &F826: \JP RunExec1 :\ BBC BASIC patch
470 \ &F826: .LF826
480 \ &F826: POP HL:JR code_enter
490 \ &F829:
500 \ &F829: .LF829
510 \ &F829: XOR A:LD (REBOOT),A
520 \ &F82D: LD A,(HL):AND &4F
530 \ &F830: CP &40:JR C,LF83D
540 \ &F834: CP &48:JR NZ,LF83D+25
550 \ &F838: LD A,&01:JR code_enter
560 \ &F83C: NOP
570 \ &F83D: .LF83D
580 ]
590 P%=mem%-&F000+&FF22
600 [OPT P*3
610 \ &FF22: .copystr
620 \ &FF22: DEFB 0:DEFM "(C)"
630 \ &FF26:
640 ]
650 P%=mem%-&F000+&F300:[OPT P*3:DEFB 17:]
660 P%=mem%-&F000+&F50A:[OPT P*3:DEFB 200:]
670 P%=mem%-&F000+&F629:[OPT P*3:NOP:NOP:NOP:]
680 P%=mem%-&F000+&F83E:[OPT P*3:DEFB 249:]
690 P%=mem%-&F000+&F857:[OPT P*3:DEFB 249:]
700 P%=mem%-&F000+&FA35:[OPT P*3:AND &FF:]
710 P%=mem%-&F000+&FC74+5 :[OPT P*3:DEFB 4:]
720 P%=mem%-&F000+&FC74+14:[OPT P*3:DEFB 32:]
730 P%=mem%-&F000+&FC74+15:[OPT P*3:DEFB 32:]
740 P%=mem%-&F000+&FC88+14:[OPT P*3:DEFB 32:]
750 P%=mem%-&F000+&F2A6:[OPT P*3:DEFM "1.22":]
760 P%=mem%-&F000+&F730:[OPT P*3:DEFM "1.22":]
770 NEXT
780 X%=ctrl%:Y%=X%DIV256:$name%=oswFF$
790 !X%=name%:A%=5:IF ((USR&FFDD)AND&FF)<>1:ENDPROC
800 oswlen%=X%!6-X%!2:osw%=&FDDA-oswlen%
810 in%=OPENIN(oswFF$):IF in%=0:ENDPROC
820 FOR A%=0 TO oswlen%-1:mem%?(osw%-&F000+A%)=BGET#in%:NEXT A%
830 CLOSE#in%
840 P%=mem%-&F000+&F5B2
850 [OPT 3:LD DE,osw%:LD B,oswlen%:]
860 ENDPROC