From 5333d4d1724eb32776df6b47d18f0f05bd1dd3d0 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Wed, 16 Feb 2011 19:17:51 +0000 Subject: [PATCH] Various MCD fixed from Haze, don't bother --- src/mame/machine/megadriv.c | 47 ++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c index 70789e1d0bb..1c4c2279b8a 100644 --- a/src/mame/machine/megadriv.c +++ b/src/mame/machine/megadriv.c @@ -5232,8 +5232,27 @@ static READ16_HANDLER( segacd_main_dataram_part1_r ) } else { - printf("Unspported: segacd_main_dataram_part1_r (Cell rearranged RAM) in mode 1\n"); - return 0x0000; + // converts data stored in bitmap format (in dataram) to be read out as tiles (for dma->vram purposes) + // used by Heart of the Alien + + if(offset<0x30000/2) /* 0x20000 - 0x2ffff */ // 512x256 bitmap -> tiles + offset = BITSWAP24(offset,23,22,21,20,19,18,17,16,15,8,7,6,5,4,3,2,1,14,13,12,11,10,9,0); + else if(offset<0x38000/2) /* 0x30000 - 0x37fff */ // 512x128 bitmap -> tiles + offset = BITSWAP24(offset,23,22,21,20,19,18,17,16,15,14,7,6,5,4,3,2,1,13,12,11,10,9,8,0); + else if(offset<0x3c000/2) /* 0x38000 - 0x3bfff */ // 512x64 bitmap -> tiles + offset = BITSWAP24(offset,23,22,21,20,19,18,17,16,15,14,13,6,5,4,3,2,1,12,11,10,9,8,7,0); + else /* 0x3c000 - 0x3dfff and 0x3e000 - 0x3ffff */ // 512x32 bitmap (x2) -> tiles + offset = BITSWAP24(offset,23,22,21,20,19,18,17,16,15,14,13,12,5,4,3,2,1,11,10,9,8,7,6,0); + + // do we care about the ret bit?? HOTA is missing some startup screens... + //if (!segacd_ret) + //{ + // return segacd_dataram[offset+0x20000/2]; + //} + //else + { + return segacd_dataram[offset+0x00000/2]; + } } } @@ -5318,6 +5337,10 @@ static TIMER_CALLBACK( segacd_gfx_conversion_timer_callback ) cputag_set_input_line(machine, "segacd_68k", 1, HOLD_LINE); segacd_conversion_active = 0; + + // this ends up as 0 after processing (soniccd bonus stage) + segacd_imagebuffer_vdot_size = 0; + } @@ -5669,6 +5692,9 @@ INLINE UINT8 get_stampmap_16x16_1x1_tile_info_pixel(running_machine* machine, in const gfx_element *gfx = machine->gfx[tile_region]; tileno %= gfx->total_elements; + + if (tileno==0) return 0x00; + const UINT8* srcdata = gfx_element_get_data(gfx, tileno); return srcdata[((ypos&((1<gfx[tile_region]; tileno %= gfx->total_elements; + + if (tileno==0) return 0x00; // does this apply in this mode? + const UINT8* srcdata = gfx_element_get_data(gfx, tileno); return srcdata[((ypos&((1<gfx[tile_region]; tileno %= gfx->total_elements; + + if (tileno==0) return 0x00; // does this apply in this mode + const UINT8* srcdata = gfx_element_get_data(gfx, tileno); return srcdata[((ypos&((1<gfx[tile_region]; tileno %= gfx->total_elements; + + if (tileno==0) return 0x00; + const UINT8* srcdata = gfx_element_get_data(gfx, tileno); return srcdata[((ypos&((1<gfx[2] = gfx_element_alloc(machine, &sega_16x16_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[3] = gfx_element_alloc(machine, &sega_16x16_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[4] = gfx_element_alloc(machine, &sega_16x16_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0); - machine->gfx[5] = gfx_element_alloc(machine, &sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); + machine->gfx[5] = gfx_element_alloc(machine, &sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[6] = gfx_element_alloc(machine, &sega_16x16_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0); - machine->gfx[7] = gfx_element_alloc(machine, &sega_16x16_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); + machine->gfx[7] = gfx_element_alloc(machine, &sega_16x16_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[8] = gfx_element_alloc(machine, &sega_32x32_r00_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[9] = gfx_element_alloc(machine, &sega_32x32_r01_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[10]= gfx_element_alloc(machine, &sega_32x32_r10_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[11]= gfx_element_alloc(machine, &sega_32x32_r11_f0_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[12]= gfx_element_alloc(machine, &sega_32x32_r00_f1_layout, (UINT8 *)segacd_dataram, 0, 0); - machine->gfx[13]= gfx_element_alloc(machine, &sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); + machine->gfx[13]= gfx_element_alloc(machine, &sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); machine->gfx[14]= gfx_element_alloc(machine, &sega_32x32_r10_f1_layout, (UINT8 *)segacd_dataram, 0, 0); - machine->gfx[15]= gfx_element_alloc(machine, &sega_32x32_r11_f1_layout, (UINT8 *)segacd_dataram, 0, 0); + machine->gfx[15]= gfx_element_alloc(machine, &sega_32x32_r01_f1_layout, (UINT8 *)segacd_dataram, 0, 0); segacd_stampmap[0] = tilemap_create(machine, get_stampmap_16x16_1x1_tile_info, tilemap_scan_rows, 16, 16, 16, 16); segacd_stampmap[1] = tilemap_create(machine, get_stampmap_32x32_1x1_tile_info, tilemap_scan_rows, 32, 32, 8, 8);