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

« back to all changes in this revision

Viewing changes to src/arch/msdos/uiburstmod.c

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2013-07-28 20:38:23 UTC
  • mfrom: (1.2.5)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: package-import@ubuntu.com-20130728203823-w495rps5wuykespp
Tags: upstream-2.4.dfsg
ImportĀ upstreamĀ versionĀ 2.4.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * uiburstmod.c - C64 Burst Modification UI interface for MS-DOS.
 
3
 *
 
4
 * Written by
 
5
 *  Marco van den Heuvel <blackystardust68@yahoo.com>
 
6
 *
 
7
 * This file is part of VICE, the Versatile Commodore Emulator.
 
8
 * See README for copyright notice.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
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
 
23
 *  02111-1307  USA.
 
24
 *
 
25
 */
 
26
 
 
27
#include "vice.h"
 
28
 
 
29
#include <stdio.h>
 
30
 
 
31
#include "resources.h"
 
32
#include "tui.h"
 
33
#include "tuimenu.h"
 
34
#include "uiburstmod.h"
 
35
 
 
36
TUI_MENU_DEFINE_RADIO(BurstMod)
 
37
 
 
38
static TUI_MENU_CALLBACK(burstmod_submenu_callback)
 
39
{
 
40
    int value;
 
41
    char *s;
 
42
 
 
43
    resources_get_int("BurstMod", &value);
 
44
    switch (value) {
 
45
        case 0:
 
46
        default:
 
47
            s = "None";
 
48
            break;
 
49
        case 1:
 
50
            s = "CIA-1";
 
51
            break;
 
52
        case 2:
 
53
            s = "CIA-2";
 
54
            break;
 
55
    }
 
56
    return s;
 
57
}
 
58
 
 
59
static tui_menu_item_def_t burstmod_submenu[] = {
 
60
    { "None", NULL, radio_BurstMod_callback,
 
61
      (void *)0, 20, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
62
    { "CIA-1", NULL, radio_BurstMod_callback,
 
63
      (void *)1, 20, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
64
    { "CIA-2", NULL, radio_BurstMod_callback,
 
65
      (void *)2, 20, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
66
    { NULL }
 
67
};
 
68
 
 
69
static tui_menu_item_def_t burstmod_menu_items[] = {
 
70
    { "Burst Modification:", "Select the burst modification",
 
71
      burstmod_submenu_callback, NULL, 11,
 
72
      TUI_MENU_BEH_CONTINUE, burstmod_submenu,
 
73
      "Burst Modification" },
 
74
    { NULL }
 
75
};
 
76
 
 
77
void uiburstmod_init(struct tui_menu *parent_submenu)
 
78
{
 
79
    tui_menu_t ui_burstmod_submenu;
 
80
 
 
81
    ui_burstmod_submenu = tui_menu_create("Burst Modification settings", 1);
 
82
 
 
83
    tui_menu_add(ui_burstmod_submenu, burstmod_menu_items);
 
84
 
 
85
    tui_menu_add_submenu(parent_submenu, "Burst Modification settings...",
 
86
                         "Burst Modification settings",
 
87
                         ui_burstmod_submenu,
 
88
                         NULL, 0,
 
89
                         TUI_MENU_BEH_CONTINUE);
 
90
}