1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-06-08 23:29:42 +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 { ProbeRecorder } from "./recorder";
import { BaseWASMMachine } from "./wasmplatform"; import { BaseWASMMachine } from "./wasmplatform";
import { CPU6809 } from "./cpu/6809"; 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; abstract readAddress(addr:number) : number;
newCPU(membus : MemoryBus) { newCPU(membus : MemoryBus) {
var cpu = new jt.M6502(); var cpu = new _MOS6502();
cpu.connectBus(membus); cpu.connectBus(membus);
return cpu; 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. // Copyright 2015 by Paulo Augusto Peccin. See license.txt distributed with this file.
var _MOS6502 = function() { export var _MOS6502 = function() {
var self = this; var self = this;
this.powerOn = function() { this.powerOn = function() {

View File

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

View File

@ -270,7 +270,7 @@ var AtariColorVectorPlatform = function(mainElement) {
clock++; clock++;
if (--nmicount == 0) { if (--nmicount == 0) {
//console.log("NMI", cpu.saveState()); //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; clock += n;
nmicount = cpuCyclesPerNMI - n; nmicount = cpuCyclesPerNMI - n;
//console.log(n, clock, nmicount); //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) { var WilliamsZ80Platform = function(mainElement) {
this.__proto__ = new WilliamsPlatform(mainElement, BaseZ80Platform, false); 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-defender'] = WilliamsDefenderPlatform;
PLATFORMS['williams-z80'] = WilliamsZ80Platform; PLATFORMS['williams-z80'] = WilliamsZ80Platform;

View File

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