source: buchla-68k/ram/etatun.c

Last change on this file was 861ab45, checked in by Thomas Lopatic <thomas@…>, 6 years ago

Fixed etatun.c.

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[f40a309]1/*
2 =============================================================================
3 etatun.c -- MIDAS assignment editor - tuning table field handlers
4 Version 1 -- 1987-12-10 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[b28a12e]8#include "ram.h"
[f40a309]9
10/*
11 =============================================================================
12 et_atun() -- load the edit buffer
13 =============================================================================
14*/
15
[7258c6a]16int16_t et_atun(int16_t n)
[f40a309]17{
[7ecfb7b]18 (void)n;
19
[f40a309]20 sprintf(ebuf, "%01.1d", curtun);
21 ebflag = TRUE;
22
23 return(SUCCESS);
24}
25
26/*
27 =============================================================================
28 ef_atun() -- parse (unload) the edit buffer
29 =============================================================================
30*/
31
[7258c6a]32int16_t ef_atun(int16_t n)
[f40a309]33{
[7258c6a]34 register int16_t tmpval;
[f40a309]35
[7ecfb7b]36 (void)n;
37
[f40a309]38 ebuf[1] = '\0'; /* terminate the string in ebuf */
39 ebflag = FALSE;
40
41 tmpval = ebuf[0] - '0';
42
43 gettun(tmpval);
44
45 modasg();
46 return(SUCCESS);
47}
48
49/*
50 =============================================================================
51 rd_atun() -- (re)display the field
52 =============================================================================
53*/
54
[7258c6a]55int16_t rd_atun(int16_t nn)
[f40a309]56{
[7258c6a]57 register int16_t n;
[f40a309]58
59 n = nn & 0xFF;
60 sprintf(dspbuf, "Tun %01.1d", curtun);
61
62 vbank(0);
63 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
64 adbox[n][6], adbox[n][7], dspbuf, 14);
65
66 return(SUCCESS);
67}
68
69/*
70 =============================================================================
71 nd_atun() -- handle new data entry
72 =============================================================================
73*/
74
[7258c6a]75int16_t nd_atun(int16_t nn, int16_t k)
[f40a309]76{
[7258c6a]77 register int16_t n;
[f40a309]78
79 n = nn & 0xFF;
[861ab45]80 ebuf[0] = (int8_t)(k + '0');
[f40a309]81 ebuf[1] = '\0';
82
[861ab45]83 dspbuf[0] = (int8_t)(k + '0');
[f40a309]84 dspbuf[1] = '\0';
85
86 vbank(0);
87 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
88 stcrow, stccol, dspbuf, 14);
89
90 return(SUCCESS);
91}
92
[6262b5c]93
Note: See TracBrowser for help on using the repository browser.