Exemplo n.º 1
0
        //TILE_GET_INFO_MEMBER(pacman_state::pacman_get_tile_info)
        void pacman_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int code = m_videoram.op[tile_index] | (m_charbank << 8);
            int attr = (m_colorram.op[tile_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);

            tileinfo.set(0, (u32)code, (u32)attr, 0);
        }
Exemplo n.º 2
0
        //TILE_GET_INFO_MEMBER(dkong_state::dkong_bg_tile_info)
        void dkong_bg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int code  = m_video_ram[tile_index] + 256 * m_gfx_bank;
            int color = (m_color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * m_palette_bank;

            tileinfo.set(0, (u32)code, (u32)color, 0);  //SET_TILE_INFO_MEMBER(0, code, color, 0);
        }
Exemplo n.º 3
0
        //TILE_GET_INFO_MEMBER(digdug_state::tx_get_tile_info)
        void tx_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint8_t code = m_videoram.op[tile_index];
            int     color;

            /* the hardware has two ways to pick the color, either straight from the
             * bottom 4 bits of the character code, or from the top 4 bits through a
             * formula. The former method isnot used by Dig Dug and seems kind of
             * useless (I don't know what use they were thinking of when they added
             * it), anyway here it is reproduced faithfully. */

            if (m_tx_color_mode != 0)
            {
                color = code & 0x0f;
            }
            else
            {
                color = ((code >> 4) & 0x0e) | ((code >> 3) & 2);
            }

            /* the hardware has two character sets, one normal and one x-flipped. When
             * screen is flipped, character y flip is done by the hardware inverting the
             * timing signals, while x flip is done by selecting the 2nd character set.
             * We reproduce this here, but since the tilemap system automatically flips
             * characters when screen is flipped, we have to flip them back. */
            tileinfo.set(0,
                         (u32)((code & 0x7f) | (flip_screen() != 0 ? 0x80 : 0)),
                         (u32)color,
                         flip_screen() != 0 ? TILE_FLIPX : (u8)0);
        }
Exemplo n.º 4
0
        /***************************************************************************
         *  Atari System 2 hardware
         ****************************************************************************/

        /*************************************
        *
        *  Tilemap callbacks
        *
        *************************************/

        //TILE_GET_INFO_MEMBER(atarisy2_state::get_alpha_tile_info)
        void get_alpha_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint16_t data  = (uint16_t)m_alpha_tilemap.op0.basemem_read(tile_index);
            int      code  = data & 0x3ff;
            int      color = (data >> 13) & 0x07;

            tileinfo.set(2, (uint32_t)code, (uint32_t)color, 0);
        }
Exemplo n.º 5
0
        //TILE_GET_INFO_MEMBER(pacman_state::pacman_get_tile_info)
        void pacman_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int code = m_videoram[tile_index] | (m_charbank << 8);
            int attr = (m_colorram[tile_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);

            //SET_TILE_INFO_MEMBER(0,code,attr,0);
            tileinfo.set(0, (UInt32)code, (UInt32)attr, 0);
        }
Exemplo n.º 6
0
        //TILE_GET_INFO_MEMBER(dkong_state::radarscp1_bg_tile_info)
        void radarscp1_bg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int code  = m_video_ram[tile_index] + 256 * m_gfx_bank;
            int color = (m_color_codes[tile_index % 32] & 0x0f);

            color = color | (m_palette_bank << 4);

            tileinfo.set(0, (u32)code, (u32)color, 0);  //SET_TILE_INFO_MEMBER(0, code, color, 0);
        }
Exemplo n.º 7
0
        //TILE_GET_INFO_MEMBER(atarisy2_state::get_playfield_tile_info)
        void get_playfield_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint16_t data  = tile_index < 020000 / 2 ? m_playfieldt[tile_index].op : m_playfieldb[tile_index & (020000 / 2 - 1)].op;
            int      code  = (int)(m_playfield_tile_bank[(data >> 10) & 1] << 10) | (data & 0x3ff);
            int      color = (data >> 11) & 7;

            tileinfo.set(0, (uint32_t)code, (uint32_t)color, 0);
            tileinfo.category = (uint8_t)(((uint32_t) ~data >> 14) & 3);
        }
Exemplo n.º 8
0
        /***************************************************************************
        *
        *  Callbacks for the TileMap code
        *
        ***************************************************************************/

        //TILE_GET_INFO_MEMBER(_1942_state::get_fg_tile_info)
        void get_fg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int code  = m_fg_videoram.op[tile_index];
            int color = m_fg_videoram.op[tile_index + 0x400];

            tileinfo.set(0,
                         (u32)(code + ((color & 0x80) << 1)),
                         (u32)(color & 0x3f),
                         0);
        }
Exemplo n.º 9
0
        //TILE_GET_INFO_MEMBER(xevious_state::get_bg_tile_info)
        void get_bg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint8_t code  = m_xevious_bg_videoram.op[tile_index];
            uint8_t attr  = m_xevious_bg_colorram.op[tile_index];
            uint8_t color = (uint8_t)(((attr & 0x3c) >> 2) | ((code & 0x80) >> 3) | ((attr & 0x03) << 5));

            tileinfo.set(1,
                         (u32)(code + ((attr & 0x01) << 8)),
                         color,
                         TILE_FLIPYX((attr & 0xc0) >> 6));
        }
Exemplo n.º 10
0
        //TILE_GET_INFO_MEMBER(_1942_state::get_bg_tile_info)
        void get_bg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            tile_index = (tile_index & 0x0f) | ((tile_index & 0x01f0) << 1);

            int code  = m_bg_videoram.op[tile_index];
            int color = m_bg_videoram.op[tile_index + 0x10];

            tileinfo.set(1,
                         (u32)(code + ((color & 0x80) << 1)),
                         (u32)((color & 0x1f) + (0x20 * m_palette_bank)),
                         TILE_FLIPYX((color & 0x60) >> 5));
        }
Exemplo n.º 11
0
        /*************************************
        *
        *  Background tilemap
        *
        *************************************/

        //TILE_GET_INFO_MEMBER(galaxian_state::bg_get_tile_info)
        void bg_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            var     videoram = m_videoram.op; //uint8_t *videoram = m_videoram;
            uint8_t x        = (uint8_t)(tile_index & 0x1f);
            uint8_t y        = (uint8_t)(tile_index >> 5);

            uint16_t code   = videoram[tile_index];
            uint8_t  attrib = m_spriteram.op[x * 2 + 1];
            uint8_t  color  = (uint8_t)(attrib & 7);

            m_extend_tile_info_ptr(ref code, ref color, attrib, x, y);

            tileinfo.set(0, code, color, 0);
        }
Exemplo n.º 12
0
        //TILE_GET_INFO_MEMBER(galaga_state::get_tile_info)
        void get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            /* the hardware has two character sets, one normal and one x-flipped. When
             * screen is flipped, character y flip is done by the hardware inverting the
             * timing signals, while x flip is done by selecting the 2nd character set.
             * We reproduce this here, but since the tilemap system automatically flips
             * characters when screen is flipped, we have to flip them back. */
            int color = m_videoram.op[tile_index + 0x400] & 0x3f;

            tileinfo.set(0,
                         (u32)(m_videoram.op[tile_index] & 0x7f) | (flip_screen() != 0 ? 0x80 : 0U) | (m_galaga_gfxbank << 8),
                         (u32)color,
                         flip_screen() != 0 ? TILE_FLIPX : (u8)0);

            tileinfo.group = (u8)color;
        }
Exemplo n.º 13
0
        /***************************************************************************
        *  Callbacks for the TileMap code
        ***************************************************************************/

        //TILE_GET_INFO_MEMBER(xevious_state::get_fg_tile_info)
        void get_fg_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint8_t attr = m_xevious_fg_colorram.op[tile_index];

            /* the hardware has two character sets, one normal and one x-flipped. When
             * screen is flipped, character y flip is done by the hardware inverting the
             * timing signals, while x flip is done by selecting the 2nd character set.
             * We reproduce this here, but since the tilemap system automatically flips
             * characters when screen is flipped, we have to flip them back. */
            uint8_t color = (uint8_t)(((attr & 0x03) << 4) | ((attr & 0x3c) >> 2));

            tileinfo.set(0,
                         (u32)(m_xevious_fg_videoram.op[tile_index] | (flip_screen() != 0 ? 0x100 : 0)),
                         color,
                         (u8)(TILE_FLIPYX((attr & 0xc0) >> 6) ^ (flip_screen() != 0 ? TILE_FLIPX : 0)));
        }
Exemplo n.º 14
0
        //TILE_GET_INFO_MEMBER(digdug_state::bg_get_tile_info)
        void bg_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            Pointer <uint8_t> rom = new Pointer <uint8_t>(memregion("gfx4").base_());  //uint8_t *rom = memregion("gfx4")->base();

            int code = rom[tile_index | ((u32)m_bg_select << 10)];

            /* when the background is "disabled", it is actually still drawn, but using
             * a color code that makes all pixels black. There are pullups setting the
             * code to 0xf, but also solder pads that optionally connect the lines with
             * tilemap RAM, therefore allowing to pick some bits of the color code from
             * the top 4 bits of alpha code. This feature is not used by Dig Dug. */

            int color = m_bg_disable != 0 ? 0xf : (code >> 4);

            tileinfo.set(2,
                         (u32)code,
                         (u32)(color | m_bg_color_bank),
                         0);
        }
Exemplo n.º 15
0
        /*************************************
        *
        *  Tilemap info callback
        *
        *************************************/
        //TILE_GET_INFO_MEMBER(m52_state::get_tile_info)
        void get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            uint8_t video = m_videoram.op[tile_index];
            uint8_t color = m_colorram.op[tile_index];

            int flag = 0;
            int code = 0;

            code = video;

            if ((color & 0x80) != 0)
            {
                code |= 0x100;
            }

            if (tile_index / 32 <= 6)
            {
                flag |= TILE_FORCE_LAYER0; /* lines 0 to 6 are opaqe? */
            }

            tileinfo.set(0, (u32)code, (u32)(color & 0x7f), (u8)flag);
        }
Exemplo n.º 16
0
        /*************************************
        *
        *  Tilemap callback
        *
        *************************************/

        //TILE_GET_INFO_MEMBER(centiped_state::centiped_get_tile_info)
        void centiped_get_tile_info(tilemap_t tilemap, ref tile_data tileinfo, tilemap_memory_index tile_index)
        {
            int data = m_videoram[tile_index].op;

            tileinfo.set(0, ((u32)data & 0x3f) + 0x40, 0, TILE_FLIPYX(data >> 6));
        }