summaryrefslogtreecommitdiff
path: root/src/code/z_prenmi_buff.c
blob: 3c45d7e540a21ef1026e0801b4495c6872b208b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "prenmi_buff.h"

#define COLD_RESET 0
#define NMI 1

void PreNmiBuff_Init(PreNmiBuff* this) {
    this->resetting = false;

    if (osResetType == COLD_RESET) {
        this->resetCount = 0;
        this->duration = 0;
    } else {
        this->resetCount++;
        this->duration += this->resetTime;
    }

    this->resetTime = 0;
}

void PreNmiBuff_SetReset(PreNmiBuff* this) {
    this->resetting = true;
    this->resetTime = osGetTime();
}

u32 PreNmiBuff_IsResetting(PreNmiBuff* this) {
    return this->resetting;
}