Skip to content

Commit 0a3c9c8

Browse files
authored
Fix bug in handling change of config in HostApp. (#136)
1 parent 0151eb4 commit 0a3c9c8

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/apps/Highbyte.DotNet6502.App.WASM/Pages/Commodore64/C64Menu.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
else
5050
{
51-
<button @onclick="OnLoadPreloadedDisk">Download & Run Game</button>
51+
<button @onclick="OnLoadPreloadedDisk">Download & Run</button>
5252
}
5353
<br />
5454
<span style="font-size: 0.9em; color: #666;">

src/libraries/Highbyte.DotNet6502.Systems/HostApp.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ public async Task<ISystem> GetSelectedSystem()
364364
{
365365
if (EmulatorState == EmulatorState.Uninitialized)
366366
{
367-
// If we havent started started the selected system yet, return a temporary instance of the system (set in SelectSystem method).
367+
// If we haven't started started the selected system yet, return a temporary instance of the system (set in SelectSystem method).
368368
if (_selectedSystemTemporary == null)
369369
throw new DotNet6502Exception("Internal state error.");
370370
return _selectedSystemTemporary;
@@ -378,6 +378,9 @@ public void UpdateHostSystemConfig(IHostSystemConfig newConfig)
378378
// Note: Make sure to store a clone of the newConfig in the systemList, so it cannot be changed by the caller (bound to UI for example).
379379
CurrentHostSystemConfig = (IHostSystemConfig)newConfig.Clone();
380380
_systemList.ChangeCurrentHostSystemConfig(_selectedSystemName, CurrentHostSystemConfig);
381+
382+
//Re-select the system to ensure the new config is applied.
383+
SelectSystem(_selectedSystemName).Wait();
381384
}
382385

383386
/// <summary>

0 commit comments

Comments
 (0)