Previous 199869 Revisions Next

r20635 Thursday 31st January, 2013 at 15:11:56 UTC by Curt Coder
(MESS) Input fixes. (nw)
[src/mess/drivers]cosmicos.c huebler.c newbrain.c sg1000.c tiki100.c tmc1800.c tmc2000e.c tmc600.c
[src/mess/includes]cosmicos.h huebler.h newbrain.h sg1000.h tiki100.h tmc1800.h tmc2000e.h tmc600.h

trunk/src/mess/includes/huebler.h
r20634r20635
7272
7373   virtual void machine_start();
7474
75   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
75   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7676
7777   DECLARE_READ8_MEMBER( keyboard_r );
7878
7979   void scan_keyboard();
8080
8181   // keyboard state
82   ioport_port* m_key_row[16];
8283   int m_key_d6;
8384   int m_key_d7;
8485   int m_key_a4;
trunk/src/mess/includes/tmc2000e.h
r20634r20635
66
77#include "emu.h"
88#include "cpu/cosmac/cosmac.h"
9#include "formats/basicdsk.h"
109#include "imagedev/cassette.h"
11#include "imagedev/flopdrv.h"
12#include "imagedev/printer.h"
13#include "machine/rescap.h"
1410#include "machine/ram.h"
11#include "machine/rescap.h"
1512#include "sound/cdp1864.h"
1613
1714#define SCREEN_TAG      "screen"
r20634r20635
2421{
2522public:
2623   tmc2000e_state(const machine_config &mconfig, device_type type, const char *tag)
27      : driver_device(mconfig, type, tag)
28      , m_maincpu(*this, CDP1802_TAG)
29      , m_cti(*this, CDP1864_TAG)
30      , m_cassette(*this, CASSETTE_TAG)
31      , m_colorram(*this, "colorram")
32      , m_io_in0(*this, "IN0")
33      , m_io_in1(*this, "IN1")
34      , m_io_in2(*this, "IN2")
35      , m_io_in3(*this, "IN3")
36      , m_io_in4(*this, "IN4")
37      , m_io_in5(*this, "IN5")
38      , m_io_in6(*this, "IN6")
39      , m_io_in7(*this, "IN7")
40      , m_io_run(*this, "RUN")
24      : driver_device(mconfig, type, tag),
25         m_maincpu(*this, CDP1802_TAG),
26         m_cti(*this, CDP1864_TAG),
27         m_cassette(*this, CASSETTE_TAG),
28         m_colorram(*this, "colorram"),
29         m_y0(*this, "Y0"),
30         m_y1(*this, "Y1"),
31         m_y2(*this, "Y2"),
32         m_y3(*this, "Y3"),
33         m_y4(*this, "Y4"),
34         m_y5(*this, "Y5"),
35         m_y6(*this, "Y6"),
36         m_y7(*this, "Y7"),
37         m_run(*this, "RUN")
4138   { }
4239
4340   required_device<cpu_device> m_maincpu;
4441   required_device<cdp1864_device> m_cti;
4542   required_device<cassette_image_device> m_cassette;
43   required_shared_ptr<UINT8> m_colorram;
44   required_ioport m_y0;
45   required_ioport m_y1;
46   required_ioport m_y2;
47   required_ioport m_y3;
48   required_ioport m_y4;
49   required_ioport m_y5;
50   required_ioport m_y6;
51   required_ioport m_y7;
52   required_ioport m_run;
4653
4754   virtual void machine_start();
4855   virtual void machine_reset();
r20634r20635
6976
7077   /* video state */
7178   int m_cdp1864_efx;      /* EFx */
72   required_shared_ptr<UINT8> m_colorram;      /* color memory */
7379   UINT8 m_color;
7480
7581   /* keyboard state */
82   ioport_port* m_key_row[8];
7683   int m_keylatch;         /* key latch */
7784   int m_reset;            /* reset activated */
78
79protected:
80   required_ioport m_io_in0;
81   required_ioport m_io_in1;
82   required_ioport m_io_in2;
83   required_ioport m_io_in3;
84   required_ioport m_io_in4;
85   required_ioport m_io_in5;
86   required_ioport m_io_in6;
87   required_ioport m_io_in7;
88   required_ioport m_io_run;
8985};
9086
9187#endif
trunk/src/mess/includes/newbrain.h
r20634r20635
175175   int m_cop_access;       // COP access
176176
177177   // keyboard state
178   ioport_port* m_key_row[16];
178179   int m_keylatch;         // keyboard row
179180   int m_keydata;          // keyboard column
180181
r20634r20635
206207         m_ctc(*this, Z80CTC_TAG),
207208         m_acia(*this, MC6850_TAG),
208209         m_fdc(*this, UPD765_TAG),
209         m_floppy(*this, UPD765_TAG ":0:525dd")
210         m_floppy(*this, UPD765_TAG ":0:525dd"),
211         m_eim_ram(*this, "eim_ram")
210212   { }
211213
212214   required_device<cpu_device> m_fdccpu;
r20634r20635
214216   required_device<acia6850_device> m_acia;
215217   required_device<upd765a_device> m_fdc;
216218   required_device<floppy_image_device> m_floppy;
219   optional_shared_ptr<UINT8> m_eim_ram;
217220
218221   virtual void machine_start();
219222
r20634r20635
252255   int m_mpm;              // multi paging mode ?
253256   int m_a16;              // address line 16
254257   UINT8 m_pr[16];         // expansion interface paging register
255   UINT8 *m_eim_ram;       // expansion interface RAM
256258
257259   // floppy state
258260   int m_fdc_int;          // interrupt
trunk/src/mess/includes/sg1000.h
r20634r20635
126126   DECLARE_READ8_MEMBER( ppi_pa_r );
127127   DECLARE_READ8_MEMBER( ppi_pb_r );
128128   DECLARE_WRITE8_MEMBER( ppi_pc_w );
129
130   ioport_port* m_key_row[16];
129131};
130132
131133class sf7000_state : public sc3000_state
trunk/src/mess/includes/cosmicos.h
r20634r20635
125125   int m_ram_disable;
126126
127127   /* keyboard state */
128   ioport_port* m_key_row[4];
128129   UINT8 m_keylatch;
129130
130131   /* display state */
trunk/src/mess/includes/tmc1800.h
r20634r20635
8686   DECLARE_WRITE_LINE_MEMBER( q_w );
8787
8888   /* keyboard state */
89   int m_keylatch;         /* key latch */
89   int m_keylatch;
9090};
9191
9292class tmc2000_state : public driver_device
r20634r20635
100100         m_ram(*this, RAM_TAG),
101101         m_rom(*this, CDP1802_TAG),
102102         m_colorram(*this, "color_ram"),
103         m_in0(*this, "IN0"),
104         m_in1(*this, "IN1"),
105         m_in2(*this, "IN2"),
106         m_in3(*this, "IN3"),
107         m_in4(*this, "IN4"),
108         m_in5(*this, "IN5"),
109         m_in6(*this, "IN6"),
110         m_in7(*this, "IN7"),
103         m_y0(*this, "Y0"),
104         m_y1(*this, "Y1"),
105         m_y2(*this, "Y2"),
106         m_y3(*this, "Y3"),
107         m_y4(*this, "Y4"),
108         m_y5(*this, "Y5"),
109         m_y6(*this, "Y6"),
110         m_y7(*this, "Y7"),
111111         m_run(*this, "RUN")
112112   { }
113113
r20634r20635
117117   required_device<ram_device> m_ram;
118118   required_memory_region m_rom;
119119   optional_shared_ptr<UINT8> m_colorram;
120   required_ioport m_in0;
121   required_ioport m_in1;
122   required_ioport m_in2;
123   required_ioport m_in3;
124   required_ioport m_in4;
125   required_ioport m_in5;
126   required_ioport m_in6;
127   required_ioport m_in7;
120   required_ioport m_y0;
121   required_ioport m_y1;
122   required_ioport m_y2;
123   required_ioport m_y3;
124   required_ioport m_y4;
125   required_ioport m_y5;
126   required_ioport m_y6;
127   required_ioport m_y7;
128128   required_ioport m_run;
129129
130130   virtual void machine_start();
r20634r20635
152152   UINT8 m_color;
153153
154154   /* keyboard state */
155   int m_keylatch;         /* key latch */
155   ioport_port* m_key_row[8];
156   int m_keylatch;
156157};
157158
158159class nano_state : public driver_device
trunk/src/mess/includes/tiki100.h
r20634r20635
105105   UINT8 m_palette;
106106
107107   /* keyboard state */
108   ioport_port* m_key_row[12];
108109   int m_keylatch;
109110   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
110111};
trunk/src/mess/includes/tmc600.h
r20634r20635
8484   int m_blink;                // cursor blink
8585
8686   // keyboard state
87   ioport_port* m_key_row[8];
8788   int m_keylatch;             // key latch
89
8890   TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
8991};
9092
trunk/src/mess/drivers/cosmicos.c
r20634r20635
7979
8080READ8_MEMBER( cosmicos_state::hex_keyboard_r )
8181{
82   ioport_port *ports[4] = { m_y1, m_y2, m_y3, m_y4 };
8382   UINT8 data = 0;
8483   int i;
8584
r20634r20635
8786   {
8887      if (BIT(m_keylatch, i))
8988      {
90         UINT8 keydata = ports[i]->read();
89         UINT8 keydata = m_key_row[i]->read();
9190
9291         if (BIT(keydata, 0)) data |= 0x01;
9392         if (BIT(keydata, 1)) data |= 0x02;
r20634r20635
501500
502501   set_ram_mode();
503502
503   // find keyboard rows
504   m_key_row[0] = m_y1;
505   m_key_row[1] = m_y2;
506   m_key_row[2] = m_y3;
507   m_key_row[3] = m_y4;
508
504509   /* register for state saving */
505510   save_item(NAME(m_wait));
506511   save_item(NAME(m_clear));
trunk/src/mess/drivers/tiki100.c
r20634r20635
9494
9595READ8_MEMBER( tiki100_state::keyboard_r )
9696{
97   ioport_port *ports[12] = { m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7, m_y8, m_y9, m_y10, m_y11, m_y12 };
98   UINT8 data = ports[m_keylatch]->read();
97   UINT8 data = m_key_row[m_keylatch]->read();
9998
10099   m_keylatch++;
101100
r20634r20635
563562
564563   bankswitch();
565564
565   // find keyboard rows
566   m_key_row[0] = m_y1;
567   m_key_row[1] = m_y2;
568   m_key_row[2] = m_y3;
569   m_key_row[3] = m_y4;
570   m_key_row[4] = m_y5;
571   m_key_row[5] = m_y6;
572   m_key_row[6] = m_y7;
573   m_key_row[7] = m_y8;
574   m_key_row[8] = m_y9;
575   m_key_row[9] = m_y10;
576   m_key_row[10] = m_y11;
577   m_key_row[11] = m_y12;
578
566579   /* register for state saving */
567580   save_item(NAME(m_rome));
568581   save_item(NAME(m_vire));
trunk/src/mess/drivers/huebler.c
r20634r20635
2424
2525void amu880_state::scan_keyboard()
2626{
27   ioport_port* ports[16] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7,
28                   m_y8, m_y9, m_y10, m_y11, m_y12, m_y13, m_y14, m_y15 };
27   UINT8 data = m_key_row[m_key_a8 ? m_key_d6 : m_key_d7]->read();
2928
30   UINT8 data = ports[m_key_a8 ? m_key_d6 : m_key_d7]->read();
31
3229   int a8 = (data & 0x0f) == 0x0f;
3330
3431   if (m_key_a8 && !a8)
r20634r20635
210207
211208/* Video */
212209
213UINT32 amu880_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
210UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
214211{
215212   int y, sx, x, line;
216213
r20634r20635
230227         {
231228            int color = ((line > 7) ? 0 : BIT(data, 7)) ^ BIT(videoram_data, 7);
232229
233            bitmap.pix16(y, (sx * 6) + x) = color;
230            bitmap.pix32(y, (sx * 6) + x) = RGB_MONOCHROME_WHITE[color];
234231
235232            data <<= 1;
236233         }
r20634r20635
335332
336333void amu880_state::machine_start()
337334{
335   // find keyboard rows
336   m_key_row[0] = m_y0;
337   m_key_row[1] = m_y1;
338   m_key_row[2] = m_y2;
339   m_key_row[3] = m_y3;
340   m_key_row[4] = m_y4;
341   m_key_row[5] = m_y5;
342   m_key_row[6] = m_y6;
343   m_key_row[7] = m_y7;
344   m_key_row[8] = m_y8;
345   m_key_row[9] = m_y9;
346   m_key_row[10] = m_y10;
347   m_key_row[11] = m_y11;
348   m_key_row[12] = m_y12;
349   m_key_row[13] = m_y13;
350   m_key_row[14] = m_y14;
351   m_key_row[15] = m_y15;
352
338353   /* register for state saving */
339354   save_item(NAME(m_key_d6));
340355   save_item(NAME(m_key_d7));
r20634r20635
388403   MCFG_SCREEN_RAW_PARAMS(9000000, 576, 0*6, 64*6, 320, 0*10, 24*10)
389404
390405   MCFG_GFXDECODE(amu880)
391   MCFG_PALETTE_LENGTH(2)
392   MCFG_PALETTE_INIT(black_and_white)
393406
394407   /* devices */
395408   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_10MHz/4, ctc_intf)
trunk/src/mess/drivers/tmc600.c
r20634r20635
206206
207207READ_LINE_MEMBER( tmc600_state::ef3_r )
208208{
209   ioport_port* portnames[8] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7 };
209   UINT8 data = ~m_key_row[m_keylatch / 8]->read();
210210
211   UINT8 data = ~portnames[m_keylatch / 8]->read();
212
213211   return BIT(data, m_keylatch % 8);
214212}
215213
r20634r20635
251249      program.unmap_readwrite(0xa000, 0xbfff);
252250      break;
253251   }
252   
253   // find keyboard rows
254   m_key_row[0] = m_y0;
255   m_key_row[1] = m_y1;
256   m_key_row[2] = m_y2;
257   m_key_row[3] = m_y3;
258   m_key_row[4] = m_y4;
259   m_key_row[5] = m_y5;
260   m_key_row[6] = m_y6;
261   m_key_row[7] = m_y7;
254262
255263   /* register for state saving */
256264   save_item(NAME(m_keylatch));
trunk/src/mess/drivers/sg1000.c
r20634r20635
522522
523523static TMS9928A_INTERFACE(sg1000_tms9918a_interface)
524524{
525   "screen",
525   SCREEN_TAG,
526526   0x4000,
527527   DEVCB_DRIVER_LINE_MEMBER(sg1000_state,sg1000_vdp_interrupt)
528528};
r20634r20635
546546       PA7     Keyboard input
547547   */
548548
549   ioport_port *ports[8] = { m_pa0, m_pa1, m_pa2, m_pa3, m_pa4, m_pa5, m_pa6, m_pa7 };
550
551   return ports[m_keylatch]->read();
549   return m_key_row[m_keylatch]->read();
552550}
553551
554552READ8_MEMBER( sc3000_state::ppi_pb_r )
r20634r20635
566564       PB7     Cassette tape input
567565   */
568566
569   ioport_port *ports[8] = { m_pb0, m_pb1, m_pb2, m_pb3, m_pb4, m_pb5, m_pb6, m_pb7 };
570
571567   /* keyboard */
572   UINT8 data = ports[m_keylatch]->read();
568   UINT8 data = m_key_row[m_keylatch + 8]->read();
573569
574570   /* cartridge contact */
575571   data |= 0x10;
r20634r20635
10221018   /* toggle light gun crosshair */
10231019   machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sg1000_state::lightgun_tick),this));
10241020
1021   // find keyboard rows
1022   m_key_row[0] = m_pa0;
1023   m_key_row[1] = m_pa1;
1024   m_key_row[2] = m_pa2;
1025   m_key_row[3] = m_pa3;
1026   m_key_row[4] = m_pa4;
1027   m_key_row[5] = m_pa5;
1028   m_key_row[6] = m_pa6;
1029   m_key_row[7] = m_pa7;
1030   m_key_row[8] = m_pb0;
1031   m_key_row[9] = m_pb1;
1032   m_key_row[10] = m_pb2;
1033   m_key_row[11] = m_pb3;
1034   m_key_row[12] = m_pb4;
1035   m_key_row[13] = m_pb5;
1036   m_key_row[14] = m_pb6;
1037   m_key_row[15] = m_pb7;
1038
10251039   /* register for state saving */
10261040   save_item(NAME(m_tvdraw_data));
10271041   save_item(NAME(m_keylatch));
r20634r20635
10691083
10701084   /* video hardware */
10711085   MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
1072   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1086   MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
10731087   MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
10741088
10751089   /* sound hardware */
r20634r20635
11231137
11241138   /* video hardware */
11251139   MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
1126   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1140   MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
11271141   MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
11281142
11291143   /* sound hardware */
r20634r20635
11641178
11651179   /* video hardware */
11661180   MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface )
1167   MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" )
1181   MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG )
11681182   MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update )
11691183
11701184   /* sound hardware */
trunk/src/mess/drivers/tmc2000e.c
r20634r20635
9595/* Input Ports */
9696
9797static INPUT_PORTS_START( tmc2000e )
98   PORT_START("Y0")
99   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
100   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
101   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
102   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
103   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
104   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
105   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
106   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
107
108   PORT_START("Y1")
109   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
110   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
111   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
112   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
113   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
114   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
115   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
116   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
117
118   PORT_START("Y2")
119   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
120   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
121   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
122   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
123   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
124   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
125   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
126   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
127
128   PORT_START("Y3")
129   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
130   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
131   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
132   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
133   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
134   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
135   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
136   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
137
138   PORT_START("Y4")
139   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
140   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
141   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
142   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
143   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
144   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
145   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
146   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
147
148   PORT_START("Y5")
149   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
150   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
151   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
152   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
153   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
154   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
155   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
156   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
157
158   PORT_START("Y6")
159   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
160   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
161   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
162   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
163   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
164   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
165   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
166   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
167
168   PORT_START("Y7")
169   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
170   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
171   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
172   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
173   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
174   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
175   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
176   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
177
98178   PORT_START("DSW0")  // System Configuration DIPs
99179   PORT_DIPNAME( 0x80, 0x00, "Keyboard Type" )
100180   PORT_DIPSETTING(    0x00, "ASCII" )
r20634r20635
152232
153233READ_LINE_MEMBER( tmc2000e_state::clear_r )
154234{
155   return BIT(m_io_run->read(), 0);
235   return BIT(m_run->read(), 0);
156236}
157237
158238READ_LINE_MEMBER( tmc2000e_state::ef2_r )
159239{
160   return (m_cassette)->input() < 0;
240   return m_cassette->input() < 0;
161241}
162242
163243READ_LINE_MEMBER( tmc2000e_state::ef3_r )
164244{
165   ioport_port *keynames[] = { m_io_in0, m_io_in1, m_io_in2, m_io_in3, m_io_in4, m_io_in5, m_io_in6, m_io_in7 };
166   UINT8 data = ~(keynames[m_keylatch / 8])->read();
245   UINT8 data = ~(m_key_row[m_keylatch / 8])->read();
167246
168247   return BIT(data, m_keylatch % 8);
169248}
r20634r20635
210289
211290void tmc2000e_state::machine_start()
212291{
292   // find keyboard rows
293   m_key_row[0] = m_y0;
294   m_key_row[1] = m_y1;
295   m_key_row[2] = m_y2;
296   m_key_row[3] = m_y3;
297   m_key_row[4] = m_y4;
298   m_key_row[5] = m_y5;
299   m_key_row[6] = m_y6;
300   m_key_row[7] = m_y7;
301
213302   /* register for state saving */
214   save_pointer(NAME(m_colorram.target()), TMC2000E_COLORRAM_SIZE);
215303   save_item(NAME(m_cdp1864_efx));
216304   save_item(NAME(m_keylatch));
217305}
r20634r20635
234322   NULL
235323};
236324
237static const floppy_interface tmc2000e_floppy_interface =
238{
239   DEVCB_NULL,
240   DEVCB_NULL,
241   DEVCB_NULL,
242   DEVCB_NULL,
243   DEVCB_NULL,
244   FLOPPY_STANDARD_5_25_DSDD,
245   LEGACY_FLOPPY_OPTIONS_NAME(default),
246   NULL,
247   NULL
248};
249
250325static MACHINE_CONFIG_START( tmc2000e, tmc2000e_state )
251326   // basic system hardware
252327   MCFG_CPU_ADD(CDP1802_TAG, COSMAC, XTAL_1_75MHz)
r20634r20635
264339   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
265340
266341   /* devices */
267   MCFG_PRINTER_ADD("printer")
268342   MCFG_CASSETTE_ADD(CASSETTE_TAG, tmc2000_cassette_interface)
269343
270   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tmc2000e_floppy_interface)
271
272344   /* internal ram */
273345   MCFG_RAM_ADD(RAM_TAG)
274346   MCFG_RAM_DEFAULT_SIZE("8K")
trunk/src/mess/drivers/tmc1800.c
r20634r20635
298298/* Input Ports */
299299
300300static INPUT_PORTS_START( tmc1800 )
301   PORT_START("IN0")
301   PORT_START("Y0")
302302   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
303303   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
304304   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
r20634r20635
308308   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
309309   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
310310
311   PORT_START("IN1")
311   PORT_START("Y1")
312312   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8')
313313   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9')
314314   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
r20634r20635
331331}
332332
333333static INPUT_PORTS_START( tmc2000 )
334   PORT_START("IN0")
334   PORT_START("Y0")
335335   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0')
336336   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1')
337337   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2')
r20634r20635
341341   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6')
342342   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7')
343343
344   PORT_START("IN1")
344   PORT_START("Y1")
345345   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8')
346346   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9')
347347   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
r20634r20635
354354   PORT_START("RUN")
355355   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, tmc2000_state, run_pressed, 0)
356356
357   PORT_START("IN2")
357   PORT_START("Y2")
358358   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
359359   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
360360   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
r20634r20635
364364   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
365365   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
366366
367   PORT_START("IN3")
367   PORT_START("Y3")
368368   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
369369   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
370370   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
r20634r20635
374374   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
375375   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
376376
377   PORT_START("IN4")
377   PORT_START("Y4")
378378   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
379379   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
380380   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
r20634r20635
384384   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
385385   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
386386
387   PORT_START("IN5")
387   PORT_START("Y5")
388388   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
389389   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
390390   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
r20634r20635
394394   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
395395   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
396396
397   PORT_START("IN6")
397   PORT_START("Y6")
398398   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
399399   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
400400   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
r20634r20635
404404   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
405405   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
406406
407   PORT_START("IN7")
407   PORT_START("Y7")
408408   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
409409   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
410410   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
r20634r20635
559559
560560READ_LINE_MEMBER( tmc2000_state::ef3_r )
561561{
562   ioport_port *ports[] = { m_in0, m_in1, m_in2, m_in3, m_in4, m_in5, m_in6, m_in7 };
563   UINT8 data = ~ports[m_keylatch / 8]->read();
562   UINT8 data = ~m_key_row[m_keylatch / 8]->read();
564563
565564   return BIT(data, m_keylatch % 8);
566565}
r20634r20635
695694   {
696695      m_colorram[addr] = machine().rand() & 0xff;
697696   }
697   
698   // find keyboard rows
699   m_key_row[0] = m_y0;
700   m_key_row[1] = m_y1;
701   m_key_row[2] = m_y2;
702   m_key_row[3] = m_y3;
703   m_key_row[4] = m_y4;
704   m_key_row[5] = m_y5;
705   m_key_row[6] = m_y6;
706   m_key_row[7] = m_y7;
698707
699708   // state saving
700709   save_item(NAME(m_keylatch));
trunk/src/mess/drivers/newbrain.c
r20634r20635
443443
444444   */
445445
446   ioport_port* ports[16] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7,
447                   m_y8, m_y9, m_y10, m_y11, m_y12, m_y13, m_y14, m_y15 };
448
449446   /* keyboard row reset */
450447
451448   if (!BIT(data, 0))
r20634r20635
471468         m_keylatch = 0;
472469      }
473470
474      m_keydata = ports[m_keylatch]->read();
471      m_keydata = m_key_row[m_keylatch]->read();
475472
476473      output_set_digit_value(m_keylatch, m_segment_data[m_keylatch]);
477474   }
r20634r20635
12691266   /* set up memory banking */
12701267   bankswitch();
12711268
1269   // find keyboard rows
1270   m_key_row[0] = m_y0;
1271   m_key_row[1] = m_y1;
1272   m_key_row[2] = m_y2;
1273   m_key_row[3] = m_y3;
1274   m_key_row[4] = m_y4;
1275   m_key_row[5] = m_y5;
1276   m_key_row[6] = m_y6;
1277   m_key_row[7] = m_y7;
1278   m_key_row[8] = m_y8;
1279   m_key_row[9] = m_y9;
1280   m_key_row[10] = m_y10;
1281   m_key_row[11] = m_y11;
1282   m_key_row[12] = m_y12;
1283   m_key_row[13] = m_y13;
1284   m_key_row[14] = m_y14;
1285   m_key_row[15] = m_y15;
1286
12721287   /* register for state saving */
12731288   save_item(NAME(m_pwrup));
12741289   save_item(NAME(m_userint));
r20634r20635
12971312   newbrain_state::machine_start();
12981313
12991314   /* allocate expansion RAM */
1300   m_eim_ram = auto_alloc_array(machine(), UINT8, NEWBRAIN_EIM_RAM_SIZE);
1315   m_eim_ram.allocate(NEWBRAIN_EIM_RAM_SIZE);
13011316
13021317   /* register for state saving */
1303   save_pointer(NAME(m_eim_ram), NEWBRAIN_EIM_RAM_SIZE);
13041318   save_item(NAME(m_mpm));
13051319   save_item(NAME(m_a16));
13061320   save_item(NAME(m_pr));

Previous 199869 Revisions Next


© 1997-2024 The MAME Team