Long Filename Browser for ZX-UNO / esxDOS

Field Programmable Gate Array based devices! As exciting as they sound
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

there were several posts about testing the browser and launching it on emulators, which are not so many with ESXDos support.
So, I launched this browser in the LNX emulator, using a hammer, a chisel and some swear words.
This is a very entertaining quest :)
Image
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

I "spied" the work with cursor keys in the .LCE / IMG plugin, and did the same for myself. Probably the same can be done in the plugins PT1, PT2, PT3.
One question remains - is it possible to make the position of the current file pointer on the screen in the browser also change when switching to the previous \ next \ last \ first file?
Is this too complicated or do I need to read the SDK carefully?
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Tue Dec 15, 2020 3:12 pm I "spied" the work with cursor keys in the .LCE / IMG plugin, and did the same for myself. Probably the same can be done in the plugins PT1, PT2, PT3.
Yes, I was going to suggest having a look at the source for the SCR plugin as that is a good example of handling file navigation but you've found the same code in the LCE / IMG plugin. Navigation code can be added to the other music plugins - and the other image formats for that matter, I just didn't get round to doing it yet. :)
azesmbog wrote: Tue Dec 15, 2020 3:12 pm One question remains - is it possible to make the position of the current file pointer on the screen in the browser also change when switching to the previous \ next \ last \ first file?
Is this too complicated or do I need to read the SDK carefully?
I'm not sure I understand your problem. If I select a .SCR file from the browser, then for example press cursor right three times to navigate to the next 3 screens and then exit the plugin with BREAK the selection highlight back in the browser file list has now moved down by 3 files. The selected file in the browser should be on the same file as the one you navigated to when you exit the plugin.

One issue I can see with the current plugin system is that if you navigate between files and return PLUGIN_RESTORE_SCREEN which would cause the selection to be updated - the update gets queued until you can't navigate any more. I think I did this to stop an unnecessary screen restore happening between screen changes in the IMG / SCR / LCE plugins But you might want to do this for plugins that don't take over the screen, like music plugins

I'll have a think about it. Apologies if I've misunderstood your question.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

bob_fossil wrote: Tue Dec 15, 2020 9:57 pm
One issue I can see with the current plugin system is that if you navigate between files and return PLUGIN_RESTORE_SCREEN which would cause the selection to be updated - the update gets queued until you can't navigate any more. I think I did this to stop an unnecessary screen restore happening between screen changes in the IMG / SCR / LCE plugins But you might want to do this for plugins that don't take over the screen, like music plugins
When a music file is playing and I move to the next one, it starts playing, but the file pointer is on the previous one and remains where the playback began.
In screen file viewers, this is not important, but in music viewers it would be visually visible which file is playing now. The screen needs to be updated without leaving the plugin.
Lost in translation, I understand :)
and yes, I read the SDK, and I understood, as far as possible)
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Tue Dec 15, 2020 10:15 pm When a music file is playing and I move to the next one, it starts playing, but the file pointer is on the previous one and remains where the playback began.
In screen file viewers, this is not important, but in music viewers it would be visually visible which file is playing now. The screen needs to be updated without leaving the plugin.
Lost in translation, I understand :)
and yes, I read the SDK, and I understood, as far as possible)
Not lost in translation. :) I have just modified the PT1 plugin to handle navigation keys and now see what you were describing. Fix will be in the next test version along with the improved PT1 plugin too (and maybe the other module players too).
sromero
Drutt
Posts: 7
Joined: Sun Dec 20, 2020 8:37 am

Re: New File Browser for ZX-UNO

Post by sromero »

bob_fossil wrote: Sun Dec 13, 2020 4:17 pm v0.13
  • New plugin system to handle multiple file types from the browser. Plugins are located in '/BIN/BPLUGINS'. See 'plugins/plugins_info.txt' for the list of supported files and 'plugins/plugins_sdk.txt' for technical information about writing your own browser plugin. Plugins are not supported by the 'No_MMC_Memory' version.
  • PZX file loading on the ZX-UNO now works from the NMI.
  • An 8.3 filename could end up being named with a left over LFN entry in the FAT.
  • Speed up navigation performance when moving the selection scrolls the file list up or down by a line.
  • External command (Shift + L) code stopped working after the previous changes to support MMC memory banks.
  • Couple of small optimisations to the FAT code.
Download here.
Hi Bob,

I just made your NMI browser the default one in my ZX-Uno and I'm very happy with the results. Being able to read long names was a must for me...

Thank you very much for your work in this software.

Just some suggestions, I don't know if they're doable or useful, but I just wanted to share them:

1.- In MiSTer and ZXBaremulator, when you type a letter (0-9, A-Z) cursor goes automatically to the first game starting with that letter. In MiSTER, you can even continue typing and the cursor position moves to refine "the search". So, in my FAVS folder I could type "G" to go to (let's say) "Galaxians" and the type H ("GH") to go to Ghosts N Goblins. It would be nice and allow faster game search.

2.- Maybe a "single key shortcut" for Eject TAP (CTRL+o) would be convenient, as is a very used feature.

3.- As a "shortcut" for the above, I thought maybe putting the Z80 in Turbo Mode would allow for faster file browsing, I pressed Ctrl+T and didn't notice any difference when moving the cursor or moving between folders. My initial idea was: "maybe the browser could detect if you're in a ZXUNO and go in Turbo mode in that case when you launch it. Do thisit would be more responsive and moving among files/folders would be faster. Then, the browser would go back to normal speed mode when the TAP file was selected". Do you think that's possible? I didn't notice any difference by triggering Turbo Mode with the shortcut so maybe not.

Anyway, these are just some suggestions you can happily ignore as the browser works perfectly. Thanks a lot again for your work :)
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

sromero wrote: Sun Dec 20, 2020 8:47 am 1.- In MiSTer and ZXBaremulator, when you type a letter (0-9, A-Z) cursor goes automatically to the first game starting with that letter. In MiSTER, you can even continue typing and the cursor position moves to refine "the search". So, in my FAVS folder I could type "G" to go to (let's say) "Galaxians" and the type H ("GH") to go to Ghosts N Goblins. It would be nice and allow faster game search.
I have thought of something like this but you'd need to switch to a different 'find mode' as non shifted keys can be used for the navigation and select keys via the config utility - so you'd need to be able to distinguish between the two.
sromero wrote: Sun Dec 20, 2020 8:47 am
2.- Maybe a "single key shortcut" for Eject TAP (CTRL+o) would be convenient, as is a very used feature.
Thought I'd already added that back in v0.09.

Code: Select all

* Symbol Shift + I / O will eject the current input / output .tap.
sromero wrote: Sun Dec 20, 2020 8:47 am
3.- As a "shortcut" for the above, I thought maybe putting the Z80 in Turbo Mode would allow for faster file browsing, I pressed Ctrl+T and didn't notice any difference when moving the cursor or moving between folders. My initial idea was: "maybe the browser could detect if you're in a ZXUNO and go in Turbo mode in that case when you launch it. Do thisit would be more responsive and moving among files/folders would be faster. Then, the browser would go back to normal speed mode when the TAP file was selected". Do you think that's possible? I didn't notice any difference by triggering Turbo Mode with the shortcut so maybe not.

Anyway, these are just some suggestions you can happily ignore as the browser works perfectly. Thanks a lot again for your work :)
Switching to a higher turbo rate will make reading and displaying the files in a folder faster, however the keyboard navigation uses a delay loop with a 'halt' instruction to insure the delay is consistent regardless of the current turbo rate - otherwise the key input is going to run crazy at higher speeds. You're not the first person to think of switching to a higher turbo rate to make the browser run a bit faster. :)

Thanks for your feedback and the kind words!
sromero
Drutt
Posts: 7
Joined: Sun Dec 20, 2020 8:37 am

Re: New File Browser for ZX-UNO

Post by sromero »

bob_fossil wrote: Sun Dec 20, 2020 1:43 pm I have thought of something like this but you'd need to switch to a different 'find mode' as non shifted keys can be used for the navigation and select keys via the config utility - so you'd need to be able to distinguish between the two.
I see. Something like Shift + G for "Go To" mode, with a text prompt appearing to do a simple [1] or fuzzy [2] search of the files in the current folder.

[1] The cursor moves to the first matching file as you type, then ENTER exits the prompt at the current match:

Gh --> Ghosts N Goblins, Ghouls and Ghosts...

[2] Only files matching appear on the screen as you type (this is how MiSTer search works), and cursors/enter move only between the displayed matches.

Gb --> Green Beret...
Switching to a higher turbo rate will make reading and displaying the files in a folder faster, however the keyboard navigation uses a delay loop with a 'halt' instruction to insure the delay is consistent regardless of the current turbo rate - otherwise the key input is going to run crazy at higher speeds. You're not the first person to think of switching to a higher turbo rate to make the browser run a bit faster. :)

Thanks for your feedback and the kind words!
No, thanks to you!

In any case, just at its current status, for me it's perfectly functional, so, those suggestions were just "more sugar" :)
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

New test version available here.

Main change is the support for cache files which store the folder contents in a 'cache.db' file inside that folder. If this file is found, the files and long filenames are loaded in one go from that file rather than having to read them individually off the disk and then sort them. This speeds up the read time for large folders (100+ files). Pressing 'Caps Shift + Z' creates / updates an existing cache file for a folder. The top directory line shows a '*' at the end of the folder name when showing a cached folder.

File information (Caps Shift + F) now shows the date of the file and navigation keys were added to PT1, PT2, PT3, SQT and STC music player plugins (see plugins/plugins_info.txt). I also fixed a reported issue where the browser selection was not updated when you navigated files in a plugin but did not have PLUGIN_RESTORE_SCREEN set and fixed an issue in the FAT32 code which would cause corrupted folder reads in some situations.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

bob_fossil wrote: Sun Dec 20, 2020 6:18 pm This speeds up the read time for large folders (100+ files).
I understand that the number of files in one folder is limited by the total number of characters in the headers of these files?
I have a folder with 551 music files, 447 were read into the catalog , with the last 10 files with a short name.
Ok, I divided it into two folders - 300 and 251 pieces in one and the other.
Running my .ETC plugin
If you select the previous / next file, then the position is updated correctly.
If you select the first / last file in this folder, then the music of course plays, but at the same time the pointer to the file is generally not clear where, well, and then the directory "breaks down": ((If I could also fix this.
But mostly I already like it. Thank you!!!
I will add
And if I am at the last position on the screen, and I press the next one, then the position is also not updated, but the music plays. If you click - previous - then the directory is broken too
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Sun Dec 20, 2020 10:06 pm
I understand that the number of files in one folder is limited by the total number of characters in the headers of these files?
No. There is a hardcoded limit of 426 files in a folder. Whatever the length of the long file names, you should always get 426 files. Long files names are stored in an 8k block of memory. If the browser runs out of space in this block, it stops adding long file names and falls back to using 8.3 filenames. The buffer that holds 426 files has space to hold the 8.3 filename and some attributes for each folder.
azesmbog wrote: Sun Dec 20, 2020 10:06 pm
I have a folder with 551 music files, 447 were read into the catalog , with the last 10 files with a short name.
Ok, I divided it into two folders - 300 and 251 pieces in one and the other.
Running my .ETS plugin
If you select the previous / next file, then the position is updated correctly.
If you select the first / last file in this folder, then the music of course plays, but at the same time the pointer to the file is generally not clear where, well, and then the directory "breaks down": ((If I could also fix this.
But mostly I already like it. Thank you!!!
Maybe there is an issue with the plugin navigation code with large folders? I would need to set up a folder with lots of files to try and replicate this.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

I can upload the .HDF image with the plugin and files.
I did it for the LnxSpectrum emulator, but maybe it will work for another emulator.
Is it necessary?
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Sun Dec 20, 2020 10:40 pm I can upload the .HDF image with the plugin and files.
I did it for the LnxSpectrum emulator, but maybe it will work for another emulator.
Is it necessary?
I do all my debugging with a HDF file with DivMMC emulation under Fuse. If you can upload the image somewhere I can have a look - I can't promise a fix though. :)
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

in the root folder SAA1099 with a small number of files.
there are two folders with a lot in the Music folder.
There will be no sound in the Fuse, but at least you will see how the directory breaks down.
If you get it right, no, well, then it's easier to remove the first / last file and the buttons to them
https://drive.google.com/file/d/1PJPHvY ... sp=sharing
upd
can be checked on the PT folder - there are also more files than one screen and there are problems :)
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Sun Dec 20, 2020 10:49 pm in the root folder SAA1099 with a small number of files.
there are two folders with a lot in the Music folder.
There will be no sound in the Fuse, but at least you will see how the directory breaks down.
If you get it right, no, well, then it's easier to remove the first / last file and the buttons to them
https://drive.google.com/file/d/1PJPHvY ... sp=sharing
upd
can be checked on the PT folder - there are also more files than one screen and there are problems :)
I've got the HDF file and it works with Fuse. It's probably a bug in the new code I added in to try and get the selection to track after a plugin returns a navigation command but doesn't update the screen. I don't think it's a file system problem as the normal navigation keys seem to work okay.

Update:

Yes, it was a bug in that new code. I'll update the zip file tomorrow after I've done some more testing to make sure I haven't broken navigation in the SCR/LCE/IMG plugins.
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

Okay, I've updated the zip file in the previous link with a fix (hopefully!) for [mention]azesmbog[/mention]'s reported issue with the plugin navigation code.
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

So far everything works fine !!!
Small cosmetic bug (does not affect speed :)
Two files with very long names
Arcane Zone Part 2 (ZX AAA demo compo 2013, 2) .etc
Beat to the pulp (Retrokomp-Loaderror 2015, 1) .etc
In the second case, it correctly abbreviates the long name, with dots, but in the first case, it leaves only two characters for the .et extension
Arcane Zone Part 2 (ZX AAA demo compo 2013 ....et
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

azesmbog wrote: Mon Dec 21, 2020 10:19 pm So far everything works fine !!!
Small cosmetic bug (does not affect speed :)
Two files with very long names
Arcane Zone Part 2 (ZX AAA demo compo 2013, 2) .etc
Beat to the pulp (Retrokomp-Loaderror 2015, 1) .etc
In the second case, it correctly abbreviates the long name, with dots, but in the first case, it leaves only two characters for the .et extension
Arcane Zone Part 2 (ZX AAA demo compo 2013 ....et
Yes, I'd seen the same thing with some gigascreen images with very long filenames - the last character of the extension can be missing, partially clipped or drawn as the first character of the next line. I think I know what is going wrong - it's just a pain to fix it. :)
azesmbog
Manic Miner
Posts: 307
Joined: Sat May 16, 2020 8:43 am

Re: New File Browser for ZX-UNO

Post by azesmbog »

Best the enemy of the good!!
In the case of PT1-PT3 files there will be some ambiguity, but sometimes it is better not to touch, the game is not worth the trouble
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

New test version available here.

Caps Shift + F enables find mode for the current folder you are in. The top line will change to 'Find: ' to show you are in this mode. As you enter the text to find, the browser window will try and find the first matching file which has the text in it. Entering 'the' as the search phrase would, for example, match 'The Great Escape' and 'Turbo The Tortoise'.

If no match is found, the browser, window returns to the first file in the list and flashes the border red. You can delete a character from the search text with DELETE. Once you've found your matching file, you can press ENTER to launch it.

Pressing Caps Shift + F again will cycle between all the other matching file entries. BREAK exits find mode and returns you to normal browser mode.

Current limitations:
  • Your search phrase is limited to 16 characters.
  • Search is case insensitive - searching for 'jet' will match 'JET PAC' and 'Jet Set Willy'.
  • Navigation and hotkeys are disabled when you are in find mode.
  • Find mode only searches the current folder. It will not recurse into subfolders.
  • File information is now on Caps Shift + R.
User avatar
Pegaz
Dynamite Dan
Posts: 1210
Joined: Mon Nov 13, 2017 1:44 pm

Re: New File Browser for ZX-UNO

Post by Pegaz »

Today I played with the RVM ZX-Uno emulator and this new browser and I really like it. :)
Tried various types of formats and everything works well, except the pzx.
I made a few pzx images in the ZX-Blockeditor, copied LOADPZX file to the BIN folder, but when I try to run the game it shows Loading: name with a few PDPDPDPDPD characters and then nothing happens.
Created PZX.tap file can be seen on the card, but the games will not start.
Then, I tried the ZX-Uno pack v4.0,but it behaves the same way...
Finally, I tested without a browser through the zxuno pack menu to start some pzx file in the Extras section, but at the end of the process I get a "Pulse F7" message and when I press F7 nothing happens again.
Its possible that this is an emulator issue, but maybe someone has an idea of what to do here and how run pzx files...
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

New test version available here.

Main new feature (alongside some bug fixes and internal restructuring) is the POK plugin for .pok files. This is work in progress. Current limitations:
  • .pok files must be smaller than 16384 bytes in length.
  • Only the first 8 'trainers' inside the file will be listed.
  • You can't currently turn a trainer 'off' once applied.
  • The plugin doesn't remember which trainers you selected last time, so it will always startup with every trainer set to 'off' (shown with [_] characters).
  • .pok files can only be opened from inside the NMI browser.
Cursor Up / Down: Move selection
Space: Toggle trainer on / off
Enter: Exit with selected trainers applied
Break: Cancel / Exit
User avatar
Turrican
Microbot
Posts: 195
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: New File Browser for ZX-UNO

Post by Turrican »

Pegaz wrote: Tue Jan 05, 2021 3:56 pm Today I played with the RVM ZX-Uno emulator and this new browser and I really like it. :)
Tried various types of formats and everything works well, except the pzx.
I made a few pzx images in the ZX-Blockeditor, copied LOADPZX file to the BIN folder, but when I try to run the game it shows Loading: name with a few PDPDPDPDPD characters and then nothing happens.
Created PZX.tap file can be seen on the card, but the games will not start.
Then, I tried the ZX-Uno pack v4.0,but it behaves the same way...
Finally, I tested without a browser through the zxuno pack menu to start some pzx file in the Extras section, but at the end of the process I get a "Pulse F7" message and when I press F7 nothing happens again.
Its possible that this is an emulator issue, but maybe someone has an idea of what to do here and how run pzx files...
On my real ZX-UNO, the pzx files works ok. No problems.
User avatar
bob_fossil
Manic Miner
Posts: 669
Joined: Mon Nov 13, 2017 6:09 pm

Re: New File Browser for ZX-UNO

Post by bob_fossil »

Turrican wrote: Tue Jan 05, 2021 8:04 pm On my real ZX-UNO, the pzx files works ok. No problems.
Same here - works on my ZX-UNO - but someone who isn't the author saying it works carries far more weight. :)

I'm not sure whether you need the 2mb version for pzx playback to work? You also need a recent core for it to work correctly as well.
User avatar
Turrican
Microbot
Posts: 195
Joined: Thu Apr 12, 2018 5:48 pm
Location: Brazil

Re: New File Browser for ZX-UNO

Post by Turrican »

bob_fossil wrote: Tue Jan 05, 2021 9:43 pm
Turrican wrote: Tue Jan 05, 2021 8:04 pm On my real ZX-UNO, the pzx files works ok. No problems.
Same here - works on my ZX-UNO - but someone who isn't the author saying it works carries far more weight. :)

I'm not sure whether you need the 2mb version for pzx playback to work? You also need a recent core for it to work correctly as well.
My UNO is 512Kb.
Post Reply