| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
#ifndef platform_H |
| 7 |
#define platform_H |
| 8 |
|
| 9 |
|
| 10 |
#include "config.h" |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#define PLATFORM_INIT RISCOS_entry() |
| 17 |
|
| 18 |
|
| 19 |
#define DIRECTORY_SEPARATOR '.' |
| 20 |
#define ALTERNATIVE_DIR_SEP ':' |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#define PLATFORM_LIBPREFIX "ACME_Lib:" |
| 25 |
#define PLATFORM_USE_ENV_VAR 0 // no "ACME" environment variable needed/supported |
| 26 |
|
| 27 |
|
| 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 |
|
| 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 |
|
| 40 |
#define PLATFORM_UINT2CHAR(x) \ |
| 41 |
do { \ |
| 42 |
x ^= x >> 16; \ |
| 43 |
x ^= x >> 8; \ |
| 44 |
x &= 255; \ |
| 45 |
} while (0) |
| 46 |
|
| 47 |
|
| 48 |
#define PLATFORM_OPTION_HELP \ |
| 49 |
" -t, --throwback use the DDEUtils module's \"throwback\" protocol\n" |
| 50 |
|
| 51 |
|
| 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 |
|
| 62 |
extern bits RISCOS_flags; |
| 63 |
#define RISCOSFLAG_THROWBACK (1u << 0) // use throwback protocol |
| 64 |
#define RISCOSFLAG_THROWN (1u << 1) // throwback is active |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
extern void RISCOS_entry(void); |
| 69 |
|
| 70 |
|
| 71 |
extern void RISCOS_set_filetype(const char *filename, int type); |
| 72 |
|
| 73 |
|
| 74 |
extern void RISCOS_throwback(const char *msg, int type); |
| 75 |
|
| 76 |
|
| 77 |
#endif |