summaryrefslogtreecommitdiff
path: root/lib/ultralib/src/io/visetyscale.c
blob: 12024789f418c8d255af0582514a78ede89d9508 (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
28
29
30
31
32
33
34
#include "PR/os_internal.h"
#include "PR/ultraerror.h"
#include "PR/ultralog.h"
#include "PRinternal/viint.h"

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

void osViSetYScale(f32 value) {
    register u32 saveMask;

#ifdef _DEBUG
    if (!__osViDevMgr.active) {
        __osError(ERR_OSVISETYSCALE_VIMGR, 0);
        return;
    }

    if ((value < 0.05f) || (value > 1.0f)) {
        __osError(ERR_OSVISETYSCALE_VALUE, 1, OS_LOG_FLOAT(value));

        if (value < 0.05f) {
            value = 0.05f;
        } else {
            value = 1.0f;
        }
    }
#endif

    saveMask = __osDisableInt();

    __osViNext->y.factor = value;
    __osViNext->state |= VI_STATE_YSCALE_UPDATED;
    __osRestoreInt(saveMask);
}