~ubuntu-branches/ubuntu/precise/mame/precise-proposed

« back to all changes in this revision

Viewing changes to src/emu/machine/wd17xx.c

  • Committer: Package Import Robot
  • Author(s): Cesare Falco
  • Date: 2011-11-30 18:50:10 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111130185010-02hcxybht1mn082w
Tags: 0.144-0ubuntu1
* New upstream release (LP: #913550)
* mame.install:
  - Added artwork/ images to be used with -effect switch
  - Be more selective with hash/ contents
* contrib/mame.ini: added /usr/share/games/mame/artwork/ to artpath

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
    2011-Jun-24 Curt Coder
141
141
    - Added device types for all known variants, and enforced inverted DAL lines.
142
142
 
 
143
    2011-Sep-18 Curt Coder
 
144
    - Connected Side Select Output for variants that support it.
 
145
 
143
146
    TODO:
144
147
        - What happens if a track is read that doesn't have any id's on it?
145
148
         (e.g. unformatted disc)
658
661
static void write_track(device_t *device)
659
662
{
660
663
        wd1770_state *w = get_safe_token(device);
661
 
        floppy_image *floppy;
 
664
        floppy_image_legacy *floppy;
662
665
#if 0
663
666
        int i;
664
667
        for (i=0;i+4<w->data_offset;)
719
722
static void read_track(device_t *device)
720
723
{
721
724
        wd1770_state *w = get_safe_token(device);
722
 
        floppy_image *floppy;
 
725
        floppy_image_legacy *floppy;
723
726
#if 0
724
727
        UINT8 *psrc;            /* pointer to track format structure */
725
728
        UINT8 *pdst;            /* pointer to track buffer */
1003
1006
        return 0;
1004
1007
}
1005
1008
 
1006
 
 
 
1009
static void wd17xx_side_compare(device_t *device, UINT8 command)
 
1010
{
 
1011
        wd1770_state *w = get_safe_token(device);
 
1012
 
 
1013
        if (wd17xx_has_side_select(device))
 
1014
                wd17xx_set_side(device, (command & FDC_SIDE_CMP_T) ? 1 : 0);
 
1015
 
 
1016
        if (command & FDC_SIDE_CMP_T)
 
1017
                w->head = (command & FDC_SIDE_CMP_S) ? 1 : 0;
 
1018
        else
 
1019
                w->head = ~0;
 
1020
}
1007
1021
 
1008
1022
/* read a sector */
1009
1023
static void wd17xx_read_sector(device_t *device)
1012
1026
        w->data_offset = 0;
1013
1027
 
1014
1028
        /* side compare? */
1015
 
        if (w->read_cmd & 0x02)
1016
 
                w->head = (w->read_cmd & 0x08) ? 1 : 0;
1017
 
        else
1018
 
                w->head = ~0;
 
1029
        wd17xx_side_compare(device, w->read_cmd);
1019
1030
 
1020
1031
        if (wd17xx_find_sector(device))
1021
1032
        {
1067
1078
     */
1068
1079
 
1069
1080
        /* side compare? */
1070
 
        if (w->write_cmd & 0x02)
1071
 
                w->head = (w->write_cmd & 0x08) ? 1 : 0;
1072
 
        else
1073
 
                w->head = ~0;
 
1081
        wd17xx_side_compare(device, w->write_cmd);
1074
1082
 
1075
1083
        /* find sector */
1076
1084
        if (wd17xx_find_sector(device))
1173
1181
                else
1174
1182
                {
1175
1183
                        /* side compare? */
1176
 
                        if (w->write_cmd & 0x02)
1177
 
                                w->head = (w->write_cmd & 0x08) ? 1 : 0;
1178
 
                        else
1179
 
                                w->head = ~0;
 
1184
                        wd17xx_side_compare(device, w->write_cmd);
1180
1185
 
1181
1186
                        /* attempt to find it first before getting data from cpu */
1182
1187
                        if (wd17xx_find_sector(device))