2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-03-20 11:43:51 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
#define COLD_RESET 0
|
|
|
|
#define NMI 1
|
2020-03-20 11:43:51 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void PreNmiBuff_Init(PreNmiBuff* this) {
|
2020-03-20 11:43:51 +00:00
|
|
|
this->resetting = false;
|
2021-02-14 00:49:40 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (osResetType == COLD_RESET) {
|
2020-03-20 11:43:51 +00:00
|
|
|
this->resetCount = 0;
|
|
|
|
this->duration = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-20 11:43:51 +00:00
|
|
|
this->resetCount++;
|
|
|
|
this->duration += this->resetTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
this->resetTime = 0;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void PreNmiBuff_SetReset(PreNmiBuff* this) {
|
2020-03-20 11:43:51 +00:00
|
|
|
this->resetting = true;
|
|
|
|
this->resetTime = osGetTime();
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
u32 PreNmiBuff_IsResetting(PreNmiBuff* this) {
|
2020-03-20 11:43:51 +00:00
|
|
|
return this->resetting;
|
|
|
|
}
|