// most of this came from pinmame as the diagram doesn't make a lot of sense UINT32 mrgame_state::screen_update_mrgame(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { UINT8 x,y,ptr=0,col; INT32 scrolly[32]; UINT16 chr; bool flipx,flipy; // text for (x = 0; x < 32; x++) { scrolly[x] = -m_p_objectram[ptr++]; col = m_p_objectram[ptr++]; for (y = 0; y < 32; y++) { chr = m_p_videoram[x+y*32] | (m_gfx_bank << 8); m_gfxdecode->gfx(0)->opaque(*m_tile_bitmap, m_tile_bitmap->cliprect(), chr, col, m_flip,0, x*8,y*8); } } // scroll each column as needed copyscrollbitmap(bitmap,*m_tile_bitmap,0,0,32,scrolly,cliprect); // sprites for (ptr = 0x40; ptr < 0x60; ptr += 4) { x = m_p_objectram[ptr + 3] + 1; y = 255 - m_p_objectram[ptr]; flipx = BIT(m_p_objectram[ptr + 1], 6); flipy = BIT(m_p_objectram[ptr + 1], 7); chr = (m_p_objectram[ptr + 1] & 0x3f) | (m_gfx_bank << 6); col = m_p_objectram[ptr + 2]; if ((y > 16) && (x > 24)) m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, chr, col, flipx,flipy, x,y-16,0); } return 0; }
/* write a single char on screen */ void apexc_state::apexc_draw_char(bitmap_ind16 &bitmap, char character, int x, int y, int color) { m_gfxdecode->m_gfx[0]->transpen(bitmap,bitmap.cliprect(), character-32, color, 0, 0, x+1, y, 0); }
void ninjakd2_state::draw_sprites( bitmap_ind16 &bitmap) { gfx_element* const gfx = m_gfxdecode->gfx(1); int const big_xshift = m_robokid_sprites ? 1 : 0; int const big_yshift = m_robokid_sprites ? 0 : 1; UINT8* sprptr = &m_spriteram[11]; int sprites_drawn = 0; /* The sprite generator draws exactly 96 16x16 sprites per frame. When big (32x32) sprites are drawn, this counts for 4 sprites drawn, so the sprite list is reduced accordingly (i.e. three slots at the end of the list will be ignored). Note that a disabled sprite, even if it is not drawn, still counts as one sprite drawn. This is proven by Mutant Night, which doesn't work correctly (leaves shots on screen) if we don't take big sprites into account. */ for (;;) { if (sprptr[2] & 0x02) { int sx = sprptr[1] - ((sprptr[2] & 0x01) << 8); int sy = sprptr[0]; // Ninja Kid II doesn't use the topmost bit (it has smaller ROMs) so it might not be connected on the board int code = sprptr[3] + ((sprptr[2] & 0xc0) << 2) + ((sprptr[2] & 0x08) << 7); int flipx = (sprptr[2] & 0x10) >> 4; int flipy = (sprptr[2] & 0x20) >> 5; int const color = sprptr[4] & 0x0f; // Ninja Kid II doesn't use the 'big' feature so it might not be available on the board int const big = (sprptr[2] & 0x04) >> 2; if (flip_screen()) { sx = 240 - 16*big - sx; sy = 240 - 16*big - sy; flipx ^= 1; flipy ^= 1; } if (big) { code &= ~3; code ^= flipx << big_xshift; code ^= flipy << big_yshift; } for (int y = 0; y <= big; ++y) { for (int x = 0; x <= big; ++x) { int const tile = code ^ (x << big_xshift) ^ (y << big_yshift); gfx->transpen(m_palette,bitmap,bitmap.cliprect(), tile, color, flipx,flipy, sx + 16*x, sy + 16*y, 0xf); ++sprites_drawn; if (sprites_drawn >= 96) return; } } } else { ++sprites_drawn;
/* write a single char on screen */ void tx0_state::tx0_draw_char(bitmap_ind16 &bitmap, char character, int x, int y, int color) { m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,bitmap.cliprect(), character-32, color, 0, 0, x+1, y, 0); }
/* write a single char on screen */ void pdp1_state::pdp1_draw_char(bitmap_ind16 &bitmap, char character, int x, int y, int color) { drawgfx_transpen(bitmap, bitmap.cliprect(), machine().gfx[0], character-32, color, 0, 0, x+1, y, 0); }
/* write a single char on screen */ static void tx0_draw_char(running_machine &machine, bitmap_ind16 &bitmap, char character, int x, int y, int color) { drawgfx_transpen(bitmap, bitmap.cliprect(), machine.gfx[0], character-32, color, 0, 0, x+1, y, 0); }