mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-05-28 23:41:32 +00:00
added vcs.stellerator platform
This commit is contained in:
parent
6441129dc1
commit
9a2e411587
|
@ -223,6 +223,10 @@ vcs: input not preserved when replaying frames?
|
||||||
|
|
||||||
compile errors disappear when focus returns
|
compile errors disappear when focus returns
|
||||||
|
|
||||||
|
Stellerator
|
||||||
|
- window eats keystrokes (e.g. "i")
|
||||||
|
- more features, debugging
|
||||||
|
|
||||||
|
|
||||||
WEB WORKER FORMAT
|
WEB WORKER FORMAT
|
||||||
|
|
||||||
|
|
|
@ -198,11 +198,12 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown dropdown-submenu">
|
<li class="dropdown dropdown-submenu">
|
||||||
<a tabindex="-1" href="#">MAME Emulators</a>
|
<a tabindex="-1" href="#">MAME/Other</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a class="dropdown-item" href="?platform=atari8-800xl.mame">Atari 800XL (MAME)</a></li>
|
<li><a class="dropdown-item" href="?platform=atari8-800xl.mame">Atari 800XL (MAME)</a></li>
|
||||||
<li><a class="dropdown-item" href="?platform=atari8-5200.mame">Atari 5200 (MAME)</a></li>
|
<li><a class="dropdown-item" href="?platform=atari8-5200.mame">Atari 5200 (MAME)</a></li>
|
||||||
<hr>
|
<hr>
|
||||||
|
<li><a class="dropdown-item" href="?platform=vcs.stellerator">Atari 2600 (Stellerator)</a></li>
|
||||||
<li><a class="dropdown-item" href="?platform=vcs.mame">Atari 2600 (MAME)</a></li>
|
<li><a class="dropdown-item" href="?platform=vcs.mame">Atari 2600 (MAME)</a></li>
|
||||||
<li><a class="dropdown-item" href="?platform=coleco.mame">ColecoVision (MAME)</a></li>
|
<li><a class="dropdown-item" href="?platform=coleco.mame">ColecoVision (MAME)</a></li>
|
||||||
<li><a class="dropdown-item" href="?platform=nes.mame">NES (MAME)</a></li>
|
<li><a class="dropdown-item" href="?platform=nes.mame">NES (MAME)</a></li>
|
||||||
|
|
22
lib/stellerator/stellerator-embedded.min.js
vendored
Normal file
22
lib/stellerator/stellerator-embedded.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
lib/stellerator/stellerator-embedded.min.js.map
Normal file
1
lib/stellerator/stellerator-embedded.min.js.map
Normal file
File diff suppressed because one or more lines are too long
31
lib/stellerator/stellerator.min.js
vendored
Normal file
31
lib/stellerator/stellerator.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
lib/stellerator/stellerator.min.js.map
Normal file
1
lib/stellerator/stellerator.min.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -30,7 +30,7 @@ export function setNoiseSeed(x : number) {
|
||||||
|
|
||||||
type KeyboardCallback = (which:number, charCode:number, flags:KeyFlags) => void;
|
type KeyboardCallback = (which:number, charCode:number, flags:KeyFlags) => void;
|
||||||
|
|
||||||
function __createCanvas(doc:HTMLDocument, mainElement:HTMLElement, width:number, height:number) : HTMLCanvasElement {
|
export function __createCanvas(doc:HTMLDocument, mainElement:HTMLElement, width:number, height:number) : HTMLCanvasElement {
|
||||||
var canvas = doc.createElement('canvas');
|
var canvas = doc.createElement('canvas');
|
||||||
canvas.width = width;
|
canvas.width = width;
|
||||||
canvas.height = height;
|
canvas.height = height;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
import { Platform, BasePlatform, cpuStateToLongString_6502, dumpStackToString, DisasmLine, CpuState } from "../common/baseplatform";
|
import { Platform, BasePlatform, cpuStateToLongString_6502, dumpStackToString, DisasmLine, CpuState, getToolForFilename_6502 } from "../common/baseplatform";
|
||||||
import { PLATFORMS, dumpRAM, EmuHalt } from "../common/emu";
|
import { PLATFORMS, dumpRAM, EmuHalt, RasterVideo, __createCanvas } from "../common/emu";
|
||||||
import { hex, loadScript, lpad, tobin } from "../common/util";
|
import { hex, loadScript, lpad, tobin } from "../common/util";
|
||||||
import { CodeAnalyzer_vcs } from "../common/analysis";
|
import { CodeAnalyzer_vcs } from "../common/analysis";
|
||||||
import { disassemble6502 } from "../common/cpu/disasm6502";
|
import { disassemble6502 } from "../common/cpu/disasm6502";
|
||||||
|
@ -56,6 +56,13 @@ const VCS_PRESETS = [
|
||||||
// {id:'bb/rblast106.bas', name:'Road Blasters (batariBASIC)'},
|
// {id:'bb/rblast106.bas', name:'Road Blasters (batariBASIC)'},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
function getToolForFilename_vcs(fn: string) {
|
||||||
|
if (fn.endsWith(".wiz")) return "wiz";
|
||||||
|
if (fn.endsWith(".bb") || fn.endsWith(".bas")) return "bataribasic";
|
||||||
|
if (fn.endsWith(".ca65")) return "ca65";
|
||||||
|
return "dasm";
|
||||||
|
}
|
||||||
|
|
||||||
class VCSPlatform extends BasePlatform {
|
class VCSPlatform extends BasePlatform {
|
||||||
|
|
||||||
lastBreakState; // last breakpoint state
|
lastBreakState; // last breakpoint state
|
||||||
|
@ -278,14 +285,8 @@ class VCSPlatform extends BasePlatform {
|
||||||
var ram = this.getRAMForState(state);
|
var ram = this.getRAMForState(state);
|
||||||
return "\n" + dumpRAM(ram, 0x80, 0x80);
|
return "\n" + dumpRAM(ram, 0x80, 0x80);
|
||||||
}
|
}
|
||||||
getToolForFilename(fn) {
|
getToolForFilename = getToolForFilename_vcs;
|
||||||
if (fn.endsWith(".wiz")) return "wiz";
|
|
||||||
if (fn.endsWith(".bb") || fn.endsWith(".bas")) return "bataribasic";
|
|
||||||
if (fn.endsWith(".ca65")) return "ca65";
|
|
||||||
return "dasm";
|
|
||||||
}
|
|
||||||
getDefaultExtension() { return ".a"; }
|
getDefaultExtension() { return ".a"; }
|
||||||
|
|
||||||
getROMExtension() { return ".a26"; }
|
getROMExtension() { return ".a26"; }
|
||||||
|
|
||||||
getDebugCategories() {
|
getDebugCategories() {
|
||||||
|
@ -450,13 +451,9 @@ class VCSMAMEPlatform extends BaseMAME6502Platform implements Platform {
|
||||||
|
|
||||||
getPresets = function() { return VCS_PRESETS; }
|
getPresets = function() { return VCS_PRESETS; }
|
||||||
|
|
||||||
getToolForFilename = function(fn) {
|
getToolForFilename = getToolForFilename_vcs;
|
||||||
if (fn.endsWith(".wiz")) return "wiz";
|
getDefaultExtension() { return ".a"; }
|
||||||
if (fn.endsWith(".bb") || fn.endsWith(".bas")) return "bataribasic";
|
getROMExtension() { return ".a26"; }
|
||||||
if (fn.endsWith(".ca65")) return "ca65";
|
|
||||||
return "dasm";
|
|
||||||
}
|
|
||||||
getDefaultExtension = function() { return ".a"; };
|
|
||||||
|
|
||||||
getOriginPC = function() {
|
getOriginPC = function() {
|
||||||
return (this.readAddress(0xfffc) | (this.readAddress(0xfffd) << 8)) & 0xffff;
|
return (this.readAddress(0xfffc) | (this.readAddress(0xfffd) << 8)) & 0xffff;
|
||||||
|
@ -466,10 +463,59 @@ class VCSMAMEPlatform extends BaseMAME6502Platform implements Platform {
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
|
|
||||||
export const Platforms = {
|
class VCSStellaPlatform implements Platform {
|
||||||
'vcs': VCSPlatform,
|
|
||||||
'vcs.mame': VCSMAMEPlatform,
|
mainElement: HTMLElement;
|
||||||
|
Stellerator;
|
||||||
|
stellerator;
|
||||||
|
running: boolean = false;
|
||||||
|
|
||||||
|
constructor(mainElement: HTMLElement) {
|
||||||
|
this.mainElement = mainElement;
|
||||||
|
}
|
||||||
|
async start() {
|
||||||
|
await loadScript('lib/stellerator/stellerator-embedded.min.js');
|
||||||
|
const $6502 : any = window['$6502'];
|
||||||
|
this.Stellerator = $6502.Stellerator;
|
||||||
|
// create a canvas, stellerator will override width/height but we need CSS aspect ratio
|
||||||
|
const canvas = __createCanvas(window.document, this.mainElement, 28, 20);
|
||||||
|
// stellerator adds overscan, we don't need as much
|
||||||
|
canvas.style.padding = '10px';
|
||||||
|
this.stellerator = new this.Stellerator(canvas, 'lib/stellerator/stellerator.min.js',
|
||||||
|
{
|
||||||
|
gamma: 0.8,
|
||||||
|
scalingMode: this.Stellerator.ScalingMode.qis,
|
||||||
|
tvEmulation: this.Stellerator.TvEmulation.composite,
|
||||||
|
phosphorLevel: 0.5,
|
||||||
|
scanlineLevel: 0.2
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
loadROM(title, data) {
|
||||||
|
this.stellerator.run(data, this.Stellerator.TvMode.ntsc);
|
||||||
|
}
|
||||||
|
reset() {
|
||||||
|
this.stellerator.reset();
|
||||||
|
}
|
||||||
|
pause() {
|
||||||
|
this.running = false;
|
||||||
|
this.stellerator.pause();
|
||||||
|
}
|
||||||
|
resume() {
|
||||||
|
this.running = true;
|
||||||
|
this.stellerator.resume();
|
||||||
|
}
|
||||||
|
isRunning() {
|
||||||
|
return this.running;
|
||||||
|
}
|
||||||
|
getToolForFilename = getToolForFilename_vcs;
|
||||||
|
getDefaultExtension() { return ".a"; }
|
||||||
|
getROMExtension() { return ".a26"; }
|
||||||
|
getPresets() { return VCS_PRESETS }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////
|
||||||
|
|
||||||
PLATFORMS['vcs'] = VCSPlatform;
|
PLATFORMS['vcs'] = VCSPlatform;
|
||||||
PLATFORMS['vcs.mame'] = VCSMAMEPlatform;
|
PLATFORMS['vcs.mame'] = VCSMAMEPlatform;
|
||||||
|
PLATFORMS['vcs.stellerator'] = VCSStellaPlatform;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user