mrneo240 / openmenu

openMenu open source GDEMU Frontend
Other
82 stars 6 forks source link

[ISSUE] SORT by NAME doesn't properly work #26

Open legolas119 opened 2 years ago

legolas119 commented 2 years ago

Hi, i choose SORT = NAME, i push APPLY and SAVE and the games are correctly sorted by NAME. But if i turn off the console, when i turn on it again, the games aren't sorted by name anymore...even if the option is kept saved: https://i.postimg.cc/vDFC6NFf/Cattura4.png

So every time i turn on the console, i have to push START and then i push SAVE: in this way there is a "biiiiip" sound from my VMU unit and the games are correctly sorted by name. Currently my VMU has a totally low battery: do you think that this could be the cause of the issue ot the sort by name?

thanks

mrneo240 commented 2 years ago

I believe it is an issue in the loading of preferences. Thank you for posting

Batteries do not affect operation of the vmu while the console it on.

legolas119 commented 2 years ago

I confirm that the issue is still present even if i have changed the battery, so probably if is an issue. Thank you!

mrneo240 commented 2 years ago

To be clear, the issue is in openMenu. I'll look into it this week

legolas119 commented 2 years ago

many thanks!

legolas119 commented 2 years ago

thanks! i'm really sorry, i suppose the issues isn't solved yet, is that correct? thank you!

retrohead commented 2 years ago

A bit more detail on this bug.

The option is saved correctly but the actual list is not sorted. This means you need to open the options then apply or save to sort the list correctly on a new load.

I can't compile this on my current setup to test but changing list_get() in gd_list.c should fix this:

OLD:

const struct gd_item **list_get(void) {
  return (const gd_item **)list_temp;
}

New

const struct gd_item **list_get(void) {
    openmenu_settings *settings = settings_get();
    if (!settings->filter) {
      switch ((CFG_SORT)settings->sort) {
        case SORT_NAME:
          return list_get_sort_name();
        case SORT_DATE:
          return list_get_sort_date();
        default:
        case SORT_DEFAULT:
          return list_get_sort_default();
      }
    } else {
      /* If filtering, filter down to only genre then sort */
      return list_get_genre_sort((FLAGS_GENRE)settings->filter - 1, settings->sort);
    }
}

PR created here https://github.com/mrneo240/openmenu/pull/31 but I cannot test it out at the moment

legolas119 commented 2 years ago

thanks! i suppose the fix will be implemented in the next openmenu release? thanks

retrohead commented 2 years ago

Hopefully so, I managed to compile it but it won't run. I think I might need a config.mk for dc-chain or something as the main branch here won't run either and my 1ST_READ.BIN is much larger than the one released. Any help would be appreciated with compiling a working binary of this. @mrneo240

legolas119 commented 2 years ago

thank you very much!

mrneo240 commented 2 years ago

I can offer some insight, currently the official releases are written such that they run from a gdi ( aka gdrom) but include code that goes against the wishes of the KallistiOS creator, as such they are not part of this repo. In addition there is an entire elf encrypter+packer i wrote to help handle size and relocation easily, these too are not part of the public source release.

What is released is currently everything else along with tools and the code is configured in such a way that you will be able to compile it and then run it from a CDI either as a binhacked IP.bin + binary or as a scrambled binary + libre ip.bin.

If the code isnt running from a CDI please let me know and i can investigate why that would be.

edit

also thank you for the discussion here on the issue and the possible code fix. my apologies for being so busy lately. I will implement and update in the next few days.

retrohead commented 2 years ago

Thanks, I had a go at making a CDI from a bin hacked IP.BIN / 1ST_READ.BIN and it just resets my console after the logo.

My environment was freshly installed for this and I had a few issues getting KOS compiled due to the new config.mk file for dc-chain. I used the config.mk.test file as it uses the latest GCC. The stable one would not compile your code at all for several reasons but the newer compiler fixed that.

open_menu_fail.zip

legolas119 commented 2 years ago

hi, do you confirm that this little bug isn't fixed yet, is that correct? thank you very much!

legolas119 commented 2 years ago

hi, is this bug fixed or not yet? manu thanks!

legolas119 commented 1 year ago

hi all, is this bug already fixed? thanks !