summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/rollerg.c
blob: a842a2683ddd23a70f7edc0a28383b038568031d (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "emu.h"
#include "video/konicdev.h"
#include "includes/rollerg.h"

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

  Callbacks for the K053245

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

void rollerg_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
	rollerg_state *state = machine.driver_data<rollerg_state>();
#if 0
	if (machine.input().code_pressed(KEYCODE_Q) && (*color & 0x80)) *color = rand();
	if (machine.input().code_pressed(KEYCODE_W) && (*color & 0x40)) *color = rand();
	if (machine.input().code_pressed(KEYCODE_E) && (*color & 0x20)) *color = rand();
	if (machine.input().code_pressed(KEYCODE_R) && (*color & 0x10)) *color = rand();
#endif
	*priority_mask = (*color & 0x10) ? 0 : 0x02;
	*color = state->m_sprite_colorbase + (*color & 0x0f);
}


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

  Callbacks for the K051316

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

void rollerg_zoom_callback( running_machine &machine, int *code, int *color, int *flags )
{
	rollerg_state *state = machine.driver_data<rollerg_state>();
	*flags = TILE_FLIPYX((*color & 0xc0) >> 6);
	*code |= ((*color & 0x0f) << 8);
	*color = state->m_zoom_colorbase + ((*color & 0x30) >> 4);
}



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

    Start the video hardware emulation.

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

VIDEO_START( rollerg )
{
	rollerg_state *state = machine.driver_data<rollerg_state>();
	state->m_sprite_colorbase = 16;
	state->m_zoom_colorbase = 0;
}



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

  Display refresh

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

SCREEN_UPDATE( rollerg )
{
	rollerg_state *state = screen->machine().driver_data<rollerg_state>();
	int bg_colorbase = 16;

	bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
	bitmap_fill(bitmap, cliprect, 16 * bg_colorbase);
	k051316_zoom_draw(state->m_k051316, bitmap, cliprect, 0, 1);
	k053245_sprites_draw(state->m_k053244, bitmap, cliprect);
	return 0;
}