summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/nbmj8688.h
blob: 236502efd977bee3d4c5285f3e061b7ae4842908 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// license:BSD-3-Clause
// copyright-holders:Takahiro Nogi
#include "video/hd61830.h"
#include "machine/nb1413m3.h"

class nbmj8688_state : public driver_device
{
public:
	enum
	{
		TIMER_BLITTER
	};

	nbmj8688_state(const machine_config &mconfig, device_type type, const char *tag) :
		driver_device(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_nb1413m3(*this, "nb1413m3"),
		m_lcdc0(*this, "lcdc0"),
		m_lcdc1(*this, "lcdc1")
	{ }

	required_device<cpu_device> m_maincpu;
	required_device<nb1413m3_device> m_nb1413m3;
	optional_device<hd61830_device> m_lcdc0;
	optional_device<hd61830_device> m_lcdc1;

	// defined in video_start
	int m_gfxmode;

	int m_scrolly;
	int m_blitter_destx;
	int m_blitter_desty;
	int m_blitter_sizex;
	int m_blitter_sizey;
	int m_blitter_direction_x;
	int m_blitter_direction_y;
	int m_blitter_src_addr;
	int m_gfxrom;
	int m_dispflag;
	int m_gfxflag2;
	int m_gfxflag3;
	int m_flipscreen;
	int m_screen_refresh;
	std::unique_ptr<bitmap_ind16> m_tmpbitmap;
	std::unique_ptr<uint16_t[]> m_videoram;
	std::unique_ptr<uint8_t[]> m_clut;
	int m_flipscreen_old;
	emu_timer *m_blitter_timer;

	// common
	DECLARE_READ8_MEMBER(ff_r);
	DECLARE_WRITE8_MEMBER(clut_w);
	DECLARE_WRITE8_MEMBER(blitter_w);
	DECLARE_WRITE8_MEMBER(scrolly_w);


	DECLARE_WRITE8_MEMBER(mjsikaku_gfxflag2_w);
	DECLARE_WRITE8_MEMBER(mjsikaku_gfxflag3_w);
	DECLARE_WRITE8_MEMBER(mjsikaku_romsel_w);
	DECLARE_WRITE8_MEMBER(secolove_romsel_w);
	DECLARE_WRITE8_MEMBER(crystalg_romsel_w);
	DECLARE_WRITE8_MEMBER(seiha_romsel_w);
	DECLARE_WRITE8_MEMBER(HD61830B_both_instr_w);
	DECLARE_WRITE8_MEMBER(HD61830B_both_data_w);
	DECLARE_READ8_MEMBER(dipsw1_r);
	DECLARE_READ8_MEMBER(dipsw2_r);
	DECLARE_WRITE8_MEMBER(barline_output_w);

	DECLARE_CUSTOM_INPUT_MEMBER(nb1413m3_busyflag_r);

	void init_kyuhito();
	void init_idhimitu();
	void init_kaguya2();
	void init_mjcamera();
	void init_kanatuen();
	void video_start_mbmj8688_pure_12bit()     ATTR_COLD;
	DECLARE_PALETTE_INIT(mbmj8688_12bit);
	void video_start_mbmj8688_pure_16bit_LCD() ATTR_COLD;
	DECLARE_PALETTE_INIT(mbmj8688_16bit);
	DECLARE_PALETTE_INIT(mbmj8688_lcd);
	void video_start_mbmj8688_8bit()           ATTR_COLD;
	DECLARE_PALETTE_INIT(mbmj8688_8bit);
	void video_start_mbmj8688_hybrid_16bit()   ATTR_COLD;
	void video_start_mbmj8688_hybrid_12bit()   ATTR_COLD;
	void video_start_mbmj8688_pure_16bit()     ATTR_COLD;

	uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	void vramflip();
	void update_pixel(int x, int y);
	void writeram_low(int x, int y, int color);
	void writeram_high(int x, int y, int color);
	void gfxdraw(int gfxtype);
	void common_video_start();
	void postload();

	void NBMJDRV_4096(machine_config &config);
	void NBMJDRV_256(machine_config &config);
	void NBMJDRV_65536(machine_config &config);
	void mbmj_h12bit(machine_config &config);
	void mbmj_p12bit(machine_config &config);
	void mbmj_p16bit(machine_config &config);
	void mbmj_p16bit_LCD(machine_config &config);
	void swinggal(machine_config &config);
	void korinai(machine_config &config);
	void livegal(machine_config &config);
	void apparel(machine_config &config);
	void kyuhito(machine_config &config);
	void bijokkoy(machine_config &config);
	void barline(machine_config &config);
	void bijokkog(machine_config &config);
	void korinaim(machine_config &config);
	void ryuuha(machine_config &config);
	void seiham(machine_config &config);
	void orangeci(machine_config &config);
	void citylove(machine_config &config);
	void otonano(machine_config &config);
	void ojousanm(machine_config &config);
	void mcitylov(machine_config &config);
	void iemotom(machine_config &config);
	void crystalg(machine_config &config);
	void crystal2(machine_config &config);
	void secolove(machine_config &config);
	void orangec(machine_config &config);
	void mjsikaku(machine_config &config);
	void housemn2(machine_config &config);
	void kanatuen(machine_config &config);
	void nightlov(machine_config &config);
	void kaguya2(machine_config &config);
	void mjgaiden(machine_config &config);
	void mjcamera(machine_config &config);
	void mmsikaku(machine_config &config);
	void housemnq(machine_config &config);
	void idhimitu(machine_config &config);
	void iemoto(machine_config &config);
	void kaguya(machine_config &config);
	void vipclub(machine_config &config);
	void ojousan(machine_config &config);
	void seiha(machine_config &config);
	void barline_io_map(address_map &map);
	void crystalg_io_map(address_map &map);
	void iemoto_io_map(address_map &map);
	void kaguya_io_map(address_map &map);
	void mjgaiden_io_map(address_map &map);
	void mjsikaku_io_map(address_map &map);
	void mjsikaku_map(address_map &map);
	void mmsikaku_io_map(address_map &map);
	void ojousan_map(address_map &map);
	void otonano_io_map(address_map &map);
	void p16bit_LCD_io_map(address_map &map);
	void secolove_io_map(address_map &map);
	void secolove_map(address_map &map);
	void seiha_io_map(address_map &map);
protected:
	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
};