mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
(MESS) Mac: Add support for PDS Sigma Designs L-View card [R. Belmont, Sharkpuncher]
This commit is contained in:
parent
717948cdcb
commit
6104913e57
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -7544,6 +7544,8 @@ src/mess/video/pds30_cb264.c svneol=native#text/plain
|
||||
src/mess/video/pds30_cb264.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
|
||||
src/mess/video/pds30_sigmalview.h svneol=native#text/plain
|
||||
src/mess/video/pecom.c svneol=native#text/plain
|
||||
src/mess/video/pet.c svneol=native#text/plain
|
||||
src/mess/video/pk8020.c svneol=native#text/plain
|
||||
|
@ -71,6 +71,7 @@
|
||||
#include "video/nubus_m2video.h"
|
||||
#include "video/pds30_cb264.h"
|
||||
#include "video/pds30_procolor816.h"
|
||||
#include "video/pds30_sigmalview.h"
|
||||
#include "includes/mac.h"
|
||||
#include "mac.lh"
|
||||
|
||||
@ -863,6 +864,7 @@ SLOT_INTERFACE_END
|
||||
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_END
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -710,6 +710,7 @@ $(MESSOBJ)/apple.a: \
|
||||
$(MESS_VIDEO)/nubus_wsportrait.o \
|
||||
$(MESS_VIDEO)/pds30_cb264.o \
|
||||
$(MESS_VIDEO)/pds30_procolor816.o \
|
||||
$(MESS_VIDEO)/pds30_sigmalview.o \
|
||||
|
||||
$(MESSOBJ)/applied.a: \
|
||||
$(MESS_VIDEO)/mbee.o \
|
||||
|
217
src/mess/video/pds30_sigmalview.c
Normal file
217
src/mess/video/pds30_sigmalview.c
Normal file
@ -0,0 +1,217 @@
|
||||
/***************************************************************************
|
||||
|
||||
Sigma Designs L-View card
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "video/pds30_sigmalview.h"
|
||||
|
||||
#define LVIEW_SCREEN_NAME "lview_screen"
|
||||
#define LVIEW_ROM_REGION "lview_rom"
|
||||
|
||||
#define VRAM_SIZE (0x80000) // 512K?
|
||||
|
||||
MACHINE_CONFIG_FRAGMENT( lview )
|
||||
MCFG_SCREEN_ADD( LVIEW_SCREEN_NAME, RASTER)
|
||||
MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, nubus_lview_device, screen_update)
|
||||
MCFG_SCREEN_SIZE(832,600)
|
||||
MCFG_SCREEN_REFRESH_RATE(70)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 832-1, 0, 600-1)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START( lview )
|
||||
ROM_REGION(0x4000, LVIEW_ROM_REGION, 0)
|
||||
ROM_LOAD( "lv_asi_4_00.bin", 0x000000, 0x004000, CRC(b806f875) SHA1(1e58593b1a8720193d1651b0d8a0d43e4e47563d) )
|
||||
ROM_END
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
const device_type PDS030_LVIEW = &device_creator<nubus_lview_device>;
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// machine_config_additions - device-specific
|
||||
// machine configurations
|
||||
//-------------------------------------------------
|
||||
|
||||
machine_config_constructor nubus_lview_device::device_mconfig_additions() const
|
||||
{
|
||||
return MACHINE_CONFIG_NAME( lview );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// rom_region - device-specific ROM region
|
||||
//-------------------------------------------------
|
||||
|
||||
const rom_entry *nubus_lview_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( lview );
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// nubus_lview_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
nubus_lview_device::nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
|
||||
device_t(mconfig, PDS030_LVIEW, "Lapis ProColor Server 8*16", tag, owner, clock),
|
||||
device_nubus_card_interface(mconfig, *this)
|
||||
{
|
||||
m_shortname = "pd3_lviw";
|
||||
}
|
||||
|
||||
nubus_lview_device::nubus_lview_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_lviw";
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_lview_device::device_start()
|
||||
{
|
||||
UINT32 slotspace;
|
||||
|
||||
// set_nubus_device makes m_slot valid
|
||||
set_nubus_device();
|
||||
install_declaration_rom(this, LVIEW_ROM_REGION);
|
||||
|
||||
slotspace = get_slotspace();
|
||||
|
||||
// printf("[lview %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_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this));
|
||||
m_nubus->install_device(slotspace+0x900000, slotspace+VRAM_SIZE-1+0x900000, read32_delegate(FUNC(nubus_lview_device::vram_r), this), write32_delegate(FUNC(nubus_lview_device::vram_w), this));
|
||||
m_nubus->install_device(slotspace+0xb0000, slotspace+0xbffff, read32_delegate(FUNC(nubus_lview_device::lview_r), this), write32_delegate(FUNC(nubus_lview_device::lview_w), this));
|
||||
|
||||
m_timer = timer_alloc(0, NULL);
|
||||
m_screen = NULL; // can we look this up now?
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void nubus_lview_device::device_reset()
|
||||
{
|
||||
m_vbl_disable = 1;
|
||||
m_protstate = 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_lview_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(599, 0), 0);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
CB264 section
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
UINT32 nubus_lview_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(599, 0), 0);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_lview_device::lview_r )
|
||||
{
|
||||
UINT32 rv = 0;
|
||||
|
||||
// printf("prot_r: @ %x, mask %08x [PC=%x state %d]\n", offset, mem_mask, machine().device("maincpu")->safe_pc(), m_protstate);
|
||||
|
||||
if ((m_protstate == 1) || (m_protstate == 10) || (machine().device("maincpu")->safe_pc() == 0x5aac))
|
||||
{
|
||||
rv = 0x02020202;
|
||||
}
|
||||
|
||||
if (m_protstate == 8)
|
||||
{
|
||||
rv = 0x01010101;
|
||||
}
|
||||
|
||||
m_protstate++;
|
||||
return rv;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_lview_device::lview_w )
|
||||
{
|
||||
// if (offset != 0x7a && offset != 0x3ffb) printf("prot_w: %08x @ %x, mask %08x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
|
||||
|
||||
if (offset == 0x7a)
|
||||
{
|
||||
if (data == 1)
|
||||
{
|
||||
m_vbl_disable = 0;
|
||||
lower_slot_irq();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_vbl_disable = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WRITE32_MEMBER( nubus_lview_device::vram_w )
|
||||
{
|
||||
COMBINE_DATA(&m_vram32[offset]);
|
||||
}
|
||||
|
||||
READ32_MEMBER( nubus_lview_device::vram_r )
|
||||
{
|
||||
return m_vram32[offset];
|
||||
}
|
54
src/mess/video/pds30_sigmalview.h
Normal file
54
src/mess/video/pds30_sigmalview.h
Normal file
@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef __NUBUS_LVIEW_H__
|
||||
#define __NUBUS_LVIEW_H__
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/nubus.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> nubus_lview_device
|
||||
|
||||
class nubus_lview_device :
|
||||
public device_t,
|
||||
public device_nubus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
nubus_lview_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
nubus_lview_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(lview_r);
|
||||
DECLARE_WRITE32_MEMBER(lview_w);
|
||||
DECLARE_READ32_MEMBER(vram_r);
|
||||
DECLARE_WRITE32_MEMBER(vram_w);
|
||||
|
||||
public:
|
||||
UINT8 *m_vram;
|
||||
UINT32 *m_vram32;
|
||||
UINT32 m_vbl_disable, m_toggle;
|
||||
UINT32 m_palette[256];
|
||||
screen_device *m_screen;
|
||||
emu_timer *m_timer;
|
||||
int m_protstate;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type PDS030_LVIEW;
|
||||
|
||||
#endif /* __NUBUS_LVIEW_H__ */
|
Loading…
Reference in New Issue
Block a user