summaryrefslogtreecommitdiff
path: root/lib/ultralib/src/io/vifade.c
blob: 22be390d3dc320b8cadd864afdbf946b7f4e90fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "PR/os_internal.h"
#include "PRinternal/viint.h"

// TODO: this comes from a header
#ident "$Revision: 1.17 $"

void osViFade(u8 active, u16 factor) {
    register u32 saveMask = __osDisableInt();

    if (active) {
        __osViNext->y.offset = factor & VI_2_10_FPART_MASK;
        __osViNext->state |= VI_STATE_FADE;
    } else {
        __osViNext->state &= ~VI_STATE_FADE;
    }

    __osRestoreInt(saveMask);
}