mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
(MESS) Mac: Preliminary support for Micron XCEED 30HR and MacroColor 30 PDS cards [R. Belmont, Sharkpuncher, Balrog]
This commit is contained in:
parent
01195c47e2
commit
f5d08006f0
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -7554,8 +7554,12 @@ src/mess/video/pc_t1t.h svneol=native#text/plain
|
||||
src/mess/video/pcw.c svneol=native#text/plain
|
||||
src/mess/video/pcw16.c svneol=native#text/plain
|
||||
src/mess/video/pdp1.c svneol=native#text/plain
|
||||
src/mess/video/pds30_30hr.c svneol=native#text/plain
|
||||
src/mess/video/pds30_30hr.h svneol=native#text/plain
|
||||
src/mess/video/pds30_cb264.c svneol=native#text/plain
|
||||
src/mess/video/pds30_cb264.h svneol=native#text/plain
|
||||
src/mess/video/pds30_mc30.c svneol=native#text/plain
|
||||
src/mess/video/pds30_mc30.h svneol=native#text/plain
|
||||
src/mess/video/pds30_procolor816.c svneol=native#text/plain
|
||||
src/mess/video/pds30_procolor816.h svneol=native#text/plain
|
||||
src/mess/video/pds30_sigmalview.c svneol=native#text/plain
|
||||
|
@ -72,6 +72,8 @@
|
||||
#include "video/pds30_cb264.h"
|
||||
#include "video/pds30_procolor816.h"
|
||||
#include "video/pds30_sigmalview.h"
|
||||
#include "video/pds30_30hr.h"
|
||||
#include "video/pds30_mc30.h"
|
||||
#include "includes/mac.h"
|
||||
#include "mac.lh"
|
||||
|
||||
@ -865,6 +867,8 @@ static SLOT_INTERFACE_START(mac_pds030_cards)
|
||||
SLOT_INTERFACE("cb264", PDS030_CB264SE30) // RasterOps Colorboard 264/SE30
|
||||
SLOT_INTERFACE("pc816", PDS030_PROCOLOR816) // Lapis ProColor Server 8*16 PDS
|
||||
SLOT_INTERFACE("lview", PDS030_LVIEW) // Sigma Designs L-View
|
||||
SLOT_INTERFACE("30hr", PDS030_XCEED30HR) // Micron/XCEED Technology Color 30HR
|
||||
SLOT_INTERFACE("mc30", PDS030_XCEEDMC30) // Micron/XCEED Technology MacroColor 30
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -712,6 +712,8 @@ $(MESSOBJ)/apple.a: \
|
||||
$(MESS_VIDEO)/pds30_cb264.o \
|
||||
$(MESS_VIDEO)/pds30_procolor816.o \
|
||||
$(MESS_VIDEO)/pds30_sigmalview.o \
|
||||
$(MESS_VIDEO)/pds30_30hr.o \
|
||||
$(MESS_VIDEO)/pds30_mc30.o \
|
||||
|
||||
$(MESSOBJ)/applied.a: \
|
||||
$(MESS_VIDEO)/mbee.o \
|
||||
|
321
src/mess/video/pds30_30hr.c
Normal file
321
src/mess/video/pds30_30hr.c
Normal file
@ -0,0 +1,321 @@
|
||||
/***************************************************************************
|
||||
|
||||
Micron/XCEED Technologies Color 30HR
|
||||
|
||||
Fs800000 - Mode A
|
||||
FsA00000 - Mode B
|
||||
FsC00000 - RAMDAC write offset
|
||||
FsC00004 - RAMDAC write data
|
||||
FsC00008 - RAMDAC write mask
|
||||
FsC0000C - RAMDAC read offset
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/pds30_30hr.h"
|
||||
|
||||
#define XCEED30HR_SCREEN_NAME "x30hr_screen"
|
||||
#define XCEED30HR_ROM_REGION "x30hr_rom"
|
||||
|
||||
#define VRAM_SIZE (0x100000) // 1 MB VRAM - max mode is 1024x768 @ 8bpp
|
||||
|
||||
MACHINE_CONFIG_FRAGMENT( xceed30hr )
|
||||
MCFG_SCREEN_ADD( XCEED30HR_SCREEN_NAME, RASTER)
|
||||
MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceed30hr_device, screen_update)
|
||||
MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
|
||||
MCFG_SCREEN_SIZE(1024,768)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START( xceed30hr )
|
||||
ROM_REGION(0x8000, XCEED30HR_ROM_REGION, 0)
|
||||
ROM_LOAD( "369c.rom", 0x000000, 0x008000, CRC(b22f0a89) SHA1(be34c8604b8a1ae9c9f3b0b90faba9a1a64a5855) )
|
||||
ROM_END
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
const device_type PDS030_XCEED30HR = &device_creator<nubus_xceed30hr_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor nubus_xceed30hr_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( xceed30hr );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
const rom_entry *nubus_xceed30hr_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( xceed30hr );
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// nubus_xceed30hr_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, PDS030_XCEED30HR, "Micron/XCEED Technology Color 30HR", tag, owner, clock),
|
||||
device_nubus_card_interface(mconfig, *this)
|
||||
{
|
||||
m_shortname = "pd3_30hr";
|
||||
}
|
||||
|
||||
nubus_xceed30hr_device::nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, type, name, tag, owner, clock),
|
||||
device_nubus_card_interface(mconfig, *this)
|
||||
{
|
||||
m_shortname = "pd3_30hr";
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_xceed30hr_device::device_start()
|
||||
{
|
||||
UINT32 slotspace;
|
||||
|
||||
// set_nubus_device makes m_slot valid
|
||||
set_nubus_device();
|
||||
install_declaration_rom(this, XCEED30HR_ROM_REGION);
|
||||
|
||||
slotspace = get_slotspace();
|
||||
|
||||
// printf("[xceed30hr %p] slotspace = %x\n", this, slotspace);
|
||||
|
||||
m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
|
||||
m_vram32 = (UINT32 *)m_vram;
|
||||
|
||||
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceed30hr_device::vram_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::vram_w), this));
|
||||
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_r), this), write32_delegate(FUNC(nubus_xceed30hr_device::xceed30hr_w), this));
|
||||
|
||||
m_timer = timer_alloc(0, NULL);
|
||||
m_screen = NULL; // can we look this up now?
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_xceed30hr_device::device_reset()
|
||||
{
|
||||
m_count = 0;
|
||||
m_clutoffs = 0;
|
||||
m_vbl_disable = 1;
|
||||
m_mode = 0;
|
||||
memset(m_vram, 0, VRAM_SIZE);
|
||||
memset(m_palette, 0, sizeof(m_palette));
|
||||
|
||||
m_palette[0] = MAKE_RGB(255, 255, 255);
|
||||
m_palette[0x80] = MAKE_RGB(0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void nubus_xceed30hr_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
|
||||
{
|
||||
if (!m_vbl_disable)
|
||||
{
|
||||
raise_slot_irq();
|
||||
}
|
||||
|
||||
m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
CB264 section
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
UINT32 nubus_xceed30hr_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 + 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;
|
||||
|
||||
default:
|
||||
fatalerror("xceed30hr: unknown video mode %d\n", m_mode);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_xceed30hr_device::xceed30hr_w )
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x80000: // mode
|
||||
switch (data & 0xff000000)
|
||||
{
|
||||
case 0xfc000000:
|
||||
m_mode = 0;
|
||||
break;
|
||||
|
||||
case 0xfd000000:
|
||||
m_mode = 1;
|
||||
break;
|
||||
|
||||
case 0xfe000000:
|
||||
m_mode = 2;
|
||||
break;
|
||||
|
||||
case 0xff000000:
|
||||
m_mode = 3;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x80005: // ack VBL
|
||||
lower_slot_irq();
|
||||
break;
|
||||
|
||||
case 0x100000:
|
||||
// printf("%08x to DAC control (PC=%x)\n", data, space.device().safe_pc());
|
||||
m_clutoffs = (data&0xff);
|
||||
m_count = 0;
|
||||
break;
|
||||
|
||||
case 0x100001:
|
||||
// printf("%08x to DAC data (PC=%x)\n", data, space.device().safe_pc());
|
||||
m_colors[m_count++] = (data & 0xff);
|
||||
|
||||
if (m_count == 3)
|
||||
{
|
||||
// printf("RAMDAC: color %02x = %02x %02x %02x (PC=%x)\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], space.device().safe_pc() );
|
||||
m_palette[m_clutoffs] = MAKE_RGB(m_colors[0], m_colors[1], m_colors[2]);
|
||||
m_clutoffs++;
|
||||
if (m_clutoffs > 255)
|
||||
{
|
||||
m_clutoffs = 0;
|
||||
}
|
||||
m_count = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x100002: // VBL control
|
||||
if (data & 0x06000000)
|
||||
{
|
||||
m_vbl_disable = 0;
|
||||
lower_slot_irq();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vbl_disable = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("xceed30hr_w: %08x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_xceed30hr_device::xceed30hr_r )
|
||||
{
|
||||
// printf("xceed30hr_r: @ %x, mask %08x [PC=%x]\n", offset, mem_mask, machine().device("maincpu")->safe_pc());
|
||||
if (offset == 0x80008)
|
||||
{
|
||||
m_toggle ^= 0x80;
|
||||
return m_toggle | 0x33333333;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_xceed30hr_device::vram_w )
|
||||
{
|
||||
COMBINE_DATA(&m_vram32[offset]);
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_xceed30hr_device::vram_r )
|
||||
{
|
||||
return m_vram32[offset];
|
||||
}
|
53
src/mess/video/pds30_30hr.h
Normal file
53
src/mess/video/pds30_30hr.h
Normal file
@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __NUBUS_XCEED30HR_H__
|
||||
#define __NUBUS_XCEED30HR_H__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/nubus.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> nubus_xceed30hr_device
|
||||
|
||||
class nubus_xceed30hr_device :
|
||||
public device_t,
|
||||
public device_nubus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nubus_xceed30hr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
nubus_xceed30hr_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
DECLARE_READ32_MEMBER(xceed30hr_r);
|
||||
DECLARE_WRITE32_MEMBER(xceed30hr_w);
|
||||
DECLARE_READ32_MEMBER(vram_r);
|
||||
DECLARE_WRITE32_MEMBER(vram_w);
|
||||
|
||||
public:
|
||||
UINT8 *m_vram;
|
||||
UINT32 *m_vram32;
|
||||
UINT32 m_mode, m_vbl_disable, m_toggle;
|
||||
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
|
||||
screen_device *m_screen;
|
||||
emu_timer *m_timer;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type PDS030_XCEED30HR;
|
||||
|
||||
#endif /* __NUBUS_XCEED30HR_H__ */
|
338
src/mess/video/pds30_mc30.c
Normal file
338
src/mess/video/pds30_mc30.c
Normal file
@ -0,0 +1,338 @@
|
||||
/***************************************************************************
|
||||
|
||||
Micron/XCEED Technologies MacroColor 30
|
||||
|
||||
Similar to the 30HR, but registers are rearranged and 24bpp support
|
||||
was added.
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/pds30_mc30.h"
|
||||
|
||||
#define XCEEDMC30_SCREEN_NAME "x30hr_screen"
|
||||
#define XCEEDMC30_ROM_REGION "x30hr_rom"
|
||||
|
||||
#define VRAM_SIZE (0x200000) // 16 42C4256 256Kx4 VRAMs on the board = 2MB
|
||||
|
||||
MACHINE_CONFIG_FRAGMENT( xceedmc30 )
|
||||
MCFG_SCREEN_ADD( XCEEDMC30_SCREEN_NAME, RASTER)
|
||||
MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_xceedmc30_device, screen_update)
|
||||
MCFG_SCREEN_RAW_PARAMS(25175000, 800, 0, 640, 525, 0, 480)
|
||||
MCFG_SCREEN_SIZE(1024,768)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START( xceedmc30 )
|
||||
ROM_REGION(0x8000, XCEEDMC30_ROM_REGION, 0)
|
||||
ROM_LOAD( "0390.bin", 0x000000, 0x008000, CRC(adea7a18) SHA1(9141eb1a0e5061e0409d65a89b4eaeb119ee4ffb) )
|
||||
ROM_END
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
const device_type PDS030_XCEEDMC30 = &device_creator<nubus_xceedmc30_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor nubus_xceedmc30_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( xceedmc30 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
const rom_entry *nubus_xceedmc30_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( xceedmc30 );
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// nubus_xceedmc30_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, PDS030_XCEEDMC30, "Micron/XCEED Technology MacroColor 30", tag, owner, clock),
|
||||
device_nubus_card_interface(mconfig, *this)
|
||||
{
|
||||
m_shortname = "pd3_mclr";
|
||||
}
|
||||
|
||||
nubus_xceedmc30_device::nubus_xceedmc30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, type, name, tag, owner, clock),
|
||||
device_nubus_card_interface(mconfig, *this)
|
||||
{
|
||||
m_shortname = "pd3_mclr";
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_xceedmc30_device::device_start()
|
||||
{
|
||||
UINT32 slotspace;
|
||||
|
||||
// set_nubus_device makes m_slot valid
|
||||
set_nubus_device();
|
||||
install_declaration_rom(this, XCEEDMC30_ROM_REGION);
|
||||
|
||||
slotspace = get_slotspace();
|
||||
|
||||
// printf("[xceedmc30 %p] slotspace = %x\n", this, slotspace);
|
||||
|
||||
m_vram = auto_alloc_array(machine(), UINT8, VRAM_SIZE);
|
||||
m_vram32 = (UINT32 *)m_vram;
|
||||
|
||||
m_nubus->install_device(slotspace, slotspace+VRAM_SIZE-1, read32_delegate(FUNC(nubus_xceedmc30_device::vram_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::vram_w), this));
|
||||
m_nubus->install_device(slotspace+0x800000, slotspace+0xefffff, read32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_r), this), write32_delegate(FUNC(nubus_xceedmc30_device::xceedmc30_w), this));
|
||||
|
||||
m_timer = timer_alloc(0, NULL);
|
||||
m_screen = NULL; // can we look this up now?
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_xceedmc30_device::device_reset()
|
||||
{
|
||||
m_count = 0;
|
||||
m_clutoffs = 0;
|
||||
m_vbl_disable = 1;
|
||||
m_mode = 0;
|
||||
memset(m_vram, 0, VRAM_SIZE);
|
||||
memset(m_palette, 0, sizeof(m_palette));
|
||||
|
||||
m_palette[0] = MAKE_RGB(255, 255, 255);
|
||||
m_palette[0x80] = MAKE_RGB(0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void nubus_xceedmc30_device::device_timer(emu_timer &timer, device_timer_id tid, int param, void *ptr)
|
||||
{
|
||||
if (!m_vbl_disable)
|
||||
{
|
||||
raise_slot_irq();
|
||||
}
|
||||
|
||||
m_timer->adjust(m_screen->time_until_pos(479, 0), 0);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
CB264 section
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
UINT32 nubus_xceedmc30_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 + (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;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_xceedmc30_device::xceedmc30_w )
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x80000: // mode
|
||||
switch (data & 0xff000000)
|
||||
{
|
||||
case 0xfb000000:
|
||||
m_mode = 0;
|
||||
break;
|
||||
|
||||
case 0xfa000000:
|
||||
m_mode = 1;
|
||||
break;
|
||||
|
||||
case 0xf9000000:
|
||||
m_mode = 2;
|
||||
break;
|
||||
|
||||
case 0xf8000000:
|
||||
m_mode = 3;
|
||||
break;
|
||||
|
||||
case 0xff000000:
|
||||
m_mode = 4;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x80005: // ack VBL
|
||||
lower_slot_irq();
|
||||
break;
|
||||
|
||||
case 0x100000:
|
||||
// printf("%08x to DAC control (PC=%x)\n", data, space.device().safe_pc());
|
||||
m_clutoffs = (data&0xff);
|
||||
m_count = 0;
|
||||
break;
|
||||
|
||||
case 0x100001:
|
||||
// printf("%08x to DAC data (PC=%x)\n", data, space.device().safe_pc());
|
||||
m_colors[m_count++] = ((data>>24) & 0xff);
|
||||
|
||||
if (m_count == 3)
|
||||
{
|
||||
// printf("RAMDAC: color %02x = %02x %02x %02x (PC=%x)\n", m_clutoffs, m_colors[0], m_colors[1], m_colors[2], space.device().safe_pc() );
|
||||
m_palette[m_clutoffs] = MAKE_RGB(m_colors[0], m_colors[1], m_colors[2]);
|
||||
m_clutoffs++;
|
||||
if (m_clutoffs > 255)
|
||||
{
|
||||
m_clutoffs = 0;
|
||||
}
|
||||
m_count = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x80002: // VBL control
|
||||
if (data == 0xdcef0000)
|
||||
{
|
||||
m_vbl_disable = 0;
|
||||
lower_slot_irq();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vbl_disable = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// printf("xceedmc30_w: %08x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_xceedmc30_device::xceedmc30_r )
|
||||
{
|
||||
// printf("xceedmc30_r: @ %x, mask %08x [PC=%x]\n", offset, mem_mask, machine().device("maincpu")->safe_pc());
|
||||
if (offset == 0x80008)
|
||||
{
|
||||
m_toggle ^= 0x04;
|
||||
return m_toggle;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_xceedmc30_device::vram_w )
|
||||
{
|
||||
COMBINE_DATA(&m_vram32[offset]);
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_xceedmc30_device::vram_r )
|
||||
{
|
||||
return m_vram32[offset];
|
||||
}
|
53
src/mess/video/pds30_mc30.h
Normal file
53
src/mess/video/pds30_mc30.h
Normal file
@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __NUBUS_XCEEDMC30_H__
|
||||
#define __NUBUS_XCEEDMC30_H__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/nubus.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> nubus_xceedmc30_device
|
||||
|
||||
class nubus_xceedmc30_device :
|
||||
public device_t,
|
||||
public device_nubus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nubus_xceedmc30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
nubus_xceedmc30_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const;
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
|
||||
|
||||
DECLARE_READ32_MEMBER(xceedmc30_r);
|
||||
DECLARE_WRITE32_MEMBER(xceedmc30_w);
|
||||
DECLARE_READ32_MEMBER(vram_r);
|
||||
DECLARE_WRITE32_MEMBER(vram_w);
|
||||
|
||||
public:
|
||||
UINT8 *m_vram;
|
||||
UINT32 *m_vram32;
|
||||
UINT32 m_mode, m_vbl_disable, m_toggle;
|
||||
UINT32 m_palette[256], m_colors[3], m_count, m_clutoffs;
|
||||
screen_device *m_screen;
|
||||
emu_timer *m_timer;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type PDS030_XCEEDMC30;
|
||||
|
||||
#endif /* __NUBUS_XCEEDMC30_H__ */
|
Loading…
Reference in New Issue
Block a user