-
Notifications
You must be signed in to change notification settings - Fork 44
/
REQUEST.C
214 lines (196 loc) · 4.74 KB
/
REQUEST.C
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#include "REQUEST.H"
#include "EFFECTS.H"
#include "FXTRIG.H"
#include "GAMEFLOW.H"
#include "MISC.H"
#include "SAVEGAME.H"
#include "SPECIFIC.H"
#include "PSXINPUT.H"
#include "TEXT_S.H"
#include "SOUND.H"
#include "CONTROL.H"
long Requester(struct REQUESTER* r)//63718(<), 63DF4 (F)
{
int x;
int y;
short top;
unsigned short w;
unsigned short h;
int i;
int optiony;
unsigned short rx;
unsigned short ry;
unsigned short rw;
unsigned short rh;
short OptionTop[5];
short OptionBottom[5];
int val;
GetStringDimensions(&gfStringWad[gfStringOffset[r->TitleTxt]], &w, &h);
optiony = h + 4;
if (r->nOptions != 0)
{
h += 2;
if (r->nOptions != 0)
{
//loc_637B0
for (i = 0; i < r->nOptions; i++)
{
GetStringLength(&gfStringWad[gfStringOffset[r->OptionTxt[i]]], (unsigned short*)&OptionTop[i], (unsigned short*)&OptionBottom[i]);
GetStringDimensions(&gfStringWad[gfStringOffset[r->OptionTxt[i]]], &rw, &rh);
if (i == 0 && r->Ignore != 0)
{
OptionBottom[0] = OptionTop[0] + rh;
}
//loc_63858
if (w < rw)
{
w = rw;
}
h += rh;
}
}//loc_6389C
}
//loc_6389C
y = 120 - (h >> 1);
rw = w + 32;
x = 256 - (w >> 1);
rh = h + 16;
rx = (x - 16) & 0xFFFF;
ry = (y - 8) & 0xFFFF;
GetStringLength(&gfStringWad[gfStringOffset[r->TitleTxt]], (unsigned short*)&top, NULL);
PrintString(256, ((y - top) + 2) & 0xFFFF, r->TitleCol, &gfStringWad[gfStringOffset[r->TitleTxt]], FF_CENTER);
if (r->nOptions != 0)
{
DrawLineH(x & 0xFFFF, ((y + optiony) - 4) & 0xFFFF, w, 1, 0, 0xC0C0C0);
DrawTPage(0, 1);
y += optiony - OptionTop[0];
if (r->nOptions != 0)
{
//loc_639D8
for (i = 0; i < r->nOptions; i++)
{
if (i == 0 && r->Ignore != 0)
{
DisplayConfig(x, y);
}
else
{
//loc_63A08
if ((r->JustifyL >> h) & 1)
{
if (i != r->CursorPos)
{
PrintString(x & 0xFFFF, y & 0xFFFF, r->OptionCol, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_NONE);
}//loc_63A34
else
{
PrintString(x & 0xFFFF, y & 0xFFFF, 1, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_NONE);
}
}
else
{
//loc_63A78
if ((r->JustifyR >> i) & 1)
{
if (i != 0)
{
val = savegame.VolumeCD;
}
else
{
val = savegame.VolumeFX;
}
//loc_63AA8
if (i == r->CursorPos)
{
PrintString(((rw + x) - 32) & 0xFFFF, y & 0xFFFF, 1, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_R_JUSTIFY);
}
else
{
//loc_63AD0
PrintString(((rw + x) - 32) & 0xFFFF, y & 0xFFFF, r->OptionCol, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_R_JUSTIFY);
}
PrintGauge(((rw + x) - 140) & 0xFFFF, (y - 7) & 0xFFFF, val);
}
else
{
//loc_63B30
if (i == r->CursorPos)
{
PrintString(0x100, y & 0xFFFF, 1, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_CENTER);
}
else
{
PrintString(0x100, y & 0xFFFF, r->OptionCol, &gfStringWad[gfStringOffset[r->OptionTxt[i]]], FF_CENTER);
}
}
}
}
//loc_63B88
if (i == r->CursorPos)
{
if ((r->Arrows >> i) & 1)
{
PrintString((rx - 4) & 0xFFFF, y & 0xFFFF, 2, "\x00000019", FF_NONE);
PrintString(((rx + rw) - 8) & 0xFFFF, y & 0xFFFF, 1, "\x0000001B", FF_NONE);
}//loc_63C04
}//loc_63C04
if (i < (r->nOptions - 1))
{
y = (y + 2) + OptionBottom[i] - OptionTop[i + 1];
}//loc_63C48
}
}//loc_63C58
}//loc_63C58
DrawF4(rx, ry, rw, rh, 0, 0x2A800000);
DrawTPage(0, 1);
DrawLineH((rx + 2) & 0xFFFF, (ry + 1) & 0xFFFF, (rw - 4) & 0xFFFF, 0, 0x404040, 0);
DrawLineH((rx + 2) & 0xFFFF, ((ry + rh) - 2) & 0xFFFF, (rw - 4) & 0xFFFF, 0, 0x404040, 0);
DrawLineV((rx + 2) & 0xFFFF, (ry + 1) & 0xFFFF, (rh - 2) & 0xFFFF, 0, 0x404040, 0);
DrawLineV(((rx + rw) - 3) & 0xFFFF, (ry + 1) & 0xFFFF, (rh - 2) & 0xFFFF, 0, 0x404040, 0);
DrawTPage(0, 1);
if ((r->nOptions != 0))
{
if ((dbinput2 & IN_FORWARD) && r->CursorPos != 0 && !(r->Ignore >> (r->nOptions - 1) & 1))
{
SoundEffect(SFX_MENU_SELECT, NULL, 2);
r->OptionCol &= 0x18;
//loc_63E38
r->CursorPos--;
}
else if ((dbinput2 & IN_BACK) && r->CursorPos < (r->nOptions - 1)) //loc_63DDC
{
SoundEffect(SFX_MENU_SELECT, NULL, 2);
r->OptionCol &= 0x18;
//loc_63E38
r->CursorPos++;
}
//loc_63E4C
if ((RawEdge & IN_CROSS))
{
if (r->CursorPos < 2)
{
if (r == &SettingsReq)
{
return 0x7000000;
}
}
if (r->CursorPos == 0x1000000)//loc_63E90
{
if (r == &ConfigReq)
{
return 0;
}
}
else
{
//loc_63EB0
SoundEffect(SFX_MENU_CHOOSE, NULL, 2);
return r->CursorPos | 0x8000;
}
}
//loc_63ED4
}
//loc_63ED4
return 0;
}