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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/**********************************************************************
COMX-35 Thermal Printer Card emulation
**********************************************************************/
#include "emu.h"
#include "thermal.h"
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(COMX_THM, comx_thm_device, "comx_thm", "COMX-35 Thermal Printer Card")
//-------------------------------------------------
// ROM( comx_thm )
//-------------------------------------------------
ROM_START( comx_thm )
ROM_REGION( 0x2000, "c000", 0 )
ROM_LOAD( "thermal.bin", 0x0000, 0x1000, CRC(41a72ba8) SHA1(3a8760c78bd8c7bec2dbf26657b930c9a6814803) )
ROM_END
//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------
const tiny_rom_entry *comx_thm_device::device_rom_region() const
{
return ROM_NAME( comx_thm );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// comx_thm_device - constructor
//-------------------------------------------------
comx_thm_device::comx_thm_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock) :
device_t(mconfig, COMX_THM, tag, owner, clock),
device_comx_expansion_card_interface(mconfig, *this),
m_rom(*this, "c000")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void comx_thm_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void comx_thm_device::device_reset()
{
}
//-------------------------------------------------
// comx_mrd_r - memory read
//-------------------------------------------------
uint8_t comx_thm_device::comx_mrd_r(offs_t offset, int *extrom)
{
uint8_t data = 0;
if (offset >= 0xc000 && offset < 0xd000)
{
data = m_rom->base()[offset & 0xfff];
}
return data;
}
//-------------------------------------------------
// comx_io_r - I/O read
//-------------------------------------------------
uint8_t comx_thm_device::comx_io_r(offs_t offset)
{
/*
INP 2 is used for the printer status, where:
b0=1: Printer Not Ready
b1=1: Energizing Head
b2=1: Head At Position 0
*/
return 0;
}
//-------------------------------------------------
// comx_io_w - I/O write
//-------------------------------------------------
void comx_thm_device::comx_io_w(offs_t offset, uint8_t data)
{
/*
OUT 2 is used to control the thermal printer where:
Q = 0, b0-7: Pixel 1 to 8
Q = 1, b7: Pixel 9 (if b0-6=#21)
Q = 1, b3=1: Move head right
Q = 1, b0-7=#12: Move head left
*/
}
|