fixed vcs-mame presets; improved vcs debug info

This commit is contained in:
Steven Hugg 2018-08-06 13:47:55 -04:00
parent 2e37e22eb8
commit 8693179821
6 changed files with 33 additions and 19 deletions

View File

@ -35,15 +35,12 @@ TODO:
- show self-modifying code insns left of editor
- facade/kbd shortcuts for emulators, focus
- update Javatari version? (and others?)
- WASM takes too long to load (esp. verilog)
(https://developers.google.com/web/updates/2018/04/loading-wasm)
- unify versioning
- more UI tests
- base-36 encoding for LZG
- disassembler for uploaded ROMs
- show tool-specific (readonly) include files
- verilog debugging/reloading makes it slow
- fix VCS mame
- remove FPS and play controls when Verilog scope paused
- compile stuck when errors unchanged
- sound mute?
@ -53,7 +50,6 @@ TODO:
- how to revert included files?
- go to error in include files
- BOM in upload/download?
- don't mess with localStorage when migrating!
WEB WORKER FORMAT

View File

@ -72,7 +72,7 @@ if (window.location.host.endsWith('8bitworkshop.com')) {
<a tabindex="-1" href="#">Platform</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="?platform=vcs" id="item_platform_vcs">Atari VCS</a></li>
<li><a class="dropdown-item" href="?platform=vcs-mame" id="item_platform_vcs">Atari VCS (MAME)</a></li>
<!--<li><a class="dropdown-item" href="?platform=vcs-mame" id="item_platform_vcs">Atari VCS (MAME)</a></li>-->
<!--<li><a class="dropdown-item" href="?platform=apple2" id="item_platform_apple2">Apple ][</a></li>-->
<li><a class="dropdown-item" href="?platform=vicdual" id="item_platform_vicdual">VIC Dual</a></li>
<li><a class="dropdown-item" href="?platform=mw8080bw" id="item_platform_mw8080bw">Midway 8080</a></li>

View File

@ -127,13 +127,12 @@ var VCSPlatform = function() {
this.getDefaultExtension = function() { return ".a"; };
this.getDebugCategories = function() {
return ['CPU','Memory','PIA','TIA'];
return ['CPU','PIA','TIA'];
}
this.getDebugInfo = function(category, state) {
switch (category) {
case 'CPU': return this.cpuStateToLongString(state.c);
case 'Memory': return this.ramStateToLongString(state);
case 'PIA': return this.piaStateToLongString(state.p);
case 'PIA': return this.ramStateToLongString(state) + "\n" + this.piaStateToLongString(state.p);
case 'TIA': return this.tiaStateToLongString(state.t);
}
}
@ -143,24 +142,37 @@ var VCSPlatform = function() {
this.tiaStateToLongString = function(t) {
var pos = this.getRasterPosition();
var s = '';
s += "H " + pos.x + " V " + pos.y + "\n";
s += "H" + lpad(pos.x,5) + " V" + lpad(pos.y,5) + " ";
s += (t.vs?"VSYNC ":"- ") + (t.vb?"VBLANK ":"- ") + "\n";
s += "\n";
s += "Playfield " + t.f + "\n";
// TODO? s += " Color {color:0x" + hex(t.fc) + "} {color:0x" + hex(t.fb) + "}\n";
s += " " + (t.fr?"REFLECT ":"- ") + (t.fs?"SCOREMODE ":"- ") + (t.ft?"PRIORITY ":"- ") + "\n";
for (var j=0; j<2; j++) {
var i = "p"+j;
s += "Player"+j+ " " + t[i+'co'] + " " + t[i+'sc'] + " " + t[i+'ss'] + " " + (t[i+'v']?"DELAY":"") + " " + (t[i+'cc']?"CLOSECOPY":"") + " " + (t[i+'mc']?"MEDCOPY":"") + " " + (t[i+'wc']?"WIDECOPY":"") + " " + (t[i+'r']?"REFLECT":"") + "\n";
s += " " + tobin(t[i]) + " " + tobin(t[i+'d']) + "\n";
s += "Player"+j+ lpad(tobin(t[i]),11) + lpad(tobin(t[i+'d']),11) + "\n";
}
s += "\n";
// TODO? s += " Color {color:0x" + hex(t.fc) + "} {color:0x" + hex(t.fb) + "}\n";
s += " Count Scan Speed\n";
for (var j=0; j<2; j++) {
var i = "p"+j;
s += "Player"+j+ lpad(t[i+'co'],8) + lpad(nonegstr(t[i+'sc']),5) + lpad(t[i+'ss'],6);
s += " " + (t[i+'rr']?"RESET":"") + " " + (t[i+'v']?"DELAY":"") + " " + (t[i+'cc']?"CLOSECOPY":"") + " " + (t[i+'mc']?"MEDCOPY":"") + " " + (t[i+'wc']?"WIDECOPY":"") + " " + (t[i+'r']?"REFLECT":"") + "\n";
}
for (var j=0; j<2; j++) {
var i = "m"+j;
s += "Missile"+j+ " " + t[i+'co'] + " " + t[i+'sc'] + " " + t[i+'ss'] + "\n";
s += "Missile"+j+ lpad(t[i+'co'],7) + lpad(nonegstr(t[i+'sc']),5) + lpad(t[i+'ss'],6);
s += " " + (t[i+'rr']?"RESET":"") + " " + (t[i+'r']?"RESET2PLAYER":"") + "\n";
}
s += "Ball " + t['bco'] + " " + t['bsc'] + " " + t['bss'] + "\n";
s += "Ball"+ lpad(t['bco'],11) + lpad(nonegstr(t['bsc']),5) + lpad(t['bss'],6) + "\n";
return s;
}
};
function nonegstr(n) {
return n < 0 ? "-" : n.toString();
}
/// VCS TIMING ANALYSIS
var pc2minclocks = {};

View File

@ -170,8 +170,10 @@ export class CodeProject {
loadNext();
} else {
// found on remote fetch?
var webpath = "presets/" + this.platform_id + "/" + path;
if (this.platform_id == 'vcs' && path.indexOf('.') <= 0)
var preset_id = this.platform_id;
preset_id = preset_id.replace("-mame","");
var webpath = "presets/" + preset_id + "/" + path;
if (this.platform_id.startsWith('vcs') && path.indexOf('.') <= 0)
webpath += ".a"; // legacy stuff
this.callbackGetRemote( webpath, (text:string) => {
console.log("GET",webpath,text.length,'bytes');
@ -180,7 +182,7 @@ export class CodeProject {
loadNext();
}, 'text')
.fail( (err:XMLHttpRequest) => {
console.log("Could not load preset", path, err);
console.log("Could not load preset", path, err.status);
// only cache result if status is 404 (not found)
if (err.status && err.status == 404)
this.filedata[path] = null;

View File

@ -144,7 +144,7 @@ function refreshWindowList() {
// add other source files
separate = true;
current_project.iterateFiles(function(id, text) {
if (id != main_file_id)
if (text && id != main_file_id)
addWindowItem(id, getFilenameForPath(id), loadEditor);
});

View File

@ -1,6 +1,10 @@
"use strict";
function lpad(s:string, n:number):string { while(s.length<n) s=" "+s; return s; }
function lpad(s:string, n:number):string {
s += ''; // convert to string
while (s.length<n) s=" "+s;
return s;
}
function byte2signed(b:number):number {
b &= 0xff;