2018-01-08 00:12:52 +00:00
|
|
|
//
|
|
|
|
// DiskROM.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 07/01/2018.
|
2018-05-13 19:19:52 +00:00
|
|
|
// Copyright 2018 Thomas Harte. All rights reserved.
|
2018-01-08 00:12:52 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DiskROM_hpp
|
|
|
|
#define DiskROM_hpp
|
|
|
|
|
2023-01-13 04:01:11 +00:00
|
|
|
#include "MemorySlotHandler.hpp"
|
2018-01-08 00:12:52 +00:00
|
|
|
|
2018-05-12 21:32:53 +00:00
|
|
|
#include "../../Activity/Source.hpp"
|
2018-01-08 00:12:52 +00:00
|
|
|
#include "../../Components/1770/1770.hpp"
|
|
|
|
|
2018-05-12 21:32:53 +00:00
|
|
|
#include <array>
|
2018-01-08 00:12:52 +00:00
|
|
|
#include <cstdint>
|
2018-05-12 21:32:53 +00:00
|
|
|
#include <string>
|
2018-01-08 00:12:52 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace MSX {
|
|
|
|
|
2023-01-13 04:02:24 +00:00
|
|
|
class DiskROM: public MemorySlotHandler, public WD::WD1770 {
|
2018-01-08 00:12:52 +00:00
|
|
|
public:
|
2023-01-13 19:07:54 +00:00
|
|
|
DiskROM(MSX::MemorySlot &slot);
|
2018-01-08 00:12:52 +00:00
|
|
|
|
2020-01-24 03:57:51 +00:00
|
|
|
void write(uint16_t address, uint8_t value, bool pc_is_outside_bios) final;
|
|
|
|
uint8_t read(uint16_t address) final;
|
|
|
|
void run_for(HalfCycles half_cycles) final;
|
2018-01-08 00:12:52 +00:00
|
|
|
|
2018-05-12 21:32:53 +00:00
|
|
|
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, size_t drive);
|
|
|
|
void set_activity_observer(Activity::Observer *observer);
|
2018-01-08 00:12:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const std::vector<uint8_t> &rom_;
|
|
|
|
|
|
|
|
long int controller_cycles_ = 0;
|
|
|
|
|
2020-01-24 03:57:51 +00:00
|
|
|
void set_head_load_request(bool head_load) final;
|
2018-01-08 00:12:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DiskROM_hpp */
|