blob: a6fb81a64bf2d53ebd4cfe947f2f89b33a352a32 (
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
|
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
#ifndef MAME_BUS_ASTROCDE_CASSETTE_H
#define MAME_BUS_ASTROCDE_CASSETTE_H
#pragma once
#include "ctrl.h"
#include "imagedev/cassette.h"
#include "machine/timer.h"
#include <queue>
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
// ======================> astrocade_cassette_device
class astrocade_cassette_device : public device_t,
public device_astrocade_ctrl_interface
{
public:
static constexpr feature_type imperfect_features() { return feature::TAPE; }
// construction/destruction
astrocade_cassette_device(machine_config const &mconfig, char const *tag, device_t *owner, const XTAL &clock = XTAL());
virtual ~astrocade_cassette_device();
// device_astrocade_ctrl_interface implementation
virtual uint8_t read_handle() override;
virtual uint8_t read_knob() override;
protected:
// device_t implementation
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
TIMER_DEVICE_CALLBACK_MEMBER(check_cassette_wave);
TIMER_DEVICE_CALLBACK_MEMBER(pulse_cassette_clock);
private:
required_device<cassette_image_device> m_cassette;
double m_cass_wave;
double m_cass_delta;
uint32_t m_cass_wave_ticks;
uint32_t m_cass_cycles;
bool m_cass_mark;
std::queue<uint8_t> m_cass_data;
};
/***************************************************************************
DEVICE TYPES
***************************************************************************/
DECLARE_DEVICE_TYPE(ASTROCADE_CASSETTE, astrocade_cassette_device)
#endif // MAME_BUS_ASTROCDE_CASSETTE_H
|