source: buchla-68k/ram/etttab.c@ e225e77

Last change on this file since e225e77 was e225e77, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[f40a309]1/*
2 =============================================================================
3 etttab.c -- MIDAS tuning editor - tuning table number field handlers
4 Version 3 -- 1988-08-22 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "vsddsw.h"
12#include "graphdef.h"
13
14#include "midas.h"
15#include "tundsp.h"
16
[e225e77]17#include "stdio.h"
18
19extern void modtun(void);
20extern void settc(int16_t rv, int16_t cv);
21
[7258c6a]22extern uint16_t *tunob;
[f40a309]23
[7258c6a]24extern int16_t stcrow, stccol;
25extern int16_t curtun, tunmod;
[f40a309]26
[7258c6a]27extern int16_t tdbox[][8];
[f40a309]28
[7258c6a]29extern int8_t dspbuf[];
[f40a309]30
31/*
32
33*/
34
35/*
36 =============================================================================
37 et_ttab() -- load the edit buffer
38 =============================================================================
39*/
[7258c6a]40
[f40a309]41int16_t et_ttab(int16_t n)
42{
43 sprintf(ebuf, "%d", curtun);
44 ebflag = TRUE;
45
46 return(SUCCESS);
47}
48
49/*
50 =============================================================================
51 ef_ttab() -- parse (unload) the edit buffer
52 =============================================================================
53*/
[7258c6a]54
[f40a309]55int16_t ef_ttab(int16_t n)
[7258c6a]56{
[f40a309]57 register int16_t i, tmpval;
58
59 ebuf[1] = '\0'; /* terminate the string in ebuf */
60 ebflag = FALSE;
61
62 curtun = ebuf[0] - '0';
63 modtun();
64 settc(22, 54);
65 return(SUCCESS);
66}
67
68/*
69
70*/
71
72/*
73 =============================================================================
74 rd_ttab() -- (re)display the field
75 =============================================================================
[7258c6a]76*/
[f40a309]77
[7258c6a]78int16_t rd_ttab(int16_t nn)
[f40a309]79{
80 register int16_t n;
81
82 n = nn & 0xFF;
83 sprintf(dspbuf, "%d", curtun);
84
85 vbank(0);
86 vcputsv(tunob, 64, (tunmod ? TDCHGD : tdbox[n][4]), tdbox[n][5],
87 24, 61, dspbuf, 14);
88
89 return(SUCCESS);
90}
91
92/*
93 =============================================================================
94 nd_ttab() -- handle new data entry
95 =============================================================================
[7258c6a]96*/
[f40a309]97
[7258c6a]98int16_t nd_ttab(int16_t nn, int16_t k)
[f40a309]99{
100 register int16_t n;
101
102 n = nn & 0xFF;
103
104 ebuf[0] = k + '0';
105 ebuf[1] = '\0';
106
107 dspbuf[0] = k + '0';
108 dspbuf[1] = '\0';
109
110 vbank(0);
111 vcputsv(tunob, 64, TDENTRY, tdbox[n][5], stcrow, stccol, dspbuf, 14);
112
113 return(SUCCESS);
114}
Note: See TracBrowser for help on using the repository browser.