46 |
|
static int slot_rom_size = 0; |
47 |
|
|
48 |
|
|
49 |
– |
// Check whether a mode with the specified depth exists |
50 |
– |
static bool has_depth(video_depth depth) |
51 |
– |
{ |
52 |
– |
vector<video_mode>::const_iterator i = VideoModes.begin(), end = VideoModes.end(); |
53 |
– |
while (i != end) { |
54 |
– |
if (i->depth == depth) |
55 |
– |
return true; |
56 |
– |
++i; |
57 |
– |
} |
58 |
– |
return false; |
59 |
– |
} |
60 |
– |
|
61 |
– |
|
49 |
|
/* |
50 |
|
* Construct slot declaration ROM and copy it into the Mac ROM (must be called after VideoInit()) |
51 |
|
*/ |
105 |
|
srom[p++] = 0; |
106 |
|
} |
107 |
|
|
108 |
< |
static uint32 VModeParms(uint32 width, uint32 height, uint32 bytes_per_row, video_depth depth) |
108 |
> |
static uint32 VModeParms(const video_mode &mode, video_depth depth) |
109 |
|
{ |
110 |
|
uint32 ret = p; |
111 |
|
Long(50); // Length |
112 |
|
Long(0); // Base offset |
113 |
< |
Word(bytes_per_row); // Row bytes |
113 |
> |
Word(video_bytes_per_row(depth, mode.resolution_id)); |
114 |
|
Word(0); // Bounds |
115 |
|
Word(0); |
116 |
< |
Word(height); |
117 |
< |
Word(width); |
116 |
> |
Word(mode.y); |
117 |
> |
Word(mode.x); |
118 |
|
Word(0); // Version |
119 |
|
Word(0); // Pack type |
120 |
|
Long(0); // Pack size |
302 |
|
Offs(0x80, defaultGamma); |
303 |
|
EndOfList(); |
304 |
|
|
305 |
< |
vidModeParms1 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_1BIT); |
306 |
< |
vidModeParms2 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_2BIT); |
307 |
< |
vidModeParms4 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_4BIT); |
308 |
< |
vidModeParms8 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_8BIT); |
309 |
< |
vidModeParms16 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_16BIT); |
310 |
< |
vidModeParms32 = VModeParms(VideoMonitor.mode.x, VideoMonitor.mode.y, VideoMonitor.mode.bytes_per_row, VDEPTH_32BIT); |
305 |
> |
vidModeParms1 = VModeParms(VideoMonitor.mode, VDEPTH_1BIT); |
306 |
> |
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); |
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 (has_depth(VDEPTH_1BIT)) |
329 |
< |
Offs(0x80, vidMode1); // Video mode parameters for 1 bit |
330 |
< |
if (has_depth(VDEPTH_2BIT)) |
331 |
< |
Offs(0x81, vidMode2); // Video mode parameters for 2 bit |
332 |
< |
if (has_depth(VDEPTH_4BIT)) |
333 |
< |
Offs(0x82, vidMode4); // Video mode parameters for 4 bit |
334 |
< |
if (has_depth(VDEPTH_8BIT)) |
335 |
< |
Offs(0x83, vidMode8); // Video mode parameters for 8 bit |
336 |
< |
if (has_depth(VDEPTH_16BIT)) |
337 |
< |
Offs(0x84, vidMode16); // Video mode parameters for 16 bit |
338 |
< |
if (has_depth(VDEPTH_32BIT)) |
339 |
< |
Offs(0x85, vidMode32); // Video mode parameters for 32 bit |
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(); |
341 |
|
|
342 |
|
// CPU sResource |