src/mame/drivers/megadriv.c
| r9274 | r9275 | |
| 2221 | 2221 | /**********************************************************************************************/ |
| 2222 | 2222 | |
| 2223 | 2223 | |
| 2224 | | static READ16_HANDLER( _32x_68k_a15180_r ); |
| 2225 | | static READ16_HANDLER( _32x_68k_a15182_r ); |
| 2226 | | static READ16_HANDLER( _32x_68k_a15184_r ); |
| 2227 | | static READ16_HANDLER( _32x_68k_a15186_r ); |
| 2228 | | static READ16_HANDLER( _32x_68k_a15188_r ); |
| 2229 | | static READ16_HANDLER( _32x_68k_a1518a_r ); |
| 2224 | static READ16_HANDLER( _32x_common_vdp_regs_r ); |
| 2225 | static WRITE16_HANDLER( _32x_common_vdp_regs_w ); |
| 2230 | 2226 | |
| 2231 | | static WRITE16_HANDLER( _32x_68k_a15180_w ); |
| 2232 | | static WRITE16_HANDLER( _32x_68k_a15182_w ); |
| 2233 | | static WRITE16_HANDLER( _32x_68k_a15184_w ); |
| 2234 | | static WRITE16_HANDLER( _32x_68k_a15186_w ); |
| 2235 | | static WRITE16_HANDLER( _32x_68k_a15188_w ); |
| 2236 | | static WRITE16_HANDLER( _32x_68k_a1518a_w ); |
| 2237 | | |
| 2238 | 2227 | static UINT16 _32x_autofill_length; |
| 2239 | 2228 | static UINT16 _32x_autofill_address; |
| 2240 | 2229 | static UINT16 _32x_autofill_data; |
| r9274 | r9275 | |
| 2598 | 2587 | |
| 2599 | 2588 | memory_install_rom(space, 0x0000000, 0x03fffff, 0, 0, memory_region(space->machine, "32x_68k_bios")); |
| 2600 | 2589 | |
| 2601 | | memory_install_readwrite16_handler(space, 0x0a15180, 0x0a15181, 0, 0, _32x_68k_a15180_r, _32x_68k_a15180_w); // mode control regs |
| 2602 | | memory_install_readwrite16_handler(space, 0x0a15182, 0x0a15183, 0, 0, _32x_68k_a15182_r, _32x_68k_a15182_w); // screen shift |
| 2603 | | memory_install_readwrite16_handler(space, 0x0a15184, 0x0a15185, 0, 0, _32x_68k_a15184_r, _32x_68k_a15184_w); // autofill length reg |
| 2604 | | memory_install_readwrite16_handler(space, 0x0a15186, 0x0a15187, 0, 0, _32x_68k_a15186_r, _32x_68k_a15186_w); // autofill address reg |
| 2605 | | memory_install_readwrite16_handler(space, 0x0a15188, 0x0a15189, 0, 0, _32x_68k_a15188_r, _32x_68k_a15188_w); // autofill data reg / start fill |
| 2606 | | memory_install_readwrite16_handler(space, 0x0a1518a, 0x0a1518b, 0, 0, _32x_68k_a1518a_r, _32x_68k_a1518a_w); // framebuffer control regs |
| 2607 | | |
| 2590 | /* VDP area */ |
| 2591 | memory_install_readwrite16_handler(space, 0x0a15180, 0x0a1518b, 0, 0, _32x_common_vdp_regs_r, _32x_common_vdp_regs_w); // common / shared VDP regs |
| 2608 | 2592 | memory_install_readwrite16_handler(space, 0x0a15200, 0x0a153ff, 0, 0, _32x_68k_palette_r, _32x_68k_palette_w); // access to 'palette' xRRRRRGGGGGBBBBB |
| 2609 | | |
| 2610 | 2593 | memory_install_readwrite16_handler(space, 0x0840000, 0x085ffff, 0, 0, _32x_68k_dram_r, _32x_68k_dram_w); // access to 'display ram' (framebuffer) |
| 2611 | 2594 | memory_install_readwrite16_handler(space, 0x0860000, 0x087ffff, 0, 0, _32x_68k_dram_overwrite_r, _32x_68k_dram_overwrite_w); // access to 'display ram' (framebuffer) |
| 2612 | 2595 | |
| 2596 | |
| 2597 | |
| 2613 | 2598 | memory_install_readwrite16_handler(cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000070, 0x000073, 0, 0, _32x_68k_hint_vector_r, _32x_68k_hint_vector_w); // h interrupt vector |
| 2614 | 2599 | } |
| 2615 | 2600 | else |
| r9274 | r9275 | |
| 2784 | 2769 | // also accessed from the SH2 @ 4100 |
| 2785 | 2770 | /**********************************************************************************************/ |
| 2786 | 2771 | |
| 2787 | | static READ16_HANDLER( _32x_68k_a15180_r ) |
| 2788 | | { |
| 2789 | | // printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask); |
| 2790 | | |
| 2791 | | // read needs authorization too I think, undefined behavior otherwise |
| 2792 | | |
| 2793 | | // the flag is inverted compared to the megadrive |
| 2794 | | int ntsc; |
| 2795 | | if (megadrive_region_pal) ntsc = 0; |
| 2796 | | else ntsc = 1; |
| 2772 | static UINT16 _32x_a1518a_reg; |
| 2797 | 2773 | |
| 2798 | | return (ntsc << 15) | |
| 2799 | | (_32x_videopriority << 7 ) | |
| 2800 | | ( _32x_240mode << 6 ) | |
| 2801 | | ( _32x_displaymode << 0 ); |
| 2802 | | |
| 2803 | | } |
| 2804 | | |
| 2805 | | void write_32x_68k_a15180_w_sh2_4100( UINT16 data, UINT16 mem_mask, int source ) |
| 2774 | static READ16_HANDLER( _32x_common_vdp_regs_r ) |
| 2806 | 2775 | { |
| 2807 | | printf("_32x_68k_a15180_w (a15180) %04x %04x source %04x _32x_access_auth %04x\n",data,mem_mask, source, _32x_access_auth); |
| 2808 | | |
| 2809 | | // authorization is needed to access vdp registers? |
| 2810 | | // spiderman attempts to write here without authorization and ends up setting the priority regsiter badly |
| 2811 | | if (_32x_access_auth != source ) |
| 2812 | | return; |
| 2813 | | |
| 2814 | | if (ACCESSING_BITS_0_7) |
| 2815 | | { |
| 2816 | | _32x_videopriority = (data & 0x80) >> 7; |
| 2817 | | _32x_240mode = (data & 0x40) >> 6; |
| 2818 | | _32x_displaymode = (data & 0x03) >> 0; |
| 2819 | | } |
| 2776 | // what happens if the z80 accesses it, what authorization do we use? |
| 2820 | 2777 | |
| 2821 | 2778 | |
| 2822 | | } |
| 2823 | 2779 | |
| 2824 | | static WRITE16_HANDLER( _32x_68k_a15180_w ) |
| 2825 | | { |
| 2826 | | write_32x_68k_a15180_w_sh2_4100( data, mem_mask, 0 ); |
| 2827 | | } |
| 2828 | | |
| 2829 | | /**********************************************************************************************/ |
| 2830 | | // 68k side a15182 |
| 2831 | | // screenshift register |
| 2832 | | // also accessed from the SH2 @ 4102 |
| 2833 | | // used to shift 32x framebuffer by 1 pixel |
| 2834 | | /**********************************************************************************************/ |
| 2835 | | |
| 2836 | | static READ16_HANDLER( _32x_68k_a15182_r ) |
| 2837 | | { |
| 2838 | | return _32x_screenshift; |
| 2839 | | } |
| 2840 | | |
| 2841 | | static WRITE16_HANDLER( _32x_68k_a15182_w ) |
| 2842 | | { |
| 2843 | | if (ACCESSING_BITS_0_7) |
| 2780 | // printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask); |
| 2781 | |
| 2782 | // read needs authorization too I think, undefined behavior otherwise |
| 2783 | switch (offset) |
| 2844 | 2784 | { |
| 2845 | | _32x_screenshift = data & 1; // allows 1 pixel shifting |
| 2846 | | } |
| 2847 | | if (ACCESSING_BITS_8_15) |
| 2848 | | { |
| 2785 | case 0x00: |
| 2786 | |
| 2787 | // the flag is inverted compared to the megadrive |
| 2788 | int ntsc; |
| 2789 | if (megadrive_region_pal) ntsc = 0; |
| 2790 | else ntsc = 1; |
| 2849 | 2791 | |
| 2850 | | } |
| 2851 | | } |
| 2792 | return (ntsc << 15) | |
| 2793 | (_32x_videopriority << 7 ) | |
| 2794 | ( _32x_240mode << 6 ) | |
| 2795 | ( _32x_displaymode << 0 ); |
| 2796 | |
| 2797 | |
| 2798 | |
| 2799 | case 0x02/2: |
| 2800 | return _32x_screenshift; |
| 2801 | |
| 2802 | case 0x04/2: |
| 2803 | return _32x_autofill_length; |
| 2804 | |
| 2805 | case 0x06/2: |
| 2806 | return _32x_autofill_address; |
| 2807 | |
| 2808 | case 0x08/2: |
| 2809 | return _32x_autofill_data; |
| 2810 | |
| 2811 | case 0x0a/2: |
| 2812 | UINT16 retdata = _32x_a1518a_reg; |
| 2813 | UINT16 hpos = get_hposition(); |
| 2814 | int megadrive_hblank_flag = 0; |
| 2852 | 2815 | |
| 2853 | | /**********************************************************************************************/ |
| 2854 | | // 68k side a15184 |
| 2855 | | // autofill length |
| 2856 | | // also accessed from the SH2 @ 4104 |
| 2857 | | /**********************************************************************************************/ |
| 2816 | if (megadrive_vblank_flag) retdata |= 0x8000; |
| 2858 | 2817 | |
| 2818 | if (hpos>400) megadrive_hblank_flag = 1; |
| 2819 | if (hpos>460) megadrive_hblank_flag = 0; |
| 2859 | 2820 | |
| 2860 | | static READ16_HANDLER( _32x_68k_a15184_r ) |
| 2861 | | { |
| 2862 | | return _32x_autofill_length; |
| 2863 | | } |
| 2821 | if (megadrive_hblank_flag) retdata |= 0x4000; |
| 2864 | 2822 | |
| 2865 | | static WRITE16_HANDLER( _32x_68k_a15184_w ) |
| 2866 | | { |
| 2867 | | if (ACCESSING_BITS_0_7) |
| 2868 | | { |
| 2869 | | _32x_autofill_length = data & 0xff; |
| 2870 | | } |
| 2823 | if (megadrive_vblank_flag && _32x_access_auth) { retdata |= 2; } // framebuffer approval (TODO: condition is unknown at current time) |
| 2871 | 2824 | |
| 2872 | | if (ACCESSING_BITS_8_15) |
| 2873 | | { |
| 2825 | if (megadrive_hblank_flag && megadrive_vblank_flag) { retdata |= 0x2000; } // palette approval (TODO: active high or low?) |
| 2874 | 2826 | |
| 2827 | return retdata; |
| 2875 | 2828 | } |
| 2829 | |
| 2830 | return 0x0000; |
| 2876 | 2831 | } |
| 2877 | 2832 | |
| 2878 | | /**********************************************************************************************/ |
| 2879 | | // 68k side a15186 |
| 2880 | | // auto fill addres |
| 2881 | | // also accessed from the SH2 @ 4106 |
| 2882 | | /**********************************************************************************************/ |
| 2883 | 2833 | |
| 2884 | 2834 | |
| 2885 | | static READ16_HANDLER( _32x_68k_a15186_r ) |
| 2835 | static WRITE16_HANDLER( _32x_common_vdp_regs_w ) |
| 2886 | 2836 | { |
| 2887 | | return _32x_autofill_address; |
| 2888 | | } |
| 2837 | // what happens if the z80 accesses it, what authorization do we use? which address space do we get?? the z80 *can* write here and to the framebuffer via the window |
| 2838 | |
| 2839 | address_space* _68kspace = cputag_get_address_space(space->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 2889 | 2840 | |
| 2890 | | static WRITE16_HANDLER( _32x_68k_a15186_w ) |
| 2891 | | { |
| 2892 | | if (ACCESSING_BITS_0_7) |
| 2841 | if (space!= _68kspace) |
| 2893 | 2842 | { |
| 2894 | | _32x_autofill_address = (_32x_autofill_address & 0xff00) | (data & 0x00ff); |
| 2843 | if (_32x_access_auth!=1) |
| 2844 | return; |
| 2895 | 2845 | } |
| 2896 | 2846 | |
| 2897 | | if (ACCESSING_BITS_8_15) |
| 2847 | if (space== _68kspace) |
| 2898 | 2848 | { |
| 2899 | | _32x_autofill_address = (_32x_autofill_address & 0x00ff) | (data & 0xff00); |
| 2849 | if (_32x_access_auth!=0) |
| 2850 | return; |
| 2900 | 2851 | } |
| 2901 | | } |
| 2902 | | |
| 2903 | | /**********************************************************************************************/ |
| 2904 | | // 68k side a15188 |
| 2905 | | // auto fill data (start command) |
| 2906 | | // also accessed from the SH2 @ 4108 |
| 2907 | | /**********************************************************************************************/ |
| 2908 | | |
| 2909 | | |
| 2910 | | static READ16_HANDLER( _32x_68k_a15188_r ) |
| 2911 | | { |
| 2912 | | return _32x_autofill_data; |
| 2913 | | } |
| 2914 | | |
| 2915 | | static WRITE16_HANDLER( _32x_68k_a15188_w ) |
| 2916 | | { |
| 2917 | | if (ACCESSING_BITS_0_7) |
| 2852 | |
| 2853 | |
| 2854 | switch (offset) |
| 2918 | 2855 | { |
| 2919 | | _32x_autofill_data = (_32x_autofill_data & 0xff00) | (data & 0x00ff); |
| 2920 | | } |
| 2856 | |
| 2857 | case 0x00: |
| 2858 | printf("_32x_68k_a15180_w (a15180) %04x %04x source _32x_access_auth %04x\n",data,mem_mask, _32x_access_auth); |
| 2859 | |
| 2860 | if (ACCESSING_BITS_0_7) |
| 2861 | { |
| 2862 | _32x_videopriority = (data & 0x80) >> 7; |
| 2863 | _32x_240mode = (data & 0x40) >> 6; |
| 2864 | _32x_displaymode = (data & 0x03) >> 0; |
| 2865 | } |
| 2866 | break; |
| 2867 | |
| 2868 | case 0x02/2: |
| 2869 | if (ACCESSING_BITS_0_7) |
| 2870 | { |
| 2871 | _32x_screenshift = data & 1; // allows 1 pixel shifting |
| 2872 | } |
| 2873 | if (ACCESSING_BITS_8_15) |
| 2874 | { |
| 2921 | 2875 | |
| 2922 | | if (ACCESSING_BITS_8_15) |
| 2923 | | { |
| 2924 | | _32x_autofill_data = (_32x_autofill_data & 0x00ff) | (data & 0xff00); |
| 2925 | | } |
| 2876 | } |
| 2877 | break; |
| 2878 | |
| 2879 | case 0x04/2: |
| 2880 | if (ACCESSING_BITS_0_7) |
| 2881 | { |
| 2882 | _32x_autofill_length = data & 0xff; |
| 2883 | } |
| 2926 | 2884 | |
| 2927 | | // do the fill - shouldn't be instant.. |
| 2928 | | { |
| 2929 | | int i; |
| 2930 | | for (i=0; i<_32x_autofill_length+1;i++) |
| 2931 | | { |
| 2932 | | _32x_access_dram[_32x_autofill_address] = _32x_autofill_data; |
| 2933 | | _32x_autofill_address = (_32x_autofill_address & 0xff00) | ((_32x_autofill_address+1) & 0x00ff); |
| 2934 | | } |
| 2935 | | } |
| 2936 | | } |
| 2885 | if (ACCESSING_BITS_8_15) |
| 2886 | { |
| 2937 | 2887 | |
| 2888 | } |
| 2889 | break; |
| 2890 | |
| 2891 | case 0x06/2: |
| 2892 | if (ACCESSING_BITS_0_7) |
| 2893 | { |
| 2894 | _32x_autofill_address = (_32x_autofill_address & 0xff00) | (data & 0x00ff); |
| 2895 | } |
| 2938 | 2896 | |
| 2939 | | /**********************************************************************************************/ |
| 2940 | | // 68k side a1518a |
| 2941 | | // framebuffer status / control |
| 2942 | | // also accessed from the SH2 @ 410A |
| 2897 | if (ACCESSING_BITS_8_15) |
| 2898 | { |
| 2899 | _32x_autofill_address = (_32x_autofill_address & 0x00ff) | (data & 0xff00); |
| 2900 | } |
| 2901 | break; |
| 2902 | |
| 2903 | case 0x08/2: |
| 2904 | if (ACCESSING_BITS_0_7) |
| 2905 | { |
| 2906 | _32x_autofill_data = (_32x_autofill_data & 0xff00) | (data & 0x00ff); |
| 2907 | } |
| 2943 | 2908 | |
| 2944 | | /* |
| 2945 | | vhp- ---- ---- --fb |
| 2909 | if (ACCESSING_BITS_8_15) |
| 2910 | { |
| 2911 | _32x_autofill_data = (_32x_autofill_data & 0x00ff) | (data & 0xff00); |
| 2912 | } |
| 2946 | 2913 | |
| 2947 | | v = 1=vblank r/o |
| 2948 | | h = 1=hblank r/o |
| 2949 | | p = 0=palette access approval r/o |
| 2950 | | - = unused |
| 2951 | | f = 0=MD framebuffer access, 1 = SH2 r/o |
| 2952 | | b = 0=DRAM0 accessed by VDP, 1=DRAM1 r/w |
| 2914 | // do the fill - shouldn't be instant.. |
| 2915 | { |
| 2916 | int i; |
| 2917 | for (i=0; i<_32x_autofill_length+1;i++) |
| 2918 | { |
| 2919 | _32x_access_dram[_32x_autofill_address] = _32x_autofill_data; |
| 2920 | _32x_autofill_address = (_32x_autofill_address & 0xff00) | ((_32x_autofill_address+1) & 0x00ff); |
| 2921 | } |
| 2922 | } |
| 2923 | break; |
| 2924 | |
| 2925 | case 0x0a/2: |
| 2926 | // bit 0 is the framebuffer select; |
| 2927 | _32x_a1518a_reg = (_32x_a1518a_reg & 0xfffe) | (data & 1); |
| 2953 | 2928 | |
| 2954 | | */ |
| 2955 | | |
| 2956 | | /**********************************************************************************************/ |
| 2957 | | |
| 2958 | | static UINT16 _32x_a1518a_reg; |
| 2959 | | static READ16_HANDLER( _32x_68k_a1518a_r ) |
| 2960 | | { |
| 2961 | | UINT16 retdata = _32x_a1518a_reg; |
| 2962 | | UINT16 hpos = get_hposition(); |
| 2963 | | int megadrive_hblank_flag = 0; |
| 2964 | | |
| 2965 | | if (megadrive_vblank_flag) retdata |= 0x8000; |
| 2966 | | |
| 2967 | | if (hpos>400) megadrive_hblank_flag = 1; |
| 2968 | | if (hpos>460) megadrive_hblank_flag = 0; |
| 2969 | | |
| 2970 | | if (megadrive_hblank_flag) retdata |= 0x4000; |
| 2971 | | |
| 2972 | | if (megadrive_vblank_flag && _32x_access_auth) { retdata |= 2; } // framebuffer approval (TODO: condition is unknown at current time) |
| 2973 | | |
| 2974 | | if (megadrive_hblank_flag && megadrive_vblank_flag) { retdata |= 0x2000; } // palette approval (TODO: active high or low?) |
| 2975 | | |
| 2976 | | return retdata; |
| 2977 | | } |
| 2978 | | |
| 2979 | | static WRITE16_HANDLER( _32x_68k_a1518a_w ) |
| 2980 | | { |
| 2981 | | // bit 0 is the framebuffer select; |
| 2982 | | _32x_a1518a_reg = (_32x_a1518a_reg & 0xfffe) | (data & 1); |
| 2983 | | |
| 2984 | | if (_32x_a1518a_reg & 1) |
| 2985 | | { |
| 2986 | | _32x_access_dram = _32x_dram0; |
| 2987 | | _32x_display_dram = _32x_dram1; |
| 2929 | if (_32x_a1518a_reg & 1) |
| 2930 | { |
| 2931 | _32x_access_dram = _32x_dram0; |
| 2932 | _32x_display_dram = _32x_dram1; |
| 2933 | } |
| 2934 | else |
| 2935 | { |
| 2936 | _32x_display_dram = _32x_dram0; |
| 2937 | _32x_access_dram = _32x_dram1; |
| 2938 | } |
| 2939 | break; |
| 2940 | |
| 2941 | |
| 2988 | 2942 | } |
| 2989 | | else |
| 2990 | | { |
| 2991 | | _32x_display_dram = _32x_dram0; |
| 2992 | | _32x_access_dram = _32x_dram1; |
| 2993 | | } |
| 2943 | |
| 2944 | |
| 2994 | 2945 | } |
| 2995 | 2946 | |
| 2996 | 2947 | |
| 2997 | | |
| 2998 | 2948 | /**********************************************************************************************/ |
| 2999 | 2949 | // SH2 side 4000 |
| 3000 | 2950 | // IRQ Control |
| r9274 | r9275 | |
| 3330 | 3280 | /* 4100 - 43ff are VDP registers, you need permission to access them - ensure this is true for all! */ |
| 3331 | 3281 | |
| 3332 | 3282 | /**********************************************************************************************/ |
| 3333 | | // SH2 side 4100 |
| 3334 | | // Access to Framebuffer control |
| 3335 | | // maps through to 68k at a15180 |
| 3336 | | /**********************************************************************************************/ |
| 3337 | | |
| 3338 | | static READ16_HANDLER( _32x_sh2_common_4100_r ) { return _32x_68k_a15180_r(space,offset,mem_mask); } |
| 3339 | | static WRITE16_HANDLER( _32x_sh2_common_4100_w ) { write_32x_68k_a15180_w_sh2_4100(data,mem_mask, 1); } |
| 3340 | | |
| 3341 | | /**********************************************************************************************/ |
| 3342 | | // SH2 side 4102 |
| 3343 | | // Screenshift register |
| 3344 | | // maps through to 68k at a15182 |
| 3345 | | /**********************************************************************************************/ |
| 3346 | | |
| 3347 | | static READ16_HANDLER( _32x_sh2_common_4102_r ) { return _32x_68k_a15182_r(space,offset,mem_mask); } |
| 3348 | | static WRITE16_HANDLER( _32x_sh2_common_4102_w ) { _32x_68k_a15182_w(space,offset,data,mem_mask); } |
| 3349 | | |
| 3350 | | /**********************************************************************************************/ |
| 3351 | | // SH2 side 4104 |
| 3352 | | // autofill length |
| 3353 | | // maps through to 68k at a15184 |
| 3354 | | /**********************************************************************************************/ |
| 3355 | | |
| 3356 | | static READ16_HANDLER( _32x_sh2_common_4104_r ) { return _32x_68k_a15184_r(space,offset,mem_mask); } |
| 3357 | | static WRITE16_HANDLER( _32x_sh2_common_4104_w ) { _32x_68k_a15184_w(space,offset,data,mem_mask); } |
| 3358 | | |
| 3359 | | /**********************************************************************************************/ |
| 3360 | | // SH2 side 4106 |
| 3361 | | // autofill address |
| 3362 | | // maps through to 68k at a15186 |
| 3363 | | /**********************************************************************************************/ |
| 3364 | | |
| 3365 | | static READ16_HANDLER( _32x_sh2_common_4106_r ) { return _32x_68k_a15186_r(space,offset,mem_mask); } |
| 3366 | | static WRITE16_HANDLER( _32x_sh2_common_4106_w ) { _32x_68k_a15186_w(space,offset,data,mem_mask); } |
| 3367 | | |
| 3368 | | /**********************************************************************************************/ |
| 3369 | | // SH2 side 4108 |
| 3370 | | // autofill start |
| 3371 | | // maps through to 68k at a15188 |
| 3372 | | /**********************************************************************************************/ |
| 3373 | | |
| 3374 | | static READ16_HANDLER( _32x_sh2_common_4108_r ) { return _32x_68k_a15188_r(space,offset,mem_mask); } |
| 3375 | | static WRITE16_HANDLER( _32x_sh2_common_4108_w ) { _32x_68k_a15188_w(space,offset,data,mem_mask); } |
| 3376 | | |
| 3377 | | /**********************************************************************************************/ |
| 3378 | | // SH2 side 410a |
| 3379 | | // framebuffer status / control |
| 3380 | | // maps through to 68k at a1518a |
| 3381 | | /**********************************************************************************************/ |
| 3382 | | |
| 3383 | | static READ16_HANDLER( _32x_sh2_common_410a_r ) { return _32x_68k_a1518a_r(space,offset,mem_mask); } |
| 3384 | | static WRITE16_HANDLER( _32x_sh2_common_410a_w ) { _32x_68k_a1518a_w(space,offset,data,mem_mask); } |
| 3385 | | |
| 3386 | | /**********************************************************************************************/ |
| 3387 | 3283 | // SH2 side 4200 - 43ff |
| 3388 | 3284 | // palette |
| 3389 | 3285 | // maps through to 68k at a15200 - a153ff |
| r9274 | r9275 | |
| 3516 | 3412 | |
| 3517 | 3413 | _32X_MAP_READHANDLERS(common_4010,common_4012) |
| 3518 | 3414 | |
| 3519 | | _32X_MAP_READHANDLERS(common_4100,common_4102) // _32x_sh2_common_4100_common_4102_r |
| 3520 | | _32X_MAP_WRITEHANDLERS(common_4100,common_4102) // _32x_sh2_common_4100_common_4102_w |
| 3521 | 3415 | |
| 3522 | | |
| 3523 | | _32X_MAP_READHANDLERS(common_4104,common_4106) // _32x_sh2_common_4104_common_4106_r |
| 3524 | | _32X_MAP_WRITEHANDLERS(common_4104,common_4106) // _32x_sh2_common_4104_common_4106_w |
| 3525 | | |
| 3526 | | _32X_MAP_READHANDLERS(common_4108,common_410a) // _32x_sh2_common_4108_common_410a_r |
| 3527 | | _32X_MAP_WRITEHANDLERS(common_4108,common_410a) // _32x_sh2_common_4108_common_410a_w |
| 3528 | | |
| 3529 | | |
| 3530 | 3416 | _32X_MAP_RAM_READHANDLERS(framebuffer_dram) // _32x_sh2_framebuffer_dram_r |
| 3531 | 3417 | _32X_MAP_RAM_WRITEHANDLERS(framebuffer_dram) // _32x_sh2_framebuffer_dram_w |
| 3532 | 3418 | |
| r9274 | r9275 | |
| 3557 | 3443 | AM_RANGE(0x00004030, 0x00004033) AM_READWRITE( _32x_sh2_pwm_control_reg_pwm_cycle_reg_r, _32x_sh2_pwm_control_reg_pwm_cycle_reg_w ) |
| 3558 | 3444 | AM_RANGE(0x00004034, 0x0000403f) AM_NOP |
| 3559 | 3445 | |
| 3560 | | AM_RANGE(0x00004100, 0x00004103) AM_READWRITE( _32x_sh2_common_4100_common_4102_r, _32x_sh2_common_4100_common_4102_w ) |
| 3561 | | AM_RANGE(0x00004104, 0x00004107) AM_READWRITE( _32x_sh2_common_4104_common_4106_r, _32x_sh2_common_4104_common_4106_w ) |
| 3562 | | AM_RANGE(0x00004108, 0x0000410b) AM_READWRITE( _32x_sh2_common_4108_common_410a_r, _32x_sh2_common_4108_common_410a_w ) |
| 3446 | AM_RANGE(0x00004100, 0x0000410b) AM_READWRITE16( _32x_common_vdp_regs_r, _32x_common_vdp_regs_w , 0xffffffff) |
| 3563 | 3447 | AM_RANGE(0x00004200, 0x000043ff) AM_READWRITE( _32x_sh2_paletteram_r, _32x_sh2_paletteram_w) |
| 3564 | 3448 | |
| 3565 | 3449 | AM_RANGE(0x04000000, 0x0401ffff) AM_READWRITE(_32x_sh2_framebuffer_dram_r, _32x_sh2_framebuffer_dram_w) |
| r9274 | r9275 | |
| 3589 | 3473 | AM_RANGE(0x00004030, 0x00004033) AM_READWRITE( _32x_sh2_pwm_control_reg_pwm_cycle_reg_r, _32x_sh2_pwm_control_reg_pwm_cycle_reg_w ) |
| 3590 | 3474 | AM_RANGE(0x00004034, 0x0000403f) AM_NOP |
| 3591 | 3475 | |
| 3592 | | AM_RANGE(0x00004100, 0x00004103) AM_READWRITE( _32x_sh2_common_4100_common_4102_r, _32x_sh2_common_4100_common_4102_w ) |
| 3593 | | AM_RANGE(0x00004104, 0x00004107) AM_READWRITE( _32x_sh2_common_4104_common_4106_r, _32x_sh2_common_4104_common_4106_w ) |
| 3594 | | AM_RANGE(0x00004108, 0x0000410b) AM_READWRITE( _32x_sh2_common_4108_common_410a_r, _32x_sh2_common_4108_common_410a_w ) |
| 3476 | AM_RANGE(0x00004100, 0x0000410b) AM_READWRITE16( _32x_common_vdp_regs_r, _32x_common_vdp_regs_w , 0xffffffff) |
| 3595 | 3477 | AM_RANGE(0x00004200, 0x000043ff) AM_READWRITE(_32x_sh2_paletteram_r, _32x_sh2_paletteram_w) |
| 3596 | 3478 | |
| 3597 | 3479 | AM_RANGE(0x04000000, 0x0401ffff) AM_READWRITE(_32x_sh2_framebuffer_dram_r, _32x_sh2_framebuffer_dram_w) |