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

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

Use standard integer types.

  • Property mode set to 100644
File size: 2.1 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
[7258c6a]17extern uint16_t *tunob;
[f40a309]18
[7258c6a]19extern int16_t stcrow, stccol;
20extern int16_t curtun, tunmod;
[f40a309]21
[7258c6a]22extern int16_t tdbox[][8];
[f40a309]23
[7258c6a]24extern int8_t dspbuf[];
[f40a309]25
26/*
27
28*/
29
30/*
31 =============================================================================
32 et_ttab() -- load the edit buffer
33 =============================================================================
34*/
[7258c6a]35
[f40a309]36int16_t et_ttab(int16_t n)
37{
38 sprintf(ebuf, "%d", curtun);
39 ebflag = TRUE;
40
41 return(SUCCESS);
42}
43
44/*
45 =============================================================================
46 ef_ttab() -- parse (unload) the edit buffer
47 =============================================================================
48*/
[7258c6a]49
[f40a309]50int16_t ef_ttab(int16_t n)
[7258c6a]51{
[f40a309]52 register int16_t i, tmpval;
53
54 ebuf[1] = '\0'; /* terminate the string in ebuf */
55 ebflag = FALSE;
56
57 curtun = ebuf[0] - '0';
58 modtun();
59 settc(22, 54);
60 return(SUCCESS);
61}
62
63/*
64
65*/
66
67/*
68 =============================================================================
69 rd_ttab() -- (re)display the field
70 =============================================================================
[7258c6a]71*/
[f40a309]72
[7258c6a]73int16_t rd_ttab(int16_t nn)
[f40a309]74{
75 register int16_t n;
76
77 n = nn & 0xFF;
78 sprintf(dspbuf, "%d", curtun);
79
80 vbank(0);
81 vcputsv(tunob, 64, (tunmod ? TDCHGD : tdbox[n][4]), tdbox[n][5],
82 24, 61, dspbuf, 14);
83
84 return(SUCCESS);
85}
86
87/*
88 =============================================================================
89 nd_ttab() -- handle new data entry
90 =============================================================================
[7258c6a]91*/
[f40a309]92
[7258c6a]93int16_t nd_ttab(int16_t nn, int16_t k)
[f40a309]94{
95 register int16_t n;
96
97 n = nn & 0xFF;
98
99 ebuf[0] = k + '0';
100 ebuf[1] = '\0';
101
102 dspbuf[0] = k + '0';
103 dspbuf[1] = '\0';
104
105 vbank(0);
106 vcputsv(tunob, 64, TDENTRY, tdbox[n][5], stcrow, stccol, dspbuf, 14);
107
108 return(SUCCESS);
109}
Note: See TracBrowser for help on using the repository browser.