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

« back to all changes in this revision

Viewing changes to src/pet/petdrive.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-03-27 13:06:04 UTC
  • mfrom: (4 hoary)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20050327130604-zodmv0i60dbbmcik
Tags: 1.16-3
Apply patch from Andreas Jochens <aj@andaco.de> to correct building on
AMD64 and GCC 4.x (closes: #300936)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * petdrive.c
 
3
 *
 
4
 * Written by
 
5
 *  Andreas Boose <viceteam@t-online.de>
 
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 "drive.h"
 
32
#include "iecieee.h"
 
33
#include "ieee.h"
 
34
#include "machine-drive.h"
 
35
#include "types.h"
 
36
 
 
37
 
 
38
int machine_drive_resources_init(void)
 
39
{
 
40
    return drive_resources_type_init(DRIVE_TYPE_2031)
 
41
        | ieee_drive_resources_init();
 
42
}
 
43
 
 
44
void machine_drive_resources_shutdown(void)
 
45
{
 
46
    ieee_drive_resources_shutdown();
 
47
}
 
48
 
 
49
int machine_drive_cmdline_options_init(void)
 
50
{
 
51
    return ieee_drive_cmdline_options_init();
 
52
}
 
53
 
 
54
void machine_drive_init(struct drive_context_s *drv)
 
55
{
 
56
    iecieee_drive_init(drv);
 
57
    ieee_drive_init(drv);
 
58
}
 
59
 
 
60
void machine_drive_shutdown(struct drive_context_s *drv)
 
61
{
 
62
    iecieee_drive_shutdown(drv);
 
63
    ieee_drive_shutdown(drv);
 
64
}
 
65
 
 
66
void machine_drive_reset(struct drive_context_s *drv)
 
67
{
 
68
    iecieee_drive_reset(drv);
 
69
    ieee_drive_reset(drv);
 
70
}
 
71
 
 
72
void machine_drive_mem_init(struct drive_context_s *drv, unsigned int type)
 
73
{
 
74
    ieee_drive_mem_init(drv, type);
 
75
}
 
76
 
 
77
void machine_drive_setup_context(struct drive_context_s *drv)
 
78
{
 
79
    iecieee_drive_setup_context(drv);
 
80
    ieee_drive_setup_context(drv);
 
81
}
 
82
 
 
83
void machine_drive_idling_method(unsigned int dnr)
 
84
{
 
85
}
 
86
 
 
87
void machine_drive_vsync_hook(void)
 
88
{
 
89
}
 
90
 
 
91
void machine_drive_rom_load(void)
 
92
{
 
93
    ieee_drive_rom_load();
 
94
}
 
95
 
 
96
void machine_drive_rom_setup_image(unsigned int dnr)
 
97
{
 
98
    ieee_drive_rom_setup_image(dnr);
 
99
}
 
100
 
 
101
int machine_drive_rom_read(unsigned int type, WORD addr, BYTE *data)
 
102
{
 
103
    if (ieee_drive_rom_read(type, addr, data) == 0)
 
104
        return 0;
 
105
 
 
106
    return -1;
 
107
}
 
108
 
 
109
int machine_drive_rom_check_loaded(unsigned int type)
 
110
{
 
111
    if (ieee_drive_rom_check_loaded(type) == 0)
 
112
        return 0;
 
113
 
 
114
    return -1;
 
115
}
 
116
 
 
117
void machine_drive_rom_do_checksum(unsigned int dnr)
 
118
{
 
119
    ieee_drive_rom_do_checksum(dnr);
 
120
}
 
121
 
 
122
int machine_drive_snapshot_read(struct drive_context_s *ctxptr,
 
123
                                struct snapshot_s *s)
 
124
{
 
125
    if (iecieee_drive_snapshot_read(ctxptr, s) < 0)
 
126
        return -1;
 
127
    if (ieee_drive_snapshot_read(ctxptr, s) < 0)
 
128
        return -1;
 
129
 
 
130
    return 0;
 
131
}
 
132
 
 
133
int machine_drive_snapshot_write(struct drive_context_s *ctxptr,
 
134
                                 struct snapshot_s *s)
 
135
{
 
136
    if (iecieee_drive_snapshot_write(ctxptr, s) < 0)
 
137
        return -1;
 
138
    if (ieee_drive_snapshot_write(ctxptr, s) < 0)
 
139
        return -1;
 
140
 
 
141
    return 0;
 
142
}
 
143
 
 
144
int machine_drive_image_attach(struct disk_image_s *image, unsigned int unit)
 
145
{
 
146
    return ieee_drive_image_attach(image, unit);
 
147
}
 
148
 
 
149
int machine_drive_image_detach(struct disk_image_s *image, unsigned int unit)
 
150
{
 
151
    return ieee_drive_image_detach(image, unit);
 
152
}
 
153
 
 
154
void machine_drive_port_default(struct drive_context_s *drv)
 
155
{
 
156
 
 
157
}
 
158
 
 
159
void machine_drive_flush(void)
 
160
{
 
161
    drive_gcr_data_writeback_all();
 
162
}
 
163
 
 
164
void machine_drive_stub(void)
 
165
{
 
166
 
 
167
}
 
168