mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-01-10 21:30:30 +00:00
added "apple" output format for Apple II machines (load address, length, body)
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@7 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
57ff3490e0
commit
e6a8139fcb
@ -20,6 +20,7 @@
|
||||
#define NO_NEED_FOR_ENV_VAR
|
||||
|
||||
// setting file types of created files
|
||||
#define PLATFORM_SETFILETYPE_APPLE(a)
|
||||
#define PLATFORM_SETFILETYPE_CBM(a)
|
||||
#define PLATFORM_SETFILETYPE_PLAIN(a)
|
||||
#define PLATFORM_SETFILETYPE_TEXT(a)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#define PLATFORM_LIBPREFIX DOS_lib_prefix
|
||||
|
||||
// setting file types of created files
|
||||
#define PLATFORM_SETFILETYPE_APPLE(a)
|
||||
#define PLATFORM_SETFILETYPE_CBM(a)
|
||||
#define PLATFORM_SETFILETYPE_PLAIN(a)
|
||||
#define PLATFORM_SETFILETYPE_TEXT(a)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#define NO_NEED_FOR_ENV_VAR
|
||||
|
||||
// setting file types of created files
|
||||
#define PLATFORM_SETFILETYPE_APPLE(a) RISCOS_set_filetype(a, 0xffd) // FIXME - wrong value!
|
||||
#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)
|
||||
|
@ -19,6 +19,7 @@
|
||||
#define PLATFORM_LIBPREFIX AnyOS_lib_prefix
|
||||
|
||||
// setting the created files' types
|
||||
#define PLATFORM_SETFILETYPE_APPLE(a)
|
||||
#define PLATFORM_SETFILETYPE_CBM(a)
|
||||
#define PLATFORM_SETFILETYPE_PLAIN(a)
|
||||
#define PLATFORM_SETFILETYPE_TEXT(a)
|
||||
|
@ -15,9 +15,9 @@
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#define RELEASE "0.94.3" // update before release (FIXME)
|
||||
#define RELEASE "0.94.4" // update before release (FIXME)
|
||||
#define CODENAME "Zarquon" // update before release
|
||||
#define CHANGE_DATE "16 Mar" // update before release
|
||||
#define CHANGE_DATE "9 Oct" // update before release
|
||||
#define CHANGE_YEAR "2012" // update before release
|
||||
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" // FIXME
|
||||
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME
|
||||
|
15
src/output.c
15
src/output.c
@ -53,10 +53,12 @@ static struct node_t *file_format_tree = NULL; // tree to hold output formats
|
||||
// possible file formats
|
||||
enum out_format_t {
|
||||
OUTPUT_FORMAT_UNSPECIFIED, // default (uses "plain" actually)
|
||||
OUTPUT_FORMAT_PLAIN,
|
||||
OUTPUT_FORMAT_CBM, // default for "!to" pseudo opcode
|
||||
OUTPUT_FORMAT_APPLE, // load address, length, code
|
||||
OUTPUT_FORMAT_CBM, // load address, code (default for "!to" pseudo opcode)
|
||||
OUTPUT_FORMAT_PLAIN // code only
|
||||
};
|
||||
static struct node_t file_formats[] = {
|
||||
PREDEFNODE("apple", OUTPUT_FORMAT_APPLE),
|
||||
PREDEFNODE(s_cbm, OUTPUT_FORMAT_CBM),
|
||||
// PREDEFNODE("o65", OUTPUT_FORMAT_O65),
|
||||
PREDEFLAST("plain", OUTPUT_FORMAT_PLAIN),
|
||||
@ -359,6 +361,15 @@ void Output_save_file(FILE *fd)
|
||||
amount, amount, lowest_idx, highest_idx);
|
||||
// output file header according to file format
|
||||
switch (output_format) {
|
||||
case OUTPUT_FORMAT_APPLE:
|
||||
PLATFORM_SETFILETYPE_APPLE(output_filename);
|
||||
// output 16-bit load address in little-endian byte order
|
||||
putc(lowest_idx & 255, fd);
|
||||
putc(lowest_idx >> 8, fd);
|
||||
// output 16-bit length in little-endian byte order
|
||||
putc(amount & 255, fd);
|
||||
putc(amount >> 8, fd);
|
||||
break;
|
||||
case OUTPUT_FORMAT_UNSPECIFIED:
|
||||
case OUTPUT_FORMAT_PLAIN:
|
||||
PLATFORM_SETFILETYPE_PLAIN(output_filename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user