1 /* 2 * Calcoo: displays.h 3 * 4 * Copyright (C) 2001, 2002 Alexei Kaminski 5 * 6 */ 7 8 #ifndef DISPLAYS_H 9 #define DISPLAYS_H 10 11 #include "basic.h" /* for the NUMBER_OF_MEMS */ 12 13 #define NUMBER_OF_REG_DISPLAYS 3 /* if you want to change this number, you 14 * also need to make modifications in 15 * cpu_to_output() */ 16 17 18 #define NUMBER_OF_DISPLAYS ( 1 + NUMBER_OF_MEMS + NUMBER_OF_REG_DISPLAYS ) 19 20 #define NUMBER_OF_SIMPLE_DISPLAYS (NUMBER_OF_REG_DISPLAYS * 2 + 2) 21 /* NUMBER_OF_REG_DISPLAYS for display labels, 22 * NUMBER_OF_REG_DISPLAYS for the operations and parens in the stack, 23 * 1 for display format and 1 for deg/rad 24 * in the land of Mordor, where the shadow lies */ 25 26 27 /* -------------------------------------------------------- 28 * positions of the displays in the array which holds them 29 * -------------------------------------------------------- */ 30 31 #define MAIN_DISPLAY 0 32 #define MEM_DISPLAY_OFFSET 1 /* the number of the first mem display */ 33 #define REG_DISPLAY_OFFSET (1 + NUMBER_OF_MEMS) /* of the first reg display */ 34 35 36 #define OPERATION_DISPLAY_OFFSET 0 37 #define DISPLAY_LABEL_DISPLAY_OFFSET NUMBER_OF_REG_DISPLAYS 38 #define ANGLE_UNIT_DISPLAY_OFFSET (NUMBER_OF_REG_DISPLAYS * 2) 39 #define FORMAT_DISPLAY_OFFSET (NUMBER_OF_REG_DISPLAYS * 2 + 1) 40 41 42 /* ---------------------------------------------- 43 * codes for the display glyphs other than digits 44 * 45 * when a display is created, the set of the glyphs to be used 46 * is passed to the corresponding function in an array; the codes 47 * label the positions of the glyphs in this array 48 * ----------------------------------------------- */ 49 50 /* 0-9 reserved for the digits */ 51 #define D_E 10 52 #define D_PLUS 11 53 #define D_MINUS 12 54 #define D_DOT 13 55 #define D_TICK 14 56 #define D_OVERFLOW 15 57 /* don't forget to adjust D_G_TOTAL if you add something to 58 * the set below */ 59 60 #define NUMBER_OF_DISPLAY_GLYPHS 16 61 /* 0-9 plus the glyphs defined above 62 * it is needed in the decaration of the array, 63 * which holds the glyphs to pass to the corresp. 64 * function for the display creation */ 65 66 67 /* --------------------------------------------------- 68 * codes for the glyphs of the "operation displays," 69 * which are small displays showing operations and parens in the stack 70 * --------------------------------------------------- */ 71 72 #define OD_ADD 0 73 #define OD_SUB 1 74 #define OD_MUL 2 75 #define OD_DIV 3 76 #define OD_POW 4 77 #define OD_PAREN 5 78 79 #define NUMBER_OF_OPERATION_DISPLAY_GLYPHS 6 80 81 82 /* --------------------------------------------------- 83 * codes for the glyphs of the deg/rad display 84 * --------------------------------------------------- */ 85 86 #define DRD_DEG 0 87 #define DRD_RAD 1 88 89 #define NUMBER_OF_ANGLE_UNIT_GLYPHS 2 90 91 92 /* --------------------------------------------------- 93 * codes for the glyphs of the fix/exp/sci display 94 * --------------------------------------------------- */ 95 96 #define FD_FIX 0 97 #define FD_SCI 1 98 #define FD_ENG 2 99 100 #define NUMBER_OF_FORMAT_GLYPHS 3 101 102 #endif /* DISPLAYS_H */ 103