src/lib/formats/hect_dsk.c
| r0 | r11917 | |
| 1 | /********************************************************************* |
| 2 | |
| 3 | formats/hect_dsk.c |
| 4 | |
| 5 | Hector disk images |
| 6 | |
| 7 | *********************************************************************/ |
| 8 | |
| 9 | #include "formats/hect_dsk.h" |
| 10 | #include "formats/basicdsk.h" |
| 11 | |
| 12 | /*****************************************************************************/ |
| 13 | /****** Management of the floppy images 200Ko and 800Ko *********************/ |
| 14 | /*****************************************************************************/ |
| 15 | /* For the 200Ko disk : |
| 16 | 512 bytes per sectors, |
| 17 | 10 sector per track, |
| 18 | From sector =0 to sector 9, |
| 19 | 40 tracks, |
| 20 | 1 Head |
| 21 | This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE2). |
| 22 | */ |
| 23 | static FLOPPY_IDENTIFY(hector_disc2_dsk200_identify) |
| 24 | { |
| 25 | *vote = (floppy_image_size(floppy) == (1*40*10*512)) ? 100 : 0; |
| 26 | return FLOPPY_ERROR_SUCCESS; |
| 27 | } |
| 28 | |
| 29 | static FLOPPY_CONSTRUCT(hector_disc2_dsk200_construct) |
| 30 | { |
| 31 | struct basicdsk_geometry geometry; |
| 32 | memset(&geometry, 0, sizeof(geometry)); |
| 33 | geometry.heads = 1; |
| 34 | geometry.first_sector_id = 0; |
| 35 | geometry.sector_length = 512; |
| 36 | geometry.tracks = 40; |
| 37 | geometry.sectors = 10; |
| 38 | return basicdsk_construct(floppy, &geometry); |
| 39 | } |
| 40 | /* For the 720Ko disk : |
| 41 | 512 bytes per sectors, |
| 42 | 9 sector per track, |
| 43 | From sector =0 to sector 8, |
| 44 | 80 tracks, |
| 45 | 2 Head |
| 46 | This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE7). |
| 47 | */ |
| 48 | static FLOPPY_IDENTIFY(hector_disc2_dsk720_identify) |
| 49 | { |
| 50 | *vote = (floppy_image_size(floppy) == (2*80*9*512)) ? 100 : 0; |
| 51 | return FLOPPY_ERROR_SUCCESS; |
| 52 | } |
| 53 | |
| 54 | static FLOPPY_CONSTRUCT(hector_disc2_dsk720_construct) |
| 55 | { |
| 56 | struct basicdsk_geometry geometry; |
| 57 | memset(&geometry, 0, sizeof(geometry)); |
| 58 | geometry.heads = 2; |
| 59 | geometry.first_sector_id = 0; |
| 60 | geometry.sector_length = 512; |
| 61 | geometry.tracks = 80; |
| 62 | geometry.sectors = 9; |
| 63 | return basicdsk_construct(floppy, &geometry); |
| 64 | |
| 65 | }/* For the 800Ko disk : |
| 66 | 512 bytes per sectors, |
| 67 | 10 sector per track, |
| 68 | From sector =0 to sector 9, |
| 69 | 80 tracks |
| 70 | 2 Heads |
| 71 | This format can be extract from a real disk with anadisk (*.IMG format rename in *.HE2). |
| 72 | */ |
| 73 | |
| 74 | static FLOPPY_IDENTIFY(hector_disc2_dsk800_identify) |
| 75 | { |
| 76 | *vote = (floppy_image_size(floppy) == (2*80*10*512)) ? 100 : 0; |
| 77 | return FLOPPY_ERROR_SUCCESS; |
| 78 | } |
| 79 | |
| 80 | static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct) |
| 81 | { |
| 82 | struct basicdsk_geometry geometry; |
| 83 | memset(&geometry, 0, sizeof(geometry)); |
| 84 | geometry.heads = 2; |
| 85 | geometry.first_sector_id = 0; |
| 86 | geometry.sector_length = 512; |
| 87 | geometry.tracks = 80; |
| 88 | geometry.sectors = 10; |
| 89 | return basicdsk_construct(floppy, &geometry); |
| 90 | } |
| 91 | |
| 92 | FLOPPY_OPTIONS_START( hector_disc2 ) |
| 93 | FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL) |
| 94 | FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL) |
| 95 | FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, NULL, NULL) |
| 96 | FLOPPY_OPTIONS_END |
| | No newline at end of file |
src/lib/lib.mak
| r11916 | r11917 | |
| 91 | 91 | $(LIBOBJ)/formats/apf_apt.o \ |
| 92 | 92 | $(LIBOBJ)/formats/apridisk.o \ |
| 93 | 93 | $(LIBOBJ)/formats/ap_dsk35.o \ |
| 94 | $(LIBOBJ)/formats/atari_dsk.o \ |
| 94 | 95 | $(LIBOBJ)/formats/atarist_dsk.o \ |
| 95 | 96 | $(LIBOBJ)/formats/atom_tap.o \ |
| 96 | 97 | $(LIBOBJ)/formats/cbm_tap.o \ |
| r11916 | r11917 | |
| 112 | 113 | $(LIBOBJ)/formats/fmsx_cas.o \ |
| 113 | 114 | $(LIBOBJ)/formats/g64_dsk.o \ |
| 114 | 115 | $(LIBOBJ)/formats/gtp_cas.o \ |
| 116 | $(LIBOBJ)/formats/hect_dsk.o \ |
| 115 | 117 | $(LIBOBJ)/formats/hect_tap.o \ |
| 116 | 118 | $(LIBOBJ)/formats/imd_dsk.o \ |
| 117 | 119 | $(LIBOBJ)/formats/kim1_cas.o \ |
| r11916 | r11917 | |
| 144 | 146 | $(LIBOBJ)/formats/vg5k_cas.o \ |
| 145 | 147 | $(LIBOBJ)/formats/vt_cas.o \ |
| 146 | 148 | $(LIBOBJ)/formats/vt_dsk.o \ |
| 149 | $(LIBOBJ)/formats/vtech1_dsk.o \ |
| 147 | 150 | $(LIBOBJ)/formats/wavfile.o \ |
| 148 | 151 | $(LIBOBJ)/formats/x1_tap.o \ |
| 149 | 152 | $(LIBOBJ)/formats/z80ne_dsk.o \ |
src/mess/machine/hecdisk2.c
| r11916 | r11917 | |
| 22 | 22 | #include "sound/wave.h" /* for K7 sound*/ |
| 23 | 23 | #include "sound/discrete.h" /* for 1 Bit sound*/ |
| 24 | 24 | #include "machine/upd765.h" /* for floppy disc controller */ |
| 25 | | #include "formats/basicdsk.h" |
| 25 | #include "formats/hect_dsk.h" |
| 26 | 26 | #include "cpu/z80/z80.h" |
| 27 | 27 | |
| 28 | 28 | #include "includes/hec2hrp.h" |
| r11916 | r11917 | |
| 48 | 48 | * At this point the Z80 can read the RESULT in port 61h |
| 49 | 49 | */ |
| 50 | 50 | |
| 51 | | /*****************************************************************************/ |
| 52 | | /****** Management of the floppy images 200Ko and 800Ko *********************/ |
| 53 | | /*****************************************************************************/ |
| 54 | | /* For the 200Ko disk : |
| 55 | | 512 bytes per sectors, |
| 56 | | 10 sector per track, |
| 57 | | From sector =0 to sector 9, |
| 58 | | 40 tracks, |
| 59 | | 1 Head |
| 60 | | This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE2). |
| 61 | | */ |
| 62 | | static FLOPPY_IDENTIFY(hector_disc2_dsk200_identify) |
| 63 | | { |
| 64 | | *vote = (floppy_image_size(floppy) == (1*40*10*512)) ? 100 : 0; |
| 65 | | return FLOPPY_ERROR_SUCCESS; |
| 66 | | } |
| 67 | | |
| 68 | | static FLOPPY_CONSTRUCT(hector_disc2_dsk200_construct) |
| 69 | | { |
| 70 | | struct basicdsk_geometry geometry; |
| 71 | | memset(&geometry, 0, sizeof(geometry)); |
| 72 | | geometry.heads = 1; |
| 73 | | geometry.first_sector_id = 0; |
| 74 | | geometry.sector_length = 512; |
| 75 | | geometry.tracks = 40; |
| 76 | | geometry.sectors = 10; |
| 77 | | return basicdsk_construct(floppy, &geometry); |
| 78 | | } |
| 79 | | /* For the 720Ko disk : |
| 80 | | 512 bytes per sectors, |
| 81 | | 9 sector per track, |
| 82 | | From sector =0 to sector 8, |
| 83 | | 80 tracks, |
| 84 | | 2 Head |
| 85 | | This format can be extract from a real disc with anadisk (*.IMG format rename in *.HE7). |
| 86 | | */ |
| 87 | | static FLOPPY_IDENTIFY(hector_disc2_dsk720_identify) |
| 88 | | { |
| 89 | | *vote = (floppy_image_size(floppy) == (2*80*9*512)) ? 100 : 0; |
| 90 | | return FLOPPY_ERROR_SUCCESS; |
| 91 | | } |
| 92 | | |
| 93 | | static FLOPPY_CONSTRUCT(hector_disc2_dsk720_construct) |
| 94 | | { |
| 95 | | struct basicdsk_geometry geometry; |
| 96 | | memset(&geometry, 0, sizeof(geometry)); |
| 97 | | geometry.heads = 2; |
| 98 | | geometry.first_sector_id = 0; |
| 99 | | geometry.sector_length = 512; |
| 100 | | geometry.tracks = 80; |
| 101 | | geometry.sectors = 9; |
| 102 | | return basicdsk_construct(floppy, &geometry); |
| 103 | | |
| 104 | | }/* For the 800Ko disk : |
| 105 | | 512 bytes per sectors, |
| 106 | | 10 sector per track, |
| 107 | | From sector =0 to sector 9, |
| 108 | | 80 tracks |
| 109 | | 2 Heads |
| 110 | | This format can be extract from a real disk with anadisk (*.IMG format rename in *.HE2). |
| 111 | | */ |
| 112 | | |
| 113 | | static FLOPPY_IDENTIFY(hector_disc2_dsk800_identify) |
| 114 | | { |
| 115 | | *vote = (floppy_image_size(floppy) == (2*80*10*512)) ? 100 : 0; |
| 116 | | return FLOPPY_ERROR_SUCCESS; |
| 117 | | } |
| 118 | | |
| 119 | | static FLOPPY_CONSTRUCT(hector_disc2_dsk800_construct) |
| 120 | | { |
| 121 | | struct basicdsk_geometry geometry; |
| 122 | | memset(&geometry, 0, sizeof(geometry)); |
| 123 | | geometry.heads = 2; |
| 124 | | geometry.first_sector_id = 0; |
| 125 | | geometry.sector_length = 512; |
| 126 | | geometry.tracks = 80; |
| 127 | | geometry.sectors = 10; |
| 128 | | return basicdsk_construct(floppy, &geometry); |
| 129 | | } |
| 130 | | |
| 131 | | FLOPPY_OPTIONS_START( hector_disc2 ) |
| 132 | | FLOPPY_OPTION( hector_dsk, "HE2", "hector disc2 floppy disk image 200K", hector_disc2_dsk200_identify, hector_disc2_dsk200_construct, NULL, NULL) |
| 133 | | FLOPPY_OPTION( hector_dsk, "HE7", "hector disc2 floppy disk image 720K", hector_disc2_dsk720_identify, hector_disc2_dsk720_construct, NULL, NULL) |
| 134 | | FLOPPY_OPTION( hector_dsk, "HE8", "hector disc2 floppy disk image 800K", hector_disc2_dsk800_identify, hector_disc2_dsk800_construct, NULL, NULL) |
| 135 | | FLOPPY_OPTIONS_END |
| 136 | | |
| 137 | 51 | // Define the hardware of the disk |
| 138 | 52 | const floppy_config hector_disc2_floppy_config = |
| 139 | 53 | { |