Skip to content

Commit e1705d1

Browse files
authored
system: check reset button state correctly on gamecube (#124)
also unmask the irq after callback so pressing it again re-triggers the irq
1 parent a12a5bc commit e1705d1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

libogc/system.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ static void __RSWHandler(u32 irq, void* ctx)
446446
do {
447447
now = gettime();
448448
if(diff_usec(hold_down,now)>=100) break;
449-
} while(!(_piReg[0]&0x10000));
449+
} while(!SYS_ResetButtonDown());
450450

451-
if(_piReg[0]&0x10000) {
451+
if(SYS_ResetButtonDown()){
452452
__MaskIrq(IRQMASK(IRQ_PI_RSW));
453-
454453
if(__RSWCallback) {
455454
__RSWCallback(irq, ctx);
456455
}
456+
__UnmaskIrq(IRQMASK(IRQ_PI_RSW));
457457
}
458458
_piReg[0] = 2;
459459
}

0 commit comments

Comments
 (0)