mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
add miracle emulator for z88dk sms files (#4086)
This commit is contained in:
@@ -106,6 +106,10 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
return `${this.outputFilebase}.tap`;
|
||||
}
|
||||
|
||||
getSmsfilename() {
|
||||
return `${this.outputFilebase}.sms`;
|
||||
}
|
||||
|
||||
override async objdump(outputFilename, result: any, maxSize: number, intelAsm, demangle, filters: ParseFilters) {
|
||||
outputFilename = this.getObjdumpOutputFilename(outputFilename);
|
||||
|
||||
@@ -154,6 +158,13 @@ export class z88dkCompiler extends BaseCompiler {
|
||||
const binary_base64 = file_buffer.toString('base64');
|
||||
result.speccytape = binary_base64;
|
||||
}
|
||||
|
||||
const smsFilepath = path.join(result.dirPath, this.getSmsfilename());
|
||||
if (await utils.fileExists(smsFilepath)) {
|
||||
const file_buffer = await fs.readFile(smsFilepath);
|
||||
const binary_base64 = file_buffer.toString('base64');
|
||||
result.miraclesms = binary_base64;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -1419,9 +1419,35 @@ Compiler.prototype.postCompilationResult = function (request, result, wasCmake)
|
||||
this.emulateBbcDisk(result.bbcdiskimage);
|
||||
} else if (result.speccytape) {
|
||||
this.emulateSpeccyTape(result.speccytape);
|
||||
} else if (result.miraclesms) {
|
||||
this.emulateMiracleSMS(result.miraclesms);
|
||||
}
|
||||
};
|
||||
|
||||
Compiler.prototype.emulateMiracleSMS = function (image) {
|
||||
var dialog = $('#miracleemu');
|
||||
|
||||
this.alertSystem.notify(
|
||||
'Click ' +
|
||||
'<a target="_blank" id="miracle_emulink" style="cursor:pointer;" click="javascript:;">here</a>' +
|
||||
' to emulate',
|
||||
{
|
||||
group: 'emulation',
|
||||
collapseSimilar: true,
|
||||
dismissTime: 10000,
|
||||
onBeforeShow: function (elem) {
|
||||
elem.find('#miracle_emulink').on('click', function () {
|
||||
dialog.modal();
|
||||
|
||||
var emuwindow = dialog.find('#miracleemuframe')[0].contentWindow;
|
||||
var tmstr = Date.now();
|
||||
emuwindow.location = 'https://xania.org/miracle/miracle.html?' + tmstr + '#b64sms=' + image;
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Compiler.prototype.emulateSpeccyTape = function (image) {
|
||||
var dialog = $('#jsspeccyemu');
|
||||
|
||||
|
||||
5
views/popups/miracleemu.pug
Normal file
5
views/popups/miracleemu.pug
Normal file
@@ -0,0 +1,5 @@
|
||||
#miracleemu.modal.fade.gl_keep(tabindex="-1" role="dialog")
|
||||
.modal-dialog.modal-xl
|
||||
.modal-content
|
||||
.modal-body
|
||||
iframe#miracleemuframe(src="about:blank" width="1024" height="600")
|
||||
@@ -24,4 +24,6 @@ include jsbeebemu
|
||||
|
||||
include jsspeccyemu
|
||||
|
||||
include miracleemu
|
||||
|
||||
include site-template-loader
|
||||
|
||||
Reference in New Issue
Block a user