mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2025-02-16 17:30:27 +00:00
moved types to baseplatform.ts
This commit is contained in:
parent
1c9817d155
commit
1e7e7feae5
48
src/baseplatform.ts
Normal file
48
src/baseplatform.ts
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
export interface OpcodeMetadata {
|
||||||
|
minCycles: number;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Platform {
|
||||||
|
start() : void;
|
||||||
|
reset() : void;
|
||||||
|
isRunning() : boolean;
|
||||||
|
getToolForFilename(s:string) : string;
|
||||||
|
getDefaultExtension() : string;
|
||||||
|
getPresets() : Preset[];
|
||||||
|
pause() : void;
|
||||||
|
resume() : void;
|
||||||
|
loadROM(title:string, rom:Uint8Array);
|
||||||
|
|
||||||
|
inspect?(ident:string) : void;
|
||||||
|
disassemble?(addr:number, readfn:(addr:number)=>number) : any; // TODO
|
||||||
|
readAddress?(addr:number) : number;
|
||||||
|
setFrameRate?(fps:number) : void;
|
||||||
|
getFrameRate?() : number;
|
||||||
|
cpuStateToLongString?(state) : string;
|
||||||
|
ramStateToLongString?(state) : string;
|
||||||
|
getRasterPosition() : {x:number, y:number};
|
||||||
|
setupDebug?(debugfn : (state)=>void) : void;
|
||||||
|
clearDebug?() : void;
|
||||||
|
step?() : void;
|
||||||
|
runToVsync?() : void;
|
||||||
|
runToPC?(pc:number) : void;
|
||||||
|
runUntilReturn?() : void;
|
||||||
|
stepBack?() : void;
|
||||||
|
//TODO runEval?(evalfn : (cpustate) => boolean) : void;
|
||||||
|
runEval?(evalfn : Function) : void;
|
||||||
|
|
||||||
|
getOpcodeMetadata?(opcode:number, offset:number) : OpcodeMetadata; //TODO
|
||||||
|
saveState?() : any; // TODO
|
||||||
|
getDebugCallback?() : any; // TODO
|
||||||
|
getSP?() : number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Preset {
|
||||||
|
id : string;
|
||||||
|
name : string;
|
||||||
|
chapter? : number;
|
||||||
|
title? : string;
|
||||||
|
}
|
||||||
|
|
@ -94,9 +94,9 @@ export class CodeProject {
|
|||||||
tools_preloaded = {};
|
tools_preloaded = {};
|
||||||
callbackBuildResult : BuildResultCallback;
|
callbackBuildResult : BuildResultCallback;
|
||||||
callbackBuildStatus : BuildStatusCallback;
|
callbackBuildStatus : BuildStatusCallback;
|
||||||
worker: any;
|
worker : Worker;
|
||||||
platform_id : string;
|
platform_id : string;
|
||||||
platform: any;
|
platform: any; // TODO: use type
|
||||||
store: any;
|
store: any;
|
||||||
callbackGetRemote : GetRemoteCallback;
|
callbackGetRemote : GetRemoteCallback;
|
||||||
mainPath: string;
|
mainPath: string;
|
||||||
|
38
src/ui.ts
38
src/ui.ts
@ -6,6 +6,7 @@ import $ = require("jquery");
|
|||||||
import * as bootstrap from "bootstrap";
|
import * as bootstrap from "bootstrap";
|
||||||
import { SourceFile, CodeProject } from "./project";
|
import { SourceFile, CodeProject } from "./project";
|
||||||
import { ProjectWindows } from "./windows";
|
import { ProjectWindows } from "./windows";
|
||||||
|
import { Platform, Preset } from "./baseplatform";
|
||||||
import * as Views from "./views";
|
import * as Views from "./views";
|
||||||
|
|
||||||
// external libs (TODO)
|
// external libs (TODO)
|
||||||
@ -18,43 +19,6 @@ declare var PLATFORMS;
|
|||||||
// make sure VCS doesn't start
|
// make sure VCS doesn't start
|
||||||
if (window['Javatari']) window['Javatari'].AUTO_START = false;
|
if (window['Javatari']) window['Javatari'].AUTO_START = false;
|
||||||
|
|
||||||
interface Preset {
|
|
||||||
id : string;
|
|
||||||
name : string;
|
|
||||||
chapter? : number;
|
|
||||||
title? : string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Platform {
|
|
||||||
start() : void;
|
|
||||||
reset() : void;
|
|
||||||
isRunning() : boolean;
|
|
||||||
getToolForFilename(s:string) : string;
|
|
||||||
getDefaultExtension() : string;
|
|
||||||
getPresets() : Preset[];
|
|
||||||
pause() : void;
|
|
||||||
resume() : void;
|
|
||||||
loadROM(title:string, rom:Uint8Array);
|
|
||||||
|
|
||||||
inspect?(ident:string) : void;
|
|
||||||
disassemble?(addr:number, readfn:(addr:number)=>number) : any; // TODO
|
|
||||||
readAddress?(addr:number) : number;
|
|
||||||
setFrameRate?(fps:number) : void;
|
|
||||||
getFrameRate?() : number;
|
|
||||||
cpuStateToLongString?(state) : string;
|
|
||||||
ramStateToLongString?(state) : string;
|
|
||||||
getRasterPosition() : {x:number, y:number};
|
|
||||||
setupDebug?(debugfn : (state)=>void) : void;
|
|
||||||
clearDebug?() : void;
|
|
||||||
step?() : void;
|
|
||||||
runToVsync?() : void;
|
|
||||||
runToPC?(pc:number) : void;
|
|
||||||
runUntilReturn?() : void;
|
|
||||||
stepBack?() : void;
|
|
||||||
//TODO runEval?(evalfn : (cpustate) => boolean) : void;
|
|
||||||
runEval?(evalfn : Function) : void;
|
|
||||||
}
|
|
||||||
|
|
||||||
var PRESETS : Preset[]; // presets array
|
var PRESETS : Preset[]; // presets array
|
||||||
var platform_id : string; // platform ID string
|
var platform_id : string; // platform ID string
|
||||||
var platform : Platform; // platform object
|
var platform : Platform; // platform object
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import $ = require("jquery");
|
import $ = require("jquery");
|
||||||
import { SourceFile, WorkerError, CodeProject } from "./project";
|
import { SourceFile, WorkerError, CodeProject } from "./project";
|
||||||
|
import { Platform } from "./baseplatform";
|
||||||
|
|
||||||
export interface ProjectView {
|
export interface ProjectView {
|
||||||
createDiv(parent:HTMLElement, text:string) : HTMLElement;
|
createDiv(parent:HTMLElement, text:string) : HTMLElement;
|
||||||
@ -18,7 +19,7 @@ export interface ProjectView {
|
|||||||
|
|
||||||
// TODO: move to different namespace
|
// TODO: move to different namespace
|
||||||
declare var CodeMirror;
|
declare var CodeMirror;
|
||||||
declare var platform;
|
declare var platform : Platform;
|
||||||
declare var platform_id : string;
|
declare var platform_id : string;
|
||||||
declare var compparams;
|
declare var compparams;
|
||||||
declare var addr2symbol : {[addr:number]:string};
|
declare var addr2symbol : {[addr:number]:string};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user