Added Makefile to simplify builds

This commit is contained in:
Luxferre
2022-08-06 13:35:10 +03:00
parent 62b84f735b
commit 00bdae06da
3 changed files with 34 additions and 11 deletions
+10 -10
View File
@@ -36,46 +36,46 @@
#define ushort unsigned short /* basic 16-bit integer */
#define uchar unsigned char /* basic 8-bit integer */
#define WS sizeof(ushort) /* Equi word size in bytes */
#define CLT_ENTRY_LEN 6 /* Amount of significant compiled word characters */
#define CLT_ENTRY_LEN 6u /* Amount of significant compiled word characters */
#define CLT_ENTRY_SIZE (CLT_ENTRY_LEN + WS) /* Full size in bytes taken by one CLT entry */
/* Configuration section (constants overridable at compile-time) */
/* Main and return stack size in bytes */
#ifndef STACK_SIZE
#define STACK_SIZE 256
#define STACK_SIZE 256u
#endif
/* Literal stack size in bytes */
#ifndef LIT_STACK_SIZE
#define LIT_STACK_SIZE 32
#define LIT_STACK_SIZE 32u
#endif
/* GPD (general purpose data) area start address */
#ifndef GPD_AREA_START
#define GPD_AREA_START 0x2300
#define GPD_AREA_START 0x2300u
#endif
/* Command buffer start address */
#ifndef CMD_BUF_START
#define CMD_BUF_START 0x3b80
#define CMD_BUF_START 0x3b80u
#endif
/* Command buffer size in bytes */
#ifndef CMD_BUF_SIZE
#define CMD_BUF_SIZE 15600
#define CMD_BUF_SIZE 15600u
#endif
/* Some necessary constants and offsets derived from the above values */
#define STACK_SIZE_WORDS (STACK_SIZE / WS) /* Main and return stack size in words */
#define MAIN_STACK_ADDR 0 /* Main stack address */
#define MAIN_STACK_ADDR 0u /* Main stack address */
#define RETURN_STACK_ADDR STACK_SIZE /* Return stack address */
#define LIT_STACK_ADDR (RETURN_STACK_ADDR + STACK_SIZE) /* Literal stack address */
#define PC_ADDR (LIT_STACK_ADDR + LIT_STACK_SIZE) /* Program counter address */
#define CBP_ADDR (PC_ADDR + WS) /* Compilation buffer pointer location address */
#define CLTP_ADDR (CBP_ADDR + WS) /* Compilation lookup table pointer location address */
#define FLAGS_ADDR (CLTP_ADDR + WS) /* Flags register address */
#define GPD_START_LOC_ADDR (FLAGS_ADDR + 1) /* Location where GPD_AREA_START value is stored */
#define GPD_START_LOC_ADDR (FLAGS_ADDR + 1u) /* Location where GPD_AREA_START value is stored */
#define CMD_START_LOC_ADDR (GPD_START_LOC_ADDR + WS) /* Location where CMD_BUF_START value is stored */
#define CMD_SIZE_LOC_ADDR (CMD_START_LOC_ADDR + WS) /* Location where CMD_BUF_SIZE value is stored */
#define CLT_START (CMD_SIZE_LOC_ADDR + 213u) /* should be 0x300 by default */
@@ -94,7 +94,7 @@ struct EquiFlags {
};
struct CLTEntry {
uchar name[6]; /* compiled word name */
uchar name[CLT_ENTRY_LEN]; /* compiled word name */
ushort loc; /* compiled word location */
};
@@ -112,7 +112,7 @@ struct EquiRAM {
ushort gpd_start;
ushort cmd_start;
ushort cmd_size;
uchar reserved[206]; /* reserved space */
uchar reserved[206u]; /* reserved space */
struct CLTEntry clt[CLT_ENTRIES_MAX]; /* compilation lookup table */
uchar gpd[GPD_AREA_SIZE];
uchar cmdbuf[CMD_BUF_SIZE];