~ubuntu-branches/ubuntu/dapper/vice/dapper

« back to all changes in this revision

Viewing changes to src/raster/raster-cmdline-options.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2004-08-26 13:35:51 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040826133551-gcje8j31q5cqgdq2
Tags: 1.14-3
Apply patch from Spiro Trikaliotis <vice@trikaliotis.net> to fix a
problem that some users were experiencing with a floating point
exception on startup related to the fullscreen option being enabled
during compile.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * raster-cmdline-options.c - Raster-based video chip emulation helper,
 
3
 *                            command line options.
 
4
 *
 
5
 * Written by
 
6
 *  Andreas Boose <viceteam@t-online.de>
 
7
 *
 
8
 * This file is part of VICE, the Versatile Commodore Emulator.
 
9
 * See README for copyright notice.
 
10
 *
 
11
 *  This program is free software; you can redistribute it and/or modify
 
12
 *  it under the terms of the GNU General Public License as published by
 
13
 *  the Free Software Foundation; either version 2 of the License, or
 
14
 *  (at your option) any later version.
 
15
 *
 
16
 *  This program is distributed in the hope that it will be useful,
 
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 *  GNU General Public License for more details.
 
20
 *
 
21
 *  You should have received a copy of the GNU General Public License
 
22
 *  along with this program; if not, write to the Free Software
 
23
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 
24
 *  02111-1307  USA.
 
25
 *
 
26
 */
 
27
 
 
28
#include "vice.h"
 
29
 
 
30
#include <stdio.h>
 
31
 
 
32
#include "cmdline.h"
 
33
#include "lib.h"
 
34
#include "raster-cmdline-options.h"
 
35
#include "util.h"
 
36
#include "video.h"
 
37
 
 
38
 
 
39
static const char *cname_chip[] = { "-", "vcache", "VideoCache",
 
40
                                    "+", "vcache", "VideoCache",
 
41
                                    NULL };
 
42
 
 
43
static cmdline_option_t cmdline_options_chip[] =
 
44
{
 
45
    { NULL, SET_RESOURCE, 0, NULL, NULL, NULL,
 
46
      (void *)1, NULL, "Enable the video cache" },
 
47
    { NULL, SET_RESOURCE, 0, NULL, NULL, NULL,
 
48
      (void *)0, NULL, "Disable the video cache" },
 
49
    { NULL }
 
50
};
 
51
 
 
52
int raster_cmdline_options_chip_init(const char *chipname,
 
53
                                     struct video_chip_cap_s *video_chip_cap)
 
54
{
 
55
    unsigned int i;
 
56
 
 
57
    for (i = 0; cname_chip[i * 3] != NULL; i++) {
 
58
        cmdline_options_chip[i].name = util_concat(cname_chip[i * 3], chipname,
 
59
                                       cname_chip[i * 3 + 1], NULL);
 
60
        cmdline_options_chip[i].resource_name = util_concat(chipname,
 
61
                                                cname_chip[i * 3 + 2], NULL);
 
62
    }
 
63
 
 
64
    if (cmdline_register_options(cmdline_options_chip) < 0)
 
65
        return -1;
 
66
 
 
67
    for (i = 0; cname_chip[i * 3] != NULL; i++) {
 
68
        lib_free((char *)cmdline_options_chip[i].name);
 
69
        lib_free((char *)cmdline_options_chip[i].resource_name);
 
70
    }
 
71
 
 
72
    if (video_cmdline_options_chip_init(chipname, video_chip_cap) < 0)
 
73
        return -1;
 
74
 
 
75
    return 0;
 
76
}
 
77