~ubuntu-branches/ubuntu/quantal/vice/quantal

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2006-07-30 19:15:59 UTC
  • mto: (9.1.1 lenny) (1.1.6 upstream)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20060730191559-g31ymd2mk102kzff
Tags: upstream-1.19
ImportĀ upstreamĀ versionĀ 1.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * uitfe.c - TFE and RRNET 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
#ifdef HAVE_TFE
 
30
 
 
31
#include <stdio.h>
 
32
 
 
33
#include "resources.h"
 
34
#include "tui.h"
 
35
#include "tuimenu.h"
 
36
#include "uitfe.h"
 
37
 
 
38
 
 
39
TUI_MENU_DEFINE_TOGGLE(ETHERNET_ACTIVE)
 
40
TUI_MENU_DEFINE_RADIO(ETHERNET_AS_RR)
 
41
 
 
42
 
 
43
static TUI_MENU_CALLBACK(ethernet_as_rr_submenu_callback)
 
44
{
 
45
    int value;
 
46
    static char s[100];
 
47
 
 
48
    resources_get_value("ETHERNET_AS_RR", (void *)&value);
 
49
    sprintf(s, "%s",(value==0) ? "TFE" : "RRNET");
 
50
    return s;
 
51
}
 
52
 
 
53
static tui_menu_item_def_t ethernet_as_rr_submenu[] = {
 
54
    { "_TFE", NULL, radio_ETHERNET_AS_RR_callback,
 
55
      (void *)0, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
56
    { "_RRNET", NULL, radio_ETHERNET_AS_RR_callback,
 
57
      (void *)1, 7, TUI_MENU_BEH_CLOSE, NULL, NULL },
 
58
    { NULL }
 
59
};
 
60
 
 
61
static tui_menu_item_def_t tfe_menu_items[] = {
 
62
    { "_Enable Ethernet:", "Emulate Ethernet Cartridge",
 
63
      toggle_ETHERNET_ACTIVE_callback, NULL, 3,
 
64
      TUI_MENU_BEH_CONTINUE, NULL, NULL },
 
65
    { "_TFE or RRNET:", "Select which type to use",
 
66
      ethernet_as_rr_submenu_callback, NULL, 7,
 
67
      TUI_MENU_BEH_CONTINUE, ethernet_as_rr_submenu,
 
68
      "Ethernet type" },
 
69
    { NULL }
 
70
};
 
71
 
 
72
void uitfe_init(struct tui_menu *parent_submenu)
 
73
{
 
74
    tui_menu_t ui_tfe_submenu;
 
75
 
 
76
    ui_tfe_submenu = tui_menu_create("TFE settings", 1);
 
77
 
 
78
    tui_menu_add(ui_tfe_submenu, tfe_menu_items);
 
79
 
 
80
    tui_menu_add_submenu(parent_submenu, "_TFE settings...",
 
81
                         "TFE settings",
 
82
                         ui_tfe_submenu, NULL, 0,
 
83
                         TUI_MENU_BEH_CONTINUE);
 
84
}
 
85
 
 
86
#endif