viewer.h
3.32 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#ifndef __viewer__
#define __viewer__
#ifdef _PARTNER
#define CFB_SEGMENT_ADDR 0x80200000
#else
#define TEX_SEGMENT_ADDR 0x80001000
#define GAMETEX_SEGMENT_ADDR 0x802DF1D0
#define GAMETICKET_SEGMENT_ADDR 0x80393E80
#define CODE_SEGMENT_ADDR 0x804171D0
#define CFB_SEGMENT_ADDR 0x80690000
#define RESERVED_SEGMENT_ADDR 0x807BC000
#endif
#define STACKSIZEBYTES 0xc000
#ifdef _LANGUAGE_C
#include <ultra64.h>
#include <PR/os.h>
#include <PR/os_bbfs.h>
#include <PR/os_bbatb.h>
#include <PR/os_bbsa.h>
#include "gfx.h"
/*
* debug print support
*/
#undef PRINTF
#ifdef DEBUG
#define PRINTF osSyncPrintf
#else
#define PRINTF(format, args...)
#endif
#define MAX_MESGS 32
#define DMA_QUEUE_SIZE 200
#define NUM_FIELDS 1 /* 1 = 60 Hz video interrupts, 2 = 30 Hz, etc */
#define UTIL_PRIORITY 1
#define INIT_PRIORITY 10
#define GAME_PRIORITY 10
#define AUDIO_PRIORITY 12
#define SCHEDULER_PRIORITY 13
#define PAGE_TOP 0
#define PAGE_GAME 1
#define PAGE_MANAGE 2
#define PAGE_CONTROL 3
#define PAGE_CPAK 4
#define PAGE_GPAK 5
#define PAGE_BIND 6
#define VW_MOVE_STILL 0
#define VW_MOVE_UP 1
#define VW_MOVE_DOWN 2
#define VW_MOVE_LEFT 4
#define VW_MOVE_RIGHT 8
#define MAX_LOGO_COUNT 90
#define MAX_WARN_COUNT 240
#define VW_DATE_YEAR 0
#define VW_DATE_MON 1
#define VW_DATE_DAY 2
#define VW_DATE_DOW 3
#define VW_DATE_HR 4
#define VW_DATE_MIN 5
#define VW_DATE_SEC 6
/*
* Block size for allocation
*/
#define BB_USER_BLOCK_SIZE (1<<18)
extern OSMesgQueue gGfxFrameMsgQ;
extern OSMesg gpGfxFrameMsgBuf[MAX_MESGS];
extern OSMesgQueue gControllerMsgQ;
extern OSMesg gControllerMsgBuf;
extern OSPiHandle *handler;
extern u32 gCid;
extern u16 gTid;
extern u16 gTidx;
extern u16 gRow;
extern u8 gValidControllers;
extern u8 gControllers[MAXCONTROLLERS];
extern u8 gControllerCnt;
extern u32 gPageNo;
extern int gCardInit;
extern int gPageTopInit;
extern int gFrameInit;
extern u8 gCpakCnt;
extern u32 gBBID;
extern u32 gCardID;
extern int gStatus;
extern int gTicketStatus;
extern int gPGameUnits;
extern int gLPGameUnits;
extern s8 gCursorX, gCursorY;
extern int gCursorCnt;
extern int gStickCnt;
extern u32 gMove;
extern u8 gHotSpot;
extern u32 gButton;
extern int gClubTicketIdx;
extern char gWarningFile[9];
extern int gWarn;
extern u8 gpDate[7];
#ifdef SHOW_BBID
extern int gFlashErr;
extern u32 gFlashErrAddr;
#endif
void initGFX(void);
void initCntrl(void);
void createGfxTask(GFXInfo *i);
void updateController(void);
s32 sberrCorrect(char stateName[] /* 8.3 <cid>.sta */);
extern void resetViewer(void);
#endif /* _LANGUAGE_C */
#endif /* __viewer__ */