Support notifying latches

This commit is contained in:
Ilari Liusvaara 2013-10-27 10:52:45 +02:00
parent 7b09063fbc
commit 62f8a07104
4 changed files with 8 additions and 0 deletions

View file

@ -33,6 +33,7 @@ void CPU::mmio_w2183(uint8 data) {
//strobing $4016.d0 affects both controller port latches.
//$4017 bit 0 writes are ignored.
void CPU::mmio_w4016(uint8 data) {
if(data&1) interface->notifyLatched();
input.port1->latch(data & 1);
input.port2->latch(data & 1);
}

View file

@ -7,6 +7,7 @@ void CPU::step_auto_joypad_poll() {
if(status.auto_joypad_active && status.auto_joypad_poll) {
if(status.auto_joypad_counter == 0) {
interface->notifyLatched();
input.port1->latch(1);
input.port2->latch(1);
input.port1->latch(0);

View file

@ -28,4 +28,9 @@ time_t Interface::randomSeed()
return time(0);
}
void Interface::notifyLatched()
{
//Nothing.
}
}

View file

@ -7,6 +7,7 @@ struct Interface {
virtual void message(const string &text);
virtual time_t currentTime();
virtual time_t randomSeed();
virtual void notifyLatched();
};
extern Interface *interface;