Displaying of long file names

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, Greenious, spiny, Sorgelig, Moderator Team

theypsilon
Atarian
Atarian
Posts: 7
Joined: Mon Dec 16, 2019 2:49 am

Displaying of long file names

Postby theypsilon » Wed Jan 08, 2020 12:53 pm

Sorgelig wrote:
wesclemens wrote:Would be seen as:

Code: Select all
Sonic & Knuck...dgehog
Sonic & Knuck...ehog 2
Sonic & Knuck...ehog 3

While i agree to cut in the middle, there is no specific rule where exactly to truncate.


I decided to give it a try, even if it's just to get a bit of familiarity with the mister codebase.

Image

More examples:
https://ibb.co/d6rMCG9
https://ibb.co/FsTJySk
https://ibb.co/wL3GF0w
https://ibb.co/BcjvdMB

I also had to take into account the position of the first '(' character, which works fine with the SmokeMonster set, but it might be problematic with others.

If you want, I'll be pleased to share the patch.
Last edited by theypsilon on Thu Jan 09, 2020 12:38 pm, edited 1 time in total.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Wed Jan 08, 2020 12:57 pm

theypsilon wrote:If you want, I'll be pleased to share the patch.

you are welcome

theypsilon
Atarian
Atarian
Posts: 7
Joined: Mon Dec 16, 2019 2:49 am

Re: MiSTer frontend future

Postby theypsilon » Thu Jan 09, 2020 12:37 pm

Sorgelig wrote:
theypsilon wrote:If you want, I'll be pleased to share the patch.

you are welcome


Here you go:

https://github.com/theypsilon/Main_MiST ... d8de7b72ac

1. I choosed to include 7 chars from the ending, not for a strong reason,
it just looked fine on testing. I also thought in making it configurable, but maybe that's overkill.

2. It works only on files with a '(' character present, but it can be
extended to all files with a one line change (check first comment).

3. I found some games that actually look worse after this, specifically:

Phantasy Star II - Amia's Adventure (Japan) (SegaNet).md
Phantasy Star II - Anne's Adventure (Japan) (SegaNet).md
Phantasy Star II - Huey's Adventure (Japan) (SegaNet).md

From the folder: \\MISTER\fat\games\Genesis\2 Japan - A-Z\Japan - P-Z

The cut is done before the characters name (Amia, Anne, Huey), and at the same time 'Adventure' is a very long
word, so I don't think those could be made to look good with a practical version
of this feature.

PS. I tried to send the link to you via email (I thought it was a PM at first), but probably it got lost. Nevermind.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Thu Jan 09, 2020 12:42 pm

what is behind of '(' obsession?

theypsilon
Atarian
Atarian
Posts: 7
Joined: Mon Dec 16, 2019 2:49 am

Re: MiSTer frontend future

Postby theypsilon » Thu Jan 09, 2020 1:46 pm

Sorgelig wrote:what is behind of '(' obsession?


If you just look after the end of the file name, what you would get is something like this:

Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md

So not really useful.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Thu Jan 09, 2020 7:30 pm

theypsilon wrote:
Sorgelig wrote:what is behind of '(' obsession?


If you just look after the end of the file name, what you would get is something like this:

Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md

So not really useful.

So you want to show in the end the part before first found '('?
While overall idea is good, this feature should be put on hold for longer brain storming. May be there are implementations in some emulators?

theypsilon
Atarian
Atarian
Posts: 7
Joined: Mon Dec 16, 2019 2:49 am

Re: MiSTer frontend future

Postby theypsilon » Thu Jan 09, 2020 9:59 pm

Sorgelig wrote:
theypsilon wrote:
Sorgelig wrote:what is behind of '(' obsession?


If you just look after the end of the file name, what you would get is something like this:

Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md

So not really useful.

So you want to show in the end the part before first found '('?

Yeah, so far I can't imagine any other practical rule that can solve the described issue with common romsets.
Sorgelig wrote:While overall idea is good, this feature should be put on hold for longer brain storming. May be there are implementations in some emulators?

Sounds good, is indeed a feature that has some drawbacks. And It's tricky stuff, not sure about how to solve them in a way that doesn't defeat the purpose. Haven't seen it myself in other platforms with similar constraints. But at least, if somebody requests this feature in the future, now you have something concrete to point at.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Thu Jan 09, 2020 11:36 pm

Probably it should be more intellectual like search for some specific words like disk,disc, numbers. Some sets like TOSEC have specific pattern.

peepsalot
Atari User
Atari User
Posts: 34
Joined: Wed Jan 01, 2020 6:45 pm

Re: MiSTer frontend future

Postby peepsalot » Fri Jan 10, 2020 3:48 am

I have a suggestion on the topic of long filenames with matching beginnings.

Basically draw a pseudo-directory sort of treeview when filenames are longer than menu character width, and two or more consecutive lines have a matching beginning of a string (with some #of char threshold maybe)

So the Phantasy Star example would look something like this (where "v" and ">" are arrow glyphs):

Code: Select all

v Phantasy Star II -
├ Amia's Adventure (Japan)>
├ Anne's Adventure (Japan)>
└ Huey's Adventure (Japan)>


The top line displays only the prefix which is shared between all its children. If the prefix is long enough it could still be scrollable, but either way would be a "fake" menu item that cannot be chosen directly.
The children would just display starting from the first mismatched character, and would also stay scrollable if still too long.

I would suggest that such a treeview be static: always expanded, not collapse-able.

It could also potentially be made to nest multiple times if some children still share prefixes after the initial match, but that would be a bit more complicated to code, requiring to look ahead and to find the maximum prefix shared by all children, then the next sub-prefix for some children, etc.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Fri Jan 10, 2020 5:00 am

peepsalot wrote:I have a suggestion on the topic of long filenames with matching beginnings.

Basically draw a pseudo-directory sort of treeview when filenames are longer than menu character width, and two or more consecutive lines have a matching beginning of a string (with some #of char threshold maybe)

Some games have sequels, so Test Drive 1,2,3,4.. will display like Test Drive tree while it's not correct since games are different. And inside each game it can be further division like US/EU, hack, etc..
Constructing such trees are also problematic because after sorting there must be additional time consuming insertions of new items "parents".
So overall i don't think it's a good solution.

But truncation point can be analysed using neighbour items.

MottZilla
Atariator
Atariator
Posts: 20
Joined: Fri Oct 04, 2019 2:27 am

Re: MiSTer frontend future

Postby MottZilla » Fri Jan 10, 2020 5:12 am

Sorgelig wrote:
theypsilon wrote:
Sorgelig wrote:what is behind of '(' obsession?


If you just look after the end of the file name, what you would get is something like this:

Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md
Sonic & Knuckles ...USA).md

So not really useful.

So you want to show in the end the part before first found '('?
While overall idea is good, this feature should be put on hold for longer brain storming. May be there are implementations in some emulators?


There is a flash cart I believe that solves the similar long file name issue by scrolling the file name currently selected so you can read the whole title. Another thing I've seen done is dedicating a couple lines at the bottom of the file browser to show two lines worth of the file name string to give enough room to see the longer file names.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: MiSTer frontend future

Postby Sorgelig » Fri Jan 10, 2020 5:30 am

MottZilla wrote:I believe that solves the similar long file name issue by scrolling the file name currently selected so you can read the whole title.

So you are definitely not a MiSTer user.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Displaying of long file names

Postby Sorgelig » Fri Jan 10, 2020 5:43 am

I will think about 2 lines of selected file

peepsalot
Atari User
Atari User
Posts: 34
Joined: Wed Jan 01, 2020 6:45 pm

Re: Displaying of long file names

Postby peepsalot » Fri Jan 10, 2020 7:59 pm

Could the menu also simply be made larger to fit more characters, maybe as a configurable option?
I think being able to display more than 28 total chars would also alleviate much of these type of problems.

Is there any specific reason for the current menu sizing?
I use 1080 HDMI, not CRT, but I suppose the menu needs to be sized to fit the "lowest common denominator" of 240p analog out, is that right?
I don't know the exact resolution of the current menu, but even from pictures of CRT I can find, it looks like its only filling roughly 50% of available width and 60% of height.
I know that overscan also needs to be taken into account (even my hdmi tv has some, since its rear projection!), but still accounting for that is seems there's plenty of room to display more characters if the user wanted to.

peepsalot
Atari User
Atari User
Posts: 34
Joined: Wed Jan 01, 2020 6:45 pm

Re: Displaying of long file names

Postby peepsalot » Fri Jan 10, 2020 9:30 pm

By the way I was curious how common various rom filename lengths are, so I made this graph for reference:
rom filesize.png

Distribution may vary depending on your library, but more than half of mine are 38 chars or more.

The data was made from my Linux desktop with a command line this:

Code: Select all

find ./ROMS -type f -printf "%f\n" | awk '{print length}' | sort -n | uniq -c > LineSizeCounts.txt

And imported to LIbreoffice Calc to make the chart.
I had to manually insert the 0 counts (filename lengths which didn't occur) to make it play nice with the bar graph.
Scatter plot can also be done without such editing, but can't output those nice bars.
You do not have the required permissions to view the files attached to this post.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Displaying of long file names

Postby Sorgelig » Fri Jan 10, 2020 10:49 pm

peepsalot wrote:Could the menu also simply be made larger to fit more characters, maybe as a configurable option?
I think being able to display more than 28 total chars would also alleviate much of these type of problems.

Is there any specific reason for the current menu sizing?
I use 1080 HDMI, not CRT, but I suppose the menu needs to be sized to fit the "lowest common denominator" of 240p analog out, is that right?
I don't know the exact resolution of the current menu, but even from pictures of CRT I can find, it looks like its only filling roughly 50% of available width and 60% of height.
I know that overscan also needs to be taken into account (even my hdmi tv has some, since its rear projection!), but still accounting for that is seems there's plenty of room to display more characters if the user wanted to.

Yes, there is a resource limit for that. It occupies precious BRAM (FPGA RAM) making less amount available for the cores.
There are 2 OSD modules separate for HDMI and VGA. Merging them into a single module may reduce required BRAM, so it can be doubled for a common module.

theypsilon
Atarian
Atarian
Posts: 7
Joined: Mon Dec 16, 2019 2:49 am

Re: Displaying of long file names

Postby theypsilon » Sat Jan 11, 2020 9:43 pm

I've put a bit more thought into this. I came up with a strategy where I compare each filename with its neighbours in the list, and if they differ in a point that wouldn't be visible in the OSD, I do the cut in the middle thing. It works better than the '(' strategy, and is much less agressive. But of course, is more complicated. This time I opted for putting the '...' thing in the middle, so I have a bit more flexibility with the ending part of the filename.

Here are the changes: https://github.com/theypsilon/Main_MiST ... 961f586970

I've done a fair amount of testing and here I'll summarize what I've found:

1.
Image

The Sonic & Knuckles entries work quite well for S&K + Sonic 1, S&K + Sonic 2 and S&K + Sonic 3. But the difference between S&K and S&K + Sonic 1 is a bit more ugly. It's still clear files are different but they look quite similar.

2.
Image

The Romance of the 3 Kindoms entries work well. The roman numbers were a problem at first. Because you'd get:

Code: Select all

Romance of the ... (USA).md
Romance of the ...I - Dragon


So I decided to introduce a mechanism to rollback the differ position to the start of a word if possible. I think like this looks much better.

3.
Image

The Phantasy Star problem is entirely gone, since the differ position is inside the OSD, no cut in the middle is applied at all.

4.
Image
Look at the davis cup entries. Those differ in the words June and July. I think the result looks good. If the word was to be bigger than 12 characers, for example AAAAAAAAAAAAAAAAAAJune and AAAAAAAAAAAAAAAAAAJuly, the rollback to the start of the word mechanism is disabled so it would look like this:

Code: Select all

Davis Cup Te...ly 1993).md
Davis Cup Te...ne 1993).md


I think that's also OK.

5.
Image

Flashback. Not the prettiest, but you can tell which one is the Alt1 rom and which one is not.

----------------------------------------------------------------------------------------------------------------------------

In order to do further testing, I made a syntatic list of files:

Code: Select all

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA b.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA c.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB a.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAB b.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC aaaaaaaaaaaaaaa.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC aaaaaaaaaaaaaaaa.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC aaaaaaaaaaaaaaaaa.bin
Conic & Knuckles + Sonic2 (USA) - Copy - Copy.bin
Conic & Knuckles + Sonic 2 (USA) - Copy - Copy.bin
Conic & Knuckles + Sonic T2 (USA) - Copy - Copy.bin
Conic & Knuckles + Sonic Th2 (USA) - Copy.bin
Conic & Knuckles + Sonic The2 (USA) - Copy.bin
Conic & Knuckles + Sonic The 2 (USA) - Copy.bin
Conic & Knuckles + Sonic The H2 (USA) - Copy.bin
Conic & Knuckles + Sonic The He2 (USA).bin
Conic & Knuckles + Sonic The Hed2 (USA) - Copy.bin
Conic & Knuckles + Sonic The Hedg2 (USA) - Copy.bin
Conic & Knuckles + Sonic The Hedge2 (USA) - Copy.bin
Conic & Knuckles + Sonic The Hedgeh2 (USA) - Copy.bin


Those reveal some problems:

A.
Image

Here you can see that the two AAA files in the bottom look identical, but they are not. They correspond to:

Code: Select all

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC aaaaaaaaaaaaaaaa.bin
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAC aaaaaaaaaaaaaaaaa.bin


Not sure about a way to solve this issue, but to be honest, I doubt is worth the time solving it.

B.
Image

Here there are two files with same display 'Conic & Knuckles + Sonic Th', but the files are indeed different, they are:

Code: Select all

Conic & Knuckles + Sonic Th2 (USA) - Copy.bin
Conic & Knuckles + Sonic The2 (USA) - Copy.bin


They are not consecutive even thought they should be by intuition, so they are not compared with each other, and as result, they collide. The alphabetic sorting takes the space character before a letter or a number, that's the reason why they aren't consecutive. This is probably the biggest issue I've found during my testing, but I still would say is quite minor. And I'm not sure about how to solve it. Maybe is also not worth solving it by now.

----------------------------------------------------------------------------------------------------------------------------

If somebody wants to do more testing, all you need is the MiSTer file compiled from here: https://github.com/theypsilon/Main_MiST ... inmiddle_2

Or if you don't want to/can't compile it yourself, here is the binary: https://drive.google.com/open?id=1NAl3g ... 9aHWYKrJZg
Just replace it with the MiSTer file in the SD card.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 5788
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Displaying of long file names

Postby Sorgelig » Sun Jan 12, 2020 5:42 am

Btw, you don't need to spend 3 chars for "...". It's possible to draw a new symbol "..." so it will occupy only 1 place. While testing you can use any other symbol. Later, if this truncation will be accepted i will draw a new symbol.

I think, it's better to display 2 lines when long name is selected. Probably mixing with truncation can give a good result. While default (non-selected) probably better to keep as-is.


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 13 guests