summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/video/cbmb.c
blob: e1a91cb37b445182c46e332b13df65c56c7b916b (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/***************************************************************************

  PeT mess@utanet.at

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

#include "emu.h"
#include "includes/cbmb.h"
#include "video/mc6845.h"



VIDEO_START( cbmb_crtc )
{
}

void cbm600_vh_init(running_machine &machine)
{
	UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
	int i;

	/* inversion logic on board */
	for (i=0; i<0x800; i++) {
		gfx[0x1000+i]=gfx[0x800+i];
		gfx[0x1800+i]=gfx[0x1000+i]^0xff;
		gfx[0x800+i]=gfx[i]^0xff;
	}
}

void cbm700_vh_init(running_machine &machine)
{
	UINT8 *gfx = machine.root_device().memregion("gfx1")->base();
	int i;
	for (i=0; i<0x800; i++) {
		gfx[0x1000+i]=gfx[0x800+i];
		gfx[0x1800+i]=gfx[0x1000+i]^0xff;
		gfx[0x800+i]=gfx[i]^0xff;
	}
}

VIDEO_START( cbm700 )
{
	int i;

    /* remove pixel column 9 for character codes 0 - 175 and 224 - 255 */
	for( i = 0; i < 256; i++)
	{
//      if( i < 176 || i > 223 )
		{
			int y;
			for( y = 0; y < machine.gfx[0]->height(); y++ ) {
				*const_cast<UINT8 *>(machine.gfx[0]->get_data(i) + y * machine.gfx[0]->rowbytes() + 8) = 0;
				*const_cast<UINT8 *>(machine.gfx[1]->get_data(i) + y * machine.gfx[1]->rowbytes() + 8) = 0;
			}
		}
	}
}

void cbmb_vh_set_font(running_machine &machine, int font)
{
	cbmb_state *state = machine.driver_data<cbmb_state>();
	state->m_font=font;
}

MC6845_UPDATE_ROW( cbm600_update_row )
{
	cbmb_state *state = device->machine().driver_data<cbmb_state>();
	const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
	UINT8 *videoram = state->m_videoram;
	int i;

	for( i = 0; i < x_count; i++ ) {
		if ( i == cursor_x ) {
			bitmap.plot_box( device->machine().gfx[state->m_font]->width() * i, y, device->machine().gfx[state->m_font]->width(), 1, palette[1] );
		} else {
			drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i )& 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width() * i, y-ra );
		}
	}
}

MC6845_UPDATE_ROW( cbm700_update_row )
{
	cbmb_state *state = device->machine().driver_data<cbmb_state>();
	const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
	UINT8 *videoram = state->m_videoram;
	int i;

	for( i = 0; i < x_count; i++ ) {
		if ( i == cursor_x ) {
			bitmap.plot_box( device->machine().gfx[state->m_font]->width() * i, y, device->machine().gfx[state->m_font]->width(), 1, palette[1] );
		} else {
			drawgfx_opaque( bitmap, cliprect, device->machine().gfx[state->m_font], videoram[(ma+i) & 0x7ff], 0, 0, 0, device->machine().gfx[state->m_font]->width() * i, y-ra );
		}
	}
}

WRITE_LINE_DEVICE_HANDLER( cbmb_display_enable_changed )
{
}