mirror of
https://github.com/holub/mame
synced 2025-10-06 17:08:28 +03:00
Modernized video/hd63484.c. This should be merged with video/h63484.c. (nw)
This commit is contained in:
parent
d0b6f33658
commit
693948e146
File diff suppressed because it is too large
Load Diff
@ -9,38 +9,81 @@
|
|||||||
#define __HD63484_H__
|
#define __HD63484_H__
|
||||||
|
|
||||||
|
|
||||||
|
/* the on-chip FIFO is 16 bytes long, but we use a larger one to simplify */
|
||||||
|
/* decoding of long commands. Commands can be up to 64KB long... but Shanghai */
|
||||||
|
/* doesn't reach that length. */
|
||||||
|
|
||||||
|
#define FIFO_LENGTH 256
|
||||||
|
#define HD63484_RAM_SIZE 0x100000
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
TYPE DEFINITIONS
|
TYPE DEFINITIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
class hd63484_device : public device_t
|
struct hd63484_interface
|
||||||
|
{
|
||||||
|
int m_skattva_hack;
|
||||||
|
};
|
||||||
|
|
||||||
|
class hd63484_device : public device_t,
|
||||||
|
public hd63484_interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||||
~hd63484_device() { global_free(m_token); }
|
~hd63484_device() {}
|
||||||
|
|
||||||
|
DECLARE_READ16_MEMBER( status_r );
|
||||||
|
DECLARE_WRITE16_MEMBER( address_w );
|
||||||
|
DECLARE_WRITE16_MEMBER( data_w );
|
||||||
|
DECLARE_READ16_MEMBER( data_r );
|
||||||
|
|
||||||
|
DECLARE_READ16_MEMBER( ram_r );
|
||||||
|
DECLARE_READ16_MEMBER( regs_r );
|
||||||
|
DECLARE_WRITE16_MEMBER( ram_w );
|
||||||
|
DECLARE_WRITE16_MEMBER( regs_w );
|
||||||
|
|
||||||
// access to legacy token
|
|
||||||
void *token() const { assert(m_token != NULL); return m_token; }
|
|
||||||
protected:
|
protected:
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual void device_config_complete();
|
virtual void device_config_complete();
|
||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal state
|
// internal state
|
||||||
void *m_token;
|
UINT16 * m_ram;
|
||||||
|
UINT16 m_reg[256/2];
|
||||||
|
|
||||||
|
int m_fifo_counter;
|
||||||
|
UINT16 m_fifo[FIFO_LENGTH];
|
||||||
|
UINT16 m_readfifo;
|
||||||
|
|
||||||
|
UINT16 m_pattern[16];
|
||||||
|
int m_org, m_org_dpd, m_rwp;
|
||||||
|
UINT16 m_cl0, m_cl1, m_ccmp, m_edg, m_mask, m_ppy, m_pzcy, m_ppx, m_pzcx, m_psy, m_psx, m_pey, m_pzy, m_pex, m_pzx, m_xmin, m_ymin, m_xmax, m_ymax, m_rwp_dn;
|
||||||
|
INT16 m_cpx, m_cpy;
|
||||||
|
|
||||||
|
int m_regno;
|
||||||
|
|
||||||
|
void doclr16( int opcode, UINT16 fill, int *dst, INT16 _ax, INT16 _ay );
|
||||||
|
void docpy16( int opcode, int src, int *dst, INT16 _ax, INT16 _ay );
|
||||||
|
int org_first_pixel( int _org_dpd );
|
||||||
|
void dot( int x, int y, int opm, UINT16 color );
|
||||||
|
int get_pixel( int x, int y );
|
||||||
|
int get_pixel_ptn( int x, int y );
|
||||||
|
void agcpy( int opcode, int src_x, int src_y, int dst_x, int dst_y, INT16 _ax, INT16 _ay );
|
||||||
|
void ptn( int opcode, int src_x, int src_y, INT16 _ax, INT16 _ay );
|
||||||
|
void line( INT16 sx, INT16 sy, INT16 ex, INT16 ey, INT16 col );
|
||||||
|
void circle( INT16 sx, INT16 sy, UINT16 r, INT16 col );
|
||||||
|
void paint( int sx, int sy, int col );
|
||||||
|
|
||||||
|
void command_w(UINT16 cmd);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const device_type HD63484;
|
extern const device_type HD63484;
|
||||||
|
|
||||||
|
|
||||||
#define HD63484_RAM_SIZE 0x100000
|
|
||||||
|
|
||||||
struct hd63484_interface
|
|
||||||
{
|
|
||||||
int skattva_hack;
|
|
||||||
};
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
DEVICE CONFIGURATION MACROS
|
DEVICE CONFIGURATION MACROS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
@ -49,19 +92,4 @@ struct hd63484_interface
|
|||||||
MCFG_DEVICE_ADD(_tag, HD63484, 0) \
|
MCFG_DEVICE_ADD(_tag, HD63484, 0) \
|
||||||
MCFG_DEVICE_CONFIG(_interface)
|
MCFG_DEVICE_CONFIG(_interface)
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
DEVICE I/O FUNCTIONS
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
DECLARE_READ16_DEVICE_HANDLER( hd63484_status_r );
|
|
||||||
DECLARE_WRITE16_DEVICE_HANDLER( hd63484_address_w );
|
|
||||||
DECLARE_WRITE16_DEVICE_HANDLER( hd63484_data_w );
|
|
||||||
DECLARE_READ16_DEVICE_HANDLER( hd63484_data_r );
|
|
||||||
|
|
||||||
DECLARE_READ16_DEVICE_HANDLER( hd63484_ram_r );
|
|
||||||
DECLARE_READ16_DEVICE_HANDLER( hd63484_regs_r );
|
|
||||||
DECLARE_WRITE16_DEVICE_HANDLER( hd63484_ram_w );
|
|
||||||
DECLARE_WRITE16_DEVICE_HANDLER( hd63484_regs_w );
|
|
||||||
|
|
||||||
#endif /* __HD63484_H__ */
|
#endif /* __HD63484_H__ */
|
||||||
|
@ -60,8 +60,8 @@ UINT32 segajw_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
|
|||||||
static ADDRESS_MAP_START( segajw_map, AS_PROGRAM, 16, segajw_state )
|
static ADDRESS_MAP_START( segajw_map, AS_PROGRAM, 16, segajw_state )
|
||||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||||
|
|
||||||
// AM_RANGE(0x080000, 0x080001) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
|
// AM_RANGE(0x080000, 0x080001) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
|
||||||
// AM_RANGE(0x080002, 0x080003) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
// AM_RANGE(0x080002, 0x080003) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
|
|
||||||
AM_RANGE(0x1a000e, 0x1a000f) AM_NOP
|
AM_RANGE(0x1a000e, 0x1a000f) AM_NOP
|
||||||
AM_RANGE(0xff0000, 0xffffff) AM_RAM
|
AM_RANGE(0xff0000, 0xffffff) AM_RAM
|
||||||
|
@ -33,7 +33,8 @@ class shanghai_state : public driver_device
|
|||||||
public:
|
public:
|
||||||
shanghai_state(const machine_config &mconfig, device_type type, const char *tag)
|
shanghai_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||||
: driver_device(mconfig, type, tag),
|
: driver_device(mconfig, type, tag),
|
||||||
m_maincpu(*this, "maincpu") { }
|
m_maincpu(*this, "maincpu"),
|
||||||
|
m_hd63484(*this, "hd63484") { }
|
||||||
|
|
||||||
DECLARE_WRITE16_MEMBER(shanghai_coin_w);
|
DECLARE_WRITE16_MEMBER(shanghai_coin_w);
|
||||||
DECLARE_READ16_MEMBER(kothello_hd63484_status_r);
|
DECLARE_READ16_MEMBER(kothello_hd63484_status_r);
|
||||||
@ -42,6 +43,7 @@ public:
|
|||||||
UINT32 screen_update_shanghai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
UINT32 screen_update_shanghai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
INTERRUPT_GEN_MEMBER(shanghai_interrupt);
|
INTERRUPT_GEN_MEMBER(shanghai_interrupt);
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
|
required_device<hd63484_device> m_hd63484;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -81,40 +83,39 @@ void shanghai_state::video_start()
|
|||||||
|
|
||||||
UINT32 shanghai_state::screen_update_shanghai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
UINT32 shanghai_state::screen_update_shanghai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
|
||||||
int x, y, b, src;
|
int x, y, b, src;
|
||||||
|
|
||||||
address_space &space = machine().driver_data()->generic_space();
|
address_space &space = machine().driver_data()->generic_space();
|
||||||
b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
|
b = ((m_hd63484->regs_r(space, 0xcc/2, 0xffff) & 0x000f) << 16) + m_hd63484->regs_r(space, 0xce/2, 0xffff);
|
||||||
for (y = 0; y < 280; y++)
|
for (y = 0; y < 280; y++)
|
||||||
{
|
{
|
||||||
for (x = 0 ; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
|
for (x = 0 ; x < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
|
||||||
{
|
{
|
||||||
b &= (HD63484_RAM_SIZE - 1);
|
b &= (HD63484_RAM_SIZE - 1);
|
||||||
src = hd63484_ram_r(hd63484, space, b, 0xffff);
|
src = m_hd63484->ram_r(space, b, 0xffff);
|
||||||
bitmap.pix16(y, x) = src & 0x00ff;
|
bitmap.pix16(y, x) = src & 0x00ff;
|
||||||
bitmap.pix16(y, x + 1) = (src & 0xff00) >> 8;
|
bitmap.pix16(y, x + 1) = (src & 0xff00) >> 8;
|
||||||
b++;
|
b++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hd63484_regs_r(hd63484, space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
|
if ((m_hd63484->regs_r(space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
|
||||||
{
|
{
|
||||||
int sy = (hd63484_regs_r(hd63484, space, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, space, 0x88/2, 0xffff) >> 8);
|
int sy = (m_hd63484->regs_r(space, 0x94/2, 0xffff) & 0x0fff) - (m_hd63484->regs_r(space, 0x88/2, 0xffff) >> 8);
|
||||||
int h = hd63484_regs_r(hd63484, space, 0x96/2, 0xffff) & 0x0fff;
|
int h = m_hd63484->regs_r(space, 0x96/2, 0xffff) & 0x0fff;
|
||||||
int sx = ((hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, space, 0x84/2, 0xffff) >> 8)) * 4;
|
int sx = ((m_hd63484->regs_r(space, 0x92/2, 0xffff) >> 8) - (m_hd63484->regs_r(space, 0x84/2, 0xffff) >> 8)) * 4;
|
||||||
int w = (hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) & 0xff) * 4;
|
int w = (m_hd63484->regs_r(space, 0x92/2, 0xffff) & 0xff) * 4;
|
||||||
if (sx < 0) sx = 0; // not sure about this (shangha2 title screen)
|
if (sx < 0) sx = 0; // not sure about this (shangha2 title screen)
|
||||||
|
|
||||||
b = (((hd63484_regs_r(hd63484, space, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xde/2, 0xffff));
|
b = (((m_hd63484->regs_r(space, 0xdc/2, 0xffff) & 0x000f) << 16) + m_hd63484->regs_r(space, 0xde/2, 0xffff));
|
||||||
|
|
||||||
for (y = sy ; y <= sy + h && y < 280 ; y++)
|
for (y = sy ; y <= sy + h && y < 280 ; y++)
|
||||||
{
|
{
|
||||||
for (x = 0 ; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
|
for (x = 0 ; x < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff) * 2 ; x += 2)
|
||||||
{
|
{
|
||||||
b &= (HD63484_RAM_SIZE - 1);
|
b &= (HD63484_RAM_SIZE - 1);
|
||||||
src = hd63484_ram_r(hd63484, space, b, 0xffff);
|
src = m_hd63484->ram_r(space, b, 0xffff);
|
||||||
if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 2)
|
if (x <= w && x + sx >= 0 && x + sx < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff) * 2)
|
||||||
{
|
{
|
||||||
bitmap.pix16(y, x + sx) = src & 0x00ff;
|
bitmap.pix16(y, x + sx) = src & 0x00ff;
|
||||||
bitmap.pix16(y, x + sx + 1) = (src & 0xff00) >> 8;
|
bitmap.pix16(y, x + sx + 1) = (src & 0xff00) >> 8;
|
||||||
@ -155,8 +156,8 @@ ADDRESS_MAP_END
|
|||||||
|
|
||||||
|
|
||||||
static ADDRESS_MAP_START( shanghai_portmap, AS_IO, 16, shanghai_state )
|
static ADDRESS_MAP_START( shanghai_portmap, AS_IO, 16, shanghai_state )
|
||||||
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
|
AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
|
||||||
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE8("ymsnd", ym2203_device, read, write, 0x00ff)
|
AM_RANGE(0x20, 0x23) AM_DEVREADWRITE8("ymsnd", ym2203_device, read, write, 0x00ff)
|
||||||
AM_RANGE(0x40, 0x41) AM_READ_PORT("P1")
|
AM_RANGE(0x40, 0x41) AM_READ_PORT("P1")
|
||||||
AM_RANGE(0x44, 0x45) AM_READ_PORT("P2")
|
AM_RANGE(0x44, 0x45) AM_READ_PORT("P2")
|
||||||
@ -169,8 +170,8 @@ static ADDRESS_MAP_START( shangha2_portmap, AS_IO, 16, shanghai_state )
|
|||||||
AM_RANGE(0x00, 0x01) AM_READ_PORT("P1")
|
AM_RANGE(0x00, 0x01) AM_READ_PORT("P1")
|
||||||
AM_RANGE(0x10, 0x11) AM_READ_PORT("P2")
|
AM_RANGE(0x10, 0x11) AM_READ_PORT("P2")
|
||||||
AM_RANGE(0x20, 0x21) AM_READ_PORT("SYSTEM")
|
AM_RANGE(0x20, 0x21) AM_READ_PORT("SYSTEM")
|
||||||
AM_RANGE(0x30, 0x31) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
|
AM_RANGE(0x30, 0x31) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
|
||||||
AM_RANGE(0x32, 0x33) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
AM_RANGE(0x32, 0x33) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
AM_RANGE(0x40, 0x43) AM_DEVREADWRITE8("ymsnd", ym2203_device, read, write, 0x00ff)
|
AM_RANGE(0x40, 0x43) AM_DEVREADWRITE8("ymsnd", ym2203_device, read, write, 0x00ff)
|
||||||
AM_RANGE(0x50, 0x51) AM_WRITE(shanghai_coin_w)
|
AM_RANGE(0x50, 0x51) AM_WRITE(shanghai_coin_w)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
@ -182,8 +183,8 @@ READ16_MEMBER(shanghai_state::kothello_hd63484_status_r)
|
|||||||
|
|
||||||
static ADDRESS_MAP_START( kothello_map, AS_PROGRAM, 16, shanghai_state )
|
static ADDRESS_MAP_START( kothello_map, AS_PROGRAM, 16, shanghai_state )
|
||||||
AM_RANGE(0x00000, 0x07fff) AM_RAM
|
AM_RANGE(0x00000, 0x07fff) AM_RAM
|
||||||
AM_RANGE(0x08010, 0x08011) AM_READ(kothello_hd63484_status_r) AM_DEVWRITE_LEGACY("hd63484", hd63484_address_w)
|
AM_RANGE(0x08010, 0x08011) AM_READ(kothello_hd63484_status_r) AM_DEVWRITE("hd63484", hd63484_device, address_w)
|
||||||
AM_RANGE(0x08012, 0x08013) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
AM_RANGE(0x08012, 0x08013) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
AM_RANGE(0x09010, 0x09011) AM_READ_PORT("P1")
|
AM_RANGE(0x09010, 0x09011) AM_READ_PORT("P1")
|
||||||
AM_RANGE(0x09012, 0x09013) AM_READ_PORT("P2")
|
AM_RANGE(0x09012, 0x09013) AM_READ_PORT("P2")
|
||||||
AM_RANGE(0x09014, 0x09015) AM_READ_PORT("SYSTEM")
|
AM_RANGE(0x09014, 0x09015) AM_READ_PORT("SYSTEM")
|
||||||
|
@ -137,7 +137,8 @@ class sigmab52_state : public driver_device
|
|||||||
public:
|
public:
|
||||||
sigmab52_state(const machine_config &mconfig, device_type type, const char *tag)
|
sigmab52_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||||
: driver_device(mconfig, type, tag),
|
: driver_device(mconfig, type, tag),
|
||||||
m_maincpu(*this, "maincpu") { }
|
m_maincpu(*this, "maincpu"),
|
||||||
|
m_hd63484(*this, "hd63484") { }
|
||||||
|
|
||||||
int m_latch;
|
int m_latch;
|
||||||
unsigned int m_acrtc_data;
|
unsigned int m_acrtc_data;
|
||||||
@ -153,6 +154,7 @@ public:
|
|||||||
UINT32 screen_update_jwildb52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
UINT32 screen_update_jwildb52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
INTERRUPT_GEN_MEMBER(timer_irq);
|
INTERRUPT_GEN_MEMBER(timer_irq);
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
|
required_device<hd63484_device> m_hd63484;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -170,12 +172,10 @@ void sigmab52_state::video_start()
|
|||||||
|
|
||||||
UINT32 sigmab52_state::screen_update_jwildb52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
UINT32 sigmab52_state::screen_update_jwildb52(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
|
||||||
|
|
||||||
int x, y, b, src;
|
int x, y, b, src;
|
||||||
|
|
||||||
address_space &space = machine().driver_data()->generic_space();
|
address_space &space = machine().driver_data()->generic_space();
|
||||||
b = ((hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
|
b = ((m_hd63484->regs_r(space, 0xcc/2, 0xffff) & 0x000f) << 16) + m_hd63484->regs_r(space, 0xce/2, 0xffff);
|
||||||
|
|
||||||
//save vram to file
|
//save vram to file
|
||||||
#if 0
|
#if 0
|
||||||
@ -190,9 +190,9 @@ UINT32 sigmab52_state::screen_update_jwildb52(screen_device &screen, bitmap_ind1
|
|||||||
|
|
||||||
for (y = 0; y < 480; y++)
|
for (y = 0; y < 480; y++)
|
||||||
{
|
{
|
||||||
for (x = 0; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 4; x += 4)
|
for (x = 0; x < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff) * 4; x += 4)
|
||||||
{
|
{
|
||||||
src = hd63484_ram_r(hd63484, space, b & (HD63484_RAM_SIZE - 1), 0xffff);
|
src = m_hd63484->ram_r(space, b & (HD63484_RAM_SIZE - 1), 0xffff);
|
||||||
|
|
||||||
bitmap.pix16(y, x ) = ((src & 0x000f) >> 0) << 0;
|
bitmap.pix16(y, x ) = ((src & 0x000f) >> 0) << 0;
|
||||||
bitmap.pix16(y, x + 1) = ((src & 0x00f0) >> 4) << 0;
|
bitmap.pix16(y, x + 1) = ((src & 0x00f0) >> 4) << 0;
|
||||||
@ -203,24 +203,24 @@ UINT32 sigmab52_state::screen_update_jwildb52(screen_device &screen, bitmap_ind1
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!machine().input().code_pressed(KEYCODE_O))
|
if (!machine().input().code_pressed(KEYCODE_O))
|
||||||
if ((hd63484_regs_r(hd63484, space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
|
if ((m_hd63484->regs_r(space, 0x06/2, 0xffff) & 0x0300) == 0x0300)
|
||||||
{
|
{
|
||||||
int sy = (hd63484_regs_r(hd63484, space, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(hd63484, space, 0x88/2, 0xffff) >> 8);
|
int sy = (m_hd63484->regs_r(space, 0x94/2, 0xffff) & 0x0fff) - (m_hd63484->regs_r(space, 0x88/2, 0xffff) >> 8);
|
||||||
int h = hd63484_regs_r(hd63484, space, 0x96/2, 0xffff) & 0x0fff;
|
int h = m_hd63484->regs_r(space, 0x96/2, 0xffff) & 0x0fff;
|
||||||
int sx = ((hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) >> 8) - (hd63484_regs_r(hd63484, space, 0x84/2, 0xffff) >> 8)) * 4;
|
int sx = ((m_hd63484->regs_r(space, 0x92/2, 0xffff) >> 8) - (m_hd63484->regs_r(space, 0x84/2, 0xffff) >> 8)) * 4;
|
||||||
int w = (hd63484_regs_r(hd63484, space, 0x92/2, 0xffff) & 0xff) * 2;
|
int w = (m_hd63484->regs_r(space, 0x92/2, 0xffff) & 0xff) * 2;
|
||||||
if (sx < 0) sx = 0; // not sure about this (shangha2 title screen)
|
if (sx < 0) sx = 0; // not sure about this (shangha2 title screen)
|
||||||
|
|
||||||
b = (((hd63484_regs_r(hd63484, space, 0xdc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(hd63484, space, 0xde/2, 0xffff));
|
b = (((m_hd63484->regs_r(space, 0xdc/2, 0xffff) & 0x000f) << 16) + m_hd63484->regs_r(space, 0xde/2, 0xffff));
|
||||||
|
|
||||||
|
|
||||||
for (y = sy; y <= sy + h && y < 480; y++)
|
for (y = sy; y <= sy + h && y < 480; y++)
|
||||||
{
|
{
|
||||||
for (x = 0; x < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff)* 4; x += 4)
|
for (x = 0; x < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff)* 4; x += 4)
|
||||||
{
|
{
|
||||||
src = hd63484_ram_r(hd63484, space, b & (HD63484_RAM_SIZE - 1), 0xffff);
|
src = m_hd63484->ram_r(space, b & (HD63484_RAM_SIZE - 1), 0xffff);
|
||||||
|
|
||||||
if (x <= w && x + sx >= 0 && x + sx < (hd63484_regs_r(hd63484, space, 0xca/2, 0xffff) & 0x0fff) * 4)
|
if (x <= w && x + sx >= 0 && x + sx < (m_hd63484->regs_r(space, 0xca/2, 0xffff) & 0x0fff) * 4)
|
||||||
{
|
{
|
||||||
bitmap.pix16(y, x + sx ) = ((src & 0x000f) >> 0) << 0;
|
bitmap.pix16(y, x + sx ) = ((src & 0x000f) >> 0) << 0;
|
||||||
bitmap.pix16(y, x + sx + 1) = ((src & 0x00f0) >> 4) << 0;
|
bitmap.pix16(y, x + sx + 1) = ((src & 0x00f0) >> 4) << 0;
|
||||||
@ -247,11 +247,10 @@ void sigmab52_state::palette_init()
|
|||||||
|
|
||||||
WRITE8_MEMBER(sigmab52_state::acrtc_w)
|
WRITE8_MEMBER(sigmab52_state::acrtc_w)
|
||||||
{
|
{
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
|
||||||
if(!offset)
|
if(!offset)
|
||||||
{
|
{
|
||||||
//address select
|
//address select
|
||||||
hd63484_address_w(hd63484, space, 0, data, 0x00ff);
|
m_hd63484->address_w(space, 0, data, 0x00ff);
|
||||||
m_latch = 0;
|
m_latch = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -267,7 +266,7 @@ WRITE8_MEMBER(sigmab52_state::acrtc_w)
|
|||||||
m_acrtc_data <<= 8;
|
m_acrtc_data <<= 8;
|
||||||
m_acrtc_data |= data;
|
m_acrtc_data |= data;
|
||||||
|
|
||||||
hd63484_data_w(hd63484, space, 0, m_acrtc_data, 0xffff);
|
m_hd63484->data_w(space, 0, m_acrtc_data, 0xffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_latch ^= 1;
|
m_latch ^= 1;
|
||||||
@ -278,13 +277,12 @@ READ8_MEMBER(sigmab52_state::acrtc_r)
|
|||||||
{
|
{
|
||||||
if(offset&1)
|
if(offset&1)
|
||||||
{
|
{
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
return m_hd63484->data_r(space, 0, 0xff);
|
||||||
return hd63484_data_r(hd63484, space, 0, 0xff);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0x7b; //fake status read (instead HD63484_status_r(space, 0, 0xff); )
|
return 0x7b; //fake status read (instead m_hd63484->status_r(space, 0, 0xff); )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,8 +321,8 @@ static ADDRESS_MAP_START( jwildb52_map, AS_PROGRAM, 8, sigmab52_state )
|
|||||||
AM_RANGE(0xf710, 0xf710) AM_WRITE(unk_f710_w)
|
AM_RANGE(0xf710, 0xf710) AM_WRITE(unk_f710_w)
|
||||||
AM_RANGE(0xf721, 0xf721) AM_READ(unk_f721_r)
|
AM_RANGE(0xf721, 0xf721) AM_READ(unk_f721_r)
|
||||||
|
|
||||||
//AM_RANGE(0x00, 0x01) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
|
//AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
|
||||||
//AM_RANGE(0x02, 0x03) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
//AM_RANGE(0x02, 0x03) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
|
|
||||||
AM_RANGE(0xf730, 0xf731) AM_READWRITE(acrtc_r, acrtc_w)
|
AM_RANGE(0xf730, 0xf731) AM_READWRITE(acrtc_r, acrtc_w)
|
||||||
AM_RANGE(0xf740, 0xf740) AM_READ_PORT("IN0")
|
AM_RANGE(0xf740, 0xf740) AM_READ_PORT("IN0")
|
||||||
@ -569,12 +567,10 @@ void sigmab52_state::machine_start()
|
|||||||
UINT16 *rom = (UINT16*)memregion("gfx1")->base();
|
UINT16 *rom = (UINT16*)memregion("gfx1")->base();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
|
||||||
|
|
||||||
address_space &space = generic_space();
|
address_space &space = generic_space();
|
||||||
for(i = 0; i < 0x40000/2; ++i)
|
for(i = 0; i < 0x40000/2; ++i)
|
||||||
{
|
{
|
||||||
hd63484_ram_w(hd63484, space, i + 0x40000/2, rom[i], 0xffff);
|
m_hd63484->ram_w(space, i + 0x40000/2, rom[i], 0xffff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -685,8 +685,8 @@ static ADDRESS_MAP_START( realpunc_map, AS_PROGRAM, 16, taitob_state )
|
|||||||
AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w)
|
AM_RANGE(0x18c000, 0x18c001) AM_WRITE(realpunc_output_w)
|
||||||
TC0180VCU_MEMRW( 0x200000 )
|
TC0180VCU_MEMRW( 0x200000 )
|
||||||
AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
|
AM_RANGE(0x280000, 0x281fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram")
|
||||||
AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_status_r, hd63484_address_w)
|
AM_RANGE(0x300000, 0x300001) AM_DEVREADWRITE("hd63484", hd63484_device, status_r, address_w)
|
||||||
AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE_LEGACY("hd63484", hd63484_data_r, hd63484_data_w)
|
AM_RANGE(0x300002, 0x300003) AM_DEVREADWRITE("hd63484", hd63484_device, data_r, data_w)
|
||||||
// AM_RANGE(0x320000, 0x320001) AM_NOP // ?
|
// AM_RANGE(0x320000, 0x320001) AM_NOP // ?
|
||||||
AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
|
AM_RANGE(0x320002, 0x320003) AM_READNOP AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_w, 0xff00)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "machine/mb87078.h"
|
#include "machine/mb87078.h"
|
||||||
#include "machine/taitoio.h"
|
#include "machine/taitoio.h"
|
||||||
|
#include "video/hd63484.h"
|
||||||
#include "video/tc0180vcu.h"
|
#include "video/tc0180vcu.h"
|
||||||
|
|
||||||
class taitob_state : public driver_device
|
class taitob_state : public driver_device
|
||||||
@ -26,6 +27,7 @@ public:
|
|||||||
m_pixelram(*this, "pixelram"),
|
m_pixelram(*this, "pixelram"),
|
||||||
m_maincpu(*this, "maincpu"),
|
m_maincpu(*this, "maincpu"),
|
||||||
m_audiocpu(*this, "audiocpu"),
|
m_audiocpu(*this, "audiocpu"),
|
||||||
|
m_hd63484(*this, "hd63484"),
|
||||||
m_tc0180vcu(*this, "tc0180vcu"),
|
m_tc0180vcu(*this, "tc0180vcu"),
|
||||||
m_tc0640fio(*this, "tc0640fio"),
|
m_tc0640fio(*this, "tc0640fio"),
|
||||||
m_tc0220ioc(*this, "tc0220ioc"),
|
m_tc0220ioc(*this, "tc0220ioc"),
|
||||||
@ -58,6 +60,7 @@ public:
|
|||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
required_device<cpu_device> m_audiocpu;
|
required_device<cpu_device> m_audiocpu;
|
||||||
device_t *m_ym;
|
device_t *m_ym;
|
||||||
|
optional_device<hd63484_device> m_hd63484;
|
||||||
required_device<tc0180vcu_device> m_tc0180vcu;
|
required_device<tc0180vcu_device> m_tc0180vcu;
|
||||||
optional_device<tc0640fio_device> m_tc0640fio;
|
optional_device<tc0640fio_device> m_tc0640fio;
|
||||||
optional_device<tc0220ioc_device> m_tc0220ioc;
|
optional_device<tc0220ioc_device> m_tc0220ioc;
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "video/hd63484.h"
|
|
||||||
#include "includes/taito_b.h"
|
#include "includes/taito_b.h"
|
||||||
|
|
||||||
WRITE16_MEMBER(taitob_state::hitice_pixelram_w)
|
WRITE16_MEMBER(taitob_state::hitice_pixelram_w)
|
||||||
@ -426,10 +425,8 @@ UINT32 taitob_state::screen_update_realpunc(screen_device &screen, bitmap_rgb32
|
|||||||
/* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */
|
/* Draw the 15bpp raw CRTC frame buffer directly to the output bitmap */
|
||||||
if (m_realpunc_video_ctrl & 0x0002)
|
if (m_realpunc_video_ctrl & 0x0002)
|
||||||
{
|
{
|
||||||
device_t *hd63484 = machine().device("hd63484");
|
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);
|
||||||
int base = (hd63484_regs_r(hd63484, space, 0xcc/2, 0xffff) << 16) + hd63484_regs_r(hd63484, space, 0xce/2, 0xffff);
|
|
||||||
int stride = hd63484_regs_r(hd63484, space, 0xca/2, 0xffff);
|
|
||||||
|
|
||||||
// scrollx = taitob_scroll[0];
|
// scrollx = taitob_scroll[0];
|
||||||
// scrolly = taitob_scroll[1];
|
// scrolly = taitob_scroll[1];
|
||||||
@ -440,7 +437,7 @@ UINT32 taitob_state::screen_update_realpunc(screen_device &screen, bitmap_rgb32
|
|||||||
for (x = 0; x <= cliprect.max_x; x++)
|
for (x = 0; x <= cliprect.max_x; x++)
|
||||||
{
|
{
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
UINT16 srcpix = hd63484_ram_r(hd63484, space, addr++, 0xffff);
|
UINT16 srcpix = m_hd63484->ram_r(space, addr++, 0xffff);
|
||||||
|
|
||||||
r = (BIT(srcpix, 1)) | ((srcpix >> 11) & 0x1e);
|
r = (BIT(srcpix, 1)) | ((srcpix >> 11) & 0x1e);
|
||||||
g = (BIT(srcpix, 2)) | ((srcpix >> 7) & 0x1e);
|
g = (BIT(srcpix, 2)) | ((srcpix >> 7) & 0x1e);
|
||||||
|
Loading…
Reference in New Issue
Block a user