Previous 15994 Revisions Next

r15241 Sunday 20th May, 2012 at 10:36:35 UTC by Robbbert
Instructor - system is now usable [Robbbert]
[src/mess/drivers]instruct.c

src/mess/drivers/instruct.c
r15240r15241
44
55    08/04/2010 Skeleton driver.
66    20/05/2012 Connected digits, system boots. [Robbbert]
7    20/05/2012 Connected keyboard, system mostly usable. [Robbbert]
78
89    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    useful info on this device on the net. It does appear though,
11    that it divides the 3.58MHz crystal by 4 for the CPU.
1112
12    The Instructor has 512 bytes of ram, plus the 128 bytes mentioned
13    above. The clock speed is supposedly 875kHz.
13    The system also has 512 bytes of ram in an ordinary ram chip.
1414
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.
15    There are no known schematics for this computer. There is a block
16    diagram which imparts little.
1717
18    From looking at a blurry picture of it, this is what I can determine:
19    - Left side: 8 toggle switches, with a round red led above each one.
20    - Below this is another toggle switch with choice of 'Extended' or 'I/O port 07'.
21    - To the right of this is another toggle switch labelled 'Interrupt', the
22      choices are 'Direct' and 'Indirect'.
23    - Above this switch are 2 more round red leds: FLAG and RUN.
24    - Middle: a 4 down x3 across keypad containing the function keys. The
25      labels (from left to right, top to bottom) seem to be:
26      SENS, WCAS, BKPT, INT, RCAS, REG, MON, STEP, MEM, RST, RUN, ENT/NXT.
27    - Right side: a 4x4 hexadecimal keypad. The keys are:
28      C, D, E, F, 8, 9, A, B, 4, 5, 6, 7, 0, 1, 2, 3
29    - Above, extending from one side to the other is a metal plate with
30      printed mnemonics. At the right edge are sockets to connect up the
31      MIC and EAR cords to a cassette player.
32    - At the back is a S100 interface.
33
34    Quick usage:
35    - Look at memory: Press minus key. Enter an address. Press UP key to see the next.
36    - Look at registers: Press R. Press 0. Press UP key to see the next.
37    - Look at PC register: Press R. Press C.
38
1839    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.
40    - Keys are mostly correct. It seems the SENS, INT, MON, RST keys are
41      not in the matrix, but are connected to hardware directly. This needs
42      to be emulated.
43    - Connect 10 toggle switches and 10 round red leds.
44    - Cassette interface.
2445
2546****************************************************************************/
2647
r15240r15241
3859   { }
3960
4061   required_device<cpu_device> m_maincpu;
41   DECLARE_READ8_MEMBER(instruct_fc_r);
42   DECLARE_READ8_MEMBER(instruct_fd_r);
62   DECLARE_READ8_MEMBER(portfc_r);
63   DECLARE_READ8_MEMBER(portfd_r);
4364   DECLARE_READ8_MEMBER(portfe_r);
44   DECLARE_READ8_MEMBER(instruct_sense_r);
45   DECLARE_WRITE8_MEMBER(instruct_f8_w);
65   DECLARE_READ8_MEMBER(sense_r);
66   DECLARE_WRITE8_MEMBER(portf8_w);
4667   DECLARE_WRITE8_MEMBER(portf9_w);
4768   DECLARE_WRITE8_MEMBER(portfa_w);
4869   virtual void machine_reset();
r15240r15241
5172   bool m_valid_digit;
5273};
5374
54WRITE8_MEMBER( instruct_state::instruct_f8_w )
75// cassette port
76// when loading, bit 7 is continuously toggled
77// saving can use bits 3,4,5
78WRITE8_MEMBER( instruct_state::portf8_w )
5579{
56   printf("%X ",data);
5780}
5881
82// segment output
5983WRITE8_MEMBER( instruct_state::portf9_w )
6084{
6185   if (m_valid_digit)
r15240r15241
6387   m_valid_digit = false;
6488}
6589
90// digit & keyrow-scan select
6691WRITE8_MEMBER( instruct_state::portfa_w )
6792{
6893   m_digit = data;
6994   m_valid_digit = true;
7095}
7196
72READ8_MEMBER( instruct_state::instruct_fc_r )
97// unknown - copied to 17E9 at boot
98READ8_MEMBER( instruct_state::portfc_r )
7399{
74   return 0;
100   return 0x55;
75101}
76102
77READ8_MEMBER( instruct_state::instruct_fd_r )
103// unknown - copied to 17E8 at boot
104READ8_MEMBER( instruct_state::portfd_r )
78105{
79   return 0;
106   return 0xAA;
80107}
81108
109// read keyboard
82110READ8_MEMBER( instruct_state::portfe_r )
83111{
84   UINT8 data = 0xff, i;
112   UINT8 i;
85113
86   for (i = 0; i < 8; i++)
114   for (i = 0; i < 6; i++)
87115   {
88116      if (BIT(m_digit, i))
89117      {
90118         char kbdrow[6];
91119         sprintf(kbdrow,"X%X",i);
92         data = ioport(kbdrow)->read();
93         break;
120         return ioport(kbdrow)->read();
94121      }
95122   }
96123
97   return data;
124   return 0xff;
98125}
99126
100READ8_MEMBER( instruct_state::instruct_sense_r )
127// read SENS key and cassin
128READ8_MEMBER( instruct_state::sense_r )
101129{
102130   return 0;
103131}
104132
105133static ADDRESS_MAP_START( instruct_mem, AS_PROGRAM, 8, instruct_state )
106134   ADDRESS_MAP_UNMAP_HIGH
107   AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("p_ram")
135   AM_RANGE(0x0000, 0x01ff) AM_RAM AM_SHARE("p_ram") // 512 bytes onboard ram
136   AM_RANGE(0x1780, 0x17ff) AM_RAM // 128 bytes in s2656 chip
137   AM_RANGE(0x1800, 0x1fff) AM_ROM
108138ADDRESS_MAP_END
109139
110140static ADDRESS_MAP_START( instruct_io, AS_IO, 8, instruct_state )
111141   ADDRESS_MAP_UNMAP_HIGH
112   //AM_RANGE(0xf8, 0xf8) AM_WRITE(instruct_f8_w)
142   AM_RANGE(0xf8, 0xf8) AM_WRITE(portf8_w)
113143   AM_RANGE(0xf9, 0xf9) AM_WRITE(portf9_w)
114144   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)
145   AM_RANGE(0xfc, 0xfc) AM_READ(portfc_r)
146   AM_RANGE(0xfd, 0xfd) AM_READ(portfd_r)
117147   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
148   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ(sense_r)
120149ADDRESS_MAP_END
121150
122151/* Input ports */
123152static INPUT_PORTS_START( instruct )
124153   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')
154   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
155   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4')
156   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8')
157   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C')
158   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
129159
130160   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')
161   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1')
162   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5')
163   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
164   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D')
165   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
135166
136167   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')
168   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2')
169   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6')
170   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A')
171   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E')
172   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
141173
142174   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')
175   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3')
176   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7')
177   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B')
178   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F')
179   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
147180
148181   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')
182   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("WCAS") PORT_CODE(KEYCODE_S) PORT_CHAR('S')
183   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RCAS") PORT_CODE(KEYCODE_L) PORT_CHAR('L')
184   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("STEP") PORT_CODE(KEYCODE_H) PORT_CHAR('H')
185   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RUN") PORT_CODE(KEYCODE_X) PORT_CHAR('X')
186   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
153187
154188   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')
189   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BKPT") PORT_CODE(KEYCODE_J) PORT_CHAR('J')
190   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("REG") PORT_CODE(KEYCODE_R) PORT_CHAR('R')
191   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MEM") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
192   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENT/NXT") PORT_CODE(KEYCODE_UP) PORT_CHAR('^')
193   PORT_BIT(0xF0, IP_ACTIVE_LOW, IPT_UNUSED)
159194
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')
195   PORT_START("HW")
196   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SENS") PORT_CODE(KEYCODE_U) PORT_CHAR('U')
197   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("INT") PORT_CODE(KEYCODE_I) PORT_CHAR('I')
198   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MON") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
199   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RST") PORT_CODE(KEYCODE_P) PORT_CHAR('P')
171200INPUT_PORTS_END
172201
173202
174203void instruct_state::machine_reset()
175204{
176   // copy the roms into ram
205   // copy the roms into ram so it can boot
177206   UINT8* ROM = memregion("maincpu")->base();
178   memcpy(m_p_ram, ROM, 0x0800);
179   memcpy(m_p_ram+0x1800, ROM, 0x0800);
207   memcpy(m_p_ram, ROM+0x1800, 0x0200);
180208}
181209
182210
183211static MACHINE_CONFIG_START( instruct, instruct_state )
184212   /* basic machine hardware */
185   MCFG_CPU_ADD("maincpu",S2650, XTAL_1MHz)
213   MCFG_CPU_ADD("maincpu",S2650, XTAL_3_579545MHz / 4)
186214   MCFG_CPU_PROGRAM_MAP(instruct_mem)
187215   MCFG_CPU_IO_MAP(instruct_io)
188216
r15240r15241
193221/* ROM definition */
194222ROM_START( instruct )
195223   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
196   ROM_LOAD( "instruct.rom", 0x0000, 0x0800, CRC(131715a6) SHA1(4930b87d09046113ab172ba3fb31f5e455068ec7) )
224   ROM_LOAD( "instruct.rom", 0x1800, 0x0800, CRC(131715a6) SHA1(4930b87d09046113ab172ba3fb31f5e455068ec7) )
197225ROM_END
198226
199227/* Driver */
200228
201229/*    YEAR  NAME       PARENT   COMPAT   MACHINE    INPUT     INIT    COMPANY     FULLNAME                    FLAGS */
202COMP( 1978, instruct,  0,       0,       instruct,  instruct, 0,    "Signetics", "Signetics Instructor 50", GAME_NOT_WORKING | GAME_NO_SOUND )
230COMP( 1978, instruct,  0,       0,       instruct,  instruct, 0,    "Signetics", "Signetics Instructor 50", GAME_NOT_WORKING | GAME_NO_SOUND_HW )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team