From 643d5fafe72493305f12d24db1af38ec37ad9fff Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Mon, 20 Apr 2015 22:34:31 +0300 Subject: (MESS) Added sector image format for the Commodore 8280 8" floppy drive. [Curt Coder] --- scripts/src/lib.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 557e9e7316c..96ab4c3cad2 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -157,6 +157,8 @@ project "formats" MAME_DIR .. "src/lib/formats/bw2_dsk.h", MAME_DIR .. "src/lib/formats/bw12_dsk.c", MAME_DIR .. "src/lib/formats/bw12_dsk.h", + MAME_DIR .. "src/lib/formats/c8280_dsk.c", + MAME_DIR .. "src/lib/formats/c8280_dsk.h", MAME_DIR .. "src/lib/formats/cbm_crt.c", MAME_DIR .. "src/lib/formats/cbm_crt.h", MAME_DIR .. "src/lib/formats/cbm_tap.c", -- cgit v1.2.3-70-g09d2 From e7967e81b9ceb5a730814dafa33f5a02607faaf7 Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Tue, 21 Apr 2015 22:25:44 +0300 Subject: (MESS) c4040: Added own sector dump disk format since it's different from what the 1541 uses. [Curt Coder] --- scripts/src/lib.lua | 2 + src/emu/bus/ieee488/c2040.c | 131 ++++++++++++++++++++++++++++++----------- src/emu/bus/ieee488/c2040.h | 3 + src/emu/bus/ieee488/c2040fdc.h | 1 + src/lib/formats/c4040_dsk.c | 91 ++++++++++++++++++++++++++++ src/lib/formats/c4040_dsk.h | 38 ++++++++++++ src/lib/formats/d64_dsk.c | 3 +- src/lib/formats/d64_dsk.h | 1 + 8 files changed, 233 insertions(+), 37 deletions(-) create mode 100644 src/lib/formats/c4040_dsk.c create mode 100644 src/lib/formats/c4040_dsk.h (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 96ab4c3cad2..e3dc7c6064a 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -157,6 +157,8 @@ project "formats" MAME_DIR .. "src/lib/formats/bw2_dsk.h", MAME_DIR .. "src/lib/formats/bw12_dsk.c", MAME_DIR .. "src/lib/formats/bw12_dsk.h", + MAME_DIR .. "src/lib/formats/c4040_dsk.c", + MAME_DIR .. "src/lib/formats/c4040_dsk.h", MAME_DIR .. "src/lib/formats/c8280_dsk.c", MAME_DIR .. "src/lib/formats/c8280_dsk.h", MAME_DIR .. "src/lib/formats/cbm_crt.c", diff --git a/src/emu/bus/ieee488/c2040.c b/src/emu/bus/ieee488/c2040.c index d12be0795a3..bb012afa92a 100644 --- a/src/emu/bus/ieee488/c2040.c +++ b/src/emu/bus/ieee488/c2040.c @@ -9,6 +9,34 @@ **********************************************************************/ +/* + + 2040/3040 disk initialization + ----------------------------- + You need to initialize each diskette before trying to access it + or you will get a DISK ID MISMATCH error upon disk commands. + On the 4040 this is done automatically by the DOS. + + open 15,8,15:print 15,"i":close 15 + + List directory + -------------- + directory / diR + + Format disk + ----------- + header "label,id",d0,i01 + + Load file + --------- + dload "name" / dL"name + + Save file + --------- + dsave "name" / dS"name + +*/ + /* TODO: @@ -53,19 +81,14 @@ const device_type C4040 = &device_creator; // ROM( c2040 ) //------------------------------------------------- -ROM_START( c2040 ) // schematic 320806 +ROM_START( c2040 ) // schematic 320806, DOS 1.0 ROM_REGION( 0x3000, M6502_TAG, 0 ) ROM_DEFAULT_BIOS("dos12") - ROM_SYSTEM_BIOS( 0, "dos10", "DOS 1.0" ) - ROMX_LOAD( "901468-xx.ul1", 0x1000, 0x1000, NO_DUMP, ROM_BIOS(1) ) - ROMX_LOAD( "901468-xx.uh1", 0x2000, 0x1000, NO_DUMP, ROM_BIOS(1) ) - ROM_SYSTEM_BIOS( 1, "dos12", "DOS 1.2" ) - ROMX_LOAD( "901468-06.ul1", 0x1000, 0x1000, CRC(25b5eed5) SHA1(4d9658f2e6ff3276e5c6e224611a66ce44b16fc7), ROM_BIOS(2) ) - ROMX_LOAD( "901468-07.uh1", 0x2000, 0x1000, CRC(9b09ae83) SHA1(6a51c7954938439ca8342fc295bda050c06e1791), ROM_BIOS(2) ) + ROM_LOAD( "901468-xx.ul1", 0x1000, 0x1000, NO_DUMP ) + ROM_LOAD( "901468-xx.uh1", 0x2000, 0x1000, NO_DUMP ) ROM_REGION( 0x400, M6504_TAG, 0 ) - ROMX_LOAD( "901466-01.uk3", 0x000, 0x400, CRC(9d1e25ce) SHA1(d539858f839f96393f218307df7394362a84a26a), ROM_BIOS(1) ) - ROMX_LOAD( "901466-02.uk3", 0x000, 0x400, CRC(9d1e25ce) SHA1(d539858f839f96393f218307df7394362a84a26a), ROM_BIOS(2) ) + ROM_LOAD( "901466-01.uk3", 0x000, 0x400, CRC(9d1e25ce) SHA1(d539858f839f96393f218307df7394362a84a26a) ) ROM_REGION( 0x800, "gcr", 0) ROM_LOAD( "901467.uk6", 0x000, 0x800, CRC(a23337eb) SHA1(97df576397608455616331f8e837cb3404363fa2) ) @@ -82,6 +105,33 @@ const rom_entry *c2040_device::device_rom_region() const } +//------------------------------------------------- +// ROM( c3040 ) +//------------------------------------------------- + +ROM_START( c3040 ) // schematic 320806, DOS 1.2 + ROM_REGION( 0x3000, M6502_TAG, 0 ) + ROM_LOAD( "901468-06.ul1", 0x1000, 0x1000, CRC(25b5eed5) SHA1(4d9658f2e6ff3276e5c6e224611a66ce44b16fc7) ) + ROM_LOAD( "901468-07.uh1", 0x2000, 0x1000, CRC(9b09ae83) SHA1(6a51c7954938439ca8342fc295bda050c06e1791) ) + + ROM_REGION( 0x400, M6504_TAG, 0 ) + ROM_LOAD( "901466-02.uk3", 0x000, 0x400, CRC(9d1e25ce) SHA1(d539858f839f96393f218307df7394362a84a26a) ) + + ROM_REGION( 0x800, "gcr", 0) + ROM_LOAD( "901467.uk6", 0x000, 0x800, CRC(a23337eb) SHA1(97df576397608455616331f8e837cb3404363fa2) ) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const rom_entry *c3040_device::device_rom_region() const +{ + return ROM_NAME( c3040 ); +} + + //------------------------------------------------- // ROM( c4040 ) //------------------------------------------------- @@ -434,9 +484,18 @@ SLOT_INTERFACE_END //------------------------------------------------- FLOPPY_FORMATS_MEMBER( c2040_device::floppy_formats ) - FLOPPY_D64_FORMAT, - FLOPPY_G64_FORMAT, - FLOPPY_D67_FORMAT + FLOPPY_D67_FORMAT, + FLOPPY_G64_FORMAT +FLOPPY_FORMATS_END + + +//------------------------------------------------- +// FLOPPY_FORMATS( floppy_formats ) +//------------------------------------------------- + +FLOPPY_FORMATS_MEMBER( c4040_device::floppy_formats ) + FLOPPY_C4040_FORMAT, + FLOPPY_G64_FORMAT FLOPPY_FORMATS_END @@ -532,8 +591,8 @@ static MACHINE_CONFIG_FRAGMENT( c4040 ) MCFG_DEVICE_ADD(FDC_TAG, C2040_FDC, XTAL_16MHz) MCFG_C2040_READY_CALLBACK(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1)) MCFG_C2040_ERROR_CALLBACK(DEVWRITELINE(M6522_TAG, via6522_device, write_cb1)) - MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":0", c2040_floppies, "525ssqd", c2040_device::floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":1", c2040_floppies, "525ssqd", c2040_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":0", c2040_floppies, "525ssqd", c4040_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":1", c2040_floppies, "525ssqd", c4040_device::floppy_formats) MACHINE_CONFIG_END @@ -605,24 +664,24 @@ inline void c2040_device::update_ieee_signals() // c2040_device - constructor //------------------------------------------------- -c2040_device::c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) - : device_t(mconfig, type, name, tag, owner, clock, shortname, source), - device_ieee488_interface(mconfig, *this), - m_maincpu(*this, M6502_TAG), - m_fdccpu(*this, M6504_TAG), - m_riot0(*this, M6532_0_TAG), - m_riot1(*this, M6532_1_TAG), - m_miot(*this, M6530_TAG), - m_via(*this, M6522_TAG), - m_floppy0(*this, FDC_TAG":0:525ssqd"), - m_floppy1(*this, FDC_TAG":1:525ssqd"), - m_fdc(*this, FDC_TAG), - m_gcr(*this, "gcr"), - m_address(*this, "ADDRESS"), - m_rfdo(1), - m_daco(1), - m_atna(1), - m_miot_irq(CLEAR_LINE) +c2040_device::c2040_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : + device_t(mconfig, type, name, tag, owner, clock, shortname, source), + device_ieee488_interface(mconfig, *this), + m_maincpu(*this, M6502_TAG), + m_fdccpu(*this, M6504_TAG), + m_riot0(*this, M6532_0_TAG), + m_riot1(*this, M6532_1_TAG), + m_miot(*this, M6530_TAG), + m_via(*this, M6522_TAG), + m_floppy0(*this, FDC_TAG":0:525ssqd"), + m_floppy1(*this, FDC_TAG":1:525ssqd"), + m_fdc(*this, FDC_TAG), + m_gcr(*this, "gcr"), + m_address(*this, "ADDRESS"), + m_rfdo(1), + m_daco(1), + m_atna(1), + m_miot_irq(CLEAR_LINE) { } @@ -652,16 +711,16 @@ c2040_device::c2040_device(const machine_config &mconfig, const char *tag, devic // c3040_device - constructor //------------------------------------------------- -c3040_device::c3040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : c2040_device(mconfig, C3040, "C3040", tag, owner, clock, "c3040", __FILE__) { } +c3040_device::c3040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + c2040_device(mconfig, C3040, "C3040", tag, owner, clock, "c3040", __FILE__) { } //------------------------------------------------- // c4040_device - constructor //------------------------------------------------- -c4040_device::c4040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : c2040_device(mconfig, C4040, "C4040", tag, owner, clock, "c4040", __FILE__) { } +c4040_device::c4040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + c2040_device(mconfig, C4040, "C4040", tag, owner, clock, "c4040", __FILE__) { } //------------------------------------------------- diff --git a/src/emu/bus/ieee488/c2040.h b/src/emu/bus/ieee488/c2040.h index c99731d27d9..020a436a9ac 100644 --- a/src/emu/bus/ieee488/c2040.h +++ b/src/emu/bus/ieee488/c2040.h @@ -107,6 +107,9 @@ class c3040_device : public c2040_device public: // construction/destruction c3040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual const rom_entry *device_rom_region() const; }; diff --git a/src/emu/bus/ieee488/c2040fdc.h b/src/emu/bus/ieee488/c2040fdc.h index d64d2de7c01..31b3c38affa 100644 --- a/src/emu/bus/ieee488/c2040fdc.h +++ b/src/emu/bus/ieee488/c2040fdc.h @@ -15,6 +15,7 @@ #define __C2040_FLOPPY__ #include "emu.h" +#include "formats/c4040_dsk.h" #include "formats/d64_dsk.h" #include "formats/d67_dsk.h" #include "formats/g64_dsk.h" diff --git a/src/lib/formats/c4040_dsk.c b/src/lib/formats/c4040_dsk.c new file mode 100644 index 00000000000..da3ac905693 --- /dev/null +++ b/src/lib/formats/c4040_dsk.c @@ -0,0 +1,91 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************* + + formats/c4040_dsk.c + + Commodore 4040 sector disk image format + +*********************************************************************/ + +#include + +#include "formats/c4040_dsk.h" + +c4040_format::c4040_format() : d64_format(file_formats) +{ +} + +const char *c4040_format::name() const +{ + return "c4040"; +} + +const char *c4040_format::description() const +{ + return "Commodore 4040 disk image"; +} + +const char *c4040_format::extensions() const +{ + return "d64"; +} + +const c4040_format::format c4040_format::file_formats[] = { + { // c4040, dos 2, 35 tracks, head 48 tpi, stepper 96 tpi + floppy_image::FF_525, floppy_image::SSSD, 683, 35, 1, 256, 9, 8 + }, + {} +}; + +const int c4040_format::c4040_gap2[] = +{ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, // 1-17 + 19, 19, 19, 19, 19, 19, 19, // 18-24 + 15, 15, 15, 15, 15, 15, // 25-30 + 12, 12, 12, 12, 12 // 31-35 +}; + +floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +{ + static floppy_image_format_t::desc_e desc[] = { + /* 00 */ { SECTOR_LOOP_START, 0, -1 }, + /* 01 */ { RAWBYTE, 0xff, 5 }, + /* 02 */ { GCR5, 0x08, 1 }, + /* 03 */ { CRC, 1 }, + /* 04 */ { CRC_CBM_START, 1 }, + /* 05 */ { SECTOR_ID_GCR5 }, + /* 06 */ { TRACK_ID_DOS2_GCR5 }, + /* 07 */ { GCR5, id2, 1 }, + /* 08 */ { GCR5, id1, 1 }, + /* 09 */ { CRC_END, 1 }, + /* 10 */ { GCR5, 0x00, f.gap_1 }, + /* 11 */ { RAWBYTE, 0xff, 5 }, + /* 12 */ { GCR5, 0x07, 1 }, + /* 13 */ { CRC_CBM_START, 2 }, + /* 14 */ { SECTOR_DATA_GCR5, -1 }, + /* 15 */ { CRC_END, 2 }, + /* 16 */ { CRC, 2 }, + /* 17 */ { GCR5, 0x00, gap_2 }, + /* 18 */ { SECTOR_LOOP_END }, + /* 19 */ { GCR5, 0x00, 0 }, + /* 20 */ { RAWBITS, 0x14a, 0 }, + /* 21 */ { END } + }; + + desc[17].p2 = gap_2; // TODO why?!? + + current_size = 40 + (1+1+4)*10 + f.gap_1*10 + 40 + (1+f.sector_base_size+1)*10 + gap_2*10; + + current_size *= sector_count; + return desc; +} + +void c4040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +{ + desc[19].p2 = remaining_size / 10; + desc[20].p2 = remaining_size % 10; + desc[20].p1 >>= remaining_size & 0x01; +} + +const floppy_format_type FLOPPY_C4040_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/c4040_dsk.h b/src/lib/formats/c4040_dsk.h new file mode 100644 index 00000000000..231b961c765 --- /dev/null +++ b/src/lib/formats/c4040_dsk.h @@ -0,0 +1,38 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************* + + formats/c4040_dsk.h + + Commodore 4040 sector disk image format + +*********************************************************************/ + +#ifndef C4040_DSK_H_ +#define C4040_DSK_H_ + +#include "d64_dsk.h" + +class c4040_format : public d64_format { +public: + c4040_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +protected: + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); + virtual int get_gap2(const format &f, int head, int track) { return c4040_gap2[track]; } + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size); + + static const format file_formats[]; + + static const int c4040_gap2[]; +}; + +extern const floppy_format_type FLOPPY_C4040_FORMAT; + + + +#endif diff --git a/src/lib/formats/d64_dsk.c b/src/lib/formats/d64_dsk.c index e5ffc9d15d9..4de63b34bc8 100644 --- a/src/lib/formats/d64_dsk.c +++ b/src/lib/formats/d64_dsk.c @@ -239,8 +239,9 @@ bool d64_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) int physical_track = this->get_physical_track(f, head, track); int sector_count = this->get_sectors_per_track(f, track); int track_size = sector_count*f.sector_base_size; + int gap2 = this->get_gap2(f, head, track); - floppy_image_format_t::desc_e *desc = this->get_sector_desc(f, current_size, sector_count, id1, id2, f.gap_2); + floppy_image_format_t::desc_e *desc = this->get_sector_desc(f, current_size, sector_count, id1, id2, gap2); int remaining_size = total_size - current_size; if(remaining_size < 0) diff --git a/src/lib/formats/d64_dsk.h b/src/lib/formats/d64_dsk.h index 9d6add2817e..558d4ebf1c2 100644 --- a/src/lib/formats/d64_dsk.h +++ b/src/lib/formats/d64_dsk.h @@ -66,6 +66,7 @@ protected: void get_disk_id(const format &f, io_generic *io, UINT8 &id1, UINT8 &id2); virtual int get_image_offset(const format &f, int head, int track); int compute_track_size(const format &f, int track); + virtual int get_gap2(const format &f, int head, int track) { return f.gap_2; } virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); void build_sector_description(const format &f, UINT8 *sectdata, UINT32 sect_offs, UINT32 error_offs, desc_s *sectors, int sector_count) const; virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size); -- cgit v1.2.3-70-g09d2 From 67d09b16e9c3bfdbbbd5badebb34ce1dd2aba01a Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Tue, 21 Apr 2015 23:52:22 +0300 Subject: (MESS) c3040: Disk format WIP. (nw) --- scripts/src/lib.lua | 4 +- src/emu/bus/ieee488/c2040.c | 66 ++++++++++++++++++++++++++- src/emu/bus/ieee488/c2040.h | 3 ++ src/emu/bus/ieee488/c2040fdc.h | 2 +- src/lib/formats/c3040_dsk.c | 101 +++++++++++++++++++++++++++++++++++++++++ src/lib/formats/c3040_dsk.h | 40 ++++++++++++++++ src/lib/formats/c4040_dsk.c | 4 +- src/lib/formats/d64_dsk.c | 2 +- src/lib/formats/d67_dsk.c | 56 ----------------------- src/lib/formats/d67_dsk.h | 36 --------------- 10 files changed, 215 insertions(+), 99 deletions(-) create mode 100644 src/lib/formats/c3040_dsk.c create mode 100644 src/lib/formats/c3040_dsk.h delete mode 100644 src/lib/formats/d67_dsk.c delete mode 100644 src/lib/formats/d67_dsk.h (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index e3dc7c6064a..5f809256072 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -157,6 +157,8 @@ project "formats" MAME_DIR .. "src/lib/formats/bw2_dsk.h", MAME_DIR .. "src/lib/formats/bw12_dsk.c", MAME_DIR .. "src/lib/formats/bw12_dsk.h", + MAME_DIR .. "src/lib/formats/c3040_dsk.c", + MAME_DIR .. "src/lib/formats/c3040_dsk.h", MAME_DIR .. "src/lib/formats/c4040_dsk.c", MAME_DIR .. "src/lib/formats/c4040_dsk.h", MAME_DIR .. "src/lib/formats/c8280_dsk.c", @@ -187,8 +189,6 @@ project "formats" MAME_DIR .. "src/lib/formats/csw_cas.h", MAME_DIR .. "src/lib/formats/d64_dsk.c", MAME_DIR .. "src/lib/formats/d64_dsk.h", - MAME_DIR .. "src/lib/formats/d67_dsk.c", - MAME_DIR .. "src/lib/formats/d67_dsk.h", MAME_DIR .. "src/lib/formats/d71_dsk.c", MAME_DIR .. "src/lib/formats/d71_dsk.h", MAME_DIR .. "src/lib/formats/d80_dsk.c", diff --git a/src/emu/bus/ieee488/c2040.c b/src/emu/bus/ieee488/c2040.c index bb012afa92a..4eb7c265660 100644 --- a/src/emu/bus/ieee488/c2040.c +++ b/src/emu/bus/ieee488/c2040.c @@ -484,7 +484,17 @@ SLOT_INTERFACE_END //------------------------------------------------- FLOPPY_FORMATS_MEMBER( c2040_device::floppy_formats ) - FLOPPY_D67_FORMAT, + FLOPPY_C3040_FORMAT, + FLOPPY_G64_FORMAT +FLOPPY_FORMATS_END + + +//------------------------------------------------- +// FLOPPY_FORMATS( floppy_formats ) +//------------------------------------------------- + +FLOPPY_FORMATS_MEMBER( c3040_device::floppy_formats ) + FLOPPY_C3040_FORMAT, FLOPPY_G64_FORMAT FLOPPY_FORMATS_END @@ -553,6 +563,60 @@ machine_config_constructor c2040_device::device_mconfig_additions() const } +//------------------------------------------------- +// MACHINE_CONFIG_FRAGMENT( c3040 ) +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( c3040 ) + // DOS + MCFG_CPU_ADD(M6502_TAG, M6502, XTAL_16MHz/16) + MCFG_CPU_PROGRAM_MAP(c2040_main_mem) + + MCFG_DEVICE_ADD(M6532_0_TAG, RIOT6532, XTAL_16MHz/16) + MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, dio_r)) + MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, dio_w)) + + MCFG_DEVICE_ADD(M6532_1_TAG, RIOT6532, XTAL_16MHz/16) + MCFG_RIOT6532_IN_PA_CB(READ8(c2040_device, riot1_pa_r)) + MCFG_RIOT6532_OUT_PA_CB(WRITE8(c2040_device, riot1_pa_w)) + MCFG_RIOT6532_IN_PB_CB(READ8(c2040_device, riot1_pb_r)) + MCFG_RIOT6532_OUT_PB_CB(WRITE8(c2040_device, riot1_pb_w)) + MCFG_RIOT6532_IRQ_CB(INPUTLINE(M6502_TAG, INPUT_LINE_IRQ0)) + + // controller + MCFG_CPU_ADD(M6504_TAG, M6504, XTAL_16MHz/16) + MCFG_CPU_PROGRAM_MAP(c2040_fdc_mem) + + MCFG_DEVICE_ADD(M6522_TAG, VIA6522, XTAL_16MHz/16) + MCFG_VIA6522_READPA_HANDLER(DEVREAD8(FDC_TAG, c2040_fdc_t, read)) + MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(c2040_device, via_pb_w)) + MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE(FDC_TAG, c2040_fdc_t, mode_sel_w)) + MCFG_VIA6522_CB2_HANDLER(DEVWRITELINE(FDC_TAG, c2040_fdc_t, rw_sel_w)) + + MCFG_DEVICE_ADD(M6530_TAG, MOS6530, XTAL_16MHz/16) + MCFG_MOS6530_OUT_PA_CB(DEVWRITE8(FDC_TAG, c2040_fdc_t, write)) + MCFG_MOS6530_IN_PB_CB(READ8(c2040_device, miot_pb_r)) + MCFG_MOS6530_OUT_PB_CB(WRITE8(c2040_device, miot_pb_w)) + + MCFG_DEVICE_ADD(FDC_TAG, C2040_FDC, XTAL_16MHz) + MCFG_C2040_READY_CALLBACK(DEVWRITELINE(M6522_TAG, via6522_device, write_ca1)) + MCFG_C2040_ERROR_CALLBACK(DEVWRITELINE(M6522_TAG, via6522_device, write_cb1)) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":0", c2040_floppies, "525ssqd", c3040_device::floppy_formats) + MCFG_FLOPPY_DRIVE_ADD(FDC_TAG":1", c2040_floppies, "525ssqd", c3040_device::floppy_formats) +MACHINE_CONFIG_END + + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +machine_config_constructor c3040_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( c3040 ); +} + + //------------------------------------------------- // MACHINE_CONFIG_FRAGMENT( c4040 ) //------------------------------------------------- diff --git a/src/emu/bus/ieee488/c2040.h b/src/emu/bus/ieee488/c2040.h index 020a436a9ac..2664a2ffdd8 100644 --- a/src/emu/bus/ieee488/c2040.h +++ b/src/emu/bus/ieee488/c2040.h @@ -110,6 +110,9 @@ public: // optional information overrides virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + + DECLARE_FLOPPY_FORMATS( floppy_formats ); }; diff --git a/src/emu/bus/ieee488/c2040fdc.h b/src/emu/bus/ieee488/c2040fdc.h index 31b3c38affa..382c540d4e4 100644 --- a/src/emu/bus/ieee488/c2040fdc.h +++ b/src/emu/bus/ieee488/c2040fdc.h @@ -15,9 +15,9 @@ #define __C2040_FLOPPY__ #include "emu.h" +#include "formats/c3040_dsk.h" #include "formats/c4040_dsk.h" #include "formats/d64_dsk.h" -#include "formats/d67_dsk.h" #include "formats/g64_dsk.h" #include "imagedev/floppy.h" diff --git a/src/lib/formats/c3040_dsk.c b/src/lib/formats/c3040_dsk.c new file mode 100644 index 00000000000..dd1d3ee5817 --- /dev/null +++ b/src/lib/formats/c3040_dsk.c @@ -0,0 +1,101 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************* + + formats/c3040_dsk.c + + Commodore 3040 sector disk image format + +*********************************************************************/ + +#include + +#include "formats/c3040_dsk.h" + +c3040_format::c3040_format() : d64_format(file_formats) +{ +} + +const char *c3040_format::name() const +{ + return "c3040"; +} + +const char *c3040_format::description() const +{ + return "Commodore 3040 disk image"; +} + +const char *c3040_format::extensions() const +{ + return "d67"; +} + +const c3040_format::format c3040_format::file_formats[] = { + { // d67, dos 1, 35 tracks, head 48 tpi, stepper 96 tpi + floppy_image::FF_525, floppy_image::SSSD, 690, 35, 1, 256, 9, 8 + }, + {} +}; + +const int c3040_format::c3040_sectors_per_track[] = +{ + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, // 1-17 + 20, 20, 20, 20, 20, 20, 20, // 18-24 + 18, 18, 18, 18, 18, 18, // 25-30 + 17, 17, 17, 17, 17, // 31-35 + 17, 17, 17, 17, 17, // 36-40 + 17, 17 // 41-42 +}; + +const int c3040_format::c3040_gap2[] = +{ + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, // 1-17 + 8, 8, 8, 8, 8, 8, 8, // 18-24 + 15, 15, 15, 15, 15, 15, // 25-30 + 12, 12, 12, 12, 12 // 31-35 +}; + +floppy_image_format_t::desc_e* c3040_format::get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2) +{ + static floppy_image_format_t::desc_e desc[] = { + /* 00 */ { SECTOR_LOOP_START, 0, -1 }, + /* 01 */ { SYNC_GCR5, 2 }, + /* 02 */ { GCR5, 0x08, 1 }, + /* 03 */ { CRC, 1 }, + /* 04 */ { CRC_CBM_START, 1 }, + /* 05 */ { SECTOR_ID_GCR5 }, + /* 06 */ { TRACK_ID_DOS2_GCR5 }, + /* 07 */ { GCR5, id2, 1 }, + /* 08 */ { GCR5, id1, 1 }, + /* 09 */ { CRC_END, 1 }, + /* 10 */ { GCR5, 0x00, f.gap_1 }, + /* 11 */ { SYNC_GCR5, 2 }, + /* 12 */ { GCR5, 0x07, 1 }, + /* 13 */ { CRC_CBM_START, 2 }, + /* 14 */ { SECTOR_DATA_GCR5, -1 }, + /* 15 */ { CRC_END, 2 }, + /* 16 */ { CRC, 2 }, + /* 17 */ { GCR5, 0x00, gap_2 }, + /* 18 */ { SECTOR_LOOP_END }, + /* 19 */ { GCR5, 0x00, 0 }, + /* 20 */ { RAWBITS, 0x14a, 0 }, + /* 21 */ { END } + }; + + desc[17].p2 = gap_2; // TODO why?!? + + current_size = 20 + (1+1+4)*10 + f.gap_1*10 + 20 + (1+f.sector_base_size+1)*10 + gap_2*10; + + current_size *= sector_count; + return desc; +} + +void c3040_format::fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size) +{ + desc[19].p2 = remaining_size / 10; + desc[20].p2 = remaining_size % 10; + desc[20].p1 >>= remaining_size & 0x01; +} + +const floppy_format_type FLOPPY_C3040_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/c3040_dsk.h b/src/lib/formats/c3040_dsk.h new file mode 100644 index 00000000000..cbf320273a8 --- /dev/null +++ b/src/lib/formats/c3040_dsk.h @@ -0,0 +1,40 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************* + + formats/c3040_dsk.h + + Commodore 3040 sector disk image format + +*********************************************************************/ + +#ifndef C3040_DSK_H_ +#define C3040_DSK_H_ + +#include "d64_dsk.h" + +class c3040_format : public d64_format { +public: + c3040_format(); + + virtual const char *name() const; + virtual const char *description() const; + virtual const char *extensions() const; + +protected: + virtual int get_sectors_per_track(const format &f, int track) { return c3040_sectors_per_track[track]; } + virtual floppy_image_format_t::desc_e* get_sector_desc(const format &f, int ¤t_size, int sector_count, UINT8 id1, UINT8 id2, int gap_2); + virtual int get_gap2(const format &f, int head, int track) { return c3040_gap2[track]; } + virtual void fix_end_gap(floppy_image_format_t::desc_e* desc, int remaining_size); + + static const format file_formats[]; + + static const int c3040_gap2[]; + static const int c3040_sectors_per_track[]; +}; + +extern const floppy_format_type FLOPPY_C3040_FORMAT; + + + +#endif diff --git a/src/lib/formats/c4040_dsk.c b/src/lib/formats/c4040_dsk.c index da3ac905693..4def7e0c581 100644 --- a/src/lib/formats/c4040_dsk.c +++ b/src/lib/formats/c4040_dsk.c @@ -50,7 +50,7 @@ floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, in { static floppy_image_format_t::desc_e desc[] = { /* 00 */ { SECTOR_LOOP_START, 0, -1 }, - /* 01 */ { RAWBYTE, 0xff, 5 }, + /* 01 */ { SYNC_GCR5, 4 }, /* 02 */ { GCR5, 0x08, 1 }, /* 03 */ { CRC, 1 }, /* 04 */ { CRC_CBM_START, 1 }, @@ -60,7 +60,7 @@ floppy_image_format_t::desc_e* c4040_format::get_sector_desc(const format &f, in /* 08 */ { GCR5, id1, 1 }, /* 09 */ { CRC_END, 1 }, /* 10 */ { GCR5, 0x00, f.gap_1 }, - /* 11 */ { RAWBYTE, 0xff, 5 }, + /* 11 */ { SYNC_GCR5, 4 }, /* 12 */ { GCR5, 0x07, 1 }, /* 13 */ { CRC_CBM_START, 2 }, /* 14 */ { SECTOR_DATA_GCR5, -1 }, diff --git a/src/lib/formats/d64_dsk.c b/src/lib/formats/d64_dsk.c index 4de63b34bc8..531ce441b99 100644 --- a/src/lib/formats/d64_dsk.c +++ b/src/lib/formats/d64_dsk.c @@ -272,7 +272,7 @@ bool d64_format::save(io_generic *io, floppy_image *image) for(int track=0; track < f.track_count; track++) { int sector_count = this->get_sectors_per_track(f, track); int track_size = compute_track_size(f, track); - UINT8 sectdata[40*256]; + UINT8 sectdata[40*256] = { 0 }; desc_s sectors[40]; int offset = get_image_offset(f, head, track); diff --git a/src/lib/formats/d67_dsk.c b/src/lib/formats/d67_dsk.c deleted file mode 100644 index b512e55b694..00000000000 --- a/src/lib/formats/d67_dsk.c +++ /dev/null @@ -1,56 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Curt Coder -/********************************************************************* - - formats/d67_dsk.c - - Commodore 2040 sector disk image format - -*********************************************************************/ - -#include - -#include "formats/d67_dsk.h" - -d67_format::d67_format() : d64_format(file_formats) -{ -} - -const char *d67_format::name() const -{ - return "d67"; -} - -const char *d67_format::description() const -{ - return "Commodore 2040 disk image"; -} - -const char *d67_format::extensions() const -{ - return "d67"; -} - -const d67_format::format d67_format::file_formats[] = { - { // d67, dos 1, 35 tracks, head 48 tpi, stepper 96 tpi - floppy_image::FF_525, floppy_image::SSSD, 690, 35, 1, 256, 9, 8 - }, - {} -}; - -const int d67_format::d67_sectors_per_track[] = -{ - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, // 1-17 - 20, 20, 20, 20, 20, 20, 20, // 18-24 - 18, 18, 18, 18, 18, 18, // 25-30 - 17, 17, 17, 17, 17, // 31-35 - 17, 17, 17, 17, 17, // 36-40 - 17, 17 // 41-42 -}; - -int d67_format::get_sectors_per_track(const format &f, int track) -{ - return d67_sectors_per_track[track]; -} - -const floppy_format_type FLOPPY_D67_FORMAT = &floppy_image_format_creator; diff --git a/src/lib/formats/d67_dsk.h b/src/lib/formats/d67_dsk.h deleted file mode 100644 index c28c1a4d37f..00000000000 --- a/src/lib/formats/d67_dsk.h +++ /dev/null @@ -1,36 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Curt Coder -/********************************************************************* - - formats/d67_dsk.h - - Commodore 2040 sector disk image format - -*********************************************************************/ - -#ifndef D67_DSK_H_ -#define D67_DSK_H_ - -#include "d64_dsk.h" - -class d67_format : public d64_format { -public: - d67_format(); - - virtual const char *name() const; - virtual const char *description() const; - virtual const char *extensions() const; - -protected: - virtual int get_sectors_per_track(const format &f, int track); - - static const format file_formats[]; - - static const int d67_sectors_per_track[]; -}; - -extern const floppy_format_type FLOPPY_D67_FORMAT; - - - -#endif -- cgit v1.2.3-70-g09d2 From eb2a14b153ce0f4b73656536a41c3faf3270cf8b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 22 Apr 2015 13:26:18 +0200 Subject: fix --- scripts/src/lib.lua | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts/src/lib.lua') diff --git a/scripts/src/lib.lua b/scripts/src/lib.lua index 5f809256072..147099a07df 100644 --- a/scripts/src/lib.lua +++ b/scripts/src/lib.lua @@ -17,8 +17,6 @@ project "utils" files { MAME_DIR .. "src/lib/util/bitstream.h", MAME_DIR .. "src/lib/util/coretmpl.h", - MAME_DIR .. "src/lib/util/astring.c", - MAME_DIR .. "src/lib/util/astring.h", MAME_DIR .. "src/lib/util/avhuff.c", MAME_DIR .. "src/lib/util/avhuff.h", MAME_DIR .. "src/lib/util/aviio.c", -- cgit v1.2.3-70-g09d2