abbruzze / kernal64

A Scala Commodore 64, 128, VIC20, CBM2 and SuperCPU emulator
MIT License
112 stars 12 forks source link

Saving Settings #24

Open bluecursor opened 1 year ago

bluecursor commented 1 year ago

I am finding in the latest beta versions that all emulators either don't load settings from the config file on load or doesn't save all changes to settings (especially zoom settings). There is something not working properly here.....

abbruzze commented 1 year ago

Thanks for your notification. Could you please tell me which version number are you using and on which OS ? If you're using Windows run k64.bat --shell and check if you see any error during loading. On Linux you should see any errors on the shell. Try also to start from scratch deleting any old configuration file: go under your home directory and delete any *.config file generated by the emulator (e.g. C64.config, C128.config, etc.).

bluecursor commented 1 year ago

Using Kernal64 ver 1.8.2b2 on OSX Ventura. No Errors on Shell. Try deleting thing as well....

abbruzze commented 1 year ago

Unfortunately, OSX is the least tested environment. Send me your C64.config after you have saved settings.

bluecursor commented 1 year ago

Commands:

Last login: Wed Jun  7 17:37:43 on ttys000 @. ~ % cd /Applications/Emulators/Commodore/kernal64 @. kernal64 % sh k64.sh Using 'EN' keyboard layout Settings saved Settings saved

I enlarge he window, set Zoom X2, Save setting on exit, then exit.

I relaunch the app, and the window size is not reset or zoomed and none of the zoom settings are set.

BlueCursor www.imacommodork.com Sent with OSX/iOS Spark! On Jun 7, 2023 at 1:16 PM -0400, Alessandro Abbruzzetti @.***>, wrote:

Unfortunately, OSX is the least tested environment. Send me your C64.config after you have saved settings. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

abbruzze commented 1 year ago

Because there are no errors I need the C64.config file to try to reproduce on my laptop.

bluecursor commented 1 year ago

Archive.zip

abbruzze commented 1 year ago

I used your C64.config file on my Windows machine. The window size and position is in according to what is in the configuration (no zoom). Auto-save option is enabled as well as write-on-disk option. VIC palette is set to bright.

To skip configuration file the emulator must be run with --ignore-config-file or if while reading back the file an IOException raises (for example, if you don't have permissions to read).

Just to check this hypothesis I added a print out in case of error while reading config file. In attachment the file kernal64.zip that must be renamed to kernal.jar and put in the lib directory. When you restart the emulator check if the version is changed in 1.8.2b3. kernal64.zip

Let me know.

bluecursor commented 1 year ago

it works once, but doesn't on retry?

Screenshot 2023-06-09 at 6 56 36 PM

abbruzze commented 1 year ago

No errors on console, so it means it can read properly the config file. Very strange indeed! I would like to understand if the problem is for the window’s size/position only or for all the other options. If you change, for example, the rendering type or the write on disk option, and save settings, what happen ? Are these options keep changed ?

bluecursor commented 1 year ago

Yes those options are saved and restored on load, its just the zoom and screen size that isn't...

bluecursor commented 1 year ago

Any word on this?

abbruzze commented 1 year ago

Try disabling the custom look and feel and restore native one (even if looking at your snap, seems that l&f is native). Edit k64.sh and modify this line: $JAVA -server -Xms64M -Xmx128M -cp $CP -Djava.library.path=$LIB ucesoft.cbm.c64.C64 "$@" like this: $JAVA -server -Xms64M -Xmx128M -cp $CP -DnativeLF -Djava.library.path=$LIB ucesoft.cbm.c64.C64 "$@"

For now no other options, as I said I have no chance to debug on a Mac OS.

bluecursor commented 1 year ago

I figured something out today with the latest beta release. That only the emulators that have a zoom option, doesn't use the coordinates saved in the config file. The k64 and kscpu64 are defaulted to use zoom 1 and the k20 is defaulted to zoom 2 so when you save k20 to zoom 1 it reopens back to zoom2.

k128 and kcbm2 have no issues.

May i suggest remove anything that deals with zoom option and remove it? or trace if zoom is ever activated on load?