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
|
|
|
|
|
|
|
|
#include "ROMSlotHandler.hpp"
|
|
|
|
|
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 {
|
|
|
|
|
|
|
|
class DiskROM: public ROMSlotHandler, public WD::WD1770 {
|
|
|
|
public:
|
|
|
|
DiskROM(const std::vector<uint8_t> &rom);
|
|
|
|
|
2018-02-10 22:11:16 +00:00
|
|
|
void write(uint16_t address, uint8_t value, bool pc_is_outside_bios) override;
|
2018-01-08 00:12:52 +00:00
|
|
|
uint8_t read(uint16_t address) override;
|
|
|
|
void run_for(HalfCycles half_cycles) override;
|
|
|
|
|
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;
|
2018-05-12 21:32:53 +00:00
|
|
|
size_t selected_drive_ = 0;
|
2018-01-08 00:12:52 +00:00
|
|
|
int selected_head_ = 0;
|
2018-05-12 21:32:53 +00:00
|
|
|
std::array<std::shared_ptr<Storage::Disk::Drive>, 2> drives_;
|
2018-01-08 00:12:52 +00:00
|
|
|
|
2018-01-08 02:59:59 +00:00
|
|
|
void set_head_load_request(bool head_load) override;
|
2018-01-08 00:12:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DiskROM_hpp */
|