--- BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 1999/10/19 19:28:16 1.2 +++ BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 2000/07/14 21:29:11 1.9 @@ -1,7 +1,7 @@ /* * prefs_editor_amiga.cpp - Preferences editor, AmigaOS implementation (using gtlayout.library) * - * Basilisk II (C) 1997-1999 Christian Bauer + * Basilisk II (C) 1997-2000 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include "sysdeps.h" @@ -65,6 +67,7 @@ const int GAD_CDROM_DEVICE = 0x0304; const int GAD_CDROM_UNIT = 0x0305; const int GAD_BOOTDRIVER = 0x0306; const int GAD_NOCDROM = 0x0307; +const int GAD_EXTFS = 0x0308; const int GAD_VOLUME_READONLY = 0x0310; // "Add/Edit Volume" window const int GAD_VOLUME_TYPE = 0x0311; @@ -142,7 +145,7 @@ static void read_settings(struct LayoutH * Locale hook - returns string for given ID */ -static __saveds __regargs const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) +static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) { return GetString((uint32)id); } @@ -510,6 +513,9 @@ quit: FreeAslRequest(dev_request); FreeAslRequest(file_request); + // Delete menus + LT_DisposeMenu(menu); + // Delete handle LT_DeleteHandle(h); @@ -524,7 +530,7 @@ quit: */ static struct List disk_list; -static char cdrom_name[256]; +static char cdrom_name[256], extfs_name[256]; static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize; static BYTE bootdriver_num, nocdrom; @@ -559,6 +565,11 @@ static void parse_volumes_prefs(void) } nocdrom = PrefsFindBool("nocdrom"); + + extfs_name[0] = 0; + str = PrefsFindString("extfs"); + if (str) + strncpy(extfs_name, str, sizeof(extfs_name) - 1); } // Ghost/unghost "Edit" and "Remove" buttons @@ -865,9 +876,6 @@ do_req: if (req) { } } while (!done); - // Delete handle - LT_DeleteHandle(h); - // Update preferences and list view if (ok_clicked) { char str[256]; @@ -905,6 +913,9 @@ do_req: if (req) { LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, TAG_END); ghost_volumes_gadgets(h2); } + + // Delete handle + LT_DeleteHandle(h); } // Remove volume from list @@ -950,6 +961,9 @@ static void read_volumes_settings(void) PrefsRemoveItem("cdrom"); PrefsReplaceBool("nocdrom", nocdrom); + + if (strlen(extfs_name)) + PrefsReplaceString("extfs", extfs_name); } // Create "Volumes" pane @@ -965,6 +979,7 @@ static void create_volumes_pane(struct L VGROUP; LT_New(h, LA_Type, LISTVIEW_KIND, LA_ID, GAD_DISK_LIST, + LA_Chars, 20, GTLV_Labels, (ULONG)&disk_list, LALV_Lines, 6, LALV_Link, (ULONG)NIL_LINK, @@ -1032,6 +1047,16 @@ static void create_volumes_pane(struct L TAG_END ); ENDGROUP; + VGROUP; + LT_New(h, LA_Type, STRING_KIND, + LA_LabelID, STR_EXTFS_CTRL, + LA_ID, GAD_EXTFS, + LA_Chars, 20, + LA_STRPTR, (ULONG)extfs_name, + GTST_MaxChars, sizeof(extfs_name) - 1, + TAG_END + ); + ENDGROUP; ENDGROUP; } @@ -1067,7 +1092,7 @@ static void read_scsi_settings(void) if (strlen(scsi_dev[i])) { char str[256]; - sprintf("%s/%ld", scsi_dev[i], scsi_unit[i]); + sprintf(str, "%s/%ld", scsi_dev[i], scsi_unit[i]); PrefsReplaceString(prefs_name, str); } else PrefsRemoveItem(prefs_name); @@ -1219,15 +1244,27 @@ static void ghost_graphics_gadgets(struc // Show screen mode requester static void screen_mode_req(struct Window *win, struct LayoutHandle *h) { - if (P96Base == NULL) + if (P96Base == NULL && CyberGfxBase == NULL) return; LT_LockWindow(win); - ULONG id = p96RequestModeIDTags( - P96MA_MinDepth, 8, - P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, - TAG_END - ); + + ULONG id; + + if (P96Base) { + id = p96RequestModeIDTags( + P96MA_MinDepth, 8, + P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, + TAG_END + ); + } else { + UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0}; + id = (ULONG) CModeRequestTags(NULL, + CYBRMREQ_MinDepth, 8, + CYBRMREQ_CModelArray, (ULONG)model_array, + TAG_END + ); + } LT_UnlockWindow(win); if (id != INVALID_ID) {