Previous 15994 Revisions Next

r9274 Wednesday 29th September, 2010 at 06:49:04 UTC by Angelo Salese
[32x]: Disallow writing to the a15180 register if CPU doesn't have authorization, fixes gfxs in Spiderman [David Haywood]
[src/mame/drivers]megadriv.c

src/mame/drivers/megadriv.c
r9273r9274
27862786
27872787static READ16_HANDLER( _32x_68k_a15180_r )
27882788{
2789   printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask);
2790
2789//   printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask);
27912790   
2791   // read needs authorization too I think, undefined behavior otherwise
2792   
27922793   // the flag is inverted compared to the megadrive
27932794   int ntsc;
27942795   if (megadrive_region_pal) ntsc = 0;
r9273r9274
28012802
28022803}
28032804
2804static WRITE16_HANDLER( _32x_68k_a15180_w )
2805void write_32x_68k_a15180_w_sh2_4100( UINT16 data, UINT16 mem_mask, int source )
28052806{
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);
28072808 
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;
28082813 
28092814   if (ACCESSING_BITS_0_7)
28102815   {
r9273r9274
28122817      _32x_240mode   = (data & 0x40) >> 6;
28132818      _32x_displaymode   = (data & 0x03) >> 0;
28142819   }
2820
2821
28152822}
28162823
2824static WRITE16_HANDLER( _32x_68k_a15180_w )
2825{
2826   write_32x_68k_a15180_w_sh2_4100( data, mem_mask, 0 );
2827}
2828
28172829/**********************************************************************************************/
28182830// 68k side a15182
28192831// screenshift register
r9273r9274
33153327// Mono Pulse Width Register
33163328/**********************************************************************************************/
33173329
3330/* 4100 - 43ff are VDP registers, you need permission to access them - ensure this is true for all! */
3331
33183332/**********************************************************************************************/
33193333// SH2 side 4100
33203334// Access to Framebuffer control
r9273r9274
33223336/**********************************************************************************************/
33233337
33243338static READ16_HANDLER( _32x_sh2_common_4100_r ) { return _32x_68k_a15180_r(space,offset,mem_mask); }
3325static WRITE16_HANDLER( _32x_sh2_common_4100_w ) { _32x_68k_a15180_w(space,offset,data,mem_mask); }
3339static WRITE16_HANDLER( _32x_sh2_common_4100_w ) { write_32x_68k_a15180_w_sh2_4100(data,mem_mask, 1); }
33263340
33273341/**********************************************************************************************/
33283342// SH2 side 4102
r9273r9274
33713385
33723386/**********************************************************************************************/
33733387// SH2 side 4200 - 43ff
3374// framebuffer status / control
3388// palette
33753389// maps through to 68k at a15200 - a153ff
33763390/**********************************************************************************************/
33773391

Previous 15994 Revisions Next


© 1998-2018 The MESS Team