34 |
|
#include "video.h" |
35 |
|
#include "video_defs.h" |
36 |
|
|
37 |
< |
#define DEBUG 1 |
37 |
> |
#define DEBUG 0 |
38 |
|
#include "debug.h" |
39 |
|
|
40 |
|
|
50 |
|
uint8 palette[256 * 3]; // Color palette, 256 entries, RGB |
51 |
|
bool luminance_mapping; // Luminance mapping on/off |
52 |
|
bool interrupts_enabled; // VBL interrupts on/off |
53 |
+ |
uint32 gamma_table; // Mac address of gamma table |
54 |
|
uint16 current_mode; // Currently selected depth/resolution |
55 |
|
uint32 current_id; |
56 |
|
uint16 preferred_mode; // Preferred depth/resolution |
57 |
|
uint32 preferred_id; |
58 |
+ |
uint32 sp; // Mac address of Slot Manager parameter block |
59 |
|
} VidLocal; |
60 |
|
|
61 |
|
|
127 |
|
|
128 |
|
|
129 |
|
/* |
130 |
+ |
* Set palette to 50% gray |
131 |
+ |
*/ |
132 |
+ |
|
133 |
+ |
static void set_gray_palette(void) |
134 |
+ |
{ |
135 |
+ |
if (!IsDirectMode(VidLocal.current_mode)) { |
136 |
+ |
for (int i=0; i<256; i++) { |
137 |
+ |
VidLocal.palette[i * 3 + 0] = 127; |
138 |
+ |
VidLocal.palette[i * 3 + 1] = 127; |
139 |
+ |
VidLocal.palette[i * 3 + 2] = 127; |
140 |
+ |
} |
141 |
+ |
video_set_palette(VidLocal.palette); |
142 |
+ |
} |
143 |
+ |
} |
144 |
+ |
|
145 |
+ |
|
146 |
+ |
/* |
147 |
|
* Driver Open() routine |
148 |
|
*/ |
149 |
|
|
164 |
|
VidLocal.preferred_mode = VidLocal.current_mode; |
165 |
|
VidLocal.preferred_id = VidLocal.current_id; |
166 |
|
|
167 |
+ |
// Allocate Slot Manager parameter block in Mac RAM |
168 |
+ |
M68kRegisters r; |
169 |
+ |
r.d[0] = SIZEOF_SPBlock; |
170 |
+ |
Execute68kTrap(0xa71e, &r); // NewPtrSysClear() |
171 |
+ |
if (r.a[0] == 0) |
172 |
+ |
return memFullErr; |
173 |
+ |
VidLocal.sp = r.a[0]; |
174 |
+ |
D(bug("SPBlock at %08x\n", VidLocal.sp)); |
175 |
+ |
|
176 |
+ |
// Find and set default gamma table |
177 |
+ |
VidLocal.gamma_table = 0; //!! |
178 |
+ |
|
179 |
|
// Init color palette (solid gray) |
180 |
< |
if (!IsDirectMode(VidLocal.desc->mode)) { |
150 |
< |
for (int i=0; i<256; i++) { |
151 |
< |
VidLocal.palette[i * 3 + 0] = 127; |
152 |
< |
VidLocal.palette[i * 3 + 1] = 127; |
153 |
< |
VidLocal.palette[i * 3 + 2] = 127; |
154 |
< |
} |
155 |
< |
video_set_palette(VidLocal.palette); |
156 |
< |
} |
180 |
> |
set_gray_palette(); |
181 |
|
return noErr; |
182 |
|
} |
183 |
|
|
197 |
|
uint16 mode = ReadMacInt16(param + csMode); |
198 |
|
D(bug(" SetMode %04x\n", mode)); |
199 |
|
|
200 |
+ |
// Set old base address in case the switch fails |
201 |
+ |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
202 |
+ |
|
203 |
+ |
if (ReadMacInt16(param + csPage)) |
204 |
+ |
return paramErr; |
205 |
+ |
|
206 |
|
if (mode != VidLocal.current_mode) { |
207 |
|
std::vector<video_mode>::const_iterator i = find_mode(mode, VidLocal.current_id); |
208 |
< |
if (i == VideoModes.end()) { |
179 |
< |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
208 |
> |
if (i == VideoModes.end()) |
209 |
|
return paramErr; |
210 |
< |
} |
210 |
> |
set_gray_palette(); |
211 |
|
video_switch_to_mode(*i); |
212 |
|
VidLocal.current_mode = mode; |
213 |
+ |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
214 |
+ |
WriteMacInt32(dce + dCtlDevBase, VidLocal.desc->mac_frame_base); |
215 |
|
} |
216 |
< |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
216 |
> |
D(bug(" base %08x\n", VidLocal.desc->mac_frame_base)); |
217 |
|
return noErr; |
218 |
|
} |
219 |
|
|
220 |
|
case cscSetEntries: { // Set palette |
221 |
< |
D(bug(" SetEntries table %08lx, count %d, start %d\n", ReadMacInt32(param + csTable), ReadMacInt16(param + csCount), ReadMacInt16(param + csStart))); |
222 |
< |
if (IsDirectMode(VidLocal.desc->mode)) |
221 |
> |
D(bug(" SetEntries table %08x, count %d, start %d\n", ReadMacInt32(param + csTable), ReadMacInt16(param + csCount), ReadMacInt16(param + csStart))); |
222 |
> |
if (IsDirectMode(VidLocal.current_mode)) |
223 |
|
return controlErr; |
224 |
|
|
225 |
|
uint32 s_pal = ReadMacInt32(param + csTable); // Source palette |
226 |
|
uint8 *d_pal; // Destination palette |
227 |
+ |
uint16 start = ReadMacInt16(param + csStart); |
228 |
|
uint16 count = ReadMacInt16(param + csCount); |
229 |
< |
if (!s_pal || count > 255) |
229 |
> |
if (s_pal == 0 || count > 255) |
230 |
|
return paramErr; |
231 |
|
|
232 |
< |
if (ReadMacInt16(param + csStart) == 0xffff) { // Indexed |
232 |
> |
if (start == 0xffff) { // Indexed |
233 |
|
for (uint32 i=0; i<=count; i++) { |
234 |
< |
d_pal = VidLocal.palette + ReadMacInt16(s_pal) * 3; |
234 |
> |
d_pal = VidLocal.palette + (ReadMacInt16(s_pal) & 0xff) * 3; |
235 |
|
uint8 red = (uint16)ReadMacInt16(s_pal + 2) >> 8; |
236 |
|
uint8 green = (uint16)ReadMacInt16(s_pal + 4) >> 8; |
237 |
|
uint8 blue = (uint16)ReadMacInt16(s_pal + 6) >> 8; |
238 |
|
if (VidLocal.luminance_mapping) |
239 |
|
red = green = blue = (red * 0x4ccc + green * 0x970a + blue * 0x1c29) >> 16; |
240 |
+ |
//!! gamma correction |
241 |
|
*d_pal++ = red; |
242 |
|
*d_pal++ = green; |
243 |
|
*d_pal++ = blue; |
244 |
|
s_pal += 8; |
245 |
|
} |
246 |
< |
} else { // Sequential |
247 |
< |
d_pal = VidLocal.palette + ReadMacInt16(param + csStart) * 3; |
246 |
> |
} else { // Sequential |
247 |
> |
if (start + count > 255) |
248 |
> |
return paramErr; |
249 |
> |
d_pal = VidLocal.palette + start * 3; |
250 |
|
for (uint32 i=0; i<=count; i++) { |
251 |
|
uint8 red = (uint16)ReadMacInt16(s_pal + 2) >> 8; |
252 |
|
uint8 green = (uint16)ReadMacInt16(s_pal + 4) >> 8; |
253 |
|
uint8 blue = (uint16)ReadMacInt16(s_pal + 6) >> 8; |
254 |
|
if (VidLocal.luminance_mapping) |
255 |
|
red = green = blue = (red * 0x4ccc + green * 0x970a + blue * 0x1c29) >> 16; |
256 |
+ |
//!! gamma correction |
257 |
|
*d_pal++ = red; |
258 |
|
*d_pal++ = green; |
259 |
|
*d_pal++ = blue; |
267 |
|
case cscSetGamma: // Set gamma table |
268 |
|
D(bug(" SetGamma\n")); |
269 |
|
//!! |
270 |
< |
return noErr; |
270 |
> |
return controlErr; |
271 |
|
|
272 |
|
case cscGrayPage: { // Fill page with dithered gray pattern |
273 |
|
D(bug(" GrayPage %d\n", ReadMacInt16(param + csPage))); |
284 |
|
}; |
285 |
|
uint32 p = VidLocal.desc->mac_frame_base; |
286 |
|
uint32 pat = pattern[VidLocal.desc->mode.depth]; |
287 |
+ |
bool invert = (VidLocal.desc->mode.depth == VDEPTH_32BIT); |
288 |
|
for (uint32 y=0; y<VidLocal.desc->mode.y; y++) { |
289 |
|
for (uint32 x=0; x<VidLocal.desc->mode.bytes_per_row; x+=4) { |
290 |
|
WriteMacInt32(p + x, pat); |
291 |
< |
if (VidLocal.desc->mode.depth == VDEPTH_32BIT) |
291 |
> |
if (invert) |
292 |
|
pat = ~pat; |
293 |
|
} |
294 |
|
p += VidLocal.desc->mode.bytes_per_row; |
295 |
|
pat = ~pat; |
296 |
|
} |
297 |
+ |
//!! if direct mode, load gamma table to CLUT |
298 |
|
return noErr; |
299 |
|
} |
300 |
|
|
308 |
|
VidLocal.interrupts_enabled = (ReadMacInt8(param + csMode) == 0); |
309 |
|
return noErr; |
310 |
|
|
273 |
– |
// case cscDirectSetEntries: |
274 |
– |
|
311 |
|
case cscSetDefaultMode: { // Set default color depth |
312 |
|
uint16 mode = ReadMacInt16(param + csMode); |
313 |
|
D(bug(" SetDefaultMode %04x\n", mode)); |
320 |
|
uint32 id = ReadMacInt32(param + csData); |
321 |
|
D(bug(" SwitchMode %04x, %08x\n", mode, id)); |
322 |
|
|
323 |
+ |
// Set old base address in case the switch fails |
324 |
+ |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
325 |
+ |
|
326 |
+ |
if (ReadMacInt16(param + csPage)) |
327 |
+ |
return paramErr; |
328 |
+ |
|
329 |
|
if (mode != VidLocal.current_mode || id != VidLocal.current_id) { |
330 |
|
std::vector<video_mode>::const_iterator i = find_mode(mode, id); |
331 |
< |
if (i == VideoModes.end()) { |
290 |
< |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
331 |
> |
if (i == VideoModes.end()) |
332 |
|
return paramErr; |
333 |
< |
} |
333 |
> |
set_gray_palette(); |
334 |
|
video_switch_to_mode(*i); |
335 |
|
VidLocal.current_mode = mode; |
336 |
|
VidLocal.current_id = id; |
337 |
+ |
uint32 frame_base = VidLocal.desc->mac_frame_base; |
338 |
+ |
WriteMacInt32(param + csBaseAddr, frame_base); |
339 |
+ |
|
340 |
+ |
M68kRegisters r; |
341 |
+ |
uint32 sp = VidLocal.sp; |
342 |
+ |
r.a[0] = sp; |
343 |
+ |
|
344 |
+ |
// Find functional sResource for this display |
345 |
+ |
WriteMacInt8(sp + spSlot, ReadMacInt8(dce + dCtlSlot)); |
346 |
+ |
WriteMacInt8(sp + spID, ReadMacInt8(dce + dCtlSlotId)); |
347 |
+ |
WriteMacInt8(sp + spExtDev, 0); |
348 |
+ |
r.d[0] = 0x0016; |
349 |
+ |
Execute68kTrap(0xa06e, &r); // SRsrcInfo() |
350 |
+ |
uint32 rsrc = ReadMacInt32(sp + spPointer); |
351 |
+ |
|
352 |
+ |
// Patch minorBase |
353 |
+ |
WriteMacInt8(sp + spID, 0x0a); // minorBase |
354 |
+ |
r.d[0] = 0x0006; |
355 |
+ |
Execute68kTrap(0xa06e, &r); // SFindStruct() |
356 |
+ |
uint32 minor_base = ReadMacInt32(sp + spPointer) - ROMBaseMac; |
357 |
+ |
ROMBaseHost[minor_base + 0] = frame_base >> 24; |
358 |
+ |
ROMBaseHost[minor_base + 1] = frame_base >> 16; |
359 |
+ |
ROMBaseHost[minor_base + 2] = frame_base >> 8; |
360 |
+ |
ROMBaseHost[minor_base + 3] = frame_base; |
361 |
+ |
|
362 |
+ |
// Patch video mode parameter table |
363 |
+ |
WriteMacInt32(sp + spPointer, rsrc); |
364 |
+ |
WriteMacInt8(sp + spID, mode); |
365 |
+ |
r.d[0] = 0x0006; |
366 |
+ |
Execute68kTrap(0xa06e, &r); // SFindStruct() |
367 |
+ |
WriteMacInt8(sp + spID, 0x01); |
368 |
+ |
r.d[0] = 0x0006; |
369 |
+ |
Execute68kTrap(0xa06e, &r); // SFindStruct() |
370 |
+ |
uint32 p = ReadMacInt32(sp + spPointer) - ROMBaseMac; |
371 |
+ |
ROMBaseHost[p + 8] = i->bytes_per_row >> 8; |
372 |
+ |
ROMBaseHost[p + 9] = i->bytes_per_row; |
373 |
+ |
ROMBaseHost[p + 14] = i->y >> 8; |
374 |
+ |
ROMBaseHost[p + 15] = i->y; |
375 |
+ |
ROMBaseHost[p + 16] = i->x >> 8; |
376 |
+ |
ROMBaseHost[p + 17] = i->x; |
377 |
+ |
|
378 |
+ |
// Update sResource |
379 |
+ |
WriteMacInt8(sp + spID, ReadMacInt8(dce + dCtlSlotId)); |
380 |
+ |
r.d[0] = 0x002b; |
381 |
+ |
Execute68kTrap(0xa06e, &r); // SUpdateSRT() |
382 |
+ |
|
383 |
+ |
// Update frame buffer base in DCE |
384 |
+ |
WriteMacInt32(dce + dCtlDevBase, frame_base); |
385 |
|
} |
386 |
< |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
386 |
> |
D(bug(" base %08x\n", VidLocal.desc->mac_frame_base)); |
387 |
|
return noErr; |
388 |
|
} |
389 |
|
|
421 |
|
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
422 |
|
return noErr; |
423 |
|
|
424 |
< |
// case cscGetEntries: |
424 |
> |
case cscGetEntries: { // Read palette |
425 |
> |
D(bug(" GetEntries table %08x, count %d, start %d\n", ReadMacInt32(param + csTable), ReadMacInt16(param + csCount), ReadMacInt16(param + csStart))); |
426 |
|
|
427 |
< |
case cscGetPageCnt: // Get number of pages |
428 |
< |
D(bug(" GetPageCnt -> 1\n")); |
427 |
> |
uint8 *s_pal; // Source palette |
428 |
> |
uint32 d_pal = ReadMacInt32(param + csTable); // Destination palette |
429 |
> |
uint16 start = ReadMacInt16(param + csStart); |
430 |
> |
uint16 count = ReadMacInt16(param + csCount); |
431 |
> |
if (d_pal == 0 || count > 255) |
432 |
> |
return paramErr; |
433 |
> |
|
434 |
> |
if (start == 0xffff) { // Indexed |
435 |
> |
for (uint32 i=0; i<=count; i++) { |
436 |
> |
s_pal = VidLocal.palette + (ReadMacInt16(d_pal) & 0xff) * 3; |
437 |
> |
uint8 red = *s_pal++; |
438 |
> |
uint8 green = *s_pal++; |
439 |
> |
uint8 blue = *s_pal++; |
440 |
> |
WriteMacInt16(d_pal + 2, red * 0x0101); |
441 |
> |
WriteMacInt16(d_pal + 4, green * 0x0101); |
442 |
> |
WriteMacInt16(d_pal + 6, blue * 0x0101); |
443 |
> |
d_pal += 8; |
444 |
> |
} |
445 |
> |
} else { // Sequential |
446 |
> |
if (start + count > 255) |
447 |
> |
return paramErr; |
448 |
> |
s_pal = VidLocal.palette + start * 3; |
449 |
> |
for (uint32 i=0; i<=count; i++) { |
450 |
> |
uint8 red = *s_pal++; |
451 |
> |
uint8 green = *s_pal++; |
452 |
> |
uint8 blue = *s_pal++; |
453 |
> |
WriteMacInt16(d_pal + 2, red * 0x0101); |
454 |
> |
WriteMacInt16(d_pal + 4, green * 0x0101); |
455 |
> |
WriteMacInt16(d_pal + 6, blue * 0x0101); |
456 |
> |
d_pal += 8; |
457 |
> |
} |
458 |
> |
} |
459 |
> |
return noErr; |
460 |
> |
} |
461 |
> |
|
462 |
> |
case cscGetPages: // Get number of pages |
463 |
> |
D(bug(" GetPages -> 1\n")); |
464 |
|
WriteMacInt16(param + csPage, 1); |
465 |
|
return noErr; |
466 |
|
|
467 |
< |
case cscGetPageBase: // Get page base address |
468 |
< |
D(bug(" GetPageBase -> %08x\n", VidLocal.desc->mac_frame_base)); |
467 |
> |
case cscGetBaseAddress: // Get page base address |
468 |
> |
D(bug(" GetBaseAddress -> %08x\n", VidLocal.desc->mac_frame_base)); |
469 |
|
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
470 |
< |
return noErr; |
470 |
> |
if (ReadMacInt16(param + csPage)) |
471 |
> |
return paramErr; |
472 |
> |
else |
473 |
> |
return noErr; |
474 |
|
|
475 |
|
case cscGetGray: // Get luminance mapping flag |
476 |
|
D(bug(" GetGray -> %d\n", VidLocal.luminance_mapping)); |
477 |
< |
WriteMacInt8(param, VidLocal.luminance_mapping ? 1 : 0); |
477 |
> |
WriteMacInt16(param, VidLocal.luminance_mapping ? 0x0100 : 0); |
478 |
|
return noErr; |
479 |
|
|
480 |
|
case cscGetInterrupt: // Get interrupt disable flag |
481 |
|
D(bug(" GetInterrupt -> %d\n", VidLocal.interrupts_enabled)); |
482 |
< |
WriteMacInt8(param, VidLocal.interrupts_enabled ? 0 : 1); |
482 |
> |
WriteMacInt16(param, VidLocal.interrupts_enabled ? 0 : 0x0100); |
483 |
|
return noErr; |
484 |
|
|
485 |
< |
// case cscGetGamma: |
485 |
> |
case cscGetGamma: |
486 |
> |
D(bug(" GetGamma -> \n")); |
487 |
> |
//!! |
488 |
> |
return statusErr; |
489 |
|
|
490 |
|
case cscGetDefaultMode: // Get default color depth |
491 |
|
D(bug(" GetDefaultMode -> %04x\n", VidLocal.preferred_mode)); |
492 |
|
WriteMacInt16(param + csMode, VidLocal.preferred_mode); |
493 |
|
return noErr; |
494 |
|
|
495 |
< |
case cscGetCurMode: // Get current video mode (depth and resolution) |
496 |
< |
D(bug(" GetCurMode -> %04x/%08x\n", VidLocal.current_mode, VidLocal.current_id)); |
495 |
> |
case cscGetCurrentMode: // Get current video mode (depth and resolution) |
496 |
> |
D(bug(" GetCurMode -> %04x/%08x, base %08x\n", VidLocal.current_mode, VidLocal.current_id, VidLocal.desc->mac_frame_base)); |
497 |
|
WriteMacInt16(param + csMode, VidLocal.current_mode); |
498 |
|
WriteMacInt32(param + csData, VidLocal.current_id); |
499 |
|
WriteMacInt16(param + csPage, 0); |
502 |
|
|
503 |
|
case cscGetConnection: // Get monitor information |
504 |
|
D(bug(" GetConnection\n")); |
505 |
< |
WriteMacInt16(param + csDisplayType, 6); // 21" Multiscan |
506 |
< |
WriteMacInt8(param + csConnectTaggedType, 6); |
507 |
< |
WriteMacInt8(param + csConnectTaggedData, 0x23); |
508 |
< |
WriteMacInt32(param + csConnectFlags, 0x03); // All modes valid and safe |
505 |
> |
WriteMacInt16(param + csDisplayType, 8); // Modeless connection |
506 |
> |
WriteMacInt8(param + csConnectTaggedType, 0); |
507 |
> |
WriteMacInt8(param + csConnectTaggedData, 0); |
508 |
> |
WriteMacInt32(param + csConnectFlags, 0x43); // All modes valid and safe, non-standard tagging |
509 |
|
WriteMacInt32(param + csDisplayComponent, 0); |
510 |
|
return noErr; |
511 |
|
|
512 |
+ |
case cscGetModeTiming: { // Get video timing for specified resolution |
513 |
+ |
uint32 id = ReadMacInt32(param + csTimingMode); |
514 |
+ |
D(bug(" GetModeTiming %08x\n", id)); |
515 |
+ |
if (!has_resolution(id)) |
516 |
+ |
return paramErr; |
517 |
+ |
|
518 |
+ |
WriteMacInt32(param + csTimingFormat, FOURCC('d', 'e', 'c', 'l')); |
519 |
+ |
WriteMacInt32(param + csTimingData, 0); // unknown |
520 |
+ |
uint32 flags = 0xb; // mode valid, safe and shown in Monitors panel |
521 |
+ |
if (id == VidLocal.preferred_id) |
522 |
+ |
flags |= 4; // default mode |
523 |
+ |
WriteMacInt32(param + csTimingFlags, flags); |
524 |
+ |
return noErr; |
525 |
+ |
} |
526 |
+ |
|
527 |
|
case cscGetModeBaseAddress: // Get frame buffer base address |
528 |
< |
D(bug(" GetModeBaseAddress -> %08x\n", VidLocal.desc->mac_frame_base)); |
529 |
< |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); // Base address of video RAM for the current DisplayModeID and relative bit depth |
528 |
> |
D(bug(" GetModeBaseAddress -> base %08x\n", VidLocal.desc->mac_frame_base)); |
529 |
> |
WriteMacInt32(param + csBaseAddr, VidLocal.desc->mac_frame_base); |
530 |
|
return noErr; |
531 |
|
|
532 |
|
case cscGetPreferredConfiguration: // Get default video mode (depth and resolution) |
573 |
|
WriteMacInt32(param + csVerticalLines, y); |
574 |
|
WriteMacInt32(param + csRefreshRate, 75 << 16); |
575 |
|
WriteMacInt16(param + csMaxDepthMode, DepthToAppleMode(max_depth_of_resolution(id))); |
430 |
– |
uint32 flags = 0xb; // mode valid, safe and shown in Monitors panel |
431 |
– |
if (id == VidLocal.preferred_id) |
432 |
– |
flags |= 4; // default mode |
433 |
– |
WriteMacInt32(param + csResolutionFlags, flags); |
576 |
|
return noErr; |
577 |
|
} |
578 |
|
|
594 |
|
WriteMacInt16(vp + vpVersion, 0); |
595 |
|
WriteMacInt16(vp + vpPackType, 0); |
596 |
|
WriteMacInt32(vp + vpPackSize, 0); |
597 |
< |
WriteMacInt32(vp + vpHRes, 0x00480000); |
597 |
> |
WriteMacInt32(vp + vpHRes, 0x00480000); // 72 dpi |
598 |
|
WriteMacInt32(vp + vpVRes, 0x00480000); |
599 |
|
uint32 pix_type, pix_size, cmp_count, cmp_size, dev_type; |
600 |
|
switch (i->depth) { |
642 |
|
return paramErr; // specified resolution/depth not supported |
643 |
|
} |
644 |
|
|
503 |
– |
case cscGetModeTiming: { // Get video timing for specified resolution |
504 |
– |
uint32 id = ReadMacInt32(param + csTimingMode); |
505 |
– |
D(bug(" GetModeTiming %08x\n", id)); |
506 |
– |
if (!has_resolution(id)) |
507 |
– |
return paramErr; |
508 |
– |
|
509 |
– |
WriteMacInt32(param + csTimingFormat, FOURCC('d', 'e', 'c', 'l')); |
510 |
– |
WriteMacInt32(param + csTimingData, 0); // unknown |
511 |
– |
uint32 flags = 0xb; // mode valid, safe and shown in Monitors panel |
512 |
– |
if (id == VidLocal.preferred_id) |
513 |
– |
flags |= 4; // default mode |
514 |
– |
WriteMacInt32(param + csTimingFlags, flags); |
515 |
– |
return noErr; |
516 |
– |
} |
517 |
– |
|
645 |
|
default: |
646 |
|
printf("WARNING: Unknown VideoDriverStatus(%d)\n", code); |
647 |
|
return statusErr; |