abc1600: Added sector dump floppy image format. [Curt Coder]

This commit is contained in:
Curt Coder 2022-02-05 13:32:54 +02:00
parent 74c9b4c248
commit 8099d46984
6 changed files with 141 additions and 3 deletions

View File

@ -131,6 +131,18 @@ if opt_tool(FORMATS, "ABC800_DSK") then
} }
end end
--------------------------------------------------
--
--@src/lib/formats/abc1600_dsk.h,FORMATS["ABC1600_DSK"] = true
--------------------------------------------------
if opt_tool(FORMATS, "ABC1600_DSK") then
files {
MAME_DIR.. "src/lib/formats/abc1600_dsk.cpp",
MAME_DIR.. "src/lib/formats/abc1600_dsk.h",
}
end
-------------------------------------------------- --------------------------------------------------
-- --
--@src/lib/formats/abcfd2_dsk.h,FORMATS["ABCFD2_DSK"] = true --@src/lib/formats/abcfd2_dsk.h,FORMATS["ABCFD2_DSK"] = true

View File

@ -1020,6 +1020,7 @@ BUSES["ZORRO"] = true
FORMATS["2D_DSK"] = true FORMATS["2D_DSK"] = true
FORMATS["A26_CAS"] = true FORMATS["A26_CAS"] = true
FORMATS["A5105_DSK"] = true FORMATS["A5105_DSK"] = true
FORMATS["ABC1600_DSK"] = true
FORMATS["ABC800_DSK"] = true FORMATS["ABC800_DSK"] = true
FORMATS["ABCFD2_DSK"] = true FORMATS["ABCFD2_DSK"] = true
FORMATS["ACE_TAP"] = true FORMATS["ACE_TAP"] = true

View File

@ -0,0 +1,79 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/*********************************************************************
formats/abc1600_dsk.c
Luxor ABC 1600 disk image formats
*********************************************************************/
#include "formats/abc1600_dsk.h"
abc1600_format::abc1600_format() : wd177x_format(formats)
{
}
const char *abc1600_format::name() const
{
return "abc1600";
}
const char *abc1600_format::description() const
{
return "Luxor ABC 1600 disk image";
}
const char *abc1600_format::extensions() const
{
return "img";
}
const abc1600_format::format abc1600_format::formats[] = {
// track description
// 55x4e 12x00 3xf5 fe 2x00 01 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 02 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 03 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 04 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 05 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 06 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 07 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 08 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 09 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0a 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0b 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0c 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0d 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0e 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 0f 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 54x4e 12x00 3xf5 fe 2x00 10 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
// 298x4e
{ // 640K 5 1/4 inch quad density
floppy_image::FF_525, floppy_image::DSQD, floppy_image::MFM,
2000, 16, 80, 2, 256, {}, 1, {}, 55, 22, 54
},
{}
};
const floppy_format_type FLOPPY_ABC1600_FORMAT = &floppy_image_format_creator<abc1600_format>;
int abc1600_format::get_image_offset(const format &f, int head, int track)
{
int offset = 0;
if(head) {
for(int trk=0; trk < f.track_count; trk++) {
const format &tf = get_track_format(f, 0, trk);
offset += compute_track_size(tf);
}
}
for(int trk=0; trk < track; trk++) {
const format &tf = get_track_format(f, head, trk);
offset += compute_track_size(tf);
}
return offset;
}

View File

@ -0,0 +1,35 @@
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/*********************************************************************
formats/abc1600_dsk.h
Luxor ABC 1600 disk image formats
*********************************************************************/
#ifndef MAME_FORMATS_ABC1600_DSK_H
#define MAME_FORMATS_ABC1600_DSK_H
#pragma once
#include "wd177x_dsk.h"
class abc1600_format : public wd177x_format
{
public:
abc1600_format();
virtual const char *name() const override;
virtual const char *description() const override;
virtual const char *extensions() const override;
protected:
virtual int get_image_offset(const format &f, int head, int track) override;
private:
static const format formats[];
};
extern const floppy_format_type FLOPPY_ABC1600_FORMAT;
#endif // MAME_FORMATS_ABC1600_DSK_H

View File

@ -785,6 +785,13 @@ static void abc1600_floppies(device_slot_interface &device)
device.option_add("525qd", FLOPPY_525_QD); device.option_add("525qd", FLOPPY_525_QD);
} }
void abc1600_state::floppy_formats(format_registration &fr)
{
fr.add_mfm_containers();
fr.add(FLOPPY_ABC1600_FORMAT);
}
//------------------------------------------------- //-------------------------------------------------
// ABC1600BUS_INTERFACE( abcbus_intf ) // ABC1600BUS_INTERFACE( abcbus_intf )
@ -955,9 +962,9 @@ void abc1600_state::abc1600(machine_config &config)
m_fdc->intrq_wr_callback().set(m_cio, FUNC(z8536_device::pb7_w)); m_fdc->intrq_wr_callback().set(m_cio, FUNC(z8536_device::pb7_w));
m_fdc->drq_wr_callback().set(FUNC(abc1600_state::update_drdy0)); m_fdc->drq_wr_callback().set(FUNC(abc1600_state::update_drdy0));
FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":0", abc1600_floppies, nullptr, floppy_image_device::default_mfm_floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":0", abc1600_floppies, nullptr, abc1600_state::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":1", abc1600_floppies, nullptr, floppy_image_device::default_mfm_floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":1", abc1600_floppies, nullptr, abc1600_state::floppy_formats).enable_sound(true);
FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":2", abc1600_floppies, "525qd", floppy_image_device::default_mfm_floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, SAB1797_02P_TAG":2", abc1600_floppies, "525qd", abc1600_state::floppy_formats).enable_sound(true);
ABCBUS_SLOT(config, m_bus0i, 64_MHz_XTAL / 16, abc1600bus_cards, nullptr); ABCBUS_SLOT(config, m_bus0i, 64_MHz_XTAL / 16, abc1600bus_cards, nullptr);
m_bus0i->irq_callback().set(m_cio, FUNC(z8536_device::pa7_w)); m_bus0i->irq_callback().set(m_cio, FUNC(z8536_device::pa7_w));

View File

@ -9,6 +9,7 @@
#include "bus/abckb/abckb.h" #include "bus/abckb/abckb.h"
#include "bus/rs232/rs232.h" #include "bus/rs232/rs232.h"
#include "cpu/m68000/m68000.h" #include "cpu/m68000/m68000.h"
#include "formats/abc1600_dsk.h"
#include "imagedev/floppy.h" #include "imagedev/floppy.h"
#include "machine/abc1600mac.h" #include "machine/abc1600mac.h"
#include "machine/e0516.h" #include "machine/e0516.h"
@ -105,6 +106,8 @@ public:
virtual void machine_start() override; virtual void machine_start() override;
virtual void machine_reset() override; virtual void machine_reset() override;
static void floppy_formats(format_registration &fr);
uint8_t bus_r(offs_t offset); uint8_t bus_r(offs_t offset);
void bus_w(offs_t offset, uint8_t data); void bus_w(offs_t offset, uint8_t data);
uint8_t dart_r(offs_t offset); uint8_t dart_r(offs_t offset);
@ -152,6 +155,7 @@ public:
void abc1600(machine_config &config); void abc1600(machine_config &config);
void abc1600_mem(address_map &map); void abc1600_mem(address_map &map);
void mac_mem(address_map &map); void mac_mem(address_map &map);
// peripherals // peripherals
int m_cs7; // card select address bit 7 int m_cs7; // card select address bit 7
int m_bus0; // BUS 0 selected int m_bus0; // BUS 0 selected