ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp (file contents):
Revision 1.10 by cebix, 2000-07-22T16:20:54Z vs.
Revision 1.11 by jlachmann, 2000-08-20T14:08:42Z

# Line 1 | Line 1
1   /*
2   *  prefs_editor_amiga.cpp - Preferences editor, AmigaOS implementation (using gtlayout.library)
3   *
4 < *  Basilisk II (C) 1997-2000 Christian Bauer
4 > *  Basilisk II (C) 1997-1999 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 27 | Line 27
27   #include <libraries/asl.h>
28   #include <libraries/gtlayout.h>
29   #include <libraries/Picasso96.h>
30 < #include <cybergraphics/cybergraphics.h>
30 > #include <cybergraphx/cybergraphics.h>  // jl
31   #include <graphics/displayinfo.h>
32   #include <devices/ahi.h>
33   #include <proto/exec.h>
# Line 38 | Line 38
38   #include <proto/graphics.h>
39   #include <proto/asl.h>
40   #include <proto/Picasso96.h>
41 < #include <proto/cybergraphics.h>
41 > #include <proto/cybergraphics.h>        // jl
42   #include <proto/ahi.h>
43  
44   #include "sysdeps.h"
# Line 428 | Line 428 | bool PrefsEditor(void)
428                                                  case GAD_SCSI6_DEVICE:
429                                                  case GAD_SERIALA_DEVICE:
430                                                  case GAD_SERIALB_DEVICE:
431 +                                                        if (dev_request) {
432 +                                                                LT_LockWindow(win);
433 +                                                                BOOL result = AslRequestTags(dev_request,
434 +                                                                        ASLFR_Window, (ULONG)win,
435 +                                                                        ASLFR_InitialDrawer, (ULONG) "Devs:",
436 +                                                                        TAG_END);
437 +                                                                LT_UnlockWindow(win);
438 +                                                                if (result) {
439 +                                                                        char *str;
440 +                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END);
441 +                                                                        strncpy(str, dev_request->rf_File, 255);        // Don't copy the directory part. This is usually "DEVS:" and we don't need that.
442 +                                                                        str[255] = 0;
443 +                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END);
444 +                                                                }
445 +                                                        }
446 +                                                        break;
447 +
448                                                  case GAD_ETHER_DEVICE:
449                                                          if (dev_request) {
450                                                                  LT_LockWindow(win);
451 <                                                                BOOL result = AslRequestTags(dev_request, ASLFR_Window, (ULONG)win, TAG_END);
451 >                                                                BOOL result = AslRequestTags(dev_request,
452 >                                                                        ASLFR_Window, (ULONG)win,
453 >                                                                        ASLFR_InitialDrawer, (ULONG) "Devs:Networks",
454 >                                                                        TAG_END);
455                                                                  LT_UnlockWindow(win);
456                                                                  if (result) {
457                                                                          char *str;
# Line 513 | Line 533 | quit:
533          FreeAslRequest(dev_request);
534          FreeAslRequest(file_request);
535  
536 <        // Delete menus
536 >        // Delete Menus jl
537          LT_DisposeMenu(menu);
538  
539          // Delete handle
# Line 1251 | Line 1271 | static void screen_mode_req(struct Windo
1271  
1272          ULONG id;
1273  
1274 <        if (P96Base) {
1274 >        if (CyberGfxBase)
1275 >                {
1276 >                UWORD ModelArray[] = { PIXFMT_LUT8, PIXFMT_RGB15, PIXFMT_ARGB32, 0, ~0 };
1277 >
1278 >                id = (ULONG) CModeRequestTags(NULL,
1279 >                        CYBRMREQ_MinDepth, 8,
1280 >                        CYBRMREQ_CModelArray, (ULONG) ModelArray,
1281 >                        TAG_END
1282 >                        );
1283 >                }
1284 >        else
1285 >                {
1286                  id = p96RequestModeIDTags(
1287                          P96MA_MinDepth, 8,
1288                          P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1289                          TAG_END
1290                  );
1291 <        } else {
1261 <                UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0};
1262 <                id = (ULONG) CModeRequestTags(NULL,
1263 <                        CYBRMREQ_MinDepth, 8,
1264 <                        CYBRMREQ_CModelArray, (ULONG)model_array,
1265 <                        TAG_END
1266 <                );
1267 <        }
1291 >                }
1292          LT_UnlockWindow(win);
1293  
1294          if (id != INVALID_ID) {
# Line 1446 | Line 1470 | static void parse_serial_prefs(void)
1470  
1471          const char *str = PrefsFindString("ether");
1472          if (str)
1473 <                sscanf(str, "%[^/]/%ld", ether_dev, &ether_unit);
1473 >                {
1474 >                const char *FirstSlash = strchr(str, '/');
1475 >                const char *LastSlash = strrchr(str, '/');
1476 >
1477 >                if (FirstSlash && FirstSlash && FirstSlash != LastSlash)
1478 >                        {
1479 >                        // Device name contains path, i.e. "Networks/xyzzy.device"
1480 >                        const char *lp = str;
1481 >                        char *dp = ether_dev;
1482 >
1483 >                        while (lp != LastSlash)
1484 >                                *dp++ = *lp++;
1485 >                        *dp = '\0';
1486 >
1487 >                        sscanf(LastSlash, "/%ld", &ether_unit);
1488 >
1489 > //                      printf("dev=<%s> unit=%d\n", ether_dev, ether_unit);
1490 >                        }
1491 >                else
1492 >                        {
1493 >                        sscanf(str, "%[^/]/%ld", ether_dev, &ether_unit);
1494 >                        }
1495 >                }
1496   }
1497  
1498   // Set serial preference item
# Line 1468 | Line 1514 | static void read_serial_settings(void)
1514  
1515          if (strlen(ether_dev)) {
1516                  char str[256];
1517 +
1518                  sprintf(str, "%s/%ld", ether_dev, ether_unit);
1519                  PrefsReplaceString("ether", str);
1520          } else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines