(MESS) cbm2: Added skeleton for CBM-II high resolution cartridge. (nw)

This commit is contained in:
Curt Coder 2012-09-25 14:55:28 +00:00
parent ac17372427
commit 52669bc922
7 changed files with 290 additions and 0 deletions

2
.gitattributes vendored
View file

@ -6622,6 +6622,8 @@ src/mess/machine/c65.c svneol=native#text/plain
src/mess/machine/c8280.c svneol=native#text/plain
src/mess/machine/c8280.h svneol=native#text/plain
src/mess/machine/cbm.c svneol=native#text/plain
src/mess/machine/cbm2_graphic.c svneol=native#text/plain
src/mess/machine/cbm2_graphic.h svneol=native#text/plain
src/mess/machine/cbm2_std.c svneol=native#text/plain
src/mess/machine/cbm2_std.h svneol=native#text/plain
src/mess/machine/cbm2exp.c svneol=native#text/plain

View file

@ -88,4 +88,18 @@
</part>
</software>
<software name="graphic">
<description>High Resolution Graphics</description>
<year>198?</year>
<publisher>Commodore</publisher>
<part name="cart" interface="cbm2_cart">
<feature name="slot" value="graphic" />
<dataarea name="bank3" size="0x2000">
<rom name="324688-01.bin" size="0x2000" crc="863e9ef8" sha1="d75ffa97b2dd4e1baefe4acaa130daae866ab0e8" offset="0" />
</dataarea>
</part>
</software>
</softwarelist>

View file

@ -0,0 +1,206 @@
/**********************************************************************
CBM 500/600/700 High Resolution Graphics cartridge emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
/*
TODO:
- version A (EF9365, 512x512 interlaced, 1 page)
- version B (EF9366, 512x256 non-interlaced, 2 pages)
*/
#include "cbm2_graphic.h"
//**************************************************************************
// MACROS/CONSTANTS
//**************************************************************************
#define EF9365_TAG "ef9365"
#define EF9366_TAG "ef9366"
#define SCREEN_TAG "screen"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type CBM2_GRAPHIC = &device_creator<cbm2_graphic_cartridge_device>;
//-------------------------------------------------
// ef9345_interface gdp_intf
//-------------------------------------------------
static const ef9345_interface gdp_intf =
{
SCREEN_TAG
};
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( cbm2_graphic_a )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( cbm2_graphic_a )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DEVICE(EF9365_TAG, ef9345_device, screen_update)
MCFG_SCREEN_SIZE(512, 512)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 512-1)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_EF9345_ADD(EF9365_TAG, gdp_intf)
MACHINE_CONFIG_END
//-------------------------------------------------
// MACHINE_CONFIG_FRAGMENT( cbm2_graphic_b )
//-------------------------------------------------
static MACHINE_CONFIG_FRAGMENT( cbm2_graphic_b )
MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
MCFG_SCREEN_UPDATE_DEVICE(EF9366_TAG, ef9345_device, screen_update)
MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
MCFG_SCREEN_REFRESH_RATE(50)
MCFG_EF9345_ADD(EF9366_TAG, gdp_intf)
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor cbm2_graphic_cartridge_device::device_mconfig_additions() const
{
switch (m_variant)
{
default: return MACHINE_CONFIG_NAME( cbm2_graphic_a );
case TYPE_B: return MACHINE_CONFIG_NAME( cbm2_graphic_b );
}
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// cbm2_graphic_cartridge_device - constructor
//-------------------------------------------------
cbm2_graphic_cartridge_device::cbm2_graphic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, CBM2_GRAPHIC, "CBM 500/600/700 High Resolution Graphics", tag, owner, clock),
device_cbm2_expansion_card_interface(mconfig, *this),
m_gdc(*this, EF9365_TAG),
m_variant(TYPE_A)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void cbm2_graphic_cartridge_device::device_start()
{
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void cbm2_graphic_cartridge_device::device_reset()
{
}
//-------------------------------------------------
// cbm2_bd_r - cartridge data read
//-------------------------------------------------
UINT8 cbm2_graphic_cartridge_device::cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3)
{
if (!csbank3)
{
if (offset < 0x7f80)
{
data = m_bank3[offset & m_bank1_mask];
}
else if (offset == 0x7f90)
{
/*
bit description
0 light pen
1
2
3
4
5
6
7
*/
}
else if (offset == 0x7fb0)
{
// hard copy
}
else if (offset >= 0x7ff0)
{
data = m_gdc->data_r(space, offset & 0x07);
}
}
return data;
}
//-------------------------------------------------
// cbm2_bd_w - cartridge data write
//-------------------------------------------------
void cbm2_graphic_cartridge_device::cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3)
{
if (!csbank3)
{
if (offset == 0x7f80)
{
/*
bit description
0 hard copy (0=active)
1 operating page select (version B)
2
3 read-modify-write (1=active)
4 display switch (1=graphic)
5 display page select (version B)
6
7
*/
}
else if (offset >= 0x7ff0)
{
m_gdc->data_w(space, offset & 0x07, data);
}
}
}

View file

@ -0,0 +1,65 @@
/**********************************************************************
CBM 500/600/700 High Resolution Graphics cartridge emulation
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
**********************************************************************/
#pragma once
#ifndef __CBM2_GRAPHIC__
#define __CBM2_GRAPHIC__
#include "emu.h"
#include "machine/cbm2exp.h"
#include "video/ef9345.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> cbm2_graphic_cartridge_device
class cbm2_graphic_cartridge_device : public device_t,
public device_cbm2_expansion_card_interface
{
public:
// construction/destruction
cbm2_graphic_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
protected:
enum
{
TYPE_A,
TYPE_B
};
// device-level overrides
virtual void device_config_complete() { m_shortname = "cbm2_graphic"; }
virtual void device_start();
virtual void device_reset();
// device_cbm2_expansion_card_interface overrides
virtual UINT8 cbm2_bd_r(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3);
virtual void cbm2_bd_w(address_space &space, offs_t offset, UINT8 data, int csbank1, int csbank2, int csbank3);
private:
required_device<ef9345_device> m_gdc;
int m_variant;
};
// device type definition
extern const device_type CBM2_GRAPHIC;
#endif

View file

@ -1045,6 +1045,7 @@ INPUT_PORTS_END
SLOT_INTERFACE_START( cbm2_expansion_cards )
SLOT_INTERFACE_INTERNAL("standard", CBM2_STD)
SLOT_INTERFACE_INTERNAL("graphic", CBM2_GRAPHIC)
SLOT_INTERFACE_END
SLOT_INTERFACE_START( cbm_datassette_devices )

View file

@ -61,6 +61,7 @@
#include "machine/c64_zaxxon.h"
#include "machine/c128_comal80.h"
#include "machine/cbm2_std.h"
#include "machine/cbm2_graphic.h"
#include "machine/c1541.h"
#include "machine/c1551.h"
#include "machine/c1571.h"

View file

@ -889,6 +889,7 @@ $(MESSOBJ)/cbm.a: \
$(MESS_DRIVERS)/cbm2.o \
$(MESS_MACHINE)/cbm2exp.o \
$(MESS_MACHINE)/cbm2_std.o \
$(MESS_MACHINE)/cbm2_graphic.o \
$(MESS_DRIVERS)/c65.o \
$(MESS_MACHINE)/c65.o \
$(MESS_DRIVERS)/c128.o \