ROMs
- The C64 system requires the following types of ROM files: Kernal, Basic, and Character generator.
- - Use existing C64 ROM files on your computer, or download them to your computer from the internet.
- - Upload the ROM files from your computer to this emulator with the button below.
+ The C64 system requires the following ROM files: Kernal, Basic, and Character generator.
+ Note: You may need a license from Commodore/Cloanto (or own a C64) to use them.
+ How to download and use them:
+ - Automatically download ROM files from known URLs (see right).
+ - Or upload existing ROM files from your computer.
-
-
+
+
@if (_isLoadingC64Roms)
{
@@ -48,19 +50,23 @@
}
}
+
+
+
+
-
Direct download links from here
+
Direct download links from here
@@ -287,6 +293,8 @@
public ILocalStorageService LocalStorage { get; set; } = default!;
[Inject]
public IJSRuntime Js { get; set; } = default!;
+ [Inject]
+ public HttpClient HttpClient { get; set; } = default!;
[CascadingParameter] BlazoredModalInstance BlazoredModal { get; set; } = default!;
@@ -359,6 +367,47 @@
private string _aiBackendValidationMessage = "";
+ private async Task LoadROMsFromURL()
+ {
+ _isLoadingC64Roms = true;
+ _validationMessage = "";
+
+ HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36");
+ HttpClient.DefaultRequestHeaders.Accept.ParseAdd("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
+
+ try
+ {
+ foreach (var romDownload in C64SystemConfig.ROMDownloadUrls)
+ {
+ var romName = romDownload.Key;
+ var romUrl = romDownload.Value;
+ var filename = Path.GetFileName(new Uri(romUrl).LocalPath);
+
+ byte[] fileBuffer;
+ var fullROMUrl = !string.IsNullOrEmpty(C64HostConfig.CorsProxyURL) ? $"{C64HostConfig.CorsProxyURL}{Uri.EscapeDataString(romUrl)}" : romUrl;
+ try
+ {
+ fileBuffer = await HttpClient.GetByteArrayAsync(fullROMUrl);
+ }
+ catch (Exception ex)
+ {
+ throw new Exception($"Error downloading {fullROMUrl}: {ex.Message}", ex);
+ }
+ C64HostConfig.SystemConfig.SetROM(romName, data: fileBuffer);
+ }
+ }
+ catch (Exception ex)
+ {
+ _validationMessage = $"Error downloading ROMs: {ex.Message}";
+ }
+ finally
+ {
+ _isLoadingC64Roms = false;
+ this.StateHasChanged();
+ }
+ }
+
+
private async Task OnC64RomFilePickerChange(InputFileChangeEventArgs e)
{
if (C64HostConfig == null)
diff --git a/src/apps/Highbyte.DotNet6502.App.WASM/global.json b/src/apps/Highbyte.DotNet6502.App.WASM/global.json
index 31f23b687..4c686a526 100644
--- a/src/apps/Highbyte.DotNet6502.App.WASM/global.json
+++ b/src/apps/Highbyte.DotNet6502.App.WASM/global.json
@@ -1,5 +1,5 @@
{
"sdk": {
- "version": "9.0.201"
+ "version": "9.0.301"
}
}
\ No newline at end of file
diff --git a/src/libraries/Highbyte.DotNet6502.Systems.Commodore64/Config/C64SystemConfig.cs b/src/libraries/Highbyte.DotNet6502.Systems.Commodore64/Config/C64SystemConfig.cs
index ee6f5de45..d67b08e4f 100644
--- a/src/libraries/Highbyte.DotNet6502.Systems.Commodore64/Config/C64SystemConfig.cs
+++ b/src/libraries/Highbyte.DotNet6502.Systems.Commodore64/Config/C64SystemConfig.cs
@@ -14,7 +14,11 @@ public void ClearDirty()
_isDirty = false;
}
- // TODO: Decide if DefaultKernalROMChecksums should exists here in C64SystemConfig, C64Config, or in C64
+ public static string DEFAULT_KERNAL_ROM_DOWNLOAD_URL = "https://www.commodore.ca/manuals/funet/cbm/firmware/computers/c64/kernal.901227-03.bin";
+ public static string DEFAULT_BASIC_ROM_DOWNLOAD_URL = "https://www.commodore.ca/manuals/funet/cbm/firmware/computers/c64/basic.901226-01.bin";
+ public static string DEFAULT_CHARGEN_ROM_DOWNLOAD_URL = "https://www.commodore.ca/manuals/funet/cbm/firmware/computers/c64/characters.901225-01.bin";
+
+ // TODO: Decide if ROM checksums should exist in C64SystemConfig, C64Config, or in C64
// ROM version info from: https://www.commodore.ca/manuals/funet/cbm/firmware/computers/c64/
// Checksums calculated with SHA1
public const string KERNAL_ROM_NAME = "kernal";
@@ -85,6 +89,13 @@ public string ROMDirectory
}
}
+ public Dictionary
ROMDownloadUrls { get; } = new()
+ {
+ { KERNAL_ROM_NAME, DEFAULT_KERNAL_ROM_DOWNLOAD_URL },
+ { BASIC_ROM_NAME, DEFAULT_BASIC_ROM_DOWNLOAD_URL },
+ { CHARGEN_ROM_NAME, DEFAULT_CHARGEN_ROM_DOWNLOAD_URL }
+ };
+
private bool _audioEnabled;
public bool AudioEnabled
{