1000 REM "Tube" 1010GOTO 1030 1020DEFFNosbyte8(A,X,Y):[OPT Pass:Lda #A:Ldx #X:Ldy #Y:Jsr osbyte:]:=Pass 1030[OPT Pass 1040\Enters here to set the start address for subsequent 1050\data transfer. 1060\ 1070.initcommon 1140 OPT FNosbyte8(&EA,0,&FF) 1150 Cpx #&FF 1160 Bne NoTube 1170 Ldy #2:Lda (scratch0),Y 1180 Cmp #&FF 1190 Bne proc_two 1200 Iny: Lda (scratch0),Y 1210 Cmp #&FF 1220 Beq NoTube 1230.proc_two 1240 Jsr clatub 1250 Lda #true 1260 Sta tube_present \ Must be last thing - sets CC 1270 Rts 1280.NoTube 1290 Lda #false 1300 Sta tube_present \ Must be last thing - sets CC 1310 Rts 1320 1330.initload 1340 Jsr initcommon 1350 Bne noload2 \ branch if false (i.e. no tube) 1360 Lda #1 \ Parasite to host (2nd proc) 1370 Jmp tubecommon 1380.noload2 1390 Rts 1400\ 1410.initsave 1420 Jsr initcommon 1430 Bne nosave2 \ branch if false (i.e. no tube) 1440 Lda #0 \ Host (2nd proc) to parasite 1450 Jmp tubecommon 1460.nosave2 1470 Rts 1480\ 1490.tubecommon 1500 Ldx scratch0 1510 Ldy scratch1 1520 Jsr &0406 \ Tube entry point 1530 Rts 1540\ 1550.clatub 1560 Lda #&C0+our_fs_no 1570 Jsr &0406 1580 Bcc clatub 1590 Rts 1600 1610.reltub 1620 Lda tube_present 1630 Bne noclaim \ <> true (0 true, &FF false) 1640 Lda #&80+our_fs_no 1650 Jsr &0406 1660.noclaim 1670 Rts 1680\ 1690\ sends a byte (A) to the address, tubed or otherwise 1700\ set up by initdma. 1710\ Non tubed transfers use private z-page dmazp0, dmazp1 1720\ 1730.putbyte 1740 Ldx tube_present 1750 Bne local_put 1760 Sta &FEE5 1770 Rts 1780.local_put 1790 Ldy #0 1800 Sta (scratch0),Y 1850 Rts 1860\ 1870.getbyte 1880 Lda tube_present 1890 Bne local_get 1900 Lda &FEE5 1910 Rts 1920.local_get 1930 Ldy #0 1940 Lda (scratch0),Y 1990 Rts 2000\ 2010\ 2020] 2030RETURN