src/mess/drivers/instruct.c
| r15237 | r15238 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | instruct |
| 3 | Signetics Intructor 50 |
| 4 | 4 | |
| 5 | | 08/04/2010 Skeleton driver. |
| 5 | 08/04/2010 Skeleton driver. |
| 6 | 20/05/2012 Connected digits, system boots. [Robbbert] |
| 6 | 7 | |
| 7 | | The eprom and 128 bytes of ram are in a 2656 chip. There is no |
| 8 | | useful info on this device on the net, particularly where in the |
| 9 | | memory map the ram resides. |
| 8 | The eprom and 128 bytes of ram are in a 2656 chip. There is no |
| 9 | useful info on this device on the net, particularly where in the |
| 10 | memory map the ram resides. |
| 10 | 11 | |
| 11 | | The Instructor has 512 bytes of ram, plus the 128 bytes mentioned |
| 12 | | above. The clock speed is supposedly 875kHz. |
| 12 | The Instructor has 512 bytes of ram, plus the 128 bytes mentioned |
| 13 | above. The clock speed is supposedly 875kHz. |
| 13 | 14 | |
| 14 | | There is a big lack of info on this computer. No schematics, no i/o |
| 15 | | list or memory map. There is a block diagram which imparts little. |
| 15 | There is a big lack of info on this computer. No schematics, no i/o |
| 16 | list or memory map. There is a block diagram which imparts little. |
| 16 | 17 | |
| 18 | ToDO: |
| 19 | - Keys are not correct. Matrix to be worked out, and the polarity. |
| 20 | So far pressing random keys results in 'Error 2' or a freeze. |
| 21 | - Key names to be found out. |
| 22 | - Connect slide switches and 8 round leds. |
| 23 | - See if it had a speaker or a cassette interface. |
| 24 | |
| 17 | 25 | ****************************************************************************/ |
| 18 | 26 | |
| 19 | 27 | #include "emu.h" |
| 20 | 28 | #include "cpu/s2650/s2650.h" |
| 29 | #include "instruct.lh" |
| 21 | 30 | |
| 22 | | |
| 23 | 31 | class instruct_state : public driver_device |
| 24 | 32 | { |
| 25 | 33 | public: |
| 26 | 34 | instruct_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | 35 | : driver_device(mconfig, type, tag), |
| 28 | | m_maincpu(*this, "maincpu") |
| 29 | | { } |
| 36 | m_maincpu(*this, "maincpu"), |
| 37 | m_p_ram(*this, "p_ram") |
| 38 | { } |
| 30 | 39 | |
| 31 | 40 | required_device<cpu_device> m_maincpu; |
| 32 | | DECLARE_READ8_MEMBER( instruct_fc_r ); |
| 33 | | DECLARE_READ8_MEMBER( instruct_fd_r ); |
| 34 | | DECLARE_READ8_MEMBER( instruct_sense_r ); |
| 35 | | DECLARE_WRITE8_MEMBER( instruct_f8_w ); |
| 41 | DECLARE_READ8_MEMBER(instruct_fc_r); |
| 42 | DECLARE_READ8_MEMBER(instruct_fd_r); |
| 43 | DECLARE_READ8_MEMBER(portfe_r); |
| 44 | DECLARE_READ8_MEMBER(instruct_sense_r); |
| 45 | DECLARE_WRITE8_MEMBER(instruct_f8_w); |
| 46 | DECLARE_WRITE8_MEMBER(portf9_w); |
| 47 | DECLARE_WRITE8_MEMBER(portfa_w); |
| 48 | virtual void machine_reset(); |
| 49 | required_shared_ptr<UINT8> m_p_ram; |
| 50 | UINT8 m_digit; |
| 51 | bool m_valid_digit; |
| 36 | 52 | }; |
| 37 | 53 | |
| 38 | | WRITE8_MEMBER(instruct_state::instruct_f8_w) |
| 54 | WRITE8_MEMBER( instruct_state::instruct_f8_w ) |
| 39 | 55 | { |
| 56 | printf("%X ",data); |
| 40 | 57 | } |
| 41 | 58 | |
| 42 | | READ8_MEMBER(instruct_state::instruct_fc_r) |
| 59 | WRITE8_MEMBER( instruct_state::portf9_w ) |
| 43 | 60 | { |
| 61 | if (m_valid_digit) |
| 62 | output_set_digit_value(m_digit, data); |
| 63 | m_valid_digit = false; |
| 64 | } |
| 65 | |
| 66 | WRITE8_MEMBER( instruct_state::portfa_w ) |
| 67 | { |
| 68 | m_digit = data; |
| 69 | m_valid_digit = true; |
| 70 | } |
| 71 | |
| 72 | READ8_MEMBER( instruct_state::instruct_fc_r ) |
| 73 | { |
| 44 | 74 | return 0; |
| 45 | 75 | } |
| 46 | 76 | |
| 47 | | READ8_MEMBER(instruct_state::instruct_fd_r) |
| 77 | READ8_MEMBER( instruct_state::instruct_fd_r ) |
| 48 | 78 | { |
| 49 | 79 | return 0; |
| 50 | 80 | } |
| 51 | 81 | |
| 52 | | READ8_MEMBER(instruct_state::instruct_sense_r) |
| 82 | READ8_MEMBER( instruct_state::portfe_r ) |
| 53 | 83 | { |
| 84 | UINT8 data = 0xff, i; |
| 85 | |
| 86 | for (i = 0; i < 8; i++) |
| 87 | { |
| 88 | if (BIT(m_digit, i)) |
| 89 | { |
| 90 | char kbdrow[6]; |
| 91 | sprintf(kbdrow,"X%X",i); |
| 92 | data = ioport(kbdrow)->read(); |
| 93 | break; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | return data; |
| 98 | } |
| 99 | |
| 100 | READ8_MEMBER( instruct_state::instruct_sense_r ) |
| 101 | { |
| 54 | 102 | return 0; |
| 55 | 103 | } |
| 56 | 104 | |
| 57 | | static ADDRESS_MAP_START(instruct_mem, AS_PROGRAM, 8, instruct_state) |
| 105 | static ADDRESS_MAP_START( instruct_mem, AS_PROGRAM, 8, instruct_state ) |
| 58 | 106 | ADDRESS_MAP_UNMAP_HIGH |
| 59 | | AM_RANGE( 0x0000, 0x07ff) AM_ROM |
| 60 | | AM_RANGE( 0x1700, 0x17ff) AM_RAM |
| 61 | | AM_RANGE( 0x1f00, 0x1fff) AM_RAM |
| 107 | AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("p_ram") |
| 62 | 108 | ADDRESS_MAP_END |
| 63 | 109 | |
| 64 | | static ADDRESS_MAP_START( instruct_io, AS_IO, 8, instruct_state) |
| 110 | static ADDRESS_MAP_START( instruct_io, AS_IO, 8, instruct_state ) |
| 65 | 111 | ADDRESS_MAP_UNMAP_HIGH |
| 66 | | AM_RANGE(0xf8, 0xf8) AM_WRITE(instruct_f8_w) |
| 67 | | AM_RANGE(0xfc, 0xfc) AM_READ(instruct_fc_r) |
| 68 | | AM_RANGE(0xfd, 0xfd) AM_READ(instruct_fd_r) |
| 69 | | AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(instruct_sense_r) |
| 112 | //AM_RANGE(0xf8, 0xf8) AM_WRITE(instruct_f8_w) |
| 113 | AM_RANGE(0xf9, 0xf9) AM_WRITE(portf9_w) |
| 114 | AM_RANGE(0xfa, 0xfa) AM_WRITE(portfa_w) |
| 115 | //AM_RANGE(0xfc, 0xfc) AM_READ(instruct_fc_r) |
| 116 | //AM_RANGE(0xfd, 0xfd) AM_READ(instruct_fd_r) |
| 117 | AM_RANGE(0xfe, 0xfe) AM_READ(portfe_r) |
| 118 | //AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(instruct_sense_r) |
| 119 | AM_RANGE(0x102, 0x103) AM_NOP // stops error log filling up while using debug |
| 70 | 120 | ADDRESS_MAP_END |
| 71 | 121 | |
| 72 | 122 | /* Input ports */ |
| 73 | 123 | static INPUT_PORTS_START( instruct ) |
| 124 | PORT_START("X0") |
| 125 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 126 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 127 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 128 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U0") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 129 | |
| 130 | PORT_START("X1") |
| 131 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 132 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 133 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 134 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U1") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 135 | |
| 136 | PORT_START("X2") |
| 137 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 138 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 139 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 140 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U2") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 141 | |
| 142 | PORT_START("X3") |
| 143 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 144 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 145 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 146 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U3") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 147 | |
| 148 | PORT_START("X4") |
| 149 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 150 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 151 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 152 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U4") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 153 | |
| 154 | PORT_START("X5") |
| 155 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 156 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 157 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 158 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U5") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 159 | |
| 160 | PORT_START("X6") |
| 161 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 162 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR('^') |
| 163 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 164 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U6") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 165 | |
| 166 | PORT_START("X7") |
| 167 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 168 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR('V') |
| 169 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 170 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U7") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 74 | 171 | INPUT_PORTS_END |
| 75 | 172 | |
| 76 | 173 | |
| 77 | | static MACHINE_RESET(instruct) |
| 174 | void instruct_state::machine_reset() |
| 78 | 175 | { |
| 176 | // copy the roms into ram |
| 177 | UINT8* ROM = memregion("maincpu")->base(); |
| 178 | memcpy(m_p_ram, ROM, 0x0800); |
| 179 | memcpy(m_p_ram+0x1800, ROM, 0x0800); |
| 79 | 180 | } |
| 80 | 181 | |
| 81 | | static VIDEO_START( instruct ) |
| 82 | | { |
| 83 | | } |
| 84 | 182 | |
| 85 | | static SCREEN_UPDATE_IND16( instruct ) |
| 86 | | { |
| 87 | | return 0; |
| 88 | | } |
| 89 | | |
| 90 | 183 | static MACHINE_CONFIG_START( instruct, instruct_state ) |
| 91 | 184 | /* basic machine hardware */ |
| 92 | 185 | MCFG_CPU_ADD("maincpu",S2650, XTAL_1MHz) |
| 93 | 186 | MCFG_CPU_PROGRAM_MAP(instruct_mem) |
| 94 | 187 | MCFG_CPU_IO_MAP(instruct_io) |
| 95 | 188 | |
| 96 | | MCFG_MACHINE_RESET(instruct) |
| 97 | | |
| 98 | 189 | /* video hardware */ |
| 99 | | MCFG_SCREEN_ADD("screen", RASTER) |
| 100 | | MCFG_SCREEN_REFRESH_RATE(50) |
| 101 | | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 102 | | MCFG_SCREEN_SIZE(640, 480) |
| 103 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 104 | | MCFG_SCREEN_UPDATE_STATIC(instruct) |
| 105 | | |
| 106 | | MCFG_PALETTE_LENGTH(2) |
| 107 | | MCFG_PALETTE_INIT(black_and_white) |
| 108 | | |
| 109 | | MCFG_VIDEO_START(instruct) |
| 190 | MCFG_DEFAULT_LAYOUT(layout_instruct) |
| 110 | 191 | MACHINE_CONFIG_END |
| 111 | 192 | |
| 112 | 193 | /* ROM definition */ |
| r15237 | r15238 | |
| 117 | 198 | |
| 118 | 199 | /* Driver */ |
| 119 | 200 | |
| 120 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 121 | | COMP( 1978, instruct, 0, 0, instruct, instruct, 0, "Signetics", "Signetics Instructor 50", GAME_NOT_WORKING | GAME_NO_SOUND ) |
| 122 | | |
| 201 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 202 | COMP( 1978, instruct, 0, 0, instruct, instruct, 0, "Signetics", "Signetics Instructor 50", GAME_NOT_WORKING | GAME_NO_SOUND ) |