Content-Type: text/html; charset=UTF-8 Last-Modified: Fri, 29 Mar 2024 14:54:57 GMT Expires: Thu, 01 Jan 1970 00:00:05 GMT mame - MAME - Multiple Arcade Machine Emulator
summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/segald.c
Bad commit: ae660bf22f3880f9a0c73d7a34e7ed195a630c01
an class='sha1'>3165d460a77
42207cc385f
7b77f121862





2b23d7c017b
2fd263c18b4
7b77f121862
7b77f121862














f1f0591f43f
7b77f121862
f1f0591f43f

7b77f121862
f1f0591f43f

95a2e3a939f
7b77f121862
f1f0591f43f
95a2e3a939f
f1f0591f43f
7b77f121862
f1f0591f43f



7b77f121862
f1f0591f43f



7b77f121862
f1f0591f43f


7b77f121862
f1f0591f43f
95a2e3a939f

321d93323fb
95a2e3a939f

f1f0591f43f
7b77f121862

e3a81674d23
7b77f121862

0e19f641d31




7b77f121862
5291d140218

7b77f121862
96490888396
7b77f121862
95a2e3a939f
7b77f121862


ddb290d5f61
7b77f121862
f1f0591f43f
7b77f121862
f1f0591f43f
7b77f121862


4887ce18443
e3a81674d23

38d401dd6e8






e3a81674d23
7b77f121862



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
                       
                                  





                                                                            
                
                          
 














                                                                                 
                                                            
 

                                                                     
 

                                                         
 
 
                                                                                     
 
                             
 



                                                              
 



                                                              
 


                                                
 
                                                      

 
                                                                    

                                       
                                                

 
                                   

                              




                              
 

                                 
 
                                                                      
 
                                            


 
                                                                                                          
 
                                                                
         
                                                      


                                         
 

                                  






                                                                                                                   
                 



                 
// license:BSD-3-Clause
// copyright-holders:Zsolt Vasvari
/***************************************************************************

    Epos games

***************************************************************************/

#include "emu.h"
#include "includes/epos.h"

/***************************************************************************

  These games has one 32 byte palette PROM, connected to the RGB output this way:

  bit 7 -- 240 ohm resistor  -- RED
        -- 510 ohm resistor  -- RED
        -- 1  kohm resistor  -- RED
        -- 240 ohm resistor  -- GREEN
        -- 510 ohm resistor  -- GREEN
        -- 1  kohm resistor  -- GREEN
        -- 240 ohm resistor  -- BLUE
  bit 0 -- 510 ohm resistor  -- BLUE

***************************************************************************/

void epos_state::epos_palette(palette_device &palette) const
{
	uint8_t const *const color_prom = memregion("proms")->base();
	int const len = memregion("proms")->bytes();

	for (offs_t i = 0; i < len; i++)
		set_pal_color(palette, i, color_prom[i]);
}

void epos_state::set_pal_color(palette_device &palette, uint8_t offset, uint8_t data)
{
	int bit0, bit1, bit2;

	bit0 = BIT(data, 7);
	bit1 = BIT(data, 6);
	bit2 = BIT(data, 5);
	int const r = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2;

	bit0 = BIT(data, 4);
	bit1 = BIT(data, 3);
	bit2 = BIT(data, 2);
	int const g = 0x92 * bit0 + 0x4a * bit1 + 0x23 * bit2;

	bit0 = BIT(data, 1);
	bit1 = BIT(data, 0);
	int const b = 0xad * bit0 + 0x52 * bit1;

	palette.set_pen_color(offset, rgb_t(r, g, b));
}

// later (tristar 9000) games uses a dynamic palette instead of prom
WRITE8_MEMBER(epos_state::dealer_pal_w)
{
	set_pal_color(*m_palette, offset, data);
}

WRITE8_MEMBER(epos_state::port_1_w)
{
	/* D0 - start light #1
	   D1 - start light #2
	   D2 - coin counter
	   D3 - palette select
	   D4-D7 - unused
	 */

	m_leds[0] = BIT(data, 0);
	m_leds[1] = BIT(data, 1);

	machine().bookkeeping().coin_counter_w(0, (data >> 2) & 0x01);

	m_palette_bank = (data >> 3) & 0x01;
}


uint32_t epos_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	for (offs_t offs = 0; offs < m_videoram.bytes(); offs++)
	{
		uint8_t const data = m_videoram[offs];

		int x = (offs % 136) * 2;
		int y = (offs / 136);

		if (flip_screen())
		{
			bitmap.pix32(240 - y, 270 - x + 1) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
			bitmap.pix32(240 - y, 270 - x + 0) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
		}
		else
		{
			bitmap.pix32(y, x + 0) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
			bitmap.pix32(y, x + 1) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
		}
	}

	return 0;
}