~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/mame/drivers/namcoic.c

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
265
265
 
266
266
/**************************************************************************************/
267
267
 
268
 
static void zdrawgfxzoom(running_machine *machine,
269
 
                bitmap_t *dest_bmp,const gfx_element *gfx,
 
268
static void zdrawgfxzoom(
 
269
                bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
270
270
                UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
271
 
                const rectangle *clip,int transparency,int transparent_color,
272
271
                int scalex, int scaley, int zpos )
273
272
{
274
273
        if (!scalex || !scaley) return;
276
275
        {
277
276
                if( gfx )
278
277
                {
279
 
                        int shadow_offset = (machine->config->video_attributes&VIDEO_HAS_SHADOWS)?machine->config->total_colors:0;
280
 
                        const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
 
278
                        int shadow_offset = (gfx->machine->config->video_attributes&VIDEO_HAS_SHADOWS)?gfx->machine->config->total_colors:0;
 
279
                        const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
281
280
                        const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
282
281
                        int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
283
282
                        int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
342
341
                                if( ex>sx )
343
342
                                { /* skip if inner loop doesn't draw anything */
344
343
                                        int y;
345
 
                                        if (transparency == TRANSPARENCY_PEN)
 
344
                                        bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
 
345
                                        if( priority_bitmap )
346
346
                                        {
347
 
                                                if( priority_bitmap )
 
347
                                                for( y=sy; y<ey; y++ )
348
348
                                                {
349
 
                                                        for( y=sy; y<ey; y++ )
350
 
                                                        {
351
 
                                                                const UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
352
 
                                                                UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
353
 
                                                                UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
354
 
                                                                int x, x_index = x_index_base;
355
 
                                                                if( mPalXOR )
356
 
                                                                {
357
 
                                                                        for( x=sx; x<ex; x++ )
358
 
                                                                        {
359
 
                                                                                int c = source[x_index>>16];
360
 
                                                                                if( c != transparent_color )
361
 
                                                                                {
362
 
                                                                                        if( pri[x]<=zpos )
363
 
                                                                                        {
364
 
                                                                                                switch( c )
365
 
                                                                                                {
366
 
                                                                                                case 0:
367
 
                                                                                                        dest[x] = 0x4000|(dest[x]&0x1fff);
368
 
                                                                                                        break;
369
 
                                                                                                case 1:
370
 
                                                                                                        dest[x] = 0x6000|(dest[x]&0x1fff);
371
 
                                                                                                        break;
372
 
                                                                                                default:
373
 
                                                                                                        dest[x] = pal[c];
374
 
                                                                                                        break;
375
 
                                                                                                }
376
 
                                                                                                pri[x] = zpos;
377
 
                                                                                        }
378
 
                                                                                }
379
 
                                                                                x_index += dx;
380
 
                                                                        }
381
 
                                                                        y_index += dy;
382
 
                                                                }
383
 
                                                                else
384
 
                                                                {
385
 
                                                                        for( x=sx; x<ex; x++ )
386
 
                                                                        {
387
 
                                                                                int c = source[x_index>>16];
388
 
                                                                                if( c != transparent_color )
389
 
                                                                                {
390
 
                                                                                        if( pri[x]<=zpos )
391
 
                                                                                        {
392
 
                                                                                                if( color == 0xf && c==0xfe && shadow_offset )
393
 
                                                                                                {
394
 
                                                                                                        dest[x] |= shadow_offset;
395
 
                                                                                                }
396
 
                                                                                                else
397
 
                                                                                                {
398
 
                                                                                                        dest[x] = pal[c];
399
 
                                                                                                }
400
 
                                                                                                pri[x] = zpos;
401
 
                                                                                        }
402
 
                                                                                }
403
 
                                                                                x_index += dx;
404
 
                                                                        }
405
 
                                                                        y_index += dy;
406
 
                                                                }
 
349
                                                        const UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
 
350
                                                        UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
 
351
                                                        UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
 
352
                                                        int x, x_index = x_index_base;
 
353
                                                        if( mPalXOR )
 
354
                                                        {
 
355
                                                                for( x=sx; x<ex; x++ )
 
356
                                                                {
 
357
                                                                        int c = source[x_index>>16];
 
358
                                                                        if( c != 0xff )
 
359
                                                                        {
 
360
                                                                                if( pri[x]<=zpos )
 
361
                                                                                {
 
362
                                                                                        switch( c )
 
363
                                                                                        {
 
364
                                                                                        case 0:
 
365
                                                                                                dest[x] = 0x4000|(dest[x]&0x1fff);
 
366
                                                                                                break;
 
367
                                                                                        case 1:
 
368
                                                                                                dest[x] = 0x6000|(dest[x]&0x1fff);
 
369
                                                                                                break;
 
370
                                                                                        default:
 
371
                                                                                                dest[x] = pal[c];
 
372
                                                                                                break;
 
373
                                                                                        }
 
374
                                                                                        pri[x] = zpos;
 
375
                                                                                }
 
376
                                                                        }
 
377
                                                                        x_index += dx;
 
378
                                                                }
 
379
                                                                y_index += dy;
 
380
                                                        }
 
381
                                                        else
 
382
                                                        {
 
383
                                                                for( x=sx; x<ex; x++ )
 
384
                                                                {
 
385
                                                                        int c = source[x_index>>16];
 
386
                                                                        if( c != 0xff )
 
387
                                                                        {
 
388
                                                                                if( pri[x]<=zpos )
 
389
                                                                                {
 
390
                                                                                        if( color == 0xf && c==0xfe && shadow_offset )
 
391
                                                                                        {
 
392
                                                                                                dest[x] |= shadow_offset;
 
393
                                                                                        }
 
394
                                                                                        else
 
395
                                                                                        {
 
396
                                                                                                dest[x] = pal[c];
 
397
                                                                                        }
 
398
                                                                                        pri[x] = zpos;
 
399
                                                                                }
 
400
                                                                        }
 
401
                                                                        x_index += dx;
 
402
                                                                }
 
403
                                                                y_index += dy;
407
404
                                                        }
408
405
                                                }
409
406
                                        }
420
417
        int loop;
421
418
        if( pri==0 )
422
419
        {
423
 
                bitmap_fill( priority_bitmap, cliprect , 0);
 
420
                bitmap_fill( machine->priority_bitmap, cliprect , 0);
424
421
        }
425
422
        for( loop=0; loop < 128; loop++ )
426
423
        {
478
475
                                                gfx_element_set_source_clip(gfx, 0, 32, 0, 32);
479
476
 
480
477
                                        zdrawgfxzoom(
481
 
                                                machine,
482
478
                                                bitmap,
 
479
                                                cliprect,
483
480
                                                gfx,
484
481
                                                sprn,
485
482
                                                color,
486
483
                                                flipx,flipy,
487
484
                                                xpos,ypos,
488
 
                                                cliprect,
489
 
                                                TRANSPARENCY_PEN,0xff,
490
485
                                                scalex,scaley,
491
486
                                                loop );
492
487
                                }
533
528
        int loop;
534
529
        if( pri==0 )
535
530
        {
536
 
                bitmap_fill( priority_bitmap, cliprect , 0);
 
531
                bitmap_fill( machine->priority_bitmap, cliprect , 0);
537
532
        }
538
533
        for( loop=0; loop < 128; loop++ )
539
534
        {
613
608
                                rect.min_y += (tile&2)?16:0;
614
609
                                rect.max_y += (tile&2)?16:0;
615
610
                        }
616
 
                        zdrawgfxzoom(machine,
617
 
                                bitmap,machine->gfx[0],
 
611
                        zdrawgfxzoom(
 
612
                                bitmap,
 
613
                                &rect,
 
614
                                machine->gfx[0],
618
615
                                sprn, color,
619
616
                                flipx,flipy,
620
617
                                sx,sy,
621
 
                                &rect,
622
 
                                TRANSPARENCY_PEN,0xff,
623
618
                                scalex, scaley,
624
619
                                loop );
625
620
                }
877
872
                        tile = spritetile16[tile_index++];
878
873
                        if( (tile&0x8000)==0 )
879
874
                        {
880
 
                                zdrawgfxzoom(machine,
881
 
                                        bitmap,machine->gfx[mGfxC355],
 
875
                                zdrawgfxzoom(
 
876
                                        bitmap,
 
877
                                        &clip,
 
878
                                        machine->gfx[mGfxC355],
882
879
                                        mpCodeToTile(tile) + offset,
883
880
                                        color,
884
881
                                        flipx,flipy,
885
882
                                        sx,sy,
886
 
                                        &clip,
887
 
                                        TRANSPARENCY_PEN,0xff,
888
883
                                        zoomx, zoomy, zpos );
889
884
                        }
890
885
                        if( !flipx )
951
946
//  int offs = spriteram16[0x18000/2]; /* end-of-sprite-list */
952
947
        if( pri==0 )
953
948
        {
954
 
                bitmap_fill( priority_bitmap, cliprect , 0);
 
949
                bitmap_fill( machine->priority_bitmap, cliprect , 0);
955
950
        }
956
951
//  if( offs==0 )
957
952
        { /* boot */
1348
1343
        COMBINE_DATA( &rozcontrol16[offset] );
1349
1344
} /* namco_rozcontrol16_w */
1350
1345
 
 
1346
#ifdef UNUSED_FUNCTION
1351
1347
READ16_HANDLER( namco_rozbank16_r )
1352
1348
{
1353
1349
        return rozbank16[offset];
1366
1362
                }
1367
1363
        }
1368
1364
} /* namco_rozbank16_w */
 
1365
#endif
1369
1366
 
1370
1367
static void
1371
1368
writerozvideo( int offset, UINT16 data )
1525
1522
        ROAD_TILE_SIZE, ROAD_TILE_SIZE,
1526
1523
        ROAD_TILE_COUNT_MAX,
1527
1524
        2,
1528
 
#ifndef LSB_FIRST
1529
 
        { 0,8 },
1530
 
#else
1531
 
        { 8,0 },
1532
 
#endif
 
1525
        { NATIVE_ENDIAN_VALUE_LE_BE(0,8), NATIVE_ENDIAN_VALUE_LE_BE(8,0) },
1533
1526
        {/* x offset */
1534
1527
                0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
1535
1528
                0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17