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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino, Nicola Salmoria
#ifndef MAME_INCLUDES_HOMEDATA_H
#define MAME_INCLUDES_HOMEDATA_H
#pragma once
#include "machine/bankdev.h"
#include "machine/gen_latch.h"
#include "sound/sn76496.h"
#include "sound/ymopn.h"
#include "emupal.h"
#include "tilemap.h"
class homedata_state : public driver_device
{
public:
homedata_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_vreg(*this, "vreg"),
m_videoram(*this, "videoram"),
m_blit_rom(*this, "blit_rom"),
m_mainbank(*this, "mainbank"),
m_audiobank(*this, "audiobank"),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_ymsnd(*this, "ymsnd"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_soundlatch(*this, "soundlatch"),
m_mainlatch(*this, "mainlatch"),
m_sn(*this, "snsnd"),
m_mrokumei_soundbank(*this, "mrokumei_soundbank"),
m_keys(*this, "KEY%u", 0U)
{
}
void reikaids(machine_config &config);
void mrokumei(machine_config &config);
void mirderby(machine_config &config);
void pteacher(machine_config &config);
void jogakuen(machine_config &config);
void lemnangl(machine_config &config);
void mjikaga(machine_config &config);
void mjkinjas(machine_config &config);
void init_reikaids();
void init_battlcry();
void init_mirderby();
private:
/* memory pointers */
optional_shared_ptr<uint8_t> m_vreg;
required_shared_ptr<uint8_t> m_videoram;
optional_region_ptr<uint8_t> m_blit_rom;
optional_memory_bank m_mainbank;
optional_memory_bank m_audiobank;
/* video-related */
tilemap_t *m_bg_tilemap[2][4]{};
int m_visible_page = 0;
int m_priority = 0;
uint8_t m_reikaids_which = 0;
int m_flipscreen = 0;
uint8_t m_gfx_bank[2]{}; // pteacher only uses the first one
uint8_t m_blitter_bank = 0;
int m_blitter_param_count = 0;
uint8_t m_blitter_param[4]{}; /* buffers last 4 writes to 0x8006 */
/* misc */
int m_vblank = 0;
int m_keyb = 0;
int m_upd7807_porta = 0;
int m_upd7807_portc = 0;
/* device */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<ym2203_device> m_ymsnd;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<generic_latch_8_device> m_soundlatch;
optional_device<generic_latch_8_device> m_mainlatch; // pteacher
optional_device<sn76489a_device> m_sn; // mrokumei and pteacher
optional_device<address_map_bank_device> m_mrokumei_soundbank; // mrokumei
optional_ioport_array<12> m_keys;
uint8_t m_prot_data = 0;
uint8_t mrokumei_keyboard_r(offs_t offset);
void mrokumei_keyboard_select_w(uint8_t data);
void mrokumei_sound_bank_w(uint8_t data);
void mrokumei_sound_cmd_w(uint8_t data);
uint8_t reikaids_upd7807_porta_r();
void reikaids_upd7807_porta_w(uint8_t data);
void reikaids_upd7807_portc_w(uint8_t data);
uint8_t reikaids_io_r();
uint8_t pteacher_io_r();
uint8_t pteacher_keyboard_r();
uint8_t pteacher_upd7807_porta_r();
void pteacher_upd7807_porta_w(uint8_t data);
void pteacher_upd7807_portc_w(uint8_t data);
void bankswitch_w(uint8_t data);
uint8_t mirderby_prot_r();
void mirderby_prot_w(uint8_t data);
void mrokumei_videoram_w(offs_t offset, u8 data);
void reikaids_videoram_w(offs_t offset, u8 data);
void reikaids_gfx_bank_w(uint8_t data);
void pteacher_gfx_bank_w(uint8_t data);
void homedata_blitter_param_w(uint8_t data);
void mrokumei_blitter_bank_w(uint8_t data);
void reikaids_blitter_bank_w(uint8_t data);
void pteacher_blitter_bank_w(uint8_t data);
void mrokumei_blitter_start_w(uint8_t data);
void reikaids_blitter_start_w(uint8_t data);
void pteacher_blitter_start_w(uint8_t data);
TILE_GET_INFO_MEMBER(mrokumei_get_info0_0);
TILE_GET_INFO_MEMBER(mrokumei_get_info1_0);
TILE_GET_INFO_MEMBER(mrokumei_get_info0_1);
TILE_GET_INFO_MEMBER(mrokumei_get_info1_1);
TILE_GET_INFO_MEMBER(reikaids_get_info0_0);
TILE_GET_INFO_MEMBER(reikaids_get_info1_0);
TILE_GET_INFO_MEMBER(reikaids_get_info0_1);
TILE_GET_INFO_MEMBER(reikaids_get_info1_1);
TILE_GET_INFO_MEMBER(reikaids_get_info0_2);
TILE_GET_INFO_MEMBER(reikaids_get_info1_2);
TILE_GET_INFO_MEMBER(reikaids_get_info0_3);
TILE_GET_INFO_MEMBER(reikaids_get_info1_3);
TILE_GET_INFO_MEMBER(pteacher_get_info0_0);
TILE_GET_INFO_MEMBER(pteacher_get_info1_0);
TILE_GET_INFO_MEMBER(pteacher_get_info0_1);
TILE_GET_INFO_MEMBER(pteacher_get_info1_1);
TILE_GET_INFO_MEMBER(lemnangl_get_info0_0);
TILE_GET_INFO_MEMBER(lemnangl_get_info1_0);
TILE_GET_INFO_MEMBER(lemnangl_get_info0_1);
TILE_GET_INFO_MEMBER(lemnangl_get_info1_1);
TILE_GET_INFO_MEMBER(mirderby_get_info0_0);
TILE_GET_INFO_MEMBER(mirderby_get_info1_0);
TILE_GET_INFO_MEMBER(mirderby_get_info0_1);
TILE_GET_INFO_MEMBER(mirderby_get_info1_1);
DECLARE_MACHINE_START(homedata);
DECLARE_MACHINE_RESET(homedata);
DECLARE_MACHINE_RESET(mrokumei);
DECLARE_VIDEO_START(mrokumei);
void mrokumei_palette(palette_device &palette) const;
DECLARE_MACHINE_START(reikaids);
DECLARE_MACHINE_RESET(reikaids);
DECLARE_VIDEO_START(reikaids);
void reikaids_palette(palette_device &palette) const;
DECLARE_MACHINE_START(pteacher);
DECLARE_MACHINE_RESET(pteacher);
DECLARE_VIDEO_START(pteacher);
void pteacher_palette(palette_device &palette) const;
DECLARE_VIDEO_START(mirderby);
void mirderby_palette(palette_device &palette) const;
DECLARE_VIDEO_START(lemnangl);
uint32_t screen_update_mrokumei(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_reikaids(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_pteacher(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mirderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank);
INTERRUPT_GEN_MEMBER(homedata_irq);
void mrokumei_handleblit( int rom_base );
void reikaids_handleblit( int rom_base );
void pteacher_handleblit( int rom_base );
inline void mrokumei_info0( tile_data &tileinfo, int tile_index, int page, int gfxbank );
inline void mrokumei_info1( tile_data &tileinfo, int tile_index, int page, int gfxbank );
inline void reikaids_info( tile_data &tileinfo, int tile_index, int page, int layer, int gfxbank );
inline void pteacher_info( tile_data &tileinfo, int tile_index, int page, int layer, int gfxbank );
inline void lemnangl_info( tile_data &tileinfo, int tile_index, int page, int layer, int gfxset, int gfxbank );
inline void mirderby_info0( tile_data &tileinfo, int tile_index, int page, int gfxbank );
inline void mirderby_info1( tile_data &tileinfo, int tile_index, int page, int gfxbank );
void cpu0_map(address_map &map);
void cpu1_map(address_map &map);
void cpu2_map(address_map &map);
void jogakuen_map(address_map &map);
void mjikaga_map(address_map &map);
void mjikaga_upd7807_map(address_map &map);
void mrokumei_map(address_map &map);
void mrokumei_sound_banked_map(address_map &map);
void mrokumei_sound_io_map(address_map &map);
void mrokumei_sound_map(address_map &map);
void pteacher_base_map(address_map &map);
void pteacher_map(address_map &map);
void pteacher_upd7807_map(address_map &map);
void reikaids_map(address_map &map);
void reikaids_upd7807_map(address_map &map);
};
#endif // MAME_INCLUDES_HOMEDATA_H
|