Fix tape loading; Speedlock 4-7, Softlock and Powerload work now

This commit is contained in:
fabio.olimpieri 2013-04-19 12:03:15 +00:00
parent f931efe19e
commit fd93e04b9b
3 changed files with 13 additions and 12 deletions

View File

@ -1717,6 +1717,7 @@ void ResetComputer () {
ordenador.tape_stop = 1;
ordenador.tape_stop_fast = 1;
ordenador.stop_tape_start_countdown = 0;
ordenador.tape_current_bit = 0;
if (ordenador.rewind_on_reset)
{

View File

@ -302,8 +302,8 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
ordenador.tape_pause_at_end = ((unsigned int) value2) + 256 * ((unsigned int) value3);
if(ordenador.tape_pause_at_end==0)
ordenador.tape_pause_at_end=10; // to avoid problems
//if(ordenador.tape_pause_at_end==0)
//ordenador.tape_pause_at_end=10; // to avoid problems
ordenador.tape_pause_at_end *= 3500;
retval=fread (&value, 1, 1, fichero);
@ -323,7 +323,7 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
ordenador.tape_current_mode = TAP_GUIDE;
ordenador.tape_counter0 = ordenador.tape_block_level;
ordenador.tape_counter1 = ordenador.tape_block_level;
ordenador.tape_current_bit = 0;
//ordenador.tape_current_bit = 0;
break;
case 0x12: // pure tone
@ -356,10 +356,10 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
}
break;
case 0x14: // turbo tape block
case 0x14: // pure data
done = 1;
bucle = 0;
ordenador.tape_current_bit = 0;
//ordenador.tape_current_bit = 0;
retval=fread(&value2,1,1,fichero);
retval=fread(&value3,1,1,fichero);
ordenador.tape_bit0_level = ((unsigned int) value2) + 256 * ((unsigned int) value3);
@ -576,7 +576,7 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
return;
} else { // guide tone ended. send sync tone
ordenador.tape_counter0 = ordenador.tape_sync_level0 - tstados;
ordenador.tape_counter1 = ordenador.tape_sync_level0; // new pulse
ordenador.tape_counter1 = ordenador.tape_sync_level1; // new pulse
ordenador.tape_current_mode = TAP_DATA; // data mode
ordenador.tape_bit = 0x80; // from bit0 to bit7
if((ordenador.tape_byte_counter==1)&&(ordenador.tape_bits_at_end!=8)) { // last byte
@ -631,8 +631,8 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
break;
case TAP_PAUSE: // pause
ordenador.tape_readed = 0;
ordenador.tape_current_bit = 0;
//ordenador.tape_readed = 0;
//ordenador.tape_current_bit = 0;
if (ordenador.tape_counter_rep > tstados) {
ordenador.tape_counter_rep -= tstados;
} else {
@ -642,8 +642,8 @@ inline void tape_read_tzx (FILE * fichero, int tstados) {
}
break;
case TAP_PAUSE2: // pause and stop
ordenador.tape_readed = 0;
ordenador.tape_current_bit = 0;
//ordenador.tape_readed = 0;
//ordenador.tape_current_bit = 0;
if (ordenador.tape_counter_rep > tstados) {
ordenador.tape_counter_rep -= tstados;
} else {
@ -1031,7 +1031,7 @@ void fastload_block_tzx (FILE * fichero) {
retorno=2;
break;
case 0x14: // turbo tape block
case 0x14: // pure data
retorno=2;
break;

View File

@ -75,7 +75,7 @@ void create_browser_tzx (FILE * fichero) {
browser_list[block_number]->position=byte_position;
strcpy(browser_list[block_number]->info, " ");
printf("TZX browser: %X en %d\n",blockid, byte_position);
printf("TZX browser: %X en %d\n",blockid, byte_position+1);
switch(blockid) {
case 0x10: // classic tape block