2018-01-08 00:12:52 +00:00
|
|
|
//
|
|
|
|
// DiskROM.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 07/01/2018.
|
|
|
|
// Copyright © 2018 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DiskROM_hpp
|
|
|
|
#define DiskROM_hpp
|
|
|
|
|
|
|
|
#include "ROMSlotHandler.hpp"
|
|
|
|
|
|
|
|
#include "../../Components/1770/1770.hpp"
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#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;
|
|
|
|
|
|
|
|
void set_disk(std::shared_ptr<Storage::Disk::Disk> disk, int drive);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const std::vector<uint8_t> &rom_;
|
|
|
|
|
|
|
|
long int controller_cycles_ = 0;
|
|
|
|
int selected_drive_ = 0;
|
|
|
|
int selected_head_ = 0;
|
|
|
|
std::shared_ptr<Storage::Disk::Drive> drives_[4];
|
|
|
|
|
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 */
|