diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index aa8c342b3f3..952ee2f5228 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -2529,8 +2529,11 @@ files { MAME_DIR .. "src/mame/audio/galaga.cpp", MAME_DIR .. "src/mame/video/galaga.cpp", MAME_DIR .. "src/mame/video/bosco.cpp", + MAME_DIR .. "src/mame/includes/bosco.h", MAME_DIR .. "src/mame/video/digdug.cpp", + MAME_DIR .. "src/mame/includes/digdug.h", MAME_DIR .. "src/mame/machine/xevious.cpp", + MAME_DIR .. "src/mame/includes/xevious.h", MAME_DIR .. "src/mame/video/xevious.cpp", MAME_DIR .. "src/mame/drivers/galaxian.cpp", MAME_DIR .. "src/mame/includes/galaxian.h", diff --git a/src/mame/drivers/galaga.cpp b/src/mame/drivers/galaga.cpp index 46edb856148..5e84f16fcc5 100644 --- a/src/mame/drivers/galaga.cpp +++ b/src/mame/drivers/galaga.cpp @@ -707,6 +707,9 @@ TODO: #include "machine/namco51.h" #include "machine/namco53.h" #include "includes/galaga.h" +#include "includes/xevious.h" +#include "includes/bosco.h" +#include "includes/digdug.h" #include "audio/namco52.h" #include "machine/rescap.h" #include "machine/watchdog.h" diff --git a/src/mame/includes/bosco.h b/src/mame/includes/bosco.h new file mode 100644 index 00000000000..64bd73f7693 --- /dev/null +++ b/src/mame/includes/bosco.h @@ -0,0 +1,41 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria + +class bosco_state : public galaga_state +{ +public: + bosco_state(const machine_config &mconfig, device_type type, const char *tag) + : galaga_state(mconfig, type, tag), + m_bosco_radarattr(*this, "bosco_radarattr"), + m_bosco_starcontrol(*this, "starcontrol"), + m_bosco_starblink(*this, "bosco_starblink") { } + + required_shared_ptr m_bosco_radarattr; + + required_shared_ptr m_bosco_starcontrol; + required_shared_ptr m_bosco_starblink; + + UINT8 *m_bosco_radarx; + UINT8 *m_bosco_radary; + + UINT8 *m_spriteram; + UINT8 *m_spriteram2; + UINT32 m_spriteram_size; + DECLARE_WRITE8_MEMBER(bosco_flip_screen_w); + TILEMAP_MAPPER_MEMBER(fg_tilemap_scan); + TILE_GET_INFO_MEMBER(bg_get_tile_info); + TILE_GET_INFO_MEMBER(fg_get_tile_info); + DECLARE_VIDEO_START(bosco); + DECLARE_PALETTE_INIT(bosco); + UINT32 screen_update_bosco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void screen_eof_bosco(screen_device &screen, bool state); + + inline void get_tile_info_bosco(tile_data &tileinfo,int tile_index,int ram_offs); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); + void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); + void draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); + DECLARE_WRITE8_MEMBER( bosco_videoram_w ); + DECLARE_WRITE8_MEMBER( bosco_scrollx_w ); + DECLARE_WRITE8_MEMBER( bosco_scrolly_w ); + DECLARE_WRITE8_MEMBER( bosco_starclr_w ); +}; diff --git a/src/mame/includes/digdug.h b/src/mame/includes/digdug.h new file mode 100644 index 00000000000..97744fdd8fe --- /dev/null +++ b/src/mame/includes/digdug.h @@ -0,0 +1,31 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria + +class digdug_state : public galaga_state +{ +public: + digdug_state(const machine_config &mconfig, device_type type, const char *tag) + : galaga_state(mconfig, type, tag), + m_digdug_objram(*this, "digdug_objram"), + m_digdug_posram(*this, "digdug_posram"), + m_digdug_flpram(*this, "digdug_flpram") { } + + required_shared_ptr m_digdug_objram; + required_shared_ptr m_digdug_posram; + required_shared_ptr m_digdug_flpram; + + UINT8 m_bg_select; + UINT8 m_tx_color_mode; + UINT8 m_bg_disable; + UINT8 m_bg_color_bank; + DECLARE_CUSTOM_INPUT_MEMBER(shifted_port_r); + TILEMAP_MAPPER_MEMBER(tilemap_scan); + TILE_GET_INFO_MEMBER(bg_get_tile_info); + TILE_GET_INFO_MEMBER(tx_get_tile_info); + DECLARE_VIDEO_START(digdug); + DECLARE_PALETTE_INIT(digdug); + UINT32 screen_update_digdug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE8_MEMBER( digdug_videoram_w ); + DECLARE_WRITE8_MEMBER( digdug_PORT_w ); +}; diff --git a/src/mame/includes/galaga.h b/src/mame/includes/galaga.h index 5a417fe44a7..7c5f753ca84 100644 --- a/src/mame/includes/galaga.h +++ b/src/mame/includes/galaga.h @@ -90,149 +90,5 @@ public: static struct star m_star_seed_tab[]; }; -class xevious_state : public galaga_state -{ -public: - xevious_state(const machine_config &mconfig, device_type type, const char *tag) - : galaga_state(mconfig, type, tag), - m_xevious_sr1(*this, "xevious_sr1"), - m_xevious_sr2(*this, "xevious_sr2"), - m_xevious_sr3(*this, "xevious_sr3"), - m_xevious_fg_colorram(*this, "fg_colorram"), - m_xevious_bg_colorram(*this, "bg_colorram"), - m_xevious_fg_videoram(*this, "fg_videoram"), - m_xevious_bg_videoram(*this, "bg_videoram"), - m_samples(*this, "samples"), - m_subcpu3(*this, "sub3") { } - - required_shared_ptr m_xevious_sr1; - required_shared_ptr m_xevious_sr2; - required_shared_ptr m_xevious_sr3; - required_shared_ptr m_xevious_fg_colorram; - required_shared_ptr m_xevious_bg_colorram; - required_shared_ptr m_xevious_fg_videoram; - required_shared_ptr m_xevious_bg_videoram; - optional_device m_samples; - - INT32 m_xevious_bs[2]; - DECLARE_DRIVER_INIT(xevious); - DECLARE_DRIVER_INIT(xevios); - DECLARE_DRIVER_INIT(battles); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - DECLARE_VIDEO_START(xevious); - DECLARE_PALETTE_INIT(xevious); - DECLARE_MACHINE_RESET(xevios); - DECLARE_PALETTE_INIT(battles); - DECLARE_MACHINE_RESET(battles); - UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(battles_interrupt_4); - TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate); - void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); - DECLARE_WRITE8_MEMBER( xevious_fg_videoram_w ); - DECLARE_WRITE8_MEMBER( xevious_fg_colorram_w ); - DECLARE_WRITE8_MEMBER( xevious_bg_videoram_w ); - DECLARE_WRITE8_MEMBER( xevious_bg_colorram_w ); - DECLARE_WRITE8_MEMBER( xevious_vh_latch_w ); - DECLARE_WRITE8_MEMBER( xevious_bs_w ); - DECLARE_READ8_MEMBER( xevious_bb_r ); - - // Custom I/O - void battles_customio_init(); - - DECLARE_READ8_MEMBER( battles_customio0_r ); - DECLARE_READ8_MEMBER( battles_customio_data0_r ); - DECLARE_READ8_MEMBER( battles_customio3_r ); - DECLARE_READ8_MEMBER( battles_customio_data3_r ); - DECLARE_READ8_MEMBER( battles_input_port_r ); - - DECLARE_WRITE8_MEMBER( battles_customio0_w ); - DECLARE_WRITE8_MEMBER( battles_customio_data0_w ); - DECLARE_WRITE8_MEMBER( battles_customio3_w ); - DECLARE_WRITE8_MEMBER( battles_customio_data3_w ); - DECLARE_WRITE8_MEMBER( battles_CPU4_coin_w ); - DECLARE_WRITE8_MEMBER( battles_noise_sound_w ); - - UINT8 m_customio[16]; - char m_battles_customio_command; - char m_battles_customio_prev_command; - char m_battles_customio_command_count; - char m_battles_customio_data; - char m_battles_sound_played; - - optional_device m_subcpu3; -}; - - -class bosco_state : public galaga_state -{ -public: - bosco_state(const machine_config &mconfig, device_type type, const char *tag) - : galaga_state(mconfig, type, tag), - m_bosco_radarattr(*this, "bosco_radarattr"), - m_bosco_starcontrol(*this, "starcontrol"), - m_bosco_starblink(*this, "bosco_starblink") { } - - required_shared_ptr m_bosco_radarattr; - - required_shared_ptr m_bosco_starcontrol; - required_shared_ptr m_bosco_starblink; - - UINT8 *m_bosco_radarx; - UINT8 *m_bosco_radary; - - UINT8 *m_spriteram; - UINT8 *m_spriteram2; - UINT32 m_spriteram_size; - DECLARE_WRITE8_MEMBER(bosco_flip_screen_w); - TILEMAP_MAPPER_MEMBER(fg_tilemap_scan); - TILE_GET_INFO_MEMBER(bg_get_tile_info); - TILE_GET_INFO_MEMBER(fg_get_tile_info); - DECLARE_VIDEO_START(bosco); - DECLARE_PALETTE_INIT(bosco); - UINT32 screen_update_bosco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void screen_eof_bosco(screen_device &screen, bool state); - - inline void get_tile_info_bosco(tile_data &tileinfo,int tile_index,int ram_offs); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); - void draw_bullets(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); - void draw_stars(bitmap_ind16 &bitmap, const rectangle &cliprect, int flip); - DECLARE_WRITE8_MEMBER( bosco_videoram_w ); - DECLARE_WRITE8_MEMBER( bosco_scrollx_w ); - DECLARE_WRITE8_MEMBER( bosco_scrolly_w ); - DECLARE_WRITE8_MEMBER( bosco_starclr_w ); -}; - -class digdug_state : public galaga_state -{ -public: - digdug_state(const machine_config &mconfig, device_type type, const char *tag) - : galaga_state(mconfig, type, tag), - m_digdug_objram(*this, "digdug_objram"), - m_digdug_posram(*this, "digdug_posram"), - m_digdug_flpram(*this, "digdug_flpram") { } - - required_shared_ptr m_digdug_objram; - required_shared_ptr m_digdug_posram; - required_shared_ptr m_digdug_flpram; - - UINT8 m_bg_select; - UINT8 m_tx_color_mode; - UINT8 m_bg_disable; - UINT8 m_bg_color_bank; - DECLARE_CUSTOM_INPUT_MEMBER(shifted_port_r); - TILEMAP_MAPPER_MEMBER(tilemap_scan); - TILE_GET_INFO_MEMBER(bg_get_tile_info); - TILE_GET_INFO_MEMBER(tx_get_tile_info); - DECLARE_VIDEO_START(digdug); - DECLARE_PALETTE_INIT(digdug); - UINT32 screen_update_digdug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE8_MEMBER( digdug_videoram_w ); - DECLARE_WRITE8_MEMBER( digdug_PORT_w ); -}; - -/*----------- defined in audio/galaga.c -----------*/ - -DISCRETE_SOUND_EXTERN( bosco ); DISCRETE_SOUND_EXTERN( galaga ); +DISCRETE_SOUND_EXTERN( bosco ); diff --git a/src/mame/includes/xevious.h b/src/mame/includes/xevious.h new file mode 100644 index 00000000000..1f4e849c41f --- /dev/null +++ b/src/mame/includes/xevious.h @@ -0,0 +1,75 @@ +// license:BSD-3-Clause +// copyright-holders:Nicola Salmoria + +class xevious_state : public galaga_state +{ +public: + xevious_state(const machine_config &mconfig, device_type type, const char *tag) + : galaga_state(mconfig, type, tag), + m_xevious_sr1(*this, "xevious_sr1"), + m_xevious_sr2(*this, "xevious_sr2"), + m_xevious_sr3(*this, "xevious_sr3"), + m_xevious_fg_colorram(*this, "fg_colorram"), + m_xevious_bg_colorram(*this, "bg_colorram"), + m_xevious_fg_videoram(*this, "fg_videoram"), + m_xevious_bg_videoram(*this, "bg_videoram"), + m_samples(*this, "samples"), + m_subcpu3(*this, "sub3") { } + + required_shared_ptr m_xevious_sr1; + required_shared_ptr m_xevious_sr2; + required_shared_ptr m_xevious_sr3; + required_shared_ptr m_xevious_fg_colorram; + required_shared_ptr m_xevious_bg_colorram; + required_shared_ptr m_xevious_fg_videoram; + required_shared_ptr m_xevious_bg_videoram; + optional_device m_samples; + + INT32 m_xevious_bs[2]; + DECLARE_DRIVER_INIT(xevious); + DECLARE_DRIVER_INIT(xevios); + DECLARE_DRIVER_INIT(battles); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + DECLARE_VIDEO_START(xevious); + DECLARE_PALETTE_INIT(xevious); + DECLARE_MACHINE_RESET(xevios); + DECLARE_PALETTE_INIT(battles); + DECLARE_MACHINE_RESET(battles); + UINT32 screen_update_xevious(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + INTERRUPT_GEN_MEMBER(battles_interrupt_4); + TIMER_DEVICE_CALLBACK_MEMBER(battles_nmi_generate); + void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); + DECLARE_WRITE8_MEMBER( xevious_fg_videoram_w ); + DECLARE_WRITE8_MEMBER( xevious_fg_colorram_w ); + DECLARE_WRITE8_MEMBER( xevious_bg_videoram_w ); + DECLARE_WRITE8_MEMBER( xevious_bg_colorram_w ); + DECLARE_WRITE8_MEMBER( xevious_vh_latch_w ); + DECLARE_WRITE8_MEMBER( xevious_bs_w ); + DECLARE_READ8_MEMBER( xevious_bb_r ); + + // Custom I/O + void battles_customio_init(); + + DECLARE_READ8_MEMBER( battles_customio0_r ); + DECLARE_READ8_MEMBER( battles_customio_data0_r ); + DECLARE_READ8_MEMBER( battles_customio3_r ); + DECLARE_READ8_MEMBER( battles_customio_data3_r ); + DECLARE_READ8_MEMBER( battles_input_port_r ); + + DECLARE_WRITE8_MEMBER( battles_customio0_w ); + DECLARE_WRITE8_MEMBER( battles_customio_data0_w ); + DECLARE_WRITE8_MEMBER( battles_customio3_w ); + DECLARE_WRITE8_MEMBER( battles_customio_data3_w ); + DECLARE_WRITE8_MEMBER( battles_CPU4_coin_w ); + DECLARE_WRITE8_MEMBER( battles_noise_sound_w ); + + UINT8 m_customio[16]; + char m_battles_customio_command; + char m_battles_customio_prev_command; + char m_battles_customio_command_count; + char m_battles_customio_data; + char m_battles_sound_played; + + optional_device m_subcpu3; +}; diff --git a/src/mame/machine/xevious.cpp b/src/mame/machine/xevious.cpp index a8e8e304aa6..e4818ba080b 100644 --- a/src/mame/machine/xevious.cpp +++ b/src/mame/machine/xevious.cpp @@ -12,6 +12,7 @@ #include "emu.h" #include "sound/samples.h" #include "includes/galaga.h" +#include "includes/xevious.h" /*************************************************************************** diff --git a/src/mame/video/bosco.cpp b/src/mame/video/bosco.cpp index c716403329a..928ec05b71d 100644 --- a/src/mame/video/bosco.cpp +++ b/src/mame/video/bosco.cpp @@ -10,6 +10,7 @@ #include "emu.h" #include "includes/galaga.h" +#include "includes/bosco.h" #define MAX_STARS 252 diff --git a/src/mame/video/digdug.cpp b/src/mame/video/digdug.cpp index 0ba931a0da6..7e24b76b576 100644 --- a/src/mame/video/digdug.cpp +++ b/src/mame/video/digdug.cpp @@ -2,6 +2,7 @@ // copyright-holders:Nicola Salmoria #include "emu.h" #include "includes/galaga.h" +#include "includes/digdug.h" /*************************************************************************** diff --git a/src/mame/video/xevious.cpp b/src/mame/video/xevious.cpp index 1f18a4b44bd..7066a219a3e 100644 --- a/src/mame/video/xevious.cpp +++ b/src/mame/video/xevious.cpp @@ -10,6 +10,7 @@ #include "emu.h" #include "includes/galaga.h" +#include "includes/xevious.h" /***************************************************************************