1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-21 05:29:13 +00:00

Loop the Master System into the experiment.

This commit is contained in:
Thomas Harte 2022-07-07 16:46:08 -04:00
parent fc0dc4e5e2
commit 96189bde4b
2 changed files with 10 additions and 4 deletions

View File

@ -210,6 +210,12 @@ class ConcreteMachine:
z80_.run_for(cycles);
}
void flush_output() final {
vdp_.flush();
update_audio();
audio_queue_.perform();
}
forceinline HalfCycles perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
if(vdp_ += cycle.length) {
z80_.set_interrupt_line(vdp_->get_interrupt_line(), vdp_.last_sequence_point_overrun());
@ -383,9 +389,6 @@ class ConcreteMachine:
}
void flush() {
vdp_.flush();
update_audio();
audio_queue_.perform();
}
const std::vector<std::unique_ptr<Inputs::Joystick>> &get_joysticks() final {

View File

@ -678,11 +678,14 @@ struct ActivityObserver: public Activity::Observer {
- (void)audioQueueIsRunningDry:(nonnull CSAudioQueue *)audioQueue {
// TODO: Make audio flushes overt, and do one here.
updater.update([] {});
updater.update([self] {
updater.performer.machine->flush_output();
});
}
- (void)scanTargetViewDisplayLinkDidFire:(CSScanTargetView *)view now:(const CVTimeStamp *)now outputTime:(const CVTimeStamp *)outputTime {
updater.update([self] {
updater.performer.machine->flush_output();
dispatch_async(dispatch_get_main_queue(), ^{
[self.view updateBacking];
[self.view draw];