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
|
#include "emu.h"
#include "video/konicdev.h"
#include "includes/blockhl.h"
/***************************************************************************
Callbacks for the K052109
***************************************************************************/
void blockhl_tile_callback( running_machine &machine, int layer, int bank, int *code, int *color, int *flags, int *priority )
{
blockhl_state *state = machine.driver_data<blockhl_state>();
*code |= ((*color & 0x0f) << 8);
*color = state->m_layer_colorbase[layer] + ((*color & 0xe0) >> 5);
}
/***************************************************************************
Callbacks for the K051960
***************************************************************************/
void blockhl_sprite_callback( running_machine &machine, int *code, int *color, int *priority, int *shadow )
{
blockhl_state *state = machine.driver_data<blockhl_state>();
if(*color & 0x10)
*priority = 0xfe; // under K052109_tilemap[0]
else
*priority = 0xfc; // under K052109_tilemap[1]
*color = state->m_sprite_colorbase + (*color & 0x0f);
}
/***************************************************************************
Start the video hardware emulation.
***************************************************************************/
void blockhl_state::video_start()
{
m_generic_paletteram_8.allocate(0x800);
m_layer_colorbase[0] = 0;
m_layer_colorbase[1] = 16;
m_layer_colorbase[2] = 32;
m_sprite_colorbase = 48;
}
UINT32 blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.machine().priority_bitmap.fill(0, cliprect);
k052109_tilemap_update(m_k052109);
k052109_tilemap_draw(m_k052109, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 0); // tile 2
k052109_tilemap_draw(m_k052109, bitmap, cliprect, 1, 0, 1); // tile 1
k052109_tilemap_draw(m_k052109, bitmap, cliprect, 0, 0, 2); // tile 0
k051960_sprites_draw(m_k051960, bitmap, cliprect, 0, -1);
return 0;
}
|