-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice.h
31 lines (22 loc) · 976 Bytes
/
device.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include "cpu.h"
#include "ResponseRange.h"
#include <list>
class Device {
public:
Device();
~Device();
virtual bool Refresh(word32 timestamp) = 0;
virtual bool GetInitOk();
virtual bool TryReadByte(word32 address, word32 timestamp, word32 emulFlags, byte &b);
virtual bool TryWriteByte(word32 address, word32 timestamp, byte b);
ResponseRange* AddResponseRange(word32 start, word32 end, byte rw_mask);
ResponseRange* AddResponseRange(word32 start, word32 end, byte rw_mask, ResponseRange::ReadCallback read_callback, ResponseRange::WriteCallback write_callback);
protected:
virtual bool _InternalReadByte(word32 address, word32 timestamp, word32 emulFlags, ResponseRange* triggered_range, byte& b) = 0;
virtual bool _InternalWriteByte(word32 address, word32 timestamp, ResponseRange* triggered_range, byte b) = 0;
std::list<ResponseRange*> *_ResponseRanges;
bool _InitOk;
private:
ResponseRange* _MatchRange(word32 address, bool write);
};