static void datasette_control_internal(int command) { if (current_image != NULL) { switch(command) { case DATASETTE_CONTROL_RESET_COUNTER: datasette_reset_counter(); break; case DATASETTE_CONTROL_RESET: datasette_internal_reset(); case DATASETTE_CONTROL_STOP: current_image->mode = DATASETTE_CONTROL_STOP; datasette_set_tape_sense(0); last_write_clk = (CLOCK)0; break; case DATASETTE_CONTROL_START: current_image->mode = DATASETTE_CONTROL_START; datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) datasette_start_motor(); break; case DATASETTE_CONTROL_FORWARD: current_image->mode = DATASETTE_CONTROL_FORWARD; datasette_forward(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) datasette_start_motor(); break; case DATASETTE_CONTROL_REWIND: current_image->mode = DATASETTE_CONTROL_REWIND; datasette_rewind(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) datasette_start_motor(); break; case DATASETTE_CONTROL_RECORD: if (current_image->read_only == 0) { current_image->mode = DATASETTE_CONTROL_RECORD; datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; } break; } ui_display_tape_control_status(current_image->mode); /* clear the tap-buffer */ last_tap = next_tap = 0; } }
static void datasette_control_internal(int command) { DBG(("datasette_control_internal (%s) (image present:%s)", cmdstr[command], current_image ? "yes" : "no")); if (current_image) { switch (command) { case DATASETTE_CONTROL_RESET_COUNTER: datasette_reset_counter(); break; case DATASETTE_CONTROL_RESET: datasette_internal_reset(); case DATASETTE_CONTROL_STOP: current_image->mode = DATASETTE_CONTROL_STOP; datasette_set_tape_sense(0); last_write_clk = (CLOCK)0; break; case DATASETTE_CONTROL_START: current_image->mode = DATASETTE_CONTROL_START; datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_FORWARD: current_image->mode = DATASETTE_CONTROL_FORWARD; datasette_forward(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_REWIND: current_image->mode = DATASETTE_CONTROL_REWIND; datasette_rewind(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_RECORD: if (current_image->read_only == 0) { current_image->mode = DATASETTE_CONTROL_RECORD; datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; } break; } ui_display_tape_control_status(current_image->mode); } else { switch (command) { case DATASETTE_CONTROL_RESET_COUNTER: datasette_reset_counter(); break; case DATASETTE_CONTROL_RESET: datasette_internal_reset(); case DATASETTE_CONTROL_STOP: notape_mode = DATASETTE_CONTROL_STOP; datasette_set_tape_sense(0); last_write_clk = (CLOCK)0; break; case DATASETTE_CONTROL_START: notape_mode = DATASETTE_CONTROL_START; datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_FORWARD: notape_mode = DATASETTE_CONTROL_FORWARD; datasette_forward(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_REWIND: notape_mode = DATASETTE_CONTROL_REWIND; datasette_rewind(); datasette_set_tape_sense(1); last_write_clk = (CLOCK)0; if (datasette_motor) { datasette_start_motor(); } break; case DATASETTE_CONTROL_RECORD: /* record can usually not be pressed when no tape is present */ break; } ui_display_tape_control_status(notape_mode); } /* clear the tap-buffer */ last_tap = next_tap = 0; }