From 0055efb7205e9685e650a6e721868e6a2636b889 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 13 May 2018 22:29:36 -0400 Subject: [PATCH 1/4] Corrects failure of expression in track size expansion. --- Storage/Disk/DiskImage/Formats/AppleDSK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Storage/Disk/DiskImage/Formats/AppleDSK.cpp b/Storage/Disk/DiskImage/Formats/AppleDSK.cpp index c281c107b..91882590d 100644 --- a/Storage/Disk/DiskImage/Formats/AppleDSK.cpp +++ b/Storage/Disk/DiskImage/Formats/AppleDSK.cpp @@ -68,7 +68,7 @@ std::shared_ptr AppleDSK::get_track_at_position(Track::Address address) { // Pad if necessary. if(segment.number_of_bits < 50000) { - segment += Encodings::AppleGCR::six_and_two_sync((50000 - segment.number_of_bits) >> 3); + segment += Encodings::AppleGCR::six_and_two_sync((50000 - segment.number_of_bits) / 10); } } else { From 7996040f35f381ef738f77cba910434962bba51e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 13 May 2018 22:30:44 -0400 Subject: [PATCH 2/4] Rejigs segment conjugation to avoid potential accidental empty byte. --- Storage/Disk/Track/PCMSegment.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Storage/Disk/Track/PCMSegment.cpp b/Storage/Disk/Track/PCMSegment.cpp index 5433df568..2a4af08aa 100644 --- a/Storage/Disk/Track/PCMSegment.cpp +++ b/Storage/Disk/Track/PCMSegment.cpp @@ -53,15 +53,11 @@ PCMSegment &PCMSegment::operator +=(const PCMSegment &rhs) { std::size_t first_byte = number_of_bits >> 3; int shift = number_of_bits&7; - data[first_byte] |= rhs.data[0] >> shift; - for(std::size_t target = first_byte+1; target < (data.size()-1); ++target) { - data[target] = - static_cast( - (rhs.data[target - first_byte - 1] << (8 - shift)) | - (rhs.data[target - first_byte] >> shift) - ); + for(std::size_t source = 0; source < rhs.data.size(); ++source) { + data[first_byte + source] |= rhs.data[source] >> shift; + if(source*8 + static_cast(shift) < rhs.number_of_bits) + data[first_byte + source + 1] = static_cast(rhs.data[source] << (8-shift)); } - data.back() = static_cast(rhs.data.back() << (8 - shift)); number_of_bits = target_number_of_bits; } else { From 4dbd1f13587ea6d7c58d01a89094fc5057e08b04 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 13 May 2018 22:36:02 -0400 Subject: [PATCH 3/4] Corrects Disk II ROM visibility. --- Machines/AppleII/DiskIICard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/AppleII/DiskIICard.cpp b/Machines/AppleII/DiskIICard.cpp index a16afc3ad..e1447d6cc 100644 --- a/Machines/AppleII/DiskIICard.cpp +++ b/Machines/AppleII/DiskIICard.cpp @@ -23,7 +23,7 @@ DiskIICard::DiskIICard(const ROMMachine::ROMFetcher &rom_fetcher, bool is_16_sec void DiskIICard::perform_bus_operation(CPU::MOS6502::BusOperation operation, uint16_t address, uint8_t *value) { if(address < 0x100) { - if(isReadOperation(operation)) *value &= boot_[address]; + if(isReadOperation(operation)) *value = boot_[address]; } else { if(isReadOperation(operation)) { *value = diskii_.get_register(address); From 5107c7c23dc7b1682cbd0fc5fe2aadc806ceac9a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 13 May 2018 22:40:28 -0400 Subject: [PATCH 4/4] Ensures all keypresses are entered as upper case. --- Machines/AppleII/AppleII.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/AppleII/AppleII.cpp b/Machines/AppleII/AppleII.cpp index 7529c74f5..eddc22d6d 100644 --- a/Machines/AppleII/AppleII.cpp +++ b/Machines/AppleII/AppleII.cpp @@ -368,7 +368,7 @@ class ConcreteMachine: } } - keyboard_input_ = static_cast(value | 0x80); + keyboard_input_ = static_cast(toupper(value) | 0x80); } }