Previous 15994 Revisions Next

r4434 Tuesday 24th March, 2009 at 12:14:59 UTC by Robbbert
[TRS80] WIP
[src/mess/drivers]trs80.c
[src/mess/includes]trs80.h
[src/mess/machine]trs80.c

src/mess/includes/trs80.h
r4433r4434
3030DRIVER_INIT( ht108064 );
3131
3232WRITE8_HANDLER ( trs80_ff_w );
33WRITE8_HANDLER ( sys80_f8_w );
3334WRITE8_HANDLER ( trs80m3_eb_w );
3435WRITE8_HANDLER ( trs80m3_ea_w );
3536WRITE8_HANDLER ( trs80m3_e9_w );
3637WRITE8_HANDLER ( trs80m3_e8_w );
3738READ8_HANDLER ( trs80_ff_r );
3839READ8_HANDLER ( trs80_fe_r );
40READ8_HANDLER ( sys80_f9_r );
3941READ8_HANDLER ( trs80m3_eb_r );
4042READ8_HANDLER ( trs80m3_ea_r );
4143READ8_HANDLER ( trs80m3_e8_r );
src/mess/machine/trs80.c
r4433r4434
337337   d6 Data-Set-Ready (DSR), pin 6
338338   d5 Carrier Detect (CD), pin 8
339339   d4 Ring Indicator (RI), pin 22
340   d3..d1 Not used
341   d0 ?? UART Receiver Input, pin 20 (pin 20 is also DTR) */
340   d3,d2,d0 Not used
341   d1 UART Receiver Input, pin 20 (pin 20 is also DTR) */
342342
343343   return 0;   // this is a guess
344344}
r4433r4434
374374   return data;
375375}
376376
377READ8_HANDLER( sys80_f9_r )
378{
379/* UART Status Register (d4..d6 not emulated)
380   d7 Transmit buffer empty (inverted)
381   d6 CTS pin
382   d5 DSR pin
383   d4 CD pin
384   d3 Parity Error
385   d2 Framing Error
386   d1 Overrun
387   d0 Data Available */
388
389   UINT8 data=70;
390   ay31015_set_input_pin( trs80_ay31015, AY31015_SWE, 0 );
391   data |= ay31015_get_output_pin( trs80_ay31015, AY31015_TBMT ) ? 0 : 0x80;
392   data |= ay31015_get_output_pin( trs80_ay31015, AY31015_DAV  ) ? 0x01 : 0;
393   data |= ay31015_get_output_pin( trs80_ay31015, AY31015_OR   ) ? 0x02 : 0;
394   data |= ay31015_get_output_pin( trs80_ay31015, AY31015_FE   ) ? 0x04 : 0;
395   data |= ay31015_get_output_pin( trs80_ay31015, AY31015_PE   ) ? 0x08 : 0;
396   ay31015_set_input_pin( trs80_ay31015, AY31015_SWE, 1 );
397
398   return data;
399}
400
377401READ8_HANDLER( trs80_fe_r )
378402{
379403/* not emulated yet */
r4433r4434
391415WRITE8_HANDLER( trs80m3_e8_w )
392416{
393417/* d1 when '1' enables control register load (see below) */
394   trs80_reg_load = data & 1;
418   trs80_reg_load = data & 2;
395419}
396420
397421WRITE8_HANDLER( trs80m3_e9_w )
r4433r4434
432456   d4 Stop Bit Select ('1'=two stop bits, '0'=one stop bit)
433457   d3 Parity Inhibit ('1'=disable; No parity, '0'=parity enabled)
434458   d2 Break ('0'=disable transmit data; continuous RS232 'SPACE' condition)
435   d1 Data-Terminal-Ready (DTR), pin 20
436   d0 Request-to-Send (RTS), pin 4 */
459   d1 Request-to-Send (RTS), pin 4
460   d0 Data-Terminal-Ready (DTR), pin 20 */
437461
438462   {
439463      ay31015_set_input_pin( trs80_ay31015, AY31015_CS, 0 );
r4433r4434
464488   ay31015_set_transmit_data( trs80_ay31015, data );
465489}
466490
491WRITE8_HANDLER( sys80_f8_w )
492{
493/* These adjust levels at the socket pins - not emulated
494   d2 reset UART (XR pin)
495   d1 DTR
496   d0 RTS */
497}
498
467499WRITE8_HANDLER( trs80_ff_w )
468500{
469501   static const double levels[4] = { 0.0, -1.0, 0.0, 1.0 };
src/mess/drivers/trs80.c
r4433r4434
3232IRQ mode 1
3333NMI
3434
35Printer: Level II usually 37e8; System80 uses port FD; Model 4 uses port F8
36Uart: TR1602, equivalent to the uart used in the Exidy Sorcerer
35Printer: Level II usually 37e8; System80 uses port FD; Model 4 uses port F8.
36Uart: TR1602, equivalent to the uart used in the Exidy Sorcerer.
37System80 has non-addressable dip switches to set the UART control register.
38System80 and LNW80 have non-addressable links to set the baud rate. Receive and Transmit clocks are tied together.
39It is assumed that the TRS80L2 UART setup is identical to the System80, apart from the address ports used.
40Due to the above, the only working emulated UART is for the Model 3.
3741
3842I/O ports
3943FF:
r4433r4434
8286d4 Stop Bit Select ('1'=two stop bits, '0'=one stop bit)
8387d3 Parity Inhibit ('1'=disable; No parity, '0'=parity enabled)
8488d2 Break ('0'=disable transmit data; continuous RS232 'SPACE' condition)
85d1 Data-Terminal-Ready (DTR), pin 20
86d0 Request-to-Send (RTS), pin 4
89d1 Request-to-Send (RTS), pin 4
90d0 Data-Terminal-Ready (DTR), pin 20
8791EAh Output (Write), when E8h bit d1 is '0' (Control Register disabled): bits d5..d3 are secondary line control, and could even be used for steering or multiplexing logic; d2..d0 are Modem line control same as above
8892d7,d6 Not used
8993d5 Secondary Unassigned, pin 18
r4433r4434
131135d6 Data-Set-Ready (DSR), pin 6
132136d5 Carrier Detect (CD), pin 8
133137d4 Ring Indicator (RI), pin 22
134d3..d1 Not used
135d0 ?? UART Receiver Input, pin 20 (pin 20 is also DTR)
138d3..d2,d0 Not used
139d1 UART Receiver Input, pin 20 (pin 20 is also DTR)
136140
137141***************************************************************************
138142
r4433r4434
200204/* memory from 3700-37ff, 8000-ffff only exists when expansion box is used */
201205static ADDRESS_MAP_START( model1_map, ADDRESS_SPACE_PROGRAM, 8 )
202206   AM_RANGE(0x0000, 0x35ff) AM_ROM
207   AM_RANGE(0x37de, 0x37de) AM_READWRITE(sys80_f9_r, sys80_f8_w)
208   AM_RANGE(0x37df, 0x37df) AM_READWRITE(trs80m3_eb_r, trs80m3_eb_w)
203209   AM_RANGE(0x37e0, 0x37e3) AM_READWRITE(trs80_irq_status_r, trs80_motor_w)
204210//   AM_RANGE(0x37e4, 0x37e7) AM_NOP
205211   AM_RANGE(0x37e8, 0x37eb) AM_READWRITE(trs80_printer_r, trs80_printer_w)
r4433r4434
221227
222228static ADDRESS_MAP_START( sys80_io, ADDRESS_SPACE_IO, 8 )
223229   ADDRESS_MAP_GLOBAL_MASK(0xff)
230   AM_RANGE(0xf8, 0xf8) AM_READWRITE(trs80m3_eb_r, sys80_f8_w)
231   AM_RANGE(0xf9, 0xf9) AM_READWRITE(sys80_f9_r, trs80m3_eb_w)
224232   AM_RANGE(0xfd, 0xfd) AM_READWRITE(trs80_printer_r, trs80_printer_w)
225233   AM_RANGE(0xfe, 0xfe) AM_READ(trs80_fe_r)
226234   AM_RANGE(0xff, 0xff) AM_READWRITE(trs80_ff_r, trs80_ff_w)
r4433r4434
228236
229237static ADDRESS_MAP_START( model3_map, ADDRESS_SPACE_PROGRAM, 8 )
230238   AM_RANGE(0x0000, 0x37ff) AM_ROM
231   AM_RANGE(0x3800, 0x38ff) AM_READ(trs80_keyboard_r)
239   AM_RANGE(0x3800, 0x38ff) AM_MIRROR(0x300) AM_READ(trs80_keyboard_r)
232240   AM_RANGE(0x3c00, 0x3fff) AM_READWRITE(SMH_RAM, trs80_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
233241   AM_RANGE(0x4000, 0xffff) AM_RAM
234242ADDRESS_MAP_END
r4433r4434
236244static ADDRESS_MAP_START( model3_io, ADDRESS_SPACE_IO, 8 )
237245   ADDRESS_MAP_GLOBAL_MASK(0xff)
238246   /* the ports marked NOP are not emulated yet */
239//   AM_RANGE(0xe0, 0xe3) AM_READWRITE(trs80_irq_status_r, trs80_irq_mask_w)   // needs to be fixed because it breaks the keyboard
247//   AM_RANGE(0xe0, 0xe3) AM_READWRITE(trs80_irq_status_r, trs80_irq_mask_w)   // it breaks the keyboard
240248   AM_RANGE(0xe4, 0xe4) AM_READWRITE(SMH_NOP,trs80_motor_w)
241249   AM_RANGE(0xe8, 0xe8) AM_READWRITE(trs80m3_e8_r, trs80m3_e8_w)
242   AM_RANGE(0xe9, 0xe9) AM_WRITE(trs80m3_e9_w)
250   AM_RANGE(0xe9, 0xe9) AM_READ_PORT("E9") AM_WRITE(trs80m3_e9_w)
243251   AM_RANGE(0xea, 0xea) AM_READWRITE(trs80m3_ea_r, trs80m3_ea_w)
244252   AM_RANGE(0xeb, 0xeb) AM_READWRITE(trs80m3_eb_r, trs80m3_eb_w)
245   AM_RANGE(0xec, 0xec) AM_WRITENOP
253//   AM_RANGE(0xec, 0xec) AM_WRITENOP
246254   AM_RANGE(0xf0, 0xf0) AM_DEVREADWRITE("wd179x", trs80_wd179x_r, wd17xx_command_w)
247255   AM_RANGE(0xf1, 0xf1) AM_DEVREADWRITE("wd179x", wd17xx_track_r, wd17xx_track_w)
248256   AM_RANGE(0xf2, 0xf2) AM_DEVREADWRITE("wd179x", wd17xx_sector_r, wd17xx_sector_w)
249257   AM_RANGE(0xf3, 0xf3) AM_DEVREADWRITE("wd179x", wd17xx_data_r, wd17xx_data_w)
250   AM_RANGE(0xf4, 0xf4) AM_WRITENOP
258//   AM_RANGE(0xf4, 0xf4) AM_WRITENOP
251259   AM_RANGE(0xf8, 0xf8) AM_READWRITE(trs80_printer_r, trs80_printer_w)
252260   AM_RANGE(0xff, 0xff) AM_READWRITE(trs80_ff_r, trs80_ff_w)
253261ADDRESS_MAP_END
r4433r4434
409417#endif
410418INPUT_PORTS_END
411419
420INPUT_PORTS_START( trs80m3 )
421   PORT_INCLUDE (trs80)
422   PORT_START("E9")
423   PORT_BIT(0x07, IP_ACTIVE_LOW, IPT_UNUSED )
424   PORT_DIPNAME( 0x88, 0x08, "Parity")
425   PORT_DIPSETTING(    0x08, DEF_STR(None))
426   PORT_DIPSETTING(    0x00, "Odd")
427   PORT_DIPSETTING(    0x80, "Even")
428   PORT_DIPNAME( 0x10, 0x10, "Stop Bits")
429   PORT_DIPSETTING(    0x10, "2")
430   PORT_DIPSETTING(    0x00, "1")
431   PORT_DIPNAME( 0x60, 0x60, "Bits")
432   PORT_DIPSETTING(    0x00, "5")
433   PORT_DIPSETTING(    0x20, "6")
434   PORT_DIPSETTING(    0x40, "7")
435   PORT_DIPSETTING(    0x60, "8")
436INPUT_PORTS_END
412437
413438static const gfx_layout trs80_charlayout =
414439{
r4433r4434
501526   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
502527   MDRV_SOUND_WAVE_ADD("wave", "cassette")
503528   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
529
504530   /* devices */
505
506531   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
507   
508532MACHINE_DRIVER_END
509533
510534static MACHINE_DRIVER_START( model1 )
r4433r4434
513537   MDRV_CPU_PROGRAM_MAP( model1_map, 0 )
514538   MDRV_CPU_IO_MAP( model1_io, 0 )
515539
540   /* devices */
516541   MDRV_CASSETTE_MODIFY( "cassette", trs80l2_cassette_config )
517542   MDRV_QUICKLOAD_ADD("quickload", trs80_cmd, "cmd", 0.5)
518543   MDRV_WD179X_ADD("wd179x", trs80_wd17xx_interface )
519   /* printer */
520544   MDRV_CENTRONICS_ADD("centronics", standard_centronics)
545   MDRV_AY31015_ADD( "tr1602", trs80_ay31015_config )
521546MACHINE_DRIVER_END
522547
523548
r4433r4434
527552   MDRV_CPU_PROGRAM_MAP( model3_map, 0 )
528553   MDRV_CPU_IO_MAP( model3_io, 0 )
529554   MDRV_CPU_VBLANK_INT_HACK(trs80_frame_interrupt, 2)
530   MDRV_AY31015_ADD( "tr1602", trs80_ay31015_config )
531555MACHINE_DRIVER_END
532556
533557static MACHINE_DRIVER_START( sys80 )
534558   MDRV_IMPORT_FROM( model1 )
535559   MDRV_CPU_MODIFY( "maincpu" )
536560   MDRV_CPU_IO_MAP( sys80_io, 0 )
537   //MDRV_AY31015_ADD( "tr1602", trs80_ay31015_config )   // need more info
538561MACHINE_DRIVER_END
539562
540563static MACHINE_DRIVER_START( ht1080z )
r4433r4434
673696SYSTEM_CONFIG_END
674697
675698
676/*    YEAR  NAME      PARENT  COMPAT  MACHINE     INPUT  INIT      CONFIG       COMPANY  FULLNAME */
677COMP( 1977, trs80,    0,   0,   trs80,    trs80, trs80,    0,      "Tandy Radio Shack",  "TRS-80 Model I (Level I Basic)" , 0)
678COMP( 1978, trs80l2,  trs80,   0,   model1,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (Level II Basic)" , 0)
679COMP( 1983, radionic, trs80,   0,   model1,   trs80, radionic, trs8012,   "Komtek",  "Radionic" , 0)
680COMP( 1980, sys80,    trs80,   0,   sys80,    trs80, trs80,    trs8012,   "EACA Computers Ltd.","System-80" , 0)
681COMP( 1981, lnw80,    trs80,   0,   model1,   trs80, lnw80,    trs8012,   "LNW Research","LNW-80", 0 )
682COMP( 1980, trs80m3,  trs80,   0,   model3,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model III", 0 )
683COMP( 1980, trs80m4,  trs80,   0,   model3,   trs80, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4", 0 )
684COMP( 1983, ht1080z,  trs80,   0,   ht1080z,  trs80, ht1080z,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series I" , 0)
685COMP( 1984, ht1080z2, trs80,   0,   ht1080z,  trs80, ht1080z,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series II" , 0)
686COMP( 1985, ht108064, trs80,   0,   ht1080z,  trs80, ht108064, trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z/64" , 0)
699/*    YEAR  NAME      PARENT  COMPAT  MACHINE     INPUT    INIT      CONFIG       COMPANY  FULLNAME */
700COMP( 1977, trs80,    0,   0,   trs80,    trs80,   trs80,    0,      "Tandy Radio Shack",  "TRS-80 Model I (Level I Basic)" , 0)
701COMP( 1978, trs80l2,  trs80,   0,   model1,   trs80,   trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (Level II Basic)" , 0)
702COMP( 1983, radionic, trs80,   0,   model1,   trs80,   radionic, trs8012,   "Komtek",  "Radionic" , 0)
703COMP( 1980, sys80,    trs80,   0,   sys80,    trs80,   trs80,    trs8012,   "EACA Computers Ltd.","System-80" , 0)
704COMP( 1981, lnw80,    trs80,   0,   model1,   trs80m3, lnw80,    trs8012,   "LNW Research","LNW-80", 0 )
705COMP( 1980, trs80m3,  trs80,   0,   model3,   trs80m3, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model III", 0 )
706COMP( 1980, trs80m4,  trs80,   0,   model3,   trs80m3, trs80,    trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4", 0 )
707COMP( 1983, ht1080z,  trs80,   0,   ht1080z,  trs80,   ht1080z,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series I" , 0)
708COMP( 1984, ht1080z2, trs80,   0,   ht1080z,  trs80,   ht1080z,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series II" , 0)
709COMP( 1985, ht108064, trs80,   0,   ht1080z,  trs80,   ht108064, trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z/64" , 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team