Previous 15994 Revisions Next

r14012 Friday 13th January, 2012 at 11:07:41 UTC by Robbbert
i8279: removed trampolines
[src/mess/drivers]mmd1.c sdk85.c sdk86.c selz80.c
[src/mess/machine]i8279.c i8279.h

src/mess/machine/i8279.c
r14011r14012
7373**********************************************************************/
7474
7575#include "i8279.h"
76#include "machine/devhelpr.h"
7776
7877
7978//**************************************************************************
r14011r14012
354353}
355354
356355
357UINT8 i8279_device::status_r()
356READ8_MEMBER( i8279_device::status_r )
358357{
359358   return m_status;
360359}
361360
362361
363UINT8 i8279_device::data_r()
362READ8_MEMBER( i8279_device::data_r )
364363{
365364   UINT8 i;
366365   bool sensor_mode = ((m_cmd[0] & 6)==4);
r14011r14012
419418}
420419
421420
422void i8279_device::ctrl_w( UINT8 data )
421WRITE8_MEMBER( i8279_device::cmd_w )
423422{//printf("Command: %X=%X ",data>>5,data&31);
424423   UINT8 cmd = data >> 5;
425424   data &= 0x1f;
r14011r14012
457456}
458457
459458
460void i8279_device::data_w( UINT8 data )
459WRITE8_MEMBER( i8279_device::data_w )
461460{//printf("Data: %X ",data);
462461   if (BIT(m_cmd[0], 4) & m_autoinc)
463462   {
r14011r14012
472471   m_d_ram_ptr &= 15;
473472}
474473
475
476// These 2 are only to be used if the port numbers are sequential
477READ8_MEMBER( i8279_device::read )
478{
479   return BIT(offset, 0) ? data_r() : status_r();
480}
481
482
483WRITE8_MEMBER( i8279_device::write)
484{
485   BIT(offset, 0) ? data_w(data) : ctrl_w(data);
486}
487
488
489/***************************************************************************
490    TRAMPOLINES
491***************************************************************************/
492
493WRITE8_MEMBER( i8279_device::i8279_ctrl_w ) { ctrl_w(data); }
494WRITE8_MEMBER( i8279_device::i8279_data_w ) { data_w(data); }
495READ8_MEMBER( i8279_device::i8279_status_r ) { return status_r(); }
496READ8_MEMBER( i8279_device::i8279_data_r ) { return data_r(); }
src/mess/machine/i8279.h
r14011r14012
8080   // construction/destruction
8181   i8279_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8282
83   /* read data register */
84   DECLARE_READ8_MEMBER(read);
85   DECLARE_WRITE8_MEMBER(write);
86   DECLARE_READ8_MEMBER(i8279_status_r);
87   DECLARE_READ8_MEMBER(i8279_data_r);
88   DECLARE_WRITE8_MEMBER(i8279_ctrl_w);
89   DECLARE_WRITE8_MEMBER(i8279_data_w);
90
83   // read & write handlers
84   DECLARE_READ8_MEMBER(status_r);
85   DECLARE_READ8_MEMBER(data_r);
86   DECLARE_WRITE8_MEMBER(cmd_w);
87   DECLARE_WRITE8_MEMBER(data_w);
9188   void timer_mainloop();
9289
9390protected:
r14011r14012
109106   UINT8 get_segments();
110107   void set_irq(bool state);
111108   void set_display_mode(UINT8 data);
112   void ctrl_w(UINT8 data);
113   void data_w(UINT8 data);
114   UINT8 status_r();
115   UINT8 data_r();
116109
117110   devcb_resolved_write_line   m_out_irq_func;
118111   devcb_resolved_write8      m_out_sl_func;
src/mess/drivers/mmd1.c
r14011r14012
267267   AM_RANGE( 0x00, 0x00 ) AM_WRITE(mmd1_port0_w)
268268   AM_RANGE( 0x01, 0x01 ) AM_READWRITE(mmd2_01_r,mmd1_port1_w)
269269   AM_RANGE( 0x02, 0x02 ) AM_WRITE(mmd1_port2_w)
270   AM_RANGE( 0x03, 0x04 ) AM_DEVREADWRITE("i8279", i8279_device, read, write)
270   AM_RANGE( 0x03, 0x03 ) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
271   AM_RANGE( 0x04, 0x04 ) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w)
271272   AM_RANGE( 0x05, 0x07 ) AM_READ(mmd2_bank_r)
272273ADDRESS_MAP_END
273274
src/mess/drivers/selz80.c
r14011r14012
5757static ADDRESS_MAP_START(selz80_io, AS_IO, 8, selz80_state)
5858   ADDRESS_MAP_UNMAP_HIGH
5959   ADDRESS_MAP_GLOBAL_MASK(0xff)
60   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("i8279", i8279_device, i8279_data_r, i8279_data_w )
61   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("i8279", i8279_device, i8279_status_r, i8279_ctrl_w)
60   AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w )
61   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
6262ADDRESS_MAP_END
6363
6464/* Input ports */
src/mess/drivers/sdk85.c
r14011r14012
4343   ADDRESS_MAP_UNMAP_HIGH
4444   AM_RANGE(0x0000, 0x07ff) AM_ROM // Monitor rom (A14)
4545   AM_RANGE(0x0800, 0x0fff) AM_ROM // Expansion rom (A15)
46   AM_RANGE(0x1800, 0x1800) AM_DEVREADWRITE("i8279", i8279_device, i8279_data_r, i8279_data_w )
47   AM_RANGE(0x1900, 0x1900) AM_DEVREADWRITE("i8279", i8279_device, i8279_status_r, i8279_ctrl_w)
46   AM_RANGE(0x1800, 0x1800) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w )
47   AM_RANGE(0x1900, 0x1900) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w)
4848   //AM_RANGE(0x1800, 0x1fff) AM_RAM // i8279 (A13)
4949   AM_RANGE(0x2000, 0x27ff) AM_RAM // i8155 (A16)
5050   AM_RANGE(0x2800, 0x2fff) AM_RAM // i8155 (A17)
src/mess/drivers/sdk86.c
r14011r14012
5252
5353static ADDRESS_MAP_START(sdk86_io, AS_IO, 16, sdk86_state)
5454   ADDRESS_MAP_UNMAP_HIGH
55   AM_RANGE(0xffe8, 0xffe9) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, i8279_data_r, i8279_data_w, 0xff)
56   AM_RANGE(0xffea, 0xffeb) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, i8279_status_r, i8279_ctrl_w, 0xff)
55   AM_RANGE(0xffe8, 0xffe9) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, data_r, data_w, 0xff)
56   AM_RANGE(0xffea, 0xffeb) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, status_r, cmd_w, 0xff)
5757
5858   // FFF0-FFF3 = 8251 serial chip (even -> data, control) AM_MIRROR(4)
5959   // FFF8-FFFF = 2 x 8255A i/o chips. chip 1 uses the odd addresses, chip 2 uses the even addresses.

Previous 15994 Revisions Next


© 1998-2018 The MESS Team