65 |
|
const int GAD_CDROM_UNIT = 0x0305; |
66 |
|
const int GAD_BOOTDRIVER = 0x0306; |
67 |
|
const int GAD_NOCDROM = 0x0307; |
68 |
+ |
const int GAD_EXTFS = 0x0308; |
69 |
|
|
70 |
|
const int GAD_VOLUME_READONLY = 0x0310; // "Add/Edit Volume" window |
71 |
|
const int GAD_VOLUME_TYPE = 0x0311; |
140 |
|
|
141 |
|
|
142 |
|
/* |
143 |
< |
* Locale hook function - returns string for given ID |
143 |
> |
* Locale hook - returns string for given ID |
144 |
|
*/ |
145 |
|
|
146 |
< |
static __saveds __asm char *locale_hook_func(register __a0 struct Hook *hook, register __a2 struct LayoutHandle *h, register __a1 LONG id) |
146 |
> |
static __saveds __attribute__((regparm(3))) const char *locale_hook_func(struct Hook *hook /*a0*/, void *id /*a1*/, struct LayoutHandle *h /*a2*/) |
147 |
|
{ |
148 |
< |
return GetString(id); |
148 |
> |
return GetString((uint32)id); |
149 |
|
} |
150 |
|
|
151 |
|
struct Hook locale_hook = {{NULL, NULL}, (HOOKFUNC)locale_hook_func, NULL, NULL}; |
163 |
|
struct Window *win = NULL; |
164 |
|
struct Menu *menu = NULL; |
165 |
|
|
166 |
+ |
// Pane tabs |
167 |
+ |
static const LONG labels[] = { |
168 |
+ |
STR_VOLUMES_PANE_TITLE, |
169 |
+ |
STR_SCSI_PANE_TITLE, |
170 |
+ |
STR_GRAPHICS_SOUND_PANE_TITLE, |
171 |
+ |
STR_SERIAL_NETWORK_PANE_TITLE, |
172 |
+ |
STR_MEMORY_MISC_PANE_TITLE, |
173 |
+ |
-1 |
174 |
+ |
}; |
175 |
+ |
|
176 |
|
// Open gtlayout.library |
177 |
|
GTLayoutBase = (struct Library *)OpenLibrary((UBYTE *)"gtlayout.library", 39); |
178 |
|
if (GTLayoutBase == NULL) { |
179 |
|
WarningAlert(GetString(STR_NO_GTLAYOUT_LIB_WARN)); |
180 |
< |
goto quit; |
180 |
> |
return true; |
181 |
|
} |
182 |
|
|
183 |
|
// Create layout handle |
184 |
|
h = LT_CreateHandleTags(NULL, |
185 |
|
LAHN_AutoActivate, FALSE, |
186 |
< |
LAHN_LocaleHook, &locale_hook, |
186 |
> |
LAHN_LocaleHook, (ULONG)&locale_hook, |
187 |
|
TAG_END |
188 |
|
); |
189 |
|
if (h == NULL) |
191 |
|
|
192 |
|
// Create menus |
193 |
|
menu = LT_NewMenuTags( |
194 |
< |
LAMN_LayoutHandle, h, |
194 |
> |
LAMN_LayoutHandle, (ULONG)h, |
195 |
|
LAMN_TitleID, STR_PREFS_MENU, |
196 |
|
LAMN_ItemID, STR_PREFS_ITEM_ABOUT, |
197 |
|
LAMN_UserData, MSG_ABOUT, |
198 |
< |
LAMN_ItemText, NM_BARLABEL, |
198 |
> |
LAMN_ItemText, (ULONG)NM_BARLABEL, |
199 |
|
LAMN_ItemID, STR_PREFS_ITEM_START, |
200 |
|
LAMN_UserData, MSG_OK, |
201 |
|
LAMN_ItemID, STR_PREFS_ITEM_ZAP_PRAM, |
202 |
|
LAMN_UserData, MSG_ZAP_PRAM, |
203 |
< |
LAMN_ItemText, NM_BARLABEL, |
203 |
> |
LAMN_ItemText, (ULONG)NM_BARLABEL, |
204 |
|
LAMN_ItemID, STR_PREFS_ITEM_QUIT, |
205 |
|
LAMN_UserData, MSG_CANCEL, |
206 |
< |
LAMN_KeyText, "Q", |
206 |
> |
LAMN_KeyText, (ULONG)"Q", |
207 |
|
TAG_END |
208 |
|
); |
209 |
|
|
210 |
|
// Create window contents |
211 |
|
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 |
– |
}; |
212 |
|
VGROUP; |
213 |
|
LT_New(h, LA_Type, TAB_KIND, |
214 |
< |
LATB_LabelTable, labels, |
214 |
> |
LATB_LabelTable, (ULONG)labels, |
215 |
|
LATB_AutoPageID, GAD_PAGEGROUP, |
216 |
|
LATB_FullWidth, TRUE, |
217 |
|
TAG_END |
263 |
|
// Open window |
264 |
|
win = LT_Build(h, |
265 |
|
LAWN_TitleID, STR_PREFS_TITLE, |
266 |
< |
LAWN_Menu, menu, |
266 |
> |
LAWN_Menu, (ULONG)menu, |
267 |
|
LAWN_IDCMP, IDCMP_CLOSEWINDOW, |
268 |
|
LAWN_BelowMouse, TRUE, |
269 |
|
LAWN_SmartZoom, TRUE, |
281 |
|
dev_request = (struct FileRequester *)AllocAslRequestTags(ASL_FileRequest, |
282 |
|
ASLFR_DoPatterns, TRUE, |
283 |
|
ASLFR_RejectIcons, TRUE, |
284 |
< |
ASLFR_InitialDrawer, "DEVS:", |
285 |
< |
ASLFR_InitialPattern, "#?.device", |
284 |
> |
ASLFR_InitialDrawer, (ULONG)"DEVS:", |
285 |
> |
ASLFR_InitialPattern, (ULONG)"#?.device", |
286 |
|
TAG_END |
287 |
|
); |
288 |
|
file_request = (struct FileRequester *)AllocAslRequestTags(ASL_FileRequest, |
289 |
|
ASLFR_DoPatterns, TRUE, |
290 |
|
ASLFR_RejectIcons, TRUE, |
291 |
< |
ASLFR_InitialPattern, "#?", |
291 |
> |
ASLFR_InitialPattern, (ULONG)"#?", |
292 |
|
TAG_END |
293 |
|
); |
294 |
|
|
429 |
|
case GAD_ETHER_DEVICE: |
430 |
|
if (dev_request) { |
431 |
|
LT_LockWindow(win); |
432 |
< |
BOOL result = AslRequestTags(dev_request, ASLFR_Window, win, TAG_END); |
432 |
> |
BOOL result = AslRequestTags(dev_request, ASLFR_Window, (ULONG)win, TAG_END); |
433 |
|
LT_UnlockWindow(win); |
434 |
|
if (result) { |
435 |
|
char *str; |
436 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
436 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
437 |
|
strncpy(str, dev_request->rf_File, 255); // Don't copy the directory part. This is usually "DEVS:" and we don't need that. |
438 |
|
str[255] = 0; |
439 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
439 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
440 |
|
} |
441 |
|
} |
442 |
|
break; |
444 |
|
case GAD_ROM_FILE: |
445 |
|
if (file_request) { |
446 |
|
LT_LockWindow(win); |
447 |
< |
BOOL result = AslRequestTags(file_request, ASLFR_Window, win, TAG_END); |
447 |
> |
BOOL result = AslRequestTags(file_request, ASLFR_Window, (ULONG)win, TAG_END); |
448 |
|
LT_UnlockWindow(win); |
449 |
|
if (result) { |
450 |
|
char *str; |
451 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
451 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
452 |
|
strncpy(str, file_request->rf_Dir, 255); |
453 |
|
str[255] = 0; |
454 |
|
AddPart(str, file_request->rf_File, 255); |
455 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
455 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
456 |
|
} |
457 |
|
} |
458 |
|
break; |
525 |
|
*/ |
526 |
|
|
527 |
|
static struct List disk_list; |
528 |
< |
static char cdrom_name[256]; |
528 |
> |
static char cdrom_name[256], extfs_name[256]; |
529 |
|
static ULONG cdrom_unit, cdrom_flags, cdrom_start, cdrom_size, cdrom_bsize; |
530 |
|
static BYTE bootdriver_num, nocdrom; |
531 |
|
|
560 |
|
} |
561 |
|
|
562 |
|
nocdrom = PrefsFindBool("nocdrom"); |
563 |
+ |
|
564 |
+ |
extfs_name[0] = 0; |
565 |
+ |
str = PrefsFindString("extfs"); |
566 |
+ |
if (str) |
567 |
+ |
strncpy(extfs_name, str, sizeof(extfs_name) - 1); |
568 |
|
} |
569 |
|
|
570 |
|
// Ghost/unghost "Edit" and "Remove" buttons |
651 |
|
struct Window *win = NULL; |
652 |
|
h = LT_CreateHandleTags(NULL, |
653 |
|
LAHN_AutoActivate, FALSE, |
654 |
< |
LAHN_LocaleHook, &locale_hook, |
654 |
> |
LAHN_LocaleHook, (ULONG)&locale_hook, |
655 |
|
TAG_END |
656 |
|
); |
657 |
|
if (h == NULL) |
664 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
665 |
|
LA_LabelID, STR_VOL_READONLY_CTRL, |
666 |
|
LA_ID, GAD_VOLUME_READONLY, |
667 |
< |
LA_BYTE, &read_only, |
667 |
> |
LA_BYTE, (ULONG)&read_only, |
668 |
|
TAG_END |
669 |
|
); |
670 |
|
LT_New(h, LA_Type, CYCLE_KIND, |
673 |
|
LACY_AutoPageID, GAD_VOLUME_PAGEGROUP, |
674 |
|
LACY_FirstLabel, STR_VOL_FILE_LAB, |
675 |
|
LACY_LastLabel, STR_VOL_DEVICE_LAB, |
676 |
< |
LA_BYTE, &is_device, |
676 |
> |
LA_BYTE, (ULONG)&is_device, |
677 |
|
TAG_END |
678 |
|
); |
679 |
|
ENDGROUP; |
687 |
|
LA_LabelID, STR_VOL_FILE_CTRL, |
688 |
|
LA_ID, GAD_VOLUME_FILE, |
689 |
|
LA_Chars, 20, |
690 |
< |
LA_STRPTR, file_name, |
690 |
> |
LA_STRPTR, (ULONG)file_name, |
691 |
|
GTST_MaxChars, sizeof(file_name) - 1, |
692 |
|
LAST_Picker, TRUE, |
693 |
|
TAG_END |
698 |
|
LA_LabelID, STR_DEVICE_CTRL, |
699 |
|
LA_ID, GAD_VOLUME_DEVICE, |
700 |
|
LA_Chars, 20, |
701 |
< |
LA_STRPTR, dev_name, |
701 |
> |
LA_STRPTR, (ULONG)dev_name, |
702 |
|
GTST_MaxChars, sizeof(dev_name) - 1, |
703 |
|
LAST_Picker, TRUE, |
704 |
|
TAG_END |
706 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
707 |
|
LA_LabelID, STR_UNIT_CTRL, |
708 |
|
LA_ID, GAD_VOLUME_UNIT, |
709 |
< |
LA_LONG, &dev_unit, |
709 |
> |
LA_LONG, (ULONG)&dev_unit, |
710 |
|
LAIN_UseIncrementers, TRUE, |
711 |
|
GTIN_MaxChars, 8, |
712 |
|
TAG_END |
714 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
715 |
|
LA_LabelID, STR_VOL_OPENFLAGS_CTRL, |
716 |
|
LA_ID, GAD_VOLUME_OPENFLAGS, |
717 |
< |
LA_LONG, &dev_flags, |
717 |
> |
LA_LONG, (ULONG)&dev_flags, |
718 |
|
LAIN_UseIncrementers, TRUE, |
719 |
|
GTIN_MaxChars, 8, |
720 |
|
TAG_END |
722 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
723 |
|
LA_LabelID, STR_VOL_STARTBLOCK_CTRL, |
724 |
|
LA_ID, GAD_VOLUME_STARTBLOCK, |
725 |
< |
LA_LONG, &dev_start, |
725 |
> |
LA_LONG, (ULONG)&dev_start, |
726 |
|
LAIN_UseIncrementers, TRUE, |
727 |
|
GTIN_MaxChars, 8, |
728 |
|
TAG_END |
730 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
731 |
|
LA_LabelID, STR_VOL_SIZE_CTRL, |
732 |
|
LA_ID, GAD_VOLUME_SIZE, |
733 |
< |
LA_LONG, &dev_size, |
733 |
> |
LA_LONG, (ULONG)&dev_size, |
734 |
|
LAIN_UseIncrementers, TRUE, |
735 |
|
GTIN_MaxChars, 8, |
736 |
|
TAG_END |
738 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
739 |
|
LA_LabelID, STR_VOL_BLOCKSIZE_CTRL, |
740 |
|
LA_ID, GAD_VOLUME_BLOCKSIZE, |
741 |
< |
LA_LONG, &dev_bsize, |
741 |
> |
LA_LONG, (ULONG)&dev_bsize, |
742 |
|
LAIN_UseIncrementers, TRUE, |
743 |
|
GTIN_MaxChars, 8, |
744 |
|
TAG_END |
838 |
|
req = dev_request; |
839 |
|
do_req: if (req) { |
840 |
|
LT_LockWindow(win); |
841 |
< |
BOOL result = AslRequestTags(req, ASLFR_Window, win, TAG_END); |
841 |
> |
BOOL result = AslRequestTags(req, ASLFR_Window, (ULONG)win, TAG_END); |
842 |
|
LT_UnlockWindow(win); |
843 |
|
if (result) { |
844 |
|
char *str; |
845 |
< |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, &str, TAG_END); |
845 |
> |
GT_GetGadgetAttrs(gad, win, NULL, GTST_String, (ULONG)&str, TAG_END); |
846 |
|
if (gad->GadgetID == GAD_VOLUME_FILE) { |
847 |
|
strncpy(str, req->rf_Dir, 255); |
848 |
|
str[255] = 0; |
860 |
|
LT_SetAttributes(h, GAD_VOLUME_BLOCKSIZE, GTIN_Number, dev_bsize, TAG_END); |
861 |
|
} |
862 |
|
} |
863 |
< |
LT_SetAttributes(h, gad->GadgetID, GTST_String, str, TAG_END); |
863 |
> |
LT_SetAttributes(h, gad->GadgetID, GTST_String, (ULONG)str, TAG_END); |
864 |
|
} |
865 |
|
} |
866 |
|
break; |
888 |
|
if (adding) { |
889 |
|
|
890 |
|
// Add new item |
891 |
+ |
int i; |
892 |
|
PrefsAddString("disk", str); |
893 |
|
struct Node *item = (struct Node *)AllocMem(sizeof(struct Node), MEMF_CLEAR); |
894 |
< |
for (int i=0; PrefsFindString("disk", i); i++) ; |
894 |
> |
for (i=0; PrefsFindString("disk", i); i++) ; |
895 |
|
item->ln_Name = (char *)PrefsFindString("disk", i - 1); |
896 |
|
AddTail(&disk_list, item); |
897 |
|
|
908 |
|
item = item->ln_Succ; |
909 |
|
} |
910 |
|
} |
911 |
< |
LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, &disk_list, TAG_END); |
911 |
> |
LT_SetAttributes(h2, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, TAG_END); |
912 |
|
ghost_volumes_gadgets(h2); |
913 |
|
} |
914 |
|
} |
932 |
|
} |
933 |
|
item = next; |
934 |
|
} |
935 |
< |
LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, &disk_list, GTLV_Selected, 0xffff, TAG_END); |
935 |
> |
LT_SetAttributes(h, GAD_DISK_LIST, GTLV_Labels, (ULONG)&disk_list, GTLV_Selected, 0xffff, TAG_END); |
936 |
|
ghost_volumes_gadgets(h); |
937 |
|
} |
938 |
|
} |
956 |
|
PrefsRemoveItem("cdrom"); |
957 |
|
|
958 |
|
PrefsReplaceBool("nocdrom", nocdrom); |
959 |
+ |
|
960 |
+ |
if (strlen(extfs_name)) |
961 |
+ |
PrefsReplaceString("extfs", extfs_name); |
962 |
|
} |
963 |
|
|
964 |
|
// Create "Volumes" pane |
974 |
|
VGROUP; |
975 |
|
LT_New(h, LA_Type, LISTVIEW_KIND, |
976 |
|
LA_ID, GAD_DISK_LIST, |
977 |
< |
GTLV_Labels, &disk_list, |
977 |
> |
LA_Chars, 20, |
978 |
> |
GTLV_Labels, (ULONG)&disk_list, |
979 |
|
LALV_Lines, 6, |
980 |
< |
LALV_Link, NIL_LINK, |
980 |
> |
LALV_Link, (ULONG)NIL_LINK, |
981 |
|
LALV_ResizeX, TRUE, |
982 |
|
LALV_ResizeY, TRUE, |
983 |
|
LALV_Selected, 0, |
1014 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1015 |
|
LA_ID, GAD_CDROM_DEVICE, |
1016 |
|
LA_Chars, 20, |
1017 |
< |
LA_STRPTR, cdrom_name, |
1017 |
> |
LA_STRPTR, (ULONG)cdrom_name, |
1018 |
|
GTST_MaxChars, sizeof(cdrom_name) - 1, |
1019 |
|
LAST_Picker, TRUE, |
1020 |
|
TAG_END |
1022 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1023 |
|
LA_LabelID, STR_UNIT_CTRL, |
1024 |
|
LA_ID, GAD_CDROM_UNIT, |
1025 |
< |
LA_LONG, &cdrom_unit, |
1025 |
> |
LA_LONG, (ULONG)&cdrom_unit, |
1026 |
|
LAIN_UseIncrementers, TRUE, |
1027 |
|
GTIN_MaxChars, 8, |
1028 |
|
TAG_END |
1032 |
|
LA_ID, GAD_BOOTDRIVER, |
1033 |
|
LACY_FirstLabel, STR_BOOT_ANY_LAB, |
1034 |
|
LACY_LastLabel, STR_BOOT_CDROM_LAB, |
1035 |
< |
LA_BYTE, &bootdriver_num, |
1035 |
> |
LA_BYTE, (ULONG)&bootdriver_num, |
1036 |
|
TAG_END |
1037 |
|
); |
1038 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1039 |
|
LA_LabelID, STR_NOCDROM_CTRL, |
1040 |
|
LA_ID, GAD_NOCDROM, |
1041 |
< |
LA_BYTE, &nocdrom, |
1041 |
> |
LA_BYTE, (ULONG)&nocdrom, |
1042 |
> |
TAG_END |
1043 |
> |
); |
1044 |
> |
ENDGROUP; |
1045 |
> |
VGROUP; |
1046 |
> |
LT_New(h, LA_Type, STRING_KIND, |
1047 |
> |
LA_LabelID, STR_EXTFS_CTRL, |
1048 |
> |
LA_ID, GAD_EXTFS, |
1049 |
> |
LA_Chars, 20, |
1050 |
> |
LA_STRPTR, (ULONG)extfs_name, |
1051 |
> |
GTST_MaxChars, sizeof(extfs_name) - 1, |
1052 |
|
TAG_END |
1053 |
|
); |
1054 |
|
ENDGROUP; |
1087 |
|
|
1088 |
|
if (strlen(scsi_dev[i])) { |
1089 |
|
char str[256]; |
1090 |
< |
sprintf("%s/%ld", scsi_dev[i], scsi_unit[i]); |
1090 |
> |
sprintf(str, "%s/%ld", scsi_dev[i], scsi_unit[i]); |
1091 |
|
PrefsReplaceString(prefs_name, str); |
1092 |
|
} else |
1093 |
|
PrefsRemoveItem(prefs_name); |
1110 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1111 |
|
LA_ID, GAD_SCSI0_DEVICE + i, |
1112 |
|
LA_Chars, 20, |
1113 |
< |
LA_STRPTR, scsi_dev[i], |
1113 |
> |
LA_STRPTR, (ULONG)scsi_dev[i], |
1114 |
|
GTST_MaxChars, sizeof(scsi_dev[i]) - 1, |
1115 |
|
LAST_Picker, TRUE, |
1116 |
|
TAG_END |
1119 |
|
LA_LabelID, STR_UNIT_CTRL, |
1120 |
|
LA_ID, GAD_SCSI0_UNIT + i, |
1121 |
|
LA_Chars, 4, |
1122 |
< |
LA_LONG, &scsi_unit[i], |
1122 |
> |
LA_LONG, (ULONG)&scsi_unit[i], |
1123 |
|
LAIN_UseIncrementers, TRUE, |
1124 |
|
GTIN_MaxChars, 8, |
1125 |
|
TAG_END |
1199 |
|
if (str) { |
1200 |
|
if (sscanf(str, "ahi/%08lx", &ahi_id) == 1 && AHIBase) { |
1201 |
|
AHI_GetAudioAttrs(ahi_id, NULL, |
1202 |
< |
AHIDB_Name, ahi_mode_name, |
1202 |
> |
AHIDB_Name, (ULONG)ahi_mode_name, |
1203 |
|
AHIDB_BufferLen, sizeof(ahi_mode_name) - 1, |
1204 |
|
TAG_END |
1205 |
|
); |
1253 |
|
if (id != INVALID_ID) { |
1254 |
|
mode_id = id; |
1255 |
|
GetDisplayInfoData(NULL, (UBYTE *)&mode_name, sizeof(mode_name), DTAG_NAME, mode_id); |
1256 |
< |
LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, mode_name.Name, TAG_END); |
1256 |
> |
LT_SetAttributes(h, GAD_SCREEN_MODE, GTTX_Text, (ULONG)mode_name.Name, TAG_END); |
1257 |
|
} |
1258 |
|
} |
1259 |
|
|
1264 |
|
return; |
1265 |
|
|
1266 |
|
struct AHIAudioModeRequester *req = AHI_AllocAudioRequest( |
1267 |
< |
AHIR_Window, win, |
1267 |
> |
AHIR_Window, (ULONG)win, |
1268 |
|
TAG_END |
1269 |
|
); |
1270 |
|
if (req == NULL) |
1280 |
|
if (ok) { |
1281 |
|
ahi_id = req->ahiam_AudioID; |
1282 |
|
AHI_GetAudioAttrs(ahi_id, NULL, |
1283 |
< |
AHIDB_Name, ahi_mode_name, |
1283 |
> |
AHIDB_Name, (ULONG)ahi_mode_name, |
1284 |
|
AHIDB_BufferLen, sizeof(ahi_mode_name) - 1, |
1285 |
|
TAG_END |
1286 |
|
); |
1287 |
< |
LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, ahi_mode_name, TAG_END); |
1287 |
> |
LT_SetAttributes(h, GAD_AHI_MODE, GTTX_Text, (ULONG)ahi_mode_name, TAG_END); |
1288 |
|
} |
1289 |
|
AHI_FreeAudioRequest(req); |
1290 |
|
} |
1329 |
|
LT_New(h, LA_Type, CYCLE_KIND, |
1330 |
|
LA_LabelID, STR_VIDEO_TYPE_CTRL, |
1331 |
|
LA_ID, GAD_VIDEO_TYPE, |
1332 |
< |
LACY_LabelTable, labels, |
1333 |
< |
LA_BYTE, &display_type, |
1332 |
> |
LACY_LabelTable, (ULONG)labels, |
1333 |
> |
LA_BYTE, (ULONG)&display_type, |
1334 |
|
TAG_END |
1335 |
|
); |
1336 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1337 |
|
LA_LabelID, STR_DISPLAY_X_CTRL, |
1338 |
|
LA_ID, GAD_DISPLAY_X, |
1339 |
< |
LA_LONG, &dis_width, |
1339 |
> |
LA_LONG, (ULONG)&dis_width, |
1340 |
|
GTIN_MaxChars, 8, |
1341 |
|
TAG_END |
1342 |
|
); |
1343 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1344 |
|
LA_LabelID, STR_DISPLAY_Y_CTRL, |
1345 |
|
LA_ID, GAD_DISPLAY_Y, |
1346 |
< |
LA_LONG, &dis_height, |
1346 |
> |
LA_LONG, (ULONG)&dis_height, |
1347 |
|
GTIN_MaxChars, 8, |
1348 |
|
TAG_END |
1349 |
|
); |
1352 |
|
LA_ID, GAD_FRAMESKIP, |
1353 |
|
LAPU_FirstLabel, STR_REF_5HZ_LAB, |
1354 |
|
LAPU_LastLabel, STR_REF_60HZ_LAB, |
1355 |
< |
LA_BYTE, &frameskip_num, |
1355 |
> |
LA_BYTE, (ULONG)&frameskip_num, |
1356 |
|
TAG_END |
1357 |
|
); |
1358 |
|
LT_New(h, LA_Type, TEXT_KIND, |
1360 |
|
LA_ID, GAD_SCREEN_MODE, |
1361 |
|
LA_Chars, DISPLAYNAMELEN, |
1362 |
|
LATX_Picker, TRUE, |
1363 |
< |
GTTX_Text, mode_name.Name, |
1363 |
> |
GTTX_Text, (ULONG)mode_name.Name, |
1364 |
|
GTTX_Border, TRUE, |
1365 |
|
TAG_END |
1366 |
|
); |
1374 |
|
LA_ID, GAD_AHI_MODE, |
1375 |
|
LA_Chars, DISPLAYNAMELEN, |
1376 |
|
LATX_Picker, TRUE, |
1377 |
< |
GTTX_Text, ahi_mode_name, |
1377 |
> |
GTTX_Text, (ULONG)ahi_mode_name, |
1378 |
|
GTTX_Border, TRUE, |
1379 |
|
TAG_END |
1380 |
|
); |
1381 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1382 |
|
LA_LabelID, STR_NOSOUND_CTRL, |
1383 |
|
LA_ID, GAD_NOSOUND, |
1384 |
< |
LA_BYTE, &nosound, |
1384 |
> |
LA_BYTE, (ULONG)&nosound, |
1385 |
|
TAG_END |
1386 |
|
); |
1387 |
|
ENDGROUP; |
1403 |
|
static ULONG ether_unit; |
1404 |
|
|
1405 |
|
// Read serial/network preferences |
1406 |
< |
static void parse_serial_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar) |
1406 |
> |
static void parse_ser_prefs(const char *prefs, char *dev, LONG &unit, BYTE &ispar) |
1407 |
|
{ |
1408 |
|
dev[0] = 0; |
1409 |
|
unit = 0; |
1417 |
|
} |
1418 |
|
sscanf(str, "%[^/]/%ld", dev, &unit); |
1419 |
|
} |
1420 |
+ |
} |
1421 |
+ |
|
1422 |
+ |
static void parse_serial_prefs(void) |
1423 |
+ |
{ |
1424 |
+ |
parse_ser_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar); |
1425 |
+ |
parse_ser_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar); |
1426 |
|
|
1427 |
|
ether_dev[0] = 0; |
1428 |
|
ether_unit = 0; |
1429 |
|
|
1430 |
< |
str = PrefsFindString("ether"); |
1430 |
> |
const char *str = PrefsFindString("ether"); |
1431 |
|
if (str) |
1432 |
|
sscanf(str, "%[^/]/%ld", ether_dev, ðer_unit); |
1433 |
|
} |
1460 |
|
// Create "Serial/Network" pane |
1461 |
|
static void create_serial_pane(struct LayoutHandle *h) |
1462 |
|
{ |
1463 |
< |
parse_serial_prefs("seriala", seriala_dev, seriala_unit, seriala_ispar); |
1436 |
< |
parse_serial_prefs("serialb", serialb_dev, serialb_unit, serialb_ispar); |
1463 |
> |
parse_serial_prefs(); |
1464 |
|
|
1465 |
|
VGROUP; |
1466 |
|
LT_New(h, LA_Type, VERTICAL_KIND, |
1471 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1472 |
|
LA_ID, GAD_SERIALA_DEVICE, |
1473 |
|
LA_Chars, 20, |
1474 |
< |
LA_STRPTR, seriala_dev, |
1474 |
> |
LA_STRPTR, (ULONG)seriala_dev, |
1475 |
|
GTST_MaxChars, sizeof(seriala_dev) - 1, |
1476 |
|
LAST_Picker, TRUE, |
1477 |
|
TAG_END |
1479 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1480 |
|
LA_LabelID, STR_UNIT_CTRL, |
1481 |
|
LA_ID, GAD_SERIALA_UNIT, |
1482 |
< |
LA_LONG, &seriala_unit, |
1482 |
> |
LA_LONG, (ULONG)&seriala_unit, |
1483 |
|
LAIN_UseIncrementers, TRUE, |
1484 |
|
GTIN_MaxChars, 8, |
1485 |
|
TAG_END |
1487 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1488 |
|
LA_LabelID, STR_ISPAR_CTRL, |
1489 |
|
LA_ID, GAD_SERIALA_ISPAR, |
1490 |
< |
LA_BYTE, &seriala_ispar, |
1490 |
> |
LA_BYTE, (ULONG)&seriala_ispar, |
1491 |
|
TAG_END |
1492 |
|
); |
1493 |
|
ENDGROUP; |
1500 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1501 |
|
LA_ID, GAD_SERIALB_DEVICE, |
1502 |
|
LA_Chars, 20, |
1503 |
< |
LA_STRPTR, serialb_dev, |
1503 |
> |
LA_STRPTR, (ULONG)serialb_dev, |
1504 |
|
GTST_MaxChars, sizeof(serialb_dev) - 1, |
1505 |
|
LAST_Picker, TRUE, |
1506 |
|
TAG_END |
1508 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1509 |
|
LA_LabelID, STR_UNIT_CTRL, |
1510 |
|
LA_ID, GAD_SERIALB_UNIT, |
1511 |
< |
LA_LONG, &serialb_unit, |
1511 |
> |
LA_LONG, (ULONG)&serialb_unit, |
1512 |
|
LAIN_UseIncrementers, TRUE, |
1513 |
|
GTIN_MaxChars, 8, |
1514 |
|
TAG_END |
1516 |
|
LT_New(h, LA_Type, CHECKBOX_KIND, |
1517 |
|
LA_LabelID, STR_ISPAR_CTRL, |
1518 |
|
LA_ID, GAD_SERIALB_ISPAR, |
1519 |
< |
LA_BYTE, &serialb_ispar, |
1519 |
> |
LA_BYTE, (ULONG)&serialb_ispar, |
1520 |
|
TAG_END |
1521 |
|
); |
1522 |
|
ENDGROUP; |
1529 |
|
LA_LabelID, STR_DEVICE_CTRL, |
1530 |
|
LA_ID, GAD_ETHER_DEVICE, |
1531 |
|
LA_Chars, 20, |
1532 |
< |
LA_STRPTR, ether_dev, |
1532 |
> |
LA_STRPTR, (ULONG)ether_dev, |
1533 |
|
GTST_MaxChars, sizeof(ether_dev) - 1, |
1534 |
|
LAST_Picker, TRUE, |
1535 |
|
TAG_END |
1537 |
|
LT_New(h, LA_Type, INTEGER_KIND, |
1538 |
|
LA_LabelID, STR_UNIT_CTRL, |
1539 |
|
LA_ID, GAD_ETHER_UNIT, |
1540 |
< |
LA_LONG, ðer_unit, |
1540 |
> |
LA_LONG, (ULONG)ðer_unit, |
1541 |
|
LAIN_UseIncrementers, TRUE, |
1542 |
|
GTIN_MaxChars, 8, |
1543 |
|
TAG_END |
1600 |
|
LA_LabelID, STR_RAMSIZE_SLIDER, |
1601 |
|
LA_ID, GAD_RAMSIZE, |
1602 |
|
LA_Chars, 20, |
1603 |
< |
LA_LONG, &ramsize_mb, |
1604 |
< |
GTSL_LevelFormat, GetString(STR_RAMSIZE_FMT), |
1603 |
> |
LA_LONG, (ULONG)&ramsize_mb, |
1604 |
> |
GTSL_LevelFormat, (ULONG)GetString(STR_RAMSIZE_FMT), |
1605 |
|
GTSL_Min, 1, |
1606 |
|
GTSL_Max, AvailMem(MEMF_LARGEST) >> 20, |
1607 |
|
TAG_END |
1611 |
|
LA_ID, GAD_MODELID, |
1612 |
|
LACY_FirstLabel, STR_MODELID_5_LAB, |
1613 |
|
LACY_LastLabel, STR_MODELID_14_LAB, |
1614 |
< |
LA_BYTE, &model_num, |
1614 |
> |
LA_BYTE, (ULONG)&model_num, |
1615 |
|
TAG_END |
1616 |
|
); |
1617 |
|
LT_New(h, LA_Type, STRING_KIND, |
1618 |
|
LA_LabelID, STR_ROM_FILE_CTRL, |
1619 |
|
LA_ID, GAD_ROM_FILE, |
1620 |
|
LA_Chars, 20, |
1621 |
< |
LA_STRPTR, rom_file, |
1621 |
> |
LA_STRPTR, (ULONG)rom_file, |
1622 |
|
GTST_MaxChars, sizeof(rom_file) - 1, |
1623 |
|
LAST_Picker, TRUE, |
1624 |
|
TAG_END |