Previous 15994 Revisions Next

r4440 Friday 27th March, 2009 at 22:09:36 UTC by Robbbert
[TRS80] WIP - 500 baud cassette save and load works on all clones, model 4 switchable cpu clock implemented.
[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
r4439r4440
1818
1919VIDEO_UPDATE( trs80 )
2020{
21   int width = 64 - ((trs80_port_ff & 8) << 2);
21   int width = 64 - ((trs80_mode & 1) << 5);
2222   int skip = 3 - (width >> 5);
2323   int i=0,x,y,chr;
2424   int adj=input_port_read(screen->machine, "CONFIG")&0x40;
src/mess/includes/trs80.h
r4439r4440
1717/*----------- defined in machine/trs80.c -----------*/
1818
1919extern const wd17xx_interface trs80_wd17xx_interface;
20extern UINT8 trs80_port_ff;
20extern UINT8 trs80_mode;
2121
2222DEVICE_IMAGE_LOAD( trs80_floppy );
2323QUICKLOAD_LOAD( trs80_cmd );
src/mess/machine/trs80.c
r4439r4440
3434
3535
3636static UINT8 trs80_port_e0 = 0;
37UINT8 trs80_port_ff = 0;      // will be changed to pass mode bits to video rather than port bits
37UINT8 trs80_mode = 0;
3838
3939#define IRQ_TIMER      0x80   /* RTC on Model I */
4040#define IRQ_RTC         0x04   /* RTC on Model 4 */
r4439r4440
5757
5858#define FW TRS80_FONT_W
5959#define FH TRS80_FONT_H
60#define MODEL4_MASTER_CLOCK 20275200
6061
6162static double old_cassette_val;
6263static UINT8 cassette_data;
r4439r4440
419420
420421READ8_HANDLER( trs80_ff_r )
421422{
422   UINT8 data = (~trs80_port_ff & 8) << 3;   // MODESEL bit (32 or 64 chars per line)
423   UINT8 data = (~trs80_mode & 1) << 5;   // MODESEL bit (32 or 64 chars per line)
423424   return data | cassette_data;
424425}
425426
r4439r4440
544545
545546WRITE8_HANDLER( trs80m4_ec_w )
546547{
547/* Hardware settings - not yet emulated
548/* Hardware settings - d5..d3 not emulated
548549   d6 CPU fast (1=4MHz, 0=2MHz)
549550   d5 Enable Video Wait
550551   d4 Enable External I/O bus
r4439r4440
552553   d2 Mode Select (0=64 chars, 1=32chars)
553554   d1 Cassette Motor (1=On) */
554555
555   cassette_change_state( trs80_cass, ( data & 2 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR );
556   static UINT8 settings=0xff;
557   UINT8 changed = data ^ settings;
558
559   if (changed & 0x40)
560      cpu_set_clock(space->machine->cpu[0], data & 0x40 ? MODEL4_MASTER_CLOCK/5 : MODEL4_MASTER_CLOCK/10);
561
562   if (data & 0x04)
563      trs80_mode |= 1;
564   else
565      trs80_mode &= 2;
566
567   if (changed & 0x02)
568      cassette_change_state( trs80_cass, ( data & 2 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR );
569
570   settings = data;
556571}
557572
558573WRITE8_HANDLER( sys80_f8_w )
r4439r4440
570585   cassette_change_state( trs80_cass, ( data & 4 ) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR );
571586   cassette_output( trs80_cass, levels[data & 3]);
572587   cassette_data &= ~0x80;
573   trs80_port_ff = data;
588
589   trs80_mode = (data & 8) ? 1 : 0;
574590}
575591
576592WRITE8_HANDLER( trs80m4_ff_w )
src/mess/drivers/trs80.c
r4439r4440
423423static GFXDECODE_START( ht1080z )
424424   GFXDECODE_ENTRY( "gfx1", 0, ht1080z_charlayout, 0, 1 )
425425GFXDECODE_END
426#if 0
427static const INT16 speaker_levels[3] = {0.0*32767,0.46*32767,0.85*32767};
428426
429static const speaker_interface trs80_speaker_interface =
430{
431   3,            /* optional: number of different levels */
432   speaker_levels   /* optional: level lookup table */
433};
434#endif
427
435428static const cassette_config trs80l2_cassette_config =
436429{
437430   trs80l2_cassette_formats,

Previous 15994 Revisions Next


© 1998-2018 The MESS Team