1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Merge pull request #441 from TomHarte/AppleDSKFixes

Corrects various Apple DSK handling errors.
This commit is contained in:
Thomas Harte 2018-05-13 22:42:21 -04:00 committed by GitHub
commit d2d7ab5d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 11 deletions

View File

@ -368,7 +368,7 @@ class ConcreteMachine:
}
}
keyboard_input_ = static_cast<uint8_t>(value | 0x80);
keyboard_input_ = static_cast<uint8_t>(toupper(value) | 0x80);
}
}

View File

@ -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);

View File

@ -68,7 +68,7 @@ std::shared_ptr<Track> 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 {

View File

@ -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<uint8_t>(
(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<std::size_t>(shift) < rhs.number_of_bits)
data[first_byte + source + 1] = static_cast<uint8_t>(rhs.data[source] << (8-shift));
}
data.back() = static_cast<uint8_t>(rhs.data.back() << (8 - shift));
number_of_bits = target_number_of_bits;
} else {