libgambatte: timar quirk accuracy
This commit is contained in:
parent
ca31e9ad72
commit
d8c238c9fb
|
@ -337,8 +337,8 @@ unsigned long Memory::stop(unsigned long cc) {
|
|||
cc += 4;
|
||||
|
||||
if (ioamhram_[0x14D] & isCgb()) {
|
||||
psg_.generateSamples(cc, isDoubleSpeed());
|
||||
lcd_.speedChange(cc);
|
||||
psg_.generateSamples(cc + 4, isDoubleSpeed());
|
||||
lcd_.speedChange((cc + 7) & ~7);
|
||||
ioamhram_[0x14D] ^= 0x81;
|
||||
intreq_.setEventTime<intevent_blit>(ioamhram_[0x140] & lcdc_en
|
||||
? lcd_.nextMode1IrqTime()
|
||||
|
@ -686,7 +686,7 @@ void Memory::nontrivial_ff_write(unsigned const p, unsigned data, unsigned long
|
|||
break;
|
||||
case 0x07:
|
||||
data |= 0xF8;
|
||||
tima_.setTac(data, cc, TimaInterruptRequester(intreq_), gbIsCgb_);
|
||||
tima_.setTac(data, cc, TimaInterruptRequester(intreq_), agbMode_);
|
||||
break;
|
||||
case 0x0F:
|
||||
updateIrqs(cc);
|
||||
|
|
|
@ -117,7 +117,7 @@ void Tima::setTma(unsigned const data, unsigned long const cc, TimaInterruptRequ
|
|||
tma_ = data;
|
||||
}
|
||||
|
||||
void Tima::setTac(unsigned const data, unsigned long const cc, TimaInterruptRequester timaIrq, bool gbIsCgb) {
|
||||
void Tima::setTac(unsigned const data, unsigned long const cc, TimaInterruptRequester timaIrq, bool agbFlag) {
|
||||
if (tac_ ^ data) {
|
||||
unsigned long nextIrqEventTime = timaIrq.nextIrqEventTime();
|
||||
|
||||
|
@ -141,7 +141,7 @@ void Tima::setTac(unsigned const data, unsigned long const cc, TimaInterruptRequ
|
|||
if (data & 4) {
|
||||
unsigned long diff = cc - basetime_;
|
||||
|
||||
if (gbIsCgb) {
|
||||
if (agbFlag) {
|
||||
if (((diff >> (timaClock[tac_ & 3] - 1)) & 1) == 1 && ((diff >> (timaClock[data & 3] - 1)) & 1) == 0)
|
||||
tima_++;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
void resetCc(unsigned long oldCc, unsigned long newCc, TimaInterruptRequester timaIrq);
|
||||
void setTima(unsigned tima, unsigned long cc, TimaInterruptRequester timaIrq);
|
||||
void setTma(unsigned tma, unsigned long cc, TimaInterruptRequester timaIrq);
|
||||
void setTac(unsigned tac, unsigned long cc, TimaInterruptRequester timaIrq, bool gbIsCgb);
|
||||
void setTac(unsigned tac, unsigned long cc, TimaInterruptRequester timaIrq, bool agbFlag);
|
||||
void resTac(unsigned long cc, TimaInterruptRequester timaIrq);
|
||||
unsigned tima(unsigned long cc);
|
||||
void doIrqEvent(TimaInterruptRequester timaIrq);
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue