blob: 4bb0c02355846c1beb57ac90db44a12110cb8a77 (
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
|
// license:BSD-3-Clause
// copyright-holders:Philip Bennett
/***************************************************************************
JPM IMPACT with Video hardware
****************************************************************************/
#include "emu.h"
#include "cpu/tms34010/tms34010.h"
#include "includes/jpmimpct.h"
/*************************************
*
* VRAM shift register callbacks
*
*************************************/
TMS340X0_TO_SHIFTREG_CB_MEMBER(jpmimpct_video_state::to_shiftreg)
{
memcpy(shiftreg, &m_vram[address >> 4], 512 * sizeof(uint16_t));
}
TMS340X0_FROM_SHIFTREG_CB_MEMBER(jpmimpct_video_state::from_shiftreg)
{
memcpy(&m_vram[address >> 4], shiftreg, 512 * sizeof(uint16_t));
}
/*************************************
*
* Main video refresh
*
*************************************/
TMS340X0_SCANLINE_RGB32_CB_MEMBER(jpmimpct_video_state::scanline_update)
{
uint16_t const *const vram = &m_vram[(params->rowaddr << 8) & 0x3ff00];
uint32_t *const dest = &bitmap.pix(scanline);
int coladdr = params->coladdr;
for (int x = params->heblnk; x < params->hsblnk; x += 2)
{
uint16_t const pixels = vram[coladdr++ & 0xff];
dest[x + 0] = m_ramdac->palette_lookup(pixels & 0xff);
dest[x + 1] = m_ramdac->palette_lookup(pixels >> 8);
}
}
|