trunk/src/mame/drivers/champbwl.c
r241374 | r241375 | |
155 | 155 | #include "sound/x1_010.h" |
156 | 156 | #include "machine/nvram.h" |
157 | 157 | #include "machine/ticket.h" |
158 | | #include "includes/tnzs.h" |
| 158 | #include "video/seta001.h" |
159 | 159 | |
160 | | class champbwl_state : public tnzs_state |
| 160 | class champbwl_state : public driver_device |
161 | 161 | { |
162 | 162 | public: |
163 | 163 | champbwl_state(const machine_config &mconfig, device_type type, const char *tag) |
164 | | : tnzs_state(mconfig, type, tag), |
| 164 | : driver_device(mconfig, type, tag), |
| 165 | m_maincpu(*this, "maincpu"), |
| 166 | m_seta001(*this, "spritegen"), |
| 167 | m_palette(*this, "palette"), |
165 | 168 | m_x1(*this, "x1snd") { } |
166 | 169 | |
| 170 | int m_screenflip;
|
| 171 | |
| 172 | required_device<cpu_device> m_maincpu;
|
| 173 | required_device<seta001_device> m_seta001;
|
| 174 | required_device<palette_device> m_palette; |
167 | 175 | required_device<x1_010_device> m_x1; |
168 | 176 | UINT8 m_last_trackball_val[2]; |
169 | 177 | DECLARE_READ8_MEMBER(trackball_r); |
r241374 | r241375 | |
172 | 180 | DECLARE_MACHINE_START(champbwl); |
173 | 181 | DECLARE_MACHINE_RESET(champbwl); |
174 | 182 | DECLARE_MACHINE_START(doraemon); |
| 183 | DECLARE_PALETTE_INIT(champbwl);
|
175 | 184 | UINT32 screen_update_champbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
176 | 185 | UINT32 screen_update_doraemon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
177 | 186 | void screen_eof_champbwl(screen_device &screen, bool state); |
178 | 187 | void screen_eof_doraemon(screen_device &screen, bool state); |
179 | 188 | }; |
180 | 189 | |
| 190 | PALETTE_INIT_MEMBER(champbwl_state,champbwl) |
| 191 | { |
| 192 | const UINT8 *color_prom = memregion("proms")->base(); |
| 193 | int i, col; |
181 | 194 | |
| 195 | for (i = 0; i < palette.entries(); i++) |
| 196 | { |
| 197 | col = (color_prom[i] << 8) + color_prom[i + 512]; |
| 198 | palette.set_pen_color(i, pal5bit(col >> 10), pal5bit(col >> 5), pal5bit(col >> 0)); |
| 199 | } |
| 200 | } |
182 | 201 | |
| 202 | |
183 | 203 | READ8_MEMBER(champbwl_state::trackball_r) |
184 | 204 | { |
185 | 205 | UINT8 ret; |
r241374 | r241375 | |
443 | 463 | MACHINE_RESET_MEMBER(champbwl_state,champbwl) |
444 | 464 | { |
445 | 465 | m_screenflip = 0; |
446 | | m_mcu_type = -1; |
447 | 466 | m_last_trackball_val[0] = 0; |
448 | 467 | m_last_trackball_val[1] = 0; |
449 | 468 | |
r241374 | r241375 | |
497 | 516 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", champbwl) |
498 | 517 | MCFG_PALETTE_ADD("palette", 512) |
499 | 518 | |
500 | | MCFG_PALETTE_INIT_OWNER(champbwl_state,arknoid2) |
| 519 | MCFG_PALETTE_INIT_OWNER(champbwl_state,champbwl) |
501 | 520 | |
502 | 521 | /* sound hardware */ |
503 | 522 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
r241374 | r241375 | |
562 | 581 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", champbwl) |
563 | 582 | MCFG_PALETTE_ADD("palette", 512) |
564 | 583 | |
565 | | MCFG_PALETTE_INIT_OWNER(champbwl_state,arknoid2) |
| 584 | MCFG_PALETTE_INIT_OWNER(champbwl_state,champbwl) |
566 | 585 | |
567 | 586 | /* sound hardware */ |
568 | 587 | MCFG_SPEAKER_STANDARD_MONO("mono") |