1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-09-30 22:56:03 +00:00

Added support for the ID 20 block and fixed a minor error in my skip-the-contents version of block 11: length is three bytes long, not two. This gives me enough structure properly to get to the end of my current test CDT, albeit without making any of the noises.

This commit is contained in:
Thomas Harte 2017-08-02 14:12:34 -04:00
parent 819761f9fb
commit d7a5c3f49a
2 changed files with 16 additions and 1 deletions

View File

@ -56,12 +56,14 @@ void TZX::get_next_pulses() {
return;
}
// printf("TZX %ld\n", ftell(file_));
switch(chunk_id) {
case 0x10: get_standard_speed_data_block(); break;
case 0x11: get_turbo_speed_data_block(); break;
case 0x12: get_pure_tone_data_block(); break;
case 0x13: get_pulse_sequence(); break;
case 0x19: get_generalised_data_block(); break;
case 0x20: get_pause(); break;
case 0x30: {
// Text description. Ripe for ignoring.
@ -183,7 +185,10 @@ void TZX::get_turbo_speed_data_block() {
__unused uint16_t length_of_pilot_tone = fgetc16le();
__unused uint8_t number_of_bits_in_final_byte = (uint8_t)fgetc(file_);
__unused uint16_t pause_after_block = fgetc16le();
uint16_t data_length = fgetc16le();
long data_length = fgetc16le();
data_length |= (long)(fgetc(file_) << 16);
printf("Skipping %lu bytes of turbo speed data\n", data_length);
// TODO output as described
fseek(file_, data_length, SEEK_CUR);
@ -203,6 +208,15 @@ void TZX::get_pulse_sequence() {
}
}
void TZX::get_pause() {
uint16_t duration = fgetc16le();
if(!duration) {
// TODO (maybe): post a 'pause the tape' suggestion
} else {
post_gap(duration);
}
}
#pragma mark - Output
void TZX::post_pulse(unsigned int length) {

View File

@ -42,6 +42,7 @@ class TZX: public PulseQueuedTape, public Storage::FileHolder {
void get_pure_tone_data_block();
void get_pulse_sequence();
void get_generalised_data_block();
void get_pause();
void get_generalised_segment(uint32_t output_symbols, uint8_t max_pulses_per_symbol, uint8_t number_of_symbols, bool is_data);