Exemplo n.º 1
0
static void SetKeyVal(HWND hwnd, USHORT id, int num, int val)
{
    char *msg;

    ResSetKeyVal(num, id, val);

    msg = lib_msprintf("%03d", val);
    WinSendDlgMsg(hwnd, id, SPBM_SETARRAY, &msg, 1);
    WinSetDlgSpinVal(hwnd, id, 0);
    lib_free(msg);
}
Exemplo n.º 2
0
static MRESULT EXPENTRY pm_emulator(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    // FIXME: Speed=0 'No Limit' is missing
    static int first = TRUE;
    const char psz[11][6] = {
        " Auto",
        " 1/1",
        " 1/2",
        " 1/3",
        " 1/4",
        " 1/5",
        " 1/6",
        " 1/7",
        " 1/8",
        " 1/9",
        " 1/10"
    };

    switch (msg) {
        case WM_INITDLG:
            {
            int val=0;

                for (val = 0; val < 11; val++) {
                    WinDlgLboxInsertItem(hwnd, CBS_REFRATE, psz[val]);
                }
                resources_get_int("Speed", &val);
                WinSetDlgSpinVal(hwnd, SPB_SPEED, val);
                WinEnableControl(hwnd, PB_SPEED100, (val!=100));
                resources_get_int("RefreshRate", &val);
                WinDlgLboxSelectItem(hwnd, CBS_REFRATE, val);
            }
            break;
        case WM_COMMAND:
            switch (LONGFROMMP(mp1)) {
                case PB_SPEED100:
                WinSetDlgSpinVal(hwnd, SPB_SPEED, 100);
                vsync_suspend_speed_eval();
                resources_set_int("Speed", 100);
                WinEnableControl(hwnd, PB_SPEED100, FALSE);
                return FALSE;
            }
            break;
        case WM_DISPLAY:
            {
                char txt1[8] = "---%";
                char txt2[8] = "--fps";

                if ((int)mp1 < 100000) {
                    sprintf(txt1, "%5d%%", mp1);
                }
                if ((int)mp2 < 10000) {
                    sprintf(txt2, "%4dfps", mp2);
                }
                WinSetDlgItemText(hwnd, ID_SPEEDDISP, txt1);
                WinSetDlgItemText(hwnd, ID_REFRATEDISP, txt2);
            }
            return FALSE;
        case WM_CONTROL:
            {
                const int ctrl = SHORT1FROMMP(mp1);

                switch (ctrl) {
                    case SPB_SPEED:
                        if (SHORT2FROMMP(mp1) == SPBN_ENDSPIN) {
                            const ULONG val = WinGetSpinVal((HWND)mp2);

                            vsync_suspend_speed_eval();
                            resources_set_int("Speed", val);
                            WinEnableControl(hwnd, PB_SPEED100, (val != 100));
                        }
                        break;
                    case CBS_REFRATE:
                        if (SHORT2FROMMP(mp1) == LN_SELECT) {
                            const int val = WinQueryLboxSelectedItem((HWND)mp2);

                            resources_set_int("RefreshRate", val);
                        }
                        break;
                }
                break;
            }
            break;
    }
    return WinDefDlgProc (hwnd, msg, mp1, mp2);
}
Exemplo n.º 3
0
static MRESULT EXPENTRY pm_datasette(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    switch (msg)
    {
    case WM_INITDLG:
        {
            int val;

            WinSendMsg(hwnd, WM_COUNTER,  (void*)ui_status.lastTapeCounter, 0);
            WinSendMsg(hwnd, WM_TAPESTAT,
                       (void*)ui_status.lastTapeCtrlStat,
                       (void*)ui_status.lastTapeStatus);
            WinShowDlg(hwnd, SS_SPIN,
                       ui_status.lastTapeMotor && ui_status.lastTapeStatus);

            resources_get_int("DatasetteResetWithCPU", &val);
            WinCheckButton(hwnd, CB_RESETWCPU, val);
            resources_get_int("DatasetteZeroGapDelay", &val);
            WinSetDlgSpinVal(hwnd, SPB_DELAY, (val/100));
            resources_get_int("DatasetteSpeedTuning", &val);
            WinSetDlgSpinVal(hwnd, SPB_GAP, val);
        }
        break;

    case WM_COUNTER:
        WinSetDlgSpinVal(hwnd, SPB_COUNT, (ULONG)mp1);
        return FALSE;

    case WM_TAPESTAT:
        WinEnableControl(hwnd, PB_RECORD,   mp2 && (int)mp1!=DATASETTE_CONTROL_RECORD);
        WinEnableControl(hwnd, PB_REWIND,   mp2 && (int)mp1!=DATASETTE_CONTROL_REWIND);
        WinEnableControl(hwnd, PB_STOP,     mp2 && (int)mp1!=DATASETTE_CONTROL_STOP);
        WinEnableControl(hwnd, PB_START,    mp2 && (int)mp1!=DATASETTE_CONTROL_START);
        WinEnableControl(hwnd, PB_FORWARD,  mp2 && (int)mp1!=DATASETTE_CONTROL_FORWARD);
        WinEnableControl(hwnd, PB_RESET,    mp2!=0);
        WinEnableControl(hwnd, PB_RESETCNT, mp2!=0);
        WinEnableControl(hwnd, SPB_COUNT,   mp2!=0);

        if (!mp2)
            WinShowDlg(hwnd, SS_SPIN, 0);

        return FALSE;

    case WM_SPINNING:
        WinShowDlg(hwnd, SS_SPIN, mp1 && mp2);
        return FALSE;
 
    case WM_COMMAND:
        switch (LONGFROMMP(mp1))
        {
        case PB_STOP:
        case PB_START:
        case PB_FORWARD:
        case PB_REWIND:
        case PB_RECORD:
        case PB_RESET:
        case PB_RESETCNT:
            datasette_control(LONGFROMMP(mp1)&0xf);
            return FALSE;

        case PB_TATTACH:
            ViceFileDialog(hwnd, 0x0201, FDS_OPEN_DIALOG);
            return FALSE;

        case PB_TDETACH:
            tape_image_detach(1);
            return FALSE;
        }
        break;
    case WM_CONTROL:
        switch (SHORT1FROMMP(mp1))
        {
        case CB_RESETWCPU:
            toggle("DatasetteResetWithCPU");
            break;
        case SPB_DELAY:
            if (SHORT2FROMMP(mp1)==SPBN_ENDSPIN)
            {
                const ULONG val = WinGetSpinVal((HWND)mp2);
                resources_set_int("DatasetteZeroGapDelay", val*100);
            }
            break;
        case SPB_GAP:
            if (SHORT2FROMMP(mp1)==SPBN_ENDSPIN)
            {
                const ULONG val = WinGetSpinVal((HWND)mp2);
                resources_set_int("DatasetteSpeedTuning", val);
            }
            break;
        }
        break;
    }
    return WinDefDlgProc (hwnd, msg, mp1, mp2);
}
Exemplo n.º 4
0
static MRESULT EXPENTRY pm_calibrate(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    static int joy1 = TRUE;

    switch (msg) {
        case WM_INITDLG:
            {
                int j1, j2;

                resources_get_int("JoyDevice1", &j1);
                resources_get_int("JoyDevice2", &j2);
                WinSendMsg(hwnd, WM_PROCESS, (void*)!!((j1 | j2) & JOYDEV_HW1), (void*)!!((j1 | j2) & JOYDEV_HW2));
            }
            break;
        case WM_COMMAND:
            {
                int cmd = LONGFROMMP(mp1);

                switch (cmd) {
                    case ID_START:
                    case ID_RESET:
                    case ID_STOP:
                        if (joy1) {
                            set_joyA_autoCal(NULL, (void*)(cmd != ID_STOP));
                        } else {
                            set_joyB_autoCal(NULL, (void*)(cmd != ID_STOP));
                        }
                        WinSendMsg(hwnd, WM_ENABLECTRL, 0, (void*)(cmd != ID_STOP));
                        WinSendMsg(hwnd, WM_FILLSPB, 0, 0);
                        return FALSE;
                }
                break;
            }
        case WM_CONTROL:
            {
                int ctrl = SHORT1FROMMP(mp1);

                switch (ctrl) {
                    case RB_JOY1:
                    case RB_JOY2:
                        if (!(ctrl == RB_JOY1 && joy1) && !(ctrl == RB_JOY2 && !joy1)) {
                            joy1 = !joy1;
                            WinSendMsg(hwnd, WM_ENABLECTRL, 0, (void*)(get_joy_autoCal(joy1 ? 0 : 1)));
                            WinSendMsg(hwnd, WM_FILLSPB, 0, 0);
                        }
                        break;
                    case SPB_UP:
                    case SPB_DOWN:
                    case SPB_LEFT:
                    case SPB_RIGHT:
                        if (SHORT2FROMMP(mp1) == SPBN_ENDSPIN) {
                            const ULONG val = WinGetSpinVal((HWND)mp2);

                            resources_set_int(ctrl == SPB_UP ? (joy1 ? "joyAup" : "joyBup") : ctrl == SPB_DOWN ? (joy1 ? "joyAdown" : "joyBdown") :
                                              ctrl == SPB_LEFT ? (joy1 ? "joyAleft" : "joyBleft") : (joy1 ? "joyAright" : "joyBright"), val);
                        }
                        break;
                }
                break;
            }
        case WM_PROCESS:
            if (((int)mp1 ^ (int)mp2) & 1) {
                joy1 = (int)mp1;
            }

            WinCheckButton(hwnd, joy1?RB_JOY1:RB_JOY2, 1);
            WinEnableControl(hwnd, RB_JOY1, (ULONG)mp1);
            WinEnableControl(hwnd, RB_JOY2, (ULONG)mp2);

            WinSendMsg(hwnd, WM_ENABLECTRL, (void*)(!mp1 && !mp2), (void*)get_joy_autoCal(joy1 ? 0 : 1));
            WinSendMsg(hwnd, WM_FILLSPB, 0, 0);
            break;
        case WM_SETJOY:
            {
                ULONG state1 = mp1 ? 1 : 0;
                ULONG state2 = mp2 ? 1 : 0;
                WinEnableControl(hwnd, RB_JOY1, state1);
                WinEnableControl(hwnd, RB_JOY2, state2);
                WinSendMsg(hwnd, WM_PROCESS, (void*)state1, (void*)state2);
            }
            break;
        case WM_ENABLECTRL:
            WinEnableControl(hwnd, ID_START, mp1 ? FALSE : !mp2);
            WinEnableControl(hwnd, ID_STOP, mp1 ? FALSE : !!mp2);
            WinEnableControl(hwnd, ID_RESET, mp1 ? FALSE : !!mp2);
            WinEnableControl(hwnd, SPB_UP, mp1 ? FALSE : !mp2);
            WinEnableControl(hwnd, SPB_DOWN, mp1 ? FALSE : !mp2);
            WinEnableControl(hwnd, SPB_LEFT, mp1 ? FALSE : !mp2);
            WinEnableControl(hwnd, SPB_RIGHT, mp1 ? FALSE : !mp2);
            return FALSE;
        case WM_FILLSPB:
            {
                int val;

                resources_get_int(joy1 ? "JoyAup" : "JoyBup", &val);
                WinSetDlgSpinVal(hwnd, SPB_UP, val);
                resources_get_int(joy1 ? "JoyAdown" : "JoyBdown", &val);
                WinSetDlgSpinVal(hwnd, SPB_DOWN, val);
                resources_get_int(joy1 ? "JoyAleft" : "JoyBleft", &val);
                WinSetDlgSpinVal(hwnd, SPB_LEFT, val);
                resources_get_int(joy1 ? "JoyAright" : "JoyBright", &val);
                WinSetDlgSpinVal(hwnd, SPB_RIGHT, val);
            }
            return FALSE;
    }
    return WinDefDlgProc (hwnd, msg, mp1, mp2);
}
Exemplo n.º 5
0
static MRESULT EXPENTRY pm_drive(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
{
    static int drive = 0;

    switch (msg) {
        case WM_INITDLG:
            {
                int val, i = 0;
                HWND ihwnd = WinWindowFromID(hwnd, CBS_IMAGE);

                while (i < 10 && ui_status.imageHist[i][0]) {
                    WinLboxInsertItem(ihwnd, ui_status.imageHist[i++]);
                }
                WinLboxInsertItem(ihwnd, "");
                resources_get_int("DriveTrueEmulation", &val);
                WinCheckButton(hwnd, CB_TRUEDRIVE, val);
                WinCheckButton(hwnd, RB_DRIVE8|drive, 1);
                WinSendMsg(hwnd, WM_SWITCH, (void*)drive, 0);
                WinSendMsg(hwnd, WM_DRIVESTATE, (void*)ui_status.lastDriveState, NULL);
                for (i = 0; i < 3; i++) {
                    WinSendMsg(hwnd, WM_TRACK, (void*)i, (void*)(int)(ui_status.lastTrack[i] * 2));
                }
        }
        break;
    case WM_COMMAND:
        switch (LONGFROMMP(mp1)) {
            case PB_CREATE:
                create_dialog(hwnd);
                return FALSE;
            case PB_ATTACH:
                ViceFileDialog(hwnd, 0x0100 | (drive + 1), FDS_OPEN_DIALOG);
                return FALSE;
            case PB_DETACH:
                file_system_detach_disk(drive + 8);
                return FALSE;
            case PB_FLIPADD:
                fliplist_add_image(drive + 8);
                return FALSE;
            case PB_FLIPREMOVE:
                fliplist_remove(drive + 8, NULL);
                return FALSE;
            case PB_FLIP:
                fliplist_attach_head(drive + 8, FLIP_NEXT);
                return FALSE;
        }
        break;
    case WM_CONTROL:
        {
            switch (SHORT1FROMMP(mp1)) {
                case RB_DRIVE8:
                case RB_DRIVE9:
                case RB_DRIVE10:
                case RB_DRIVE11:
                    WinSendMsg(hwnd, WM_SWITCH, (void*)(SHORT1FROMMP(mp1) & 0x3), 0);
                    break;
                case CB_TRUEDRIVE:
                    toggle("DriveTrueEmulation");
                    WinSendMsg(hwnd, WM_SWITCH, (void*)drive, 0);
                    break;
                case CB_CONVERTP00:
                    toggle_drive_res("FSDevice%dConvertP00", drive);//);
                    WinSendMsg(hwnd, WM_SWITCH, (void*)drive, 0);
                    break;
                case CB_SAVEP00:
                    toggle_drive_res("FileDevice%dSaveP00", drive);
                    break;
                case CB_ALLOWACCESS:
                    toggle_drive_res("FileSystemDevice%d", drive);
                    WinSendMsg(hwnd, WM_SWITCH, (void*)drive, 0);
                    break;
                case CB_HIDENONP00:
                    toggle_drive_res("FSDevice%dHideCBMFiles", drive);
                    break;
                case CB_MEM2000:
                    toggle_drive_res("Drive%dRAM2000", drive);
                    break;
                case CB_MEM4000:
                    toggle_drive_res("Drive%dRAM4000", drive);
                    break;
                case CB_MEM6000:
                    toggle_drive_res("Drive%dRAM6000", drive);
                    break;
                case CB_MEM8000:
                    toggle_drive_res("Drive%dRAM8000", drive);
                    break;
                case CB_MEMA000:
                    toggle_drive_res("Drive%dRAMA000", drive);
                    break;
                case CB_READONLY:
                    toggle_drive_res("AttachDevice%dReadonly", drive);
                    break;
                case CB_PARALLEL:
                    if (drive == 0 || drive == 1) {
                        toggle_drive_res("Drive%dParallelCable", drive);
                    }
                    break;
                case RB_NEVER:
                case RB_ASK:
                case RB_ALWAYS:
                    if (drive == 0 || drive == 1) {
                        resources_set_int_sprintf("Drive%dExtendImagePolicy", (SHORT1FROMMP(mp1) & 0x3), drive + 8);
                    }
                    break;
                case RB_NONE:
                case RB_TRAP:
                case RB_SKIP:
                    if (drive == 0 || drive == 1) {
                        resources_set_int_sprintf("Drive%dIdleMethod", (SHORT1FROMMP(mp1) & 0x3), drive + 8);
                    }
                    break;
               case CBS_IMAGE:
                   if (SHORT2FROMMP(mp1) == CBN_ENTER) {
                       char psz[CCHMAXPATH];

                       WinLboxQuerySelectedItemText(hwnd, CBS_IMAGE, psz, CCHMAXPATH);

                       if (!strlen(psz)) {
                           file_system_detach_disk(drive + 8);
                           return FALSE;
                       }

                       if (file_system_attach_disk(drive + 8, psz)) {
                           WinMessageBox(HWND_DESKTOP, hwnd, "Cannot attach specified file.", "VICE/2 Error", 0, MB_OK);
                       }
                   }
                   return FALSE;
                case CBS_PATH:
                    switch (SHORT2FROMMP(mp1)) {
                        case SPBN_CHANGE:
                            {
                                char path[255];

                                WinSendDlgMsg(hwnd, CBS_PATH, SPBM_QUERYVALUE, &path, 255);
                                if (!chdir(path)) {
                                    resources_set_string_sprintf("FSDevice%dDir", path, drive + 8);
                                }
                            }
                            break;
                        case SPBN_KILLFOCUS:
                            {
                                const char *path;

                                resources_get_string_sprintf("FSDevice%dDir", &path, drive + 8);
                                WinSendDlgMsg(hwnd, CBS_PATH, SPBM_SETARRAY, &path, 1);
                                WinSetDlgSpinVal(hwnd, CBS_PATH, 0);
                            }
                            break;
                    }
                    return FALSE;
                case CBS_TYPE:
                    if (SHORT2FROMMP(mp1) == CBN_ENTER && (drive == 0 || drive == 1)) {
                        const int nr  = WinQueryLboxSelectedItem((HWND)mp2);
                        const int val = WinLboxItemHandle((HWND)mp2, nr);

                        resources_set_int_sprintf("Drive%dType", val, drive + 8);
                    }
                    return FALSE;
            }
        }
        break;
    case WM_DRIVEIMAGE:
        {
            HWND ihwnd = WinWindowFromID(hwnd, CBS_IMAGE);
            const char *name = (char *)mp1;

            int pos;
            for (pos = 0; pos < 9; pos++) {
                WinDeleteLboxItem(ihwnd, 0);
            }

            pos = 0;
            while (pos < 10 && ui_status.imageHist[pos][0]) {
                WinLboxInsertItem(ihwnd, ui_status.imageHist[pos++]);
            }

            WinLboxInsertItem(ihwnd, "");

            if (drive == (int)mp2) {
                WinLboxSelectItem(ihwnd, name[0] ? 0 : pos);
            }
        }
        return FALSE;
    case WM_TRACK:
        if (!(ui_status.lastDriveState & (1 << (int)mp1))) {
            break;
        }

        WinSetDlgSpinVal(hwnd, SPB_TRACK8+(int)mp1, (int)((int)mp2 / 2));
        WinShowDlg(hwnd, SS_HALFTRACK8 + (int)mp1, ((int)mp2 % 2));
        break;
    case WM_DRIVELEDS:
        WinShowDlg(hwnd, SS_LED8+(int)mp1, (int)mp2);
        break;
    case WM_DRIVESTATE:
        WinShowDlg(hwnd, SPB_TRACK8, (int)mp1 & 1 == 1);
        WinShowDlg(hwnd, SS_HALFTRACK8, (int)mp1 & 1 == 1);
        WinShowDlg(hwnd, SPB_TRACK9, (int)mp1 & 2 == 1);
        WinShowDlg(hwnd, SS_HALFTRACK9, (int)mp1 & 2 == 1);
        WinShowDlg(hwnd, SS_LED8, 0);
        WinShowDlg(hwnd, SS_LED9, 0);
        break;
    case WM_SWITCH:
        drive = (int)mp1;
            {
                const HWND lbox = WinWindowFromID(hwnd, CBS_TYPE);
                int type = 0;
                int val;
                int res;
                int drive89 = (drive == 0 || drive == 1);

                resources_get_int("DriveTrueEmulation", &val);

                WinLboxEmpty(lbox);

                if (drive89) {
                    int i, nr;

                    WinCheckButton(hwnd, RB_NEVER | get_drive_res("Drive%dExtendImagePolicy", drive), 1);
                    WinCheckButton(hwnd, RB_NONE | get_drive_res("Drive%dIdleMethod", drive), 1);

                    nr = 0;
                    res = get_drive_res("Drive%dType", drive);
                    for (i = 0; i < nDRIVES; i++) {
                        if (!drive_check_type(driveRes[i], drive)) {
                            continue;
                        }

                        WinLboxInsertItem(lbox, driveName[i]);
                        WinLboxSetItemHandle(lbox, nr, driveRes[i]);

                        if (res == driveRes[i]) {
                            type = nr;
                        }

                        nr++;
                    }
                } else {
                    WinCheckButton(hwnd, RB_NEVER, 0);
                    WinCheckButton(hwnd, RB_ASK, 0);
                    WinCheckButton(hwnd, RB_ALWAYS, 0);
                    WinCheckButton(hwnd, RB_NONE, 0);
                    WinCheckButton(hwnd, RB_SKIP, 0);
                    WinCheckButton(hwnd, RB_TRAP, 0);
                }
                WinLboxSelectItem(lbox, type);

                WinCheckButton(hwnd, CB_PARALLEL, drive89 && get_drive_res("Drive%dParallelCable", drive) != 0);
                WinCheckButton(hwnd, CB_MEM2000, drive89 && get_drive_res("Drive%dRAM2000", drive) != 0);
                WinCheckButton(hwnd, CB_MEM4000, drive89 && get_drive_res("Drive%dRAM4000", drive) != 0);
                WinCheckButton(hwnd, CB_MEM6000, drive89 && get_drive_res("Drive%dRAM6000", drive) != 0);
                WinCheckButton(hwnd, CB_MEM8000, drive89 && get_drive_res("Drive%dRAM8000", drive) != 0);
                WinCheckButton(hwnd, CB_MEMA000, drive89 && get_drive_res("Drive%dRAMA000", drive) != 0);
                WinEnableControl(hwnd, CB_PARALLEL, drive89 && val);
                WinEnableControl(hwnd, RB_NEVER, drive89 && val);
                WinEnableControl(hwnd, RB_ASK, drive89 && val);
                WinEnableControl(hwnd, RB_ALWAYS, drive89 && val);
                WinEnableControl(hwnd, RB_NONE, drive89 && val);
                WinEnableControl(hwnd, RB_SKIP, drive89 && val);
                WinEnableControl(hwnd, RB_TRAP, drive89 && val);
                WinEnableControl(hwnd, CBS_TYPE, drive89 && val);
                WinEnableControl(hwnd, CB_MEM2000, drive89 && val);
                WinEnableControl(hwnd, CB_MEM4000, drive89 && val);
                WinEnableControl(hwnd, CB_MEM6000, drive89 && val);
                WinEnableControl(hwnd, CB_MEM8000, drive89 && val);
                WinEnableControl(hwnd, CB_MEMA000, drive89 && val);
                {
                    int acc  = get_drive_res("FileSystemDevice%d", drive) != 0;
                    int conv = get_drive_res("FSDevice%dConvertP00", drive) != 0;

                    if (!conv) {
                        resources_set_int_sprintf("FSDevice%dHideCBMFiles", 0, drive + 8);
                    }

                    WinCheckButton(hwnd, CB_ALLOWACCESS, acc);
                    WinCheckButton(hwnd, CB_CONVERTP00, conv);
                    WinCheckButton(hwnd, CB_SAVEP00, get_drive_res("FSDevice%dSaveP00", drive) != 0);
                    WinCheckButton(hwnd, CB_HIDENONP00, get_drive_res("FSDevice%dHideCBMFiles", drive) != 0);
                    WinEnableControl(hwnd, CB_ALLOWACCESS, !(drive89 && val));
                    WinEnableControl(hwnd, CB_SAVEP00, !(drive89 && val) && acc);
                    WinEnableControl(hwnd, CB_CONVERTP00, !(drive89 && val) && acc);
                    WinEnableControl(hwnd, CBS_PATH, !(drive89 && val) && acc);
                    WinEnableControl(hwnd, CB_HIDENONP00, !(drive89 && val) && acc && conv);

                    WinCheckButton(hwnd, CB_READONLY, get_drive_res("AttachDevice%dReadonly", drive) != 0);
                }
                {
                    char tmp[CCHMAXPATH];
                    int max = WinDlgLboxQueryCount(hwnd, CBS_IMAGE);
                    int pos = -1;

                    do {
                        WinLboxQueryItem(hwnd, CBS_IMAGE, ++pos, tmp, CCHMAXPATH);
                    }
                    while (pos < max && strcmp(ui_status.lastImage[drive], tmp));
                    WinDlgLboxSelectItem(hwnd, CBS_IMAGE, pos);
                }
                {
                    const char *path;
                    resources_get_string_sprintf("FSDevice%dDir", &path, drive + 8);
                    WinSendDlgMsg(hwnd, CBS_PATH, SPBM_SETARRAY, &path, 1);
                    WinSetDlgSpinVal(hwnd, CBS_PATH, 0);
                }
            }
            return FALSE;

    }
    return WinDefDlgProc (hwnd, msg, mp1, mp2);
}