MSX-DOS2 showing directories using 'Find First Entry' _FFIRST

Door Huey

Prophet (2694)

afbeelding van Huey

13-10-2011, 22:35

I am trying to code a little file selection menu for a project I am making.

I thought it would be possible to show files and directories using the FFIRST function (followed by FNEXT). But I only get the file names. No directories (even when playing around with reg b values).

Is there a catch with this function?

     Parameters:    C = 40H (_FFIRST) 
                    DE = Drive/path/file ASCIIZ string
                                or fileinfo block pointer
                    HL = filename ASCIIZ string (only if
                                DE = fileinfo pointer)
                    B = Search attributes
                    IX = Pointer to new fileinfo block
     Results:       A = Error
                    (IX) = Filled in with matching entry

and here is the (quick and dirty) code:

      ;--- Display the working directory
	ld	de,disk_workdir
	ld	hl,(80*6)+16
	call	draw_label

      ;--- Display offset for the filename(s)
	ld	hl,(80*7)+16
	push	hl	
	
      ;--- First time use FFIRST
	ld	c,_FFIRST		
	ld	b,16+1+2+4
	ld	de,disk_workdir
	ld	ix,disk_fib
	call	DOS
_fd_loop:	
      ;--- Check for errors
	and	a
	jp	nz,_fd_error
	
      ;--- Display the filename or directory
	pop	hl
	ld	bc,80
	add	hl,bc
	push hl
	ld	de,disk_fib+1
	call	draw_label

      ;--- Get other files and or directories
	ld	c,_FNEXT
	call	DOS
	
       ; --- Loop
	jp	_fd_loop
	

      ;--- An error was found (probably 0xd7)
_fd_error:	
	pop	hl
	ret

The 'disk_workdir' has the value "B:\",0

Any help/hint is appreciated Wink

Aangemeld of registreer om reacties te plaatsen

Van Huey

Prophet (2694)

afbeelding van Huey

13-10-2011, 23:00

Ok! I am clueless now.
It seems to work after all.

Must be related to a 'dir as disk' feature in BlueMSX.

Running Naked in a Field of FlowersRunning Naked in a Field of FlowersRunning Naked in a Field of FlowersRunning Naked in a Field of FlowersRunning Naked in a Field of Flowers

Van Manuel

Ascended (19270)

afbeelding van Manuel

13-10-2011, 23:38

Due to technical reasons, this is quite hard to emulate properly (dir as disk on its own for DOS1 features only is already quite a tough job...).

Van Huey

Prophet (2694)

afbeelding van Huey

14-10-2011, 09:01

@Manuel: I understand and I am very happy it is there Tongue