Confirmed that video register [1] controls upper color bank (fixes Mazer Blazer CRT test). Upcoming: device-ify custom VCU

This commit is contained in:
Angelo Salese 2013-10-31 13:56:53 +00:00
parent bebebc00c8
commit aa6def709e
6 changed files with 208 additions and 8 deletions

2
.gitattributes vendored
View File

@ -2476,6 +2476,8 @@ src/emu/video/m50458.c svneol=native#text/plain
src/emu/video/m50458.h svneol=native#text/plain
src/emu/video/mb90082.c svneol=native#text/plain
src/emu/video/mb90082.h svneol=native#text/plain
src/emu/video/mb_vcu.c svneol=native#text/plain
src/emu/video/mb_vcu.h svneol=native#text/plain
src/emu/video/mc6845.c svneol=native#text/plain
src/emu/video/mc6845.h svneol=native#text/plain
src/emu/video/mc6847.c svneol=native#text/plain

115
src/emu/video/mb_vcu.c Normal file
View File

@ -0,0 +1,115 @@
// license: ?
// copyright-holders: Angelo Salese
/***************************************************************************
Device for Mazer Blazer/Great Guns custom Video Controller Unit
***************************************************************************/
#include "emu.h"
#include "video/mb_vcu.h"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
// device type definition
const device_type MB_VCU = &device_creator<mb_vcu_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// mb_vcu_device - constructor
//-------------------------------------------------
mb_vcu_device::mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, MB_VCU, "Mazer Blazer custom VCU", tag, owner, clock, "mb_vcu", __FILE__),
device_video_interface(mconfig, *this)
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void mb_vcu_device::device_config_complete()
{
// inherit a copy of the static data
const mb_vcu_interface *intf = reinterpret_cast<const mb_vcu_interface *>(static_config());
if (intf != NULL)
{
*static_cast<mb_vcu_interface *>(this) = *intf;
}
// or initialize to defaults if none provided
else
{
m_cpu_tag = NULL;
}
}
//-------------------------------------------------
// device_validity_check - perform validity checks
// on this device
//-------------------------------------------------
void mb_vcu_device::device_validity_check(validity_checker &valid) const
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void mb_vcu_device::device_start()
{
if(m_cpu_tag)
{
m_cpu = machine().device(m_cpu_tag);
}
else
{
m_cpu = NULL;
}
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void mb_vcu_device::device_reset()
{
}
//**************************************************************************
// READ/WRITE HANDLERS
//**************************************************************************
READ8_MEMBER( mb_vcu_device::read )
{
return 0;
}
WRITE8_MEMBER( mb_vcu_device::write )
{
}
//-------------------------------------------------
// update_screen -
//-------------------------------------------------
UINT32 mb_vcu_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
return 0;
}

74
src/emu/video/mb_vcu.h Normal file
View File

@ -0,0 +1,74 @@
// license: ?
// copyright-holders: Angelo Salese
/***************************************************************************
Template for skeleton device
***************************************************************************/
#pragma once
#ifndef __MB_VCUDEV_H__
#define __MB_VCUDEV_H__
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_MB_VCU_ADD(_tag,_freq,_config) \
MCFG_DEVICE_ADD(_tag, MB_VCU, _freq) \
MCFG_DEVICE_CONFIG(_config)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> mb_vcu_interface
struct mb_vcu_interface
{
const char *m_cpu_tag;
};
// ======================> mb_vcu_device
class mb_vcu_device : public device_t,
public device_video_interface,
public mb_vcu_interface
{
public:
// construction/destruction
mb_vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// I/O operations
DECLARE_WRITE8_MEMBER( write );
DECLARE_READ8_MEMBER( read );
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_validity_check(validity_checker &valid) const;
virtual void device_start();
virtual void device_reset();
private:
device_t *m_cpu;
};
// device type definition
extern const device_type MB_VCU;
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
#endif

View File

@ -268,6 +268,15 @@ ifneq ($(filter MB90082,$(VIDEOS)),)
VIDEOOBJS+= $(VIDEOOBJ)/mb90082.o
endif
#-------------------------------------------------
#
#@src/emu/video/mb_vcu.h,VIDEOS += MB_VCU
#-------------------------------------------------
ifneq ($(filter MB_VCU,$(VIDEOS)),)
VIDEOOBJS+= $(VIDEOOBJ)/mb_vcu.o
endif
#-------------------------------------------------
#
#@src/emu/video/mc6845.h,VIDEOS += MC6845

View File

@ -109,6 +109,9 @@ master z80
[0x0021]: clears i/o at 0x6a (lamps), clears 0xe563, 0xe004, 0xe000, 0xe001, 0xe007, 0xe002, 0xe003, 0xe005,
0xc04f, 0xe572, enables IM 2, clears 0xe581 / 0xe583 (word), puts default initials (0x2274->0xe058)
video z80
[0x535]:
[0x03c]: start of proper code
****************************************************************************/
@ -491,7 +494,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_cmd_param_r)
m_plane = m_mode & 3;
return 0;
return machine().rand();
}
@ -503,11 +506,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
int bits = 0;
UINT8 color_base = 0;
if (m_game_id == MAZERBLA)
color_base = 0x80; /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */
if (m_game_id == GREATGUN)
color_base = 0x00; /* 0x00 - good for Great Guns: (both in game and CRT test mode) */
color_base = m_vcu_video_reg[1] << 4;
// if ((mode <= 0x07) || (mode >= 0x10))
/*
@ -660,7 +659,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
break;
}
return 0;
return machine().rand();
}
READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r)
@ -853,7 +852,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r)
break;
}
return 0;
return machine().rand();
}
/*************************************

View File

@ -298,6 +298,7 @@ VIDEOS += I8275
VIDEOS += K053250
VIDEOS += M50458
VIDEOS += MB90082
VIDEOS += MB_VCU
VIDEOS += MC6845
#VIDEOS += MC6847
#VIDEOS += MSM6255