[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | showcfg.c -- display a configuration diagram
|
---|
| 4 | Version 14 -- 1988-08-26 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | #define MAXPAT 35
|
---|
| 11 |
|
---|
| 12 | #include "configs.h"
|
---|
| 13 |
|
---|
| 14 | /* instrument display configuration box parameters */
|
---|
| 15 |
|
---|
| 16 | #define LFT_EDGE 1 /* left edge of configuration box */
|
---|
| 17 | #define TOP_EDGE 238 /* top edge of configuration box */
|
---|
| 18 | #define RGT_EDGE 131 /* right edge of configuration box */
|
---|
| 19 | #define BOT_EDGE 348 /* bottom edge of configuration box */
|
---|
| 20 |
|
---|
| 21 | /* external functions */
|
---|
| 22 |
|
---|
[7258c6a] | 23 | extern uint16_t exp_c(uint16_t c);
|
---|
[f40a309] | 24 |
|
---|
[0580615] | 25 | extern void enterit(void);
|
---|
[7258c6a] | 26 | extern void idpoint(int16_t x, int16_t y, int16_t pen);
|
---|
[60288f5] | 27 | extern void nokey(void);
|
---|
[f40a309] | 28 |
|
---|
[7258c6a] | 29 | extern int16_t et_mcfn(int16_t n);
|
---|
| 30 | extern int16_t ef_mcfn(int16_t n);
|
---|
| 31 | extern int16_t rd_mcfn(int16_t n);
|
---|
| 32 | extern int16_t nd_mcfn(int16_t n, int16_t k);
|
---|
| 33 | extern int16_t et_mwsn(int16_t nn);
|
---|
| 34 | extern int16_t ef_mwsn(int16_t nn);
|
---|
| 35 | extern int16_t rd_mwsn(int16_t nn);
|
---|
| 36 | extern int16_t nd_mwsn(int16_t nn, int16_t k);
|
---|
[f40a309] | 37 |
|
---|
| 38 | /* forward references */
|
---|
| 39 |
|
---|
[7258c6a] | 40 | int16_t imfnbox(int16_t n);
|
---|
[f40a309] | 41 |
|
---|
[e225e77] | 42 | extern void modinst(void);
|
---|
| 43 | extern void reshowi(void);
|
---|
| 44 | extern void settc(int16_t rv, int16_t cv);
|
---|
| 45 |
|
---|
[f40a309] | 46 | /* |
---|
| 47 |
|
---|
| 48 | */
|
---|
| 49 |
|
---|
| 50 | /* variables defined elsewhere */
|
---|
[7258c6a] | 51 |
|
---|
[0c834c5] | 52 | extern void (*point)(int16_t x, int16_t y, int16_t pen);
|
---|
| 53 | /* point plotting function pointer */
|
---|
[f40a309] | 54 | extern void (*x_key)(void); /* "X" key handler pointer */
|
---|
[7258c6a] | 55 |
|
---|
| 56 | extern int16_t LftEdge; /* left edge of current box */
|
---|
| 57 | extern int16_t TopEdge; /* top edge of current box */
|
---|
| 58 | extern int16_t RgtEdge; /* right edge of current box */
|
---|
| 59 | extern int16_t BotEdge; /* bottom edge of current box */
|
---|
| 60 |
|
---|
| 61 | extern int16_t curslim; /* cursor changeover point */
|
---|
| 62 | extern int16_t curvce; /* currently edited voice */
|
---|
| 63 | extern int16_t hitbox; /* selected box number */
|
---|
| 64 | extern int16_t hitcx; /* selection cursor x value */
|
---|
| 65 | extern int16_t hitcy; /* selection cursor y value */
|
---|
| 66 | extern int16_t stccol; /* text cursor column */
|
---|
| 67 | extern int16_t stcrow; /* text cursor row */
|
---|
| 68 | extern int16_t wcflag; /* ws/cf menu select flag (cf=0, ws=1) */
|
---|
| 69 | extern int16_t wcmcol; /* ws/cf menu label column */
|
---|
| 70 | extern int16_t wcmrow; /* ws/cf menu label row */
|
---|
| 71 | extern int16_t wcpage; /* ws/cf menu page */
|
---|
| 72 | extern int16_t wmcsel; /* ws slot select */
|
---|
| 73 | extern int16_t wmctag; /* ws/cf display update flag */
|
---|
| 74 |
|
---|
[f40a309] | 75 | extern uint16_t *instob; /* instrument display object pointer */
|
---|
| 76 |
|
---|
| 77 | extern struct octent *idoct; /* object control table pointer */
|
---|
| 78 |
|
---|
| 79 | extern struct selbox *csbp; /* current box select table pointer */
|
---|
| 80 |
|
---|
| 81 | extern struct instdef vbufs[]; /* voice buffers */
|
---|
| 82 |
|
---|
| 83 | extern struct wstbl wslib[]; /* waveshape library */
|
---|
| 84 |
|
---|
| 85 | /* |
---|
| 86 |
|
---|
| 87 | */
|
---|
| 88 |
|
---|
| 89 | struct fet id_fet2[] = { /* waveshape number fet */
|
---|
| 90 |
|
---|
| 91 | {24, 12, 13, 0x0000, et_mwsn, ef_mwsn, rd_mwsn, nd_mwsn},
|
---|
| 92 | {24, 16, 17, 0x0100, et_mwsn, ef_mwsn, rd_mwsn, nd_mwsn},
|
---|
| 93 | { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
|
---|
| 94 | };
|
---|
| 95 |
|
---|
| 96 | struct fet id_fet3[] = { /* configuration number fet */
|
---|
| 97 |
|
---|
| 98 | {24, 16, 17, 0, et_mcfn, ef_mcfn, rd_mcfn, nd_mcfn},
|
---|
| 99 | { 0, 0, 0, 0x0000, FN_NULL, FN_NULL, FN_NULL, FN_NULL}
|
---|
| 100 | };
|
---|
| 101 |
|
---|
| 102 | struct selbox idmbox[] = {
|
---|
| 103 |
|
---|
| 104 | { 1, 1, 127, 111, 0, imfnbox}, /* slot 00 */
|
---|
| 105 | {129, 1, 255, 111, 1, imfnbox}, /* slot 01 */
|
---|
| 106 | {257, 1, 383, 111, 2, imfnbox}, /* slot 02 */
|
---|
| 107 | {385, 1, 510, 111, 3, imfnbox}, /* slot 03 */
|
---|
| 108 |
|
---|
| 109 | { 1, 113, 127, 223, 4, imfnbox}, /* slot 04 */
|
---|
| 110 | {129, 113, 255, 223, 5, imfnbox}, /* slot 05 */
|
---|
| 111 | {257, 113, 383, 223, 6, imfnbox}, /* slot 06 */
|
---|
| 112 | {385, 113, 510, 223, 7, imfnbox}, /* slot 07 */
|
---|
| 113 |
|
---|
| 114 | { 1, 225, 127, 334, 8, imfnbox}, /* slot 08 */
|
---|
| 115 | {129, 225, 255, 334, 9, imfnbox}, /* slot 09 */
|
---|
| 116 | {257, 225, 383, 334, 10, imfnbox}, /* slot 10 */
|
---|
| 117 | {385, 225, 510, 334, 11, imfnbox}, /* slot 11 */
|
---|
| 118 |
|
---|
| 119 | { 1, 336, 510, 349, 12, imfnbox}, /* number */
|
---|
| 120 | };
|
---|
| 121 |
|
---|
| 122 | /* |
---|
[7258c6a] | 123 |
|
---|
[f40a309] | 124 | */
|
---|
| 125 |
|
---|
| 126 | int16_t patctab[MAXPAT] = { /* pattern colors */
|
---|
| 127 |
|
---|
| 128 | 0, /* 1 */
|
---|
| 129 | 0, /* 2 */
|
---|
| 130 | 0, /* 3 */
|
---|
| 131 | 0, /* 4 */
|
---|
| 132 | 0, /* 5 */
|
---|
| 133 | 0, /* 6 */
|
---|
| 134 | 12, /* 7 */
|
---|
| 135 | 12, /* 8 */
|
---|
| 136 | 12, /* 9 */
|
---|
| 137 | 12, /* 10 */
|
---|
| 138 | 0, /* 11 */
|
---|
| 139 | 0, /* 12 */
|
---|
| 140 | 0, /* 13 */
|
---|
| 141 | 0, /* 14 */
|
---|
| 142 | 13, /* 15 */
|
---|
| 143 | 8, /* 16 */
|
---|
| 144 | 0, /* 17 */
|
---|
| 145 | 0, /* 18 */
|
---|
| 146 | 2, /* 19 */
|
---|
| 147 | 2, /* 20 */
|
---|
| 148 | 2, /* 21 */
|
---|
| 149 | 2, /* 22 */
|
---|
| 150 | 2, /* 23 */
|
---|
| 151 | 2, /* 24 */
|
---|
| 152 | 2, /* 25 */
|
---|
| 153 | 2, /* 26 */
|
---|
| 154 | 0, /* 27 */
|
---|
| 155 | 0, /* 28 */
|
---|
| 156 | 0, /* 29 */
|
---|
| 157 | 0, /* 30 */
|
---|
| 158 | 0, /* 31 */
|
---|
| 159 | 0, /* 32 */
|
---|
| 160 | 0, /* 33 */
|
---|
| 161 | 0, /* 34 */
|
---|
| 162 | 4 /* 35 */
|
---|
| 163 | };
|
---|
| 164 |
|
---|
[c3aee8a] | 165 | /* |
---|
[f40a309] | 166 |
|
---|
| 167 | */
|
---|
| 168 |
|
---|
| 169 | uint16_t pat[MAXPAT][16] = { /* configuration pattern elements */
|
---|
| 170 |
|
---|
| 171 | {0x0000, 0x0000, 0x0000, 0x0000, /* 1 */
|
---|
| 172 | 0x0080, 0x0180, 0x0080, 0x0080,
|
---|
| 173 | 0x0080, 0x0080, 0x0080, 0x01C0,
|
---|
| 174 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 175 |
|
---|
| 176 | {0x0000, 0x0000, 0x0000, 0x0000, /* 2 */
|
---|
| 177 | 0x03C0, 0x0420, 0x0020, 0x0020,
|
---|
| 178 | 0x03C0, 0x0400, 0x0400, 0x07E0,
|
---|
| 179 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 180 |
|
---|
| 181 | {0x0000, 0x0000, 0x0000, 0x0000, /* 3 */
|
---|
| 182 | 0x03C0, 0x0420, 0x0020, 0x01C0,
|
---|
| 183 | 0x0020, 0x0020, 0x0420, 0x03C0,
|
---|
| 184 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 185 |
|
---|
| 186 | {0x0000, 0x0000, 0x0000, 0x0000, /* 4 */
|
---|
| 187 | 0x0040, 0x00C0, 0x0140, 0x0240,
|
---|
| 188 | 0x0440, 0x07E0, 0x0040, 0x0040,
|
---|
| 189 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 190 |
|
---|
| 191 | {0x0000, 0x0000, 0x0000, 0x0000, /* 5 */
|
---|
| 192 | 0x03C0, 0x0200, 0x0200, 0x03C0,
|
---|
| 193 | 0x0020, 0x0020, 0x0420, 0x03C0,
|
---|
| 194 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 195 |
|
---|
| 196 | {0x0000, 0x0000, 0x0000, 0x0000, /* 6 */
|
---|
| 197 | 0x03C0, 0x0400, 0x0400, 0x07C0,
|
---|
| 198 | 0x0420, 0x0420, 0x0420, 0x03C0,
|
---|
| 199 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 200 |
|
---|
| 201 | {0x0000, 0x03C0, 0x07E0, 0x0FF0, /* 7 */
|
---|
| 202 | 0x1FF8, 0x1FF8, 0x3FFC, 0x3FFC,
|
---|
| 203 | 0x7FFE, 0x7FFE, 0x7FFE, 0xFFFF,
|
---|
| 204 | 0xFFFF, 0xFFFF, 0x0000, 0x0000},
|
---|
| 205 |
|
---|
| 206 | {0x0000, 0x0000, 0xFFFF, 0xFFFF, /* 8 */
|
---|
| 207 | 0xFFFF, 0x7FFE, 0x7FFE, 0x7FFE,
|
---|
| 208 | 0x3FFC, 0x3FFC, 0x1FF8, 0x1FF8,
|
---|
| 209 | 0x0FF0, 0x07E0, 0x03C0, 0x0000},
|
---|
| 210 |
|
---|
| 211 | {0x3800, 0x3F00, 0x3FC0, 0x3FF0, /* 9 */
|
---|
| 212 | 0x3FF8, 0x3FFC, 0x3FFE, 0x3FFE,
|
---|
| 213 | 0x3FFE, 0x3FFE, 0x3FFC, 0x3FF8,
|
---|
| 214 | 0x3FF0, 0x3FC0, 0x3F00, 0x3800},
|
---|
| 215 |
|
---|
| 216 | {0x001C, 0x00FC, 0x03FC, 0x0FFC, /* 10 */
|
---|
| 217 | 0x1FFC, 0x3FFC, 0x7FFC, 0x7FFC,
|
---|
| 218 | 0x7FFC, 0x7FFC, 0x3FFC, 0x1FFC,
|
---|
| 219 | 0x0FFC, 0x03FC, 0x00FC, 0x001C},
|
---|
| 220 | /* |
---|
| 221 |
|
---|
| 222 | */
|
---|
| 223 | {0x0000, 0x0000, 0x0000, 0x0000, /* 11 */
|
---|
| 224 | 0x0080, 0x0180, 0x0080, 0x0000,
|
---|
| 225 | 0x0000, 0x0000, 0x0000, 0x01C0,
|
---|
| 226 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 227 |
|
---|
| 228 | {0x0000, 0x0000, 0x0000, 0x0000, /* 12 */
|
---|
| 229 | 0x03C0, 0x0420, 0x0020, 0x0000,
|
---|
| 230 | 0x03C0, 0x0400, 0x0000, 0x07E0,
|
---|
| 231 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 232 |
|
---|
| 233 | {0x0000, 0x0000, 0x0000, 0x0000, /* 13 */
|
---|
| 234 | 0x03C0, 0x0420, 0x0020, 0x01C0,
|
---|
| 235 | 0x0020, 0x0000, 0x0420, 0x03C0,
|
---|
| 236 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 237 |
|
---|
| 238 | {0x0000, 0x0000, 0x0000, 0x0000, /* 14 */
|
---|
| 239 | 0x0000, 0x0000, 0x0000, 0x0000,
|
---|
| 240 | 0x0000, 0x0000, 0x0000, 0x0000,
|
---|
| 241 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 242 |
|
---|
| 243 | {0x0000, 0x07E0, 0x1FF8, 0x3FFC, /* 15 */
|
---|
| 244 | 0x7FFE, 0x7FFE, 0xFFFF, 0xFFFF,
|
---|
| 245 | 0xFFFF, 0xFFFF, 0x7FFE, 0x7FFE,
|
---|
| 246 | 0x3FFC, 0x1FF8, 0x07E0, 0x0000},
|
---|
| 247 |
|
---|
| 248 | {0x0000, 0x7FFE, 0x7FFE, 0x7FFE, /* 16 */
|
---|
| 249 | 0x7FFE, 0x7FFE, 0x7FFE, 0x7FFE,
|
---|
| 250 | 0x7FFE, 0x7FFE, 0x7FFE, 0x7FFE,
|
---|
| 251 | 0x7FFE, 0x7FFE, 0x7FFE, 0x0000},
|
---|
| 252 |
|
---|
| 253 | {0x0000, 0x0000, 0x0000, 0x0000, /* 17 */
|
---|
| 254 | 0x03C0, 0x0420, 0x0420, 0x0420,
|
---|
| 255 | 0x07E0, 0x0420, 0x0420, 0x0420,
|
---|
| 256 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 257 |
|
---|
| 258 | {0x0000, 0x0000, 0x0000, 0x0000, /* 18 */
|
---|
| 259 | 0x07C0, 0x0220, 0x0220, 0x03C0,
|
---|
| 260 | 0x0220, 0x0220, 0x0220, 0x07C0,
|
---|
| 261 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 262 |
|
---|
| 263 | {0x0000, 0x0000, 0x0000, 0x0000, /* 19 */
|
---|
| 264 | 0x0000, 0x0000, 0x0000, 0x007F,
|
---|
| 265 | 0x00FF, 0x01C0, 0x0180, 0x0180,
|
---|
| 266 | 0x0180, 0x0180, 0x0180, 0x0180},
|
---|
| 267 |
|
---|
| 268 | {0x0180, 0x0180, 0x0180, 0x0180, /* 20 */
|
---|
| 269 | 0x0180, 0x0180, 0x0380, 0xFF00,
|
---|
| 270 | 0xFE00, 0x0000, 0x0000, 0x0000,
|
---|
| 271 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 272 | /* |
---|
| 273 |
|
---|
| 274 | */
|
---|
| 275 | {0x0000, 0x0000, 0x0000, 0x0000, /* 21 */
|
---|
| 276 | 0x0000, 0x0000, 0x0000, 0xFE00,
|
---|
| 277 | 0xFF00, 0x0380, 0x0180, 0x0180,
|
---|
| 278 | 0x0180, 0x0180, 0x0180, 0x0180},
|
---|
| 279 |
|
---|
| 280 | {0x0180, 0x0180, 0x0180, 0x0180, /* 22 */
|
---|
| 281 | 0x0180, 0x0180, 0x01C0, 0x00FF,
|
---|
| 282 | 0x007F, 0x0000, 0x0000, 0x0000,
|
---|
| 283 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 284 |
|
---|
| 285 | {0x0000, 0x0000, 0x0000, 0x0000, /* 23 */
|
---|
| 286 | 0x0000, 0x0000, 0x0000, 0xFFFF,
|
---|
| 287 | 0xFFFF, 0x0000, 0x0000, 0x0000,
|
---|
| 288 | 0x0000, 0x0000, 0x0000, 0x0000},
|
---|
| 289 |
|
---|
| 290 | {0x0180, 0x0180, 0x0180, 0x0180, /* 24 */
|
---|
| 291 | 0x0180, 0x0180, 0x0180, 0x0180,
|
---|
| 292 | 0x0180, 0x0180, 0x0180, 0x0180,
|
---|
| 293 | 0x0180, 0x0180, 0x0180, 0x0180},
|
---|
| 294 |
|
---|
| 295 | {0x0003, 0x0007, 0x000E, 0x001C, /* 25 */
|
---|
| 296 | 0x0038, 0x0070, 0x00E0, 0x01C0,
|
---|
[df097bf] | 297 | 0x0380, 0x0700, 0x0E00, 0x1C00,
|
---|
[f40a309] | 298 | 0x3800, 0x7000, 0xE000, 0xC000},
|
---|
| 299 |
|
---|
| 300 | {0xC000, 0xE000, 0x7000, 0x3800, /* 26 */
|
---|
| 301 | 0x1C00, 0x0E00, 0x0700, 0x0380,
|
---|
| 302 | 0x01C0, 0x00E0, 0x0070, 0x0038,
|
---|
| 303 | 0x001C, 0x000E, 0x0007, 0x0003},
|
---|
| 304 |
|
---|
| 305 | {0x0000, 0x0000, 0x0000, 0x03C0, /* 27 */
|
---|
| 306 | 0x07E0, 0x0E70, 0x0C30, 0x0C30,
|
---|
| 307 | 0x0FF0, 0x0FF0, 0x0C30, 0x0C30,
|
---|
| 308 | 0x0C30, 0x0000, 0x0000, 0x0000},
|
---|
| 309 |
|
---|
| 310 | {0x0000, 0x0000, 0x0000, 0x0FE0, /* 28 */
|
---|
| 311 | 0x0FF0, 0x0630, 0x0630, 0x07E0,
|
---|
| 312 | 0x07E0, 0x0630, 0x0630, 0x0FF0,
|
---|
| 313 | 0x0FE0, 0x0000, 0x0000, 0x0000},
|
---|
| 314 |
|
---|
| 315 | {0x0000, 0x0000, 0x0000, 0x0080, /* 29 */
|
---|
| 316 | 0x0180, 0x0380, 0x0180, 0x0180,
|
---|
| 317 | 0x0180, 0x0180, 0x0180, 0x03C0,
|
---|
| 318 | 0x03C0, 0x0000, 0x0000, 0x0000},
|
---|
| 319 |
|
---|
| 320 | {0x0000, 0x0000, 0x0000, 0x03C0, /* 30 */
|
---|
| 321 | 0x07E0, 0x0660, 0x0060, 0x03E0,
|
---|
| 322 | 0x07C0, 0x0600, 0x0600, 0x07E0,
|
---|
| 323 | 0x07E0, 0x0000, 0x0000, 0x0000},
|
---|
| 324 | /* |
---|
| 325 |
|
---|
| 326 | */
|
---|
| 327 | {0x0000, 0x0000, 0x0000, 0x03C0, /* 31 */
|
---|
| 328 | 0x07E0, 0x0660, 0x0060, 0x01C0,
|
---|
| 329 | 0x01C0, 0x0060, 0x0660, 0x07E0,
|
---|
| 330 | 0x03C0, 0x0000, 0x0000, 0x0000},
|
---|
| 331 |
|
---|
| 332 | {0x0000, 0x0000, 0x0000, 0x0000, /* 32 */
|
---|
| 333 | 0x0060, 0x0660, 0x0660, 0x0660,
|
---|
| 334 | 0x07F0, 0x07F0, 0x0060, 0x0060,
|
---|
| 335 | 0x0060, 0x0000, 0x0000, 0x0000},
|
---|
| 336 |
|
---|
| 337 | {0x0000, 0x0000, 0x0000, 0x07C0, /* 33 */
|
---|
| 338 | 0x07C0, 0x0600, 0x0600, 0x07C0,
|
---|
| 339 | 0x07E0, 0x0060, 0x0060, 0x07E0,
|
---|
| 340 | 0x03C0, 0x0000, 0x0000, 0x0000},
|
---|
| 341 |
|
---|
| 342 | {0x0000, 0x0000, 0x0000, 0x03C0, /* 34 */
|
---|
| 343 | 0x07C0, 0x0600, 0x0600, 0x07C0,
|
---|
| 344 | 0x07E0, 0x0660, 0x0660, 0x07E0,
|
---|
| 345 | 0x03C0, 0x0000, 0x0000, 0x0000},
|
---|
| 346 |
|
---|
| 347 | {0x0000, 0x7FFE, 0x7FFE, 0x7FFE, /* 35 */
|
---|
| 348 | 0x7FFE, 0x7FFE, 0x7FFE, 0x7FFE,
|
---|
| 349 | 0x7FFE, 0x7FFE, 0x7FFE, 0x7FFE,
|
---|
| 350 | 0x7FFE, 0x7FFE, 0x7FFE, 0x0000}
|
---|
| 351 | };
|
---|
| 352 |
|
---|
| 353 | /* |
---|
| 354 |
|
---|
[7258c6a] | 355 | */
|
---|
[f40a309] | 356 |
|
---|
[7258c6a] | 357 | /*
|
---|
| 358 | =============================================================================
|
---|
[f40a309] | 359 | putpat() -- display a pattern in a configuration diagram
|
---|
| 360 | =============================================================================
|
---|
| 361 | */
|
---|
| 362 |
|
---|
| 363 | void putpat(int16_t pn, int16_t px, int16_t py, int16_t patc)
|
---|
| 364 | {
|
---|
| 365 | register int16_t xp, yp, pr, pc;
|
---|
| 366 | register uint16_t pw;
|
---|
| 367 |
|
---|
| 368 | if (v_regs[5] & 0x0180)
|
---|
| 369 | vbank(0);
|
---|
| 370 |
|
---|
| 371 | for (pr = 0; pr < 16; pr++) {
|
---|
| 372 |
|
---|
| 373 | pw = pat[pn - 1][pr];
|
---|
| 374 | yp = py - 8 + pr + TopEdge;
|
---|
| 375 |
|
---|
| 376 | if ((yp GE TopEdge) AND
|
---|
| 377 | (yp LE BotEdge)) {
|
---|
| 378 |
|
---|
| 379 | for (pc = 0; pc < 16; pc++) {
|
---|
| 380 |
|
---|
| 381 | xp = px - 8 + pc + LftEdge;
|
---|
| 382 |
|
---|
| 383 | if ((xp GE LftEdge) AND
|
---|
| 384 | (xp LE RgtEdge) AND
|
---|
| 385 | (pw & (1 << (15 - pc)))) {
|
---|
| 386 |
|
---|
| 387 | vputp(idoct, xp, yp, patc);
|
---|
| 388 | }
|
---|
| 389 | }
|
---|
| 390 | }
|
---|
| 391 | }
|
---|
| 392 | }
|
---|
| 393 |
|
---|
| 394 | /* |
---|
[7258c6a] | 395 |
|
---|
[f40a309] | 396 | */
|
---|
[7258c6a] | 397 |
|
---|
| 398 | /*
|
---|
| 399 | =============================================================================
|
---|
[f40a309] | 400 | dispcfg() -- display a configuration on the screen
|
---|
| 401 | =============================================================================
|
---|
| 402 | */
|
---|
| 403 |
|
---|
| 404 | void dispcfg(int16_t nn)
|
---|
| 405 | {
|
---|
| 406 | register int16_t i, np;
|
---|
| 407 | int16_t idbuf[8];
|
---|
| 408 | register int8_t *cfgdat, *cfp;
|
---|
| 409 |
|
---|
| 410 | if (v_regs[5] & 0x0180)
|
---|
| 411 | vbank(0);
|
---|
| 412 |
|
---|
| 413 | tsplot4(instob, 64, CFBX18, wcmrow, 4 + wcmcol, "Config #", 14);
|
---|
| 414 |
|
---|
| 415 | sprintf(idbuf, "%02d", nn);
|
---|
| 416 | tsplot4(instob, 64, CFBX18, wcmrow, 12 + wcmcol, idbuf, 14);
|
---|
| 417 |
|
---|
| 418 | cfgdat = cfgptr[nn];
|
---|
| 419 |
|
---|
| 420 | for (i = 0; i < 64; i++) {
|
---|
| 421 |
|
---|
| 422 | cfp = cfgdat + (i << 1) + i;
|
---|
| 423 | np = *cfp;
|
---|
| 424 |
|
---|
| 425 | if (np)
|
---|
| 426 | putpat(np, *(cfp + 1), *(cfp + 2), patctab[np - 1]);
|
---|
| 427 | }
|
---|
| 428 | }
|
---|
| 429 |
|
---|
[7258c6a] | 430 | /* |
---|
[f40a309] | 431 |
|
---|
| 432 | */
|
---|
| 433 |
|
---|
| 434 | /*
|
---|
| 435 | =============================================================================
|
---|
| 436 | showcfg() -- display a configuration in the configuration window
|
---|
| 437 | =============================================================================
|
---|
| 438 | */
|
---|
| 439 |
|
---|
| 440 | void showcfg(int16_t nn)
|
---|
| 441 | {
|
---|
| 442 | LftEdge = LFT_EDGE;
|
---|
| 443 | TopEdge = TOP_EDGE;
|
---|
| 444 | RgtEdge = RGT_EDGE;
|
---|
| 445 | BotEdge = BOT_EDGE;
|
---|
| 446 | wcmrow = 17;
|
---|
| 447 | wcmcol = 0;
|
---|
| 448 |
|
---|
| 449 | if (v_regs[5] & 0x0180)
|
---|
| 450 | vbank(0);
|
---|
| 451 |
|
---|
| 452 | vbfill4(instob, 128, LftEdge, TopEdge, RgtEdge, BotEdge,
|
---|
| 453 | exp_c(CBBX18));
|
---|
| 454 |
|
---|
| 455 | dispcfg(nn);
|
---|
| 456 | }
|
---|
[7258c6a] | 457 |
|
---|
[f40a309] | 458 | /* |
---|
[7258c6a] | 459 |
|
---|
| 460 | */
|
---|
| 461 |
|
---|
[f40a309] | 462 | /*
|
---|
| 463 | =============================================================================
|
---|
| 464 | dispws() -- display a waveshape
|
---|
| 465 | =============================================================================
|
---|
| 466 | */
|
---|
| 467 |
|
---|
| 468 | void dispws(int16_t ws)
|
---|
| 469 | {
|
---|
| 470 | register uint16_t *wsp;
|
---|
| 471 | register int16_t i, x, y;
|
---|
| 472 | int8_t buf[64];
|
---|
| 473 |
|
---|
| 474 | if (ws GE NUMWAVS) /* number must be valid */
|
---|
| 475 | return;
|
---|
| 476 |
|
---|
| 477 | wsp = wslib[ws].final; /* point at the data */
|
---|
| 478 |
|
---|
| 479 | /* label the waveshape */
|
---|
| 480 |
|
---|
| 481 | sprintf(buf, "Waveshape #%02d", ws + 1);
|
---|
| 482 | tsplot4(instob, 64, CFBX21, wcmrow, wcmcol + 2, buf, 14);
|
---|
| 483 |
|
---|
| 484 | for (i = 1; i < 254; i++) { /* draw the points */
|
---|
| 485 |
|
---|
| 486 | x = LftEdge + (i >> 1);
|
---|
| 487 | y = BotEdge - ((wsp[i] ^ 0x8000) / 676);
|
---|
| 488 |
|
---|
| 489 | idpoint(x, y, WSBFC);
|
---|
| 490 | }
|
---|
[7258c6a] | 491 | }
|
---|
[f40a309] | 492 |
|
---|
[7258c6a] | 493 | /* |
---|
| 494 |
|
---|
[f40a309] | 495 | */
|
---|
| 496 |
|
---|
| 497 | /*
|
---|
| 498 | =============================================================================
|
---|
| 499 | wcmenu() -- setup the display for a waveshape or configuration menu
|
---|
| 500 | =============================================================================
|
---|
| 501 | */
|
---|
| 502 |
|
---|
| 503 | void wcmenu(int16_t wc)
|
---|
| 504 | {
|
---|
| 505 | register int16_t i;
|
---|
| 506 | int8_t buf[32];
|
---|
| 507 |
|
---|
| 508 | wcflag = wc; /* set menu page type */
|
---|
| 509 |
|
---|
| 510 | if (v_regs[5] & 0x0180)
|
---|
| 511 | vbank(0);
|
---|
| 512 |
|
---|
| 513 | vbfill4(instob, 128, 0, 0, 511, 349, exp_c(CBBX18));
|
---|
| 514 |
|
---|
| 515 | point = idpoint;
|
---|
| 516 |
|
---|
| 517 | lseg( 0, 0, 511, 0, CBORD); /* outside border */
|
---|
| 518 | lseg(511, 0, 511, 349, CBORD);
|
---|
| 519 | lseg(511, 349, 0, 349, CBORD);
|
---|
| 520 | lseg( 0, 349, 0, 0, CBORD);
|
---|
| 521 |
|
---|
| 522 | lseg( 0, 112, 511, 112, CBORD); /* horizontal lines */
|
---|
| 523 | lseg( 0, 224, 511, 224, CBORD);
|
---|
| 524 | lseg( 0, 335, 511, 335, CBORD);
|
---|
| 525 |
|
---|
| 526 | lseg(128, 0, 128, 335, CBORD); /* vertical lines */
|
---|
| 527 | lseg(256, 0, 256, 335, CBORD);
|
---|
| 528 | lseg(384, 0, 384, 335, CBORD);
|
---|
| 529 |
|
---|
| 530 | ebflag = FALSE; /* clear edit buffer */
|
---|
| 531 | memset(ebuf, '\0', sizeof ebuf);
|
---|
| 532 |
|
---|
| 533 | curslim = RTOY(24)-1; /* text cursor in bottom row */
|
---|
| 534 |
|
---|
| 535 | x_key = nokey;
|
---|
| 536 | csbp = idmbox;
|
---|
| 537 |
|
---|
| 538 | /* |
---|
| 539 |
|
---|
| 540 | */
|
---|
| 541 | if (wc) { /* waveshape */
|
---|
| 542 |
|
---|
| 543 | for (i = 0; i < 12; i++) { /* fill in waveshapes */
|
---|
| 544 |
|
---|
| 545 | LftEdge = ((i % 4) * 128) + 1;
|
---|
| 546 | BotEdge = ((i / 4) * 112) + 111;
|
---|
| 547 | wcmrow = (i / 4) << 3;
|
---|
| 548 | wcmcol = (i % 4) << 4;
|
---|
| 549 |
|
---|
| 550 | dispws(i + (wcpage * 12));
|
---|
| 551 | }
|
---|
| 552 |
|
---|
| 553 | /* label data entry area and show page number */
|
---|
| 554 |
|
---|
| 555 | sprintf(buf, "Waveshape A%02d B%02d Page",
|
---|
| 556 | 1 + vbufs[curvce].idhwsb,
|
---|
| 557 | 1 + vbufs[curvce].idhwsa);
|
---|
| 558 |
|
---|
| 559 | tsplot4(instob, 64, CFBX18, 24, 1, buf, 14);
|
---|
| 560 |
|
---|
| 561 | tsplot4(instob, 64, wcpage ? CFBX18 : ID_ENTRY,
|
---|
| 562 | 24, 26, "1", 14);
|
---|
| 563 |
|
---|
| 564 | tsplot4(instob, 64, wcpage ? ID_ENTRY : CFBX18,
|
---|
| 565 | 24, 28, "2", 14);
|
---|
| 566 |
|
---|
| 567 | curfet = id_fet2;
|
---|
| 568 | settc(24, 12);
|
---|
| 569 | /* |
---|
| 570 |
|
---|
| 571 | */
|
---|
| 572 | } else { /* configuration */
|
---|
| 573 |
|
---|
| 574 | for (i = 0; i < 12; i++) { /* fill in configurations */
|
---|
| 575 |
|
---|
| 576 | LftEdge = ((i % 4) * 128) + 1;
|
---|
| 577 | TopEdge = ((i / 4) * 112) + 1;
|
---|
| 578 | RgtEdge = LftEdge + 128;
|
---|
| 579 | BotEdge = TopEdge + 112;
|
---|
| 580 | wcmrow = (i / 4) << 3;
|
---|
| 581 | wcmcol = (i % 4) << 4;
|
---|
| 582 |
|
---|
| 583 | dispcfg(i);
|
---|
| 584 | }
|
---|
| 585 |
|
---|
| 586 | /* label data entry area */
|
---|
| 587 |
|
---|
| 588 | tsplot4(instob, 64, CFBX18, 24, 1, "Configuration #", 14);
|
---|
| 589 |
|
---|
| 590 | sprintf(buf, "%02d", vbufs[curvce].idhcfg);
|
---|
| 591 | tsplot4(instob, 64, CFBX18, 24, 16, buf, 14);
|
---|
| 592 |
|
---|
[7258c6a] | 593 | curfet = id_fet3;
|
---|
[f40a309] | 594 | settc(24, 16);
|
---|
[7258c6a] | 595 | }
|
---|
[f40a309] | 596 | }
|
---|
| 597 |
|
---|
| 598 | /* |
---|
| 599 |
|
---|
| 600 | */
|
---|
| 601 |
|
---|
| 602 | /*
|
---|
| 603 | =============================================================================
|
---|
| 604 | imfnbox() -- instrument menu box hit processor
|
---|
| 605 | =============================================================================
|
---|
| 606 | */
|
---|
| 607 |
|
---|
| 608 | int16_t imfnbox(int16_t n)
|
---|
| 609 | {
|
---|
| 610 | register int16_t row, col;
|
---|
| 611 |
|
---|
| 612 | row = hitcy / 14;
|
---|
| 613 | col = hitcx >> 3;
|
---|
| 614 |
|
---|
| 615 | if (hitbox EQ 12) {
|
---|
| 616 |
|
---|
| 617 | if (wcflag) { /* waveshape */
|
---|
| 618 |
|
---|
[60288f5] | 619 | if (col < 10) { /* take down menu */
|
---|
[f40a309] | 620 |
|
---|
| 621 | reshowi();
|
---|
| 622 | settc(17, wmcsel ? 61 : 57);
|
---|
| 623 |
|
---|
| 624 | } else if ((col GE 19) AND (col LE 22)) {
|
---|
| 625 |
|
---|
| 626 | /* toggle waveshape display page */
|
---|
| 627 |
|
---|
| 628 | if (wcpage)
|
---|
[60288f5] | 629 | wcpage = 0; /* to page 1 */
|
---|
[f40a309] | 630 | else
|
---|
| 631 | wcpage = 1; /* to page 2 */
|
---|
| 632 |
|
---|
| 633 | wcmenu(1);
|
---|
| 634 | return(SUCCESS);
|
---|
| 635 |
|
---|
| 636 | } else { /* data entry */
|
---|
| 637 |
|
---|
| 638 | wmctag = FALSE;
|
---|
[9519422] | 639 | enterit();
|
---|
[f40a309] | 640 |
|
---|
| 641 | if (wmctag)
|
---|
| 642 | modinst();
|
---|
| 643 |
|
---|
| 644 | return(SUCCESS);
|
---|
| 645 | }
|
---|
| 646 | /* |
---|
| 647 |
|
---|
[60288f5] | 648 | */
|
---|
[f40a309] | 649 | } else { /* configuration */
|
---|
| 650 |
|
---|
| 651 | if (col < 14) { /* take down menu */
|
---|
[60288f5] | 652 |
|
---|
| 653 | reshowi();
|
---|
[f40a309] | 654 | settc(17, 12);
|
---|
[6262b5c] | 655 |
|
---|
| 656 | } else { /* data entry */
|
---|
| 657 |
|
---|
| 658 | wmctag = FALSE;
|
---|
| 659 | enterit();
|
---|
| 660 |
|
---|
| 661 | if (wmctag)
|
---|
| 662 | modinst();
|
---|
| 663 |
|
---|
| 664 | return(SUCCESS);
|
---|
| 665 | }
|
---|
| 666 | }
|
---|
| 667 | }
|
---|
| 668 |
|
---|
| 669 | return(FAILURE);
|
---|
| 670 | }
|
---|
| 671 |
|
---|