The source code (in beebasm format) is in the .zip file along with a .ssd but I'll inline it here for reference:
Code: Select all
tube = $027A OSARGS = $FFDA OSBYTE = $FFF4 OSWRCH = $FFEE lptr = $AA osbyte_read_high_order_address = $82 org $2000 .start .TubeOff TYA:BPL NOTTUBE :\ Tube already disabled LDA #0:STA tube :\ Clear Tube presence flag LDA &FFB7:STA lptr+0 :\ Point to default vectors LDA &FFB8:STA lptr+1 LDY #&20 .TubeOffEvent LDA (lptr),Y:STA &200,Y :\ Reset EVENTV INY:CPY #&22:BNE TubeOffEvent JSR ServiceInit :\ Initialise ROMs JSR ReselectFS :\ Reselect current filing system .NOTTUBE LDA #osbyte_read_high_order_address JSR OSBYTE TYA JSR printhex .HANG JMP HANG .ReselectFS LDA #0:TAY:JSR OSARGS :\ Get current filing system TAY:LDX #18:BNE Service :\ Reselect filing system .ServiceInit LDX #&37 .Service LDA #143:JMP OSBYTE :\ Issue service call .printhex PHA LSR A LSR A LSR A LSR A JSR printhex4 PLA AND #$F .printhex4 TAX LDA hexdigits,X JMP OSWRCH .hexdigits equs "0123456789ABCDEF" .end save "TEST", start, end, $ff2000, $ff2000
Since the tube is explicitly disabled if present, I think this should always print FF. And it does when I run it in b-em from DFS, and it does for shifters74 when run from MMFS, but when run from ANFS with the tube active it prints 00.
I am planning on discarding this code in PLASMA anyway so it doesn't matter in a practical sense, but I'm curious as to why this happens. Am I doing something wrong?