use new neslib2.lib w/ seperate object files

This commit is contained in:
Steven Hugg 2019-05-14 12:01:54 -04:00
parent 5f61521c6f
commit 89331dbcf2
6 changed files with 10 additions and 12 deletions

View File

@ -419,5 +419,6 @@ class NESMAMEPlatform extends BaseMAMEPlatform implements Platform {
///
PLATFORMS['nes'] = JSNESPlatform;
PLATFORMS['nes-asm'] = JSNESPlatform;
PLATFORMS['nes.mame'] = NESMAMEPlatform;

View File

@ -12,7 +12,7 @@ import { PLATFORMS, EmuHalt, Toolbar } from "./emu";
import * as Views from "./views";
import { createNewPersistentStore } from "./store";
import { getFilenameForPath, getFilenamePrefix, highlightDifferences, invertMap, byteArrayToString, compressLZG,
byteArrayToUTF8, isProbablyBinary, getWithBinary, getBasePlatform } from "./util";
byteArrayToUTF8, isProbablyBinary, getWithBinary, getBasePlatform, hex } from "./util";
import { StateRecorderImpl } from "./recorder";
import { GHSession, GithubService, getRepos, parseGithubURL } from "./services";
@ -1084,14 +1084,14 @@ function _breakExpression() {
function getDebugExprExamples() : string {
var state = platform.saveState && platform.saveState();
var cpu = platform.getCPUState && platform.getCPUState();
var cpu = state.c;
console.log(cpu, state);
var s = '';
if (cpu.PC) s += "c.PC == 0x" + hex(cpu.PC) + "\n";
if (cpu.SP) s += "c.SP < 0x" + hex(cpu.SP) + "\n";
if (platform.readAddress) s += "this.readAddress(0x1234) == 0x0\n";
if (platform.readVRAMAddress) s += "this.readVRAMAddress(0x1234) != 0x80\n";
if (platform.getRasterPosition) s += "this.getRasterPosition().y > 222\n";
if (platform['getRasterPosition']) s += "this.getRasterPosition().y > 222\n";
return s;
}

View File

@ -637,6 +637,8 @@ export class MemoryView implements ProjectView {
var nextofs = parseInt(_nextofs); // convert from string (stupid JS)
var nextsym = addr2sym[nextofs];
if (sym) {
if (sym.endsWith('_SIZE__') || sym.endsWith('_LAST__') || sym.endsWith('STACKSIZE__') || sym.endsWith('FILEOFFS__'))
sym = '';
if (MemoryView.IGNORE_SYMS[sym]) {
ofs = nextofs;
} else {

Binary file not shown.

View File

@ -182,13 +182,13 @@ var PLATFORM_PARAMS = {
'nes': { //TODO
define: '__NES__',
cfgfile: 'neslib.cfg',
libargs: ['crt0.o', 'nes.lib',
libargs: ['crt0.o', 'nes.lib', 'neslib2.lib',
'-D', 'NES_MAPPER=0', // NROM
'-D', 'NES_PRG_BANKS=2', // 2 16K PRG banks
'-D', 'NES_CHR_BANKS=1', // 1 CHR bank
'-D', 'NES_MIRRORING=0', // horizontal mirroring
],
extra_link_files: ['crt0.o', 'nesbanked.cfg'],
extra_link_files: ['crt0.o', 'neslib2.lib', 'nesbanked.cfg'],
extra_segments:[
//{name:'Work RAM',start:0x0,size:0x800,type:'ram'},
{name:'OAM Buffer',start:0x200,size:0x100,type:'ram'},
@ -197,16 +197,11 @@ var PLATFORM_PARAMS = {
{name:'Cartridge RAM',start:0x6000,size:0x2000,type:'ram'},
],
},
'nes-conio': {
'nes-asm': {
cfgfile: 'nes.cfg',
define: '__NES__',
libargs: ['nes.lib'],
},
'nes-lib': {
define: '__NES__',
cfgfile: 'neslib.cfg',
libargs: ['neslib.lib', 'nes.lib'],
},
'apple2': {
define: '__APPLE2__',
cfgfile: 'apple2-hgr.cfg',

View File

@ -110,7 +110,7 @@ describe('Worker', function() {
compile('cc65', '#include "NOSUCH.file"\n', 'nes', done, 0, 0, 1, {ignoreErrorPath:true});
});
it('should assemble CA65', function(done) {
compile('ca65', '\t.segment "HEADER"\n\t.segment "STARTUP"\n\t.segment "CHARS"\n\t.segment "VECTORS"\n\tlda #0\n\tsta $1\n', 'nes-conio', done, 40976, 2);
compile('ca65', '\t.segment "HEADER"\n\t.segment "STARTUP"\n\t.segment "CHARS"\n\t.segment "VECTORS"\n\tlda #0\n\tsta $1\n', 'nes-asm', done, 40976, 2);
});
/*
it('should assemble Z80ASM', function(done) {