27 |
|
#include <libraries/asl.h> |
28 |
|
#include <libraries/gtlayout.h> |
29 |
|
#include <libraries/Picasso96.h> |
30 |
+ |
#include <cybergraphx/cybergraphics.h> // jl |
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> // jl |
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 |
|
|
428 |
|
case GAD_SCSI6_DEVICE: |
429 |
|
case GAD_SERIALA_DEVICE: |
430 |
|
case GAD_SERIALB_DEVICE: |
431 |
+ |
if (dev_request) { |
432 |
+ |
LT_LockWindow(win); |
433 |
+ |
BOOL result = AslRequestTags(dev_request, |
434 |
+ |
ASLFR_Window, (ULONG)win, |
435 |
+ |
ASLFR_InitialDrawer, (ULONG) "Devs:", |
436 |
+ |
TAG_END); |
437 |
+ |
LT_UnlockWindow(win); |
438 |
+ |
if (result) { |
439 |
+ |
char *str; |
440 |
+ |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
441 |
+ |
strncpy(str, dev_request->rf_File, 255); // Don't copy the directory part. This is usually "DEVS:" and we don't need that. |
442 |
+ |
str[255] = 0; |
443 |
+ |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
444 |
+ |
} |
445 |
+ |
} |
446 |
+ |
break; |
447 |
+ |
|
448 |
|
case GAD_ETHER_DEVICE: |
449 |
|
if (dev_request) { |
450 |
|
LT_LockWindow(win); |
451 |
< |
BOOL result = AslRequestTags(dev_request, ASLFR_Window, win, TAG_END); |
451 |
> |
BOOL result = AslRequestTags(dev_request, |
452 |
> |
ASLFR_Window, (ULONG)win, |
453 |
> |
ASLFR_InitialDrawer, (ULONG) "Devs:Networks", |
454 |
> |
TAG_END); |
455 |
|
LT_UnlockWindow(win); |
456 |
|
if (result) { |
457 |
|
char *str; |
458 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
458 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
459 |
|
strncpy(str, dev_request->rf_File, 255); // Don't copy the directory part. This is usually "DEVS:" and we don't need that. |
460 |
|
str[255] = 0; |
461 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
461 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
462 |
|
} |
463 |
|
} |
464 |
|
break; |
466 |
|
case GAD_ROM_FILE: |
467 |
|
if (file_request) { |
468 |
|
LT_LockWindow(win); |
469 |
< |
BOOL result = AslRequestTags(file_request, ASLFR_Window, win, TAG_END); |
469 |
> |
BOOL result = AslRequestTags(file_request, ASLFR_Window, (ULONG)win, TAG_END); |
470 |
|
LT_UnlockWindow(win); |
471 |
|
if (result) { |
472 |
|
char *str; |
473 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
473 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
474 |
|
strncpy(str, file_request->rf_Dir, 255); |
475 |
|
str[255] = 0; |
476 |
|
AddPart(str, file_request->rf_File, 255); |
477 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
477 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
478 |
|
} |
479 |
|
} |
480 |
|
break; |
533 |
|
FreeAslRequest(dev_request); |
534 |
|
FreeAslRequest(file_request); |
535 |
|
|
536 |
+ |
// Delete Menus jl |
537 |
+ |
LT_DisposeMenu(menu); |
538 |
+ |
|
539 |
|
// Delete handle |
540 |
|
LT_DeleteHandle(h); |
541 |
|
|
550 |
|
*/ |
551 |
|
|
552 |
|
static struct List disk_list; |
553 |
< |
static char cdrom_name[256]; |
553 |
> |
static char cdrom_name[256], extfs_name[256]; |
554 |
|
static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize; |
555 |
|
static BYTE bootdriver_num, nocdrom; |
556 |
|
|
585 |
|
} |
586 |
|
|
587 |
|
nocdrom = PrefsFindBool("nocdrom"); |
588 |
+ |
|
589 |
+ |
extfs_name[0] = 0; |
590 |
+ |
str = PrefsFindString("extfs"); |
591 |
+ |
if (str) |
592 |
+ |
strncpy(extfs_name, str, sizeof(extfs_name) - 1); |
593 |
|
} |
594 |
|
|
595 |
|
// Ghost/unghost "Edit" and "Remove" buttons |
676 |
|
struct Window *win = NULL; |
677 |
|
h = LT_CreateHandleTags(NULL, |
678 |
|
LAHN_AutoActivate, FALSE, |
679 |
< |
LAHN_LocaleHook, &locale_hook, |
679 |
> |
LAHN_LocaleHook, (ULONG)&locale_hook, |
680 |
|
TAG_END |
681 |
|
); |
682 |
|
if (h == NULL) |
689 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
690 |
|
LA_LabelID, STR_VOL_READONLY_CTRL, |
691 |
|
LA_ID, GAD_VOLUME_READONLY, |
692 |
< |
LA_BYTE, &read_only, |
692 |
> |
LA_BYTE, (ULONG)&read_only, |
693 |
|
TAG_END |
694 |
|
); |
695 |
|
LT_New(h, LA_Type, CYCLE_KIND, |
698 |
|
LACY_AutoPageID, GAD_VOLUME_PAGEGROUP, |
699 |
|
LACY_FirstLabel, STR_VOL_FILE_LAB, |
700 |
|
LACY_LastLabel, STR_VOL_DEVICE_LAB, |
701 |
< |
LA_BYTE, &is_device, |
701 |
> |
LA_BYTE, (ULONG)&is_device, |
702 |
|
TAG_END |
703 |
|
); |
704 |
|
ENDGROUP; |
712 |
|
LA_LabelID, STR_VOL_FILE_CTRL, |
713 |
|
LA_ID, GAD_VOLUME_FILE, |
714 |
|
LA_Chars, 20, |
715 |
< |
LA_STRPTR, file_name, |
715 |
> |
LA_STRPTR, (ULONG)file_name, |
716 |
|
GTST_MaxChars, sizeof(file_name) - 1, |
717 |
|
LAST_Picker, TRUE, |
718 |
|
TAG_END |
723 |
|
LA_LabelID, STR_DEVICE_CTRL, |
724 |
|
LA_ID, GAD_VOLUME_DEVICE, |
725 |
|
LA_Chars, 20, |
726 |
< |
LA_STRPTR, dev_name, |
726 |
> |
LA_STRPTR, (ULONG)dev_name, |
727 |
|
GTST_MaxChars, sizeof(dev_name) - 1, |
728 |
|
LAST_Picker, TRUE, |
729 |
|
TAG_END |
731 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
732 |
|
LA_LabelID, STR_UNIT_CTRL, |
733 |
|
LA_ID, GAD_VOLUME_UNIT, |
734 |
< |
LA_LONG, &dev_unit, |
734 |
> |
LA_LONG, (ULONG)&dev_unit, |
735 |
|
LAIN_UseIncrementers, TRUE, |
736 |
|
GTIN_MaxChars, 8, |
737 |
|
TAG_END |
739 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
740 |
|
LA_LabelID, STR_VOL_OPENFLAGS_CTRL, |
741 |
|
LA_ID, GAD_VOLUME_OPENFLAGS, |
742 |
< |
LA_LONG, &dev_flags, |
742 |
> |
LA_LONG, (ULONG)&dev_flags, |
743 |
|
LAIN_UseIncrementers, TRUE, |
744 |
|
GTIN_MaxChars, 8, |
745 |
|
TAG_END |
747 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
748 |
|
LA_LabelID, STR_VOL_STARTBLOCK_CTRL, |
749 |
|
LA_ID, GAD_VOLUME_STARTBLOCK, |
750 |
< |
LA_LONG, &dev_start, |
750 |
> |
LA_LONG, (ULONG)&dev_start, |
751 |
|
LAIN_UseIncrementers, TRUE, |
752 |
|
GTIN_MaxChars, 8, |
753 |
|
TAG_END |
755 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
756 |
|
LA_LabelID, STR_VOL_SIZE_CTRL, |
757 |
|
LA_ID, GAD_VOLUME_SIZE, |
758 |
< |
LA_LONG, &dev_size, |
758 |
> |
LA_LONG, (ULONG)&dev_size, |
759 |
|
LAIN_UseIncrementers, TRUE, |
760 |
|
GTIN_MaxChars, 8, |
761 |
|
TAG_END |
763 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
764 |
|
LA_LabelID, STR_VOL_BLOCKSIZE_CTRL, |
765 |
|
LA_ID, GAD_VOLUME_BLOCKSIZE, |
766 |
< |
LA_LONG, &dev_bsize, |
766 |
> |
LA_LONG, (ULONG)&dev_bsize, |
767 |
|
LAIN_UseIncrementers, TRUE, |
768 |
|
GTIN_MaxChars, 8, |
769 |
|
TAG_END |
863 |
|
req = dev_request; |
864 |
|
do_req: if (req) { |
865 |
|
LT_LockWindow(win); |
866 |
< |
BOOL result = AslRequestTags(req, ASLFR_Window, win, TAG_END); |
866 |
> |
BOOL result = AslRequestTags(req, ASLFR_Window, (ULONG)win, TAG_END); |
867 |
|
LT_UnlockWindow(win); |
868 |
|
if (result) { |
869 |
|
char *str; |
870 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
870 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
871 |
|
if (gad->GadgetID == GAD_VOLUME_FILE) { |
872 |
|
strncpy(str, req->rf_Dir, 255); |
873 |
|
str[255] = 0; |
885 |
|
LT_SetAttributes(h, GAD_VOLUME_BLOCKSIZE, GTIN_Number, dev_bsize, TAG_END); |
886 |
|
} |
887 |
|
} |
888 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
888 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
889 |
|
} |
890 |
|
} |
891 |
|
break; |
896 |
|
} |
897 |
|
} while (!done); |
898 |
|
|
867 |
– |
// Delete handle |
868 |
– |
LT_DeleteHandle(h); |
869 |
– |
|
899 |
|
// Update preferences and list view |
900 |
|
if (ok_clicked) { |
901 |
|
char str[256]; |
910 |
|
if (adding) { |
911 |
|
|
912 |
|
// Add new item |
913 |
+ |
int i; |
914 |
|
PrefsAddString("disk", str); |
915 |
|
struct Node *item = (struct Node *)AllocMem(sizeof(struct Node), MEMF_CLEAR); |
916 |
< |
for (int i=0; PrefsFindString("disk", i); i++) ; |
916 |
> |
for (i=0; PrefsFindString("disk", i); i++) ; |
917 |
|
item->ln_Name = (char *)PrefsFindString("disk", i - 1); |
918 |
|
AddTail(&disk_list, item); |
919 |
|
|
930 |
|
item = item->ln_Succ; |
931 |
|
} |
932 |
|
} |
933 |
< |
LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, &disk_list, TAG_END); |
933 |
> |
LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, TAG_END); |
934 |
|
ghost_volumes_gadgets(h2); |
935 |
|
} |
936 |
+ |
|
937 |
+ |
// Delete handle |
938 |
+ |
LT_DeleteHandle(h); |
939 |
|
} |
940 |
|
|
941 |
|
// Remove volume from list |
957 |
|
} |
958 |
|
item = next; |
959 |
|
} |
960 |
< |
LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, &disk_list, GTLV_Selected, 0xffff, TAG_END); |
960 |
> |
LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, GTLV_Selected, 0xffff, TAG_END); |
961 |
|
ghost_volumes_gadgets(h); |
962 |
|
} |
963 |
|
} |
981 |
|
PrefsRemoveItem("cdrom"); |
982 |
|
|
983 |
|
PrefsReplaceBool("nocdrom", nocdrom); |
984 |
+ |
|
985 |
+ |
if (strlen(extfs_name)) |
986 |
+ |
PrefsReplaceString("extfs", extfs_name); |
987 |
|
} |
988 |
|
|
989 |
|
// Create "Volumes" pane |
999 |
|
VGROUP; |
1000 |
|
LT_New(h, LA_Type, LISTVIEW_KIND, |
1001 |
|
LA_ID, GAD_DISK_LIST, |
1002 |
< |
GTLV_Labels, &disk_list, |
1002 |
> |
LA_Chars, 20, |
1003 |
> |
GTLV_Labels, (ULONG)&disk_list, |
1004 |
|
LALV_Lines, 6, |
1005 |
< |
LALV_Link, NIL_LINK, |
1005 |
> |
LALV_Link, (ULONG)NIL_LINK, |
1006 |
|
LALV_ResizeX, TRUE, |
1007 |
|
LALV_ResizeY, TRUE, |
1008 |
|
LALV_Selected, 0, |
1039 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1040 |
|
LA_ID, GAD_CDROM_DEVICE, |
1041 |
|
LA_Chars, 20, |
1042 |
< |
LA_STRPTR, cdrom_name, |
1042 |
> |
LA_STRPTR, (ULONG)cdrom_name, |
1043 |
|
GTST_MaxChars, sizeof(cdrom_name) - 1, |
1044 |
|
LAST_Picker, TRUE, |
1045 |
|
TAG_END |
1047 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1048 |
|
LA_LabelID, STR_UNIT_CTRL, |
1049 |
|
LA_ID, GAD_CDROM_UNIT, |
1050 |
< |
LA_LONG, &cdrom_unit, |
1050 |
> |
LA_LONG, (ULONG)&cdrom_unit, |
1051 |
|
LAIN_UseIncrementers, TRUE, |
1052 |
|
GTIN_MaxChars, 8, |
1053 |
|
TAG_END |
1057 |
|
LA_ID, GAD_BOOTDRIVER, |
1058 |
|
LACY_FirstLabel, STR_BOOT_ANY_LAB, |
1059 |
|
LACY_LastLabel, STR_BOOT_CDROM_LAB, |
1060 |
< |
LA_BYTE, &bootdriver_num, |
1060 |
> |
LA_BYTE, (ULONG)&bootdriver_num, |
1061 |
|
TAG_END |
1062 |
|
); |
1063 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1064 |
|
LA_LabelID, STR_NOCDROM_CTRL, |
1065 |
|
LA_ID, GAD_NOCDROM, |
1066 |
< |
LA_BYTE, &nocdrom, |
1066 |
> |
LA_BYTE, (ULONG)&nocdrom, |
1067 |
> |
TAG_END |
1068 |
> |
); |
1069 |
> |
ENDGROUP; |
1070 |
> |
VGROUP; |
1071 |
> |
LT_New(h, LA_Type, STRING_KIND, |
1072 |
> |
LA_LabelID, STR_EXTFS_CTRL, |
1073 |
> |
LA_ID, GAD_EXTFS, |
1074 |
> |
LA_Chars, 20, |
1075 |
> |
LA_STRPTR, (ULONG)extfs_name, |
1076 |
> |
GTST_MaxChars, sizeof(extfs_name) - 1, |
1077 |
|
TAG_END |
1078 |
|
); |
1079 |
|
ENDGROUP; |
1112 |
|
|
1113 |
|
if (strlen(scsi_dev[i])) { |
1114 |
|
char str[256]; |
1115 |
< |
sprintf("%s/%ld", scsi_dev[i], scsi_unit[i]); |
1115 |
> |
sprintf(str, "%s/%ld", scsi_dev[i], scsi_unit[i]); |
1116 |
|
PrefsReplaceString(prefs_name, str); |
1117 |
|
} else |
1118 |
|
PrefsRemoveItem(prefs_name); |
1135 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1136 |
|
LA_ID, GAD_SCSI0_DEVICE + i, |
1137 |
|
LA_Chars, 20, |
1138 |
< |
LA_STRPTR, scsi_dev[i], |
1138 |
> |
LA_STRPTR, (ULONG)scsi_dev[i], |
1139 |
|
GTST_MaxChars, sizeof(scsi_dev[i]) - 1, |
1140 |
|
LAST_Picker, TRUE, |
1141 |
|
TAG_END |
1144 |
|
LA_LabelID, STR_UNIT_CTRL, |
1145 |
|
LA_ID, GAD_SCSI0_UNIT + i, |
1146 |
|
LA_Chars, 4, |
1147 |
< |
LA_LONG, &scsi_unit[i], |
1147 |
> |
LA_LONG, (ULONG)&scsi_unit[i], |
1148 |
|
LAIN_UseIncrementers, TRUE, |
1149 |
|
GTIN_MaxChars, 8, |
1150 |
|
TAG_END |
1224 |
|
if (str) { |
1225 |
|
if (sscanf(str, "ahi/%08lx", &ahi_id) == 1 && AHIBase) { |
1226 |
|
AHI_GetAudioAttrs(ahi_id, NULL, |
1227 |
< |
AHIDB_Name, ahi_mode_name, |
1227 |
> |
AHIDB_Name, (ULONG)ahi_mode_name, |
1228 |
|
AHIDB_BufferLen, sizeof(ahi_mode_name) - 1, |
1229 |
|
TAG_END |
1230 |
|
); |
1264 |
|
// Show screen mode requester |
1265 |
|
static void screen_mode_req(struct Window *win, struct LayoutHandle *h) |
1266 |
|
{ |
1267 |
< |
if (P96Base == NULL) |
1267 |
> |
if (P96Base == NULL && CyberGfxBase == NULL) |
1268 |
|
return; |
1269 |
|
|
1270 |
|
LT_LockWindow(win); |
1271 |
< |
ULONG id = p96RequestModeIDTags( |
1272 |
< |
P96MA_MinDepth, 8, |
1273 |
< |
P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, |
1274 |
< |
TAG_END |
1275 |
< |
); |
1271 |
> |
|
1272 |
> |
ULONG id; |
1273 |
> |
|
1274 |
> |
if (CyberGfxBase) |
1275 |
> |
{ |
1276 |
> |
UWORD ModelArray[] = { PIXFMT_LUT8, PIXFMT_RGB15, PIXFMT_ARGB32, 0, ~0 }; |
1277 |
> |
|
1278 |
> |
id = (ULONG) CModeRequestTags(NULL, |
1279 |
> |
CYBRMREQ_MinDepth, 8, |
1280 |
> |
CYBRMREQ_CModelArray, (ULONG) ModelArray, |
1281 |
> |
TAG_END |
1282 |
> |
); |
1283 |
> |
} |
1284 |
> |
else |
1285 |
> |
{ |
1286 |
> |
id = p96RequestModeIDTags( |
1287 |
> |
P96MA_MinDepth, 8, |
1288 |
> |
P96MA_FormatsAllowed, RGBFF_CLUT | RGBFF_R5G5B5 | RGBFF_A8R8G8B8, |
1289 |
> |
TAG_END |
1290 |
> |
); |
1291 |
> |
} |
1292 |
|
LT_UnlockWindow(win); |
1293 |
|
|
1294 |
|
if (id != INVALID_ID) { |
1295 |
|
mode_id = id; |
1296 |
|
GetDisplayInfoData(NULL, (UBYTE *)&mode_name, sizeof(mode_name), DTAG_NAME, mode_id); |
1297 |
< |
LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, mode_name.Name, TAG_END); |
1297 |
> |
LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, (ULONG)mode_name.Name, TAG_END); |
1298 |
|
} |
1299 |
|
} |
1300 |
|
|
1305 |
|
return; |
1306 |
|
|
1307 |
|
struct AHIAudioModeRequester *req = AHI_AllocAudioRequest( |
1308 |
< |
AHIR_Window, win, |
1308 |
> |
AHIR_Window, (ULONG)win, |
1309 |
|
TAG_END |
1310 |
|
); |
1311 |
|
if (req == NULL) |
1321 |
|
if (ok) { |
1322 |
|
ahi_id = req->ahiam_AudioID; |
1323 |
|
AHI_GetAudioAttrs(ahi_id, NULL, |
1324 |
< |
AHIDB_Name, ahi_mode_name, |
1324 |
> |
AHIDB_Name, (ULONG)ahi_mode_name, |
1325 |
|
AHIDB_BufferLen, sizeof(ahi_mode_name) - 1, |
1326 |
|
TAG_END |
1327 |
|
); |
1328 |
< |
LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, ahi_mode_name, TAG_END); |
1328 |
> |
LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, (ULONG)ahi_mode_name, TAG_END); |
1329 |
|
} |
1330 |
|
AHI_FreeAudioRequest(req); |
1331 |
|
} |
1370 |
|
LT_New(h, LA_Type, CYCLE_KIND, |
1371 |
|
LA_LabelID, STR_VIDEO_TYPE_CTRL, |
1372 |
|
LA_ID, GAD_VIDEO_TYPE, |
1373 |
< |
LACY_LabelTable, labels, |
1374 |
< |
LA_BYTE, &display_type, |
1373 |
> |
LACY_LabelTable, (ULONG)labels, |
1374 |
> |
LA_BYTE, (ULONG)&display_type, |
1375 |
|
TAG_END |
1376 |
|
); |
1377 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1378 |
|
LA_LabelID, STR_DISPLAY_X_CTRL, |
1379 |
|
LA_ID, GAD_DISPLAY_X, |
1380 |
< |
LA_LONG, &dis_width, |
1380 |
> |
LA_LONG, (ULONG)&dis_width, |
1381 |
|
GTIN_MaxChars, 8, |
1382 |
|
TAG_END |
1383 |
|
); |
1384 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1385 |
|
LA_LabelID, STR_DISPLAY_Y_CTRL, |
1386 |
|
LA_ID, GAD_DISPLAY_Y, |
1387 |
< |
LA_LONG, &dis_height, |
1387 |
> |
LA_LONG, (ULONG)&dis_height, |
1388 |
|
GTIN_MaxChars, 8, |
1389 |
|
TAG_END |
1390 |
|
); |
1393 |
|
LA_ID, GAD_FRAMESKIP, |
1394 |
|
LAPU_FirstLabel, STR_REF_5HZ_LAB, |
1395 |
|
LAPU_LastLabel, STR_REF_60HZ_LAB, |
1396 |
< |
LA_BYTE, &frameskip_num, |
1396 |
> |
LA_BYTE, (ULONG)&frameskip_num, |
1397 |
|
TAG_END |
1398 |
|
); |
1399 |
|
LT_New(h, LA_Type, TEXT_KIND, |
1401 |
|
LA_ID, GAD_SCREEN_MODE, |
1402 |
|
LA_Chars, DISPLAYNAMELEN, |
1403 |
|
LATX_Picker, TRUE, |
1404 |
< |
GTTX_Text, mode_name.Name, |
1404 |
> |
GTTX_Text, (ULONG)mode_name.Name, |
1405 |
|
GTTX_Border, TRUE, |
1406 |
|
TAG_END |
1407 |
|
); |
1415 |
|
LA_ID, GAD_AHI_MODE, |
1416 |
|
LA_Chars, DISPLAYNAMELEN, |
1417 |
|
LATX_Picker, TRUE, |
1418 |
< |
GTTX_Text, ahi_mode_name, |
1418 |
> |
GTTX_Text, (ULONG)ahi_mode_name, |
1419 |
|
GTTX_Border, TRUE, |
1420 |
|
TAG_END |
1421 |
|
); |
1422 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1423 |
|
LA_LabelID, STR_NOSOUND_CTRL, |
1424 |
|
LA_ID, GAD_NOSOUND, |
1425 |
< |
LA_BYTE, &nosound, |
1425 |
> |
LA_BYTE, (ULONG)&nosound, |
1426 |
|
TAG_END |
1427 |
|
); |
1428 |
|
ENDGROUP; |
1444 |
|
static ULONG ether_unit; |
1445 |
|
|
1446 |
|
// Read serial/network preferences |
1447 |
< |
static void parse_serial_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar) |
1447 |
> |
static void parse_ser_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar) |
1448 |
|
{ |
1449 |
|
dev[0] = 0; |
1450 |
|
unit = 0; |
1458 |
|
} |
1459 |
|
sscanf(str, "%[^/]/%ld", dev, &unit); |
1460 |
|
} |
1461 |
+ |
} |
1462 |
+ |
|
1463 |
+ |
static void parse_serial_prefs(void) |
1464 |
+ |
{ |
1465 |
+ |
parse_ser_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar); |
1466 |
+ |
parse_ser_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar); |
1467 |
|
|
1468 |
|
ether_dev[0] = 0; |
1469 |
|
ether_unit = 0; |
1470 |
|
|
1471 |
< |
str = PrefsFindString("ether"); |
1471 |
> |
const char *str = PrefsFindString("ether"); |
1472 |
|
if (str) |
1473 |
< |
sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); |
1473 |
> |
{ |
1474 |
> |
const char *FirstSlash = strchr(str, '/'); |
1475 |
> |
const char *LastSlash = strrchr(str, '/'); |
1476 |
> |
|
1477 |
> |
if (FirstSlash && FirstSlash && FirstSlash != LastSlash) |
1478 |
> |
{ |
1479 |
> |
// Device name contains path, i.e. "Networks/xyzzy.device" |
1480 |
> |
const char *lp = str; |
1481 |
> |
char *dp = ether_dev; |
1482 |
> |
|
1483 |
> |
while (lp != LastSlash) |
1484 |
> |
*dp++ = *lp++; |
1485 |
> |
*dp = '\0'; |
1486 |
> |
|
1487 |
> |
sscanf(LastSlash, "/%ld", ðer_unit); |
1488 |
> |
|
1489 |
> |
// printf("dev=<%s> unit=%d\n", ether_dev, ether_unit); |
1490 |
> |
} |
1491 |
> |
else |
1492 |
> |
{ |
1493 |
> |
sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); |
1494 |
> |
} |
1495 |
> |
} |
1496 |
|
} |
1497 |
|
|
1498 |
|
// Set serial preference item |
1514 |
|
|
1515 |
|
if (strlen(ether_dev)) { |
1516 |
|
char str[256]; |
1517 |
+ |
|
1518 |
|
sprintf(str, "%s/%ld", ether_dev, ether_unit); |
1519 |
|
PrefsReplaceString("ether", str); |
1520 |
|
} else |
1524 |
|
// Create "Serial/Network" pane |
1525 |
|
static void create_serial_pane(struct LayoutHandle *h) |
1526 |
|
{ |
1527 |
< |
parse_serial_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar); |
1436 |
< |
parse_serial_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar); |
1527 |
> |
parse_serial_prefs(); |
1528 |
|
|
1529 |
|
VGROUP; |
1530 |
|
LT_New(h, LA_Type, VERTICAL_KIND, |
1535 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1536 |
|
LA_ID, GAD_SERIALA_DEVICE, |
1537 |
|
LA_Chars, 20, |
1538 |
< |
LA_STRPTR, seriala_dev, |
1538 |
> |
LA_STRPTR, (ULONG)seriala_dev, |
1539 |
|
GTST_MaxChars, sizeof(seriala_dev) - 1, |
1540 |
|
LAST_Picker, TRUE, |
1541 |
|
TAG_END |
1543 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1544 |
|
LA_LabelID, STR_UNIT_CTRL, |
1545 |
|
LA_ID, GAD_SERIALA_UNIT, |
1546 |
< |
LA_LONG, &seriala_unit, |
1546 |
> |
LA_LONG, (ULONG)&seriala_unit, |
1547 |
|
LAIN_UseIncrementers, TRUE, |
1548 |
|
GTIN_MaxChars, 8, |
1549 |
|
TAG_END |
1551 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1552 |
|
LA_LabelID, STR_ISPAR_CTRL, |
1553 |
|
LA_ID, GAD_SERIALA_ISPAR, |
1554 |
< |
LA_BYTE, &seriala_ispar, |
1554 |
> |
LA_BYTE, (ULONG)&seriala_ispar, |
1555 |
|
TAG_END |
1556 |
|
); |
1557 |
|
ENDGROUP; |
1564 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1565 |
|
LA_ID, GAD_SERIALB_DEVICE, |
1566 |
|
LA_Chars, 20, |
1567 |
< |
LA_STRPTR, serialb_dev, |
1567 |
> |
LA_STRPTR, (ULONG)serialb_dev, |
1568 |
|
GTST_MaxChars, sizeof(serialb_dev) - 1, |
1569 |
|
LAST_Picker, TRUE, |
1570 |
|
TAG_END |
1572 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1573 |
|
LA_LabelID, STR_UNIT_CTRL, |
1574 |
|
LA_ID, GAD_SERIALB_UNIT, |
1575 |
< |
LA_LONG, &serialb_unit, |
1575 |
> |
LA_LONG, (ULONG)&serialb_unit, |
1576 |
|
LAIN_UseIncrementers, TRUE, |
1577 |
|
GTIN_MaxChars, 8, |
1578 |
|
TAG_END |
1580 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1581 |
|
LA_LabelID, STR_ISPAR_CTRL, |
1582 |
|
LA_ID, GAD_SERIALB_ISPAR, |
1583 |
< |
LA_BYTE, &serialb_ispar, |
1583 |
> |
LA_BYTE, (ULONG)&serialb_ispar, |
1584 |
|
TAG_END |
1585 |
|
); |
1586 |
|
ENDGROUP; |
1593 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1594 |
|
LA_ID, GAD_ETHER_DEVICE, |
1595 |
|
LA_Chars, 20, |
1596 |
< |
LA_STRPTR, ether_dev, |
1596 |
> |
LA_STRPTR, (ULONG)ether_dev, |
1597 |
|
GTST_MaxChars, sizeof(ether_dev) - 1, |
1598 |
|
LAST_Picker, TRUE, |
1599 |
|
TAG_END |
1601 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1602 |
|
LA_LabelID, STR_UNIT_CTRL, |
1603 |
|
LA_ID, GAD_ETHER_UNIT, |
1604 |
< |
LA_LONG, ðer_unit, |
1604 |
> |
LA_LONG, (ULONG)ðer_unit, |
1605 |
|
LAIN_UseIncrementers, TRUE, |
1606 |
|
GTIN_MaxChars, 8, |
1607 |
|
TAG_END |
1664 |
|
LA_LabelID, STR_RAMSIZE_SLIDER, |
1665 |
|
LA_ID, GAD_RAMSIZE, |
1666 |
|
LA_Chars, 20, |
1667 |
< |
LA_LONG, &ramsize_mb, |
1668 |
< |
GTSL_LevelFormat, GetString(STR_RAMSIZE_FMT), |
1667 |
> |
LA_LONG, (ULONG)&ramsize_mb, |
1668 |
> |
GTSL_LevelFormat, (ULONG)GetString(STR_RAMSIZE_FMT), |
1669 |
|
GTSL_Min, 1, |
1670 |
|
GTSL_Max, AvailMem(MEMF_LARGEST) >> 20, |
1671 |
|
TAG_END |
1675 |
|
LA_ID, GAD_MODELID, |
1676 |
|
LACY_FirstLabel, STR_MODELID_5_LAB, |
1677 |
|
LACY_LastLabel, STR_MODELID_14_LAB, |
1678 |
< |
LA_BYTE, &model_num, |
1678 |
> |
LA_BYTE, (ULONG)&model_num, |
1679 |
|
TAG_END |
1680 |
|
); |
1681 |
|
LT_New(h, LA_Type, STRING_KIND, |
1682 |
|
LA_LabelID, STR_ROM_FILE_CTRL, |
1683 |
|
LA_ID, GAD_ROM_FILE, |
1684 |
|
LA_Chars, 20, |
1685 |
< |
LA_STRPTR, rom_file, |
1685 |
> |
LA_STRPTR, (ULONG)rom_file, |
1686 |
|
GTST_MaxChars, sizeof(rom_file) - 1, |
1687 |
|
LAST_Picker, TRUE, |
1688 |
|
TAG_END |