mirror of
https://github.com/holub/mame
synced 2025-04-26 10:13:37 +03:00
k053250_t to k053250_device (nw)
This commit is contained in:
parent
80e2f51697
commit
58c73283d8
@ -1,26 +1,26 @@
|
||||
#include "k053250.h"
|
||||
|
||||
const device_type K053250 = &device_creator<k053250_t>;
|
||||
const device_type K053250 = &device_creator<k053250_device>;
|
||||
|
||||
k053250_t::k053250_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
k053250_device::k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, K053250, "K053250", tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
void k053250_t::static_set_screen_tag(device_t &device, const char *screen_tag)
|
||||
void k053250_device::static_set_screen_tag(device_t &device, const char *screen_tag)
|
||||
{
|
||||
k053250_t &dev = downcast<k053250_t &>(device);
|
||||
k053250_device &dev = downcast<k053250_device &>(device);
|
||||
dev.screen_tag = screen_tag;
|
||||
}
|
||||
|
||||
void k053250_t::static_set_offsets(device_t &device, int offx, int offy)
|
||||
void k053250_device::static_set_offsets(device_t &device, int offx, int offy)
|
||||
{
|
||||
k053250_t &dev = downcast<k053250_t &>(device);
|
||||
k053250_device &dev = downcast<k053250_device &>(device);
|
||||
dev.offx = offx;
|
||||
dev.offy = offy;
|
||||
}
|
||||
|
||||
void k053250_t::unpack_nibbles()
|
||||
void k053250_device::unpack_nibbles()
|
||||
{
|
||||
if(!m_region)
|
||||
throw emu_fatalerror("k053250 %s: no associated region found\n", tag());
|
||||
@ -35,7 +35,7 @@ void k053250_t::unpack_nibbles()
|
||||
unpacked_size = 2*size;
|
||||
}
|
||||
|
||||
void k053250_t::device_start()
|
||||
void k053250_device::device_start()
|
||||
{
|
||||
screen = machine().device<screen_device>(screen_tag);
|
||||
ram = auto_alloc_array_clear(machine(), UINT16, 0x6000/2);
|
||||
@ -50,7 +50,7 @@ void k053250_t::device_start()
|
||||
save_item(NAME(frame));
|
||||
}
|
||||
|
||||
void k053250_t::device_reset()
|
||||
void k053250_device::device_reset()
|
||||
{
|
||||
page = 0;
|
||||
frame = -1;
|
||||
@ -58,7 +58,7 @@ void k053250_t::device_reset()
|
||||
}
|
||||
|
||||
// utility function to render a clipped scanline vertically or horizontally
|
||||
inline void k053250_t::pdraw_scanline32(bitmap_rgb32 &bitmap, const pen_t *palette, UINT8 *source,
|
||||
inline void k053250_device::pdraw_scanline32(bitmap_rgb32 &bitmap, const pen_t *palette, UINT8 *source,
|
||||
const rectangle &cliprect, int linepos, int scroll, int zoom,
|
||||
UINT32 clipmask, UINT32 wrapmask, UINT32 orientation, bitmap_ind8 &priority, UINT8 pri)
|
||||
{
|
||||
@ -221,7 +221,7 @@ inline void k053250_t::pdraw_scanline32(bitmap_rgb32 &bitmap, const pen_t *palet
|
||||
#undef FIXPOINT_PRECISION_HALF
|
||||
}
|
||||
|
||||
void k053250_t::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int colorbase, int flags, int priority )
|
||||
void k053250_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int colorbase, int flags, int priority )
|
||||
{
|
||||
UINT8 *pix_ptr;
|
||||
const pen_t *pal_base, *pal_ptr;
|
||||
@ -423,7 +423,7 @@ void k053250_t::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int color
|
||||
}
|
||||
}
|
||||
|
||||
void k053250_t::dma(int limiter)
|
||||
void k053250_device::dma(int limiter)
|
||||
{
|
||||
int current_frame = screen->frame_number();
|
||||
|
||||
@ -435,12 +435,12 @@ void k053250_t::dma(int limiter)
|
||||
page ^= 1;
|
||||
}
|
||||
|
||||
READ16_MEMBER(k053250_t::reg_r)
|
||||
READ16_MEMBER(k053250_device::reg_r)
|
||||
{
|
||||
return regs[offset];
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(k053250_t::reg_w)
|
||||
WRITE16_MEMBER(k053250_device::reg_w)
|
||||
{
|
||||
if (ACCESSING_BITS_0_7)
|
||||
{
|
||||
@ -452,17 +452,17 @@ WRITE16_MEMBER(k053250_t::reg_w)
|
||||
}
|
||||
}
|
||||
|
||||
READ16_MEMBER(k053250_t::ram_r)
|
||||
READ16_MEMBER(k053250_device::ram_r)
|
||||
{
|
||||
return ram[offset];
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(k053250_t::ram_w)
|
||||
WRITE16_MEMBER(k053250_device::ram_w)
|
||||
{
|
||||
COMBINE_DATA(ram+offset);
|
||||
}
|
||||
|
||||
READ16_MEMBER(k053250_t::rom_r)
|
||||
READ16_MEMBER(k053250_device::rom_r)
|
||||
{
|
||||
return m_region->base()[0x80000 * regs[6] + 0x800 * regs[7] + offset/2];
|
||||
}
|
||||
|
@ -9,13 +9,13 @@
|
||||
|
||||
#define MCFG_K053250_ADD(_tag, screen_tag, offx, offy) \
|
||||
MCFG_DEVICE_ADD(_tag, K053250, 0) \
|
||||
k053250_t::static_set_screen_tag(*device, screen_tag); \
|
||||
k053250_t::static_set_offsets(*device, offx, offy);
|
||||
k053250_device::static_set_screen_tag(*device, screen_tag); \
|
||||
k053250_device::static_set_offsets(*device, offx, offy);
|
||||
|
||||
class k053250_t : public device_t
|
||||
class k053250_device : public device_t
|
||||
{
|
||||
public:
|
||||
k053250_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
k053250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
static void static_set_screen_tag(device_t &device, const char *screen_tag);
|
||||
static void static_set_offsets(device_t &device, int offx, int offy);
|
||||
|
@ -290,8 +290,8 @@ static ADDRESS_MAP_START( metamrph_map, AS_PROGRAM, 16, mystwarr_state )
|
||||
AM_RANGE(0x240000, 0x240007) AM_WRITE_LEGACY(K053246_word_w)
|
||||
AM_RANGE(0x244000, 0x24400f) AM_READ_LEGACY(K055673_rom_word_r)
|
||||
AM_RANGE(0x244010, 0x24401f) AM_WRITE_LEGACY(K053247_reg_word_w)
|
||||
AM_RANGE(0x24c000, 0x24ffff) AM_DEVREADWRITE("k053250_1", k053250_t, ram_r, ram_w)
|
||||
AM_RANGE(0x250000, 0x25000f) AM_DEVREADWRITE("k053250_1", k053250_t, reg_r, reg_w)
|
||||
AM_RANGE(0x24c000, 0x24ffff) AM_DEVREADWRITE("k053250_1", k053250_device, ram_r, ram_w)
|
||||
AM_RANGE(0x250000, 0x25000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
|
||||
AM_RANGE(0x254000, 0x25401f) AM_WRITE_LEGACY(K054338_word_w)
|
||||
AM_RANGE(0x258000, 0x2580ff) AM_WRITE_LEGACY(K055555_word_w)
|
||||
AM_RANGE(0x260000, 0x26001f) AM_DEVREADWRITE8_LEGACY("k053252",k053252_r,k053252_w,0x00ff)
|
||||
@ -311,7 +311,7 @@ static ADDRESS_MAP_START( metamrph_map, AS_PROGRAM, 16, mystwarr_state )
|
||||
AM_RANGE(0x300000, 0x301fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w)
|
||||
AM_RANGE(0x302000, 0x303fff) AM_READWRITE_LEGACY(K056832_ram_word_r,K056832_ram_word_w) // tilemap RAM mirror read/write (essential)
|
||||
AM_RANGE(0x310000, 0x311fff) AM_READ_LEGACY(K056832_mw_rom_word_r)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("k053250_1", k053250_t, rom_r)
|
||||
AM_RANGE(0x320000, 0x321fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
|
||||
AM_RANGE(0x330000, 0x331fff) AM_RAM_WRITE(paletteram_xrgb_word_be_w) AM_SHARE("paletteram")
|
||||
#if MW_DEBUG
|
||||
AM_RANGE(0x240000, 0x240007) AM_READ_LEGACY(K053246_reg_word_r)
|
||||
|
@ -189,16 +189,16 @@ static ADDRESS_MAP_START( overdriv_slave_map, AS_PROGRAM, 16, overdriv_state )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x080000, 0x083fff) AM_RAM /* work RAM */
|
||||
AM_RANGE(0x0c0000, 0x0c1fff) AM_RAM //AM_DEVREADWRITE_LEGACY("k053250_1", k053250_ram_r, k053250_ram_w)
|
||||
AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("k053250_1", k053250_t, reg_r, reg_w)
|
||||
AM_RANGE(0x108000, 0x10800f) AM_DEVREADWRITE("k053250_2", k053250_t, reg_r, reg_w)
|
||||
AM_RANGE(0x100000, 0x10000f) AM_DEVREADWRITE("k053250_1", k053250_device, reg_r, reg_w)
|
||||
AM_RANGE(0x108000, 0x10800f) AM_DEVREADWRITE("k053250_2", k053250_device, reg_r, reg_w)
|
||||
AM_RANGE(0x118000, 0x118fff) AM_DEVREADWRITE_LEGACY("k053246", k053247_word_r, k053247_word_w)
|
||||
AM_RANGE(0x120000, 0x120001) AM_DEVREAD_LEGACY("k053246", k053246_word_r)
|
||||
AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */
|
||||
AM_RANGE(0x130000, 0x130007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w)
|
||||
AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
|
||||
AM_RANGE(0x208000, 0x20bfff) AM_RAM
|
||||
AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_t, rom_r)
|
||||
AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("k053250_2", k053250_t, rom_r)
|
||||
AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
|
||||
AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("k053250_2", k053250_device, rom_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( overdriv_sound_map, AS_PROGRAM, 8, overdriv_state )
|
||||
|
@ -314,8 +314,8 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xexex_state )
|
||||
AM_RANGE(0x0c0000, 0x0c003f) AM_DEVWRITE_LEGACY("k056832", k056832_word_w) // VACSET (K054157)
|
||||
AM_RANGE(0x0c2000, 0x0c2007) AM_DEVWRITE_LEGACY("k053246", k053246_word_w) // OBJSET1
|
||||
AM_RANGE(0x0c4000, 0x0c4001) AM_DEVREAD_LEGACY("k053246", k053246_word_r) // Passthrough to sprite roms
|
||||
AM_RANGE(0x0c6000, 0x0c7fff) AM_DEVREADWRITE("k053250", k053250_t, ram_r, ram_w) // K053250 "road" RAM
|
||||
AM_RANGE(0x0c8000, 0x0c800f) AM_DEVREADWRITE("k053250", k053250_t, reg_r, reg_w)
|
||||
AM_RANGE(0x0c6000, 0x0c7fff) AM_DEVREADWRITE("k053250", k053250_device, ram_r, ram_w) // K053250 "road" RAM
|
||||
AM_RANGE(0x0c8000, 0x0c800f) AM_DEVREADWRITE("k053250", k053250_device, reg_r, reg_w)
|
||||
AM_RANGE(0x0ca000, 0x0ca01f) AM_DEVWRITE_LEGACY("k054338", k054338_word_w) // CLTC
|
||||
AM_RANGE(0x0cc000, 0x0cc01f) AM_DEVWRITE_LEGACY("k053251", k053251_lsb_w) // priority encoder
|
||||
// AM_RANGE(0x0d0000, 0x0d001f) AM_DEVREADWRITE8_LEGACY("k053252", k053252_r,k053252_w,0x00ff) // CCU
|
||||
@ -334,7 +334,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xexex_state )
|
||||
AM_RANGE(0x180000, 0x181fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w)
|
||||
AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("k056832", k056832_ram_word_r, k056832_ram_word_w)
|
||||
AM_RANGE(0x190000, 0x191fff) AM_DEVREAD_LEGACY("k056832", k056832_rom_word_r) // Passthrough to tile roms
|
||||
AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREAD("k053250", k053250_t, rom_r)
|
||||
AM_RANGE(0x1a0000, 0x1a1fff) AM_DEVREAD("k053250", k053250_device, rom_r)
|
||||
AM_RANGE(0x1b0000, 0x1b1fff) AM_RAM_WRITE(paletteram_xrgb_word_be_w) AM_SHARE("paletteram")
|
||||
|
||||
#if XE_DEBUG
|
||||
@ -450,7 +450,7 @@ void xexex_state::machine_start()
|
||||
membank("bank2")->set_entry(0);
|
||||
|
||||
m_k053246 = machine().device("k053246");
|
||||
m_k053250 = machine().device<k053250_t>("k053250");
|
||||
m_k053250 = machine().device<k053250_device>("k053250");
|
||||
m_k053251 = machine().device("k053251");
|
||||
m_k053252 = machine().device("k053252");
|
||||
m_k056832 = machine().device("k056832");
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
filter_volume_device *m_filter2r;
|
||||
device_t *m_k056832;
|
||||
device_t *m_k053246;
|
||||
k053250_t *m_k053250;
|
||||
k053250_device *m_k053250;
|
||||
device_t *m_k053251;
|
||||
device_t *m_k053252;
|
||||
device_t *m_k054338;
|
||||
|
@ -1593,7 +1593,7 @@ void konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitmap, const rectan
|
||||
}
|
||||
else
|
||||
{
|
||||
machine.device<k053250_t>("k053250_1")->draw(bitmap, cliprect, vcblk[4]<<l, 0, 0);
|
||||
machine.device<k053250_device>("k053250_1")->draw(bitmap, cliprect, vcblk[4]<<l, 0, 0);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -1655,7 +1655,7 @@ void konamigx_mixer(running_machine &machine, bitmap_rgb32 &bitmap, const rectan
|
||||
}
|
||||
}
|
||||
else
|
||||
machine.device<k053250_t>("k053250_2")->draw(bitmap, cliprect, vcblk[5]<<l, 0, 0);
|
||||
machine.device<k053250_device>("k053250_2")->draw(bitmap, cliprect, vcblk[5]<<l, 0, 0);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user