Open ZornsLemma opened 4 years ago
I can reproduce this.
A quick fix would be to move the call to _update_rommenu from _changemodel in gui-allegro.c to _mainrestart in main.c. As _mainrestart calls _modelinit which in turn calls the ROM set-up function for that model the ROM configuration could change and the menu should be kept in step.
But that does side-step the debate about how long changes to the ROM configuration should persist and exactly how much "Hard Reset:" should reset. Obviously this should be more than Ctrl-Break and I would say is intended to be useful for things that would require a real machine to be turned off and on again. That is certainly the case with Video NuLA, which Hard Reset resets - the real one has no reset so you have to turn off/on to reset or just program it back to the default values.
But that does not mean it has to be exactly the same. The idea of removing a ROM while the power is on is not something you can do with a real machine.
One of the reasons you might need to power off a real machine is after putting a ROM image with a bug in into sideways RAM and it makes a mess of one of the service calls such that the machine is unusable. So that may be why the model init function is called to reset the ROM configuration. But there are a couple of other possibilities - Hard reset could clear the sideways RAM but leave the ROMs alone and there is tickbox to convert a bank between ROM and RAM. Or maybe even that is not needed as one could use the "Clear" function on the affected bank.
As a further piece of inconsistency, if you load a ROM into a spare bank and then quit, this is saved to the config file so the ROM is still there when b-em is re-started as that same model.
Thanks for trying to reproduce it, and I'm glad you could.
I don't pretend to have the answers to what's "right" here, and I suspect there's going to be a lot of disagreement. Your idea that hard reset clears the sideways RAM but leaves ROMs alone seems pretty sensible to me as a starting point, and I think it would address the problems I've had.
I can say that my model B is now permanently afflicted by an unwanted ADFS ROM, as you mentioned in your "As a further..." comment. I'm sure I can remove this by editing the config manually, but it does feel wrong that I need to do this. It would be nice if the permanent ROM/RAM config of the machine could be edited via the GUI, but I don't think it's good that it happens this easily.
For the time being I have done the simple thing of refreshing the ROM menu after reset. I have also changed the way models are saved to the config file so when you clear a slot into which you had previously loaded a ROM that is also remembered.
Hi,
I'm afraid this is going to be a bit fuzzy, but I hope it will be reproducible.
I'm using commit 99f09567b5823af728bd124fbb79a601e9a15012 here, running on Linux (Ubuntu 18.04, though I doubt it matters here).
Start the emulator in "BBC B w/1770 FDC" mode. Examine the ROM menu and see the top three banks are all ROM with BASIC/VDFS/DFS and the rest are RAM. (I don't have VDFS enabled in the Disc menu, FWIW.)
Use the ROM menu to load adfs130.rom into bank 12. This is flagged as RAM, which is fine. Press CTRL-BREAK. Everything works as expected, *ROMS shows all four ROMs and PAGE is at &1F00.
Use the ROM menu to clear bank 13, to get rid of DFS (so we can have PAGE at &1D00). Press CTRL-BREAK, everything looks as it should, we default to ADFS and PAGE is &1D00.
Choose File->Hard Reset. The emulated machine resets to the original configuration with DFS only and PAGE at &1900, but the ROM menu still shows the empty bank 13 and ADFS in bank 12.
I don't know if this is the only problem in this area - I seem to get myself and/or b-em confused quite a bit when trying to tweak the ROM configuration - but I'll stop here, because this seems wrong and it may be that all my confusion derives from this.
I'm not too sure what "should" happen here. I think File->Hard Reset is maybe more like a power cycle than pressing CTRL-BREAK, and ADFS in bank 12 was flagged as RAM so maybe it's correct that it disappears, but since I "cleared" the ROM DFS in bank 13 maybe it shouldn't reappear. You could probably argue it's reasonable for it to reappear, but does that mean there's no way (short of editing b-em.cfg) to remove a ROM from the emulated machine which will survive a hard reset? In many ways I don't want hacks I make like this in the ROM menu to be saved permanently across emulator shutdown and restart, but I usually end up feeling I need to do a hard reset so the machine isn't confused about what ROMs it has so it's annoying to lose the changes at that point.
In any case, I think the ROM menu should match what the emulated machine's state actually is, whatever is "correct" for the emulated machine's state to be.
I hope this makes sense, let me know if you need any more information.
Cheers.
Steve