2016-12-28 20:32:00 +00:00
|
|
|
// ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code.
|
2024-02-19 21:51:57 +00:00
|
|
|
// Copyright (C) 1998-2024 Marco Baye
|
2012-02-27 21:14:46 +00:00
|
|
|
// Have a look at "acme.c" for further info
|
|
|
|
//
|
|
|
|
// Platform specific stuff (in this case, for RISC OS)
|
|
|
|
#ifndef platform_H
|
|
|
|
#define platform_H
|
|
|
|
|
2024-02-19 21:51:57 +00:00
|
|
|
|
2024-03-15 00:18:21 +00:00
|
|
|
#include "config.h" // for "bits"
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
// symbolic constants and macros
|
|
|
|
|
|
|
|
// called once on program startup (could register exit handler, if needed)
|
|
|
|
#define PLATFORM_INIT RISCOS_entry()
|
|
|
|
|
2024-03-08 23:42:58 +00:00
|
|
|
// directory separators for search paths
|
|
|
|
#define DIRECTORY_SEPARATOR '.'
|
|
|
|
#define ALTERNATIVE_DIR_SEP ':'
|
2017-12-22 22:55:36 +00:00
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
// string containing the prefix for accessing files from the library tree
|
|
|
|
#define PLATFORM_LIBPREFIX "ACME_Lib:"
|
2024-03-08 23:42:58 +00:00
|
|
|
#define PLATFORM_NEEDS_ENV_VAR 0 // no "ACME" environment variable needed
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
// setting file types of created files
|
2012-10-25 15:33:14 +00:00
|
|
|
#define PLATFORM_SETFILETYPE_APPLE(a) RISCOS_set_filetype(a, 0xffd) // FIXME - wrong value!
|
2012-02-27 21:14:46 +00:00
|
|
|
#define PLATFORM_SETFILETYPE_CBM(a) RISCOS_set_filetype(a, 0x064)
|
|
|
|
#define PLATFORM_SETFILETYPE_PLAIN(a) RISCOS_set_filetype(a, 0xffd)
|
|
|
|
#define PLATFORM_SETFILETYPE_TEXT(a) RISCOS_set_filetype(a, 0xfff)
|
|
|
|
|
|
|
|
// platform specific message output
|
2024-08-28 16:45:31 +00:00
|
|
|
#define PLATFORM_INFO(a) RISCOS_throwback(a, 0)
|
2012-02-27 21:14:46 +00:00
|
|
|
#define PLATFORM_WARNING(a) RISCOS_throwback(a, 0)
|
|
|
|
#define PLATFORM_ERROR(a) RISCOS_throwback(a, 1)
|
|
|
|
#define PLATFORM_SERIOUS(a) RISCOS_throwback(a, 2)
|
|
|
|
|
|
|
|
// integer-to-character conversion
|
|
|
|
#define PLATFORM_UINT2CHAR(x) \
|
|
|
|
do { \
|
|
|
|
x ^= x >> 16; \
|
|
|
|
x ^= x >> 8; \
|
|
|
|
x &= 255; \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
// output of platform-specific command line switches
|
|
|
|
#define PLATFORM_OPTION_HELP \
|
2024-02-11 23:08:58 +00:00
|
|
|
" -t, --throwback use the DDEUtils module's \"throwback\" protocol\n"
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
// processing of platform-specific command line switches
|
|
|
|
#define PLATFORM_SHORTOPTION_CODE \
|
|
|
|
case 't': \
|
|
|
|
RISCOS_flags |= RISCOSFLAG_THROWBACK; \
|
|
|
|
break;
|
|
|
|
#define PLATFORM_LONGOPTION_CODE \
|
|
|
|
else if (strcmp(string, "throwback") == 0) \
|
|
|
|
RISCOS_flags |= RISCOSFLAG_THROWBACK;
|
|
|
|
|
|
|
|
|
|
|
|
// variables
|
2020-06-14 00:26:38 +00:00
|
|
|
extern bits RISCOS_flags; // Holds platform-specific flags
|
2012-02-27 21:14:46 +00:00
|
|
|
#define RISCOSFLAG_THROWBACK (1u << 0) // use throwback protocol
|
|
|
|
#define RISCOSFLAG_THROWN (1u << 1) // throwback is active
|
|
|
|
|
|
|
|
|
|
|
|
// used as PLATFORM_INIT: registers exit handler
|
|
|
|
extern void RISCOS_entry(void);
|
2024-02-19 21:51:57 +00:00
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
// setting the created files' types
|
2020-05-29 14:30:03 +00:00
|
|
|
extern void RISCOS_set_filetype(const char *filename, int type);
|
2024-02-19 21:51:57 +00:00
|
|
|
|
2012-02-27 21:14:46 +00:00
|
|
|
// use DDEUtils module's "Throwback" protocol
|
2020-05-29 14:30:03 +00:00
|
|
|
extern void RISCOS_throwback(const char *msg, int type);
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|