Re: SD2IEC REL support

From: silverdr_at_wfmh.org.pl
Date: Mon, 3 Feb 2020 23:11:45 +0100
Message-Id: <3CB9CA0E-B10B-418B-8457-A5FCDFD2177E_at_wfmh.org.pl>
> On 2020-02-03, at 21:43, Jim Brain <brain_at_jbrain.com> wrote:
> 
> On 2/3/2020 9:34 AM, silverdr_at_wfmh.org.pl wrote:
>> 
>> ID says "SD2IEC V0.10.4.0". Does that ring a bell? FWIW - it's the "C64SD" from Manolo. Not sure if he patched anything there.
>> 
>> 
> It does, and my REL support has been in since .8 or so.  If you can create a small test case that exhibits the issue, I can debug.

This piece of code should exhibit it. Works on 1541 (50 returned). Maybe you clear the 50 after CLOSE? PRG sent to your e-mail.


```
.scope test_rel_create
	expected_status = 50 ; RECORD NOT PRESENT

	.segment "RODATA"
	rel_filename:
		.byte "rel-test,l,2"
	sizeof_rel_filename = * - rel_filename

	rel_position_cmd:
		.byte "p";           ; p - position
		.byte $60 | 2        ; the file with secondary address of the open REL file | $60 (2 + 96)
		.byte <1000, >1000   ; to record #1000
		.byte 1              ; position 1 in the record
		.byte 0              ; terminating NUL byte

	.import select_filenumber

	.segment "CODE"
	code:
		jsr select_filenumber ; selects first available LFN and returns it in A
		bcs return            ; no LFNs? TOO MANY FILES OPEN
		pha
		ldx test_device_id ; whatever your device ID is
		ldy #$02 ; 0 and 1 are used for LOAD and SAVE, 15 is for command channel, 2 - 14 are available
		jsr SETLFS
		lda #sizeof_rel_filename
		ldx #<rel_filename
		ldy #>rel_filename
		jsr SETNAM
		jsr OPEN
		ldx #$01
		jsr CHKOUT
		lda #<rel_position_cmd
		ldy #>rel_position_cmd
		jsr STROUT
		jsr CLRCHN
		pla
		pha
		tax
		jsr CHKOUT
		lda #$ff
		jsr CHROUT
		jsr CLRCHN
		pla
		jsr CLOSE

	return:
		clc
		rts
.endscope
```

-- 
SD! 
Received on 2020-05-30 00:47:05

Archive generated by hypermail 2.3.0.