Fixed bug when entering file selection during file loading, inverted audio channels

This commit is contained in:
fabio.olimpieri 2013-01-27 20:22:13 +00:00
parent f3dc41a8dd
commit 1d83a75fe5
3 changed files with 10 additions and 17 deletions

View File

@ -228,13 +228,6 @@ static void insert_tape()
unsigned char char_id[11]; unsigned char char_id[11];
int retorno, retval; int retorno, retval;
// Maybe should go after the first control??
if(ordenador.tap_file!=NULL)
rewind_tape(ordenador.tap_file,1);
ordenador.tape_current_bit=0;
ordenador.tape_current_mode=TAP_TRASH;
const char *filename = menu_select_file(load_path_taps, ordenador.current_tap, 1); const char *filename = menu_select_file(load_path_taps, ordenador.current_tap, 1);
if (filename==NULL) // Aborted if (filename==NULL) // Aborted
@ -250,6 +243,8 @@ static void insert_tape()
if (!(ext_matches(filename, ".tap")|ext_matches(filename, ".TAP")|ext_matches(filename, ".tzx")| if (!(ext_matches(filename, ".tap")|ext_matches(filename, ".TAP")|ext_matches(filename, ".tzx")|
ext_matches(filename, ".TZX"))) {free((void *)filename); return;} ext_matches(filename, ".TZX"))) {free((void *)filename); return;}
ordenador.tape_current_bit=0;
ordenador.tape_current_mode=TAP_TRASH;
if(ordenador.tap_file!=NULL) { if(ordenador.tap_file!=NULL) {
fclose(ordenador.tap_file); fclose(ordenador.tap_file);
@ -426,7 +421,7 @@ static int manage_tape(int which)
ordenador.tape_current_mode=TAP_TRASH; ordenador.tape_current_mode=TAP_TRASH;
rewind_tape(ordenador.tap_file,1); rewind_tape(ordenador.tap_file,1);
} }
msgInfo("Tape rewinded",3000,NULL); msgInfo("Tape rewound",3000,NULL);
retorno=-1; retorno=-1;
break; break;
case 5: //Create case 5: //Create

View File

@ -632,7 +632,7 @@ void taps_menu() {
fin=0; fin=0;
break; break;
case SDLK_1: case SDLK_1:
ordenador.pause=1; //ordenador.pause=1;
select_tapfile(); select_tapfile();
break; break;
case SDLK_2: case SDLK_2:
@ -642,7 +642,7 @@ void taps_menu() {
ordenador.tape_current_mode=TAP_TRASH; ordenador.tape_current_mode=TAP_TRASH;
rewind_tape(ordenador.tap_file,1); rewind_tape(ordenador.tap_file,1);
} }
sprintf(ordenador.osd_text,"Tape rewinded"); sprintf(ordenador.osd_text,"Tape rewound");
ordenador.osd_time=50; ordenador.osd_time=50;
break; break;
case SDLK_3: case SDLK_3:
@ -681,12 +681,6 @@ void select_tapfile() {
clean_screen(); clean_screen();
if(ordenador.tap_file!=NULL)
rewind_tape(ordenador.tap_file,1);
ordenador.tape_current_bit=0;
ordenador.tape_current_mode=TAP_TRASH;
print_string(videomem,"Choose the TAPE file to load",-1,32,13,0,ancho); print_string(videomem,"Choose the TAPE file to load",-1,32,13,0,ancho);
filename=select_file(load_path_taps,FILETYPE_TAP_TZX); filename=select_file(load_path_taps,FILETYPE_TAP_TZX);
@ -696,6 +690,9 @@ void select_tapfile() {
return; return;
} }
ordenador.tape_current_bit=0;
ordenador.tape_current_mode=TAP_TRASH;
if(ordenador.tap_file!=NULL) { if(ordenador.tap_file!=NULL) {
fclose(ordenador.tap_file); fclose(ordenador.tap_file);
} }
@ -703,6 +700,7 @@ void select_tapfile() {
if (!strncmp(filename,"smb:",4)) ordenador.tap_file=fopen(filename,"r"); //tinysmb does not work with r+ if (!strncmp(filename,"smb:",4)) ordenador.tap_file=fopen(filename,"r"); //tinysmb does not work with r+
else ordenador.tap_file=fopen(filename,"r+"); // read and write else ordenador.tap_file=fopen(filename,"r+"); // read and write
ordenador.tape_write = 0; // by default, can't record ordenador.tape_write = 0; // by default, can't record
if(ordenador.tap_file==NULL) if(ordenador.tap_file==NULL)
retorno=-1; retorno=-1;
else else

View File

@ -372,7 +372,7 @@ inline void play_sound (unsigned int tstados) {
lvalue = beeper*ordenador.volume; lvalue = beeper*ordenador.volume;
} }
*ordenador.current_buffer = (lvalue<<16)|(rvalue); *ordenador.current_buffer = (rvalue<<16)|(lvalue);
ordenador.current_buffer++; ordenador.current_buffer++;
ordenador.sound_cuantity++; ordenador.sound_cuantity++;