Previous 199869 Revisions Next

r33986 Saturday 20th December, 2014 at 18:59:20 UTC by Sandro Ronco
(MESS) digel804: added RS232 port. (nw)
[src/mess/drivers]digel804.c
[src/mess/layout]digel804.lay

trunk/src/mess/drivers/digel804.c
r242497r242498
2020*  hook up keypad via 74C923 and mode buttons via logic gate mess
2121*
2222*  TODO:
23*  remove ACIA hack in digel804_state::acia_command_w
2324*  minor finishing touches to i/o map
24*  hook up 6551/ACIA interrupt (currently ACIA device doesn't have a callback for /IRQ line)
25*  attach terminal to 6551/ACIA serial for recieving from ep804
26*  correctly hook up 10937 vfd controller: por is not hooked up (relates to /MEMEN)
27*  SCLK line should be handled inside the 10937 device
2825*  EPROM socket stuff (ports 0x40, 0x41, 0x42 and 0x47)
2926*  artwork
3027*
r242497r242498
5956/* Core includes */
6057#include "emu.h"
6158#include "cpu/z80/z80.h"
62#include "machine/terminal.h"
6359#include "sound/speaker.h"
6460#include "machine/roc10937.h"
6561#include "machine/mos6551.h"
6662#include "machine/mm74c922.h"
6763#include "machine/ram.h"
64#include "bus/rs232/rs232.h"
6865#include "digel804.lh"
6966
70#define TERMINAL_TAG "terminal"
7167
7268class digel804_state : public driver_device
7369{
r242497r242498
7571   digel804_state(const machine_config &mconfig, device_type type, const char *tag)
7672      : driver_device(mconfig, type, tag),
7773      m_maincpu(*this, "maincpu"),
78      m_terminal(*this, TERMINAL_TAG),
7974      m_speaker(*this, "speaker"),
8075      m_acia(*this, "acia"),
8176      m_vfd(*this, "vfd"),
8277      m_kb(*this, "74c923"),
83      m_ram(*this, RAM_TAG)
78      m_ram(*this, RAM_TAG),
79      m_rambank(*this, "bankedram")
8480   {
8581   }
8682
8783   required_device<cpu_device> m_maincpu;
88   required_device<generic_terminal_device> m_terminal;
8984   required_device<speaker_sound_device> m_speaker;
9085   required_device<mos6551_device> m_acia;
9186   required_device<roc10937_t> m_vfd;
9287   required_device<mm74c922_device> m_kb;
9388   required_device<ram_device> m_ram;
89   required_memory_bank m_rambank;
9490
9591   virtual void machine_reset();
9692   DECLARE_DRIVER_INIT(digel804);
r242497r242498
115111   DECLARE_WRITE8_MEMBER( acia_command_w );
116112   DECLARE_READ8_MEMBER( acia_control_r );
117113   DECLARE_WRITE8_MEMBER( acia_control_w );
114   DECLARE_WRITE_LINE_MEMBER( acia_irq_w );
115   DECLARE_WRITE_LINE_MEMBER( ep804_acia_irq_w );
118116   DECLARE_WRITE_LINE_MEMBER( da_w );
119117   DECLARE_INPUT_CHANGED_MEMBER(mode_change);
120118   // current speaker state for port 45
121119   UINT8 m_speaker_state;
122120   // ram stuff for banking
123121   UINT8 m_ram_bank;
124   //required_shared_ptr<UINT8> m_main_ram;
125122   // states
126123   UINT8 m_acia_intq;
127124   UINT8 m_overload_state;
r242497r242498
133130   UINT8 m_chipinsert_state;
134131   UINT8 m_keyen_state;
135132   UINT8 m_op41;
136   DECLARE_WRITE8_MEMBER(digel804_serial_put);
137133};
138134
139135
r242497r242498
156152   m_op41 = 0;
157153   m_keyen_state = 1; // /KEYEN
158154
159   membank( "bankedram" )->set_base(m_ram->pointer());
155   m_rambank->set_base(m_ram->pointer());
160156}
161157
162158void digel804_state::machine_reset()
r242497r242498
236232WRITE8_MEMBER( digel804_state::op00 )
237233{
238234   m_ram_bank = data;
239   membank( "bankedram" )->set_base(m_ram->pointer() + ((m_ram_bank * 0x8000) & m_ram->mask()));
235   m_rambank->set_base(m_ram->pointer() + ((m_ram_bank * 0x8000) & m_ram->mask()));
240236}
241237
242238WRITE8_MEMBER( digel804_state::op43 )
r242497r242498
257253   if ((data&0xF8)!=0)
258254      logerror("Digel804: port 0x43 ram bank had unexpected data %02x written to it!\n", data);
259255
260   membank( "bankedram" )->set_base(m_ram->pointer() + ((m_ram_bank * 0x8000) & m_ram->mask()));
256   m_rambank->set_base(m_ram->pointer() + ((m_ram_bank * 0x8000) & m_ram->mask()));
261257}
262258
263259WRITE8_MEMBER( digel804_state::op43_1_4 )
r242497r242498
372368            m_sim_mode = 0;
373369            break;
374370      }
371
372      m_acia->reset();
375373   }
376374
377375   // press one of those keys reset the Z80
r242497r242498
406404
407405WRITE8_MEMBER( digel804_state::acia_command_w )
408406{
407   data |= 0x08;   // HACK for ep804 remote mode
408
409409   m_acia->write(space, 2, data);
410410}
411411
r242497r242498
458458   ADDRESS_MAP_GLOBAL_MASK(0xff)
459459   // io bits: x 1 x x x * * *
460460   // writes to 47, 4e, 57, 5e, 67, 6e, 77, 7e, c7, ce, d7, de, e7, ee, f7, fe all go to 47, same with reads
461   AM_RANGE(0x00, 0x00) AM_MIRROR(0xB8) AM_WRITE(op00) // W, banked ram
461   AM_RANGE(0x00, 0x00) AM_MIRROR(0x38) AM_WRITE(op00) // W, banked ram
462462   AM_RANGE(0x40, 0x40) AM_MIRROR(0xB8) AM_READWRITE(ip40, op40) // RW, eprom socket data bus input/output value
463463   AM_RANGE(0x41, 0x41) AM_MIRROR(0xB8) AM_WRITE(op41) // W, eprom socket address low out
464464   AM_RANGE(0x42, 0x42) AM_MIRROR(0xB8) AM_WRITE(op42) // W, eprom socket address hi/control out
r242497r242498
553553   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
554554INPUT_PORTS_END
555555
556static DEVICE_INPUT_DEFAULTS_START( digel804_rs232_defaults )
557   DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 )
558   DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 )
559   DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
560   DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 )
561   DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_ODD )
562   DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 )
563DEVICE_INPUT_DEFAULTS_END
564
556565/******************************************************************************
557566 Machine Drivers
558567******************************************************************************/
559WRITE8_MEMBER(digel804_state::digel804_serial_put)
560{
561   //m_acia->receive_character(data);
562}
563568
564569WRITE_LINE_MEMBER( digel804_state::da_w )
565570{
566   m_maincpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
567571   m_key_intq = state ? 0 : 1;
572   m_maincpu->set_input_line(0, (m_key_intq & m_acia_intq) ? CLEAR_LINE : ASSERT_LINE);
568573}
569574
575WRITE_LINE_MEMBER( digel804_state::acia_irq_w )
576{
577   m_acia_intq = state ? 0 : 1;
578   m_maincpu->set_input_line(0, (m_key_intq & m_acia_intq) ? CLEAR_LINE : ASSERT_LINE);
579}
580
581WRITE_LINE_MEMBER( digel804_state::ep804_acia_irq_w )
582{
583}
584
570585static MACHINE_CONFIG_START( digel804, digel804_state )
571586   /* basic machine hardware */
572587   MCFG_CPU_ADD("maincpu", Z80, XTAL_3_6864MHz/2) /* Z80A, X1(aka E0 on schematics): 3.6864Mhz */
r242497r242498
577592   MCFG_ROC10937_ADD("vfd",0) // RIGHT_TO_LEFT
578593
579594   /* video hardware */
580   MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0)
581   MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(digel804_state, digel804_serial_put))
582
583595   MCFG_DEFAULT_LAYOUT(layout_digel804)
584596
585597   MCFG_DEVICE_ADD("74c923", MM74C923, 0)
r242497r242498
591603
592604   /* acia */
593605   MCFG_DEVICE_ADD("acia", MOS6551, 0)
594   MCFG_MOS6551_XTAL(XTAL_1_8432MHz)
606   MCFG_MOS6551_XTAL(XTAL_3_6864MHz/2)
607   MCFG_MOS6551_IRQ_HANDLER(WRITELINE(digel804_state, acia_irq_w))
608   MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
609   MCFG_MOS6551_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
610   MCFG_MOS6551_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
595611
612   MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "null_modem")
613   MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", mos6551_device, write_rxd))
614   MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia", mos6551_device, write_dsr))
615   MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", mos6551_device, write_cts))
616   MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("null_modem", digel804_rs232_defaults)
617   MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", digel804_rs232_defaults)
618
596619   MCFG_RAM_ADD(RAM_TAG)
597620   MCFG_RAM_DEFAULT_SIZE("256K")
598621   MCFG_RAM_EXTRA_OPTIONS("32K,64K,128K")
r242497r242498
609632   MCFG_CPU_PROGRAM_MAP(z80_mem_804_1_2)
610633   MCFG_CPU_IO_MAP(z80_io_1_2)
611634
635   MCFG_DEVICE_MODIFY("acia")
636   MCFG_MOS6551_IRQ_HANDLER(WRITELINE(digel804_state, ep804_acia_irq_w))
637
612638   MCFG_RAM_MODIFY(RAM_TAG)
613639   MCFG_RAM_DEFAULT_SIZE("32K")
614640   MCFG_RAM_EXTRA_OPTIONS("64K")
trunk/src/mess/layout/digel804.lay
r242497r242498
214214      </bezel>
215215   </view>
216216
217   <view name="Terminal">
218      <screen index="0">
219         <bounds x="0" y="0" width="4" height="3" />
220      </screen>
221   </view>
222217</mamelayout>


Previous 199869 Revisions Next


© 1997-2024 The MAME Team