recreate audio when resuming (https://goo.gl/7K7WLu)

This commit is contained in:
Steven Hugg 2019-08-21 19:38:56 -04:00
parent af482b5fa6
commit 9de22d6389
3 changed files with 17 additions and 6 deletions

View File

@ -137,6 +137,8 @@ TODO:
- doesn't do clip right
- doesn't do b/w tint
- vcs
- sound doesn't start on Chrome (https://goo.gl/7K7WLu)
- make start after clicking in embed
- vcs sound continues when paused
- vcs: INPTx needs to be added to control state
- vcs: break on # of lines changed (maybe using getRasterPosition?)
@ -178,6 +180,8 @@ TODO:
- SMS
- can't step back twice?
- compiler bug in chase
- "shared" in URL doesn't work, leave in URL? (also importURL)
- vicdual: delay is faster
WEB WORKER FORMAT

View File

@ -5,13 +5,19 @@ declare var MasterChannel, AudioLooper, PsgDeviceChannel;
export class MasterAudio {
master = new MasterChannel();
looper = new AudioLooper(512);
looper;
start() {
this.looper.setChannel(this.master);
this.looper.activate();
if (!this.looper) {
this.looper = new AudioLooper(512);
this.looper.setChannel(this.master);
this.looper.activate();
}
}
stop() {
this.looper.setChannel(null);
if (this.looper) {
this.looper.setChannel(null);
this.looper = null;
}
}
}

View File

@ -69,6 +69,8 @@ class VCSPlatform extends BasePlatform {
var self = this;
$("#javatari-div").show();
Javatari.start();
// for Chrome autostart
Javatari.room.speaker.powerOff();
// intercept clockPulse function
Javatari.room.console.oldClockPulse = Javatari.room.console.clockPulse;
Javatari.room.console.clockPulse = function() {
@ -127,11 +129,10 @@ class VCSPlatform extends BasePlatform {
}
pause() {
Javatari.room.console.pause();
Javatari.room.speaker.mute();
}
resume() {
Javatari.room.console.go();
Javatari.room.speaker.play();
Javatari.room.speaker.powerOn();
}
advance() {
Javatari.room.console.clockPulse();