summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/snes_ppu.h
diff options
context:
space:
mode:
author cam900 <dbtlrchl@naver.com>2020-10-25 22:49:49 +0900
committer GitHub <noreply@github.com>2020-10-26 00:49:49 +1100
commit62d9564619d6a91e4be07a3833e627ec652a9bd0 (patch)
tree9ce80ad40bf0d6d4760ade37dd61aae9558c7908 /src/devices/video/snes_ppu.h
parent16f71a3a8ee0e5969c984be3164a6f5171d77abe (diff)
snes_ppu.cpp: Use device_palette_interface for Palette handling (#7375)
Use device_palette_interface for palette, fixed CGRAM size and direct color behavior
Diffstat (limited to 'src/devices/video/snes_ppu.h')
-rw-r--r--src/devices/video/snes_ppu.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index 77c13b4dfca..f6ae1b09fa4 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -37,7 +37,8 @@
// ======================> snes_ppu_device
class snes_ppu_device : public device_t,
- public device_video_interface
+ public device_video_interface,
+ public device_palette_interface
{
public:
// construction/destruction
@@ -312,7 +313,15 @@ protected:
virtual void device_start() override;
virtual void device_reset() override;
+ // device_palette_interface overrides
+ // 256 word CG RAM data (0x000-0x0ff), 8 group of direct colours (0x100-0x8ff), Fixed color (0x900)
+ virtual uint32_t palette_entries() const override { return 0x100 + (0x100 * 8) + 1; }
+ virtual uint32_t palette_indirect_entries() const override { return 32 * 32 * 32; } // 15 bit BGR
+
private:
+ static constexpr uint16_t DIRECT_COLOUR = 0x100; // Position in palette entry for direct colour
+ static constexpr uint16_t FIXED_COLOUR = 0x100 + (0x100 * 8); // Position in palette entry for fixed colour
+
devcb_read16 m_openbus_cb;
optional_ioport m_options;
optional_ioport m_debug1;