[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etsnbt.c -- beat field handlers
|
---|
| 4 | Version 4 -- 1988-07-28 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #include "fields.h"
|
---|
| 9 | #include "hwdefs.h"
|
---|
| 10 | #include "graphdef.h"
|
---|
| 11 | #include "vsdd.h"
|
---|
| 12 | #include "vsddsw.h"
|
---|
| 13 | #include "stddefs.h"
|
---|
| 14 |
|
---|
| 15 | #include "midas.h"
|
---|
| 16 | #include "scdsp.h"
|
---|
| 17 | #include "instdsp.h"
|
---|
| 18 |
|
---|
[7258c6a] | 19 | extern uint16_t *obj8;
|
---|
[f40a309] | 20 |
|
---|
[7258c6a] | 21 | extern int16_t clkrun;
|
---|
| 22 | extern int16_t insmode;
|
---|
| 23 | extern int16_t stccol;
|
---|
[f40a309] | 24 |
|
---|
[7258c6a] | 25 | extern int32_t t_cur;
|
---|
[f40a309] | 26 |
|
---|
| 27 | /* |
---|
| 28 |
|
---|
| 29 | */
|
---|
| 30 |
|
---|
| 31 | /*
|
---|
| 32 | =============================================================================
|
---|
| 33 | et_snbt() -- load edit buffer
|
---|
| 34 | =============================================================================
|
---|
| 35 | */
|
---|
[7258c6a] | 36 |
|
---|
[f40a309] | 37 | int16_t et_snbt(int16_t n)
|
---|
[7258c6a] | 38 | {
|
---|
[f40a309] | 39 | register int32_t curfr, beat;
|
---|
| 40 |
|
---|
| 41 | if (clkrun) {
|
---|
| 42 |
|
---|
| 43 | ebflag = FALSE;
|
---|
| 44 | return(FAILURE);
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | curfr = t_cur;
|
---|
| 48 | beat = curfr / 48;
|
---|
| 49 |
|
---|
| 50 | sprintf(ebuf, "%05ld", beat);
|
---|
| 51 | ebflag = TRUE;
|
---|
| 52 |
|
---|
| 53 | return(SUCCESS);
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | /*
|
---|
| 57 | =============================================================================
|
---|
| 58 | ef_snbt() -- parse edit buffer
|
---|
| 59 | =============================================================================
|
---|
| 60 | */
|
---|
[7258c6a] | 61 |
|
---|
[f40a309] | 62 | int16_t ef_snbt(int16_t n)
|
---|
[7258c6a] | 63 | {
|
---|
| 64 | register int32_t ival;
|
---|
[f40a309] | 65 | register int16_t i;
|
---|
| 66 |
|
---|
| 67 | if (clkrun)
|
---|
| 68 | return(FAILURE);
|
---|
| 69 |
|
---|
| 70 | ival = 0L;
|
---|
| 71 |
|
---|
| 72 | for (i = 0; i < 5; i++)
|
---|
| 73 | ival = (ival * 10) + (ebuf[i] - '0');
|
---|
| 74 |
|
---|
| 75 | ebflag = FALSE;
|
---|
| 76 |
|
---|
| 77 | if (insmode) {
|
---|
| 78 |
|
---|
| 79 | icancel();
|
---|
| 80 | dsimode();
|
---|
| 81 | }
|
---|
| 82 |
|
---|
| 83 | sc_goto(fc_val = ival * 48L);
|
---|
| 84 | return(SUCCESS);
|
---|
| 85 | }
|
---|
| 86 |
|
---|
| 87 | /* |
---|
| 88 |
|
---|
| 89 | */
|
---|
| 90 |
|
---|
| 91 | /*
|
---|
| 92 | =============================================================================
|
---|
| 93 | rd_snbt() -- (re)display the field
|
---|
| 94 | =============================================================================
|
---|
[7258c6a] | 95 | */
|
---|
[f40a309] | 96 |
|
---|
[7258c6a] | 97 | int16_t rd_snbt(int16_t n)
|
---|
| 98 | {
|
---|
[f40a309] | 99 | register int32_t curfr, beat;
|
---|
| 100 | int8_t buf[8];
|
---|
| 101 |
|
---|
| 102 | curfr = t_cur;
|
---|
| 103 | beat = curfr / 48;
|
---|
| 104 | sprintf(buf, "%05ld", beat);
|
---|
| 105 |
|
---|
| 106 | if (v_regs[5] & 0x0180)
|
---|
| 107 | vbank(0);
|
---|
| 108 |
|
---|
| 109 | vputs(obj8, 0, 11, buf, SDW00ATR);
|
---|
| 110 |
|
---|
| 111 | return(SUCCESS);
|
---|
| 112 | }
|
---|
| 113 |
|
---|
| 114 | /* |
---|
| 115 |
|
---|
| 116 | */
|
---|
| 117 |
|
---|
| 118 | /*
|
---|
| 119 | =============================================================================
|
---|
| 120 | nd_snbt() -- data entry function
|
---|
[7258c6a] | 121 | =============================================================================
|
---|
[f40a309] | 122 | */
|
---|
[7258c6a] | 123 |
|
---|
[f40a309] | 124 | int16_t nd_snbt(int16_t n, int16_t k)
|
---|
| 125 | {
|
---|
| 126 | register int16_t ec;
|
---|
| 127 |
|
---|
| 128 | if (clkrun)
|
---|
| 129 | return(FAILURE);
|
---|
| 130 |
|
---|
| 131 | ec = stccol - cfetp->flcol;
|
---|
| 132 | ebuf[ec] = k + '0';
|
---|
| 133 |
|
---|
| 134 | if (v_regs[5] & 0x0180)
|
---|
| 135 | vbank(0);
|
---|
| 136 |
|
---|
| 137 | vputc(obj8, 0, stccol, k + '0', SDW00DEA);
|
---|
| 138 | advscur();
|
---|
| 139 |
|
---|
| 140 | return(SUCCESS);
|
---|
| 141 | }
|
---|