[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ADTpro protocol for sending VSDRIVE and BASIC over serial



On 6/13/2013 12:13 AM, osgeld wrote:
now I can get prodos, and the vsdrive driver loaded, but when I attempt to send basic the apple sends 0xB8, I respond with 0x42 and the apple continues to send 0xB8

I copied and pasted the same chunk of code that loads up prodos and vsdrive but the apple never seems to acknowledge the 0x42 (B) response, cant figure out why it would work everywhere else and fail on basic

any thoughts?

Here's the relevant code on the Apple II end:

GoBASIC:
	jsr	msg
	.byte	"BASIC:",$00
	lda	#$0f		; Screen offset for BASIC throbber
	sta	UpdateLoc+1	
	lda	#$B8		; Ask for BASIC ("8")
	sta	Desired+1
	lda	#$42		; First character will be "B" for BASIC
	sta	FirstChar+1	
	jmp	PullFile

PullFile:
	bit	$c010		; Clear the keyboard strobe
Desired:
	lda	#$00		; Ask for the file (value self-modified)
	jsr	PUTC		; Trigger the download

; Poll the port until we get a magic incantation
	ldy	#$20		; Prepare to store file at $2000
	sty	b_p+1
	ldy	#$00		; Prep y reg with zero for pointer ops later
	sty	b_p
Poll:
	jsr	GETC
	bcs	PullFile
FirstChar:
	cmp	#$00		; Compare to the desired first char
	beq	PullGo
	jmp	Poll
PullGo:
	jsr	GETC		; LSB of length
	bcs	PullFile
	sta	size
	jsr	GETC		; MSB of length
	bcs	PullFile
	beq	Poll		; Better not be zero
	sta	size+1		; Ready to read everything else now

ReadFile:			; We got the magic signature; start reading data
...

Any exceptional situation or non-reception of expected stuff will make it loop back around to PullFile and re-request. That's what you're seeing it do. First char doesn't match, MSB of length is zero, or some other kind of timeout...