src/mame/drivers/megadriv.c
| r9272 | r9273 | |
| 105 | 105 | static int _32x_access_auth; |
| 106 | 106 | static int _32x_screenshift; |
| 107 | 107 | static int _32x_videopriority; |
| 108 | static int _32x_videopriority_alt; |
| 109 | |
| 108 | 110 | static int _32x_displaymode; |
| 109 | 111 | static int _32x_240mode; |
| 110 | 112 | |
| r9272 | r9273 | |
| 2784 | 2786 | |
| 2785 | 2787 | static READ16_HANDLER( _32x_68k_a15180_r ) |
| 2786 | 2788 | { |
| 2789 | printf("_32x_68k_a15180_r (a15180) %04x\n",mem_mask); |
| 2790 | |
| 2791 | |
| 2787 | 2792 | // the flag is inverted compared to the megadrive |
| 2788 | 2793 | int ntsc; |
| 2789 | 2794 | if (megadrive_region_pal) ntsc = 0; |
| r9272 | r9273 | |
| 2798 | 2803 | |
| 2799 | 2804 | static WRITE16_HANDLER( _32x_68k_a15180_w ) |
| 2800 | 2805 | { |
| 2801 | | // printf("_32x_68k_a15180_w (a15180) %04x %04x\n",data,mem_mask); |
| 2806 | printf("_32x_68k_a15180_w (a15180) %04x %04x\n",data,mem_mask); |
| 2807 | |
| 2808 | |
| 2802 | 2809 | if (ACCESSING_BITS_0_7) |
| 2803 | 2810 | { |
| 2804 | 2811 | _32x_videopriority = (data & 0x80) >> 7; |
| 2805 | 2812 | _32x_240mode = (data & 0x40) >> 6; |
| 2806 | 2813 | _32x_displaymode = (data & 0x03) >> 0; |
| 2807 | 2814 | } |
| 2808 | | |
| 2809 | | if (ACCESSING_BITS_8_15) |
| 2810 | | { |
| 2811 | | // nothing? (pal flag is read only) |
| 2812 | | } |
| 2813 | 2815 | } |
| 2814 | 2816 | |
| 2815 | 2817 | /**********************************************************************************************/ |
| r9272 | r9273 | |
| 5422 | 5424 | } |
| 5423 | 5425 | } |
| 5424 | 5426 | |
| 5427 | // hack - spiderman web of fire |
| 5428 | //_32x_videopriority_alt = 1; |
| 5429 | // normal |
| 5430 | _32x_videopriority_alt = 0; |
| 5425 | 5431 | |
| 5432 | int _32x_priority = _32x_videopriority ^ _32x_videopriority_alt; |
| 5433 | |
| 5434 | |
| 5426 | 5435 | if (!MEGADRIVE_REG0C_SHADOW_HIGLIGHT) |
| 5427 | 5436 | { |
| 5428 | 5437 | |
| r9272 | r9273 | |
| 5430 | 5439 | { |
| 5431 | 5440 | UINT32 dat; |
| 5432 | 5441 | dat = video_renderline[x]; |
| 5442 | int drawn = 0; |
| 5443 | |
| 5444 | // low priority 32x - if it's the bg pen, we have a 32x, and it's display is enabled... |
| 5433 | 5445 | if ((dat&0x20000) && (_32x_is_connected) && (_32x_displaymode != 0)) |
| 5434 | 5446 | { |
| 5435 | | if (_32x_linerender[x]&0x8000) |
| 5447 | if (!_32x_priority) |
| 5436 | 5448 | { |
| 5437 | | if (_32x_videopriority) |
| 5449 | if (!(_32x_linerender[x]&0x8000)) |
| 5438 | 5450 | { |
| 5439 | 5451 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5452 | drawn = 1; |
| 5440 | 5453 | } |
| 5441 | | else |
| 5442 | | { |
| 5443 | | // display md bg? |
| 5444 | | } |
| 5445 | 5454 | } |
| 5446 | 5455 | else |
| 5447 | 5456 | { |
| 5448 | | if (_32x_videopriority) |
| 5457 | if ((_32x_linerender[x]&0x8000)) |
| 5449 | 5458 | { |
| 5450 | | // display md bg? |
| 5451 | | } |
| 5452 | | else |
| 5453 | | { |
| 5454 | 5459 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5455 | | } |
| 5460 | drawn = 1; |
| 5461 | } |
| 5456 | 5462 | } |
| 5457 | | } |
| 5458 | | else |
| 5463 | } |
| 5464 | |
| 5465 | |
| 5466 | if (drawn==0) |
| 5459 | 5467 | { |
| 5460 | 5468 | if (dat&0x10000) |
| 5461 | 5469 | lineptr[x] = megadrive_vdp_palette_lookup_sprite[(dat&0x0f) | segac2_sp_pal_lookup[(dat&0x30)>>4]]; |
| 5462 | 5470 | else |
| 5463 | 5471 | lineptr[x] = megadrive_vdp_palette_lookup[(dat&0x0f) | segac2_bg_pal_lookup[(dat&0x30)>>4]]; |
| 5464 | 5472 | } |
| 5473 | |
| 5465 | 5474 | |
| 5475 | |
| 5466 | 5476 | } |
| 5467 | 5477 | } |
| 5468 | 5478 | else |
| 5469 | 5479 | { |
| 5480 | |
| 5470 | 5481 | for (x=0;x<320;x++) |
| 5471 | 5482 | { |
| 5472 | 5483 | UINT32 dat; |
| 5473 | 5484 | dat = video_renderline[x]; |
| 5474 | 5485 | |
| 5486 | int drawn = 0; |
| 5487 | |
| 5488 | // low priority 32x - if it's the bg pen, we have a 32x, and it's display is enabled... |
| 5475 | 5489 | if ((dat&0x20000) && (_32x_is_connected) && (_32x_displaymode != 0)) |
| 5476 | 5490 | { |
| 5477 | | if (_32x_linerender[x]&0x8000) |
| 5491 | if (!_32x_priority) |
| 5478 | 5492 | { |
| 5479 | | if (_32x_videopriority) |
| 5493 | if (!(_32x_linerender[x]&0x8000)) |
| 5480 | 5494 | { |
| 5481 | 5495 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5496 | drawn = 1; |
| 5482 | 5497 | } |
| 5483 | | else |
| 5484 | | { |
| 5485 | | // display md bg? |
| 5486 | | } |
| 5487 | 5498 | } |
| 5488 | 5499 | else |
| 5489 | 5500 | { |
| 5490 | | if (_32x_videopriority) |
| 5501 | if ((_32x_linerender[x]&0x8000)) |
| 5491 | 5502 | { |
| 5492 | | // display md bg? |
| 5493 | | } |
| 5494 | | else |
| 5495 | | { |
| 5496 | 5503 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5497 | | } |
| 5504 | drawn = 1; |
| 5505 | } |
| 5498 | 5506 | } |
| 5507 | } |
| 5499 | 5508 | |
| 5500 | | } |
| 5501 | | else |
| 5509 | |
| 5510 | if (drawn==0) |
| 5502 | 5511 | { |
| 5503 | 5512 | /* Verify my handling.. I'm not sure all cases are correct */ |
| 5504 | 5513 | switch (dat&0x1e000) |
| r9272 | r9273 | |
| 5537 | 5546 | break; |
| 5538 | 5547 | } |
| 5539 | 5548 | } |
| 5549 | |
| 5550 | |
| 5551 | |
| 5540 | 5552 | } |
| 5541 | 5553 | |
| 5542 | 5554 | } |
| 5543 | 5555 | |
| 5544 | 5556 | |
| 5545 | | if (_32x_is_connected && ( _32x_displaymode != 0)) |
| 5557 | // high priority 32x |
| 5558 | if ((_32x_is_connected) && (_32x_displaymode != 0)) |
| 5546 | 5559 | { |
| 5547 | 5560 | for (x=0;x<320;x++) |
| 5548 | 5561 | { |
| 5549 | | if (_32x_linerender[x]&0x8000) |
| 5562 | if (!_32x_priority) |
| 5550 | 5563 | { |
| 5551 | | if (_32x_videopriority) |
| 5552 | | { |
| 5553 | | // display md screen? |
| 5554 | | |
| 5555 | | } |
| 5556 | | else |
| 5557 | | { |
| 5564 | if ((_32x_linerender[x]&0x8000)) |
| 5558 | 5565 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5559 | | } |
| 5560 | 5566 | } |
| 5561 | 5567 | else |
| 5562 | 5568 | { |
| 5563 | | if (_32x_videopriority) |
| 5564 | | { |
| 5569 | if (!(_32x_linerender[x]&0x8000)) |
| 5565 | 5570 | lineptr[x] = _32x_linerender[x]&0x7fff; |
| 5566 | | } |
| 5567 | | else |
| 5568 | | { |
| 5569 | | // display md screen? |
| 5570 | | } |
| 5571 | 5571 | } |
| 5572 | 5572 | } |
| 5573 | 5573 | } |