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
|
/***************************************************************************
video.c
Functions to emulate the video hardware of the machine.
***************************************************************************/
#include "emu.h"
#include "includes/spcforce.h"
WRITE8_HANDLER( spcforce_flip_screen_w )
{
flip_screen_set(space->machine(), ~data & 0x01);
}
SCREEN_UPDATE( spcforce )
{
spcforce_state *state = screen->machine().driver_data<spcforce_state>();
int offs;
int flip = flip_screen_get(screen->machine());
/* draw the characters as sprites because they could be overlapping */
bitmap_fill(bitmap,cliprect,0);
for (offs = 0; offs < 0x400; offs++)
{
int code,sx,sy,col;
sy = 8 * (offs / 32) - (state->m_scrollram[offs] & 0x0f);
sx = 8 * (offs % 32) + ((state->m_scrollram[offs] >> 4) & 0x0f);
code = state->m_videoram[offs] + ((state->m_colorram[offs] & 0x01) << 8);
col = (~state->m_colorram[offs] >> 4) & 0x07;
if (flip)
{
sx = 248 - sx;
sy = 248 - sy;
}
drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
code, col,
flip, flip,
sx, sy,0);
}
return 0;
}
|