summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/sptape.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox/sptape.c')
-rw-r--r--apps/plugins/zxbox/sptape.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/apps/plugins/zxbox/sptape.c b/apps/plugins/zxbox/sptape.c
index d3642eea4c..76817ca68c 100644
--- a/apps/plugins/zxbox/sptape.c
+++ b/apps/plugins/zxbox/sptape.c
@@ -39,8 +39,6 @@ int spt_auto_stop = 1;
39 39
40static int playing = 0; 40static int playing = 0;
41static int paused = 0; 41static int paused = 0;
42/*static FILE *tapefp;*/
43/*static int *tapefp;*/
44 42
45static char tapename[MAXFILENAME]; 43static char tapename[MAXFILENAME];
46static int tapetype; 44static int tapetype;
@@ -93,10 +91,10 @@ static void put_seg_desc(void)
93 len = get_seglen(); 91 len = get_seglen();
94 92
95 me = msgbuf; 93 me = msgbuf;
96 rb->snprintf(me,MAXDESCLEN, "%4i: ", currseg); 94 rb->snprintf(me,MAXDESCLEN, "%4d: ", currseg);
97 me = me+rb->strlen(me); 95 me = me+rb->strlen(me);
98 if(segtype >= SEG_DATA && len) { 96 if(segtype >= SEG_DATA && len) {
99 rb->snprintf(me,MAXDESCLEN, "%5li bytes, ", len); 97 rb->snprintf(me,MAXDESCLEN, "%5ld bytes, ", len);
100 me = me+rb->strlen(me); 98 me = me+rb->strlen(me);
101 } 99 }
102 100
@@ -120,7 +118,7 @@ static void put_seg_desc(void)
120 put_msg(msgbuf); 118 put_msg(msgbuf);
121 } 119 }
122 else { 120 else {
123 rb->snprintf(msgbuf,MAXDESCLEN, "%4i:", currseg); 121 rb->snprintf(msgbuf,MAXDESCLEN, "%4d:", currseg);
124 put_tmp_msg(msgbuf); 122 put_tmp_msg(msgbuf);
125 } 123 }
126 } 124 }
@@ -315,11 +313,11 @@ void play_tape(void)
315 313
316 datak = (int) (get_segpos() / 1000); 314 datak = (int) (get_segpos() / 1000);
317 if(datak > lastdatak) { 315 if(datak > lastdatak) {
318/* if(ingroup) sprintf(msgbuf, "%4i: ", currseg); 316 if(ingroup) rb->snprintf(msgbuf,MAXDESCLEN, "%4d: ", currseg);
319 else sprintf(msgbuf, " "); 317 else rb->snprintf(msgbuf,MAXDESCLEN, " ");
320 sprintf(msgbuf+strlen(msgbuf), "%3ik", datak); 318 rb->snprintf(msgbuf+rb->strlen(msgbuf),MAXDESCLEN, "%3dk", datak);
321 put_tmp_msg(msgbuf); 319 put_tmp_msg(msgbuf);
322*/ 320
323 lastdatak = datak; 321 lastdatak = datak;
324 } 322 }
325 } 323 }
@@ -367,19 +365,20 @@ rovid: 2..5
367#define BIT1_MAX 9 365#define BIT1_MAX 9
368 366
369#define LEADER_MIN_COUNT 512 367#define LEADER_MIN_COUNT 512
370/* 368#if 0
371static int rec_segment; 369static int rec_segment;
372static int rec_state = RC_NONE; 370static int rec_state = RC_NONE;
373static byte *recbuf = NULL; 371static byte *recbuf = NULL;
374static const char *waitchars = "-\\|/"; 372static const char *waitchars = "-\\|/";
375*/ 373#endif
376static int recording = 0; 374static int recording = 0;
377 375
378 376
379 377
380void rec_tape(void) 378void rec_tape(void)
381{ 379{
382/* static byte lastmic = 0; 380#if 0
381 static byte lastmic = 0;
383 static int lastlen = 0; 382 static int lastlen = 0;
384 static int whole; 383 static int whole;
385 static int leadercount; 384 static int leadercount;
@@ -524,18 +523,21 @@ void rec_tape(void)
524 } 523 }
525 524
526 lastlen = 0; 525 lastlen = 0;
527 }*/ 526 }
527#endif
528} 528}
529 529
530static void stop_recording(void) 530static void stop_recording(void)
531{ 531{
532/* if(recording) { 532#if 0
533 if(recording) {
533 recording = 0; 534 recording = 0;
534 free(recbuf); 535 free(recbuf);
535 recbuf = NULL; 536 recbuf = NULL;
536 537
537 rb->close(tapefp); 538 rb->close(tapefp);
538 }*/ 539 }
540#endif
539} 541}
540 542
541static void restart_playing(void) 543static void restart_playing(void)
@@ -634,8 +636,10 @@ void stop_play(void)
634 if(paused) paused = 0; 636 if(paused) paused = 0;
635 } 637 }
636 else if(recording) { 638 else if(recording) {
637 /* sprintf(msgbuf, " * Stopped recording tape `%s' * ", tapename); 639#if 0
638 put_msg(msgbuf);*/ 640 sprintf(msgbuf, " * Stopped recording tape `%s' * ", tapename);
641 put_msg(msgbuf);
642#endif
639 stop_recording(); 643 stop_recording();
640 } 644 }
641} 645}
@@ -696,9 +700,7 @@ void qload(void)
696 if(!playing) { 700 if(!playing) {
697 if(paused) unpause_playing(); 701 if(paused) unpause_playing();
698 else { 702 else {
699 spkey_textmode();
700 start_play(); 703 start_play();
701 spkey_screenmode();
702 } 704 }
703 } 705 }
704 if(!playing) { 706 if(!playing) {