1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-12-11 20:49:36 +00:00

minor updates

This commit is contained in:
steve 2023-09-28 22:14:11 +01:00
parent 3e90841500
commit b3e9fb9c2f
3 changed files with 22 additions and 0 deletions

View File

@ -25,4 +25,10 @@ extern class spiram sram;
extern class Memory memory;
#endif
#if defined(DEBUGGING)
#define DBG(x) Serial.x
#else
#define DBG(x)
#endif
#endif

14
pia.cpp
View File

@ -177,3 +177,17 @@ uint8_t PIA::read_portb() {
irq_b1 = irq_b2 = false;
return (inb & ~ddrb) | (outb & ddrb);
}
void PIA::write_porta_in_bit(uint8_t mask, bool state) {
if (state)
ina |= mask;
else
ina &= ~mask;
}
void PIA::write_portb_in_bit(uint8_t mask, bool state) {
if (state)
inb |= mask;
else
inb &= ~mask;
}

2
pia.h
View File

@ -23,9 +23,11 @@ public:
// device input (external) interface
void write_porta_in(uint8_t b) { ina = b; }
void write_porta_in_bit(uint8_t, bool);
void write_ca1(bool);
void write_ca2(bool);
void write_portb_in(uint8_t b) { inb = b; }
void write_portb_in_bit(uint8_t, bool);
void write_cb1(bool);
void write_cb2(bool);