5
* Andreas Boose <viceteam@t-online.de>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
33
#include "resources.h"
40
UI_CALLBACK(set_ide64_image_name)
42
uilib_select_string((char *)UI_MENU_CB_PARAM, _("IDE64 image name"),
46
UI_MENU_DEFINE_TOGGLE(IDE64AutodetectSize)
48
static UI_CALLBACK(set_cylinders)
50
static char input_string[32];
55
resources_get_value("IDE64AutodetectSize", (void *)&autosize);
58
ui_menu_set_sensitive(w, False);
60
ui_menu_set_sensitive(w, True);
67
vsync_suspend_speed_eval();
69
resources_get_value("IDE64Cylinders", (void *)&cylinders);
71
sprintf(input_string, "%d", cylinders);
73
msg_string = lib_stralloc(_("Enter number of cylinders"));
74
button = ui_input_string(_("IDE64 cylinders"), msg_string, input_string,
77
if (button == UI_BUTTON_OK) {
78
i = atoi(input_string);
79
if (cylinders > 0 && cylinders <= 1024 && cylinders != i) {
80
resources_set_value("IDE64Cylinders", (resource_value_t)i);
87
static UI_CALLBACK(set_heads)
89
static char input_string[32];
94
resources_get_value("IDE64AutodetectSize", (void *)&autosize);
97
ui_menu_set_sensitive(w, False);
99
ui_menu_set_sensitive(w, True);
106
vsync_suspend_speed_eval();
108
resources_get_value("IDE64Heads", (void *)&heads);
110
sprintf(input_string, "%d", heads);
112
msg_string = lib_stralloc(_("Enter number of heads"));
113
button = ui_input_string(_("IDE64 heads"), msg_string, input_string,
115
lib_free(msg_string);
116
if (button == UI_BUTTON_OK) {
117
i = atoi(input_string);
118
if (heads > 0 && heads <= 16 && heads != i) {
119
resources_set_value("IDE64Heads", (resource_value_t)i);
126
static UI_CALLBACK(set_sectors)
128
static char input_string[32];
133
resources_get_value("IDE64AutodetectSize", (void *)&autosize);
136
ui_menu_set_sensitive(w, False);
138
ui_menu_set_sensitive(w, True);
145
vsync_suspend_speed_eval();
147
resources_get_value("IDE64Sectors", (void *)§ors);
149
sprintf(input_string, "%d", sectors);
151
msg_string = lib_stralloc(_("Enter number of sectors"));
152
button = ui_input_string(_("IDE64 sectors"), msg_string, input_string,
154
lib_free(msg_string);
155
if (button == UI_BUTTON_OK) {
156
i = atoi(input_string);
157
if (sectors >= 0 && sectors <= 63 && sectors != i) {
158
resources_set_value("IDE64Sectors", (resource_value_t)i);
165
ui_menu_entry_t ide64_submenu[] = {
166
{ N_("IDE64 image name..."),
167
(ui_callback_t)set_ide64_image_name,
168
(ui_callback_data_t)"IDE64Image", NULL },
169
{ N_("*Autodetect image size"),
170
(ui_callback_t)toggle_IDE64AutodetectSize, NULL, NULL },
171
{ N_("*Cylinders..."),
172
(ui_callback_t)set_cylinders, NULL, NULL },
174
(ui_callback_t)set_heads, NULL, NULL },
176
(ui_callback_t)set_sectors, NULL, NULL },