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.1 by cebix, 1999-10-03T14:16:25Z vs.
Revision 1.9 by cebix, 2000-07-14T21:29:11Z

# 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 139 | Line 142 | static void read_settings(struct LayoutH
142  
143  
144   /*
145 < *  Locale hook function - returns string for given ID
145 > *  Locale hook - returns string for given ID
146   */
147  
148 < static __saveds __asm char *locale_hook_func(register __a0 struct Hook *hook, register __a2 struct LayoutHandle *h, register __a1 LONG id)
148 > static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/)
149   {
150 <        return GetString(id);
150 >        return GetString((uint32)id);
151   }
152  
153   struct Hook locale_hook = {{NULL, NULL}, (HOOKFUNC)locale_hook_func, NULL, NULL};
# Line 162 | Line 165 | bool PrefsEditor(void)
165          struct Window *win = NULL;
166          struct Menu *menu = NULL;
167  
168 +        // Pane tabs
169 +        static const LONG labels[] = {
170 +                STR_VOLUMES_PANE_TITLE,
171 +                STR_SCSI_PANE_TITLE,
172 +                STR_GRAPHICS_SOUND_PANE_TITLE,
173 +                STR_SERIAL_NETWORK_PANE_TITLE,
174 +                STR_MEMORY_MISC_PANE_TITLE,
175 +                -1
176 +        };
177 +
178          // Open gtlayout.library
179          GTLayoutBase = (struct Library *)OpenLibrary((UBYTE *)"gtlayout.library", 39);
180          if (GTLayoutBase == NULL) {
181                  WarningAlert(GetString(STR_NO_GTLAYOUT_LIB_WARN));
182 <                goto quit;
182 >                return true;
183          }
184  
185          // Create layout handle
186          h = LT_CreateHandleTags(NULL,
187                  LAHN_AutoActivate, FALSE,
188 <                LAHN_LocaleHook, &locale_hook,
188 >                LAHN_LocaleHook, (ULONG)&locale_hook,
189                  TAG_END
190          );
191          if (h == NULL)
# Line 180 | Line 193 | bool PrefsEditor(void)
193  
194          // Create menus
195          menu = LT_NewMenuTags(
196 <                LAMN_LayoutHandle, h,
196 >                LAMN_LayoutHandle, (ULONG)h,
197                  LAMN_TitleID, STR_PREFS_MENU,
198                  LAMN_ItemID, STR_PREFS_ITEM_ABOUT,
199                  LAMN_UserData, MSG_ABOUT,
200 <                LAMN_ItemText, NM_BARLABEL,
200 >                LAMN_ItemText, (ULONG)NM_BARLABEL,
201                  LAMN_ItemID, STR_PREFS_ITEM_START,
202                  LAMN_UserData, MSG_OK,
203                  LAMN_ItemID, STR_PREFS_ITEM_ZAP_PRAM,
204                  LAMN_UserData, MSG_ZAP_PRAM,
205 <                LAMN_ItemText, NM_BARLABEL,
205 >                LAMN_ItemText, (ULONG)NM_BARLABEL,
206                  LAMN_ItemID, STR_PREFS_ITEM_QUIT,
207                  LAMN_UserData, MSG_CANCEL,
208 <                LAMN_KeyText, "Q",
208 >                LAMN_KeyText, (ULONG)"Q",
209                  TAG_END
210          );
211  
212          // Create window contents
213          VGROUP;
201                // Pane tabs
202                static const LONG labels[] = {
203                        STR_VOLUMES_PANE_TITLE,
204                        STR_SCSI_PANE_TITLE,
205                        STR_GRAPHICS_SOUND_PANE_TITLE,
206                        STR_SERIAL_NETWORK_PANE_TITLE,
207                        STR_MEMORY_MISC_PANE_TITLE,
208                        -1
209                };
214                  VGROUP;
215                          LT_New(h, LA_Type, TAB_KIND,
216 <                                LATB_LabelTable, labels,
216 >                                LATB_LabelTable, (ULONG)labels,
217                                  LATB_AutoPageID, GAD_PAGEGROUP,
218                                  LATB_FullWidth, TRUE,
219                                  TAG_END
# Line 261 | Line 265 | bool PrefsEditor(void)
265          // Open window
266          win = LT_Build(h,
267                  LAWN_TitleID, STR_PREFS_TITLE,
268 <                LAWN_Menu, menu,
268 >                LAWN_Menu, (ULONG)menu,
269                  LAWN_IDCMP, IDCMP_CLOSEWINDOW,
270                  LAWN_BelowMouse, TRUE,
271                  LAWN_SmartZoom, TRUE,
# Line 279 | Line 283 | bool PrefsEditor(void)
283          dev_request = (struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
284                  ASLFR_DoPatterns, TRUE,
285                  ASLFR_RejectIcons, TRUE,
286 <                ASLFR_InitialDrawer, "DEVS:",
287 <                ASLFR_InitialPattern, "#?.device",
286 >                ASLFR_InitialDrawer, (ULONG)"DEVS:",
287 >                ASLFR_InitialPattern, (ULONG)"#?.device",
288                  TAG_END
289          );
290          file_request = (struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
291                  ASLFR_DoPatterns, TRUE,
292                  ASLFR_RejectIcons, TRUE,
293 <                ASLFR_InitialPattern, "#?",
293 >                ASLFR_InitialPattern, (ULONG)"#?",
294                  TAG_END
295          );
296  
# Line 427 | Line 431 | bool PrefsEditor(void)
431                                                  case GAD_ETHER_DEVICE:
432                                                          if (dev_request) {
433                                                                  LT_LockWindow(win);
434 <                                                                BOOL result = AslRequestTags(dev_request, ASLFR_Window, win, TAG_END);
434 >                                                                BOOL result = AslRequestTags(dev_request, ASLFR_Window, (ULONG)win, TAG_END);
435                                                                  LT_UnlockWindow(win);
436                                                                  if (result) {
437                                                                          char *str;
438 <                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END);
438 >                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END);
439                                                                          strncpy(str, dev_request->rf_File, 255);        // Don't copy the directory part. This is usually "DEVS:" and we don't need that.
440                                                                          str[255] = 0;
441 <                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END);
441 >                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END);
442                                                                  }
443                                                          }
444                                                          break;
# Line 442 | Line 446 | bool PrefsEditor(void)
446                                                  case GAD_ROM_FILE:
447                                                          if (file_request) {
448                                                                  LT_LockWindow(win);
449 <                                                                BOOL result = AslRequestTags(file_request, ASLFR_Window, win, TAG_END);
449 >                                                                BOOL result = AslRequestTags(file_request, ASLFR_Window, (ULONG)win, TAG_END);
450                                                                  LT_UnlockWindow(win);
451                                                                  if (result) {
452                                                                          char *str;
453 <                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END);
453 >                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END);
454                                                                          strncpy(str, file_request->rf_Dir, 255);
455                                                                          str[255] = 0;
456                                                                          AddPart(str, file_request->rf_File, 255);
457 <                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END);
457 >                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END);
458                                                                  }
459                                                          }
460                                                          break;
# Line 509 | Line 513 | quit:
513          FreeAslRequest(dev_request);
514          FreeAslRequest(file_request);
515  
516 +        // Delete menus
517 +        LT_DisposeMenu(menu);
518 +
519          // Delete handle
520          LT_DeleteHandle(h);
521  
# Line 523 | Line 530 | quit:
530   */
531  
532   static struct List disk_list;
533 < static char cdrom_name[256];
533 > static char cdrom_name[256], extfs_name[256];
534   static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize;
535   static BYTE bootdriver_num, nocdrom;
536  
# Line 558 | Line 565 | static void parse_volumes_prefs(void)
565          }
566  
567          nocdrom = PrefsFindBool("nocdrom");
568 +
569 +        extfs_name[0] = 0;
570 +        str = PrefsFindString("extfs");
571 +        if (str)
572 +                strncpy(extfs_name, str, sizeof(extfs_name) - 1);
573   }
574  
575   // Ghost/unghost "Edit" and "Remove" buttons
# Line 644 | Line 656 | static void add_edit_volume(struct Layou
656          struct Window *win = NULL;
657          h = LT_CreateHandleTags(NULL,
658                  LAHN_AutoActivate, FALSE,
659 <                LAHN_LocaleHook, &locale_hook,
659 >                LAHN_LocaleHook, (ULONG)&locale_hook,
660                  TAG_END
661          );
662          if (h == NULL)
# Line 657 | Line 669 | static void add_edit_volume(struct Layou
669                          LT_New(h, LA_Type, CHECKBOX_KIND,
670                                  LA_LabelID, STR_VOL_READONLY_CTRL,
671                                  LA_ID, GAD_VOLUME_READONLY,
672 <                                LA_BYTE, &read_only,
672 >                                LA_BYTE, (ULONG)&read_only,
673                                  TAG_END
674                          );
675                          LT_New(h, LA_Type, CYCLE_KIND,
# Line 666 | Line 678 | static void add_edit_volume(struct Layou
678                                  LACY_AutoPageID, GAD_VOLUME_PAGEGROUP,
679                                  LACY_FirstLabel, STR_VOL_FILE_LAB,
680                                  LACY_LastLabel, STR_VOL_DEVICE_LAB,
681 <                                LA_BYTE, &is_device,
681 >                                LA_BYTE, (ULONG)&is_device,
682                                  TAG_END
683                          );
684                  ENDGROUP;
# Line 680 | Line 692 | static void add_edit_volume(struct Layou
692                                          LA_LabelID, STR_VOL_FILE_CTRL,
693                                          LA_ID, GAD_VOLUME_FILE,
694                                          LA_Chars, 20,
695 <                                        LA_STRPTR, file_name,
695 >                                        LA_STRPTR, (ULONG)file_name,
696                                          GTST_MaxChars, sizeof(file_name) - 1,
697                                          LAST_Picker, TRUE,
698                                          TAG_END
# Line 691 | Line 703 | static void add_edit_volume(struct Layou
703                                          LA_LabelID, STR_DEVICE_CTRL,
704                                          LA_ID, GAD_VOLUME_DEVICE,
705                                          LA_Chars, 20,
706 <                                        LA_STRPTR, dev_name,
706 >                                        LA_STRPTR, (ULONG)dev_name,
707                                          GTST_MaxChars, sizeof(dev_name) - 1,
708                                          LAST_Picker, TRUE,
709                                          TAG_END
# Line 699 | Line 711 | static void add_edit_volume(struct Layou
711                                  LT_New(h, LA_Type, INTEGER_KIND,
712                                          LA_LabelID, STR_UNIT_CTRL,
713                                          LA_ID, GAD_VOLUME_UNIT,
714 <                                        LA_LONG, &dev_unit,
714 >                                        LA_LONG, (ULONG)&dev_unit,
715                                          LAIN_UseIncrementers, TRUE,
716                                          GTIN_MaxChars, 8,
717                                          TAG_END
# Line 707 | Line 719 | static void add_edit_volume(struct Layou
719                                  LT_New(h, LA_Type, INTEGER_KIND,
720                                          LA_LabelID, STR_VOL_OPENFLAGS_CTRL,
721                                          LA_ID, GAD_VOLUME_OPENFLAGS,
722 <                                        LA_LONG, &dev_flags,
722 >                                        LA_LONG, (ULONG)&dev_flags,
723                                          LAIN_UseIncrementers, TRUE,
724                                          GTIN_MaxChars, 8,
725                                          TAG_END
# Line 715 | Line 727 | static void add_edit_volume(struct Layou
727                                  LT_New(h, LA_Type, INTEGER_KIND,
728                                          LA_LabelID, STR_VOL_STARTBLOCK_CTRL,
729                                          LA_ID, GAD_VOLUME_STARTBLOCK,
730 <                                        LA_LONG, &dev_start,
730 >                                        LA_LONG, (ULONG)&dev_start,
731                                          LAIN_UseIncrementers, TRUE,
732                                          GTIN_MaxChars, 8,
733                                          TAG_END
# Line 723 | Line 735 | static void add_edit_volume(struct Layou
735                                  LT_New(h, LA_Type, INTEGER_KIND,
736                                          LA_LabelID, STR_VOL_SIZE_CTRL,
737                                          LA_ID, GAD_VOLUME_SIZE,
738 <                                        LA_LONG, &dev_size,
738 >                                        LA_LONG, (ULONG)&dev_size,
739                                          LAIN_UseIncrementers, TRUE,
740                                          GTIN_MaxChars, 8,
741                                          TAG_END
# Line 731 | Line 743 | static void add_edit_volume(struct Layou
743                                  LT_New(h, LA_Type, INTEGER_KIND,
744                                          LA_LabelID, STR_VOL_BLOCKSIZE_CTRL,
745                                          LA_ID, GAD_VOLUME_BLOCKSIZE,
746 <                                        LA_LONG, &dev_bsize,
746 >                                        LA_LONG, (ULONG)&dev_bsize,
747                                          LAIN_UseIncrementers, TRUE,
748                                          GTIN_MaxChars, 8,
749                                          TAG_END
# Line 831 | Line 843 | static void add_edit_volume(struct Layou
843                                                          req = dev_request;
844   do_req:                                         if (req) {
845                                                                  LT_LockWindow(win);
846 <                                                                BOOL result = AslRequestTags(req, ASLFR_Window, win, TAG_END);
846 >                                                                BOOL result = AslRequestTags(req, ASLFR_Window, (ULONG)win, TAG_END);
847                                                                  LT_UnlockWindow(win);
848                                                                  if (result) {
849                                                                          char *str;
850 <                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END);
850 >                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END);
851                                                                          if (gad->GadgetID == GAD_VOLUME_FILE) {
852                                                                                  strncpy(str, req->rf_Dir, 255);
853                                                                                  str[255] = 0;
# Line 853 | Line 865 | do_req:                                                if (req) {
865                                                                                          LT_SetAttributes(h, GAD_VOLUME_BLOCKSIZE, GTIN_Number, dev_bsize, TAG_END);
866                                                                                  }
867                                                                          }
868 <                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END);
868 >                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END);
869                                                                  }
870                                                          }
871                                                          break;
# Line 864 | Line 876 | do_req:                                                if (req) {
876                  }
877          } while (!done);
878  
867        // Delete handle
868        LT_DeleteHandle(h);
869
879          // Update preferences and list view
880          if (ok_clicked) {
881                  char str[256];
# Line 881 | Line 890 | do_req:                                                if (req) {
890                  if (adding) {
891  
892                          // Add new item
893 +                        int i;
894                          PrefsAddString("disk", str);
895                          struct Node *item = (struct Node *)AllocMem(sizeof(struct Node), MEMF_CLEAR);
896 <                        for (int i=0; PrefsFindString("disk", i); i++) ;
896 >                        for (i=0; PrefsFindString("disk", i); i++) ;
897                          item->ln_Name = (char *)PrefsFindString("disk", i - 1);
898                          AddTail(&disk_list, item);
899  
# Line 900 | Line 910 | do_req:                                                if (req) {
910                                  item = item->ln_Succ;
911                          }
912                  }
913 <                LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, &disk_list, TAG_END);
913 >                LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, TAG_END);
914                  ghost_volumes_gadgets(h2);
915          }
916 +
917 +        // Delete handle
918 +        LT_DeleteHandle(h);
919   }
920  
921   // Remove volume from list
# Line 924 | Line 937 | static void remove_volume(struct LayoutH
937                          }
938                          item = next;
939                  }
940 <                LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, &disk_list, GTLV_Selected, 0xffff, TAG_END);
940 >                LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, GTLV_Selected, 0xffff, TAG_END);
941                  ghost_volumes_gadgets(h);
942          }
943   }
# Line 948 | Line 961 | static void read_volumes_settings(void)
961                  PrefsRemoveItem("cdrom");
962  
963          PrefsReplaceBool("nocdrom", nocdrom);
964 +
965 +        if (strlen(extfs_name))
966 +                PrefsReplaceString("extfs", extfs_name);
967   }
968  
969   // Create "Volumes" pane
# Line 963 | Line 979 | static void create_volumes_pane(struct L
979                          VGROUP;
980                                  LT_New(h, LA_Type, LISTVIEW_KIND,
981                                          LA_ID, GAD_DISK_LIST,
982 <                                        GTLV_Labels, &disk_list,
982 >                                        LA_Chars, 20,
983 >                                        GTLV_Labels, (ULONG)&disk_list,
984                                          LALV_Lines, 6,
985 <                                        LALV_Link, NIL_LINK,
985 >                                        LALV_Link, (ULONG)NIL_LINK,
986                                          LALV_ResizeX, TRUE,
987                                          LALV_ResizeY, TRUE,
988                                          LALV_Selected, 0,
# Line 1002 | Line 1019 | static void create_volumes_pane(struct L
1019                                  LA_LabelID, STR_DEVICE_CTRL,
1020                                  LA_ID, GAD_CDROM_DEVICE,
1021                                  LA_Chars, 20,
1022 <                                LA_STRPTR, cdrom_name,
1022 >                                LA_STRPTR, (ULONG)cdrom_name,
1023                                  GTST_MaxChars, sizeof(cdrom_name) - 1,
1024                                  LAST_Picker, TRUE,
1025                                  TAG_END
# Line 1010 | Line 1027 | static void create_volumes_pane(struct L
1027                          LT_New(h, LA_Type, INTEGER_KIND,
1028                                  LA_LabelID, STR_UNIT_CTRL,
1029                                  LA_ID, GAD_CDROM_UNIT,
1030 <                                LA_LONG, &cdrom_unit,
1030 >                                LA_LONG, (ULONG)&cdrom_unit,
1031                                  LAIN_UseIncrementers, TRUE,
1032                                  GTIN_MaxChars, 8,
1033                                  TAG_END
# Line 1020 | Line 1037 | static void create_volumes_pane(struct L
1037                                  LA_ID, GAD_BOOTDRIVER,
1038                                  LACY_FirstLabel, STR_BOOT_ANY_LAB,
1039                                  LACY_LastLabel, STR_BOOT_CDROM_LAB,
1040 <                                LA_BYTE, &bootdriver_num,
1040 >                                LA_BYTE, (ULONG)&bootdriver_num,
1041                                  TAG_END
1042                          );
1043                          LT_New(h, LA_Type, CHECKBOX_KIND,
1044                                  LA_LabelID, STR_NOCDROM_CTRL,
1045                                  LA_ID, GAD_NOCDROM,
1046 <                                LA_BYTE, &nocdrom,
1046 >                                LA_BYTE, (ULONG)&nocdrom,
1047 >                                TAG_END
1048 >                        );
1049 >                ENDGROUP;
1050 >                VGROUP;
1051 >                        LT_New(h, LA_Type, STRING_KIND,
1052 >                                LA_LabelID, STR_EXTFS_CTRL,
1053 >                                LA_ID, GAD_EXTFS,
1054 >                                LA_Chars, 20,
1055 >                                LA_STRPTR, (ULONG)extfs_name,
1056 >                                GTST_MaxChars, sizeof(extfs_name) - 1,
1057                                  TAG_END
1058                          );
1059                  ENDGROUP;
# Line 1065 | Line 1092 | static void read_scsi_settings(void)
1092  
1093                  if (strlen(scsi_dev[i])) {
1094                          char str[256];
1095 <                        sprintf("%s/%ld", scsi_dev[i], scsi_unit[i]);
1095 >                        sprintf(str, "%s/%ld", scsi_dev[i], scsi_unit[i]);
1096                          PrefsReplaceString(prefs_name, str);
1097                  } else
1098                          PrefsRemoveItem(prefs_name);
# Line 1088 | Line 1115 | static void create_scsi_pane(struct Layo
1115                                          LA_LabelID, STR_DEVICE_CTRL,
1116                                          LA_ID, GAD_SCSI0_DEVICE + i,
1117                                          LA_Chars, 20,
1118 <                                        LA_STRPTR, scsi_dev[i],
1118 >                                        LA_STRPTR, (ULONG)scsi_dev[i],
1119                                          GTST_MaxChars, sizeof(scsi_dev[i]) - 1,
1120                                          LAST_Picker, TRUE,
1121                                          TAG_END
# Line 1097 | Line 1124 | static void create_scsi_pane(struct Layo
1124                                          LA_LabelID, STR_UNIT_CTRL,
1125                                          LA_ID, GAD_SCSI0_UNIT + i,
1126                                          LA_Chars, 4,
1127 <                                        LA_LONG, &scsi_unit[i],
1127 >                                        LA_LONG, (ULONG)&scsi_unit[i],
1128                                          LAIN_UseIncrementers, TRUE,
1129                                          GTIN_MaxChars, 8,
1130                                          TAG_END
# Line 1177 | Line 1204 | static void parse_graphics_prefs(void)
1204          if (str) {
1205                  if (sscanf(str, "ahi/%08lx", &ahi_id) == 1 && AHIBase) {
1206                          AHI_GetAudioAttrs(ahi_id, NULL,
1207 <                                AHIDB_Name, ahi_mode_name,
1207 >                                AHIDB_Name, (ULONG)ahi_mode_name,
1208                                  AHIDB_BufferLen, sizeof(ahi_mode_name) - 1,
1209                                  TAG_END
1210                          );
# Line 1217 | Line 1244 | static void ghost_graphics_gadgets(struc
1244   // Show screen mode requester
1245   static void screen_mode_req(struct Window *win, struct LayoutHandle *h)
1246   {
1247 <        if (P96Base == NULL)
1247 >        if (P96Base == NULL && CyberGfxBase == NULL)
1248                  return;
1249  
1250          LT_LockWindow(win);
1251 <        ULONG id = p96RequestModeIDTags(
1252 <                P96MA_MinDepth, 8,
1253 <                P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1254 <                TAG_END
1255 <        );
1251 >
1252 >        ULONG id;
1253 >
1254 >        if (P96Base) {
1255 >                id = p96RequestModeIDTags(
1256 >                        P96MA_MinDepth, 8,
1257 >                        P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1258 >                        TAG_END
1259 >                );
1260 >        } 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 >        }
1268          LT_UnlockWindow(win);
1269  
1270          if (id != INVALID_ID) {
1271                  mode_id = id;
1272                  GetDisplayInfoData(NULL, (UBYTE *)&mode_name, sizeof(mode_name), DTAG_NAME, mode_id);
1273 <                LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, mode_name.Name, TAG_END);
1273 >                LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, (ULONG)mode_name.Name, TAG_END);
1274          }
1275   }
1276  
# Line 1242 | Line 1281 | static void ahi_mode_req(struct Window *
1281                  return;
1282  
1283          struct AHIAudioModeRequester *req = AHI_AllocAudioRequest(
1284 <                AHIR_Window, win,
1284 >                AHIR_Window, (ULONG)win,
1285                  TAG_END
1286          );
1287          if (req == NULL)
# Line 1258 | Line 1297 | static void ahi_mode_req(struct Window *
1297          if (ok) {
1298                  ahi_id = req->ahiam_AudioID;
1299                  AHI_GetAudioAttrs(ahi_id, NULL,
1300 <                        AHIDB_Name, ahi_mode_name,
1300 >                        AHIDB_Name, (ULONG)ahi_mode_name,
1301                          AHIDB_BufferLen, sizeof(ahi_mode_name) - 1,
1302                          TAG_END
1303                  );
1304 <                LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, ahi_mode_name, TAG_END);
1304 >                LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, (ULONG)ahi_mode_name, TAG_END);
1305          }
1306          AHI_FreeAudioRequest(req);
1307   }
# Line 1307 | Line 1346 | static void create_graphics_pane(struct
1346                          LT_New(h, LA_Type, CYCLE_KIND,
1347                                  LA_LabelID, STR_VIDEO_TYPE_CTRL,
1348                                  LA_ID, GAD_VIDEO_TYPE,
1349 <                                LACY_LabelTable, labels,
1350 <                                LA_BYTE, &display_type,
1349 >                                LACY_LabelTable, (ULONG)labels,
1350 >                                LA_BYTE, (ULONG)&display_type,
1351                                  TAG_END
1352                          );
1353                          LT_New(h, LA_Type, INTEGER_KIND,
1354                                  LA_LabelID, STR_DISPLAY_X_CTRL,
1355                                  LA_ID, GAD_DISPLAY_X,
1356 <                                LA_LONG, &dis_width,
1356 >                                LA_LONG, (ULONG)&dis_width,
1357                                  GTIN_MaxChars, 8,
1358                                  TAG_END
1359                          );
1360                          LT_New(h, LA_Type, INTEGER_KIND,
1361                                  LA_LabelID, STR_DISPLAY_Y_CTRL,
1362                                  LA_ID, GAD_DISPLAY_Y,
1363 <                                LA_LONG, &dis_height,
1363 >                                LA_LONG, (ULONG)&dis_height,
1364                                  GTIN_MaxChars, 8,
1365                                  TAG_END
1366                          );
# Line 1330 | Line 1369 | static void create_graphics_pane(struct
1369                                  LA_ID, GAD_FRAMESKIP,
1370                                  LAPU_FirstLabel, STR_REF_5HZ_LAB,
1371                                  LAPU_LastLabel, STR_REF_60HZ_LAB,
1372 <                                LA_BYTE, &frameskip_num,
1372 >                                LA_BYTE, (ULONG)&frameskip_num,
1373                                  TAG_END
1374                          );
1375                          LT_New(h, LA_Type, TEXT_KIND,
# Line 1338 | Line 1377 | static void create_graphics_pane(struct
1377                                  LA_ID, GAD_SCREEN_MODE,
1378                                  LA_Chars, DISPLAYNAMELEN,
1379                                  LATX_Picker, TRUE,
1380 <                                GTTX_Text, mode_name.Name,
1380 >                                GTTX_Text, (ULONG)mode_name.Name,
1381                                  GTTX_Border, TRUE,
1382                                  TAG_END
1383                          );
# Line 1352 | Line 1391 | static void create_graphics_pane(struct
1391                                  LA_ID, GAD_AHI_MODE,
1392                                  LA_Chars, DISPLAYNAMELEN,
1393                                  LATX_Picker, TRUE,
1394 <                                GTTX_Text, ahi_mode_name,
1394 >                                GTTX_Text, (ULONG)ahi_mode_name,
1395                                  GTTX_Border, TRUE,
1396                                  TAG_END
1397                          );
1398                          LT_New(h, LA_Type, CHECKBOX_KIND,
1399                                  LA_LabelID, STR_NOSOUND_CTRL,
1400                                  LA_ID, GAD_NOSOUND,
1401 <                                LA_BYTE, &nosound,
1401 >                                LA_BYTE, (ULONG)&nosound,
1402                                  TAG_END
1403                          );
1404                  ENDGROUP;
# Line 1381 | Line 1420 | static char ether_dev[256];
1420   static ULONG ether_unit;
1421  
1422   // Read serial/network preferences
1423 < static void parse_serial_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar)
1423 > static void parse_ser_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar)
1424   {
1425          dev[0] = 0;
1426          unit = 0;
# Line 1395 | Line 1434 | static void parse_serial_prefs(const cha
1434                  }
1435                  sscanf(str, "%[^/]/%ld", dev, &unit);
1436          }
1437 + }
1438 +
1439 + static void parse_serial_prefs(void)
1440 + {
1441 +        parse_ser_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar);
1442 +        parse_ser_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar);
1443  
1444          ether_dev[0] = 0;
1445          ether_unit = 0;
1446  
1447 <        str = PrefsFindString("ether");
1447 >        const char *str = PrefsFindString("ether");
1448          if (str)
1449                  sscanf(str, "%[^/]/%ld", ether_dev, &ether_unit);
1450   }
# Line 1432 | Line 1477 | static void read_serial_settings(void)
1477   // Create "Serial/Network" pane
1478   static void create_serial_pane(struct LayoutHandle *h)
1479   {
1480 <        parse_serial_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar);
1436 <        parse_serial_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar);
1480 >        parse_serial_prefs();
1481  
1482          VGROUP;
1483                  LT_New(h, LA_Type, VERTICAL_KIND,
# Line 1444 | Line 1488 | static void create_serial_pane(struct La
1488                                  LA_LabelID, STR_DEVICE_CTRL,
1489                                  LA_ID, GAD_SERIALA_DEVICE,
1490                                  LA_Chars, 20,
1491 <                                LA_STRPTR, seriala_dev,
1491 >                                LA_STRPTR, (ULONG)seriala_dev,
1492                                  GTST_MaxChars, sizeof(seriala_dev) - 1,
1493                                  LAST_Picker, TRUE,
1494                                  TAG_END
# Line 1452 | Line 1496 | static void create_serial_pane(struct La
1496                          LT_New(h, LA_Type, INTEGER_KIND,
1497                                  LA_LabelID, STR_UNIT_CTRL,
1498                                  LA_ID, GAD_SERIALA_UNIT,
1499 <                                LA_LONG, &seriala_unit,
1499 >                                LA_LONG, (ULONG)&seriala_unit,
1500                                  LAIN_UseIncrementers, TRUE,
1501                                  GTIN_MaxChars, 8,
1502                                  TAG_END
# Line 1460 | Line 1504 | static void create_serial_pane(struct La
1504                          LT_New(h, LA_Type, CHECKBOX_KIND,
1505                                  LA_LabelID, STR_ISPAR_CTRL,
1506                                  LA_ID, GAD_SERIALA_ISPAR,
1507 <                                LA_BYTE, &seriala_ispar,
1507 >                                LA_BYTE, (ULONG)&seriala_ispar,
1508                                  TAG_END
1509                          );
1510                  ENDGROUP;
# Line 1473 | Line 1517 | static void create_serial_pane(struct La
1517                                  LA_LabelID, STR_DEVICE_CTRL,
1518                                  LA_ID, GAD_SERIALB_DEVICE,
1519                                  LA_Chars, 20,
1520 <                                LA_STRPTR, serialb_dev,
1520 >                                LA_STRPTR, (ULONG)serialb_dev,
1521                                  GTST_MaxChars, sizeof(serialb_dev) - 1,
1522                                  LAST_Picker, TRUE,
1523                                  TAG_END
# Line 1481 | Line 1525 | static void create_serial_pane(struct La
1525                          LT_New(h, LA_Type, INTEGER_KIND,
1526                                  LA_LabelID, STR_UNIT_CTRL,
1527                                  LA_ID, GAD_SERIALB_UNIT,
1528 <                                LA_LONG, &serialb_unit,
1528 >                                LA_LONG, (ULONG)&serialb_unit,
1529                                  LAIN_UseIncrementers, TRUE,
1530                                  GTIN_MaxChars, 8,
1531                                  TAG_END
# Line 1489 | Line 1533 | static void create_serial_pane(struct La
1533                          LT_New(h, LA_Type, CHECKBOX_KIND,
1534                                  LA_LabelID, STR_ISPAR_CTRL,
1535                                  LA_ID, GAD_SERIALB_ISPAR,
1536 <                                LA_BYTE, &serialb_ispar,
1536 >                                LA_BYTE, (ULONG)&serialb_ispar,
1537                                  TAG_END
1538                          );
1539                  ENDGROUP;
# Line 1502 | Line 1546 | static void create_serial_pane(struct La
1546                                  LA_LabelID, STR_DEVICE_CTRL,
1547                                  LA_ID, GAD_ETHER_DEVICE,
1548                                  LA_Chars, 20,
1549 <                                LA_STRPTR, ether_dev,
1549 >                                LA_STRPTR, (ULONG)ether_dev,
1550                                  GTST_MaxChars, sizeof(ether_dev) - 1,
1551                                  LAST_Picker, TRUE,
1552                                  TAG_END
# Line 1510 | Line 1554 | static void create_serial_pane(struct La
1554                          LT_New(h, LA_Type, INTEGER_KIND,
1555                                  LA_LabelID, STR_UNIT_CTRL,
1556                                  LA_ID, GAD_ETHER_UNIT,
1557 <                                LA_LONG, &ether_unit,
1557 >                                LA_LONG, (ULONG)&ether_unit,
1558                                  LAIN_UseIncrementers, TRUE,
1559                                  GTIN_MaxChars, 8,
1560                                  TAG_END
# Line 1573 | Line 1617 | static void create_memory_pane(struct La
1617                          LA_LabelID, STR_RAMSIZE_SLIDER,
1618                          LA_ID, GAD_RAMSIZE,
1619                          LA_Chars, 20,
1620 <                        LA_LONG, &ramsize_mb,
1621 <                        GTSL_LevelFormat, GetString(STR_RAMSIZE_FMT),
1620 >                        LA_LONG, (ULONG)&ramsize_mb,
1621 >                        GTSL_LevelFormat, (ULONG)GetString(STR_RAMSIZE_FMT),
1622                          GTSL_Min, 1,
1623                          GTSL_Max, AvailMem(MEMF_LARGEST) >> 20,
1624                          TAG_END
# Line 1584 | Line 1628 | static void create_memory_pane(struct La
1628                          LA_ID, GAD_MODELID,
1629                          LACY_FirstLabel, STR_MODELID_5_LAB,
1630                          LACY_LastLabel, STR_MODELID_14_LAB,
1631 <                        LA_BYTE, &model_num,
1631 >                        LA_BYTE, (ULONG)&model_num,
1632                          TAG_END
1633                  );
1634                  LT_New(h, LA_Type, STRING_KIND,
1635                          LA_LabelID, STR_ROM_FILE_CTRL,
1636                          LA_ID, GAD_ROM_FILE,
1637                          LA_Chars, 20,
1638 <                        LA_STRPTR, rom_file,
1638 >                        LA_STRPTR, (ULONG)rom_file,
1639                          GTST_MaxChars, sizeof(rom_file) - 1,
1640                          LAST_Picker, TRUE,
1641                          TAG_END

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines