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; |
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}; |
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) |
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 |
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, |
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 |
|
|
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; |
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; |
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 |
|
|
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 |
|
|
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 |
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) |
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, |
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; |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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; |
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; |
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]; |
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 |
|
|
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 |
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 |
|
} |
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 |
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, |
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 |
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 |
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; |
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); |
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 |
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 |
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 |
|
); |
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 |
|
|
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) |
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 |
|
} |
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 |
|
); |
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, |
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 |
|
); |
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; |
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; |
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, ðer_unit); |
1450 |
|
} |
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, |
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 |
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 |
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; |
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 |
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 |
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; |
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 |
1554 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1555 |
|
LA_LabelID, STR_UNIT_CTRL, |
1556 |
|
LA_ID, GAD_ETHER_UNIT, |
1557 |
< |
LA_LONG, ðer_unit, |
1557 |
> |
LA_LONG, (ULONG)ðer_unit, |
1558 |
|
LAIN_UseIncrementers, TRUE, |
1559 |
|
GTIN_MaxChars, 8, |
1560 |
|
TAG_END |
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 |
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 |