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.3 by cebix, 1999-10-21T22:39:57Z vs.
Revision 1.8 by cebix, 2000-07-13T17:45:32Z

# Line 1 | Line 1
1   /*
2   *  prefs_editor_amiga.cpp - Preferences editor, AmigaOS implementation (using gtlayout.library)
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2000 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 <cybergraphx/cybergraphics.h>
31   #include <graphics/displayinfo.h>
32   #include <devices/ahi.h>
33   #include <proto/exec.h>
# Line 37 | Line 38
38   #include <proto/graphics.h>
39   #include <proto/asl.h>
40   #include <proto/Picasso96.h>
41 + #include <proto/cybergraphics.h>
42   #include <proto/ahi.h>
43  
44   #include "sysdeps.h"
# Line 65 | Line 67 | const int GAD_CDROM_DEVICE = 0x0304;
67   const int GAD_CDROM_UNIT = 0x0305;
68   const int GAD_BOOTDRIVER = 0x0306;
69   const int GAD_NOCDROM = 0x0307;
70 + const int GAD_EXTFS = 0x0308;
71  
72   const int GAD_VOLUME_READONLY = 0x0310;         // "Add/Edit Volume" window
73   const int GAD_VOLUME_TYPE = 0x0311;
# Line 142 | Line 145 | static void read_settings(struct LayoutH
145   *  Locale hook - returns string for given ID
146   */
147  
145 #ifdef __GNUC__
148   static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/)
147 #else
148 static __saveds __regargs const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/)
149 #endif
149   {
150          return GetString((uint32)id);
151   }
# Line 528 | Line 527 | quit:
527   */
528  
529   static struct List disk_list;
530 < static char cdrom_name[256];
530 > static char cdrom_name[256], extfs_name[256];
531   static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize;
532   static BYTE bootdriver_num, nocdrom;
533  
# Line 563 | Line 562 | static void parse_volumes_prefs(void)
562          }
563  
564          nocdrom = PrefsFindBool("nocdrom");
565 +
566 +        extfs_name[0] = 0;
567 +        str = PrefsFindString("extfs");
568 +        if (str)
569 +                strncpy(extfs_name, str, sizeof(extfs_name) - 1);
570   }
571  
572   // Ghost/unghost "Edit" and "Remove" buttons
# Line 954 | Line 958 | static void read_volumes_settings(void)
958                  PrefsRemoveItem("cdrom");
959  
960          PrefsReplaceBool("nocdrom", nocdrom);
961 +
962 +        if (strlen(extfs_name))
963 +                PrefsReplaceString("extfs", extfs_name);
964   }
965  
966   // Create "Volumes" pane
# Line 969 | Line 976 | static void create_volumes_pane(struct L
976                          VGROUP;
977                                  LT_New(h, LA_Type, LISTVIEW_KIND,
978                                          LA_ID, GAD_DISK_LIST,
979 +                                        LA_Chars, 20,
980                                          GTLV_Labels, (ULONG)&disk_list,
981                                          LALV_Lines, 6,
982                                          LALV_Link, (ULONG)NIL_LINK,
# Line 1036 | Line 1044 | static void create_volumes_pane(struct L
1044                                  TAG_END
1045                          );
1046                  ENDGROUP;
1047 +                VGROUP;
1048 +                        LT_New(h, LA_Type, STRING_KIND,
1049 +                                LA_LabelID, STR_EXTFS_CTRL,
1050 +                                LA_ID, GAD_EXTFS,
1051 +                                LA_Chars, 20,
1052 +                                LA_STRPTR, (ULONG)extfs_name,
1053 +                                GTST_MaxChars, sizeof(extfs_name) - 1,
1054 +                                TAG_END
1055 +                        );
1056 +                ENDGROUP;
1057          ENDGROUP;
1058   }
1059  
# Line 1071 | Line 1089 | static void read_scsi_settings(void)
1089  
1090                  if (strlen(scsi_dev[i])) {
1091                          char str[256];
1092 <                        sprintf("%s/%ld", scsi_dev[i], scsi_unit[i]);
1092 >                        sprintf(str, "%s/%ld", scsi_dev[i], scsi_unit[i]);
1093                          PrefsReplaceString(prefs_name, str);
1094                  } else
1095                          PrefsRemoveItem(prefs_name);
# Line 1223 | Line 1241 | static void ghost_graphics_gadgets(struc
1241   // Show screen mode requester
1242   static void screen_mode_req(struct Window *win, struct LayoutHandle *h)
1243   {
1244 <        if (P96Base == NULL)
1244 >        if (P96Base == NULL && CyberGfxBase == NULL)
1245                  return;
1246  
1247          LT_LockWindow(win);
1248 <        ULONG id = p96RequestModeIDTags(
1249 <                P96MA_MinDepth, 8,
1250 <                P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1251 <                TAG_END
1252 <        );
1248 >
1249 >        ULONG id;
1250 >
1251 >        if (P96Base) {
1252 >                id = p96RequestModeIDTags(
1253 >                        P96MA_MinDepth, 8,
1254 >                        P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1255 >                        TAG_END
1256 >                );
1257 >        } else {
1258 >                UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0};
1259 >                id = (ULONG) CModeRequestTags(NULL,
1260 >                        CYBRMREQ_MinDepth, 8,
1261 >                        CYBRMREQ_CModelArray, (ULONG)model_array,
1262 >                        TAG_END
1263 >                );
1264 >        }
1265          LT_UnlockWindow(win);
1266  
1267          if (id != INVALID_ID) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines