105 |
|
srom[p++] = 0; |
106 |
|
} |
107 |
|
|
108 |
< |
static uint32 VModeParms(const video_mode &mode, video_depth depth) |
108 |
> |
static uint32 VModeParms(const monitor_desc &m, video_depth depth) |
109 |
|
{ |
110 |
+ |
const video_mode &mode = m.get_current_mode(); |
111 |
+ |
|
112 |
|
uint32 ret = p; |
113 |
|
Long(50); // Length |
114 |
|
Long(0); // Base offset |
115 |
< |
Word(video_bytes_per_row(depth, mode.resolution_id)); |
115 |
> |
Word(m.get_bytes_per_row(depth, mode.resolution_id)); |
116 |
|
Word(0); // Bounds |
117 |
|
Word(0); |
118 |
|
Word(mode.y); |
175 |
|
return ret; |
176 |
|
} |
177 |
|
|
178 |
+ |
static uint32 VMonitor(const monitor_desc &m, uint32 videoType, uint32 videoName, uint32 vidDrvrDir, uint32 gammaDir) |
179 |
+ |
{ |
180 |
+ |
uint32 minorBase, minorLength; |
181 |
+ |
uint32 vidModeParms1, vidModeParms2, vidModeParms4, vidModeParms8, vidModeParms16, vidModeParms32; |
182 |
+ |
uint32 vidMode1, vidMode2, vidMode4, vidMode8, vidMode16, vidMode32; |
183 |
+ |
uint32 ret; |
184 |
+ |
|
185 |
+ |
minorBase = p; |
186 |
+ |
Long(m.get_mac_frame_base()); // Frame buffer base |
187 |
+ |
minorLength = p; |
188 |
+ |
Long(0); // Frame buffer size (unspecified) |
189 |
+ |
|
190 |
+ |
vidModeParms1 = VModeParms(m, VDEPTH_1BIT); |
191 |
+ |
vidModeParms2 = VModeParms(m, VDEPTH_2BIT); |
192 |
+ |
vidModeParms4 = VModeParms(m, VDEPTH_4BIT); |
193 |
+ |
vidModeParms8 = VModeParms(m, VDEPTH_8BIT); |
194 |
+ |
vidModeParms16 = VModeParms(m, VDEPTH_16BIT); |
195 |
+ |
vidModeParms32 = VModeParms(m, VDEPTH_32BIT); |
196 |
+ |
|
197 |
+ |
vidMode1 = VModeDesc(vidModeParms1, false); |
198 |
+ |
vidMode2 = VModeDesc(vidModeParms2, false); |
199 |
+ |
vidMode4 = VModeDesc(vidModeParms4, false); |
200 |
+ |
vidMode8 = VModeDesc(vidModeParms8, false); |
201 |
+ |
vidMode16 = VModeDesc(vidModeParms16, true); |
202 |
+ |
vidMode32 = VModeDesc(vidModeParms32, true); |
203 |
+ |
|
204 |
+ |
ret = p; |
205 |
+ |
Offs(0x01, videoType); // Video type descriptor |
206 |
+ |
Offs(0x02, videoName); // Driver name |
207 |
+ |
Offs(0x04, vidDrvrDir); // Driver directory |
208 |
+ |
Rsrc(0x08, 0x4232); // Hardware device ID ('B2') |
209 |
+ |
Offs(0x0a, minorBase); // Frame buffer base |
210 |
+ |
Offs(0x0b, minorLength); // Frame buffer length |
211 |
+ |
Offs(0x40, gammaDir); // Gamma directory |
212 |
+ |
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in |
213 |
+ |
if (m.has_depth(VDEPTH_1BIT)) |
214 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_1BIT), vidMode1); // Video mode parameters for 1 bit |
215 |
+ |
if (m.has_depth(VDEPTH_2BIT)) |
216 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_2BIT), vidMode2); // Video mode parameters for 2 bit |
217 |
+ |
if (m.has_depth(VDEPTH_4BIT)) |
218 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_4BIT), vidMode4); // Video mode parameters for 4 bit |
219 |
+ |
if (m.has_depth(VDEPTH_8BIT)) |
220 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_8BIT), vidMode8); // Video mode parameters for 8 bit |
221 |
+ |
if (m.has_depth(VDEPTH_16BIT)) |
222 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_16BIT), vidMode16); // Video mode parameters for 16 bit |
223 |
+ |
if (m.has_depth(VDEPTH_32BIT)) |
224 |
+ |
Offs(m.depth_to_apple_mode(VDEPTH_32BIT), vidMode32); // Video mode parameters for 32 bit |
225 |
+ |
EndOfList(); |
226 |
+ |
return ret; |
227 |
+ |
} |
228 |
+ |
|
229 |
|
bool InstallSlotROM(void) |
230 |
|
{ |
231 |
|
uint32 boardType, boardName, vendorID, revLevel, partNum, date; |
232 |
|
uint32 vendorInfo, sRsrcBoard; |
233 |
|
|
234 |
< |
uint32 videoType, videoName, minorBase, minorLength, videoDrvr, vidDrvrDir; |
235 |
< |
uint32 defaultGamma, gammaDir, sRsrcVideo; |
183 |
< |
uint32 vidModeParms1, vidModeParms2, vidModeParms4, vidModeParms8, vidModeParms16, vidModeParms32; |
184 |
< |
uint32 vidMode1, vidMode2, vidMode4, vidMode8, vidMode16, vidMode32; |
234 |
> |
uint32 videoType, videoName, videoDrvr, vidDrvrDir; |
235 |
> |
uint32 defaultGamma, gammaDir; |
236 |
|
|
237 |
|
uint32 cpuType, cpuName, cpuMajor, cpuMinor, sRsrcCPU; |
238 |
|
|
240 |
|
|
241 |
|
uint32 sRsrcDir; |
242 |
|
|
243 |
+ |
vector<monitor_desc *>::const_iterator m, mend = VideoMonitors.end(); |
244 |
+ |
vector<uint32> sRsrcVideo; |
245 |
+ |
|
246 |
|
char str[256]; |
247 |
+ |
int i; |
248 |
|
p = 0; |
249 |
|
|
250 |
|
// Board sResource |
276 |
|
Offs(0x24, vendorInfo); // Vendor Info |
277 |
|
EndOfList(); |
278 |
|
|
279 |
< |
// Video sResource for default mode |
225 |
< |
videoType = p; // Literals |
279 |
> |
videoType = p; |
280 |
|
Word(3); Word(1); Word(1); Word(0x4232); // Display Video Apple 'B2' |
281 |
|
videoName = p; |
282 |
|
String("Display_Video_Apple_Basilisk"); |
229 |
– |
minorBase = p; |
230 |
– |
Long(VideoMonitor.mac_frame_base); // Frame buffer base |
231 |
– |
minorLength = p; |
232 |
– |
Long(0); // Frame buffer size (unspecified) |
283 |
|
|
284 |
|
videoDrvr = p; // Video driver |
285 |
|
Long(0x72); // Length |
352 |
|
Offs(0x80, defaultGamma); |
353 |
|
EndOfList(); |
354 |
|
|
355 |
< |
vidModeParms1 = VModeParms(VideoMonitor.mode, VDEPTH_1BIT); |
356 |
< |
vidModeParms2 = VModeParms(VideoMonitor.mode, VDEPTH_2BIT); |
307 |
< |
vidModeParms4 = VModeParms(VideoMonitor.mode, VDEPTH_4BIT); |
308 |
< |
vidModeParms8 = VModeParms(VideoMonitor.mode, VDEPTH_8BIT); |
309 |
< |
vidModeParms16 = VModeParms(VideoMonitor.mode, VDEPTH_16BIT); |
310 |
< |
vidModeParms32 = VModeParms(VideoMonitor.mode, VDEPTH_32BIT); |
311 |
< |
|
312 |
< |
vidMode1 = VModeDesc(vidModeParms1, false); |
313 |
< |
vidMode2 = VModeDesc(vidModeParms2, false); |
314 |
< |
vidMode4 = VModeDesc(vidModeParms4, false); |
315 |
< |
vidMode8 = VModeDesc(vidModeParms8, false); |
316 |
< |
vidMode16 = VModeDesc(vidModeParms16, true); |
317 |
< |
vidMode32 = VModeDesc(vidModeParms32, true); |
318 |
< |
|
319 |
< |
sRsrcVideo = p; |
320 |
< |
Offs(0x01, videoType); // Video type descriptor |
321 |
< |
Offs(0x02, videoName); // Driver name |
322 |
< |
Offs(0x04, vidDrvrDir); // Driver directory |
323 |
< |
Rsrc(0x08, 0x4232); // Hardware device ID ('B2') |
324 |
< |
Offs(0x0a, minorBase); // Frame buffer base |
325 |
< |
Offs(0x0b, minorLength); // Frame buffer length |
326 |
< |
Offs(0x40, gammaDir); // Gamma directory |
327 |
< |
Rsrc(0x7d, 6); // Video attributes: Default to color, built-in |
328 |
< |
if (video_has_depth(VDEPTH_1BIT)) |
329 |
< |
Offs(DepthToAppleMode(VDEPTH_1BIT), vidMode1); // Video mode parameters for 1 bit |
330 |
< |
if (video_has_depth(VDEPTH_2BIT)) |
331 |
< |
Offs(DepthToAppleMode(VDEPTH_2BIT), vidMode2); // Video mode parameters for 2 bit |
332 |
< |
if (video_has_depth(VDEPTH_4BIT)) |
333 |
< |
Offs(DepthToAppleMode(VDEPTH_4BIT), vidMode4); // Video mode parameters for 4 bit |
334 |
< |
if (video_has_depth(VDEPTH_8BIT)) |
335 |
< |
Offs(DepthToAppleMode(VDEPTH_8BIT), vidMode8); // Video mode parameters for 8 bit |
336 |
< |
if (video_has_depth(VDEPTH_16BIT)) |
337 |
< |
Offs(DepthToAppleMode(VDEPTH_16BIT), vidMode16); // Video mode parameters for 16 bit |
338 |
< |
if (video_has_depth(VDEPTH_32BIT)) |
339 |
< |
Offs(DepthToAppleMode(VDEPTH_32BIT), vidMode32); // Video mode parameters for 32 bit |
340 |
< |
EndOfList(); |
355 |
> |
for (m = VideoMonitors.begin(); m != mend; ++m) |
356 |
> |
sRsrcVideo.push_back(VMonitor(**m, videoType, videoName, vidDrvrDir, gammaDir)); |
357 |
|
|
358 |
|
// CPU sResource |
359 |
|
cpuType = p; // Literals |
431 |
|
// sResource directory |
432 |
|
sRsrcDir = p; |
433 |
|
Offs(0x01, sRsrcBoard); |
434 |
< |
Offs(0x80, sRsrcVideo); |
434 |
> |
for (m = VideoMonitors.begin(), i = 0; m != mend; ++m, ++i) |
435 |
> |
Offs((*m)->get_slot_id(), sRsrcVideo[i]); |
436 |
|
Offs(0xf0, sRsrcCPU); |
437 |
|
Offs(0xf1, sRsrcEther); |
438 |
|
EndOfList(); |