Previous 15994 Revisions Next

r6149 Tuesday 20th October, 2009 at 17:27:58 UTC by Harmony
[CDI] Miscellaneous updates: [Harmony]
- Re-added Mosaic code that got erroneously removed in the last checkin.
- Corrected some squirrelly-looking Sound Map code that was probably doing more harm than good.
- Corrected NR=0 region handling; Tangram - The Ultimate Chinese Game is now fully playable.
- Corrected plane enable/disable conditions; The Wacky World of Mini Golf is now fully playable.
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6148r6149
23532353#define MCD212_DDR_FT_BMP2         0x0100   // Bitmap (alt.)
23542354#define MCD212_DDR_FT_RLE         0x0200   // Run-Length Encoded
23552355#define MCD212_DDR_FT_MOSAIC      0x0300   // Mosaic
2356#define MCD212_DDR_MT            0x0c00   // Mosaic File Type
2357#define MCD212_DDR_MT_2            0x0000   // 2x1
2358#define MCD212_DDR_MT_4            0x0400   // 4x1
2359#define MCD212_DDR_MT_8            0x0800   // 8x1
2360#define MCD212_DDR_MT_16         0x0c00   // 16x1
2361#define MCD212_DDR_MT_SHIFT         10
23562362
23572363static const UINT16 cdi220_lcd_char[20*22] =
23582364{
r6148r6149
31963202   UINT8 *clut_r = mcd212.channel[0].clut_r;
31973203   UINT8 *clut_g = mcd212.channel[0].clut_g;
31983204   UINT8 *clut_b = mcd212.channel[0].clut_b;
3205   UINT8 mosaic_enable = ((mcd212.channel[channel].ddr & MCD212_DDR_FT) == MCD212_DDR_FT_MOSAIC);
3206   UINT8 mosaic_factor = 1 << (((mcd212.channel[channel].ddr & MCD212_DDR_MT) >> MCD212_DDR_MT_SHIFT) + 1);
3207   int mosaic_index = 0;
31993208
32003209   //printf( "vsr before: %08x: ", vsr );
32013210   //fflush(stdout);
r6148r6149
32163225      {
32173226         case MCD212_DDR_FT_BMP:
32183227         case MCD212_DDR_FT_BMP2:
3228         case MCD212_DDR_FT_MOSAIC:
32193229            if(mcd212.channel[channel].dcr & MCD212_DCR_CM)
32203230            {
32213231               // 4-bit Bitmap
r6148r6149
32453255                        bY = bU = bV = 0x80;
32463256                        break;
32473257                  }
3248                  for(; x < 768; x += 4)
3258                  for(; x < 768; x += 2)
32493259                  {
32503260                        BYTE68K b0 = byte;
32513261                        BYTE68K bU1 = bU + mcd212_abDeltaUV[b0];
r6148r6149
32723282                        pixels_g[x + 0] = pixels_g[x + 1] = pbLimit[mcd212_abMatrixUG[bU] + mcd212_abMatrixVG[bV]];
32733283                        pixels_b[x + 0] = pixels_b[x + 1] = pbLimit[mcd212_abMatrixUB[bU]];
32743284
3275                        bY = bY1;
3285                     if(mosaic_enable)
3286                     {
3287                        for(mosaic_index = 0; mosaic_index < mosaic_factor; mosaic_index++)
3288                        {
3289                           pixels_r[x + 0 + mosaic_index*2] = pixels_r[x + 0];
3290                           pixels_g[x + 0 + mosaic_index*2] = pixels_g[x + 0];
3291                           pixels_b[x + 0 + mosaic_index*2] = pixels_b[x + 0];
3292                           pixels_r[x + 1 + mosaic_index*2] = pixels_r[x + 1];
3293                           pixels_g[x + 1 + mosaic_index*2] = pixels_g[x + 1];
3294                           pixels_b[x + 1 + mosaic_index*2] = pixels_b[x + 1];
3295                        }
3296                        x += mosaic_factor * 2;
3297                     }
3298                     else
3299                     {
3300                        x += 2;
3301                     }
3302
3303                     bY = bY1;
32763304                        bU = bU1;
32773305                        bV = bV1;
32783306
32793307                        pbLimit = mcd212_abLimit + bY + BYTE68K_MAX;
32803308
3281                        pixels_r[x + 2] = pixels_r[x + 3] = pbLimit[mcd212_abMatrixVR[bV]];
3282                        pixels_g[x + 2] = pixels_g[x + 3] = pbLimit[mcd212_abMatrixUG[bU] + mcd212_abMatrixVG[bV]];
3283                        pixels_b[x + 2] = pixels_b[x + 3] = pbLimit[mcd212_abMatrixUB[bU]];
3309                        pixels_r[x + 0] = pixels_r[x + 1] = pbLimit[mcd212_abMatrixVR[bV]];
3310                        pixels_g[x + 0] = pixels_g[x + 1] = pbLimit[mcd212_abMatrixUG[bU] + mcd212_abMatrixVG[bV]];
3311                        pixels_b[x + 0] = pixels_b[x + 1] = pbLimit[mcd212_abMatrixUB[bU]];
32843312
3313                     if(mosaic_enable)
3314                     {
3315                        for(mosaic_index = 0; mosaic_index < mosaic_factor; mosaic_index++)
3316                        {
3317                           pixels_r[x + 0 + mosaic_index*2] = pixels_r[x + 0];
3318                           pixels_g[x + 0 + mosaic_index*2] = pixels_g[x + 0];
3319                           pixels_b[x + 0 + mosaic_index*2] = pixels_b[x + 0];
3320                           pixels_r[x + 1 + mosaic_index*2] = pixels_r[x + 1];
3321                           pixels_g[x + 1 + mosaic_index*2] = pixels_g[x + 1];
3322                           pixels_b[x + 1 + mosaic_index*2] = pixels_b[x + 1];
3323                        }
3324                        x += (mosaic_factor * 2) - 2;
3325                     }
3326
32853327                        byte = data[(vsr & 0x0007ffff) ^ 1];
32863328
32873329                     vsr++;
r6148r6149
32993341                     pixels_r[x + 1] = clut_r[clut_entry];
33003342                     pixels_g[x + 1] = clut_g[clut_entry];
33013343                     pixels_b[x + 1] = clut_b[clut_entry];
3344                     if(mosaic_enable)
3345                     {
3346                        for(mosaic_index = 0; mosaic_index < mosaic_factor; mosaic_index++)
3347                        {
3348                           pixels_r[x + 0 + mosaic_index*2] = pixels_r[x + 0];
3349                           pixels_g[x + 0 + mosaic_index*2] = pixels_g[x + 0];
3350                           pixels_b[x + 0 + mosaic_index*2] = pixels_b[x + 0];
3351                           pixels_r[x + 1 + mosaic_index*2] = pixels_r[x + 1];
3352                           pixels_g[x + 1 + mosaic_index*2] = pixels_g[x + 1];
3353                           pixels_b[x + 1 + mosaic_index*2] = pixels_b[x + 1];
3354                        }
3355                        x += (mosaic_factor * 2) - 2;
3356                     }
33023357                     byte = data[(vsr & 0x0007ffff) ^ 1];
33033358                     vsr++;
33043359                  }
r6148r6149
33103365                  {
33113366                     UINT8 even_entry = BYTE_TO_CLUT(channel, icm, byte >> 4);
33123367                     UINT8 odd_entry = BYTE_TO_CLUT(channel, icm, byte);
3313                     pixels_r[x + 0] = clut_r[even_entry];
3314                     pixels_g[x + 0] = clut_g[even_entry];
3315                     pixels_b[x + 0] = clut_b[even_entry];
3316                     pixels_r[x + 1] = clut_r[odd_entry];
3317                     pixels_g[x + 1] = clut_g[odd_entry];
3318                     pixels_b[x + 1] = clut_b[odd_entry];
3368                     if(mosaic_enable)
3369                     {
3370                        for(mosaic_index = 0; mosaic_index < mosaic_factor; mosaic_index++)
3371                        {
3372                           pixels_r[x + mosaic_index] = clut_r[even_entry];
3373                           pixels_g[x + mosaic_index] = clut_g[even_entry];
3374                           pixels_b[x + mosaic_index] = clut_b[even_entry];
3375                        }
3376                        for(mosaic_index = 0; mosaic_index < mosaic_factor; mosaic_index++)
3377                        {
3378                           pixels_r[x + mosaic_factor + mosaic_index] = clut_r[odd_entry];
3379                           pixels_g[x + mosaic_factor + mosaic_index] = clut_g[odd_entry];
3380                           pixels_b[x + mosaic_factor + mosaic_index] = clut_b[odd_entry];
3381                        }
3382                        x += (mosaic_factor * 2) - 2;
3383                     }
3384                     else
3385                     {
3386                        pixels_r[x + 0] = clut_r[even_entry];
3387                        pixels_g[x + 0] = clut_g[even_entry];
3388                        pixels_b[x + 0] = clut_b[even_entry];
3389                        pixels_r[x + 1] = clut_r[odd_entry];
3390                        pixels_g[x + 1] = clut_g[odd_entry];
3391                        pixels_b[x + 1] = clut_b[odd_entry];
3392                     }
33193393                     byte = data[(vsr & 0x0007ffff) ^ 1];
33203394                     vsr++;
33213395                  }
r6148r6149
34093483               }
34103484            }
34113485            break;
3412         case MCD212_DDR_FT_MOSAIC:
3413            verboselog(machine, 0, "Unsupported display mode: Mosaic\n" );
3414            done = 1;
3415            break;
34163486      }
34173487   }
34183488

Previous 15994 Revisions Next


© 1998-2018 The MESS Team