Apu callback, CPU instruction lengths
This commit is contained in:
@@ -43,11 +43,14 @@ void APU::Update() {
|
||||
|
||||
for (auto i = 0; i < cycles_to_run; ++i) {
|
||||
// Update the APU
|
||||
// ...
|
||||
UpdateChannelSettings();
|
||||
|
||||
// Update the SPC700
|
||||
// ...
|
||||
uint8_t opcode = spc700_.read(spc700_.PC);
|
||||
spc700_.ExecuteInstructions(opcode);
|
||||
}
|
||||
|
||||
ProcessSamples();
|
||||
}
|
||||
|
||||
void APU::ProcessSamples() {
|
||||
|
||||
@@ -157,6 +157,10 @@ class APU : public Observer {
|
||||
}
|
||||
}
|
||||
|
||||
void SetReadyCallback(std::function<void()> callback) {
|
||||
ready_callback_ = callback;
|
||||
}
|
||||
|
||||
private:
|
||||
// Constants for communication
|
||||
static const uint8_t READY_SIGNAL_0 = 0xAA;
|
||||
@@ -187,6 +191,8 @@ class APU : public Observer {
|
||||
DigitalSignalProcessor dsp_;
|
||||
SPC700 spc700_{aram_};
|
||||
std::vector<int16_t> audioSamples_;
|
||||
|
||||
std::function<void()> ready_callback_;
|
||||
};
|
||||
|
||||
} // namespace emu
|
||||
|
||||
Reference in New Issue
Block a user