stardot / b-em

An opensource BBC Micro emulator for Win32 and Linux
http://stardot.org.uk/forums/viewtopic.php?f=4&t=10823
GNU General Public License v2.0
118 stars 58 forks source link

ROM menu entries not correctly updated when performing operations on ROM sockets #77

Closed richardcrossley closed 5 years ago

richardcrossley commented 5 years ago

Description of Issue When loading ROM images, into ROM sockets using emulator, the menu for the ROM socket is not being correctly updated. I am thinking this similar to inserting EPROMs into sockets rather than loading images into sideways RAM.

For example, I have Wordwise Plus in socket 3.

B-em v-c756f6b_316

Then I wish to remove that ROM so I select "Clear" for "03 ROM". The ROM is correctly removed, but the menu continues to have the wrong title.

B-em v-c756f6b_317

Now I load a different ROM into the same socket, for this example I'll use one of the Acornsoft ISO Pascal ROMS.

B-em v-c756f6b_318

The menu again has not been updated and the ROM has been correctly loaded into the socket. If I load the second ROM into socket 2, again we see the menu is not updated...

B-em v-c756f6b_319

... but Pascal is working

B-em v-c756f6b_320

Expected Behaviour I would expect the ROM menu to be updated immediately after the GUI option has been completed. When "Clear" is selected, I would expect the ROM menu entry to return to its default. When a new ROM is selected, I would expect the ROM menu entry to reflect the new selection.

What I have done? I took a look at the C source code last night, and I might be able to remediate this. What tooling under Linux is used for B-em. I have Jetbrains CLion, but this appears to be an "Autotools" project so won't immediately work in that IDE, which is beyond the scope of this issue.

Environment Linux 64bit; Linux Mint 19.0;

B-em configuration Model = "BBC Master 128" Tube = Nothing selected Speed = 100%

B-em revision: c756f6b4eb82fe83fbbda360ce828f305fb9f4e3

A clone of the b-em revision indicated was taken and b-em built as follows:

./autogen.sh
./configure
make
SteveFosdick commented 5 years ago

Thanks for a detailed report. I can reproduce this bug and will work to fix it.

richardcrossley commented 5 years ago

Thanks, I was considering working on it and giving you a PR. It seemed like something simpler and a good way into the B-em code base. I just needed to know what IDE was being used.

SteveFosdick commented 5 years ago

You're very welcome to. I have been using Geany but I don't think it should make much difference as the build system is GNU autotools/make so doesn't depend on an IDE. The only IDE-related issue is that I am using only spaces for indentation to avoid everything changing where opening in a different IDE/editor.

fordp2002 commented 5 years ago

I can recommend an .editorconfig file in the project to avoid issues with tabs/ tab size, well at least to those IDE/ Editors that support it!

SteveFosdick commented 5 years ago

Thanks for the tip on .editorconfig. It seems there are plenty of IDEs that support it, either native or with a plugin so I have added one.

SteveFosdick commented 5 years ago

Fixed in master and packaged for Windows in https://github.com/stardot/b-em/releases/tag/rom-menu

The issue was that the code to update the menu was manipulating the menu on which the click event occurred but this was only a sub-menu of the one that needed its label changed. I have also fixed a failure to refresh the ROM menu when the model is changed.