102 |
|
srom[p++] = 0; |
103 |
|
} |
104 |
|
|
105 |
+ |
static uint32 VModeParms(uint32 width, uint32 height, uint32 bytes_per_row, video_depth depth) |
106 |
+ |
{ |
107 |
+ |
uint32 ret = p; |
108 |
+ |
Long(50); // Length |
109 |
+ |
Long(0); // Base offset |
110 |
+ |
Word(bytes_per_row); // Row bytes |
111 |
+ |
Word(0); // Bounds |
112 |
+ |
Word(0); |
113 |
+ |
Word(height); |
114 |
+ |
Word(width); |
115 |
+ |
Word(0); // Version |
116 |
+ |
Word(0); // Pack type |
117 |
+ |
Long(0); // Pack size |
118 |
+ |
Long(0x00480000); // HRes |
119 |
+ |
Long(0x00480000); // VRes |
120 |
+ |
switch (depth) { |
121 |
+ |
case VDEPTH_1BIT: |
122 |
+ |
Word(0); // Pixel type (indirect) |
123 |
+ |
Word(1); // Pixel size |
124 |
+ |
Word(1); // CmpCount |
125 |
+ |
Word(1); // CmpSize |
126 |
+ |
break; |
127 |
+ |
case VDEPTH_2BIT: |
128 |
+ |
Word(0); // Pixel type (indirect) |
129 |
+ |
Word(2); // Pixel size |
130 |
+ |
Word(1); // CmpCount |
131 |
+ |
Word(2); // CmpSize |
132 |
+ |
break; |
133 |
+ |
case VDEPTH_4BIT: |
134 |
+ |
Word(0); // Pixel type (indirect) |
135 |
+ |
Word(4); // Pixel size |
136 |
+ |
Word(1); // CmpCount |
137 |
+ |
Word(4); // CmpSize |
138 |
+ |
break; |
139 |
+ |
case VDEPTH_8BIT: |
140 |
+ |
Word(0); // Pixel type (indirect) |
141 |
+ |
Word(8); // Pixel size |
142 |
+ |
Word(1); // CmpCount |
143 |
+ |
Word(8); // CmpSize |
144 |
+ |
break; |
145 |
+ |
case VDEPTH_16BIT: |
146 |
+ |
Word(16); // Pixel type (direct) |
147 |
+ |
Word(16); // Pixel size |
148 |
+ |
Word(3); // CmpCount |
149 |
+ |
Word(5); // CmpSize |
150 |
+ |
break; |
151 |
+ |
case VDEPTH_32BIT: |
152 |
+ |
Word(16); // Pixel type (direct) |
153 |
+ |
Word(32); // Pixel size |
154 |
+ |
Word(3); // CmpCount |
155 |
+ |
Word(8); // CmpSize |
156 |
+ |
break; |
157 |
+ |
} |
158 |
+ |
Long(0); // Plane size |
159 |
+ |
Long(0); // Reserved |
160 |
+ |
return ret; |
161 |
+ |
} |
162 |
+ |
|
163 |
+ |
static uint32 VModeDesc(uint32 params, bool direct) |
164 |
+ |
{ |
165 |
+ |
uint32 ret = p; |
166 |
+ |
Offs(0x01, params); // Video parameters |
167 |
+ |
Rsrc(0x03, 1); // Page count |
168 |
+ |
Rsrc(0x04, direct ? 2 : 0); // Device type |
169 |
+ |
EndOfList(); |
170 |
+ |
return ret; |
171 |
+ |
} |
172 |
+ |
|
173 |
|
bool InstallSlotROM(void) |
174 |
|
{ |
175 |
|
uint32 boardType, boardName, vendorID, revLevel, partNum, date; |
176 |
|
uint32 vendorInfo, sRsrcBoard; |
177 |
|
|
178 |
|
uint32 videoType, videoName, minorBase, minorLength, videoDrvr, vidDrvrDir; |
179 |
< |
uint32 defaultGamma, gammaDir, vidModeParms, vidMode, sRsrcVideo; |
179 |
> |
uint32 defaultGamma, gammaDir, sRsrcVideo; |
180 |
> |
uint32 vidModeParms1, vidModeParms2, vidModeParms4, vidModeParms8, vidModeParms16, vidModeParms32; |
181 |
> |
uint32 vidMode1, vidMode2, vidMode4, vidMode8, vidMode16, vidMode32; |
182 |
|
|
183 |
|
uint32 cpuType, cpuName, cpuMajor, cpuMinor, sRsrcCPU; |
184 |
|
|
218 |
|
Offs(0x24, vendorInfo); // Vendor Info |
219 |
|
EndOfList(); |
220 |
|
|
221 |
< |
// Video sResource |
221 |
> |
// Video sResource for default mode |
222 |
|
videoType = p; // Literals |
223 |
|
Word(3); Word(1); Word(1); Word(0x4232); // Display Video Apple 'B2' |
224 |
|
videoName = p; |
226 |
|
minorBase = p; |
227 |
|
Long(VideoMonitor.mac_frame_base); // Frame buffer base |
228 |
|
minorLength = p; |
229 |
< |
Long(VideoMonitor.bytes_per_row * VideoMonitor.y); // Frame buffer size |
229 |
> |
Long(VideoMonitor.mode.bytes_per_row * VideoMonitor.mode.y); // Frame buffer size |
230 |
|
|
231 |
|
videoDrvr = p; // Video driver |
232 |
|
Long(0x72); // Length |
299 |
|
Offs(0x80, defaultGamma); |
300 |
|
EndOfList(); |
301 |
|
|
302 |
< |
vidModeParms = p; // Video mode parameters |
303 |
< |
Long(50); // Length |
304 |
< |
Long(0); // Base offset |
305 |
< |
Word(VideoMonitor.bytes_per_row); // Row bytes |
306 |
< |
Word(0); // Bounds |
307 |
< |
Word(0); |
308 |
< |
Word(VideoMonitor.y); |
309 |
< |
Word(VideoMonitor.x); |
310 |
< |
Word(0); // Version |
311 |
< |
Word(0); // Pack type |
312 |
< |
Long(0); // Pack size |
313 |
< |
Long(0x00480000); // HRes |
314 |
< |
Long(0x00480000); // VRes |
245 |
< |
switch (VideoMonitor.mode) { |
246 |
< |
case VMODE_1BIT: |
247 |
< |
Word(0); // Pixel type (indirect) |
248 |
< |
Word(1); // Pixel size |
249 |
< |
Word(1); // CmpCount |
250 |
< |
Word(1); // CmpSize |
251 |
< |
break; |
252 |
< |
case VMODE_2BIT: |
253 |
< |
Word(0); // Pixel type (indirect) |
254 |
< |
Word(2); // Pixel size |
255 |
< |
Word(1); // CmpCount |
256 |
< |
Word(2); // CmpSize |
257 |
< |
break; |
258 |
< |
case VMODE_4BIT: |
259 |
< |
Word(0); // Pixel type (indirect) |
260 |
< |
Word(4); // Pixel size |
261 |
< |
Word(1); // CmpCount |
262 |
< |
Word(4); // CmpSize |
263 |
< |
break; |
264 |
< |
case VMODE_8BIT: |
265 |
< |
Word(0); // Pixel type (indirect) |
266 |
< |
Word(8); // Pixel size |
267 |
< |
Word(1); // CmpCount |
268 |
< |
Word(8); // CmpSize |
269 |
< |
break; |
270 |
< |
case VMODE_16BIT: |
271 |
< |
Word(16); // Pixel type (direct) |
272 |
< |
Word(16); // Pixel size |
273 |
< |
Word(3); // CmpCount |
274 |
< |
Word(5); // CmpSize |
275 |
< |
break; |
276 |
< |
case VMODE_32BIT: |
277 |
< |
Word(16); // Pixel type (direct) |
278 |
< |
Word(32); // Pixel size |
279 |
< |
Word(3); // CmpCount |
280 |
< |
Word(8); // CmpSize |
281 |
< |
break; |
282 |
< |
} |
283 |
< |
Long(0); // Plane size |
284 |
< |
Long(0); // Reserved |
285 |
< |
|
286 |
< |
vidMode = p; // Video mode description |
287 |
< |
Offs(0x01, vidModeParms); // Video parameters |
288 |
< |
Rsrc(0x03, 1); // Page count |
289 |
< |
Rsrc(0x04, IsDirectMode(VideoMonitor.mode) ? 2 :0); // Device type |
290 |
< |
EndOfList(); |
302 |
> |
vidModeParms1 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_1BIT); |
303 |
> |
vidModeParms2 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_2BIT); |
304 |
> |
vidModeParms4 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_4BIT); |
305 |
> |
vidModeParms8 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_8BIT); |
306 |
> |
vidModeParms16 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_16BIT); |
307 |
> |
vidModeParms32 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_32BIT); |
308 |
> |
|
309 |
> |
vidMode1 = VModeDesc(vidModeParms1, false); |
310 |
> |
vidMode2 = VModeDesc(vidModeParms2, false); |
311 |
> |
vidMode4 = VModeDesc(vidModeParms4, false); |
312 |
> |
vidMode8 = VModeDesc(vidModeParms8, false); |
313 |
> |
vidMode16 = VModeDesc(vidModeParms16, true); |
314 |
> |
vidMode32 = VModeDesc(vidModeParms32, true); |
315 |
|
|
316 |
|
sRsrcVideo = p; |
317 |
|
Offs(0x01, videoType); // Video type descriptor |
322 |
|
Offs(0x0b, minorLength); // Frame buffer length |
323 |
|
Offs(0x40, gammaDir); // Gamma directory |
324 |
|
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in |
325 |
< |
Offs(0x80, vidMode); // Video mode parameters |
325 |
> |
#if 0 |
326 |
> |
Offs(0x80, vidMode1); // Video mode parameters for 1 bit |
327 |
> |
Offs(0x81, vidMode2); // Video mode parameters for 2 bit |
328 |
> |
Offs(0x82, vidMode4); // Video mode parameters for 4 bit |
329 |
> |
Offs(0x83, vidMode8); // Video mode parameters for 8 bit |
330 |
> |
Offs(0x84, vidMode16); // Video mode parameters for 16 bit |
331 |
> |
Offs(0x85, vidMode32); // Video mode parameters for 32 bit |
332 |
> |
#else |
333 |
> |
switch (VideoMonitor.mode.depth) { |
334 |
> |
case VDEPTH_1BIT: |
335 |
> |
Offs(0x80, vidMode1); // Video mode parameters |
336 |
> |
break; |
337 |
> |
case VDEPTH_2BIT: |
338 |
> |
Offs(0x80, vidMode2); // Video mode parameters |
339 |
> |
break; |
340 |
> |
case VDEPTH_4BIT: |
341 |
> |
Offs(0x80, vidMode4); // Video mode parameters |
342 |
> |
break; |
343 |
> |
case VDEPTH_8BIT: |
344 |
> |
Offs(0x80, vidMode8); // Video mode parameters |
345 |
> |
break; |
346 |
> |
case VDEPTH_16BIT: |
347 |
> |
Offs(0x80, vidMode16); // Video mode parameters |
348 |
> |
break; |
349 |
> |
case VDEPTH_32BIT: |
350 |
> |
Offs(0x80, vidMode32); // Video mode parameters |
351 |
> |
break; |
352 |
> |
} |
353 |
> |
#endif |
354 |
|
EndOfList(); |
355 |
|
|
356 |
|
// CPU sResource |