Previous 199869 Revisions Next

r30774 Monday 2nd June, 2014 at 15:04:32 UTC by Carl
(mess) x68k: apply the intensity bit to fix some transparency issues and slightly change gfx layer blending (nw)
[src/mess/drivers]x68k.c
[src/mess/includes]x68k.h
[src/mess/video]x68k.c

trunk/src/mess/includes/x68k.h
r30773r30774
349349   void mfp_trigger_irq(int irq);
350350   void mfp_set_timer(int timer, unsigned char data);
351351   void mfp_recv_data(int data);
352   static rgb_t GGGGGRRRRRBBBBBI_decoder(UINT32 raw);
352353
353354protected:
354355   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mess/video/x68k.c
r30773r30774
2323         2 tilemapped layers - can be 8x8 or 16x16, 16 colours per tile, max 256 colours overall
2424         1 sprite layer - up to 128 16x16 sprites, 16 colours per sprite, maximum 16 sprites per scanline (not yet implemented).
2525
26         Questions: What do the other bits in m_video.reg[2] do?
27                    How is the intensity applied during blending if at all?
28                    Black appears to be opaque only at priority 2 but not 3, is that right?
29                    How is the gfx layer cleared in pacland and text layer in akumajo?
30                    Are the gfx layers blended from the bottom up or all at once?
31
2632*/
2733
2834#include "emu.h"
35
2936#include "machine/mc68901.h"
3037#include "includes/x68k.h"
3138#include "machine/ram.h"
3239
3340
41rgb_t x68k_state::GGGGGRRRRRBBBBBI_decoder(UINT32 raw)
42{
43   UINT8 i = raw & 1;
44   UINT8 r = pal6bit(((raw >> 5) & 0x3e) | i);
45   UINT8 g = pal6bit(((raw >> 10) & 0x3e) | i);
46   UINT8 b = pal6bit(((raw >> 0) & 0x3e) | i);
47   return rgb_t(r, g, b);
48}
3449
35
3650inline void x68k_state::x68k_plot_pixel(bitmap_rgb32 &bitmap, int x, int y, UINT32 color)
3751{
3852   bitmap.pix32(y, x) = (UINT16)color;
r30773r30774
720734            + (((m_tvram[loc+0x20000] >> bit) & 0x01) ? 4 : 0)
721735            + (((m_tvram[loc+0x30000] >> bit) & 0x01) ? 8 : 0);
722736         // Colour 0 is displayable if the text layer is at the priority level 2
723         if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || (m_video.text_pri == 2))
737         if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || ((m_video.reg[1] & 0x0c00) == 0x0800))
724738            bitmap.pix32(line, pixel) = m_pcgpalette->pen(colour);
725739         bit--;
726740         if(bit < 0)
r30773r30774
847861                     {
848862                        if(ret)
849863                        {
850                           if(blend)
864                           if(blend && bitmap.pix16(scanline, pixel))
851865                              bitmap.pix16(scanline, pixel) = ((bitmap.pix16(scanline, pixel) >> 1) & 0x7bde) + ((pal[colour] >> 1) & 0x7bde) + 1;
852866                           else
853                              bitmap.pix16(scanline, pixel) = pal[colour] & 0xfffe;
867                              bitmap.pix16(scanline, pixel) = (pal[colour] & 0xfffe) + blend;
854868                        }
855869                        else
856870                           bitmap.pix16(scanline, pixel) = colour;
r30773r30774
909923         {
910924            colour = m_gfxbitmap->pix16(scanline, pixel);
911925            if(colour || (m_video.gfx_pri == 2))
912               bitmap.pix32(scanline, pixel) = pal555(colour, 6, 11, 1);
926               bitmap.pix32(scanline, pixel) = GGGGGRRRRRBBBBBI_decoder(colour);
913927         }
914928         else if(gfxblend)
915929         {
r30773r30774
12081222            for(pixel=m_crtc.hbegin;pixel<=m_crtc.hend;pixel++)
12091223            {
12101224               UINT8 colour = m_pcgbitmap->pix16(scanline, pixel) & 0xff;
1211               if(colour && (m_pcgpalette->pen(colour) & 0xffffff))
1225               if((colour && (m_pcgpalette->pen(colour) & 0xffffff)) || ((m_video.reg[1] & 0x3000) == 0x2000))
12121226                  bitmap.pix32(scanline, pixel) = m_pcgpalette->pen(colour);
12131227            }
12141228         }
trunk/src/mess/drivers/x68k.c
r30773r30774
17221722   MCFG_GFXDECODE_ADD("gfxdecode", "pcgpalette", empty)
17231723
17241724   MCFG_PALETTE_ADD("gfxpalette", 256)
1725   MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
1725   palette_device::static_set_format(*device, raw_to_rgb_converter(2, &x68k_state::GGGGGRRRRRBBBBBI_decoder));
17261726   MCFG_PALETTE_ADD("pcgpalette", 256)
1727   MCFG_PALETTE_FORMAT(GGGGGRRRRRBBBBBx)
1727   palette_device::static_set_format(*device, raw_to_rgb_converter(2, &x68k_state::GGGGGRRRRRBBBBBI_decoder));
17281728
17291729   MCFG_VIDEO_START_OVERRIDE(x68k_state, x68000 )
17301730

Previous 199869 Revisions Next


© 1997-2024 The MAME Team