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
|
// license:GPL-2.0+
// copyright-holders:Kevin Thacker
/*****************************************************************************
*
* includes/spec128.h
*
****************************************************************************/
#ifndef MAME_INCLUDES_SPEC128_H
#define MAME_INCLUDES_SPEC128_H
#pragma once
#include "spectrum.h"
class spectrum_128_state : public spectrum_state
{
public:
spectrum_128_state(const machine_config &mconfig, device_type type, const char *tag) :
spectrum_state(mconfig, type, tag),
m_bank_rom(*this, "bank_rom%u", 0U),
m_bank_ram(*this, "bank_ram%u", 0U)
{ }
void spectrum_128(machine_config &config);
protected:
memory_bank_array_creator<1> m_bank_rom;
memory_bank_array_creator<4> m_bank_ram;
virtual void video_start() override;
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void spectrum_128_update_memory() override;
virtual rectangle get_screen_area() override;
virtual bool is_contended(offs_t offset) override;
virtual bool is_vram_write(offs_t offset) override;
template <u8 Bank>
void spectrum_128_ram_w(offs_t offset, u8 data);
template <u8 Bank>
u8 spectrum_128_ram_r(offs_t offset);
private:
u8 spectrum_128_pre_opcode_fetch_r(offs_t offset);
void spectrum_128_rom_w(offs_t offset, u8 data);
u8 spectrum_128_rom_r(offs_t offset);
void spectrum_128_port_7ffd_w(offs_t offset, u8 data);
virtual uint8_t spectrum_port_r(offs_t offset) override;
//uint8_t spectrum_128_ula_r();
void spectrum_128_io(address_map &map);
void spectrum_128_mem(address_map &map);
void spectrum_128_fetch(address_map &map);
};
#define X1_128_AMSTRAD 35'469'000 // Main clock (Amstrad 128K model, +2A?)
#define X1_128_SINCLAIR 35.469_MHz_XTAL // Main clock (Sinclair 128K model)
/* 128K machines take an extra 4 cycles per scan line - add this to retrace */
#define SPEC128_UNSEEN_LINES 15
#define SPEC128_RETRACE_CYCLES 52
#define SPEC128_CYCLES_PER_LINE 228
#endif // MAME_INCLUDES_SPEC128_H
|