trunk/src/lib/formats/kaypro_dsk.c
| r0 | r24553 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Copyright Olivier Galibert |
| 4 | All rights reserved. |
| 5 | |
| 6 | Redistribution and use in source and binary forms, with or without |
| 7 | modification, are permitted provided that the following conditions are |
| 8 | met: |
| 9 | |
| 10 | * Redistributions of source code must retain the above copyright |
| 11 | notice, this list of conditions and the following disclaimer. |
| 12 | * Redistributions in binary form must reproduce the above copyright |
| 13 | notice, this list of conditions and the following disclaimer in |
| 14 | the documentation and/or other materials provided with the |
| 15 | distribution. |
| 16 | * Neither the name 'MAME' nor the names of its contributors may be |
| 17 | used to endorse or promote products derived from this software |
| 18 | without specific prior written permission. |
| 19 | |
| 20 | THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR |
| 21 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 23 | DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT, |
| 24 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 27 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 28 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 29 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 30 | POSSIBILITY OF SUCH DAMAGE. |
| 31 | |
| 32 | ****************************************************************************/ |
| 33 | |
| 34 | /********************************************************************* |
| 35 | |
| 36 | formats/kaypro_dsk.c |
| 37 | |
| 38 | Kaypro disk image format |
| 39 | |
| 40 | There is no inter-sector info on these disks. It is simply a |
| 41 | dump of the 512 bytes from each sector and track in order. |
| 42 | It is just like a headerless quickload. |
| 43 | |
| 44 | *********************************************************************/ |
| 45 | |
| 46 | #include "emu.h" |
| 47 | #include "formats/kaypro_dsk.h" |
| 48 | |
| 49 | kayproii_format::kayproii_format() : wd177x_format(formats) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | const char *kayproii_format::name() const |
| 54 | { |
| 55 | return "kaypro"; |
| 56 | } |
| 57 | |
| 58 | const char *kayproii_format::description() const |
| 59 | { |
| 60 | return "Kaypro disk image"; |
| 61 | } |
| 62 | |
| 63 | const char *kayproii_format::extensions() const |
| 64 | { |
| 65 | return "dsk"; |
| 66 | } |
| 67 | |
| 68 | // gap info is a total guess |
| 69 | const kayproii_format::format kayproii_format::formats[] = { |
| 70 | { /* 191K 13cm double density single sided */ |
| 71 | floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM, |
| 72 | 2000, 10, 40, 1, 512, {}, 1, {}, 32, 22, 31 |
| 73 | }, |
| 74 | {} |
| 75 | }; |
| 76 | |
| 77 | kaypro2x_format::kaypro2x_format() : wd177x_format(formats) |
| 78 | { |
| 79 | } |
| 80 | |
| 81 | const char *kaypro2x_format::name() const |
| 82 | { |
| 83 | return "kaypro"; |
| 84 | } |
| 85 | |
| 86 | const char *kaypro2x_format::description() const |
| 87 | { |
| 88 | return "Kaypro disk image"; |
| 89 | } |
| 90 | |
| 91 | const char *kaypro2x_format::extensions() const |
| 92 | { |
| 93 | return "dsk"; |
| 94 | } |
| 95 | |
| 96 | // gap info is a total guess |
| 97 | const kaypro2x_format::format kaypro2x_format::formats[] = { |
| 98 | { /* 382K 13cm double density double sided */ |
| 99 | floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, |
| 100 | 2000, 10, 80, 2, 512, {}, 1, {}, 32, 22, 31 |
| 101 | }, |
| 102 | {} |
| 103 | }; |
| 104 | |
| 105 | const floppy_format_type FLOPPY_KAYPROII_FORMAT = &floppy_image_format_creator<kayproii_format>; |
| 106 | const floppy_format_type FLOPPY_KAYPRO2X_FORMAT = &floppy_image_format_creator<kaypro2x_format>; |
trunk/src/mess/drivers/kaypro.c
| r24552 | r24553 | |
| 30 | 30 | **************************************************************************************************/ |
| 31 | 31 | |
| 32 | 32 | #include "includes/kaypro.h" |
| 33 | #include "formats/kaypro_dsk.h" |
| 33 | 34 | |
| 34 | 35 | |
| 35 | 36 | READ8_MEMBER( kaypro_state::kaypro2x_87_r ) { return 0x7f; } /* to bypass unemulated HD controller */ |
| r24552 | r24553 | |
| 176 | 177 | Machine Driver |
| 177 | 178 | |
| 178 | 179 | ************************************************************/ |
| 179 | | #if 0 |
| 180 | | static LEGACY_FLOPPY_OPTIONS_START(kayproii) |
| 181 | | LEGACY_FLOPPY_OPTION(kayproii, "dsk", "Kaypro II disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 182 | | HEADS([1]) |
| 183 | | TRACKS([40]) |
| 184 | | SECTORS([10]) |
| 185 | | SECTOR_LENGTH([512]) |
| 186 | | FIRST_SECTOR_ID([0])) |
| 187 | | LEGACY_FLOPPY_OPTIONS_END |
| 188 | 180 | |
| 189 | | static LEGACY_FLOPPY_OPTIONS_START(kaypro2x) |
| 190 | | LEGACY_FLOPPY_OPTION(kaypro2x, "dsk", "Kaypro 2x disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 191 | | HEADS([2]) |
| 192 | | TRACKS([80]) |
| 193 | | SECTORS([10]) |
| 194 | | SECTOR_LENGTH([512]) |
| 195 | | FIRST_SECTOR_ID([0])) |
| 196 | | LEGACY_FLOPPY_OPTIONS_END |
| 197 | | |
| 198 | | static const floppy_interface kayproii_floppy_interface = |
| 199 | | { |
| 200 | | DEVCB_NULL, |
| 201 | | DEVCB_NULL, |
| 202 | | DEVCB_NULL, |
| 203 | | DEVCB_NULL, |
| 204 | | DEVCB_NULL, |
| 205 | | FLOPPY_STANDARD_5_25_DSHD, |
| 206 | | LEGACY_FLOPPY_OPTIONS_NAME(kayproii), |
| 207 | | "floppy_5_25", |
| 208 | | NULL |
| 209 | | }; |
| 210 | | |
| 211 | | static const floppy_interface kaypro2x_floppy_interface = |
| 212 | | { |
| 213 | | DEVCB_LINE(wd17xx_idx_w), |
| 214 | | DEVCB_NULL, |
| 215 | | DEVCB_NULL, |
| 216 | | DEVCB_NULL, |
| 217 | | DEVCB_NULL, |
| 218 | | FLOPPY_STANDARD_5_25_DSHD, |
| 219 | | LEGACY_FLOPPY_OPTIONS_NAME(kaypro2x), |
| 220 | | "floppy_5_25", |
| 221 | | NULL |
| 222 | | }; |
| 223 | | |
| 224 | 181 | FLOPPY_FORMATS_MEMBER( kaypro_state::kayproii_floppy_formats ) |
| 225 | 182 | FLOPPY_KAYPROII_FORMAT |
| 226 | 183 | FLOPPY_FORMATS_END |
| r24552 | r24553 | |
| 228 | 185 | FLOPPY_FORMATS_MEMBER( kaypro_state::kaypro2x_floppy_formats ) |
| 229 | 186 | FLOPPY_KAYPRO2X_FORMAT |
| 230 | 187 | FLOPPY_FORMATS_END |
| 231 | | #endif |
| 232 | 188 | |
| 233 | 189 | static SLOT_INTERFACE_START( kaypro_floppies ) |
| 234 | 190 | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| r24552 | r24553 | |
| 272 | 228 | MCFG_Z80SIO_ADD( "z80sio", 4800, kaypro_sio_intf ) /* start at 300 baud */ |
| 273 | 229 | |
| 274 | 230 | MCFG_FD1793x_ADD("fdc", XTAL_20MHz / 20) |
| 275 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 276 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 231 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "525dd", kaypro_state::kayproii_floppy_formats) |
| 232 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "525dd", kaypro_state::kayproii_floppy_formats) |
| 277 | 233 | MCFG_SOFTWARE_LIST_ADD("flop_list","kayproii") |
| 278 | 234 | MACHINE_CONFIG_END |
| 279 | 235 | |
| r24552 | r24553 | |
| 317 | 273 | MCFG_Z80SIO_ADD( "z80sio", 4800, kaypro_sio_intf ) |
| 318 | 274 | MCFG_Z80SIO_ADD( "z80sio_2x", 4800, kaypro_sio_intf ) /* extra sio for modem and printer */ |
| 319 | 275 | MCFG_FD1793x_ADD("fdc", XTAL_16MHz / 16) |
| 320 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 321 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 276 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", kaypro_floppies, "525dd", kaypro_state::kaypro2x_floppy_formats) |
| 277 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", kaypro_floppies, "525dd", kaypro_state::kaypro2x_floppy_formats) |
| 322 | 278 | MACHINE_CONFIG_END |
| 323 | 279 | |
| 324 | 280 | static MACHINE_CONFIG_DERIVED( omni2, kaypro4 ) |