~ubuntu-branches/ubuntu/trusty/vice/trusty

« back to all changes in this revision

Viewing changes to src/arch/amigaos/mui/uidigimax.c

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-07-28 20:38:23 UTC
  • mfrom: (1.1.10) (9.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20130728203823-1h8s6bcv22oundul
Tags: 2.4.dfsg-1
* New upstream release (closes: #693065, #693641).
* Drop vice-ffmpeg.patch , applied upstream.
* Disable architecture specific compilation (closes: #686400, #714136).

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    -1
51
51
};
52
52
 
53
 
static char *ui_digimax_base[] = {
 
53
static char *ui_digimax_c64_base[] = {
54
54
    "Userport Interface",
55
55
    "$DE00",
56
56
    "$DE20",
71
71
    NULL
72
72
};
73
73
 
74
 
static const int ui_digimax_base_values[] = {
 
74
static const int ui_digimax_c64_base_values[] = {
75
75
    0xdd00,   /* special case, userport interface */
76
76
    0xde00,
77
77
    0xde20,
92
92
    -1
93
93
};
94
94
 
95
 
static ui_to_from_t ui_to_from[] = {
96
 
    { NULL, MUI_TYPE_CYCLE, "DIGIMAX", ui_digimax_enable, ui_digimax_enable_values, NULL },
97
 
    { NULL, MUI_TYPE_CYCLE, "DIGIMAXbase", ui_digimax_base, ui_digimax_base_values, NULL },
98
 
    UI_END /* mandatory */
99
 
};
100
 
 
101
 
static APTR build_gui(void)
102
 
{
103
 
    APTR app, ui, ok, cancel;
104
 
 
105
 
    app = mui_get_app();
106
 
 
107
 
    ui = GroupObject,
108
 
           CYCLE(ui_to_from[0].object, translate_text(IDS_DIGIMAX_ENABLED), ui_digimax_enable)
109
 
           CYCLE(ui_to_from[1].object, translate_text(IDS_DIGIMAX_BASE), ui_digimax_base)
110
 
           OK_CANCEL_BUTTON
111
 
         End;
112
 
 
113
 
    if (ui != NULL) {
114
 
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
115
 
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
116
 
 
117
 
        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
118
 
                 app, 2, MUIM_Application_ReturnID, BTN_OK);
119
 
    }
120
 
 
121
 
    return ui;
122
 
}
123
 
 
124
 
void ui_digimax_settings_dialog(video_canvas_t *canvas)
125
 
{
126
 
    APTR window;
127
 
 
128
 
    digimax_canvas = canvas;
129
 
    intl_convert_mui_table(ui_digimax_enable_translate, ui_digimax_enable);
130
 
 
131
 
    window = mui_make_simple_window(build_gui(), translate_text(IDS_DIGIMAX_SETTINGS));
132
 
 
133
 
    if (window != NULL) {
134
 
        mui_add_window(window);
135
 
        ui_get_to(ui_to_from);
136
 
        set(window, MUIA_Window_Open, TRUE);
137
 
        if (mui_run() == BTN_OK) {
138
 
            ui_get_from(ui_to_from);
 
95
static char *ui_digimax_vic20_base[] = {
 
96
    "$9800",
 
97
    "$9820",
 
98
    "$9840",
 
99
    "$9860",
 
100
    "$9880",
 
101
    "$98A0",
 
102
    "$98C0",
 
103
    "$98E0",
 
104
    "$9C00",
 
105
    "$9C20",
 
106
    "$9C40",
 
107
    "$9C60",
 
108
    "$9C80",
 
109
    "$9CA0",
 
110
    "$9CC0",
 
111
    "$9CE0",
 
112
    NULL
 
113
};
 
114
 
 
115
static const int ui_digimax_vic20_base_values[] = {
 
116
    0x9800,
 
117
    0x9820,
 
118
    0x9840,
 
119
    0x9860,
 
120
    0x9880,
 
121
    0x98a0,
 
122
    0x98c0,
 
123
    0x98e0,
 
124
    0x9c00,
 
125
    0x9c20,
 
126
    0x9c40,
 
127
    0x9c60,
 
128
    0x9c80,
 
129
    0x9ca0,
 
130
    0x9cc0,
 
131
    0x9ce0,
 
132
    -1
 
133
};
 
134
 
 
135
static ui_to_from_t ui_to_from64[] = {
 
136
    { NULL, MUI_TYPE_CYCLE, "DIGIMAX", ui_digimax_enable, ui_digimax_enable_values, NULL },
 
137
    { NULL, MUI_TYPE_CYCLE, "DIGIMAXbase", ui_digimax_c64_base, ui_digimax_c64_base_values, NULL },
 
138
    UI_END /* mandatory */
 
139
};
 
140
 
 
141
static ui_to_from_t ui_to_from20[] = {
 
142
    { NULL, MUI_TYPE_CYCLE, "DIGIMAX", ui_digimax_enable, ui_digimax_enable_values, NULL },
 
143
    { NULL, MUI_TYPE_CYCLE, "DIGIMAXbase", ui_digimax_vic20_base, ui_digimax_vic20_base_values, NULL },
 
144
    UI_END /* mandatory */
 
145
};
 
146
 
 
147
static APTR build_gui64(void)
 
148
{
 
149
    APTR app, ui, ok, cancel;
 
150
 
 
151
    app = mui_get_app();
 
152
 
 
153
    ui = GroupObject,
 
154
           CYCLE(ui_to_from64[0].object, translate_text(IDS_DIGIMAX_ENABLED), ui_digimax_enable)
 
155
           CYCLE(ui_to_from64[1].object, translate_text(IDS_DIGIMAX_BASE), ui_digimax_c64_base)
 
156
           OK_CANCEL_BUTTON
 
157
         End;
 
158
 
 
159
    if (ui != NULL) {
 
160
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
 
161
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
 
162
 
 
163
        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
 
164
                 app, 2, MUIM_Application_ReturnID, BTN_OK);
 
165
    }
 
166
 
 
167
    return ui;
 
168
}
 
169
 
 
170
static APTR build_gui20(void)
 
171
{
 
172
    APTR app, ui, ok, cancel;
 
173
 
 
174
    app = mui_get_app();
 
175
 
 
176
    ui = GroupObject,
 
177
           CYCLE(ui_to_from20[0].object, translate_text(IDS_DIGIMAX_ENABLED), ui_digimax_enable)
 
178
           CYCLE(ui_to_from20[1].object, translate_text(IDS_DIGIMAX_BASE), ui_digimax_vic20_base)
 
179
           OK_CANCEL_BUTTON
 
180
         End;
 
181
 
 
182
    if (ui != NULL) {
 
183
        DoMethod(cancel, MUIM_Notify, MUIA_Pressed, FALSE,
 
184
                 app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
 
185
 
 
186
        DoMethod(ok, MUIM_Notify, MUIA_Pressed, FALSE,
 
187
                 app, 2, MUIM_Application_ReturnID, BTN_OK);
 
188
    }
 
189
 
 
190
    return ui;
 
191
}
 
192
 
 
193
void ui_digimax_c64_settings_dialog(video_canvas_t *canvas)
 
194
{
 
195
    APTR window;
 
196
 
 
197
    digimax_canvas = canvas;
 
198
    intl_convert_mui_table(ui_digimax_enable_translate, ui_digimax_enable);
 
199
 
 
200
    window = mui_make_simple_window(build_gui64(), translate_text(IDS_DIGIMAX_SETTINGS));
 
201
 
 
202
    if (window != NULL) {
 
203
        mui_add_window(window);
 
204
        ui_get_to(ui_to_from64);
 
205
        set(window, MUIA_Window_Open, TRUE);
 
206
        if (mui_run() == BTN_OK) {
 
207
            ui_get_from(ui_to_from64);
 
208
        }
 
209
        set(window, MUIA_Window_Open, FALSE);
 
210
        mui_rem_window(window);
 
211
        MUI_DisposeObject(window);
 
212
    }
 
213
}
 
214
 
 
215
void ui_digimax_vic20_settings_dialog(video_canvas_t *canvas)
 
216
{
 
217
    APTR window;
 
218
 
 
219
    digimax_canvas = canvas;
 
220
    intl_convert_mui_table(ui_digimax_enable_translate, ui_digimax_enable);
 
221
 
 
222
    window = mui_make_simple_window(build_gui20(), translate_text(IDS_DIGIMAX_SETTINGS));
 
223
 
 
224
    if (window != NULL) {
 
225
        mui_add_window(window);
 
226
        ui_get_to(ui_to_from20);
 
227
        set(window, MUIA_Window_Open, TRUE);
 
228
        if (mui_run() == BTN_OK) {
 
229
            ui_get_from(ui_to_from20);
139
230
        }
140
231
        set(window, MUIA_Window_Open, FALSE);
141
232
        mui_rem_window(window);