Previous 15994 Revisions Next

r4453 Thursday 2nd April, 2009 at 13:12:14 UTC by Robbbert
[TRS80] WIP
[src/mess/drivers]trs80.c
[src/mess/includes]trs80.h
[src/mess/machine]trs80.c
[src/mess/video]trs80.c

src/mess/video/trs80.c
r4452r4453
4646   UINT8 y,ra,chr,gfx,gfxbit;
4747   UINT16 sy=0,ma=0,x;
4848   UINT8 *FNT = memory_region(screen->machine, "gfx1");
49   UINT8 seven_bit = (screen->machine->gamedrv->flags >> 24) & 1;
5049   static UINT8 size_store=0xff;
5150   static UINT8 cols=64,skip=1;
5251
r4452r4453
8281            }
8382            else
8483            {
85               if ((seven_bit) && (chr < 32)) chr+=64;
84               if ((trs80_seven_bit) && (chr < 32)) chr+=64;
8685
8786               /* get pattern of pixels for that character scanline */
8887               if (ra < 8)
r4452r4453
185184   UINT8 y,ra,chr,gfx,gfxbit;
186185   UINT16 sy=0,ma=0,x;
187186   UINT8 *FNT = memory_region(screen->machine, "gfx1");
188   UINT8 seven_bit = (screen->machine->gamedrv->flags >> 24) & 1;
189187   static UINT8 size_store=0xff;
190188   static UINT8 cols=64,skip=1;
191189
r4452r4453
221219            }
222220            else
223221            {
224               if ((seven_bit) && (chr < 32)) chr+=64;
222               if ((trs80_seven_bit) && (chr < 32)) chr+=64;
225223
226224               /* get pattern of pixels for that character scanline */
227225               gfx = FNT[(chr<<4) | ra ];
src/mess/includes/trs80.h
r4452r4453
1818
1919extern const wd17xx_interface trs80_wd17xx_interface;
2020extern UINT8 trs80_mode;
21extern UINT8 trs80_model4;
22extern UINT8 trs80_seven_bit;
2123
2224DEVICE_IMAGE_LOAD( trs80_floppy );
2325QUICKLOAD_LOAD( trs80_cmd );
src/mess/machine/trs80.c
r4452r4453
3939static UINT8 trs80_port_ec=0;      /* bit d6..d1 of port EC to be read by port FF */
4040static UINT8 trs80_tape_unit=1;      /* selected cassette unit (trs80l2 and sys80 only) (not implemented yet) */
4141static UINT8 trs80_reg_load=1;      /* Controls what port EA will do */
42static UINT8 trs80_nmi_data=0;      /* Passes FDC int to NMI handler */
42static UINT8 trs80_nmi_data=0xff;   /* Passes FDC int to NMI handler */
4343UINT8 trs80_mode = 0;         /* Control bits passed to video output routine */
4444
4545#define IRQ_M1_RTC      0x80   /* RTC on Model I */
r4452r4453
292292   cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE);
293293
294294   return ~(trs80_nmi_mask & trs80_nmi_data);
295
296//   return 0xff;
297295}
298296
299297READ8_HANDLER( trs80m4_e8_r )
r4452r4453
640638   The OS counts one tick for each interrupt. The Model I has 40 ticks per
641639   second, while the Model III/4 has 30. */
642640
643   UINT8 system = (device->machine->gamedrv->flags >> 25) & 1;
644
645   if (system)   // Model 4
641   if (trs80_model4)   // Model 4
646642   {
647643      if (trs80_mask & IRQ_M4_RTC)
648644      {
r4452r4453
659655
660656static void trs80_fdc_interrupt_internal(running_machine *machine)
661657{
662   UINT8 system = (machine->gamedrv->flags >> 25) & 1;
663
664   if (system)   // Model 4 does a NMI
658   if (trs80_model4)
665659   {
666      trs80_nmi_data = 0x80;
667   //   cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, HOLD_LINE);
660      if (trs80_nmi_mask & 0x80)   // Model 4 does a NMI
661      {
662         trs80_nmi_data = 0x80;
663         cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
664      }
668665   }
669666   else      // Model 1 does a IRQ
670667   {
r4452r4453
680677
681678static WD17XX_CALLBACK( trs80_fdc_callback )
682679{
683   UINT8 system = (device->machine->gamedrv->flags >> 25) & 1;
684
685680   switch (state)
686681   {
687682      case WD17XX_IRQ_CLR:
688         if (system) trs80_int &= ~IRQ_M1_FDC;
683         if (trs80_model4)
684            trs80_nmi_data = 0;
685         else
686            trs80_int &= ~IRQ_M1_FDC;
689687         break;
690688      case WD17XX_IRQ_SET:
691689         trs80_fdc_interrupt_internal(device->machine);
src/mess/drivers/trs80.c
r4452r4453
3939It is assumed that the TRS80L2 UART setup is identical to the System80, apart from the address ports used.
4040Due to the above, the only working emulated UART is for the Model 3.
4141
42Cassette baud rates:    Model I level I - 250 baud
43         Model I level II and all clones - 500 baud
44         Model III/4 - 500 and 1500 baud selectable at boot time
45         - When it says "Cass?" press L for 500 baud, or Enter otherwise.
46
4247I/O ports
4348FF:
4449- bits 0 and 1 are for writing a cassette
r4452r4453
137142#include "devices/cassette.h"
138143#include "formats/trs_cas.h"
139144
145UINT8 trs80_model4;
146UINT8 trs80_seven_bit;
140147
141148static READ8_DEVICE_HANDLER (trs80_wd179x_r)
142149{
r4452r4453
597604   ROM_LOAD("ht108064.chr", 0x0000, 0x0800, CRC(e76b73a4) SHA1(6361ee9667bf59d50059d09b0baf8672fdb2e8af))
598605ROM_END
599606
607static DRIVER_INIT( trs80 )
608{
609   trs80_seven_bit = 0;
610   trs80_model4 = 0;
611}
600612
613static DRIVER_INIT( trs80l2 )
614{
615   trs80_seven_bit = 1;
616   trs80_model4 = 0;
617}
618
619static DRIVER_INIT( trs80m4 )
620{
621   trs80_seven_bit = 0;
622   trs80_model4 = 1;
623}
624
601625static void trs8012_floppy_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
602626{
603627   /* floppy */
604628   switch(state)
605629   {
606630      /* --- the following bits of info are returned as 64-bit signed integers --- */
607      case MESS_DEVINFO_INT_COUNT:                     info->i = 4; break;
631      case MESS_DEVINFO_INT_COUNT:         info->i = 4; break;
608632
609633      /* --- the following bits of info are returned as pointers to data or functions --- */
610      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(trs80_floppy); break;
634      case MESS_DEVINFO_PTR_LOAD:         info->load = DEVICE_IMAGE_LOAD_NAME(trs80_floppy); break;
611635
612636      /* --- the following bits of info are returned as NULL-terminated strings --- */
613      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "dsk"); break;
637      case MESS_DEVINFO_STR_FILE_EXTENSIONS:      strcpy(info->s = device_temp_str(), "dsk"); break;
614638
615      default:                              legacybasicdsk_device_getinfo(devclass, state, info); break;
639      default:               legacybasicdsk_device_getinfo(devclass, state, info); break;
616640   }
617641}
618642
r4452r4453
620644   CONFIG_DEVICE(trs8012_floppy_getinfo)
621645SYSTEM_CONFIG_END
622646
623/* Note - "1<<24" = needs 7-bit video; "1<<25" = Uses Model 4 IRQ system */
624647/*    YEAR  NAME      PARENT  COMPAT  MACHINE     INPUT    INIT      CONFIG       COMPANY  FULLNAME */
625COMP( 1977, trs80,    0,   0,   trs80,    trs80,   0,        0,      "Tandy Radio Shack",  "TRS-80 Model I (Level I Basic)" , 0)
626COMP( 1978, trs80l2,  trs80,   0,   model1,   trs80,   0,        trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (Level II Basic)" , 1<<24)
627COMP( 1983, radionic, trs80,   0,   radionic, trs80,   0,        trs8012,   "Komtek",  "Radionic" , 0)
628COMP( 1980, sys80,    trs80,   0,   sys80,    trs80,   0,        trs8012,   "EACA Computers Ltd.","System-80" , 1<<24)
629COMP( 1981, lnw80,    trs80,   0,   lnw80,    trs80m3, 0,        trs8012,   "LNW Research","LNW-80", 0 )
630COMP( 1980, trs80m3,  trs80,   0,   model3,   trs80m3, 0,        trs8012,   "Tandy Radio Shack",  "TRS-80 Model III", 1<<25 )
631COMP( 1980, trs80m4,  trs80,   0,   model3,   trs80m3, 0,        trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4", 1<<25 )
632COMP( 1980, trs80m4p, trs80,   0,   model3,   trs80m3, 0,        trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4P", GAME_NOT_WORKING | 1<<25)
633COMP( 1983, ht1080z,  trs80,   0,   ht1080z,  trs80,   0,        trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series I" , 1<<24)
634COMP( 1984, ht1080z2, trs80,   0,   ht1080z,  trs80,   0,        trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series II" , 1<<24)
635COMP( 1985, ht108064, trs80,   0,   ht1080z,  trs80,   0,        trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z/64" , 0)
648COMP( 1977, trs80,    0,   0,   trs80,    trs80,   trs80,    0,      "Tandy Radio Shack",  "TRS-80 Model I (Level I Basic)" , 0 )
649COMP( 1978, trs80l2,  trs80,   0,   model1,   trs80,   trs80l2,  trs8012,   "Tandy Radio Shack",  "TRS-80 Model I (Level II Basic)" , 0 )
650COMP( 1983, radionic, trs80,   0,   radionic, trs80,   trs80,    trs8012,   "Komtek",  "Radionic" , 0 )
651COMP( 1980, sys80,    trs80,   0,   sys80,    trs80,   trs80l2,  trs8012,   "EACA Computers Ltd.","System-80" , 0 )
652COMP( 1981, lnw80,    trs80,   0,   lnw80,    trs80m3, trs80,    trs8012,   "LNW Research","LNW-80", 0 )
653COMP( 1980, trs80m3,  trs80,   0,   model3,   trs80m3, trs80m4,  trs8012,   "Tandy Radio Shack",  "TRS-80 Model III", 0 )
654COMP( 1980, trs80m4,  trs80,   0,   model3,   trs80m3, trs80m4,  trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4", 0 )
655COMP( 1980, trs80m4p, trs80,   0,   model3,   trs80m3, trs80m4,  trs8012,   "Tandy Radio Shack",  "TRS-80 Model 4P", GAME_NOT_WORKING )
656COMP( 1983, ht1080z,  trs80,   0,   ht1080z,  trs80,   trs80l2,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series I" , 0 )
657COMP( 1984, ht1080z2, trs80,   0,   ht1080z,  trs80,   trs80l2,  trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z Series II" , 0 )
658COMP( 1985, ht108064, trs80,   0,   ht1080z,  trs80,   trs80,    trs8012,   "Hiradastechnika Szovetkezet",  "HT-1080Z/64" , 0 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team