Previous 199869 Revisions Next

r26027 Wednesday 6th November, 2013 at 19:26:08 UTC by Angelo Salese
Read-back for paletteram
[src/emu/video]mb_vcu.c mb_vcu.h

trunk/src/emu/video/mb_vcu.c
r26026r26027
4141   AM_RANGE(0x0000, 0x00ff) AM_RAM
4242   AM_RANGE(0x0200, 0x02ff) AM_RAM
4343   AM_RANGE(0x0400, 0x04ff) AM_RAM
44   AM_RANGE(0x0600, 0x06ff) AM_WRITE(mb_vcu_paletteram_w)
44   AM_RANGE(0x0600, 0x06ff) AM_READWRITE(mb_vcu_paletteram_r,mb_vcu_paletteram_w)
4545ADDRESS_MAP_END
4646
47READ8_MEMBER( mb_vcu_device::mb_vcu_paletteram_r )
48{
49   return m_palram[offset];
50}
51
4752WRITE8_MEMBER( mb_vcu_device::mb_vcu_paletteram_w )
4853{
4954   int r,g,b, bit0, bit1, bit2;
5055
51   UINT8 colour = data;
56   m_palram[offset] = data;
5257
5358   /* red component */
54   bit1 = (colour >> 7) & 0x01;
55   bit0 = (colour >> 6) & 0x01;
59   bit1 = (m_palram[offset] >> 7) & 0x01;
60   bit0 = (m_palram[offset] >> 6) & 0x01;
5661   r = combine_2_weights(m_weights_r, bit0, bit1);
5762
5863   /* green component */
59   bit2 = (colour >> 5) & 0x01;
60   bit1 = (colour >> 4) & 0x01;
61   bit0 = (colour >> 3) & 0x01;
64   bit2 = (m_palram[offset] >> 5) & 0x01;
65   bit1 = (m_palram[offset] >> 4) & 0x01;
66   bit0 = (m_palram[offset] >> 3) & 0x01;
6267   g = combine_3_weights(m_weights_g, bit0, bit1, bit2);
6368
6469   /* blue component */
65   bit2 = (colour >> 2) & 0x01;
66   bit1 = (colour >> 1) & 0x01;
67   bit0 = (colour >> 0) & 0x01;
70   bit2 = (m_palram[offset] >> 2) & 0x01;
71   bit1 = (m_palram[offset] >> 1) & 0x01;
72   bit0 = (m_palram[offset] >> 0) & 0x01;
6873   b = combine_3_weights(m_weights_b, bit0, bit1, bit2);
6974
7075   palette_set_color(machine(), offset, MAKE_RGB(r, g, b));
r26026r26027
185190   // TODO: m_screen_tag
186191   m_cpu = machine().device<cpu_device>(m_cpu_tag);
187192   m_ram = auto_alloc_array_clear(machine(), UINT8, 0x800);
193   m_palram = auto_alloc_array_clear(machine(), UINT8, 0x100);
188194
189195   {
190196      static const int resistances_r[2]  = { 4700, 2200 };
trunk/src/emu/video/mb_vcu.h
r26026r26027
5353   DECLARE_WRITE8_MEMBER( background_color_w );
5454   DECLARE_READ8_MEMBER( status_r );
5555   DECLARE_WRITE8_MEMBER( vbank_w );
56   DECLARE_READ8_MEMBER( mb_vcu_paletteram_r );
5657   DECLARE_WRITE8_MEMBER( mb_vcu_paletteram_w );
5758
5859   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
r26026r26027
7576   const address_space_config      m_paletteram_space_config;
7677   UINT8 m_status;
7778   UINT8 *m_ram;
79   UINT8 *m_palram;
7880   cpu_device *m_cpu;
7981   UINT16 m_param_offset_latch;
8082

Previous 199869 Revisions Next


© 1997-2024 The MAME Team