Debian Codegraph @

src/_riscos.h

raw symbols SCIP
1 // ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code.
2 // Copyright (C) 1998-2024 Marco Baye
3 // Have a look at "acme.c" for further info
4 //
5 // Platform specific stuff (in this case, for RISC OS)
6 #ifndef platform_H
7 #define platform_H
8
9
10 #include "config.h" // for "bits"
11
12
13 // symbolic constants and macros
14
15 // called once on program startup (could register exit handler, if needed)
16 #define PLATFORM_INIT RISCOS_entry()
17
18 // directory separators for search paths
19 #define DIRECTORY_SEPARATOR '.'
20 #define ALTERNATIVE_DIR_SEP ':'
21
22 // string containing the prefix for accessing files from the library tree
23 // (use "--libpath" cli switch to override)
24 #define PLATFORM_LIBPREFIX "ACME_Lib:"
25 #define PLATFORM_USE_ENV_VAR 0 // no "ACME" environment variable needed/supported
26
27 // setting file types of created files
28 #define PLATFORM_SETFILETYPE_APPLE(a) RISCOS_set_filetype(a, 0xffd) // FIXME - wrong value!
29 #define PLATFORM_SETFILETYPE_CBM(a) RISCOS_set_filetype(a, 0x064)
30 #define PLATFORM_SETFILETYPE_PLAIN(a) RISCOS_set_filetype(a, 0xffd)
31 #define PLATFORM_SETFILETYPE_TEXT(a) RISCOS_set_filetype(a, 0xfff)
32
33 // platform specific message output
34 #define PLATFORM_INFO(a) RISCOS_throwback(a, 0)
35 #define PLATFORM_WARNING(a) RISCOS_throwback(a, 0)
36 #define PLATFORM_ERROR(a) RISCOS_throwback(a, 1)
37 #define PLATFORM_SERIOUS(a) RISCOS_throwback(a, 2)
38
39 // integer-to-character conversion
40 #define PLATFORM_UINT2CHAR(x) \
41 do { \
42 x ^= x >> 16; \
43 x ^= x >> 8; \
44 x &= 255; \
45 } while (0)
46
47 // output of platform-specific command line switches
48 #define PLATFORM_OPTION_HELP \
49 " -t, --throwback use the DDEUtils module's \"throwback\" protocol\n"
50
51 // processing of platform-specific command line switches
52 #define PLATFORM_SHORTOPTION_CODE \
53 case 't': \
54 RISCOS_flags |= RISCOSFLAG_THROWBACK; \
55 break;
56 #define PLATFORM_LONGOPTION_CODE \
57 else if (strcmp(string, "throwback") == 0) \
58 RISCOS_flags |= RISCOSFLAG_THROWBACK;
59
60
61 // variables
62 extern bits RISCOS_flags; // Holds platform-specific flags
63 #define RISCOSFLAG_THROWBACK (1u << 0) // use throwback protocol
64 #define RISCOSFLAG_THROWN (1u << 1) // throwback is active
65
66
67 // used as PLATFORM_INIT: registers exit handler
68 extern void RISCOS_entry(void);
69
70 // setting the created files' types
71 extern void RISCOS_set_filetype(const char *filename, int type);
72
73 // use DDEUtils module's "Throwback" protocol
74 extern void RISCOS_throwback(const char *msg, int type);
75
76
77 #endif