Exemple #1
0
uint32_t darkmist_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
#define DM_GETSCROLL(n) (((m_scroll[(n)]<<1)&0xff) + ((m_scroll[(n)]&0x80)?1:0) +( ((m_scroll[(n)-1]<<4) | (m_scroll[(n)-1]<<12) )&0xff00))

	m_bgtilemap->set_scrollx(0, DM_GETSCROLL(0x2));
	m_bgtilemap->set_scrolly(0, DM_GETSCROLL(0x6));
	m_fgtilemap->set_scrollx(0, DM_GETSCROLL(0xa));
	m_fgtilemap->set_scrolly(0, DM_GETSCROLL(0xe));

	m_temp_bitmap.fill(0,cliprect);
	bitmap.fill(m_palette->black_pen(), cliprect);
	
	if(m_hw & DISPLAY_BG)
	{
		m_bgtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
		mix_layer(screen, bitmap, cliprect, m_bg_clut);
	}
	
	if(m_hw & DISPLAY_FG)
	{
		m_fgtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
		mix_layer(screen, bitmap, cliprect, m_fg_clut);
	}
	
	if(m_hw & DISPLAY_SPR)
	{
		draw_sprites(m_temp_bitmap,cliprect);
		mix_layer(screen, bitmap, cliprect, m_spr_clut);
	}

	if(m_hw & DISPLAY_TXT)
	{
		m_txtilemap->draw(screen, m_temp_bitmap, cliprect, 0,0);
		mix_layer(screen, bitmap, cliprect, m_tx_clut);
	}

	return 0;
}
Exemple #2
0
UINT32 sslam_state::screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{

	if (!(m_regs[6] & 1))
	{
		bitmap.fill(get_black_pen(machine()), cliprect);
		return 0;
	}

	m_tx_tilemap->set_scrollx(0, m_regs[0]+1);  /* +0 looks better, but the real board has the left most pixel at the left edge shifted off screen */
	m_tx_tilemap->set_scrolly(0, (m_regs[1] & 0xff)+8);
	m_md_tilemap->set_scrollx(0, m_regs[2]+2);
	m_md_tilemap->set_scrolly(0, m_regs[3]+8);
	m_bg_tilemap->set_scrollx(0, m_regs[4]+4);
	m_bg_tilemap->set_scrolly(0, m_regs[5]+8);

	m_bg_tilemap->draw(bitmap, cliprect, 0,0);

	/* remove wraparound from the tilemap (used on title screen) */
	if (m_regs[2]+2 > 0x8c8)
	{
		rectangle md_clip;
		md_clip.min_x = cliprect.min_x;
		md_clip.max_x = cliprect.max_x - (m_regs[2]+2 - 0x8c8);
		md_clip.min_y = cliprect.min_y;
		md_clip.max_y = cliprect.max_y;

		m_md_tilemap->draw(bitmap, md_clip, 0,0);
	}
	else
	{
		m_md_tilemap->draw(bitmap, cliprect, 0,0);
	}

	draw_sprites(machine(), bitmap,cliprect);
	m_tx_tilemap->draw(bitmap, cliprect, 0,0);
	return 0;
}
Exemple #3
0
uint32_t namcos1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i;
	rectangle new_clip = cliprect;

	/* flip screen is embedded in the sprite control registers */
	flip_screen_set(m_spriteram[0x0ff6] & 1);

	/* background color */
	bitmap.fill(m_c116->black_pen(), cliprect);

	/* berabohm uses asymmetrical visibility windows to iris on the character */
	i = m_c116->get_reg(0) - 1;                         // min x
	if (new_clip.min_x < i) new_clip.min_x = i;
	i = m_c116->get_reg(1) - 1 - 1;                     // max x
	if (new_clip.max_x > i) new_clip.max_x = i;
	i = m_c116->get_reg(2) - 0x11;                      // min y
	if (new_clip.min_y < i) new_clip.min_y = i;
	i = m_c116->get_reg(3) - 0x11 - 1;                  // max y
	if (new_clip.max_y > i) new_clip.max_y = i;

	if (new_clip.empty())
		return 0;

	m_c123tmap->init_scroll(flip_screen());

	screen.priority().fill(0, new_clip);

	/* bit 0-2 priority */
	/* bit 3   disable  */
	for (int priority = 0; priority < 8; priority++)
	{
		m_c123tmap->draw(screen, bitmap, new_clip, priority, priority);
	}

	draw_sprites(screen, bitmap, new_clip);
	return 0;
}
Exemple #4
0
UINT32 taitopjc_state::screen_update_taitopjc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	UINT8 *s = (UINT8*)m_screen_ram.get();
	int x,y,t,u;

	bitmap.fill(0x000000, cliprect);

	UINT16 *s16 = (UINT16*)m_screen_ram.get();

	for (u=0; u < 24; u++)
	{
		for (t=0; t < 32; t++)
		{
			UINT16 tile = s16[(0x7e000 + (u*64) + t) ^ NATIVE_ENDIAN_VALUE_LE_BE(1,0)];

			int palette = (tile >> 12) & 0xf;

			tile &= 0xfff;

			for (y=0; y < 16; y++)
			{
				UINT16 *fb = &bitmap.pix16(y+(u*16));
				for (x=0; x < 16; x++)
				{
					UINT8 p = s[((tile*256) + ((y*16)+x)) ^ NATIVE_ENDIAN_VALUE_LE_BE(3,0)];
					if (p != 0)
					{
						fb[x+(t*16)] = (palette << 8) + p;
					}
				}
			}
		}
	}

	m_tc0780fpa->draw(bitmap, cliprect);

	return 0;
}
Exemple #5
0
UINT32 unico_state::screen_update_unico(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = -1;

	m_tilemap[0]->set_scrollx(0, m_scroll[0x00]);
	m_tilemap[0]->set_scrolly(0, m_scroll[0x01]);

	m_tilemap[1]->set_scrollx(0, m_scroll[0x05]);
	m_tilemap[1]->set_scrolly(0, m_scroll[0x0a]);

	m_tilemap[2]->set_scrollx(0, m_scroll[0x04]);
	m_tilemap[2]->set_scrolly(0, m_scroll[0x02]);

#ifdef MAME_DEBUG
if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) )
{
	int msk = 0;
	if (machine().input().code_pressed(KEYCODE_Q))  msk |= 1;
	if (machine().input().code_pressed(KEYCODE_W))  msk |= 2;
	if (machine().input().code_pressed(KEYCODE_E))  msk |= 4;
	if (machine().input().code_pressed(KEYCODE_A))  msk |= 8;
	if (msk != 0) layers_ctrl &= msk;
}
#endif

	/* The background color is the first of the last palette */
	bitmap.fill(0x1f00, cliprect);
	screen.priority().fill(0, cliprect);

	if (layers_ctrl & 1)    m_tilemap[0]->draw(screen, bitmap, cliprect, 0,1);
	if (layers_ctrl & 2)    m_tilemap[1]->draw(screen, bitmap, cliprect, 0,2);
	if (layers_ctrl & 4)    m_tilemap[2]->draw(screen, bitmap, cliprect, 0,4);

	/* Sprites are drawn last, using pdrawgfx */
	if (layers_ctrl & 8)    unico_draw_sprites(screen,bitmap,cliprect);

	return 0;
}
Exemple #6
0
UINT32 lastfght_state::screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
#ifdef MAME_DEBUG
#if 1
    // gfx roms viewer (toggle with enter, use pgup/down to browse)
    int x, y, count = 0;
    UINT8 *gfxdata = memregion("gfx1")->base();
    UINT8 data;

    if (machine().input().code_pressed_once(KEYCODE_ENTER)) m_view_roms ^= 1;
    if (m_view_roms)
    {
        if (machine().input().code_pressed_once(KEYCODE_PGDN))  m_base += 512 * 256;
        if (machine().input().code_pressed_once(KEYCODE_PGUP))  m_base -= 512 * 256;
        m_base %= memregion("gfx1")->bytes();

        count = m_base;

        bitmap.fill(m_palette->black_pen(), cliprect );
        for (y = 0 ; y < 256; y++)
        {
            for (x = 0; x < 512; x++)
            {
                data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? m_palette->white_pen() : gfxdata[count];   // white grid or data
                bitmap.pix16(y, x) = data;
                count++;
            }
        }
        popmessage("%x", m_base);
        return 0;
    }
#endif
#endif

    copybitmap(bitmap, m_bitmap[m_dest ^ 1], 0, 0, 0, 0, cliprect);

    return 0;
}
Exemple #7
0
UINT32 gaelco_state::screen_update_bigkarnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	/* set scroll registers */
	m_tilemap[0]->set_scrolly(0, m_vregs[0]);
	m_tilemap[0]->set_scrollx(0, m_vregs[1] + 4);
	m_tilemap[1]->set_scrolly(0, m_vregs[2]);
	m_tilemap[1]->set_scrollx(0, m_vregs[3]);

	screen.priority().fill(0, cliprect);
	bitmap.fill(0, cliprect);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 3, 0);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3, 1);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 3, 1);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2, 1);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 2, 1);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2, 2);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 2, 2);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 2);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 1, 2);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 4);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 1, 4);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 4);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1 | 0, 4);

	m_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 8);
	m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0 | 0, 8);

	draw_sprites(screen, bitmap, cliprect);
	return 0;
}
Exemple #8
0
UINT32 majorpkr_state::screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(get_black_pen(machine()), cliprect);

	rectangle custom_clip;

	/* The following custom_clip is to exclude the last char column (unused)
	   form the render. We need more proof about how the video is working.
	*/
	custom_clip = cliprect;
	custom_clip.max_x -= 16;

	m_bg_tilemap->draw(screen, bitmap, custom_clip, 0, 0);
	m_fg_tilemap->draw(screen, bitmap, custom_clip, 0, 0);

	if (m_flip_state == 1)
	{
		m_bg_tilemap->set_flip(TILEMAP_FLIPX | TILEMAP_FLIPY);
		m_fg_tilemap->set_flip(TILEMAP_FLIPX | TILEMAP_FLIPY);
	}

	return 0;
}
Exemple #9
0
UINT32 gladiatr_state::screen_update_gladiatr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	if (m_video_attributes & 0x20)
	{
		int scroll;

		scroll = m_bg_scrollx + ((m_video_attributes & 0x04) << 6);
		m_bg_tilemap->set_scrollx(0, scroll ^ (flip_screen() ? 0x0f : 0));
		scroll = m_fg_scrollx + ((m_video_attributes & 0x08) << 5);
		m_fg_tilemap->set_scrollx(0, scroll ^ (flip_screen() ? 0x0f : 0));

		// always 0 anyway
		m_bg_tilemap->set_scrolly(0, m_bg_scrolly);
		m_fg_tilemap->set_scrolly(0, m_fg_scrolly);

		m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
		draw_sprites(bitmap,cliprect);
		m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0);
	}
	else
		bitmap.fill(m_palette->black_pen(), cliprect );
	return 0;
}
Exemple #10
0
UINT32 segaxbd_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	// if no drawing is happening, fill with black and get out
	if (!segaic16_display_enable)
	{
		bitmap.fill(get_black_pen(machine()), cliprect);
		return 0;
	}

	// reset priorities
	machine().priority_bitmap.fill(0, cliprect);

	// draw the low priority road layer
	segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_BACKGROUND);
	if (m_road_priority == 0)
		segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);

	// draw background
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 0, 0x01);
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_BACKGROUND, 1, 0x02);

	// draw foreground
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 0, 0x02);
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_FOREGROUND, 1, 0x04);

	// draw the high priority road
	if (m_road_priority == 1)
		segaic16_road_draw(0, bitmap, cliprect, SEGAIC16_ROAD_FOREGROUND);

	// text layer
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 0, 0x04);
	segaic16_tilemap_draw(screen, bitmap, cliprect, 0, SEGAIC16_TILEMAP_TEXT, 1, 0x08);

	// draw the sprites
	segaic16_sprites_draw(screen, bitmap, cliprect, 0);
	return 0;
}
Exemple #11
0
UINT32 pturn_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(m_bgcolor, cliprect);
	m_bgmap->draw(screen, bitmap, cliprect, 0,0);
	for (int offs = 0x80-4 ; offs >=0 ; offs -= 4)
	{
		int sy=256-m_spriteram[offs]-16 ;
		int sx=m_spriteram[offs+3]-16 ;

		int flipx=m_spriteram[offs+1]&0x40;
		int flipy=m_spriteram[offs+1]&0x80;


		if (flip_screen_x())
		{
			sx = 224 - sx;
			flipx ^= 0x40;
		}

		if (flip_screen_y())
		{
			flipy ^= 0x80;
			sy = 224 - sy;
		}

		if(sx|sy)
		{
			m_gfxdecode->gfx(2)->transpen(bitmap,cliprect,
			m_spriteram[offs+1] & 0x3f ,
			(m_spriteram[offs+2] & 0x1f),
			flipx, flipy,
			sx,sy,0);
		}
	}
	m_fgmap->draw(screen, bitmap, cliprect, 0,0);
	return 0;
}
Exemple #12
0
uint32_t funybubl_state::screen_update_funybubl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x, y, offs;
	offs = 0;

	bitmap.fill(m_palette->black_pen(), cliprect);

	/* tilemap .. convert it .. banking makes it slightly more annoying but still easy */
	for (y = 0; y < 32; y++)
	{
		for (x = 0; x< 64; x++)
		{
			int data;

			data = m_banked_vram[offs] | (m_banked_vram[offs + 1] << 8);
			m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, data & 0x7fff, (data & 0x8000) ? 2 : 1, 0, 0, x*8, y*8, 0);
			offs += 2;
		}
	}

	draw_sprites(bitmap, cliprect);

#if 0
	if ( machine().input().code_pressed_once(KEYCODE_W) )
	{
		FILE *fp;

		fp = fopen("funnybubsprites", "w+b");
		if (fp)
		{
			fwrite(&m_banked_vram[0x1000], 0x1000, 1, fp);
			fclose(fp);
		}
	}
#endif
	return 0;
}
Exemple #13
0
UINT32 mz_state::screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	UINT8 *videoram = m_videoram;

	bitmap.fill(get_black_pen(machine()), cliprect);

	if (m_mz700_mode)
		return screen_update_mz700(screen, bitmap, cliprect);
	else
	{
		if (m_hires_mode)
		{
		}
		else
		{
			int x, y;
			UINT8 *start_addr = videoram;

			for (x = 0; x < 40; x++)
			{
				for (y = 0; y < 200; y++)
				{
					bitmap.pix16(y, x * 8 + 0) = BIT(start_addr[x * 8 + y], 0);
					bitmap.pix16(y, x * 8 + 1) = BIT(start_addr[x * 8 + y], 1);
					bitmap.pix16(y, x * 8 + 2) = BIT(start_addr[x * 8 + y], 2);
					bitmap.pix16(y, x * 8 + 3) = BIT(start_addr[x * 8 + y], 3);
					bitmap.pix16(y, x * 8 + 4) = BIT(start_addr[x * 8 + y], 4);
					bitmap.pix16(y, x * 8 + 5) = BIT(start_addr[x * 8 + y], 5);
					bitmap.pix16(y, x * 8 + 6) = BIT(start_addr[x * 8 + y], 6);
					bitmap.pix16(y, x * 8 + 7) = BIT(start_addr[x * 8 + y], 7);
				}
			}
		}

		return 0;
	}
}
Exemple #14
0
UINT32 murogem_state::screen_update_murogem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int xx,yy,count;
	count = 0x000;

	bitmap.fill(0, cliprect);

	for (yy=0;yy<32;yy++)
	{
		for(xx=0;xx<32;xx++)
		{
			int tileno = m_videoram[count]&0x3f;
			int attr = m_videoram[count+0x400]&0x0f;

			drawgfx_transpen(bitmap,cliprect,machine().gfx[0],tileno,attr,0,0,xx*8,yy*8,0);

			count++;

		}

	}

	return 0;
}
Exemple #15
0
UINT32 aceal_state::screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int offs;

	/* first of all, fill the screen with the background color */
	bitmap.fill(0, cliprect);

	m_gfxdecode->gfx(1)->opaque(m_palette,bitmap,cliprect,
			0,
			0,
			0, 0,
			m_objpos[0], m_objpos[1]);

	m_gfxdecode->gfx(2)->opaque(m_palette,bitmap,cliprect,
			0,
			0,
			0, 0,
			m_objpos[2], m_objpos[3]);

	m_gfxdecode->gfx(3)->opaque(m_palette,bitmap,cliprect,
			0,
			0,
			0, 0,
			m_objpos[4], m_objpos[5]);

	for (offs = 0; offs < 8; offs++)
	{
		m_gfxdecode->gfx(4)->opaque(m_palette,bitmap,/* ?? */
				cliprect,
				offs,
				0,
				0, 0,
				10 * 8 + offs * 16, 256 - 16);
	}
	return 0;
}
Exemple #16
0
uint32_t fun_tech_corp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(0, cliprect);

	if (!(m_vreg & 0x40))
	{
		for (int i = 0; i < 64; i++)
		{
			m_reel1_tilemap->set_scrolly(i, m_reel1_scroll[i]);
			m_reel2_tilemap->set_scrolly(i, m_reel2_scroll[i]);
			m_reel3_tilemap->set_scrolly(i, m_reel3_scroll[i]);
		}

		const rectangle visible1(0 * 8, (14 + 48) * 8 - 1, 4 * 8, (4 + 7) * 8 - 1);
		const rectangle visible2(0 * 8, (14 + 48) * 8 - 1, 12 * 8, (12 + 7) * 8 - 1);
		const rectangle visible3(0 * 8, (14 + 48) * 8 - 1, 18 * 8, (18 + 7) * 8 - 1);

		m_reel1_tilemap->draw(screen, bitmap, visible1, 0, 0);
		m_reel2_tilemap->draw(screen, bitmap, visible2, 0, 0);
		m_reel3_tilemap->draw(screen, bitmap, visible3, 0, 0);
	}
	else
	{
		// this mode seems to draw reel1 as fullscreen using a different set of scroll regs
		for (int i = 0; i < 64; i++)
		{
			m_reel1_tilemap->set_scrolly(i, m_reel1_alt_scroll[i]);
		}

		m_reel1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	}


	m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	return 0;
}
Exemple #17
0
UINT32 poolshrk_state::screen_update_poolshrk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i;

	m_bg_tilemap->mark_all_dirty();

	bitmap.fill(0, cliprect);

	/* draw sprites */

	for (i = 0; i < 16; i++)
	{
		int hpos = m_hpos_ram[i];
		int vpos = m_vpos_ram[i];

		m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect, i, (i == 0) ? 0 : 1, 0, 0,
			248 - hpos, vpos - 15, 0);
	}

	/* draw playfield */

	m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	return 0;
}
Exemple #18
0
UINT32 ajax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_k052109->tilemap_update();

	screen.priority().fill(0, cliprect);

	bitmap.fill(m_palette->black_pen(), cliprect);
	m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 1);
	if (m_priority)
	{
		/* basic layer order is B, zoom, A, F */
		m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4);
		m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2);
	}
	else
	{
		/* basic layer order is B, A, zoom, F */
		m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2);
		m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4);
	}
	m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1);
	m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0);
	return 0;
}
Exemple #19
0
UINT32 deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	gfx_element *gfx = m_gfxdecode->gfx(0);
	int y,x;

	bitmap.fill(0, cliprect);

	draw_sprites(bitmap,cliprect,m_vram1,0x000);
	draw_sprites(bitmap,cliprect,m_vram0,0x100);

	for (y=0;y<32;y++)
	{
		for (x=0;x<32;x++)
		{
			int attr = m_attr0[x+y*32];
			int tile = m_vram0[x+y*32] | ((attr & 3) << 8);
			int colour = (6 & 0x7); /* TODO */

			gfx->transpen(bitmap,cliprect,tile|0x400,colour,0,0,x*8,y*8,0);
		}
	}

	for (y=0;y<32;y++)
	{
		for (x=0;x<32;x++)
		{
			int attr = m_attr1[x+y*32];
			int tile = m_vram1[x+y*32] | ((attr & 3) << 8);
			int colour = (6 & 0x7); /* TODO */

			gfx->transpen(bitmap,cliprect,tile,colour,0,0,x*8,y*8,0);
		}
	}

	return 0;
}
Exemple #20
0
uint32_t murogem_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int xx,yy,count;
	count = 0x000;

	bitmap.fill(0, cliprect);

	for (yy=0;yy<32;yy++)
	{
		for(xx=0;xx<32;xx++)
		{
			int tileno = m_videoram[count]&0x3f;
			int attr = m_videoram[count+0x400]&0x0f;

			m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,tileno,attr,0,0,xx*8,yy*8,0);

			count++;

		}

	}

	return 0;
}
Exemple #21
0
void cgenie_state::cgenie_refresh_monitor(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	UINT8 *videoram = m_videoram;
	int i, address, offset, cursor, size, code, x, y;
	rectangle r;

	bitmap.fill(get_black_pen(machine()), cliprect);

	if(m_crt.vertical_displayed || m_crt.horizontal_displayed)
	{
		offset = 256 * m_crt.screen_address_hi + m_crt.screen_address_lo;
		size = m_crt.horizontal_displayed * m_crt.vertical_displayed;
		cursor = 256 * m_crt.cursor_address_hi + m_crt.cursor_address_lo;

		/*
		 * for every character in the Video RAM, check if it has been modified since
		 * last time and update it accordingly.
		 */
		for( address = 0; address < size; address++ )
		{
			i = (offset + address) & 0x3fff;
			x = address % m_crt.horizontal_displayed + m_off_x;
			y = address / m_crt.horizontal_displayed;

			r.min_x = x * 8;
			r.max_x = r.min_x + 7;
			r.min_y = y * (m_crt.scan_lines + 1) + m_off_y;
			r.max_y = r.min_y + m_crt.scan_lines;

			if( m_graphics )
			{
				/* get graphics code */
				code = videoram[i];
				drawgfx_opaque(bitmap, r, machine().gfx[1], code, 0,
					0, 0, r.min_x, r.min_y);
			}
			else
			{
				/* get character code */
				code = videoram[i];

				/* translate defined character sets */
				code += m_font_offset[(code >> 6) & 3];
				drawgfx_opaque(bitmap, r, machine().gfx[0], code, m_colorram[i&0x3ff],
					0, 0, r.min_x, r.min_y);
			}

			if( i == cursor )
			{
			rectangle rc;

			/* check if cursor turned off */
				if( (m_crt.cursor_top & 0x60) == 0x20 )
					continue;

				if( (m_crt.cursor_top & 0x60) == 0x60 )
				{
					m_crt.cursor_visible = 1;
				}
				else
				{
					m_crt.cursor_phase++;
					m_crt.cursor_visible = (m_crt.cursor_phase >> 3) & 1;
				}

				if( !m_crt.cursor_visible )
					continue;

				rc.min_x = r.min_x;
				rc.max_x = r.max_x;
				rc.min_y = r.min_y + (m_crt.cursor_top & 15);
				rc.max_y = r.min_y + (m_crt.cursor_bottom & 15);
				drawgfx_opaque(bitmap, rc, machine().gfx[0], 0x7f, m_colorram[i&0x3ff],
					0, 0, rc.min_x, rc.min_y);
			}
		}
Exemple #22
0
UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x, y;
	UINT8 fg = m_videoram[0x1403] >> 4;
	UINT8 bg = m_videoram[0x1403] & 0x0f;
	UINT8 gr_fg = m_videoram[0x1401] >> 4;
	UINT8 gr_bg = m_videoram[0x1401] & 0x0f;
	int clip_x = ( m_videoram[0x1402] & 0x0f ) * 2;
	int clip_y = m_videoram[0x1402] >> 4;

	/* Clear the screen */
	bitmap.fill(gr_bg , cliprect);

	/* Draw background */
	for ( y = 0; y < 16; y++ )
	{
		int text_y = 0;

		if ( y < clip_y )
		{
			text_y = ( m_videoram[0x1400] & 0x80 ) ? 0 : 1;
		}
		else
		{
			text_y = ( m_videoram[0x1400] & 0x80 ) ? 1 : 0;
		}

		for ( x = 0; x < 32; x++ )
		{
			int text_x = 0;
			UINT8 d = m_videoram[ 0x1000 + y * 32 + x ];

			if ( x < clip_x )
			{
				text_x = ( m_videoram[0x1400] & 0x40 ) ? 0 : 1;
			}
			else
			{
				text_x = ( m_videoram[0x1400] & 0x40 ) ? 1 : 0;
			}

			if ( text_x && text_y )
			{
				/* Text mode */
				UINT8 *char_data = m_charrom->base() + ( d & 0x7f ) * 8;
				draw_text( bitmap, x * 8, y * 16, char_data, fg, bg );
			}
			else
			{
				switch ( m_videoram[0x1400] & 0x03 )
				{
				case 0x01:      /* Semi graphics mode */
					draw_semi_graph( bitmap, x * 8    , y * 16     , d & 0x80, gr_fg );
					draw_semi_graph( bitmap, x * 8 + 4, y * 16     , d & 0x40, gr_fg );
					draw_semi_graph( bitmap, x * 8    , y * 16 +  4, d & 0x20, gr_fg );
					draw_semi_graph( bitmap, x * 8 + 4, y * 16 +  4, d & 0x10, gr_fg );
					draw_semi_graph( bitmap, x * 8    , y * 16 +  8, d & 0x08, gr_fg );
					draw_semi_graph( bitmap, x * 8 + 4, y * 16 +  8, d & 0x04, gr_fg );
					draw_semi_graph( bitmap, x * 8    , y * 16 + 12, d & 0x02, gr_fg );
					draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 12, d & 0x01, gr_fg );
					break;

				case 0x03:      /* Block graphics mode */
					draw_block_graph( bitmap, x * 8, y * 16    , d >> 4 );
					draw_block_graph( bitmap, x * 8, y * 16 + 8, d & 0x0f );
					break;

				default:        /* Otherwise draw nothing? */
					break;
				}
			}
		}
	}

	/* Draw sprites if enabled */
	if ( m_videoram[0x1400] & 0x10 )
	{
		UINT8 screen_start_sprite_line = ( ( ( m_videoram[0x1400] & 0xf7 ) == 0x17 ) && ( ( m_videoram[0x1402] & 0xef ) == 0x4f ) ) ? 21 + 32 : 0 ;
		int i;

		for ( i = 0; i < 128; i++ )
		{
			UINT8 spr_y = m_videoram[ 0x1200 + i * 4 ] & 0xfe;
			UINT8 y_32 = m_videoram[ 0x1200 + i * 4 ] & 0x01;       /* Xx32 sprite */
			UINT8 clip = m_videoram[ 0x1201 + i * 4 ] >> 4;
			UINT8 col = m_videoram[ 0x1201 + i * 4 ] & 0x0f;
			UINT8 spr_x = m_videoram[ 0x1202 + i * 4 ] & 0xfe;
			UINT8 x_32 = m_videoram[ 0x1202 + i * 4 ] & 0x01;       /* 32xX sprite */
			UINT8 tile_idx = m_videoram[ 0x1203 + i * 4 ] & 0x7f;
			UINT8 half = m_videoram[ 0x1203 + i * 4] & 0x80;
			UINT8 left = 1;
			UINT8 right = 1;
			UINT8 top = 1;
			UINT8 bottom = 1;

			if ( !col )
			{
				continue;
			}

			if ( !spr_y )
			{
				continue;
			}

			if ( half )
			{
				if ( tile_idx & 0x40 )
				{
					if ( y_32 )
					{
						spr_y -= 8;
						top = 0;
						bottom = 1;
						y_32 = 0;
					}
					else
					{
						top = 1;
						bottom = 0;
					}
				}
				if ( x_32 )
				{
					spr_x -= 8;
					left = 0;
					right = 1;
					x_32 = 0;
				}
				else
				{
					left = 1;
					right = 0;
				}
			}

			/* Check if 2 color sprites are enabled */
			if ( ( m_videoram[0x1400] & 0x20 ) && ( i & 0x20 ) )
			{
				/* 2 color sprite handling */
				draw_sprite( bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line );
				if ( x_32 || y_32 )
				{
					static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11,  8, 9, 6, 7,  4,  5, 2, 3,  1,  1 };
					static const UINT8 spr_2col_lut1[16] = { 0,  1,  8, 11,  2,  3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 };

					draw_sprite( bitmap, spr_x, spr_y, tile_idx ^ ( 8 * x_32 + y_32 ), ( i & 0x40 ) ? spr_2col_lut1[col] : spr_2col_lut0[col], left, right, top, bottom, clip, screen_start_sprite_line );
				}
			}
			else
			{
				/* regular sprite handling */
				draw_sprite( bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip, screen_start_sprite_line );
				if ( x_32 )
				{
					draw_sprite( bitmap, spr_x + 16, spr_y, tile_idx | 8, col, 1, 1, top, bottom, clip, screen_start_sprite_line );
				}

				if ( y_32 )
				{
					clip = ( clip & 0x08 ) ? ( clip & 0x07 ) : 0;
					draw_sprite( bitmap, spr_x, spr_y + 16, tile_idx | 1, col, left, right, 1, 1, clip, screen_start_sprite_line );
					if ( x_32 )
					{
						draw_sprite( bitmap, spr_x + 16, spr_y + 16, tile_idx | 9, col, 1, 1, 1, 1, clip, screen_start_sprite_line );
					}
				}
			}
		}
	}
Exemple #23
0
UINT32 m52_state::screen_update_m52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int offs;

	bitmap.fill(0, cliprect);

	if (!(m_bgcontrol & 0x20))
	{
		if (!(m_bgcontrol & 0x10))
			draw_background(bitmap, cliprect, m_bg2xpos, m_bg2ypos, 2); /* distant mountains */

		if (!(m_bgcontrol & 0x02))
			draw_background(bitmap, cliprect, m_bg1xpos, m_bg1ypos, 3); /* hills */

		if (!(m_bgcontrol & 0x04))
			draw_background(bitmap, cliprect, m_bg1xpos, m_bg1ypos, 4); /* cityscape */
	}

	m_bg_tilemap->set_flip(flip_screen() ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);

	m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);

	/* draw the sprites */
	for (offs = 0xfc; offs >= 0; offs -= 4)
	{
		int sy = 257 - m_spriteram[offs];
		int color = m_spriteram[offs + 1] & 0x3f;
		int flipx = m_spriteram[offs + 1] & 0x40;
		int flipy = m_spriteram[offs + 1] & 0x80;
		int code = m_spriteram[offs + 2];
		int sx = m_spriteram[offs + 3];
		rectangle clip;

		/* sprites from offsets $00-$7F are processed in the upper half of the frame */
		/* sprites from offsets $80-$FF are processed in the lower half of the frame */
		clip = cliprect;
		if (!(offs & 0x80))
			clip.min_y = 0, clip.max_y = 127;
		else
			clip.min_y = 128, clip.max_y = 255;

		/* adjust for flipping */
		if (flip_screen())
		{
			int temp = clip.min_y;
			clip.min_y = 255 - clip.max_y;
			clip.max_y = 255 - temp;
			flipx = !flipx;
			flipy = !flipy;
			sx = 112 - sx;
			sy = 257 + 11 - sy;
		}

		sx += 128;

		/* in theory anyways; in practice, some of the molecule-looking guys get clipped */
#ifdef SPLIT_SPRITES
		sect_rect(&clip, cliprect);
#else
		clip = cliprect;
#endif

		m_gfxdecode->m_gfx[1]->transmask(bitmap,clip,
			code, color, flipx, flipy, sx, sy,
			m_palette->transpen_mask(*m_gfxdecode->m_gfx[1], color, 512 + 32));
	}
	return 0;
}
Exemple #24
0
UINT32 itgamble_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(get_black_pen(machine()));
	return 0;
}
Exemple #25
0
UINT32 tc0091lvc_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	UINT32 count;
	int x,y;
	UINT8 global_flip;

	bitmap.fill(m_palette->black_pen(), cliprect);

	if((m_vregs[4] & 0x20) == 0)
		return 0;

	global_flip = m_vregs[4] & 0x10;

	if((m_vregs[4] & 0x7) == 7) // 8bpp bitmap enabled
	{
		count = 0;

		for (y=0;y<256;y++)
		{
			for (x=0;x<512;x++)
			{
				int res_x, res_y;

				res_x = (global_flip) ? 320-x : x;
				res_y = (global_flip) ? 256-y : y;

				if(screen.visible_area().contains(res_x, res_y))
					bitmap.pix16(res_y, res_x) = m_palette->pen(m_bitmap_ram[count]);

				count++;
			}
		}
	}
	else
	{
		int dx, dy;

		machine().tilemap().set_flip_all(global_flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);

		dx = m_bg0_scroll[0] | (m_bg0_scroll[1] << 8);
		if (global_flip) { dx = ((dx & 0xfffc) | ((dx - 3) & 0x0003)) ^ 0xf; dx += 192; }
		dy = m_bg0_scroll[2];

		bg0_tilemap->set_scrollx(0, -dx);
		bg0_tilemap->set_scrolly(0, -dy);

		dx = m_bg1_scroll[0] | (m_bg1_scroll[1] << 8);
		if (global_flip) { dx = ((dx & 0xfffc) | ((dx - 3) & 0x0003)) ^ 0xf; dx += 192; }
		dy = m_bg1_scroll[2];

		bg1_tilemap->set_scrollx(0, -dx);
		bg1_tilemap->set_scrolly(0, -dy);

		tx_tilemap->set_scrollx(0, (global_flip) ? -192 : 0);

		screen.priority().fill(0, cliprect);
		bg1_tilemap->draw(screen, bitmap, cliprect, 0,0);
		bg0_tilemap->draw(screen, bitmap, cliprect, 0,(m_vregs[4] & 0x8) ? 0 : 1);
		draw_sprites(screen, bitmap, cliprect, global_flip);
		tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
	}
	return 0;
}
Exemple #26
0
UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	logerror("update\n");
	int y,x,count;

	static const int xxx=320,yyy=204;

	bitmap.fill(m_palette->black_pen());
	UINT8 *videoramfg;
	UINT8* videorambg;

	count=0;
	videorambg = (UINT8*)m_videoram0;
	videoramfg = (UINT8*)m_videoram2;

	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			bitmap.pix16(y, x) = videorambg[BYTE_XOR_LE(count)]+0x300;
			count++;
		}
	}

	/*
	count=0;
	videoram = (UINT8*)m_videoram1;
	for (y=0;y<yyy;y++)
	{
	    for(x=0;x<xxx;x++)
	    {
	        UINT8 pix = videoram[BYTE_XOR_LE(count)];
	        if (pix) bitmap.pix16(y, x) = pix+0x200;
	        count++;
	    }
	}
	*/

	count=0;
	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			UINT8 pix = videoramfg[BYTE_XOR_LE(count)];
			if (pix)
			{
				// first pen values seem to be special
				// see char select and shadows ingame
				// pen 0 = transparent
				// pen 1 = blend 1
				// pen 2 = blend 2
				// pen 3 = ??

				if (pix == 0x01) // blend mode 1
				{
					UINT8 pix = videorambg[BYTE_XOR_LE(count)];
					bitmap.pix16(y, x) = pix + 0x200;
				}
				else if (pix == 0x02) // blend mode 2
				{
					UINT8 pix = videorambg[BYTE_XOR_LE(count)];
					bitmap.pix16(y, x) = pix + 0x100;
				}
				else
				{
					bitmap.pix16(y, x) = pix + 0x000;
				}
			}
			count++;
		}
	}

#if 0
	for (int i = 0; i < 0x8000; i++)
	{
		// how are layers cleared?
		// I think it actually does more blit operations with
		// different bits of m_port10 set to redraw the backgrounds using the video ram data as a source rather than ROM - notice the garbage you see behind 'sprites' right now
		// this method also removes the text layer, which we don't want
	//  m_videoram1[i] = 0x0000;
	//  m_videoram2[i] = 0x0000;
	}
#endif

	return 0;
}
Exemple #27
0
// renders to 2 bitmaps, and mixes output
uint32_t toaplan2_state::screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
//  bitmap.fill(0, cliprect);
//  gp9001_custom_priority_bitmap->fill(0, cliprect);

	if (m_vdp[0])
	{
		bitmap.fill(0, cliprect);
		m_custom_priority_bitmap.fill(0, cliprect);
		m_vdp[0]->render_vdp(bitmap, cliprect);
	}
	if (m_vdp[1])
	{
		m_secondary_render_bitmap.fill(0, cliprect);
		m_custom_priority_bitmap.fill(0, cliprect);
		m_vdp[1]->render_vdp(m_secondary_render_bitmap, cliprect);
	}


	// key test places in batsugun
	// level 2 - the two layers of clouds (will appear under background, or over ships if wrong)
	// level 3 - the special effect 'layer' which should be under everything (will appear over background if wrong)
	// level 4(?) - the large clouds (will obscure player if wrong)
	// high score entry - letters will be missing if wrong
	// end credits - various issues if wrong, clouds like level 2
	//
	// when implemented based directly on the PAL equation it doesn't work, however, my own equations roughly based
	// on that do.
	//

	if (m_vdp[0] && m_vdp[1])
	{
		uint16_t* src_vdp0; // output buffer of vdp0
		uint16_t* src_vdp1; // output buffer of vdp1

		for (int y=cliprect.min_y;y<=cliprect.max_y;y++)
		{
			src_vdp0 = &bitmap.pix16(y);
			src_vdp1 = &m_secondary_render_bitmap.pix16(y);

			for (int x=cliprect.min_x;x<=cliprect.max_x;x++)
			{
				uint16_t GPU0_LUTaddr = src_vdp0[x];
				uint16_t GPU1_LUTaddr = src_vdp1[x];

				// these equations is derived from the PAL, but doesn't seem to work?

				int COMPARISON = ((GPU0_LUTaddr & 0x0780) > (GPU1_LUTaddr & 0x0780));

				// note: GPU1_LUTaddr & 0x000f - transparency check for vdp1? (gfx are 4bpp, the low 4 bits of the lookup would be the pixel data value)
#if 0
				int result =
							((GPU0_LUTaddr & 0x0008) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0008) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0004) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0004) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0002) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0002) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0001) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0001) & !(GPU1_LUTaddr & 0x000f));

				if (result) src_vdp0[x] = GPU0_LUTaddr;
				else src_vdp0[x] = GPU1_LUTaddr;
#endif
				// this seems to work tho?
				if (!(GPU1_LUTaddr & 0x000f))
				{
					src_vdp0[x] = GPU0_LUTaddr;
				}
				else
				{
					if (!(GPU0_LUTaddr & 0x000f))
					{
						src_vdp0[x] = GPU1_LUTaddr; // bg pen
					}
					else
					{
						if (COMPARISON)
						{
							src_vdp0[x] = GPU1_LUTaddr;
						}
						else
						{
							src_vdp0[x] = GPU0_LUTaddr;
						}

					}
				}
			}
		}
	}

	return 0;
}
Exemple #28
0
/***************************************************************************
  Draw the game screen in the given bitmap_ind16.
  Do NOT call osd_update_display() from this function,
  it will be called by the main emulation engine.
***************************************************************************/
UINT32 pcw_state::screen_update_pcw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x,y,b;
	unsigned short roller_ram_offs;
	unsigned char *roller_ram_ptr;
	int pen0,pen1;

	pen0 = 0;
	pen1 = 1;

	/* invert? */
	if (m_vdu_video_control_register & (1<<7))
	{
		/* yes */
		pen1^=1;
		pen0^=1;
	}

	/* video enable? */
	if ((m_vdu_video_control_register & (1<<6))!=0)
	{
		/* render top border */
		rectangle rect(0, PCW_SCREEN_WIDTH, 0, PCW_BORDER_HEIGHT);
		bitmap.fill(pen0, rect);

		/* render bottom border */
		rect.set(0, PCW_SCREEN_WIDTH, PCW_BORDER_HEIGHT + PCW_DISPLAY_HEIGHT, PCW_BORDER_HEIGHT + PCW_DISPLAY_HEIGHT + PCW_BORDER_HEIGHT);
		bitmap.fill(pen0, rect);

		/* offset to start in table */
		roller_ram_offs = (m_roller_ram_offset<<1);

		for (y=0; y<256; y++)
		{
			int by;
			unsigned short line_data;
			unsigned char *line_ptr;

			x = PCW_BORDER_WIDTH;

			roller_ram_ptr = m_ram->pointer() + m_roller_ram_addr + roller_ram_offs;

			/* get line address */
			/* b16-14 control which bank the line is to be found in, b13-3 the address in the bank (in 16-byte units), and b2-0 the offset. Thus a roller RAM address bbbxxxxxxxxxxxyyy indicates bank bbb, address 00xxxxxxxxxxx0yyy. */
			line_data = ((unsigned char *)roller_ram_ptr)[0] | (((unsigned char *)roller_ram_ptr)[1]<<8);

			/* calculate address of pixel data */
			line_ptr = m_ram->pointer() + ((line_data & 0x0e000)<<1) + ((line_data & 0x01ff8)<<1) + (line_data & 0x07);

			for (by=0; by<90; by++)
			{
				unsigned char byte;

				byte = line_ptr[0];

				for (b=0; b<8; b++)
				{
					if (byte & 0x080)
					{
						pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen1);
					}
					else
					{
						pcw_plot_pixel(bitmap,x+b, y+PCW_BORDER_HEIGHT, pen0);

					}
					byte = byte<<1;
				}

				x = x + 8;


				line_ptr = line_ptr+8;
			}

			/* update offset, wrap within 512 byte range */
			roller_ram_offs+=2;
			roller_ram_offs&=511;

		}

		/* render border */
		/* 8 pixels either side of display */
		for (y=0; y<256; y++)
		{
			pcw_plot_pixel(bitmap, 0, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 1, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 2, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 3, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 4, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 5, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 6, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, 7, y+PCW_BORDER_HEIGHT, pen0);

			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+0, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+1, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+2, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+3, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+4, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+5, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+6, y+PCW_BORDER_HEIGHT, pen0);
			pcw_plot_pixel(bitmap, PCW_BORDER_WIDTH+PCW_DISPLAY_WIDTH+7, y+PCW_BORDER_HEIGHT, pen0);
		}
	}
	else
	{
		/* not video - render whole lot in pen 0 */
		rectangle rect(0, PCW_SCREEN_WIDTH, 0, PCW_SCREEN_HEIGHT);
		bitmap.fill(pen0, rect);
	}
	return 0;
}
Exemple #29
0
UINT32 hp48_state::screen_update_hp48(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	address_space &space = m_maincpu->space(AS_PROGRAM);
	int x, y, xp, i, addr;
	int display       = HP48_IO_4(0) >> 3;           /* 1=on, 0=off */
	int left_margin   = HP48_IO_4(0) & 7;            /* 0..7 pixels for main bitmap */
	int contrast      = HP48_IO_8(1) & 0x1f;         /* 0..31 */
	int refresh       = HP48_IO_4(3) >> 3;           /* vertical refresh */
	int bitmap_start  = HP48_IO_20(0x20) & ~1;       /* main bitmap address */
	int right_margin  = HP48_IO_12(0x25) & ~1;       /* -2048..2046 nibbles for main bitmap */
	int last_line     = HP48_IO_8(0x28) & 0x3f;      /* 2..63 lines of main bitmap before menu */
	int menu_start    = HP48_IO_20(0x30) & ~1;       /* menu bitmap address */
	int fg = contrast + 2;

	LOG(( "%f hp48 video_update called: ", machine().time().as_double()));

	if ( !display || refresh )
	{
		LOG(( "display off\n" ));
		bitmap.fill(0 );
		return 0;
	}

	/* correcting factors */
	if ( right_margin & 0x800 ) right_margin -= 0x1000;
	if ( last_line <= 1 ) last_line = 0x3f;

	LOG(( "on=%i lmargin=%i rmargin=%i contrast=%i start=%05x lline=%i menu=%05x\n",
			display, left_margin, right_margin, contrast, bitmap_start, last_line, menu_start ));

	/* draw main bitmap */
	addr = bitmap_start;
	for ( y = 0; y <= last_line; y++ )
	{
		xp = -left_margin;
		for ( x = 0; x < 34; x++, addr++ )
		{
			draw_quart;
		}
		addr += (right_margin + (left_margin / 4) + 1) & ~1;
	}

	/* draw menu bitmap */
	addr = menu_start;
	for ( ; y <= 0x3f; y++ )
	{
		xp = 0;
		for ( x = 0; x < 34; x++, addr++ )
		{
			draw_quart;
		}
	}

	/* draw averaged frames */
	for ( y = 0; y < 64; y++ )
	{
		for ( x = 0; x < 131; x++ )
		{
			int acc = 0;
			for ( i = 0; i < HP48_NB_SCREENS; i++ )
			{
				acc += m_screens[ i ][ y ][ x+8 ];
			}
			acc = (acc * 255) / (33 * HP48_NB_SCREENS);
			bitmap.pix16(y, x ) = acc;
		}
	}

	m_cur_screen = (m_cur_screen + 1) % HP48_NB_SCREENS;

	return 0;
}
Exemple #30
0
UINT32 destroyr_state::screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i, j;

	bitmap.fill(0, cliprect);

	/* draw major objects */
	for (i = 0; i < 16; i++)
	{
		int attr = m_major_obj_ram[2 * i + 0] ^ 0xff;
		int horz = m_major_obj_ram[2 * i + 1];

		int num = attr & 3;
		int scan = attr & 4;
		int flipx = attr & 8;

		if (scan == 0)
		{
			if (horz >= 192)
				horz -= 256;
		}
		else
		{
			if (horz < 192)
				continue;
		}

		 machine().gfx[2]->transpen(bitmap,cliprect, num, 0, flipx, 0, horz, 16 * i, 0);
	}

	/* draw alpha numerics */
	for (i = 0; i < 8; i++)
	{
		for (j = 0; j < 32; j++)
		{
			int num = m_alpha_num_ram[32 * i + j];

			 machine().gfx[0]->transpen(bitmap,cliprect, num, 0, 0, 0, 8 * j, 8 * i, 0);
		}
	}

	/* draw minor objects */
	for (i = 0; i < 2; i++)
	{
		int num = i << 4 | (m_minor_obj_ram[i + 0] & 0xf);
		int horz = 256 - m_minor_obj_ram[i + 2];
		int vert = 256 - m_minor_obj_ram[i + 4];

		 machine().gfx[1]->transpen(bitmap,cliprect, num, 0, 0, 0, horz, vert, 0);
	}

	/* draw waves */
	for (i = 0; i < 4; i++)
	{
		 machine().gfx[3]->transpen(bitmap,cliprect, m_wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
	}

	/* draw cursor */
	for (i = 0; i < 256; i++)
	{
		if (i & 4)
			bitmap.pix16(m_cursor ^ 0xff, i) = 7;
	}
	return 0;
}