-
Notifications
You must be signed in to change notification settings - Fork 2
/
speccy.h
69 lines (54 loc) · 1.79 KB
/
speccy.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
Portable ZX-Spectrum emulator.
Copyright (C) 2001-2010 SMT, Dexus, Alone Coder, deathsoft, djdron, scor
Copyright (C) 2023 Graham Sanderson
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SPECCY_H__
#define __SPECCY_H__
#include "devices/device.h"
#pragma once
namespace xZ80 { class eZ80; }
class eMemory;
//*****************************************************************************
// eSpeccy
//-----------------------------------------------------------------------------
class eSpeccy
{
public:
eSpeccy();
#ifndef NO_USE_DESTRUCTORS
virtual ~eSpeccy();
#else
~eSpeccy() =delete;
#endif
void Reset();
void Update(int* fetches = NULL);
xZ80::eZ80* CPU() const { return cpu; }
eMemory* Memory() const { return memory; }
eDevices& Devices() { return devices; }
template<class D> D* Device() const { return devices.Get<D>(); }
qword T() const { return t_states; }
#ifndef NO_USE_128K
bool Mode48k() const;
void Mode48k(bool on);
#endif
protected:
xZ80::eZ80* cpu;
eMemory* memory;
eDevices devices;
int frame_tacts; // t-states per frame
int int_len; // length of INT signal (for Z80)
int nmi_pending;
qword t_states;
};
#endif//__SPECCY_H__