mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-05 10:28:58 +00:00
Sought to emulate 0111 as a longer 0110 to test a particular HQ UEF. Some progress. Not great.
This commit is contained in:
parent
6239297212
commit
11850b872d
@ -112,6 +112,6 @@ void StaticAnalyser::Acorn::AddTargets(
|
|||||||
|
|
||||||
// TODO: disks
|
// TODO: disks
|
||||||
|
|
||||||
if(target.tapes.size() || target.cartridges.size())
|
// if(target.tapes.size() || target.cartridges.size())
|
||||||
destination.push_back(target);
|
destination.push_back(target);
|
||||||
}
|
}
|
||||||
|
@ -198,13 +198,13 @@ static std::unique_ptr<File::Chunk> GetNextChunk(Acorn1200BaudTapeParser &parser
|
|||||||
// read out name
|
// read out name
|
||||||
char name[11];
|
char name[11];
|
||||||
int name_ptr = 0;
|
int name_ptr = 0;
|
||||||
while(!parser.is_at_end() && name_ptr < 11)
|
while(!parser.is_at_end() && name_ptr < sizeof(name))
|
||||||
{
|
{
|
||||||
name[name_ptr] = (char)parser.get_next_byte();
|
name[name_ptr] = (char)parser.get_next_byte();
|
||||||
if(!name[name_ptr]) break;
|
if(!name[name_ptr]) break;
|
||||||
name_ptr++;
|
name_ptr++;
|
||||||
}
|
}
|
||||||
name[10] = '\0';
|
name[sizeof(name)-1] = '\0';
|
||||||
new_chunk->name = name;
|
new_chunk->name = name;
|
||||||
|
|
||||||
// addresses
|
// addresses
|
||||||
|
@ -7,8 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "TapeUEF.hpp"
|
#include "TapeUEF.hpp"
|
||||||
#include <string.h>
|
#include <cstring>
|
||||||
#include <math.h>
|
#include <cstdio>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using namespace Storage::Tape;
|
using namespace Storage::Tape;
|
||||||
|
|
||||||
@ -123,6 +124,7 @@ Storage::Tape::Tape::Pulse UEF::get_next_pulse()
|
|||||||
_bit_position = (_bit_position+1)&(_current_bit ? 3 : 1);
|
_bit_position = (_bit_position+1)&(_current_bit ? 3 : 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x0111: // TODO: insert dummy byte
|
||||||
case 0x0110:
|
case 0x0110:
|
||||||
next_pulse.type = (_bit_position&1) ? Pulse::High : Pulse::Low;
|
next_pulse.type = (_bit_position&1) ? Pulse::High : Pulse::Low;
|
||||||
next_pulse.length.length = 1;
|
next_pulse.length.length = 1;
|
||||||
@ -219,9 +221,14 @@ void UEF::find_next_tape_chunk()
|
|||||||
_chunk_duration.length |= (uint16_t)(gzgetc(_file) << 8);
|
_chunk_duration.length |= (uint16_t)(gzgetc(_file) << 8);
|
||||||
gzseek(_file, _chunk_length - 2, SEEK_CUR);
|
gzseek(_file, _chunk_length - 2, SEEK_CUR);
|
||||||
return;
|
return;
|
||||||
// case 0x0111: // carrier tone with dummy byte
|
case 0x0111: // carrier tone with dummy byte
|
||||||
// TODO: read lengths
|
_high_tone_with_dummy.pre_length = (uint16_t)gzgetc(_file);
|
||||||
// return;
|
_high_tone_with_dummy.pre_length |= (uint16_t)(gzgetc(_file) << 8);
|
||||||
|
_high_tone_with_dummy.post_length = (uint16_t)gzgetc(_file);
|
||||||
|
_high_tone_with_dummy.post_length |= (uint16_t)(gzgetc(_file) << 8);
|
||||||
|
_chunk_duration.length = _high_tone_with_dummy.post_length + _high_tone_with_dummy.pre_length + 10;
|
||||||
|
gzseek(_file, _chunk_length - 4, SEEK_CUR);
|
||||||
|
return;
|
||||||
case 0x0114: // security cycles
|
case 0x0114: // security cycles
|
||||||
{
|
{
|
||||||
// read number of cycles
|
// read number of cycles
|
||||||
@ -244,6 +251,7 @@ void UEF::find_next_tape_chunk()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
printf("!!! Skipping %04x\n", _chunk_id);
|
||||||
gzseek(_file, _chunk_length, SEEK_CUR);
|
gzseek(_file, _chunk_length, SEEK_CUR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -257,6 +265,7 @@ bool UEF::chunk_is_finished()
|
|||||||
case 0x0100: return (_implicit_data_chunk.position / 10) == _chunk_length;
|
case 0x0100: return (_implicit_data_chunk.position / 10) == _chunk_length;
|
||||||
case 0x0102: return (_explicit_data_chunk.position / 8) == _chunk_length;
|
case 0x0102: return (_explicit_data_chunk.position / 8) == _chunk_length;
|
||||||
case 0x0114:
|
case 0x0114:
|
||||||
|
case 0x0111:
|
||||||
case 0x0110: return _chunk_position == _chunk_duration.length;
|
case 0x0110: return _chunk_position == _chunk_duration.length;
|
||||||
|
|
||||||
case 0x0112:
|
case 0x0112:
|
||||||
@ -310,6 +319,8 @@ bool UEF::get_next_bit()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x0111:
|
||||||
|
|
||||||
case 0x0110:
|
case 0x0110:
|
||||||
_chunk_position++;
|
_chunk_position++;
|
||||||
return true;
|
return true;
|
||||||
|
@ -56,6 +56,10 @@ class UEF : public Tape {
|
|||||||
uint8_t current_byte;
|
uint8_t current_byte;
|
||||||
uint32_t position;
|
uint32_t position;
|
||||||
} _explicit_data_chunk;
|
} _explicit_data_chunk;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
unsigned int pre_length, post_length;
|
||||||
|
} _high_tone_with_dummy;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t _current_byte;
|
uint8_t _current_byte;
|
||||||
|
Loading…
Reference in New Issue
Block a user