/* Twins Electronic Devices, 1994 PCB Layout ---------- This is a very tiny PCB, only about 6 inches square. |-----------------------| | 6116 16MHz 62256| |TEST 6116 24C02 | | PAL 62256| |J 62256 |--------| | |A |TPC1020 | 2 | |M 62256 |AFN-084C| | |M | | 1 | |A |--------| | | AY3-8910 | | D70116| |-----------------------| Notes: V30 clock : 8.000MHz (16/2) AY3-8910 clock : 2.000MHz (16/8) VSync : 50Hz seems a similar board to hotblocks same TPC1020 AFN-084C chip same 24c02 eeprom V30 instead of I8088 AY3-8910 instead of YM2149 (compatible) video is not banked in this case instead palette data is sent to the ports strange palette format. todo: hook up eeprom takes a long time to boot (eeprom?) Electronic Devices was printed on rom labels 1994 date string is in ROM */ #include "emu.h" #include "cpu/nec/nec.h" #include "sound/ay8910.h" class twins_state : public driver_device { public: twins_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_videoram(*this, "videoram"){ } required_shared_ptr m_videoram; UINT16 *m_pal; UINT16 m_paloff; DECLARE_READ16_MEMBER(twins_port4_r); DECLARE_WRITE16_MEMBER(twins_port4_w); DECLARE_WRITE16_MEMBER(port6_pal0_w); DECLARE_WRITE16_MEMBER(porte_paloff0_w); DECLARE_WRITE16_MEMBER(twinsa_port4_w); DECLARE_READ16_MEMBER(twinsa_unk_r); DECLARE_VIDEO_START(twins); DECLARE_VIDEO_START(twinsa); UINT32 screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_twinsa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; /* port 4 is eeprom */ READ16_MEMBER(twins_state::twins_port4_r) { return 0xffff; } WRITE16_MEMBER(twins_state::twins_port4_w) { } WRITE16_MEMBER(twins_state::port6_pal0_w) { COMBINE_DATA(&m_pal[m_paloff]); m_paloff = (m_paloff + 1) & 0xff; } /* ??? weird ..*/ WRITE16_MEMBER(twins_state::porte_paloff0_w) { m_paloff = 0; } static ADDRESS_MAP_START( twins_map, AS_PROGRAM, 16, twins_state ) AM_RANGE(0x00000, 0x0ffff) AM_RAM AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_SHARE("videoram") AM_RANGE(0x20000, 0xfffff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( twins_io, AS_IO, 16, twins_state ) AM_RANGE(0x0000, 0x0003) AM_DEVWRITE8_LEGACY("aysnd", ay8910_address_data_w, 0x00ff) AM_RANGE(0x0002, 0x0003) AM_DEVREAD8_LEGACY("aysnd", ay8910_r, 0x00ff) AM_RANGE(0x0004, 0x0005) AM_READWRITE(twins_port4_r, twins_port4_w) AM_RANGE(0x0006, 0x0007) AM_WRITE(port6_pal0_w) AM_RANGE(0x000e, 0x000f) AM_WRITE(porte_paloff0_w) ADDRESS_MAP_END VIDEO_START_MEMBER(twins_state,twins) { m_pal = auto_alloc_array(machine(), UINT16, 0x100); } UINT32 twins_state::screen_update_twins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int y,x,count; int i; static const int xxx=320,yyy=204; bitmap.fill(get_black_pen(machine())); for (i=0;i<0x100;i++) { int dat,r,g,b; dat = m_pal[i]; r = dat & 0x1f; r = BITSWAP8(r,7,6,5,0,1,2,3,4); g = (dat>>5) & 0x1f; g = BITSWAP8(g,7,6,5,0,1,2,3,4); b = (dat>>10) & 0x1f; b = BITSWAP8(b,7,6,5,0,1,2,3,4); palette_set_color_rgb(machine(),i, pal5bit(r),pal5bit(g),pal5bit(b)); } count=0; UINT8 *videoram = reinterpret_cast(m_videoram.target()); for (y=0;y(m_videoram.target()); for (y=0;y