1 // license:BSD-3-Clause 2 // copyright-holders:Takahiro Nogi 3 #ifndef MAME_INCLUDES_MAGMAX_H 4 #define MAME_INCLUDES_MAGMAX_H 5 6 #pragma once 7 8 #include "screen.h" 9 #include "machine/gen_latch.h" 10 #include "sound/ay8910.h" 11 #include "emupal.h" 12 13 class magmax_state : public driver_device 14 { 15 public: magmax_state(const machine_config & mconfig,device_type type,const char * tag)16 magmax_state(const machine_config &mconfig, device_type type, const char *tag) : 17 driver_device(mconfig, type, tag), 18 m_videoram(*this, "videoram"), 19 m_spriteram(*this, "spriteram"), 20 m_vreg(*this, "vreg"), 21 m_scroll_x(*this, "scroll_x"), 22 m_scroll_y(*this, "scroll_y"), 23 m_rom18B(*this, "user1"), 24 m_maincpu(*this, "maincpu"), 25 m_audiocpu(*this, "audiocpu"), 26 m_ay(*this, "ay%u", 0U), 27 m_soundlatch(*this, "soundlatch"), 28 m_gfxdecode(*this, "gfxdecode"), 29 m_screen(*this, "screen"), 30 m_palette(*this, "palette") 31 { } 32 33 void magmax(machine_config &config); 34 35 protected: 36 virtual void machine_start() override; 37 virtual void machine_reset() override; 38 virtual void video_start() override; 39 40 private: 41 required_shared_ptr<uint16_t> m_videoram; 42 required_shared_ptr<uint16_t> m_spriteram; 43 required_shared_ptr<uint16_t> m_vreg; 44 required_shared_ptr<uint16_t> m_scroll_x; 45 required_shared_ptr<uint16_t> m_scroll_y; 46 required_region_ptr<uint8_t> m_rom18B; 47 required_device<cpu_device> m_maincpu; 48 required_device<cpu_device> m_audiocpu; 49 required_device_array<ay8910_device, 3> m_ay; 50 required_device<generic_latch_8_device> m_soundlatch; 51 required_device<gfxdecode_device> m_gfxdecode; 52 required_device<screen_device> m_screen; 53 required_device<palette_device> m_palette; 54 55 uint8_t m_sound_latch; 56 uint8_t m_LS74_clr; 57 uint8_t m_LS74_q; 58 uint8_t m_gain_control; 59 emu_timer *m_interrupt_timer; 60 int m_flipscreen; 61 std::unique_ptr<uint32_t[]> m_prom_tab; 62 bitmap_ind16 m_bitmap; 63 64 void cpu_irq_ack_w(uint16_t data); 65 uint8_t sound_r(); 66 void vreg_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); 67 void ay8910_portB_0_w(uint8_t data); 68 void ay8910_portA_0_w(uint8_t data); 69 70 void magmax_palette(palette_device &palette) const; 71 uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); 72 TIMER_CALLBACK_MEMBER(scanline_callback); 73 74 void main_map(address_map &map); 75 void sound_io_map(address_map &map); 76 void sound_map(address_map &map); 77 }; 78 79 #endif // MAME_INCLUDES_MAGMAX_H 80