Previous 15994 Revisions Next

r6223 Friday 30th October, 2009 at 16:21:18 UTC by Dirk Best
[TF20] Various updates, starts to read its OS from floppy now
[src/mess/machine]tf20.c

src/mess/machine/tf20.c
r6222r6223
3535   const device_config *ram;
3636   const device_config *upd765a;
3737   const device_config *upd7201;
38   const device_config *floppy_0;
39   const device_config *floppy_1;
3840};
3941 
4042 
r6222r6223
8688   return 0xff;
8789}
8890 
91static READ8_DEVICE_HANDLER( tf20_upd765_tc_r )
92{
93   logerror("%s: tf20_upd765_tc_r\n", cpuexec_describe_context(device->machine));
94 
95   /* set tc on read */
96   upd765_tc_w(device, ASSERT_LINE);
97 
98   return 0xff;
99}
100 
89101static WRITE8_HANDLER( tf20_fdc_control_w )
90102{
103   tf20_state *tf20 = get_safe_token(space->cpu->owner);
91104   logerror("%s: tf20_fdc_control_w %02x\n", cpuexec_describe_context(space->machine), data);
92105 
93106   /* bit 0, motor on signal */
107   floppy_drive_set_motor_state(tf20->floppy_0, BIT(data, 0));
108   floppy_drive_set_ready_state(tf20->floppy_0, BIT(data, 0), 1);
109   floppy_drive_set_motor_state(tf20->floppy_1, BIT(data, 0));
110   floppy_drive_set_ready_state(tf20->floppy_1, BIT(data, 0), 1);
111 
112   /* clear tc on write */
113   upd765_tc_w(tf20->upd765a, CLEAR_LINE);
94114}
95115 
116static IRQ_CALLBACK( tf20_irq_ack )
117{
118   return 0x00;
119}
96120 
121 
97122/***************************************************************************
98123    EXTERNAL INTERFACE
99124***************************************************************************/
r6222r6223
119144WRITE_LINE_DEVICE_HANDLER( tf20_txs_w )
120145{
121146   tf20_state *tf20 = get_safe_token(device);
122   logerror("%s: tf20_rxd1_w %u\n", cpuexec_describe_context(device->machine), state);
147   logerror("%s: tf20_txs_w %u\n", cpuexec_describe_context(device->machine), state);
123148 
124149   upd7201_rxda_w(tf20->upd7201, state);
125150}
r6222r6223
182207   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("3a", upd7201_ba_cd_r, upd7201_ba_cd_w)
183208   AM_RANGE(0xf6, 0xf6) AM_READ(tf20_rom_disable)
184209   AM_RANGE(0xf7, 0xf7) AM_READ(tf20_dip_r)
185   AM_RANGE(0xf8, 0xf8) AM_WRITE(tf20_fdc_control_w)
210   AM_RANGE(0xf8, 0xf8) AM_DEVREAD("5a", tf20_upd765_tc_r) AM_WRITE(tf20_fdc_control_w)
186211   AM_RANGE(0xfa, 0xfa) AM_DEVREAD("5a", upd765_status_r)
187212   AM_RANGE(0xfb, 0xfb) AM_DEVREADWRITE("5a", upd765_data_r, upd765_data_w)
188213ADDRESS_MAP_END
r6222r6223
231256   DEVCB_CPU_INPUT_LINE("tf20", INPUT_LINE_IRQ0),
232257   NULL,
233258   NULL,
234   UPD765_RDY_PIN_CONNECTED,
259   UPD765_RDY_PIN_NOT_CONNECTED,
235260   {FLOPPY_0, FLOPPY_1, NULL, NULL}
236261};
237262 
r6222r6223
285310static DEVICE_START( tf20 )
286311{
287312   tf20_state *tf20 = get_safe_token(device);
313   const device_config *cpu = device_find_child_by_tag(device, "tf20");
288314 
315   cpu_set_irq_callback(cpu, tf20_irq_ack);
316 
289317   /* ram device */
290318   tf20->ram = device_find_child_by_tag(device, "ram");
291319 
r6222r6223
299327   /* locate child devices */
300328   tf20->upd765a = device_find_child_by_tag(device, "5a");
301329   tf20->upd7201 = device_find_child_by_tag(device, "3a");
330   tf20->floppy_0 = device_find_child_by_tag(device, FLOPPY_0);
331   tf20->floppy_1 = device_find_child_by_tag(device, FLOPPY_1);
302332 
303333   /* enable second half of ram */
304334   memory_set_bankptr(device->machine, 22, messram_get_ptr(tf20->ram) + 0x8000);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team