Previous 15994 Revisions Next

r15242 Sunday 20th May, 2012 at 11:20:25 UTC by Sandro Ronco
tvc: added BASIC v2.1 and fixed svn properties. (nw)
[src/mess/drivers]tvc.c
[src/mess/machine]tvc_hbf.c tvc_hbf.h tvcexp.c tvcexp.h

src/mess/machine/tvcexp.c
r15241r15242
1/*********************************************************************
2 
3    tvcexp.c
4 
5*********************************************************************/
6 
7#include "emu.h"
8#include "tvcexp.h"
9#include "emuopts.h"
10 
11 
12/***************************************************************************
13    PARAMETERS
14***************************************************************************/
15 
16//**************************************************************************
17//  GLOBAL VARIABLES
18//**************************************************************************
19 
20const device_type TVCEXP_SLOT  = &device_creator<tvcexp_slot_device>;
21 
22 
23//**************************************************************************
24//    TVC Expansion Interface
25//**************************************************************************
26 
27//-------------------------------------------------
28//  device_tvcexp_interface - constructor
29//-------------------------------------------------
30 
31device_tvcexp_interface::device_tvcexp_interface(const machine_config &mconfig, device_t &device)
32   : device_slot_card_interface(mconfig, device)
33{
34}
35 
36 
37//-------------------------------------------------
38//  ~device_tvcexp_interface - destructor
39//-------------------------------------------------
40 
41device_tvcexp_interface::~device_tvcexp_interface()
42{
43}
44 
45 
46//**************************************************************************
47//  LIVE DEVICE
48//**************************************************************************
49 
50//-------------------------------------------------
51//  tvcexp_slot_device - constructor
52//-------------------------------------------------
53tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
54        device_t(mconfig, TVCEXP_SLOT, "TVC64 Expansion Slot", tag, owner, clock),
55      device_slot_interface(mconfig, *this)
56{
57}
58 
59//-------------------------------------------------
60//  tvcexp_slot_device - destructor
61//-------------------------------------------------
62 
63tvcexp_slot_device::~tvcexp_slot_device()
64{
65}
66 
67//-------------------------------------------------
68//  device_start - device-specific startup
69//-------------------------------------------------
70 
71void tvcexp_slot_device::device_start()
72{
73   m_cart = dynamic_cast<device_tvcexp_interface *>(get_card_device());
74 
75   // resolve callbacks
76   m_out_irq_func.resolve(m_out_irq_cb, *this);
77   m_out_nmi_func.resolve(m_out_nmi_cb, *this);
78}
79 
80//-------------------------------------------------
81//  device_config_complete - perform any
82//  operations now that the configuration is
83//  complete
84//-------------------------------------------------
85 
86void tvcexp_slot_device::device_config_complete()
87{
88   // inherit a copy of the static data
89   const tvcexp_interface *intf = reinterpret_cast<const tvcexp_interface *>(static_config());
90   if (intf != NULL)
91   {
92      *static_cast<tvcexp_interface *>(this) = *intf;
93   }
94 
95   // or initialize to defaults if none provided
96   else
97   {
98       memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
99       memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
100   }
101}
102 
103 
104/*-------------------------------------------------
105    module id read
106-------------------------------------------------*/
107 
108UINT8 tvcexp_slot_device::id_r()
109{
110   UINT8 result = 0x00;
111 
112   if (m_cart)
113      result = m_cart->id_r() & 0x03;
114 
115   return result;
116}
117 
118/*-------------------------------------------------
119    module interrupt ack
120-------------------------------------------------*/
121 
122void tvcexp_slot_device::int_ack()
123{
124   if (m_cart)
125      m_cart->int_ack();
126}
127 
128/*-------------------------------------------------
129    module int read
130-------------------------------------------------*/
131 
132UINT8 tvcexp_slot_device::int_r()
133{
134   UINT8 result = 1;
135 
136   if (m_cart)
137      result = m_cart->int_r() & 0x01;
138 
139   return result;
140}
141 
142 
143/*-------------------------------------------------
144    read
145-------------------------------------------------*/
146 
147READ8_MEMBER(tvcexp_slot_device::read)
148{
149   if (m_cart)
150      return m_cart->read(space, offset);
151   else
152      return 0x00;
153}
154 
155 
156/*-------------------------------------------------
157    write
158-------------------------------------------------*/
159 
160WRITE8_MEMBER(tvcexp_slot_device::write)
161{
162   if (m_cart)
163      m_cart->write(space, offset, data);
164}
165 
166/*-------------------------------------------------
167    IO read
168-------------------------------------------------*/
169 
170READ8_MEMBER(tvcexp_slot_device::io_read)
171{
172   if (m_cart)
173      return m_cart->io_read(space, offset);
174   else
175      return 0x00;
176}
177 
178 
179/*-------------------------------------------------
180   IO write
181-------------------------------------------------*/
182 
183WRITE8_MEMBER(tvcexp_slot_device::io_write)
184{
185   if (m_cart)
186      m_cart->io_write(space, offset, data);
187}
1/*********************************************************************
2
3    tvcexp.c
4
5*********************************************************************/
6
7#include "emu.h"
8#include "tvcexp.h"
9#include "emuopts.h"
10
11
12/***************************************************************************
13    PARAMETERS
14***************************************************************************/
15
16//**************************************************************************
17//  GLOBAL VARIABLES
18//**************************************************************************
19
20const device_type TVCEXP_SLOT  = &device_creator<tvcexp_slot_device>;
21
22
23//**************************************************************************
24//    TVC Expansion Interface
25//**************************************************************************
26
27//-------------------------------------------------
28//  device_tvcexp_interface - constructor
29//-------------------------------------------------
30
31device_tvcexp_interface::device_tvcexp_interface(const machine_config &mconfig, device_t &device)
32   : device_slot_card_interface(mconfig, device)
33{
34}
35
36
37//-------------------------------------------------
38//  ~device_tvcexp_interface - destructor
39//-------------------------------------------------
40
41device_tvcexp_interface::~device_tvcexp_interface()
42{
43}
44
45
46//**************************************************************************
47//  LIVE DEVICE
48//**************************************************************************
49
50//-------------------------------------------------
51//  tvcexp_slot_device - constructor
52//-------------------------------------------------
53tvcexp_slot_device::tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
54        device_t(mconfig, TVCEXP_SLOT, "TVC64 Expansion Slot", tag, owner, clock),
55      device_slot_interface(mconfig, *this)
56{
57}
58
59//-------------------------------------------------
60//  tvcexp_slot_device - destructor
61//-------------------------------------------------
62
63tvcexp_slot_device::~tvcexp_slot_device()
64{
65}
66
67//-------------------------------------------------
68//  device_start - device-specific startup
69//-------------------------------------------------
70
71void tvcexp_slot_device::device_start()
72{
73   m_cart = dynamic_cast<device_tvcexp_interface *>(get_card_device());
74
75   // resolve callbacks
76   m_out_irq_func.resolve(m_out_irq_cb, *this);
77   m_out_nmi_func.resolve(m_out_nmi_cb, *this);
78}
79
80//-------------------------------------------------
81//  device_config_complete - perform any
82//  operations now that the configuration is
83//  complete
84//-------------------------------------------------
85
86void tvcexp_slot_device::device_config_complete()
87{
88   // inherit a copy of the static data
89   const tvcexp_interface *intf = reinterpret_cast<const tvcexp_interface *>(static_config());
90   if (intf != NULL)
91   {
92      *static_cast<tvcexp_interface *>(this) = *intf;
93   }
94
95   // or initialize to defaults if none provided
96   else
97   {
98       memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
99       memset(&m_out_nmi_cb, 0, sizeof(m_out_nmi_cb));
100   }
101}
102
103
104/*-------------------------------------------------
105    module id read
106-------------------------------------------------*/
107
108UINT8 tvcexp_slot_device::id_r()
109{
110   UINT8 result = 0x00;
111
112   if (m_cart)
113      result = m_cart->id_r() & 0x03;
114
115   return result;
116}
117
118/*-------------------------------------------------
119    module interrupt ack
120-------------------------------------------------*/
121
122void tvcexp_slot_device::int_ack()
123{
124   if (m_cart)
125      m_cart->int_ack();
126}
127
128/*-------------------------------------------------
129    module int read
130-------------------------------------------------*/
131
132UINT8 tvcexp_slot_device::int_r()
133{
134   UINT8 result = 1;
135
136   if (m_cart)
137      result = m_cart->int_r() & 0x01;
138
139   return result;
140}
141
142
143/*-------------------------------------------------
144    read
145-------------------------------------------------*/
146
147READ8_MEMBER(tvcexp_slot_device::read)
148{
149   if (m_cart)
150      return m_cart->read(space, offset);
151   else
152      return 0x00;
153}
154
155
156/*-------------------------------------------------
157    write
158-------------------------------------------------*/
159
160WRITE8_MEMBER(tvcexp_slot_device::write)
161{
162   if (m_cart)
163      m_cart->write(space, offset, data);
164}
165
166/*-------------------------------------------------
167    IO read
168-------------------------------------------------*/
169
170READ8_MEMBER(tvcexp_slot_device::io_read)
171{
172   if (m_cart)
173      return m_cart->io_read(space, offset);
174   else
175      return 0x00;
176}
177
178
179/*-------------------------------------------------
180   IO write
181-------------------------------------------------*/
182
183WRITE8_MEMBER(tvcexp_slot_device::io_write)
184{
185   if (m_cart)
186      m_cart->io_write(space, offset, data);
187}
src/mess/machine/tvc_hbf.c
r15241r15242
1/***************************************************************************
2 
3    tvc_hbf.c
4 
5***************************************************************************/
6 
7#include "emu.h"
8#include "tvc_hbf.h"
9 
10 
11/***************************************************************************
12    IMPLEMENTATION
13***************************************************************************/
14 
15static LEGACY_FLOPPY_OPTIONS_START(tvc_hbf)
16   LEGACY_FLOPPY_OPTION(tvc_hbf, "img,dsk", "TVC DS disk image (720KB)", basicdsk_identify_default, basicdsk_construct_default, NULL,
17      HEADS([2])
18      TRACKS([80])
19      SECTORS([9])
20      SECTOR_LENGTH([512])
21      FIRST_SECTOR_ID([1]))
22   LEGACY_FLOPPY_OPTION(tvc_hbf, "img,dsk", "TVC SS disk image (360KB)", basicdsk_identify_default, basicdsk_construct_default, NULL,
23      HEADS([1])
24      TRACKS([80])
25      SECTORS([9])
26      SECTOR_LENGTH([512])
27      FIRST_SECTOR_ID([1]))
28LEGACY_FLOPPY_OPTIONS_END
29 
30static const floppy_interface tvc_hbf_floppy_interface =
31{
32   DEVCB_NULL,
33   DEVCB_NULL,
34   DEVCB_NULL,
35   DEVCB_NULL,
36   DEVCB_NULL,
37   FLOPPY_STANDARD_5_25_DSDD,
38   LEGACY_FLOPPY_OPTIONS_NAME(tvc_hbf),
39   "floppy_5_25",
40   NULL
41};
42 
43static MACHINE_CONFIG_FRAGMENT(tvc_hbf)
44   MCFG_FD1793_ADD("fdc", default_wd17xx_interface_2_drives)
45   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tvc_hbf_floppy_interface)
46MACHINE_CONFIG_END
47 
48 
49ROM_START( tvc_hbf )
50   ROM_REGION(0x4000, "hbf", 0)
51   // UPM version
52   ROM_LOAD_OPTIONAL("d_tvcupm.128",   0x0000, 0x4000, CRC(b3a567ad) SHA1(f92df6074b07f5f19e8c96ff1315da0cfeec9f74))
53 
54   // VT-DOS v1.1 version
55   ROM_LOAD_OPTIONAL("d_tvcdos.128",   0x0000, 0x4000, CRC(2acf8477) SHA1(07bf39b633a564f98dd4b2e93bd889501b341550))
56 
57   // VT-DOS v1.2 version
58   ROM_LOAD_OPTIONAL("d_dos12.128",   0x0000, 0x4000, CRC(f5c35597) SHA1(2fa44ad089a51f453b580e0b13e3be96a0f14649))
59 
60   // Standalone version for use with BASIC
61   ROM_LOAD_OPTIONAL("hbf.rom",       0x0000, 0x4000, CRC(ae34982b) SHA1(96c4154c04086c537ae1272fe051a256d2f5be3f))
62 
63   ROM_REGION(0x1000, "ram", ROMREGION_ERASE)
64ROM_END
65 
66 
67//**************************************************************************
68//  GLOBAL VARIABLES
69//**************************************************************************
70 
71const device_type TVC_HBF = &device_creator<tvc_hbf_device>;
72 
73//**************************************************************************
74//  LIVE DEVICE
75//**************************************************************************
76 
77//-------------------------------------------------
78//  tvc_hbf_device - constructor
79//-------------------------------------------------
80 
81tvc_hbf_device::tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
82      : device_t(mconfig, TVC_HBF, "HBF floppy interface", tag, owner, clock),
83      device_tvcexp_interface( mconfig, *this ),
84      m_fdc(*this, "fdc")
85{
86}
87 
88 
89//-------------------------------------------------
90//  device_start - device-specific startup
91//-------------------------------------------------
92 
93void tvc_hbf_device::device_start()
94{
95   m_rom = memregion("hbf")->base();
96   m_ram = memregion("ram")->base();
97}
98 
99//-------------------------------------------------
100//  device_reset - device-specific reset
101//-------------------------------------------------
102 
103void tvc_hbf_device::device_reset()
104{
105   m_rom_bank = 0;
106}
107 
108//-------------------------------------------------
109//  device_mconfig_additions
110//-------------------------------------------------
111 
112machine_config_constructor tvc_hbf_device::device_mconfig_additions() const
113{
114   return MACHINE_CONFIG_NAME( tvc_hbf );
115}
116 
117//-------------------------------------------------
118//  device_rom_region
119//-------------------------------------------------
120 
121const rom_entry *tvc_hbf_device::device_rom_region() const
122{
123   return ROM_NAME( tvc_hbf );
124}
125 
126/*-------------------------------------------------
127    read
128-------------------------------------------------*/
129READ8_MEMBER(tvc_hbf_device::read)
130{
131   if (offset>=0x1000)
132      return m_ram[offset& 0x0fff];
133   else
134      return m_rom[(m_rom_bank<<12) + (offset & 0x0fff)];
135}
136 
137//-------------------------------------------------
138//  write
139//-------------------------------------------------
140 
141WRITE8_MEMBER(tvc_hbf_device::write)
142{
143   if (offset>=0x1000)
144      m_ram[offset & 0x0fff] = data;
145   else
146      logerror("'%s': unmapped write to %04x %02x\n", tag(), offset, data);
147}
148 
149 
150//-------------------------------------------------
151//  IO read
152//-------------------------------------------------
153 
154READ8_MEMBER(tvc_hbf_device::io_read)
155{
156   switch((offset>>2) & 0x03)
157   {
158      case 0x00:
159         return wd17xx_r(m_fdc, offset & 3);
160      case 0x01:
161         return (wd17xx_drq_r(m_fdc)<<7) | wd17xx_intrq_r(m_fdc);
162      default:
163         return 0x00;
164   }
165}
166 
167//-------------------------------------------------
168//  IO write
169//-------------------------------------------------
170 
171WRITE8_MEMBER(tvc_hbf_device::io_write)
172{
173   switch((offset>>2) & 0x03)
174   {
175      case 0x00:
176         wd17xx_w(m_fdc, offset & 3, data);
177         break;
178      case 0x01:
179         // bit 0-3   drive select
180         // bit 5     DDEN
181         // bit 6     floppy motor
182         // bit 7     side select
183         if (BIT(data, 0))
184            wd17xx_set_drive(m_fdc, 0);
185         else if (BIT(data, 1))
186            wd17xx_set_drive(m_fdc, 1);
187         wd17xx_dden_w(m_fdc, BIT(data, 5));
188         floppy_mon_w(subdevice(FLOPPY_0), !BIT(data, 6));
189         floppy_mon_w(subdevice(FLOPPY_1), !BIT(data, 6));
190         wd17xx_set_side(m_fdc, BIT(data, 7));
191         break;
192      case 0x02:
193         m_rom_bank = (data>>4) & 0x03;
194         break;
195   }
196}
1/***************************************************************************
2
3    tvc_hbf.c
4
5***************************************************************************/
6
7#include "emu.h"
8#include "tvc_hbf.h"
9
10
11/***************************************************************************
12    IMPLEMENTATION
13***************************************************************************/
14
15static LEGACY_FLOPPY_OPTIONS_START(tvc_hbf)
16   LEGACY_FLOPPY_OPTION(tvc_hbf, "img,dsk", "TVC DS disk image (720KB)", basicdsk_identify_default, basicdsk_construct_default, NULL,
17      HEADS([2])
18      TRACKS([80])
19      SECTORS([9])
20      SECTOR_LENGTH([512])
21      FIRST_SECTOR_ID([1]))
22   LEGACY_FLOPPY_OPTION(tvc_hbf, "img,dsk", "TVC SS disk image (360KB)", basicdsk_identify_default, basicdsk_construct_default, NULL,
23      HEADS([1])
24      TRACKS([80])
25      SECTORS([9])
26      SECTOR_LENGTH([512])
27      FIRST_SECTOR_ID([1]))
28LEGACY_FLOPPY_OPTIONS_END
29
30static const floppy_interface tvc_hbf_floppy_interface =
31{
32   DEVCB_NULL,
33   DEVCB_NULL,
34   DEVCB_NULL,
35   DEVCB_NULL,
36   DEVCB_NULL,
37   FLOPPY_STANDARD_5_25_DSDD,
38   LEGACY_FLOPPY_OPTIONS_NAME(tvc_hbf),
39   "floppy_5_25",
40   NULL
41};
42
43static MACHINE_CONFIG_FRAGMENT(tvc_hbf)
44   MCFG_FD1793_ADD("fdc", default_wd17xx_interface_2_drives)
45   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tvc_hbf_floppy_interface)
46MACHINE_CONFIG_END
47
48
49ROM_START( tvc_hbf )
50   ROM_REGION(0x4000, "hbf", 0)
51   // UPM version
52   ROM_LOAD_OPTIONAL("d_tvcupm.128",   0x0000, 0x4000, CRC(b3a567ad) SHA1(f92df6074b07f5f19e8c96ff1315da0cfeec9f74))
53
54   // VT-DOS v1.1 version
55   ROM_LOAD_OPTIONAL("d_tvcdos.128",   0x0000, 0x4000, CRC(2acf8477) SHA1(07bf39b633a564f98dd4b2e93bd889501b341550))
56
57   // VT-DOS v1.2 version
58   ROM_LOAD_OPTIONAL("d_dos12.128",   0x0000, 0x4000, CRC(f5c35597) SHA1(2fa44ad089a51f453b580e0b13e3be96a0f14649))
59
60   // Standalone version for use with BASIC
61   ROM_LOAD_OPTIONAL("hbf.rom",       0x0000, 0x4000, CRC(ae34982b) SHA1(96c4154c04086c537ae1272fe051a256d2f5be3f))
62
63   ROM_REGION(0x1000, "ram", ROMREGION_ERASE)
64ROM_END
65
66
67//**************************************************************************
68//  GLOBAL VARIABLES
69//**************************************************************************
70
71const device_type TVC_HBF = &device_creator<tvc_hbf_device>;
72
73//**************************************************************************
74//  LIVE DEVICE
75//**************************************************************************
76
77//-------------------------------------------------
78//  tvc_hbf_device - constructor
79//-------------------------------------------------
80
81tvc_hbf_device::tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
82      : device_t(mconfig, TVC_HBF, "HBF floppy interface", tag, owner, clock),
83      device_tvcexp_interface( mconfig, *this ),
84      m_fdc(*this, "fdc")
85{
86}
87
88
89//-------------------------------------------------
90//  device_start - device-specific startup
91//-------------------------------------------------
92
93void tvc_hbf_device::device_start()
94{
95   m_rom = memregion("hbf")->base();
96   m_ram = memregion("ram")->base();
97}
98
99//-------------------------------------------------
100//  device_reset - device-specific reset
101//-------------------------------------------------
102
103void tvc_hbf_device::device_reset()
104{
105   m_rom_bank = 0;
106}
107
108//-------------------------------------------------
109//  device_mconfig_additions
110//-------------------------------------------------
111
112machine_config_constructor tvc_hbf_device::device_mconfig_additions() const
113{
114   return MACHINE_CONFIG_NAME( tvc_hbf );
115}
116
117//-------------------------------------------------
118//  device_rom_region
119//-------------------------------------------------
120
121const rom_entry *tvc_hbf_device::device_rom_region() const
122{
123   return ROM_NAME( tvc_hbf );
124}
125
126/*-------------------------------------------------
127    read
128-------------------------------------------------*/
129READ8_MEMBER(tvc_hbf_device::read)
130{
131   if (offset>=0x1000)
132      return m_ram[offset& 0x0fff];
133   else
134      return m_rom[(m_rom_bank<<12) + (offset & 0x0fff)];
135}
136
137//-------------------------------------------------
138//  write
139//-------------------------------------------------
140
141WRITE8_MEMBER(tvc_hbf_device::write)
142{
143   if (offset>=0x1000)
144      m_ram[offset & 0x0fff] = data;
145   else
146      logerror("'%s': unmapped write to %04x %02x\n", tag(), offset, data);
147}
148
149
150//-------------------------------------------------
151//  IO read
152//-------------------------------------------------
153
154READ8_MEMBER(tvc_hbf_device::io_read)
155{
156   switch((offset>>2) & 0x03)
157   {
158      case 0x00:
159         return wd17xx_r(m_fdc, offset & 3);
160      case 0x01:
161         return (wd17xx_drq_r(m_fdc)<<7) | wd17xx_intrq_r(m_fdc);
162      default:
163         return 0x00;
164   }
165}
166
167//-------------------------------------------------
168//  IO write
169//-------------------------------------------------
170
171WRITE8_MEMBER(tvc_hbf_device::io_write)
172{
173   switch((offset>>2) & 0x03)
174   {
175      case 0x00:
176         wd17xx_w(m_fdc, offset & 3, data);
177         break;
178      case 0x01:
179         // bit 0-3   drive select
180         // bit 5     DDEN
181         // bit 6     floppy motor
182         // bit 7     side select
183         if (BIT(data, 0))
184            wd17xx_set_drive(m_fdc, 0);
185         else if (BIT(data, 1))
186            wd17xx_set_drive(m_fdc, 1);
187         wd17xx_dden_w(m_fdc, BIT(data, 5));
188         floppy_mon_w(subdevice(FLOPPY_0), !BIT(data, 6));
189         floppy_mon_w(subdevice(FLOPPY_1), !BIT(data, 6));
190         wd17xx_set_side(m_fdc, BIT(data, 7));
191         break;
192      case 0x02:
193         m_rom_bank = (data>>4) & 0x03;
194         break;
195   }
196}
src/mess/machine/tvcexp.h
r15241r15242
1/*********************************************************************
2 
3    tvcexp.h
4 
5**********************************************************************
6 
7                   +----------+
8          GND      | A01  B01 |       GND
9          +5V      | A02  B02 |       +5V
10         +12V      | A03  B03 |       +12V
11         -12V      | A04  B04 |       -12V
12         N.C.      | A05  B05 |       N.C.
13         N.C.      | A06  B06 |       /HSYNC
14    3.125 CLK      | A07  B07 |       /VSYNC
15          DMA      | A08  B08 |       BORDER
16         LPEN      | A09  B09 |       N.C.
17          DEB      | A10  B10 |       MUX
18    6.25 CLK       | A11  B11 |       A3
19          A1       | A12  B12 |       EC3
20         EC0       | A13  B13 |       EC1
21       /EXTC       | A14  B14 |       EC2
22    /PHANTOM       | A15  B15 |       TXRXCLK
23        N.C.       | A16  B16 |       SOUND
24         BD0       | A17  B17 |       N.C.
25         BD1       | A18  B18 |       N.C.
26         BD2       | A19  B19 |       N.C.
27         BD3       | A20  B20 |       N.C.
28         BD4       | A21  B21 |       N.C.
29         BD5       | A22  B22 |       N.C.
30         BD6       | A23  B23 |       N.C.
31         BD7       | A24  B24 |       A15
32         A17       | A25  B25 |       A5
33          A8       | A26  B26 |       A12
34          A7       | A27  B27 |       A6
35          A9       | A28  B28 |       A11
36          A4       | A29  B29 |       A10
37         A13       | A30  B30 |       A2
38     /VIDLSB       | A31  B31 |       A0
39        /EXP       | A32  B32 |       P3
40        N.C.       | A33  B33 |       /BUSRQ
41         /P2       | A34  B34 |       N.C.
42     /CLRINT       | A35  B35 |       RESET
43         IDA       | A36  B36 |       /NMI
44        /INT       | A37  B37 |       /WAIT
45         IDB       | A38  B38 |       /INT
46        /EXP       | A39  B39 |       N.C.
47         /BM       | A40  B40 |       /BIORQ
48     /BRESET       | A41  B41 |       /B0
49        /BWR       | A42  B42 |       /BMREQ
50        /WRD       | A43  B43 |       /BRFSH
51                   +----------+
52*********************************************************************/
53 
54#ifndef __TVCEXP_H__
55#define __TVCEXP_H__
56 
57 
58/***************************************************************************
59    TYPE DEFINITIONS
60***************************************************************************/
61 
62// ======================> tvcexp_interface
63 
64struct tvcexp_interface
65{
66    devcb_write_line            m_out_irq_cb;
67    devcb_write_line            m_out_nmi_cb;
68};
69 
70 
71// ======================> device_tvcexp_interface
72 
73class device_tvcexp_interface : public device_slot_card_interface
74{
75public:
76   // construction/destruction
77   device_tvcexp_interface(const machine_config &mconfig, device_t &device);
78   virtual ~device_tvcexp_interface();
79 
80   // reading and writing
81   virtual UINT8 id_r() { return 0x00; }   // ID_A and ID_B lines
82   virtual void int_ack() { }
83   virtual UINT8 int_r() { return 1; }
84   virtual DECLARE_READ8_MEMBER(read) { return 0x00; }
85   virtual DECLARE_WRITE8_MEMBER(write) {}
86   virtual DECLARE_READ8_MEMBER(io_read) { return 0x00; }
87   virtual DECLARE_WRITE8_MEMBER(io_write) {}
88};
89 
90// ======================> tvcexp_slot_device
91 
92class tvcexp_slot_device : public device_t,
93                     public tvcexp_interface,
94                     public device_slot_interface
95{
96public:
97   // construction/destruction
98   tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
99   virtual ~tvcexp_slot_device();
100 
101   // device-level overrides
102   virtual void device_start();
103   virtual void device_config_complete();
104 
105   // reading and writing
106   virtual UINT8 id_r();
107   virtual void int_ack();
108   virtual UINT8 int_r();
109   virtual DECLARE_READ8_MEMBER(read);
110   virtual DECLARE_WRITE8_MEMBER(write);
111   virtual DECLARE_READ8_MEMBER(io_read);
112   virtual DECLARE_WRITE8_MEMBER(io_write);
113 
114   devcb_resolved_write_line   m_out_irq_func;
115   devcb_resolved_write_line   m_out_nmi_func;
116 
117   device_tvcexp_interface*   m_cart;
118};
119 
120// device type definition
121extern const device_type TVCEXP_SLOT;
122 
123 
124/***************************************************************************
125    DEVICE CONFIGURATION MACROS
126***************************************************************************/
127 
128#define MCFG_TVC64_EXPANSION_ADD(_tag,_config,_slot_intf,_def_slot,_def_inp) \
129   MCFG_DEVICE_ADD(_tag, TVCEXP_SLOT, 0) \
130   MCFG_DEVICE_CONFIG(_config) \
131   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \
132 
133#endif /* __TVCEXP_H__ */
1/*********************************************************************
2
3    tvcexp.h
4
5**********************************************************************
6
7                   +----------+
8          GND      | A01  B01 |       GND
9          +5V      | A02  B02 |       +5V
10         +12V      | A03  B03 |       +12V
11         -12V      | A04  B04 |       -12V
12         N.C.      | A05  B05 |       N.C.
13         N.C.      | A06  B06 |       /HSYNC
14    3.125 CLK      | A07  B07 |       /VSYNC
15          DMA      | A08  B08 |       BORDER
16         LPEN      | A09  B09 |       N.C.
17          DEB      | A10  B10 |       MUX
18    6.25 CLK       | A11  B11 |       A3
19          A1       | A12  B12 |       EC3
20         EC0       | A13  B13 |       EC1
21       /EXTC       | A14  B14 |       EC2
22    /PHANTOM       | A15  B15 |       TXRXCLK
23        N.C.       | A16  B16 |       SOUND
24         BD0       | A17  B17 |       N.C.
25         BD1       | A18  B18 |       N.C.
26         BD2       | A19  B19 |       N.C.
27         BD3       | A20  B20 |       N.C.
28         BD4       | A21  B21 |       N.C.
29         BD5       | A22  B22 |       N.C.
30         BD6       | A23  B23 |       N.C.
31         BD7       | A24  B24 |       A15
32         A17       | A25  B25 |       A5
33          A8       | A26  B26 |       A12
34          A7       | A27  B27 |       A6
35          A9       | A28  B28 |       A11
36          A4       | A29  B29 |       A10
37         A13       | A30  B30 |       A2
38     /VIDLSB       | A31  B31 |       A0
39        /EXP       | A32  B32 |       P3
40        N.C.       | A33  B33 |       /BUSRQ
41         /P2       | A34  B34 |       N.C.
42     /CLRINT       | A35  B35 |       RESET
43         IDA       | A36  B36 |       /NMI
44        /INT       | A37  B37 |       /WAIT
45         IDB       | A38  B38 |       /INT
46        /EXP       | A39  B39 |       N.C.
47         /BM       | A40  B40 |       /BIORQ
48     /BRESET       | A41  B41 |       /B0
49        /BWR       | A42  B42 |       /BMREQ
50        /WRD       | A43  B43 |       /BRFSH
51                   +----------+
52*********************************************************************/
53
54#ifndef __TVCEXP_H__
55#define __TVCEXP_H__
56
57
58/***************************************************************************
59    TYPE DEFINITIONS
60***************************************************************************/
61
62// ======================> tvcexp_interface
63
64struct tvcexp_interface
65{
66    devcb_write_line            m_out_irq_cb;
67    devcb_write_line            m_out_nmi_cb;
68};
69
70
71// ======================> device_tvcexp_interface
72
73class device_tvcexp_interface : public device_slot_card_interface
74{
75public:
76   // construction/destruction
77   device_tvcexp_interface(const machine_config &mconfig, device_t &device);
78   virtual ~device_tvcexp_interface();
79
80   // reading and writing
81   virtual UINT8 id_r() { return 0x00; }   // ID_A and ID_B lines
82   virtual void int_ack() { }
83   virtual UINT8 int_r() { return 1; }
84   virtual DECLARE_READ8_MEMBER(read) { return 0x00; }
85   virtual DECLARE_WRITE8_MEMBER(write) {}
86   virtual DECLARE_READ8_MEMBER(io_read) { return 0x00; }
87   virtual DECLARE_WRITE8_MEMBER(io_write) {}
88};
89
90// ======================> tvcexp_slot_device
91
92class tvcexp_slot_device : public device_t,
93                     public tvcexp_interface,
94                     public device_slot_interface
95{
96public:
97   // construction/destruction
98   tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
99   virtual ~tvcexp_slot_device();
100
101   // device-level overrides
102   virtual void device_start();
103   virtual void device_config_complete();
104
105   // reading and writing
106   virtual UINT8 id_r();
107   virtual void int_ack();
108   virtual UINT8 int_r();
109   virtual DECLARE_READ8_MEMBER(read);
110   virtual DECLARE_WRITE8_MEMBER(write);
111   virtual DECLARE_READ8_MEMBER(io_read);
112   virtual DECLARE_WRITE8_MEMBER(io_write);
113
114   devcb_resolved_write_line   m_out_irq_func;
115   devcb_resolved_write_line   m_out_nmi_func;
116
117   device_tvcexp_interface*   m_cart;
118};
119
120// device type definition
121extern const device_type TVCEXP_SLOT;
122
123
124/***************************************************************************
125    DEVICE CONFIGURATION MACROS
126***************************************************************************/
127
128#define MCFG_TVC64_EXPANSION_ADD(_tag,_config,_slot_intf,_def_slot,_def_inp) \
129   MCFG_DEVICE_ADD(_tag, TVCEXP_SLOT, 0) \
130   MCFG_DEVICE_CONFIG(_config) \
131   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \
132
133#endif /* __TVCEXP_H__ */
src/mess/machine/tvc_hbf.h
r15241r15242
1#pragma once
2 
3#ifndef __TVC_HBF_H__
4#define __TVC_HBF_H__
5 
6#include "emu.h"
7#include "machine/tvcexp.h"
8#include "machine/wd17xx.h"
9#include "imagedev/flopdrv.h"
10#include "formats/basicdsk.h"
11 
12 
13//**************************************************************************
14//  TYPE DEFINITIONS
15//**************************************************************************
16 
17// ======================> tvc_hbf_device
18 
19class tvc_hbf_device :
20      public device_t,
21      public device_tvcexp_interface
22{
23public:
24   // construction/destruction
25   tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26 
27   // optional information overrides
28   virtual machine_config_constructor device_mconfig_additions() const;
29   virtual const rom_entry *device_rom_region() const;
30 
31protected:
32   // device-level overrides
33   virtual void device_start();
34   virtual void device_reset();
35   virtual void device_config_complete() { m_shortname = "tvc_hbf"; }
36 
37   // tvcexp_interface overrides
38   virtual UINT8 id_r() { return 0x02; } // ID_A to GND, ID_B to VCC
39   virtual DECLARE_READ8_MEMBER(read);
40   virtual DECLARE_WRITE8_MEMBER(write);
41   virtual DECLARE_READ8_MEMBER(io_read);
42   virtual DECLARE_WRITE8_MEMBER(io_write);
43 
44private:
45   // internal state
46   required_device<device_t>   m_fdc;
47 
48   UINT8 *      m_rom;
49   UINT8 *      m_ram;
50   UINT8      m_rom_bank;      // A12 and A13
51};
52 
53 
54// device type definition
55extern const device_type TVC_HBF;
56 
57#endif  /* __TVC_HBF_H__ */
1#pragma once
2
3#ifndef __TVC_HBF_H__
4#define __TVC_HBF_H__
5
6#include "emu.h"
7#include "machine/tvcexp.h"
8#include "machine/wd17xx.h"
9#include "imagedev/flopdrv.h"
10#include "formats/basicdsk.h"
11
12
13//**************************************************************************
14//  TYPE DEFINITIONS
15//**************************************************************************
16
17// ======================> tvc_hbf_device
18
19class tvc_hbf_device :
20      public device_t,
21      public device_tvcexp_interface
22{
23public:
24   // construction/destruction
25   tvc_hbf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
26
27   // optional information overrides
28   virtual machine_config_constructor device_mconfig_additions() const;
29   virtual const rom_entry *device_rom_region() const;
30
31protected:
32   // device-level overrides
33   virtual void device_start();
34   virtual void device_reset();
35   virtual void device_config_complete() { m_shortname = "tvc_hbf"; }
36
37   // tvcexp_interface overrides
38   virtual UINT8 id_r() { return 0x02; } // ID_A to GND, ID_B to VCC
39   virtual DECLARE_READ8_MEMBER(read);
40   virtual DECLARE_WRITE8_MEMBER(write);
41   virtual DECLARE_READ8_MEMBER(io_read);
42   virtual DECLARE_WRITE8_MEMBER(io_write);
43
44private:
45   // internal state
46   required_device<device_t>   m_fdc;
47
48   UINT8 *      m_rom;
49   UINT8 *      m_ram;
50   UINT8      m_rom_bank;      // A12 and A13
51};
52
53
54// device type definition
55extern const device_type TVC_HBF;
56
57#endif  /* __TVC_HBF_H__ */
src/mess/drivers/tvc.c
r15241r15242
148148WRITE8_MEMBER(tvc_state::tvc_palette_w)
149149{
150150   //  0 I 0 G | 0 R 0 B
151   //  0 0 0 0 | I R G B
152   int i = ((data&0x40)>>3) | ((data&0x10)>>3) | (data&0x04) | (data&0x01);
151   //  0 0 0 0 | I G R B
152   int i = ((data&0x40)>>3) | ((data&0x10)>>2) | ((data&0x04)>>1) | (data&0x01);
153153
154154   m_col[offset] = i;
155155}
r15241r15242
554554            break;
555555      default:
556556            // 16 colors mode
557            // IGRB IGRB
557            // IIGG RRBB
558558            for ( i = 0; i < x_count; i++ )
559559            {
560560               UINT8 data = vram[offset + i];
561               UINT8 col0 = ((data & 0x80)>>4) | ((data & 0x20)>>4) | ((data & 0x08)>>1) | ((data & 0x02)>>1);
562               UINT8 col1 = ((data & 0x40)>>3) | ((data & 0x10)>>3) | (data & 0x04) | (data & 0x01);
561               UINT8 col0 = ((data & 0x80)>>4) | ((data & 0x20)>>3) | ((data & 0x08)>>2) | ((data & 0x02)>>1);
562               UINT8 col1 = ((data & 0x40)>>3) | ((data & 0x10)>>2) | ((data & 0x04)>>1) | (data & 0x01);
563563               *p++ = palette[col0];
564564               *p++ = palette[col0];
565565               *p++ = palette[col0];
r15241r15242
580580   {
581581      { 0x00,0x00,0x00 },
582582      { 0x00,0x00,0x7f },
583      { 0x00,0x7f,0x00 },
584      { 0x00,0x7f,0x7f },
585583      { 0x7f,0x00,0x00 },
586584      { 0x7f,0x00,0x7f },
585      { 0x00,0x7f,0x00 },
586      { 0x00,0x7f,0x7f },
587587      { 0x7f,0x7f,0x00 },
588588      { 0x7f,0x7f,0x7f },
589589      { 0x00,0x00,0x00 },
590590      { 0x00,0x00,0xff },
591      { 0x00,0xff,0x00 },
592      { 0x00,0xff,0xff },
593591      { 0xff,0x00,0x00 },
594592      { 0xff,0x00,0xff },
593      { 0x00,0xff,0x00 },
594      { 0x00,0xff,0xff },
595595      { 0xff,0xff,0x00 },
596596      { 0xff,0xff,0xff }
597597   };
r15241r15242
749749
750750ROM_START( tvc64p )
751751   ROM_REGION( 0x4000, "sys", ROMREGION_ERASEFF )
752   ROM_LOAD( "tvc22_d6.64k", 0x0000, 0x2000, CRC(05ac3a34) SHA1(bdc7eda5fd53f806dca8c4929ee498e8e59eb787))
753   ROM_LOAD( "tvc22_d4.64k", 0x2000, 0x2000, CRC(ba6ad589) SHA1(e5c8a6db506836a327d901387a8dc8c681a272db))
752   ROM_SYSTEM_BIOS( 0, "v22", "v2.2")
753   ROMX_LOAD( "tvc22_d6.64k", 0x0000, 0x2000, CRC(05ac3a34) SHA1(bdc7eda5fd53f806dca8c4929ee498e8e59eb787), ROM_BIOS(1) )
754   ROMX_LOAD( "tvc22_d4.64k", 0x2000, 0x2000, CRC(ba6ad589) SHA1(e5c8a6db506836a327d901387a8dc8c681a272db), ROM_BIOS(1) )
755   ROM_SYSTEM_BIOS( 1, "v21", "v2.1")
756   ROMX_LOAD( "tvc21_d6.64k", 0x0000, 0x2000, CRC(f197ffce) SHA1(7b27a91504dd864170451949ada5f938d6532cae), ROM_BIOS(2) )
757   ROMX_LOAD( "tvc21_d4.64k", 0x2000, 0x2000, CRC(b054c0b2) SHA1(c8ca8d5a4d092604de01e2cafc2a2dabe94e6380), ROM_BIOS(2) )
758
754759   ROM_REGION( 0x4000, "cart", ROMREGION_ERASEFF )
755760   ROM_CART_LOAD( "cart", 0, 0x4000, 0 )
756761   ROM_REGION( 0x4000, "ext", ROMREGION_ERASEFF )
757762   ROM_LOAD( "tvc22_d7.64k", 0x2000, 0x2000, CRC(05e1c3a8) SHA1(abf119cf947ea32defd08b29a8a25d75f6bd4987))
758763
759764   ROM_REGION( 0x10000, "vram", ROMREGION_ERASE )
760/*
761
762    ROM_LOAD( "tvcru_d4.bin", 0x0000, 0x2000, CRC(bac5dd4f) SHA1(665a1b8c80b6ad82090803621f0c73ef9243c7d4))
763    ROM_LOAD( "tvcru_d6.bin", 0x2000, 0x2000, CRC(1e0fa0b8) SHA1(9bebb6c8f03f9641bd35c9fd45ffc13a48e5c572))
764    ROM_LOAD( "tvcru_d7.bin", 0x2000, 0x2000, CRC(70cde756) SHA1(c49662af9f6653347ead641e85777c3463cc161b))
765*/
766765ROM_END
767766
768767ROM_START( tvc64pru )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team