summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/fs3216.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/fs3216.cpp')
-rw-r--r--src/mame/drivers/fs3216.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mame/drivers/fs3216.cpp b/src/mame/drivers/fs3216.cpp
index 2ca75d73931..bb917962270 100644
--- a/src/mame/drivers/fs3216.cpp
+++ b/src/mame/drivers/fs3216.cpp
@@ -50,8 +50,8 @@ private:
MC6845_UPDATE_ROW(crt_update_row);
void mmu_reg_w(offs_t offset, u16 data);
- DECLARE_READ16_MEMBER(mmu_read);
- DECLARE_WRITE16_MEMBER(mmu_write);
+ u16 mmu_read(offs_t offset, u16 mem_mask);
+ void mmu_write(offs_t offset, u16 data, u16 mem_mask);
DECLARE_WRITE_LINE_MEMBER(mmu_reset_w);
void mmu_init_w(u16 data);
@@ -171,7 +171,7 @@ void fs3216_state::mmu_reg_w(offs_t offset, u16 data)
reg = (reg & 0x00ffff) | (data & 0x00ff) << 16;
}
-READ16_MEMBER(fs3216_state::mmu_read)
+u16 fs3216_state::mmu_read(offs_t offset, u16 mem_mask)
{
const bool a23 = BIT(offset, 22);
const bool mmu_disable = !a23 && BIT(m_maincpu->get_fc(), 2);
@@ -184,10 +184,10 @@ READ16_MEMBER(fs3216_state::mmu_read)
offs_t clbaddr = offset + ((mmu_reg & 0x000fff) << 9);
clbaddr = (clbaddr & 0x1fffff) | (clbaddr & 0x100000) << 1;
- return m_clb->read16(space, clbaddr, mem_mask);
+ return m_clb->read16(clbaddr, mem_mask);
}
-WRITE16_MEMBER(fs3216_state::mmu_write)
+void fs3216_state::mmu_write(offs_t offset, u16 data, u16 mem_mask)
{
const bool a23 = BIT(offset, 22);
const bool mmu_disable = !a23 && BIT(m_maincpu->get_fc(), 2);
@@ -200,7 +200,7 @@ WRITE16_MEMBER(fs3216_state::mmu_write)
offs_t clbaddr = offset + ((mmu_reg & 0x000fff) << 9);
clbaddr = (clbaddr & 0x1fffff) | (clbaddr & 0x100000) << 1;
- m_clb->write16(space, clbaddr, data, mem_mask);
+ m_clb->write16(clbaddr, data, mem_mask);
}
WRITE_LINE_MEMBER(fs3216_state::mmu_reset_w)
154' href='#n154'>154 155 156
// license:BSD-3-Clause
// copyright-holders:R. Belmont, Olivier Galibert
/*********************************************************************

    formats/esq16_dsk.c

    Formats for 16-bit Ensoniq synthesizers and samplers

    Disk is PC MFM, 80 tracks, double-sided, with 10 sectors per track

*********************************************************************/

#include "esq16_dsk.h"

#include "ioprocs.h"


const floppy_image_format_t::desc_e esqimg_format::esq_10_desc[] = {
	{ MFM, 0x4e, 80 },
	{ MFM, 0x00, 12 },
	{ RAW, 0x5224, 3 },
	{ MFM, 0xfc, 1 },
	{ MFM, 0x4e, 50 },
	{ MFM, 0x00, 12 },
	{ SECTOR_LOOP_START, 0, 9 },
	{   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 }
};

esqimg_format::esqimg_format()
{
}

const char *esqimg_format::name() const
{
	return "esq16";
}

const char *esqimg_format::description() const
{
	return "Ensoniq VFX-SD/SD-1/EPS-16 floppy disk image";
}

const char *esqimg_format::extensions() const
{
	return "img";
}

bool esqimg_format::supports_save() const
{
	return true;
}

void esqimg_format::find_size(util::random_read &io, uint8_t &track_count, uint8_t &head_count, uint8_t &sector_count)
{
	uint64_t size;
	if(!io.length(size)) {
		track_count = 80;
		head_count = 2;
		sector_count = 10;

		uint32_t expected_size = 512 * track_count*head_count*sector_count;
		if(size == expected_size) {
			return;
		}
	}
	track_count = head_count = sector_count = 0;
}

int esqimg_format::identify(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants)
{
	uint8_t track_count, head_count, sector_count;
	find_size(io, track_count, head_count, sector_count);

	if(track_count)
		return 50;
	return 0;
}

bool esqimg_format::load(util::random_read &io, uint32_t form_factor, const std::vector<uint32_t> &variants, floppy_image *image)
{
	uint8_t track_count, head_count, sector_count;
	find_size(io, track_count, head_count, sector_count);

	uint8_t sectdata[10*512];
	desc_s sectors[10];
	for(int i=0; i<sector_count; i++) {
		sectors[i].data = sectdata + 512*i;
		sectors[i].size = 512;
		sectors[i].sector_id = i;
	}

	int track_size = sector_count*512;
	for(int track=0; track < track_count; track++) {
		for(int head=0; head < head_count; head++) {
			size_t actual;
			io.read_at((track*head_count + head)*track_size, sectdata, track_size, actual);
			generate_track(esq_10_desc, track, head, sectors, sector_count, 110528, image);
		}
	}

	image->set_variant(floppy_image::DSDD);

	return true;
}

bool esqimg_format::save(util::random_read_write &io, const std::vector<uint32_t> &variants, floppy_image *image)
{
	int track_count, head_count, sector_count;
	get_geometry_mfm_pc(image, 2000, track_count, head_count, sector_count);

	if(track_count != 80)
		track_count = 80;

	// Happens for a fully unformatted floppy
	if(!head_count)
		head_count = 2;

	if(sector_count != 10)
		sector_count = 10;

	uint8_t sectdata[11*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, 2000, 512, sector_count, sectdata);
			size_t actual;
			io.write_at((track*head_count + head)*track_size, sectdata, track_size, actual);
		}
	}

	return true;
}

const floppy_format_type FLOPPY_ESQIMG_FORMAT = &floppy_image_format_creator<esqimg_format>;