(mess) upd765: Modernize [O. Galibert]

Remaining TODO list:
- take WP into account

- test the amstrad, implement its observational format (edsk) using
  pasti as a start.  Or find the legendary amstrad IPFs.  Or both.

- correct read track, the implementation is completely wrong.  See
  previous for testing, it's only used in protections the check the
  inter-sector gaps.

- shake and bake on the amstrad, protections are the best to find bugs
  in a fdc

- add the scan id commands, but nothing seems to use them

- debug the 2.88M formatting which is unreliable.  Fix its IDAM/DAM
  gap size on formatting too (but that's not what's making it
  unreliable)

- test all the systems that were hit, and fix what needs to be fixed.
  Beware that multiple problems may happen:
  - upd765 may be wrong
  - the driver may not be working
  - the hookup may be wrong/incomplete (bitrate selection and floppy
    rpm in particular)
  - the driver may be too limited for the new implementation (the x68k
    dma device does not handle non-instant dma yet for instance)

- report invalid command when appropriate depending on the actual chip
  emulated

- add the russian clones with their real names
This commit is contained in:
Olivier Galibert 2012-10-10 15:33:51 +00:00
parent 204b78cf00
commit 9d1aaf97ae
117 changed files with 5759 additions and 7261 deletions

2
.gitattributes vendored
View File

@ -6948,8 +6948,6 @@ src/mess/machine/msx_slot.c svneol=native#text/plain
src/mess/machine/mtx.c svneol=native#text/plain
src/mess/machine/mz700.c svneol=native#text/plain
src/mess/machine/mz80.c svneol=native#text/plain
src/mess/machine/n82077aa.c svneol=native#text/plain
src/mess/machine/n82077aa.h svneol=native#text/plain
src/mess/machine/nascom1.c svneol=native#text/plain
src/mess/machine/nc.c svneol=native#text/plain
src/mess/machine/ncr5380.c svneol=native#text/plain

View File

@ -0,0 +1,77 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/a5105_dsk.c
a5105 format
*********************************************************************/
#include "emu.h"
#include "formats/a5105_dsk.h"
a5105_format::a5105_format() : upd765_format(formats)
{
}
const char *a5105_format::name() const
{
return "a5105";
}
const char *a5105_format::description() const
{
return "A5105 disk image";
}
const char *a5105_format::extensions() const
{
return "img";
}
// Unverified gap sizes
const a5105_format::format a5105_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSQD,
2000, // 2us, 300rpm
5, 80, 2,
1024, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_A5105_FORMAT = &floppy_image_format_creator<a5105_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/a5105_dsk.h
a5105 format
*********************************************************************/
#ifndef A5105_DSK_H_
#define A5105_DSK_H_
#include "upd765_dsk.h"
class a5105_format : public upd765_format {
public:
a5105_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_A5105_FORMAT;
#endif

View File

@ -0,0 +1,77 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/apollo_dsk.c
apollo format
*********************************************************************/
#include "emu.h"
#include "formats/apollo_dsk.h"
apollo_format::apollo_format() : upd765_format(formats)
{
}
const char *apollo_format::name() const
{
return "apollo";
}
const char *apollo_format::description() const
{
return "APOLLO disk image";
}
const char *apollo_format::extensions() const
{
return "afd";
}
// Unverified gap sizes
const apollo_format::format apollo_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
8, 77, 2,
1024, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_APOLLO_FORMAT = &floppy_image_format_creator<apollo_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/apollo_dsk.h
apollo format
*********************************************************************/
#ifndef APOLLO_DSK_H_
#define APOLLO_DSK_H_
#include "upd765_dsk.h"
class apollo_format : public upd765_format {
public:
apollo_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_APOLLO_FORMAT;
#endif

View File

@ -0,0 +1,109 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/bw12_dsk.c
bw12 format
*********************************************************************/
#include "emu.h"
#include "formats/bw12_dsk.h"
bw12_format::bw12_format() : upd765_format(formats)
{
}
const char *bw12_format::name() const
{
return "bw12";
}
const char *bw12_format::description() const
{
return "Bronwell 12/14 disk image";
}
const char *bw12_format::extensions() const
{
return "dsk";
}
// Unverified gap sizes
const bw12_format::format bw12_format::formats[] = {
{ // 180KB BW 12
floppy_image::FF_525, floppy_image::SSDD,
2000, // 2us, 300rpm
18, 40, 1,
256, {},
0, {},
80, 50, 22, 80
},
{ // 360KB BW 12
floppy_image::FF_525, floppy_image::DSDD,
2000, // 2us, 300rpm
18, 40, 2,
256, {},
0, {},
80, 50, 22, 80
},
{ // SVI-328
floppy_image::FF_525, floppy_image::SSDD,
2000, // 2us, 300rpm
17, 40, 1,
256, {},
0, {},
80, 50, 22, 80
},
{ // SVI-328
floppy_image::FF_525, floppy_image::DSDD,
2000, // 2us, 300rpm
17, 40, 2,
256, {},
0, {},
80, 50, 22, 80
},
{ // Kaypro II
floppy_image::FF_525, floppy_image::SSDD,
2000, // 2us, 300rpm
10, 40, 1,
512, {},
0, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_BW12_FORMAT = &floppy_image_format_creator<bw12_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/bw12_dsk.h
Bonwell 12/14 format
*********************************************************************/
#ifndef BW12_DSK_H_
#define BW12_DSK_H_
#include "upd765_dsk.h"
class bw12_format : public upd765_format {
public:
bw12_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_BW12_FORMAT;
#endif

View File

@ -504,6 +504,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
if(!head_count)
return false;
UINT32 *track_data = global_alloc_array(UINT32, cell_count+10000);
UINT32 track_pos[164];
io_generic_read(io, track_pos, 32, 164*4);
@ -513,7 +514,6 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
if(!pos)
continue;
UINT32 track_data[210000];
UINT8 sect_data[65536];
int tpos = 0;
@ -541,7 +541,6 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
else
gap3 = form_factor == floppy_image::FF_35 ? 84 : 80;
}
int cpos;
UINT16 crc;
// sync and IDAM and gap 2
@ -561,7 +560,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
for(int j=0; j<12; j++) mfm_w(track_data, tpos, 8, 0x00);
cpos = tpos;
for(int j=0; j< 3; j++) raw_w(track_data, tpos, 16, 0x4489);
mfm_w(track_data, tpos, 8, 0xfb);
mfm_w(track_data, tpos, 8, hs[7] ? 0xf8 : 0xfb);
for(int j=0; j<size; j++) mfm_w(track_data, tpos, 8, sect_data[j]);
crc = calc_crc_ccitt(track_data, cpos, tpos);
mfm_w(track_data, tpos, 16, crc);
@ -578,6 +577,7 @@ bool d88_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
generate_track_from_levels(track, head, track_data, cell_count, 0, image);
}
global_free(track_data);
return true;
}

View File

@ -1047,7 +1047,9 @@ const char *floppy_image::get_variant_name(UINT32 form_factor, UINT32 variant)
switch(variant) {
case SSSD: return "Single side, single density";
case SSDD: return "Single side, double density";
case SSQD: return "Single side, quad density";
case DSDD: return "Double side, double density";
case DSQD: return "Double side, quad density";
case DSHD: return "Double side, high density";
case DSED: return "Double side, extended density";
}
@ -1569,6 +1571,7 @@ void floppy_image_format_t::generate_track_from_levels(int track, int head, UINT
case MG_W:
throw emu_fatalerror("Weak bits not yet handled, track %d head %d\n", track, head);
case MG_0:
case floppy_image::MG_N:
case floppy_image::MG_D:
@ -2202,8 +2205,8 @@ void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const UINT8 *b
idblk[idblk_count++] = pos;
i = pos-1;
}
// fa, fb, fc, fd
if(header == 0x5544 || header == 0x5545 || header == 0x5553 || header == 0x5551) {
// f8, f9, fa, fb
if(header == 0x554a || header == 0x5549 || header == 0x5544 || header == 0x5545) {
if(dblk_count < 100)
dblk[dblk_count++] = pos;
i = pos-1;
@ -2229,13 +2232,14 @@ void floppy_image_format_t::extract_sectors_from_bitstream_mfm_pc(const UINT8 *b
continue;
// Start of IDAM and DAM are supposed to be exactly 704 cells
// apart. Of course the hardware is tolerant. Accept +/- 128
// cells of shift.
// apart in normal format or 1008 cells apart in perpendicular
// format. Of course the hardware is tolerant. Accept +/-
// 128 cells of shift.
int d_index;
for(d_index = 0; d_index < dblk_count; d_index++) {
int delta = dblk[d_index] - idblk[i];
if(delta >= 704-128 && delta <= 704+128)
if(delta >= 704-128 && delta <= 1008+128)
break;
}
if(d_index == dblk_count)

View File

@ -683,10 +683,12 @@ public:
void set_write_splice_position(int track, int head, UINT32 pos) { write_splice[track][head] = pos; }
//! @return the current write splice position.
UINT32 get_write_splice_position(int track, int head) const { return write_splice[track][head]; }
//! @return the maximal geometry supported by thie format.
//! @return the maximal geometry supported by this format.
void get_maximal_geometry(int &tracks, int &heads);
//! @return the current geometry of the loaded image.
void get_actual_geometry(int &tracks, int &heads);
//! Returns the variant name for the particular disk form factor/variant
//! @param form_factor
//! @param variant

View File

@ -0,0 +1,77 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/iq151_dsk.c
iq151 format
*********************************************************************/
#include "emu.h"
#include "formats/iq151_dsk.h"
iq151_format::iq151_format() : upd765_format(formats)
{
}
const char *iq151_format::name() const
{
return "iq151";
}
const char *iq151_format::description() const
{
return "IQ151 disk image";
}
const char *iq151_format::extensions() const
{
return "iqd";
}
// Unverified gap sizes. May be FM.
const iq151_format::format iq151_format::formats[] = {
{
floppy_image::FF_8, floppy_image::SSSD,
2000, // maybe
26, 77, 1,
128, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_IQ151_FORMAT = &floppy_image_format_creator<iq151_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/iq151_dsk.h
iq151 format
*********************************************************************/
#ifndef IQ151_DSK_H_
#define IQ151_DSK_H_
#include "upd765_dsk.h"
class iq151_format : public upd765_format {
public:
iq151_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_IQ151_FORMAT;
#endif

View File

@ -0,0 +1,94 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/kc85_dsk.c
kc85 format
*********************************************************************/
#include "emu.h"
#include "formats/kc85_dsk.h"
kc85_format::kc85_format() : upd765_format(formats)
{
}
const char *kc85_format::name() const
{
return "kc85";
}
const char *kc85_format::description() const
{
return "KC85 disk image";
}
const char *kc85_format::extensions() const
{
return "img";
}
// Unverified gap sizes
// 640-800K on HD which handles 1.2M, really?
const kc85_format::format kc85_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
5, 80, 2,
1024, {},
1, {},
80, 50, 22, 80
},
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
9, 80, 2,
512, {},
1, {},
80, 50, 22, 80
},
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
16, 80, 2,
256, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_KC85_FORMAT = &floppy_image_format_creator<kc85_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/kc85_dsk.h
kc85 format
*********************************************************************/
#ifndef KC85_DSK_H_
#define KC85_DSK_H_
#include "upd765_dsk.h"
class kc85_format : public upd765_format {
public:
kc85_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_KC85_FORMAT;
#endif

View File

@ -0,0 +1,77 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/m5_dsk.c
sord m5 format
*********************************************************************/
#include "emu.h"
#include "formats/m5_dsk.h"
m5_format::m5_format() : upd765_format(formats)
{
}
const char *m5_format::name() const
{
return "m5";
}
const char *m5_format::description() const
{
return "Sord M5 disk image";
}
const char *m5_format::extensions() const
{
return "dsk";
}
// Unverified gap sizes
const m5_format::format m5_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSDD,
2000, // 2us, 300rpm
18, 40, 2,
256, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_M5_FORMAT = &floppy_image_format_creator<m5_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/m5_dsk.h
sord m5 format
*********************************************************************/
#ifndef M5_DSK_H_
#define M5_DSK_H_
#include "upd765_dsk.h"
class m5_format : public upd765_format {
public:
m5_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_M5_FORMAT;
#endif

View File

@ -0,0 +1,119 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/mm_dsk.c
mm format
*********************************************************************/
#include "emu.h"
#include "formats/mm_dsk.h"
mm1_format::mm1_format() : upd765_format(formats)
{
}
const char *mm1_format::name() const
{
return "mm1";
}
const char *mm1_format::description() const
{
return "Nokia MikroMikko 1 disk image";
}
const char *mm1_format::extensions() const
{
return "dsk";
}
mm2_format::mm2_format() : upd765_format(formats)
{
}
const char *mm2_format::name() const
{
return "mm2";
}
const char *mm2_format::description() const
{
return "Nokia MikroMikko 2 disk image";
}
const char *mm2_format::extensions() const
{
return "dsk";
}
// Unverified gap sizes
const mm1_format::format mm1_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSQD,
2000, // 2us, 300rpm
8, 80, 2,
512, {},
-1, { 1,4,7,2,5,8,3,6 },
80, 50, 22, 80
},
{}
};
// Unverified gap sizes
const mm2_format::format mm2_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSDD,
2000, // 2us, 300rpm
9, 40, 2,
512, {},
1, {},
80, 50, 22, 80
},
// 40 tracks but 18 sectors implying HD density at 300rpm, i.e. on
// 3.5" media? That makes no sense
{
floppy_image::FF_525, floppy_image::DSHD,
1000, // 1us, 300rpm, otherwise it just won't fit
18, 40, 2, // That line is just nonsense
512, {},
1, {},
80, 50, 22, 80
}
};
const floppy_format_type FLOPPY_MM1_FORMAT = &floppy_image_format_creator<mm1_format>;
const floppy_format_type FLOPPY_MM2_FORMAT = &floppy_image_format_creator<mm2_format>;

View File

@ -0,0 +1,41 @@
/*********************************************************************
formats/mm_dsk.h
MikroMikko formats
*********************************************************************/
#ifndef MM_DSK_H_
#define MM_DSK_H_
#include "upd765_dsk.h"
class mm1_format : public upd765_format {
public:
mm1_format();
virtual const char *name() const;
virtual const char *description() const;
virtual const char *extensions() const;
private:
static const format formats[];
};
class mm2_format : public upd765_format {
public:
mm2_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_MM1_FORMAT;
extern const floppy_format_type FLOPPY_MM2_FORMAT;
#endif

View File

@ -0,0 +1,78 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/nanos_dsk.c
nanos format
*********************************************************************/
#include "emu.h"
#include "formats/nanos_dsk.h"
nanos_format::nanos_format() : upd765_format(formats)
{
}
const char *nanos_format::name() const
{
return "nanos";
}
const char *nanos_format::description() const
{
return "NANOS disk image";
}
const char *nanos_format::extensions() const
{
return "img";
}
// Unverified gap sizes
// 800K on HD which handles 1.2M, really?
const nanos_format::format nanos_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
5, 80, 2,
1024, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_NANOS_FORMAT = &floppy_image_format_creator<nanos_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/nanos_dsk.h
nanos format
*********************************************************************/
#ifndef NANOS_DSK_H_
#define NANOS_DSK_H_
#include "upd765_dsk.h"
class nanos_format : public upd765_format {
public:
nanos_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_NANOS_FORMAT;
#endif

View File

@ -137,119 +137,7 @@ LEGACY_FLOPPY_OPTIONS_START( pc )
SECTORS(8/[9]/10/15/18/36))
LEGACY_FLOPPY_OPTIONS_END
const floppy_image_format_t::desc_e pc_format::pc_9_desc[] = {
{ MFM, 0x4e, 80 },
{ MFM, 0x00, 12 },
{ RAW, 0x5224, 3 },
{ MFM, 0xfc, 1 },
{ MFM, 0x4e, 50 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_START, 0, 8 },
{ CRC_CCITT_START, 1 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfe, 1 },
{ TRACK_ID },
{ HEAD_ID },
{ SECTOR_ID },
{ SIZE_ID },
{ CRC_END, 1 },
{ CRC, 1 },
{ MFM, 0x4e, 22 },
{ MFM, 0x00, 12 },
{ CRC_CCITT_START, 2 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfb, 1 },
{ SECTOR_DATA, -1 },
{ CRC_END, 2 },
{ CRC, 2 },
{ MFM, 0x4e, 84 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_END },
{ MFM, 0x4e, 170 },
{ END }
};
const floppy_image_format_t::desc_e pc_format::pc_18_desc[] = {
{ MFM, 0x4e, 80 },
{ MFM, 0x00, 12 },
{ RAW, 0x5224, 3 },
{ MFM, 0xfc, 1 },
{ MFM, 0x4e, 50 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_START, 0, 17 },
{ CRC_CCITT_START, 1 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfe, 1 },
{ TRACK_ID },
{ HEAD_ID },
{ SECTOR_ID },
{ SIZE_ID },
{ CRC_END, 1 },
{ CRC, 1 },
{ MFM, 0x4e, 22 },
{ MFM, 0x00, 12 },
{ CRC_CCITT_START, 2 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfb, 1 },
{ SECTOR_DATA, -1 },
{ CRC_END, 2 },
{ CRC, 2 },
{ MFM, 0x4e, 84 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_END },
{ MFM, 0x4e, 498 },
{ END }
};
const floppy_image_format_t::desc_e pc_format::pc_36_desc[] = {
{ MFM, 0x4e, 80 },
{ MFM, 0x00, 12 },
{ RAW, 0x5224, 3 },
{ MFM, 0xfc, 1 },
{ MFM, 0x4e, 50 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_START, 0, 35 },
{ CRC_CCITT_START, 1 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfe, 1 },
{ TRACK_ID },
{ HEAD_ID },
{ SECTOR_ID },
{ SIZE_ID },
{ CRC_END, 1 },
{ CRC, 1 },
{ MFM, 0x4e, 22 },
{ MFM, 0x00, 12 },
{ CRC_CCITT_START, 2 },
{ RAW, 0x4489, 3 },
{ MFM, 0xfb, 1 },
{ SECTOR_DATA, -1 },
{ CRC_END, 2 },
{ CRC, 2 },
{ MFM, 0x4e, 84 },
{ MFM, 0x00, 12 },
{ SECTOR_LOOP_END },
{ MFM, 0x4e, 1154 },
{ END }
};
const pc_format::format pc_format::formats[] = {
{ 8*1*40*512, floppy_image::FF_525, floppy_image::SSDD, 40, 1, 8, 0, 000000 }, /* 5 1/4 inch double density single sided */
{ 8*2*40*512, floppy_image::FF_525, floppy_image::DSDD, 40, 2, 8, 0, 000000 }, /* 5 1/4 inch double density */
{ 9*1*40*512, floppy_image::FF_525, floppy_image::SSDD, 40, 1, 9, 0, 000000 }, /* 5 1/4 inch double density single sided */
{ 9*2*40*512, floppy_image::FF_525, floppy_image::DSDD, 40, 2, 9, 0, 000000 }, /* 5 1/4 inch double density */
{ 10*2*40*512, floppy_image::FF_525, floppy_image::DSDD, 40, 2, 10, 0, 000000 }, /* 5 1/4 inch double density 10spt */
{ 9*2*80*512, floppy_image::FF_525, floppy_image::DSDD, 80, 2, 9, 0, 000000 }, /* 80 tracks 5 1/4 inch drives rare in PCs */
{ 9*2*80*512, floppy_image::FF_35, floppy_image::DSDD, 80, 2, 9, pc_9_desc, 100000 }, /* 3 1/2 inch double density */
{ 15*2*80*512, floppy_image::FF_525, floppy_image::DSHD, 80, 2, 15, 0, 000000 }, /* 5 1/4 inch high density (or japanese 3 1/2 inch high density) */
{ 18*2*80*512, floppy_image::FF_35, floppy_image::DSHD, 80, 2, 18, pc_18_desc, 200000 }, /* 3 1/2 inch high density */
{ 21*2*80*512, floppy_image::FF_35, floppy_image::DSHD, 80, 2, 21, 0, 000000 }, /* 3 1/2 inch high density DMF */
{ 36*2*80*512, floppy_image::FF_35, floppy_image::DSED, 80, 2, 36, pc_36_desc, 400000 }, /* 3 1/2 inch enhanced density */
{ 0 },
};
pc_format::pc_format()
pc_format::pc_format() : upd765_format(formats)
{
}
@ -268,106 +156,52 @@ const char *pc_format::extensions() const
return "dsk,ima,img,ufi,360";
}
bool pc_format::supports_save() const
{
return true;
}
int pc_format::find_size(io_generic *io, UINT32 form_factor)
{
int size = io_generic_size(io);
for(int type = 0; formats[type].size; type++)
if(formats[type].size == size && (formats[type].form_factor == form_factor || form_factor == floppy_image::FF_UNKNOWN))
return type;
return -1;
}
int pc_format::identify(io_generic *io, UINT32 form_factor)
{
int type = find_size(io, form_factor);
if(type != -1)
return 50;
return 0;
}
bool pc_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
int type = find_size(io, form_factor);
if(type == -1)
return false;
const format &f = formats[type];
if(!f.desc)
return false;
UINT8 sectdata[36*512];
desc_s sectors[36];
for(int i=0; i<f.sector_count; i++) {
sectors[i].data = sectdata + 512*i;
sectors[i].size = 512;
sectors[i].sector_id = i + 1;
}
int track_size = f.sector_count*512;
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
io_generic_read(io, sectdata, (track*f.head_count + head)*track_size, track_size);
generate_track(f.desc, track, head, sectors, f.sector_count, f.cell_count, image);
}
image->set_variant(f.variant);
return true;
}
bool pc_format::save(io_generic *io, floppy_image *image)
{
int cell_time = 1000;
switch(image->get_variant()) {
case floppy_image::SSSD:
cell_time = 4000; // fm too, actually
break;
case floppy_image::SSDD:
case floppy_image::DSDD:
cell_time = 2000;
break;
case floppy_image::DSHD:
cell_time = 1000;
break;
case floppy_image::DSED:
cell_time = 500;
break;
}
int track_count, head_count, sector_count;
get_geometry_mfm_pc(image, cell_time, track_count, head_count, sector_count);
if(track_count < 80)
track_count = 80;
else if(track_count > 82)
track_count = 82;
// Happens for a fully unformatted floppy
if(!head_count)
head_count = 1;
if(sector_count > 36)
sector_count = 36;
else if(sector_count < 8)
sector_count = 8;
UINT8 sectdata[36*512];
int track_size = sector_count*512;
for(int track=0; track < track_count; track++) {
for(int head=0; head < head_count; head++) {
get_track_data_mfm_pc(track, head, image, cell_time, 512, sector_count, sectdata);
io_generic_write(io, sectdata, (track*head_count + head)*track_size, track_size);
}
}
return true;
}
const pc_format::format pc_format::formats[] = {
{ /* 160K 5 1/4 inch double density single sided */
floppy_image::FF_525, floppy_image::SSDD,
2000, 8, 40, 1, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 320K 5 1/4 inch double density */
floppy_image::FF_525, floppy_image::DSDD,
2000, 8, 40, 2, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 180K 5 1/4 inch double density single sided */
floppy_image::FF_525, floppy_image::SSDD,
2000, 9, 40, 1, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 360K 5 1/4 inch double density */
floppy_image::FF_525, floppy_image::DSDD,
2000, 9, 40, 2, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 400K 5 1/4 inch double density - gaps unverified */
floppy_image::FF_525, floppy_image::DSDD,
2000, 10, 40, 2, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 720K 5 1/4 inch quad density - gaps unverified */
floppy_image::FF_525, floppy_image::DSQD,
2000, 9, 80, 2, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 1200K 5 1/4 inch high density */
floppy_image::FF_525, floppy_image::DSHD,
1200, 15, 40, 2, 512, {}, 1, {}, 80, 50, 22, 84
},
{ /* 720K 3 1/2 inch double density */
floppy_image::FF_35, floppy_image::DSDD,
2000, 9, 80, 2, 512, {}, 1, {}, 80, 50, 22, 80
},
{ /* 1200K 3 1/2 inch high density (japanese variant) - gaps unverified */
floppy_image::FF_35, floppy_image::DSHD,
1200, 15, 40, 2, 512, {}, 1, {}, 80, 50, 22, 84
},
{ /* 1440K 3 1/2 inch high density */
floppy_image::FF_35, floppy_image::DSHD,
1000, 18, 80, 2, 512, {}, 1, {}, 80, 50, 22, 108
},
{ /* 2880K 3 1/2 inch extended density - gaps unverified */
floppy_image::FF_35, floppy_image::DSED,
500, 36, 80, 2, 512, {}, 1, {}, 80, 50, 41, 80
},
{}
};
const floppy_format_type FLOPPY_PC_FORMAT = &floppy_image_format_creator<pc_format>;

View File

@ -10,43 +10,24 @@
#define PC_DSK_H
#include "flopimg.h"
#include "upd765_dsk.h"
/**************************************************************************/
LEGACY_FLOPPY_OPTIONS_EXTERN(pc);
class pc_format : public floppy_image_format_t
class pc_format : public upd765_format
{
public:
pc_format();
virtual int identify(io_generic *io, UINT32 form_factor);
virtual bool load(io_generic *io, UINT32 form_factor, floppy_image *image);
virtual bool save(io_generic *io, floppy_image *image);
virtual const char *name() const;
virtual const char *description() const;
virtual const char *extensions() const;
virtual bool supports_save() const;
private:
struct format {
int size;
UINT32 form_factor;
UINT32 variant;
int track_count;
int head_count;
int sector_count;
const desc_e *desc;
int cell_count;
};
static const format formats[];
static const desc_e pc_9_desc[], pc_18_desc[], pc_36_desc[];
int find_size(io_generic *io, UINT32 form_factor);
};
extern const floppy_format_type FLOPPY_PC_FORMAT;

View File

@ -0,0 +1,78 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/pyldin_dsk.c
pyldin format
*********************************************************************/
#include "emu.h"
#include "formats/pyldin_dsk.h"
pyldin_format::pyldin_format() : upd765_format(formats)
{
}
const char *pyldin_format::name() const
{
return "pyldin";
}
const char *pyldin_format::description() const
{
return "PYLDIN disk image";
}
const char *pyldin_format::extensions() const
{
return "img";
}
// Unverified gap sizes
// 720K on HD which handles 1.2M, really?
const pyldin_format::format pyldin_format::formats[] = {
{
floppy_image::FF_525, floppy_image::DSHD,
1200, // 1us, 360rpm
9, 80, 2,
512, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_PYLDIN_FORMAT = &floppy_image_format_creator<pyldin_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/pyldin_dsk.h
pyldin format
*********************************************************************/
#ifndef PYLDIN_DSK_H_
#define PYLDIN_DSK_H_
#include "upd765_dsk.h"
class pyldin_format : public upd765_format {
public:
pyldin_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_PYLDIN_FORMAT;
#endif

View File

@ -0,0 +1,78 @@
/***************************************************************************
Copyright Olivier Galibert
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************/
/*********************************************************************
formats/sf7000_dsk.c
sf7000 format
*********************************************************************/
#include "emu.h"
#include "formats/sf7000_dsk.h"
sf7000_format::sf7000_format() : upd765_format(formats)
{
}
const char *sf7000_format::name() const
{
return "sf7";
}
const char *sf7000_format::description() const
{
return "SF7 disk image";
}
const char *sf7000_format::extensions() const
{
return "sf7";
}
// Unverified gap sizes
// Drivers says HD, I don't believe it. At all.
const sf7000_format::format sf7000_format::formats[] = {
{
floppy_image::FF_525, floppy_image::SSDD,
2000, // 2us, 300rpm
16, 40, 1,
256, {},
1, {},
80, 50, 22, 80
},
{}
};
const floppy_format_type FLOPPY_SF7000_FORMAT = &floppy_image_format_creator<sf7000_format>;

View File

@ -0,0 +1,28 @@
/*********************************************************************
formats/sf7000_dsk.h
sf7000 format
*********************************************************************/
#ifndef SF7000_DSK_H_
#define SF7000_DSK_H_
#include "upd765_dsk.h"
class sf7000_format : public upd765_format {
public:
sf7000_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_SF7000_FORMAT;
#endif

View File

@ -51,21 +51,11 @@ int upd765_format::find_size(io_generic *io, UINT32 form_factor)
{
int size = io_generic_size(io);
for(int i=0; formats[i].form_factor; i++) {
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != formats[i].form_factor)
const format &f = formats[i];
if(form_factor != floppy_image::FF_UNKNOWN && form_factor != f.form_factor)
continue;
int format_size;
if(formats[i].sector_base_size)
format_size = formats[i].sector_base_size * formats[i].sector_count;
else {
format_size = 0;
for(int j=0; j != formats[i].sector_count; j++)
format_size += formats[i].per_sector_size[j];
}
format_size *= formats[i].track_count * formats[i].head_count;
if(size == format_size)
if(size == compute_track_size(f) * f.track_count * f.head_count)
return i;
}
return -1;
@ -80,6 +70,42 @@ int upd765_format::identify(io_generic *io, UINT32 form_factor)
return 0;
}
int upd765_format::compute_track_size(const format &f) const
{
int track_size;
if(f.sector_base_size)
track_size = f.sector_base_size * f.sector_count;
else {
track_size = 0;
for(int i=0; i != f.sector_count; i++)
track_size += f.per_sector_size[i];
}
return track_size;
}
void upd765_format::build_sector_description(const format &f, UINT8 *sectdata, desc_s *sectors) const
{
if(f.sector_base_id == -1) {
for(int i=0; i<f.sector_count; i++) {
int cur_offset = 0;
for(int j=0; j<f.sector_count; j++)
if(f.per_sector_id[j] < f.per_sector_id[i])
cur_offset += f.sector_base_size ? f.sector_base_size : f.per_sector_size[j];
sectors[i].data = sectdata + cur_offset;
sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i];
sectors[i].sector_id = f.per_sector_id[i];
}
} else {
int cur_offset = 0;
for(int i=0; i<f.sector_count; i++) {
sectors[i].data = sectdata + cur_offset;
sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i];
cur_offset += sectors[i].size;
sectors[i].sector_id = i + f.sector_base_id;
}
}
}
bool upd765_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
{
int type = find_size(io, form_factor);
@ -139,36 +165,11 @@ bool upd765_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
desc[27].p2 = remaining_size & 15;
desc[27].p1 >>= 16-(remaining_size & 15);
int track_size;
if(f.sector_base_size)
track_size = f.sector_base_size * f.sector_count;
else {
track_size = 0;
for(int i=0; i != f.sector_count; i++)
track_size += f.per_sector_size[i];
}
int track_size = compute_track_size(f);
UINT8 sectdata[40*512];
desc_s sectors[40];
if(f.sector_base_id == -1) {
for(int i=0; i<f.sector_count; i++) {
int cur_offset = 0;
for(int j=0; j<f.sector_count; j++)
if(f.per_sector_id[j] < f.per_sector_id[i])
cur_offset += f.sector_base_size ? f.sector_base_size : f.per_sector_size[j];
sectors[i].data = sectdata + cur_offset;
sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i];
sectors[i].sector_id = f.per_sector_id[i];
}
} else {
int cur_offset = 0;
for(int i=0; i<f.sector_count; i++) {
sectors[i].data = sectdata + cur_offset;
sectors[i].size = f.sector_base_size ? f.sector_base_size : f.per_sector_size[i];
cur_offset += sectors[i].size;
sectors[i].sector_id = i + f.sector_base_id;
}
}
build_sector_description(f, sectdata, sectors);
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
@ -181,14 +182,192 @@ bool upd765_format::load(io_generic *io, UINT32 form_factor, floppy_image *image
return true;
}
bool upd765_format::save(io_generic *io, floppy_image *image)
{
return true;
}
bool upd765_format::supports_save() const
{
return true;
}
bool upd765_format::save(io_generic *io, floppy_image *image)
{
// Count the number of formats
int formats_count;
for(formats_count=0; formats[formats_count].form_factor; formats_count++);
// Allocate the storage for the list of testable formats for a
// given cell size
int *candidates = global_alloc_array(int, formats_count);
// Format we're finally choosing
int chosen_candidate = -1;
// Previously tested cell size
int min_cell_size = 0;
for(;;) {
// Build the list of all formats for the immediatly superior cell size
int cur_cell_size = 0;
int candidates_count = 0;
for(int i=0; i != formats_count; i++) {
if(image->get_form_factor() == floppy_image::FF_UNKNOWN ||
image->get_form_factor() == formats[i].form_factor) {
if(formats[i].cell_size == cur_cell_size)
candidates[candidates_count++] = i;
else if((!cur_cell_size || formats[i].cell_size < cur_cell_size) &&
formats[i].cell_size > min_cell_size) {
candidates[0] = i;
candidates_count = 1;
cur_cell_size = formats[i].cell_size;
}
}
}
min_cell_size = cur_cell_size;
// No candidates with a cell size bigger than the previously
// tested one, we're done
if(!candidates_count)
break;
// Filter with track 0 head 0
check_compatibility(image, candidates, candidates_count);
// Nobody matches, try with the next cell size
if(!candidates_count)
continue;
// We have a match at that cell size, we just need to find the
// best one given the geometry
// If there's only one, we're done
if(candidates_count == 1) {
chosen_candidate = candidates[0];
break;
}
// Otherwise, find the best
int tracks, heads;
image->get_actual_geometry(tracks, heads);
chosen_candidate = candidates[0];
for(int i=1; i != candidates_count; i++) {
const format &cc = formats[chosen_candidate];
const format &cn = formats[candidates[i]];
// Handling enough sides is better than not
if(cn.head_count >= heads && cc.head_count < heads)
goto change;
else if(cc.head_count >= heads && cn.head_count < heads)
goto dont_change;
// Since we're limited to two heads, at that point head
// count is identical for both formats.
// Handling enough tracks is better than not
if(cn.track_count >= tracks && cc.track_count < tracks)
goto change;
else if(cn.track_count >= tracks && cc.track_count < tracks)
goto dont_change;
// Both are on the same side of the track count, so closest is best
if(cc.track_count < tracks && cn.track_count > cc.track_count)
goto change;
if(cc.track_count >= tracks && cn.track_count < cc.track_count)
goto change;
goto dont_change;
change:
chosen_candidate = candidates[i];
dont_change:
;
}
// We have a winner, bail out
break;
}
// No match, pick the first one and be done with it
if(chosen_candidate == -1)
chosen_candidate = 0;
const format &f = formats[chosen_candidate];
int track_size = compute_track_size(f);
UINT8 sectdata[40*512];
desc_s sectors[40];
build_sector_description(f, sectdata, sectors);
for(int track=0; track < f.track_count; track++)
for(int head=0; head < f.head_count; head++) {
extract_sectors(image, f, sectors, track, head);
io_generic_write(io, sectdata, (track*f.head_count + head)*track_size, track_size);
}
return true;
}
void upd765_format::check_compatibility(floppy_image *image, int *candidates, int &candidates_count)
{
UINT8 bitstream[500000/8];
UINT8 sectdata[50000];
desc_xs sectors[256];
int track_size;
// Extract the sectors
generate_bitstream_from_track(0, 0, formats[candidates[0]].cell_size, bitstream, track_size, image);
extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
// Check compatibility with every candidate, copy in-place
int *ok_cands = candidates;
for(int i=0; i != candidates_count; i++) {
const format &f = formats[candidates[i]];
int ns = 0;
for(int j=0; j<256; j++)
if(sectors[j].data) {
int sid;
if(f.sector_base_id == -1) {
for(sid=0; sid < f.sector_count; sid++)
if(f.per_sector_id[sid] == j)
break;
} else
sid = j - f.sector_base_id;
if(sid < 0 || sid > f.sector_count)
goto fail;
if(f.sector_base_size) {
if(sectors[j].size != f.sector_base_size)
goto fail;
} else {
if(sectors[j].size != f.per_sector_size[sid])
goto fail;
}
ns++;
}
if(ns == f.sector_count)
*ok_cands++ = candidates[i];
fail:
;
}
candidates_count = ok_cands - candidates;
}
void upd765_format::extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head)
{
UINT8 bitstream[500000/8];
UINT8 sectdata[50000];
desc_xs sectors[256];
int track_size;
// Extract the sectors
generate_bitstream_from_track(track, head, f.cell_size, bitstream, track_size, image);
extract_sectors_from_bitstream_mfm_pc(bitstream, track_size, sectors, sectdata, sizeof(sectdata));
for(int i=0; i<f.sector_count; i++) {
desc_s &ds = sdesc[i];
desc_xs &xs = sectors[ds.sector_id];
if(!xs.data)
memset((void *)ds.data, 0, ds.size);
else if(xs.size < ds.size) {
memcpy((void *)ds.data, xs.data, xs.size);
memset((UINT8 *)ds.data + xs.size, 0, xs.size - ds.size);
} else
memcpy((void *)ds.data, xs.data, ds.size);
}
}

View File

@ -43,6 +43,10 @@ public:
private:
const format *formats;
int find_size(io_generic *io, UINT32 form_factor);
int compute_track_size(const format &f) const;
void build_sector_description(const format &d, UINT8 *sectdata, desc_s *sectors) const;
void check_compatibility(floppy_image *image, int *candidates, int &candidates_count);
void extract_sectors(floppy_image *image, const format &f, desc_s *sdesc, int track, int head);
};
#endif /* UPD765_DSK_H */

View File

@ -93,16 +93,19 @@ FORMATSOBJS = \
$(LIBOBJ)/formats/ioprocs.o \
$(LIBOBJ)/formats/basicdsk.o \
$(LIBOBJ)/formats/a26_cas.o \
$(LIBOBJ)/formats/a5105_dsk.o \
$(LIBOBJ)/formats/ace_tap.o \
$(LIBOBJ)/formats/adam_cas.o \
$(LIBOBJ)/formats/ami_dsk.o \
$(LIBOBJ)/formats/ap2_dsk.o \
$(LIBOBJ)/formats/apf_apt.o \
$(LIBOBJ)/formats/apridisk.o \
$(LIBOBJ)/formats/apollo_dsk.o \
$(LIBOBJ)/formats/ap_dsk35.o \
$(LIBOBJ)/formats/atari_dsk.o \
$(LIBOBJ)/formats/atarist_dsk.o \
$(LIBOBJ)/formats/atom_tap.o \
$(LIBOBJ)/formats/bw12_dsk.o \
$(LIBOBJ)/formats/cbm_tap.o \
$(LIBOBJ)/formats/cgen_cas.o \
$(LIBOBJ)/formats/coco_cas.o \
@ -127,14 +130,19 @@ FORMATSOBJS = \
$(LIBOBJ)/formats/gtp_cas.o \
$(LIBOBJ)/formats/hect_dsk.o \
$(LIBOBJ)/formats/hect_tap.o \
$(LIBOBJ)/formats/iq151_dsk.o \
$(LIBOBJ)/formats/imd_dsk.o \
$(LIBOBJ)/formats/ipf_dsk.o \
$(LIBOBJ)/formats/kc_cas.o \
$(LIBOBJ)/formats/kc85_dsk.o \
$(LIBOBJ)/formats/kim1_cas.o \
$(LIBOBJ)/formats/lviv_lvt.o \
$(LIBOBJ)/formats/m5_dsk.o \
$(LIBOBJ)/formats/mm_dsk.o \
$(LIBOBJ)/formats/msx_dsk.o \
$(LIBOBJ)/formats/mfi_dsk.o \
$(LIBOBJ)/formats/mz_cas.o \
$(LIBOBJ)/formats/nanos_dsk.o \
$(LIBOBJ)/formats/nes_dsk.o \
$(LIBOBJ)/formats/orao_cas.o \
$(LIBOBJ)/formats/oric_dsk.o \
@ -144,8 +152,10 @@ FORMATSOBJS = \
$(LIBOBJ)/formats/pc_dsk.o \
$(LIBOBJ)/formats/pmd_cas.o \
$(LIBOBJ)/formats/primoptp.o \
$(LIBOBJ)/formats/pyldin_dsk.o \
$(LIBOBJ)/formats/rk_cas.o \
$(LIBOBJ)/formats/sc3000_bit.o \
$(LIBOBJ)/formats/sf7000_dsk.o \
$(LIBOBJ)/formats/smx_dsk.o \
$(LIBOBJ)/formats/sorc_dsk.o \
$(LIBOBJ)/formats/sord_cas.o \

View File

@ -21,13 +21,14 @@ ToDo:
#include "video/upd7220.h"
#include "machine/ram.h"
#include "machine/upd765.h"
#include "formats/mfi_dsk.h"
#include "formats/a5105_dsk.h"
#include "machine/z80ctc.h"
#include "machine/z80pio.h"
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
#include "sound/wave.h"
#include "sound/beep.h"
#include "formats/basicdsk.h"
@ -310,14 +311,13 @@ WRITE8_MEMBER( a5105_state::a5105_memsel_w )
WRITE8_MEMBER( a5105_state::a5105_upd765_w )
{
upd765_tc_w(machine().device("upd765"), BIT(data, 4));
machine().device<upd765a_device>("upd765")->tc_w(BIT(data, 4));
}
static ADDRESS_MAP_START(a5105_io, AS_IO, 8, a5105_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x40, 0x40) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0x41, 0x41) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE(0x40, 0x41) AM_DEVICE("upd765a", upd765a_device, map)
AM_RANGE(0x48, 0x4f) AM_WRITE(a5105_upd765_w)
AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("z80ctc", z80ctc_device, read, write)
@ -520,37 +520,15 @@ static ADDRESS_MAP_START( upd7220_map, AS_0, 8, a5105_state)
AM_RANGE(0x00000, 0x1ffff) AM_RAM AM_SHARE("video_ram")
ADDRESS_MAP_END
static LEGACY_FLOPPY_OPTIONS_START(a5105)
LEGACY_FLOPPY_OPTION(a5105, "img", "A5105 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([80])
SECTORS([5])
SECTOR_LENGTH([1024])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface a5105_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(a5105),
"floppy_5_25",
static const floppy_format_type a5105_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
FLOPPY_A5105_FORMAT,
NULL
};
static const upd765_interface a5105_interface =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
static SLOT_INTERFACE_START( a5105_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
static Z80CTC_INTERFACE( a5105_ctc_intf )
{
@ -609,8 +587,11 @@ static MACHINE_CONFIG_START( a5105, a5105_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, default_cassette_interface )
MCFG_UPD765A_ADD("upd765", a5105_interface)
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(a5105_floppy_interface)
MCFG_UPD765A_ADD("upd765a", false, true)
MCFG_FLOPPY_DRIVE_ADD("upd765a:0", a5105_floppies, "525dd", 0, a5105_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765a:1", a5105_floppies, "525dd", 0, a5105_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765a:2", a5105_floppies, "525dd", 0, a5105_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765a:3", a5105_floppies, "525dd", 0, a5105_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -55,6 +55,7 @@ More information can be found at http://www.seasip.info/AmstradXT/1640tech/index
#include "imagedev/cassette.h"
#include "imagedev/cartslot.h"
#include "formats/pc_dsk.h"
#include "formats/mfi_dsk.h"
#include "machine/8237dma.h"
#include "sound/sn76496.h"
@ -95,7 +96,7 @@ static ADDRESS_MAP_START(ppc512_io, AS_IO, 16, pc_state )
AM_RANGE(0x0378, 0x037b) AM_READ8_LEGACY(pc200_port378_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_1", pc_lpt_w, 0x00ff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_xt_device, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -123,7 +124,7 @@ static ADDRESS_MAP_START(pc200_io, AS_IO, 16, pc_state )
AM_RANGE(0x0378, 0x037b) AM_READ8_LEGACY(pc200_port378_r, 0xffff) AM_DEVWRITE8_LEGACY("lpt_1", pc_lpt_w, 0x00ff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0x00ff)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_xt_device, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -219,19 +220,16 @@ static const pc_lpt_interface pc_lpt_config =
DEVCB_CPU_INPUT_LINE("maincpu", 0)
};
static const floppy_interface ibmpc_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
NULL,
static const floppy_format_type ibmpc_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( ibmpc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
SLOT_INTERFACE_START(amstr_com)
SLOT_INTERFACE("microsoft_mouse", MSFT_SERIAL_MOUSE)
SLOT_INTERFACE("mouse_systems_mouse", MSYSTEM_SERIAL_MOUSE)
@ -300,9 +298,10 @@ static MACHINE_CONFIG_START( pc200, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -370,9 +369,10 @@ static MACHINE_CONFIG_START( ppc512, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )

View File

@ -101,9 +101,7 @@ Some bugs left :
#include "machine/ctronics.h"
/* Devices */
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "formats/msx_dsk.h"
#include "formats/mfi_dsk.h"
#include "imagedev/snapquik.h"
#include "imagedev/cartslot.h"
#include "imagedev/cassette.h"
@ -134,30 +132,9 @@ static I8255_INTERFACE( amstrad_ppi8255_interface )
DEVCB_DRIVER_MEMBER(amstrad_state,amstrad_ppi_portc_w) /* port C write */
};
/* Amstrad UPD765 interface doesn't use interrupts or DMA! */
static const upd765_interface amstrad_upd765_interface =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
/* Aleste uses an 8272A, with the interrupt flag visible on PPI port B */
static const upd765_interface aleste_8272_interface =
{
DEVCB_DRIVER_LINE_MEMBER(amstrad_state,aleste_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
DRIVER_INIT_MEMBER(amstrad_state,aleste)
{
m_fdc->setup_intrq_cb(i8272a_device::line_cb(FUNC(amstrad_state::aleste_interrupt), this));
}
@ -829,32 +806,25 @@ static const cassette_interface amstrad_cassette_interface =
NULL
};
static const floppy_interface cpc6128_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_3_SSDD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_3",
static const floppy_format_type amstrad_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static const floppy_interface aleste_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(msx),
NULL,
static const floppy_format_type aleste_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( amstrad_floppies )
SLOT_INTERFACE( "3ssdd", FLOPPY_3_SSDD )
SLOT_INTERFACE_END
static SLOT_INTERFACE_START( aleste_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
CPC_EXPANSION_INTERFACE(cpc_exp_intf)
{
DEVCB_CPU_INPUT_LINE("maincpu", 0),
@ -873,7 +843,7 @@ static MACHINE_CONFIG_FRAGMENT( cpcplus_cartslot )
MCFG_SOFTWARE_LIST_ADD("cart_list","gx4000")
MACHINE_CONFIG_END
static MACHINE_CONFIG_START( amstrad, amstrad_state )
static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state )
/* Machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz / 4)
MCFG_CPU_PROGRAM_MAP(amstrad_mem)
@ -918,11 +888,6 @@ static MACHINE_CONFIG_START( amstrad, amstrad_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, amstrad_cassette_interface )
MCFG_SOFTWARE_LIST_ADD("cass_list","cpc_cass")
MCFG_UPD765A_ADD("upd765", amstrad_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(cpc6128_floppy_interface)
MCFG_SOFTWARE_LIST_ADD("flop_list","cpc_flop")
MCFG_CPC_EXPANSION_SLOT_ADD("exp",cpc_exp_intf,cpc_exp_cards,NULL,NULL)
/* internal ram */
@ -931,6 +896,16 @@ static MACHINE_CONFIG_START( amstrad, amstrad_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( amstrad, amstrad_nofdc )
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", amstrad_floppies, "3ssdd", 0, amstrad_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "3ssdd", 0, amstrad_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("flop_list","cpc_flop")
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( kccomp, amstrad )
MCFG_MACHINE_START_OVERRIDE(amstrad_state,kccomp)
MCFG_MACHINE_RESET_OVERRIDE(amstrad_state,kccomp)
@ -983,11 +958,12 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, amstrad_cassette_interface )
MCFG_UPD765A_ADD("upd765", amstrad_upd765_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FRAGMENT_ADD(cpcplus_cartslot)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(cpc6128_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", amstrad_floppies, "3ssdd", 0, amstrad_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", amstrad_floppies, "3ssdd", 0, amstrad_floppy_formats)
MCFG_CPC_EXPANSION_SLOT_ADD("exp",cpc_exp_intf,cpc_exp_cards,NULL,NULL)
@ -1049,9 +1025,11 @@ static MACHINE_CONFIG_DERIVED( aleste, amstrad )
MCFG_PALETTE_LENGTH(32+64)
MCFG_PALETTE_INIT_OVERRIDE(amstrad_state,aleste)
MCFG_MC146818_ADD( "rtc", MC146818_IGNORE_CENTURY )
MCFG_UPD765A_MODIFY("upd765", aleste_8272_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_MODIFY(aleste_floppy_interface)
MCFG_I8272A_ADD("upd765", true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", aleste_floppies, "525hd", 0, aleste_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", aleste_floppies, "525hd", 0, aleste_floppy_formats)
/* internal ram */
MCFG_RAM_MODIFY(RAM_TAG)

View File

@ -29,6 +29,7 @@
#include "includes/apollo.h"
#include "machine/apollo_kbd.h"
#include "machine/pc_fdc.h"
#include "debugger.h"
@ -751,7 +752,7 @@ static ADDRESS_MAP_START(dn3500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
@ -799,7 +800,7 @@ static ADDRESS_MAP_START(dsp3500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
// AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
// AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
@ -838,7 +839,7 @@ static ADDRESS_MAP_START(dn3000_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
@ -876,7 +877,7 @@ static ADDRESS_MAP_START(dsp3000_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
// AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
// AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
@ -922,7 +923,7 @@ static ADDRESS_MAP_START(dn5500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)
@ -974,7 +975,7 @@ static ADDRESS_MAP_START(dsp5500_map, AS_PROGRAM, 32, apollo_state )
AM_RANGE(0x04D000, 0x04D007) AM_DEVREADWRITE16_LEGACY(APOLLO_WDC_TAG, omti8621_r, omti8621_w, 0xffffffff)
AM_RANGE(0x050000, 0x050007) AM_DEVREADWRITE8_LEGACY(APOLLO_CTAPE_TAG, sc499_r, sc499_w, 0xffffffff)
AM_RANGE(0x058000, 0x058007) AM_DEVREADWRITE8_LEGACY(APOLLO_ETH_TAG, threecom3c505_r, threecom3c505_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_READWRITE8(apollo_fdc_r, apollo_fdc_w, 0xffffffff)
AM_RANGE(0x05f800, 0x05f807) AM_DEVICE8(APOLLO_WDC_TAG, pc_fdc_at_device, map, 0xffffffff)
// AM_RANGE(0x05d800, 0x05dc07) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mcr_r, apollo_mcr_w, 0xffffffff)
// AM_RANGE(0xfa0000, 0xfdffff) AM_DEVREADWRITE16_LEGACY(APOLLO_SCREEN_TAG, apollo_mgm_r, apollo_mgm_w, 0xffffffff)

View File

@ -355,7 +355,7 @@ static SLOT_INTERFACE_START(pc_isa16_cards)
SLOT_INTERFACE("svga_dm",ISA8_SVGA_CIRRUS)
SLOT_INTERFACE("com", ISA8_COM)
SLOT_INTERFACE("comat", ISA8_COM_AT)
SLOT_INTERFACE("fdc", ISA8_FDC)
SLOT_INTERFACE("fdc", ISA8_FDC_AT)
SLOT_INTERFACE("hdc", ISA8_HDC)
SLOT_INTERFACE("adlib", ISA8_ADLIB)
SLOT_INTERFACE("hercules", ISA8_HERCULES)

View File

@ -18,7 +18,7 @@
#include "machine/ins8250.h"
#include "machine/pic8259.h"
#include "machine/mc146818.h"
#include "machine/pc_fdc.h"
#include "machine/upd765.h"
#include "machine/pci.h"
#include "machine/8237dma.h"
#include "machine/pckeybrd.h"
@ -34,6 +34,7 @@
#include "machine/scsicd.h"
#include "machine/scsihd.h"
#include "imagedev/flopdrv.h"
#include "formats/mfi_dsk.h"
#include "formats/pc_dsk.h"
#include "machine/ram.h"
@ -63,6 +64,7 @@ static ADDRESS_MAP_START( bebox_mem, AS_PROGRAM, 64, bebox_state )
AM_RANGE(0x800003c0, 0x800003cf) AM_DEVREADWRITE8("vga", cirrus_vga_device, port_03c0_r, port_03c0_w, U64(0xffffffffffffffff))
AM_RANGE(0x800003d0, 0x800003df) AM_DEVREADWRITE8("vga", cirrus_vga_device, port_03d0_r, port_03d0_w, U64(0xffffffffffffffff))
AM_RANGE(0x800003F0, 0x800003F7) AM_READWRITE(bebox_800003F0_r, bebox_800003F0_w )
AM_RANGE(0x800003F0, 0x800003F7) AM_DEVICE8( "smc37c78", smc37c78_device, map, U64(0xffffffffffffffff) )
AM_RANGE(0x800003F8, 0x800003FF) AM_DEVREADWRITE8( "ns16550_0",ns16550_device, ins8250_r, ins8250_w, U64(0xffffffffffffffff) )
AM_RANGE(0x80000480, 0x8000048F) AM_READWRITE8(bebox_80000480_r, bebox_80000480_w, U64(0xffffffffffffffff) )
AM_RANGE(0x80000CF8, 0x80000CFF) AM_DEVREADWRITE("pcibus", pci_bus_device, read_64be, write_64be )
@ -129,19 +131,16 @@ static const struct LSI53C810interface lsi53c810_intf =
};
static const floppy_interface bebox_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
NULL,
static const floppy_format_type bebox_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( bebox_floppies )
SLOT_INTERFACE( "35hd", FLOPPY_35_HD )
SLOT_INTERFACE_END
const struct mpc105_interface mpc105_config =
{
"ppc1",
@ -209,9 +208,8 @@ static MACHINE_CONFIG_START( bebox, bebox_state )
/*MCFG_PCI_BUS_DEVICE(12, NULL, scsi53c810_pci_read, scsi53c810_pci_write)*/
MCFG_SMC37C78_ADD("smc37c78", pc_fdc_upd765_connected_1_drive_interface)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, bebox_floppy_interface)
MCFG_SMC37C78_ADD("smc37c78")
MCFG_FLOPPY_DRIVE_ADD("smc37c78:0", bebox_floppies, "35hd", 0, bebox_floppy_formats)
MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )

View File

@ -28,7 +28,7 @@
#include "cpu/z80/z80.h"
#include "imagedev/flopdrv.h"
#include "machine/ram.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "machine/6821pia.h"
#include "machine/ctronics.h"
#include "machine/upd765.h"
@ -146,8 +146,7 @@ void bw12_state::ls259_w(int address, int data)
if (data)
{
floppy_mon_w(m_floppy0, CLEAR_LINE);
floppy_drive_set_ready_state(m_floppy0, 1, 0);
m_floppy0->mon_w(false);
}
set_floppy_motor_off_timer();
@ -158,15 +157,14 @@ void bw12_state::ls259_w(int address, int data)
if (data)
{
floppy_mon_w(m_floppy1, CLEAR_LINE);
floppy_drive_set_ready_state(m_floppy1, 1, 0);
m_floppy1->mon_w(false);
}
set_floppy_motor_off_timer();
break;
case 7: /* FDC TC */
upd765_tc_w(m_fdc, data);
m_fdc->tc_w(data);
break;
}
}
@ -199,8 +197,7 @@ static ADDRESS_MAP_START( bw12_io, AS_IO, 8, bw12_state )
AM_RANGE(0x00, 0x0f) AM_READWRITE(ls259_r, ls259_w)
AM_RANGE(0x10, 0x10) AM_MIRROR(0x0e) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
AM_RANGE(0x11, 0x11) AM_MIRROR(0x0e) AM_DEVREADWRITE(MC6845_TAG, mc6845_device, register_r, register_w)
AM_RANGE(0x20, 0x20) AM_MIRROR(0x0e) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
AM_RANGE(0x21, 0x21) AM_MIRROR(0x0e) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0x20, 0x21) AM_MIRROR(0x0e) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0x30, 0x33) AM_MIRROR(0x0c) AM_DEVREADWRITE(PIA6821_TAG, pia6821_device, read, write)
AM_RANGE(0x40, 0x40) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_d_r, z80dart_d_w)
AM_RANGE(0x41, 0x41) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_c_r, z80dart_c_w)
@ -408,37 +405,11 @@ void bw12_state::video_start()
/* UPD765 Interface */
WRITE_LINE_MEMBER( bw12_state::fdc_intrq_w )
void bw12_state::fdc_intrq_w(bool state)
{
m_fdc_int = state;
}
static UPD765_GET_IMAGE( bw12_upd765_get_image )
{
bw12_state *state = device->machine().driver_data<bw12_state>();
switch (floppy_index)
{
case 1: /* drive A */
return state->m_floppy0;
case 2: /* drive B */
return state->m_floppy1;
default:
return NULL;
}
}
static const struct upd765_interface fdc_intf =
{
DEVCB_DRIVER_LINE_MEMBER(bw12_state, fdc_intrq_w), /* interrupt */
DEVCB_NULL, /* DMA request */
bw12_upd765_get_image, /* image lookup */
UPD765_RDY_PIN_CONNECTED, /* ready pin */
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
/* PIA6821 Interface */
READ8_MEMBER( bw12_state::pia_pa_r )
@ -659,84 +630,21 @@ void bw12_state::machine_reset()
}
}
static LEGACY_FLOPPY_OPTIONS_START( bw12 )
LEGACY_FLOPPY_OPTION(bw12, "dsk", "180KB BW 12 SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([18])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw12, "dsk", "SVI-328 SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([17])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw12, "dsk", "Kaypro II SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([10])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTIONS_END
static SLOT_INTERFACE_START( bw12_floppies )
SLOT_INTERFACE( "525ssdd", FLOPPY_525_SSDD )
SLOT_INTERFACE_END
static const floppy_interface bw12_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_SSDD,
LEGACY_FLOPPY_OPTIONS_NAME(bw12),
NULL,
static const floppy_format_type bw12_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static LEGACY_FLOPPY_OPTIONS_START( bw14 )
LEGACY_FLOPPY_OPTION(bw14, "dsk", "180KB BW 12 SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([18])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw14, "dsk", "360KB BW 14 DSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([40])
SECTORS([18])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw14, "dsk", "SVI-328 SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([17])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw14, "dsk", "SVI-328 DSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([40])
SECTORS([17])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTION(bw14, "dsk", "Kaypro II SSDD", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([10])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([0]))
LEGACY_FLOPPY_OPTIONS_END
static SLOT_INTERFACE_START( bw14_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static const floppy_interface bw14_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(bw14),
NULL,
static const floppy_format_type bw14_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
@ -788,7 +696,7 @@ static MACHINE_CONFIG_START( common, bw12_state )
/* devices */
MCFG_TIMER_DRIVER_ADD(FLOPPY_TIMER_TAG, bw12_state, floppy_motor_off_tick)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_UPD765A_ADD(UPD765_TAG, true, true)
MCFG_PIA6821_ADD(PIA6821_TAG, pia_intf)
MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_16MHz/4, sio_intf)
MCFG_PIT8253_ADD(PIT8253_TAG, pit_intf)
@ -800,7 +708,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( bw12, common )
/* floppy drives */
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bw12_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw12_floppies, "525ssdd", 0, bw12_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw12_floppies, "525ssdd", 0, bw12_floppy_formats)
// software lists
MCFG_SOFTWARE_LIST_ADD("flop_list", "bw12")
@ -812,7 +721,8 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( bw14, common )
/* floppy drives */
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(bw14_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", bw14_floppies, "525hd", 0, bw14_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", bw14_floppies, "525hd", 0, bw14_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -41,6 +41,7 @@
******************************************************************************/
#include "includes/compis.h"
#include "formats/mfi_dsk.h"
#if 0
/* TODO: this is likely to come from a RAMdac ... */
@ -165,8 +166,8 @@ static ADDRESS_MAP_START( compis_io, AS_IO, 16, compis_state )
//AM_RANGE( 0x0288, 0x028f) AM_DEVREADWRITE_LEGACY("pit8254", compis_osp_pit_r, compis_osp_pit_w ) /* PIT 8254 (80150/80130) */
AM_RANGE( 0x0310, 0x031f) AM_READWRITE( compis_usart_r, compis_usart_w ) /* USART 8251 Keyboard */
AM_RANGE( 0x0330, 0x0333) AM_DEVREADWRITE8("upd7220", upd7220_device, read, write, 0x00ff) /* GDC 82720 PCS6:6 */
AM_RANGE( 0x0340, 0x0343) AM_READWRITE8( compis_fdc_r, compis_fdc_w, 0xffff ) /* iSBX0 (J8) FDC 8272 */
AM_RANGE( 0x0350, 0x0351) AM_READ(compis_fdc_dack_r) /* iSBX0 (J8) DMA ACK */
AM_RANGE( 0x0340, 0x0343) AM_DEVICE8("i8272a", i8272a_device, map, 0x00ff) /* iSBX0 (J8) FDC 8272 */
AM_RANGE( 0x0350, 0x0351) AM_DEVREADWRITE8("i8272a", i8272a_device, mdma_r, mdma_w, 0x00ff) /* iSBX0 (J8) DMA ACK */
AM_RANGE( 0xff00, 0xffff) AM_READWRITE( compis_i186_internal_port_r, compis_i186_internal_port_w)/* CPU 80186 */
//{ 0x0100, 0x017e, compis_null_r }, /* RTC */
//{ 0x0180, 0x01ff, compis_null_r }, /* PCS3? */
@ -334,19 +335,16 @@ static const mm58274c_interface compis_mm58274c_interface =
1 /* first day of week */
};
static const floppy_interface compis_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSQD,
LEGACY_FLOPPY_OPTIONS_NAME(compis),
"floppy_5_25",
static const floppy_format_type compis_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( compis_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
SLOT_INTERFACE_END
static ADDRESS_MAP_START( upd7220_map, AS_0, 8, compis_state )
ADDRESS_MAP_GLOBAL_MASK(0x1ffff)
AM_RANGE(0x00000, 0x1ffff) AM_RAM AM_SHARE("video_ram")
@ -387,8 +385,9 @@ static MACHINE_CONFIG_START( compis, compis_state )
MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
MCFG_I8251_ADD("uart", compis_usart_interface)
MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)
MCFG_UPD765A_ADD("upd765", compis_fdc_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface)
MCFG_I8272A_ADD("i8272a", true)
MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", 0, compis_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", 0, compis_floppy_formats)
MCFG_COMPIS_KEYBOARD_ADD()
/* software lists */
@ -426,8 +425,9 @@ static MACHINE_CONFIG_START( compis2, compis_state )
MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
MCFG_I8251_ADD("uart", compis_usart_interface)
MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)
MCFG_UPD765A_ADD("upd765", compis_fdc_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(compis_floppy_interface)
MCFG_I8272A_ADD("i8272a", true)
MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", 0, compis_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", 0, compis_floppy_formats)
MCFG_COMPIS_KEYBOARD_ADD()
/* software lists */

View File

@ -13,7 +13,7 @@
#include "machine/upd765.h"
#include "machine/8237dma.h"
#include "video/upd7220.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "dmv.lh"
class dmv_state : public driver_device
@ -24,27 +24,34 @@ public:
m_maincpu(*this, "maincpu"),
m_hgdc(*this, "upd7220"),
m_dmac(*this, "dma8237"),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_fdc(*this, "upd765"),
m_floppy0(*this, "upd765:0:525dd"),
m_floppy1(*this, "upd765:1:525dd"),
m_video_ram(*this, "video_ram")
{ }
required_device<cpu_device> m_maincpu;
required_device<upd7220_device> m_hgdc;
required_device<device_t> m_dmac;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
required_device<i8237_device> m_dmac;
required_device<upd765a_device> m_fdc;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
virtual void video_start();
virtual void machine_start();
virtual void machine_reset();
DECLARE_WRITE8_MEMBER(leds_w);
DECLARE_WRITE_LINE_MEMBER(fdc_irq_w);
DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
DECLARE_WRITE8_MEMBER(fdd_motor_w);
DECLARE_READ8_MEMBER(sys_status_r);
DECLARE_READ8_MEMBER(kb_ctrl_mcu_r);
DECLARE_WRITE8_MEMBER(kb_ctrl_mcu_w);
DECLARE_READ8_MEMBER(fdc_dma_r);
DECLARE_WRITE8_MEMBER(fdc_dma_w);
void fdc_irq(bool state);
void fdc_drq(bool state);
required_shared_ptr<UINT8> m_video_ram;
int m_fdc_int_line;
@ -71,19 +78,32 @@ WRITE8_MEMBER(dmv_state::leds_w)
output_set_led_value(8-i, BIT(data, i));
}
WRITE_LINE_MEMBER(dmv_state::fdc_irq_w)
void dmv_state::fdc_irq(bool state)
{
m_fdc_int_line = state;
}
void dmv_state::fdc_drq(bool state)
{
m_dmac->i8237_drq_write(3, state);
}
READ8_MEMBER(dmv_state::fdc_dma_r)
{
return m_fdc->dma_r();
}
WRITE8_MEMBER(dmv_state::fdc_dma_w)
{
m_fdc->dma_w(data);
}
WRITE8_MEMBER(dmv_state::fdd_motor_w)
{
// bit 0 defines the state of the FDD motor
floppy_mon_w(m_floppy0, BIT(data, 0) ? 0 : 1);
floppy_mon_w(m_floppy1, BIT(data, 0) ? 0 : 1);
floppy_drive_set_ready_state(m_floppy0, 1, BIT(data, 0));
floppy_drive_set_ready_state(m_floppy1, 1, BIT(data, 0));
m_floppy0->mon_w(!BIT(data, 0));
m_floppy1->mon_w(!BIT(data, 0));
}
READ8_MEMBER(dmv_state::sys_status_r)
@ -160,6 +180,15 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
}
}
static const floppy_format_type dmv_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( dmv_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
static ADDRESS_MAP_START(dmv_mem, AS_PROGRAM, 8, dmv_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x0000, 0x1fff ) AM_ROM
@ -174,8 +203,7 @@ static ADDRESS_MAP_START( dmv_io , AS_IO, 8, dmv_state)
AM_RANGE(0x14, 0x14) AM_WRITE(fdd_motor_w)
AM_RANGE(0x20, 0x2f) AM_DEVREADWRITE_LEGACY("dma8237", i8237_r, i8237_w)
AM_RANGE(0x40, 0x41) AM_READWRITE(kb_ctrl_mcu_r, kb_ctrl_mcu_w)
AM_RANGE(0x50, 0x50) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0x51, 0x51) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE(0x50, 0x51) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0xa0, 0xa1) AM_DEVREADWRITE("upd7220", upd7220_device, read, write)
//AM_RANGE(0x10, 0x11) boot ROM bankswitch (0x0000-0x1fff)
@ -204,6 +232,12 @@ ADDRESS_MAP_END
INPUT_PORTS_START( dmv )
INPUT_PORTS_END
void dmv_state::machine_start()
{
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(dmv_state::fdc_irq), this));
m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(dmv_state::fdc_drq), this));
}
void dmv_state::machine_reset()
{
}
@ -241,29 +275,6 @@ static UPD7220_INTERFACE( hgdc_intf )
DEVCB_NULL
};
static const floppy_interface dmv_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_5_25",
NULL
};
static const upd765_interface dmv_interface =
{
DEVCB_DRIVER_LINE_MEMBER(dmv_state, fdc_irq_w),
DEVCB_DEVICE_LINE("dma8237", i8237_dreq3_w),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
//------------------------------------------------------------------------------------
// I8237_INTERFACE
@ -286,8 +297,8 @@ static I8237_INTERFACE( dmv_dma8237_config )
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_HANDLER("upd765", upd765_dack_r) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_HANDLER("upd765", upd765_dack_w) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(dmv_state, fdc_dma_r) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(dmv_state, fdc_dma_w) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
};
@ -321,8 +332,9 @@ static MACHINE_CONFIG_START( dmv, dmv_state )
// devices
MCFG_UPD7220_ADD( "upd7220", XTAL_4MHz, hgdc_intf, upd7220_map )
MCFG_I8237_ADD( "dma8237", XTAL_4MHz, dmv_dma8237_config )
MCFG_UPD765A_ADD( "upd765", dmv_interface )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD( dmv_floppy_interface )
MCFG_UPD765A_ADD( "upd765", true, true )
MCFG_FLOPPY_DRIVE_ADD("upd765:0", dmv_floppies, "525dd", 0, dmv_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", dmv_floppies, "525dd", 0, dmv_floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -28,6 +28,7 @@
#include "imagedev/flopdrv.h"
#include "imagedev/cassette.h"
#include "formats/tzx_cas.h"
#include "formats/mfi_dsk.h"
#include "machine/ram.h"
@ -79,27 +80,17 @@ DIRECT_UPDATE_MEMBER(elwro800_state::elwro800_direct_handler)
*
*************************************/
static const struct upd765_interface elwro800jr_upd765_interface =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
WRITE8_MEMBER(elwro800_state::elwro800jr_fdc_control_w)
{
device_t *fdc = machine().device("upd765");
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
floppy_mon_w(floppy_get_device(machine(), 0), !BIT(data, 0));
floppy_mon_w(floppy_get_device(machine(), 1), !BIT(data, 1));
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1,1);
machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(!BIT(data, 0));
machine().device<floppy_connector>("upd765:1")->get_device()->mon_w(!BIT(data, 1));
upd765_tc_w(fdc, data & 0x04);
fdc->tc_w(data & 0x04);
upd765_reset_w(fdc, !(data & 0x08));
if(!(data & 8))
fdc->reset();
}
/*************************************
@ -289,14 +280,14 @@ READ8_MEMBER(elwro800_state::elwro800jr_io_r)
else if (!BIT(cs,3))
{
// CSFDC
device_t *fdc = machine().device("upd765");
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
if (offset & 1)
{
return upd765_data_r(fdc,space, 0);
return fdc->fifo_r(space, 0, 0xff);
}
else
{
return upd765_status_r(fdc,space, 0);
return fdc->msr_r(space, 0, 0xff);
}
}
else if (!BIT(cs,4))
@ -347,10 +338,10 @@ WRITE8_MEMBER(elwro800_state::elwro800jr_io_w)
else if (!BIT(cs,3))
{
// CSFDC
device_t *fdc = machine().device("upd765");
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
if (offset & 1)
{
upd765_data_w(fdc, space, 0, data);
fdc->fifo_w(space, 0, data, 0xff);
}
}
else if (!BIT(cs,4))
@ -543,19 +534,15 @@ INTERRUPT_GEN_MEMBER(elwro800_state::elwro800jr_interrupt)
device.execute().set_input_line(0, HOLD_LINE);
}
static const floppy_interface elwro800jr_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type elwro800jr_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( elwro800jr_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* F4 Character Displayer */
static const gfx_layout elwro800_charlayout =
{
@ -600,7 +587,7 @@ static MACHINE_CONFIG_START( elwro800, elwro800_state )
MCFG_VIDEO_START_OVERRIDE(elwro800_state, spectrum )
MCFG_UPD765A_ADD("upd765", elwro800jr_upd765_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_I8255A_ADD( "ppi8255", elwro800jr_ppi8255_interface)
/* printer */
@ -617,7 +604,8 @@ static MACHINE_CONFIG_START( elwro800, elwro800_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, elwro800jr_cassette_interface )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(elwro800jr_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", elwro800jr_floppies, "525hd", 0, elwro800jr_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", elwro800jr_floppies, "525hd", 0, elwro800jr_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -2,7 +2,7 @@
drivers/genpc.c
Driver file for geenric PC machines
Driver file for generic PC machines
***************************************************************************/
@ -98,7 +98,11 @@ static SLOT_INTERFACE_START(pc_isa8_cards)
SLOT_INTERFACE("ega", ISA8_EGA)
SLOT_INTERFACE("svga_et4k", ISA8_SVGA_ET4K)
SLOT_INTERFACE("com", ISA8_COM)
SLOT_INTERFACE("fdc", ISA8_FDC)
SLOT_INTERFACE("fdc", ISA8_FDC_SUPERIO)
SLOT_INTERFACE("fdc_xt", ISA8_FDC_XT)
SLOT_INTERFACE("fdc_at", ISA8_FDC_AT)
SLOT_INTERFACE("fdc_smc", ISA8_FDC_SMC)
SLOT_INTERFACE("fdc_ps2", ISA8_FDC_PS2)
SLOT_INTERFACE("finalchs", ISA8_FINALCHS)
SLOT_INTERFACE("hdc", ISA8_HDC)
SLOT_INTERFACE("adlib", ISA8_ADLIB)

View File

@ -79,7 +79,7 @@
#include "sound/discrete.h" /* for 1 Bit sound*/
#include "machine/upd765.h" /* for floppy disc controller */
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "cpu/z80/z80.h"
#include "formats/hect_dsk.h"
#include "includes/hec2hrp.h"
@ -108,11 +108,8 @@ static ADDRESS_MAP_START( hecdisc2_io , AS_IO, 8, hec2hrp_state )
AM_RANGE(0x040,0x04f) AM_READWRITE_LEGACY(hector_disc2_io40_port_r, hector_disc2_io40_port_w )
AM_RANGE(0x050,0x05f) AM_READWRITE_LEGACY(hector_disc2_io50_port_r, hector_disc2_io50_port_w )
// uPD765 link:
AM_RANGE(0x060,0x060) AM_DEVREAD_LEGACY("upd765",upd765_status_r )
// AM_RANGE(0x061,0x061) AM_DEVREADWRITE_LEGACY("upd765",upd765_data_r,upd765_data_w)
// AM_RANGE(0x070,0x07f) AM_DEVREADWRITE_LEGACY("upd765",upd765_dack_r,upd765_dack_w)
AM_RANGE(0x061,0x061) AM_READWRITE_LEGACY(hector_disc2_io61_port_r, hector_disc2_io61_port_w )//patched version
AM_RANGE(0x070,0x07F) AM_READWRITE_LEGACY(hector_disc2_io70_port_r, hector_disc2_io70_port_w )//patched version
AM_RANGE(0x060,0x061) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0x070,0x07f) AM_DEVREADWRITE("upd765", upd765a_device, mdma_r, mdma_w)
ADDRESS_MAP_END
/*****************************************************************************/
@ -519,6 +516,15 @@ static MACHINE_CONFIG_START( hec2hrp, hec2hrp_state )
MACHINE_CONFIG_END
static const floppy_format_type hector_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( hector_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/*****************************************************************************/
static MACHINE_CONFIG_START( hec2mx40, hec2hrp_state )
/*****************************************************************************/
@ -532,8 +538,9 @@ static MACHINE_CONFIG_START( hec2mx40, hec2hrp_state )
MCFG_CPU_ADD("disc2cpu",Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(hecdisc2_mem)
MCFG_CPU_IO_MAP(hecdisc2_io)
MCFG_UPD765A_ADD("upd765", hector_disc2_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(hector_disc2_floppy_interface)
MCFG_UPD765A_ADD("upd765", false, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", hector_floppies, "525hd", 0, hector_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", hector_floppies, "525hd", 0, hector_floppy_formats)
MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2hrx)
MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2hrx)
@ -583,8 +590,9 @@ static MACHINE_CONFIG_START( hec2hrx, hec2hrp_state )
MCFG_CPU_ADD("disc2cpu",Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(hecdisc2_mem)
MCFG_CPU_IO_MAP(hecdisc2_io)
MCFG_UPD765A_ADD("upd765", hector_disc2_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(hector_disc2_floppy_interface)
MCFG_UPD765A_ADD("upd765", false, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", hector_floppies, "525hd", 0, hector_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", hector_floppies, "525hd", 0, hector_floppy_formats)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@ -681,8 +689,9 @@ static MACHINE_CONFIG_START( hec2mx80, hec2hrp_state )
MCFG_CPU_ADD("disc2cpu",Z80, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(hecdisc2_mem)
MCFG_CPU_IO_MAP(hecdisc2_io)
MCFG_UPD765A_ADD("upd765", hector_disc2_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(hector_disc2_floppy_interface)
MCFG_UPD765A_ADD("upd765", false, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", hector_floppies, "525hd", 0, hector_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", hector_floppies, "525hd", 0, hector_floppy_formats)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)

View File

@ -83,111 +83,111 @@ Currently known: (probably exist for all the standard codepages)
IBM Roms thanks to Frode
=========================
1504036.bin: IBM 4860 PC/jr BIOS. vissible in memory at F0000-F7FFF.
1504037.bin: IBM 4860 PC/jr BIOS. vissible in memory at F8000-FFFFF.
1504036.bin: IBM 4860 PC/jr BIOS. visible in memory at F0000-F7FFF.
1504037.bin: IBM 4860 PC/jr BIOS. visible in memory at F8000-FFFFF.
ROM_LOAD( "1504036.bin", 0xf0000, 0x8000, CRC(de8fa668) SHA1(459341e033be1199c107e56d33680170e144b689))
ROM_LOAD( "1504037.bin", 0xf8000, 0x8000, CRC(04c05f17) SHA1(319423cb6bb02b399ecf6e0cb82015c16ada68f5))
5601JDA.bin: IBM 5511 PC/JX BIOS. vissible in memory at F0000-FFFFF.
5601JDA.bin: IBM 5511 PC/JX BIOS. visible in memory at F0000-FFFFF.
ROM_LOAD( "5601jda.bin", 0xf0000, 0x10000, CRC(b1e12366) SHA1(751feb16b985aa4f1ec1437493ff77e2ebd5e6a6))
7396917.bin: IBM 5140 PC/Convertible BIOS. vissible in memory at F0000-F7FFF.
7396918.bin: IBM 5140 PC/Convertible BIOS. vissible in memory at F8000-FFFFF.
7396917.bin: IBM 5140 PC/Convertible BIOS. visible in memory at F0000-F7FFF.
7396918.bin: IBM 5140 PC/Convertible BIOS. visible in memory at F8000-FFFFF.
ROM_LOAD( "7396917.bin", 0xf0000, 0x8000, CRC(95c35652) SHA1(2bdac30715dba114fbe0895b8b4723f8dc26a90d))
ROM_LOAD( "7396918.bin", 0xf8000, 0x8000, CRC(1b4202b0) SHA1(4797ff853ba1675860f293b6368832d05e2f3ea9))
5700019.bin: IBM 5150 PC BASIC 1.0. vissible in memory at F6000-F7FFF.
5700027.bin: IBM 5150 PC BASIC 1.0. vissible in memory at F8000-F9FFF.
5700035.bin: IBM 5150 PC BASIC 1.0. vissible in memory at FA000-FBFFF.
5700043.bin: IBM 5150 PC BASIC 1.0. vissible in memory at FC000-FDFFF.
5700019.bin: IBM 5150 PC BASIC 1.0. visible in memory at F6000-F7FFF.
5700027.bin: IBM 5150 PC BASIC 1.0. visible in memory at F8000-F9FFF.
5700035.bin: IBM 5150 PC BASIC 1.0. visible in memory at FA000-FBFFF.
5700043.bin: IBM 5150 PC BASIC 1.0. visible in memory at FC000-FDFFF.
ROM_LOAD( "5700019.bin", 0xf6000, 0x2000, CRC(b59e8f6c) SHA1(7a5db95370194c73b7921f2d69267268c69d2511))
ROM_LOAD( "5700027.bin", 0xf8000, 0x2000, CRC(bfff99b8) SHA1(ca2f126ba69c1613b7b5a4137d8d8cf1db36a8e6))
ROM_LOAD( "5700035.bin", 0xfa000, 0x2000, CRC(9fe4ec11) SHA1(89af8138185938c3da3386f97d3b0549a51de5ef))
ROM_LOAD( "5700043.bin", 0xfc000, 0x2000, CRC(ea2794e6) SHA1(22fe58bc853ffd393d5e2f98defda7456924b04f))
5700051.bin: First early IBM 5150 PC BIOS. vissible in memory at FE000-FFFFF.
5700051.bin: First early IBM 5150 PC BIOS. visible in memory at FE000-FFFFF.
ROM_LOAD( "5700051.bin", 0xfe000, 0x2000, CRC(12d33fb8) SHA1(f046058faa016ad13aed5a082a45b21dea43d346))
5700671.bin: Second early IBM 5150 PC BIOS. vissible in memory at FE000-FFFFF.
5700671.bin: Second early IBM 5150 PC BIOS. visible in memory at FE000-FFFFF.
ROM_LOAD( "5700671.bin", 0xfe000, 0x2000, CRC(b7d4ec46) SHA1(bdb06f846c4768f39eeff7e16b6dbff8cd2117d2))
5000019.bin: IBM 5150 PC BASIC 1.1. vissible in memory at F6000-F7FFF.
5000021.bin: IBM 5150 PC BASIC 1.1. vissible in memory at F8000-F9FFF.
5000022.bin: IBM 5150 PC BASIC 1.1. vissible in memory at FA000-FBFFF.
5000023.bin: IBM 5150 PC BASIC 1.1. vissible in memory at FC000-FDFFF.
5000019.bin: IBM 5150 PC BASIC 1.1. visible in memory at F6000-F7FFF.
5000021.bin: IBM 5150 PC BASIC 1.1. visible in memory at F8000-F9FFF.
5000022.bin: IBM 5150 PC BASIC 1.1. visible in memory at FA000-FBFFF.
5000023.bin: IBM 5150 PC BASIC 1.1. visible in memory at FC000-FDFFF.
ROM_LOAD( "5000019.bin", 0xf6000, 0x2000, CRC(80d3cf5d) SHA1(64769b7a8b60ffeefa04e4afbec778069a2840c9))
ROM_LOAD( "5000021.bin", 0xf8000, 0x2000, CRC(673a4acc) SHA1(082ae803994048e225150f771794ca305f73d731))
ROM_LOAD( "5000022.bin", 0xfa000, 0x2000, CRC(aac3fc37) SHA1(c9e0529470edf04da093bb8c8ae2536c688c1a74))
ROM_LOAD( "5000023.bin", 0xfc000, 0x2000, CRC(3062b3fc) SHA1(5134dd64721cbf093d059ee5d3fd09c7f86604c7))
5700476.0.bin: Late IBM 5150 PC BIOS. vissible in memory at FE000-FFFFF. (1981 copyright)
5700476.0.bin: Late IBM 5150 PC BIOS. visible in memory at FE000-FFFFF. (1981 copyright)
ROM_LOAD( "1501476.0.bin", 0xfe000, 0x2000, CRC(9b791d3e) SHA1(0c93f07e62cd27688f7f473e9787ef5308535fa0))
5700476.1.bin: Late IBM 5150 PC BIOS. vissible in memory at FE000-FFFFF. (1982 copyright)
5700476.1.bin: Late IBM 5150 PC BIOS. visible in memory at FE000-FFFFF. (1982 copyright)
ROM_LOAD( "1501476.1.bin", 0xfe000, 0x2000, CRC(e88792b3) SHA1(40fce6a94dda4328a8b608c7ae2f39d1dc688af4))
5000027.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F6000-F7FFF.
5000026.bin: Prototype IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF.
5000027.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F6000-F7FFF.
5000026.bin: Prototype IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF.
ROM_LOAD( "5000027.bin", 0xf6000, 0x2000, CRC(80d3cf5d) SHA1(64769b7a8b60ffeefa04e4afbec778069a2840c9))
ROM_LOAD( "5000026.bin", 0xf8000, 0x8000, CRC(3c9b0ac3) SHA1(271c9f4cef5029a1560075550b67c3395db09fef))
6359116.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F6000-F7FFF.
6359116.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F6000-F7FFF.
ROM_LOAD( "6359116.bin", 0xf6000, 0x2000, CRC(80d3cf5d) SHA1(64769b7a8b60ffeefa04e4afbec778069a2840c9))
1501512.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF.
1501512.bin: Early IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF.
ROM_LOAD( "1501512.bin", 0xf8000, 0x8000, CRC(79522c3d) SHA1(6bac726d8d033491d52507278aa388ec04cf8b7e))
62x0854.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F0000-F7FFF. (PROM)
62x0851.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF. (PROM)
62x0854.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F0000-F7FFF. (PROM)
62x0851.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF. (PROM)
ROM_LOAD( "62x0854.bin", 0xf0000, 0x8000, CRC(b5fb0e83) SHA1(937b43759ffd472da4fb0fe775b3842f5fb4c3b3))
ROM_LOAD( "62x0851.bin", 0xf8000, 0x8000, CRC(1054f7bd) SHA1(e7d0155813e4c650085144327581f05486ed1484))
62x0853.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F0000-F7FFF. (EPROM)
62x0852.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF. (EPROM)
62x0853.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F0000-F7FFF. (EPROM)
62x0852.bin: First late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF. (EPROM)
ROM_LOAD( "62x0853.bin", 0xf0000, 0x8000, CRC(b5fb0e83) SHA1(937b43759ffd472da4fb0fe775b3842f5fb4c3b3))
ROM_LOAD( "62x0852.bin", 0xf8000, 0x8000, CRC(1054f7bd) SHA1(e7d0155813e4c650085144327581f05486ed1484))
68x4370.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F0000-F7FFF. (PROM)
62x0890.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF. (PROM)
68x4370.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F0000-F7FFF. (PROM)
62x0890.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF. (PROM)
ROM_LOAD( "68x4370.bin", 0xf0000, 0x8000, CRC(758ff036) SHA1(045e27a70407d89b7956ecae4d275bd2f6b0f8e2))
ROM_LOAD( "62x0890.bin", 0xf8000, 0x8000, CRC(4f417635) SHA1(daa61762d3afdd7262e34edf1a3d2df9a05bcebb))
62x0819.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F0000-F7FFF. (EPROM)
59x7268.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. vissible in memory at F8000-FFFFF. (EPROM)
62x0819.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F0000-F7FFF. (EPROM)
59x7268.bin: Second late IBM 5160 PC/XT BIOS/BASIC 1.1. visible in memory at F8000-FFFFF. (EPROM)
ROM_LOAD( "62x0819.bin", 0xf0000, 0x8000, CRC(758ff036) SHA1(045e27a70407d89b7956ecae4d275bd2f6b0f8e2))
ROM_LOAD( "59x7268.bin", 0xf8000, 0x8000, CRC(4f417635) SHA1(daa61762d3afdd7262e34edf1a3d2df9a05bcebb))
78x7460.bin: IBM 5162 PC/XT 286 BIOS. vissible in even memory at F0000-FFFFF (mirror at E0000-EFFFF).
78x7461.bin: IBM 5162 PC/XT 286 BIOS. vissible in odd memory at F0000-FFFFF (mirror at E0000-EFFFF).
78x7460.bin: IBM 5162 PC/XT 286 BIOS. visible in even memory at F0000-FFFFF (mirror at E0000-EFFFF).
78x7461.bin: IBM 5162 PC/XT 286 BIOS. visible in odd memory at F0000-FFFFF (mirror at E0000-EFFFF).
ROM_LOAD16_BYTE( "78x7460.bin", 0xf0000, 0x8000, CRC(1db4bd8f) SHA1(7be669fbb998d8b4626fefa7cd1208d3b2a88c31))
ROM_LOAD16_BYTE( "78x7461.bin", 0xf0001, 0x8000, CRC(be14b453) SHA1(ec7c10087dbd53f9c6d1174e8f14212e2aec1818))
6181028.bin: First 6MHz IBM 5170 PC/AT BIOS. vissible in even memory at F0000-FFFFF.
6181029.bin: First 6MHz IBM 5170 PC/AT BIOS. vissible in odd memory at F0000-FFFFF.
6181028.bin: First 6MHz IBM 5170 PC/AT BIOS. visible in even memory at F0000-FFFFF.
6181029.bin: First 6MHz IBM 5170 PC/AT BIOS. visible in odd memory at F0000-FFFFF.
ROM_LOAD16_BYTE( "6181028.bin", 0xf0000, 0x8000, CRC(f6573f2a) SHA1(3e52cfa6a6a62b4e8576f4fe076c858c220e6c1a))
ROM_LOAD16_BYTE( "6181029.bin", 0xf0001, 0x8000, CRC(7075fbb2) SHA1(a7b885cfd38710c9bc509da1e3ba9b543a2760be))
6480090.bin: Second 6MHz IBM 5170 PC/AT BIOS. vissible in even memory at F0000-FFFFF.
6480091.bin: Second 6MHz IBM 5170 PC/AT BIOS. vissible in odd memory at F0000-FFFFF.
6480090.bin: Second 6MHz IBM 5170 PC/AT BIOS. visible in even memory at F0000-FFFFF.
6480091.bin: Second 6MHz IBM 5170 PC/AT BIOS. visible in odd memory at F0000-FFFFF.
ROM_LOAD16_BYTE( "6480090.bin", 0xf0000, 0x8000, CRC(99703aa9) SHA1(18022e93a0412c8477e58f8c61a87718a0b9ab0e))
ROM_LOAD16_BYTE( "6480091.bin", 0xf0001, 0x8000, CRC(013ef44b) SHA1(bfa15d2180a1902cb6d38c6eed3740f5617afd16))
62x0820.bin: 8MHz IBM 5170 PC/AT BIOS. vissible in even memory at F0000-FFFFF. (PROM)
62x0821.bin: 8MHz IBM 5170 PC/AT BIOS. vissible in odd memory at F0000-FFFFF. (PROM)
62x0820.bin: 8MHz IBM 5170 PC/AT BIOS. visible in even memory at F0000-FFFFF. (PROM)
62x0821.bin: 8MHz IBM 5170 PC/AT BIOS. visible in odd memory at F0000-FFFFF. (PROM)
ROM_LOAD( "62x0820.bin", 0xf0000, 0x8000, CRC(e9cc3761) SHA1(ff9373c1a1f34a32fb6acdabc189c61b01acf9aa))
ROM_LOAD( "62x0821.bin", 0xf0001, 0x8000, CRC(b5978ccb) SHA1(2a1aeb9ae3cd7e60fc4c383ca026208b82156810))
61x9266.bin: 8MHz IBM 5170 PC/AT BIOS. vissible in even memory at F0000-FFFFF. (EPROM)
61x9265.bin: 8MHz IBM 5170 PC/AT BIOS. vissible in odd memory at F0000-FFFFF. (EPROM)
61x9266.bin: 8MHz IBM 5170 PC/AT BIOS. visible in even memory at F0000-FFFFF. (EPROM)
61x9265.bin: 8MHz IBM 5170 PC/AT BIOS. visible in odd memory at F0000-FFFFF. (EPROM)
ROM_LOAD( "61x9265.bin", 0xf0001, 0x8000, CRC(c32713e4) SHA1(22ed4e2be9f948682891e2fd056a97dbea01203c))
ROM_LOAD( "61x9266.bin", 0xf0000, 0x8000, CRC(4995be7a) SHA1(8e8e5c863ae3b8c55fd394e345d8cca48b6e575c))
5788005.bin: IBM MDA/CGA font. Not mapped in PC memory. (American manufacture, otherwise similar to the Europeian manufacture)
5788005.bin: IBM MDA/CGA font. Not mapped in PC memory. (American manufacture, otherwise similar to the European manufacture)
ROM_LOAD( "5788005.bin", 0x0000, 0x2000, CRC(0bf56d70) SHA1(c2a8b10808bf51a3c123ba3eb1e9dd608231916f))
6359300.bin: IBM MDA/CGA font. Not mapped in PC memory. (Europeian manufacture, otherwise similar to the American manufacture)
6359300.bin: IBM MDA/CGA font. Not mapped in PC memory. (European manufacture, otherwise similar to the American manufacture)
ROM_LOAD( "6359300.bin", 0x0000, 0x2000, CRC(0bf56d70) SHA1(c2a8b10808bf51a3c123ba3eb1e9dd608231916f))
4733197.bin: IBM MDA/CGA Alternative font. Not mapped in PC memory.
@ -211,7 +211,7 @@ IBM Roms thanks to Frode
104839e.bin: Hard drive controller Z80 firmware ROM. Not mapped in PC memory. (Mapped in Z80 microcontroller memory at 0000-7FFF)
ROM_LOAD( "104839e.bin", 0x0000, 0x1000, CRC(3ad32fcc) SHA1(0127fa520aaee91285cb46a640ed835b4554e4b3))
6323581.bin: 3270 Keyboard adapter ROM. The first 0x800 bytes vissible in memory at C0000-C07FF. The later 0x1800 bytes visible in memory at CA000-CB7FF.
6323581.bin: 3270 Keyboard adapter ROM. The first 0x800 bytes visible in memory at C0000-C07FF. The later 0x1800 bytes visible in memory at CA000-CB7FF.
ROM_LOAD( "6323581.bin", 0xc0000, 0x2000, CRC(cf323cbd) SHA1(93c1ef2ede02772a46dab075c32e179faa045f81))
1504161.bin: 3270 Character ROM (pixels 0-7). Not mapped in PC memory.
@ -246,7 +246,7 @@ XT U44 IBM.bin: IBM 5160 PC/XT Bank-selection decoding ROM (256x4 bit). Not mapp
ROM_LOAD( "30f9579.bin", 0x0000, 0x10000, CRC(1448d3cb) SHA1(13fa26d895ce084278cd5ab1208fc16c80115ebe))
ROM_LOAD( "30f9580.bin", 0x0000, 0x10000, CRC(9965a634) SHA1(c237b1760f8a4561ec47dc70fe2e9df664e56596))
90X7415.bin: IBM PS/2 model 25/30 external FDD support adapter. vissible in memory at C8000-C9FFF.
90X7415.bin: IBM PS/2 model 25/30 external FDD support adapter. visible in memory at C8000-C9FFF.
ROM_LOAD( "90x7415.bin", 0x0000, 0x2000, CRC(02d28556) SHA1(5543a8634f90a9141cf95f6a13c71be7778ee2a1))
@ -318,7 +318,7 @@ static SLOT_INTERFACE_START(ibm_isa8_cards)
SLOT_INTERFACE("hercules", ISA8_HERCULES)
SLOT_INTERFACE("svga_et4k", ISA8_SVGA_ET4K)
SLOT_INTERFACE("com", ISA8_COM)
SLOT_INTERFACE("fdc", ISA8_FDC)
SLOT_INTERFACE("fdc", ISA8_FDC_XT)
SLOT_INTERFACE("finalchs", ISA8_FINALCHS)
SLOT_INTERFACE("hdc", ISA8_HDC)
SLOT_INTERFACE("adlib", ISA8_ADLIB)

View File

@ -23,7 +23,8 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/m5_dsk.h"
#include "formats/sord_cas.h"
#include "imagedev/cartslot.h"
#include "imagedev/cassette.h"
@ -211,8 +212,7 @@ WRITE8_MEMBER( m5_state::fd5_ctrl_w )
*/
floppy_mon_w(m_floppy0, !BIT(data, 0));
floppy_drive_set_ready_state(m_floppy0, 1, 1);
m_floppy0->mon_w(!BIT(data, 0));
}
@ -222,8 +222,8 @@ WRITE8_MEMBER( m5_state::fd5_ctrl_w )
WRITE8_MEMBER( m5_state::fd5_tc_w )
{
upd765_tc_w(m_fdc, 1);
upd765_tc_w(m_fdc, 0);
m_fdc->tc_w(true);
m_fdc->tc_w(false);
}
@ -289,8 +289,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( fd5_io, AS_IO, 8, m5_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0x00, 0x01) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0x10, 0x10) AM_READWRITE(fd5_data_r, fd5_data_w)
AM_RANGE(0x20, 0x20) AM_WRITE(fd5_com_w)
AM_RANGE(0x30, 0x30) AM_READ(fd5_com_r)
@ -561,37 +560,20 @@ static I8255_INTERFACE( ppi_intf )
// upd765_interface fdc_intf
//-------------------------------------------------
static LEGACY_FLOPPY_OPTIONS_START( m5 )
LEGACY_FLOPPY_OPTION( m5, "dsk", "Sord M5 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([40])
SECTORS([18])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface m5_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD_40,
LEGACY_FLOPPY_OPTIONS_NAME(m5),
NULL,
static const floppy_format_type m5_floppy_formats[] = {
FLOPPY_M5_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static const struct upd765_interface fdc_intf =
{
DEVCB_CPU_INPUT_LINE(Z80_FD5_TAG, INPUT_LINE_IRQ0),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, NULL, NULL, NULL }
};
static SLOT_INTERFACE_START( m5_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
void m5_state::fdc_irq(bool state)
{
m_fd5cpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
}
//-------------------------------------------------
// z80_daisy_config m5_daisy_chain
@ -631,6 +613,8 @@ void m5_state::machine_start()
break;
}
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(m5_state::fdc_irq), this));
// register for state saving
save_item(NAME(m_fd5_data));
save_item(NAME(m_fd5_com));
@ -680,8 +664,8 @@ static MACHINE_CONFIG_START( m5, m5_state )
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
MCFG_CASSETTE_ADD(CASSETTE_TAG, cassette_intf)
MCFG_I8255_ADD(I8255A_TAG, ppi_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, m5_floppy_interface)
MCFG_UPD765A_ADD(UPD765_TAG, true, true)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", m5_floppies, "525dd", 0, m5_floppy_formats)
// cartridge
MCFG_CARTSLOT_ADD("cart")

View File

@ -11,6 +11,7 @@
#include "machine/upd765.h"
#include "imagedev/flopdrv.h"
#include "machine/terminal.h"
#include "formats/mfi_dsk.h"
class microdec_state : public driver_device
@ -23,11 +24,13 @@ public:
DECLARE_READ8_MEMBER(terminal_status_r);
DECLARE_READ8_MEMBER(terminal_r);
DECLARE_WRITE8_MEMBER(kbd_put);
DECLARE_WRITE_LINE_MEMBER(microdec_irq_w);
UINT8 m_term_data;
required_device<generic_terminal_device> m_terminal;
virtual void machine_reset();
virtual void machine_start();
void fdc_irq(bool state);
};
@ -52,8 +55,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(microdec_io, AS_IO, 8, microdec_state)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0xfa, 0xfa) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0xfb, 0xfb) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE(0xfa, 0xfb) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0xfc, 0xfc) AM_READ(terminal_r) AM_DEVWRITE(TERMINAL_TAG, generic_terminal_device, write)
AM_RANGE(0xfd, 0xfd) AM_READ(terminal_status_r)
ADDRESS_MAP_END
@ -62,6 +64,10 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( microdec )
INPUT_PORTS_END
void microdec_state::machine_start()
{
machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(microdec_state::fdc_irq), this));
}
void microdec_state::machine_reset()
{
@ -78,32 +84,19 @@ static GENERIC_TERMINAL_INTERFACE( terminal_intf )
DEVCB_DRIVER_MEMBER(microdec_state, kbd_put)
};
WRITE_LINE_MEMBER( microdec_state::microdec_irq_w )
void microdec_state::fdc_irq(bool state)
{
}
static const struct upd765_interface microdec_upd765_interface =
{
DEVCB_DRIVER_LINE_MEMBER(microdec_state, microdec_irq_w), /* interrupt */
DEVCB_NULL, /* DMA request */
NULL, /* image lookup */
UPD765_RDY_PIN_CONNECTED, /* ready pin */
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
static const floppy_interface microdec_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type microdec_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( microdec_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_START( microdec, microdec_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
@ -114,8 +107,9 @@ static MACHINE_CONFIG_START( microdec, microdec_state )
/* video hardware */
MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
MCFG_UPD765A_ADD("upd765", microdec_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(microdec_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", microdec_floppies, "525hd", 0, microdec_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", microdec_floppies, "525hd", 0, microdec_floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -51,7 +51,8 @@
*/
#include "includes/mikromik.h"
#include "formats/mfi_dsk.h"
#include "formats/mm_dsk.h"
//**************************************************************************
@ -110,11 +111,11 @@ READ8_MEMBER( mm1_state::mmu_r )
case 5:
if (BIT(offset, 0))
{
data = upd765_data_r(m_fdc, space, 0);
data = m_fdc->fifo_r(space, 0, 0xff);
}
else
{
data = upd765_status_r(m_fdc, space, 0);
data = m_fdc->msr_r(space, 0, 0xff);
}
break;
@ -179,7 +180,7 @@ WRITE8_MEMBER( mm1_state::mmu_w )
case 5:
if (BIT(offset, 0))
{
upd765_data_w(m_fdc, space, 0, data);
m_fdc->fifo_w(space, 0, data, 0xff);
}
break;
@ -220,7 +221,8 @@ WRITE8_MEMBER( mm1_state::ls259_w )
case 1: // RECALL
if (LOG) logerror("RECALL %u\n", d);
m_recall = d;
upd765_reset_w(m_fdc, d);
if(d)
m_fdc->reset();
break;
case 2: // _RV28/RX21
@ -246,12 +248,10 @@ WRITE8_MEMBER( mm1_state::ls259_w )
case 7: // MOTOR ON
if (LOG) logerror("MOTOR %u\n", d);
floppy_mon_w(m_floppy0, !d);
floppy_mon_w(m_floppy1, !d);
floppy_drive_set_ready_state(m_floppy0, d, 1);
floppy_drive_set_ready_state(m_floppy1, d, 1);
m_floppy0->mon_w(!d);
m_floppy1->mon_w(!d);
if (ioport("T5")->read()) upd765_ready_w(m_fdc, d);
if (ioport("T5")->read()) m_fdc->ready_w(d);
break;
}
}
@ -516,7 +516,7 @@ WRITE_LINE_MEMBER( mm1_state::tc_w )
if (!m_dack3)
{
// floppy terminal count
upd765_tc_w(m_fdc, !state);
m_fdc->tc_w(!state);
}
m_tc = !state;
@ -531,21 +531,31 @@ WRITE_LINE_MEMBER( mm1_state::dack3_w )
if (!m_dack3)
{
// floppy terminal count
upd765_tc_w(m_fdc, m_tc);
m_fdc->tc_w(m_tc);
}
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
static void memory_write_byte(address_space &space, offs_t address, UINT8 data, UINT8 mem_mask) { space.write_byte(address, data); }
READ8_MEMBER( mm1_state::fdc_dma_r )
{
return m_fdc->dma_r();
}
WRITE8_MEMBER( mm1_state::fdc_dma_w )
{
m_fdc->dma_w(data);
}
static I8237_INTERFACE( dmac_intf )
{
DEVCB_DRIVER_LINE_MEMBER(mm1_state, dma_hrq_changed),
DEVCB_DRIVER_LINE_MEMBER(mm1_state, tc_w),
DEVCB_MEMORY_HANDLER(I8085A_TAG, PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER(I8085A_TAG, PROGRAM, memory_write_byte),
{ DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(mm1_state, mpsc_dack_r), DEVCB_DEVICE_HANDLER(UPD765_TAG, upd765_dack_r) },
{ DEVCB_DEVICE_HANDLER(I8275_TAG, i8275_dack_w), DEVCB_DRIVER_MEMBER(mm1_state, mpsc_dack_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER(UPD765_TAG, upd765_dack_w) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(mm1_state, mpsc_dack_r), DEVCB_DRIVER_MEMBER(mm1_state, fdc_dma_r) },
{ DEVCB_DEVICE_HANDLER(I8275_TAG, i8275_dack_w), DEVCB_DRIVER_MEMBER(mm1_state, mpsc_dack_w), DEVCB_NULL, DEVCB_DRIVER_MEMBER(mm1_state, fdc_dma_w) },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(mm1_state, dack3_w) }
};
@ -673,53 +683,31 @@ static I8085_CONFIG( i8085_intf )
// upd765_interface fdc_intf
//-------------------------------------------------
static LEGACY_FLOPPY_OPTIONS_START( mm1 )
LEGACY_FLOPPY_OPTION( mm1_640kb, "dsk", "Nokia MikroMikko 1 640KB disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([80])
SECTORS([8]) // 3:1 sector skew (1,4,7,2,5,8,3,6)
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static LEGACY_FLOPPY_OPTIONS_START( mm2 )
LEGACY_FLOPPY_OPTION( mm2_360kb, "dsk", "Nokia MikroMikko 2 360KB disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([40])
SECTORS([9])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTION( mm2_720kb, "dsk", "Nokia MikroMikko 2 720KB disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([40])
SECTORS([18])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface mm1_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSQD,
LEGACY_FLOPPY_OPTIONS_NAME(mm1),
"floppy_5_25",
static const floppy_format_type mm1_floppy_formats[] = {
FLOPPY_MM1_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static const upd765_interface fdc_intf =
{
DEVCB_CPU_INPUT_LINE(I8085A_TAG, I8085_RST55_LINE),
DEVCB_DEVICE_LINE_MEMBER(I8237_TAG, am9517a_device, dreq3_w),
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
static const floppy_format_type mm2_floppy_formats[] = {
FLOPPY_MM2_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( mm1_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
SLOT_INTERFACE_END
void mm1_state::fdc_irq(bool state)
{
m_maincpu->set_input_line(I8085_RST55_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
void mm1_state::fdc_drq(bool state)
{
m_dmac->dreq3_w(state);
}
//**************************************************************************
@ -762,11 +750,10 @@ void mm1_state::machine_reset()
for (i = 0; i < 8; i++) ls259_w(program, i, 0);
// set FDC ready
if (!ioport("T5")->read()) upd765_ready_w(m_fdc, 1);
if (!ioport("T5")->read()) m_fdc->ready_w(true);
// reset FDC
upd765_reset_w(m_fdc, 1);
upd765_reset_w(m_fdc, 0);
m_fdc->reset();
}
@ -796,10 +783,11 @@ static MACHINE_CONFIG_START( mm1, mm1_state )
MCFG_I8212_ADD(I8212_TAG, iop_intf)
MCFG_I8237_ADD(I8237_TAG, XTAL_6_144MHz/2, dmac_intf)
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_UPD765A_ADD(UPD765_TAG, /* XTAL_16MHz/2/2 */ fdc_intf)
MCFG_UPD765A_ADD(UPD765_TAG, /* XTAL_16MHz/2/2 */ true, true)
MCFG_UPD7201_ADD(UPD7201_TAG, XTAL_6_144MHz/2, mpsc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mm1_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", mm1_floppies, "525qd", 0, mm1_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", mm1_floppies, "525qd", 0, mm1_floppy_formats)
// internal ram
MCFG_RAM_ADD(RAM_TAG)

View File

@ -10,6 +10,7 @@
#include "cpu/i86/i86.h"
#include "machine/upd765.h"
#include "video/upd7220.h"
#include "formats/mfi_dsk.h"
class mz6500_state : public driver_device
{
@ -22,13 +23,11 @@ public:
m_video_ram(*this, "video_ram"){ }
required_device<upd7220_device> m_hgdc;
required_device<device_t> m_fdc;
DECLARE_READ8_MEMBER(fdc_r);
DECLARE_WRITE8_MEMBER(fdc_w);
required_device<upd765a_device> m_fdc;
DECLARE_READ8_MEMBER(mz6500_vram_r);
DECLARE_WRITE8_MEMBER(mz6500_vram_w);
DECLARE_WRITE_LINE_MEMBER(fdc_irq);
DECLARE_WRITE_LINE_MEMBER(fdc_drq);
void fdc_irq(bool state);
void fdc_drq(bool state);
required_shared_ptr<UINT8> m_video_ram;
virtual void machine_reset();
virtual void video_start();
@ -58,17 +57,6 @@ void mz6500_state::video_start()
}
READ8_MEMBER( mz6500_state::fdc_r )
{
return (offset) ? upd765_data_r(m_fdc, space, 0) : upd765_status_r(m_fdc, space, 0);
}
WRITE8_MEMBER( mz6500_state::fdc_w )
{
if(offset)
upd765_data_w(m_fdc, space, 0, data);
}
READ8_MEMBER( mz6500_state::mz6500_vram_r )
{
return m_video_ram[offset];
@ -91,7 +79,7 @@ static ADDRESS_MAP_START(mz6500_io, AS_IO, 16, mz6500_state)
ADDRESS_MAP_UNMAP_HIGH
// AM_RANGE(0x0000, 0x000f) i8237 dma
// AM_RANGE(0x0010, 0x001f) i8255
AM_RANGE(0x0020, 0x0021) AM_MIRROR(0xe) AM_READWRITE8(fdc_r,fdc_w,0xffff)
AM_RANGE(0x0020, 0x0021) AM_MIRROR(0xe) AM_DEVICE8("upd765", upd765a_device, map, 0xffff)
// AM_RANGE(0x0030, 0x003f) i8259 master
// AM_RANGE(0x0040, 0x004f) i8259 slave
// AM_RANGE(0x0050, 0x0050) segment byte for DMA
@ -121,38 +109,24 @@ void mz6500_state::machine_reset()
{
}
WRITE_LINE_MEMBER( mz6500_state::fdc_irq )
void mz6500_state::fdc_irq(bool state)
{
//printf("%02x IRQ\n",state);
}
WRITE_LINE_MEMBER( mz6500_state::fdc_drq )
void mz6500_state::fdc_drq(bool state)
{
//printf("%02x DRQ\n",state);
}
static const struct upd765_interface upd765_intf =
{
DEVCB_DRIVER_LINE_MEMBER(mz6500_state, fdc_irq),
DEVCB_DRIVER_LINE_MEMBER(mz6500_state, fdc_drq),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
static const floppy_interface mz6500_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type mz6500_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( mz6500_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static UPD7220_INTERFACE( hgdc_intf )
{
@ -187,8 +161,9 @@ static MACHINE_CONFIG_START( mz6500, mz6500_state )
/* Devices */
MCFG_UPD7220_ADD("upd7220", 4000000, hgdc_intf, upd7220_map)
MCFG_UPD765A_ADD("upd765", upd765_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(mz6500_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", mz6500_floppies, "525hd", 0, mz6500_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", mz6500_floppies, "525hd", 0, mz6500_floppy_formats)
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -14,7 +14,8 @@
#include "machine/z80ctc.h"
#include "machine/upd765.h"
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/nanos_dsk.h"
#include "machine/ram.h"
@ -43,7 +44,7 @@ public:
required_device<z80sio_device> m_sio_1;
required_device<z80ctc_device> m_ctc_0;
required_device<z80ctc_device> m_ctc_1;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<device_t> m_key_t;
const UINT8 *m_p_chargen;
UINT8 m_key_command;
@ -73,7 +74,7 @@ ADDRESS_MAP_END
WRITE8_MEMBER(nanos_state::nanos_tc_w)
{
upd765_tc_w(m_fdc, BIT(data,1));
m_fdc->tc_w(BIT(data,1));
}
@ -167,8 +168,7 @@ static ADDRESS_MAP_START( nanos_io , AS_IO, 8, nanos_state)
/* FDC card */
AM_RANGE(0x92, 0x92) AM_WRITE(nanos_tc_w)
AM_RANGE(0x94, 0x94) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0x95, 0x95) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE(0x94, 0x95) AM_DEVICE("upd765", upd765a_device, map)
/* V24+IFSS card */
AM_RANGE(0xA0, 0xA3) AM_DEVREADWRITE("z80sio_0", z80sio_device, read_alt, write_alt)
AM_RANGE(0xA4, 0xA7) AM_DEVREADWRITE("z80ctc_1", z80ctc_device, read, write)
@ -465,38 +465,16 @@ static Z80PIO_INTERFACE( nanos_z80pio_intf )
DEVCB_NULL
};
static const upd765_interface nanos_upd765_interface =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{FLOPPY_0,FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
static LEGACY_FLOPPY_OPTIONS_START(nanos)
LEGACY_FLOPPY_OPTION(nanos, "img", "NANOS disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([80])
SECTORS([5])
SECTOR_LENGTH([1024])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface nanos_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(nanos),
NULL,
static const floppy_format_type nanos_floppy_formats[] = {
FLOPPY_NANOS_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( nanos_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* F4 Character Displayer */
static const gfx_layout nanos_charlayout =
{
@ -542,9 +520,8 @@ static MACHINE_CONFIG_START( nanos, nanos_state )
MCFG_Z80SIO_ADD( "z80sio_1", XTAL_4MHz, sio_intf)
MCFG_Z80PIO_ADD( "z80pio", XTAL_4MHz, nanos_z80pio_intf )
/* UPD765 */
MCFG_UPD765A_ADD("upd765", nanos_upd765_interface)
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(nanos_floppy_interface)
MCFG_UPD765A_ADD("upd765", false, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", nanos_floppies, "525hd", 0, nanos_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -104,6 +104,7 @@
#include "machine/upd765.h" /* for NC200 disk drive interface */
#include "imagedev/flopdrv.h" /* for NC200 disk image */
#include "formats/pc_dsk.h" /* for NC200 disk image */
#include "formats/mfi_dsk.h"
#include "imagedev/cartslot.h"
#include "sound/beep.h"
#include "machine/ram.h"
@ -1257,7 +1258,7 @@ static const i8251_interface nc200_uart_interface=
};
WRITE_LINE_MEMBER(nc_state::nc200_fdc_interrupt)
void nc_state::nc200_fdc_interrupt(bool state)
{
#if 0
m_irq_latch &=~(1<<5);
@ -1277,15 +1278,6 @@ WRITE_LINE_MEMBER(nc_state::nc200_fdc_interrupt)
nc_update_interrupts(machine());
}
static const upd765_interface nc200_upd765_interface=
{
DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_fdc_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, NULL, NULL, NULL }
};
#ifdef UNUSED_FUNCTION
static void nc200_floppy_drive_index_callback(int drive_id)
{
@ -1339,6 +1331,7 @@ MACHINE_START_MEMBER(nc_state,nc200)
/* serial timer */
m_serial_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nc_state::nc_serial_timer_callback),this));
machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(nc_state::nc200_fdc_interrupt), this));
}
/*
@ -1432,13 +1425,13 @@ WRITE8_MEMBER(nc_state::nc200_uart_control_w)
WRITE8_MEMBER(nc_state::nc200_memory_card_wait_state_w)
{
device_t *fdc = machine().device("upd765");
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
LOG_DEBUG(("nc200 memory card wait state: PC: %04x %02x\n", machine().device("maincpu")->safe_pc(), data));
#if 0
floppy_drive_set_motor_state(0, 1);
floppy_drive_set_ready_state(0, 1, 1);
#endif
upd765_tc_w(fdc, (data & 0x01));
fdc->tc_w(data & 0x01);
}
/* bit 2: backlight: 1=off, 0=on */
@ -1468,8 +1461,7 @@ static ADDRESS_MAP_START(nc200_io, AS_IO, 8, nc_state )
AM_RANGE(0xc0, 0xc0) AM_DEVREADWRITE("uart",i8251_device, data_r, data_w)
AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w)
AM_RANGE(0xd0, 0xd1) AM_DEVREADWRITE("mc", mc146818_device, read, write)
AM_RANGE(0xe0, 0xe0) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE_LEGACY("upd765",upd765_data_r, upd765_data_w)
AM_RANGE(0xe0, 0xe1) AM_DEVICE("upd765", upd765a_device, map)
ADDRESS_MAP_END
static INPUT_PORTS_START(nc200)
@ -1636,19 +1628,16 @@ static MACHINE_CONFIG_START( nc100, nc_state )
MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", nc_state, dummy_timer_callback, attotime::from_hz(50))
MACHINE_CONFIG_END
static const floppy_interface nc200_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
NULL,
static const floppy_format_type ibmpc_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( ibmpc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_DERIVED( nc200, nc100 )
MCFG_CPU_MODIFY( "maincpu" )
@ -1674,9 +1663,9 @@ static MACHINE_CONFIG_DERIVED( nc200, nc100 )
/* no rtc */
MCFG_DEVICE_REMOVE("rtc")
MCFG_UPD765A_ADD("upd765", nc200_upd765_interface)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, nc200_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_MC146818_ADD( "mc", MC146818_STANDARD )

View File

@ -1,4 +1,5 @@
#include "includes/newbrain.h"
#include "formats/mfi_dsk.h"
/*
@ -582,12 +583,12 @@ WRITE8_MEMBER( newbrain_eim_state::fdc_auxiliary_w )
*/
floppy_mon_w(m_floppy, !BIT(data, 0));
floppy_drive_set_ready_state(m_floppy, 1, 0);
m_floppy->mon_w(!BIT(data, 0));
upd765_reset_w(m_fdc, BIT(data, 1));
if(BIT(data, 1))
m_fdc->reset();
upd765_tc_w(m_fdc, BIT(data, 2));
m_fdc->tc_w(BIT(data, 2));
}
READ8_MEMBER( newbrain_eim_state::fdc_control_r )
@ -1048,8 +1049,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( newbrain_fdc_io_map, AS_IO, 8, newbrain_eim_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
AM_RANGE(0x01, 0x01) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0x00, 0x01) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0x20, 0x20) AM_WRITE(fdc_auxiliary_w)
AM_RANGE(0x40, 0x40) AM_READ(fdc_control_r)
ADDRESS_MAP_END
@ -1188,15 +1188,6 @@ WRITE_LINE_MEMBER( newbrain_eim_state::fdc_interrupt )
m_fdc_int = state;
}
static const upd765_interface fdc_intf =
{
DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, fdc_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
WRITE_LINE_MEMBER( newbrain_eim_state::ctc_z0_w )
{
/* connected to the ACIA receive clock */
@ -1398,23 +1389,15 @@ static MACHINE_CONFIG_START( newbrain_a, newbrain_state )
MCFG_RAM_DEFAULT_SIZE("32K")
MACHINE_CONFIG_END
static LEGACY_FLOPPY_OPTIONS_START(newbrain)
// 180K img
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface newbrain_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(newbrain),
NULL,
static const floppy_format_type newbrain_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( newbrain_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_DERIVED_CLASS( newbrain_eim, newbrain_a, newbrain_eim_state )
// basic system hardware
MCFG_CPU_MODIFY(Z80_TAG)
@ -1429,8 +1412,9 @@ static MACHINE_CONFIG_DERIVED_CLASS( newbrain_eim, newbrain_a, newbrain_eim_stat
MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_c2", newbrain_eim_state, ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
MCFG_ADC0808_ADD(ADC0809_TAG, 500000, adc_intf)
MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(newbrain_floppy_interface)
MCFG_UPD765A_ADD(UPD765_TAG, false, true)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", newbrain_floppies, "525dd", 0, newbrain_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", newbrain_floppies, "525dd", 0, newbrain_floppy_formats)
// internal ram
MCFG_RAM_MODIFY(RAM_TAG)

View File

@ -624,7 +624,7 @@ READ32_MEMBER( next_state::fdc_control_r )
// reason. The kernel otoh behaves as expected.
if(fdc) {
floppy_image_device *fdev = machine().device<floppy_connector>(":fd0")->get_device();
floppy_image_device *fdev = machine().device<floppy_connector>(":fdc:0")->get_device();
if(fdev->exists()) {
UINT32 variant = fdev->get_variant();
switch(variant) {
@ -889,7 +889,7 @@ static ADDRESS_MAP_START( next_0b_nofdc_mem, AS_PROGRAM, 32, next_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START( next_fdc_mem, AS_PROGRAM, 32, next_state )
AM_RANGE(0x02014100, 0x02014107) AM_MIRROR(0x300000) AM_DEVICE8("fdc", n82077aa_device, amap, 0xffffffff)
AM_RANGE(0x02014100, 0x02014107) AM_MIRROR(0x300000) AM_DEVICE8("fdc", n82077aa_device, map, 0xffffffff)
AM_RANGE(0x02014108, 0x0201410b) AM_MIRROR(0x300000) AM_READWRITE(fdc_control_r, fdc_control_w)
AM_IMPORT_FROM(next_mem)
@ -987,7 +987,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( next_fdc_base, next_base )
MCFG_N82077AA_ADD("fdc", n82077aa_device::MODE_PS2)
MCFG_FLOPPY_DRIVE_ADD("fd0", next_floppies, "35ed", 0, next_state::floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", next_floppies, "35ed", 0, next_state::floppy_formats)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( nexts, next_fdc_base )
@ -1145,19 +1145,3 @@ COMP( 1990, nextst, 0, 0, nextst, next, next_state, nextst, "
COMP( 1990, nextstc, nextst, 0, nextstc, next, next_state, nextstc, "Next Software Inc", "NeXTstation turbo color", GAME_NOT_WORKING | GAME_NO_SOUND)
COMP( ????, nextct, nextst, 0, nextct, next, next_state, nextct, "Next Software Inc", "NeXT Cube turbo", GAME_NOT_WORKING | GAME_NO_SOUND)
COMP( ????, nextctc, nextst, 0, nextctc, next, next_state, nextctc, "Next Software Inc", "NeXT Cube turbo color", GAME_NOT_WORKING | GAME_NO_SOUND)
/*
UINT32 *rom = (UINT32 *)(machine.root_device().memregion("user1")->base());
rom[0x3f48/4] = 0x2f017000; // memory test funcall
rom[0x3f4c/4] = 0x4e712400;
rom[0x00b8/4] = 0x001a4e71; // rom checksum
rom[0x00bc/4] = 0x4e714e71;
v74
UINT32 *rom = (UINT32 *)(machine.root_device().memregion("user1")->base());
rom[0x329c/4] = 0x70004e71; // memory test funcall
rom[0x32a0/4] = 0x4e712400;
rom[0x03f8/4] = 0x001a4e71; // rom checksum
rom[0x03fc/4] = 0x4e714e71;
*/

View File

@ -49,7 +49,7 @@
#include "cpu/z80/z80.h"
#include "cpu/z8000/z8000.h"
#include "cpu/z80/z80daisy.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "imagedev/flopdrv.h"
#include "machine/upd765.h"
#include "machine/z80ctc.h"
@ -82,6 +82,11 @@ public:
DECLARE_DRIVER_INIT(p8k);
DECLARE_MACHINE_RESET(p8k);
DECLARE_MACHINE_RESET(p8k_16);
void fdc_irq(bool state);
void fdc_drq(bool state);
virtual void machine_start();
};
/***************************************************************************
@ -116,8 +121,7 @@ static ADDRESS_MAP_START(p8k_iomap, AS_IO, 8, p8k_state)
AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("z80pio_0", z80pio_device, read_alt, write_alt)
AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("z80pio_1", z80pio_device, read_alt, write_alt)
AM_RANGE(0x1c, 0x1f) AM_DEVREADWRITE("z80pio_2", z80pio_device, read_alt, write_alt)
AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("i8272", upd765_data_r, upd765_data_w)
AM_RANGE(0x21, 0x21) AM_DEVREAD_LEGACY("i8272", upd765_status_r)
AM_RANGE(0x20, 0x21) AM_DEVICE("i8272", i8272a_device, map)
//AM_RANGE(0x24, 0x27) AM_DEVREADWRITE("z80sio_0", z80sio_device, read_alt, write_alt)
AM_RANGE(0x24, 0x27) AM_READWRITE(p8k_port24_r,p8k_port24_w)
AM_RANGE(0x28, 0x2b) AM_DEVREADWRITE("z80sio_1", z80sio_device, read_alt, write_alt)
@ -211,11 +215,8 @@ static WRITE_LINE_DEVICE_HANDLER( p8k_daisy_interrupt )
static WRITE_LINE_DEVICE_HANDLER( p8k_dma_irq_w )
{
if (state)
{
device_t *i8272 = device->machine().device("i8272");
upd765_tc_w(i8272, state);
}
i8272a_device *i8272 = device->machine().device<i8272a_device>("i8272");
i8272->tc_w(state);
p8k_daisy_interrupt(device, state);
}
@ -350,35 +351,35 @@ static const z80_daisy_config p8k_daisy_chain[] =
/* Intel 8272 Interface */
static WRITE_LINE_DEVICE_HANDLER( p8k_i8272_irq_w )
void p8k_state::fdc_irq(bool state)
{
z80pio_device *z80pio = device->machine().device<z80pio_device>("z80pio_2");
z80pio_device *z80pio = machine().device<z80pio_device>("z80pio_2");
z80pio->port_b_write((state) ? 0x10 : 0x00);
z80pio->port_b_write(state ? 0x10 : 0x00);
}
static const struct upd765_interface p8k_i8272_intf =
void p8k_state::fdc_drq(bool state)
{
DEVCB_LINE(p8k_i8272_irq_w),
DEVCB_DEVICE_LINE("z80dma", z80dma_rdy_w),
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
z80dma_device *z80dma = machine().device<z80dma_device>("z80dma");
z80dma->rdy_w(state);
}
static const floppy_interface p8k_floppy_interface =
void p8k_state::machine_start()
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
i8272a_device *fdc = machine().device<i8272a_device>("i8272");
fdc->setup_intrq_cb(i8272a_device::line_cb(FUNC(p8k_state::fdc_irq), this));
fdc->setup_drq_cb(i8272a_device::line_cb(FUNC(p8k_state::fdc_drq), this));
}
static const floppy_format_type p8k_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( p8k_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* Input ports */
static INPUT_PORTS_START( p8k )
PORT_START("DSW")
@ -726,8 +727,9 @@ static MACHINE_CONFIG_START( p8k, p8k_state )
MCFG_Z80PIO_ADD("z80pio_0", 1229000, p8k_pio_0_intf)
MCFG_Z80PIO_ADD("z80pio_1", 1229000, p8k_pio_1_intf)
MCFG_Z80PIO_ADD("z80pio_2", 1229000, p8k_pio_2_intf)
MCFG_UPD765A_ADD("i8272", p8k_i8272_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(p8k_floppy_interface)
MCFG_I8272A_ADD("i8272", true)
MCFG_FLOPPY_DRIVE_ADD("i8272:0", p8k_floppies, "525hd", 0, p8k_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("i8272:1", p8k_floppies, "525hd", 0, p8k_floppy_formats)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")

View File

@ -22,6 +22,7 @@
#include "machine/upd765.h"
#include "sound/sn76496.h"
#include "video/mc6845.h"
#include "formats/mfi_dsk.h"
#include "rendlay.h"
#include "includes/pasopia.h"
@ -38,6 +39,7 @@ public:
m_pio(*this, "z80pio"),
m_crtc(*this, "crtc"),
m_fdc(*this, "fdc"),
m_floppy(*this, "fdc:0:525hd"),
m_sn1(*this, "sn1"),
m_sn2(*this, "sn2")
{ }
@ -49,21 +51,21 @@ public:
required_device<z80ctc_device> m_ctc;
required_device<z80pio_device> m_pio;
required_device<mc6845_device> m_crtc;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<floppy_image_device> m_floppy;
required_device<sn76489a_device> m_sn1;
required_device<sn76489a_device> m_sn2;
DECLARE_READ8_MEMBER(vram_r);
DECLARE_WRITE8_MEMBER(vram_w);
DECLARE_WRITE8_MEMBER(pasopia7_memory_ctrl_w);
DECLARE_READ8_MEMBER(fdc_r);
DECLARE_WRITE8_MEMBER(pac2_w);
DECLARE_READ8_MEMBER(pac2_r);
DECLARE_WRITE8_MEMBER(ram_bank_w);
DECLARE_WRITE8_MEMBER(pasopia7_6845_w);
DECLARE_READ8_MEMBER(pasopia7_fdc_r);
DECLARE_WRITE8_MEMBER(pasopia7_fdc_w);
DECLARE_READ8_MEMBER(pasopia7_io_r);
DECLARE_WRITE8_MEMBER(pasopia7_io_w);
DECLARE_READ8_MEMBER(pasopia7_fdc_r);
DECLARE_WRITE8_MEMBER(pasopia7_fdc_w);
DECLARE_READ8_MEMBER(mux_r);
DECLARE_READ8_MEMBER(keyb_r);
DECLARE_WRITE8_MEMBER(mux_w);
@ -110,6 +112,8 @@ public:
DECLARE_PALETTE_INIT(p7_raster);
DECLARE_PALETTE_INIT(p7_lcd);
UINT32 screen_update_pasopia7(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void fdc_irq(bool state);
};
#define VDP_CLOCK XTAL_3_579545MHz/4
@ -549,8 +553,8 @@ READ8_MEMBER( pasopia7_state::pasopia7_fdc_r )
{
switch(offset)
{
case 4: return upd765_status_r(m_fdc, space, 0);
case 5: return upd765_data_r(m_fdc, space, 0);
case 4: return m_fdc->msr_r(space, 0, 0xff);
case 5: return m_fdc->fifo_r(space, 0, 0xff);
//case 6: bit 7 interrupt bit
}
@ -561,13 +565,13 @@ WRITE8_MEMBER( pasopia7_state::pasopia7_fdc_w )
{
switch(offset)
{
case 0: upd765_tc_w(m_fdc, 0); break;
case 2: upd765_tc_w(m_fdc, 1); break;
case 5: upd765_data_w(m_fdc, space, 0, data); break;
case 0: m_fdc->tc_w(false); break;
case 2: m_fdc->tc_w(true); break;
case 5: m_fdc->fifo_w(space, 0, data, 0xff); break;
case 6:
upd765_reset_w(m_fdc, data & 0x80);
floppy_mon_w(floppy_get_device(machine(), 0), (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), (data & 0x40), 0);
if(data & 0x80)
m_fdc->reset();
m_floppy->mon_w(!(data & 0x40));
break;
}
}
@ -968,28 +972,19 @@ PALETTE_INIT_MEMBER(pasopia7_state,p7_lcd)
palette_set_color_rgb(machine(), i, 0x30, 0x38, 0x10);
}
static const struct upd765_interface pasopia7_upd765_interface =
void pasopia7_state::fdc_irq(bool state)
{
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),
DEVCB_NULL, //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
m_maincpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
}
static const floppy_interface pasopia7_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type pasopia7_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pasopia7_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/*************************************
*
@ -1007,7 +1002,6 @@ static const sn76496_config psg_intf =
DEVCB_NULL
};
static MACHINE_CONFIG_START( p7_base, pasopia7_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz)
@ -1031,8 +1025,9 @@ static MACHINE_CONFIG_START( p7_base, pasopia7_state )
MCFG_I8255_ADD( "ppi8255_0", ppi8255_intf_0 )
MCFG_I8255_ADD( "ppi8255_1", ppi8255_intf_1 )
MCFG_I8255_ADD( "ppi8255_2", ppi8255_intf_2 )
MCFG_UPD765A_ADD("fdc", pasopia7_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pasopia7_floppy_interface)
MCFG_UPD765A_ADD("fdc", true, true)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pasopia7_floppies, "525hd", 0, pasopia7_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", pasopia7_floppies, "525hd", 0, pasopia7_floppy_formats)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( p7_raster, p7_base )

View File

@ -91,6 +91,7 @@ video HW too.
#include "imagedev/harddriv.h"
#include "imagedev/cassette.h"
#include "imagedev/cartslot.h"
#include "formats/mfi_dsk.h"
#include "formats/pc_dsk.h"
#include "machine/8237dma.h"
@ -206,7 +207,7 @@ static ADDRESS_MAP_START(pc8_io, AS_IO, 8, pc_state )
AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE_LEGACY("lpt_1", pc_lpt_r, pc_lpt_w)
AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE("ins8250_2", ins8250_device, ins8250_r, ins8250_w)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE_LEGACY(pc_fdc_r, pc_fdc_w)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE("fdc", pc_fdc_interface, map)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE("ins8250_0", ins8250_device, ins8250_r, ins8250_w)
ADDRESS_MAP_END
@ -232,7 +233,7 @@ static ADDRESS_MAP_START(pc16_io, AS_IO, 16, pc_state )
AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8_LEGACY("lpt_1", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -252,7 +253,7 @@ static ADDRESS_MAP_START(ec1841_io, AS_IO, 16, pc_state)
// AM_RANGE(0x02f8, 0x02f8) AM_DEVREADWRITE8_LEGACY("upd8251_1", i8251_device, data_r, data_w, 0x00ff)
// AM_RANGE(0x02f9, 0x02f9) AM_DEVREADWRITE8_LEGACY("upd8251_1", i8251_device, status_r, control_w, 0xff00)
AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
// AM_RANGE(0x03f8, 0x03f9) AM_DEVREADWRITE8_LEGACY("upd8251_0", i8251_device, data_r, data_w, 0x00ff)
// AM_RANGE(0x03f8, 0x03f9) AM_DEVREADWRITE8_LEGACY("upd8251_0", i8251_device, status_r, control_w, 0xff00)
ADDRESS_MAP_END
@ -273,7 +274,7 @@ static ADDRESS_MAP_START(iskr1031_io, AS_IO, 16, pc_state)
AM_RANGE(0x0340, 0x0357) AM_NOP /* anonymous bios should not recogniced realtimeclock */
AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
// AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -307,7 +308,7 @@ static ADDRESS_MAP_START(ibm5550_io, AS_IO, 16, pc_state )
AM_RANGE(0x0378, 0x037f) AM_DEVREADWRITE8_LEGACY("lpt_1", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE8("ins8250_2", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -338,7 +339,7 @@ static ADDRESS_MAP_START(europc_io, AS_IO, 8, pc_state )
AM_RANGE(0x0378, 0x037b) AM_DEVREADWRITE_LEGACY("lpt_1", pc_lpt_r, pc_lpt_w)
// AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w)
AM_RANGE(0x03e8, 0x03ef) AM_DEVREADWRITE("ins8250_2", ins8250_device, ins8250_r, ins8250_w)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE_LEGACY(pc_fdc_r, pc_fdc_w)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE("fdc", pc_fdc_interface, map)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE("ins8250_0", ins8250_device, ins8250_r, ins8250_w)
ADDRESS_MAP_END
@ -368,7 +369,7 @@ static ADDRESS_MAP_START(tandy1000_io, AS_IO, 8, pc_state )
AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w)
AM_RANGE(0x0378, 0x037f) AM_READWRITE_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w)
AM_RANGE(0x03bc, 0x03be) AM_DEVREADWRITE_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE_LEGACY(pc_fdc_r, pc_fdc_w)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE("fdc", pc_fdc_interface, map)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE("ins8250_0", ins8250_device, ins8250_r, ins8250_w)
ADDRESS_MAP_END
@ -398,7 +399,7 @@ static ADDRESS_MAP_START(tandy1000_16_io, AS_IO, 16, pc_state )
AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x0378, 0x037f) AM_READWRITE8_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0xffea, 0xffeb) AM_READWRITE8_LEGACY(tandy1000_bank_r, tandy1000_bank_w, 0xffff)
ADDRESS_MAP_END
@ -429,7 +430,7 @@ static ADDRESS_MAP_START(tandy1000_286_io, AS_IO, 16, pc_state )
AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE8("ins8250_1", ins8250_device, ins8250_r, ins8250_w, 0xffff)
AM_RANGE(0x0378, 0x037f) AM_READWRITE8_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w, 0xffff)
AM_RANGE(0x03bc, 0x03bf) AM_DEVREADWRITE8_LEGACY("lpt_0", pc_lpt_r, pc_lpt_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_READWRITE8_LEGACY(pc_fdc_r, pc_fdc_w, 0xffff)
AM_RANGE(0x03f0, 0x03f7) AM_DEVICE8("fdc", pc_fdc_interface, map, 0xffff)
AM_RANGE(0x03f8, 0x03ff) AM_DEVREADWRITE8("ins8250_0", ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -455,7 +456,7 @@ static ADDRESS_MAP_START(ibmpcjr_io, AS_IO, 8, pc_state )
AM_RANGE(0x0080, 0x0087) AM_READWRITE(pc_page_r, pc_page_w)
AM_RANGE(0x00a0, 0x00a0) AM_READWRITE(pcjr_nmi_enable_r, pc_nmi_enable_w )
AM_RANGE(0x00c0, 0x00c0) AM_DEVWRITE("sn76496", sn76496_device, write)
AM_RANGE(0x00f0, 0x00f7) AM_READWRITE_LEGACY(pc_fdc_r, pcjr_fdc_w)
AM_RANGE(0x00f0, 0x00f7) AM_DEVICE("fdc", pc_fdc_interface, map)
AM_RANGE(0x0200, 0x0207) AM_READWRITE_LEGACY(pc_JOY_r, pc_JOY_w)
AM_RANGE(0x02f8, 0x02ff) AM_DEVREADWRITE("ins8250_1", ins8250_device, ins8250_r, ins8250_w)
AM_RANGE(0x0378, 0x037f) AM_READWRITE_LEGACY(pc_t1t_p37x_r, pc_t1t_p37x_w)
@ -856,19 +857,16 @@ static const pc_lpt_interface pc_lpt_config =
DEVCB_CPU_INPUT_LINE("maincpu", 0)
};
static const floppy_interface ibmpc_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
"floppy_5_25",
static const floppy_format_type ibmpc_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( ibmpc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
SLOT_INTERFACE_START(ibm5150_com)
SLOT_INTERFACE("microsoft_mouse", MSFT_SERIAL_MOUSE)
SLOT_INTERFACE("mouse_systems_mouse", MSYSTEM_SERIAL_MOUSE)
@ -996,9 +994,10 @@ static MACHINE_CONFIG_START( pccga, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1076,9 +1075,10 @@ static MACHINE_CONFIG_START( europc, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1125,9 +1125,10 @@ static MACHINE_CONFIG_START( t1000hx, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1174,9 +1175,10 @@ static MACHINE_CONFIG_START( t1000_16, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1223,9 +1225,10 @@ static MACHINE_CONFIG_START( t1000_286, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1295,9 +1298,9 @@ static MACHINE_CONFIG_START( ibmpcjr, pc_state )
/* cassette */
MCFG_CASSETTE_ADD( CASSETTE_TAG, ibm5150_cassette_interface )
MCFG_UPD765A_ADD("upd765", pcjr_fdc_upd765_interface)
MCFG_PC_FDC_JR_ADD("fdc")
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* cartridge */
MCFG_CARTSLOT_ADD("cart1")
@ -1371,7 +1374,7 @@ static MACHINE_CONFIG_START( mc1502, pc_state )
MCFG_CASSETTE_ADD( CASSETTE_TAG, mc1502_cassette_interface ) // has no motor control
MCFG_FD1793_ADD( "vg93", default_wd17xx_interface_2_drives )
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD(FLOPPY_0, ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1413,9 +1416,10 @@ static MACHINE_CONFIG_START( ec1841, pc_state )
/* printer */
MCFG_PC_LPT_ADD("lpt_0", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* keyboard -- needs dump */
MCFG_PC_KBDC_ADD("pc_kbdc", pc_kbdc_intf)
@ -1472,9 +1476,10 @@ static MACHINE_CONFIG_START( iskr1031, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1525,9 +1530,10 @@ static MACHINE_CONFIG_START( iskr3104, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1579,9 +1585,10 @@ static MACHINE_CONFIG_START( poisk2, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1632,9 +1639,10 @@ static MACHINE_CONFIG_START( zenith, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1685,9 +1693,10 @@ static MACHINE_CONFIG_START( olivetti, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)
@ -1738,9 +1747,10 @@ static MACHINE_CONFIG_START( ibm5550, pc_state )
MCFG_PC_LPT_ADD("lpt_1", pc_lpt_config)
MCFG_PC_LPT_ADD("lpt_2", pc_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_not_connected_interface)
MCFG_PC_FDC_XT_ADD("fdc")
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(ibmpc_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("fdc:0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -458,84 +458,6 @@ WRITE8_MEMBER( pc1512_state::printer_w )
}
//**************************************************************************
// FLOPPY
//**************************************************************************
//-------------------------------------------------
// fdc_r -
//-------------------------------------------------
READ8_MEMBER( pc1512_state::fdc_r )
{
UINT8 data = 0;
switch (offset)
{
case 4:
data = upd765_status_r(m_fdc, space, 0);
break;
case 5:
data = upd765_data_r(m_fdc, space, 0);
break;
}
return data;
}
//-------------------------------------------------
// fdc_w -
//-------------------------------------------------
void pc1512_state::set_fdc_dsr(UINT8 data)
{
/*
bit description
0 Drive Select Bit 0 (DS0)
1 Drive Select Bit 1 (DS1)
2 765A reset
3 Allow 765A FDC to interrupt and request DMA
4 Switch motor(s) on and enable drive 0 selection
5 Switch motor(s) on and enable drive 1 selection
6
7
*/
m_fdc_dsr = data;
m_nden = BIT(data, 3);
update_fdc_int();
update_fdc_drq();
update_fdc_tc();
upd765_reset_w(m_fdc, BIT(data, 2));
floppy_mon_w(m_floppy0, BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE);
floppy_mon_w(m_floppy1, BIT(data, 5) ? CLEAR_LINE : ASSERT_LINE);
}
WRITE8_MEMBER( pc1512_state::fdc_w )
{
switch (offset)
{
case 2:
set_fdc_dsr(data);
break;
case 5:
upd765_data_w(m_fdc, space, 0, data);
break;
}
}
//**************************************************************************
// PC1640 I/O ACCESS
//**************************************************************************
@ -544,24 +466,20 @@ WRITE8_MEMBER( pc1512_state::fdc_w )
// io_r -
//-------------------------------------------------
READ8_MEMBER( pc1640_state::io_unmapped_r )
{
test_unmapped = true;
return 0xff;
}
READ8_MEMBER( pc1640_state::io_r )
{
UINT8 data = 0;
offs_t addr = offset & 0x3ff;
bool decoded = false;
test_unmapped = false;
if ( addr <= 0x00f) { data = m_dmac->read(space, offset & 0x0f); decoded = true; }
else if (addr >= 0x020 && addr <= 0x021) { data = pic8259_r(m_pic, space, offset & 0x01); decoded = true; }
else if (addr >= 0x040 && addr <= 0x043) { data = pit8253_r(m_pit, space, offset & 0x03); decoded = true; }
else if (addr >= 0x060 && addr <= 0x06f) { data = system_r(space, offset & 0x0f); decoded = true; }
else if (addr >= 0x070 && addr <= 0x073) { data = m_rtc->read(space, offset & 0x01); decoded = true; }
else if (addr >= 0x078 && addr <= 0x07f) { data = mouse_r(space, offset & 0x07); decoded = true; }
else if (addr >= 0x378 && addr <= 0x37b) { data = printer_r(space, offset & 0x03); decoded = true; }
else if (addr >= 0x3b0 && addr <= 0x3df) { data = iga_r(space, addr - 0x3b0); decoded = true; }
else if (addr >= 0x3f0 && addr <= 0x3f7) { data = fdc_r(space, offset & 0x07); decoded = true; }
else if (addr >= 0x3f8 && addr <= 0x3ff) { data = m_uart->ins8250_r(space, offset & 0x07); decoded = true; }
UINT8 data = space.read_byte(offset + 0x10000);
if (decoded)
if (!test_unmapped)
{
if (BIT(offset, 7))
{
@ -621,7 +539,7 @@ static ADDRESS_MAP_START( pc1512_io, AS_IO, 16, pc1512_state )
AM_RANGE(0x0a0, 0x0a1) AM_WRITE8(nmi_mask_w, 0xff00)
AM_RANGE(0x378, 0x37b) AM_READWRITE8(printer_r, printer_w, 0xffff)
AM_RANGE(0x3d0, 0x3df) AM_READWRITE8(vdu_r, vdu_w, 0xffff)
AM_RANGE(0x3f0, 0x3f7) AM_READWRITE8(fdc_r, fdc_w, 0xffff)
AM_RANGE(0x3f0, 0x3f7) AM_DEVICE8(PC_FDC_XT_TAG, pc_fdc_xt_device, map, 0xffff)
AM_RANGE(0x3f8, 0x3ff) AM_DEVREADWRITE8(INS8250_TAG, ins8250_device, ins8250_r, ins8250_w, 0xffff)
ADDRESS_MAP_END
@ -645,18 +563,22 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( pc1640_io, AS_IO, 16, pc1640_state )
AM_RANGE(0x0000, 0xffff) AM_READ8(io_r, 0xffff)
AM_RANGE(0x000, 0x00f) AM_DEVWRITE8(I8237A5_TAG, am9517a_device, write, 0xffff)
AM_RANGE(0x020, 0x021) AM_DEVWRITE8_LEGACY(I8259A2_TAG, pic8259_w, 0xffff)
AM_RANGE(0x040, 0x043) AM_DEVWRITE8_LEGACY(I8253_TAG, pit8253_w, 0xffff)
AM_RANGE(0x060, 0x06f) AM_WRITE8(system_w, 0xffff)
AM_RANGE(0x070, 0x071) AM_MIRROR(0x02) AM_DEVWRITE8(MC146818_TAG, mc146818_device, write, 0xffff)
AM_RANGE(0x078, 0x07f) AM_WRITE8(mouse_w, 0xffff)
AM_RANGE(0x080, 0x083) AM_WRITE8(dma_page_w, 0xffff)
AM_RANGE(0x0a0, 0x0a1) AM_WRITE8(nmi_mask_w, 0xff00)
AM_RANGE(0x378, 0x37b) AM_WRITE8(printer_w, 0xffff)
AM_RANGE(0x3b0, 0x3df) AM_WRITE8(iga_w, 0xffff)
AM_RANGE(0x3f0, 0x3f7) AM_WRITE8(fdc_w, 0xffff)
AM_RANGE(0x3f8, 0x3ff) AM_DEVWRITE8(INS8250_TAG, ins8250_device, ins8250_w, 0xffff)
// Mirrored over to 10000 for indirect reads through io_r
AM_RANGE(0x000, 0x00f) AM_MIRROR(0x10000) AM_DEVWRITE8(I8237A5_TAG, am9517a_device, write, 0xffff)
AM_RANGE(0x020, 0x021) AM_MIRROR(0x10000) AM_DEVWRITE8_LEGACY(I8259A2_TAG, pic8259_w, 0xffff)
AM_RANGE(0x040, 0x043) AM_MIRROR(0x10000) AM_DEVWRITE8_LEGACY(I8253_TAG, pit8253_w, 0xffff)
AM_RANGE(0x060, 0x06f) AM_MIRROR(0x10000) AM_WRITE8(system_w, 0xffff)
AM_RANGE(0x070, 0x071) AM_MIRROR(0x10000) AM_MIRROR(0x02) AM_DEVWRITE8(MC146818_TAG, mc146818_device, write, 0xffff)
AM_RANGE(0x078, 0x07f) AM_MIRROR(0x10000) AM_WRITE8(mouse_w, 0xffff)
AM_RANGE(0x080, 0x083) AM_MIRROR(0x10000) AM_WRITE8(dma_page_w, 0xffff)
AM_RANGE(0x0a0, 0x0a1) AM_MIRROR(0x10000) AM_WRITE8(nmi_mask_w, 0xff00)
AM_RANGE(0x378, 0x37b) AM_MIRROR(0x10000) AM_WRITE8(printer_w, 0xffff)
AM_RANGE(0x3b0, 0x3df) AM_MIRROR(0x10000) AM_WRITE8(iga_w, 0xffff)
AM_RANGE(0x3f0, 0x3f7) AM_MIRROR(0x10000) AM_DEVICE8(PC_FDC_XT_TAG, pc_fdc_xt_device, map, 0xffff)
AM_RANGE(0x3f8, 0x3ff) AM_MIRROR(0x10000) AM_DEVWRITE8(INS8250_TAG, ins8250_device, ins8250_w, 0xffff)
AM_RANGE(0x10000, 0x1ffff) AM_READ8(io_unmapped_r, 0xffff)
ADDRESS_MAP_END
@ -865,9 +787,9 @@ static PC1512_KEYBOARD_INTERFACE( kb_intf )
void pc1512_state::update_fdc_tc()
{
if (m_nden)
upd765_tc_w(m_fdc, m_neop);
m_fdc->tc_w(m_neop);
else
upd765_tc_w(m_fdc, 0);
m_fdc->tc_w(false);
}
WRITE_LINE_MEMBER( pc1512_state::hrq_w )
@ -910,7 +832,7 @@ READ8_MEMBER( pc1512_state::ior1_r )
READ8_MEMBER( pc1512_state::ior2_r )
{
if (m_nden)
return upd765_dack_r(m_fdc, space, 0);
return m_fdc->dma_r();
else
return m_bus->dack_r(2);
}
@ -934,7 +856,7 @@ WRITE8_MEMBER( pc1512_state::iow1_w )
WRITE8_MEMBER( pc1512_state::iow2_w )
{
if (m_nden)
upd765_dack_w(m_fdc, space, 0, data);
m_fdc->dma_w(data);
else
m_bus->dack_w(2, data);
}
@ -1105,26 +1027,6 @@ WRITE_LINE_MEMBER( pc1512_state::fdc_drq_w )
update_fdc_drq();
}
static UPD765_GET_IMAGE( pc1512_fdc_get_image )
{
pc1512_state *state = device->machine().driver_data<pc1512_state>();
if (BIT(state->m_fdc_dsr, 0))
return state->m_floppy1;
else
return state->m_floppy0;
}
static const upd765_interface fdc_intf =
{
DEVCB_DRIVER_LINE_MEMBER(pc1512_state, fdc_int_w),
DEVCB_DRIVER_LINE_MEMBER(pc1512_state, fdc_drq_w),
pc1512_fdc_get_image,
UPD765_RDY_PIN_NOT_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
//-------------------------------------------------
// ins8250_interface uart_intf
//-------------------------------------------------
@ -1190,6 +1092,15 @@ static const isa8bus_interface isabus_intf =
DEVCB_DEVICE_LINE_MEMBER(I8237A5_TAG, am9517a_device, dreq3_w)
};
static const floppy_format_type ibmpc_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( ibmpc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
//**************************************************************************
@ -1233,7 +1144,6 @@ void pc1512_state::machine_start()
save_item(NAME(m_nden));
save_item(NAME(m_dint));
save_item(NAME(m_ddrq));
save_item(NAME(m_fdc_dsr));
save_item(NAME(m_neop));
save_item(NAME(m_ack_int_enable));
save_item(NAME(m_ack));
@ -1263,8 +1173,6 @@ void pc1512_state::machine_reset()
m_toggle = 0;
m_kb_bits = 0;
set_fdc_dsr(0);
m_lpen = 0;
m_blink = 0;
m_cursor = 0;
@ -1307,7 +1215,6 @@ void pc1640_state::machine_start()
save_item(NAME(m_nden));
save_item(NAME(m_dint));
save_item(NAME(m_ddrq));
save_item(NAME(m_fdc_dsr));
save_item(NAME(m_neop));
save_item(NAME(m_ack_int_enable));
save_item(NAME(m_ack));
@ -1325,9 +1232,6 @@ void pc1640_state::machine_reset()
{
m_nmi_enable = 0;
m_kb_bits = 0;
set_fdc_dsr(0);
m_kb->clock_w(0);
}
@ -1360,10 +1264,11 @@ static MACHINE_CONFIG_START( pc1512, pc1512_state )
MCFG_PIC8259_ADD(I8259A2_TAG, pic_intf)
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_MC146818_IRQ_ADD(MC146818_TAG, MC146818_STANDARD, rtc_intf)
MCFG_UPD765A_ADD(UPD765AC2_TAG, fdc_intf)
MCFG_PC_FDC_XT_ADD(PC_FDC_XT_TAG)
MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
// ISA8 bus
MCFG_ISA8_BUS_ADD(ISA_BUS_TAG, I8086_TAG, isabus_intf)
@ -1404,10 +1309,11 @@ static MACHINE_CONFIG_START( pc1640, pc1640_state )
MCFG_PIC8259_ADD(I8259A2_TAG, pic_intf)
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_MC146818_IRQ_ADD(MC146818_TAG, MC146818_STANDARD, rtc_intf)
MCFG_UPD765A_ADD(UPD765AC2_TAG, fdc_intf)
MCFG_PC_FDC_XT_ADD(PC_FDC_XT_TAG)
MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":0", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", ibmpc_floppies, "525dd", 0, ibmpc_floppy_formats)
// ISA8 bus
MCFG_ISA8_BUS_ADD(ISA_BUS_TAG, I8086_TAG, isabus_intf)

View File

@ -244,7 +244,8 @@
#include "cpu/z80/z80.h"
#include "imagedev/cassette.h"
#include "imagedev/flopdrv.h"
#include "imagedev/cassette.h"
#include "formats/mfi_dsk.h"
#include "formats/d88_dsk.h"
#include "machine/ctronics.h"
#include "machine/i8255.h"
#include "machine/upd1990a.h"
@ -438,6 +439,7 @@ public:
void pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UINT8 gfx_mode,UINT8 reverse,UINT8 secret,
UINT8 blink,UINT8 upper,UINT8 lower,int y_size,int width, UINT8 non_special);
void draw_text(bitmap_ind16 &bitmap,int y_size, UINT8 width);
void fdc_irq_w(bool state);
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -1887,24 +1889,23 @@ TIMER_CALLBACK_MEMBER(pc8801_state::pc8801fd_upd765_tc_to_zero)
{
//printf("0\n");
upd765_tc_w(machine().device("upd765"), 0);
machine().device<upd765a_device>("upd765")->tc_w(false);
}
WRITE8_MEMBER(pc8801_state::upd765_mc_w)
{
floppy_mon_w(floppy_get_device(machine(), 0), (data & 1) ? CLEAR_LINE : ASSERT_LINE);
floppy_mon_w(floppy_get_device(machine(), 1), (data & 2) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), (data & 1), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), (data & 2), 0);
machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(!(data & 1));
machine().device<floppy_connector>("upd765:1")->get_device()->mon_w(!(data & 2));
}
READ8_MEMBER(pc8801_state::upd765_tc_r)
{
//printf("%04x 1\n",m_fdccpu->pc());
upd765_tc_w(machine().device("upd765"), 1);
//TODO: I'm not convinced that this works correctly with current hook-up ... 1000 usec is needed by Aploon, a bigger value breaks Alpha.
machine().scheduler().timer_set(attotime::from_usec(750), timer_expired_delegate(FUNC(pc8801_state::pc8801fd_upd765_tc_to_zero),this));
machine().device<upd765a_device>("upd765")->tc_w(true);
//TODO: I'm not convinced that this works correctly with current hook-up ... 1000 usec is needed by Aploon, a bigger value breaks Alpha.
//OTOH, 50 seems more than enough for the new upd...
machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(pc8801_state::pc8801fd_upd765_tc_to_zero),this));
return 0xff; // value is meaningless
}
@ -1916,10 +1917,11 @@ WRITE8_MEMBER(pc8801_state::fdc_irq_vector_w)
WRITE8_MEMBER(pc8801_state::fdc_drive_mode_w)
{
if(data & 5)
printf("drive 0 sets up %s floppy format\n",data & 1 ? "2hd" : "2dd");
if(data & 0xa)
printf("drive 1 sets up %s floppy format\n",data & 2 ? "2hd" : "2dd");
logerror("FDC drive mode %02x\n", data);
machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(data & 0x01 ? 360 : 300);
machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
machine().device<upd765a_device>("upd765")->set_rate(data & 0x20 ? 500000 : 250000);
}
static ADDRESS_MAP_START( pc8801fdc_io, AS_IO, 8, pc8801_state )
@ -1928,8 +1930,7 @@ static ADDRESS_MAP_START( pc8801fdc_io, AS_IO, 8, pc8801_state )
AM_RANGE(0xf4, 0xf4) AM_WRITE(fdc_drive_mode_w) // Drive mode, 2d, 2dd, 2hd
AM_RANGE(0xf7, 0xf7) AM_WRITENOP // printer port output
AM_RANGE(0xf8, 0xf8) AM_READWRITE(upd765_tc_r,upd765_mc_w) // (R) Terminal Count Port (W) Motor Control Port
AM_RANGE(0xfa, 0xfa) AM_DEVREAD_LEGACY("upd765", upd765_status_r )
AM_RANGE(0xfb, 0xfb) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w )
AM_RANGE(0xfa, 0xfb) AM_DEVICE("upd765", upd765a_device, map )
AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE("d8255_slave", i8255_device, read, write)
ADDRESS_MAP_END
@ -2261,19 +2262,17 @@ static UPD1990A_INTERFACE( pc8801_upd1990a_intf )
/* Floppy Configuration */
static const floppy_interface pc88_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_5_25",
static const floppy_format_type pc88_floppy_formats[] = {
FLOPPY_D88_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pc88_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* Cassette Configuration */
static const cassette_interface pc88_cassette_interface =
@ -2433,6 +2432,11 @@ void pc8801_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(pc8801_irq_callback);
machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc8801_state::fdc_irq_w), this));
machine().device<floppy_connector>("upd765:0")->get_device()->set_rpm(300);
machine().device<floppy_connector>("upd765:1")->get_device()->set_rpm(300);
machine().device<upd765a_device>("upd765")->set_rate(250000);
m_rtc->cs_w(1);
m_rtc->oe_w(1);
@ -2563,14 +2567,10 @@ void pc8801_state::palette_init()
palette_set_color_rgb(machine(), i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0));
}
static const struct upd765_interface pc8801_upd765_interface =
void pc8801_state::fdc_irq_w(bool state)
{
DEVCB_CPU_INPUT_LINE("fdccpu", INPUT_LINE_IRQ0),
DEVCB_NULL, //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
m_fdccpu->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
}
/* YM2203 Interface */
@ -2682,7 +2682,7 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state )
MCFG_I8255_ADD( "d8255_master", master_fdd_intf )
MCFG_I8255_ADD( "d8255_slave", slave_fdd_intf )
MCFG_UPD765A_ADD("upd765", pc8801_upd765_interface)
MCFG_UPD765A_ADD("upd765", true, true)
#ifdef USE_PROPER_I8214
MCFG_I8214_ADD(I8214_TAG, MASTER_CLOCK, pic_intf)
#endif
@ -2693,7 +2693,8 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state )
MCFG_I8251_ADD(I8251_TAG, uart_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pc88_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", pc88_floppies, "525hd", 0, pc88_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", pc88_floppies, "525hd", 0, pc88_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("disk_list","pc8801_flop")
/* video hardware */

View File

@ -27,7 +27,9 @@
#include "machine/pit8253.h"
#include "machine/upd765.h"
#include "sound/2203intf.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/pc_dsk.h"
#include "formats/xdf_dsk.h"
struct tsp_t
{
@ -119,6 +121,8 @@ public:
DECLARE_READ8_MEMBER(get_slave_ack);
DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed);
DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
void upd765_interrupt(bool state);
};
@ -954,23 +958,19 @@ READ8_MEMBER(pc88va_state::hdd_status_r)
WRITE8_MEMBER(pc88va_state::upd765_mc_w)
{
floppy_mon_w(floppy_get_device(machine(), 0), (data & 1) ? CLEAR_LINE : ASSERT_LINE);
floppy_mon_w(floppy_get_device(machine(), 1), (data & 2) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), (data & 1), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), (data & 2), 0);
machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(!(data & 1));
machine().device<floppy_connector>("upd765:1")->get_device()->mon_w(!(data & 2));
}
TIMER_CALLBACK_MEMBER(pc88va_state::pc8801fd_upd765_tc_to_zero)
{
upd765_tc_w(machine().device("upd765"), 0);
machine().device<upd765a_device>("upd765")->tc_w(false);
}
READ8_MEMBER(pc88va_state::upd765_tc_r)
{
upd765_tc_w(machine().device("upd765"), 1);
machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(pc88va_state::pc8801fd_upd765_tc_to_zero),this));
machine().device<upd765a_device>("upd765")->tc_w(true);
machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(pc88va_state::pc8801fd_upd765_tc_to_zero),this));
return 0;
}
@ -986,8 +986,6 @@ READ8_MEMBER(pc88va_state::pc88va_fdc_r)
/* ---x ---- RDY: (0) Busy (1) Ready */
case 0x06: // FDC control port 2
return 0;
case 0x08: return upd765_status_r(machine().device("upd765"), space, 0);
case 0x0a: return upd765_data_r(machine().device("upd765"), space, 0);
}
return 0xff;
@ -1028,8 +1026,6 @@ WRITE8_MEMBER(pc88va_state::pc88va_fdc_w)
case 0x06:
printf("%02x\n",data);
break; // FDC control port 2
case 0x08: break; // UPD765 status
case 0x0a: upd765_data_w(machine().device("upd765"), space, 0,data); break;
}
}
@ -1154,7 +1150,8 @@ static ADDRESS_MAP_START( pc88va_io_map, AS_IO, 16, pc88va_state )
AM_RANGE(0x019a, 0x019b) AM_WRITE(backupram_wp_0_w) //Backup RAM write permission
AM_RANGE(0x01a0, 0x01a7) AM_DEVREADWRITE8_LEGACY("pit8253", pit8253_r, pit8253_w, 0x00ff)// vTCU (timer counter unit)
AM_RANGE(0x01a8, 0x01a9) AM_WRITE8(timer3_ctrl_reg_w,0x00ff) // General-purpose timer 3 control port
AM_RANGE(0x01b0, 0x01bb) AM_READWRITE8(pc88va_fdc_r,pc88va_fdc_w,0x00ff)// FDC related (765)
AM_RANGE(0x01b0, 0x01b7) AM_READWRITE8(pc88va_fdc_r,pc88va_fdc_w,0x00ff)// FDC related (765)
AM_RANGE(0x01b8, 0x01bb) AM_DEVICE8("upd765", upd765a_device, map, 0x00ff)
// AM_RANGE(0x01c0, 0x01c1) ?
AM_RANGE(0x01c6, 0x01c7) AM_WRITENOP // ???
AM_RANGE(0x01c8, 0x01cf) AM_DEVREADWRITE8("d8255_3", i8255_device, read, write,0xff00) //i8255 3 (byte access)
@ -1187,8 +1184,7 @@ static ADDRESS_MAP_START( pc88va_z80_io_map, AS_IO, 8, pc88va_state )
AM_RANGE(0xf0, 0xf0) AM_WRITE(fdc_irq_vector_w) // Interrupt Opcode Port
// AM_RANGE(0xf4, 0xf4) // Drive Control Port
AM_RANGE(0xf8, 0xf8) AM_READWRITE(upd765_tc_r,upd765_mc_w) // (R) Terminal Count Port (W) Motor Control Port
AM_RANGE(0xfa, 0xfa) AM_DEVREAD_LEGACY("upd765", upd765_status_r )
AM_RANGE(0xfb, 0xfb) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w )
AM_RANGE(0xfa, 0xfb) AM_DEVICE("upd765", upd765a_device, map )
AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE("d8255_2s", i8255_device, read, write)
ADDRESS_MAP_END
@ -1545,6 +1541,7 @@ void pc88va_state::machine_start()
m_t3_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc88va_state::t3_mouse_callback),this));
m_t3_mouse_timer->adjust(attotime::never);
machine().device<upd765a_device>("upd765")->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc88va_state::upd765_interrupt), this));
}
void pc88va_state::machine_reset()
@ -1578,30 +1575,6 @@ INTERRUPT_GEN_MEMBER(pc88va_state::pc88va_vrtc_irq)
pic8259_ir2_w(machine().device("pic8259_master"), 1);
}
/* Not sure if parameters are correct for pc88va (copied from x68k) */
static LEGACY_FLOPPY_OPTIONS_START( pc88va )
LEGACY_FLOPPY_OPTION( img2d, "xdf,hdm,2hd", "XDF disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([77])
SECTORS([8])
SECTOR_LENGTH([1024])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface pc88va_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc88va),
"floppy_5_25",
NULL
};
WRITE_LINE_MEMBER(pc88va_state::pc88va_pit_out0_changed)
{
pic8259_ir0_w(machine().device("pic8259_master"), 1);
@ -1632,22 +1605,14 @@ static const struct pit8253_config pc88va_pit8253_config =
};
WRITE_LINE_MEMBER(pc88va_state::pc88va_upd765_interrupt)
void pc88va_state::upd765_interrupt(bool state)
{
if(m_fdc_mode)
pic8259_ir3_w(machine().device( "pic8259_slave"), state);
else
machine().device("fdccpu")->execute().set_input_line(0, HOLD_LINE);
};
}
static const struct upd765_interface pc88va_upd765_interface =
{
DEVCB_DRIVER_LINE_MEMBER(pc88va_state, pc88va_upd765_interrupt),
DEVCB_NULL, //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
static const ym2203_interface pc88va_ym2203_intf =
{
@ -1662,6 +1627,17 @@ static const ym2203_interface pc88va_ym2203_intf =
DEVCB_NULL
};
static const floppy_format_type pc88va_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_XDF_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pc88va_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_START( pc88va, pc88va_state )
MCFG_CPU_ADD("maincpu", V30, 8000000) /* 8 MHz */
@ -1695,8 +1671,9 @@ static MACHINE_CONFIG_START( pc88va, pc88va_state )
MCFG_PIC8259_ADD( "pic8259_master", pc88va_pic8259_master_config )
MCFG_PIC8259_ADD( "pic8259_slave", pc88va_pic8259_slave_config )
MCFG_UPD765A_ADD("upd765", pc88va_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pc88va_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", pc88va_floppies, "525hd", 0, pc88va_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", pc88va_floppies, "525hd", 0, pc88va_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("disk_list","pc88va")
MCFG_PIT8253_ADD("pit8253",pc88va_pit8253_config)

View File

@ -244,6 +244,7 @@
#include "video/upd7220.h"
#include "imagedev/flopdrv.h"
#include "machine/ram.h"
#include "formats/mfi_dsk.h"
#define UPD1990A_TAG "upd1990a"
#define UPD8251_TAG "upd8251"
@ -405,6 +406,13 @@ public:
DECLARE_WRITE8_MEMBER(sdip_a_w);
DECLARE_WRITE8_MEMBER(sdip_b_w);
void fdc_2hd_irq(bool state);
void fdc_2hd_drq(bool state);
void fdc_2dd_irq(bool state);
void fdc_2dd_drq(bool state);
void pc9801rs_fdc_irq(bool state);
private:
UINT8 m_sdip_read(UINT16 port, UINT8 sdip_offset);
void m_sdip_write(UINT16 port, UINT8 sdip_offset,UINT8 data);
@ -578,6 +586,14 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
}
}
static const floppy_format_type pc9801_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pc9801_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static UPD7220_INTERFACE( hgdc_1_intf )
{
@ -1063,8 +1079,8 @@ READ8_MEMBER(pc9801_state::pc9801_fdc_2hd_r)
{
switch(offset & 6)
{
case 0: return upd765_status_r(machine().device("upd765_2hd"),space, 0);
case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
case 0: return machine().device<upd765a_device>("upd765_2hd")->msr_r(space, 0, 0xff);
case 2: return machine().device<upd765a_device>("upd765_2hd")->fifo_r(space, 0, 0xff);
case 4: return 0x5f; //unknown port meaning
}
}
@ -1090,19 +1106,15 @@ WRITE8_MEMBER(pc9801_state::pc9801_fdc_2hd_w)
switch(offset & 6)
{
case 0: printf("Write to undefined port [%02x] <- %02x\n",offset+0x90,data); return;
case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
case 2: machine().device<upd765a_device>("upd765_2hd")->fifo_w(space, 0, data, 0xff); return;
case 4:
printf("%02x ctrl\n",data);
if(((m_fdc_2hd_ctrl & 0x80) == 0) && (data & 0x80))
upd765_reset_w(machine().device("upd765_2hd"),1);
if((m_fdc_2hd_ctrl & 0x80) && (!(data & 0x80)))
upd765_reset_w(machine().device("upd765_2hd"),0);
machine().device<upd765a_device>("upd765_2hd")->reset();
m_fdc_2hd_ctrl = data;
floppy_mon_w(floppy_get_device(machine(), 0), (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
floppy_mon_w(floppy_get_device(machine(), 1), (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), (data & 0x40), 0);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), (data & 0x40), 0);
machine().device<floppy_connector>("upd765_2hd:0")->get_device()->mon_w(!(data & 0x40));
machine().device<floppy_connector>("upd765_2hd:1")->get_device()->mon_w(!(data & 0x40));
break;
}
}
@ -1124,8 +1136,8 @@ READ8_MEMBER(pc9801_state::pc9801_fdc_2dd_r)
{
switch(offset & 6)
{
case 0: return upd765_status_r(machine().device("upd765_2dd"),space, 0);
case 2: return upd765_data_r(machine().device("upd765_2dd"),space, 0);
case 0: return machine().device<upd765a_device>("upd765_2dd")->msr_r(space, 0, 0xff);
case 2: return machine().device<upd765a_device>("upd765_2dd")->fifo_r(space, 0, 0xff);
case 4: return 0x40; //unknown port meaning, might be 0x70
}
}
@ -1146,13 +1158,11 @@ WRITE8_MEMBER(pc9801_state::pc9801_fdc_2dd_w)
switch(offset & 6)
{
case 0: printf("Write to undefined port [%02x] <- %02x\n",offset+0xc8,data); return;
case 2: upd765_data_w(machine().device("upd765_2dd"),space, 0,data); return;
case 2: machine().device<upd765a_device>("upd765_2dd")->fifo_w(space, 0, data, 0xff); return;
case 4:
printf("%02x ctrl\n",data);
if(((m_fdc_2dd_ctrl & 0x80) == 0) && (data & 0x80))
upd765_reset_w(machine().device("upd765_2dd"),1);
if((m_fdc_2dd_ctrl & 0x80) && (!(data & 0x80)))
upd765_reset_w(machine().device("upd765_2dd"),0);
machine().device<upd765a_device>("upd765_2dd")->reset();
m_fdc_2dd_ctrl = data;
//floppy_mon_w(floppy_get_device(machine(), 0), (data & 8) ? CLEAR_LINE : ASSERT_LINE);
@ -1436,8 +1446,8 @@ READ8_MEMBER(pc9801_state::pc9801rs_2hd_r)
{
switch(offset & 6)
{
case 0: return upd765_status_r(machine().device("upd765_2hd"),space, 0);
case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
case 0: return machine().device<upd765a_device>("upd765_2hd")->msr_r(space, 0, 0xff);
case 2: return machine().device<upd765a_device>("upd765_2hd")->fifo_r(space, 0, 0xff);
case 4: return 0x40; //2hd flag
}
}
@ -1453,7 +1463,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_2hd_w)
{
switch(offset & 6)
{
case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
case 2: machine().device<upd765a_device>("upd765_2hd")->fifo_w(space, 0, data, 0xff); return;
case 4: printf("%02x FDC ctrl\n",data); return;
}
}
@ -1471,8 +1481,8 @@ READ8_MEMBER(pc9801_state::pc9801rs_2dd_r)
{
switch(offset & 6)
{
case 0: return upd765_status_r(machine().device("upd765_2hd"),space, 0);
case 2: return upd765_data_r(machine().device("upd765_2hd"),space, 0);
case 0: return machine().device<upd765a_device>("upd765_2hd")->msr_r(space, 0, 0xff);
case 2: return machine().device<upd765a_device>("upd765_2hd")->fifo_r(space, 0, 0xff);
case 4: return 0x70; //2dd flag
}
}
@ -1492,7 +1502,7 @@ WRITE8_MEMBER(pc9801_state::pc9801rs_2dd_w)
{
switch(offset & 6)
{
case 2: upd765_data_w(machine().device("upd765_2hd"),space, 0,data); return;
case 2: machine().device<upd765a_device>("upd765_2hd")->fifo_w(space, 0, data, 0xff); return;
case 4: printf("%02x FDC ctrl\n",data); return;
}
}
@ -2429,21 +2439,20 @@ static I8255A_INTERFACE( ppi_fdd_intf )
*
****************************************/
WRITE_LINE_MEMBER(pc9801_state::fdc_2hd_irq)
void pc9801_state::fdc_2hd_irq(bool state)
{
printf("IRQ %d\n",state);
//if(state)
// pic8259_ir3_w(machine().device("pic8259_slave"), state);
}
WRITE_LINE_MEMBER(pc9801_state::fdc_2hd_drq)
void pc9801_state::fdc_2hd_drq(bool state)
{
printf("%02x DRQ\n",state);
}
WRITE_LINE_MEMBER(pc9801_state::fdc_2dd_irq)
void pc9801_state::fdc_2dd_irq(bool state)
{
printf("IRQ %d\n",state);
if(m_fdc_2dd_ctrl & 8)
@ -2452,32 +2461,13 @@ WRITE_LINE_MEMBER(pc9801_state::fdc_2dd_irq)
}
}
WRITE_LINE_MEMBER(pc9801_state::fdc_2dd_drq)
void pc9801_state::fdc_2dd_drq(bool state)
{
printf("%02x DRQ\n",state);
}
static const struct upd765_interface upd765_2hd_intf =
void pc9801_state::pc9801rs_fdc_irq(bool state)
{
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2hd_irq),
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2hd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
static const struct upd765_interface upd765_2dd_intf =
{
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_irq),
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{NULL, NULL, NULL, NULL}
};
WRITE_LINE_MEMBER(pc9801_state::pc9801rs_fdc_irq)
{
/* 0xffaf8 */
if(m_fdc_ctrl & 1)
@ -2486,28 +2476,6 @@ WRITE_LINE_MEMBER(pc9801_state::pc9801rs_fdc_irq)
pic8259_ir2_w(machine().device("pic8259_slave"), state);
}
static const struct upd765_interface pc9801rs_upd765_intf =
{
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc9801rs_fdc_irq),
DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
static const floppy_interface pc9801_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_5_25",
NULL
};
static UPD1990A_INTERFACE( pc9801_upd1990a_intf )
{
DEVCB_NULL,
@ -2555,6 +2523,16 @@ MACHINE_START_MEMBER(pc9801_state,pc9801)
m_rtc->cs_w(1);
m_rtc->oe_w(1);
upd765a_device *fdc;
fdc = machine().device<upd765a_device>("upd765_2hd");
fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2hd_irq), this));
fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2hd_drq), this));
fdc = machine().device<upd765a_device>("upd765_2dd");
fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2dd_irq), this));
fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(pc9801_state::fdc_2dd_drq), this));
}
MACHINE_RESET_MEMBER(pc9801_state,pc9801)
@ -2674,9 +2652,11 @@ static MACHINE_CONFIG_START( pc9801, pc9801_state )
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, pc9801_upd1990a_intf)
MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface)
MCFG_UPD765A_ADD("upd765_2hd", upd765_2hd_intf)
MCFG_UPD765A_ADD("upd765_2dd", upd765_2dd_intf)
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(pc9801_floppy_interface)
MCFG_UPD765A_ADD("upd765_2hd", true, true)
MCFG_UPD765A_ADD("upd765_2dd", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("disk_list","pc98")
#if 0
@ -2737,9 +2717,10 @@ static MACHINE_CONFIG_START( pc9801rs, pc9801_state )
MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf)
MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface)
MCFG_UPD765A_ADD("upd765_2hd", pc9801rs_upd765_intf)
MCFG_UPD765A_ADD("upd765_2hd", true, true)
//"upd765_2dd"
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(pc9801_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("640K")
@ -2797,9 +2778,10 @@ static MACHINE_CONFIG_START( pc9821, pc9801_state )
MCFG_UPD1990A_ADD("upd1990a", XTAL_32_768kHz, pc9801_upd1990a_intf)
MCFG_I8251_ADD(UPD8251_TAG, pc9801_uart_interface)
MCFG_UPD765A_ADD("upd765_2hd", pc9801rs_upd765_intf)
MCFG_UPD765A_ADD("upd765_2hd", true, true)
//"upd765_2dd"
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(pc9801_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:0", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765_2hd:1", pc9801_floppies, "525hd", 0, pc9801_floppy_formats)
MCFG_RAM_ADD(RAM_TAG)
MCFG_RAM_DEFAULT_SIZE("640K")

View File

@ -104,6 +104,8 @@
// pcw/pcw16 beeper
#include "sound/beep.h"
#include "machine/ram.h"
#include "formats/pc_dsk.h"
#include "formats/mfi_dsk.h"
#include "pcw.lh"
@ -113,8 +115,6 @@
static const UINT8 half_step_table[4] = { 0x01, 0x02, 0x04, 0x08 };
static const UINT8 full_step_table[4] = { 0x03, 0x06, 0x0c, 0x09 };
static void pcw_update_interrupt_counter(pcw_state *state)
{
/* never increments past 15! */
@ -125,16 +125,6 @@ static void pcw_update_interrupt_counter(pcw_state *state)
state->m_interrupt_counter++;
}
/* PCW uses UPD765 in NON-DMA mode. FDC Ints are connected to /INT or
/NMI depending on choice (see system control below) */
static const upd765_interface pcw_upd765_interface =
{
DEVCB_DRIVER_LINE_MEMBER(pcw_state,pcw_fdc_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
// set/reset INT and NMI lines
static void pcw_update_irqs(running_machine &machine)
@ -178,10 +168,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(pcw_state::pcw_timer_interrupt)
machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),this));
}
/* fdc interrupt callback. set/clear fdc int */
WRITE_LINE_MEMBER(pcw_state::pcw_fdc_interrupt)
/* PCW uses UPD765 in NON-DMA mode. FDC Ints are connected to /INT or
* /NMI depending on choice (see system control below)
* fdc interrupt callback. set/clear fdc int */
void pcw_state::pcw_fdc_interrupt(bool state)
{
if (state == CLEAR_LINE)
if (!state)
m_system_status &= ~(1<<5);
else
{
@ -416,7 +408,7 @@ WRITE8_MEMBER(pcw_state::pcw_vdu_video_control_register_w)
WRITE8_MEMBER(pcw_state::pcw_system_control_w)
{
device_t *fdc = machine().device("upd765");
upd765a_device *fdc = machine().device<upd765a_device>("upd765");
device_t *speaker = machine().device(BEEPER_TAG);
LOG(("SYSTEM CONTROL: %d\n",data));
@ -503,14 +495,14 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w)
/* set fdc terminal count */
case 5:
{
upd765_tc_w(fdc, 1);
fdc->tc_w(true);
}
break;
/* clear fdc terminal count */
case 6:
{
upd765_tc_w(fdc, 0);
fdc->tc_w(false);
}
break;
@ -532,20 +524,26 @@ WRITE8_MEMBER(pcw_state::pcw_system_control_w)
/* disc motor on */
case 9:
{
floppy_mon_w(floppy_get_device(machine(), 0), CLEAR_LINE);
floppy_mon_w(floppy_get_device(machine(), 1), CLEAR_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1,1);
floppy_image_device *floppy;
floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
if(floppy)
floppy->mon_w(0);
floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
if(floppy)
floppy->mon_w(0);
}
break;
/* disc motor off */
case 10:
{
floppy_mon_w(floppy_get_device(machine(), 0), ASSERT_LINE);
floppy_mon_w(floppy_get_device(machine(), 1), ASSERT_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 0,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 0,1);
floppy_image_device *floppy;
floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
if(floppy)
floppy->mon_w(1);
floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
if(floppy)
floppy->mon_w(1);
}
break;
@ -632,28 +630,6 @@ WRITE8_MEMBER(pcw_state::pcw_expansion_w)
logerror("pcw expansion w: %04x %02x\n",offset+0x080, data);
}
READ8_MEMBER(pcw_state::pcw_fdc_r)
{
device_t *fdc = machine().device("upd765");
/* from Jacob Nevins docs. FDC I/O is not fully decoded */
if (offset & 1)
{
return upd765_data_r(fdc, space, 0);
}
return upd765_status_r(fdc, space, 0);
}
WRITE8_MEMBER(pcw_state::pcw_fdc_w)
{
device_t *fdc = machine().device("upd765");
/* from Jacob Nevins docs. FDC I/O is not fully decoded */
if (offset & 1)
{
upd765_data_w(fdc, space, 0,data);
}
}
static void pcw_printer_fire_pins(running_machine &machine, UINT16 pins)
{
pcw_state *state = machine.driver_data<pcw_state>();
@ -985,7 +961,7 @@ WRITE8_MEMBER(pcw_state::pcw9512_parallel_w)
static ADDRESS_MAP_START(pcw_io, AS_IO, 8, pcw_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x000, 0x07f) AM_READWRITE(pcw_fdc_r, pcw_fdc_w)
AM_RANGE(0x000, 0x07f) AM_MIRROR(0xfe) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0x080, 0x0ef) AM_READWRITE(pcw_expansion_r, pcw_expansion_w)
AM_RANGE(0x0f0, 0x0f3) AM_WRITE( pcw_bank_select_w)
AM_RANGE(0x0f4, 0x0f4) AM_READWRITE(pcw_interrupt_counter_r, pcw_bank_force_selection_w)
@ -1001,7 +977,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(pcw9512_io, AS_IO, 8, pcw_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x000, 0x07f) AM_READWRITE(pcw_fdc_r, pcw_fdc_w)
AM_RANGE(0x000, 0x07f) AM_MIRROR(0xfe) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0x080, 0x0ef) AM_READWRITE(pcw_expansion_r, pcw_expansion_w)
AM_RANGE(0x0f0, 0x0f3) AM_WRITE( pcw_bank_select_w)
AM_RANGE(0x0f4, 0x0f4) AM_READWRITE(pcw_interrupt_counter_r, pcw_bank_force_selection_w)
@ -1290,19 +1266,15 @@ static INPUT_PORTS_START(pcw)
PORT_BIT( 0xff, 0x00, IPT_UNUSED)
INPUT_PORTS_END
static const floppy_interface pcw_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_5_25",
static const floppy_format_type pcw_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pcw_floppies )
SLOT_INTERFACE( "3dsdd", FLOPPY_3_DSDD )
SLOT_INTERFACE_END
/* PCW8256, PCW8512, PCW9256 */
static MACHINE_CONFIG_START( pcw, pcw_state )
/* basic machine hardware */
@ -1336,9 +1308,11 @@ static MACHINE_CONFIG_START( pcw, pcw_state )
MCFG_SOUND_ADD(BEEPER_TAG, BEEP, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
MCFG_UPD765A_ADD("upd765", pcw_upd765_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", pcw_floppies, "3dsdd", 0, pcw_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", pcw_floppies, "3dsdd", 0, pcw_floppy_formats)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pcw_floppy_interface)
MCFG_SOFTWARE_LIST_ADD("disk_list","pcw")
/* internal ram */

View File

@ -95,13 +95,14 @@ TODO:
/* Components */
#include "machine/pc_lpt.h" /* PC-Parallel Port */
#include "machine/pckeybrd.h" /* PC-AT keyboard */
#include "machine/pc_fdc.h" /* change to superio later */
#include "machine/upd765.h" /* FDC superio */
#include "machine/ins8250.h" /* pc com port */
#include "sound/beep.h" /* pcw/pcw16 beeper */
#include "machine/intelfsh.h"
/* Devices */
#include "formats/pc_dsk.h" /* pc disk images */
#include "formats/pc_dsk.h"
#include "formats/mfi_dsk.h"
#include "imagedev/flopdrv.h"
#include "machine/ram.h"
@ -742,14 +743,13 @@ WRITE8_MEMBER(pcw16_state::rtc_year_w)
}
static void pcw16_trigger_fdc_int(running_machine &machine)
void pcw16_state::trigger_fdc_int()
{
pcw16_state *drvstate = machine.driver_data<pcw16_state>();
int state;
state = drvstate->m_system_status & (1<<6);
state = m_system_status & (1<<6);
switch (drvstate->m_fdc_int_code)
switch (m_fdc_int_code)
{
/* nmi */
case 0:
@ -760,13 +760,13 @@ static void pcw16_trigger_fdc_int(running_machine &machine)
is cleared this will not cause another nmi */
/* I'll emulate it like this to be sure */
if (state!=drvstate->m_previous_fdc_int_state)
if (state!=m_previous_fdc_int_state)
{
if (state)
{
/* I'll pulse it because if I used hold-line I'm not sure
it would clear - to be checked */
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
}
}
@ -775,7 +775,7 @@ static void pcw16_trigger_fdc_int(running_machine &machine)
/* attach fdc to int */
case 1:
{
drvstate->pcw16_refresh_ints();
pcw16_refresh_ints();
}
break;
@ -784,7 +784,7 @@ static void pcw16_trigger_fdc_int(running_machine &machine)
break;
}
drvstate->m_previous_fdc_int_state = state;
m_previous_fdc_int_state = state;
}
READ8_MEMBER(pcw16_state::pcw16_system_status_r)
@ -854,14 +854,14 @@ WRITE8_MEMBER(pcw16_state::pcw16_system_control_w)
/* set terminal count */
case 0x05:
{
pc_fdc_set_tc_state(machine(), 1);
machine().device<pc_fdc_superio_device>("fdc")->tc_w(true);
}
break;
/* clear terminal count */
case 0x06:
{
pc_fdc_set_tc_state(machine(), 0);
machine().device<pc_fdc_superio_device>("fdc")->tc_w(false);
}
break;
@ -907,71 +907,18 @@ WRITE8_MEMBER(pcw16_state::pcw16_system_control_w)
}
}
/**** SUPER I/O connections */
/* write to Super I/O chip. FDC Data Rate. */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_datarate_w)
void pcw16_state::fdc_interrupt(bool state)
{
pc_fdc_w(space, PC_FDC_DATA_RATE_REGISTER,data);
}
/* write to Super I/O chip. FDC Digital output register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_output_register_w)
{
pc_fdc_w(space, PC_FDC_DIGITAL_OUTPUT_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_data_w)
{
pc_fdc_w(space, PC_FDC_DATA_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_data_r)
{
return pc_fdc_r(space, PC_FDC_DATA_REGISTER);
}
/* write to Super I/O chip. FDC Main Status Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_main_status_register_r)
{
return pc_fdc_r(space, PC_FDC_MAIN_STATUS_REGISTER);
}
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_input_register_r)
{
return pc_fdc_r(space, PC_FDC_DIGITIAL_INPUT_REGISTER);
}
static void pcw16_fdc_interrupt(running_machine &machine, int state)
{
pcw16_state *drvstate = machine.driver_data<pcw16_state>();
/* IRQ6 */
/* bit 6 of PCW16 system status indicates floppy ints */
drvstate->m_system_status &= ~(1<<6);
if (state)
{
drvstate->m_system_status |= (1<<6);
}
m_system_status |= (1<<6);
else
m_system_status &= ~(1<<6);
pcw16_trigger_fdc_int(machine);
trigger_fdc_int();
}
static device_t * pcw16_get_device(running_machine &machine)
{
return machine.device("upd765");
}
static const struct pc_fdc_interface pcw16_fdc_interface=
{
pcw16_fdc_interrupt,
NULL,
NULL,
pcw16_get_device
};
WRITE_LINE_MEMBER(pcw16_state::pcw16_com_interrupt_1)
{
@ -1024,15 +971,21 @@ static const ins8250_interface pcw16_com_interface[2]=
}
};
static const floppy_format_type pcw16_floppy_formats[] = {
FLOPPY_PC_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pcw16_floppies )
SLOT_INTERFACE( "35hd", FLOPPY_35_HD )
SLOT_INTERFACE_END
static ADDRESS_MAP_START(pcw16_io, AS_IO, 8, pcw16_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
/* super i/o chip */
AM_RANGE(0x01a, 0x01a) AM_WRITE(pcw16_superio_fdc_digital_output_register_w)
AM_RANGE(0x01c, 0x01c) AM_READ(pcw16_superio_fdc_main_status_register_r)
AM_RANGE(0x01d, 0x01d) AM_READWRITE(pcw16_superio_fdc_data_r, pcw16_superio_fdc_data_w)
AM_RANGE(0x01f, 0x01f) AM_READWRITE(pcw16_superio_fdc_digital_input_register_r, pcw16_superio_fdc_datarate_w)
AM_RANGE(0x018, 0x01f) AM_DEVICE("fdc", pc_fdc_superio_device, map)
AM_RANGE(0x020, 0x027) AM_DEVREADWRITE("ns16550_1", ns16550_device, ins8250_r, ins8250_w)
AM_RANGE(0x028, 0x02f) AM_DEVREADWRITE("ns16550_2", ns16550_device, ins8250_r, ins8250_w)
AM_RANGE(0x038, 0x03a) AM_DEVREADWRITE_LEGACY("lpt", pc_lpt_r, pc_lpt_w)
@ -1058,7 +1011,7 @@ void pcw16_state::machine_reset()
/* initialise defaults */
m_fdc_int_code = 2;
/* clear terminal count */
pc_fdc_set_tc_state(machine(), 0);
machine().device<pc_fdc_superio_device>("fdc")->tc_w(false);
/* select first rom page */
m_banks[0] = 0;
// pcw16_update_memory(machine);
@ -1084,7 +1037,8 @@ void pcw16_state::machine_start()
m_system_status = 0;
m_interrupt_counter = 0;
pc_fdc_init(machine(), &pcw16_fdc_interface);
machine().device<pc_fdc_superio_device>("fdc")
->setup_intrq_cb(pc_fdc_superio_device::line_cb(FUNC(pcw16_state::fdc_interrupt), this));
/* initialise keyboard */
at_keyboard_init(machine(), AT_KEYBOARD_TYPE_AT);
@ -1112,19 +1066,6 @@ static const pc_lpt_interface pcw16_lpt_config =
DEVCB_CPU_INPUT_LINE("maincpu", 0)
};
static const floppy_interface pcw16_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
NULL,
NULL
};
static MACHINE_CONFIG_START( pcw16, pcw16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, 16000000)
@ -1155,8 +1096,9 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state )
/* printer */
MCFG_PC_LPT_ADD("lpt", pcw16_lpt_config)
MCFG_UPD765A_ADD("upd765", pc_fdc_upd765_connected_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pcw16_floppy_interface)
MCFG_PC_FDC_SUPERIO_ADD("fdc")
MCFG_FLOPPY_DRIVE_ADD("fdc:0", pcw16_floppies, "35hd", 0, pcw16_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", pcw16_floppies, "35hd", 0, pcw16_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -26,6 +26,7 @@
#include "machine/ram.h"
#include "machine/ctronics.h"
#include "machine/upd765.h"
#include "formats/mfi_dsk.h"
#include "includes/prof180x.h"
UINT32 prof180x_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@ -170,10 +171,11 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( prof180x_io , AS_IO, 8, prof180x_state )
AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) AM_WRITE(flr_w)
AM_RANGE(0x09, 0x09) AM_MASK(0xff00) AM_READ(status_r)
AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(FDC9268_TAG, upd765_dack_r, upd765_dack_w)
// Seriously?
// AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(FDC9268_TAG, upd765_dack_r, upd765_dack_w)
AM_RANGE(0x0b, 0x0b) AM_MIRROR(0xff00) AM_DEVWRITE(CENTRONICS_TAG, centronics_device, write)
AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_DEVREAD_LEGACY(FDC9268_TAG, upd765_status_r)
AM_RANGE(0x0d, 0x0d) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(FDC9268_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0x0c, 0x0d) AM_MIRROR(0xff00) AM_DEVICE(FDC9268_TAG, upd765a_device, map)
ADDRESS_MAP_END
/* Input ports */
@ -183,28 +185,15 @@ INPUT_PORTS_END
/* Video */
static const struct upd765_interface fdc_intf =
{
DEVCB_NULL,
DEVCB_NULL, // DEVCB_CPU_INPUT_LINE(HD64180_TAG, INPUT_LINE_DREQ1)
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
static const floppy_interface prof180x_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type prof180x_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( prof180x_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/*
static RTC8583_INTERFCE( rtc_intf )
{
@ -247,8 +236,12 @@ static MACHINE_CONFIG_START( prof180x, prof180x_state )
MCFG_PALETTE_INIT(black_and_white)
/* devices */
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(prof180x_floppy_interface)
MCFG_UPD765A_ADD(FDC9268_TAG, fdc_intf)
MCFG_UPD765A_ADD(FDC9268_TAG, false, true)
MCFG_FLOPPY_DRIVE_ADD(FDC9268_TAG ":0", prof180x_floppies, "525hd", 0, prof180x_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FDC9268_TAG ":1", prof180x_floppies, "525hd", 0, prof180x_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FDC9268_TAG ":2", prof180x_floppies, "525hd", 0, prof180x_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(FDC9268_TAG ":3", prof180x_floppies, "525hd", 0, prof180x_floppy_formats)
//MCFG_RTC8583_ADD(MK3835_TAG, rtc_intf)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)

View File

@ -23,7 +23,7 @@
*/
#include "includes/prof80.h"
#include "formats/mfi_dsk.h"
//**************************************************************************
@ -101,10 +101,10 @@ void prof80_state::bankswitch()
void prof80_state::floppy_motor_off()
{
floppy_mon_w(m_floppy0, 1);
floppy_mon_w(m_floppy1, 1);
floppy_drive_set_ready_state(m_floppy0, 0, 1);
floppy_drive_set_ready_state(m_floppy1, 0, 1);
if(m_floppy0)
m_floppy0->mon_w(true);
if(m_floppy1)
m_floppy1->mon_w(true);
m_motor = 0;
}
@ -135,7 +135,7 @@ void prof80_state::ls259_w(int fa, int sa, int fb, int sb)
break;
case 3: // READY
upd765_ready_w(m_fdc, fa);
m_fdc->ready_w(fa);
break;
case 4: // TCK
@ -157,10 +157,10 @@ void prof80_state::ls259_w(int fa, int sa, int fb, int sb)
else
{
// turn on floppy motor
floppy_mon_w(m_floppy0, 0);
floppy_mon_w(m_floppy1, 0);
floppy_drive_set_ready_state(m_floppy0, 1, 1);
floppy_drive_set_ready_state(m_floppy1, 1, 1);
if(m_floppy0)
m_floppy0->mon_w(false);
if(m_floppy1)
m_floppy1->mon_w(false);
m_motor = 1;
@ -176,7 +176,7 @@ void prof80_state::ls259_w(int fa, int sa, int fb, int sb)
switch (sb)
{
case 0: // RESF
if (fb) upd765_reset(m_fdc, 0);
if (fb) m_fdc->reset();
break;
case 1: // MINI
@ -272,7 +272,11 @@ READ8_MEMBER( prof80_state::status_r )
data |= 0x10;
// floppy index
data |= (m_fdc_index << 5);
if(m_floppy0)
data |= m_floppy0->idx_r() << 5;
if(m_floppy1)
data |= m_floppy1->idx_r() << 5;
return data;
}
@ -404,8 +408,7 @@ static ADDRESS_MAP_START( prof80_io, AS_IO, 8, prof80_state )
AM_RANGE(0xd8, 0xd8) AM_MIRROR(0xff00) AM_WRITE(flr_w)
AM_RANGE(0xda, 0xda) AM_MIRROR(0xff00) AM_READ(status_r)
AM_RANGE(0xdb, 0xdb) AM_MIRROR(0xff00) AM_READ(status2_r)
AM_RANGE(0xdc, 0xdc) AM_MIRROR(0xff00) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
AM_RANGE(0xdd, 0xdd) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0xdc, 0xdd) AM_MIRROR(0xff00) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0xde, 0xde) AM_MIRROR(0xff01) AM_MASK(0xff00) AM_WRITE(par_w)
ADDRESS_MAP_END
@ -504,32 +507,14 @@ static UPD1990A_INTERFACE( rtc_intf )
// upd765_interface fdc_intf
//-------------------------------------------------
WRITE_LINE_MEMBER( prof80_state::floppy_index_w )
{
m_fdc_index = state;
}
static const floppy_interface floppy_intf =
{
DEVCB_DRIVER_LINE_MEMBER(prof80_state, floppy_index_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type prof80_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static const struct upd765_interface fdc_intf =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
static SLOT_INTERFACE_START( prof80_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
//-------------------------------------------------
@ -637,8 +622,9 @@ static MACHINE_CONFIG_START( prof80, prof80_state )
// devices
MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, rtc_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
MCFG_UPD765A_ADD(UPD765_TAG, false, true)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", prof80_floppies, "525hd", 0, prof80_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", prof80_floppies, "525hd", 0, prof80_floppy_formats)
// ECB bus
MCFG_ECBBUS_ADD(Z80_TAG, ecb_intf)

View File

@ -37,7 +37,8 @@
#include "video/mc6845.h"
#include "sound/speaker.h"
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/pyldin_dsk.h"
#include "machine/upd765.h"
#include "machine/ram.h"
@ -77,7 +78,7 @@ public:
DECLARE_READ8_MEMBER(floppy_r);
UINT8 selectedline(UINT16 data);
required_device<device_t> m_speaker;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<ram_device> m_ram;
DECLARE_DRIVER_INIT(pyl601);
virtual void machine_reset();
@ -213,16 +214,6 @@ WRITE8_MEMBER(pyl601_state::led_w)
// UINT8 caps_led = BIT(data,4);
}
INLINE device_t *get_floppy_image(running_machine &machine, int drive)
{
return floppy_get_device(machine, drive);
}
static UPD765_GET_IMAGE( pyldin_upd765_get_image )
{
return get_floppy_image(device->machine(), (floppy_index & 1)^1);
}
WRITE8_MEMBER(pyl601_state::floppy_w)
{
// bit 0 is reset (if zero)
@ -232,13 +223,13 @@ WRITE8_MEMBER(pyl601_state::floppy_w)
if (BIT(data,0)==0)
//reset
upd765_reset(m_fdc, 0);
m_fdc->reset();
floppy_mon_w(get_floppy_image(machine(), BIT(data,2)), !BIT(data, 3));
floppy_image_device *floppy = machine().device<floppy_connector>(BIT(data,2) ? "upd765:1" : "upd765:0")->get_device();
if(floppy)
floppy->mon_w(!BIT(data, 3));
floppy_drive_set_ready_state(get_floppy_image(machine(), 0), BIT(data,2), 0);
upd765_tc_w(m_fdc, BIT(data, 1));
m_fdc->tc_w(BIT(data, 1));
m_floppy_ctrl = data;
}
@ -248,15 +239,6 @@ READ8_MEMBER(pyl601_state::floppy_r)
return m_floppy_ctrl;
}
static const struct upd765_interface pyldin_upd765_interface =
{
DEVCB_NULL, /* interrupt */
DEVCB_NULL, /* DMA request */
pyldin_upd765_get_image, /* image lookup */
UPD765_RDY_PIN_CONNECTED, /* ready pin */
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
static ADDRESS_MAP_START(pyl601_mem, AS_PROGRAM, 8, pyl601_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x0000, 0xbfff ) AM_RAMBANK("bank1")
@ -275,8 +257,7 @@ static ADDRESS_MAP_START(pyl601_mem, AS_PROGRAM, 8, pyl601_state )
AM_RANGE( 0xe682, 0xe682 ) AM_WRITE(vdisk_l_w)
AM_RANGE( 0xe683, 0xe683 ) AM_READWRITE(vdisk_data_r,vdisk_data_w)
AM_RANGE( 0xe6c0, 0xe6c0 ) AM_READWRITE(floppy_r, floppy_w)
AM_RANGE( 0xe6d0, 0xe6d0 ) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE( 0xe6d1, 0xe6d1 ) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE( 0xe6d0, 0xe6d1 ) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE( 0xe6f0, 0xe6f0 ) AM_READWRITE(rom_page_r, rom_page_w)
AM_RANGE( 0xe700, 0xefff ) AM_RAMBANK("bank4")
AM_RANGE( 0xf000, 0xffff ) AM_READ_BANK("bank5") AM_WRITE_BANK("bank6")
@ -522,28 +503,16 @@ INTERRUPT_GEN_MEMBER(pyl601_state::pyl601_interrupt)
device.execute().set_input_line(0, HOLD_LINE);
}
static LEGACY_FLOPPY_OPTIONS_START(pyldin)
LEGACY_FLOPPY_OPTION(pyldin, "img", "Pyldin disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([80])
SECTORS([9])
SECTOR_LENGTH([512])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface pyldin_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(pyldin),
NULL,
static const floppy_format_type pyl601_floppy_formats[] = {
FLOPPY_PYLDIN_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( pyl601_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/* F4 Character Displayer */
static const gfx_layout pyl601_charlayout =
{
@ -604,8 +573,9 @@ static MACHINE_CONFIG_START( pyl601, pyl601_state )
/* Devices */
MCFG_MC6845_ADD("crtc", MC6845, XTAL_2MHz, pyl601_crtc6845_interface)
MCFG_UPD765A_ADD("upd765", pyldin_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(pyldin_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", pyl601_floppies, "525hd", 0, pyl601_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", pyl601_floppies, "525hd", 0, pyl601_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -41,6 +41,7 @@
#include "video/upd7220.h"
#include "machine/upd765.h"
#include "machine/ram.h"
#include "formats/mfi_dsk.h"
#define MAIN_CLK 15974400
@ -75,7 +76,7 @@ public:
required_device<i8255_device> m_ppi;
required_device<i8237_device> m_dma_1;
required_device<i8237_device> m_dma_2;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<upd7220_device> m_hgdc;
required_device<mc146818_device> m_rtc;
UINT8 m_vram_bank;
@ -91,8 +92,10 @@ public:
DECLARE_WRITE8_MEMBER( qx10_18_w );
DECLARE_WRITE8_MEMBER( prom_sel_w );
DECLARE_WRITE8_MEMBER( cmos_sel_w );
DECLARE_WRITE_LINE_MEMBER( qx10_upd765_interrupt );
DECLARE_WRITE_LINE_MEMBER( drq_w );
void qx10_upd765_interrupt(bool state);
void drq_w(bool state);
DECLARE_READ8_MEMBER( fdc_dma_r );
DECLARE_WRITE8_MEMBER( fdc_dma_w );
DECLARE_WRITE8_MEMBER( fdd_motor_w );
DECLARE_READ8_MEMBER( qx10_30_r );
DECLARE_READ8_MEMBER( gdc_dack_r );
@ -267,6 +270,17 @@ void qx10_state::update_memory_mapping()
}
}
READ8_MEMBER( qx10_state::fdc_dma_r )
{
return m_fdc->dma_r();
}
WRITE8_MEMBER( qx10_state::fdc_dma_w )
{
m_fdc->dma_w(data);
}
WRITE8_MEMBER( qx10_state::qx10_18_w )
{
m_membank = (data >> 4) & 0x0f;
@ -289,63 +303,49 @@ WRITE8_MEMBER( qx10_state::cmos_sel_w )
FDD
*/
static const floppy_interface qx10_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type qx10_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
WRITE_LINE_MEMBER( qx10_state::qx10_upd765_interrupt )
static SLOT_INTERFACE_START( qx10_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
void qx10_state::qx10_upd765_interrupt(bool state)
{
m_fdcint = state;
//logerror("Interrupt from upd765: %d\n", state);
// signal interrupt
pic8259_ir6_w(m_pic_m, state);
};
}
WRITE_LINE_MEMBER( qx10_state::drq_w )
void qx10_state::drq_w(bool state)
{
i8237_dreq0_w(m_dma_1, !state);
}
static const struct upd765_interface qx10_upd765_interface =
{
DEVCB_DRIVER_LINE_MEMBER(qx10_state, qx10_upd765_interrupt),
DEVCB_DRIVER_LINE_MEMBER(qx10_state, drq_w),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
WRITE8_MEMBER( qx10_state::fdd_motor_w )
{
m_fdcmotor = 1;
floppy_mon_w(floppy_get_device(machine(), 0), CLEAR_LINE);
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1,1);
machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(false);
// motor off controlled by clock
};
}
READ8_MEMBER( qx10_state::qx10_30_r )
{
floppy_image_legacy *floppy1,*floppy2;
floppy_image_device *floppy1,*floppy2;
floppy1 = flopimg_get_image(floppy_get_device(machine(), 0));
floppy2 = flopimg_get_image(floppy_get_device(machine(), 1));
floppy1 = machine().device<floppy_connector>("upd765:0")->get_device();
floppy2 = machine().device<floppy_connector>("upd765:1")->get_device();
return m_fdcint |
/*m_fdcmotor*/ 0 << 1 |
((floppy1 != NULL) || (floppy2 != NULL) ? 1 : 0) << 3 |
m_membank << 4;
};
}
/*
DMA8237
@ -371,7 +371,7 @@ WRITE8_MEMBER( qx10_state::gdc_dack_w )
WRITE_LINE_MEMBER( qx10_state::tc_w )
{
/* floppy terminal count */
upd765_tc_w(m_fdc, !state);
m_fdc->tc_w(!state);
}
/*
@ -389,8 +389,8 @@ static I8237_INTERFACE( qx10_dma8237_1_interface )
DEVCB_DRIVER_LINE_MEMBER(qx10_state, tc_w),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
{ DEVCB_DEVICE_HANDLER("upd765", upd765_dack_r), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_r),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_r)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DEVICE_HANDLER("upd765", upd765_dack_w), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_w),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_w)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DRIVER_MEMBER(qx10_state, fdc_dma_r), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_r),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_r)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_DRIVER_MEMBER(qx10_state, fdc_dma_w), DEVCB_DRIVER_MEMBER(qx10_state, gdc_dack_w),/*DEVCB_DEVICE_HANDLER("upd7220", upd7220_dack_w)*/ DEVCB_NULL, DEVCB_NULL },
{ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL }
};
@ -431,17 +431,17 @@ static I8255_INTERFACE(qx10_i8255_interface)
READ8_MEMBER( qx10_state::mc146818_data_r )
{
return m_rtc->read(space, m_mc146818_offset);
};
}
WRITE8_MEMBER( qx10_state::mc146818_data_w )
{
m_rtc->write(space, m_mc146818_offset, data);
};
}
WRITE8_MEMBER( qx10_state::mc146818_offset_w )
{
m_mc146818_offset = data;
};
}
/*
UPD7201
@ -675,8 +675,7 @@ static ADDRESS_MAP_START( qx10_io , AS_IO, 8, qx10_state)
AM_RANGE(0x2c, 0x2c) AM_READ_PORT("CONFIG")
AM_RANGE(0x2d, 0x2d) AM_READWRITE(vram_bank_r,vram_bank_w)
AM_RANGE(0x30, 0x33) AM_READWRITE(qx10_30_r, fdd_motor_w)
AM_RANGE(0x34, 0x34) AM_DEVREAD_LEGACY("upd765", upd765_status_r)
AM_RANGE(0x35, 0x35) AM_DEVREADWRITE_LEGACY("upd765", upd765_data_r, upd765_data_w)
AM_RANGE(0x34, 0x35) AM_DEVICE("upd765", upd765a_device, map)
AM_RANGE(0x38, 0x39) AM_DEVREADWRITE("upd7220", upd7220_device, read, write)
// AM_RANGE(0x3a, 0x3a) GDC zoom
// AM_RANGE(0x3b, 0x3b) GDC light pen req
@ -903,6 +902,8 @@ INPUT_PORTS_END
void qx10_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(qx10_state::qx10_upd765_interrupt), this));
m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(qx10_state::drq_w), this));
}
void qx10_state::machine_reset()
@ -1034,8 +1035,9 @@ static MACHINE_CONFIG_START( qx10, qx10_state )
MCFG_I8237_ADD("8237dma_2", MAIN_CLK/4, qx10_dma8237_2_interface)
MCFG_UPD7220_ADD("upd7220", MAIN_CLK/4, hgdc_intf, upd7220_map)
MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )
MCFG_UPD765A_ADD("upd765", qx10_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(qx10_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", qx10_floppies, "525hd", 0, qx10_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", qx10_floppies, "525hd", 0, qx10_floppy_formats)
/* internal ram */
MCFG_RAM_ADD(RAM_TAG)

View File

@ -31,7 +31,7 @@
*/
#include "includes/sage2.h"
#include "formats/mfi_dsk.h"
//**************************************************************************
@ -90,8 +90,7 @@ static ADDRESS_MAP_START( sage2_mem, AS_PROGRAM, 16, sage2_state )
AM_RANGE(0xffc030, 0xffc031) AM_DEVREADWRITE8(I8251_1_TAG, i8251_device, data_r, data_w, 0x00ff)
AM_RANGE(0xffc032, 0xffc033) AM_DEVREADWRITE8(I8251_1_TAG, i8251_device, status_r, control_w, 0x00ff)
AM_RANGE(0xffc040, 0xffc043) AM_DEVREADWRITE8_LEGACY(I8259_TAG, pic8259_r, pic8259_w, 0x00ff)
AM_RANGE(0xffc050, 0xffc051) AM_DEVREAD8_LEGACY(UPD765_TAG, upd765_status_r, 0x00ff)
AM_RANGE(0xffc052, 0xffc053) AM_DEVREADWRITE8_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w, 0x00ff)
AM_RANGE(0xffc050, 0xffc053) AM_DEVICE8(UPD765_TAG, upd765a_device, map, 0x00ff)
AM_RANGE(0xffc060, 0xffc067) AM_DEVREADWRITE8(I8255A_0_TAG, i8255_device, read, write, 0x00ff) // i8255, Printer
AM_RANGE(0xffc070, 0xffc071) AM_DEVREAD8(I8251_0_TAG, i8251_device, data_r, 0x00ff) AM_DEVWRITE8(TERMINAL_TAG, generic_terminal_device, write, 0x00ff)
// AM_RANGE(0xffc070, 0xffc071) AM_DEVREADWRITE8(I8251_0_TAG, i8251_device, data_r, data_w, 0x00ff)
@ -238,10 +237,10 @@ WRITE8_MEMBER( sage2_state::ppi0_pc_w )
*/
// floppy terminal count
upd765_tc_w(m_fdc, BIT(data, 0));
m_fdc->tc_w(BIT(data, 0));
// floppy ready
upd765_ready_w(m_fdc, BIT(data, 1));
m_fdc->ready_w(BIT(data, 1));
// floppy interrupt enable
m_fdie = BIT(data, 2);
@ -251,12 +250,20 @@ WRITE8_MEMBER( sage2_state::ppi0_pc_w )
m_sl0 = BIT(data, 3);
m_sl1 = BIT(data, 4);
if(m_sl0)
m_fdc->set_floppy(m_floppy0);
else if(m_sl1)
m_fdc->set_floppy(m_floppy1);
else
m_fdc->set_floppy(NULL);
// floppy motor
floppy_mon_w(m_floppy0, BIT(data, 5));
floppy_mon_w(m_floppy1, BIT(data, 5));
m_floppy0->mon_w(BIT(data, 5));
m_floppy1->mon_w(BIT(data, 5));
// FDC reset
upd765_reset_w(m_fdc, BIT(data, 7));
if(BIT(data, 7))
m_fdc->reset();
}
static I8255A_INTERFACE( ppi0_intf )
@ -294,7 +301,7 @@ READ8_MEMBER( sage2_state::ppi1_pb_r )
UINT8 data = 0;
// floppy interrupt
data = upd765_int_r(m_fdc);
data = m_fdc->get_irq();
// floppy write protected
if (!m_sl0) data |= floppy_wpt_r(m_floppy0) << 1;
@ -470,50 +477,31 @@ static const i8251_interface usart1_intf =
// upd765_interface fdc_intf
//-------------------------------------------------
static const floppy_interface floppy_intf =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
"floppy_5_25",
static const floppy_format_type sage2_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( sage2_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
void sage2_state::update_fdc_int()
{
m_maincpu->set_input_line(M68K_IRQ_6, m_fdie & m_fdc_int);
}
WRITE_LINE_MEMBER( sage2_state::fdc_int_w )
void sage2_state::fdc_irq(bool state)
{
m_fdc_int = state;
update_fdc_int();
}
static UPD765_GET_IMAGE( fdc_get_image )
void sage2_state::machine_start()
{
sage2_state *state = device->machine().driver_data<sage2_state>();
if (!state->m_sl0) return state->m_floppy0;
if (!state->m_sl1) return state->m_floppy1;
return NULL;
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(sage2_state::fdc_irq), this));
}
static const upd765_interface fdc_intf =
{
DEVCB_DRIVER_LINE_MEMBER(sage2_state, fdc_int_w),
DEVCB_NULL,
fdc_get_image,
UPD765_RDY_PIN_NOT_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
};
//-------------------------------------------------
// centronics_interface centronics_intf
//-------------------------------------------------
@ -606,9 +594,10 @@ static MACHINE_CONFIG_START( sage2, sage2_state )
MCFG_PIT8253_ADD(I8253_1_TAG, pit1_intf)
MCFG_I8251_ADD(I8251_0_TAG, usart0_intf)
MCFG_I8251_ADD(I8251_1_TAG, usart1_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_UPD765A_ADD(UPD765_TAG, false, false)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sage2_floppies, "525dd", 0, sage2_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", sage2_floppies, "525dd", 0, sage2_floppy_formats)
MCFG_IEEE488_BUS_ADD(ieee488_intf)
// internal ram

View File

@ -65,7 +65,7 @@ Notes:
#include "includes/sg1000.h"
#include "formats/mfi_dsk.h"
/***************************************************************************
@ -239,8 +239,7 @@ static ADDRESS_MAP_START( sf7000_io_map, AS_IO, 8, sf7000_state )
AM_RANGE(0xbe, 0xbe) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, vram_read, vram_write)
AM_RANGE(0xbf, 0xbf) AM_DEVREADWRITE(TMS9918A_TAG, tms9918a_device, register_read, register_write)
AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE(UPD9255_0_TAG, i8255_device, read, write)
AM_RANGE(0xe0, 0xe0) AM_DEVREAD_LEGACY(UPD765_TAG, upd765_status_r)
AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w)
AM_RANGE(0xe0, 0xe1) AM_DEVICE(UPD765_TAG, upd765a_device, map)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE(UPD9255_1_TAG, i8255_device, read, write)
AM_RANGE(0xe8, 0xe8) AM_DEVREADWRITE(UPD8251_TAG, i8251_device, data_r, data_w)
AM_RANGE(0xe9, 0xe9) AM_DEVREADWRITE(UPD8251_TAG, i8251_device, status_r, control_w)
@ -924,12 +923,12 @@ WRITE8_MEMBER( sf7000_state::ppi_pc_w )
floppy_drive_set_ready_state(m_floppy0, 1, 1);
/* FDC terminal count */
upd765_tc_w(m_fdc, BIT(data, 2));
m_fdc->tc_w(BIT(data, 2));
/* FDC reset */
if (BIT(data, 3))
{
upd765_reset(m_fdc, 0);
m_fdc->reset();
}
/* ROM selection */
@ -953,33 +952,11 @@ static I8255_INTERFACE( sf7000_ppi_intf )
upd765_interface sf7000_upd765_interface
-------------------------------------------------*/
WRITE_LINE_MEMBER( sf7000_state::fdc_intrq_w )
void sf7000_state::fdc_intrq_w(bool state)
{
m_fdc_irq = state;
}
static const struct upd765_interface sf7000_upd765_interface =
{
DEVCB_DRIVER_LINE_MEMBER(sf7000_state, fdc_intrq_w),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, NULL, NULL, NULL }
};
/*-------------------------------------------------
LEGACY_FLOPPY_OPTIONS( sf7000 )
-------------------------------------------------*/
static LEGACY_FLOPPY_OPTIONS_START( sf7000 )
LEGACY_FLOPPY_OPTION(sf7000, "sf7", "SF7 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([40])
SECTORS([16])
SECTOR_LENGTH([256])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
/*-------------------------------------------------
sf7000_fdc_index_callback -
-------------------------------------------------*/
@ -993,19 +970,15 @@ WRITE_LINE_MEMBER(sf7000_state::sf7000_fdc_index_callback)
floppy_interface sf7000_floppy_interface
-------------------------------------------------*/
static const floppy_interface sf7000_floppy_interface =
{
DEVCB_DRIVER_LINE_MEMBER(sf7000_state,sf7000_fdc_index_callback),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(sf7000),
"floppy_3",
static const floppy_format_type sf7000_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( sf7000_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
/*-------------------------------------------------
sn76496_config psg_intf
-------------------------------------------------*/
@ -1078,6 +1051,8 @@ void sf7000_state::machine_start()
membank("bank1")->configure_entry(1, m_ram->pointer());
membank("bank2")->configure_entry(0, m_ram->pointer());
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(sf7000_state::fdc_intrq_w), this));
/* register for state saving */
save_item(NAME(m_keylatch));
save_item(NAME(m_fdc_irq));
@ -1218,8 +1193,8 @@ static MACHINE_CONFIG_START( sf7000, sf7000_state )
MCFG_I8255_ADD(UPD9255_0_TAG, sc3000_ppi_intf)
MCFG_I8255_ADD(UPD9255_1_TAG, sf7000_ppi_intf)
MCFG_I8251_ADD(UPD8251_TAG, default_i8251_interface)
MCFG_UPD765A_ADD(UPD765_TAG, sf7000_upd765_interface)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, sf7000_floppy_interface)
MCFG_UPD765A_ADD(UPD765_TAG, true, true)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sf7000_floppies, "525hd", 0, sf7000_floppy_formats)
// MCFG_PRINTER_ADD("sp400") /* serial printer */
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
MCFG_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_interface)

View File

@ -96,7 +96,7 @@ xx/xx/2001 KS - TS-2068 sound fixed.
causes Spectrum to reset. Fixing this problem
made much more software runing (i.e. Paperboy).
Corrected frames per second value for 48k and 128k
Sincalir machines.
Sinclair machines.
There are 50.08 frames per second for Spectrum
48k what gives 69888 cycles for each frame and
50.021 for Spectrum 128/+2/+2A/+3 what gives
@ -152,6 +152,7 @@ http://www.z88forever.org.uk/zxplus3e/
#include "sound/ay8910.h"
#include "sound/speaker.h"
#include "formats/tzx_cas.h"
#include "formats/mfi_dsk.h"
/* +3 hardware */
#include "machine/upd765.h"
@ -163,15 +164,6 @@ http://www.z88forever.org.uk/zxplus3e/
/* This driver uses some of the spectrum_128 functions. The +3 is similar to a spectrum 128
but with a disc drive */
static const upd765_interface spectrum_plus3_upd765_interface =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
static const int spectrum_plus3_memory_selections[]=
{
@ -185,7 +177,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_3ffd_w)
{
spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==1)
upd765_data_w(space.machine().device("upd765"), space, 0,data);
space.machine().device<upd765a_device>("upd765")->fifo_w(space, 0, data, 0xff);
}
static READ8_HANDLER(spectrum_plus3_port_3ffd_r)
@ -194,7 +186,7 @@ static READ8_HANDLER(spectrum_plus3_port_3ffd_r)
if (state->m_floppy==0)
return 0xff;
else
return upd765_data_r(space.machine().device("upd765"), space, 0);
return space.machine().device<upd765a_device>("upd765")->fifo_r(space, 0, 0xff);
}
@ -202,9 +194,9 @@ static READ8_HANDLER(spectrum_plus3_port_2ffd_r)
{
spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==0)
return 0xff;
return 0xff;
else
return upd765_status_r(space.machine().device("upd765"), space, 0);
return space.machine().device<upd765a_device>("upd765")->msr_r(space, 0, 0xff);
}
@ -375,19 +367,15 @@ DRIVER_INIT_MEMBER(spectrum_state,plus2)
m_floppy = 0;
}
static const floppy_interface specpls3_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_3_SSDD,
LEGACY_FLOPPY_OPTIONS_NAME(default),
NULL,
static const floppy_format_type specpls3_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( specpls3_floppies )
SLOT_INTERFACE( "3ssdd", FLOPPY_3_SSDD )
SLOT_INTERFACE_END
/* F4 Character Displayer */
static const gfx_layout spectrum_charlayout =
{
@ -415,8 +403,9 @@ static MACHINE_CONFIG_DERIVED( spectrum_plus3, spectrum_128 )
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum_plus3 )
MCFG_UPD765A_ADD("upd765", spectrum_plus3_upd765_interface)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(specpls3_floppy_interface)
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", specpls3_floppies, "3ssdd", 0, specpls3_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", specpls3_floppies, "3ssdd", 0, specpls3_floppy_formats)
MACHINE_CONFIG_END
/***************************************************************************

View File

@ -25,6 +25,7 @@
*/
#include "includes/tandy2k.h"
#include "formats/mfi_dsk.h"
enum
{
@ -118,7 +119,8 @@ WRITE8_MEMBER( tandy2k_state::enable_w )
pit8253_gate2_w(m_pit, BIT(data, 4));
// FDC reset
upd765_reset_w(m_fdc, BIT(data, 5));
if(BIT(data, 5))
m_fdc->reset();
// timer 0 enable
m_maincpu->set_input_line(INPUT_LINE_TMRIN0, BIT(data, 6));
@ -195,20 +197,18 @@ WRITE16_MEMBER( tandy2k_state::vpac_w )
}
}
READ8_MEMBER(tandy2k_state::fldtc_r)
READ8_MEMBER( tandy2k_state::fldtc_r )
{
device_t *device = machine().device("AM_RANGE(0x00004, 0x00005) AM_READWRITE8(I8272A_TAG, fldtc_r, fldtc_w, 0x00ff)");
upd765_tc_w(device, 1);
upd765_tc_w(device, 0);
m_fdc->tc_w(true);
m_fdc->tc_w(false);
return 0;
}
WRITE8_MEMBER(tandy2k_state::fldtc_w)
WRITE8_MEMBER( tandy2k_state::fldtc_w )
{
device_t *device = machine().device(I8272A_TAG);
upd765_tc_w(device, 1);
upd765_tc_w(device, 0);
m_fdc->tc_w(true);
m_fdc->tc_w(false);
}
WRITE8_MEMBER( tandy2k_state::addr_ctrl_w )
@ -273,14 +273,13 @@ static ADDRESS_MAP_START( tandy2k_io, AS_IO, 16, tandy2k_state )
AM_RANGE(0x00002, 0x00003) AM_WRITE8(dma_mux_w, 0x00ff)
AM_RANGE(0x00004, 0x00005) AM_READWRITE8(fldtc_r, fldtc_w, 0x00ff)
AM_RANGE(0x00010, 0x00013) AM_DEVREADWRITE8(I8251A_TAG, i8251_device, data_r, data_w, 0x00ff)
AM_RANGE(0x00030, 0x00031) AM_DEVREAD8_LEGACY(I8272A_TAG, upd765_status_r, 0x00ff)
AM_RANGE(0x00032, 0x00033) AM_DEVREADWRITE8_LEGACY(I8272A_TAG, upd765_data_r, upd765_data_w, 0x00ff)
AM_RANGE(0x00030, 0x00033) AM_DEVICE8(I8272A_TAG, i8272a_device, map, 0x00ff)
AM_RANGE(0x00040, 0x00047) AM_DEVREADWRITE8_LEGACY(I8253_TAG, pit8253_r, pit8253_w, 0x00ff)
AM_RANGE(0x00052, 0x00053) AM_READ8(kbint_clr_r, 0x00ff)
AM_RANGE(0x00050, 0x00057) AM_DEVREADWRITE8(I8255A_TAG, i8255_device, read, write, 0x00ff)
AM_RANGE(0x00060, 0x00063) AM_DEVREADWRITE8_LEGACY(I8259A_0_TAG, pic8259_r, pic8259_w, 0x00ff)
AM_RANGE(0x00070, 0x00073) AM_DEVREADWRITE8_LEGACY(I8259A_1_TAG, pic8259_r, pic8259_w, 0x00ff)
AM_RANGE(0x00080, 0x00081) AM_DEVREADWRITE8_LEGACY(I8272A_TAG, upd765_dack_r, upd765_dack_w, 0x00ff)
AM_RANGE(0x00080, 0x00081) AM_DEVREADWRITE8(I8272A_TAG, i8272a_device, mdma_r, mdma_w, 0x00ff)
// AM_RANGE(0x00100, 0x0017f) AM_DEVREADWRITE8(CRT9007_TAG, crt9007_device, read, write, 0x00ff) AM_WRITE8(addr_ctrl_w, 0xff00)
AM_RANGE(0x00100, 0x0017f) AM_READWRITE(vpac_r, vpac_w)
// AM_RANGE(0x00180, 0x00180) AM_READ8(hires_status_r, 0x00ff)
@ -614,20 +613,25 @@ static const floppy_interface tandy2k_floppy_interface =
// Intel 8272 Interface
WRITE_LINE_MEMBER( tandy2k_state::busdmarq0_w )
void tandy2k_state::fdc_irq(bool state)
{
pic8259_ir4_w(m_pic0, state);
}
void tandy2k_state::fdc_drq(bool state)
{
dma_request(0, state);
}
static const struct upd765_interface fdc_intf =
{
DEVCB_DEVICE_LINE(I8259A_0_TAG, pic8259_ir4_w),
DEVCB_DRIVER_LINE_MEMBER(tandy2k_state, busdmarq0_w),
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, FLOPPY_1, NULL, NULL }
static const floppy_format_type tandy2k_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( tandy2k_floppies )
SLOT_INTERFACE( "525qd", FLOPPY_525_QD )
SLOT_INTERFACE_END
// Centronics Interface
static const centronics_interface centronics_intf =
@ -678,6 +682,9 @@ void tandy2k_state::machine_start()
program.install_ram(0x00000, ram_size - 1, ram);
m_fdc->setup_intrq_cb(i8272a_device::line_cb(FUNC(tandy2k_state::fdc_irq), this));
m_fdc->setup_drq_cb(i8272a_device::line_cb(FUNC(tandy2k_state::fdc_drq), this));
// patch out i186 relocation register check
UINT8 *rom = memregion(I80186_TAG)->base();
rom[0x1f16] = 0x90;
@ -731,8 +738,9 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state )
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_PIC8259_ADD(I8259A_0_TAG, pic0_intf)
MCFG_PIC8259_ADD(I8259A_1_TAG, pic1_intf)
MCFG_UPD765A_ADD(I8272A_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tandy2k_floppy_interface)
MCFG_UPD765A_ADD(I8272A_TAG, true, true)
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", 0, tandy2k_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", 0, tandy2k_floppy_formats)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
MCFG_TANDY2K_KEYBOARD_ADD(kb_intf)

View File

@ -17,7 +17,7 @@
*/
#include "includes/wangpc.h"
#include "formats/mfi_dsk.h"
//**************************************************************************
@ -46,11 +46,17 @@ void wangpc_state::select_drive(int drive, bool select)
if (!drive)
{
m_ds1 = state;
if(state)
m_fdc->set_floppy(m_floppy0);
}
else
{
m_ds2 = state;
if(state)
m_fdc->set_floppy(m_floppy1);
}
if(!m_ds1 && !m_ds2)
m_fdc->set_floppy(NULL);
}
void wangpc_state::set_motor(int drive, bool motor)
@ -61,11 +67,11 @@ void wangpc_state::set_motor(int drive, bool motor)
if (!drive)
{
floppy_mon_w(m_floppy0, state);
m_floppy0->mon_w(state);
}
else
{
floppy_mon_w(m_floppy1, state);
m_floppy1->mon_w(state);
}
}
@ -73,16 +79,15 @@ void wangpc_state::fdc_reset()
{
if (LOG) logerror("%s: FDC reset\n", machine().describe_context());
upd765_reset_w(m_fdc, 1);
upd765_reset_w(m_fdc, 0);
m_fdc->reset();
}
void wangpc_state::fdc_tc()
{
if (LOG) logerror("%s: FDC TC\n", machine().describe_context());
upd765_tc_w(m_fdc, 1);
upd765_tc_w(m_fdc, 0);
m_fdc->tc_w(true);
m_fdc->tc_w(false);
}
WRITE8_MEMBER( wangpc_state::fdc_ctrl_w )
@ -296,7 +301,7 @@ READ8_MEMBER( wangpc_state::status_r )
UINT8 data = 0x03;
// floppy interrupts
data |= upd765_int_r(m_fdc) << 3;
data |= m_fdc->get_irq() << 3;
data |= m_fdc_dd0 << 4;
data |= m_fdc_dd1 << 5;
data |= m_floppy0->exists() ? 0 : 0x40;
@ -555,7 +560,7 @@ READ8_MEMBER( wangpc_state::option_id_r )
UINT8 data = 0;
// FDC interrupt
data |= (m_fdc_dd0 | m_fdc_dd1 | upd765_int_r(m_fdc)) << 7;
data |= (m_fdc_dd0 | m_fdc_dd1 | m_fdc->get_irq()) << 7;
return data;
}
@ -593,8 +598,7 @@ static ADDRESS_MAP_START( wangpc_io, AS_IO, 16, wangpc_state )
AM_RANGE(0x100e, 0x100f) AM_READWRITE8(motor1_on_r, motor1_on_w, 0x00ff)
AM_RANGE(0x1010, 0x1011) AM_READWRITE8(motor2_off_r, motor2_off_w, 0x00ff)
AM_RANGE(0x1012, 0x1013) AM_READWRITE8(motor2_on_r, motor2_on_w, 0x00ff)
AM_RANGE(0x1014, 0x1015) AM_DEVREAD8_LEGACY(UPD765_TAG, upd765_status_r, 0x00ff)
AM_RANGE(0x1016, 0x1017) AM_DEVREADWRITE8_LEGACY(UPD765_TAG, upd765_data_r, upd765_data_w, 0x00ff)
AM_RANGE(0x1014, 0x1017) AM_DEVICE8(UPD765_TAG, upd765a_device, map, 0x00ff)
AM_RANGE(0x1018, 0x1019) AM_MIRROR(0x0002) AM_READWRITE8(fdc_reset_r, fdc_reset_w, 0x00ff)
AM_RANGE(0x101c, 0x101d) AM_MIRROR(0x0002) AM_READWRITE8(fdc_tc_r, fdc_tc_w, 0x00ff)
AM_RANGE(0x1020, 0x1027) AM_DEVREADWRITE8(I8255A_TAG, i8255_device, read, write, 0x00ff)
@ -663,9 +667,9 @@ INPUT_PORTS_END
void wangpc_state::update_fdc_tc()
{
if (m_enable_eop)
upd765_tc_w(m_fdc, m_fdc_tc);
m_fdc->tc_w(m_fdc_tc);
else
upd765_tc_w(m_fdc, 0);
m_fdc->tc_w(false);
}
WRITE_LINE_MEMBER( wangpc_state::hrq_w )
@ -715,7 +719,7 @@ READ8_MEMBER( wangpc_state::ior2_r )
if (m_disable_dreq2)
return m_bus->dack_r(space, 2);
else
return upd765_dack_r(m_fdc, space, 0);
return m_fdc->dma_r();
}
WRITE8_MEMBER( wangpc_state::iow2_w )
@ -723,7 +727,7 @@ WRITE8_MEMBER( wangpc_state::iow2_w )
if (m_disable_dreq2)
m_bus->dack_w(space, 2, data);
else
upd765_dack_w(m_fdc, space, 0, data);
m_fdc->dma_w(data);
}
WRITE_LINE_MEMBER( wangpc_state::dack0_w )
@ -780,7 +784,7 @@ void wangpc_state::check_level1_interrupts()
void wangpc_state::check_level2_interrupts()
{
int state = !m_dma_eop || m_uart_dr || m_uart_tbre || m_fdc_dd0 || m_fdc_dd1 || upd765_int_r(m_fdc) || m_fpu_irq || m_bus_irq2;
int state = !m_dma_eop || m_uart_dr || m_uart_tbre || m_fdc_dd0 || m_fdc_dd1 || m_fdc->get_irq() || m_fpu_irq || m_bus_irq2;
pic8259_ir2_w(m_pic, state);
}
@ -868,7 +872,7 @@ READ8_MEMBER( wangpc_state::ppi_pb_r )
data |= m_uart_dr << 5;
// FDC interrupt
data |= upd765_int_r(m_fdc) << 6;
data |= m_fdc->get_irq() << 6;
// 8087 interrupt
data |= m_fpu_irq << 7;
@ -1028,27 +1032,24 @@ static MC2661_INTERFACE( epci_intf )
// upd765_interface fdc_intf
//-------------------------------------------------
static const floppy_interface floppy_intf =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(pc),
"floppy_5_25",
static const floppy_format_type wangpc_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
WRITE_LINE_MEMBER( wangpc_state::fdc_int_w )
static SLOT_INTERFACE_START( wangpc_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
void wangpc_state::fdc_irq(bool state)
{
if (LOG) logerror("FDC INT %u\n", state);
check_level2_interrupts();
}
WRITE_LINE_MEMBER( wangpc_state::fdc_drq_w )
void wangpc_state::fdc_drq(bool state)
{
if (LOG) logerror("FDC DRQ %u\n", state);
@ -1064,25 +1065,6 @@ void wangpc_state::update_fdc_drq()
m_dmac->dreq2_w(!m_fdc_drq);
}
static UPD765_GET_IMAGE( wangpc_fdc_get_image )
{
wangpc_state *state = device->machine().driver_data<wangpc_state>();
if (!state->m_ds1) return state->m_floppy0;
if (!state->m_ds2) return state->m_floppy1;
return NULL;
}
static const upd765_interface fdc_intf =
{
DEVCB_DRIVER_LINE_MEMBER(wangpc_state, fdc_int_w),
DEVCB_DRIVER_LINE_MEMBER(wangpc_state, fdc_drq_w),
wangpc_fdc_get_image,
UPD765_RDY_PIN_NOT_CONNECTED,
{ NULL, NULL, NULL, NULL }
};
//-------------------------------------------------
// centronics_interface centronics_intf
@ -1171,10 +1153,13 @@ void wangpc_state::machine_start()
m_uart->connect(m_kb);
// connect floppy callbacks
floppy_install_unload_proc(m_floppy0, wangpc_state::on_disk0_change);
floppy_install_load_proc(m_floppy0, wangpc_state::on_disk0_change);
floppy_install_unload_proc(m_floppy1, wangpc_state::on_disk1_change);
floppy_install_load_proc(m_floppy1, wangpc_state::on_disk1_change);
m_floppy0->setup_load_cb(floppy_image_device::load_cb(FUNC(wangpc_state::on_disk0_load), this));
m_floppy0->setup_unload_cb(floppy_image_device::unload_cb(FUNC(wangpc_state::on_disk0_unload), this));
m_floppy1->setup_load_cb(floppy_image_device::load_cb(FUNC(wangpc_state::on_disk1_load), this));
m_floppy1->setup_unload_cb(floppy_image_device::unload_cb(FUNC(wangpc_state::on_disk1_unload), this));
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(wangpc_state::fdc_irq), this));
m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(wangpc_state::fdc_drq), this));
// state saving
save_item(NAME(m_dma_page));
@ -1215,15 +1200,18 @@ void wangpc_state::machine_reset()
// on_disk0_change -
//-------------------------------------------------
void wangpc_state::on_disk0_change(device_image_interface &image)
int wangpc_state::on_disk0_load(floppy_image_device *image)
{
wangpc_state *state = static_cast<wangpc_state *>(image.device().owner());
on_disk0_unload(image);
return IMAGE_INIT_PASS;
}
void wangpc_state::on_disk0_unload(floppy_image_device *image)
{
if (LOG) logerror("Door 1 disturbed\n");
state->m_fdc_dd0 = 1;
state->check_level2_interrupts();
m_fdc_dd0 = 1;
check_level2_interrupts();
}
@ -1231,15 +1219,18 @@ void wangpc_state::on_disk0_change(device_image_interface &image)
// on_disk1_change -
//-------------------------------------------------
void wangpc_state::on_disk1_change(device_image_interface &image)
int wangpc_state::on_disk1_load(floppy_image_device *image)
{
wangpc_state *state = static_cast<wangpc_state *>(image.device().owner());
on_disk0_unload(image);
return IMAGE_INIT_PASS;
}
void wangpc_state::on_disk1_unload(floppy_image_device *image)
{
if (LOG) logerror("Door 2 disturbed\n");
state->m_fdc_dd1 = 1;
state->check_level2_interrupts();
m_fdc_dd1 = 1;
check_level2_interrupts();
}
@ -1264,8 +1255,9 @@ static MACHINE_CONFIG_START( wangpc, wangpc_state )
MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
MCFG_IM6402_ADD(IM6402_TAG, uart_intf)
MCFG_MC2661_ADD(SCN2661_TAG, 0, epci_intf)
MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
MCFG_UPD765A_ADD(UPD765_TAG, false, false)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", wangpc_floppies, "525dd", 0, wangpc_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", wangpc_floppies, "525dd", 0, wangpc_floppy_formats)
MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
MCFG_WANGPC_KEYBOARD_ADD()

View File

@ -55,7 +55,7 @@
RAM : between 1MB and 4MB stock, expandable to 12MB
FDD : 2x 5.25", Compact models use 2x 3.5" drives.
FDC : NEC uPD72065 (hopefully backwards compatible enough for the existing uPD765A core :))
FDC : NEC uPD72065
HDD : HD models have up to an 81MB HDD.
HDC : Fujitsu MB89352A (SCSI)
@ -76,9 +76,6 @@
*** Current status (28/12/08)
FDC/FDD : Uses the uPD765A code with a small patch to handle Sense Interrupt Status being invalid if not in seek mode
Extra uPD72065 commands not yet implemented, although I have yet to see them used.
MFP : Largely works, as far as the X68000 goes.
PPI : Joystick controls work okay.
@ -129,7 +126,8 @@
#include "machine/rp5c15.h"
#include "machine/mb89352.h"
#include "imagedev/flopdrv.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/xdf_dsk.h"
#include "formats/dim_dsk.h"
#include "machine/x68k_hdc.h"
#include "includes/x68k.h"
@ -944,15 +942,10 @@ WRITE8_MEMBER(x68k_state::ppi_port_c_w)
// NEC uPD72065 at 0xe94000
WRITE16_MEMBER(x68k_state::x68k_fdc_w)
{
device_t *fdc = machine().device("upd72065");
unsigned int drive, x;
switch(offset)
{
case 0x00:
case 0x01:
upd765_data_w(fdc, space, 0,data);
break;
case 0x02: // drive option signal control
case 0x00: // drive option signal control
x = data & 0x0f;
for(drive=0;drive<4;drive++)
{
@ -965,8 +958,8 @@ WRITE16_MEMBER(x68k_state::x68k_fdc_w)
output_set_indexed_value("eject_drv",drive,(data & 0x40) ? 1 : 0);
if(data & 0x20) // ejects disk
{
(dynamic_cast<device_image_interface *>(floppy_get_device(machine(), drive)))->unload();
floppy_mon_w(floppy_get_device(machine(), drive), ASSERT_LINE);
m_fdc.floppy[drive]->mon_w(false);
m_fdc.floppy[drive]->unload();
}
}
}
@ -974,17 +967,18 @@ WRITE16_MEMBER(x68k_state::x68k_fdc_w)
m_fdc.selected_drive = data & 0x0f;
logerror("FDC: signal control set to %02x\n",data);
break;
case 0x03:
m_fdc.media_density[data & 0x03] = data & 0x10;
case 0x01: {
static const int rates[4] = { 500000, 300000, 250000, 125000 };
m_fdc.fdc->set_rate(rates[(data >> 4) & 3]);
m_fdc.motor[data & 0x03] = data & 0x80;
floppy_mon_w(floppy_get_device(machine(), data & 0x03), !BIT(data, 7));
m_fdc.floppy[data & 0x03]->mon_w(!BIT(data, 7));
if(data & 0x80)
{
for(drive=0;drive<4;drive++) // enable motor for this drive
{
if(drive == (data & 0x03))
{
floppy_mon_w(floppy_get_device(machine(), drive), CLEAR_LINE);
m_fdc.floppy[drive]->mon_w(false);
output_set_indexed_value("access_drv",drive,0);
}
else
@ -995,28 +989,13 @@ WRITE16_MEMBER(x68k_state::x68k_fdc_w)
{
for(drive=0;drive<4;drive++)
{
floppy_mon_w(floppy_get_device(machine(), drive), ASSERT_LINE);
m_fdc.floppy[drive]->mon_w(true);
output_set_indexed_value("access_drv",drive,1);
}
}
floppy_drive_set_ready_state(floppy_get_device(machine(), 0),1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1),1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 2),1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 3),1,1);
#if 0
for(drive=0;drive<4;drive++)
{
if(floppy_drive_get_flag_state(floppy_get_device(machine, drive),FLOPPY_DRIVE_MOTOR_ON))
output_set_indexed_value("access_drv",drive,0);
else
output_set_indexed_value("access_drv",drive,1);
}
#endif
logerror("FDC: Drive #%i: Drive selection set to %02x\n",data & 0x03,data);
break;
default:
// logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",space.device().safe_pc(),data,offset);
break;
}
}
}
@ -1024,22 +1003,17 @@ READ16_MEMBER(x68k_state::x68k_fdc_r)
{
unsigned int ret;
int x;
device_t *fdc = machine().device("upd72065");
switch(offset)
{
case 0x00:
return upd765_status_r(fdc, space, 0);
case 0x01:
return upd765_data_r(fdc, space, 0);
case 0x02:
ret = 0x00;
for(x=0;x<4;x++)
{
if(m_fdc.selected_drive & (1 << x))
{
ret = 0x00;
if(m_fdc.disk_inserted[x] != 0)
if(m_fdc.floppy[x]->exists())
{
ret |= 0x80;
}
@ -1049,18 +1023,16 @@ READ16_MEMBER(x68k_state::x68k_fdc_r)
}
}
return ret;
case 0x03:
case 0x01:
logerror("FDC: IOC selection is write-only\n");
return 0xff;
default:
logerror("FDC: Read from invalid FDC port %04x\n",offset);
return 0xff;
}
return 0xff;
}
WRITE_LINE_MEMBER(x68k_state::fdc_irq)
void x68k_state::fdc_irq(bool state)
{
if((m_ioc.irqstatus & 0x04) && state == ASSERT_LINE)
if((m_ioc.irqstatus & 0x04) && state)
{
m_current_vector[1] = m_ioc.fdcvector;
m_ioc.irqstatus |= 0x80;
@ -1073,22 +1045,16 @@ WRITE_LINE_MEMBER(x68k_state::fdc_irq)
static int x68k_fdc_read_byte(running_machine &machine,int addr)
{
x68k_state *state = machine.driver_data<x68k_state>();
int data = -1;
device_t *fdc = machine.device("upd72065");
if(state->m_fdc.drq_state != 0)
data = upd765_dack_r(fdc, state->generic_space(), 0);
// logerror("FDC: DACK reading\n");
return data;
return state->m_fdc.fdc->dma_r();
}
static void x68k_fdc_write_byte(running_machine &machine,int addr, int data)
{
device_t *fdc = machine.device("upd72065");
upd765_dack_w(fdc, machine.driver_data()->generic_space(), 0, data);
x68k_state *state = machine.driver_data<x68k_state>();
return state->m_fdc.fdc->dma_w(data);
}
WRITE_LINE_MEMBER(x68k_state::fdc_drq)
void x68k_state::fdc_drq(bool state)
{
m_fdc.drq_state = state;
}
@ -1114,13 +1080,12 @@ READ16_MEMBER(x68k_state::x68k_fm_r)
WRITE8_MEMBER(x68k_state::x68k_ct_w)
{
device_t *fdc = machine().device("upd72065");
device_t *okim = machine().device("okim6258");
device_t *okim = space.machine().device("okim6258");
// CT1 and CT2 bits from YM2151 port 0x1b
// CT1 - ADPCM clock - 0 = 8MHz, 1 = 4MHz
// CT2 - 1 = Set ready state of FDC
upd765_ready_w(fdc,data & 0x01);
m_fdc.fdc->ready_w(data & 0x01);
m_adpcm.clock = data & 0x02;
x68k_set_adpcm();
okim6258_set_clock(okim, data & 0x02 ? 4000000 : 8000000);
@ -1923,7 +1888,8 @@ static ADDRESS_MAP_START(x68k_map, AS_PROGRAM, 16, x68k_state )
AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE(x68k_fm_r, x68k_fm_w)
AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8_LEGACY("okim6258", okim6258_status_r, okim6258_ctrl_w, 0x00ff)
AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8_LEGACY("okim6258", okim6258_status_r, okim6258_data_w, 0x00ff)
AM_RANGE(0xe94000, 0xe95fff) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
AM_RANGE(0xe94004, 0xe94007) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE("x68k_hdc", x68k_hdc_image_device, hdc_r, hdc_w)
AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE(x68k_scc_r, x68k_scc_w)
AM_RANGE(0xe9a000, 0xe9bfff) AM_READWRITE(x68k_ppi_r, x68k_ppi_w)
@ -1960,7 +1926,8 @@ static ADDRESS_MAP_START(x68kxvi_map, AS_PROGRAM, 16, x68k_state )
AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE(x68k_fm_r, x68k_fm_w)
AM_RANGE(0xe92000, 0xe92001) AM_DEVREADWRITE8_LEGACY("okim6258", okim6258_status_r, okim6258_ctrl_w, 0x00ff)
AM_RANGE(0xe92002, 0xe92003) AM_DEVREADWRITE8_LEGACY("okim6258", okim6258_status_r, okim6258_data_w, 0x00ff)
AM_RANGE(0xe94000, 0xe95fff) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff)
AM_RANGE(0xe94004, 0xe94007) AM_READWRITE(x68k_fdc_r, x68k_fdc_w)
// AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE_LEGACY("x68k_hdc",x68k_hdc_r, x68k_hdc_w)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff)
AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE(x68k_scc_r, x68k_scc_w)
@ -1998,7 +1965,8 @@ static ADDRESS_MAP_START(x68030_map, AS_PROGRAM, 32, x68k_state )
AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE16(x68k_sysport_r, x68k_sysport_w,0xffffffff)
AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE16(x68k_fm_r, x68k_fm_w,0xffffffff)
AM_RANGE(0xe92000, 0xe92003) AM_DEVREAD8_LEGACY("okim6258", okim6258_status_r, 0x00ff00ff) AM_WRITE8(x68030_adpcm_w, 0x00ff00ff)
AM_RANGE(0xe94000, 0xe95fff) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff)
AM_RANGE(0xe94000, 0xe94003) AM_DEVICE8("upd72065", upd72065_device, map, 0x00ff00ff)
AM_RANGE(0xe94004, 0xe94007) AM_READWRITE16(x68k_fdc_r, x68k_fdc_w,0xffffffff)
// AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE16_LEGACY("x68k_hdc",x68k_hdc_r, x68k_hdc_w,0xffffffff)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
AM_RANGE(0xe98000, 0xe99fff) AM_READWRITE16(x68k_scc_r, x68k_scc_w,0xffffffff)
@ -2065,15 +2033,6 @@ static const hd63450_intf dmac_interface =
// { 0, 0, 0, 0 }
};
static const upd765_interface fdc_interface =
{
DEVCB_DRIVER_LINE_MEMBER(x68k_state,fdc_irq),
DEVCB_DRIVER_LINE_MEMBER(x68k_state,fdc_drq),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1,FLOPPY_2,FLOPPY_3}
};
static const ym2151_interface x68k_ym2151_interface =
{
DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_fm_irq),
@ -2400,31 +2359,27 @@ static INPUT_PORTS_START( x68000 )
INPUT_PORTS_END
static void x68k_load_proc(device_image_interface &image)
void x68k_state::floppy_load_unload()
{
x68k_state *state = image.device().machine().driver_data<x68k_state>();
if(state->m_ioc.irqstatus & 0x02)
if(m_ioc.irqstatus & 0x02)
{
state->m_current_vector[1] = 0x61;
state->m_ioc.irqstatus |= 0x40;
state->m_current_irq_line = 1;
image.device().machine().device("maincpu")->execute().set_input_line_and_vector(1,ASSERT_LINE,state->m_current_vector[1]); // Disk insert/eject interrupt
m_current_vector[1] = 0x61;
m_ioc.irqstatus |= 0x40;
m_current_irq_line = 1;
machine().device("maincpu")->execute().set_input_line_and_vector(1,ASSERT_LINE,m_current_vector[1]); // Disk insert/eject interrupt
logerror("IOC: Disk image inserted\n");
}
state->m_fdc.disk_inserted[floppy_get_drive(&image.device())] = 1;
}
static void x68k_unload_proc(device_image_interface &image)
int x68k_state::floppy_load(floppy_image_device *dev)
{
x68k_state *state = image.device().machine().driver_data<x68k_state>();
if(state->m_ioc.irqstatus & 0x02)
{
state->m_current_vector[1] = 0x61;
state->m_ioc.irqstatus |= 0x40;
state->m_current_irq_line = 1;
image.device().machine().device("maincpu")->execute().set_input_line_and_vector(1,ASSERT_LINE,state->m_current_vector[1]); // Disk insert/eject interrupt
}
state->m_fdc.disk_inserted[floppy_get_drive(&image.device())] = 0;
floppy_load_unload();
return IMAGE_INIT_PASS;
}
void x68k_state::floppy_unload(floppy_image_device *dev)
{
floppy_load_unload();
}
TIMER_CALLBACK_MEMBER(x68k_state::x68k_net_irq)
@ -2447,30 +2402,6 @@ WRITE_LINE_MEMBER(x68k_state::x68k_irq2_line)
}
static LEGACY_FLOPPY_OPTIONS_START( x68k )
LEGACY_FLOPPY_OPTION( img2d, "xdf,hdm,2hd", "XDF disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([77])
SECTORS([8])
SECTOR_LENGTH([1024])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTION( dim, "dim", "DIM floppy disk image", dim_dsk_identify, dim_dsk_construct, NULL, NULL)
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface x68k_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(x68k),
"floppy_5_25",
NULL
};
static const mb89352_interface x68k_scsi_intf =
{
DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_scsi_irq),
@ -2507,16 +2438,6 @@ MACHINE_RESET_MEMBER(x68k_state,x68000)
m_keyboard.delay = 500; // 3*100+200
m_keyboard.repeat = 110; // 4^2*5+30
// check for disks
for(drive=0;drive<4;drive++)
{
device_image_interface *image = dynamic_cast<device_image_interface *>(floppy_get_device(machine(), drive));
if(image->exists())
m_fdc.disk_inserted[drive] = 1;
else
m_fdc.disk_inserted[drive] = 0;
}
// initialise CRTC, set registers to defaults for the standard text mode (768x512)
m_crtc.reg[0] = 137; // Horizontal total (in characters)
m_crtc.reg[1] = 14; // Horizontal sync end
@ -2555,8 +2476,6 @@ MACHINE_RESET_MEMBER(x68k_state,x68000)
output_set_indexed_value("eject_drv",drive,1);
output_set_indexed_value("ctrl_drv",drive,1);
output_set_indexed_value("access_drv",drive,1);
floppy_install_unload_proc(floppy_get_device(machine(), drive), x68k_unload_proc);
floppy_install_load_proc(floppy_get_device(machine(), drive), x68k_load_proc);
}
// reset CPU
@ -2591,6 +2510,23 @@ MACHINE_START_MEMBER(x68k_state,x68000)
// start LED timer
m_led_timer->adjust(attotime::zero, 0, attotime::from_msec(400));
// check for disks
m_fdc.fdc = machine().device<upd72065_device>("upd72065");
m_fdc.fdc->setup_intrq_cb(upd72065_device::line_cb(FUNC(x68k_state::fdc_irq), this));
m_fdc.fdc->setup_drq_cb(upd72065_device::line_cb(FUNC(x68k_state::fdc_drq), this));
for(int drive=0;drive<4;drive++)
{
char devname[16];
sprintf(devname, "upd72065:%d", drive);
floppy_image_device *floppy = machine().device<floppy_connector>(devname)->get_device();
m_fdc.floppy[drive] = floppy;
if(floppy) {
floppy->setup_load_cb(floppy_image_device::load_cb(FUNC(x68k_state::floppy_load), this));
floppy->setup_unload_cb(floppy_image_device::unload_cb(FUNC(x68k_state::floppy_unload), this));
}
}
}
MACHINE_START_MEMBER(x68k_state,x68030)
@ -2621,6 +2557,23 @@ MACHINE_START_MEMBER(x68k_state,x68030)
// start LED timer
m_led_timer->adjust(attotime::zero, 0, attotime::from_msec(400));
// check for disks
m_fdc.fdc = machine().device<upd72065_device>("upd72065");
m_fdc.fdc->setup_intrq_cb(upd72065_device::line_cb(FUNC(x68k_state::fdc_irq), this));
m_fdc.fdc->setup_drq_cb(upd72065_device::line_cb(FUNC(x68k_state::fdc_drq), this));
for(int drive=0;drive<4;drive++)
{
char devname[16];
sprintf(devname, "upd72065:%d", drive);
floppy_image_device *floppy = machine().device<floppy_connector>(devname)->get_device();
m_fdc.floppy[drive] = floppy;
if(floppy) {
floppy->setup_load_cb(floppy_image_device::load_cb(FUNC(x68k_state::floppy_load), this));
floppy->setup_unload_cb(floppy_image_device::unload_cb(FUNC(x68k_state::floppy_unload), this));
}
}
}
DRIVER_INIT_MEMBER(x68k_state,x68000)
@ -2680,6 +2633,16 @@ DRIVER_INIT_MEMBER(x68k_state,x68030)
m_is_32bit = true;
}
static const floppy_format_type x68k_floppy_formats[] = {
FLOPPY_XDF_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static SLOT_INTERFACE_START( x68k_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( x68000_base )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */
@ -2728,8 +2691,12 @@ static MACHINE_CONFIG_FRAGMENT( x68000_base )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50)
MCFG_UPD72065_ADD("upd72065", fdc_interface)
MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x68k_floppy_interface)
MCFG_UPD72065_ADD("upd72065", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd72065:0", x68k_floppies, "525hd", 0, x68k_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd72065:1", x68k_floppies, "525hd", 0, x68k_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd72065:2", x68k_floppies, "525hd", 0, x68k_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd72065:3", x68k_floppies, "525hd", 0, x68k_floppy_formats)
MCFG_SOFTWARE_LIST_ADD("flop_list","x68k_flop")
MCFG_X68K_EXPANSION_SLOT_ADD("exp",x68k_exp_intf,x68000_exp_cards,NULL,NULL)

View File

@ -108,7 +108,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<device_t> m_ay;
optional_device<device_t> m_fdc; // not on a GX4000
optional_device<upd765_family_device> m_fdc; // not on a GX4000
required_device<mc6845_device> m_crtc;
required_device<screen_device> m_screen;
required_device<i8255_device> m_ppi;
@ -184,6 +184,8 @@ public:
DECLARE_WRITE8_MEMBER(amstrad_ppi_porta_w);
DECLARE_READ8_MEMBER(amstrad_ppi_portb_r);
DECLARE_WRITE8_MEMBER(amstrad_ppi_portc_w);
void aleste_interrupt(bool state);
};

View File

@ -140,8 +140,6 @@ public:
DECLARE_WRITE8_MEMBER(apollo_dma_write_word);
DECLARE_WRITE8_MEMBER(apollo_rtc_w);
DECLARE_READ8_MEMBER(apollo_rtc_r);
DECLARE_WRITE8_MEMBER(apollo_fdc_w);
DECLARE_READ8_MEMBER(apollo_fdc_r);
DECLARE_WRITE8_MEMBER(cache_control_register_w);
DECLARE_READ8_MEMBER(cache_status_register_r);
DECLARE_WRITE8_MEMBER(task_alias_register_w);
@ -184,6 +182,9 @@ public:
virtual void machine_reset();
DECLARE_MACHINE_RESET(apollo);
DECLARE_MACHINE_START(apollo);
void fdc_interrupt(bool state);
void fdc_dma_drq(bool state);
};
MACHINE_CONFIG_EXTERN( apollo );

View File

@ -81,6 +81,9 @@ public:
DECLARE_READ64_MEMBER(scsi53c810_r);
DECLARE_WRITE64_MEMBER(scsi53c810_w);
DECLARE_READ64_MEMBER(bb_slave_64be_r);
void fdc_interrupt(bool state);
void fdc_dma_drq(bool state);
};

View File

@ -31,8 +31,8 @@ public:
m_crtc(*this, MC6845_TAG),
m_centronics(*this, CENTRONICS_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, UPD765_TAG ":0:525ssdd"),
m_floppy1(*this, UPD765_TAG ":1:525ssdd"),
m_floppy_timer(*this, FLOPPY_TIMER_TAG)
,
m_video_ram(*this, "video_ram"){ }
@ -40,13 +40,13 @@ public:
required_device<cpu_device> m_maincpu;
required_device<pia6821_device> m_pia;
required_device<z80dart_device> m_sio;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<ay3600_device> m_kbc;
required_device<mc6845_device> m_crtc;
required_device<centronics_device> m_centronics;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
required_device<timer_device> m_floppy_timer;
virtual void machine_start();
@ -61,7 +61,7 @@ public:
DECLARE_READ8_MEMBER( ls259_r );
DECLARE_WRITE8_MEMBER( ls259_w );
DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
void fdc_intrq_w(bool state);
DECLARE_READ8_MEMBER( pia_pa_r );
DECLARE_READ_LINE_MEMBER( pia_cb1_r );
DECLARE_WRITE_LINE_MEMBER( pia_cb2_w );

View File

@ -152,18 +152,13 @@ public:
required_device<centronics_device> m_centronics;
required_device<i8251_device> m_uart;
required_device<device_t> m_rtc;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<upd7220_device> m_crtc;
DECLARE_READ16_MEMBER(compis_fdc_dack_r);
DECLARE_READ16_MEMBER(compis_usart_r);
DECLARE_WRITE16_MEMBER(compis_usart_w);
DECLARE_READ16_MEMBER(compis_i186_internal_port_r);
DECLARE_WRITE16_MEMBER(compis_i186_internal_port_w);
DECLARE_WRITE8_MEMBER(vram_w);
DECLARE_WRITE8_MEMBER(compis_fdc_w);
DECLARE_READ8_MEMBER(compis_fdc_r);
DECLARE_WRITE_LINE_MEMBER(compis_fdc_int);
DECLARE_WRITE_LINE_MEMBER(compis_fdc_dma_drq);
DECLARE_READ8_MEMBER(compis_ppi_port_b_r);
DECLARE_WRITE8_MEMBER(compis_ppi_port_c_w);
DECLARE_READ16_MEMBER(compis_osp_pit_r);
@ -181,6 +176,9 @@ public:
void handle_eoi(int data);
void compis_fdc_tc(int state);
void fdc_irq(bool state);
void fdc_drq(bool state);
required_shared_ptr<UINT8> m_video_ram;
DECLARE_DRIVER_INIT(compis);
virtual void machine_start();
@ -201,6 +199,5 @@ extern const struct pit8253_config compis_pit8254_config;
extern const struct pic8259_interface compis_pic8259_master_config;
extern const struct pic8259_interface compis_pic8259_slave_config;
extern const i8251_interface compis_usart_interface;
extern const upd765_interface compis_fdc_interface;
#endif /* COMPIS_H_ */

View File

@ -39,6 +39,7 @@
#include "machine/upd765.h"
#include "machine/wd17xx.h"
#include "imagedev/flopdrv.h"
/* Enum status for high memory bank (c000 - ffff)*/
enum
@ -106,8 +107,7 @@ public:
UINT8 m_cassette_bit_mem;
UINT8 m_Data_K7;
int m_counter_write;
emu_timer *m_DMA_timer;
emu_timer *m_INT_timer;
int m_IRQ_current_state;
int m_NMI_current_state;
int m_hector_cmd[10];
int m_hector_nb_cde;
@ -138,6 +138,9 @@ public:
DECLARE_MACHINE_RESET(hec2mdhrx);
UINT32 screen_update_hec2hrp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(Callback_CK);
void disc2_fdc_interrupt(bool state);
void disc2_fdc_dma_irq(bool state);
};
/*----------- defined in machine/hec2hrp.c -----------*/
@ -164,7 +167,6 @@ extern const sn76477_interface hector_sn76477_interface;
/*----------- defined in machine/hecdisk2.c -----------*/
// disc2 handling
WRITE_LINE_DEVICE_HANDLER( hector_disk2_fdc_interrupt );
DECLARE_READ8_HANDLER( hector_disc2_io00_port_r);
DECLARE_WRITE8_HANDLER( hector_disc2_io00_port_w);
DECLARE_READ8_HANDLER( hector_disc2_io20_port_r);
@ -175,15 +177,9 @@ DECLARE_READ8_HANDLER( hector_disc2_io40_port_r);
DECLARE_WRITE8_HANDLER( hector_disc2_io40_port_w);
DECLARE_READ8_HANDLER( hector_disc2_io50_port_r);
DECLARE_WRITE8_HANDLER( hector_disc2_io50_port_w);
DECLARE_READ8_HANDLER( hector_disc2_io61_port_r);
DECLARE_WRITE8_HANDLER( hector_disc2_io61_port_w);
DECLARE_READ8_HANDLER( hector_disc2_io70_port_r);
DECLARE_WRITE8_HANDLER( hector_disc2_io70_port_w);
void hector_disc2_init( running_machine &machine);
void hector_minidisc_init( running_machine &machine);
extern const upd765_interface hector_disc2_upd765_interface;
extern const floppy_interface hector_disc2_floppy_interface;
extern const wd17xx_interface hector_wd17xx_interface; // Special for minidisc
extern const floppy_interface minidisc_floppy_interface;

View File

@ -27,18 +27,18 @@ public:
m_cassette(*this, CASSETTE_TAG),
m_centronics(*this, CENTRONICS_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0)
m_floppy0(*this, UPD765_TAG ":0:525dd")
{ }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_fd5cpu;
required_device<z80ctc_device> m_ctc;
required_device<i8255_device> m_ppi;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<cassette_image_device> m_cassette;
required_device<centronics_device> m_centronics;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
required_device<floppy_image_device> m_floppy0;
virtual void machine_start();
virtual void machine_reset();
@ -71,6 +71,8 @@ public:
DECLARE_DRIVER_INIT(pal);
DECLARE_DRIVER_INIT(ntsc);
DECLARE_WRITE_LINE_MEMBER(sordm5_video_interrupt_callback);
void fdc_irq(bool state);
};
#endif

View File

@ -6,7 +6,6 @@
#include "emu.h"
#include "cpu/i8085/i8085.h"
#include "formats/basicdsk.h"
#include "imagedev/flopdrv.h"
#include "machine/am9517a.h"
#include "machine/i8212.h"
@ -42,8 +41,8 @@ public:
m_mpsc(*this, UPD7201_TAG),
m_hgdc(*this, UPD7220_TAG),
m_speaker(*this, SPEAKER_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, UPD765_TAG ":0:525qd"),
m_floppy1(*this, UPD765_TAG ":1:525qd"),
m_ram(*this, RAM_TAG),
m_video_ram(*this, "video_ram")
{ }
@ -53,12 +52,12 @@ public:
required_device<am9517a_device> m_dmac;
required_device<device_t> m_pit;
required_device<device_t> m_crtc;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<upd7201_device> m_mpsc;
required_device<upd7220_device> m_hgdc;
required_device<device_t> m_speaker;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
required_device<ram_device> m_ram;
required_shared_ptr<UINT8> m_video_ram;
@ -85,6 +84,11 @@ public:
DECLARE_WRITE_LINE_MEMBER( drq1_w );
DECLARE_READ_LINE_MEMBER( dsra_r );
DECLARE_PALETTE_INIT(mm1);
DECLARE_READ8_MEMBER(fdc_dma_r);
DECLARE_WRITE8_MEMBER(fdc_dma_w);
void fdc_irq(bool state);
void fdc_drq(bool state);
void scan_keyboard();

View File

@ -73,6 +73,7 @@ public:
DECLARE_WRITE8_MEMBER(nc200_uart_control_w);
DECLARE_WRITE8_MEMBER(nc200_memory_card_wait_state_w);
DECLARE_WRITE8_MEMBER(nc200_poweroff_control_w);
virtual void machine_start();
virtual void machine_reset();
virtual void video_start();
@ -91,6 +92,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(nc200_txrdy_callback);
DECLARE_WRITE_LINE_MEMBER(nc200_rxrdy_callback);
DECLARE_WRITE_LINE_MEMBER(nc200_fdc_interrupt);
void nc200_fdc_interrupt(bool state);
};

View File

@ -170,14 +170,14 @@ public:
m_ctc(*this, Z80CTC_TAG),
m_acia(*this, MC6850_TAG),
m_fdc(*this, UPD765_TAG),
m_floppy(*this, FLOPPY_0)
m_floppy(*this, UPD765_TAG ":0:525dd")
{ }
required_device<cpu_device> m_fdccpu;
required_device<z80ctc_device> m_ctc;
required_device<acia6850_device> m_acia;
required_device<device_t> m_fdc;
required_device<device_t> m_floppy;
required_device<upd765a_device> m_fdc;
required_device<floppy_image_device> m_floppy;
virtual void machine_start();

View File

@ -10,7 +10,7 @@
#include "machine/mccs1850.h"
#include "machine/8530scc.h"
#include "machine/nextkbd.h"
#include "machine/n82077aa.h"
#include "machine/upd765.h"
#include "machine/ncr5390.h"
#include "machine/mb8795.h"
#include "machine/nextmo.h"

View File

@ -126,6 +126,9 @@ public:
DECLARE_WRITE8_MEMBER(mc1502_wd17xx_aux_w);
DECLARE_READ8_MEMBER(mc1502_wd17xx_drq_r);
DECLARE_READ8_MEMBER(mc1502_wd17xx_motor_r);
void fdc_interrupt(bool state);
void fdc_dma_drq(bool state);
};
/*----------- defined in machine/pc.c -----------*/

View File

@ -7,8 +7,8 @@
#include "emu.h"
#include "cpu/i86/i86.h"
#include "cpu/mcs48/mcs48.h"
#include "formats/basicdsk.h"
#include "formats/pc_dsk.h"
#include "formats/mfi_dsk.h"
#include "imagedev/flopdrv.h"
#include "machine/am9517a.h"
#include "machine/ctronics.h"
@ -19,7 +19,7 @@
#include "machine/pic8259.h"
#include "machine/pit8253.h"
#include "machine/pc1512kb.h"
#include "machine/upd765.h"
#include "machine/pc_fdc.h"
#include "machine/ram.h"
#include "sound/speaker.h"
#include "video/mc6845.h"
@ -31,7 +31,7 @@
#define I8259A2_TAG "ic109"
#define I8253_TAG "ic114"
#define MC146818_TAG "ic134"
#define UPD765AC2_TAG "ic112"
#define PC_FDC_XT_TAG "ic112"
#define INS8250_TAG "ic106"
#define AMS40041_TAG "ic126"
#define CENTRONICS_TAG "centronics"
@ -49,15 +49,15 @@ public:
m_pic(*this, I8259A2_TAG),
m_pit(*this, I8253_TAG),
m_rtc(*this, MC146818_TAG),
m_fdc(*this, UPD765AC2_TAG),
m_fdc(*this, PC_FDC_XT_TAG),
m_uart(*this, INS8250_TAG),
m_vdu(*this, AMS40041_TAG),
m_centronics(*this, CENTRONICS_TAG),
m_speaker(*this, SPEAKER_TAG),
m_kb(*this, PC1512_KEYBOARD_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, PC_FDC_XT_TAG ":0:525dd" ),
m_floppy1(*this, PC_FDC_XT_TAG ":1:525dd" ),
m_bus(*this, ISA_BUS_TAG),
m_pit1(0),
m_pit2(0),
@ -84,15 +84,15 @@ public:
required_device<device_t> m_pic;
required_device<device_t> m_pit;
required_device<mc146818_device> m_rtc;
required_device<device_t> m_fdc;
required_device<pc_fdc_xt_device> m_fdc;
required_device<ins8250_device> m_uart;
required_device<ams40041_device> m_vdu;
required_device<centronics_device> m_centronics;
required_device<device_t> m_speaker;
required_device<pc1512_keyboard_device> m_kb;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
optional_device<device_t> m_floppy1;
required_device<floppy_image_device> m_floppy0;
optional_device<floppy_image_device> m_floppy1;
required_device<isa8_device> m_bus;
virtual void machine_start();
@ -234,6 +234,7 @@ public:
DECLARE_READ8_MEMBER( iga_r );
DECLARE_WRITE8_MEMBER( iga_w );
DECLARE_READ8_MEMBER( printer_r );
DECLARE_READ8_MEMBER( io_unmapped_r );
// video state
int m_opt;
@ -247,6 +248,8 @@ public:
UINT8 m_crtcar; // CRT controller address register
UINT8 m_crtcdr[32]; // CRT controller data registers
UINT8 m_plr; // Plantronics mode register
bool test_unmapped; // Temporary for io_r/unmapped_r combination
};
// ---------- defined in video/pc1512.c ----------

View File

@ -72,8 +72,6 @@ public:
DECLARE_READ8_MEMBER(pcw_system_status_r);
DECLARE_READ8_MEMBER(pcw_expansion_r);
DECLARE_WRITE8_MEMBER(pcw_expansion_w);
DECLARE_READ8_MEMBER(pcw_fdc_r);
DECLARE_WRITE8_MEMBER(pcw_fdc_w);
DECLARE_WRITE8_MEMBER(pcw_printer_data_w);
DECLARE_WRITE8_MEMBER(pcw_printer_command_w);
DECLARE_READ8_MEMBER(pcw_printer_data_r);
@ -106,7 +104,8 @@ public:
TIMER_CALLBACK_MEMBER(pcw_pins_callback);
TIMER_CALLBACK_MEMBER(setup_beep);
TIMER_DEVICE_CALLBACK_MEMBER(pcw_timer_interrupt);
DECLARE_WRITE_LINE_MEMBER(pcw_fdc_interrupt);
void pcw_fdc_interrupt(bool state);
};
#endif /* PCW_H_ */

View File

@ -110,6 +110,9 @@ public:
DECLARE_WRITE_LINE_MEMBER(pcw16_com_tx_1);
DECLARE_WRITE_LINE_MEMBER(pcw16_com_dtr_1);
DECLARE_WRITE_LINE_MEMBER(pcw16_com_rts_1);
void trigger_fdc_int();
void fdc_interrupt(bool state);
};
#endif /* PCW16_H_ */

View File

@ -7,7 +7,6 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/z80daisy.h"
#include "formats/basicdsk.h"
#include "imagedev/flopdrv.h"
#include "machine/ecbbus.h"
#include "machine/ecb_grip.h"
@ -38,17 +37,17 @@ public:
m_rtc(*this, UPD1990A_TAG),
m_fdc(*this, UPD765_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, UPD765_TAG ":0:525hd"),
m_floppy1(*this, UPD765_TAG ":0:525hd"),
m_ecb(*this, ECBBUS_TAG)
{ }
required_device<cpu_device> m_maincpu;
required_device<upd1990a_device> m_rtc;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
optional_device<floppy_image_device> m_floppy0;
optional_device<floppy_image_device> m_floppy1;
required_device<ecbbus_device> m_ecb;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);

View File

@ -35,8 +35,8 @@ public:
m_usart1(*this, I8251_1_TAG),
m_fdc(*this, UPD765_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, UPD765_TAG ":0:525dd"),
m_floppy1(*this, UPD765_TAG ":1:525dd"),
m_centronics(*this, CENTRONICS_TAG),
m_ieee488(*this, IEEE488_TAG),
m_terminal(*this, TERMINAL_TAG),
@ -51,14 +51,15 @@ public:
required_device<device_t> m_pic;
required_device<i8251_device> m_usart0;
required_device<i8251_device> m_usart1;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
required_device<centronics_device> m_centronics;
required_device<ieee488_device> m_ieee488;
required_device<generic_terminal_device> m_terminal;
virtual void machine_start();
virtual void machine_reset();
void update_fdc_int();
@ -70,13 +71,14 @@ public:
DECLARE_WRITE8_MEMBER( ppi0_pc_w );
DECLARE_READ8_MEMBER( ppi1_pb_r );
DECLARE_WRITE8_MEMBER( ppi1_pc_w );
DECLARE_WRITE_LINE_MEMBER( fdc_int_w );
DECLARE_WRITE_LINE_MEMBER( ack_w );
DECLARE_WRITE8_MEMBER(kbd_put);
DECLARE_DIRECT_UPDATE_MEMBER(sage2_direct_update_handler);
void fdc_irq(bool state);
int m_reset;
// floppy state

View File

@ -8,7 +8,6 @@
#include "imagedev/cassette.h"
#include "machine/ram.h"
#include "imagedev/printer.h"
#include "formats/basicdsk.h"
#include "formats/sc3000_bit.h"
#include "machine/ctronics.h"
#include "machine/i8255.h"
@ -105,7 +104,7 @@ public:
m_floppy0(*this, FLOPPY_0)
{ }
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<centronics_device> m_centronics;
required_device<device_t> m_floppy0;
@ -114,9 +113,10 @@ public:
DECLARE_READ8_MEMBER( ppi_pa_r );
DECLARE_WRITE8_MEMBER( ppi_pc_w );
DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
DECLARE_WRITE_LINE_MEMBER(sf7000_fdc_index_callback);
void fdc_intrq_w(bool state);
/* floppy state */
int m_fdc_irq;
int m_fdc_index;

View File

@ -54,8 +54,8 @@ public:
m_centronics(*this, CENTRONICS_TAG),
m_speaker(*this, SPEAKER_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, I8272A_TAG ":0:525qd"),
m_floppy1(*this, I8272A_TAG ":1:525qd"),
m_kb(*this, TANDY2K_KEYBOARD_TAG),
m_kbdclk(0)
,
@ -65,7 +65,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<i8251_device> m_uart;
required_device<device_t> m_pit;
required_device<device_t> m_fdc;
required_device<i8272a_device> m_fdc;
required_device<device_t> m_pic0;
required_device<device_t> m_pic1;
required_device<crt9007_device> m_vpac;
@ -75,8 +75,8 @@ public:
required_device<centronics_device> m_centronics;
required_device<device_t> m_speaker;
required_device<ram_device> m_ram;
required_device<device_t> m_floppy0;
required_device<device_t> m_floppy1;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
required_device<tandy2k_keyboard_device> m_kb;
virtual void machine_start();
@ -93,8 +93,9 @@ public:
DECLARE_READ8_MEMBER( kbint_clr_r );
DECLARE_READ16_MEMBER( vpac_r );
DECLARE_WRITE16_MEMBER( vpac_w );
DECLARE_READ8_MEMBER( fldtc_r );
DECLARE_WRITE8_MEMBER( fldtc_w );
DECLARE_WRITE8_MEMBER( addr_ctrl_w );
DECLARE_WRITE_LINE_MEMBER( busdmarq0_w );
DECLARE_WRITE_LINE_MEMBER( rxrdy_w );
DECLARE_WRITE_LINE_MEMBER( txrdy_w );
DECLARE_WRITE_LINE_MEMBER( outspkr_w );
@ -108,6 +109,9 @@ public:
DECLARE_WRITE_LINE_MEMBER( kbdclk_w );
DECLARE_WRITE_LINE_MEMBER( kbddat_w );
void fdc_irq(bool state);
void fdc_drq(bool state);
/* DMA state */
UINT8 m_dma_mux;
@ -136,8 +140,6 @@ public:
/* sound state */
int m_outspkr;
int m_spkrdata;
DECLARE_READ8_MEMBER(fldtc_r);
DECLARE_WRITE8_MEMBER(fldtc_w);
};
#endif

View File

@ -51,8 +51,8 @@ public:
m_epci(*this, SCN2661_TAG),
m_fdc(*this, UPD765_TAG),
m_ram(*this, RAM_TAG),
m_floppy0(*this, FLOPPY_0),
m_floppy1(*this, FLOPPY_1),
m_floppy0(*this, UPD765_TAG ":0:525dd"),
m_floppy1(*this, UPD765_TAG ":1:525dd"),
m_centronics(*this, CENTRONICS_TAG),
m_kb(*this, WANGPC_KEYBOARD_TAG),
m_bus(*this, WANGPC_BUS_TAG),
@ -82,10 +82,10 @@ public:
required_device<device_t> m_pit;
required_device<im6402_device> m_uart;
required_device<mc2661_device> m_epci;
required_device<device_t> m_fdc;
required_device<upd765a_device> m_fdc;
required_device<ram_device> m_ram;
required_device<legacy_floppy_image_device> m_floppy0;
required_device<legacy_floppy_image_device> m_floppy1;
required_device<floppy_image_device> m_floppy0;
required_device<floppy_image_device> m_floppy1;
required_device<centronics_device> m_centronics;
required_device<wangpc_keyboard_device> m_kb;
required_device<wangpcbus_device> m_bus;
@ -161,14 +161,17 @@ public:
DECLARE_WRITE_LINE_MEMBER( uart_dr_w );
DECLARE_WRITE_LINE_MEMBER( uart_tbre_w );
DECLARE_WRITE_LINE_MEMBER( epci_irq_w );
DECLARE_WRITE_LINE_MEMBER( fdc_int_w );
DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
DECLARE_WRITE_LINE_MEMBER( ack_w );
DECLARE_WRITE_LINE_MEMBER( busy_w );
DECLARE_WRITE_LINE_MEMBER( bus_irq2_w );
static void on_disk0_change(device_image_interface &image);
static void on_disk1_change(device_image_interface &image);
void fdc_irq(bool state);
void fdc_drq(bool state);
int on_disk0_load(floppy_image_device *image);
void on_disk0_unload(floppy_image_device *image);
int on_disk1_load(floppy_image_device *image);
void on_disk1_unload(floppy_image_device *image);
UINT8 m_dma_page[4];
int m_dack;

View File

@ -10,6 +10,7 @@
#define X68K_H_
#include "machine/rp5c15.h"
#include "machine/upd765.h"
#define MC68901_TAG "mc68901"
#define RP5C15_TAG "rp5c15"
@ -67,6 +68,13 @@ public:
DECLARE_WRITE_LINE_MEMBER( mfp_tdo_w );
DECLARE_READ8_MEMBER( mfp_gpio_r );
void fdc_irq(bool state);
void fdc_drq(bool state);
void floppy_load_unload();
int floppy_load(floppy_image_device *dev);
void floppy_unload(floppy_image_device *dev);
struct
{
int sram_writeprotect;
@ -77,12 +85,12 @@ public:
} m_sysport;
struct
{
upd72065_device *fdc;
floppy_image_device *floppy[4];
int led_ctrl[4];
int led_eject[4];
int eject[4];
int motor[4];
int media_density[4];
int disk_inserted[4];
int selected_drive;
int drq_state;
} m_fdc;

View File

@ -215,12 +215,9 @@ PALETTE_INIT_MEMBER(amstrad_state,amstrad_cpc_green)
}
WRITE_LINE_MEMBER(amstrad_state::aleste_interrupt)
void amstrad_state::aleste_interrupt(bool state)
{
if(state == CLEAR_LINE)
m_aleste_fdc_int = 0;
else
m_aleste_fdc_int = 1;
m_aleste_fdc_int = state;
}
@ -1857,7 +1854,6 @@ Expansion Peripherals Read/Write - - - - - 0 - - - - - -
READ8_MEMBER(amstrad_state::amstrad_cpc_io_r)
{
device_t *fdc = m_fdc;
mc6845_device *mc6845 = m_crtc;
unsigned char data = 0xFF;
@ -1951,10 +1947,10 @@ The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which
switch (b8b0)
{
case 0x02:
data = upd765_status_r(fdc, space, 0);
data = m_fdc->msr_r(space, 0);
break;
case 0x03:
data = upd765_data_r(fdc, space, 0);
data = m_fdc->fifo_r(space, 0);
break;
default:
break;
@ -1993,7 +1989,6 @@ void amstrad_state::amstrad_plus_seqcheck(int data)
/* Offset handler for write */
WRITE8_MEMBER(amstrad_state::amstrad_cpc_io_w)
{
device_t *fdc = m_fdc;
mc6845_device *mc6845 = m_crtc;
cpc_multiface2_device* mface2;
@ -2118,18 +2113,22 @@ The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which
switch (b8b0)
{
case 0x00:
case 0x00: {
/* FDC Motor Control - Bit 0 defines the state of the FDD motor:
* "1" the FDD motor will be active.
* "0" the FDD motor will be in-active.*/
floppy_mon_w(floppy_get_device(machine(), 0), !BIT(data, 0));
floppy_mon_w(floppy_get_device(machine(), 1), !BIT(data, 0));
floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1,1);
floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1,1);
floppy_image_device *floppy;
floppy = machine().device<floppy_connector>(":upd765a:0")->get_device();
if(floppy)
floppy->mon_w(!BIT(data, 0));
floppy = machine().device<floppy_connector>(":upd765a:1")->get_device();
if(floppy)
floppy->mon_w(!BIT(data, 0));
break;
}
case 0x03: /* Write Data register of FDC */
upd765_data_w(fdc, space, 0,data);
m_fdc->fifo_w(space, 0,data);
break;
default:
@ -3267,16 +3266,3 @@ DEVICE_IMAGE_LOAD(amstrad_plus_cartridge)
auto_free(image.device().machine(), temp_copy);
return IMAGE_INIT_PASS;
}
#if 0
static DEVICE_IMAGE_LOAD( aleste )
{
if (device_load_basicdsk_floppy(image)==IMAGE_INIT_PASS)
{
basicdsk_set_geometry(image, 80, 2, 9, 512, 0x01, 0, FALSE);
return IMAGE_INIT_PASS;
}
return IMAGE_INIT_FAIL;
}
#endif

View File

@ -37,7 +37,8 @@
#include "machine/pic8259.h"
#include "machine/pc_fdc.h"
#include "formats/basicdsk.h"
#include "formats/mfi_dsk.h"
#include "formats/apollo_dsk.h"
#include "cpu/m68000/m68000.h"
//#include "cpu/m68000/m68kcpu.h"
@ -526,7 +527,8 @@ static WRITE8_DEVICE_HANDLER( apollo_dma8237_ctape_dack_w ) {
}
static READ8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_r ) {
UINT8 data = pc_fdc_dack_r(space.machine(), space);
pc_fdc_at_device *fdc = space.machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
UINT8 data = fdc->dma_r();
// DLOG2(("dma fdc dack read %02x",data));
// hack for DN3000: select appropriate DMA channel No.
@ -536,8 +538,9 @@ static READ8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_r ) {
}
static WRITE8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_w ) {
pc_fdc_at_device *fdc = space.machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
// DLOG2(("dma fdc dack write %02x", data));
pc_fdc_dack_w(space.machine(), space, data);
fdc->dma_w(data);
// hack for DN3000: select appropriate DMA channel No.
// Note: too late for this byte, but next bytes will be ok
@ -556,8 +559,9 @@ static WRITE8_DEVICE_HANDLER( apollo_dma8237_wdc_dack_w ) {
}
static WRITE_LINE_DEVICE_HANDLER( apollo_dma8237_out_eop ) {
pc_fdc_at_device *fdc = device->machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
DLOG1(("dma out eop state %02x", state));
pc_fdc_set_tc_state(device->machine(), state ? 0 : 1);
fdc->tc_w(!state);
sc499_set_tc_state(&device->machine(), state);
}
@ -1275,81 +1279,23 @@ static DEVICE_RESET(apollo_sio2)
#undef VERBOSE
#define VERBOSE 0
static device_t *apollo_fdc_device = NULL;
static LEGACY_FLOPPY_OPTIONS_START( apollo )
LEGACY_FLOPPY_OPTION( img2d, "afd", "Apollo floppy disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([2])
TRACKS([77])
SECTORS([8])
SECTOR_LENGTH([1024])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END0
static const floppy_interface apollo_fdc_floppy_config = { //
DEVCB_NULL, //
DEVCB_NULL, //
DEVCB_NULL, //
DEVCB_NULL, //
DEVCB_NULL, //
FLOPPY_STANDARD_5_25_DSHD, //
LEGACY_FLOPPY_OPTIONS_NAME(apollo), //
NULL, //
NULL //
static const floppy_format_type apollo_floppy_formats[] = {
FLOPPY_APOLLO_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
/*************************************
* Floppy Disk Controller
*************************************/
static SLOT_INTERFACE_START( apollo_floppies )
SLOT_INTERFACE( "525hd", FLOPPY_525_HD )
SLOT_INTERFACE_END
static void apollo_fdc_interrupt(running_machine &machine, int state) {
apollo_pic_set_irq_line( machine.firstcpu, APOLLO_IRQ_FDC, state);
void apollo_state::fdc_interrupt(bool state) {
apollo_pic_set_irq_line( machine().firstcpu, APOLLO_IRQ_FDC, state ? ASSERT_LINE : CLEAR_LINE);
}
static void apollo_fdc_dma_drq(running_machine &machine, int state) {
apollo_dma_fdc_drq(machine.firstcpu, state);
}
static device_t *apollo_fdc_get_image(running_machine &machine,
int floppy_index) {
return floppy_get_device(machine, 0);
}
static device_t * apollo_fdc_get_device(running_machine &machine) {
return apollo_fdc_device;
}
static const struct pc_fdc_interface apollo_fdc_interface = {
apollo_fdc_interrupt, //
apollo_fdc_dma_drq, //
apollo_fdc_get_image, //
apollo_fdc_get_device //
};
/*-------------------------------------------------
FDC upd765 at 0x5f800 - 0x5f807
-------------------------------------------------*/
static DEVICE_START( apollo_fdc ) {
DLOG1(("device_start_apollo_fdc"));
apollo_fdc_device = device;
pc_fdc_init(device->machine(), &apollo_fdc_interface);
}
static DEVICE_RESET( apollo_fdc ) {
DLOG1(("device_reset_apollo_fdc"));
pc_fdc_reset(device->machine());
}
WRITE8_MEMBER(apollo_state::apollo_fdc_w){
SLOG1(("writing FDC upd765 at offset %X = %02x", offset, data));
pc_fdc_w(space, offset, data);
}
READ8_MEMBER(apollo_state::apollo_fdc_r){
UINT8 data = pc_fdc_r(space, offset);
SLOG1(("reading FDC upd765 at offset %X = %02x", offset, data));
return data;
void apollo_state::fdc_dma_drq(bool state) {
apollo_dma_fdc_drq(machine().firstcpu, state);
}
/***************************************************************************
@ -1452,8 +1398,8 @@ MACHINE_CONFIG_FRAGMENT( apollo )
MCFG_DUART68681_ADD( APOLLO_SIO_TAG, XTAL_3_6864MHz, apollo_sio_config )
MCFG_DUART68681_ADD( APOLLO_SIO2_TAG, XTAL_3_6864MHz, apollo_sio2_config )
MCFG_UPD765A_ADD(APOLLO_FDC_TAG, pc_fdc_upd765_connected_1_drive_interface)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, apollo_fdc_floppy_config)
MCFG_PC_FDC_XT_ADD(APOLLO_FDC_TAG)
MCFG_FLOPPY_DRIVE_ADD(APOLLO_FDC_TAG ":0", apollo_floppies, "525hd", 0, apollo_floppy_formats)
MCFG_OMTI8621_ADD(APOLLO_WDC_TAG, apollo_wdc_config)
MCFG_SC499_ADD(APOLLO_CTAPE_TAG, apollo_ctape_config)
@ -1469,7 +1415,10 @@ MACHINE_START_MEMBER(apollo_state,apollo)
{
//MLOG1(("machine_start_apollo"));
device_start_apollo_fdc (machine().device(APOLLO_FDC_TAG));
pc_fdc_at_device *fdc = machine().device<pc_fdc_at_device>(APOLLO_FDC_TAG);
fdc->setup_intrq_cb(pc_fdc_at_device::line_cb(FUNC(apollo_state::fdc_interrupt), this));
fdc->setup_drq_cb(pc_fdc_at_device::line_cb(FUNC(apollo_state::fdc_dma_drq), this));
device_start_apollo_ptm (machine().device(APOLLO_PTM_TAG) );
device_start_apollo_sio(machine().device(APOLLO_SIO_TAG));
device_start_apollo_sio2(machine().device(APOLLO_SIO2_TAG));
@ -1498,5 +1447,4 @@ MACHINE_RESET_MEMBER(apollo_state,apollo)
device_reset_apollo_rtc(machine().device(APOLLO_RTC_TAG));
device_reset_apollo_sio(machine().device(APOLLO_SIO_TAG));
device_reset_apollo_sio2(machine().device(APOLLO_SIO2_TAG));
device_reset_apollo_fdc(apollo_fdc_device);
}

View File

@ -96,7 +96,7 @@
#include "video/cirrus.h"
#include "cpu/powerpc/ppc.h"
#include "machine/ins8250.h"
#include "machine/pc_fdc.h"
#include "machine/upd765.h"
#include "machine/mc146818.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@ -451,47 +451,22 @@ const ins8250_interface bebox_uart_inteface_3 =
*
*************************************/
static void bebox_fdc_interrupt(running_machine &machine, int state)
void bebox_state::fdc_interrupt(bool state)
{
bebox_state *drvstate = machine.driver_data<bebox_state>();
bebox_set_irq_bit(machine, 13, state);
if ( drvstate->m_devices.pic8259_master ) {
pic8259_ir6_w(drvstate->m_devices.pic8259_master, state);
bebox_set_irq_bit(machine(), 13, state);
if ( m_devices.pic8259_master ) {
pic8259_ir6_w(m_devices.pic8259_master, state);
}
}
static void bebox_fdc_dma_drq(running_machine &machine, int state)
void bebox_state::fdc_dma_drq(bool state)
{
bebox_state *drvstate = machine.driver_data<bebox_state>();
if ( drvstate->m_devices.dma8237_1 ) {
i8237_dreq2_w(drvstate->m_devices.dma8237_1, state);
if ( m_devices.dma8237_1 ) {
i8237_dreq2_w(m_devices.dma8237_1, state);
}
}
static device_t *bebox_fdc_get_image(running_machine &machine, int floppy_index)
{
/* the BeBox boot ROM seems to query for floppy #1 when it should be
* querying for floppy #0 */
return floppy_get_device(machine, 0);
}
static device_t * bebox_get_device(running_machine &machine )
{
return machine.device("smc37c78");
}
static const struct pc_fdc_interface bebox_fdc_interface =
{
bebox_fdc_interrupt,
bebox_fdc_dma_drq,
bebox_fdc_get_image,
bebox_get_device
};
/*************************************
*
* 8259 PIC
@ -563,18 +538,11 @@ WRITE8_MEMBER(bebox_state::bebox_800001F0_w ) { ide_controller_w(ide_device(spac
READ64_MEMBER(bebox_state::bebox_800003F0_r )
{
UINT64 result = read64be_with_read8_handler(pc_fdc_r, space, offset, mem_mask | 0xFFFF);
UINT64 result = 0;
if (((mem_mask >> 8) & 0xFF) == 0)
{
result &= ~(0xFF << 8);
result |= ide_controller_r(ide_device(space.machine()), 0x3F6, 1) << 8;
}
if (((mem_mask >> 0) & 0xFF) == 0)
{
result &= ~(0xFF << 0);
result |= ide_controller_r(ide_device(space.machine()), 0x3F7, 1) << 0;
result |= ide_controller_r(space.machine().device("ide"), 0x3F6, 1) << 8;
}
return result;
}
@ -582,13 +550,8 @@ READ64_MEMBER(bebox_state::bebox_800003F0_r )
WRITE64_MEMBER(bebox_state::bebox_800003F0_w )
{
write64be_with_write8_handler(pc_fdc_w, space, offset, data, mem_mask | 0xFFFF);
if (((mem_mask >> 8) & 0xFF) == 0)
ide_controller_w(ide_device(space.machine()), 0x3F6, 1, (data >> 8) & 0xFF);
if (((mem_mask >> 0) & 0xFF) == 0)
ide_controller_w(ide_device(space.machine()), 0x3F7, 1, (data >> 0) & 0xFF);
ide_controller_w(space.machine().device("ide"), 0x3F6, 1, (data >> 8) & 0xFF);
}
@ -768,17 +731,17 @@ WRITE8_MEMBER(bebox_state::bebox_dma_write_byte )
READ8_MEMBER(bebox_state::bebox_dma8237_fdc_dack_r){
return pc_fdc_dack_r(machine(),space);
return machine().device<smc37c78_device>("smc37c78")->dma_r();
}
WRITE8_MEMBER(bebox_state::bebox_dma8237_fdc_dack_w){
pc_fdc_dack_w( machine(), space, data );
machine().device<smc37c78_device>("smc37c78")->dma_w(data);
}
WRITE_LINE_MEMBER(bebox_state::bebox_dma8237_out_eop){
pc_fdc_set_tc_state( machine(), state );
machine().device<smc37c78_device>("smc37c78")->tc_w(state);
}
static void set_dma_channel(running_machine &machine, int channel, int state)
@ -1067,7 +1030,9 @@ void bebox_state::machine_reset()
void bebox_state::machine_start()
{
pc_fdc_init(machine(), &bebox_fdc_interface);
smc37c78_device *fdc = machine().device<smc37c78_device>("smc37c78");
fdc->setup_intrq_cb(smc37c78_device::line_cb(FUNC(bebox_state::fdc_interrupt), this));
fdc->setup_drq_cb(smc37c78_device::line_cb(FUNC(bebox_state::fdc_dma_drq), this));
}
DRIVER_INIT_MEMBER(bebox_state,bebox)

View File

@ -159,12 +159,7 @@ static void compis_keyb_init(compis_state *state)
/*-------------------------------------------------------------------------*/
static void compis_fdc_reset(running_machine &machine)
{
device_t *fdc = machine.device("upd765");
upd765_reset(fdc, 0);
/* set FDC at reset */
upd765_reset_w(fdc, 1);
machine.device("upd765")->reset();
}
void compis_state::compis_fdc_tc(int state)
@ -172,11 +167,11 @@ void compis_state::compis_fdc_tc(int state)
/* Terminal count if iSBX-218A has DMA enabled */
if (ioport("DSW1")->read())
{
upd765_tc_w(m_fdc, state);
m_fdc->tc_w(state);
}
}
WRITE_LINE_MEMBER( compis_state::compis_fdc_int )
void compis_state::fdc_irq(bool state)
{
/* No interrupt requests if iSBX-218A has DMA enabled */
if (!ioport("DSW1")->read() && state)
@ -189,71 +184,15 @@ WRITE_LINE_MEMBER( compis_state::compis_fdc_int )
}
}
WRITE_LINE_MEMBER( compis_state::compis_fdc_dma_drq )
void compis_state::fdc_drq(bool state)
{
/* DMA requst if iSBX-218A has DMA enabled */
/* DMA request if iSBX-218A has DMA enabled */
if (ioport("DSW1")->read() && state)
{
//compis_dma_drq(state, read);
}
}
const upd765_interface compis_fdc_interface =
{
DEVCB_DRIVER_LINE_MEMBER(compis_state, compis_fdc_int),
DEVCB_DRIVER_LINE_MEMBER(compis_state, compis_fdc_dma_drq),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
READ16_MEMBER( compis_state::compis_fdc_dack_r )
{
UINT16 data;
data = 0xffff;
/* DMA acknowledge if iSBX-218A has DMA enabled */
if (ioport("DSW1")->read())
{
data = upd765_dack_r(m_fdc, space, 0);
}
return data;
}
WRITE8_MEMBER( compis_state::compis_fdc_w )
{
switch(offset)
{
case 2:
upd765_data_w(m_fdc, space, 0, data);
break;
default:
printf("FDC Unknown Port Write %04X = %04X\n", offset, data);
break;
}
}
READ8_MEMBER( compis_state::compis_fdc_r )
{
UINT16 data;
data = 0xffff;
switch(offset)
{
case 0:
data = upd765_status_r(m_fdc, space, 0);
break;
case 2:
data = upd765_data_r(m_fdc, space, 0);
break;
default:
printf("FDC Unknown Port Read %04X\n", offset);
break;
}
return data;
}
/*-------------------------------------------------------------------------*/
/* Bit 0: J5-4 */

View File

@ -86,46 +86,14 @@ static const via6522_interface via_intf =
};
//-------------------------------------------------
// LEGACY_FLOPPY_OPTIONS( fd2000 )
//-------------------------------------------------
static LEGACY_FLOPPY_OPTIONS_START( fd2000 )
LEGACY_FLOPPY_OPTION( fd2000, "d81", "Commodore 1581 Disk Image", d81_dsk_identify, d81_dsk_construct, NULL, NULL )
//LEGACY_FLOPPY_OPTION( fd2000, "d2m", "CMD FD-2000 Disk Image", d2m_dsk_identify, d2m_dsk_construct, NULL, NULL )
LEGACY_FLOPPY_OPTIONS_END
//-------------------------------------------------
// floppy_interface fd2000_floppy_interface
//-------------------------------------------------
static const floppy_interface fd2000_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_3_5_DSDD,
LEGACY_FLOPPY_OPTIONS_NAME(fd2000),
"floppy_3_5",
static const floppy_format_type fd2000_floppy_formats[] = {
FLOPPY_MFI_FORMAT,
NULL
};
//-------------------------------------------------
// upd765_interface fdc_intf
//-------------------------------------------------
static const struct upd765_interface fdc_intf =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
{ FLOPPY_0, NULL, NULL, NULL }
};
static SLOT_INTERFACE_START( fd2000_floppies )
SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
SLOT_INTERFACE_END
//-------------------------------------------------
@ -137,9 +105,9 @@ static MACHINE_CONFIG_FRAGMENT( fd2000 )
MCFG_CPU_PROGRAM_MAP(fd2000_mem)
MCFG_VIA6522_ADD(M6522_TAG, 2000000, via_intf)
MCFG_UPD765A_ADD(DP8473_TAG, fdc_intf)
MCFG_UPD765A_ADD(DP8473_TAG, true, true)
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, fd2000_floppy_interface)
MCFG_FLOPPY_DRIVE_ADD(DP8473_TAG ":0", fd2000_floppies, "525dd", 0, fd2000_floppy_formats)
MACHINE_CONFIG_END

View File

@ -17,7 +17,7 @@
#include "emu.h"
#include "cpu/m6502/m6502.h"
#include "imagedev/flopdrv.h"
#include "formats/d81_dsk.h"
#include "formats/mfi_dsk.h"
#include "machine/6522via.h"
#include "machine/cbmiec.h"
#include "machine/upd765.h"

View File

@ -527,9 +527,9 @@ static INPUT_PORTS_START( ibm5160_mb )
PORT_DIPNAME( 0x02, 0x00, "8087 installed")
PORT_DIPSETTING( 0x00, DEF_STR(No) )
PORT_DIPSETTING( 0x02, DEF_STR(Yes) )
PORT_DIPNAME( 0x01, 0x01, "Any floppy drive installed")
PORT_DIPSETTING( 0x00, DEF_STR(No) )
PORT_DIPNAME( 0x01, 0x01, "Boot from floppy")
PORT_DIPSETTING( 0x01, DEF_STR(Yes) )
PORT_DIPSETTING( 0x00, DEF_STR(No) )
INPUT_PORTS_END
//-------------------------------------------------
// input_ports - device-specific input ports

View File

@ -45,7 +45,6 @@
#include "sound/wave.h" /* for K7 sound*/
#include "sound/discrete.h" /* for 1 Bit sound*/
#include "machine/upd765.h" /* for floppy disc controller */
#include "formats/basicdsk.h"
#include "formats/hect_tap.h"
#include "includes/hec2hrp.h"
@ -876,11 +875,9 @@ void hector_reset(running_machine &machine, int hr, int with_D2 )
if (with_D2==1)
{
upd765a_device *fdc = machine.device<upd765a_device>("upd765");
machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
device_t *fdc = machine.device("upd765");
machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
upd765_reset(fdc, 1);
upd765_reset_w(fdc, 1);
fdc->reset();
}
}

View File

@ -27,14 +27,7 @@
#include "includes/hec2hrp.h"
/* Disquette timer*/
static TIMER_CALLBACK( Callback_DMA_irq );
static TIMER_CALLBACK( Callback_INT_irq );
/* Callback uPD request */
//UPD765_DMA_REQUEST( hector_disc2_fdc_dma_irq );
static WRITE_LINE_DEVICE_HANDLER( disc2_fdc_interrupt );
static WRITE_LINE_DEVICE_HANDLER( hector_disc2_fdc_dma_irq );
/* How uPD765 works:
* First we send at uPD the string of command (p.e. 9 bytes for read starting by 0x46) on port 60h
@ -48,95 +41,29 @@ static WRITE_LINE_DEVICE_HANDLER( hector_disc2_fdc_dma_irq );
* At this point the Z80 can read the RESULT in port 61h
*/
// Define the hardware of the disk
const floppy_interface hector_disc2_floppy_interface =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_5_25_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(hector_disc2),
NULL,
NULL
};
/*****************************************************************************/
/****** Management of the uPD765 for interface with floppy images************/
/*****************************************************************************/
/* Hector Disc II uPD765 interface use interrupts and DMA! */
const upd765_interface hector_disc2_upd765_interface =
{
DEVCB_LINE(disc2_fdc_interrupt),
DEVCB_LINE(hector_disc2_fdc_dma_irq),
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{FLOPPY_0,FLOPPY_1, NULL, NULL}
};
/*****************************************************************************/
/**** Management of the interrupts (NMI and INT)between uPD765 and Z80 ******/
/*****************************************************************************/
static void valid_interrupt( running_machine &machine)
{
hec2hrp_state *state = machine.driver_data<hec2hrp_state>();
/* Called at each rising state of NMI or RNMI ! */
/* Take NMI only if RNMI ok*/
if ((state->m_hector_disc2_RNMI==1) && (state->m_NMI_current_state==1))
{
machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); // Clear NMI...
state->m_DMA_timer->adjust(attotime::from_usec(6) );//a little time to let the Z80 terminate he's previous job !
state->m_NMI_current_state=0;
}
}
void hector_disc2_init( running_machine &machine)
{
hec2hrp_state *state = machine.driver_data<hec2hrp_state>();
state->m_DMA_timer = machine.scheduler().timer_alloc(FUNC(Callback_DMA_irq));
state->m_INT_timer = machine.scheduler().timer_alloc(FUNC(Callback_INT_irq));
upd765a_device *fdc = machine.device<upd765a_device>("upd765");
fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(hec2hrp_state::disc2_fdc_interrupt), state));
fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(hec2hrp_state::disc2_fdc_dma_irq), state));
}
static TIMER_CALLBACK( Callback_DMA_irq )
/* upd765 INT is connected to interrupt of Z80 within a RNMI hardware authorization */
void hec2hrp_state::disc2_fdc_interrupt(bool state)
{
hec2hrp_state *state = machine.driver_data<hec2hrp_state>();
/* To generate the NMI signal (late) when uPD DMA request*/
machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); //NMI...
state->m_hector_nb_cde =0; // clear the cde length
m_IRQ_current_state = state;
machine().device("disc2cpu")->execute().set_input_line(INPUT_LINE_IRQ0, state && m_hector_disc2_RNMI ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( Callback_INT_irq )
/* upd765 DRQ is connected to NMI of Z80 within a RNMI hardware authorization */
void hec2hrp_state::disc2_fdc_dma_irq(bool state)
{
/* To generate the INT signal (late) when uPD DMA request*/
/*device->*/machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
}
/* upd765 INT is connected to interrupt of Z80 within a RNMI hardware authorization*/
static WRITE_LINE_DEVICE_HANDLER( disc2_fdc_interrupt )
{
hec2hrp_state *drvstate = device->machine().driver_data<hec2hrp_state>();
device->machine().device("disc2cpu")->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
if (state)
drvstate->m_INT_timer->adjust(attotime::from_usec(500) );//a little time to let the Z80 terminate he's previous job !
}
static WRITE_LINE_DEVICE_HANDLER( hector_disc2_fdc_dma_irq )
{
hec2hrp_state *drvstate = device->machine().driver_data<hec2hrp_state>();
/* upd765 DRQ is connected to NMI of Z80 within a RNMI hardware authorization*/
/* Here the most difficult on this machine :
The DMA request come with the uPD765 "soft" immediately,
against the true hard uPD765. In the real life, the uPD had
to seach for the sector before !
So, we had to memorize the signal (the DMA is a pulse)
until disc2's Z80 is ready to take the NMI interupt (when
he had set the RNMI authorization) ! */
if (state==1)
drvstate->m_NMI_current_state = state;
valid_interrupt(device->machine());
m_NMI_current_state = state;
machine().device("disc2cpu")->execute().set_input_line(INPUT_LINE_NMI, state && m_hector_disc2_RNMI ? ASSERT_LINE : CLEAR_LINE);
}
// RESET the disc2 Unit !
@ -144,10 +71,8 @@ void hector_disc2_reset(running_machine &machine)
{
hec2hrp_state *state = machine.driver_data<hec2hrp_state>();
// Initialization Disc2 unit
machine.device("disc2cpu" )->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
//switch ON and OFF the reset line uPD
upd765_reset_w(machine.device("upd765"), 1);
upd765_reset_w(machine.device("upd765"), 0);
machine.device("disc2cpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
machine.device<upd765a_device>("upd765")->reset();
// Select ROM memory to cold restart
state->membank("bank3")->set_entry(DISCII_BANK_ROM);
@ -157,6 +82,7 @@ void hector_disc2_reset(running_machine &machine)
state->m_hector_disc2_data_read=0; /* Data send by Hector to Disc 2 when PC2=true */
state->m_hector_disc2_data_write=0; /* Data send by Disc 2 to Hector when Write Port I/O 40 */
state->m_hector_disc2_RNMI = 0; /* State of I/O 50 D5 = authorization for INT / NMI */
state->m_IRQ_current_state=0; /* Clear the IRQ active request */
state->m_NMI_current_state=0; /* Clear the DMA active request */
}
@ -219,109 +145,18 @@ READ8_HANDLER( hector_disc2_io50_port_r) /*Read memory info write ready*/
WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
{
hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
device_t *fdc = space.machine().device("upd765");
upd765a_device *fdc = space.machine().device<upd765a_device>("upd765");
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
floppy_mon_w(floppy_get_device(space.machine(), 0), BIT(data, 0)); // Moteur floppy A:
floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 1)); // Moteur floppy B:
floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), FLOPPY_DRIVE_READY,!BIT(data, 0));
floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), FLOPPY_DRIVE_READY,!BIT(data, 1));
space.machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(BIT(data, 0)); // Moteur floppy A:
space.machine().device<floppy_connector>("upd765:1")->get_device()->mon_w(BIT(data, 1)); // Moteur floppy B:
/* Write bit TC uPD765 on D4 of port I/O 50 */
upd765_tc_w(fdc, BIT(data, 4)); // Seems not used...
fdc->tc_w(BIT(data, 4));
/* Authorization interrupt and NMI with RNMI signal*/
state->m_hector_disc2_RNMI = BIT(data, 5);
/* if RNMI is OK, try to lauch an NMI*/
if (state->m_hector_disc2_RNMI)
valid_interrupt(space.machine());
}
//Here we must take the exchange with uPD against AM_DEVREADWRITE
// Because we had to add D6 = 1 when write is done with 0x28 in ST0 back
// AM_RANGE(0x061,0x061) AM_DEVREADWRITE("upd765",upd765_data_r,upd765_data_w)
READ8_HANDLER( hector_disc2_io61_port_r)
{
hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
UINT8 data;
device_t *fdc = space.machine().device("upd765");
data = upd765_data_r(fdc,space, 0); //Get the result
// if ST0 == 0x28 (drive A:) or 0x29 (drive B:) => add 0x40
// and correct the ST1 and ST2 (patch)
if ((state->m_hector_flag_result == 3) & ((data==0x28) | (data==0x29)) ) // are we in the problem?
{
data=data + 0x40;
state->m_hector_flag_result--;
}
// Nothing to do in over case!
if (state->m_hector_flag_result == 3)
state->m_hector_flag_result = 0;
if ((state->m_hector_flag_result == 2) & (data==0x00) )
{
data=/*data +*/ 0x04;
state->m_hector_flag_result--;
}
if ((state->m_hector_flag_result == 1) & (data==0x00) )
{
data=/*data + */0x10;
state->m_hector_flag_result=0; // End !
}
#ifdef hector_trace
if (state->m_print==1)
printf(" _%x",data);
#endif
state->m_hector_nb_cde =0; // clear the cde length
return data;
}
WRITE8_HANDLER( hector_disc2_io61_port_w)
{
hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Data useful to patch the RESULT in case of write command */
state->m_hector_cmd[9]=state->m_hector_cmd[8]; //hector_cmd_8 = Cde number when state->m_hector_nb_cde = 9
state->m_hector_cmd[8]=state->m_hector_cmd[7]; //hector_cmd_7 = Drive
state->m_hector_cmd[7]=state->m_hector_cmd[6]; //hector_cmd_6 = C
state->m_hector_cmd[6]=state->m_hector_cmd[5]; //hector_cmd_5 = H
state->m_hector_cmd[5]=state->m_hector_cmd[4]; //hector_cmd_4 = R
state->m_hector_cmd[4]=state->m_hector_cmd[3]; //hector_cmd_3 = N
state->m_hector_cmd[3]=state->m_hector_cmd[2]; //hector_cmd_2 = EOT
state->m_hector_cmd[2]=state->m_hector_cmd[1]; //hector_cmd_1 = GPL
state->m_hector_cmd[1]=state->m_hector_cmd[0]; //hector_cmd_0 = DTL
state->m_hector_cmd[0] = data;
// Increase the length cde!
state->m_hector_nb_cde++;
// check if current commande is write cmde.
if (((state->m_hector_cmd[8] & 0x1f)== 0x05) & (state->m_hector_nb_cde==9) ) /*Detect wrtie commande*/
state->m_hector_flag_result = 3; // here we are!
#ifdef hector_trace
if (state->m_hector_nb_cde==6 ) /*Detect 1 octet command*/
{
printf("\n commande = %x, %x, %x, %x, %x, %x Result = ", state->m_hector_cmd[5], state->m_hector_cmd[4], state->m_hector_cmd[3], state->m_hector_cmd[2], state->m_hector_cmd[1], data );
state->m_print=1;
}
else
state->m_print=0;
#endif
device_t *fdc = space.machine().device("upd765");
upd765_data_w(fdc,space, 0, data);
}
// AM_RANGE(0x070,0x07f) AM_DEVREADWRITE("upd765",upd765_dack_r,upd765_dack_w)
READ8_HANDLER( hector_disc2_io70_port_r) // Gestion du DMA
{
UINT8 data;
device_t *fdc = space.machine().device("upd765");
data = upd765_dack_r(fdc,space, 0);
return data;
}
WRITE8_HANDLER( hector_disc2_io70_port_w)
{
device_t *fdc = space.machine().device("upd765");
upd765_dack_w(fdc,space, 0, data);
space.machine().device("disc2cpu")->execute().set_input_line(INPUT_LINE_IRQ0, state->m_IRQ_current_state && state->m_hector_disc2_RNMI ? ASSERT_LINE : CLEAR_LINE);
space.machine().device("disc2cpu")->execute().set_input_line(INPUT_LINE_NMI, state->m_NMI_current_state && state->m_hector_disc2_RNMI ? ASSERT_LINE : CLEAR_LINE);
}

View File

@ -6,46 +6,28 @@
#include "emu.h"
#include "iq151_disc2.h"
#include "formats/mfi_dsk.h"
#include "formats/iq151_dsk.h"
/***************************************************************************
IMPLEMENTATION
***************************************************************************/
static LEGACY_FLOPPY_OPTIONS_START( iq151_disc2 )
LEGACY_FLOPPY_OPTION( iq151_disk, "iqd", "IQ-151 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
HEADS([1])
TRACKS([77])
SECTORS([26])
SECTOR_LENGTH([128])
FIRST_SECTOR_ID([1]))
LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface iq151_disc2_intf =
{
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
FLOPPY_STANDARD_8_SSSD,
LEGACY_FLOPPY_OPTIONS_NAME(iq151_disc2),
"floppy_8",
static const floppy_format_type iq151_disc2_floppy_formats[] = {
FLOPPY_IQ151_FORMAT,
FLOPPY_MFI_FORMAT,
NULL
};
static const upd765_interface iq151_disc2_fdc_intf =
{
DEVCB_NULL,
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_NOT_CONNECTED,
{ NULL, FLOPPY_0, FLOPPY_1, NULL }
};
static SLOT_INTERFACE_START( iq151_disc2_floppies )
SLOT_INTERFACE( "8sssd", FLOPPY_8_SSSD )
SLOT_INTERFACE_END
static MACHINE_CONFIG_FRAGMENT( iq151_disc2 )
MCFG_UPD72065_ADD("fdc", iq151_disc2_fdc_intf)
MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(iq151_disc2_intf)
MCFG_UPD72065_ADD("fdc", false, true)
MCFG_FLOPPY_DRIVE_ADD("fdc:1", iq151_disc2_floppies, "8sssd", 0, iq151_disc2_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("fdc:2", iq151_disc2_floppies, "8sssd", 0, iq151_disc2_floppy_formats)
MACHINE_CONFIG_END
ROM_START( iq151_disc2 )
@ -129,10 +111,12 @@ void iq151_disc2_device::read(offs_t offset, UINT8 &data)
void iq151_disc2_device::io_read(offs_t offset, UINT8 &data)
{
/* This is gross */
address_space *space = NULL;
if (offset == 0xaa)
data = upd765_status_r(m_fdc, machine().driver_data()->generic_space(), 0);
data = m_fdc->msr_r(*space, 0, 0xff);
else if (offset == 0xab)
data = upd765_data_r(m_fdc, machine().driver_data()->generic_space(), 0);
data = m_fdc->fifo_r(*space, 0, 0xff);
}
//-------------------------------------------------
@ -141,8 +125,9 @@ void iq151_disc2_device::io_read(offs_t offset, UINT8 &data)
void iq151_disc2_device::io_write(offs_t offset, UINT8 data)
{
address_space *space = NULL;
if (offset == 0xab)
upd765_data_w(m_fdc, machine().driver_data()->generic_space(), 0, data);
m_fdc->fifo_w(*space, 0, data, 0xff);
else if (offset == 0xac)
m_rom_enabled = (data == 0x01);
}

Some files were not shown because too many files have changed in this diff Show More