Skip to content

Commit

Permalink
cdrom: use constructor struct initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Nov 12, 2021
1 parent af017b0 commit 15949dd
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/device/cdrom/cdrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ class CDROM {

// Hack
struct irq_response_t {
uint8_t irq;
uint8_t irq = 0;
fifo<uint8_t, 16> response;
bool ack;
int delay;
bool ack = false;
int delay = 0;

irq_response_t() = default;
irq_response_t(uint8_t irq, int delay) : irq(irq), delay(delay) {}

template <class Archive>
void serialize(Archive& ar) {
Expand Down Expand Up @@ -172,13 +175,7 @@ class CDROM {

int busyFor = 0;

void postInterrupt(int irq, int delay = 50000) {
interruptQueue.add(irq_response_t{
.irq = (uint8_t)irq, //
.response = {}, //
.delay = delay //
});
}
void postInterrupt(int irq, int delay = 50000) { interruptQueue.add(irq_response_t(irq, delay)); }

std::string dumpFifo(const FIFO& f);
std::pair<int16_t, int16_t> mixSample(std::pair<int16_t, int16_t> sample);
Expand Down

0 comments on commit 15949dd

Please sign in to comment.