Previous 15994 Revisions Next

r4486 Monday 13th April, 2009 at 08:36:08 UTC by Robbbert
[KAYPRO2] WIP [TRS80] trs80m4 connect density, correct a baud rate
[src/mess/drivers]kaypro2.c
[src/mess/machine]trs80.c

src/mess/machine/trs80.c
r4485r4486
441441/* UART set baud rate. Rx = bits 0..3, Tx = bits 4..7
442442   00h    50 
443443   11h    75 
444   22h    100 
444   22h    110 
445445   33h    134.5 
446446   44h    150 
447447   55h    300 
r4485r4486
456456   EEh    9600 
457457   FFh    19200 */
458458
459   int baud_clock[]={ 800, 1200, 1600, 2152, 2400, 4800, 9600, 19200, 28800, 32000, 38400, 57600, 76800, 115200, 153600, 307200 };
459   int baud_clock[]={ 800, 1200, 1760, 2152, 2400, 4800, 9600, 19200, 28800, 32000, 38400, 57600, 76800, 115200, 153600, 307200 };
460460   ay31015_set_receiver_clock( trs80_ay31015, baud_clock[data & 0x0f]);
461461   ay31015_set_transmitter_clock( trs80_ay31015, baud_clock[data>>4]);
462462}
r4485r4486
527527
528528WRITE8_HANDLER( trs80m4_f4_w )
529529{
530/* Selection of drive and parameters - d7..d5 not emulated.
530/* Selection of drive and parameters - d6..d5 not emulated.
531531 A write also causes the selected drive motor to turn on for about 3 seconds.
532532 When the motor turns off, the drive is deselected.
533533   d7 1=MFM, 0=FM
r4485r4486
560560      wd17xx_set_drive(trs80_fdc,drive);
561561      wd17xx_set_side(trs80_fdc,head);
562562   }
563
564   wd17xx_set_density(trs80_fdc, (data & 0x80) ? 1 : 0);
563565}
564566
565567WRITE8_HANDLER( sys80_f8_w )
src/mess/drivers/kaypro2.c
r4485r4486
1919 
2020 
2121   Things that need doing:
22   - How to specify interrupts in callbacks when a daisy-chain is in use?
23   - Which order are devices to be specified in the daisy chain?
2422   - Keyboard is a separate device and not emulated (includes a beeper)
2523   - Floppy disks (I have no knowledge of how to set these up)
2624   - Split this code to video, machine
r4485r4486
5957static PALETTE_INIT( kaypro2 )
6058{
6159   palette_set_color(machine,0,RGB_BLACK); /* black */
62   palette_set_color(machine,1,MAKE_RGB(0, 200, 0)); /* green */   
60   palette_set_color(machine,1,MAKE_RGB(0, 220, 0)); /* green */   
6361}
6462 
6563static VIDEO_UPDATE( kaypro2 )
r4485r4486
133131 
134132************************************************************/
135133 
134static WRITE8_DEVICE_HANDLER( kaypro2_interrupt )
135{
136   cpu_set_input_line(device->machine->cpu[0], 0, data);
137}
138 
136139static WRITE8_DEVICE_HANDLER( pio_printer_w )
137140{
138141/*   d7..d0 output to Centronics printer */
r4485r4486
196199 
197200static const z80pio_interface kaypro2_pio_g_intf =
198201{
199   DEVCB_NULL,      /* callback when change interrupt status - assume this is handled by the daisy-chain? */
202   DEVCB_HANDLER(kaypro2_interrupt),
200203   DEVCB_NULL,
201204   DEVCB_NULL,
202205   DEVCB_HANDLER(pio_printer_w),   /* output data to printer */
r4485r4486
207210 
208211static const z80pio_interface kaypro2_pio_s_intf =
209212{
210   DEVCB_NULL,      /* callback when change interrupt status - assume this is handled by the daisy-chain? */
213   DEVCB_HANDLER(kaypro2_interrupt),
211214   DEVCB_HANDLER(pio_system_r),   /* read printer status */
212215   DEVCB_NULL,
213216   DEVCB_HANDLER(pio_system_w),   /* activate various internal devices */
r4485r4486
288291   }
289292}
290293 
294/* when sio devcb'ed like pio is, change to use pio's int handler */
295static void kaypro2_int_sio(const device_config *device, int state)
296{
297   cpu_set_input_line(device->machine->cpu[0], 0, state);
298}
291299 
292300static const z80sio_interface kaypro2_sio_intf =
293301{
294   0,         /* interrupt handler - assume handled by daisy-chain? */
295   0,            /* DTR changed handler */
296   0,                  /* RTS changed handler */
297   0,                  /* BREAK changed handler */
298   0,   /* transmit handler - which channel is this for? */
299   0      /* receive handler - which channel is this for? */
302   kaypro2_int_sio,   /* interrupt handler */
303   0,         /* DTR changed handler */
304   0,         /* RTS changed handler */
305   0,         /* BREAK changed handler */
306   0,         /* transmit handler - which channel is this for? */
307   0         /* receive handler - which channel is this for? */
300308};
301309 
302310static const z80_daisy_chain kaypro2_daisy_chain[] =

Previous 15994 Revisions Next


© 1998-2018 The MESS Team