src/mame/drivers/megadriv.c
| r9273 | r9274 | |
| 2786 | 2786 | |
| 2787 | 2787 | static READ16_HANDLER( _32x_68k_a15180_r ) |
| 2788 | 2788 | { |
| 2789 | | printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask); |
| 2790 | | |
| 2789 | // printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask); |
| 2791 | 2790 | |
| 2791 | // read needs authorization too I think, undefined behavior otherwise |
| 2792 | |
| 2792 | 2793 | // the flag is inverted compared to the megadrive |
| 2793 | 2794 | int ntsc; |
| 2794 | 2795 | if (megadrive_region_pal) ntsc = 0; |
| r9273 | r9274 | |
| 2801 | 2802 | |
| 2802 | 2803 | } |
| 2803 | 2804 | |
| 2804 | | static WRITE16_HANDLER( _32x_68k_a15180_w ) |
| 2805 | void write_32x_68k_a15180_w_sh2_4100( UINT16 data, UINT16 mem_mask, int source ) |
| 2805 | 2806 | { |
| 2806 | | printf("_32x_68k_a15180_w (a15180) %04x %04x\n",data,mem_mask); |
| 2807 | printf("_32x_68k_a15180_w (a15180) %04x %04x source %04x _32x_access_auth %04x\n",data,mem_mask, source, _32x_access_auth); |
| 2807 | 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; |
| 2808 | 2813 | |
| 2809 | 2814 | if (ACCESSING_BITS_0_7) |
| 2810 | 2815 | { |
| r9273 | r9274 | |
| 2812 | 2817 | _32x_240mode = (data & 0x40) >> 6; |
| 2813 | 2818 | _32x_displaymode = (data & 0x03) >> 0; |
| 2814 | 2819 | } |
| 2820 | |
| 2821 | |
| 2815 | 2822 | } |
| 2816 | 2823 | |
| 2824 | static WRITE16_HANDLER( _32x_68k_a15180_w ) |
| 2825 | { |
| 2826 | write_32x_68k_a15180_w_sh2_4100( data, mem_mask, 0 ); |
| 2827 | } |
| 2828 | |
| 2817 | 2829 | /**********************************************************************************************/ |
| 2818 | 2830 | // 68k side a15182 |
| 2819 | 2831 | // screenshift register |
| r9273 | r9274 | |
| 3315 | 3327 | // Mono Pulse Width Register |
| 3316 | 3328 | /**********************************************************************************************/ |
| 3317 | 3329 | |
| 3330 | /* 4100 - 43ff are VDP registers, you need permission to access them - ensure this is true for all! */ |
| 3331 | |
| 3318 | 3332 | /**********************************************************************************************/ |
| 3319 | 3333 | // SH2 side 4100 |
| 3320 | 3334 | // Access to Framebuffer control |
| r9273 | r9274 | |
| 3322 | 3336 | /**********************************************************************************************/ |
| 3323 | 3337 | |
| 3324 | 3338 | static READ16_HANDLER( _32x_sh2_common_4100_r ) { return _32x_68k_a15180_r(space,offset,mem_mask); } |
| 3325 | | static WRITE16_HANDLER( _32x_sh2_common_4100_w ) { _32x_68k_a15180_w(space,offset,data,mem_mask); } |
| 3339 | static WRITE16_HANDLER( _32x_sh2_common_4100_w ) { write_32x_68k_a15180_w_sh2_4100(data,mem_mask, 1); } |
| 3326 | 3340 | |
| 3327 | 3341 | /**********************************************************************************************/ |
| 3328 | 3342 | // SH2 side 4102 |
| r9273 | r9274 | |
| 3371 | 3385 | |
| 3372 | 3386 | /**********************************************************************************************/ |
| 3373 | 3387 | // SH2 side 4200 - 43ff |
| 3374 | | // framebuffer status / control |
| 3388 | // palette |
| 3375 | 3389 | // maps through to 68k at a15200 - a153ff |
| 3376 | 3390 | /**********************************************************************************************/ |
| 3377 | 3391 | |