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

« back to all changes in this revision

Viewing changes to src/mame/video/psikyosh.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:
342
342
                                tileno = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0x0007ffff); /* seems to take into account spriteram, hence -0x4000 */
343
343
                                colour = (psikyosh_bgram[(bank*0x800)/4 + offs - 0x4000/4] & 0xff000000) >> 24;
344
344
 
345
 
//              drawgfx(zoom_bitmap,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)),NULL,TRANSPARENCY_PEN,0);
 
345
//              drawgfx_transpen(zoom_bitmap,NULL,gfx,tileno,colour,0,0,(16*sx)&0x1ff,((16*sy)&(width-1)),0);
346
346
 
347
347
                                drawgfx_alphatable(bitmap,cliprect,gfx,tileno,colour,0,0,(16*sx+scrollx)&0x1ff,((16*sy+scrolly)&(width-1)),alpha); /* normal */
348
348
                                if(scrollx)
421
421
/* sx and sy is top-left of entire sprite regardless of flip */
422
422
/* Note that Level 5-4 of sbomberb boss is perfect! (Alpha blended zoomed) as well as S1945II logo */
423
423
/* pixel is only plotted if z is >= priority_buffer[y][x] */
424
 
static void psikyosh_drawgfxzoom( running_machine *machine,
425
 
                bitmap_t *dest_bmp,const gfx_element *gfx,
 
424
static void psikyosh_drawgfxzoom(
 
425
                bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
426
426
                UINT32 code,UINT32 color,int flipx,int flipy,int offsx,int offsy,
427
 
                const rectangle *clip,int alpha,
 
427
                int alpha,
428
428
                int zoomx, int zoomy, int wide, int high, UINT32 z)
429
429
{
430
430
        rectangle myclip; /* Clip to screen boundaries */
433
433
 
434
434
        if (!zoomx || !zoomy) return;
435
435
 
436
 
        profiler_mark(PROFILER_DRAWGFX);
 
436
        profiler_mark_start(PROFILER_DRAWGFX);
437
437
 
438
438
        assert(dest_bmp->bpp == 32);
439
439
 
471
471
                        {
472
472
                                for (xtile = xstart; xtile != xend; xtile += xinc )
473
473
                                {
474
 
                                        const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
 
474
                                        const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
475
475
                                        const UINT8 *code_base = gfx_element_get_data(gfx, (code + code_offset++) % gfx->total_elements);
476
476
 
477
477
                                        int x_index_base, y_index, sx, sy, ex, ey;
521
521
                                        { /* skip if inner loop doesn't draw anything */
522
522
                                                int y;
523
523
 
524
 
                                                /* case 1: TRANSPARENCY_PEN */
 
524
                                                /* case 1: no alpha */
525
525
                                                if (alpha == 0xff)
526
526
                                                {
527
527
                                                        if( z > 0 )
735
735
                /* Start drawing */
736
736
                if( gfx )
737
737
                {
738
 
                        const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
 
738
                        const pen_t *pal = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
739
739
 
740
740
                        int sprite_screen_height = ((high*gfx->height*(0x400*0x400))/zoomy + 0x200)>>10; /* Round up to nearest pixel */
741
741
                        int sprite_screen_width = ((wide*gfx->width*(0x400*0x400))/zoomx + 0x200)>>10;
792
792
                                { /* skip if inner loop doesn't draw anything */
793
793
                                        int y;
794
794
 
795
 
                                        /* case 1: TRANSPARENCY_PEN */
 
795
                                        /* case 1: no alpha */
796
796
                                        /* Note: adjusted to >>10 and draws from zoom_bitmap not gfx */
797
797
                                        if (alpha == 0xff)
798
798
                                        {
953
953
                        }
954
954
                }
955
955
        }
956
 
        profiler_mark(PROFILER_END);
 
956
        profiler_mark_end();
957
957
}
958
958
 
959
959
#define SPRITE_PRI(n) (((psikyosh_vidregs[2] << (4*n)) & 0xf0000000 ) >> 28)
1046
1046
                        /* start drawing */
1047
1047
                        if( zoom_table[BYTE_XOR_BE(zoomy)] && zoom_table[BYTE_XOR_BE(zoomx)] ) /* Avoid division-by-zero when table contains 0 (Uninitialised/Bug) */
1048
1048
                        {
1049
 
                                psikyosh_drawgfxzoom(machine, bitmap,gfx,tnum,colr,flpx,flpy,xpos,ypos,cliprect,alpha,
 
1049
                                psikyosh_drawgfxzoom(bitmap,cliprect,gfx,tnum,colr,flpx,flpy,xpos,ypos,alpha,
1050
1050
                                                                        (UINT32)zoom_table[BYTE_XOR_BE(zoomx)], (UINT32)zoom_table[BYTE_XOR_BE(zoomy)], wide, high, listcntr);
1051
1051
 
1052
1052
#if 0
1053
1053
#ifdef MAME_DEBUG
1054
 
                                if (input_code_pressed(KEYCODE_Z))      /* Display some info on each sprite */
 
1054
                                if (input_code_pressed(machine, KEYCODE_Z))     /* Display some info on each sprite */
1055
1055
                                {
1056
1056
                                        char buf[10];
1057
1057
                                        int x, y;
1112
1112
 
1113
1113
        assert(bitmap->bpp == 32);
1114
1114
 
1115
 
        profiler_mark(PROFILER_USER1);
 
1115
        profiler_mark_start(PROFILER_USER1);
1116
1116
        for (y = cliprect->min_y; y <= cliprect->max_y; y += 1) {
1117
1117
 
1118
1118
                dstline = BITMAP_ADDR32(bitmap, y, 0);
1121
1121
                        for (x = cliprect->min_x; x <= cliprect->max_x; x += 1)
1122
1122
                                        dstline[x] = linefill[y]>>8;
1123
1123
        }
1124
 
        profiler_mark(PROFILER_END);
 
1124
        profiler_mark_end();
1125
1125
}
1126
1126
 
1127
1127
static void psikyosh_postlineblend( bitmap_t *bitmap, const rectangle *cliprect )
1133
1133
 
1134
1134
        assert(bitmap->bpp == 32);
1135
1135
 
1136
 
        profiler_mark(PROFILER_USER2);
 
1136
        profiler_mark_start(PROFILER_USER2);
1137
1137
        for (y = cliprect->min_y; y <= cliprect->max_y; y += 1) {
1138
1138
 
1139
1139
                dstline = BITMAP_ADDR32(bitmap, y, 0);
1149
1149
                                dstline[x] = alpha_blend_r32(dstline[x], lineblend[y]>>8, 2*(lineblend[y]&0x7f));
1150
1150
                }
1151
1151
        }
1152
 
        profiler_mark(PROFILER_END);
 
1152
        profiler_mark_end();
1153
1153
}
1154
1154
 
1155
1155
VIDEO_UPDATE( psikyosh ) /* Note the z-buffer on each sprite to get correct priority */