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.7 by cebix, 2000-07-06T16:04:24Z

# 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 523 | 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 558 | 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 644 | Line 653 | static void add_edit_volume(struct Layou
653          struct Window *win = NULL;
654          h = LT_CreateHandleTags(NULL,
655                  LAHN_AutoActivate, FALSE,
656 <                LAHN_LocaleHook, &locale_hook,
656 >                LAHN_LocaleHook, (ULONG)&locale_hook,
657                  TAG_END
658          );
659          if (h == NULL)
# Line 657 | Line 666 | static void add_edit_volume(struct Layou
666                          LT_New(h, LA_Type, CHECKBOX_KIND,
667                                  LA_LabelID, STR_VOL_READONLY_CTRL,
668                                  LA_ID, GAD_VOLUME_READONLY,
669 <                                LA_BYTE, &read_only,
669 >                                LA_BYTE, (ULONG)&read_only,
670                                  TAG_END
671                          );
672                          LT_New(h, LA_Type, CYCLE_KIND,
# Line 666 | Line 675 | static void add_edit_volume(struct Layou
675                                  LACY_AutoPageID, GAD_VOLUME_PAGEGROUP,
676                                  LACY_FirstLabel, STR_VOL_FILE_LAB,
677                                  LACY_LastLabel, STR_VOL_DEVICE_LAB,
678 <                                LA_BYTE, &is_device,
678 >                                LA_BYTE, (ULONG)&is_device,
679                                  TAG_END
680                          );
681                  ENDGROUP;
# Line 680 | Line 689 | static void add_edit_volume(struct Layou
689                                          LA_LabelID, STR_VOL_FILE_CTRL,
690                                          LA_ID, GAD_VOLUME_FILE,
691                                          LA_Chars, 20,
692 <                                        LA_STRPTR, file_name,
692 >                                        LA_STRPTR, (ULONG)file_name,
693                                          GTST_MaxChars, sizeof(file_name) - 1,
694                                          LAST_Picker, TRUE,
695                                          TAG_END
# Line 691 | Line 700 | static void add_edit_volume(struct Layou
700                                          LA_LabelID, STR_DEVICE_CTRL,
701                                          LA_ID, GAD_VOLUME_DEVICE,
702                                          LA_Chars, 20,
703 <                                        LA_STRPTR, dev_name,
703 >                                        LA_STRPTR, (ULONG)dev_name,
704                                          GTST_MaxChars, sizeof(dev_name) - 1,
705                                          LAST_Picker, TRUE,
706                                          TAG_END
# Line 699 | Line 708 | static void add_edit_volume(struct Layou
708                                  LT_New(h, LA_Type, INTEGER_KIND,
709                                          LA_LabelID, STR_UNIT_CTRL,
710                                          LA_ID, GAD_VOLUME_UNIT,
711 <                                        LA_LONG, &dev_unit,
711 >                                        LA_LONG, (ULONG)&dev_unit,
712                                          LAIN_UseIncrementers, TRUE,
713                                          GTIN_MaxChars, 8,
714                                          TAG_END
# Line 707 | Line 716 | static void add_edit_volume(struct Layou
716                                  LT_New(h, LA_Type, INTEGER_KIND,
717                                          LA_LabelID, STR_VOL_OPENFLAGS_CTRL,
718                                          LA_ID, GAD_VOLUME_OPENFLAGS,
719 <                                        LA_LONG, &dev_flags,
719 >                                        LA_LONG, (ULONG)&dev_flags,
720                                          LAIN_UseIncrementers, TRUE,
721                                          GTIN_MaxChars, 8,
722                                          TAG_END
# Line 715 | Line 724 | static void add_edit_volume(struct Layou
724                                  LT_New(h, LA_Type, INTEGER_KIND,
725                                          LA_LabelID, STR_VOL_STARTBLOCK_CTRL,
726                                          LA_ID, GAD_VOLUME_STARTBLOCK,
727 <                                        LA_LONG, &dev_start,
727 >                                        LA_LONG, (ULONG)&dev_start,
728                                          LAIN_UseIncrementers, TRUE,
729                                          GTIN_MaxChars, 8,
730                                          TAG_END
# Line 723 | Line 732 | static void add_edit_volume(struct Layou
732                                  LT_New(h, LA_Type, INTEGER_KIND,
733                                          LA_LabelID, STR_VOL_SIZE_CTRL,
734                                          LA_ID, GAD_VOLUME_SIZE,
735 <                                        LA_LONG, &dev_size,
735 >                                        LA_LONG, (ULONG)&dev_size,
736                                          LAIN_UseIncrementers, TRUE,
737                                          GTIN_MaxChars, 8,
738                                          TAG_END
# Line 731 | Line 740 | static void add_edit_volume(struct Layou
740                                  LT_New(h, LA_Type, INTEGER_KIND,
741                                          LA_LabelID, STR_VOL_BLOCKSIZE_CTRL,
742                                          LA_ID, GAD_VOLUME_BLOCKSIZE,
743 <                                        LA_LONG, &dev_bsize,
743 >                                        LA_LONG, (ULONG)&dev_bsize,
744                                          LAIN_UseIncrementers, TRUE,
745                                          GTIN_MaxChars, 8,
746                                          TAG_END
# Line 831 | Line 840 | static void add_edit_volume(struct Layou
840                                                          req = dev_request;
841   do_req:                                         if (req) {
842                                                                  LT_LockWindow(win);
843 <                                                                BOOL result = AslRequestTags(req, ASLFR_Window, win, TAG_END);
843 >                                                                BOOL result = AslRequestTags(req, ASLFR_Window, (ULONG)win, TAG_END);
844                                                                  LT_UnlockWindow(win);
845                                                                  if (result) {
846                                                                          char *str;
847 <                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END);
847 >                                                                        GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END);
848                                                                          if (gad->GadgetID == GAD_VOLUME_FILE) {
849                                                                                  strncpy(str, req->rf_Dir, 255);
850                                                                                  str[255] = 0;
# Line 853 | Line 862 | do_req:                                                if (req) {
862                                                                                          LT_SetAttributes(h, GAD_VOLUME_BLOCKSIZE, GTIN_Number, dev_bsize, TAG_END);
863                                                                                  }
864                                                                          }
865 <                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END);
865 >                                                                        LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END);
866                                                                  }
867                                                          }
868                                                          break;
# 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   }
# Line 924 | Line 934 | static void remove_volume(struct LayoutH
934                          }
935                          item = next;
936                  }
937 <                LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, &disk_list, GTLV_Selected, 0xffff, TAG_END);
937 >                LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, GTLV_Selected, 0xffff, TAG_END);
938                  ghost_volumes_gadgets(h);
939          }
940   }
# Line 948 | 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 963 | 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 <                                        GTLV_Labels, &disk_list,
979 >                                        LA_Chars, 20,
980 >                                        GTLV_Labels, (ULONG)&disk_list,
981                                          LALV_Lines, 6,
982 <                                        LALV_Link, NIL_LINK,
982 >                                        LALV_Link, (ULONG)NIL_LINK,
983                                          LALV_ResizeX, TRUE,
984                                          LALV_ResizeY, TRUE,
985                                          LALV_Selected, 0,
# Line 1002 | Line 1016 | static void create_volumes_pane(struct L
1016                                  LA_LabelID, STR_DEVICE_CTRL,
1017                                  LA_ID, GAD_CDROM_DEVICE,
1018                                  LA_Chars, 20,
1019 <                                LA_STRPTR, cdrom_name,
1019 >                                LA_STRPTR, (ULONG)cdrom_name,
1020                                  GTST_MaxChars, sizeof(cdrom_name) - 1,
1021                                  LAST_Picker, TRUE,
1022                                  TAG_END
# Line 1010 | Line 1024 | static void create_volumes_pane(struct L
1024                          LT_New(h, LA_Type, INTEGER_KIND,
1025                                  LA_LabelID, STR_UNIT_CTRL,
1026                                  LA_ID, GAD_CDROM_UNIT,
1027 <                                LA_LONG, &cdrom_unit,
1027 >                                LA_LONG, (ULONG)&cdrom_unit,
1028                                  LAIN_UseIncrementers, TRUE,
1029                                  GTIN_MaxChars, 8,
1030                                  TAG_END
# Line 1020 | Line 1034 | static void create_volumes_pane(struct L
1034                                  LA_ID, GAD_BOOTDRIVER,
1035                                  LACY_FirstLabel, STR_BOOT_ANY_LAB,
1036                                  LACY_LastLabel, STR_BOOT_CDROM_LAB,
1037 <                                LA_BYTE, &bootdriver_num,
1037 >                                LA_BYTE, (ULONG)&bootdriver_num,
1038                                  TAG_END
1039                          );
1040                          LT_New(h, LA_Type, CHECKBOX_KIND,
1041                                  LA_LabelID, STR_NOCDROM_CTRL,
1042                                  LA_ID, GAD_NOCDROM,
1043 <                                LA_BYTE, &nocdrom,
1043 >                                LA_BYTE, (ULONG)&nocdrom,
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;
# Line 1065 | 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 1088 | Line 1112 | static void create_scsi_pane(struct Layo
1112                                          LA_LabelID, STR_DEVICE_CTRL,
1113                                          LA_ID, GAD_SCSI0_DEVICE + i,
1114                                          LA_Chars, 20,
1115 <                                        LA_STRPTR, scsi_dev[i],
1115 >                                        LA_STRPTR, (ULONG)scsi_dev[i],
1116                                          GTST_MaxChars, sizeof(scsi_dev[i]) - 1,
1117                                          LAST_Picker, TRUE,
1118                                          TAG_END
# Line 1097 | Line 1121 | static void create_scsi_pane(struct Layo
1121                                          LA_LabelID, STR_UNIT_CTRL,
1122                                          LA_ID, GAD_SCSI0_UNIT + i,
1123                                          LA_Chars, 4,
1124 <                                        LA_LONG, &scsi_unit[i],
1124 >                                        LA_LONG, (ULONG)&scsi_unit[i],
1125                                          LAIN_UseIncrementers, TRUE,
1126                                          GTIN_MaxChars, 8,
1127                                          TAG_END
# Line 1177 | Line 1201 | static void parse_graphics_prefs(void)
1201          if (str) {
1202                  if (sscanf(str, "ahi/%08lx", &ahi_id) == 1 && AHIBase) {
1203                          AHI_GetAudioAttrs(ahi_id, NULL,
1204 <                                AHIDB_Name, ahi_mode_name,
1204 >                                AHIDB_Name, (ULONG)ahi_mode_name,
1205                                  AHIDB_BufferLen, sizeof(ahi_mode_name) - 1,
1206                                  TAG_END
1207                          );
# Line 1217 | 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 (CyberGfxBase) {
1252 >                UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0};
1253 >                id = (ULONG) CModeRequestTags(NULL,
1254 >                        CYBRMREQ_MinDepth, 8,
1255 >                        CYBRMREQ_CModelArray, (ULONG)model_array,
1256 >                        TAG_END
1257 >                );
1258 >        } else {
1259 >                id = p96RequestModeIDTags(
1260 >                        P96MA_MinDepth, 8,
1261 >                        P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8,
1262 >                        TAG_END
1263 >                );
1264 >        }
1265          LT_UnlockWindow(win);
1266  
1267          if (id != INVALID_ID) {
1268                  mode_id = id;
1269                  GetDisplayInfoData(NULL, (UBYTE *)&mode_name, sizeof(mode_name), DTAG_NAME, mode_id);
1270 <                LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, mode_name.Name, TAG_END);
1270 >                LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, (ULONG)mode_name.Name, TAG_END);
1271          }
1272   }
1273  
# Line 1242 | Line 1278 | static void ahi_mode_req(struct Window *
1278                  return;
1279  
1280          struct AHIAudioModeRequester *req = AHI_AllocAudioRequest(
1281 <                AHIR_Window, win,
1281 >                AHIR_Window, (ULONG)win,
1282                  TAG_END
1283          );
1284          if (req == NULL)
# Line 1258 | Line 1294 | static void ahi_mode_req(struct Window *
1294          if (ok) {
1295                  ahi_id = req->ahiam_AudioID;
1296                  AHI_GetAudioAttrs(ahi_id, NULL,
1297 <                        AHIDB_Name, ahi_mode_name,
1297 >                        AHIDB_Name, (ULONG)ahi_mode_name,
1298                          AHIDB_BufferLen, sizeof(ahi_mode_name) - 1,
1299                          TAG_END
1300                  );
1301 <                LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, ahi_mode_name, TAG_END);
1301 >                LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, (ULONG)ahi_mode_name, TAG_END);
1302          }
1303          AHI_FreeAudioRequest(req);
1304   }
# Line 1307 | Line 1343 | static void create_graphics_pane(struct
1343                          LT_New(h, LA_Type, CYCLE_KIND,
1344                                  LA_LabelID, STR_VIDEO_TYPE_CTRL,
1345                                  LA_ID, GAD_VIDEO_TYPE,
1346 <                                LACY_LabelTable, labels,
1347 <                                LA_BYTE, &display_type,
1346 >                                LACY_LabelTable, (ULONG)labels,
1347 >                                LA_BYTE, (ULONG)&display_type,
1348                                  TAG_END
1349                          );
1350                          LT_New(h, LA_Type, INTEGER_KIND,
1351                                  LA_LabelID, STR_DISPLAY_X_CTRL,
1352                                  LA_ID, GAD_DISPLAY_X,
1353 <                                LA_LONG, &dis_width,
1353 >                                LA_LONG, (ULONG)&dis_width,
1354                                  GTIN_MaxChars, 8,
1355                                  TAG_END
1356                          );
1357                          LT_New(h, LA_Type, INTEGER_KIND,
1358                                  LA_LabelID, STR_DISPLAY_Y_CTRL,
1359                                  LA_ID, GAD_DISPLAY_Y,
1360 <                                LA_LONG, &dis_height,
1360 >                                LA_LONG, (ULONG)&dis_height,
1361                                  GTIN_MaxChars, 8,
1362                                  TAG_END
1363                          );
# Line 1330 | Line 1366 | static void create_graphics_pane(struct
1366                                  LA_ID, GAD_FRAMESKIP,
1367                                  LAPU_FirstLabel, STR_REF_5HZ_LAB,
1368                                  LAPU_LastLabel, STR_REF_60HZ_LAB,
1369 <                                LA_BYTE, &frameskip_num,
1369 >                                LA_BYTE, (ULONG)&frameskip_num,
1370                                  TAG_END
1371                          );
1372                          LT_New(h, LA_Type, TEXT_KIND,
# Line 1338 | Line 1374 | static void create_graphics_pane(struct
1374                                  LA_ID, GAD_SCREEN_MODE,
1375                                  LA_Chars, DISPLAYNAMELEN,
1376                                  LATX_Picker, TRUE,
1377 <                                GTTX_Text, mode_name.Name,
1377 >                                GTTX_Text, (ULONG)mode_name.Name,
1378                                  GTTX_Border, TRUE,
1379                                  TAG_END
1380                          );
# Line 1352 | Line 1388 | static void create_graphics_pane(struct
1388                                  LA_ID, GAD_AHI_MODE,
1389                                  LA_Chars, DISPLAYNAMELEN,
1390                                  LATX_Picker, TRUE,
1391 <                                GTTX_Text, ahi_mode_name,
1391 >                                GTTX_Text, (ULONG)ahi_mode_name,
1392                                  GTTX_Border, TRUE,
1393                                  TAG_END
1394                          );
1395                          LT_New(h, LA_Type, CHECKBOX_KIND,
1396                                  LA_LabelID, STR_NOSOUND_CTRL,
1397                                  LA_ID, GAD_NOSOUND,
1398 <                                LA_BYTE, &nosound,
1398 >                                LA_BYTE, (ULONG)&nosound,
1399                                  TAG_END
1400                          );
1401                  ENDGROUP;
# Line 1381 | Line 1417 | static char ether_dev[256];
1417   static ULONG ether_unit;
1418  
1419   // Read serial/network preferences
1420 < static void parse_serial_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar)
1420 > static void parse_ser_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar)
1421   {
1422          dev[0] = 0;
1423          unit = 0;
# Line 1395 | Line 1431 | static void parse_serial_prefs(const cha
1431                  }
1432                  sscanf(str, "%[^/]/%ld", dev, &unit);
1433          }
1434 + }
1435 +
1436 + static void parse_serial_prefs(void)
1437 + {
1438 +        parse_ser_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar);
1439 +        parse_ser_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar);
1440  
1441          ether_dev[0] = 0;
1442          ether_unit = 0;
1443  
1444 <        str = PrefsFindString("ether");
1444 >        const char *str = PrefsFindString("ether");
1445          if (str)
1446                  sscanf(str, "%[^/]/%ld", ether_dev, &ether_unit);
1447   }
# Line 1432 | Line 1474 | static void read_serial_settings(void)
1474   // Create "Serial/Network" pane
1475   static void create_serial_pane(struct LayoutHandle *h)
1476   {
1477 <        parse_serial_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar);
1436 <        parse_serial_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar);
1477 >        parse_serial_prefs();
1478  
1479          VGROUP;
1480                  LT_New(h, LA_Type, VERTICAL_KIND,
# Line 1444 | Line 1485 | static void create_serial_pane(struct La
1485                                  LA_LabelID, STR_DEVICE_CTRL,
1486                                  LA_ID, GAD_SERIALA_DEVICE,
1487                                  LA_Chars, 20,
1488 <                                LA_STRPTR, seriala_dev,
1488 >                                LA_STRPTR, (ULONG)seriala_dev,
1489                                  GTST_MaxChars, sizeof(seriala_dev) - 1,
1490                                  LAST_Picker, TRUE,
1491                                  TAG_END
# Line 1452 | Line 1493 | static void create_serial_pane(struct La
1493                          LT_New(h, LA_Type, INTEGER_KIND,
1494                                  LA_LabelID, STR_UNIT_CTRL,
1495                                  LA_ID, GAD_SERIALA_UNIT,
1496 <                                LA_LONG, &seriala_unit,
1496 >                                LA_LONG, (ULONG)&seriala_unit,
1497                                  LAIN_UseIncrementers, TRUE,
1498                                  GTIN_MaxChars, 8,
1499                                  TAG_END
# Line 1460 | Line 1501 | static void create_serial_pane(struct La
1501                          LT_New(h, LA_Type, CHECKBOX_KIND,
1502                                  LA_LabelID, STR_ISPAR_CTRL,
1503                                  LA_ID, GAD_SERIALA_ISPAR,
1504 <                                LA_BYTE, &seriala_ispar,
1504 >                                LA_BYTE, (ULONG)&seriala_ispar,
1505                                  TAG_END
1506                          );
1507                  ENDGROUP;
# Line 1473 | Line 1514 | static void create_serial_pane(struct La
1514                                  LA_LabelID, STR_DEVICE_CTRL,
1515                                  LA_ID, GAD_SERIALB_DEVICE,
1516                                  LA_Chars, 20,
1517 <                                LA_STRPTR, serialb_dev,
1517 >                                LA_STRPTR, (ULONG)serialb_dev,
1518                                  GTST_MaxChars, sizeof(serialb_dev) - 1,
1519                                  LAST_Picker, TRUE,
1520                                  TAG_END
# Line 1481 | Line 1522 | static void create_serial_pane(struct La
1522                          LT_New(h, LA_Type, INTEGER_KIND,
1523                                  LA_LabelID, STR_UNIT_CTRL,
1524                                  LA_ID, GAD_SERIALB_UNIT,
1525 <                                LA_LONG, &serialb_unit,
1525 >                                LA_LONG, (ULONG)&serialb_unit,
1526                                  LAIN_UseIncrementers, TRUE,
1527                                  GTIN_MaxChars, 8,
1528                                  TAG_END
# Line 1489 | Line 1530 | static void create_serial_pane(struct La
1530                          LT_New(h, LA_Type, CHECKBOX_KIND,
1531                                  LA_LabelID, STR_ISPAR_CTRL,
1532                                  LA_ID, GAD_SERIALB_ISPAR,
1533 <                                LA_BYTE, &serialb_ispar,
1533 >                                LA_BYTE, (ULONG)&serialb_ispar,
1534                                  TAG_END
1535                          );
1536                  ENDGROUP;
# Line 1502 | Line 1543 | static void create_serial_pane(struct La
1543                                  LA_LabelID, STR_DEVICE_CTRL,
1544                                  LA_ID, GAD_ETHER_DEVICE,
1545                                  LA_Chars, 20,
1546 <                                LA_STRPTR, ether_dev,
1546 >                                LA_STRPTR, (ULONG)ether_dev,
1547                                  GTST_MaxChars, sizeof(ether_dev) - 1,
1548                                  LAST_Picker, TRUE,
1549                                  TAG_END
# Line 1510 | Line 1551 | static void create_serial_pane(struct La
1551                          LT_New(h, LA_Type, INTEGER_KIND,
1552                                  LA_LabelID, STR_UNIT_CTRL,
1553                                  LA_ID, GAD_ETHER_UNIT,
1554 <                                LA_LONG, &ether_unit,
1554 >                                LA_LONG, (ULONG)&ether_unit,
1555                                  LAIN_UseIncrementers, TRUE,
1556                                  GTIN_MaxChars, 8,
1557                                  TAG_END
# Line 1573 | Line 1614 | static void create_memory_pane(struct La
1614                          LA_LabelID, STR_RAMSIZE_SLIDER,
1615                          LA_ID, GAD_RAMSIZE,
1616                          LA_Chars, 20,
1617 <                        LA_LONG, &ramsize_mb,
1618 <                        GTSL_LevelFormat, GetString(STR_RAMSIZE_FMT),
1617 >                        LA_LONG, (ULONG)&ramsize_mb,
1618 >                        GTSL_LevelFormat, (ULONG)GetString(STR_RAMSIZE_FMT),
1619                          GTSL_Min, 1,
1620                          GTSL_Max, AvailMem(MEMF_LARGEST) >> 20,
1621                          TAG_END
# Line 1584 | Line 1625 | static void create_memory_pane(struct La
1625                          LA_ID, GAD_MODELID,
1626                          LACY_FirstLabel, STR_MODELID_5_LAB,
1627                          LACY_LastLabel, STR_MODELID_14_LAB,
1628 <                        LA_BYTE, &model_num,
1628 >                        LA_BYTE, (ULONG)&model_num,
1629                          TAG_END
1630                  );
1631                  LT_New(h, LA_Type, STRING_KIND,
1632                          LA_LabelID, STR_ROM_FILE_CTRL,
1633                          LA_ID, GAD_ROM_FILE,
1634                          LA_Chars, 20,
1635 <                        LA_STRPTR, rom_file,
1635 >                        LA_STRPTR, (ULONG)rom_file,
1636                          GTST_MaxChars, sizeof(rom_file) - 1,
1637                          LAST_Picker, TRUE,
1638                          TAG_END

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines