src/mess/drivers/prof80.c
| r6457 | r6458 | |
| 33 | 33 | #include "cpu/z80/z80.h" |
| 34 | 34 | #include "cpu/z80/z80daisy.h" |
| 35 | 35 | #include "video/mc6845.h" |
| 36 | #include "formats/basicdsk.h" |
| 37 | #include "devices/flopdrv.h" |
| 38 | #include "devices/messram.h" |
| 36 | 39 | #include "machine/i8255a.h" |
| 37 | 40 | #include "machine/upd765.h" |
| 38 | 41 | #include "machine/upd1990a.h" |
| 39 | 42 | #include "machine/z80sti.h" |
| 40 | 43 | #include "machine/ctronics.h" |
| 41 | 44 | #include "machine/rescap.h" |
| 42 | | #include "devices/flopdrv.h" |
| 43 | | #include "formats/basicdsk.h" |
| 44 | | #include "devices/messram.h" |
| 45 | #include "sound/speaker.h" |
| 45 | 46 | |
| 46 | | INLINE const device_config *get_floppy_image(running_machine *machine, int drive) |
| 47 | | { |
| 48 | | return floppy_get_device(machine, drive); |
| 49 | | } |
| 50 | | |
| 51 | 47 | /* Keyboard HACK */ |
| 52 | 48 | |
| 53 | 49 | static const UINT8 prof80_keycodes[3][9][8] = |
| r6457 | r6458 | |
| 193 | 189 | { |
| 194 | 190 | prof80_state *state = machine->driver_data; |
| 195 | 191 | |
| 196 | | floppy_drive_set_motor_state(get_floppy_image(machine, 0), 0); |
| 197 | | floppy_drive_set_motor_state(get_floppy_image(machine, 1), 0); |
| 198 | | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 0, 1); |
| 199 | | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 0, 1); |
| 192 | floppy_drive_set_motor_state(floppy_get_device(machine, 0), 0); |
| 193 | floppy_drive_set_motor_state(floppy_get_device(machine, 1), 0); |
| 194 | floppy_drive_set_ready_state(floppy_get_device(machine, 0), 0, 1); |
| 195 | floppy_drive_set_ready_state(floppy_get_device(machine, 1), 0, 1); |
| 200 | 196 | |
| 201 | 197 | state->motor = 0; |
| 202 | 198 | } |
| r6457 | r6458 | |
| 242 | 238 | else |
| 243 | 239 | { |
| 244 | 240 | /* turn on floppy motor */ |
| 245 | | floppy_drive_set_motor_state(get_floppy_image(machine, 0), 1); |
| 246 | | floppy_drive_set_motor_state(get_floppy_image(machine, 1), 1); |
| 247 | | floppy_drive_set_ready_state(get_floppy_image(machine, 0), 1, 1); |
| 248 | | floppy_drive_set_ready_state(get_floppy_image(machine, 1), 1, 1); |
| 241 | floppy_drive_set_motor_state(floppy_get_device(machine, 0), 1); |
| 242 | floppy_drive_set_motor_state(floppy_get_device(machine, 1), 1); |
| 243 | floppy_drive_set_ready_state(floppy_get_device(machine, 0), 1, 1); |
| 244 | floppy_drive_set_ready_state(floppy_get_device(machine, 1), 1, 1); |
| 249 | 245 | |
| 250 | 246 | state->motor = 1; |
| 251 | 247 | |
| r6457 | r6458 | |
| 867 | 863 | } |
| 868 | 864 | } |
| 869 | 865 | |
| 870 | | static WRITE_LINE_DEVICE_HANDLER( grip_de_w ) |
| 871 | | { |
| 872 | | prof80_state *driver_state = device->machine->driver_data; |
| 873 | | |
| 874 | | z80sti_i1_w(driver_state->z80sti, state); |
| 875 | | } |
| 876 | | |
| 877 | | static WRITE_LINE_DEVICE_HANDLER( grip_cur_w ) |
| 878 | | { |
| 879 | | prof80_state *driver_state = device->machine->driver_data; |
| 880 | | |
| 881 | | z80sti_i2_w(driver_state->z80sti, state); |
| 882 | | } |
| 883 | | |
| 884 | 866 | static const mc6845_interface grip_mc6845_interface = |
| 885 | 867 | { |
| 886 | 868 | SCREEN_TAG, |
| r6457 | r6458 | |
| 888 | 870 | NULL, |
| 889 | 871 | grip_update_row, |
| 890 | 872 | NULL, |
| 891 | | DEVCB_LINE(grip_de_w), |
| 892 | | DEVCB_LINE(grip_cur_w), |
| 873 | DEVCB_DEVICE_LINE(Z80STI_TAG, z80sti_i1_w), |
| 874 | DEVCB_DEVICE_LINE(Z80STI_TAG, z80sti_i2_w), |
| 893 | 875 | DEVCB_NULL, |
| 894 | 876 | DEVCB_NULL, |
| 895 | 877 | NULL |
| r6457 | r6458 | |
| 931 | 913 | NULL, |
| 932 | 914 | NULL, |
| 933 | 915 | UPD765_RDY_PIN_CONNECTED, |
| 934 | | {FLOPPY_0,FLOPPY_1, FLOPPY_2, FLOPPY_3} |
| 916 | { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 } |
| 935 | 917 | }; |
| 936 | 918 | |
| 937 | 919 | /* PPI8255 Interface */ |
| r6457 | r6458 | |
| 1068 | 1050 | return centronics_busy_r(state->centronics) << 3; |
| 1069 | 1051 | } |
| 1070 | 1052 | |
| 1071 | | static WRITE_LINE_DEVICE_HANDLER( grip_z80sti_tbo_w ) |
| 1072 | | { |
| 1073 | | // connected to speaker |
| 1074 | | } |
| 1075 | | |
| 1076 | | static WRITE_LINE_DEVICE_HANDLER( grip_z80sti_irq_w ) |
| 1077 | | { |
| 1078 | | cputag_set_input_line(device->machine, GRIP_Z80_TAG, INPUT_LINE_IRQ0, state); |
| 1079 | | } |
| 1080 | | |
| 1081 | 1053 | static Z80STI_INTERFACE( grip_z80sti_interface ) |
| 1082 | 1054 | { |
| 1083 | 1055 | 0, /* serial receive clock */ |
| r6457 | r6458 | |
| 1087 | 1059 | DEVCB_NULL, /* serial input */ |
| 1088 | 1060 | DEVCB_NULL, /* serial output */ |
| 1089 | 1061 | DEVCB_NULL, /* timer A output */ |
| 1090 | | DEVCB_LINE(grip_z80sti_tbo_w), /* timer B output */ |
| 1062 | DEVCB_DEVICE_LINE(SPEAKER_TAG, speaker_level_w), /* timer B output */ |
| 1091 | 1063 | DEVCB_LINE(z80sti_tc_w), /* timer C output */ |
| 1092 | 1064 | DEVCB_LINE(z80sti_rc_w), /* timer D output */ |
| 1093 | | DEVCB_LINE(grip_z80sti_irq_w) /* interrupt */ |
| 1065 | DEVCB_CPU_INPUT_LINE(GRIP_Z80_TAG, INPUT_LINE_IRQ0) /* interrupt */ |
| 1094 | 1066 | }; |
| 1095 | 1067 | |
| 1096 | 1068 | /* Z80 Daisy Chain */ |
| r6457 | r6458 | |
| 1222 | 1194 | |
| 1223 | 1195 | MDRV_MC6845_ADD(MC6845_TAG, MC6845, XTAL_16MHz/4, grip_mc6845_interface) |
| 1224 | 1196 | |
| 1197 | /* sound hardware */ |
| 1198 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 1199 | MDRV_SOUND_ADD(SPEAKER_TAG, SPEAKER, 0) |
| 1200 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1201 | |
| 1225 | 1202 | /* devices */ |
| 1226 | 1203 | MDRV_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, prof80_upd1990a_intf) |
| 1227 | 1204 | MDRV_UPD765A_ADD(UPD765_TAG, prof80_upd765_interface) |