mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
(MESS) tandy2k: Tries to load DOS now. (nw)
This commit is contained in:
parent
c3bf0c18be
commit
6eafc6bb3f
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -3474,6 +3474,8 @@ src/lib/formats/svi_cas.c svneol=native#text/plain
|
||||
src/lib/formats/svi_cas.h svneol=native#text/plain
|
||||
src/lib/formats/svi_dsk.c svneol=native#text/plain
|
||||
src/lib/formats/svi_dsk.h svneol=native#text/plain
|
||||
src/lib/formats/tandy2k_dsk.c svneol=native#text/plain
|
||||
src/lib/formats/tandy2k_dsk.h svneol=native#text/plain
|
||||
src/lib/formats/td0_dsk.c svneol=native#text/plain
|
||||
src/lib/formats/td0_dsk.h svneol=native#text/plain
|
||||
src/lib/formats/thom_cas.c svneol=native#text/plain
|
||||
|
@ -101,7 +101,8 @@ int upd765_family_device::rates[4] = { 500000, 300000, 250000, 1000000 };
|
||||
upd765_family_device::upd765_family_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
|
||||
pc_fdc_interface(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
intrq_cb(*this),
|
||||
drq_cb(*this)
|
||||
drq_cb(*this),
|
||||
hdl_cb(*this)
|
||||
{
|
||||
ready_polled = true;
|
||||
ready_connected = true;
|
||||
@ -129,8 +130,9 @@ void upd765_family_device::set_mode(int _mode)
|
||||
|
||||
void upd765_family_device::device_start()
|
||||
{
|
||||
intrq_cb.resolve();
|
||||
drq_cb.resolve();
|
||||
intrq_cb.resolve_safe();
|
||||
drq_cb.resolve_safe();
|
||||
hdl_cb.resolve_safe();
|
||||
|
||||
for(int i=0; i != 4; i++) {
|
||||
char name[2];
|
||||
@ -442,8 +444,7 @@ void upd765_family_device::set_drq(bool state)
|
||||
{
|
||||
if(state != drq) {
|
||||
drq = state;
|
||||
if(!drq_cb.isnull())
|
||||
drq_cb(drq);
|
||||
drq_cb(drq);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1442,6 +1443,7 @@ void upd765_family_device::read_data_start(floppy_info &fi)
|
||||
|
||||
if(fi.dev)
|
||||
fi.dev->ss_w(command[1] & 4 ? 1 : 0);
|
||||
hdl_cb(1);
|
||||
read_data_continue(fi);
|
||||
}
|
||||
|
||||
@ -1619,6 +1621,7 @@ void upd765_family_device::write_data_start(floppy_info &fi)
|
||||
st1 = ST1_MA;
|
||||
st2 = 0x00;
|
||||
|
||||
hdl_cb(1);
|
||||
write_data_continue(fi);
|
||||
}
|
||||
|
||||
@ -1727,6 +1730,7 @@ void upd765_family_device::read_track_start(floppy_info &fi)
|
||||
|
||||
if(fi.dev)
|
||||
fi.dev->ss_w(command[1] & 4 ? 1 : 0);
|
||||
hdl_cb(1);
|
||||
read_track_continue(fi);
|
||||
}
|
||||
|
||||
@ -1841,6 +1845,7 @@ void upd765_family_device::format_track_start(floppy_info &fi)
|
||||
fi.dev->ss_w(command[1] & 4 ? 1 : 0);
|
||||
sector_size = calc_sector_size(command[2]);
|
||||
|
||||
hdl_cb(1);
|
||||
format_track_continue(fi);
|
||||
}
|
||||
|
||||
@ -1903,6 +1908,7 @@ void upd765_family_device::read_id_start(floppy_info &fi)
|
||||
for(int i=0; i<4; i++)
|
||||
cur_live.idbuf[i] = 0x00;
|
||||
|
||||
hdl_cb(1);
|
||||
read_id_continue(fi);
|
||||
}
|
||||
|
||||
@ -1955,7 +1961,7 @@ void upd765_family_device::check_irq()
|
||||
bool old_irq = cur_irq;
|
||||
cur_irq = data_irq || other_irq || internal_drq;
|
||||
cur_irq = cur_irq && (dor & 4) && (mode != MODE_AT || (dor & 8));
|
||||
if(cur_irq != old_irq && !intrq_cb.isnull()) {
|
||||
if(cur_irq != old_irq) {
|
||||
logerror("%s: irq = %d\n", tag(), cur_irq);
|
||||
intrq_cb(cur_irq);
|
||||
}
|
||||
|
@ -61,6 +61,9 @@
|
||||
#define MCFG_UPD765_DRQ_CALLBACK(_write) \
|
||||
devcb = &upd765_family_device::set_drq_wr_callback(*device, DEVCB2_##_write);
|
||||
|
||||
#define MCFG_UPD765_HDL_CALLBACK(_write) \
|
||||
devcb = &upd765_family_device::set_hdl_wr_callback(*device, DEVCB2_##_write);
|
||||
|
||||
/* Interface required for PC ISA wrapping */
|
||||
class pc_fdc_interface : public device_t {
|
||||
public:
|
||||
@ -91,6 +94,7 @@ public:
|
||||
|
||||
template<class _Object> static devcb2_base &set_intrq_wr_callback(device_t &device, _Object object) { return downcast<upd765_family_device &>(device).intrq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb2_base &set_drq_wr_callback(device_t &device, _Object object) { return downcast<upd765_family_device &>(device).drq_cb.set_callback(object); }
|
||||
template<class _Object> static devcb2_base &set_hdl_wr_callback(device_t &device, _Object object) { return downcast<upd765_family_device &>(device).hdl_cb.set_callback(object); }
|
||||
|
||||
virtual DECLARE_ADDRESS_MAP(map, 8) = 0;
|
||||
|
||||
@ -304,7 +308,7 @@ protected:
|
||||
int main_phase;
|
||||
|
||||
live_info cur_live, checkpoint_live;
|
||||
devcb2_write_line intrq_cb, drq_cb;
|
||||
devcb2_write_line intrq_cb, drq_cb, hdl_cb;
|
||||
bool cur_irq, other_irq, data_irq, drq, internal_drq, tc, tc_done, locked, mfm;
|
||||
floppy_info flopi[4];
|
||||
|
||||
|
41
src/lib/formats/tandy2k_dsk.c
Normal file
41
src/lib/formats/tandy2k_dsk.c
Normal file
@ -0,0 +1,41 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/tandy2k_dsk.c
|
||||
|
||||
Tandy 2000 disk format
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "formats/tandy2k_dsk.h"
|
||||
|
||||
tandy2k_format::tandy2k_format() : upd765_format(formats)
|
||||
{
|
||||
}
|
||||
|
||||
const char *tandy2k_format::name() const
|
||||
{
|
||||
return "tandy2k";
|
||||
}
|
||||
|
||||
const char *tandy2k_format::description() const
|
||||
{
|
||||
return "Tandy 2000 disk image";
|
||||
}
|
||||
|
||||
const char *tandy2k_format::extensions() const
|
||||
{
|
||||
return "dsk";
|
||||
}
|
||||
|
||||
const tandy2k_format::format tandy2k_format::formats[] = {
|
||||
{ // 720K 5.25 inch quad density - gaps unverified
|
||||
floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
|
||||
2000, 9, 80, 2, 512, {}, 1, {}, 80, 50, 22, 80
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
const floppy_format_type FLOPPY_TANDY_2000_FORMAT = &floppy_image_format_creator<tandy2k_format>;
|
30
src/lib/formats/tandy2k_dsk.h
Normal file
30
src/lib/formats/tandy2k_dsk.h
Normal file
@ -0,0 +1,30 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Curt Coder
|
||||
/*********************************************************************
|
||||
|
||||
formats/tandy2k_dsk.h
|
||||
|
||||
Tandy 2000 disk format
|
||||
|
||||
*********************************************************************/
|
||||
|
||||
#ifndef BW2_DSK_H_
|
||||
#define BW2_DSK_H_
|
||||
|
||||
#include "upd765_dsk.h"
|
||||
|
||||
class tandy2k_format : public upd765_format {
|
||||
public:
|
||||
tandy2k_format();
|
||||
|
||||
virtual const char *name() const;
|
||||
virtual const char *description() const;
|
||||
virtual const char *extensions() const;
|
||||
|
||||
private:
|
||||
static const format formats[];
|
||||
};
|
||||
|
||||
extern const floppy_format_type FLOPPY_TANDY_2000_FORMAT;
|
||||
|
||||
#endif
|
@ -192,6 +192,7 @@ FORMATSOBJS = \
|
||||
$(LIBOBJ)/formats/st_dsk.o \
|
||||
$(LIBOBJ)/formats/svi_cas.o \
|
||||
$(LIBOBJ)/formats/svi_dsk.o \
|
||||
$(LIBOBJ)/formats/tandy2k_dsk.o \
|
||||
$(LIBOBJ)/formats/td0_dsk.o \
|
||||
$(LIBOBJ)/formats/thom_cas.o \
|
||||
$(LIBOBJ)/formats/thom_dsk.o \
|
||||
|
@ -4,17 +4,17 @@
|
||||
|
||||
Tandy 2000
|
||||
|
||||
Skeleton driver.
|
||||
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
TODO:
|
||||
|
||||
- video (video RAM is at memory top - 0x1400, i.e. 0x1ec00)
|
||||
- DMA
|
||||
- floppy
|
||||
- HDL is also connected to WP/TS input where TS is used to detect motor status
|
||||
- 3 second motor off delay timer
|
||||
- DMA
|
||||
- video (video RAM is at memory top - 0x1400, i.e. 0x1ec00)
|
||||
- keyboard ROM
|
||||
- hires graphics board
|
||||
- WD1010
|
||||
@ -146,7 +146,7 @@ WRITE8_MEMBER( tandy2k_state::enable_w )
|
||||
m_pit->write_gate2(BIT(data, 4));
|
||||
|
||||
// FDC reset
|
||||
if(BIT(data, 5))
|
||||
if(!BIT(data, 5))
|
||||
m_fdc->reset();
|
||||
|
||||
// timer 0 enable
|
||||
@ -665,11 +665,21 @@ static I8255A_INTERFACE( ppi_intf )
|
||||
|
||||
// Intel 8272 Interface
|
||||
|
||||
WRITE_LINE_MEMBER( tandy2k_state::fdc_drq )
|
||||
WRITE_LINE_MEMBER( tandy2k_state::fdc_drq_w )
|
||||
{
|
||||
dma_request(0, state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( tandy2k_state::fdc_hdl_w )
|
||||
{
|
||||
m_floppy0->mon_w(!state);
|
||||
m_floppy1->mon_w(!state);
|
||||
}
|
||||
|
||||
FLOPPY_FORMATS_MEMBER( tandy2k_state::floppy_formats )
|
||||
FLOPPY_TANDY_2000_FORMAT
|
||||
FLOPPY_FORMATS_END
|
||||
|
||||
static SLOT_INTERFACE_START( tandy2k_floppies )
|
||||
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
|
||||
SLOT_INTERFACE_END
|
||||
@ -715,10 +725,6 @@ void tandy2k_state::machine_start()
|
||||
|
||||
m_char_ram.allocate(0x1000);
|
||||
|
||||
// HACK these should be connected to FDC HLD output
|
||||
m_floppy0->mon_w(0);
|
||||
m_floppy1->mon_w(0);
|
||||
|
||||
// register for state saving
|
||||
save_item(NAME(m_dma_mux));
|
||||
save_item(NAME(m_kbdclk));
|
||||
@ -810,13 +816,16 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state )
|
||||
MCFG_PIT8253_OUT2_HANDLER(WRITELINE(tandy2k_state, rfrqpulse_w))
|
||||
|
||||
MCFG_PIC8259_ADD(I8259A_0_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int0_w), VCC, NULL)
|
||||
|
||||
MCFG_PIC8259_ADD(I8259A_1_TAG, DEVWRITELINE(I80186_TAG, i80186_cpu_device, int1_w), VCC, NULL)
|
||||
|
||||
MCFG_I8272A_ADD(I8272A_TAG, true)
|
||||
downcast<i8272a_device *>(device)->set_select_lines_connected(true);
|
||||
MCFG_UPD765_INTRQ_CALLBACK(DEVWRITELINE(I8259A_0_TAG, pic8259_device, ir4_w))
|
||||
MCFG_UPD765_DRQ_CALLBACK(WRITELINE(tandy2k_state, fdc_drq))
|
||||
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", floppy_image_device::default_floppy_formats)
|
||||
MCFG_UPD765_DRQ_CALLBACK(WRITELINE(tandy2k_state, fdc_drq_w))
|
||||
MCFG_UPD765_HDL_CALLBACK(WRITELINE(tandy2k_state, fdc_hdl_w))
|
||||
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", tandy2k_state::floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", tandy2k_state::floppy_formats)
|
||||
|
||||
MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image")
|
||||
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(tandy2k_state, write_centronics_ack))
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "cpu/i86/i186.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "formats/tandy2k_dsk.h"
|
||||
#include "imagedev/harddriv.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/i8251.h"
|
||||
@ -161,7 +162,8 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER( kbdclk_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( kbddat_w );
|
||||
DECLARE_READ8_MEMBER( irq_callback );
|
||||
DECLARE_WRITE_LINE_MEMBER( fdc_drq );
|
||||
DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( fdc_hdl_w );
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_ack);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_busy);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_perror);
|
||||
@ -169,6 +171,7 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER(write_centronics_fault);
|
||||
CRT9021_DRAW_CHARACTER_MEMBER( vac_draw_character );
|
||||
TIMER_DEVICE_CALLBACK_MEMBER( vidldsh_tick );
|
||||
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
||||
|
||||
enum
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user