~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/emu/cpu/m68000/m68k_in.c

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2634
2634
                if(BIT_5(word2))
2635
2635
                        width = REG_D[width&7];
2636
2636
 
2637
 
                /* Offset is signed so we have to use ugly math =( */
2638
 
                ea += offset / 8;
2639
 
                offset %= 8;
2640
 
                if(offset < 0)
 
2637
                if(BIT_B(word2))
2641
2638
                {
2642
 
                        offset += 8;
2643
 
                        ea--;
 
2639
                        /* Offset is signed so we have to use ugly math =( */
 
2640
                        ea += offset / 8;
 
2641
                        offset %= 8;
 
2642
                        if(offset < 0)
 
2643
                        {
 
2644
                                offset += 8;
 
2645
                                ea--;
 
2646
                        }
2644
2647
                }
2645
2648
                width = ((width-1) & 31) + 1;
2646
2649
 
2647
 
                data = m68ki_read_32(m68k, ea);
 
2650
                data = (offset+width) < 16 ? (m68ki_read_16(m68k, ea) << 16) : m68ki_read_32(m68k, ea);
2648
2651
 
2649
2652
                data = MASK_OUT_ABOVE_32(data<<offset);
2650
2653
 
2716
2719
                if(BIT_5(word2))
2717
2720
                        width = REG_D[width&7];
2718
2721
 
2719
 
                /* Offset is signed so we have to use ugly math =( */
2720
 
                ea += offset / 8;
2721
 
                offset %= 8;
2722
 
                if(offset < 0)
 
2722
                if(BIT_B(word2))
2723
2723
                {
2724
 
                        offset += 8;
2725
 
                        ea--;
 
2724
                        /* Offset is signed so we have to use ugly math =( */
 
2725
                        ea += offset / 8;
 
2726
                        offset %= 8;
 
2727
                        if(offset < 0)
 
2728
                        {
 
2729
                                offset += 8;
 
2730
                                ea--;
 
2731
                        }
2726
2732
                }
2727
2733
                width = ((width-1) & 31) + 1;
2728
2734
 
2729
 
                data = m68ki_read_32(m68k, ea);
 
2735
                data = (offset+width) < 16 ? (m68ki_read_16(m68k, ea) << 16) : m68ki_read_32(m68k, ea);
2730
2736
                data = MASK_OUT_ABOVE_32(data<<offset);
2731
2737
 
2732
2738
                if((offset+width) > 32)
2813
2819
                }
2814
2820
                width = ((width-1) & 31) + 1;
2815
2821
 
2816
 
                data = m68ki_read_32(m68k, ea);
 
2822
                data = (offset+width) < 16 ? (m68ki_read_16(m68k, ea) << 16) : m68ki_read_32(m68k, ea);
2817
2823
                data = MASK_OUT_ABOVE_32(data<<local_offset);
2818
2824
 
2819
2825
                if((local_offset+width) > 32)
2902
2908
                if(BIT_5(word2))
2903
2909
                        width = REG_D[width&7];
2904
2910
 
2905
 
                /* Offset is signed so we have to use ugly math =( */
2906
 
                ea += offset / 8;
2907
 
                offset %= 8;
2908
 
                if(offset < 0)
 
2911
                if(BIT_B(word2))
2909
2912
                {
2910
 
                        offset += 8;
2911
 
                        ea--;
 
2913
                        /* Offset is signed so we have to use ugly math =( */
 
2914
                        ea += offset / 8;
 
2915
                        offset %= 8;
 
2916
                        if(offset < 0)
 
2917
                        {
 
2918
                                offset += 8;
 
2919
                                ea--;
 
2920
                        }
2912
2921
                }
2913
2922
                width = ((width-1) & 31) + 1;
2914
2923
 
2920
2929
                m68k->not_z_flag = insert_base;
2921
2930
                insert_long = insert_base >> offset;
2922
2931
 
2923
 
                data_long = m68ki_read_32(m68k, ea);
 
2932
                data_long = (offset+width) < 16 ? (m68ki_read_16(m68k, ea) << 16) : m68ki_read_32(m68k, ea);
2924
2933
                m68k->v_flag = VFLAG_CLEAR;
2925
2934
                m68k->c_flag = CFLAG_CLEAR;
2926
2935
 
2927
 
                m68ki_write_32(m68k, ea, (data_long & ~mask_long) | insert_long);
 
2936
                if((width + offset) < 16)
 
2937
                {
 
2938
                        m68ki_write_16(m68k, ea, ((data_long & ~mask_long) | insert_long) >> 16);
 
2939
                }
 
2940
                else
 
2941
                {
 
2942
                        m68ki_write_32(m68k, ea, (data_long & ~mask_long) | insert_long);
 
2943
                }
2928
2944
 
2929
2945
                if((width + offset) > 32)
2930
2946
                {
6684
6700
                                        {
6685
6701
                                                m68k->cacr = REG_DA[(word2 >> 12) & 15] & 0x0f;
6686
6702
                                        }
 
6703
 
 
6704
//                  logerror("movec to cacr=%04x\n", m68k->cacr);
 
6705
                                        if (m68k->cacr & (M68K_CACR_CI | M68K_CACR_CEI))
 
6706
                                        {
 
6707
                                                m68ki_ic_clear(m68k);
 
6708
                                        }
6687
6709
                                        return;
6688
6710
                                }
6689
6711
                                m68ki_exception_illegal(m68k);