[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etvel.c -- velocity field handlers
|
---|
| 4 | Version 2 -- 1988-06-13 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[f40a309] | 9 |
|
---|
| 10 | /*
|
---|
| 11 | =============================================================================
|
---|
| 12 | et_vel() -- load edit buffer
|
---|
| 13 | =============================================================================
|
---|
| 14 | */
|
---|
| 15 |
|
---|
[7258c6a] | 16 | int16_t et_vel(int16_t n)
|
---|
[f40a309] | 17 | {
|
---|
| 18 | sprintf(ebuf, "%03d", lastvel[n] / 252);
|
---|
| 19 |
|
---|
| 20 | ebflag = TRUE;
|
---|
| 21 | return(SUCCESS);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | =============================================================================
|
---|
| 26 | ef_vel() -- parse edit buffer
|
---|
| 27 | =============================================================================
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[7258c6a] | 30 | int16_t ef_vel(int16_t n)
|
---|
[f40a309] | 31 | {
|
---|
[7258c6a] | 32 | register int16_t ival, i;
|
---|
[f40a309] | 33 | register struct s_entry *ep;
|
---|
| 34 |
|
---|
| 35 | ival = 0;
|
---|
| 36 |
|
---|
| 37 | for (i = 0; i < 3; i++)
|
---|
| 38 | ival = (ival * 10) + (ebuf[i] - '0');
|
---|
| 39 |
|
---|
| 40 | ebflag = FALSE;
|
---|
| 41 |
|
---|
| 42 | if (ival > 127)
|
---|
| 43 | return(FAILURE);
|
---|
| 44 |
|
---|
| 45 | ival = SM_SCALE(ival);
|
---|
| 46 |
|
---|
| 47 | if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
|
---|
| 48 |
|
---|
| 49 | lastvel[n] = ival;
|
---|
| 50 | ep = ep_adj(p_cur, 1, t_cur);
|
---|
| 51 |
|
---|
| 52 | while (t_cur EQ ep->e_time) {
|
---|
| 53 |
|
---|
| 54 | if ((EV_NBEG EQ (0x007F & ep->e_type)) AND
|
---|
| 55 | (ep->e_data2 EQ n)) {
|
---|
| 56 |
|
---|
| 57 | ((struct n_entry *)ep)->e_vel = ival;
|
---|
| 58 | }
|
---|
| 59 |
|
---|
| 60 | ep = ep->e_fwd;
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | return(SUCCESS);
|
---|
| 65 | }
|
---|
| 66 |
|
---|
| 67 | /*
|
---|
| 68 | =============================================================================
|
---|
| 69 | rd_vel() -- (re)display the field
|
---|
| 70 | =============================================================================
|
---|
| 71 | */
|
---|
| 72 |
|
---|
[7258c6a] | 73 | int16_t rd_vel(int16_t n)
|
---|
[f40a309] | 74 | {
|
---|
[7258c6a] | 75 | int8_t buf[6];
|
---|
[f40a309] | 76 |
|
---|
| 77 | sprintf(buf, "%03d", lastvel[n] / 252);
|
---|
| 78 |
|
---|
| 79 | if (v_regs[5] & 0x0180)
|
---|
| 80 | vbank(0);
|
---|
| 81 |
|
---|
| 82 | vputs(obj8, 5, 6 + (n * 5), buf, SDW11ATR);
|
---|
| 83 |
|
---|
| 84 | return(SUCCESS);
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | /*
|
---|
| 88 | =============================================================================
|
---|
| 89 | nd_vel() -- data entry function
|
---|
| 90 | =============================================================================
|
---|
| 91 | */
|
---|
| 92 |
|
---|
[7258c6a] | 93 | int16_t nd_vel(int16_t n, int16_t k)
|
---|
[f40a309] | 94 | {
|
---|
[7258c6a] | 95 | register int16_t ec;
|
---|
[f40a309] | 96 |
|
---|
[7ecfb7b] | 97 | (void)n;
|
---|
| 98 |
|
---|
[f40a309] | 99 | ec = stccol - cfetp->flcol; /* setup edit buffer column */
|
---|
| 100 | ebuf[ec] = k + '0';
|
---|
| 101 |
|
---|
| 102 | if (v_regs[5] & 0x0180)
|
---|
| 103 | vbank(0);
|
---|
| 104 |
|
---|
| 105 | vputc(obj8, 5, stccol, k + '0', SDW11DEA);
|
---|
| 106 | advscur();
|
---|
| 107 |
|
---|
| 108 | return(SUCCESS);
|
---|
| 109 | }
|
---|
[6262b5c] | 110 |
|
---|