summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/video/b2m.c
blob: d01fbc9cceb5bba66f884c691f1e17d956994f08 (plain) (blame)
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
/***************************************************************************

        Bashkiria-2M video driver by Miodrag Milanovic

        28/03/2008 Preliminary driver.

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


#include "emu.h"
#include "includes/b2m.h"
#include "machine/ram.h"

void b2m_state::video_start()
{
}

UINT32 b2m_state::screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	UINT8 code1;
	UINT8 code2;
	UINT8 col;
	int y, x, b;
	UINT8 *ram = m_ram->pointer();

	for (x = 0; x < 48; x++)
	{
		for (y = 0; y < 256; y++)
		{
			if (m_b2m_video_page==0) {
				code1 = ram[0x11000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
				code2 = ram[0x15000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
			} else {
				code1 = ram[0x19000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
				code2 = ram[0x1d000 + x*256 + ((y + m_b2m_video_scroll) & 0xff)];
			}
			for (b = 7; b >= 0; b--)
			{
				col = (((code2 >> b) & 0x01)<<1) + ((code1 >> b) & 0x01);
				bitmap.pix16(y, x*8+b) =  col;
			}
		}
	}

	return 0;
}

static const rgb_t b2m_palette[4] = {
	rgb_t(0x00, 0x00, 0x00), // 0
	rgb_t(0x00, 0x00, 0x00), // 1
	rgb_t(0x00, 0x00, 0x00), // 2
	rgb_t(0x00, 0x00, 0x00), // 3
};

PALETTE_INIT_MEMBER(b2m_state, b2m)
{
	palette.set_pen_colors(0, b2m_palette, ARRAY_LENGTH(b2m_palette));
}