diff --git a/Platforms/ZXBox.Blazor/Components/EmulatorComponent.razor.cs b/Platforms/ZXBox.Blazor/Components/EmulatorComponent.razor.cs index c8fbf5e..059b977 100644 --- a/Platforms/ZXBox.Blazor/Components/EmulatorComponent.razor.cs +++ b/Platforms/ZXBox.Blazor/Components/EmulatorComponent.razor.cs @@ -120,11 +120,17 @@ private async void GameLoop_Elapsed(object sender, ElapsedEventArgs e) sw.Stop(); if (tapePlayer != null && tapePlayer.IsPlaying) { + TapeStopped = false; PercentLoaded = ((Convert.ToDouble(tapePlayer.CurrentTstate) / Convert.ToDouble(tapePlayer.TotalTstates)) * 100); await InvokeAsync(() => StateHasChanged()); } + if (!TapeStopped && !tapePlayer.IsPlaying) + { + TapeStopped = true; + await InvokeAsync(() => StateHasChanged()); + } } - + bool TapeStopped = false; GCHandle gchsound; IntPtr pinnedsound; WebAssemblyJSRuntime mono;