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

« back to all changes in this revision

Viewing changes to src/mame/video/deco16ic.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:
178
178
        bitmap_t *bitmap,tilemap *tilemap0_8x8,tilemap *tilemap0_16x16,
179
179
        tilemap *tilemap1_8x8,tilemap *tilemap1_16x16, const UINT16 *rowscroll_ptr,const UINT16 scrollx,
180
180
        const UINT16 scrolly,const UINT16 control0, const UINT16 control1,int combine_mask,int combine_shift,int trans_mask,int flags,UINT32 priority);
 
181
static int pf12_last_small, pf12_last_big, pf34_last_big;
 
182
 
181
183
 
182
184
/******************************************************************************/
183
185
 
437
439
 
438
440
void deco16_pf12_set_gfxbank(int small, int big)
439
441
{
440
 
        static int last_small=-1, last_big=-1;
441
 
 
442
 
        if (last_small!=small) {
 
442
        if (pf12_last_small!=small) {
443
443
                if (pf1_tilemap_8x8)
444
444
                        tilemap_mark_all_tiles_dirty(pf1_tilemap_8x8);
445
445
                if (pf2_tilemap_8x8)
446
446
                        tilemap_mark_all_tiles_dirty(pf2_tilemap_8x8);
447
 
                last_small=small;
 
447
                pf12_last_small=small;
448
448
        }
449
449
        deco16_pf12_8x8_gfx_bank=small;
450
450
 
451
 
        if (last_big!=big) {
 
451
        if (pf12_last_big!=big) {
452
452
                if (pf1_tilemap_16x16)
453
453
                        tilemap_mark_all_tiles_dirty(pf1_tilemap_16x16);
454
454
                if (pf2_tilemap_16x16)
455
455
                        tilemap_mark_all_tiles_dirty(pf2_tilemap_16x16);
456
 
                last_big=big;
 
456
                pf12_last_big=big;
457
457
        }
458
458
        deco16_pf12_16x16_gfx_bank=big;
459
459
 
461
461
 
462
462
void deco16_pf34_set_gfxbank(int small, int big)
463
463
{
464
 
        static int last_big=-1;
465
 
 
466
 
        if (last_big!=big) {
 
464
        if (pf34_last_big!=big) {
467
465
                if (pf3_tilemap_16x16)
468
466
                        tilemap_mark_all_tiles_dirty(pf3_tilemap_16x16);
469
467
                if (pf4_tilemap_16x16)
470
468
                        tilemap_mark_all_tiles_dirty(pf4_tilemap_16x16);
471
 
                last_big=big;
 
469
                pf34_last_big=big;
472
470
        }
473
471
        deco16_pf34_16x16_gfx_bank=big;
474
472
}
580
578
        deco16_pf34_16x16_gfx_bank=2;
581
579
 
582
580
        deco16_raster_display_position=0;
 
581
 
 
582
        pf12_last_small = pf12_last_big = pf34_last_big = -1;
583
583
}
584
584
 
585
585
void deco16_1_video_init(running_machine *machine)  /* 1 times playfield generator chip */
800
800
 
801
801
/*****************************************************************************************/
802
802
 
803
 
void deco16_print_debug_info(bitmap_t *bitmap)
 
803
void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap)
804
804
{
805
805
        char buf[64*5];
806
806
 
807
 
        if (input_code_pressed(KEYCODE_O))
 
807
        if (input_code_pressed(machine, KEYCODE_O))
808
808
                return;
809
809
 
810
810
        if (deco16_pf12_control) {
835
835
}
836
836
 
837
837
/* A special pdrawgfx z-buffered sprite renderer that is needed to properly draw multiple sprite sources with alpha */
838
 
void deco16_pdrawgfx(running_machine *machine,
839
 
                bitmap_t *dest,const gfx_element *gfx,
 
838
void deco16_pdrawgfx(
 
839
                bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
840
840
                UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
841
 
                const rectangle *clip,int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha)
 
841
                int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha)
842
842
{
843
843
        int ox,oy,cx,cy;
844
844
        int x_index,y_index,x,y;
845
 
 
846
 
        const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
 
845
        bitmap_t *priority_bitmap = gfx->machine->priority_bitmap;
 
846
        const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
847
847
        const UINT8 *code_base = gfx_element_get_data(gfx, code % gfx->total_elements);
848
848
 
849
849
        /* check bounds */
1019
1019
                                if ((flags&TILEMAP_DRAW_OPAQUE) || (p&trans_mask))
1020
1020
                                {
1021
1021
                                        *BITMAP_ADDR16(bitmap, y, x) = machine->pens[p];
1022
 
                                        if (priority_bitmap)
 
1022
                                        if (machine->priority_bitmap)
1023
1023
                                        {
1024
 
                                                UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
 
1024
                                                UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
1025
1025
                                                pri[x]|=priority;
1026
1026
                                        }
1027
1027
                                }
1044
1044
                                if ((flags&TILEMAP_DRAW_OPAQUE) || (p&trans_mask))
1045
1045
                                {
1046
1046
                                        *BITMAP_ADDR32(bitmap, y, x) = machine->pens[p];
1047
 
                                        if (priority_bitmap)
 
1047
                                        if (machine->priority_bitmap)
1048
1048
                                        {
1049
 
                                                UINT8 *pri = BITMAP_ADDR8(priority_bitmap, y, 0);
 
1049
                                                UINT8 *pri = BITMAP_ADDR8(machine->priority_bitmap, y, 0);
1050
1050
                                                pri[x]|=priority;
1051
1051
                                        }
1052
1052
                                }