// License: BSD-3-Clause // Author: Brandon Munger /****************************************************************************** * * Rolm CBX 9751 Release 9005 Driver * This driver attempts to emulate the following models: * * Model 10 * * Model 40 * * The basis of this driver uses the zexall.c driver by Jonathan Gevaryahu and Robbbert * Memory map: * * 0x08000000 - 0x0800ffff : PROM Region(?) ******************************************************************************/ /* Core includes */ #include "emu.h" #include "cpu/m68000/m68000.h" #include "machine/terminal.h" #define TERMINAL_TAG "terminal" class r9751_state : public driver_device { public: r9751_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_terminal(*this, TERMINAL_TAG), m_main_ram(*this, "main_ram") { } DECLARE_READ8_MEMBER( r9751_output_ack_r ); DECLARE_READ8_MEMBER( r9751_output_req_r ); DECLARE_READ8_MEMBER( r9751_output_data_r ); DECLARE_WRITE8_MEMBER( r9751_output_ack_w ); DECLARE_WRITE8_MEMBER( r9751_output_req_w ); DECLARE_WRITE8_MEMBER( r9751_output_data_w ); DECLARE_DRIVER_INIT(r9751); private: required_device m_maincpu; required_device m_terminal; required_shared_ptr m_main_ram; UINT8 m_out_data; // byte written to 0xFFFF UINT8 m_out_req; // byte written to 0xFFFE UINT8 m_out_req_last; // old value at 0xFFFE before the most recent write UINT8 m_out_ack; // byte written to 0xFFFC virtual void machine_reset(); }; DRIVER_INIT_MEMBER(r9751_state,r9751) { m_out_ack = 0; m_out_req = 0; m_out_req_last = 0; m_out_data = 0; } void r9751_state::machine_reset() { // rom is self-modifying, so need to refresh it on each run //UINT8 *rom = memregion("prom")->base(); //UINT8 *ram = m_main_ram; /* fill main ram with r9751 code */ //memcpy(ram, rom, 0x228a); } READ8_MEMBER( r9751_state::r9751_output_ack_r ) { // spit out the byte in out_byte if out_req is not equal to out_req_last if (m_out_req != m_out_req_last) { m_terminal->write(space,0,m_out_data); fprintf(stderr,"%c",m_out_data); m_out_req_last = m_out_req; m_out_ack++; } return m_out_ack; } WRITE8_MEMBER( r9751_state::r9751_output_ack_w ) { m_out_ack = data; } READ8_MEMBER( r9751_state::r9751_output_req_r ) { return m_out_req; } WRITE8_MEMBER( r9751_state::r9751_output_req_w ) { m_out_req_last = m_out_req; m_out_req = data; } READ8_MEMBER( r9751_state::r9751_output_data_r ) { return m_out_data; } WRITE8_MEMBER( r9751_state::r9751_output_data_w ) { m_out_data = data; } /****************************************************************************** Address Maps ******************************************************************************/ static ADDRESS_MAP_START(r9751_mem, AS_PROGRAM, 32, r9751_state) ADDRESS_MAP_UNMAP_HIGH //AM_RANGE(0x0000, 0xfffc) AM_RAM AM_SHARE("main_ram") //AM_RANGE(0xfffd, 0xfffd) AM_READWRITE(r9751_output_ack_r,r9751_output_ack_w) //AM_RANGE(0xfffe, 0xfffe) AM_READWRITE(r9751_output_req_r,r9751_output_req_w) //AM_RANGE(0xffff, 0xffff) AM_READWRITE(r9751_output_data_r,r9751_output_data_w) //AM_RANGE(0x00000000,0x0000ffff) AM_ROM AM_REGION("prom",0) AM_RANGE(0x00020000,0x00ffffff) AM_RAM AM_SHARE("main_ram") // 16MB AM_RANGE(0x08000000,0x0800ffff) AM_ROM AM_REGION("prom", 0) ADDRESS_MAP_END static ADDRESS_MAP_START(r9751_io, AS_IO, 32, r9751_state) ADDRESS_MAP_UNMAP_HIGH //AM_RANGE(0x0001, 0x0001) AM_NOP // really a disable/enable for some sort of interrupt timer on kev's hardware, which is completely irrelevant for the r9751 test ADDRESS_MAP_END /****************************************************************************** Input Ports ******************************************************************************/ static INPUT_PORTS_START( r9751 ) INPUT_PORTS_END /****************************************************************************** Machine Drivers ******************************************************************************/ static MACHINE_CONFIG_START( r9751, r9751_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68030, 20000000) MCFG_CPU_PROGRAM_MAP(r9751_mem) MCFG_CPU_IO_MAP(r9751_io) MCFG_QUANTUM_TIME(attotime::from_hz(60)) /* video hardware */ MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0) MACHINE_CONFIG_END /****************************************************************************** ROM Definitions ******************************************************************************/ ROM_START(r9751) //ROM_REGION(0x08000000, "prom", 0) ROM_REGION(0x00010000, "prom", 0) //ROM_LOAD("zex.bin", 0x0000, 0x2289, CRC(77e0a1df) SHA1(cc8f84724e3837783816d92a6dfb8e5975232c66)) ROM_SYSTEM_BIOS(0, "prom34", "PROM Version 3.4") ROMX_LOAD( "PROM.9751.9005.V3.4.PN98D4643.bin", 0x0000, 0x10000, CRC(9fb19a85) SHA1(c861e15a2fc9a4ef689c2034c53fbb36f17f7da6),ROM_GROUPWORD | ROM_BIOS(1) ) ROM_END /****************************************************************************** Drivers ******************************************************************************/ /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ COMP( 198?, r9751, 0, 0, r9751, r9751, r9751_state, r9751, "ROLM Systems, Inc.", "ROLM 9751 Release 9005", GAME_NO_SOUND | GAME_NOT_WORKING )