/* Copyright (c) 1988,1991 by Sozobon, Limited.  Author: Johann Ruegg
 *
 * Permission is granted to anyone to use this software for any purpose
 * on any computer system, and to redistribute it freely, with the
 * following restrictions:
 * 1) No charge may be made other than reasonable charges for reproduction.
 * 2) Modified versions must be clearly marked as such.
 * 3) The authors are not responsible for any harmful consequences
 *    of using this software, even if they result from defects in it.
 *
 *	param.h
 *
 *	basic parameters
 *
 * Modified by Detlef Wuerkner for AMIGA
 * Changes marked with TETISOFT
 *
 * 1994
 * Modified by Jason Petty to work with hce.
 * Changes marked with VANSOFT.
 */

/* Stop Compiling if mem drops below 100K. VANSOFT */
#define MEM_QUIT  102400
#define MEM_OK    (mem_mon > MEM_QUIT)

/* Maximum errors before compile is stopped.(0-MAXERRS). VANSOFT. */
#define MAXERRS   5

/* Check still ok to compile. VANSOFT */
#define COMP_OK   (nmerrors < MAXERRS)

/* Stop compiling.
 * NOTE: 
 *      If the compiler was reading many nested include files then it may
 *      not stop compiling until it has returned from the nest. VANSOFT.
 */
#define STOP_COMPILE nmerrors=MAXERRS;

/* Stop error messages from being shown.
 * Note: this will not stop any FATAL type messages!. VANSOFT.
 */
#define MAX_MESSAGE   5
#define STOP_MSG      msg_shown=MAX_MESSAGE;
#define MSG_OK       (msg_shown < MAX_MESSAGE)
#define MSG_LONG_OK  (msg_shown < MAX_MESSAGE-1)

#ifndef MMCC
#define MMCC	0
#endif

#ifndef CC68
#define CC68	0
#endif

#ifndef dLibs
#define dLibs	0
#endif

/* ADDED BY TETISOFT */
#ifndef CCLib
#define CCLib	1
#endif

#undef NULL
#define NULL 0L

#ifndef LAT_HOST
#ifndef ACK_HOST
#define ENUMS	1	/* define if host compiler can do enums */
#endif
#endif

/* COMMENTED OUT BY TETISOFT */
/* #define DEBUG	1 */

#define NHASH	32

#define ROPEN	"r"
#define WOPEN	"w"
#define FLTFORM "%.3g"

#define MAXSTR	256
#define MAXINCL 10
#define NMSIZE	12	/* must be at least 12 */
#define NMXSIZE	32

/* sizes of basic types */
#define SIZE_C	1	/* char */
#define SIZE_S	2	/* short */
#define SIZE_L	4	/* long */
#define SIZE_F	4	/* float */
#define SIZE_D	4	/* double */
#define SIZE_P	4	/* pointer */

/* CHANGED BY TETISOFT for -L option */
#define	SIZE_I_DEF	2	/* int = 16 bit */
#define	SIZE_I_OPTL	4	/* int = 32 bit */
#define	SIZE_U_DEF	2	/* unsigned = 16 bit */
#define	SIZE_U_OPTL	4	/* unsigned = 32 bit */

/* alignment requirements */
#define ALN_C	0	/* char */
#define ALN_I	1	/* int */
#define ALN_S	1	/* short */
#define ALN_L	1	/* long */
#define ALN_U	1	/* unsigned */
#define ALN_F	1	/* float */
#define ALN_D	1	/* double */
#define ALN_P	1	/* pointer */

#define STACKALN 1

/* usage for registers */

/* 16-01-91 TetiSoft Changed DRV_START from D4 back to D3
 *          (CClib.library V3.0 seems to keep D3)
 *
 * 20-05-91 TetiSoft Changed ARV_START to A2 to gain another register variable
 *          Added AR_TEMP
 *          Changed out.c to use AR_TEMP instead of (ARV_START-1)
 *          Changed FD2Stubs to keep A2
 *          Changed TOP to keep A2
 *	    Changed lmath.asm to keep A2
 *
 * Register Usage of HCC is now as follows:
 * D0,D1,A0,A1 Scratch
 * D2 Temporary Register for Data Shifts (ASL etc)
 * D3,D4,D5,D6,D7 Register Variables
 * A2,A3,A4 Register Variables
 * A5 Local Stack Frame
 * A6 Temporary Reg for Structure Assignments AND Base Addr for Library Calls
 * A7 Stack Pointer
 *
 * Temporary registers are not saved between function or library calls,
 * even if CClib.library V3.0 saves D2, the routines in lmath.asm,
 * the stub codes generated by FD2Stubs and the code generated by HCC
 * destroys it.
 * Register variables are saved on function or library entry and restored 
 * at exit. If you write assembler subroutines for HCC, you MUST save these
 * registers!
 * Since CClib.library calls require parameters on stack AND library base in
 * A6, it would be very difficult to create stub codes that saves A6 without
 * changing A7. Also the execution speed gain of this function calls would be
 * lost. So I decided to give up A6 as local stack pointer and use A5 instead.
 * This resulted in the fact that only A3 and A4 were address register
 * variables. Therefore I changed the register usage for structure assignments
 * from A2 to A6 to gain another register variable.
 */
#ifndef CCLib
#define DRV_START	3
#define DRV_END		7
#define AREG		8
#define AR_TEMP		(AREG+2)	/* ADDED BY TETISOFT */
#define ARV_START	(AREG+3)
#define ARV_END		(AREG+5)
#define FRAMEP		(AREG+6)

#else
/* ADDED BY TETISOFT, work with cclib */
#define DRV_START	3
#define DRV_END		7
#define AREG		8
#define ARV_START	(AREG+2)
#define ARV_END		(AREG+4)
#define FRAMEP		(AREG+5)
#define AR_TEMP		(AREG+6)
/*
 * The field routines in fix.c didn't work with 32 bit integers.
 * After changing them, I tested them with 'DisAsm' from Fish #27. They seemed
 * to be ok, but, unfortunately, when not setting this flag, the compiler
 * produces a compiler that cannot compile this compiler (!). There must be a
 * bug left. Sorry. TETISOFT.
 *
 * 17-05-91 Tried again with new V2 routines. Produced a compiler that could
 * compile this compiler, seems to be ok.
 */
/* #define	NOFIELDS	1 */
#endif


/* definition of stack frame */
#define ARG_BASE	8
#define LOC_BASE	0

/* CHANGED BY TETISOFT, need for own file buffers */
#define NEEDBUF		1

/* ADDED BY TETISOFT, Computer used */
#define	FOR_AMIGA	1
