Skip to content

Commit

Permalink
Corr. errores de ejecución pt.4, preparar versión final
Browse files Browse the repository at this point in the history
  • Loading branch information
twilight1794 committed Jun 22, 2023
1 parent aeb1c51 commit d655311
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 30 deletions.
2 changes: 1 addition & 1 deletion neutralino.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
"applicationId": "xyz.campanita.z80",
"version": "1.0.0.0",
"defaultMode": "window",
"defaultMode": "browser",
"port": 0,
"documentRoot": "/public/",
"url": "/",
Expand Down
3 changes: 2 additions & 1 deletion public/archivos.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ class Proyecto {
nuevoArchivo(n, c){
let la = localStorage.getItem("archivos");
if (la) {
localStorage.setItem("archivos", la + "/" + n);
if (la.split("/").find((e) => e == n)) noti.error(_("err_archivo_existente"));
localStorage.setItem("archivos", la + "/" + n);
localStorage.setItem("archivo_"+n, c);
} else {
localStorage.setItem("archivos", n);
localStorage.setItem("archivo_"+n, c);
Expand Down
1 change: 1 addition & 0 deletions public/cadenas/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<string name="btn_macros">Macros...</string>
<string name="menubar_principal_ayuda">Help</string>
<string name="btn_manual">User manual</string>
<string name="lnk_manuallinea">Online manual...</string>
<string name="lnk_incidencias">Report an issue</string>
<string name="lnk_repositorio">Repository</string>
<string name="btn_comprobaracts">Check for updates...</string>
Expand Down
1 change: 1 addition & 0 deletions public/cadenas/es.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<string name="btn_macros">Macros...</string>
<string name="menubar_principal_ayuda">Ayuda</string>
<string name="btn_manual">Manual de usuario</string>
<string name="lnk_manuallinea">Manual en línea...</string>
<string name="lnk_incidencias">Informar sobre un problema</string>
<string name="lnk_repositorio">Repositorio</string>
<string name="btn_comprobaracts">Buscar actualizaciones...</string>
Expand Down
9 changes: 5 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<title>$nombre_app</title>
<meta name="versionNumero" content="1.0.0.0" />
<meta name="versionFecha" content="lun 19 jun 2023 13:43:27 UTC" />
<meta name="versionFecha" content="jue 22 jun 2023 18:09:41 UTC" />
<link rel="stylesheet" type="text/css" href="iconos.css" />
<link rel="stylesheet" type="text/css" href="estilos.css" />
<link rel="stylesheet" type="text/css" href="hint.min.css" />
Expand Down Expand Up @@ -215,7 +215,8 @@
</li>
<li aria-selected="false"><span>$menubar_principal_ayuda</span>
<ul>
<li><button role="menuitem" id="btnManual">$btn_manual <kbd>M-a a</kbd></button></li>
<li style="display: none;"><button role="menuitem" id="btnManual">$btn_manual <kbd>M-a a</kbd></button></li>
<li><a role="menuitem" target="_blank" id="lnk_manuallinea" href="https://github.com/twilight1794/z80/blob/main/doc/usuario.es.adoc">$lnk_manuallinea</a></li>
<li><a role="menuitem" target="_blank" id="lnk_incidencias" href="https://github.com/twilight1794/z80/issues">$lnk_incidencias <kbd>M-a p</kbd></a></li>
<li><a role="menuitem" target="_blank" id="lnk_repositorio" href="https://github.com/twilight1794/z80">$lnk_repositorio <kbd>M-a r</kbd></a></li>
<li><button role="menuitem" id="btnComprobarActs">$btn_comprobaracts <kbd>M-a m</kbd></button></li>
Expand All @@ -229,12 +230,12 @@
<section id="r-act">
<nav id="menuActividades" role="tablist" aria-orientation="vertical" aria-label="Actividades">
<button role="tab" aria-controls="r-exp" id="btnMenuExplorador"><span>$btn_menuexplorador</span></button>
<button role="tab" aria-controls="r-byr" id="btnMenuBuscar"><span>$btn_menubuscar</span></button>
<button style="display: none;" role="tab" aria-controls="r-byr" id="btnMenuBuscar"><span>$btn_menubuscar</span></button>
<button role="tab" aria-controls="r-eje" id="btnMenuEjecucion"><span>$btn_menuejecucion</span></button>
<button role="tab" aria-controls="r-msg" id="btnMenuMensajes"><span>$btn_menumensajes</span></button>
<button role="tab" aria-controls="r-eti" id="btnMenuEtiquetas"><span>$btn_menuetiquetas</span></button>
<button style="display: none;" role="tab" aria-controls="r-mac" id="btnMenuMacros"><span>$btn_menumacros</span></button>
<button role="tab" aria-controls="r-man" id="btnMenuManual"><span>$btn_menumanual</span></button>
<button style="display: none;" role="tab" aria-controls="r-man" id="btnMenuManual"><span>$btn_menumanual</span></button>
<button role="tab" aria-controls="r-cfg" id="btnMenuConfig"><span>$btn_menuconfig</span></button>
</nav>
<section role="tabpanel" id="r-exp">
Expand Down
4 changes: 2 additions & 2 deletions public/inicial.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ function estConfig(p, v){
let f = funsConfig[p];
if (f) f(val);
} catch (e) {}
salvarConfig();
//salvarConfig();
}

function estConfigIni(d){
Expand Down Expand Up @@ -821,7 +821,7 @@ window.addEventListener("DOMContentLoaded", async () => {
btnSalir.innerHTML = "<button id=\"btnSalir\" role=\"menuitem\"><span>"+_("btn_salir")+"</span></button>";
document.querySelector("#menuBarra>ul>li>ul").appendChild(btnSalir);
btnSalir.addEventListener("click", async () => {
await salvarConfig();
//await salvarConfig();
Neutralino.app.exit();
});
}
Expand Down
50 changes: 28 additions & 22 deletions public/plataforma.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Plataforma {
*/
cargarArchivoEnsamblador(nom){
let t = localStorage.getItem("archivo_"+nom) || "";
t = buscarMacros(t);
//t = buscarMacros(t);
return t.split("\n");
}

Expand Down Expand Up @@ -361,7 +361,10 @@ class Plataforma {
* @memberof Plataforma
*/
escribirRegistro(reg, val){
if (val instanceof Array) val = decodificarValor(val, val.length, true, false);
if (val instanceof Array){
console.log("Array!")
val = decodificarValor(val, val.length, true, false);
}
reg = reg.toLowerCase();
switch(reg){
case "a":
Expand All @@ -380,14 +383,14 @@ class Plataforma {
case "ex":
case "hx":
case "lx":
if (val > 255) throw new ValorTamanoError(val, 1);
if (val > 255) throw new ValorTamanoError(2);
document.getElementById("v-"+reg).textContent = val.toString(16).toUpperCase().padStart(2, "0");
break;
case "ix":
case "iy":
case "sp":
case "pc":
if (val > 65535) throw new ValorTamanoError(val, 1);
if (val > 65535) throw new ValorTamanoError(2);
document.getElementById("v-"+reg).textContent = val.toString(16).toUpperCase().padStart(4,"0");
break;
case "bc":
Expand All @@ -396,14 +399,15 @@ class Plataforma {
case "bcx":
case "dex":
case "hlx":
if (val > 65535) throw new ValorTamanoError(val, 1);
if (val > 65535) throw new ValorTamanoError(2);
let va = val.toString(16).padStart(4,"0").substring(0,2);
let vb = val.toString(16).padStart(4,"0").substring(2,4);
document.getElementById("v-"+reg[0]+((reg.length == 3)?"x":"")).textContent = vb;
document.getElementById("v-"+reg[1]+((reg.length == 3)?"x":"")).textContent = va;
document.getElementById("v-"+reg[0]+((reg.length == 3)?"x":"")).textContent = va;
document.getElementById("v-"+reg[1]+((reg.length == 3)?"x":"")).textContent = vb;
break;
case "f":
case "fx":
if (val > 255) throw new ValorTamanoError(val, 1);
if (val > 255) throw new ValorTamanoError(1);
Array.from(val.toString(2).padStart(8, "0")).forEach((e, i) => {
let it = document.querySelector("#r-f tr:nth-child("+(i+2)+") td:nth-child("+((reg=="f")?2:4)+")");
if (e=="1") it.classList.add("activo");
Expand Down Expand Up @@ -911,26 +915,25 @@ class Plataforma {
}]];
case 0xf:
this.escribirRegistro("pc", dir+1);

op1 = this.leerRegistro("a");
auxv1 = Plataforma.obtRRC(op1);
this.escribirRegistro("a", auxv1[0]);
this.estBanderasOp("RRCA", auxv1);
return ["RRCA", 4, 1, 1, []];
case 0x10:
//op1 = decodificarValor([this.leerMemoria(dir+1)], 1, true, true);
op1 = this.leerMemoria(dir+1);
op1 = decodificarValor([this.leerMemoria(dir+1)], 1, true, true);
auxv1 = this.leerRegistro("b");
if (auxv1>0){
this.escribirRegistro("b", auxv1-1);
this.escribirRegistro("b", auxv1-1);
if (auxv1-1>0){
this.escribirRegistro("pc", dir + op1 + 2);
tt = 13;
tm = 3;
} else {
this.escribirRegistro("pc", dir+2);
tt = 8;
tm = 2;
}
return ["DJNZ", tt, tm, [{
return ["DJNZ", tt, tm, 2, [{
"tipo": TipoOpEns.DESPLAZAMIENTO,
"texto": this.imprimirValor(TipoOpEns.DESPLAZAMIENTO, op1+2)
}]];
Expand Down Expand Up @@ -1062,7 +1065,7 @@ class Plataforma {
"texto": "HL"
}, {
"tipo": TipoOpEns.DIRECCION,
"texto": this.imprimirValor(TipoOpEns.DIRECCION, dir1)
"texto": this.imprimirValor(TipoOpEns.DIRECCION, dir2)
}]];
case 0x2f:
this.escribirRegistro("pc", dir+1);
Expand Down Expand Up @@ -1128,8 +1131,8 @@ class Plataforma {
dir2 = this.leerRegistro("hl");
op2 = this.escribirMemoria(dir2, op1);
return ["LD", 10, 3, 2, [{
"tipo": TipoOpEns.DESPLAZAMIENTO,
"texto": "(HL"+this.imprimirValor(TipoOpEns.DESPLAZAMIENTO, op1)+")"
"tipo": TipoOpEns.DIRECCION_R,
"texto": "(HL)"
}, {
"tipo": TipoOpEns.NUMERO,
"texto": this.imprimirValor(TipoOpEns.NUMERO, op2)
Expand Down Expand Up @@ -1501,15 +1504,16 @@ class Plataforma {
/* Compuestos */
/** 00dd0001 **/
case 1: case 17: case 33: case 49:
this.escribirRegistro("pc", dir+3);
dir1 = (cod-1)>>4;
op2 = this.leerPalabra(dir+1);
this.escribirRegistro(this.ValsSS[dir1], op2);
return ["LD", 10, 2, 1, [{
"tipo": TipoOpEns.REGISTRO,
"texto": this.ValsSS[dir1]
}, {
"tipo": TipoOpEns.DIRECCION,
"texto": this.imprimirValor(TipoOpEns.DIRECCION, op2)
"tipo": TipoOpEns.NUMERO,
"texto": this.imprimirValor(TipoOpEns.NUMERO, op2)
}]];
/** 00rrr100 **/
case 4: case 12: case 20: case 28: case 36: case 44: case 60:
Expand Down Expand Up @@ -1558,12 +1562,12 @@ class Plataforma {
}]];
/** 00ss1001 **/
case 9: case 25: case 41: case 57:
this.escribirRegistro("pc", dir+2);
this.escribirRegistro("pc", dir+1);
dir2 = (cod-3)>>4;
op1 = this.leerRegistro("hl");
op2 = this.leerRegistro(this.ValsSS[dir2]);
res = op1+op2;
this.escribirRegistro(this.ValsSS[dir2], res);
res = op1+op2;
this.escribirRegistro("hl", res);
this.estBanderasOp("ADD", [res, op1, op2]);
return ["ADD", 11, 3, 1, [{
"tipo": TipoOpEns.REGISTRO_PAR,
Expand Down Expand Up @@ -1798,6 +1802,7 @@ class Plataforma {
}]];
/** 11qq0001 **/
case 193: case 209: case 225: case 241:
this.escribirRegistro("pc", dir+1);
dir1 = (cod-193)>>4;
op1 = this.leerPila();
this.retirarPila();
Expand All @@ -1808,6 +1813,7 @@ class Plataforma {
}]];
/** 11qq0101 **/
case 197: case 213: case 229: case 245:
this.escribirRegistro("pc", dir+1);
dir1 = (cod-197)>>4;
op1 = this.leerRegistro(this.ValsQQ[dir1]);
this.insertarPila(op1);
Expand Down

0 comments on commit d655311

Please sign in to comment.