summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/scn2674.h
blob: a4d33e5938885872835764ddce5e8eba38bc4889 (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
101
102
103
104
105
106
107
108
109
110
111
#define S674VERBOSE 0
#define LOG2674(x) do { if (S674VERBOSE) logerror x; } while (0)

typedef void (*s2574_interrupt_callback_func)(running_machine &machine);

static const UINT8 vsync_table[4] = {3,1,5,7}; //Video related

class scn2674_device : public device_t
{
public:
	scn2674_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);

	static void set_irq_update_callback(device_t &device, s2574_interrupt_callback_func callback);


//	int m_gfx_index;
	
	DECLARE_READ16_MEMBER( mpu4_vid_scn2674_r );
	DECLARE_WRITE16_MEMBER( mpu4_vid_scn2674_w );

	UINT8 get_irq_state( void )
	{
		return m_scn2674_irq_state;
	}



	void scn2574_draw(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, UINT16* vid_mainram);
	void scn2574_draw(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16* vid_mainram);
	void init_stuff();
	void scn2674_do_scanline(running_machine &machine, int scanline);


protected:
	virtual void device_start();
	virtual void device_reset();

	s2574_interrupt_callback_func m_interrupt_callback;

	UINT8 m_scn2674_IR_pointer;
	UINT8 m_scn2674_screen1_l;
	UINT8 m_scn2674_screen1_h;
	UINT8 m_scn2674_cursor_l;
	UINT8 m_scn2674_cursor_h;
	UINT8 m_scn2674_screen2_l;
	UINT8 m_scn2674_screen2_h;
	UINT8 m_scn2674_irq_register;
	UINT8 m_scn2674_status_register;
	UINT8 m_scn2674_irq_mask;
	UINT8 m_scn2674_gfx_enabled;
	UINT8 m_scn2674_display_enabled;
	UINT8 m_scn2674_display_enabled_field;
	UINT8 m_scn2674_display_enabled_scanline;
	UINT8 m_scn2674_cursor_enabled;
	UINT8 m_IR0_scn2674_double_ht_wd;
	UINT8 m_IR0_scn2674_scanline_per_char_row;
	UINT8 m_IR0_scn2674_sync_select;
	UINT8 m_IR0_scn2674_buffer_mode_select;
	UINT8 m_IR1_scn2674_interlace_enable;
	UINT8 m_IR1_scn2674_equalizing_constant;
	UINT8 m_IR2_scn2674_row_table;
	UINT8 m_IR2_scn2674_horz_sync_width;
	UINT8 m_IR2_scn2674_horz_back_porch;
	UINT8 m_IR3_scn2674_vert_front_porch;
	UINT8 m_IR3_scn2674_vert_back_porch;
	UINT8 m_IR4_scn2674_rows_per_screen;
	UINT8 m_IR4_scn2674_character_blink_rate_divisor;
	UINT8 m_IR5_scn2674_character_per_row;
	UINT8 m_IR6_scn2674_cursor_first_scanline;
	UINT8 m_IR6_scn2674_cursor_last_scanline;
	UINT8 m_IR7_scn2674_cursor_underline_position;
	UINT8 m_IR7_scn2674_cursor_rate_divisor;
	UINT8 m_IR7_scn2674_cursor_blink;
	UINT8 m_IR7_scn2674_vsync_width;
	UINT8 m_IR8_scn2674_display_buffer_first_address_LSB;
	UINT8 m_IR9_scn2674_display_buffer_first_address_MSB;
	UINT8 m_IR9_scn2674_display_buffer_last_address;
	UINT8 m_IR10_scn2674_display_pointer_address_lower;
	UINT8 m_IR11_scn2674_display_pointer_address_upper;
	UINT8 m_IR11_scn2674_reset_scanline_counter_on_scrollup;
	UINT8 m_IR11_scn2674_reset_scanline_counter_on_scrolldown;
	UINT8 m_IR12_scn2674_scroll_start;
	UINT8 m_IR12_scn2674_split_register_1;
	UINT8 m_IR13_scn2674_scroll_end;
	UINT8 m_IR13_scn2674_split_register_2;
	UINT8 m_IR14_scn2674_scroll_lines;
	UINT8 m_IR14_scn2674_double_1;
	UINT8 m_IR14_scn2674_double_2;
	UINT8 m_scn2674_horz_front_porch;
	UINT8 m_scn2674_spl1;
	UINT8 m_scn2674_spl2;
	UINT8 m_scn2674_dbl1;
	int m_rowcounter;
	int m_linecounter;

	UINT8 m_scn2674_irq_state;

	void scn2674_write_init_regs(UINT8 data);
	void scn2674_write_command(running_machine &machine, UINT8 data);
	void scn2674_line(running_machine &machine);

	template<class _BitmapClass>
	void scn2574_draw_common( running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, UINT16* vid_mainram );

private:

};


extern const device_type SCN2674_VIDEO;
" /> <bounds x="0.1" y="0.05" width="0.8" height="0.6" /> </text> <text string="CREDITS PER LINE"> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0.05" y="0.6" width="0.9" height="0.3" /> </text> </element> <element name="TAKE_WIN"> <rect state="1"> <color red="0.75" green="0.5" blue="1.0" /> </rect> <rect state="0"> <color red="0.375" green="0.25" blue="0.5" /> </rect> <text string="TAKE WIN"> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0.05" y="0.3" width="0.9" height="0.4" /> </text> </element> <element name="light tower1"> <disk state="1"> <color red="1.0" green="0.0" blue="0.0" /> </disk> <disk state="0"> <color red="0.5" green="0.0" blue="0.0" /> </disk> <text string=""> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <element name="light tower2"> <disk state="1"> <color red="1.0" green="0.0" blue="0.0" /> </disk> <disk state="0"> <color red="0.5" green="0.0" blue="0.0" /> </disk> <text string=""> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <element name="light tower3"> <disk state="1"> <color red="1.0" green="0.0" blue="0.0" /> </disk> <disk state="0"> <color red="0.5" green="0.0" blue="0.0" /> </disk> <text string=""> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <element name="light tower4"> <disk state="1"> <color red="1.0" green="0.0" blue="0.0" /> </disk> <disk state="0"> <color red="0.5" green="0.0" blue="0.0" /> </disk> <text string=""> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <element name="auditkey"> <rect state="1"> <color red="0.5" green="0.35" blue="0.0" /> </rect> <rect state="0"> <color red="1.0" green="0.7" blue="0.0" /> </rect> <text string="Audit Key"> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <element name="jackpotkey"> <rect state="1"> <color red="0.2" green="0.2" blue="0.2" /> </rect> <rect state="0"> <color red="0.4" green="0.4" blue="0.4" /> </rect> <text string="Jackpot Key"> <color red="0.0" green="0.0" blue="0.0" /> <bounds x="0" y="0.1" width="1" height="0.8" /> </text> </element> <view name="Button Lamps"> <screen index="0"> <bounds left="0" top="0" right="4" bottom="3" /> </screen> <element name="lamp11" ref="CASHOUT" inputtag="500d" inputmask="0x04"> <bounds x="0.305" y="3.06" width="0.225" height="0.225" /> </element> <element name="lamp6" ref="1LINE" inputtag="500e" inputmask="0x01"> <bounds x="0.68" y="3.06" width="0.3" height="0.225" /> </element> <element name="lamp5" ref="2LINES" inputtag="500e" inputmask="0x04"> <bounds x="1.09" y="3.06" width="0.3" height="0.225" /> </element> <element name="lamp8" ref="3LINES" inputtag="500e" inputmask="0x10"> <bounds x="1.51" y="3.06" width="0.3" height="0.225" /> </element> <element name="lamp12" ref="4LINES" inputtag="500d" inputmask="0x01"> <bounds x="1.91" y="3.06" width="0.3" height="0.225" /> </element> <element name="lamp7" ref="5LINES" inputtag="500d" inputmask="0x02"> <bounds x="2.32" y="3.06" width="0.3" height="0.225" /> </element> <element name="lamp10" ref="SERVICE" inputtag="500d" inputmask="0x08"> <bounds x="0.305" y="3.47" width="0.225" height="0.225" /> </element> <element name="lamp1" ref="BET1" inputtag="500e" inputmask="0x02"> <bounds x="0.68" y="3.47" width="0.3" height="0.225" /> </element> <element name="lamp2" ref="BET2" inputtag="500e" inputmask="0x80"> <bounds x="1.09" y="3.47" width="0.3" height="0.225" /> </element> <element name="lamp3" ref="BET3" inputtag="500e" inputmask="0x40"> <bounds x="1.51" y="3.47" width="0.3" height="0.225" /> </element> <element name="lamp9" ref="BET4" inputtag="500e" inputmask="0x20"> <bounds x="1.91" y="3.47" width="0.3" height="0.225" /> </element> <element name="lamp4" ref="BET5" inputtag="500e" inputmask="0x08"> <bounds x="2.32" y="3.47" width="0.3" height="0.225" /> </element> <element name="lamp18" ref="GAMBLE" inputtag="500d" inputmask="0x10"> <bounds x="2.8" y="3.47" width="0.225" height="0.225" /> </element> <element name="lamp13" ref="TAKE_WIN" inputtag="500d" inputmask="0x20"> <bounds x="3.175" y="3.47" width="0.225" height="0.225" /> </element> <!-- Tower lamps --> <element name="lamp14" ref="light tower1"> <bounds x="3.58" y="3.43" width="0.10" height="0.10" /> </element> <element name="lamp15" ref="light tower2"> <bounds x="3.58" y="3.55" width="0.10" height="0.10" /> </element> <element name="lamp16" ref="light tower3"> <bounds x="3.68" y="3.43" width="0.10" height="0.10" /> </element> <element name="lamp17" ref="light tower4"> <bounds x="3.68" y="3.55" width="0.10" height="0.10" /> </element> <!-- Audit and Jackpot keys --> <element name="lamp19" ref="auditkey" inputtag="5002" inputmask="0x10"> <bounds x="3.52" y="3.06" width="0.31" height="0.12" /> </element> <element name="lamp20" ref="jackpotkey" inputtag="5003" inputmask="0x04"> <bounds x="3.52" y="3.24" width="0.31" height="0.12" /> </element> </view> </mamelayout>