1 /*
2  * c1541-stubs.c - dummies for unneeded/unused functions
3  *
4  * Written by
5  *  groepaz <groepaz@gmx.net>
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 #include "archdep_defs.h"
29 
30 #include "cmdline.h"
31 #include "drive.h"
32 #include "imagecontents.h"
33 #include "machine.h"
34 #include "serial.h"
35 #include "tape.h"
36 #include "vdrive.h"
37 #include "vice-event.h"
38 
39 #include <stdbool.h>
40 
41 /*
42    FIXME: these really shouldnt be needed here and are a sign of bad modular
43           design elsewhere
44  */
45 
46 /* called from resources_set_defaults() */
cartridge_detach_image(int type)47 void cartridge_detach_image(int type)
48 {
49 }
50 
51 /* called from resources_set_defaults() */
cartridge_unset_default(void)52 void cartridge_unset_default(void)
53 {
54 }
55 
cmdline_register_options(const cmdline_option_t * c)56 int cmdline_register_options(const cmdline_option_t *c)
57 {
58     return 0;
59 }
60 
network_connected(void)61 int network_connected(void)
62 {
63     return 0;
64 }
65 
network_get_mode(void)66 int network_get_mode(void)
67 {
68 #if 0
69     return NETWORK_IDLE;
70 #else
71     return 0;
72 #endif
73 }
74 
network_event_record(unsigned int type,void * data,unsigned int size)75 void network_event_record(unsigned int type, void *data, unsigned int size)
76 {
77 
78 }
79 
event_record_in_list(event_list_state_t * list,unsigned int type,void * data,unsigned int size)80 void event_record_in_list(event_list_state_t *list, unsigned int type,
81                           void *data, unsigned int size)
82 {
83 
84 }
85 
ui_error(const char * format,...)86 void ui_error(const char *format, ...)
87 {
88 
89 }
90 
main_exit(void)91 void main_exit(void)
92 {
93 
94 }
95 
mainlock_is_vice_thread(void)96 bool mainlock_is_vice_thread(void)
97 {
98 
99     return false;
100 }
101 
mainlock_initiate_shutdown(void)102 void mainlock_initiate_shutdown(void)
103 {
104 
105 }
106 
enable_text(void)107 void enable_text(void)
108 {
109 }
110 
disable_text(void)111 void disable_text(void)
112 {
113 }
114 
machine_bus_device_attach(unsigned int device,const char * name,int (* getf)(vdrive_t *,uint8_t *,unsigned int,struct cbmdos_cmd_parse_s *),int (* putf)(vdrive_t *,uint8_t,unsigned int),int (* openf)(vdrive_t *,const char *,int,unsigned int),int (* closef)(vdrive_t *,unsigned int),void (* flushf)(vdrive_t *,unsigned int),void (* listenf)(vdrive_t *,unsigned int))115 int machine_bus_device_attach(unsigned int device, const char *name,
116                               int (*getf)(vdrive_t *, uint8_t *, unsigned int,
117                                           struct cbmdos_cmd_parse_s *),
118                               int (*putf)(vdrive_t *, uint8_t, unsigned int),
119                               int (*openf)(vdrive_t *, const char *, int,
120                                            unsigned int),
121                               int (*closef)(vdrive_t *, unsigned int),
122                               void (*flushf)(vdrive_t *, unsigned int),
123                               void (*listenf)(vdrive_t *, unsigned int))
124 {
125     return 0;
126 }
127 
snapshot_module_create(snapshot_t * s,const char * name,uint8_t major_version,uint8_t minor_version)128 snapshot_module_t *snapshot_module_create(snapshot_t *s, const char *name, uint8_t major_version, uint8_t minor_version)
129 {
130     return NULL;
131 }
132 
snapshot_module_open(snapshot_t * s,const char * name,uint8_t * major_version_return,uint8_t * minor_version_return)133 snapshot_module_t *snapshot_module_open(snapshot_t *s, const char *name, uint8_t *major_version_return, uint8_t *minor_version_return)
134 {
135     return NULL;
136 }
137 
snapshot_module_close(snapshot_module_t * m)138 int snapshot_module_close(snapshot_module_t *m)
139 {
140     return 0;
141 }
142 
snapshot_module_read_dword_into_int(snapshot_module_t * m,int * value_return)143 int snapshot_module_read_dword_into_int(snapshot_module_t *m, int *value_return)
144 {
145     return 0;
146 }
147 
snapshot_module_read_dword_into_uint(snapshot_module_t * m,unsigned int * value_return)148 int snapshot_module_read_dword_into_uint(snapshot_module_t *m, unsigned int *value_return)
149 {
150     return 0;
151 }
152 
ui_error_string(const char * text)153 void ui_error_string(const char *text)
154 {
155 }
156 
vsync_suspend_speed_eval(void)157 void vsync_suspend_speed_eval(void)
158 {
159 }
160 
machine_diskcontents_bus_read(unsigned int unit)161 struct image_contents_s *machine_diskcontents_bus_read(unsigned int unit)
162 {
163     return diskcontents_iec_read(unit);
164 }
165 
machine_bus_lib_directory(unsigned int unit,const char * pattern,uint8_t ** buf)166 int machine_bus_lib_directory(unsigned int unit, const char *pattern, uint8_t **buf)
167 {
168     return serial_iec_lib_directory(unit, pattern, buf);
169 }
170 
machine_bus_lib_read_sector(unsigned int unit,unsigned int track,unsigned int sector,uint8_t * buf)171 int machine_bus_lib_read_sector(unsigned int unit, unsigned int track, unsigned int sector, uint8_t *buf)
172 {
173     return serial_iec_lib_read_sector(unit, track, sector, buf);
174 }
175 
machine_bus_lib_write_sector(unsigned int unit,unsigned int track,unsigned int sector,uint8_t * buf)176 int machine_bus_lib_write_sector(unsigned int unit, unsigned int track, unsigned int sector, uint8_t *buf)
177 {
178     return serial_iec_lib_write_sector(unit, track, sector, buf);
179 }
180 
machine_bus_device_type_get(unsigned int unit)181 unsigned int machine_bus_device_type_get(unsigned int unit)
182 {
183     return serial_device_type_get(unit);
184 }
185 
machine_drive_rom_check_loaded(unsigned int type)186 int machine_drive_rom_check_loaded(unsigned int type)
187 {
188     return 0;
189 }
190 
machine_drive_flush(void)191 void machine_drive_flush(void)
192 {
193 }
194 
195 /** \brief  Machine name
196  */
197 const char machine_name[] = "C1541";
198 
199 /** \brief  Machine class
200  */
201 int machine_class = VICE_MACHINE_C1541;
202 
machine_get_name(void)203 const char *machine_get_name(void)
204 {
205     return machine_name;
206 }
207 
machine_tape_behaviour(void)208 uint8_t machine_tape_behaviour(void)
209 {
210     return TAPE_BEHAVIOUR_NORMAL;
211 }
212 
kbd_get_menu_keyname(void)213 char *kbd_get_menu_keyname(void)
214 {
215     return NULL;
216 }
217