1 // license:BSD-3-Clause 2 // copyright-holders:Alex W. Jackson 3 #ifndef MAME_VIDEO_NAMCO_C116_H 4 #define MAME_VIDEO_NAMCO_C116_H 5 6 #pragma once 7 8 9 10 //*************************************************************************** 11 // TYPE DEFINITIONS 12 //*************************************************************************** 13 14 class namco_c116_device : 15 public device_t, 16 public device_palette_interface, 17 public device_video_interface 18 { 19 public: 20 //construction/destruction 21 namco_c116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 22 23 // configuration enable_shadows()24 void enable_shadows() { m_enable_shadows = true; } 25 26 //read/write handlers 27 uint8_t read(offs_t offset); 28 void write(offs_t offset, uint8_t data); 29 30 //getters get_reg(int reg)31 uint16_t get_reg(int reg) { return m_regs[reg]; } 32 33 protected: 34 // device-level overrides 35 virtual void device_start() override; 36 37 // device_palette_interface overrides palette_entries()38 virtual uint32_t palette_entries() const override { return 0x2000; } palette_shadows_enabled()39 virtual bool palette_shadows_enabled() const override { return m_enable_shadows; } 40 41 private: 42 // internal state 43 std::vector<uint8_t> m_ram_r; 44 std::vector<uint8_t> m_ram_g; 45 std::vector<uint8_t> m_ram_b; 46 uint16_t m_regs[8]; 47 bool m_enable_shadows; // are shadows enabled? 48 }; 49 50 DECLARE_DEVICE_TYPE(NAMCO_C116, namco_c116_device) 51 52 #endif // MAME_VIDEO_NAMCO_C116_H 53