blob: f3d4d9b8041a134c6ea1b9fe380301dc2b957906 (
plain) (
blame)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
|
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/*
Manchester Small-Scale Experimental Machine (SSEM) emulator
Written by Ryan Holtz
*/
#ifndef MAME_CPU_SSEM_SSEM_H
#define MAME_CPU_SSEM_SSEM_H
#pragma once
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> ssem_device
// Used by core CPU interface
class ssem_device : public cpu_device
{
public:
// construction/destruction
ssem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
// device-level overrides
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void device_stop() override ATTR_COLD;
// device_execute_interface overrides
virtual uint32_t execute_min_cycles() const noexcept override;
virtual uint32_t execute_max_cycles() const noexcept override;
virtual void execute_run() override;
virtual void execute_set_input(int inputnum, int state) override;
// device_memory_interface overrides
virtual space_config_vector memory_space_config() const override;
// device_disasm_interface overrides
virtual std::unique_ptr<util::disasm_interface> create_disassembler() override;
// device_state_interface overrides
virtual void state_string_export(const device_state_entry &entry, std::string &str) const override;
// address spaces
const address_space_config m_program_config;
// memory access
inline uint32_t program_read32(uint32_t addr);
inline void program_write32(uint32_t addr, uint32_t data);
// CPU registers
uint32_t m_pc;
uint32_t m_shifted_pc;
uint32_t m_a;
uint32_t m_halt;
// other internal states
int m_icount;
// address spaces
address_space *m_program;
};
// device type definition
DECLARE_DEVICE_TYPE(SSEMCPU, ssem_device)
/***************************************************************************
REGISTER ENUMERATION
***************************************************************************/
enum
{
SSEM_PC = 1,
SSEM_A,
SSEM_HALT
};
#endif // MAME_CPU_SSEM_SSEM_H
|