2022-02-05 15:32:44 +01:00
|
|
|
|
#include "NuBusFPGADrvr.h"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
7.1:
|
|
|
|
|
2 Debug: 0x00000009
|
|
|
|
|
1 <EFBFBD>Debug: 0x00000009
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7.5.3:
|
|
|
|
|
6 Debug: 0x00000008
|
|
|
|
|
112 Debug: 0x0000000a
|
|
|
|
|
32 Debug: 0x0000000c
|
|
|
|
|
14 Debug: 0x0000000d
|
|
|
|
|
3 Debug: 0x0000000e
|
|
|
|
|
4 Debug: 0x00000010
|
|
|
|
|
2 Debug: 0x00000011
|
|
|
|
|
78 Debug: 0x00000012
|
|
|
|
|
1 Debug: 0x00000014
|
|
|
|
|
1 <EFBFBD>Debug: 0x0000000a
|
|
|
|
|
|
|
|
|
|
8.1:
|
|
|
|
|
9 Debug: 0x00000008
|
|
|
|
|
273 Debug: 0x0000000a
|
|
|
|
|
156 Debug: 0x0000000c
|
|
|
|
|
16 Debug: 0x0000000d
|
|
|
|
|
3 Debug: 0x00000010
|
|
|
|
|
3 Debug: 0x00000011
|
|
|
|
|
157 Debug: 0x00000012
|
|
|
|
|
1 Debug: 0x00000014
|
|
|
|
|
2 Debug: 0x00000018
|
|
|
|
|
10 Debug: 0x0000001c
|
|
|
|
|
1 <EFBFBD>Debug: 0x0000000c
|
|
|
|
|
*/
|
|
|
|
|
|
2022-10-05 23:46:28 +02:00
|
|
|
|
#pragma parameter __D0 cNuBusFPGAStatus(__A0, __A1)
|
2022-02-05 15:32:44 +01:00
|
|
|
|
OSErr cNuBusFPGAStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
|
|
|
|
{
|
|
|
|
|
NuBusFPGADriverGlobalsHdl dStoreHdl = (NuBusFPGADriverGlobalsHdl)dce->dCtlStorage;
|
|
|
|
|
NuBusFPGADriverGlobalsPtr dStore = *dStoreHdl;
|
|
|
|
|
short ret = -1;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
|
2022-10-01 19:42:30 +02:00
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, 0xBEEF0002); */
|
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, pb->csCode); */
|
2022-04-18 17:04:32 +02:00
|
|
|
|
|
2022-02-05 15:32:44 +01:00
|
|
|
|
#if 1
|
|
|
|
|
switch (pb->csCode)
|
|
|
|
|
{
|
|
|
|
|
case -1:
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
break;
|
|
|
|
|
case 0:
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
|
|
|
|
/* case 1: */
|
|
|
|
|
/* break; */
|
|
|
|
|
case cscGetMode: /* 2 */
|
|
|
|
|
{
|
|
|
|
|
VDPageInfo *vPInfo = (VDPageInfo *)*(long *)pb->csParam;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vPInfo->csMode = dStore->curDepth; /* checkme: PCI says depth, 7.5+ doesn't call anyway? */
|
2022-09-18 14:13:25 +02:00
|
|
|
|
vPInfo->csPage = dStore->curPage;
|
|
|
|
|
vPInfo->csBaseAddr = dStore->curPage * 1024 * 1024 * 4; /* fixme */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case cscGetEntries: /* 3 */
|
|
|
|
|
/* FIXME: TODO */
|
2022-09-18 14:13:25 +02:00
|
|
|
|
/* never called in >= 7.1 ? */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
ret = noErr;
|
|
|
|
|
break;
|
|
|
|
|
case cscGetPageCnt: /* 4 == cscGetPages */
|
|
|
|
|
{
|
|
|
|
|
VDPageInfo *vPInfo = (VDPageInfo *)*(long *)pb->csParam;
|
2022-09-18 14:13:25 +02:00
|
|
|
|
if ((vPInfo->csMode != kDepthMode1) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode2) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode3) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode4) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode5) &&
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(vPInfo->csMode != kDepthMode6)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-18 14:13:25 +02:00
|
|
|
|
vPInfo->csPage = (vPInfo->csMode == kDepthMode5) ? 1 : 2;
|
|
|
|
|
ret = noErr;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case cscGetPageBase: /* 5 == cscGetBaseAddr */
|
|
|
|
|
{
|
|
|
|
|
VDPageInfo *vPInfo = (VDPageInfo *)*(long *)pb->csParam;
|
2022-09-18 14:13:25 +02:00
|
|
|
|
if ((vPInfo->csMode != kDepthMode1) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode2) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode3) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode4) &&
|
|
|
|
|
(vPInfo->csMode != kDepthMode5) &&
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(vPInfo->csMode != kDepthMode6)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-18 14:13:25 +02:00
|
|
|
|
short npage = (vPInfo->csMode == kDepthMode5) ? 1 : 2;
|
2022-10-05 22:41:27 +02:00
|
|
|
|
if (vPInfo->csPage >= npage) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-18 14:13:25 +02:00
|
|
|
|
vPInfo->csBaseAddr = vPInfo->csPage * 1024 * 1024 * 4; /* fixme for > 2 pages ? */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
ret = noErr;
|
|
|
|
|
break;
|
|
|
|
|
case cscGetGray: /* 6 */
|
|
|
|
|
{
|
|
|
|
|
VDGrayRecord *vGInfo = (VDGrayRecord *)*(long *)pb->csParam;
|
|
|
|
|
vGInfo->csMode = dStore->gray;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
break;
|
|
|
|
|
case cscGetInterrupt: /* 7 */
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
{
|
|
|
|
|
VDFlagRecord *vdflag = (VDFlagRecord *)*(long *)pb->csParam;
|
|
|
|
|
vdflag->csMode = 1 - dStore->irqen;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case cscGetGamma: /* 8 */
|
|
|
|
|
{
|
|
|
|
|
VDGammaRecord *vdgamma = (VDGammaRecord *)*(long *)pb->csParam;
|
|
|
|
|
vdgamma->csGTable = (Ptr)&dStore->gamma;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case cscGetDefaultMode: /* 9 */
|
2022-04-18 11:51:07 +02:00
|
|
|
|
{ /* obsolete in PCI, not called >= 7.5 */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
VDDefMode *vddefm = (VDDefMode *)*(long *)pb->csParam;
|
2022-09-18 14:13:25 +02:00
|
|
|
|
SpBlock spb;
|
|
|
|
|
NuBusFPGAPramRecord pram;
|
|
|
|
|
OSErr err;
|
|
|
|
|
spb.spSlot = dce->dCtlSlot;
|
|
|
|
|
spb.spResult = (UInt32)&pram;
|
|
|
|
|
ret = SReadPRAMRec(&spb);
|
|
|
|
|
if (ret == noErr) {
|
|
|
|
|
vddefm->csID = pram.mode;
|
|
|
|
|
}
|
2022-02-05 15:32:44 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetCurMode: /* 0xa */
|
|
|
|
|
{
|
|
|
|
|
VDSwitchInfoRec *vdswitch = *(VDSwitchInfoRec **)(long *)pb->csParam;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, 0xBEEF0022); */
|
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, (unsigned int)dStore->curDepth); */
|
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, (unsigned int)dStore->curMode); */
|
2022-04-18 11:51:07 +02:00
|
|
|
|
vdswitch->csMode = dStore->curDepth;
|
|
|
|
|
vdswitch->csData = dStore->curMode;
|
2022-09-18 14:13:25 +02:00
|
|
|
|
vdswitch->csPage = dStore->curPage;
|
|
|
|
|
vdswitch->csBaseAddr = dStore->curPage * 1024 * 1024 * 4; /* fixme */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetSync: /* 0xb */
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetConnection: /* 0xc */
|
|
|
|
|
{
|
|
|
|
|
VDDisplayConnectInfoRec *vdconn = *(VDDisplayConnectInfoRec **)(long *)pb->csParam;
|
|
|
|
|
vdconn->csDisplayType = kGenericLCD;
|
|
|
|
|
vdconn->csConnectTaggedType = 0;
|
|
|
|
|
vdconn->csConnectTaggedData = 0;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vdconn->csConnectFlags = (1<<kTaggingInfoNonStandard) | (1<<kAllModesSafe) | (1<<kAllModesValid);
|
2022-02-05 15:32:44 +01:00
|
|
|
|
vdconn->csDisplayComponent = 0;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetModeTiming: /* 0xd */
|
|
|
|
|
{
|
|
|
|
|
VDTimingInfoRec *vdtim = *(VDTimingInfoRec **)(long *)pb->csParam;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
if (((((UInt8)vdtim->csTimingMode) < nativeVidMode) ||
|
|
|
|
|
(((UInt8)vdtim->csTimingMode) > dStore->maxMode)) &&
|
|
|
|
|
(vdtim->csTimingMode != kDisplayModeIDFindFirstResolution) &&
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(vdtim->csTimingMode != kDisplayModeIDCurrent)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-17 14:44:26 +02:00
|
|
|
|
unsigned int mode = vdtim->csTimingMode;
|
|
|
|
|
if (mode == kDisplayModeIDFindFirstResolution)
|
2022-09-18 09:10:04 +02:00
|
|
|
|
mode = nativeVidMode;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
if (mode == kDisplayModeIDCurrent)
|
|
|
|
|
mode = dStore->curMode;
|
|
|
|
|
|
|
|
|
|
switch (mode) {
|
2022-09-18 09:10:04 +02:00
|
|
|
|
case nativeVidMode:
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vdtim->csTimingFormat = kDeclROMtables;
|
|
|
|
|
vdtim->csTimingData = 0;
|
|
|
|
|
vdtim->csTimingFlags = 1<<kModeValid | 1<<kModeSafe | 1<<kModeDefault;
|
|
|
|
|
break;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
default:
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vdtim->csTimingFormat = kDeclROMtables;//kDetailedTimingFormat;
|
|
|
|
|
vdtim->csTimingData = 0;
|
|
|
|
|
vdtim->csTimingFlags = 1<<kModeValid | 1<<kModeSafe;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
ret = noErr;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetModeBaseAddress: /* 0xe */
|
|
|
|
|
/* undocumented ??? */
|
2022-04-18 11:51:07 +02:00
|
|
|
|
{
|
|
|
|
|
VDBaseAddressInfoRec *vdbase = *(VDBaseAddressInfoRec **)(long *)pb->csParam;
|
|
|
|
|
vdbase->csDevBase = 0;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
ret = noErr;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2022-09-21 23:38:09 +02:00
|
|
|
|
/* cscGetScanProc */ /* 0xf*/ /* undocumented ? could be called according to #mac68k */
|
|
|
|
|
|
2022-02-05 15:32:44 +01:00
|
|
|
|
case cscGetPreferredConfiguration: /* 0x10 */
|
2022-09-18 09:10:04 +02:00
|
|
|
|
{ /* fixme: NVRAM */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
VDSwitchInfoRec *vdswitch = *(VDSwitchInfoRec **)(long *)pb->csParam;
|
2022-04-18 11:51:07 +02:00
|
|
|
|
vdswitch->csMode = kDepthMode1; //dStore->curDepth; /* fixme: prefered not current / default */
|
2022-09-18 09:10:04 +02:00
|
|
|
|
vdswitch->csData = nativeVidMode; //dStore->curMode;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
ret = noErr;
|
2022-09-18 14:13:25 +02:00
|
|
|
|
SpBlock spb;
|
|
|
|
|
NuBusFPGAPramRecord pram;
|
|
|
|
|
OSErr err;
|
|
|
|
|
spb.spSlot = dce->dCtlSlot;
|
|
|
|
|
spb.spResult = (UInt32)&pram;
|
|
|
|
|
ret = SReadPRAMRec(&spb);
|
|
|
|
|
if (ret == noErr) {
|
|
|
|
|
vdswitch->csMode = pram.depth;
|
|
|
|
|
vdswitch->csData = pram.mode;
|
|
|
|
|
}
|
2022-02-05 15:32:44 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetNextResolution: /* 0x11 */
|
|
|
|
|
{
|
|
|
|
|
VDResolutionInfoRec *vdres = *(VDResolutionInfoRec **)(long *)pb->csParam;
|
|
|
|
|
switch (vdres->csPreviousDisplayModeID)
|
|
|
|
|
{
|
2022-09-18 09:10:04 +02:00
|
|
|
|
default:
|
|
|
|
|
if ((((UInt8)vdres->csPreviousDisplayModeID) < nativeVidMode) ||
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(((UInt8)vdres->csPreviousDisplayModeID) > dStore->maxMode)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-18 09:10:04 +02:00
|
|
|
|
if (((UInt8)vdres->csPreviousDisplayModeID) == dStore->maxMode)
|
|
|
|
|
vdres->csDisplayModeID = kDisplayModeIDNoMoreResolutions;
|
|
|
|
|
else
|
|
|
|
|
vdres->csDisplayModeID = ((UInt8)vdres->csPreviousDisplayModeID) + 1;
|
|
|
|
|
vdres->csHorizontalPixels = dStore->hres[((UInt8)vdres->csDisplayModeID) - nativeVidMode];
|
|
|
|
|
vdres->csVerticalLines = dStore->vres[((UInt8)vdres->csDisplayModeID) - nativeVidMode];
|
|
|
|
|
vdres->csRefreshRate = 60 << 16; /* Fixed(Point) 16+16 */
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vdres->csMaxDepthMode = kDepthMode6;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
break;
|
|
|
|
|
case kDisplayModeIDFindFirstResolution:
|
2022-09-18 09:10:04 +02:00
|
|
|
|
vdres->csDisplayModeID = nativeVidMode;
|
|
|
|
|
vdres->csHorizontalPixels = dStore->hres[0];
|
|
|
|
|
vdres->csVerticalLines = dStore->vres[0];
|
|
|
|
|
vdres->csRefreshRate = 60 << 16; /* Fixed(Point) 16+16 */
|
2022-04-22 22:00:25 +01:00
|
|
|
|
vdres->csMaxDepthMode = kDepthMode6;
|
2022-04-18 11:51:07 +02:00
|
|
|
|
break;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
case kDisplayModeIDCurrent:
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vdres->csDisplayModeID = dStore->curMode;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
vdres->csHorizontalPixels = dStore->hres[dStore->curMode - nativeVidMode];
|
|
|
|
|
vdres->csVerticalLines = dStore->vres[dStore->curMode - nativeVidMode];
|
|
|
|
|
vdres->csRefreshRate = 60 << 16; /* Fixed(Point) 16+16 */
|
2022-04-22 22:00:25 +01:00
|
|
|
|
vdres->csMaxDepthMode = kDepthMode6;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case cscGetVideoParameters: /* 0x12 */
|
|
|
|
|
{
|
|
|
|
|
VDVideoParametersInfoRec *vdparam = *(VDVideoParametersInfoRec **)(long *)pb->csParam;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
if (((((UInt8)vdparam->csDisplayModeID) < nativeVidMode) ||
|
|
|
|
|
(((UInt8)vdparam->csDisplayModeID) > dStore->maxMode)) &&
|
2022-02-05 15:32:44 +01:00
|
|
|
|
(vdparam->csDisplayModeID != kDisplayModeIDFindFirstResolution) &&
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(vdparam->csDisplayModeID != kDisplayModeIDCurrent)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-04-18 11:51:07 +02:00
|
|
|
|
if ((vdparam->csDepthMode != kDepthMode1) &&
|
2022-04-18 14:10:17 +02:00
|
|
|
|
(vdparam->csDepthMode != kDepthMode2) &&
|
|
|
|
|
(vdparam->csDepthMode != kDepthMode3) &&
|
2022-04-18 17:04:32 +02:00
|
|
|
|
(vdparam->csDepthMode != kDepthMode4) &&
|
2022-04-22 22:00:25 +01:00
|
|
|
|
(vdparam->csDepthMode != kDepthMode5) &&
|
2022-10-05 22:41:27 +02:00
|
|
|
|
(vdparam->csDepthMode != kDepthMode6)) {
|
|
|
|
|
ret = paramErr;
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
2022-09-17 14:44:26 +02:00
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, 0xBEEF0022); */
|
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, (unsigned int)vdparam->csDisplayModeID); */
|
|
|
|
|
/* write_reg(dce, GOBOFB_DEBUG, (unsigned int)vdparam->csDepthMode); */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
VPBlock* vpblock = vdparam->csVPBlockPtr;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
unsigned char mode = vdparam->csDisplayModeID;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
if (mode == kDisplayModeIDFindFirstResolution)
|
2022-09-18 09:10:04 +02:00
|
|
|
|
mode = nativeVidMode;
|
2022-09-17 14:44:26 +02:00
|
|
|
|
if (mode == kDisplayModeIDCurrent)
|
|
|
|
|
mode = dStore->curMode;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
/* basically the same as the EBVParms ? */
|
2022-09-18 14:13:25 +02:00
|
|
|
|
vdparam->csPageCount = (vdparam->csDepthMode == kDepthMode5) ? 1 : 2;
|
2022-02-05 15:32:44 +01:00
|
|
|
|
vpblock->vpBaseOffset = 0;
|
|
|
|
|
vpblock->vpBounds.left = 0;
|
|
|
|
|
vpblock->vpBounds.top = 0;
|
2022-09-18 09:10:04 +02:00
|
|
|
|
vpblock->vpBounds.right = dStore->hres[mode - nativeVidMode];
|
|
|
|
|
vpblock->vpBounds.bottom = dStore->vres[mode - nativeVidMode];
|
2022-02-05 15:32:44 +01:00
|
|
|
|
vpblock->vpVersion = 0;
|
|
|
|
|
vpblock->vpPackType = 0;
|
|
|
|
|
vpblock->vpPackSize = 0;
|
|
|
|
|
vpblock->vpHRes = 0x480000;
|
|
|
|
|
vpblock->vpVRes = 0x480000;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vpblock->vpPixelType = chunky; // checkme?
|
2022-04-18 11:51:07 +02:00
|
|
|
|
if (vdparam->csDepthMode == kDepthMode1) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vdparam->csDeviceType = clutType;
|
2022-04-18 11:51:07 +02:00
|
|
|
|
vpblock->vpPixelSize = 8;
|
|
|
|
|
vpblock->vpCmpCount = 1;
|
|
|
|
|
vpblock->vpCmpSize = 8;
|
|
|
|
|
} else if (vdparam->csDepthMode == kDepthMode2) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right/2;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vdparam->csDeviceType = clutType;
|
2022-04-18 14:10:17 +02:00
|
|
|
|
vpblock->vpPixelSize = 4;
|
|
|
|
|
vpblock->vpCmpCount = 1;
|
|
|
|
|
vpblock->vpCmpSize = 4;
|
|
|
|
|
} else if (vdparam->csDepthMode == kDepthMode3) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right/4;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vdparam->csDeviceType = clutType;
|
2022-04-18 14:10:17 +02:00
|
|
|
|
vpblock->vpPixelSize = 2;
|
|
|
|
|
vpblock->vpCmpCount = 1;
|
|
|
|
|
vpblock->vpCmpSize = 2;
|
|
|
|
|
} else if (vdparam->csDepthMode == kDepthMode4) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right/8;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vdparam->csDeviceType = clutType;
|
2022-04-18 11:51:07 +02:00
|
|
|
|
vpblock->vpPixelSize = 1;
|
|
|
|
|
vpblock->vpCmpCount = 1;
|
|
|
|
|
vpblock->vpCmpSize = 1;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
} else if (vdparam->csDepthMode == kDepthMode5) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right*4;
|
2022-04-18 17:04:32 +02:00
|
|
|
|
vdparam->csDeviceType = directType;
|
|
|
|
|
vpblock->vpPixelSize = 32;
|
|
|
|
|
vpblock->vpCmpCount = 3;
|
|
|
|
|
vpblock->vpCmpSize = 8;
|
2022-04-22 22:00:25 +01:00
|
|
|
|
} else if (vdparam->csDepthMode == kDepthMode6) {
|
2022-09-17 14:44:26 +02:00
|
|
|
|
vpblock->vpRowBytes = vpblock->vpBounds.right*2;
|
2022-04-22 22:00:25 +01:00
|
|
|
|
vdparam->csDeviceType = directType;
|
|
|
|
|
vpblock->vpPixelSize = 16;
|
|
|
|
|
vpblock->vpCmpCount = 3;
|
|
|
|
|
vpblock->vpCmpSize = 5;
|
2022-04-18 11:51:07 +02:00
|
|
|
|
}
|
2022-02-05 15:32:44 +01:00
|
|
|
|
vpblock->vpPlaneBytes = 0;
|
|
|
|
|
ret = noErr;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2022-04-18 11:51:07 +02:00
|
|
|
|
/* 0x13 */ /* nothing */
|
|
|
|
|
|
2022-02-05 15:32:44 +01:00
|
|
|
|
case cscGetGammaInfoList: /* 0x14 */
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-09-21 23:38:09 +02:00
|
|
|
|
case cscRetrieveGammaTable: /* 0x15 */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
|
|
|
|
|
2022-09-21 23:38:09 +02:00
|
|
|
|
/* cscSupportsHardwareCursor */ /* 0x16 */ /* never called, unfortunately */
|
|
|
|
|
|
|
|
|
|
/* cscGetHardwareCursorDrawState */ /* 0x17 */ /* never called, unfortunately */
|
|
|
|
|
|
2022-02-05 15:32:44 +01:00
|
|
|
|
case cscGetConvolution: /* 0x18 */
|
|
|
|
|
ret = statusErr;
|
2022-09-21 23:38:09 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* cscGetPowerState */ /* 0x19 */
|
|
|
|
|
/* cscPrivateStatusCall */ /* 0x1a */
|
|
|
|
|
/* cscGetDDCBlock */ /* 0x1b */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
|
|
|
|
|
case cscGetMultiConnect: /* 0x1c */
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
2022-09-21 23:38:09 +02:00
|
|
|
|
|
|
|
|
|
/* cscGetClutBehavior */ /* 0x1d */
|
|
|
|
|
/* cscGetTimingRanges */ /* 0x1e */
|
|
|
|
|
/* cscGetDetailedTiming */ /* 0x1f */
|
|
|
|
|
/* cscGetCommunicationInfo */ /* 0x20 */
|
2022-02-05 15:32:44 +01:00
|
|
|
|
|
|
|
|
|
default: /* always return statusErr for unknown csCode */
|
|
|
|
|
asm volatile(".word 0xfe16\n");
|
|
|
|
|
ret = statusErr;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2022-10-05 22:41:27 +02:00
|
|
|
|
done:
|
|
|
|
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
2022-10-06 23:28:07 +02:00
|
|
|
|
IODone((DCtlPtr)dce, ret);
|
2022-02-05 15:32:44 +01:00
|
|
|
|
return ret;
|
|
|
|
|
}
|