Пример #1
0
Err
unloadHiRes(void)
{
	Err rv = 0;
	if (hires != 0) {
		rv = HRClose(hires);
		if (didl)
			SysLibRemove(hires);
		didl = 0;
		hires = 0;
	}
	return (rv);
}
Пример #2
0
Boolean
sonyCanHires(void)
{
	if (hires == 0) {
		loadHiRes();
		if (hires != 0) {
			HRClose(hires);
			SysLibRemove(hires);
			hires = 0;
			return (true);
		} else
			return (false);
	} else
		return (true);
}
Пример #3
0
static DIAHardwareType InitializeSony( void )
{
    Err    err;
    UInt32 version;

    err = SysLibFind( sonySysLibNameSilk, &sonyRefNum );
    if ( err == sysErrLibNotFound ) {
        err = SysLibLoad( 'libr', sonySysFileCSilkLib, &sonyRefNum );
    }
    if ( err != errNone )
        return DIA_HARDWARE_NONE;
    if ( errNone == FtrGet( sonySysFtrCreator, sonySysFtrNumVskVersion, 
                        &version ) ) {
        /* Version 2 and up */
        err = VskOpen( sonyRefNum );
        if ( errNone == err )
            return DIA_HARDWARE_SONY2;
    }
    else {
        /* Version 1 and up */
        err = SilkLibOpen( sonyRefNum );
        if ( errNone == err ) {
            /* Make sure we are in a Hi-Res mode */
            UInt32 width;
            UInt32 height;
            UInt16 sonyHiResRefNum;

            err = SysLibFind( sonySysLibNameHR, &sonyHiResRefNum );
            if ( err == sysErrLibNotFound )
                err = SysLibLoad( 'libr', sonySysFileCHRLib, &sonyHiResRefNum );
            if ( err == errNone ) {
                err = HROpen( sonyHiResRefNum );
                HRWinScreenMode( sonyHiResRefNum, winScreenModeGet, &width,
                     &height, NULL, NULL );
                HRClose( sonyHiResRefNum );
                if ( width < 320 )
                    return DIA_HARDWARE_NONE;
            }
            else
                return DIA_HARDWARE_NONE;
            }
        return DIA_HARDWARE_SONY1;
    }
    return DIA_HARDWARE_NONE;
}