worker: use imports instead of require()

This commit is contained in:
Steven Hugg 2021-07-27 11:26:49 -05:00
parent f3bf1602d5
commit 29f0238b90
4 changed files with 20 additions and 6 deletions

View File

@ -134,6 +134,7 @@ abstract class CodeAnalyzer6502 implements CodeAnalyzer {
}
break;
// TODO: only Apple2 (vapor lock)
/*
case 0xad:
if (lob == 0x61 && hib == 0xc0) { // LDA $C061
minclocks = 0;
@ -141,6 +142,7 @@ abstract class CodeAnalyzer6502 implements CodeAnalyzer {
meta.minCycles = meta.maxCycles = 0;
}
break;
*/
case 0x20: // JSR
// TODO: handle bare RTS case
minclocks += meta.minCycles;

View File

@ -243,14 +243,14 @@ var PLATFORM_PARAMS = {
cfgfile: 'apple2.cfg',
libargs: ['apple2.lib'],
},
'atari8-800xl': {
'atari8-800xl.disk': {
arch: '6502',
define: ['__ATARI__'],
cfgfile: 'atari.cfg',
libargs: ['atari.lib'],
fastbasic_cfgfile: 'fastbasic-cart.cfg',
},
'atari8-800xl.cart': {
'atari8-800xl': {
arch: '6502',
define: ['__ATARI__'],
cfgfile: 'atari-cart.cfg',
@ -1753,10 +1753,11 @@ function compileInlineASM(code:string, platform, options, errors, asmlines) {
return code;
}
import * as hdltypes from '../common/hdl/hdltypes';
import * as vxmlparser from '../common/hdl/vxmlparser';
function compileVerilator(step:BuildStep) {
loadNative("verilator_bin");
const hdltypes = require('../common/hdl/hdltypes');
const vxmlparser = require('../common/hdl/vxmlparser');
var platform = step.platform || 'verilog';
var errors : WorkerError[] = [];
gatherFiles(step);
@ -2789,12 +2790,13 @@ function compileFastBasic(step:BuildStep) {
};
}
import * as basic_compiler from '../common/basic/compiler';
function compileBASIC(step:BuildStep) {
var jsonpath = step.path + ".json";
gatherFiles(step);
if (staleFiles(step, [jsonpath])) {
const compiler = require('../common/basic/compiler');
var parser = new compiler.BASICParser();
var parser = new basic_compiler.BASICParser();
var code = getWorkFileAsString(step.path);
try {
var ast = parser.parseFile(code, step.path);

View File

@ -40,6 +40,7 @@ var _sms = require('gen/platform/sms.js');
var _c64 = require('gen/platform/c64.js');
var _vectrex = require('gen/platform/vectrex.js');
var _zx = require('gen/platform/zx.js');
var _atari8 = require('gen/platform/atari8.js');
//
@ -360,4 +361,13 @@ describe('Platform Replay', () => {
}
});
});
/*
it('Should run atari 800xl', async () => {
await testPlatform('atari8-800xl', 'siegegame.bin', 92, (platform, frameno) => {
if (frameno == 62) {
keycallback(Keys.VK_DOWN.c, Keys.VK_DOWN.c, 1);
}
});
});
*/
});

Binary file not shown.