Previous 15994 Revisions Next

r7220 Monday 1st February, 2010 at 09:42:02 UTC by Robbbert
[PDP1] Removed odd memory arrangements; the debugger memory view now agrees with the disassembly.
[src/mess/drivers]pdp1.c
[src/mess/machine]pdp1.c

src/mess/machine/pdp1.c
r7219r7220
6464
6565static void iot_cks(running_device *device, int op2, int nac, int mb, int *io, int ac);
6666
67/* pointer to pdp-1 RAM */
68static int *pdp1_memory;
6967
70
7168/*
7269    devices which are known to generate a completion pulse (source: maintainance manual 9-??,
7370    and 9-20, 9-21):
r7219r7220
169166#define PARALLEL_DRUM_ROTATION_TIME ATTOTIME_IN_NSEC(8500*4096)
170167
171168
172static DIRECT_UPDATE_HANDLER(setOPbasefunc)
173{
174   /* just to get rid of the warnings */
175   return ~1;
176}
177
178
179169pdp1_reset_param_t pdp1_reset_param =
180170{
181171   {   /* external iot handlers.  NULL means that the iot is unimplemented, unless there are
r7219r7220
212202
213203MACHINE_RESET( pdp1 )
214204{
215   int config;
205   int cfg;
216206
217   config = input_port_read(machine, "CFG");
218   pdp1_reset_param.extend_support = (config >> pdp1_config_extend_bit) & pdp1_config_extend_mask;
219   pdp1_reset_param.hw_mul_div = (config >> pdp1_config_hw_mul_div_bit) & pdp1_config_hw_mul_div_mask;
220   pdp1_reset_param.type_20_sbs = (config >> pdp1_config_type_20_sbs_bit) & pdp1_config_type_20_sbs_mask;
207   cfg = input_port_read(machine, "CFG");
208   pdp1_reset_param.extend_support = (cfg >> pdp1_config_extend_bit) & pdp1_config_extend_mask;
209   pdp1_reset_param.hw_mul_div = (cfg >> pdp1_config_hw_mul_div_bit) & pdp1_config_hw_mul_div_mask;
210   pdp1_reset_param.type_20_sbs = (cfg >> pdp1_config_type_20_sbs_bit) & pdp1_config_type_20_sbs_mask;
221211
222212   /* reset device state */
223213   tape_reader.rcl = tape_reader.rc = 0;
r7219r7220
245235MACHINE_START( pdp1 )
246236{
247237   UINT8 *dst;
248   const address_space *space = cputag_get_address_space( machine, "maincpu", ADDRESS_SPACE_PROGRAM );
249238
250239   static const unsigned char fontdata6x8[pdp1_fontdata_size] =
251240   {   /* ASCII characters */
r7219r7220
372361      0x00,
373362   };
374363
375   /* set up memory regions */
376   pdp1_memory = auto_alloc_array(machine, int, 0x40000 / sizeof(int));
377
378364   /* set up our font */
379365   dst = memory_region(machine, "gfx1");
380366   memcpy(dst, fontdata6x8, pdp1_fontdata_size);
381367
382   memory_set_direct_update_handler(space, setOPbasefunc);
383
384368   add_exit_callback(machine, pdp1_machine_stop);
385369   
386370   tape_reader.timer = timer_alloc(machine, reader_callback, NULL);
r7219r7220
390374}
391375
392376
393READ18_HANDLER(pdp1_read_mem)
394{
395   return pdp1_memory ? pdp1_memory[offset] : 0;
396}
397
398
399WRITE18_HANDLER(pdp1_write_mem)
400{
401   if (pdp1_memory)
402      pdp1_memory[offset] = data;
403}
404
405
406377/*
407378    perforated tape handling
408379*/
src/mess/drivers/pdp1.c
r7219r7220
5959 */
6060
6161
62
63
64
65/* every memory handler is the same for now */
66
67/* note: MEMORY HANDLERS used everywhere, since we don't need bytes, we
68 * need 18 bit words, the handler functions return integers, so it should
69 * be all right to use them.
70 * This gives sometimes IO warnings!
71 */
72#ifdef SUPPORT_ODD_WORD_SIZES
73#define pdp1_read_mem SMH_RAM
74#define pdp1_write_mem SMH_RAM
75#endif
7662static ADDRESS_MAP_START(pdp1_map, ADDRESS_SPACE_PROGRAM, 32)
77#if 0
78   AM_RANGE(0x0000, 0xffff) AM_READWRITE(pdp1_read_mem, pdp1_write_mem)
79#else
80   AM_RANGE(0x00000, 0x3ffff) AM_READWRITE(pdp1_read_mem, pdp1_write_mem)
81#endif
63   AM_RANGE(0x00000, 0x3ffff) AM_RAM
8264ADDRESS_MAP_END
8365
8466static INPUT_PORTS_START( pdp1 )
85
86    PORT_START("SPACEWAR")      /* 0: spacewar controllers */
67   PORT_START("SPACEWAR")      /* 0: spacewar controllers */
8768   PORT_BIT( ROTATE_LEFT_PLAYER1, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_NAME("Spin Left Player 1") PORT_CODE(KEYCODE_A) PORT_CODE(JOYCODE_X_LEFT_SWITCH)
8869   PORT_BIT( ROTATE_RIGHT_PLAYER1, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_NAME("Spin Right Player 1") PORT_CODE(KEYCODE_S) PORT_CODE(JOYCODE_X_RIGHT_SWITCH)
8970   PORT_BIT( THRUST_PLAYER1, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Thrust Player 1") PORT_CODE(KEYCODE_D) PORT_CODE(JOYCODE_BUTTON1)
r7219r7220
11091   PORT_BIT(pdp1_single_step, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("single step") PORT_CODE(KEYCODE_STOP)
11192   PORT_BIT(pdp1_single_inst, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("single inst") PORT_CODE(KEYCODE_SLASH)
11293
113    PORT_START("SENSE")      /* 2: operator control panel sense switches */
94   PORT_START("SENSE")      /* 2: operator control panel sense switches */
11495   PORT_DIPNAME(     040, 000, "Sense Switch 1") PORT_CODE(KEYCODE_1_PAD)
115    PORT_DIPSETTING(    000, DEF_STR( Off ) )
116    PORT_DIPSETTING(    040, DEF_STR( On ) )
96   PORT_DIPSETTING(    000, DEF_STR( Off ) )
97   PORT_DIPSETTING(    040, DEF_STR( On ) )
11798   PORT_DIPNAME(     020, 000, "Sense Switch 2") PORT_CODE(KEYCODE_2_PAD)
118    PORT_DIPSETTING(    000, DEF_STR( Off ) )
119    PORT_DIPSETTING(    020, DEF_STR( On ) )
99   PORT_DIPSETTING(    000, DEF_STR( Off ) )
100   PORT_DIPSETTING(    020, DEF_STR( On ) )
120101   PORT_DIPNAME(     010, 000, "Sense Switch 3") PORT_CODE(KEYCODE_3_PAD)
121    PORT_DIPSETTING(    000, DEF_STR( Off ) )
122    PORT_DIPSETTING(    010, DEF_STR( On ) )
102   PORT_DIPSETTING(    000, DEF_STR( Off ) )
103   PORT_DIPSETTING(    010, DEF_STR( On ) )
123104   PORT_DIPNAME(     004, 000, "Sense Switch 4") PORT_CODE(KEYCODE_4_PAD)
124    PORT_DIPSETTING(    000, DEF_STR( Off ) )
125    PORT_DIPSETTING(    004, DEF_STR( On ) )
105   PORT_DIPSETTING(    000, DEF_STR( Off ) )
106   PORT_DIPSETTING(    004, DEF_STR( On ) )
126107   PORT_DIPNAME(     002, 002, "Sense Switch 5") PORT_CODE(KEYCODE_5_PAD)
127    PORT_DIPSETTING(    000, DEF_STR( Off ) )
128    PORT_DIPSETTING(    002, DEF_STR( On ) )
108   PORT_DIPSETTING(    000, DEF_STR( Off ) )
109   PORT_DIPSETTING(    002, DEF_STR( On ) )
129110   PORT_DIPNAME(     001, 000, "Sense Switch 6") PORT_CODE(KEYCODE_6_PAD)
130    PORT_DIPSETTING(    000, DEF_STR( Off ) )
131    PORT_DIPSETTING(    001, DEF_STR( On ) )
111   PORT_DIPSETTING(    000, DEF_STR( Off ) )
112   PORT_DIPSETTING(    001, DEF_STR( On ) )
132113
133    PORT_START("TSTADD")      /* 3: operator control panel test address switches */
114   PORT_START("TSTADD")      /* 3: operator control panel test address switches */
134115   PORT_BIT( 0100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Extension Test Address Switch 3") PORT_CODE(KEYCODE_1)
135116   PORT_BIT( 0040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Extension Test Address Switch 4") PORT_CODE(KEYCODE_2)
136117   PORT_BIT( 0020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Extension Test Address Switch 5") PORT_CODE(KEYCODE_3)
r7219r7220
148129      PORT_BIT( 0000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Address Switch 17") PORT_CODE(KEYCODE_E)
149130      PORT_BIT( 0000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Address Switch 18") PORT_CODE(KEYCODE_R)
150131
151    PORT_START("TWDMSB")      /* 4: operator control panel test word switches MSB */
132   PORT_START("TWDMSB")      /* 4: operator control panel test word switches MSB */
152133   PORT_BIT(    0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Word Switch 1") PORT_CODE(KEYCODE_A)
153134   PORT_BIT(    0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Word Switch 2") PORT_CODE(KEYCODE_S)
154135
155    PORT_START("TWDLSB")      /* 5: operator control panel test word switches LSB */
136   PORT_START("TWDLSB")      /* 5: operator control panel test word switches LSB */
156137   PORT_BIT( 0100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Word Switch 3") PORT_CODE(KEYCODE_D)
157138   PORT_BIT( 0040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Word Switch 4") PORT_CODE(KEYCODE_F)
158139   PORT_BIT( 0020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Test Word Switch 5") PORT_CODE(KEYCODE_G)
r7219r7220
174155        Note that I can see 2 additional keys whose purpose is unknown to me.
175156        The caps look like "MAR REL" for the leftmost one and "MAR SET" for
176157        rightmost one: maybe they were used to set the margin (I don't have the
177        manual for the typewriter).
178    */
179    PORT_START("TWR0")      /* 6: typewriter codes 00-17 */
158        manual for the typewriter). */
159
160   PORT_START("TWR0")      /* 6: typewriter codes 00-17 */
180161   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(Space)") PORT_CODE(KEYCODE_SPACE)
181162   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1 \"") PORT_CODE(KEYCODE_1)
182163   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2 '") PORT_CODE(KEYCODE_2)
r7219r7220
188169   PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8 >") PORT_CODE(KEYCODE_8)
189170   PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9 (up arrow)") PORT_CODE(KEYCODE_9)
190171
191    PORT_START("TWR1")      /* 7: typewriter codes 20-37 */
172   PORT_START("TWR1")      /* 7: typewriter codes 20-37 */
192173   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0 (right arrow)") PORT_CODE(KEYCODE_0)
193174   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH)
194175   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S)
r7219r7220
202183   PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(", =") PORT_CODE(KEYCODE_COMMA)
203184   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab Key") PORT_CODE(KEYCODE_TAB)
204185
205    PORT_START("TWR2")      /* 8: typewriter codes 40-57 */
186   PORT_START("TWR2")      /* 8: typewriter codes 40-57 */
206187   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(non-spacing middle dot) _") PORT_CODE(KEYCODE_QUOTE)
207188   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J)
208189   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K)
r7219r7220
218199   PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(non-spacing overstrike) |") PORT_CODE(KEYCODE_OPENBRACE)
219200   PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("( [") PORT_CODE(KEYCODE_MINUS)
220201
221    PORT_START("TWR3")      /* 9: typewriter codes 60-77 */
202   PORT_START("TWR3")      /* 9: typewriter codes 60-77 */
222203   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A)
223204   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B)
224205   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C)
r7219r7220
238219
239220   PORT_START("CFG")      /* 10: pseudo-input port with config */
240221   PORT_DIPNAME( 0x0003, 0x0002, "RAM size")
241    PORT_DIPSETTING(   0x0000, "4kw" )
242    PORT_DIPSETTING(   0x0001, "32kw")
243    PORT_DIPSETTING(   0x0002, "64kw")
222   PORT_DIPSETTING(   0x0000, "4kw" )
223   PORT_DIPSETTING(   0x0001, "32kw")
224   PORT_DIPSETTING(   0x0002, "64kw")
244225   PORT_DIPNAME( 0x0004, 0x0000, "Hardware multiply")
245    PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
246    PORT_DIPSETTING(   0x0004, DEF_STR( On ) )
226   PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
227   PORT_DIPSETTING(   0x0004, DEF_STR( On ) )
247228   PORT_DIPNAME( 0x0008, 0x0000, "Hardware divide")
248    PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
249    PORT_DIPSETTING(   0x0008, DEF_STR( On ) )
229   PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
230   PORT_DIPSETTING(   0x0008, DEF_STR( On ) )
250231   PORT_DIPNAME( 0x0010, 0x0000, "Type 20 sequence break system")
251    PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
252    PORT_DIPSETTING(   0x0010, DEF_STR( On ) )
232   PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
233   PORT_DIPSETTING(   0x0010, DEF_STR( On ) )
253234   PORT_DIPNAME( 0x0020, 0x0000, "Type 32 light pen") PORT_CODE(KEYCODE_ENTER_PAD)
254    PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
255    PORT_DIPSETTING(   0x0020, DEF_STR( On ) )
235   PORT_DIPSETTING(   0x0000, DEF_STR( Off ) )
236   PORT_DIPSETTING(   0x0020, DEF_STR( On ) )
256237
257238   PORT_START("LIGHTPEN")   /* 11: pseudo-input port with lightpen status */
258239   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("select larger light pen tip") PORT_CODE(KEYCODE_PLUS_PAD)
r7219r7220
264245
265246   PORT_START("LIGHTY") /* 13: lightpen - Y AXIS */
266247   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) PORT_RESET
267
268
269248INPUT_PORTS_END
270249
271250

Previous 15994 Revisions Next


© 1998-2018 The MESS Team