converted realpunc to use the modern hd63484 device. (nw)

This commit is contained in:
Sandro Ronco 2016-05-07 22:40:20 +02:00
parent 1b4909f77c
commit ca1f47b52d
5 changed files with 22 additions and 17 deletions

View File

@ -32,6 +32,7 @@ h63484_device::h63484_device(const machine_config &mconfig, const char *tag, dev
: device_t(mconfig, H63484, "HD63484 CRTC", tag, owner, clock, "hd63484", __FILE__),
device_memory_interface(mconfig, *this),
device_video_interface(mconfig, *this),
m_auto_configure_screen(true),
m_ar(0),
m_sr(0),
m_fifo_ptr(-1),
@ -510,7 +511,7 @@ inline void h63484_device::dequeue_r(UINT8 *data)
inline void h63484_device::recompute_parameters()
{
if(m_hdw < 3 || m_hc == 0 || m_vc == 0) //bail out if screen params aren't valid
if(!m_auto_configure_screen || m_hdw < 3 || m_hc == 0 || m_vc == 0) //bail out if screen params aren't valid
return;
if (LOG)
@ -882,8 +883,8 @@ void h63484_device::paint(INT16 sx, INT16 sy)
limit = false;
}
if (limit) break;
}
if (limit) break;
}
}
UINT16 h63484_device::command_rpr_exec()

View File

@ -33,6 +33,9 @@ typedef device_delegate<void (bitmap_ind16 &bitmap, const rectangle &cliprect, i
#define MCFG_H63484_DISPLAY_CALLBACK_OWNER(_class, _method) \
h63484_device::static_set_display_callback(*device, h63484_display_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner)));
#define MCFG_H63484_AUTO_CONFIGURE_SCREEN(_val) \
h63484_device::static_set_auto_configure_screen(*device, _val);
#define H63484_DISPLAY_PIXELS_MEMBER(_name) void _name(bitmap_ind16 &bitmap, const rectangle &cliprect, int y, int x, UINT16 data)
@ -47,6 +50,7 @@ public:
h63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
static void static_set_display_callback(device_t &device, h63484_display_delegate callback) { downcast<h63484_device &>(device).m_display_cb = callback; }
static void static_set_auto_configure_screen(device_t &device, bool auto_configure_screen) { downcast<h63484_device &>(device).m_auto_configure_screen = auto_configure_screen; }
DECLARE_WRITE16_MEMBER( address_w );
DECLARE_WRITE16_MEMBER( data_w );
@ -113,6 +117,7 @@ private:
void register_save_state();
h63484_display_delegate m_display_cb;
bool m_auto_configure_screen;
UINT8 m_ar;
UINT8 m_vreg[0x100];

View File

@ -187,7 +187,6 @@ TODO!
#include "sound/2203intf.h"
#include "sound/2610intf.h"
#include "sound/okim6295.h"
#include "video/hd63484.h"
#include "includes/taito_b.h"
WRITE8_MEMBER(taitob_state::bankswitch_w)
@ -687,12 +686,16 @@ static ADDRESS_MAP_START( realpunc_map, AS_PROGRAM, 16, taitob_state )
AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w)
TC0180VCU_MEMRW( 0x200000 )
AM_RANGE(0x280000, 0x281fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE("hd63484", h63484_device, status_r, address_w)
AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE("hd63484", h63484_device, data_r, data_w)
// AM_RANGE(0x320000, 0x320001) AM_NOP // ?
AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, master_comm_w, 0xff00)
ADDRESS_MAP_END
static ADDRESS_MAP_START( realpunc_hd63484_map, AS_0, 16, taitob_state )
AM_RANGE(0x00000, 0x7ffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( masterw_sound_map, AS_PROGRAM, 8, taitob_state )
AM_RANGE(0x0000, 0x3fff) AM_ROM
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1")
@ -2909,8 +2912,8 @@ static MACHINE_CONFIG_START( realpunc, taitob_state )
MCFG_VIDEO_START_OVERRIDE(taitob_state,realpunc)
// TODO: convert to use H63484 and hook it up properly
MCFG_DEVICE_ADD("hd63484", HD63484, 0)
MCFG_H63484_ADD("hd63484", 0, realpunc_hd63484_map)
MCFG_H63484_AUTO_CONFIGURE_SCREEN(false)
MCFG_DEVICE_ADD("tc0180vcu", TC0180VCU, 0)
MCFG_TC0180VCU_BG_COLORBASE(0xc0)

View File

@ -2,7 +2,7 @@
// copyright-holders:Jarek Burczynski
#include "machine/mb87078.h"
#include "machine/taitoio.h"
#include "video/hd63484.h"
#include "video/h63484.h"
#include "video/tc0180vcu.h"
class taitob_state : public driver_device
@ -64,7 +64,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
device_t *m_ym;
optional_device<hd63484_device> m_hd63484;
optional_device<h63484_device> m_hd63484;
required_device<tc0180vcu_device> m_tc0180vcu;
optional_device<tc0640fio_device> m_tc0640fio;
optional_device<tc0220ioc_device> m_tc0220ioc;

View File

@ -427,19 +427,17 @@ UINT32 taitob_state::screen_update_realpunc(screen_device &screen, bitmap_rgb32
/* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */
if (m_realpunc_video_ctrl & 0x0002)
{
int base = (m_hd63484->regs_r(space, 0xcc/2, 0xffff) << 16) + m_hd63484->regs_r(space, 0xce/2, 0xffff);
int stride = m_hd63484->regs_r(space, 0xca/2, 0xffff);
// scrollx = taitob_scroll[0];
// scrolly = taitob_scroll[1];
m_hd63484->update_screen(screen, *m_realpunc_bitmap, cliprect);
for (y = 0; y <= cliprect.max_y; y++)
{
int addr = base + (y*stride);
for (x = 0; x <= cliprect.max_x; x++)
{
int r, g, b;
UINT16 srcpix = m_hd63484->ram_r(space, addr++, 0xffff);
UINT16 srcpix = m_realpunc_bitmap->pix16(cliprect.min_y + y, cliprect.min_x + x);
r = (BIT(srcpix, 1)) | ((srcpix >> 11) & 0x1e);
g = (BIT(srcpix, 2)) | ((srcpix >> 7) & 0x1e);
@ -448,8 +446,6 @@ UINT32 taitob_state::screen_update_realpunc(screen_device &screen, bitmap_rgb32
if (srcpix)
bitmap.pix32(y, x) = rgb_t(pal5bit(r), pal5bit(g), pal5bit(b));
}
addr += stride;
}
}
/* Draw the 15bpp raw output of the camera ADCs (TODO) */