UINT32 nubus_lview_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = m_vram + 0x20;

	for (y = 0; y < 600; y++)
	{
		scanline = &bitmap.pix32(y);
		for (x = 0; x < 832/8; x++)
		{
			pixels = vram[(y * (832/8)) + (BYTE4_XOR_BE(x))];

			*scanline++ = m_palette[(pixels&0x80)];
			*scanline++ = m_palette[((pixels<<1)&0x80)];
			*scanline++ = m_palette[((pixels<<2)&0x80)];
			*scanline++ = m_palette[((pixels<<3)&0x80)];
			*scanline++ = m_palette[((pixels<<4)&0x80)];
			*scanline++ = m_palette[((pixels<<5)&0x80)];
			*scanline++ = m_palette[((pixels<<6)&0x80)];
			*scanline++ = m_palette[((pixels<<7)&0x80)];
		}
	}

	return 0;
}
Beispiel #2
0
UINT32 nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = m_vram + 0x200;

	for (y = 0; y < 880; y++)
	{
		scanline = &bitmap.pix32(y);
		for (x = 0; x < 1152/8; x++)
		{
			pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];

			*scanline++ = m_palette[((pixels>>7)&0x1)];
			*scanline++ = m_palette[((pixels>>6)&0x1)];
			*scanline++ = m_palette[((pixels>>5)&0x1)];
			*scanline++ = m_palette[((pixels>>4)&0x1)];
			*scanline++ = m_palette[((pixels>>3)&0x1)];
			*scanline++ = m_palette[((pixels>>2)&0x1)];
			*scanline++ = m_palette[((pixels>>1)&0x1)];
			*scanline++ = m_palette[(pixels&1)];
		}
	}

	return 0;
}
Beispiel #3
0
UINT32 nubus_radiustpd_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	if (!m_screen)
	{
		m_screen = &screen;
		m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
	}

	vram = m_vram + 0x200;

	for (y = 0; y < 880; y++)
	{
		scanline = &bitmap.pix32(y);
		for (x = 0; x < 1152/8; x++)
		{
			pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];

			*scanline++ = m_palette[((pixels>>7)&0x1)];
			*scanline++ = m_palette[((pixels>>6)&0x1)];
			*scanline++ = m_palette[((pixels>>5)&0x1)];
			*scanline++ = m_palette[((pixels>>4)&0x1)];
			*scanline++ = m_palette[((pixels>>3)&0x1)];
			*scanline++ = m_palette[((pixels>>2)&0x1)];
			*scanline++ = m_palette[((pixels>>1)&0x1)];
			*scanline++ = m_palette[(pixels&1)];
		}
	}

	return 0;
}
Beispiel #4
0
uint32_t nubus_vikbw_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	uint32_t *scanline;
	int x, y;
	uint8_t pixels;

	if (!m_vbl_disable)
	{
		raise_slot_irq();
	}

	for (y = 0; y < 768; y++)
	{
		scanline = &bitmap.pix32(y);
		for (x = 0; x < 1024/8; x++)
		{
			pixels = m_vram[(y * 128) + (BYTE4_XOR_BE(x))];

			*scanline++ = m_palette[(pixels>>7)&1];
			*scanline++ = m_palette[(pixels>>6)&1];
			*scanline++ = m_palette[(pixels>>5)&1];
			*scanline++ = m_palette[(pixels>>4)&1];
			*scanline++ = m_palette[(pixels>>3)&1];
			*scanline++ = m_palette[(pixels>>2)&1];
			*scanline++ = m_palette[(pixels>>1)&1];
			*scanline++ = m_palette[(pixels&1)];
		}
	}

	return 0;
}
static SCREEN_UPDATE_RGB32( radiustpd )
{
	UINT32 *scanline;
	int x, y;
	nubus_radiustpd_device *card = downcast<nubus_radiustpd_device *>(screen.owner());
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	if (!card->m_screen)
	{
		card->m_screen = &screen;
		card->m_timer->adjust(card->m_screen->time_until_pos(479, 0), 0);
	}

	vram = card->m_vram + 0x200;

	for (y = 0; y < 880; y++)
	{
		scanline = &bitmap.pix32(y);
		for (x = 0; x < 1152/8; x++)
		{
			pixels = vram[(y * (1152/8)) + (BYTE4_XOR_BE(x))];

			*scanline++ = card->m_palette[((pixels>>7)&0x1)];
			*scanline++ = card->m_palette[((pixels>>6)&0x1)];
			*scanline++ = card->m_palette[((pixels>>5)&0x1)];
			*scanline++ = card->m_palette[((pixels>>4)&0x1)];
			*scanline++ = card->m_palette[((pixels>>3)&0x1)];
			*scanline++ = card->m_palette[((pixels>>2)&0x1)];
			*scanline++ = card->m_palette[((pixels>>1)&0x1)];
			*scanline++ = card->m_palette[(pixels&1)];
		}
	}

	return 0;
}
Beispiel #6
0
UINT32 nubus_procolor816_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = m_vram + 4;

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 640/8) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0x80)];
					*scanline++ = m_palette[((pixels<<1)&0x80)];
					*scanline++ = m_palette[((pixels<<2)&0x80)];
					*scanline++ = m_palette[((pixels<<3)&0x80)];
					*scanline++ = m_palette[((pixels<<4)&0x80)];
					*scanline++ = m_palette[((pixels<<5)&0x80)];
					*scanline++ = m_palette[((pixels<<6)&0x80)];
					*scanline++ = m_palette[((pixels<<7)&0x80)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 640/4) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xc0)];
					*scanline++ = m_palette[((pixels<<2)&0xc0)];
					*scanline++ = m_palette[((pixels<<4)&0xc0)];
					*scanline++ = m_palette[((pixels<<6)&0xc0)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 640/2) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xf0)];
					*scanline++ = m_palette[((pixels&0x0f)<<4)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 640) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		case 4: // 15 bpp
			{
				UINT16 *vram16 = (UINT16 *)&m_vram[0];
				UINT16 pixels;

				for (y = 0; y < 480; y++)
				{
					scanline = &bitmap.pix32(y);
					for (x = 0; x < 640; x++)
					{
						pixels = vram16[(y * 640) + (x^1)];
						*scanline++ = rgb_t(((pixels>>10) & 0x1f)<<3, ((pixels>>5) & 0x1f)<<3, (pixels & 0x1f)<<3);
					}
				}
			}
			break;

		default:
			fatalerror("procolor816: unknown video mode %d\n", m_mode);
			break;
	}
	return 0;
}
Beispiel #7
0
uint32_t nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	uint32_t *scanline;
	int x, y;
	uint8_t pixels, *vram;

	vram = &m_vram[0x20];

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>7)&0x1)];
					*scanline++ = m_palette[((pixels>>6)&0x1)];
					*scanline++ = m_palette[((pixels>>5)&0x1)];
					*scanline++ = m_palette[((pixels>>4)&0x1)];
					*scanline++ = m_palette[((pixels>>3)&0x1)];
					*scanline++ = m_palette[((pixels>>2)&0x1)];
					*scanline++ = m_palette[((pixels>>1)&0x1)];
					*scanline++ = m_palette[(pixels&1)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>6)&3)];
					*scanline++ = m_palette[((pixels>>4)&3)];
					*scanline++ = m_palette[((pixels>>2)&3)];
					*scanline++ = m_palette[(pixels&3)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels&0xf0)>>4)];
					*scanline++ = m_palette[(pixels&0xf)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		default:
			fatalerror("m2hires: unknown video mode %d\n", m_mode);
	}
	return 0;
}
UINT32 nubus_wsportrait_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	vram = &m_vram[0x80];

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 870; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>7)&0x1)];
					*scanline++ = m_palette[((pixels>>6)&0x1)];
					*scanline++ = m_palette[((pixels>>5)&0x1)];
					*scanline++ = m_palette[((pixels>>4)&0x1)];
					*scanline++ = m_palette[((pixels>>3)&0x1)];
					*scanline++ = m_palette[((pixels>>2)&0x1)];
					*scanline++ = m_palette[((pixels>>1)&0x1)];
					*scanline++ = m_palette[(pixels&1)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>6)&3)];
					*scanline++ = m_palette[((pixels>>4)&3)];
					*scanline++ = m_palette[((pixels>>2)&3)];
					*scanline++ = m_palette[(pixels&3)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels&0xf0)>>4)];
					*scanline++ = m_palette[(pixels&0xf)];
				}
			}
			break;

		default:
			fatalerror("wsportrait: unknown video mode %d\n", m_mode);
	}
	return 0;
}
Beispiel #9
0
UINT32 jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline, *base;
	int x, y;
	UINT8 *vram8 = (UINT8 *)m_vram;
	UINT8 pixels;

	if (!m_vbl_disable)
	{
		raise_slot_irq();
	}

	vram8 += 0xa00;

	switch (m_mode)
	{
		case 0: // 1bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < m_xres/8; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>7)&1];
					*scanline++ = m_palette[(pixels>>6)&1];
					*scanline++ = m_palette[(pixels>>5)&1];
					*scanline++ = m_palette[(pixels>>4)&1];
					*scanline++ = m_palette[(pixels>>3)&1];
					*scanline++ = m_palette[(pixels>>2)&1];
					*scanline++ = m_palette[(pixels>>1)&1];
					*scanline++ = m_palette[pixels&1];
				}
			}
			break;

		case 1: // 2bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < m_xres/4; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>6)&0x3];
					*scanline++ = m_palette[(pixels>>4)&0x3];
					*scanline++ = m_palette[(pixels>>2)&0x3];
					*scanline++ = m_palette[pixels&3];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < m_xres/2; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>4)&0xf];
					*scanline++ = m_palette[pixels&0xf];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < m_xres; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		case 4: // 24 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				base = (UINT32 *)&m_vram[y * m_stride];
				for (x = 0; x < m_xres; x++)
				{
					*scanline++ = *base++;
				}
			}
			break;
	}

	return 0;
}
Beispiel #10
0
UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
    UINT32 *scanline;
    int x, y;
    UINT8 pixels, *vram;

    // first time?  kick off the VBL timer
    if (!m_screen)
    {
        m_screen = &screen;
        m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
    }

    vram = m_vram + (8*1024);

    switch (m_mode)
    {
    case 0: // 1 bpp?
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 640/8; x++)
            {
                pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[(pixels&0x80)];
                *scanline++ = m_palette[((pixels<<1)&0x80)];
                *scanline++ = m_palette[((pixels<<2)&0x80)];
                *scanline++ = m_palette[((pixels<<3)&0x80)];
                *scanline++ = m_palette[((pixels<<4)&0x80)];
                *scanline++ = m_palette[((pixels<<5)&0x80)];
                *scanline++ = m_palette[((pixels<<6)&0x80)];
                *scanline++ = m_palette[((pixels<<7)&0x80)];
            }
        }
        break;

    case 1: // 2 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 640/4; x++)
            {
                pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[(pixels&0xc0)];
                *scanline++ = m_palette[((pixels<<2)&0xc0)];
                *scanline++ = m_palette[((pixels<<4)&0xc0)];
                *scanline++ = m_palette[((pixels<<6)&0xc0)];
            }
        }
        break;

    case 2: // 4 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 640/2; x++)
            {
                pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[(pixels&0xf0)];
                *scanline++ = m_palette[((pixels&0x0f)<<4)];
            }
        }
        break;

    case 3: // 8 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 640; x++)
            {
                pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
                *scanline++ = m_palette[pixels];
            }
        }
        break;

    case 4: // 24 bpp
    {
        UINT32 *vram32 = (UINT32 *)m_vram;
        UINT32 *base;

        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            base = &vram32[y * 1024];
            for (x = 0; x < 640; x++)
            {
                *scanline++ = *base++;
            }
        }
    }
    break;

    default:
        fatalerror("cb264se30: unknown video mode %d\n", m_mode);
        break;
    }
    return 0;
}
Beispiel #11
0
static void sp_dma(int direction)
{
	UINT8 *src, *dst;
	int i;
	//int cpu = cpu_getactivecpu();

	if (sp_dma_length == 0)
	{
		return;
	}

	sp_dma_length++;

	if ((sp_dma_length & 3) != 0)
	{
		//fatalerror("sp_dma (%s): sp_dma_length unaligned %08X\n", cpu ? "RSP" : "R4300i", sp_dma_length);
		sp_dma_length = sp_dma_length & ~3;
        //sp_dma_length = (sp_dma_length + 3) & ~3;

		//sp_dma_length &= ~3;
	}

	if (sp_mem_addr & 0x3)
	{
        //sp_mem_addr = (sp_mem_addr + 3) & ~3;
        sp_mem_addr = sp_mem_addr & ~3;
        // sp_mem_addr &= ~0x3;
        // fatalerror("sp_dma (%s): sp_mem_addr unaligned: %08X\n", cpu ? "RSP" : "R4300i", sp_mem_addr);
	}
	if (sp_dram_addr & 0x3)
	{
        //sp_dram_addr = (sp_dram_addr + 3) & ~3;
        sp_dram_addr = sp_dram_addr & ~3;
        // sp_dram_addr &= ~0x3;
        // fatalerror("sp_dma (%s): sp_dram_addr unaligned: %08X\n", cpu ? "RSP" : "R4300i", sp_dram_addr);

        // Diddy Kong Racing does unaligned DMA?
        //sp_dram_addr &= ~0x3;
        //sp_dram_addr = (sp_dram_addr + 3) & ~0x3;
	}

	if (sp_dma_count > 0)
	{
		fatalerror("sp_dma: dma_count = %d\n", sp_dma_count);
	}
	if (sp_dma_skip > 0)
	{
		fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip);
	}

	if ((sp_mem_addr & 0xfff) + (sp_dma_length) > 0x1000)
	{
		fatalerror("sp_dma: dma out of memory area: %08X, %08X\n", sp_mem_addr, sp_dma_length);
	}

	if (direction == 0)		// RDRAM -> I/DMEM
	{
		src = (UINT8*)&rdram[sp_dram_addr / 4];
		dst = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4];

		//mame_printf_debug("sp_dma: %08X to %08X, length %08X\n", sp_dram_addr, sp_mem_addr, sp_dma_length);

		for (i=0; i < sp_dma_length; i++)
		{
			dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)];
		}

		/*dst = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem;
        for (i=0; i <= sp_dma_length; i++)
        {
            dst[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff] = src[BYTE4_XOR_BE(i)];
        }*/

        sp_mem_addr += sp_dma_length;
        sp_dram_addr += sp_dma_length;
	}
	else					// I/DMEM -> RDRAM
	{
		src = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4];
		dst = (UINT8*)&rdram[sp_dram_addr / 4];

//      mame_printf_debug("sp_dma: %08X to %08X, length %08X\n", sp_mem_addr, sp_dram_addr, sp_dma_length);

		for (i=0; i < sp_dma_length; i++)
		{
			dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)];
		}

		/*src = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem;
        for (i=0; i <= sp_dma_length; i++)
        {
            dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff];
        }*/

        sp_mem_addr += sp_dma_length;
        sp_dram_addr += sp_dma_length;
	}
}
Beispiel #12
0
UINT32 nubus_xceedmc30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = m_vram + (4*1024);

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>7)&1];
					*scanline++ = m_palette[(pixels>>6)&1];
					*scanline++ = m_palette[(pixels>>5)&1];
					*scanline++ = m_palette[(pixels>>4)&1];
					*scanline++ = m_palette[(pixels>>3)&1];
					*scanline++ = m_palette[(pixels>>2)&1];
					*scanline++ = m_palette[(pixels>>1)&1];
					*scanline++ = m_palette[pixels&1];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>6)&3)];
					*scanline++ = m_palette[((pixels>>4)&3)];
					*scanline++ = m_palette[((pixels>>2)&3)];
					*scanline++ = m_palette[(pixels&3)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>4)];
					*scanline++ = m_palette[(pixels&0xf)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		case 4: // 24 bpp
			{
				UINT32 *vram32 = (UINT32 *)vram;
				UINT32 *base;

				for (y = 0; y < 480; y++)
				{
					scanline = &bitmap.pix32(y);
					base = &vram32[y * 1024];
					for (x = 0; x < 640; x++)
					{
						*scanline++ = *base++;
					}
				}
			}
			break;

		default:
			fatalerror("xceedmc30: unknown video mode %d\n", m_mode);
			break;
	}
	return 0;
}
Beispiel #13
0
UINT32 nubus_m2video_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = m_vram + 0x20;

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0x80)];
					*scanline++ = m_palette[((pixels<<1)&0x80)];
					*scanline++ = m_palette[((pixels<<2)&0x80)];
					*scanline++ = m_palette[((pixels<<3)&0x80)];
					*scanline++ = m_palette[((pixels<<4)&0x80)];
					*scanline++ = m_palette[((pixels<<5)&0x80)];
					*scanline++ = m_palette[((pixels<<6)&0x80)];
					*scanline++ = m_palette[((pixels<<7)&0x80)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xc0)];
					*scanline++ = m_palette[((pixels<<2)&0xc0)];
					*scanline++ = m_palette[((pixels<<4)&0xc0)];
					*scanline++ = m_palette[((pixels<<6)&0xc0)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xf0)];
					*scanline++ = m_palette[((pixels&0x0f)<<4)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		default:
			fatalerror("m2video: unknown video mode %d\n", m_mode);
	}
	return 0;
}
Beispiel #14
0
UINT32 nubus_specpdq_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	vram = &m_vram[0x9000];

	switch (m_mode)
	{
		case 0: // 1 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 1152/8; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette_val[(pixels&0x80)];
					*scanline++ = m_palette_val[((pixels<<1)&0x80)];
					*scanline++ = m_palette_val[((pixels<<2)&0x80)];
					*scanline++ = m_palette_val[((pixels<<3)&0x80)];
					*scanline++ = m_palette_val[((pixels<<4)&0x80)];
					*scanline++ = m_palette_val[((pixels<<5)&0x80)];
					*scanline++ = m_palette_val[((pixels<<6)&0x80)];
					*scanline++ = m_palette_val[((pixels<<7)&0x80)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 1152/4; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette_val[(pixels&0xc0)];
					*scanline++ = m_palette_val[((pixels<<2)&0xc0)];
					*scanline++ = m_palette_val[((pixels<<4)&0xc0)];
					*scanline++ = m_palette_val[((pixels<<6)&0xc0)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 1152/2; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette_val[(pixels&0xf0)];
					*scanline++ = m_palette_val[((pixels<<4)&0xf0)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 1152; x++)
				{
					pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette_val[pixels];
				}
			}
			break;

		default:
			fatalerror("specpdq: unknown video mode %d\n", m_mode);
	}
	return 0;
}
Beispiel #15
0
void memory_array::write8_to_32be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
Beispiel #16
0
UINT32 memory_array::read8_from_32be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)]; }
offs_t activecpu_dasm(char *buffer, offs_t pc)
{
	VERIFY_ACTIVECPU(activecpu_dasm);

	/* allow overrides */
	if (cpu_dasm_override)
	{
		offs_t result = cpu_dasm_override(activecpu, buffer, pc);
		if (result)
			return result;
	}

	/* if there's no old-style assembler, do some work to make this call work with the new one */
	if (!cpu[activecpu].intf.disassemble)
	{
		int dbwidth = activecpu_databus_width(ADDRESS_SPACE_PROGRAM);
		int maxbytes = activecpu_max_instruction_bytes();
		int endianness = activecpu_endianness();
		UINT8 opbuf[64], argbuf[64];
		int xorval = 0;
		int numbytes;

		/* determine the XOR to get the bytes in order */
		switch (dbwidth)
		{
			case 8:		xorval = 0;																break;
			case 16:	xorval = (endianness == CPU_IS_LE) ? BYTE_XOR_LE(0) : BYTE_XOR_BE(0);	break;
			case 32:	xorval = (endianness == CPU_IS_LE) ? BYTE4_XOR_LE(0) : BYTE4_XOR_BE(0);	break;
			case 64:	xorval = (endianness == CPU_IS_LE) ? BYTE8_XOR_LE(0) : BYTE8_XOR_BE(0);	break;
		}

		/* fetch the bytes up to the maximum */
		memset(opbuf, 0xff, sizeof(opbuf));
		memset(argbuf, 0xff, sizeof(argbuf));
		for (numbytes = 0; numbytes < maxbytes; numbytes++)
		{
			offs_t physpc = pc + numbytes;
			const UINT8 *ptr;

			/* translate the address, set the opcode base, and apply the byte xor */
			if (!cpu[activecpu].intf.translate || (*cpu[activecpu].intf.translate)(ADDRESS_SPACE_PROGRAM, &physpc))
			{
				memory_set_opbase(physpc);
				physpc ^= xorval;

				/* get pointer to data */
				ptr = memory_get_op_ptr(cpu_getactivecpu(), physpc, 0);
				if (ptr)
				{
					opbuf[numbytes] = *ptr;
					ptr = memory_get_op_ptr(cpu_getactivecpu(), physpc, 1);
					if (ptr)
						argbuf[numbytes] = *ptr;
					else
						argbuf[numbytes] = opbuf[numbytes];
				}
			}
		}

		return activecpu_dasm_new(buffer, pc, opbuf, argbuf, maxbytes);
	}
	return (*cpu[activecpu].intf.disassemble)(buffer, pc);
}
Beispiel #18
0
void device_nubus_card_interface::install_declaration_rom(device_t *dev, const char *romregion, bool mirror_all_mb, bool reverse_rom)
{
	bool inverted = false;

	astring tempstring;
	UINT8 *rom = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->base();
	UINT32 romlen = device().machine().root_device().memregion(dev->subtag(tempstring, romregion))->bytes();

//  printf("ROM length is %x, last bytes are %02x %02x\n", romlen, rom[romlen-2], rom[romlen-1]);

	if (reverse_rom)
	{
		UINT8 temp;
		UINT32 endptr = romlen-1;

		for (UINT32 idx = 0; idx < romlen / 2; idx++)
		{
			temp = rom[idx];
			rom[idx] = rom[endptr];
			rom[endptr] = temp;
			endptr--;
		}
	}

	UINT8 byteLanes = rom[romlen-1];
	// check if all bits are inverted
	if (rom[romlen-2] == 0xff)
	{
		byteLanes ^= 0xff;
		inverted = true;
	}

	#if 0
	FILE *f;
	f = fopen("romout.bin", "wb");
	fwrite(rom, romlen, 1, f);
	fclose(f);
	#endif

	switch (byteLanes)
	{
		case 0x0f:  // easy case: all 4 lanes (still must scramble for 32-bit BE bus though)
			m_declaration_rom.resize(romlen);
			for (int i = 0; i < romlen; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE(i)] = rom[i];
			}
			break;

		case 0xe1:  // lane 0 only
			m_declaration_rom.resize_and_clear(romlen*4);
			for (int i = 0; i < romlen; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE(i*4)] = rom[i];
			}
			romlen *= 4;
			break;

		case 0xd2:  // lane 1 only
			m_declaration_rom.resize_and_clear(romlen*4);
			for (int i = 0; i < romlen; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+1)] = rom[i];
			}
			romlen *= 4;
			break;

		case 0xb4:  // lane 2 only
			m_declaration_rom.resize_and_clear(romlen*4);
			for (int i = 0; i < romlen; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[i];
			}
			romlen *= 4;
			break;

		case 0x78:  // lane 3 only
			m_declaration_rom.resize_and_clear(romlen*4);
			for (int i = 0; i < romlen; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+3)] = rom[i];
			}
			romlen *= 4;
			break;

		case 0xc3:  // lanes 0, 1
			m_declaration_rom.resize_and_clear(romlen*2);
			for (int i = 0; i < romlen/2; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
				m_declaration_rom[BYTE4_XOR_BE((i*4)+1)] = rom[(i*2)+1];
			}
			romlen *= 2;
			break;

		case 0xa5:  // lanes 0, 2
			m_declaration_rom.resize_and_clear(romlen*2);
			for (int i = 0; i < romlen/2; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+0)] = rom[(i*2)];
				m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)+1];
			}
			romlen *= 2;
			break;

		case 0x3c:  // lanes 2,3
			m_declaration_rom.resize_and_clear(romlen*2);
			for (int i = 0; i < romlen/2; i++)
			{
				m_declaration_rom[BYTE4_XOR_BE((i*4)+2)] = rom[(i*2)];
				m_declaration_rom[BYTE4_XOR_BE((i*4)+3)] = rom[(i*2)+1];
			}
			romlen *= 2;
			break;

		default:
			fatalerror("NuBus: unhandled byteLanes value %02x\n", byteLanes);
			break;
	}

	// the slot manager can supposedly handle inverted ROMs by itself, but let's do it for it anyway
	if (inverted)
	{
		for (int i = 0; i < romlen; i++)
		{
			m_declaration_rom[i] ^= 0xff;
		}
	}

	// now install the ROM
	UINT32 addr = get_slotspace() + 0x01000000;
	char bankname[128];
	strcpy(bankname, "rom_");
	strcat(bankname, m_nubus_slottag);
	addr -= romlen;
//  printf("Installing ROM at %x, length %x\n", addr, romlen);
	if (mirror_all_mb)  // mirror the declaration ROM across all 16 megs of the slot space
	{
		m_nubus->install_bank(addr, addr+romlen-1, 0, 0x00f00000, bankname, m_declaration_rom);
	}
	else
	{
		m_nubus->install_bank(addr, addr+romlen-1, 0, 0, bankname, m_declaration_rom);
	}
}
Beispiel #19
0
UINT32 nubus_cb264_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
    UINT32 *scanline, *base;
    int x, y;
    UINT8 pixels;

    if (!m_cb264_vbl_disable)
    {
        raise_slot_irq();
    }

    switch (m_cb264_mode)
    {
    case 0: // 1 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 640/8; x++)
            {
                pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0x80];
                *scanline++ = m_palette[(pixels<<1)&0x80];
                *scanline++ = m_palette[(pixels<<2)&0x80];
                *scanline++ = m_palette[(pixels<<3)&0x80];
                *scanline++ = m_palette[(pixels<<4)&0x80];
                *scanline++ = m_palette[(pixels<<5)&0x80];
                *scanline++ = m_palette[(pixels<<6)&0x80];
                *scanline++ = m_palette[(pixels<<7)&0x80];
            }
        }
        break;

    case 1: // 2 bpp (3f/7f/bf/ff)
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 640/4; x++)
            {
                pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0xc0];
                *scanline++ = m_palette[(pixels<<2)&0xc0];
                *scanline++ = m_palette[(pixels<<4)&0xc0];
                *scanline++ = m_palette[(pixels<<6)&0xc0];
            }
        }
        break;

    case 2: // 4 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 640/2; x++)
            {
                pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0xf0];
                *scanline++ = m_palette[(pixels<<4)&0xf0];
            }
        }
        break;

    case 3: // 8 bpp
        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 640; x++)
            {
                pixels = m_vram[(y * 1024) + (BYTE4_XOR_BE(x))];
                *scanline++ = m_palette[pixels];
            }
        }
        break;

    case 4: // 24 bpp
    case 7: // ???
    {
        UINT32 *vram32 = (UINT32 *)&m_vram[0];

        for (y = 0; y < 480; y++)
        {
            scanline = &bitmap.pix32(y);
            base = &vram32[y * 1024];
            for (x = 0; x < 640; x++)
            {
                *scanline++ = *base++;
            }
        }
    }
    break;

    default:
        fatalerror("cb264: unknown video mode %d\n", m_cb264_mode);
    }

    return 0;
}
Beispiel #20
0
static void sp_dma(int direction)
{
	UINT8 *src, *dst;
	int i;

	if (sp_dma_length == 0)
	{
		return;
	}

	if (sp_mem_addr & 0x3)
	{
		fatalerror("sp_dma: sp_mem_addr unaligned: %08X\n", sp_mem_addr);
	}
	if (sp_dram_addr & 0x3)
	{
		fatalerror("sp_dma: sp_dram_addr unaligned: %08X\n", sp_dram_addr);
	}

	if (sp_dma_count > 0)
	{
		fatalerror("sp_dma: dma_count = %d\n", sp_dma_count);
	}
	if (sp_dma_skip > 0)
	{
		fatalerror("sp_dma: dma_skip = %d\n", sp_dma_skip);
	}

	if ((sp_mem_addr & 0xfff) + (sp_dma_length+1) > 0x1000)
	{
		fatalerror("sp_dma: dma out of memory area: %08X, %08X\n", sp_mem_addr, sp_dma_length+1);
	}

	if (direction == 0)		// RDRAM -> I/DMEM
	{
		src = (UINT8*)&rdram[sp_dram_addr / 4];
		dst = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4];

		for (i=0; i <= sp_dma_length; i++)
		{
			dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)];
		}

		/*dst = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem;
        for (i=0; i <= sp_dma_length; i++)
        {
            dst[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff] = src[BYTE4_XOR_BE(i)];
        }*/
	}
	else					// I/DMEM -> RDRAM
	{
		src = (sp_mem_addr & 0x1000) ? (UINT8*)&rsp_imem[(sp_mem_addr & 0xfff) / 4] : (UINT8*)&rsp_dmem[(sp_mem_addr & 0xfff) / 4];
		dst = (UINT8*)&rdram[sp_dram_addr / 4];

		for (i=0; i <= sp_dma_length; i++)
		{
			dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(i)];
		}

		/*src = (sp_mem_addr & 0x1000) ? (UINT8*)rsp_imem : (UINT8*)rsp_dmem;
        for (i=0; i <= sp_dma_length; i++)
        {
            dst[BYTE4_XOR_BE(i)] = src[BYTE4_XOR_BE(sp_mem_addr+i) & 0xfff];
        }*/
	}
}
Beispiel #21
0
UINT32 jmfb_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline, *base;
	int x, y;
	UINT8 *vram8 = &m_vram[0];
	UINT8 pixels;

	// first time?  kick off the VBL timer
	if (!m_screen)
	{
		m_screen = &screen;
		m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
	}

	vram8 += 0xa00;

	switch (m_mode)
	{
		case 0: // 1bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < m_xres/8; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>7)&1];
					*scanline++ = m_palette[(pixels>>6)&1];
					*scanline++ = m_palette[(pixels>>5)&1];
					*scanline++ = m_palette[(pixels>>4)&1];
					*scanline++ = m_palette[(pixels>>3)&1];
					*scanline++ = m_palette[(pixels>>2)&1];
					*scanline++ = m_palette[(pixels>>1)&1];
					*scanline++ = m_palette[pixels&1];
				}
			}
			break;

		case 1: // 2bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < m_xres/4; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>6)&0x3];
					*scanline++ = m_palette[(pixels>>4)&0x3];
					*scanline++ = m_palette[(pixels>>2)&0x3];
					*scanline++ = m_palette[pixels&3];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < m_xres/2; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels>>4)&0xf];
					*scanline++ = m_palette[pixels&0xf];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < m_xres; x++)
				{
					pixels = vram8[(y * m_stride) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		case 4: // 24 bpp
			for (y = 0; y < m_yres; y++)
			{
				scanline = &bitmap.pix32(y);
				base = (UINT32 *)&m_vram[y * m_stride];
				for (x = 0; x < m_xres; x++)
				{
					*scanline++ = *base++;
				}
			}
			break;
	}

	return 0;
}
UINT32 nubus_cb264se30_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	vram = &m_vram[8*1024];

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0x80)];
					*scanline++ = m_palette[((pixels<<1)&0x80)];
					*scanline++ = m_palette[((pixels<<2)&0x80)];
					*scanline++ = m_palette[((pixels<<3)&0x80)];
					*scanline++ = m_palette[((pixels<<4)&0x80)];
					*scanline++ = m_palette[((pixels<<5)&0x80)];
					*scanline++ = m_palette[((pixels<<6)&0x80)];
					*scanline++ = m_palette[((pixels<<7)&0x80)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xc0)];
					*scanline++ = m_palette[((pixels<<2)&0xc0)];
					*scanline++ = m_palette[((pixels<<4)&0xc0)];
					*scanline++ = m_palette[((pixels<<6)&0xc0)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[(pixels&0xf0)];
					*scanline++ = m_palette[((pixels&0x0f)<<4)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		case 4: // 24 bpp
			{
				UINT32 *vram32 = (UINT32 *)&m_vram[0];
				UINT32 *base;

				for (y = 0; y < 480; y++)
				{
					scanline = &bitmap.pix32(y);
					base = &vram32[y * 1024];
					for (x = 0; x < 640; x++)
					{
						*scanline++ = *base++;
					}
				}
			}
			break;

		default:
			fatalerror("cb264se30: unknown video mode %d\n", m_mode);
	}
	return 0;
}
Beispiel #23
0
UINT32 nubus_spec8s3_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
    UINT32 *scanline;
    int x, y;
    UINT8 pixels, *vram;

    vram = &m_vram[0x400];

    switch (m_mode)
    {
    case 0: // 1 bpp
        for (y = 0; y < 768; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 1024/8; x++)
            {
                pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0x80];
                *scanline++ = m_palette[(pixels<<1)&0x80];
                *scanline++ = m_palette[(pixels<<2)&0x80];
                *scanline++ = m_palette[(pixels<<3)&0x80];
                *scanline++ = m_palette[(pixels<<4)&0x80];
                *scanline++ = m_palette[(pixels<<5)&0x80];
                *scanline++ = m_palette[(pixels<<6)&0x80];
                *scanline++ = m_palette[(pixels<<7)&0x80];
            }
        }
        break;

    case 1: // 2 bpp
        for (y = 0; y < 768; y++)
        {
            scanline = &bitmap.pix32(y);
            for (x = 0; x < 1024/4; x++)
            {
                pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0xc0];
                *scanline++ = m_palette[(pixels<<2)&0xc0];
                *scanline++ = m_palette[(pixels<<4)&0xc0];
                *scanline++ = m_palette[(pixels<<6)&0xc0];
            }
        }
        break;

    case 2: // 4 bpp
        for (y = 0; y < 768; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 1024/2; x++)
            {
                pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

                *scanline++ = m_palette[pixels&0xf0];
                *scanline++ = m_palette[(pixels<<4)&0xf0];
            }
        }
        break;

    case 3: // 8 bpp
        for (y = 0; y < 768; y++)
        {
            scanline = &bitmap.pix32(y);

            for (x = 0; x < 1024; x++)
            {
                pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
                *scanline++ = m_palette[pixels];
            }
        }
        break;

    default:
        fatalerror("spec8s3: unknown video mode %d\n", m_mode);
    }
    return 0;
}
Beispiel #24
0
static SCREEN_UPDATE_RGB32( specpdq )
{
	UINT32 *scanline;
	int x, y;
	nubus_specpdq_device *card = downcast<nubus_specpdq_device *>(screen.owner());
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	if (!card->m_screen)
	{
		card->m_screen = &screen;
		card->m_timer->adjust(card->m_screen->time_until_pos(843, 0), 0);
	}
	vram = card->m_vram + 0x9000;

	switch (card->m_mode)
	{
		case 0: // 1 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 1152/8; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = card->m_palette[(pixels&0x80)];
					*scanline++ = card->m_palette[((pixels<<1)&0x80)];
					*scanline++ = card->m_palette[((pixels<<2)&0x80)];
					*scanline++ = card->m_palette[((pixels<<3)&0x80)];
					*scanline++ = card->m_palette[((pixels<<4)&0x80)];
					*scanline++ = card->m_palette[((pixels<<5)&0x80)];
					*scanline++ = card->m_palette[((pixels<<6)&0x80)];
					*scanline++ = card->m_palette[((pixels<<7)&0x80)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 1152/4; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = card->m_palette[(pixels&0xc0)];
					*scanline++ = card->m_palette[((pixels<<2)&0xc0)];
					*scanline++ = card->m_palette[((pixels<<4)&0xc0)];
					*scanline++ = card->m_palette[((pixels<<6)&0xc0)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 1152/2; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];

					*scanline++ = card->m_palette[(pixels&0xf0)];
					*scanline++ = card->m_palette[((pixels<<4)&0xf0)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 844; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 1152; x++)
				{
					pixels = vram[(y * 1152) + (BYTE4_XOR_BE(x))];
					*scanline++ = card->m_palette[pixels];
				}
			}
			break;

		default:
			fatalerror("specpdq: unknown video mode %d", card->m_mode);
			break;

	}
	return 0;
}
Beispiel #25
0
UINT32 nubus_m2hires_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	UINT32 *scanline;
	int x, y;
	UINT8 pixels, *vram;

	// first time?  kick off the VBL timer
	if (!m_screen)
	{
		m_screen = &screen;
		m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
	}

	vram = m_vram + 0x20;

	switch (m_mode)
	{
		case 0: // 1 bpp?
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/8; x++)
				{
					pixels = vram[(y * 128) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>7)&0x1)];
					*scanline++ = m_palette[((pixels>>6)&0x1)];
					*scanline++ = m_palette[((pixels>>5)&0x1)];
					*scanline++ = m_palette[((pixels>>4)&0x1)];
					*scanline++ = m_palette[((pixels>>3)&0x1)];
					*scanline++ = m_palette[((pixels>>2)&0x1)];
					*scanline++ = m_palette[((pixels>>1)&0x1)];
					*scanline++ = m_palette[(pixels&1)];
				}
			}
			break;

		case 1: // 2 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);
				for (x = 0; x < 640/4; x++)
				{
					pixels = vram[(y * 256) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels>>6)&3)];
					*scanline++ = m_palette[((pixels>>4)&3)];
					*scanline++ = m_palette[((pixels>>2)&3)];
					*scanline++ = m_palette[(pixels&3)];
				}
			}
			break;

		case 2: // 4 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640/2; x++)
				{
					pixels = vram[(y * 512) + (BYTE4_XOR_BE(x))];

					*scanline++ = m_palette[((pixels&0xf0)>>4)];
					*scanline++ = m_palette[(pixels&0xf)];
				}
			}
			break;

		case 3: // 8 bpp
			for (y = 0; y < 480; y++)
			{
				scanline = &bitmap.pix32(y);

				for (x = 0; x < 640; x++)
				{
					pixels = vram[(y * 1024) + (BYTE4_XOR_BE(x))];
					*scanline++ = m_palette[pixels];
				}
			}
			break;

		default:
			fatalerror("m2hires: unknown video mode %d\n", m_mode);
			break;
	}
	return 0;
}
Beispiel #26
0
/******************************************************************
Function: RomOpen
Purpose:  This function is called when a rom is open. (from the
emulation thread)
input:    none
output:   none
*******************************************************************/
int glide64RomOpen (void)
{
   int i;
   char name[21] = "DEFAULT";

   no_dlist = true;
   romopen = true;
   ucode_error_report = true;	// allowed to report ucode errors
   rdp_reset ();

   /* cxd4 -- Glide64 tries to predict PAL scaling based on the ROM header. */
   region = OS_TV_TYPE_NTSC; /* Invalid region codes are probably NTSC betas. */
   switch (gfx_info.HEADER[BYTE4_XOR_BE(0x3E)])
   {
   case 'A': /* generic NTSC, not documented, used by 1080 Snowboarding */
      region = OS_TV_TYPE_NTSC; break;
   case 'B': /* Brazilian */
      region = OS_TV_TYPE_MPAL; break;
   case 'C': /* Chinese */
      region = OS_TV_TYPE_NTSC; break;
   case 'D': /* German */
      region = OS_TV_TYPE_PAL ; break;
   case 'E': /* North America */
      region = OS_TV_TYPE_NTSC; break;
   case 'F': /* French */
      region = OS_TV_TYPE_PAL ; break;
   case 'G': /* Gateway 64 (NTSC) */
      region = OS_TV_TYPE_NTSC; break;
   case 'H': /* Dutch */
      region = OS_TV_TYPE_PAL ; break;
   case 'I': /* Italian */
      region = OS_TV_TYPE_PAL ; break;
   case 'J': /* Japanese */
      region = OS_TV_TYPE_NTSC; break;
   case 'K': /* Korean */
      region = OS_TV_TYPE_NTSC; break;
   case 'L': /* Gateway 64 (PAL) */
      region = OS_TV_TYPE_PAL ; break;
   case 'N': /* Canadian */
      region = OS_TV_TYPE_NTSC; break;
   case 'P': /* European (basic spec.) */
      region = OS_TV_TYPE_PAL ; break;
   case 'S': /* Spanish */
      region = OS_TV_TYPE_PAL ; break;
   case 'U': /* Australian */
      region = OS_TV_TYPE_PAL ; break;
   case 'W': /* Scandinavian */
      region = OS_TV_TYPE_PAL ; break;
   case 'X': case 'Y': case 'Z': /* documented "others", always PAL I think? */
      region = OS_TV_TYPE_PAL ; break;
   }

   ReadSpecialSettings (name);

   // get the name of the ROM
   for (i = 0; i < 20; i++)
      name[i] = gfx_info.HEADER[(32+i)^3];
   name[20] = 0;

   // remove all trailing spaces
   while (name[strlen(name)-1] == ' ')
      name[strlen(name)-1] = 0;

   strncpy(rdp.RomName, name, sizeof(name));
   ReadSpecialSettings (name);
   ClearCache ();

   CheckDRAMSize();

   OPEN_RDP_LOG ();
   OPEN_RDP_E_LOG ();

   glide64InitGfx ();
   rdp_setfuncs();

   // **
   return true;
}