--- BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 2000/08/20 14:08:42 1.11 +++ BasiliskII/src/AmigaOS/prefs_editor_amiga.cpp 2001/05/24 14:31:07 1.16 @@ -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-2001 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,7 +27,7 @@ #include #include #include -#include // jl +#include #include #include #include @@ -38,7 +38,7 @@ #include #include #include -#include // jl +#include #include #include "sysdeps.h" @@ -94,6 +94,7 @@ const int GAD_SCSI3_UNIT = 0x0413; const int GAD_SCSI4_UNIT = 0x0414; const int GAD_SCSI5_UNIT = 0x0415; const int GAD_SCSI6_UNIT = 0x0416; +const int GAD_SCSI_MEMTYPE = 0x0420; const int GAD_VIDEO_TYPE = 0x0500; // "Graphics/Sound" pane const int GAD_DISPLAY_X = 0x0501; @@ -354,14 +355,18 @@ bool PrefsEditor(void) case GAD_BOOTDRIVER: switch (code) { case 0: - PrefsReplaceInt16("bootdriver", 0); + PrefsReplaceInt32("bootdriver", 0); break; case 1: - PrefsReplaceInt16("bootdriver", CDROMRefNum); + PrefsReplaceInt32("bootdriver", CDROMRefNum); break; } break; + case GAD_SCSI_MEMTYPE: + PrefsReplaceInt32("scsimemtype", code); + break; + case GAD_VIDEO_TYPE: ghost_graphics_gadgets(h); break; @@ -533,7 +538,7 @@ quit: FreeAslRequest(dev_request); FreeAslRequest(file_request); - // Delete Menus jl + // Delete Menus LT_DisposeMenu(menu); // Delete handle @@ -574,7 +579,7 @@ static void parse_volumes_prefs(void) bootdriver_num = 0; - int bootdriver = PrefsFindInt16("bootdriver"); + int bootdriver = PrefsFindInt32("bootdriver"); switch (bootdriver) { case 0: bootdriver_num = 0; @@ -1087,6 +1092,7 @@ static void create_volumes_pane(struct L static char scsi_dev[6][256]; static LONG scsi_unit[6]; +static LONG scsi_memtype; // Read SCSI preferences static void parse_scsi_prefs(void) @@ -1101,6 +1107,8 @@ static void parse_scsi_prefs(void) if (str) sscanf(str, "%[^/]/%ld", scsi_dev[i], &scsi_unit[i]); } + + scsi_memtype = PrefsFindInt32("scsimemtype"); } // Read settings from gadgets and set preferences @@ -1125,32 +1133,47 @@ static void create_scsi_pane(struct Layo parse_scsi_prefs(); VGROUP; - for (int i=0; i<7; i++) { - HGROUP; - LT_New(h, LA_Type, TEXT_KIND, - LA_LabelID, STR_SCSI_ID_0 + i, - TAG_END - ); - LT_New(h, LA_Type, STRING_KIND, - LA_LabelID, STR_DEVICE_CTRL, - LA_ID, GAD_SCSI0_DEVICE + i, - LA_Chars, 20, - LA_STRPTR, (ULONG)scsi_dev[i], - GTST_MaxChars, sizeof(scsi_dev[i]) - 1, - LAST_Picker, TRUE, - TAG_END - ); - LT_New(h, LA_Type, INTEGER_KIND, - LA_LabelID, STR_UNIT_CTRL, - LA_ID, GAD_SCSI0_UNIT + i, - LA_Chars, 4, - LA_LONG, (ULONG)&scsi_unit[i], - LAIN_UseIncrementers, TRUE, - GTIN_MaxChars, 8, - TAG_END - ); - ENDGROUP; - } + LT_New(h, LA_Type, VERTICAL_KIND, + LA_LabelID, STR_SCSI_DEVICES_CTRL, + TAG_END + ); + for (int i=0; i<7; i++) { + HGROUP; + LT_New(h, LA_Type, TEXT_KIND, + LA_LabelID, STR_SCSI_ID_0 + i, + TAG_END + ); + LT_New(h, LA_Type, STRING_KIND, + LA_LabelID, STR_DEVICE_CTRL, + LA_ID, GAD_SCSI0_DEVICE + i, + LA_Chars, 20, + LA_STRPTR, (ULONG)scsi_dev[i], + GTST_MaxChars, sizeof(scsi_dev[i]) - 1, + LAST_Picker, TRUE, + TAG_END + ); + LT_New(h, LA_Type, INTEGER_KIND, + LA_LabelID, STR_UNIT_CTRL, + LA_ID, GAD_SCSI0_UNIT + i, + LA_Chars, 4, + LA_LONG, (ULONG)&scsi_unit[i], + LAIN_UseIncrementers, TRUE, + GTIN_MaxChars, 8, + TAG_END + ); + ENDGROUP; + } + ENDGROUP; + VGROUP; + LT_New(h, LA_Type, CYCLE_KIND, + LA_LabelID, STR_SCSI_MEMTYPE_CTRL, + LA_ID, GAD_SCSI_MEMTYPE, + LACY_FirstLabel, STR_MEMTYPE_CHIP_LAB, + LACY_LastLabel, STR_MEMTYPE_ANY_LAB, + LA_LONG, (ULONG)&scsi_memtype, + TAG_END + ); + ENDGROUP; ENDGROUP; } @@ -1166,7 +1189,7 @@ enum { DISPLAY_SCREEN }; -static BYTE display_type; +static LONG display_type; static LONG dis_width, dis_height; static ULONG mode_id; static BYTE frameskip_num; @@ -1210,9 +1233,9 @@ static void parse_graphics_prefs(void) const char *str = PrefsFindString("screen"); if (str) { - if (sscanf(str, "win/%d/%d", &dis_width, &dis_height) == 2) + if (sscanf(str, "win/%ld/%ld", &dis_width, &dis_height) == 2) display_type = DISPLAY_WINDOW; - else if (sscanf(str, "pip/%d/%d", &dis_width, &dis_height) == 2) + else if (sscanf(str, "pip/%ld/%ld", &dis_width, &dis_height) == 2) display_type = DISPLAY_PIP; else if (sscanf(str, "scr/%08lx", &mode_id) == 1) display_type = DISPLAY_SCREEN; @@ -1271,24 +1294,21 @@ static void screen_mode_req(struct Windo ULONG id; - if (CyberGfxBase) - { + // Try P96 first, because it also provides a (fake) cybergraphics.library + if (P96Base) { + id = p96RequestModeIDTags( + P96MA_MinDepth, 8, + P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, + TAG_END + ); + } else { UWORD ModelArray[] = { PIXFMT_LUT8, PIXFMT_RGB15, PIXFMT_ARGB32, 0, ~0 }; - id = (ULONG) CModeRequestTags(NULL, CYBRMREQ_MinDepth, 8, CYBRMREQ_CModelArray, (ULONG) ModelArray, TAG_END - ); - } - else - { - id = p96RequestModeIDTags( - P96MA_MinDepth, 8, - P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, - TAG_END ); - } + } LT_UnlockWindow(win); if (id != INVALID_ID) { @@ -1371,7 +1391,7 @@ static void create_graphics_pane(struct LA_LabelID, STR_VIDEO_TYPE_CTRL, LA_ID, GAD_VIDEO_TYPE, LACY_LabelTable, (ULONG)labels, - LA_BYTE, (ULONG)&display_type, + LA_LONG, (ULONG)&display_type, TAG_END ); LT_New(h, LA_Type, INTEGER_KIND, @@ -1469,13 +1489,11 @@ static void parse_serial_prefs(void) ether_unit = 0; const char *str = PrefsFindString("ether"); - if (str) - { + if (str) { const char *FirstSlash = strchr(str, '/'); const char *LastSlash = strrchr(str, '/'); - if (FirstSlash && FirstSlash && FirstSlash != LastSlash) - { + if (FirstSlash && FirstSlash && FirstSlash != LastSlash) { // Device name contains path, i.e. "Networks/xyzzy.device" const char *lp = str; char *dp = ether_dev; @@ -1487,12 +1505,10 @@ static void parse_serial_prefs(void) sscanf(LastSlash, "/%ld", ðer_unit); // printf("dev=<%s> unit=%d\n", ether_dev, ether_unit); - } - else - { + } else { sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); - } } + } } // Set serial preference item