2022-08-22 14:22:19 +00:00
|
|
|
//
|
|
|
|
// SCSICard.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 22/08/2022.
|
|
|
|
// Copyright © 2022 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2024-01-17 04:34:46 +00:00
|
|
|
#pragma once
|
2022-08-22 14:22:19 +00:00
|
|
|
|
|
|
|
#include "Card.hpp"
|
|
|
|
#include "../../ROMMachine.hpp"
|
|
|
|
|
2022-08-22 20:48:51 +00:00
|
|
|
#include "../../../Components/5380/ncr5380.hpp"
|
2022-08-24 19:23:50 +00:00
|
|
|
|
|
|
|
#include "../../../Storage/MassStorage/SCSI/SCSI.hpp"
|
|
|
|
#include "../../../Storage/MassStorage/SCSI/DirectAccessDevice.hpp"
|
2022-08-23 19:11:56 +00:00
|
|
|
#include "../../../Storage/MassStorage/MassStorageDevice.hpp"
|
2022-08-22 20:48:51 +00:00
|
|
|
|
2024-02-15 18:55:46 +00:00
|
|
|
#include "../../../Outputs/Log.hpp"
|
|
|
|
|
2022-08-22 20:48:51 +00:00
|
|
|
#include <array>
|
2022-08-23 19:11:56 +00:00
|
|
|
#include <memory>
|
2022-08-22 20:48:51 +00:00
|
|
|
|
2023-05-10 21:02:18 +00:00
|
|
|
namespace Apple::II {
|
2022-08-22 14:22:19 +00:00
|
|
|
|
|
|
|
class SCSICard: public Card {
|
|
|
|
public:
|
|
|
|
static ROM::Request rom_request();
|
2022-08-30 20:40:25 +00:00
|
|
|
SCSICard(ROM::Map &, int clock_rate);
|
2022-08-22 14:22:19 +00:00
|
|
|
|
|
|
|
void perform_bus_operation(Select select, bool is_read, uint16_t address, uint8_t *value) final;
|
|
|
|
|
2022-08-24 19:23:50 +00:00
|
|
|
void set_storage_device(const std::shared_ptr<Storage::MassStorage::MassStorageDevice> &device);
|
2022-08-23 19:11:56 +00:00
|
|
|
|
2022-08-30 20:40:25 +00:00
|
|
|
void run_for([[maybe_unused]] Cycles cycles, [[maybe_unused]] int stretches) final {
|
|
|
|
scsi_bus_.run_for(cycles);
|
|
|
|
}
|
|
|
|
|
2022-11-16 16:31:10 +00:00
|
|
|
void set_activity_observer(Activity::Observer *observer) final;
|
|
|
|
|
2022-08-22 14:22:19 +00:00
|
|
|
private:
|
2022-08-22 20:48:51 +00:00
|
|
|
uint8_t *ram_pointer_ = nullptr;
|
|
|
|
uint8_t *rom_pointer_ = nullptr;
|
|
|
|
|
|
|
|
std::array<uint8_t, 8*1024> ram_;
|
|
|
|
std::array<uint8_t, 16*1024> rom_;
|
|
|
|
|
|
|
|
SCSI::Bus scsi_bus_;
|
|
|
|
NCR::NCR5380::NCR5380 ncr5380_;
|
2022-08-24 19:23:50 +00:00
|
|
|
SCSI::Target::Target<SCSI::DirectAccessDevice> storage_;
|
2024-02-15 18:55:46 +00:00
|
|
|
Log::Logger<Log::Source::AppleIISCSICard> logger_;
|
2022-08-22 14:22:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|