1 // license:BSD-3-Clause 2 // copyright-holders:Sven Schnelle 3 #ifndef MAME_VIDEO_NEREID_H 4 #define MAME_VIDEO_NEREID_H 5 6 #pragma once 7 8 class nereid_device : public device_t, public device_palette_interface 9 { 10 public: 11 nereid_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 12 13 uint16_t ctrl_r(offs_t offset, uint16_t mem_mask = ~0); 14 void ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); 15 16 rgb_t map_color(uint8_t input, uint8_t ovl = 0); 17 18 protected: 19 nereid_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); 20 virtual void device_start() override; 21 virtual void device_reset() override; palette_entries()22 virtual u32 palette_entries() const override { return 0x200; } 23 24 private: 25 static constexpr int NEREID_BUSY=1; 26 27 static constexpr int NEREID_BLANK_ALL=0x2e; 28 static constexpr int NEREID_WRITE_STROBE_OVERLAY=0x3c; 29 static constexpr int NEREID_UNKNOWN_A0=0x50; 30 static constexpr int NEREID_OVERLAY_CTL=0x51; 31 static constexpr int NEREID_INDEX0=0x58; 32 static constexpr int NEREID_RED_DATA=0x59; 33 static constexpr int NEREID_GREEN_DATA=0x5a; 34 static constexpr int NEREID_BLUE_DATA=0x5b; 35 static constexpr int NEREID_INDEX=0x5c; 36 static constexpr int NEREID_PLANE_MASK=0x5d; 37 static constexpr int NEREID_OVERLAY_INDEX=0x5e; 38 static constexpr int NEREID_REV=0x5f; 39 static constexpr int NEREID_WRITE_STROBE=0x78; 40 static constexpr int NEREID_READ_STROBE=0x7c; 41 42 /* registers */ 43 uint8_t m_red; 44 uint8_t m_green; 45 uint8_t m_blue; 46 uint8_t m_index; 47 uint8_t m_plane_mask; 48 uint8_t m_overlay_ctl; 49 uint8_t m_unknown_a0; 50 uint8_t m_overlay_index; 51 }; 52 53 DECLARE_DEVICE_TYPE(NEREID, nereid_device) 54 #endif // MAME_VIDEO_NEREID_H 55