diff options
Diffstat (limited to 'src/mame/includes/neogeo.h')
-rw-r--r-- | src/mame/includes/neogeo.h | 214 |
1 files changed, 53 insertions, 161 deletions
diff --git a/src/mame/includes/neogeo.h b/src/mame/includes/neogeo.h index 78dd1d0a862..e569617ad44 100644 --- a/src/mame/includes/neogeo.h +++ b/src/mame/includes/neogeo.h @@ -6,6 +6,10 @@ Neo-Geo hardware *************************************************************************/ +#ifndef MAME_INCLUDES_NEOGEO_H +#define MAME_INCLUDES_NEOGEO_H + +#pragma once #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" @@ -34,10 +38,8 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), - m_upd4990a(*this, "upd4990a"), m_ym(*this, "ymsnd"), m_sprgen(*this, "spritegen"), - m_save_ram(*this, "saveram"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_memcard(*this, "memcard"), @@ -51,17 +53,12 @@ public: m_region_audiobios(*this, "audiobios"), m_region_audiocpu(*this, "audiocpu"), m_bank_audio_main(*this, "audio_main"), - m_dsw(*this, "DSW"), - m_trackx(*this, "TRACK_X"), - m_tracky(*this, "TRACK_Y"), m_edge(*this, "edge"), m_ctrl1(*this, "ctrl1"), m_ctrl2(*this, "ctrl2"), m_use_cart_vectors(0), m_use_cart_audio(0), - m_slots(*this, "cslot%u", 1U), - m_digits(*this, "digit%u", 1U), - m_lamps(*this, "lamp%u", 1U) + m_slots(*this, "cslot%u", 1U) { } DECLARE_READ16_MEMBER(memcard_r); @@ -75,8 +72,6 @@ public: DECLARE_WRITE16_MEMBER(paletteram_w); DECLARE_READ16_MEMBER(video_register_r); DECLARE_WRITE16_MEMBER(video_register_w); - DECLARE_READ16_MEMBER(in0_r); - DECLARE_READ16_MEMBER(in1_r); DECLARE_CUSTOM_INPUT_MEMBER(get_memcard_status); DECLARE_CUSTOM_INPUT_MEMBER(get_audio_result); @@ -85,14 +80,9 @@ public: TIMER_CALLBACK_MEMBER(display_position_vblank_callback); TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); - // MVS-specific - DECLARE_WRITE_LINE_MEMBER(set_save_ram_unlock); - DECLARE_WRITE16_MEMBER(save_ram_w); - DECLARE_CUSTOM_INPUT_MEMBER(kizuna4p_start_r); - uint32_t screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_WRITE8_MEMBER(io_control_w); + virtual DECLARE_WRITE8_MEMBER(io_control_w); DECLARE_WRITE_LINE_MEMBER(set_use_cart_vectors); DECLARE_WRITE_LINE_MEMBER(set_use_cart_audio); DECLARE_READ16_MEMBER(banked_vectors_r); @@ -107,99 +97,23 @@ public: DECLARE_WRITE_LINE_MEMBER(set_screen_shadow); DECLARE_WRITE_LINE_MEMBER(set_palette_bank); - DECLARE_DRIVER_INIT(neogeo); - void neogeo_base(machine_config &config); - void neogeo_arcade(machine_config &config); - void mslug3b6(machine_config &config); - void s1945p(machine_config &config); - void rotd(machine_config &config); - void mslug4(machine_config &config); - void kof2003(machine_config &config); - void lans2004(machine_config &config); - void ms5plus(machine_config &config); - void kof2k4se(machine_config &config); - void kof2002(machine_config &config); - void kof2001(machine_config &config); - void svcplus(machine_config &config); - void kf2k5uni(machine_config &config); - void garou(machine_config &config); - void sbp(machine_config &config); - void cthd2k3(machine_config &config); - void ct2k3sp(machine_config &config); - void kof2000n(machine_config &config); - void mslug3(machine_config &config); - void kog(machine_config &config); - void fatfur2(machine_config &config); - void garouh(machine_config &config); - void ganryu(machine_config &config); - void zupapa(machine_config &config); - void neobase(machine_config &config); - void kof10th(machine_config &config); - void mslug5(machine_config &config); - void garoubl(machine_config &config); - void ct2k3sa(machine_config &config); - void nitd(machine_config &config); - void samsh5sp(machine_config &config); - void kof98(machine_config &config); - void kf2k3pl(machine_config &config); - void mvs(machine_config &config); - void ms4plus(machine_config &config); - void samsho5b(machine_config &config); - void popbounc(machine_config &config); - void svcplusa(machine_config &config); - void kof2002b(machine_config &config); - void svcboot(machine_config &config); - void kof2000(machine_config &config); - void samsho5(machine_config &config); - void kf2k2mp2(machine_config &config); - void pnyaa(machine_config &config); - void mslug3h(machine_config &config); - void vliner(machine_config &config); - void jockeygp(machine_config &config); - void matrim(machine_config &config); - void matrimbl(machine_config &config); - void kof97oro(machine_config &config); - void kizuna4p(machine_config &config); - void mslugx(machine_config &config); - void kf2k2pls(machine_config &config); - void kf10thep(machine_config &config); - void sengoku3(machine_config &config); - void neogeo_mj(machine_config &config); - void kf2k3upl(machine_config &config); - void preisle2(machine_config &config); - void svcsplus(machine_config &config); - void kf2k3bl(machine_config &config); - void kof99(machine_config &config); - void svc(machine_config &config); - void kof2003h(machine_config &config); - void kof99k(machine_config &config); - void irrmaze(machine_config &config); - void kf2k2mp(machine_config &config); - void bangbead(machine_config &config); void audio_io_map(address_map &map); void audio_map(address_map &map); - void main_map_slot(address_map &map); - void neogeo_main_map(address_map &map); -protected: - void common_machine_start(); - - void set_outputs(); +protected: // device overrides virtual void machine_start() override; virtual void machine_reset() override; - void neogeo_postload(); + virtual void neogeo_postload(); // devices required_device<cpu_device> m_maincpu; required_device<cpu_device> m_audiocpu; // MVS-specific devices - optional_device<upd4990a_device> m_upd4990a; optional_device<ym2610_device> m_ym; required_device<neosprite_optimized_device> m_sprgen; - optional_shared_ptr<uint16_t> m_save_ram; required_device<screen_device> m_screen; optional_device<palette_device> m_palette; @@ -219,12 +133,6 @@ protected: memory_bank *m_bank_audio_cart[4]; memory_bank *m_bank_cartridge; - // configuration - enum {NEOGEO_MVS, NEOGEO_AES, NEOGEO_CD} m_type; - - optional_ioport m_dsw; - optional_ioport m_trackx; - optional_ioport m_tracky; optional_device<neogeo_ctrl_edge_port_device> m_edge; optional_device<neogeo_control_port_device> m_ctrl1; optional_device<neogeo_control_port_device> m_ctrl2; @@ -252,8 +160,6 @@ protected: uint32_t m_bank_base; optional_device_array<neogeo_cart_slot_device, 6> m_slots; - output_finder<4> m_digits; - output_finder<6> m_lamps; int m_curr_slot; @@ -273,22 +179,12 @@ private: void set_pens(); void audio_cpu_check_nmi(); - void set_output_latch(uint8_t data); - void set_output_data(uint8_t data); // internal state bool m_recurse; bool m_audio_cpu_nmi_enabled; bool m_audio_cpu_nmi_pending; - // MVS-specific state - uint8_t m_save_ram_unlocked; - uint8_t m_output_data; - uint8_t m_output_latch; - uint8_t m_el_value; - uint8_t m_led1_value; - uint8_t m_led2_value; - emu_timer *m_display_position_interrupt_timer; emu_timer *m_display_position_vblank_timer; emu_timer *m_vblank_interrupt_timer; @@ -308,65 +204,59 @@ private: }; -class aes_state : public neogeo_state +class ngarcade_base_state : public neogeo_state { - public: - aes_state(const machine_config &mconfig, device_type type, const char *tag) - : neogeo_state(mconfig, type, tag) - , m_io_in2(*this, "IN2") - {} +protected: + ngarcade_base_state(const machine_config &mconfig, device_type type, const char *tag) + : neogeo_state(mconfig, type, tag) + , m_save_ram(*this, "saveram") + , m_upd4990a(*this, "upd4990a") + , m_dsw(*this, "DSW") + { + } - DECLARE_READ16_MEMBER(aes_in2_r); - DECLARE_INPUT_CHANGED_MEMBER(aes_jp1); - DECLARE_MACHINE_START(aes); + virtual void machine_start() override; - void aes(machine_config &config); - void aes_main_map(address_map &map); -protected: - required_ioport m_io_in2; -}; + virtual DECLARE_WRITE8_MEMBER(io_control_w) override; + DECLARE_WRITE_LINE_MEMBER(set_save_ram_unlock); + DECLARE_WRITE16_MEMBER(save_ram_w); + DECLARE_READ16_MEMBER(in0_r); + DECLARE_READ16_MEMBER(in1_r); + + void neogeo_arcade(machine_config &config); + + void neogeo_main_map(address_map &map); + void main_map_slot(address_map &map); + +private: + required_shared_ptr<uint16_t> m_save_ram; + required_device<upd4990a_device> m_upd4990a; + required_ioport m_dsw; + uint8_t m_save_ram_unlocked; +}; -#include "bus/neogeo/prot_pcm2.h" -#include "bus/neogeo/prot_cmc.h" -#include "bus/neogeo/prot_pvc.h" -class neopcb_state : public neogeo_state +class aes_base_state : public neogeo_state { - public: - neopcb_state(const machine_config &mconfig, device_type type, const char *tag) - : neogeo_state(mconfig, type, tag) - , m_cmc_prot(*this, "cmc50") - , m_pcm2_prot(*this, "pcm2") - , m_pvc_prot(*this, "pvc") - {} +public: + DECLARE_INPUT_CHANGED_MEMBER(aes_jp1); + +protected: + aes_base_state(const machine_config &mconfig, device_type type, const char *tag) + : neogeo_state(mconfig, type, tag) + , m_io_in2(*this, "IN2") + { + } + + DECLARE_READ16_MEMBER(aes_in2_r); - // device overrides virtual void machine_start() override; - DECLARE_WRITE16_MEMBER(write_bankpvc); - - DECLARE_INPUT_CHANGED_MEMBER(select_bios); - - DECLARE_DRIVER_INIT(ms5pcb); - DECLARE_DRIVER_INIT(svcpcb); - DECLARE_DRIVER_INIT(kf2k3pcb); - DECLARE_DRIVER_INIT(vliner); - - void install_common(); - void install_banked_bios(); - void neopcb_postload(); - // non-carts - void svcpcb_gfx_decrypt(); - void svcpcb_s1data_decrypt(); - void kf2k3pcb_gfx_decrypt(); - void kf2k3pcb_decrypt_s1data(); - void kf2k3pcb_sp1_decrypt(); - - required_device<cmc_prot_device> m_cmc_prot; - required_device<pcm2_prot_device> m_pcm2_prot; - required_device<pvc_prot_device> m_pvc_prot; - void neopcb(machine_config &config); + void aes_main_map(address_map &map); + +private: + required_ioport m_io_in2; }; @@ -374,3 +264,5 @@ class neopcb_state : public neogeo_state INPUT_PORTS_EXTERN(neogeo); INPUT_PORTS_EXTERN(aes); + +#endif // MAME_INCLUDES_NEOGEO_H |