• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Mame类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Mame的典型用法代码示例。如果您正苦于以下问题:C# Mame类的具体用法?C# Mame怎么用?C# Mame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Mame类属于命名空间,在下文中一共展示了Mame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: draw_sprites

        static void draw_sprites(Mame.osd_bitmap bitmap)
        {
            /* sprite information is scattered through memory */
            /* and uses a portion of the text layer memory (outside the visible area) */
            _BytePtr spriteram_area1 = new _BytePtr(Generic.spriteram, 0x28);
            _BytePtr spriteram_area2 = new _BytePtr(Generic.spriteram_2, 0x28);
            _BytePtr spriteram_area3 = new _BytePtr(driver_kyugo.kyugo_videoram, 0x28);

            for (int n = 0; n < 12 * 2; n++)
            {
                int offs = 2 * (n % 12) + 64 * (n / 12);

                int sx = spriteram_area3[offs + 1] + 256 * (spriteram_area2[offs + 1] & 1);
                if (sx > 320) sx -= 512;

                int sy = 255 - spriteram_area1[offs];
                if (driver_kyugo.flipscreen != 0) sy = 240 - sy;

                int color = spriteram_area1[offs + 1] & 0x1f;

                for (int y = 0; y < 16; y++)
                {
                    int attr2 = spriteram_area2[offs + 128 * y];
                    int code = spriteram_area3[offs + 128 * y];
                    if ((attr2 & 0x01) != 0) code += 512;
                    if ((attr2 & 0x02) != 0) code += 256;
                    bool flipx = (attr2 & 0x08) != 0;
                    bool flipy = (attr2 & 0x04) != 0;
                    if (driver_kyugo.flipscreen != 0)
                    {
                        flipx = !flipx;
                        flipy = !flipy;
                    }

                    Mame.drawgfx(bitmap, Mame.Machine.gfx[1],
                        (uint)code,
                        (uint)color,
                        flipx, flipy,
                        sx, driver_kyugo.flipscreen != 0 ? sy - 16 * y : sy + 16 * y,
                        Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 0);
                }
            }
        }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:43,代码来源:driver_kyugo.cs


示例2: draw_background

            static void draw_background(Mame.osd_bitmap bitmap)
            {
                Mame.GfxElement gfx = Mame.Machine.gfx[0];

                for (int offs = Generic.videoram_size[0] - 2; offs >= 0; offs -= 2)
                {
                    if (Generic.dirtybuffer[offs] || Generic.dirtybuffer[offs + 1])
                    {
                        Generic.dirtybuffer[offs] = Generic.dirtybuffer[offs + 1] = false;

                        int sx = (offs / 2) % 32;
                        int sy = (offs / 2) / 32;

                        int attr = Generic.videoram[offs];
                        int code = Generic.videoram[offs + 1] + ((attr & 0xc0) << 2);
                        bool flipx = (attr & 0x20) != 0;

                        if (flipscreen != 0)
                        {
                            sx = 31 - sx;
                            sy = 31 - sy;
                            flipx = !flipx;
                        }

                        Mame.drawgfx(Generic.tmpbitmap, gfx,
                            (uint)code,
                            (uint)attr & 0x1f,
                            flipx, flipscreen != 0,
                            8 * sx, 8 * sy,
                            null, Mame.TRANSPARENCY_NONE, 0);
                    }
                }

                {
                    int[] xscroll = new int[256];

                    if (flipscreen != 0)
                    {
                        /* fixed */
                        for (int offs = 0; offs < 64; offs++) xscroll[255 - offs] = 0;

                        /* scroll (wraps around) */
                        for (int offs = 64; offs < 128; offs++) xscroll[255 - offs] = troangel_scroll[64];

                        /* linescroll (no wrap) */
                        for (int offs = 128; offs < 256; offs++) xscroll[255 - offs] = troangel_scroll[offs];
                    }
                    else
                    {
                        /* fixed */
                        for (int offs = 0; offs < 64; offs++) xscroll[offs] = 0;

                        /* scroll (wraps around) */
                        for (int offs = 64; offs < 128; offs++) xscroll[offs] = -troangel_scroll[64];

                        /* linescroll (no wrap) */
                        for (int offs = 128; offs < 256; offs++) xscroll[offs] = -troangel_scroll[offs];
                    }

                    Mame.copyscrollbitmap(bitmap, Generic.tmpbitmap, 256, xscroll, 0, null, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                }
            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:62,代码来源:driver_troangel.cs


示例3: namcos1_specific

 public namcos1_specific(int key_id_query, int key_id, Mame.mem_read_handler key_r, Mame.mem_write_handler key_w,
     namcos1_slice_timer[] slice_timer, int tilemap_use)
 {
     this.key_id_query = key_id_query;
     this.key_id = key_id;
     this.key_r = key_r;
     this.key_w = key_w;
     this.slice_timer = slice_timer;
     this.tilemap_use = tilemap_use;
 }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:10,代码来源:namcos1.cs


示例4: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
                /* for every character in the video RAM, check if it has been modified */
                /* since last time and update it accordingly. */
                for (int offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    if (Generic.dirtybuffer[offs])
                    {
                        int sx, sy, mx, my;

                        Generic.dirtybuffer[offs] = false;

                        /* Even if Phozon screen is 28x36, the memory layout is 32x32. We therefore
                        have to convert the memory coordinates into screen coordinates.
                        Note that 32*32 = 1024, while 28*36 = 1008: therefore 16 bytes of Video RAM
                        don't map to a screen position. We don't check that here, however: range
                        checking is performed by drawgfx(). */

                        mx = offs % 32;
                        my = offs / 32;

                        if (my <= 1)
                        {       /* bottom screen characters */
                            sx = my + 34;
                            sy = mx - 2;
                        }
                        else if (my >= 30)
                        {	/* top screen characters */
                            sx = my - 30;
                            sy = mx - 2;
                        }
                        else
                        {               /* middle screen characters */
                            sx = mx + 2;
                            sy = my - 2;
                        }

                        Mame.drawgfx(Generic.tmpbitmap, Mame.Machine.gfx[(Generic.colorram[offs] & 0x80) != 0 ? 1 : 0],
                                 Generic.videoram[offs],
                                 (uint)(Generic.colorram[offs] & 0x3f),
                                false, false,
                                8 * sx, 8 * sy,
                                Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                    }
                }

                Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);

                /* Draw the sprites. */
                for (int offs = 0; offs < Generic.spriteram_size[0]; offs += 2)
                {
                    /* is it on? */
                    if ((Generic.spriteram_3[offs + 1] & 2) == 0)
                    {
                        uint sprite = Generic.spriteram[offs];
                        uint color = Generic.spriteram[offs + 1];
                        int x = (Generic.spriteram_2[offs + 1] - 69) + 0x100 * (Generic.spriteram_3[offs + 1] & 1);
                        int y = (Mame.Machine.drv.screen_height) - Generic.spriteram_2[offs] - 8;
                        int flipx = Generic.spriteram_3[offs] & 1;
                        int flipy = Generic.spriteram_3[offs] & 2;

                        switch (Generic.spriteram_3[offs] & 0x3c)
                        {
                            case 0x00:		/* 16x16 */
                                phozon_draw_sprite(bitmap, sprite, color, flipx, flipy, x, y);
                                break;

                            case 0x14:		/* 8x8 */
                                sprite = (uint)((sprite << 2) | ((Generic.spriteram_3[offs] & 0xc0) >> 6));
                                phozon_draw_sprite8(bitmap, sprite, color, flipx, flipy, x, y + 8);
                                break;

                            case 0x04:		/* 8x16 */
                                sprite = (uint)((sprite << 2) | ((Generic.spriteram_3[offs] & 0xc0) >> 6));
                                if (flipy == 0)
                                {
                                    phozon_draw_sprite8(bitmap, 2 + sprite, color, flipx, flipy, x, y + 8);
                                    phozon_draw_sprite8(bitmap, sprite, color, flipx, flipy, x, y);
                                }
                                else
                                {
                                    phozon_draw_sprite8(bitmap, 2 + sprite, color, flipx, flipy, x, y);
                                    phozon_draw_sprite8(bitmap, sprite, color, flipx, flipy, x, y + 8);
                                }
                                break;

                            case 0x24:		/* 8x32 */
                                sprite = (uint)((sprite << 2) | ((Generic.spriteram_3[offs] & 0xc0) >> 6));
                                if (flipy == 0)
                                {
                                    phozon_draw_sprite8(bitmap, 10 + sprite, color, flipx, flipy, x, y + 8);
                                    phozon_draw_sprite8(bitmap, 8 + sprite, color, flipx, flipy, x, y);
                                    phozon_draw_sprite8(bitmap, 2 + sprite, color, flipx, flipy, x, y - 8);
                                    phozon_draw_sprite8(bitmap, sprite, color, flipx, flipy, x, y - 16);
                                }
                                else
                                {
                                    phozon_draw_sprite8(bitmap, 10 + sprite, color, flipx, flipy, x, y - 16);
                                    phozon_draw_sprite8(bitmap, 8 + sprite, color, flipx, flipy, x, y - 8);
                                    phozon_draw_sprite8(bitmap, 2 + sprite, color, flipx, flipy, x, y);
//.........这里部分代码省略.........
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:101,代码来源:driver_phozon.cs


示例5: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {

                Mame.palette_init_used_colors();

                for (int offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    int code, color;

                    code = Mame.memory_region(Mame.REGION_GFX4)[0x1000 * bg_image + offs];
                    color = Mame.memory_region(Mame.REGION_GFX4)[0xc000 + 0x100 * bg_image + code];
                    for (int i = 0; i < 16; i++) Mame.palette_used_colors[i + 256 + 16 * color] = Mame.PALETTE_COLOR_USED;
                }
                for (int offs = 0; offs < 256; offs++)
                {
                    int color;

                    color = citycon_charlookup[offs];
                    Mame.palette_used_colors[512 + 4 * color] = Mame.PALETTE_COLOR_TRANSPARENT;
                    for (int i = 0; i < 3; i++) Mame.palette_used_colors[i + 512 + 4 * color + 1] = Mame.PALETTE_COLOR_USED; ;
                }
                for (int offs = Generic.spriteram_size[0] - 4; offs >= 0; offs -= 4)
                {
                    int color;

                    color = Generic.spriteram[offs + 2] & 0x0f;
                    for (int i = 0; i < 15; i++) Mame.palette_used_colors[i + 16 * color + 1] = Mame.PALETTE_COLOR_USED;
                }

                if (Mame.palette_recalc() != null)
                {
                    Generic.SetDirtyBuffer(true);
                    dirty_background = 1;
                }

                /* Create the background */
                if (dirty_background != 0)
                {
                    dirty_background = 0;

                    for (int offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                    {
                        int sx, sy, code;


                        sy = offs / 32;
                        sx = (offs % 32) + (sy & 0x60);
                        sy = sy & 31;
                        if (flipscreen != 0)
                        {
                            sx = 127 - sx;
                            sy = 31 - sy;
                        }

                        code = Mame.memory_region(Mame.REGION_GFX4)[0x1000 * bg_image + offs];

                        Mame.drawgfx(tmpbitmap2, Mame.Machine.gfx[3 + bg_image],
                                (uint)code,
                                Mame.memory_region(Mame.REGION_GFX4)[0xc000 + 0x100 * bg_image + code],
                                flipscreen != 0, flipscreen != 0,
                                8 * sx, 8 * sy,
                                null, Mame.TRANSPARENCY_NONE, 0);
                    }
                }

                /* copy the temporary bitmap to the screen */
                {
                    int scroll;

                    if (flipscreen != 0)
                        scroll = 256 + ((citycon_scroll[0] * 256 + citycon_scroll[1]) >> 1);
                    else
                        scroll = -((citycon_scroll[0] * 256 + citycon_scroll[1]) >> 1);

                    Mame.copyscrollbitmap(bitmap, tmpbitmap2, 1, new int[] { scroll }, 0, null, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                }


                /* for every character in the Video RAM, check if it has been modified */
                /* since last time and update it accordingly. */
                for (int offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    int sx, sy;


                    sy = offs / 32;
                    sx = (offs % 32) + (sy & 0x60);
                    sy = sy & 0x1f;

                    if (Generic.dirtybuffer[offs] || dirtylookup[sy])
                    {
                        int i;
                        Mame.rectangle clip = new Mame.rectangle();


                        Generic.dirtybuffer[offs] = false;

                        if (flipscreen != 0)
                        {
                            sx = 127 - sx;
//.........这里部分代码省略.........
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:101,代码来源:driver_citycon.cs


示例6: tecmo_vh_screenrefresh

        public static void tecmo_vh_screenrefresh(Mame.osd_bitmap bitmap, int full_refresh)
        {
            int offs;


            Mame.palette_init_used_colors();

            {
                int color, code, i;
                int[] colmask = new int[16];
                int pal_base;


                pal_base = Mame.Machine.drv.gfxdecodeinfo[5].color_codes_start;

                for (color = 0; color < 16; color++) colmask[color] = 0;

                for (offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    if (video_type == 2)	/* Gemini Wing */
                    {
                        code = Generic.videoram[offs] + 16 * (Generic.colorram[offs] & 0x70);
                        color = Generic.colorram[offs] & 0x0f;
                    }
                    else
                    {
                        code = Generic.videoram[offs] + 256 * (Generic.colorram[offs] & 0x07);
                        color = Generic.colorram[offs] >> 4;
                    }

                    colmask[color] |= (int)Mame.Machine.gfx[5].pen_usage[code];
                }

                for (color = 0; color < 16; color++)
                {
                    if ((colmask[color] & (1 << 0)) != 0)
                        Mame.palette_used_colors[pal_base + 16 * color] = Mame.PALETTE_COLOR_TRANSPARENT;
                    for (i = 1; i < 16; i++)
                    {
                        if ((colmask[color] & (1 << i)) != 0)
                            Mame.palette_used_colors[pal_base + 16 * color + i] = Mame.PALETTE_COLOR_USED;
                    }
                }


                pal_base = Mame.Machine.drv.gfxdecodeinfo[4].color_codes_start;

                for (color = 0; color < 16; color++) colmask[color] = 0;

                for (offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    if (video_type == 2)	/* Gemini Wing */
                    {
                        code = tecmo_videoram[offs] + 16 * (tecmo_colorram[offs] & 0x70);
                        color = tecmo_colorram[offs] & 0x0f;
                    }
                    else
                    {
                        code = tecmo_videoram[offs] + 256 * (tecmo_colorram[offs] & 0x07);
                        color = tecmo_colorram[offs] >> 4;
                    }

                    colmask[color] |= (int)Mame.Machine.gfx[4].pen_usage[code];
                }

                for (color = 0; color < 16; color++)
                {
                    if ((colmask[color] & (1 << 0)) != 0)
                        Mame.palette_used_colors[pal_base + 16 * color] = Mame.PALETTE_COLOR_TRANSPARENT;
                    for (i = 1; i < 16; i++)
                    {
                        if ((colmask[color] & (1 << i)) != 0)
                            Mame.palette_used_colors[pal_base + 16 * color + i] = Mame.PALETTE_COLOR_USED;
                    }
                }


                pal_base = Mame.Machine.drv.gfxdecodeinfo[1].color_codes_start;

                for (color = 0; color < 16; color++) colmask[color] = 0;

                for (offs = 0; offs < Generic.spriteram_size[0]; offs += 8)
                {
                    int flags = Generic.spriteram[offs + 3];
                    int bank = Generic.spriteram[offs + 0];
                    if ((bank & 4) != 0)
                    { /* visible */
                        int which = Generic.spriteram[offs + 1];
                        int size = (Generic.spriteram[offs + 2] & 3);
                        /* 0 = 8x8 1 = 16x16 2 = 32x32 3 = 64x64 */
                        if (size == 3) continue;	/* not used by these games */


                        if (video_type != 0)
                            code = (which) + ((bank & 0xf8) << 5); /* silkworm */
                        else
                            code = (which) + ((bank & 0xf0) << 4); /* rygar */

                        if (size == 1) code >>= 2;
                        else if (size == 2) code >>= 4;
//.........这里部分代码省略.........
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:101,代码来源:driver_tecmo.cs


示例7: draw_sprites

            static void draw_sprites(Mame.osd_bitmap bitmap, int pri_mask)
            {
                int offs, fx, fy, x, y, color, sprite;

                for (offs = 0x1000 - 8; offs >= 0; offs -= 8)
                {
                    /* Don't draw empty sprite table entries */
                    if (Generic.buffered_spriteram[offs + 7] != 0xf) continue;
                    if (Generic.buffered_spriteram[offs + 0] == 0x0f) continue;
                    if ((pri_mask & Generic.buffered_spriteram[offs + 5]) == 0) continue;

                    fx = Generic.buffered_spriteram[offs + 1] & 0x20;
                    fy = Generic.buffered_spriteram[offs + 1] & 0x40;
                    y = Generic.buffered_spriteram[offs + 0];
                    x = Generic.buffered_spriteram[offs + 4];

                    if ((Generic.buffered_spriteram[offs + 5] & 1) != 0) x = 0 - (0x100 - x);

                    color = Generic.buffered_spriteram[offs + 1] & 0xf;
                    sprite = Generic.buffered_spriteram[offs + 2] + (Generic.buffered_spriteram[offs + 3] << 8);
                    sprite &= 0x0fff;

                    if (flipscreen != 0)
                    {
                        x = 240 - x;
                        y = 240 - y;
                        if (fx != 0) fx = 0; else fx = 1;
                        if (fy != 0) fy = 0; else fy = 1;
                    }

                    Mame.drawgfx(bitmap, Mame.Machine.gfx[3],
                            (uint)sprite,
                            (uint)color, fx != 0, fy != 0, x, y,
                            Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 15);
                }
            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:36,代码来源:driver_raiden.cs


示例8: vh_update

        public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
        {
            Mame.tilemap_update(Mame.ALL_TILEMAPS);

            Mame.palette_init_used_colors();

            mark_sprites_palette();

            /* the following is required to make the colored background work */
            for (int i = 15; i < Mame.Machine.drv.total_colors; i += 16)
                Mame.palette_used_colors[i] = Mame.PALETTE_COLOR_TRANSPARENT;

            if (Mame.palette_recalc() != null)
                Mame.tilemap_mark_all_pixels_dirty(Mame.ALL_TILEMAPS);

            Mame.tilemap_render(Mame.ALL_TILEMAPS);

            Mame.tilemap_draw(bitmap, driver_mitchell.bg_tilemap, 0);

            draw_sprites(bitmap);
        }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:21,代码来源:driver_mitchell.cs


示例9: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
                if (Mame.palette_recalc() != null)
                {
                    /* if we ran out of palette entries, rebuild the whole screen */
                    for (int y = 0; y < 256; y++)
                    {
                        for (int x = 0; x < 320; x += 2)
                        {
                            updatepixels(x, y);
                        }
                    }
                }

                Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);

                {
                    int color = Mame.Machine.pens[512];

                    for (int y = 0; y < 256; y++)
                    {
                        for (int x = 0; x < 320; x += 8)
                        {
                            int d = blockout_frontvideoram.READ_WORD(y * 128 + (x / 4));

                            if (d != 0)
                            {
                                if ((d & 0x80) != 0) Mame.plot_pixel(bitmap, x, y, color);
                                if ((d & 0x40) != 0) Mame.plot_pixel(bitmap, x + 1, y, color);
                                if ((d & 0x20) != 0) Mame.plot_pixel(bitmap, x + 2, y, color);
                                if ((d & 0x10) != 0) Mame.plot_pixel(bitmap, x + 3, y, color);
                                if ((d & 0x08) != 0) Mame.plot_pixel(bitmap, x + 4, y, color);
                                if ((d & 0x04) != 0) Mame.plot_pixel(bitmap, x + 5, y, color);
                                if ((d & 0x02) != 0) Mame.plot_pixel(bitmap, x + 6, y, color);
                                if ((d & 0x01) != 0) Mame.plot_pixel(bitmap, x + 7, y, color);
                            }
                        }
                    }
                }

            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:41,代码来源:driver_blockout.cs


示例10: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
                for (int offs = Generic.videoram_size[0] - 2; offs >= 0; offs -= 2)
                {
                    int offs2;

                    offs2 = offs / 2;
                    if (Generic.dirtybuffer[offs] || Generic.dirtybuffer[offs + 1])
                    {
                        int sx, sy, code;


                        Generic.dirtybuffer[offs] = false;
                        Generic.dirtybuffer[offs + 1] = false;

                        sx = offs2 % 32;
                        sy = offs2 / 32;

                        if (flipscreen[0] != 0) sx = 31 - sx;
                        if (flipscreen[1] != 0) sy = 31 - sy;

                        code = Generic.videoram[offs + 1] + ((Generic.videoram[offs] & 0x07) << 8) + 2048 * gfxbank;
                        Mame.drawgfx(Generic.tmpbitmap, Mame.Machine.gfx[0],
                                (uint)code,
                                (uint)(((Generic.videoram[offs] & 0xf8) >> 3) + 32 * palettebank),
                                flipscreen[0] != 0, flipscreen[1] != 0,
                                8 * sx, 8 * sy,
                                Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                    }
                }


                /* copy the temporary bitmap to the screen */
                Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);


                /* Draw the sprites. */
                for (int offs = 0; offs < Generic.spriteram_size[0]; offs += 4)
                {
                    int sx, sy, code;


                    sx = Generic.spriteram[offs];
                    sy = 248 - Generic.spriteram[offs + 1];
                    if (flipscreen[0] != 0) sx = 248 - sx;
                    if (flipscreen[1] != 0) sy = 248 - sy;

                    code = Generic.spriteram[offs + 3] + ((Generic.spriteram[offs + 2] & 0x03) << 8) + 1024 * gfxbank;
                    Mame.drawgfx(bitmap, Mame.Machine.gfx[0],
                            (uint)(2 * code),
                            (uint)(((Generic.spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank),
                            flipscreen[0] != 0, flipscreen[1] != 0,
                            sx, sy + (flipscreen[1] != 0 ? 8 : -8),
                            Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 0);
                    Mame.drawgfx(bitmap, Mame.Machine.gfx[0],
                            (uint)(2 * code + 1),
                            (uint)(((Generic.spriteram[offs + 2] & 0xf8) >> 3) + 32 * palettebank),
                            flipscreen[0] != 0, flipscreen[1] != 0,
                            sx, sy,
                            Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 0);
                }
            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:62,代码来源:driver_arkanoid.cs


示例11: vh_update

 public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
 {
     invaders_vh_screenrefresh(bitmap, full_refresh != 0);
 }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:4,代码来源:driver_8080bw.cs


示例12: vh_screenrefresh

        public static void vh_screenrefresh(Mame.osd_bitmap bitmap, bool full_refresh)
        {
            if (Mame.palette_recalc() != null || redraw_screen != 0 || (full_refresh && use_tmpbitmap == 0))
            {
                int offs;

                for (offs = 0; offs < Generic.videoram_size[0]; offs++)
                    videoram_w_p(offs, Generic.videoram[offs]);

                redraw_screen = 0;

                if (overlay != null)
                    Mame.overlay_remap(overlay);
            }


            if (full_refresh && use_tmpbitmap != 0)
                /* copy the character mapped graphics */
                Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);

            if (overlay != null)
                Mame.overlay_draw(bitmap, overlay);
        }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:23,代码来源:driver_8080bw.cs


示例13: invaders_vh_screenrefresh

 public static void invaders_vh_screenrefresh(Mame.osd_bitmap bitmap, bool full_refresh)
 {
     vh_screenrefresh_p(bitmap, full_refresh);
 }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:4,代码来源:driver_8080bw.cs


示例14: vh_update

 public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
 {
     draw_background(bitmap);
     draw_sprites(bitmap);
 }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:5,代码来源:driver_troangel.cs


示例15: draw_sprites

            static void draw_sprites(Mame.osd_bitmap bitmap)
            {
                for (int offs = Generic.spriteram_size[0] - 4; offs >= 0; offs -= 4)
                {
                    byte attributes = Generic.spriteram[offs + 1];
                    int sx = Generic.spriteram[offs + 3];
                    int sy = ((224 - Generic.spriteram[offs + 0] - 32) & 0xff) + 32;
                    int code = Generic.spriteram[offs + 2];
                    int color = attributes & 0x1f;
                    bool flipy = (attributes & 0x80) != 0;
                    bool flipx = (attributes & 0x40) != 0;

                    int tile_number = code & 0x3f;

                    int bank = 0;
                    if ((code & 0x80) != 0) bank += 1;
                    if ((attributes & 0x20) != 0) bank += 2;

                    if (flipscreen != 0)
                    {
                        sx = 240 - sx;
                        sy = 224 - sy;
                        flipx = !flipx;
                        flipy = !flipy;
                    }

                    Mame.drawgfx(bitmap, Mame.Machine.gfx[1 + bank],
                        (uint)tile_number,
                        (uint)color,
                        flipx, flipy,
                        sx, sy,
                        Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 0);
                }
            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:34,代码来源:driver_troangel.cs


示例16: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
               int i, pwidth, pheight;
	float scale;
	Mame.osd_bitmap vector_bitmap=new Mame.osd_bitmap();
	Mame.rectangle rect=new Mame.rectangle();

	if (llander_panel == null)
	{
		AvgDvg.dvg_screenrefresh(bitmap,full_refresh);
		return;
	}

	pwidth = llander_panel._artwork.width;
	pheight = llander_panel._artwork.height;

	vector_bitmap.width = bitmap.width;
	vector_bitmap.height = bitmap.height - pheight;
	vector_bitmap._private = bitmap._private;
	vector_bitmap.line = bitmap.line;

	AvgDvg.dvg_screenrefresh(vector_bitmap,full_refresh);

	if (full_refresh!=0)
	{
		rect.min_x = 0;
		rect.max_x = pwidth-1;
		rect.min_y = bitmap.height - pheight;
		rect.max_y = bitmap.height - 1;

		Mame.copybitmap(bitmap,llander_panel._artwork,false,false,0, bitmap.height - pheight, rect, Mame.TRANSPARENCY_NONE, 0);
		Mame.osd_mark_dirty (rect.min_x,rect.min_y,rect.max_x,rect.max_y,0);
	}

	scale = pwidth/800.0f;

	for (i=0;i<NUM_LIGHTS;i++)
	{
		if (lights_changed[i] || full_refresh!=0)
		{
			rect.min_x = (int)(scale * light_areas[i].min_x);
			rect.max_x = (int)(scale * light_areas[i].max_x);
			rect.min_y = (int)(bitmap.height - pheight + scale * light_areas[i].min_y);
			rect.max_y = (int)(bitmap.height - pheight + scale * light_areas[i].max_y);

			if (lights[i])
                Mame.copybitmap(bitmap, llander_lit_panel._artwork, false,false,0, bitmap.height - pheight, rect, Mame.TRANSPARENCY_NONE, 0);
			else
                Mame.copybitmap(bitmap, llander_panel._artwork, false,false,0, bitmap.height - pheight, rect, Mame.TRANSPARENCY_NONE, 0);

            Mame.osd_mark_dirty(rect.min_x, rect.min_y, rect.max_x, rect.max_y, 0);

			lights_changed[i] = false;
		}
	}
            }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:56,代码来源:driver_asteroid.cs


示例17: draw_sprites

 static void draw_sprites(Mame.osd_bitmap bitmap)
 {
     /* the last entry is not a sprite, we skip it otherwise spang shows a bubble */
     /* moving diagonally across the screen */
     for (int offs = 0x1000 - 0x40; offs >= 0; offs -= 0x20)
     {
         int code = driver_mitchell.pang_objram[offs];
         int attr = driver_mitchell.pang_objram[offs + 1];
         int color = attr & 0x0f;
         int sx = driver_mitchell.pang_objram[offs + 3] + ((attr & 0x10) << 4);
         int sy = ((driver_mitchell.pang_objram[offs + 2] + 8) & 0xff) - 8;
         code += (attr & 0xe0) << 3;
         if (driver_mitchell.flipscreen != 0)
         {
             sx = 496 - sx;
             sy = 240 - sy;
         }
         Mame.drawgfx(bitmap, Mame.Machine.gfx[1],
                  (uint)code,
                  (uint)color,
                  driver_mitchell.flipscreen != 0, driver_mitchell.flipscreen != 0,
                  sx, sy,
                  Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_PEN, 15);
     }
 }
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:25,代码来源:driver_mitchell.cs


示例18: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
                _BytePtr sr, ss;
                int offs, i;
                _BytePtr RAM = (Mame.memory_region(Mame.REGION_CPU1));


                if (Mame.palette_recalc() != null)
                {
                    Generic.SetDirtyBuffer(true);
                    //memset(dirtybuffer,1,videoram_size);
                }

                jackal_scrollram = new _BytePtr(RAM, 0x0020);
                Generic.colorram = new _BytePtr(RAM, 0x2000);
                Generic.videoram = new _BytePtr(RAM, 0x2400);

                Generic.spriteram_size[0] = 0x500;

                if ((jackal_videoctrl[0x03] & 0x08) != 0)
                {
                    sr = new _BytePtr(RAM, 0x03800);	// Sprite 2
                    ss = new _BytePtr(RAM, 0x13800);	// Additional Sprite 2
                }
                else
                {
                    sr = new _BytePtr(RAM, 0x03000);	// Sprite 1
                    ss = new _BytePtr(RAM, 0x13000);	// Additional Sprite 1
                }

                /* for every character in the Video RAM, check if it has been modified */
                /* since last time and update it accordingly. */
                for (offs = Generic.videoram_size[0] - 1; offs >= 0; offs--)
                {
                    if (Generic.dirtybuffer[offs])
                    {
                        int sx, sy;

                        Generic.dirtybuffer[offs] = false;

                        sx = offs % 32;
                        sy = offs / 32;

                        Mame.drawgfx(Generic.tmpbitmap, Mame.Machine.gfx[0],
                            (uint)(Generic.videoram[offs] + ((Generic.colorram[offs] & 0xc0) << 2) + ((Generic.colorram[offs] & 0x30) << 6)),
                            0,//colorram[offs] & 0x0f, there must be a PROM like in Contra
                            (Generic.colorram[offs] & 0x10) != 0, (Generic.colorram[offs] & 0x20) != 0,
                            8 * sx, 8 * sy,
                            null, Mame.TRANSPARENCY_NONE, 0);
                    }
                }


                /* copy the temporary bitmap to the screen */
                {
                    int h_scroll_num = 0, v_scroll_num = 0;
                    int[] h_scroll = new int[32], v_scroll = new int[32];

                    if ((jackal_videoctrl[2] & 0x08) != 0)
                    {
                        h_scroll_num = 32;
                        for (i = 0; i < 32; i++)
                            h_scroll[i] = -(jackal_scrollram[i]);
                    }

                    if ((jackal_videoctrl[2] & 0x04) != 0)
                    {
                        v_scroll_num = 32;
                        for (i = 0; i < 32; i++)
                            v_scroll[i] = -(jackal_scrollram[i]);
                    }

                    if (jackal_videoctrl[0] != 0)
                    {
                        v_scroll_num = 1;
                        v_scroll[0] = -(jackal_videoctrl[0]);
                    }

                    if (jackal_videoctrl[1] != 0)
                    {
                        h_scroll_num = 1;
                        h_scroll[0] = -(jackal_videoctrl[1]);
                    }

                    if ((h_scroll_num == 0) && (v_scroll_num == 0))
                        Mame.copybitmap(bitmap, Generic.tmpbitmap, false, false, 0, 0, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                    else
                        Mame.copyscrollbitmap(bitmap, Generic.tmpbitmap, h_scroll_num, h_scroll, v_scroll_num, v_scroll, Mame.Machine.drv.visible_area, Mame.TRANSPARENCY_NONE, 0);
                }

                /* Draw the sprites. */
                {
                    byte sr1, sr2, sr3, sr4, sr5;
                    int spritenum, sx, sy, color;
                    byte sn1, sn2, sp;
                    bool flipx, flipy;

                    for (offs = 0; offs < 0x0F5; /* offs += 5 */ )
                    {
                        sn1 = ss[offs++]; // offs+0
//.........这里部分代码省略.........
开发者ID:DarrenRainey,项目名称:xnamame036,代码行数:101,代码来源:driver_jackal.cs


示例19: vh_update

            public override void vh_update(Mame.osd_bitmap bitmap, int full_refresh)
            {
                int color, offs, sprite;
                int[] colmask = new int[16];
                int i, pal_base;

                /* Setup the tilemaps, alternate version has different scroll positions */
                if (ALTERNATE == 0)
                {
                    Mame.tilemap_set_scrollx(background_layer, 0, ((raiden_scroll_ram[1] << 8) + raiden_scroll_ram[0]));
                    Mame.tilemap_set_scrolly(background_layer, 0, ((raiden_scroll_ram[3] << 8) + raiden_scroll_ram[2]));
                    Mame.tilemap_set_scrollx(foreground_layer, 0, ((raiden_scroll_ram[5] << 8) + raiden_scroll_ram[4]));
                    Mame.tilemap_set_scrolly(foreground_layer, 0, ((raiden_scroll_ram[7] << 8) + raiden_scroll_ram[6]));
                }
                else
                {
                    Mame.tilemap_set_scrolly(background_layer, 0, ((raiden_scroll_ram[0x02] & 0x30) << 4) + ((raiden_scroll_ram[0x04] & 0x7f) << 1) + ((raiden_scroll_ram[0x04] & 0x80) >> 7));
                    Mame.tilemap_set_scrollx(background_layer, 0, ((raiden_scroll_ram[0x12] & 0x30) << 4) + ((raiden_scroll_ram[0x14] & 0x7f) << 1) + ((raiden_scroll_ram[0x14] & 0x80) >> 7));
                    Mame.tilemap_set_scrolly(foreground_layer, 0, ((raiden_scroll_ram[0x22] & 0x30) << 4) + ((raiden_scroll_ram[0x24] & 0x7f) << 1) + ((raiden_scroll_ram[0x24] & 0x80) >> 7));
                    Mame.tilemap_set_scrollx(foreground_layer, 0, ((raiden_scroll_ram[0x32] & 0x30) << 4) + ((raiden_scroll_ram[0x34] & 0x7f) << 1) + ((raiden_scroll_ram[0x34] & 0x80) >> 7));
                }

                Mame.tilemap_update(Mame.ALL_TILEMAPS);

                /* 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ManageMessageId类代码示例发布时间:2022-05-24
下一篇:
C# MakeBitmapParameter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap