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 |
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> |
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" |
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; |
145 |
|
* Locale hook - returns string for given ID |
146 |
|
*/ |
147 |
|
|
145 |
– |
#ifdef __GNUC__ |
148 |
|
static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) |
147 |
– |
#else |
148 |
– |
static __saveds __regargs const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) |
149 |
– |
#endif |
149 |
|
{ |
150 |
|
return GetString((uint32)id); |
151 |
|
} |
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 |
|
|
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 |
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 |
976 |
|
VGROUP; |
977 |
|
LT_New(h, LA_Type, LISTVIEW_KIND, |
978 |
|
LA_ID, GAD_DISK_LIST, |
979 |
+ |
LA_Chars, 20, |
980 |
|
GTLV_Labels, (ULONG)&disk_list, |
981 |
|
LALV_Lines, 6, |
982 |
|
LALV_Link, (ULONG)NIL_LINK, |
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; |
1057 |
|
ENDGROUP; |
1058 |
|
} |
1059 |
|
|
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 (P96Base) { |
1252 |
> |
id = p96RequestModeIDTags( |
1253 |
> |
P96MA_MinDepth, 8, |
1254 |
> |
P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, |
1255 |
> |
TAG_END |
1256 |
> |
); |
1257 |
> |
} else { |
1258 |
> |
UWORD model_array[] = {PIXFMT_LUT8, PIXFMT_RGB16, PIXFMT_ARGB32, 0, ~0}; |
1259 |
> |
id = (ULONG) CModeRequestTags(NULL, |
1260 |
> |
CYBRMREQ_MinDepth, 8, |
1261 |
> |
CYBRMREQ_CModelArray, (ULONG)model_array, |
1262 |
> |
TAG_END |
1263 |
> |
); |
1264 |
> |
} |
1265 |
|
LT_UnlockWindow(win); |
1266 |
|
|
1267 |
|
if (id != INVALID_ID) { |