pass intreq by ref
This commit is contained in:
parent
40167579bb
commit
8247df4be5
|
@ -85,9 +85,9 @@ public:
|
|||
template<bool isReader>void SyncState(NewState *ns);
|
||||
};
|
||||
|
||||
inline void flagHdmaReq(InterruptRequester *const intreq) { intreq->setEventTime<DMA>(0); }
|
||||
inline void flagGdmaReq(InterruptRequester *const intreq) { intreq->setEventTime<DMA>(1); }
|
||||
inline void ackDmaReq(InterruptRequester *const intreq) { intreq->setEventTime<DMA>(disabled_time); }
|
||||
inline void flagHdmaReq(InterruptRequester &intreq) { intreq.setEventTime<DMA>(0); }
|
||||
inline void flagGdmaReq(InterruptRequester &intreq) { intreq.setEventTime<DMA>(1); }
|
||||
inline void ackDmaReq(InterruptRequester &intreq) { intreq.setEventTime<DMA>(disabled_time); }
|
||||
inline bool hdmaReqFlagged(const InterruptRequester &intreq) { return intreq.eventTime(DMA) == 0; }
|
||||
inline bool gdmaReqFlagged(const InterruptRequester &intreq) { return intreq.eventTime(DMA) == 1; }
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ Memory::Memory(const Interrupter &interrupter_in, unsigned short &sp, unsigned s
|
|||
getInput(0),
|
||||
divLastUpdate(0),
|
||||
lastOamDmaUpdate(disabled_time),
|
||||
display(ioamhram, 0, VideoInterruptRequester(&intreq)),
|
||||
display(ioamhram, 0, VideoInterruptRequester(intreq)),
|
||||
interrupter(interrupter_in),
|
||||
dmaSource(0),
|
||||
dmaDestination(0),
|
||||
|
@ -203,7 +203,7 @@ unsigned long Memory::event(unsigned long cycleCounter) {
|
|||
unsigned dmaLength = ((ioamhram[0x155] & 0x7F) + 0x1) * 0x10;
|
||||
unsigned length = hdmaReqFlagged(intreq) ? 0x10 : dmaLength;
|
||||
|
||||
ackDmaReq(&intreq);
|
||||
ackDmaReq(intreq);
|
||||
|
||||
if ((static_cast<unsigned long>(dmaDest) + length) & 0x10000) {
|
||||
length = 0x10000 - dmaDest;
|
||||
|
@ -843,7 +843,7 @@ void Memory::nontrivial_ff_write(const unsigned P, unsigned data, const unsigned
|
|||
intreq.setEventTime<BLIT>(cycleCounter + (456 * 4 << isDoubleSpeed()));
|
||||
|
||||
if (hdmaEnabled)
|
||||
flagHdmaReq(&intreq);
|
||||
flagHdmaReq(intreq);
|
||||
}
|
||||
} else
|
||||
display.lcdcChange(data, cycleCounter);
|
||||
|
@ -944,9 +944,9 @@ void Memory::nontrivial_ff_write(const unsigned P, unsigned data, const unsigned
|
|||
if (ioamhram[0x140] & 0x80) {
|
||||
display.enableHdma(cycleCounter);
|
||||
} else
|
||||
flagHdmaReq(&intreq);
|
||||
flagHdmaReq(intreq);
|
||||
} else
|
||||
flagGdmaReq(&intreq);
|
||||
flagGdmaReq(intreq);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ static unsigned char const agbOverride[0xD] = { 0xFF, 0x00, 0xCD, 0x03, 0x35, 0x
|
|||
#include "gambatte.h"
|
||||
|
||||
namespace gambatte {
|
||||
class InputGetter;
|
||||
class FilterInfo;
|
||||
|
||||
class Memory {
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
namespace gambatte {
|
||||
|
||||
class VideoInterruptRequester {
|
||||
InterruptRequester * intreq;
|
||||
InterruptRequester &intreq;
|
||||
|
||||
public:
|
||||
explicit VideoInterruptRequester(InterruptRequester * intreq) : intreq(intreq) {}
|
||||
explicit VideoInterruptRequester(InterruptRequester &intreq) : intreq(intreq) {}
|
||||
void flagHdmaReq() const { gambatte::flagHdmaReq(intreq); }
|
||||
void flagIrq(const unsigned bit) const { intreq->flagIrq(bit); }
|
||||
void setNextEventTime(const unsigned long time) const { intreq->setEventTime<VIDEO>(time); }
|
||||
void flagIrq(const unsigned bit) const { intreq.flagIrq(bit); }
|
||||
void setNextEventTime(const unsigned long time) const { intreq.setEventTime<VIDEO>(time); }
|
||||
};
|
||||
|
||||
class LCD {
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue