1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-29 14:51:17 +00:00

multiple -D for cc65

This commit is contained in:
Steven Hugg 2019-12-18 18:47:40 -06:00
parent 4a1ac1bbac
commit d55576be9f
2 changed files with 16 additions and 14 deletions

View File

@ -1195,7 +1195,7 @@ export class WASMMachine implements Machine {
} }
// set init string // set init string
if (this.prgstart) { if (this.prgstart) {
this.initstring = "\r\r\r\r\r\r\rSYS " + this.prgstart + "\r"; this.initstring = "\r\r\r\r\r\r\r\r\r\r\rSYS " + this.prgstart + "\r";
this.initindex = 0; this.initindex = 0;
} }
} }
@ -1240,7 +1240,7 @@ export class WASMMachine implements Machine {
if (this.initstring) { if (this.initstring) {
var ch = this.initstring.charCodeAt(this.initindex >> 1); var ch = this.initstring.charCodeAt(this.initindex >> 1);
this.setKeyInput(ch, 0, (this.initindex&1) ? KeyFlags.KeyUp : KeyFlags.KeyDown); this.setKeyInput(ch, 0, (this.initindex&1) ? KeyFlags.KeyUp : KeyFlags.KeyDown);
this.initindex++; if (++this.initindex >= this.initstring.length*2) this.initstring = null;
} }
} }
read(address: number) : number { read(address: number) : number {

View File

@ -113,7 +113,7 @@ var PLATFORM_PARAMS = {
stack_end: 0x0, stack_end: 0x0,
}, },
'vector-ataricolor': { //TODO 'vector-ataricolor': { //TODO
define: '__VECTOR__', define: ['__VECTOR__'],
cfgfile: 'vector-color.cfg', cfgfile: 'vector-color.cfg',
libargs: ['crt0.o', 'sim6502.lib'], libargs: ['crt0.o', 'sim6502.lib'],
extra_link_files: ['crt0.o', 'vector-color.cfg'], extra_link_files: ['crt0.o', 'vector-color.cfg'],
@ -177,7 +177,7 @@ var PLATFORM_PARAMS = {
extra_compile_files: ['cv.h','cv_graphics.h','cv_input.h','cv_sound.h','cv_support.h','cvu.h','cvu_c.h','cvu_compression.h','cvu_f.h','cvu_graphics.h','cvu_input.h','cvu_sound.h'], extra_compile_files: ['cv.h','cv_graphics.h','cv_input.h','cv_sound.h','cv_support.h','cvu.h','cvu_c.h','cvu_compression.h','cvu_f.h','cvu_graphics.h','cvu_input.h','cvu_sound.h'],
}, },
'nes': { //TODO 'nes': { //TODO
define: '__NES__', define: ['__NES__'],
cfgfile: 'neslib2.cfg', cfgfile: 'neslib2.cfg',
libargs: ['crt0.o', 'nes.lib', 'neslib2.lib', libargs: ['crt0.o', 'nes.lib', 'neslib2.lib',
'-D', 'NES_MAPPER=0', // NROM '-D', 'NES_MAPPER=0', // NROM
@ -188,24 +188,24 @@ var PLATFORM_PARAMS = {
extra_link_files: ['crt0.o', 'neslib2.lib', 'neslib2.cfg', 'nesbanked.cfg'], extra_link_files: ['crt0.o', 'neslib2.lib', 'neslib2.cfg', 'nesbanked.cfg'],
}, },
'apple2': { 'apple2': {
define: '__APPLE2__', define: ['__APPLE2__'],
cfgfile: 'apple2-hgr.cfg', cfgfile: 'apple2-hgr.cfg',
libargs: [ '--lib-path', '/share/target/apple2/drv', '-D', '__EXEHDR__=0', 'apple2.lib'], libargs: [ '--lib-path', '/share/target/apple2/drv', '-D', '__EXEHDR__=0', 'apple2.lib'],
__CODE_RUN__: 16384, __CODE_RUN__: 16384,
code_start: 0x803, code_start: 0x803,
}, },
'apple2-e': { 'apple2-e': {
define: '__APPLE2__', define: ['__APPLE2__'],
cfgfile: 'apple2.cfg', cfgfile: 'apple2.cfg',
libargs: ['apple2.lib'], libargs: ['apple2.lib'],
}, },
'atari8-800': { 'atari8-800': {
define: '__ATARI__', define: ['__ATARI__'],
cfgfile: 'atari-cart.cfg', cfgfile: 'atari-cart.cfg',
libargs: ['atari.lib'], libargs: ['atari.lib'],
}, },
'atari8-5200': { 'atari8-5200': {
define: '__ATARI5200__', define: ['__ATARI5200__'],
cfgfile: 'atari5200.cfg', cfgfile: 'atari5200.cfg',
libargs: ['atari5200.lib', libargs: ['atari5200.lib',
'-D', '__CARTFLAGS__=255'], '-D', '__CARTFLAGS__=255'],
@ -234,13 +234,13 @@ var PLATFORM_PARAMS = {
stack_end: 0x4fce, stack_end: 0x4fce,
}, },
'atari7800': { 'atari7800': {
define: '__ATARI7800__', define: ['__ATARI7800__'],
cfgfile: 'atari7800.cfg', cfgfile: 'atari7800.cfg',
libargs: ['crt0.o', 'sim6502.lib'], libargs: ['crt0.o', 'sim6502.lib'],
extra_link_files: ['crt0.o', 'atari7800.cfg'], extra_link_files: ['crt0.o', 'atari7800.cfg'],
}, },
'c64': { 'c64': {
define: '__C64__', define: ['__CBM__', '__C64__'],
cfgfile: 'c64.cfg', // SYS 2061 cfgfile: 'c64.cfg', // SYS 2061
libargs: ['c64.lib'], libargs: ['c64.lib'],
//extra_link_files: ['c64-cart.cfg'], //extra_link_files: ['c64-cart.cfg'],
@ -1102,13 +1102,16 @@ function compileCC65(step:BuildStep) {
setupFS(FS, '65-'+getRootBasePlatform(step.platform)); setupFS(FS, '65-'+getRootBasePlatform(step.platform));
populateFiles(step, FS); populateFiles(step, FS);
fixParamsWithDefines(step.path, params); fixParamsWithDefines(step.path, params);
execMain(step, CC65, ['-T', '-g', var args = ['-T', '-g',
'-Oirs', // don't inline CodeSizeFactor 200? (no -Oi) '-Oirs', // don't inline CodeSizeFactor 200? (no -Oi)
'-Cl', // static locals '-Cl', // static locals
'-I', '/share/include', '-I', '/share/include',
'-I', '.', '-I', '.',
'-D' + params.define, ];
step.path]); if (params.define) params.define.forEach((x) => args.push('-D'+x));
args.push(step.path);
console.log(args);
execMain(step, CC65, args);
if (errors.length) if (errors.length)
return {errors:errors}; return {errors:errors};
var asmout = FS.readFile(destpath, {encoding:'utf8'}); var asmout = FS.readFile(destpath, {encoding:'utf8'});
@ -2070,7 +2073,6 @@ function compileCMOC(step:BuildStep) {
var args = ['-S', '-Werror', '-V', var args = ['-S', '-Werror', '-V',
'-I/share/include', '-I/share/include',
'-I.', '-I.',
//'-D' + params.define,
step.path]; step.path];
var CMOC = emglobal.cmoc({ var CMOC = emglobal.cmoc({
instantiateWasm: moduleInstFn('cmoc'), instantiateWasm: moduleInstFn('cmoc'),