Пример #1
0
int sid_engine_set(int engine)
{
#ifdef HAVE_CATWEASELMKIII
    if (engine == SID_ENGINE_CATWEASELMKIII
        && sid_engine_type != SID_ENGINE_CATWEASELMKIII) {
        if (catweaselmkiii_open() < 0) {
            return -1;
        }
    }
    if (engine != SID_ENGINE_CATWEASELMKIII
        && sid_engine_type == SID_ENGINE_CATWEASELMKIII) {
        catweaselmkiii_close();
    }
#endif
#ifdef HAVE_HARDSID
    if (engine == SID_ENGINE_HARDSID
        && sid_engine_type != SID_ENGINE_HARDSID) {
        if (hardsid_open() < 0) {
            return -1;
        }
    }
    if (engine != SID_ENGINE_HARDSID
        && sid_engine_type == SID_ENGINE_HARDSID) {
        hardsid_close();
    }
#endif
#ifdef HAVE_PARSID
    if ((engine == SID_ENGINE_PARSID_PORT1 || engine == SID_ENGINE_PARSID_PORT2 || engine == SID_ENGINE_PARSID_PORT3)
        && sid_engine_type != engine) {
        if (engine == SID_ENGINE_PARSID_PORT1) {
            if (parsid_open(1) < 0) {
                return -1;
            }
        }
        if (engine == SID_ENGINE_PARSID_PORT2) {
            if (parsid_open(2) < 0) {
                return -1;
            }
        }
        if (engine == SID_ENGINE_PARSID_PORT3) {
            if (parsid_open(3) < 0) {
                return -1;
            }
        }
    }
    if (engine != SID_ENGINE_PARSID_PORT1 && engine != SID_ENGINE_PARSID_PORT2 && engine != SID_ENGINE_PARSID_PORT3
        && (sid_engine_type == SID_ENGINE_PARSID_PORT1 || sid_engine_type == SID_ENGINE_PARSID_PORT2 || sid_engine_type == SID_ENGINE_PARSID_PORT3)) {
        parsid_close();
    }
#endif

    sid_engine_type = engine;

    set_sound_func();

    return 0;
}
Пример #2
0
int catweaselmkiii_available(void)
{
    int i = catweaselmkiii_open();

    if (!i) {
        return catweaselmkiii_drv_available();
    }

    return 0;
}
Пример #3
0
int catweaselmkiii_available(void)
{
    int i;

    if (cwmkiii_is_open) {
        for (i = 0; i < MAXCARDS; i++) {
            if (sidhandle[i] != INVALID_HANDLE_VALUE) {
                return 1;
            }
        }
        return 0;
    } else {
        i = catweaselmkiii_open();
        if (cwmkiii_is_open) {
            catweaselmkiii_close();
            return 1;
        }
    }
    return 0;
}