Support notifying latches
This commit is contained in:
parent
7b09063fbc
commit
62f8a07104
4 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,7 @@ void CPU::mmio_w2183(uint8 data) {
|
||||||
//strobing $4016.d0 affects both controller port latches.
|
//strobing $4016.d0 affects both controller port latches.
|
||||||
//$4017 bit 0 writes are ignored.
|
//$4017 bit 0 writes are ignored.
|
||||||
void CPU::mmio_w4016(uint8 data) {
|
void CPU::mmio_w4016(uint8 data) {
|
||||||
|
if(data&1) interface->notifyLatched();
|
||||||
input.port1->latch(data & 1);
|
input.port1->latch(data & 1);
|
||||||
input.port2->latch(data & 1);
|
input.port2->latch(data & 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ void CPU::step_auto_joypad_poll() {
|
||||||
|
|
||||||
if(status.auto_joypad_active && status.auto_joypad_poll) {
|
if(status.auto_joypad_active && status.auto_joypad_poll) {
|
||||||
if(status.auto_joypad_counter == 0) {
|
if(status.auto_joypad_counter == 0) {
|
||||||
|
interface->notifyLatched();
|
||||||
input.port1->latch(1);
|
input.port1->latch(1);
|
||||||
input.port2->latch(1);
|
input.port2->latch(1);
|
||||||
input.port1->latch(0);
|
input.port1->latch(0);
|
||||||
|
|
|
@ -28,4 +28,9 @@ time_t Interface::randomSeed()
|
||||||
return time(0);
|
return time(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Interface::notifyLatched()
|
||||||
|
{
|
||||||
|
//Nothing.
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ struct Interface {
|
||||||
virtual void message(const string &text);
|
virtual void message(const string &text);
|
||||||
virtual time_t currentTime();
|
virtual time_t currentTime();
|
||||||
virtual time_t randomSeed();
|
virtual time_t randomSeed();
|
||||||
|
virtual void notifyLatched();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Interface *interface;
|
extern Interface *interface;
|
||||||
|
|
Loading…
Add table
Reference in a new issue