mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 03:01:22 -06:00
formatfixes
This commit is contained in:
@@ -26,10 +26,12 @@ import path from 'path';
|
||||
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import { BaseCompiler } from '../base-compiler';
|
||||
import {BaseCompiler} from '../base-compiler';
|
||||
|
||||
export class BeebAsmCompiler extends BaseCompiler {
|
||||
static get key() { return 'beebasm'; }
|
||||
static get key() {
|
||||
return 'beebasm';
|
||||
}
|
||||
|
||||
optionsForFilter() {
|
||||
return ['-v', '-do', 'disk.ssd'];
|
||||
@@ -49,13 +51,13 @@ export class BeebAsmCompiler extends BaseCompiler {
|
||||
execOptions.customCwd = dirPath;
|
||||
}
|
||||
|
||||
options.splice(- 1, 0, '-i');
|
||||
options.splice(-1, 0, '-i');
|
||||
|
||||
const result = await this.exec(compiler, options, execOptions);
|
||||
result.inputFilename = inputFilename;
|
||||
const transformedInput = result.filenameTransform(inputFilename);
|
||||
|
||||
if ((result.code === 0) && options.includes('-v')) {
|
||||
if (result.code === 0 && options.includes('-v')) {
|
||||
const outputFilename = this.getOutputFilename(dirPath, this.outputFilebase);
|
||||
fs.writeFileSync(outputFilename, result.stdout);
|
||||
}
|
||||
|
||||
@@ -27,10 +27,12 @@ import path from 'path';
|
||||
|
||||
import _ from 'underscore';
|
||||
|
||||
import { BaseTool } from './base-tool';
|
||||
import {BaseTool} from './base-tool';
|
||||
|
||||
export class BBCDiskifyTool extends BaseTool {
|
||||
static get key() { return 'bbcdiskify-tool'; }
|
||||
static get key() {
|
||||
return 'bbcdiskify-tool';
|
||||
}
|
||||
|
||||
async createBlankSSD(compilationInfo) {
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
@@ -52,22 +54,20 @@ export class BBCDiskifyTool extends BaseTool {
|
||||
|
||||
async assembleCode(compilationInfo) {
|
||||
const asmText = fs.readFileSync(compilationInfo.executableFilename);
|
||||
fs.writeFileSync(compilationInfo.executableFilename,
|
||||
'.org $3000\njsr _main\nrts\n\n' + asmText);
|
||||
fs.writeFileSync(compilationInfo.executableFilename, '.org $3000\njsr _main\nrts\n\n' + asmText);
|
||||
|
||||
const execOptions = this.getDefaultExecOptions();
|
||||
execOptions.customCwd = path.dirname(compilationInfo.executableFilename);
|
||||
|
||||
await this.exec('/opt/compiler-explorer/6502/cc65-trunk/bin/ca65', [
|
||||
'--include-dir', '/opt/compiler-explorer/6502/cc65-trunk/share/cc65/asminc',
|
||||
'output.s',
|
||||
'-o',
|
||||
'$.!Boot'], execOptions);
|
||||
await this.exec(
|
||||
'/opt/compiler-explorer/6502/cc65-trunk/bin/ca65',
|
||||
['--include-dir', '/opt/compiler-explorer/6502/cc65-trunk/share/cc65/asminc', 'output.s', '-o', '$.!Boot'],
|
||||
execOptions,
|
||||
);
|
||||
}
|
||||
|
||||
async runTool(compilationInfo, inputFilename) {
|
||||
if(!compilationInfo.filters.binary)
|
||||
{
|
||||
if (!compilationInfo.filters.binary) {
|
||||
await this.assembleCode(compilationInfo);
|
||||
await this.createBlankSSD(compilationInfo);
|
||||
await this.writeSourceFiles(compilationInfo);
|
||||
@@ -78,7 +78,7 @@ export class BBCDiskifyTool extends BaseTool {
|
||||
}
|
||||
|
||||
const outputPath = path.dirname(compilationInfo.executableFilename);
|
||||
const file_buffer = fs.readFileSync(path.join(outputPath, 'disk.ssd'));
|
||||
const file_buffer = fs.readFileSync(path.join(outputPath, 'disk.ssd'));
|
||||
const binary_base64 = file_buffer.toString('base64');
|
||||
|
||||
const result = {
|
||||
|
||||
Reference in New Issue
Block a user