mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
common scramble (nw)
This commit is contained in:
parent
999ed27b7b
commit
74ceaefbe0
@ -354,6 +354,7 @@ static MACHINE_CONFIG_START( igs_majhong, igs_m027_state )
|
|||||||
|
|
||||||
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
||||||
MCFG_GFX_PALETTE("palette")
|
MCFG_GFX_PALETTE("palette")
|
||||||
|
MCFG_REVERSE_TEXT_BITS
|
||||||
|
|
||||||
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
||||||
|
|
||||||
@ -388,6 +389,7 @@ static MACHINE_CONFIG_START( amazonia, igs_m027_state )
|
|||||||
|
|
||||||
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
MCFG_DEVICE_ADD("igs017_igs031", IGS017_IGS031, 0)
|
||||||
MCFG_GFX_PALETTE("palette")
|
MCFG_GFX_PALETTE("palette")
|
||||||
|
MCFG_REVERSE_TEXT_BITS
|
||||||
|
|
||||||
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
// 82C55? (accessed through igs017/igs031 area like igs017.c?)
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ igs017_igs031_device::igs017_igs031_device(const machine_config &mconfig, const
|
|||||||
m_palette(*this, "^palette")
|
m_palette(*this, "^palette")
|
||||||
{
|
{
|
||||||
m_palette_scramble_cb = igs017_igs031_palette_scramble_delegate(FUNC(igs017_igs031_device::palette_callback_straight), this);
|
m_palette_scramble_cb = igs017_igs031_palette_scramble_delegate(FUNC(igs017_igs031_device::palette_callback_straight), this);
|
||||||
|
m_revbits = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const address_space_config *igs017_igs031_device::memory_space_config(address_spacenum spacenum) const
|
const address_space_config *igs017_igs031_device::memory_space_config(address_spacenum spacenum) const
|
||||||
@ -133,6 +134,19 @@ void igs017_igs031_device::video_start()
|
|||||||
{
|
{
|
||||||
// make sure thie happens AFTER driver init, or things won't work
|
// make sure thie happens AFTER driver init, or things won't work
|
||||||
expand_sprites();
|
expand_sprites();
|
||||||
|
|
||||||
|
if (m_revbits)
|
||||||
|
{
|
||||||
|
UINT8 *rom = memregion("^tilemaps")->base();
|
||||||
|
int size = memregion("^tilemaps")->bytes();
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < size ; i++)
|
||||||
|
{
|
||||||
|
rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
||||||
|
// rom[i^1] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ typedef device_delegate<UINT16 (UINT16)> igs017_igs031_palette_scramble_delegate
|
|||||||
#define MCFG_PALETTE_SCRAMBLE_CB( _class, _method) \
|
#define MCFG_PALETTE_SCRAMBLE_CB( _class, _method) \
|
||||||
igs017_igs031_device::set_palette_scramble_cb(*device, igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0));
|
igs017_igs031_device::set_palette_scramble_cb(*device, igs017_igs031_palette_scramble_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0));
|
||||||
|
|
||||||
|
#define MCFG_REVERSE_TEXT_BITS \
|
||||||
|
igs017_igs031_device::static_set_text_reverse_bits(*device);
|
||||||
|
|
||||||
class igs017_igs031_device : public device_t,
|
class igs017_igs031_device : public device_t,
|
||||||
public device_gfx_interface,
|
public device_gfx_interface,
|
||||||
@ -23,6 +25,11 @@ public:
|
|||||||
|
|
||||||
static void set_palette_scramble_cb(device_t &device,igs017_igs031_palette_scramble_delegate newtilecb);
|
static void set_palette_scramble_cb(device_t &device,igs017_igs031_palette_scramble_delegate newtilecb);
|
||||||
|
|
||||||
|
static void static_set_text_reverse_bits(device_t &device)
|
||||||
|
{
|
||||||
|
igs017_igs031_device &dev = downcast<igs017_igs031_device &>(device);
|
||||||
|
dev.m_revbits = 1;
|
||||||
|
}
|
||||||
|
|
||||||
UINT16 palette_callback_straight(UINT16 bgr);
|
UINT16 palette_callback_straight(UINT16 bgr);
|
||||||
|
|
||||||
@ -33,6 +40,8 @@ public:
|
|||||||
DECLARE_READ8_MEMBER(read);
|
DECLARE_READ8_MEMBER(read);
|
||||||
DECLARE_WRITE8_MEMBER(write);
|
DECLARE_WRITE8_MEMBER(write);
|
||||||
|
|
||||||
|
// the gfx roms were often hooked up with the bits backwards, allow us to handle it here to save doing it in every driver.
|
||||||
|
int m_revbits;
|
||||||
|
|
||||||
int m_toggle;
|
int m_toggle;
|
||||||
int m_debug_addr;
|
int m_debug_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user