示例#1
0
 u32 screen_update_galaga(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect)
 {
     bitmap.fill(m_palette.op0.black_pen(), cliprect);
     m_starfield.op0.draw_starfield(bitmap, cliprect, 0);
     draw_sprites(bitmap, cliprect);
     m_fg_tilemap.draw(screen, bitmap, cliprect);
     return(0);
 }
示例#2
0
文件: galaga.cs 项目: kwanboy/mcs
 public UInt32 screen_update_galaga(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect)
 {
     bitmap.fill(m_palette.target.palette_interface.black_pen(), cliprect);
     draw_stars(bitmap, cliprect);
     draw_sprites(bitmap, cliprect);
     m_fg_tilemap.draw(screen, bitmap, cliprect, 0, 0);
     return(0);
 }
示例#3
0
        void copy_layers(bitmap_ind16 bitmap, rectangle cliprect, copy_layer_func_t copy_layer_func, int [] sprites_on, rectangle [] sprite_areas)
        {
            // fill the screen with the background color
            bitmap.fill((uint32_t)(8 * (m_colorbank.op[1] & 0x07)), cliprect);

            for (int i = 0; i < 4; i++)
            {
                int which = m_draw_order[m_video_priority.op0 & 0x1f, i];

                copy_layer(bitmap, cliprect, copy_layer_func, which, sprites_on, sprite_areas);
            }
        }
示例#4
0
文件: empty.cs 项目: kwanboy/mcs
 public static u32 screen_update____empty(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect)
 {
     bitmap.fill(rgb_t.black(), cliprect);
     return(0);
 }
示例#5
0
 u32 screen_update(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect)
 {
     bitmap.fill(rgb_t.black(), cliprect);
     return(0);
 }
示例#6
0
文件: pacman.cs 项目: kwanboy/mcs
        public uint32_t screen_update_pacman(screen_device screen, bitmap_ind16 bitmap, rectangle cliprect)
        {
            if (m_bgpriority != 0)
            {
                bitmap.fill(0, cliprect);
            }
            else
            {
                m_bg_tilemap.draw(screen, bitmap, cliprect, tilemap_global.TILEMAP_DRAW_OPAQUE, 0);
            }

            if (m_spriteram != null)
            {
                ListBytesPointer spriteram   = m_spriteram.target;  //uint8_t *spriteram = m_spriteram;
                ListBytesPointer spriteram_2 = m_spriteram2.target; //uint8_t *spriteram_2 = m_spriteram2;
                int offs;

                rectangle spriteclip = new rectangle(2 * 8, 34 * 8 - 1, 0 * 8, 28 * 8 - 1);
                spriteclip.intersection(cliprect); // spriteclip &= cliprect;

                /* Draw the sprites. Note that it is important to draw them exactly in this */
                /* order, to have the correct priorities. */
                for (offs = (int)m_spriteram.bytes() - 2; offs > 2 * 2; offs -= 2)
                {
                    int  color;
                    int  sx;
                    int  sy;
                    byte fx;
                    byte fy;

                    if (m_inv_spr != 0)
                    {
                        sx = spriteram_2[offs + 1];
                        sy = 240 - (spriteram_2[offs]);
                    }
                    else
                    {
                        sx = 272 - spriteram_2[offs + 1];
                        sy = spriteram_2[offs] - 31;
                    }

                    fx = (byte)((spriteram[offs] & 1) ^ m_inv_spr);
                    fy = (byte)((spriteram[offs] & 2) ^ ((m_inv_spr) << 1));

                    color = (spriteram[offs + 1] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);

                    m_gfxdecode.target.digfx.gfx(1).transmask(bitmap, spriteclip,
                                                              (UInt32)((spriteram[offs] >> 2) | (m_spritebank << 6)),
                                                              (UInt32)color,
                                                              fx, fy,
                                                              sx, sy,
                                                              m_palette.target.palette_interface.transpen_mask(m_gfxdecode.target.digfx.gfx(1), (UInt32)color & 0x3f, 0));

                    /* also plot the sprite with wraparound (tunnel in Crush Roller) */
                    m_gfxdecode.target.digfx.gfx(1).transmask(bitmap, spriteclip,
                                                              (UInt32)((spriteram[offs] >> 2) | (m_spritebank << 6)),
                                                              (UInt32)color,
                                                              fx, fy,
                                                              sx - 256, sy,
                                                              m_palette.target.palette_interface.transpen_mask(m_gfxdecode.target.digfx.gfx(1), (UInt32)color & 0x3f, 0));
                }

                /* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
                /* one pixel to the left to get a more correct placement */
                for (offs = 2 * 2; offs >= 0; offs -= 2)
                {
                    int  color;
                    int  sx;
                    int  sy;
                    byte fx;
                    byte fy;

                    if (m_inv_spr != 0)
                    {
                        sx = spriteram_2[offs + 1];
                        sy = 240 - (spriteram_2[offs]);
                    }
                    else
                    {
                        sx = 272 - spriteram_2[offs + 1];
                        sy = spriteram_2[offs] - 31;
                    }

                    color = (spriteram[offs + 1] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);

                    fx = (byte)((spriteram[offs] & 1) ^ m_inv_spr);
                    fy = (byte)((spriteram[offs] & 2) ^ ((m_inv_spr) << 1));

                    m_gfxdecode.target.digfx.gfx(1).transmask(bitmap, spriteclip,
                                                              (UInt32)((spriteram[offs] >> 2) | (m_spritebank << 6)),
                                                              (UInt32)color,
                                                              fx, fy,
                                                              sx, sy + m_xoffsethack,
                                                              m_palette.target.palette_interface.transpen_mask(m_gfxdecode.target.digfx.gfx(1), (UInt32)color & 0x3f, 0));

                    /* also plot the sprite with wraparound (tunnel in Crush Roller) */
                    m_gfxdecode.target.digfx.gfx(1).transmask(bitmap, spriteclip,
                                                              (UInt32)((spriteram[offs] >> 2) | (m_spritebank << 6)),
                                                              (UInt32)color,
                                                              fx, fy,
                                                              sx - 256, sy + m_xoffsethack,
                                                              m_palette.target.palette_interface.transpen_mask(m_gfxdecode.target.digfx.gfx(1), (UInt32)color & 0x3f, 0));
                }
            }

            if (m_bgpriority != 0)
            {
                m_bg_tilemap.draw(screen, bitmap, cliprect, 0, 0);
            }

            return(0);
        }