added getRasterScanline() for profiler

This commit is contained in:
Steven Hugg 2019-05-19 18:18:41 -04:00
parent 0a89695722
commit b40a156ae6
3 changed files with 14 additions and 0 deletions

View File

@ -201,6 +201,8 @@ const _GalaxianPlatform = function(mainElement, options) {
];
class GalaxianPlatform extends BaseZ80Platform implements Platform {
scanline : number;
getPresets() {
return GALAXIAN_PRESETS;
@ -305,6 +307,7 @@ const _GalaxianPlatform = function(mainElement, options) {
advance(novideo : boolean) {
for (var sl=0; sl<scanlinesPerFrame; sl++) {
this.scanline = sl;
if (!novideo) {
drawScanline(pixels, sl);
}
@ -322,6 +325,8 @@ const _GalaxianPlatform = function(mainElement, options) {
// NMI interrupt @ 0x66
if (interruptEnabled) { cpu.nonMaskableInterrupt(); }
}
getRasterScanline() { return this.scanline; }
loadROM(title, data) {
rom = padBytes(data, romSize);

View File

@ -98,6 +98,8 @@ const _VicDualPlatform = function(mainElement) {
]);
class VicDualPlatform extends BaseZ80Platform implements Platform {
scanline : number = 0;
getPresets() {
return VICDUAL_PRESETS;
@ -153,6 +155,7 @@ const _VicDualPlatform = function(mainElement) {
advance(novideo : boolean) {
var targetTstates = cpu.getTstates();
for (var sl=0; sl<scanlinesPerFrame; sl++) {
this.scanline = sl;
inputs[2] &= ~0x8;
inputs[2] |= ((cpu.getTstates() / cyclesPerTimerTick) & 1) << 3;
if (!novideo) {
@ -165,6 +168,10 @@ const _VicDualPlatform = function(mainElement) {
}
video.updateFrame();
}
getRasterScanline() {
return this.scanline;
}
loadROM(title, data) {
if (data.length >= 0x4020 && (data[0x4000] || data[0x401f])) {

View File

@ -308,6 +308,8 @@ var WilliamsPlatform = function(mainElement, proto) {
pixels = video.getFrameData();
timer = new AnimationTimer(60, this.nextFrame.bind(this));
}
this.getRasterScanline = function() { return video_counter; }
this.advance = function(novideo:boolean) {
var cpuCyclesPerSection = Math.round(cpuCyclesPerFrame / 65);