From 0cecf166c755adf583f4cbc754d00726ab60e8ce Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sat, 16 Apr 2022 14:02:57 -0500 Subject: [PATCH] Add definitions and structures for o65 files These can be used to read and parse o65 files. --- sw/o65.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sw/o65.h diff --git a/sw/o65.h b/sw/o65.h new file mode 100644 index 0000000..6191a25 --- /dev/null +++ b/sw/o65.h @@ -0,0 +1,65 @@ +#ifndef _O65_H +#define _O65_H + +#include + +#define O65_NON_C64 0x0001 +#define O65_MAGIC_0 0x6f +#define O65_MAGIC_1 0x36 +#define O65_MAGIC_2 0x35 + +#define O65_OPT_FILENAME 0 +#define O65_OPT_OS 1 +#define O65_OPT_ASSEMBLER 2 +#define O65_OPT_AUTHOR 3 +#define O65_OPT_DATE 4 + +#define O65_OS_OSA65 1 +#define O65_OS_LUNIX 2 +#define O65_OS_CC65 3 +#define O65_OS_OPENCBM 4 +#define O65_OS_SUPER6502 5 + +typedef union { + struct { + int cpu : 1; + int reloc : 1; + int size : 1; + int obj : 1; + int simple : 1; + int chain : 1; + int bsszero : 1; + int cpu2 : 4; + int align : 2; + }; + uint16_t _mode; +} o65_mode_t; + +typedef struct { + uint16_t c64_marker; + uint8_t magic[3]; + uint8_t version; + + o65_mode_t mode; + + uint16_t tbase; + uint16_t tlen; + uint16_t dbase; + uint16_t dlen; + uint16_t bbase; + uint16_t blen; + uint16_t zbase; + uint16_t zlen; + uint16_t stack; + +} o65_header_t; + +typedef struct { + uint8_t olen; + uint8_t type; + uint8_t data[1]; //This is actually variable length +} o65_opt; + +#endif + +