coastline 0.0.4
Loading...
Searching...
No Matches
viint.h
Go to the documentation of this file.
1#ifndef LIBULTRA_IO_VIINT_H
2#define LIBULTRA_IO_VIINT_H
3
8
9#include <ultra64.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/* What a context changes when the manager swaps it in. */
16#define VI_STATE_MODE_UPDATED 0x01
17#define VI_STATE_XSCALE_UPDATED 0x02
18#define VI_STATE_YSCALE_UPDATED 0x04
19#define VI_STATE_CTRL_UPDATED 0x08
20#define VI_STATE_BUFFER_UPDATED 0x10
21#define VI_STATE_BLACK 0x20
22#define VI_STATE_REPEATLINE 0x40
23#define VI_STATE_FADE 0x80
24
25/* Bits of the control register. */
26#define VI_CTRL_GAMMA_DITHER_ON 0x00004
27#define VI_CTRL_GAMMA_ON 0x00008
28#define VI_CTRL_DIVOT_ON 0x00010
29#define VI_CTRL_ANTIALIAS_MASK 0x00300
30#define VI_CTRL_DITHER_FILTER_ON 0x10000
31
32/* The scale registers store a 2.10 fixed-point factor in their low 12 bits. */
33#define VI_SCALE_MASK 0xFFF
34#define VI_2_10_FPART_MASK 0x3FF
35#define VI_SUBPIXEL_SH 0x10
36
37typedef struct {
38 f32 factor;
39 u16 offset;
40 u32 scale;
41} __OSViScale;
42
43typedef struct {
44 u16 state;
45 u16 retraceCount;
46 void *framep;
47 OSViMode *modep;
48 u32 control;
49 OSMesgQueue *msgq;
50 OSMesg msg;
51 __OSViScale x;
52 __OSViScale y;
53} __OSViContext;
54
62extern __OSViContext __osViContexts[2];
63
70extern __OSViContext *__osViCurr;
71
78extern __OSViContext *__osViNext;
79
86extern OSDevMgr __osViDevMgr;
87
94extern OSThread viThread;
95
102extern u64 viThreadStack[0x1000 / sizeof(u64)];
103
110extern OSMesgQueue viEventQueue;
111
118extern OSMesg viEventBuf[5];
119
126extern OSIoMesg viRetraceMsg;
127
134extern OSIoMesg viCounterMsg;
135
144extern u16 viMgrRetrace;
146
153void __osViInit(void);
154
161void __osViSwapContext(void);
162
169__OSViContext *__osViGetCurrentContext(void);
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif /* LIBULTRA_IO_VIINT_H */
struct OSThread_s OSThread
A thread: its place in the queues, its state, and the registers saved when it last stopped.
struct OSMesgQueue_s OSMesgQueue
A message queue: a ring of messages and the threads blocked sending or receiving.
void * OSMesg
Definition os.h:73
A device manager: the thread and queues that serve the I/O requests of one interface.
Definition os.h:219
An I/O request to a device manager: a DMA between RDRAM and a device.
Definition os.h:210
A video mode: the registers of the video interface for a resolution and television standard.
Definition os.h:310
Umbrella header of the reconstructed libultra.
unsigned int u32
Definition ultratypes.h:20
float f32
Definition ultratypes.h:38
unsigned short u16
Definition ultratypes.h:19
unsigned long long u64
Definition ultratypes.h:21