~ubuntu-branches/ubuntu/hardy/vice/hardy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2007-10-07 07:05:46 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071007070546-81yy0twlka7p2t0e
Tags: 1.22-1
* New upstream version (closes: #428280).
* Correct link to HTML documentation in manpage (closes: #409567).
* Fix most packaging mistakes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * uidigimax.c - DIGIMAX cartridge 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 "uidigimax.h"
 
35
 
 
36
TUI_MENU_DEFINE_TOGGLE(DIGIMAX)
 
37
TUI_MENU_DEFINE_RADIO(DIGIMAXbase)
 
38
 
 
39
static TUI_MENU_CALLBACK(digimax_base_submenu_callback)
 
40
{
 
41
    int value;
 
42
    static char s[100];
 
43
 
 
44
    resources_get_int("DIGIMAXbase", &value);
 
45
    if (value==0xdd00)
 
46
      sprintf(s, "Userport");
 
47
    else
 
48
      sprintf(s, "$%X", value);
 
49
    return s;
 
50
}
 
51
 
 
52
static tui_menu_item_def_t digimax_base_submenu[] = {
 
53
    { "Userport", NULL, radio_DIGIMAXbase_callback,
 
54
      (void *)0xdd00, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
55
    { "$DE00", NULL, radio_DIGIMAXbase_callback,
 
56
      (void *)0xde00, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
57
    { "$DE20", NULL, radio_DIGIMAXbase_callback,
 
58
      (void *)0xde20, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
59
    { "$DE40", NULL, radio_DIGIMAXbase_callback,
 
60
      (void *)0xde40, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
61
    { "$DE60", NULL, radio_DIGIMAXbase_callback,
 
62
      (void *)0xde60, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
63
    { "$DE80", NULL, radio_DIGIMAXbase_callback,
 
64
      (void *)0xde80, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
65
    { "$DEA0", NULL, radio_DIGIMAXbase_callback,
 
66
      (void *)0xdea0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
67
    { "$DEC0", NULL, radio_DIGIMAXbase_callback,
 
68
      (void *)0xdec0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
69
    { "$DEE0", NULL, radio_DIGIMAXbase_callback,
 
70
      (void *)0xdee0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
71
    { "$DF00", NULL, radio_DIGIMAXbase_callback,
 
72
      (void *)0xdf00, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
73
    { "$DF20", NULL, radio_DIGIMAXbase_callback,
 
74
      (void *)0xdf20, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
75
    { "$DF40", NULL, radio_DIGIMAXbase_callback,
 
76
      (void *)0xdf40, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
77
    { "$DF60", NULL, radio_DIGIMAXbase_callback,
 
78
      (void *)0xdf60, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
79
    { "$DF80", NULL, radio_DIGIMAXbase_callback,
 
80
      (void *)0xdf80, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
81
    { "$DFA0", NULL, radio_DIGIMAXbase_callback,
 
82
      (void *)0xdfa0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
83
    { "$DFC0", NULL, radio_DIGIMAXbase_callback,
 
84
      (void *)0xdfc0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
85
    { "$DFE0", NULL, radio_DIGIMAXbase_callback,
 
86
      (void *)0xdfe0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
87
    { NULL }
 
88
};
 
89
 
 
90
static tui_menu_item_def_t digimax_menu_items[] = {
 
91
    { "_Enable Digimax:", "Emulate Digimax Cartridge",
 
92
      toggle_DIGIMAX_callback, NULL, 3,
 
93
      TUI_MENU_BEH_CONTINUE, NULL, NULL },
 
94
    { "Digimax _base:", "Select the base of the Digimax Cartridge",
 
95
      digimax_base_submenu_callback, NULL, 11,
 
96
      TUI_MENU_BEH_CONTINUE, digimax_base_submenu,
 
97
      "Digimax base" },
 
98
    { NULL }
 
99
};
 
100
 
 
101
void uidigimax_init(struct tui_menu *parent_submenu)
 
102
{
 
103
    tui_menu_t ui_digimax_submenu;
 
104
 
 
105
    ui_digimax_submenu = tui_menu_create("Digimax settings", 1);
 
106
 
 
107
    tui_menu_add(ui_digimax_submenu, digimax_menu_items);
 
108
 
 
109
    tui_menu_add_submenu(parent_submenu, "_Digimax settings...",
 
110
                         "Digimax settings",
 
111
                         ui_digimax_submenu, NULL, 0,
 
112
                         TUI_MENU_BEH_CONTINUE);
 
113
}