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

Merge branch 'master' into LockFreeQueue

This commit is contained in:
Thomas Harte 2020-07-24 22:29:45 -04:00
commit f9f500c194
6 changed files with 17 additions and 11 deletions

View File

@ -316,6 +316,8 @@ void z8530::Channel::write(bool data, uint8_t pointer, uint8_t value) {
}
LOG("Receive bit count: " << receive_bit_count);
(void)receive_bit_count;
/*
b7,b6:
00 = 5 receive bits per character

View File

@ -1,6 +1,9 @@
QT += core gui multimedia widgets
# Be specific about C++17 but also try the vaguer C++1z for older
# versions of Qt.
CONFIG += c++17
CONFIG += c++1z
# Permit multiple source files in different directories to have the same file name.
CONFIG += object_parallel_to_source

View File

@ -1,19 +1,19 @@
import glob
import sys
# establish UTF-8 encoding for Python 2
# Establish UTF-8 encoding for Python 2.
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf-8')
# create build environment
# Create build environment.
env = Environment()
# determine compiler and linker flags for SDL
# Determine compiler and linker flags for SDL.
env.ParseConfig('sdl2-config --cflags')
env.ParseConfig('sdl2-config --libs')
# gather a list of source files
# Gather a list of source files.
SOURCES = glob.glob('*.cpp')
SOURCES += glob.glob('../../Analyser/Dynamic/*.cpp')
@ -118,11 +118,11 @@ SOURCES += glob.glob('../../Storage/Tape/*.cpp')
SOURCES += glob.glob('../../Storage/Tape/Formats/*.cpp')
SOURCES += glob.glob('../../Storage/Tape/Parsers/*.cpp')
# add additional compiler flags
env.Append(CCFLAGS = ['--std=c++17', '-Wall', '-O2', '-DNDEBUG'])
# Add additional compiler flags; c++1z is insurance in case c++17 isn't fully implemented.
env.Append(CCFLAGS = ['--std=c++17', '--std=c++1z', '-Wall', '-O2', '-DNDEBUG'])
# add additional libraries to link against
# Add additional libraries to link against.
env.Append(LIBS = ['libz', 'pthread', 'GL'])
# build target
# Build target.
env.Program(target = 'clksignal', source = SOURCES)

View File

@ -166,6 +166,7 @@ std::shared_ptr<Track> WOZ::get_track_at_position(Track::Address address) {
number_of_bits = std::min(file_.get16le(), uint16_t(6646*8));
break;
default:
case Type::WOZ2: {
// In WOZ 2 an extra level of indirection allows for variable track sizes.
const uint16_t starting_block = file_.get16le();

View File

@ -247,10 +247,10 @@ void TZX::get_data_block(const DataBlock &data_block) {
void TZX::get_data(const Data &data) {
// Output data.
for(unsigned int c = 0; c < data.data_length; c++) {
for(decltype(data.data_length) c = 0; c < data.data_length; c++) {
uint8_t next_byte = file_.get8();
unsigned int bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
auto bits = (c != data.data_length-1) ? 8 : data.number_of_bits_in_final_byte;
while(bits--) {
unsigned int pulse_length = (next_byte & 0x80) ? data.length_of_one_bit_pulse : data.length_of_zero_bit_pulse;
next_byte <<= 1;

View File

@ -77,7 +77,7 @@ class TZX: public PulseQueuedTape {
unsigned int length_of_one_bit_pulse;
unsigned int number_of_bits_in_final_byte;
unsigned int pause_after_block;
long data_length;
uint32_t data_length;
};
struct DataBlock {