+
-
-
-
-
-
-
-
- 60.00 fps
-
-
-
-
- evals/clk
-
-
+
-
-
+
+
+
+
+
+
+
+
+
+ 60.00 fps
+
+
+
+
+ evals/clk
+
+
8bitworkshop
diff --git a/src/baseplatform.ts b/src/baseplatform.ts
index 11eff15c..d8026ead 100644
--- a/src/baseplatform.ts
+++ b/src/baseplatform.ts
@@ -54,6 +54,10 @@ export class DebugSymbols {
}
}
+export interface PlatformMetadata {
+ name : string; // TODO
+}
+
export interface Platform {
start() : void;
reset() : void;
@@ -65,6 +69,7 @@ export interface Platform {
resume() : void;
loadROM(title:string, rom:any); // TODO: Uint8Array
loadBIOS?(title:string, rom:Uint8Array);
+ getMetadata?() : PlatformMetadata;
loadState?(state : EmuState) : void;
saveState?() : EmuState;
diff --git a/src/ui.ts b/src/ui.ts
index 52fa770f..ac0712c7 100644
--- a/src/ui.ts
+++ b/src/ui.ts
@@ -1580,7 +1580,12 @@ function showWelcomeMessage() {
element: "#platformsMenuButton",
placement: 'right',
title: "Welcome to 8bitworkshop!",
- content: "You are currently on the \"
" + platform_id + "\" platform. You can choose a different one from the menu."
+ content: "You're currently on the \"
" + platform_id + "\" platform. You can choose a different one from the menu."
+ },
+ {
+ element: "#preset_select",
+ title: "Project Selector",
+ content: "You can choose different code examples, create your own files, or import projects from GitHub."
},
{
element: "#workspace",
@@ -1594,11 +1599,6 @@ function showWelcomeMessage() {
title: "Emulator",
content: "We'll load your compiled code into the emulator whenever you make changes."
},
- {
- element: "#preset_select",
- title: "File Selector",
- content: "Pick a code example from the book, or access your own files and files shared by others."
- },
{
element: "#debug_bar",
placement: 'bottom',
@@ -1754,6 +1754,7 @@ function installGAHooks() {
function startPlatform() {
if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'.");
platform = new PLATFORMS[platform_id]($("#emuscreen")[0]);
+ setPlatformUI();
stateRecorder = new StateRecorderImpl(platform);
PRESETS = platform.getPresets();
if (!qs['file']) {
@@ -1857,6 +1858,16 @@ function loadImportedURL(url : string) {
}, 'text');
}
+function setPlatformUI() {
+ var name = platform.getMetadata && platform.getMetadata().name;
+ var menuitem = $("#item_platform_"+platform_id);
+ if (menuitem.length) {
+ menuitem.addClass("dropdown-item-checked");
+ name = name || menuitem.text() || name;
+ }
+ $(".platform_name").text(name || platform_id);
+}
+
// start
export function startUI(loadplatform : boolean) {
installErrorHandler();
@@ -1885,9 +1896,6 @@ export function startUI(loadplatform : boolean) {
repo_id = '';
delete qs['repo'];
}
- // update UI
- $("#item_platform_"+platform_id).addClass("dropdown-item-checked");
- $("#platform_name").text(platform_id);
setupSplits();
// create store
store_id = repo_id || getBasePlatform(platform_id);