2 #include "hvl_replay.h"
18 int cx
= (getmaxx(stdscr
)/2)-(strlen(dispmesg
)/2)-1;
19 int cy
= getmaxy(stdscr
)/2;
21 mvaddch(cy
-1, cx
, ACS_ULCORNER
);
22 for(int i
=cx
+1; i
<cx
+strlen(dispmesg
)+1; i
++)
23 mvaddch(cy
-1, i
, ACS_HLINE
);
24 mvaddch(cy
-1, cx
+strlen(dispmesg
)+1, ACS_URCORNER
);
26 mvaddch(cy
, cx
, ACS_VLINE
);
27 mvaddstr(cy
, cx
+1, dispmesg
);
28 mvaddch(cy
, cx
+strlen(dispmesg
)+1, ACS_VLINE
);
30 mvaddch(cy
+1, cx
, ACS_LLCORNER
);
31 for(int i
=cx
+1; i
<cx
+strlen(dispmesg
)+1; i
++)
32 mvaddch(cy
+1, i
, ACS_HLINE
);
33 mvaddch(cy
+1, cx
+strlen(dispmesg
)+1, ACS_LRCORNER
);
36 static char *notenames
[] = {"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "H-"};
43 void setdisplay(char *str
){
52 if(c
== '-' || c
== KEY_DC
) return 0;
54 s
= strchr(keymap
[0], c
);
56 f
= (s
- (keymap
[0])) + octave
* 12 + 1;
58 s
= strchr(keymap
[1], c
);
60 f
= (s
- (keymap
[1])) + octave
* 12 + 12 + 1;
64 if(f
> 12 * 9 + 1) return -1;
68 void iedplonk(int x
) {
72 //hvl_process_step(tune, &tune->ht_Voices[0]);
73 //hvl_process_frame(tune, &tune->ht_Voices[0]);
74 //hvl_set_audio(&tune->ht_Voices[0], tune->ht_Frequency);
83 keypad(stdscr
, FALSE
);
85 nodelay(stdscr
, TRUE
);
95 for(i
= 0; i
<tune
->ht_PositionNr
; i
++){
96 snprintf(buf
, sizeof(buf
), "%02x", i
);
100 trans
= tune
->ht_Positions
[i
].pos_Transpose
[j
]; //this makes the transpose column display 'fe' instead of 'fffffffffe'..., which is weird since trans is unsigned
101 snprintf(buf
, sizeof(buf
), "%02x:%02x", tune
->ht_Positions
[i
].pos_Track
[j
], trans
);
107 if(songy
== i
) attrset(A_BOLD
);
110 snprintf(buf
, sizeof(buf
), "Name: %s", tune
->ht_Name
);
111 mvaddstr(c
++, 60, buf
);
112 snprintf(buf
, sizeof(buf
), "PosNr: %02x", tune
->ht_PosNr
);
113 mvaddstr(c
++, 60, buf
);
114 snprintf(buf
, sizeof(buf
), "PositionNr: %02x", tune
->ht_PositionNr
);
115 mvaddstr(c
++, 60, buf
);
116 snprintf(buf
, sizeof(buf
), "Restart: %02x", tune
->ht_Restart
);
117 mvaddstr(c
++, 60, buf
);
118 snprintf(buf
, sizeof(buf
), "NoteNr: %02x", tune
->ht_NoteNr
);
119 mvaddstr(c
++, 60, buf
);
120 snprintf(buf
, sizeof(buf
), "TrackLength: %02x", tune
->ht_TrackLength
);
121 mvaddstr(c
++, 60, buf
);
122 snprintf(buf
, sizeof(buf
), "TrackNr: %02x", tune
->ht_TrackNr
);
123 mvaddstr(c
++, 60, buf
);
124 snprintf(buf
, sizeof(buf
), "Tempo: %02x", tune
->ht_Tempo
);
125 mvaddstr(c
++,60, buf
);
126 snprintf(buf
, sizeof(buf
), "StepWaitFrames: %02x", tune
->ht_StepWaitFrames
);
127 mvaddstr(c
++,60, buf
);
128 snprintf(buf
, sizeof(buf
), "SongEndReached: %02x", tune
->ht_SongEndReached
);
129 mvaddstr(c
++,60, buf
);
130 snprintf(buf
, sizeof(buf
), "Freq: %d", tune
->ht_Frequency
);
131 mvaddstr(c
++,60, buf
);
132 snprintf(buf
, sizeof(buf
), "GetNewPosition: %02x", tune
->ht_GetNewPosition
);
133 mvaddstr(c
++,60, buf
);
134 //for(int i = 0; i <tune->ht_Channels; i++) {
135 for(int i
= 0; i
< 2; i
++) {
136 snprintf(buf
, sizeof(buf
), "VC %x TrackPeriod: %x", i
, tune
->ht_Voices
[i
].vc_TrackPeriod
);
137 mvaddstr(c
++,60, buf
);
138 snprintf(buf
, sizeof(buf
), "VC %x SamplePos: %x", i
, tune
->ht_Voices
[i
].vc_SamplePos
);
139 mvaddstr(c
++,60, buf
);
140 snprintf(buf
, sizeof(buf
), "VC %x Delta: %x", i
, tune
->ht_Voices
[i
].vc_Delta
);
141 mvaddstr(c
++,60, buf
);
142 snprintf(buf
, sizeof(buf
), "VC %x WaveLength: %x", i
, tune
->ht_Voices
[i
].vc_WaveLength
);
143 mvaddstr(c
++,60, buf
);
144 snprintf(buf
, sizeof(buf
), "VC %x PerfCurrent: %x", i
, tune
->ht_Voices
[i
].vc_PerfCurrent
);
145 mvaddstr(c
++,60, buf
);
146 snprintf(buf
, sizeof(buf
), "VC %x PerfSpeed: %x", i
, tune
->ht_Voices
[i
].vc_PerfSpeed
);
147 mvaddstr(c
++,60, buf
);
148 snprintf(buf
, sizeof(buf
), "VC %x FilterOn: %x", i
, tune
->ht_Voices
[i
].vc_FilterOn
);
149 mvaddstr(c
++,60, buf
);
150 snprintf(buf
, sizeof(buf
), "VC %x FilterPos: %x", i
, tune
->ht_Voices
[i
].vc_FilterPos
);
151 mvaddstr(c
++,60, buf
);
152 snprintf(buf
, sizeof(buf
), "VC %x SquarePos: %x", i
, tune
->ht_Voices
[i
].vc_SquarePos
);
153 mvaddstr(c
++,60, buf
);
155 snprintf(buf
, sizeof(buf
), "SpeedMultiplier: %02x", tune
->ht_SpeedMultiplier
);
156 mvaddstr(c
++, 60, buf
);
157 snprintf(buf
, sizeof(buf
), "InstrumentNr: %02x", tune
->ht_InstrumentNr
);
158 mvaddstr(c
++, 60, buf
);
159 snprintf(buf
, sizeof(buf
), "Note: %s%d", notenames
[(note
-1) % 12], (note
-1) / 12);
160 mvaddstr(c
++, 60, buf
);
166 snprintf(buf
, sizeof(buf
), "Track: %02x", currtrack
);
167 mvaddstr(0, 26, buf
);
169 for(i
= 0; i
< tune
->ht_TrackLength
; i
++){
170 snprintf(buf
, sizeof(buf
), "%02x", i
);
174 if(tune
->ht_Tracks
[currtrack
][i
].stp_Note
)
175 //snprintf(buf, sizeof(buf), "%s%d ", notenames[(tune->ht_Tracks[currtrack][i].stp_Note - 1) % 12], (tune->ht_Tracks[currtrack][i].stp_Note - 1) / 12);
176 snprintf(buf
, sizeof(buf
), "%d ", tune
->ht_Tracks
[currtrack
][i
].stp_Note
);
178 snprintf(buf
, sizeof(buf
), "--- ");
181 if(tune
->ht_Tracks
[currtrack
][i
].stp_Instrument
)
182 snprintf(buf
, sizeof(buf
), "%02x ", tune
->ht_Tracks
[currtrack
][i
].stp_Instrument
);
184 snprintf(buf
, sizeof(buf
), "-- ");
187 if(tune
->ht_Tracks
[currtrack
][i
].stp_FX
)
188 snprintf(buf
, sizeof(buf
), "%02x ", tune
->ht_Tracks
[currtrack
][i
].stp_FX
);
190 snprintf(buf
, sizeof(buf
), "-- ");
193 if(tune
->ht_Tracks
[currtrack
][i
].stp_FXParam
)
194 snprintf(buf
, sizeof(buf
), "%02x ", tune
->ht_Tracks
[currtrack
][i
].stp_FXParam
);
196 snprintf(buf
, sizeof(buf
), "-- ");
199 if(tune
->ht_Tracks
[currtrack
][i
].stp_FXb
)
200 snprintf(buf
, sizeof(buf
), "%02x ", tune
->ht_Tracks
[currtrack
][i
].stp_FX
);
202 snprintf(buf
, sizeof(buf
), "-- ");
205 if(tune
->ht_Tracks
[currtrack
][i
].stp_FXbParam
)
206 snprintf(buf
, sizeof(buf
), "%02x ", tune
->ht_Tracks
[currtrack
][i
].stp_FXParam
);
208 snprintf(buf
, sizeof(buf
), "-- ");
211 if((i
== tune
->ht_NoteNr
))
228 move(tracky
, trackx
);
242 if((c
= getch()) != ERR
){
296 if(x
) tune
->ht_Tracks
[currtrack
][tracky
].stp_Note
= x
;