blob: 9c3b520d915cfb897faf99e880c377c3530946f6 (
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
|
// license:BSD-3-Clause
// copyright-holders:David Haywood
#ifndef MAME_MACHINE_BFM_BD1_H
#define MAME_MACHINE_BFM_BD1_H
#pragma once
class bfm_bd1_device : public device_t
{
public:
bfm_bd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint8_t port_val)
: bfm_bd1_device(mconfig, tag, owner, clock)
{
set_port_val(port_val);
}
bfm_bd1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
void set_port_val(uint8_t val) { m_port_val = val; }
int write_char(int data);
virtual void update_display();
void blank(int data);
void shift_clock(int state);
void setdata(int segdata, int data);
uint16_t set_display(uint16_t segin);
DECLARE_WRITE_LINE_MEMBER( sclk );
DECLARE_WRITE_LINE_MEMBER( data );
DECLARE_WRITE_LINE_MEMBER( por );
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_post_load() override;
private:
static const uint8_t AT_NORMAL = 0x00;
static const uint8_t AT_FLASH = 0x01;
static const uint8_t AT_BLANK = 0x02;
static const uint8_t AT_FLASHED = 0x80; // set when character should be blinked off
std::unique_ptr<output_finder<16> > m_outputs;
uint8_t m_port_val;
int m_cursor_pos = 0;
int m_window_start = 0; // display window start pos 0-15
int m_window_end = 0; // display window end pos 0-15
int m_window_size = 0; // window size
int m_shift_count = 0;
int m_shift_data = 0;
int m_pcursor_pos = 0;
int m_scroll_active = 0;
int m_display_mode = 0;
int m_flash_rate = 0;
int m_flash_control = 0;
int m_sclk = 0;
int m_data = 0;
uint8_t m_cursor = 0;
uint16_t m_chars[16]{};
uint8_t m_attrs[16]{};
uint16_t m_user_data = 0; // user defined character data (16 bit)
uint16_t m_user_def = 0; // user defined character state
};
DECLARE_DEVICE_TYPE(BFM_BD1, bfm_bd1_device)
#endif // MAME_MACHINE_BFM_BD1_H
|