[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etwpnt.c -- waveshape editor - point number field handlers
|
---|
| 4 | Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_wpnt() -- load the edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_wpnt(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
| 18 | sprintf(ebuf, "%03d", curwpnt);
|
---|
| 19 | ebflag = TRUE;
|
---|
| 20 |
|
---|
| 21 | return(SUCCESS);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | =============================================================================
|
---|
| 26 | ef_wpnt() -- parse (unload) the edit buffer
|
---|
| 27 | =============================================================================
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[7258c6a] | 30 | int16_t ef_wpnt(int16_t n)
|
---|
[f40a309] | 31 | {
|
---|
[7258c6a] | 32 | register int16_t i, tmpval;
|
---|
[f40a309] | 33 |
|
---|
| 34 | ebuf[3] = '\0'; /* terminate the string in ebuf */
|
---|
| 35 | ebflag = FALSE;
|
---|
| 36 |
|
---|
| 37 | tmpval = 0;
|
---|
| 38 |
|
---|
| 39 | for (i = 0; i < 3; i++) /* convert from ASCII to binary */
|
---|
| 40 | tmpval = (tmpval * 10) + (ebuf[i] - '0');
|
---|
| 41 |
|
---|
| 42 | if (tmpval GE NUMWPNT)
|
---|
| 43 | return(FAILURE);
|
---|
| 44 |
|
---|
| 45 | curwpnt = tmpval;
|
---|
| 46 | newws();
|
---|
| 47 | wdswin(4);
|
---|
| 48 | return(SUCCESS);
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | /*
|
---|
| 52 | =============================================================================
|
---|
| 53 | rd_wpnt() -- (re)display the field
|
---|
| 54 | =============================================================================
|
---|
| 55 | */
|
---|
| 56 |
|
---|
[7258c6a] | 57 | int16_t rd_wpnt(int16_t nn)
|
---|
[f40a309] | 58 | {
|
---|
[7258c6a] | 59 | register int16_t n;
|
---|
[f40a309] | 60 |
|
---|
| 61 | n = nn & 0xFF;
|
---|
| 62 | sprintf(dspbuf, "%03d", curwpnt);
|
---|
| 63 |
|
---|
| 64 | vbank(0);
|
---|
| 65 | vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
|
---|
| 66 | wdbox[n][6], wdbox[n][7] + WPNT_OFF, dspbuf, 14);
|
---|
| 67 |
|
---|
| 68 | return(SUCCESS);
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | /*
|
---|
| 72 | =============================================================================
|
---|
| 73 | nd_wpnt() -- handle new data entry
|
---|
| 74 | =============================================================================
|
---|
| 75 | */
|
---|
| 76 |
|
---|
[7258c6a] | 77 | int16_t nd_wpnt(int16_t nn, int16_t k)
|
---|
[f40a309] | 78 | {
|
---|
[7258c6a] | 79 | register int16_t ec, n;
|
---|
[f40a309] | 80 |
|
---|
| 81 | n = nn & 0xFF;
|
---|
| 82 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 83 | ebuf[ec] = k + '0';
|
---|
| 84 | ebuf[3] = '\0';
|
---|
| 85 |
|
---|
| 86 | dspbuf[0] = k + '0';
|
---|
| 87 | dspbuf[1] = '\0';
|
---|
| 88 |
|
---|
| 89 | vbank(0);
|
---|
| 90 |
|
---|
| 91 | vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
|
---|
| 92 | wdbox[n][6], stccol, dspbuf, 14);
|
---|
| 93 |
|
---|
| 94 | advwcur();
|
---|
| 95 |
|
---|
| 96 | return(SUCCESS);
|
---|
| 97 | }
|
---|
[6262b5c] | 98 |
|
---|