1 // license:BSD-3-Clause
2 // copyright-holders:Yochizo, Takahiro Nogi
3 /***************************************************************************
4 
5 Functions to emulate the video hardware of the machine.
6 
7 ***************************************************************************/
8 
9 
10 #include "emu.h"
11 #include "includes/srmp2.h"
12 
srmp2_palette(palette_device & palette) const13 void srmp2_state::srmp2_palette(palette_device &palette) const
14 {
15 	uint8_t const *const color_prom = memregion("proms")->base();
16 	for (int i = 0; i < palette.entries(); i++)
17 	{
18 		int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()];
19 		palette.set_pen_color(i ^ 0x0f, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
20 	}
21 }
22 
23 
srmp3_palette(palette_device & palette) const24 void srmp2_state::srmp3_palette(palette_device &palette) const
25 {
26 	uint8_t const *const color_prom = memregion("proms")->base();
27 	for (int i = 0; i < palette.entries(); i++)
28 	{
29 		int const col = (color_prom[i] << 8) + color_prom[i + palette.entries()];
30 		palette.set_pen_color(i,pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0));
31 	}
32 }
33 
SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback)34 SETA001_SPRITE_GFXBANK_CB_MEMBER(srmp2_state::srmp3_gfxbank_callback)
35 {
36 	return (code & 0x3fff) + ((code & 0x2000) ? (m_gfx_bank<<13) : 0);
37 }
38 
39 
screen_update_srmp2(screen_device & screen,bitmap_ind16 & bitmap,const rectangle & cliprect)40 uint32_t srmp2_state::screen_update_srmp2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
41 {
42 	bitmap.fill(0x1ff, cliprect);
43 
44 	m_seta001->set_transpen(15);
45 
46 	m_seta001->set_colorbase(m_color_bank<<5);
47 
48 	m_seta001->set_fg_xoffsets( 0x10, 0x10 );
49 	m_seta001->set_fg_yoffsets( 0x05, 0x07 );
50 	m_seta001->set_bg_xoffsets( 0x00, 0x00 ); // bg not used?
51 	m_seta001->set_bg_yoffsets( 0x00, 0x00 ); // bg not used?
52 
53 	m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
54 	return 0;
55 }
56 
screen_update_srmp3(screen_device & screen,bitmap_ind16 & bitmap,const rectangle & cliprect)57 uint32_t srmp2_state::screen_update_srmp3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
58 {
59 	bitmap.fill(0x1f0, cliprect);
60 
61 	m_seta001->set_fg_xoffsets( 0x10, 0x10 );
62 	m_seta001->set_fg_yoffsets( 0x06, 0x06 );
63 	m_seta001->set_bg_xoffsets( -0x01, 0x10 );
64 	m_seta001->set_bg_yoffsets( -0x06, 0x06 );
65 
66 	m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
67 	return 0;
68 }
69 
screen_update_mjyuugi(screen_device & screen,bitmap_ind16 & bitmap,const rectangle & cliprect)70 uint32_t srmp2_state::screen_update_mjyuugi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
71 {
72 	bitmap.fill(0x1f0, cliprect);
73 
74 	m_seta001->set_fg_xoffsets( 0x10, 0x10 );
75 	m_seta001->set_fg_yoffsets( 0x06, 0x06 );
76 	m_seta001->set_bg_yoffsets( 0x09, 0x07 );
77 
78 	m_seta001->set_spritelimit( 0x1ff-6 );
79 
80 	m_seta001->draw_sprites(screen,bitmap,cliprect,0x1000);
81 	return 0;
82 }
83