1 /** \file   archdep_win32.h
2  * \brief   Windows-specific stuff - header
3  *
4  * \author  Marco van den Heuvel <blackystardust68@yahoo.com>
5  */
6 
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 #ifndef VICE_ARCHDEP_WIN32_H
29 #define VICE_ARCHDEP_WIN32_H
30 
31 #define VICE_ARCHAPI_PRIVATE_API
32 #include "archapi.h"
33 #undef VICE_ARCHAPI_PRIVATE_API
34 
35 /* Filesystem dependant operators.  */
36 #define FSDEVICE_DEFAULT_DIR "."
37 #define FSDEV_DIR_SEP_STR    "\\"
38 #define FSDEV_DIR_SEP_CHR    '\\'
39 #define FSDEV_EXT_SEP_STR    "."
40 #define FSDEV_EXT_SEP_CHR    '.'
41 
42 /* Path separator.  */
43 #define ARCHDEP_FINDPATH_SEPARATOR_CHAR   ';'
44 #define ARCHDEP_FINDPATH_SEPARATOR_STRING ";"
45 
46 /* Modes for fopen().  */
47 #define MODE_READ              "rb"
48 #define MODE_READ_TEXT         "rt"
49 #define MODE_READ_WRITE        "rb+"
50 #define MODE_WRITE             "wb"
51 #define MODE_WRITE_TEXT        "wt"
52 #define MODE_APPEND            "ab"
53 #define MODE_APPEND_READ_WRITE "ab+"
54 
55 /* Printer default devices.  */
56 #define ARCHDEP_PRINTER_DEFAULT_DEV1 "viceprnt.out"
57 #define ARCHDEP_PRINTER_DEFAULT_DEV2 "LPT1:"
58 #define ARCHDEP_PRINTER_DEFAULT_DEV3 "LPT2:"
59 
60 /* Default RS232 devices.  */
61 #define ARCHDEP_RS232_DEV1 "10.0.0.1:25232"
62 #define ARCHDEP_RS232_DEV2 "10.0.0.1:25232"
63 #define ARCHDEP_RS232_DEV3 "10.0.0.1:25232"
64 #define ARCHDEP_RS232_DEV4 "10.0.0.1:25232"
65 
66 /* Default location of raw disk images.  */
67 #define ARCHDEP_RAWDRIVE_DEFAULT "A:"
68 
69 /* Access types */
70 #define ARCHDEP_R_OK 4
71 #define ARCHDEP_W_OK 2
72 #define ARCHDEP_X_OK 1
73 #define ARCHDEP_F_OK 0
74 
75 /* Standard line delimiter.  */
76 #define ARCHDEP_LINE_DELIMITER "\r\n"
77 
78 /* Ethernet default device */
79 #define ARCHDEP_ETHERNET_DEFAULT_DEVICE ""
80 
81 /* Default sound fragment size */
82 #define ARCHDEP_SOUND_FRAGMENT_SIZE SOUND_FRAGMENT_MEDIUM
83 
84 void archdep_workaround_nop(const char *otto);
85 
86 /*
87     FIXME: confirm wether SIGPIPE must be handled or not. if the emulator quits
88            or crashes when the connection is closed, you might have to install
89            a signal handler which calls monitor_abort().
90 
91            see archdep_unix.c and bug #3201796
92 */
93 void archdep_signals_init(int do_coredumps);
94 #define archdep_signals_pipe_set()
95 #define archdep_signals_pipe_unset()
96 
97 #define MAKE_SO_NAME_VERSION_PROTO(name, version)  #name "-" #version ".dll"
98 
99 /* add second level macro to allow expansion and stringification */
100 #define ARCHDEP_MAKE_SO_NAME_VERSION(n, v) MAKE_SO_NAME_VERSION_PROTO(n, v)
101 
102 #define ARCHDEP_OPENCBM_SO_NAME  "opencbm.dll"
103 #define ARCHDEP_LAME_SO_NAME     "lame.dll"
104 
105 /* ffmpeg headers for windows don't seem to have some of the av_ prefixes */
106 #define ARCHDEP_AV_PREFIX_NEEDED
107 
108 /* Needs extra call to log_archdep() even when logfile is already opened */
109 #ifndef WATCOM_COMPILE
110 #define ARCHDEP_EXTRA_LOG_CALL
111 #endif
112 
113 /* When using the ascii printer driver we need a return before the newline */
114 #define ARCHDEP_PRINTER_RETURN_BEFORE_NEWLINE
115 
116 /* what to use to return an error when a socket error happens */
117 #define ARCHDEP_SOCKET_ERROR WSAGetLastError()
118 
119 /* Keyword to use for a static prototype */
120 #define STATIC_PROTOTYPE static
121 
122 void vice_usleep(uint64_t waitTime);
123 
124 extern int is_windows_nt(void);
125 
126 #endif
127