Long Filename Browser for ZX-UNO / esxDOS

Field Programmable Gate Array based devices! As exciting as they sound
Post Reply
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Long Filename Browser for ZX-UNO / esxDOS

Post by bob_fossil »

As I now have a lot of free time on my hands, I've been spending some of it playing around with the ZX-UNO I purchased a while back. I wondered whether it was possible to do a nicer file browser than the current NMI (F5) implementation. After a couple of days of hacking around, I've knocked up a prototype browser.

For comparison, here's the standard NMI browser:

Image

And here's mine:

Image

It supports long filenames by reading the disk directly. It also sorts the folders and files alphabetically.

The latest version can be downloaded from here.

To install, unzip and copy the BROWSE file into the root SYS folder (where all the other command files live) on your disk. You should then be able to enter:

.browse

from BASIC to launch the browser.

Keyboard commands:
  • Cursor up / down - move selection
  • Space / Enter - select a folder or launch a supported file
  • Delete / P - navigate to parent folder
  • Break / X - exit browser
Issues (I'm aware of):
  • Currently supports FAT16 disks only.
  • Currently only reads from esxdos device 0.
  • Limit of browsing 256 files in a folder.
  • Only launches .tap files (no .sna / .trd support yet).
  • Doesn't start browsing from the current directory - always starts from the root folder.
  • Unsupported characters (> ASCII 127) are displayed as '~'.
  • Filenames (> 32 characters) are not clipped.
I've tried this on a ZX-UNO with a FAT16 formatted 512mb SD card and developed the code with z88dk using an a HDF image of the SD card with SpecEmu. I'd be interested to hear if anyone else can get it working with their ZXUNO. It shouldn't damage your SD card (famous last words) as it's not writing to the disk.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

v0.02
  • Now supports FAT32.
  • Improved directory handling - some folders were being truncated or listing garbage entries.
  • When you launch the browser it now starts from the current esxdos path, rather than dropping you back at the root folder every time.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

v0.03
  • Added 42 character display.
  • Long filenames that spill over the screen are now truncated to fit the screen width and are indicated with an ellipsis character.
  • You can now select and autostart .trd files.
Image
User avatar
emook
Drutt
Posts: 36
Joined: Mon Nov 13, 2017 1:04 pm
Location: Manchester, England
Contact:

Re: New File Browser for ZX-UNO

Post by emook »

Hi Bob - looks great and works well on the Next in classic esxdos mode.

Only issue I see is that its called the same as an existing dotcommand on the Next, .BROWSE on the Next initiates the build in browser.

Cheers

emk
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

emook wrote: Wed Apr 29, 2020 10:01 am
Only issue I see is that its called the same as an existing dotcommand on the Next, .BROWSE on the Next initiates the build in browser.
Thanks for the kind words. I wasn't aware of a clash as I don't have a Next. :) At the risk of it ending up being called .browseymcbrowseface, I'm open to new name suggestions.
XoRRoX
Manic Miner
Posts: 228
Joined: Wed Jul 11, 2018 6:34 am

Re: New File Browser for ZX-UNO

Post by XoRRoX »

Thanks a lot - nice work! :)

Do you have some sort of a feature roadmap so we can see what's still going to be implemented/improved? That way we'll not suggest things that are already planned.
nihirash
Drutt
Posts: 4
Joined: Sat Apr 25, 2020 1:23 pm

Re: New File Browser for ZX-UNO

Post by nihirash »

Thank you a lot!

Feel free to integrate my scl2trd converter inside it.
Or you may share sources and I'll do it by myself.

https://github.com/nihirash/esxdos-scl2trd
User avatar
Seven.FFF
Manic Miner
Posts: 722
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: New File Browser for ZX-UNO

Post by Seven.FFF »

bob_fossil wrote: Wed Apr 29, 2020 10:15 am
emook wrote: Wed Apr 29, 2020 10:01 am
Only issue I see is that its called the same as an existing dotcommand on the Next, .BROWSE on the Next initiates the build in browser.
Thanks for the kind words. I wasn't aware of a clash as I don't have a Next. :) At the risk of it ending up being called .browseymcbrowseface, I'm open to new name suggestions.
It shouldn’t be a problem if you want to keep calling it .browse. NextZXOS keeps its dot commands in /dot/, and eaxDOS running on a Next in the other personalities still uses /bin/, so they won’t clash.

It was done that way deliberately, as NextZXOS provides enhanced versions of many of the standard esxDOS commands which wouldn’t work in esxDOS -.ls for example, is 24KB instead of 2KB and has lots of sorting and column choosing options, more like the *nix version.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
lordoftime79
Drutt
Posts: 14
Joined: Mon Apr 13, 2020 3:10 pm

Re: New File Browser for ZX-UNO

Post by lordoftime79 »

Does this not work on actual spectrums? I have tried it but either it dosnt find the command if i extract it where you say to or if i put it where i know the commands live it works but its a empty list I cant see any of my tap files?
nihirash
Drutt
Posts: 4
Joined: Sat Apr 25, 2020 1:23 pm

Re: New File Browser for ZX-UNO

Post by nihirash »

lordoftime79 wrote: Wed Apr 29, 2020 12:55 pm Does this not work on actual spectrums? I have tried it but either it dosnt find the command if i extract it where you say to or if i put it where i know the commands live it works but its a empty list I cant see any of my tap files?
You should put it into /BIN folder.

esxDOS and divMMC(in zxuno) are the same as on usual speccy.

It should work as I understand.
lordoftime79
Drutt
Posts: 14
Joined: Mon Apr 13, 2020 3:10 pm

Re: New File Browser for ZX-UNO

Post by lordoftime79 »

yea tried that - it runs but it dosnt show any files
User avatar
Seven.FFF
Manic Miner
Posts: 722
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: New File Browser for ZX-UNO

Post by Seven.FFF »

nihirash wrote: Wed Apr 29, 2020 2:13 pm You should put it into /BIN folder.

esxDOS and divMMC(in zxuno) are the same as on usual speccy.

It should work as I understand.
It launches fine in the /BIN folder on my +3 with esxDOS 0.8.6, and my Next running esxDOS 0.8.6 in non-Next personalities. However it hangs on the +3 when I try to launch Castlevania.tap. After powering the +3 off and on again, my SD card seems corrupted. When I type .browse again, I get ESXDOS error #19, 0:1.

It doesn't run in NextZXOS when moved to /DOT/BROWSEBOB - hangs on entry. No idea why. Which esxDOS API calls does it make? Does it make any private non-API calls into the esxDOS ROM?
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
stupidget
Dynamite Dan
Posts: 1586
Joined: Wed Jan 24, 2018 2:09 pm
Location: Sunny Wolverhampton

Re: New File Browser for ZX-UNO

Post by stupidget »

Works fine when I put it in the /BIN folder on my DivMMX.

Do you know if there is any way to make this the default Browser because when I NMI it obviously defaults back to the normal browser.

Also any plans to add the ability to run .sna files?
lordoftime79
Drutt
Posts: 14
Joined: Mon Apr 13, 2020 3:10 pm

Re: New File Browser for ZX-UNO

Post by lordoftime79 »

what am i doing wrong then? all i get is the backslash no list of files.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

XoRRoX wrote: Wed Apr 29, 2020 11:41 am Thanks a lot - nice work! :)

Do you have some sort of a feature roadmap so we can see what's still going to be implemented/improved? That way we'll not suggest things that are already planned.
Thanks! No roadmap as such. I just wanted a more pleasant environment to browse the files on my ZX-UNO. Things left on my to do list include:
  • .sna support.
  • Maybe do something with .pzx files using the loadpzx command for the ZX-UNO?
  • Some sort of settings file / configuration so you can change the colour scheme?
  • Bug fixing - I'm not convinced the FAT16 / 32 reading is 100% correct.
The current development version has some speed ups to the 42 character print routine and lets you scroll up and down a full page of files with cursor left and right. I'm also thinking of adding 'q 'and 'a 'keys to take you to the first and last files in the list.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

Seven.FFF wrote: Wed Apr 29, 2020 3:03 pm
nihirash wrote: Wed Apr 29, 2020 2:13 pm You should put it into /BIN folder.

esxDOS and divMMC(in zxuno) are the same as on usual speccy.

It should work as I understand.
It launches fine in the /BIN folder on my +3 with esxDOS 0.8.6, and my Next running esxDOS 0.8.6 in non-Next personalities. However it hangs on the +3 when I try to launch Castlevania.tap. After powering the +3 off and on again, my SD card seems corrupted. When I type .browse again, I get ESXDOS error #19, 0:1.

It doesn't run in NextZXOS when moved to /DOT/BROWSEBOB - hangs on entry. No idea why. Which esxDOS API calls does it make? Does it make any private non-API calls into the esxDOS ROM?
First off, apologies for breaking your SD card. I haven't used any private API calls (getting documentation for the actual API was difficult enough :) ) aside from the rst 8 codes the NMI menu uses to open and autostart .tap and .trd files. From a quick search of my code, I'm using the following z88dk functions:

Code: Select all

esxdos_f_getcwd
esxdos_f_chdir
esxdos_disk_info
esxdos_disk_read
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

lordoftime79 wrote: Wed Apr 29, 2020 6:14 pm what am i doing wrong then? all i get is the backslash no list of files.
I don't think you're doing anything wrong. If you're getting an empty listing screen, it sounds like my FAT code hasn't managed to read the root folder or current folder correctly. Is your disk FAT16 or FAT32? If you do .cd before running the browser what path does esxdos display?
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

stupidget wrote: Wed Apr 29, 2020 4:08 pm Works fine when I put it in the /BIN folder on my DivMMX.

Do you know if there is any way to make this the default Browser because when I NMI it obviously defaults back to the normal browser.

Also any plans to add the ability to run .sna files?
Cheers. I don't know what differentiates a .dot command from the nmi.sys - is the NMI.SYS just a .dot command in a different location on the disk? I've kept it as a separate command as it's not really an NMI replacement at the moment yet - it's barely a week old at the moment.

I don't use .sna files personally but it's on my to do list to try and get similar loading functionality with the NMI.
lordoftime79
Drutt
Posts: 14
Joined: Mon Apr 13, 2020 3:10 pm

Re: New File Browser for ZX-UNO

Post by lordoftime79 »

ok so I have just formatted a card with fat32 and it works so its my fat16 card it has issue with
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

lordoftime79 wrote: Wed Apr 29, 2020 6:49 pm ok so I have just formatted a card with fat32 and it works so its my fat16 card it has issue with
Good stuff! What size is your FAT16 card? How many partitions does it have? If I can create a similar setup, I can try and replicate the issue here and then try and fix it.
User avatar
Seven.FFF
Manic Miner
Posts: 722
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: New File Browser for ZX-UNO

Post by Seven.FFF »

bob_fossil wrote: Wed Apr 29, 2020 6:24 pm First off, apologies for breaking your SD card.
No problem, I have lots of cards, and it's easy to repair or reformat any broken ones :) This byte mode 256MB card is also FAT16, with a single partition, so perhaps this is the problem. I will try with FAT32 on the same card, and a larger block mode card, to see if the issue goes away.

Here is the castlevania.tap file which blew up, if you want to try it yourself.
Last edited by Seven.FFF on Wed Apr 29, 2020 10:08 pm, edited 1 time in total.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
lordoftime79
Drutt
Posts: 14
Joined: Mon Apr 13, 2020 3:10 pm

Re: New File Browser for ZX-UNO

Post by lordoftime79 »

It is a 2gb no partitions other than standard.
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

Seven.FFF wrote: Wed Apr 29, 2020 9:49 pm
No problem, I have lots of cards, and it's easy to repair or reformat any broken ones :) This byte mode 256MB card is also FAT16, with a single partition, so perhaps this is the problem. I will try with FAT32 on the same card, and a larger block mode card, to see if the issue goes away.

Here is the castlevania.tap file which blew up, if you want to try it yourself.
If you were able to navigate the folders on the card okay (e.g. root folder shown, no garbage or corrupted filename entries), then that suggests the FAT reading code was working. Having had another look at the code which autostarts .tap files, I have spotted an issue which I've just fixed in the current development version. I'd found some code online which autostarts .tap files but that code wasn't designed to run from a .dot file - it uses the ix register to pass the filename into esxdos whereas .dot commands use hl. I'm surprised .tap file loading works at all. :)
User avatar
bob_fossil
Manic Miner
Posts: 654
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

v0.04
  • You can now use cursor left / right to scroll up and down a page of files.
  • You can now use q and a keys to jump to the first and last entries in the list.
  • Fix possible issue using incorrect register when autostarting .tap files.
  • Optimisations to the 42 character print routine.
  • For FAT16 discs, the root cluster contains a set amount of directory entries and the code wasn't taking the size of this area into account when calculating the disk sector offset from the starting cluster of a directory entry. This would manifest itself as showing the root directory but showing garbage or empty lists for the subfolders. Thanks to Spezzi63 for supplying me with a HDF file to debug with.
  • Added .SNA and .Z80 autostart support via the .snapload dot command.
This is software in development so be aware they may be bugs. I haven't encountered any problems with SD card corruption but I've have had one report on a configuration I can't test on outside of emulation. If possible please test on a spare SD card or backup your SD card so you can restore it.
User avatar
Luzie
Manic Miner
Posts: 905
Joined: Fri May 01, 2020 2:07 pm

Re: New File Browser for ZX-UNO

Post by Luzie »

Seven.FFF wrote: Wed Apr 29, 2020 12:20 pm
bob_fossil wrote: Wed Apr 29, 2020 10:15 am Thanks for the kind words. I wasn't aware of a clash as I don't have a Next. :) At the risk of it ending up being called .browseymcbrowseface, I'm open to new name suggestions.
It shouldn’t be a problem if you want to keep calling it .browse. NextZXOS keeps its dot commands in /dot/, and eaxDOS running on a Next in the other personalities still uses /bin/, so they won’t clash.

It was done that way deliberately, as NextZXOS provides enhanced versions of many of the standard esxDOS commands which wouldn’t work in esxDOS -.ls for example, is 24KB instead of 2KB and has lots of sorting and column choosing options, more like the *nix version.
Dear bob_fossil, I just register here on the forum to say "Thank you" for this nice New File Browser supporting LFN!

btw. I renamed it to B so I can start it faster by just entering a .b :lol:
Post Reply