FujiNetWIFI / fujinet-nhandler

Atari N: Handler for FujiNet
GNU General Public License v3.0
7 stars 9 forks source link

Add burst mode I/O. #4

Open tschak909 opened 3 years ago

tschak909 commented 3 years ago

CIO calls the N: handler once for each character transferred.

If open (aux1) mode is not update (12), and if a buffer size and length are specified, then call SIO to transfer the desired number of bytes (minus 1) directly to the buffer, reset the buffer length to 1, and then exit, which will cause CIO to transfer the last character itself.

DOS 2.0's implementation of burst mode is described here: https://www.atariarchives.org/iad/chapter12.php

mr-atari commented 3 years ago

Your entry point is BURST I coded it this way to safe bytes in jumping back.

In my GetByte routine, I do JSR BURST before the actual get a byte in A routine. It returns to me if length = zero. Else it does the job for me.

DGB5 is just a LDY#1/RTS (Use LDY#3 if you want to support TurboBasic)

So the routine pulls in all the bytes except the last one. RTS here, jumps back after tje BURST call. That is your get byte in A routine and exits. This way, your CIO-reply is OK.

Success, Sijmen.

;------------------------------------------------------------------- ; BURST IO (GET_BYTE) FOR THOM, ENTRY = DGB (DEVICE_GET_BYTE) ;------------------------------------------------------------------- ;BURSTS JSR DGB2 ;YOUR GETBYTE ROUTINE ; ; CMP #$9B ;CHECK EOL ; BNE BURST0 ; LDA $22 ; CMP #$5 ;CHECK GET RECORD ; BNE BURST0 ; PLA ;REMOVE RTS FROM STACK ; PLA ; LDA #EOL ;EOL ; BNE DGB5 ;OK/EXIT ; ;BURST0 LDY #0 ; STA ($24),Y ; ; INC $24 ;NEXT BUFFER ; BNE BURST1 ; INC $25 ;BURST1 LDA $28 ;CHECK BOUNDARY ; BNE BURST3 ; DEC $29 ;DEC HIGH ;BURST3 DEC $28 ;DEC LOW ; LDA $29 ;CHECK ZERO HIGH ; BNE BURSTS ; LDA $28 ;CHECK LAST BYTE ; CMP #1 ; BNE BURSTS ;DONE ; ;BURSTE RTS ; ;BURST LDA $28 ;CHECK SIZE >0 / ALWAYS BURST ; ORA $29 ; BNE BURSTS ;DO BURST ; ; RTS ;-------------------------------------------------------------------