// license:BSD-3-Clause // copyright-holder:FelipeSanches // // Control ID x628 // // This is a fingerprint reader device // // TODO: Emulate the other CPU board (supposedly runs the Linux kernel on // a dedicated SoC targeting image-processing typically used on // fingerprint readers). The SoC is labelled ZKSoftware ZK6001 // and someone online suggested it may be a rebranded device from // Ingenic, so likely a MIPS32 or MIPS64. // // It has a 32Mb flash-rom and an ethernet controller // (model is Realtek RTL8201BL) // // While the 8051 board has a tiny buzzer (and a battery-backed RAM) // the other PCB interfaces with an audio speaker. // // There's also an RJ45 connector (ethernet port) as well as a // DB9 connector which seems to be used for a serial interface. // // Finally, there are 2 LEDs, a 128x64 LCD with blueish backlight // and a keypad with the following layout: // // 1 2 3 ESC // 4 5 6 MENU // 7 8 9 UP-ARROW // . 0 OK DOWN-ARROW #include "emu.h" #include "cpu/mcs51/mcs51.h" #include "video/nt7534.h" #include "emupal.h" #include "screen.h" class controlidx628_state : public driver_device { public: controlidx628_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_lcdc(*this, "nt7534") { } void controlidx628(machine_config &config); private: virtual void machine_start() override; DECLARE_WRITE8_MEMBER(p0_w); DECLARE_READ8_MEMBER(p1_r); DECLARE_WRITE8_MEMBER(p1_w); DECLARE_READ8_MEMBER(p2_r); DECLARE_READ8_MEMBER(p3_r); DECLARE_WRITE8_MEMBER(p3_w); DECLARE_PALETTE_INIT(controlidx628); void io_map(address_map &map); required_device m_lcdc; uint8_t m_p0_data; uint8_t m_p1_data; uint8_t m_p3_data; }; void controlidx628_state::machine_start() { m_p0_data = 0xff; m_p1_data = 0xff; m_p3_data = 0xff; save_item(NAME(m_p0_data)); save_item(NAME(m_p1_data)); save_item(NAME(m_p3_data)); } /************************* * Memory map information * *************************/ void controlidx628_state::io_map(address_map &map) { map(0x8000, 0xffff).ram(); } WRITE8_MEMBER(controlidx628_state::p0_w) { m_p0_data = data; } READ8_MEMBER(controlidx628_state::p1_r) { // P1.1 is used for serial I/O; P1.4 and P1.5 are also used bidirectionally return 0xcd; } WRITE8_MEMBER(controlidx628_state::p1_w) { if ((BIT(m_p1_data, 6) == 0) && (BIT(data, 6) == 1)) // on raising-edge of bit 6 { m_lcdc->write(space, BIT(data, 7), m_p0_data); } // P1.0 is also used as a serial I/O clock m_p1_data = data; } READ8_MEMBER(controlidx628_state::p2_r) { // Low nibble used for input return 0xf0; } READ8_MEMBER(controlidx628_state::p3_r) { // P3.3 (INT1) and P3.4 (T0) used bidirectionally return 0xff; } WRITE8_MEMBER(controlidx628_state::p3_w) { m_p3_data = data; } /************************* * Input ports * *************************/ //static INPUT_PORTS_START( controlidx628 ) //INPUT_PORTS_END PALETTE_INIT_MEMBER(controlidx628_state, controlidx628) { // These colors were selected from a photo of the display // using the color-picker in Inkscape: palette.set_pen_color(0, rgb_t(0x06, 0x61, 0xEE)); palette.set_pen_color(1, rgb_t(0x00, 0x23, 0x84)); } /************************* * Machine Driver * *************************/ MACHINE_CONFIG_START(controlidx628_state::controlidx628) // basic machine hardware MCFG_DEVICE_ADD("maincpu", AT89S52, XTAL(11'059'200)) MCFG_DEVICE_IO_MAP(io_map) MCFG_MCS51_PORT_P0_OUT_CB(WRITE8(*this, controlidx628_state, p0_w)) MCFG_MCS51_PORT_P1_IN_CB(READ8(*this, controlidx628_state, p1_r)) MCFG_MCS51_PORT_P1_OUT_CB(WRITE8(*this, controlidx628_state, p1_w)) MCFG_MCS51_PORT_P2_IN_CB(READ8(*this, controlidx628_state, p2_r)) MCFG_MCS51_PORT_P3_IN_CB(READ8(*this, controlidx628_state, p3_r)) MCFG_MCS51_PORT_P3_OUT_CB(WRITE8(*this, controlidx628_state, p3_w)) // video hardware MCFG_SCREEN_ADD("screen", LCD) MCFG_SCREEN_REFRESH_RATE(50) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) // not accurate MCFG_SCREEN_SIZE(132, 65) MCFG_SCREEN_VISIBLE_AREA(3, 130, 0, 63) MCFG_SCREEN_UPDATE_DEVICE("nt7534", nt7534_device, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 2) MCFG_PALETTE_INIT_OWNER(controlidx628_state, controlidx628) NT7534(config, m_lcdc); MACHINE_CONFIG_END /************************* * Rom Load * *************************/ ROM_START( cidx628 ) ROM_REGION( 0x2000, "maincpu", 0 ) ROM_LOAD( "controlid_x628.u1", 0x0000, 0x2000, CRC(500d79b4) SHA1(5522115f2da622db389e067fcdd4bccb7aa8561a) ) ROM_END COMP(200?, cidx628, 0, 0, controlidx628, 0, controlidx628_state, empty_init, "ControlID", "X628", MACHINE_NOT_WORKING|MACHINE_NO_SOUND)