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.13 by cebix, 2000-10-16T17:37:58Z vs.
Revision 1.19 by gbeauche, 2008-01-01T09:40:31Z

# 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-2008 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 30 | Line 30
30   #include <cybergraphics/cybergraphics.h>
31   #include <graphics/displayinfo.h>
32   #include <devices/ahi.h>
33 + #define __USE_SYSBASE
34   #include <proto/exec.h>
35   #include <proto/dos.h>
36   #include <proto/intuition.h>
# Line 40 | Line 41
41   #include <proto/Picasso96.h>
42   #include <proto/cybergraphics.h>
43   #include <proto/ahi.h>
44 + #include <inline/exec.h>
45 + #include <inline/dos.h>
46 + #include <inline/intuition.h>
47 + #include <inline/gadtools.h>
48 + #include <inline/gtlayout.h>
49 + #include <inline/graphics.h>
50 + #include <inline/asl.h>
51 + #include <inline/Picasso96.h>
52 + #include <inline/cybergraphics.h>
53 + #include <inline/cybergraphics.h>
54 + #include <inline/ahi.h>
55 + #include <clib/alib_protos.h>
56  
57   #include "sysdeps.h"
58   #include "main.h"
# Line 94 | Line 107 | const int GAD_SCSI3_UNIT = 0x0413;
107   const int GAD_SCSI4_UNIT = 0x0414;
108   const int GAD_SCSI5_UNIT = 0x0415;
109   const int GAD_SCSI6_UNIT = 0x0416;
110 + const int GAD_SCSI_MEMTYPE = 0x0420;
111  
112   const int GAD_VIDEO_TYPE = 0x0500;                      // "Graphics/Sound" pane
113   const int GAD_DISPLAY_X = 0x0501;
# Line 176 | Line 190 | bool PrefsEditor(void)
190          };
191  
192          // Open gtlayout.library
193 <        GTLayoutBase = (struct Library *)OpenLibrary((UBYTE *)"gtlayout.library", 39);
193 >        GTLayoutBase = (struct Library *)OpenLibrary("gtlayout.library", 39);
194          if (GTLayoutBase == NULL) {
195                  WarningAlert(GetString(STR_NO_GTLAYOUT_LIB_WARN));
196                  return true;
# Line 354 | Line 368 | bool PrefsEditor(void)
368                                                  case GAD_BOOTDRIVER:
369                                                          switch (code) {
370                                                                  case 0:
371 <                                                                        PrefsReplaceInt16("bootdriver", 0);
371 >                                                                        PrefsReplaceInt32("bootdriver", 0);
372                                                                          break;
373                                                                  case 1:
374 <                                                                        PrefsReplaceInt16("bootdriver", CDROMRefNum);
374 >                                                                        PrefsReplaceInt32("bootdriver", CDROMRefNum);
375                                                                          break;
376                                                          }
377                                                          break;
378  
379 +                                                case GAD_SCSI_MEMTYPE:
380 +                                                        PrefsReplaceInt32("scsimemtype", code);
381 +                                                        break;
382 +
383                                                  case GAD_VIDEO_TYPE:
384                                                          ghost_graphics_gadgets(h);
385                                                          break;
# Line 574 | Line 592 | static void parse_volumes_prefs(void)
592  
593          bootdriver_num = 0;
594  
595 <        int bootdriver = PrefsFindInt16("bootdriver");
595 >        int bootdriver = PrefsFindInt32("bootdriver");
596          switch (bootdriver) {
597                  case 0:
598                          bootdriver_num = 0;
# Line 1087 | Line 1105 | static void create_volumes_pane(struct L
1105  
1106   static char scsi_dev[6][256];
1107   static LONG scsi_unit[6];
1108 + static LONG scsi_memtype;
1109  
1110   // Read SCSI preferences
1111   static void parse_scsi_prefs(void)
# Line 1101 | Line 1120 | static void parse_scsi_prefs(void)
1120                  if (str)
1121                          sscanf(str, "%[^/]/%ld", scsi_dev[i], &scsi_unit[i]);
1122          }
1123 +
1124 +        scsi_memtype = PrefsFindInt32("scsimemtype");
1125   }
1126  
1127   // Read settings from gadgets and set preferences
# Line 1125 | Line 1146 | static void create_scsi_pane(struct Layo
1146          parse_scsi_prefs();
1147  
1148          VGROUP;
1149 <                for (int i=0; i<7; i++) {
1150 <                        HGROUP;
1151 <                                LT_New(h, LA_Type, TEXT_KIND,
1152 <                                        LA_LabelID, STR_SCSI_ID_0 + i,
1153 <                                        TAG_END
1154 <                                );
1155 <                                LT_New(h, LA_Type, STRING_KIND,
1156 <                                        LA_LabelID, STR_DEVICE_CTRL,
1157 <                                        LA_ID, GAD_SCSI0_DEVICE + i,
1158 <                                        LA_Chars, 20,
1159 <                                        LA_STRPTR, (ULONG)scsi_dev[i],
1160 <                                        GTST_MaxChars, sizeof(scsi_dev[i]) - 1,
1161 <                                        LAST_Picker, TRUE,
1162 <                                        TAG_END
1163 <                                );
1164 <                                LT_New(h, LA_Type, INTEGER_KIND,
1165 <                                        LA_LabelID, STR_UNIT_CTRL,
1166 <                                        LA_ID, GAD_SCSI0_UNIT + i,
1167 <                                        LA_Chars, 4,
1168 <                                        LA_LONG, (ULONG)&scsi_unit[i],
1169 <                                        LAIN_UseIncrementers, TRUE,
1170 <                                        GTIN_MaxChars, 8,
1171 <                                        TAG_END
1172 <                                );
1173 <                        ENDGROUP;
1174 <                }
1149 >                LT_New(h, LA_Type, VERTICAL_KIND,
1150 >                        LA_LabelID, STR_SCSI_DEVICES_CTRL,
1151 >                        TAG_END
1152 >                );
1153 >                        for (int i=0; i<7; i++) {
1154 >                                HGROUP;
1155 >                                        LT_New(h, LA_Type, TEXT_KIND,
1156 >                                                LA_LabelID, STR_SCSI_ID_0 + i,
1157 >                                                TAG_END
1158 >                                        );
1159 >                                        LT_New(h, LA_Type, STRING_KIND,
1160 >                                                LA_LabelID, STR_DEVICE_CTRL,
1161 >                                                LA_ID, GAD_SCSI0_DEVICE + i,
1162 >                                                LA_Chars, 20,
1163 >                                                LA_STRPTR, (ULONG)scsi_dev[i],
1164 >                                                GTST_MaxChars, sizeof(scsi_dev[i]) - 1,
1165 >                                                LAST_Picker, TRUE,
1166 >                                                TAG_END
1167 >                                        );
1168 >                                        LT_New(h, LA_Type, INTEGER_KIND,
1169 >                                                LA_LabelID, STR_UNIT_CTRL,
1170 >                                                LA_ID, GAD_SCSI0_UNIT + i,
1171 >                                                LA_Chars, 4,
1172 >                                                LA_LONG, (ULONG)&scsi_unit[i],
1173 >                                                LAIN_UseIncrementers, TRUE,
1174 >                                                GTIN_MaxChars, 8,
1175 >                                                TAG_END
1176 >                                        );
1177 >                                ENDGROUP;
1178 >                        }
1179 >                ENDGROUP;
1180 >                VGROUP;
1181 >                        LT_New(h, LA_Type, CYCLE_KIND,
1182 >                                LA_LabelID, STR_SCSI_MEMTYPE_CTRL,
1183 >                                LA_ID, GAD_SCSI_MEMTYPE,
1184 >                                LACY_FirstLabel, STR_MEMTYPE_CHIP_LAB,
1185 >                                LACY_LastLabel, STR_MEMTYPE_ANY_LAB,
1186 >                                LA_LONG, (ULONG)&scsi_memtype,
1187 >                                TAG_END
1188 >                        );
1189 >                ENDGROUP;
1190          ENDGROUP;
1191   }
1192  
# Line 1166 | Line 1202 | enum {
1202          DISPLAY_SCREEN
1203   };
1204  
1205 < static BYTE display_type;
1205 > static LONG display_type;
1206   static LONG dis_width, dis_height;
1207   static ULONG mode_id;
1208   static BYTE frameskip_num;
# Line 1210 | Line 1246 | static void parse_graphics_prefs(void)
1246  
1247          const char *str = PrefsFindString("screen");
1248          if (str) {
1249 <                if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2)
1249 >                if (sscanf(str, "win/%ld/%ld", &dis_width, &dis_height) == 2)
1250                          display_type = DISPLAY_WINDOW;
1251 <                else if (sscanf(str, "pip/%d/%d", &dis_width, &dis_height) == 2)
1251 >                else if (sscanf(str, "pip/%ld/%ld", &dis_width, &dis_height) == 2)
1252                          display_type = DISPLAY_PIP;
1253                  else if (sscanf(str, "scr/%08lx", &mode_id) == 1)
1254                          display_type = DISPLAY_SCREEN;
# Line 1368 | Line 1404 | static void create_graphics_pane(struct
1404                                  LA_LabelID, STR_VIDEO_TYPE_CTRL,
1405                                  LA_ID, GAD_VIDEO_TYPE,
1406                                  LACY_LabelTable, (ULONG)labels,
1407 <                                LA_BYTE, (ULONG)&display_type,
1407 >                                LA_LONG, (ULONG)&display_type,
1408                                  TAG_END
1409                          );
1410                          LT_New(h, LA_Type, INTEGER_KIND,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines