1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-25 18:33:11 +00:00

fixed atari-vector 6502, pass options=... to platform constructor

This commit is contained in:
Steven Hugg 2022-02-21 16:54:33 -06:00
parent d7626be789
commit 0682af1eed
7 changed files with 14 additions and 7 deletions

View File

@ -13,6 +13,7 @@ import { SampledAudio } from "./audio";
import { ProbeRecorder } from "./recorder";
import { BaseWASMMachine } from "./wasmplatform";
import { CPU6809 } from "./cpu/6809";
import { _MOS6502 } from "./cpu/MOS6502";
///
@ -448,7 +449,7 @@ export abstract class Base6502Platform extends BaseDebugPlatform {
abstract readAddress(addr:number) : number;
newCPU(membus : MemoryBus) {
var cpu = new jt.M6502();
var cpu = new _MOS6502();
cpu.connectBus(membus);
return cpu;
}

View File

@ -3,7 +3,7 @@ import { CPU, Bus, ClockBased, SavesState, Interruptable } from "../devices";
// Copyright 2015 by Paulo Augusto Peccin. See license.txt distributed with this file.
var _MOS6502 = function() {
export var _MOS6502 = function() {
var self = this;
this.powerOn = function() {

View File

@ -30,6 +30,7 @@ declare var $ : JQueryStatic; // use browser jquery
interface UIQueryString {
platform? : string;
options?: string;
repo? : string;
file? : string;
electron? : string;
@ -2213,7 +2214,9 @@ function installGAHooks() {
async function startPlatform() {
if (!PLATFORMS[platform_id]) throw Error("Invalid platform '" + platform_id + "'.");
platform = new PLATFORMS[platform_id]($("#emuscreen")[0]);
let emudiv = $("#emuscreen")[0];
let options = decodeQueryString(qs.options || '');
platform = new PLATFORMS[platform_id](emudiv, options);
setPlatformUI();
stateRecorder = new StateRecorderImpl(platform);
PRESETS = platform.getPresets ? platform.getPresets() : [];

View File

@ -270,7 +270,7 @@ var AtariColorVectorPlatform = function(mainElement) {
clock++;
if (--nmicount == 0) {
//console.log("NMI", cpu.saveState());
var n = cpu.setIRQAndWait(); // TODO: only if I flag set
var n = cpu.setIRQ(); // TODO: only if I flag set
clock += n;
nmicount = cpuCyclesPerNMI - n;
//console.log(n, clock, nmicount);

View File

@ -432,6 +432,10 @@ var WilliamsPlatform = function(mainElement, proto, isDefender) {
] } };
}
var Williams6809Platform = function(mainElement) {
this.__proto__ = new WilliamsPlatform(mainElement, null, false);
}
var WilliamsZ80Platform = function(mainElement) {
this.__proto__ = new WilliamsPlatform(mainElement, BaseZ80Platform, false);
@ -462,7 +466,7 @@ var WilliamsDefenderPlatform = function(mainElement) {
] } };
}
PLATFORMS['williams'] = WilliamsPlatform;
PLATFORMS['williams'] = Williams6809Platform;
PLATFORMS['williams-defender'] = WilliamsDefenderPlatform;
PLATFORMS['williams-z80'] = WilliamsZ80Platform;

View File

@ -8,7 +8,6 @@
.export __STARTUP__ : absolute = 1 ; Mark as startup
.import zerobss, callmain
.import initlib, donelib, copydata
.import exit
.import __PRGRAM_START__, __PRGRAM_SIZE__ ; Linker generated
; .import __STACKSIZE__ ; Linker generated
@ -30,7 +29,7 @@ start:
_exit: pha
jsr donelib
pla
jmp exit
jmp start
nmi:
inc $0