--- BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 2000/07/14 21:29:11 1.9 +++ BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 2000/09/04 16:30:47 1.12 @@ -1,7 +1,7 @@ /* * prefs_editor_amiga.cpp - Preferences editor, AmigaOS implementation (using gtlayout.library) * - * Basilisk II (C) 1997-2000 Christian Bauer + * Basilisk II (C) 1997-1999 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -428,10 +428,30 @@ bool PrefsEditor(void) case GAD_SCSI6_DEVICE: case GAD_SERIALA_DEVICE: case GAD_SERIALB_DEVICE: + if (dev_request) { + LT_LockWindow(win); + BOOL result = AslRequestTags(dev_request, + ASLFR_Window, (ULONG)win, + ASLFR_InitialDrawer, (ULONG) "Devs:", + TAG_END); + LT_UnlockWindow(win); + if (result) { + char *str; + GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); + strncpy(str, dev_request->rf_File, 255); // Don't copy the directory part. This is usually "DEVS:" and we don't need that. + str[255] = 0; + LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); + } + } + break; + case GAD_ETHER_DEVICE: if (dev_request) { LT_LockWindow(win); - BOOL result = AslRequestTags(dev_request, ASLFR_Window, (ULONG)win, TAG_END); + BOOL result = AslRequestTags(dev_request, + ASLFR_Window, (ULONG)win, + ASLFR_InitialDrawer, (ULONG) "Devs:Networks", + TAG_END); LT_UnlockWindow(win); if (result) { char *str; @@ -513,7 +533,7 @@ quit: FreeAslRequest(dev_request); FreeAslRequest(file_request); - // Delete menus + // Delete Menus LT_DisposeMenu(menu); // Delete handle @@ -1251,6 +1271,7 @@ static void screen_mode_req(struct Windo ULONG id; + // Try P96 first, because it also provides a (fake) cybergraphics.library if (P96Base) { id = p96RequestModeIDTags( P96MA_MinDepth, 8, @@ -1258,10 +1279,10 @@ static void screen_mode_req(struct Windo TAG_END ); } else { - UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0}; + UWORD ModelArray[] = { PIXFMT_LUT8, PIXFMT_RGB15, PIXFMT_ARGB32, 0, ~0 }; id = (ULONG) CModeRequestTags(NULL, CYBRMREQ_MinDepth, 8, - CYBRMREQ_CModelArray, (ULONG)model_array, + CYBRMREQ_CModelArray, (ULONG) ModelArray, TAG_END ); } @@ -1445,8 +1466,26 @@ static void parse_serial_prefs(void) ether_unit = 0; const char *str = PrefsFindString("ether"); - if (str) - sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); + if (str) { + const char *FirstSlash = strchr(str, '/'); + const char *LastSlash = strrchr(str, '/'); + + if (FirstSlash && FirstSlash && FirstSlash != LastSlash) { + // Device name contains path, i.e. "Networks/xyzzy.device" + const char *lp = str; + char *dp = ether_dev; + + while (lp != LastSlash) + *dp++ = *lp++; + *dp = '\0'; + + sscanf(LastSlash, "/%ld", ðer_unit); + +// printf("dev=<%s> unit=%d\n", ether_dev, ether_unit); + } else { + sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); + } + } } // Set serial preference item @@ -1468,6 +1507,7 @@ static void read_serial_settings(void) if (strlen(ether_dev)) { char str[256]; + sprintf(str, "%s/%ld", ether_dev, ether_unit); PrefsReplaceString("ether", str); } else