1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-02-16 17:30:27 +00:00

can't create a blank file; fixed .h gutter format; right align info links

This commit is contained in:
Steven Hugg 2018-11-24 16:08:33 -05:00
parent a511d81c97
commit a10559634f
3 changed files with 13 additions and 7 deletions

View File

@ -109,6 +109,9 @@ div.mem_info a:hover {
div.mem_info a.selected { div.mem_info a.selected {
color: #ffffff; color: #ffffff;
} }
.mem_info_links {
text-align:right;
}
.btn_group { .btn_group {
border-radius:6px; border-radius:6px;
padding:8px; padding:8px;

View File

@ -286,6 +286,7 @@ export abstract class BaseFrameBasedPlatform extends BaseDebugPlatform {
export function getToolForFilename_6502(fn:string) : string { export function getToolForFilename_6502(fn:string) : string {
if (fn.endsWith(".pla")) return "plasm"; if (fn.endsWith(".pla")) return "plasm";
if (fn.endsWith(".c")) return "cc65"; if (fn.endsWith(".c")) return "cc65";
if (fn.endsWith(".h")) return "cc65";
if (fn.endsWith(".s")) return "ca65"; if (fn.endsWith(".s")) return "ca65";
if (fn.endsWith(".ca65")) return "ca65"; if (fn.endsWith(".ca65")) return "ca65";
if (fn.endsWith(".dasm")) return "dasm"; if (fn.endsWith(".dasm")) return "dasm";
@ -572,6 +573,7 @@ export abstract class BaseZ80Platform extends BaseDebugPlatform {
export function getToolForFilename_z80(fn) { export function getToolForFilename_z80(fn) {
if (fn.endsWith(".c")) return "sdcc"; if (fn.endsWith(".c")) return "sdcc";
if (fn.endsWith(".h")) return "sdcc";
if (fn.endsWith(".s")) return "sdasz80"; if (fn.endsWith(".s")) return "sdasz80";
if (fn.endsWith(".ns")) return "naken"; if (fn.endsWith(".ns")) return "naken";
if (fn.endsWith(".scc")) return "sccz80"; if (fn.endsWith(".scc")) return "sccz80";

View File

@ -229,7 +229,7 @@ function getSkeletonFile(fileid:string, callback) {
function _createNewFile(e) { function _createNewFile(e) {
// TODO: support spaces // TODO: support spaces
var filename = prompt("Create New File", "newfile" + platform.getDefaultExtension()); var filename = prompt("Create New File", "newfile" + platform.getDefaultExtension());
if (filename && filename.length) { if (filename && filename.trim().length > 0) {
if (filename.indexOf(" ") >= 0) { if (filename.indexOf(" ") >= 0) {
alert("No spaces, please."); alert("No spaces, please.");
return; return;
@ -409,6 +409,7 @@ function _revertFile(e) {
} }
}, 'text') }, 'text')
.fail(function() { .fail(function() {
// TODO: delete file
alert("Can only revert built-in files."); alert("Can only revert built-in files.");
}); });
return true; return true;
@ -572,7 +573,7 @@ function showDebugInfo(state?) {
if (s) { if (s) {
var hs = lastDebugInfo ? highlightDifferences(lastDebugInfo, s) : s; var hs = lastDebugInfo ? highlightDifferences(lastDebugInfo, s) : s;
meminfo.show().html(hs); meminfo.show().html(hs);
var catspan = $('<span>'); var catspan = $('<div class="mem_info_links">');
var addCategoryLink = (cat:string) => { var addCategoryLink = (cat:string) => {
var catlink = $('<a>'+cat+'</a>'); var catlink = $('<a>'+cat+'</a>');
if (cat == debugCategory) if (cat == debugCategory)
@ -890,7 +891,7 @@ function addFileToProject(type, ext, linefn) {
var wnd = projectWindows.getActive(); var wnd = projectWindows.getActive();
if (wnd && wnd.insertText) { if (wnd && wnd.insertText) {
var filename = prompt("Add "+type+" File to Project", "filename"+ext); var filename = prompt("Add "+type+" File to Project", "filename"+ext);
if (filename) { if (filename && filename.trim().length > 0) {
var path = "local/" + filename; var path = "local/" + filename;
var newline = "\n" + linefn(filename) + "\n"; var newline = "\n" + linefn(filename) + "\n";
current_project.loadFiles([path], (err, result) => { current_project.loadFiles([path], (err, result) => {
@ -913,10 +914,10 @@ function _addIncludeFile() {
var tool = platform.getToolForFilename(fn); var tool = platform.getToolForFilename(fn);
if (fn.endsWith(".c") || tool == 'sdcc' || tool == 'cc65') if (fn.endsWith(".c") || tool == 'sdcc' || tool == 'cc65')
addFileToProject("Header", ".h", (s) => { return '#include "'+s+'"' }); addFileToProject("Header", ".h", (s) => { return '#include "'+s+'"' });
else if (tool == 'dasm') else if (tool == 'dasm' || tool == 'zmac')
addFileToProject("Include File", ".h", (s) => { return '\tinclude "'+s+'"' }); addFileToProject("Include File", ".inc", (s) => { return '\tinclude "'+s+'"' });
else if (tool == 'ca65' || tool == 'sdasz80' || tool == 'zmac') else if (tool == 'ca65' || tool == 'sdasz80')
addFileToProject("Include File", ".h", (s) => { return '\t.include "'+s+'"' }); addFileToProject("Include File", ".inc", (s) => { return '\t.include "'+s+'"' });
else if (tool == 'verilator') else if (tool == 'verilator')
addFileToProject("Verilog File", ".v", (s) => { return '`include "'+s+'"' }); addFileToProject("Verilog File", ".v", (s) => { return '`include "'+s+'"' });
else else