Previous 15994 Revisions Next

r4444 Monday 30th March, 2009 at 02:54:16 UTC by Robbbert
[TRS80] WIP 80x24 screen, 1500 baud tape, inverse chars
[src/mess/drivers]trs80.c
[src/mess/includes]trs80.h
[src/mess/machine]trs80.c

src/mess/includes/trs80.h
r4443r4444
7575VIDEO_UPDATE( ht1080z );
7676VIDEO_UPDATE( lnw80 );
7777VIDEO_UPDATE( radionic );
78VIDEO_UPDATE( trs80m4 );
7879
7980READ8_HANDLER( trs80_videoram_r );
8081WRITE8_HANDLER( trs80_videoram_w );
src/mess/machine/trs80.c
r4443r4444
4141#define IRQ_TIMER      0x80   /* RTC on Model I */
4242#define IRQ_RTC         0x04   /* RTC on Model 4 */
4343#define IRQ_FDC       0x40   /* FDC on Model 1 */
44static   UINT8 irq_status = 0;
44#define CASS_RISE      0x01   /* high speed cass on Model III/4) */
45#define CASS_FALL      0x02   /* high speed cass on Model III/4) */
4546
4647#define MAX_LUMPS   192       /* crude storage units - don't now much about it */
4748#define MAX_GRANULES   8      /* lumps consisted of granules.. aha */
r4443r4444
6162#define FH TRS80_FONT_H
6263#define MODEL4_MASTER_CLOCK 20275200
6364
64static double old_cassette_val;
6565static UINT8 cassette_data;
6666static emu_timer *cassette_data_timer;
6767static const device_config *trs80_printer;
r4443r4444
7272
7373static TIMER_CALLBACK( cassette_data_callback )
7474{
75   static double old_cassette_val;
7576   double new_val = cassette_input(trs80_cass);
7677
7778   /* Check for HI-LO transition */
7879   if ( old_cassette_val > -0.2 && new_val < -0.2 )
7980   {
8081      cassette_data |= 0x80;
82      if (trs80_mask & CASS_FALL)
83      {
84         cassette_data = 0;
85         trs80_int |= CASS_FALL;
86         cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
87      }
8188   }
89   else
90   if ( old_cassette_val < -0.2 && new_val > -0.2 )
91   {
92      if (trs80_mask & CASS_RISE)
93      {
94         cassette_data = 1;
95         trs80_int |= CASS_RISE;
96         cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
97      }
98   }
99
82100   old_cassette_val = new_val;
83101}
84102
r4443r4444
247265   d1 Cass 1500 baud Falling
248266   d0 Cass 1500 baud Rising */
249267
268   cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE);
250269   return ~(trs80_mask & trs80_int);
251270}
252271
r4443r4444
352371   d6..d1 info from write of port EC
353372   d0 High-speed data (not emulated yet) */
354373
355   trs80_int &= 0xfc;         /* clear cassette interrupts */
374   trs80_int &= 0xfc;   /* clear cassette interrupts */
375
356376   return trs80_port_ec | cassette_data;
357377}
358378
r4443r4444
573593
574594INTERRUPT_GEN( trs80_timer_interrupt )
575595{
576   if( (trs80_int & IRQ_TIMER) == 0 )
596   if (trs80_mask & IRQ_TIMER)
577597   {
578598      trs80_int |= IRQ_TIMER;
579599      cpu_set_input_line(device, 0, HOLD_LINE);
r4443r4444
582602
583603INTERRUPT_GEN( trs80m4_rtc_interrupt )
584604{
585/* This enables the processing of interrupts, particularly the clock and the flashing cursor.
586   We alternately raise and lower the INT line. The OS counts one tick for each interrupt.
587   There are 30 ticks per second. */
605/* This enables the processing of interrupts for the clock and the flashing cursor.
606   The OS counts one tick for each interrupt. There are 30 ticks per second. */
588607
589   if (irq_status)
608   if (trs80_mask & IRQ_RTC)
590609   {
591      irq_status = 0;
592      cpu_set_input_line(device, 0, CLEAR_LINE);
593   }
594   else
595   {
596610      trs80_int |= IRQ_RTC;
597      irq_status = 1;
598611      cpu_set_input_line(device, 0, HOLD_LINE);
599612   }
600613}
601614
602615static void trs80_fdc_interrupt_internal(running_machine *machine)
603616{
604   if ((trs80_int & IRQ_FDC) == 0)
617   if (trs80_mask & IRQ_FDC)
605618   {
606619      trs80_int |= IRQ_FDC;
607620      cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE);
src/mess/drivers/trs80.c
r4443r4444
462462   MDRV_CPU_MODIFY( "maincpu" )
463463   MDRV_CPU_PROGRAM_MAP( model3_map, 0 )
464464   MDRV_CPU_IO_MAP( model3_io, 0 )
465   MDRV_CPU_PERIODIC_INT(trs80m4_rtc_interrupt, 60)
465   MDRV_CPU_PERIODIC_INT(trs80m4_rtc_interrupt, 30)
466   MDRV_VIDEO_UPDATE( trs80m4 )
467   MDRV_SCREEN_MODIFY("screen")
468   MDRV_SCREEN_SIZE(80*FW, 24*FH)
469   MDRV_SCREEN_VISIBLE_AREA(0*FW,80*FW-1,0*FH,24*FH-1)
466470MACHINE_DRIVER_END
467471
468472static MACHINE_DRIVER_START( sys80 )
r4443r4444
484488static MACHINE_DRIVER_START( radionic )
485489   MDRV_IMPORT_FROM( model1 )
486490   MDRV_VIDEO_UPDATE( radionic )
491   MDRV_SCREEN_MODIFY("screen")
492   MDRV_SCREEN_SIZE(64*8, 16*16)
493   MDRV_SCREEN_VISIBLE_AREA(0*8,64*8-1,0*16,16*16-1)
487494MACHINE_DRIVER_END
488495
489496

Previous 15994 Revisions Next


© 1998-2018 The MESS Team