alibaba: add mystery item clock

This commit is contained in:
hap 2025-01-04 21:06:22 +01:00
parent d62f266647
commit f858997ccd
7 changed files with 745 additions and 601 deletions

View File

@ -115,7 +115,8 @@ class jrpacman_state : public pacman_state
{
public:
jrpacman_state(const machine_config &mconfig, device_type type, const char *tag)
: pacman_state(mconfig, type, tag) { }
: pacman_state(mconfig, type, tag)
{ }
void jrpacman(machine_config &config);
@ -285,14 +286,14 @@ void jrpacman_state::jrpacman(machine_config &config)
WATCHDOG_TIMER(config, m_watchdog);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60.606060);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(36*8, 28*8);
screen.set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
screen.set_screen_update(FUNC(jrpacman_state::screen_update_pacman));
screen.set_palette(m_palette);
screen.screen_vblank().set(FUNC(jrpacman_state::vblank_irq));
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60.606060);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
m_screen->set_size(36*8, 28*8);
m_screen->set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
m_screen->set_screen_update(FUNC(jrpacman_state::screen_update_pacman));
m_screen->set_palette(m_palette);
m_screen->screen_vblank().set(FUNC(jrpacman_state::vblank_irq));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_jrpacman);
PALETTE(config, m_palette, FUNC(jrpacman_state::pacman_palette), 128 * 4, 32);

View File

@ -23,7 +23,6 @@ uint8_t pacman_state::jumpshot_decrypt(int addr, uint8_t e)
uint32_t method = 0;
const uint8_t *tbl;
/* pick method from bits 0 2 5 7 9 of the address */
method = picktable[
(addr & 0x001) |
@ -43,14 +42,10 @@ uint8_t pacman_state::jumpshot_decrypt(int addr, uint8_t e)
void pacman_state::jumpshot_decode()
{
int i;
uint8_t *RAM;
/* CPU ROMs */
RAM = memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0; i < 0x4000; i++)
{
RAM[i] = jumpshot_decrypt(i,RAM[i]);
ROM[i] = jumpshot_decrypt(i, ROM[i]);
}
}

View File

@ -32,7 +32,6 @@
* Eeekk!
TODO:
* Mystery items in Ali Baba don't work correctly because of protection.
* mspactwin shows a green "0" in the corner on the PCB at tilescreen, but "18" on MAME.
* mspactwin_map supposed ROM 0x2000 mirroring implementation doesn't make much sense, there's a bus conflict now
@ -554,35 +553,60 @@ void pacman_state::coin_lockout_global_w(int state)
/*************************************
*
* Ali Baba sound
* Ali Baba mystery item and sound
*
*************************************/
void pacman_state::alibaba_sound_w(offs_t offset, uint8_t data)
void alibaba_state::machine_start()
{
/* since the sound region in Ali Baba is not contiguous, translate the
offset into the 0-0x1f range */
pacman_state::machine_start();
save_item(NAME(m_mystery_control));
save_item(NAME(m_mystery_clock));
save_item(NAME(m_mystery_prescaler));
}
void alibaba_state::mystery_tick(int state)
{
if (state)
{
// increment clock every 64 frames (approx 1.05s)
m_mystery_prescaler = (m_mystery_prescaler + 1) & 0x3f;
if (m_mystery_prescaler == 0 && m_mystery_control & 1)
m_mystery_clock = (m_mystery_clock + 1) & 0x1f;
}
}
uint8_t alibaba_state::mystery_1_r()
{
// the return value determines what the mystery item is, each bit corresponds to a question mark
return machine().rand() & 0x0f;
}
uint8_t alibaba_state::mystery_2_r()
{
// the single bit return value determines when the mystery is lit up
return (m_mystery_clock >= 24) ? 1 : 0;
}
void alibaba_state::mystery_w(uint8_t data)
{
// d0: start/stop clock
if ((m_mystery_control ^ data) & 1)
m_mystery_prescaler = m_mystery_clock = 0;
// d1: show clock
m_mystery_control = data;
}
void alibaba_state::sound_w(offs_t offset, uint8_t data)
{
// since the sound region is not contiguous, translate the offset into the 0-0x1f range
offset = (offset >> 1 & 0x10) | (offset & 0x0f);
m_namco_sound->pacman_sound_w(offset, data);
}
uint8_t pacman_state::alibaba_mystery_1_r()
{
/* The return value determines what the mystery item is. Each bit corresponds
to a question mark */
return machine().rand() & 0x0f;
// return m_maincpu->state_int(Z80_R) & 0x0f;
}
uint8_t pacman_state::alibaba_mystery_2_r()
{
/* The single bit return value determines when the mystery is lit up.
This is certainly wrong */
m_mystery++;
return (m_mystery >> 10) & 1;
}
/*************************************
@ -1208,28 +1232,28 @@ void pacman_state::numcrash_map(address_map &map)
}
void pacman_state::alibaba_map(address_map &map)
void alibaba_state::alibaba_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x4000, 0x43ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_videoram_w)).share("videoram");
map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(pacman_state::pacman_colorram_w)).share("colorram");
map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(pacman_state::pacman_read_nop)).nopw();
map(0x4000, 0x43ff).mirror(0xa000).ram().w(FUNC(alibaba_state::pacman_videoram_w)).share("videoram");
map(0x4400, 0x47ff).mirror(0xa000).ram().w(FUNC(alibaba_state::pacman_colorram_w)).share("colorram");
map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(alibaba_state::pacman_read_nop)).nopw();
map(0x4c00, 0x4eef).mirror(0xa000).ram();
map(0x4ef0, 0x4eff).mirror(0xa000).ram().share("spriteram");
map(0x4f00, 0x4fff).mirror(0xa000).ram();
map(0x5000, 0x5007).mirror(0xaf38).w("latch1", FUNC(ls259_device::write_d0));
map(0x5000, 0x5000).mirror(0xaf38).w(m_watchdog, FUNC(watchdog_timer_device::reset_w));
map(0x5040, 0x506f).mirror(0xaf00).w(FUNC(pacman_state::alibaba_sound_w)); /* the sound region is not contiguous */
map(0x5040, 0x506f).mirror(0xaf00).w(FUNC(alibaba_state::sound_w)); /* the sound region is not contiguous */
map(0x5050, 0x505f).mirror(0xaf00).writeonly().share("spriteram2");
map(0x5070, 0x507f).mirror(0xaf00).nopw();
map(0x5080, 0x5080).mirror(0xaf3f).nopw();
map(0x5080, 0x5080).mirror(0xaf3f).w(FUNC(alibaba_state::mystery_w));
map(0x50c0, 0x50c7).mirror(0xaf00).w("latch2", FUNC(ls259_device::write_d0));
map(0x5000, 0x5000).mirror(0xaf3f).portr("IN0");
map(0x5040, 0x5040).mirror(0xaf3f).portr("IN1");
map(0x5080, 0x5080).mirror(0xaf3f).portr("DSW1");
map(0x50c0, 0x50c0).mirror(0xaf00).r(FUNC(pacman_state::alibaba_mystery_1_r));
map(0x50c1, 0x50c1).mirror(0xaf00).r(FUNC(pacman_state::alibaba_mystery_2_r));
map(0x50c2, 0x50ff).mirror(0xaf00).r(FUNC(pacman_state::pacman_read_nop));
map(0x50c0, 0x50c0).mirror(0xaf00).r(FUNC(alibaba_state::mystery_1_r));
map(0x50c1, 0x50c1).mirror(0xaf00).r(FUNC(alibaba_state::mystery_2_r));
map(0x50c2, 0x50ff).mirror(0xaf00).r(FUNC(alibaba_state::pacman_read_nop));
map(0x8000, 0x8fff).rom();
map(0x9000, 0x93ff).mirror(0x0c00).ram();
map(0xa000, 0xa7ff).mirror(0x1800).rom();
@ -1418,7 +1442,6 @@ void pacman_state::crushs_map(address_map &map)
}
void pacman_state::pengojpm_map(address_map &map)
{
map(0x0000, 0x0fff).rom();
@ -3562,52 +3585,71 @@ INPUT_PORTS_END
static const gfx_layout tilelayout =
{
8,8, /* 8*8 characters */
RGN_FRAC(1,2), /* 256 characters */
2, /* 2 bits per pixel */
{ 0, 4 }, /* the two bitplanes for 4 pixels are packed into one byte */
{ 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }, /* bits are packed in groups of four */
8,8, // 8*8 characters
RGN_FRAC(1,2), // 256 characters
2, // 2 bits per pixel
{ 0, 4 }, // the two bitplanes for 4 pixels are packed into one byte
{ 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }, // bits are packed in groups of four
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
16*8 /* every char takes 16 bytes */
16*8 // every char takes 16 bytes
};
static const gfx_layout spritelayout =
{
16,16, /* 16*16 sprites */
RGN_FRAC(1,2), /* 64 sprites */
2, /* 2 bits per pixel */
{ 0, 4 }, /* the two bitplanes for 4 pixels are packed into one byte */
16,16, // 16*16 sprites
RGN_FRAC(1,2), // 64 sprites
2, // 2 bits per pixel
{ 0, 4 }, // the two bitplanes for 4 pixels are packed into one byte
{ 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
64*8 /* every sprite takes 64 bytes */
64*8 // every sprite takes 64 bytes
};
static const gfx_layout alibaba_clocklayout =
{
24,16, // 24*16 characters
RGN_FRAC(1,2),
2,
{ RGN_FRAC(1,2), RGN_FRAC(0,2) },
{
16*8+7, 16*8+6, 16*8+5, 16*8+4, 16*8+3, 16*8+2, 16*8+1, 16*8+0,
8*8+7, 8*8+6, 8*8+5, 8*8+4, 8*8+3, 8*8+2, 8*8+1, 8*8+0,
0*8+7, 0*8+6, 0*8+5, 0*8+4, 0*8+3, 0*8+2, 0*8+1, 0*8+0
},
{
256+0*8, 256+1*8, 256+2*8, 256+3*8, 256+4*8, 256+5*8, 256+6*8, 256+7*8,
0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8
},
32*16 // every char takes 64 bytes
};
static const gfx_layout crush4_tilelayout =
{
8,8, /* 8*8 characters */
8,8, // 8*8 characters
RGN_FRAC(1,4),
2, /* 2 bits per pixel */
2, // 2 bits per pixel
{ RGN_FRAC(1,2), RGN_FRAC(0,2)+4 },
{ 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }, /* bits are packed in groups of four */
{ 8*8+0, 8*8+1, 8*8+2, 8*8+3, 0, 1, 2, 3 }, // bits are packed in groups of four
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
16*8 /* every char takes 16 bytes */
16*8 // every char takes 16 bytes
};
static const gfx_layout crush4_spritelayout =
{
16,16, /* 16*16 sprites */
16,16, // 16*16 sprites
RGN_FRAC(1,4),
2, /* 2 bits per pixel */
2, // 2 bits per pixel
{ RGN_FRAC(1,2), RGN_FRAC(0,2)+4 },
{ 8*8, 8*8+1, 8*8+2, 8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3,
24*8+0, 24*8+1, 24*8+2, 24*8+3, 0, 1, 2, 3 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8 },
64*8 /* every sprite takes 64 bytes */
64*8 // every sprite takes 64 bytes
};
@ -3623,6 +3665,13 @@ static GFXDECODE_START( gfx_s2650games )
GFXDECODE_END
static GFXDECODE_START( gfx_alibaba )
GFXDECODE_ENTRY( "gfx1", 0x0000, tilelayout, 0, 128 )
GFXDECODE_ENTRY( "gfx1", 0x1000, spritelayout, 0, 128 )
GFXDECODE_ENTRY( "gfx2", 0x0000, alibaba_clocklayout, 0, 128 )
GFXDECODE_END
static GFXDECODE_START( gfx_superabc )
GFXDECODE_ENTRY( "gfx1", 0x0000, tilelayout, 0, 128 )
GFXDECODE_ENTRY( "gfx1", 0x8000, spritelayout, 0, 128 )
@ -3672,11 +3721,11 @@ void pacman_state::pacman(machine_config &config, bool latch)
PALETTE(config, m_palette, FUNC(pacman_state::pacman_palette), 128*4, 32);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
screen.set_screen_update(FUNC(pacman_state::screen_update_pacman));
screen.set_palette("palette");
screen.screen_vblank().set(FUNC(pacman_state::vblank_irq));
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
m_screen->set_screen_update(FUNC(pacman_state::screen_update_pacman));
m_screen->set_palette("palette");
m_screen->screen_vblank().set(FUNC(pacman_state::vblank_irq));
MCFG_VIDEO_START_OVERRIDE(pacman_state,pacman)
@ -3814,23 +3863,29 @@ void pacman_state::numcrash(machine_config &config)
m_mainlatch->q_out_cb<7>().set_nop(); // ???
}
void pacman_state::alibaba(machine_config &config)
void alibaba_state::alibaba(machine_config &config)
{
pacman(config, false);
// Basic machine hardware
m_maincpu->set_addrmap(AS_PROGRAM, &pacman_state::alibaba_map);
m_maincpu->set_addrmap(AS_PROGRAM, &alibaba_state::alibaba_map);
ls259_device &latch1(LS259(config, "latch1"));
latch1.q_out_cb<4>().set_output("led0");
latch1.q_out_cb<5>().set_output("led1");
latch1.q_out_cb<6>().set(FUNC(pacman_state::coin_lockout_global_w));
latch1.q_out_cb<7>().set(FUNC(pacman_state::coin_counter_w));
latch1.q_out_cb<6>().set(FUNC(alibaba_state::coin_lockout_global_w));
latch1.q_out_cb<7>().set(FUNC(alibaba_state::coin_counter_w));
ls259_device &latch2(LS259(config, "latch2"));
latch2.q_out_cb<0>().set("namco", FUNC(namco_device::sound_enable_w));
latch2.q_out_cb<1>().set(FUNC(pacman_state::flipscreen_w));
latch2.q_out_cb<2>().set(FUNC(pacman_state::irq_mask_w));
latch2.q_out_cb<1>().set(FUNC(alibaba_state::flipscreen_w));
latch2.q_out_cb<2>().set(FUNC(alibaba_state::irq_mask_w));
// Video hardware
m_gfxdecode->set_info(gfx_alibaba);
m_screen->set_screen_update(FUNC(alibaba_state::screen_update));
m_screen->screen_vblank().append(FUNC(alibaba_state::mystery_tick));
}
void pacman_state::dremshpr(machine_config &config)
@ -3842,7 +3897,7 @@ void pacman_state::dremshpr(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &pacman_state::dremshpr_portmap);
m_maincpu->remove_irq_acknowledge_callback();
subdevice<screen_device>("screen")->screen_vblank().set(FUNC(pacman_state::vblank_nmi));
m_screen->screen_vblank().set(FUNC(pacman_state::vblank_nmi));
// Sound hardware
config.device_remove("namco");
@ -3902,9 +3957,8 @@ void pacman_state::vanvan(machine_config &config)
m_maincpu->remove_irq_acknowledge_callback();
// Video hardware
screen_device &screen(*subdevice<screen_device>("screen"));
screen.set_visarea(2*8, 34*8-1, 0*8, 28*8-1);
screen.screen_vblank().set(FUNC(pacman_state::vblank_nmi));
m_screen->set_visarea(2*8, 34*8-1, 0*8, 28*8-1);
m_screen->screen_vblank().set(FUNC(pacman_state::vblank_nmi));
// Sound hardware
config.device_remove("namco");
@ -3928,7 +3982,7 @@ void pacman_state::bigbucks(machine_config &config)
m_maincpu->set_periodic_int(FUNC(pacman_state::periodic_irq), attotime::from_hz(20*60));
m_maincpu->remove_irq_acknowledge_callback();
subdevice<screen_device>("screen")->set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
m_screen->set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
m_mainlatch->q_out_cb<7>().set_nop(); /*?*/
}
@ -3956,12 +4010,11 @@ void pacman_state::s2650games(machine_config &config)
m_gfxdecode->set_info(gfx_s2650games);
screen_device &screen(*subdevice<screen_device>("screen"));
screen.set_size(32*8, 32*8);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_screen_update(FUNC(pacman_state::screen_update_s2650games));
screen.screen_vblank().set(FUNC(pacman_state::s2650_interrupt));
m_screen->set_size(32*8, 32*8);
m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
m_screen->set_screen_update(FUNC(pacman_state::screen_update_s2650games));
m_screen->screen_vblank().set(FUNC(pacman_state::s2650_interrupt));
MCFG_VIDEO_START_OVERRIDE(pacman_state,s2650games)
@ -4005,8 +4058,7 @@ void pacman_state::rocktrv2(machine_config &config)
// Basic machine hardware
m_maincpu->set_addrmap(AS_PROGRAM, &pacman_state::rocktrv2_map);
screen_device &screen(*subdevice<screen_device>("screen"));
screen.set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
m_screen->set_visarea(0*8, 36*8-1, 0*8, 28*8-1);
}
@ -4112,7 +4164,6 @@ ROM_START( puckman )
ROM_END
ROM_START( pacmanso )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pm-1r.6e", 0x0000, 0x0800, CRC(76dbed21) SHA1(400e5821aef77c9bb7117b7703afff911786d55a) ) // different
@ -6016,7 +6067,7 @@ ROM_START( mspacmab3 ) // main PCB with GDP-02 auxiliary card
ROM_REGION( 0x0200, "namco", 0 ) // sound PROMs
ROM_LOAD( "63s141.1k", 0x0000, 0x0100, CRC(459d2618) SHA1(14ba61caada575909b4dbd57e7342dc84722325d) )
ROM_IGNORE( 0x0100 ) // 1xxxxxxxx = 0x00
ROM_LOAD( "63s141.3k", 0x0100, 0x0100, CRC(fcc24d5d) SHA1(7ae2523f92cccdbd8db8bda80c613a2f90220807) ) // timing - not used
ROM_LOAD( "63s141.3k", 0x0100, 0x0100, CRC(fcc24d5d) SHA1(7ae2523f92cccdbd8db8bda80c613a2f90220807) ) // Timing - not used
ROM_IGNORE( 0x0100 ) // 11xxxxxxx = 0x00
ROM_REGION( 0x0200, "gdp02_prom", 0 ) // currently not used by the emulation
@ -6787,23 +6838,22 @@ ROM_END
ROM_START( crushrlf )
ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "pin1cc_6e.bin", 0x0400, 0x0400, CRC(65e469cf) SHA1(baeb5ba0ca0d78bca07f7830269f9c079f36d425) )
ROM_CONTINUE( 0x0000, 0x0400 )
ROM_LOAD( "pin5cc_6k.bin", 0x0c00, 0x0400, CRC(15f0415b) SHA1(90c663387a81ad206874a531d9fe631ac0175975) )
ROM_CONTINUE( 0x0800, 0x0400 )
ROM_LOAD( "pin2cc_6f.bin", 0x1400, 0x0400, CRC(653f726d) SHA1(3121315cf3e8be86d29687f29fc514e29dc64a02) )
ROM_CONTINUE(0x1000,0x400)
ROM_CONTINUE( 0x1000, 0x0400 )
ROM_LOAD( "pin6cc_6m.bin", 0x1c00, 0x0400, CRC(4536ea5b) SHA1(6e0b22dd05a76644b13f1c71f771d686cd411eea) )
ROM_CONTINUE(0x1800,0x400)
ROM_CONTINUE( 0x1800, 0x0400 )
ROM_LOAD( "pin3cc_6h.bin", 0x2400, 0x0400, CRC(55e15863) SHA1(bcbf4e5a268739c906e5c400e639e0e055799d47) )
ROM_CONTINUE(0x2000,0x400)
ROM_CONTINUE( 0x2000, 0x0400 )
ROM_LOAD( "pin7cc_6n.bin", 0x2c00, 0x0400, CRC(409111ec) SHA1(ba98cfc1cce8627d11fda4954c3776d0b90cb584) )
ROM_CONTINUE(0x2800,0x400)
ROM_CONTINUE( 0x2800, 0x0400 )
ROM_LOAD( "pin4cc_6j.bin", 0x3400, 0x0400, CRC(4fc4b582) SHA1(cb73b5f9171ba493afdfced0baeef9bb6bdb428d) )
ROM_CONTINUE(0x3000,0x400)
ROM_CONTINUE( 0x3000, 0x0400 )
ROM_LOAD( "pin8cc_6p.bin", 0x3c00, 0x0400, CRC(0d97a047) SHA1(d0024a87a7530246bfbef7d1603b599e2f168973) )
ROM_CONTINUE(0x3800,0x400)
ROM_CONTINUE( 0x3800, 0x0400 )
ROM_REGION( 0x2000, "gfx1", 0 )
ROM_LOAD( "pin9cc_5e.bin", 0x0000, 0x0800, CRC(b6551507) SHA1(a544e6afda0dd1bea526cb94b9c456d923054698))
@ -7663,6 +7713,10 @@ ROM_START( alibaba )
ROM_LOAD( "5f", 0x1000, 0x0800, CRC(b5715c86) SHA1(ed6aee778295b0182d32846b5e41776b5b15420c) )
ROM_LOAD( "5k", 0x1800, 0x0800, CRC(713086b3) SHA1(a1609bae637207a82920678f05bcc10a5ff096de) )
ROM_REGION( 0x1000, "gfx2", 0 )
ROM_LOAD( "ab7.bin", 0x0000, 0x0800, CRC(52294ef5) SHA1(1d76e16c95cb2873d898a4151a902113fccafe1c) ) // 7.p6 dumped as 0x1000 - 1ST AND 2ND HALF IDENTICAL
ROM_RELOAD( 0x0800, 0x0800 )
ROM_REGION( 0x0120, "proms", 0 )
ROM_LOAD( "82s123.e7", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) )
ROM_LOAD( "82s129.a4", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) )
@ -7670,10 +7724,6 @@ ROM_START( alibaba )
ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs
ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) )
ROM_LOAD( "82s126.3m", 0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) ) // Timing - not used
// Unknown, used for the mystery items?
ROM_REGION( 0x1000, "user1", 0 )
ROM_LOAD( "ab7.bin", 0x0000, 0x0800, CRC(52294ef5) SHA1(1d76e16c95cb2873d898a4151a902113fccafe1c) ) // 7.p6 dumped as 0x1000 - 1ST AND 2ND HALF IDENTICAL
ROM_END
@ -7692,6 +7742,10 @@ ROM_START( alibabab )
ROM_LOAD( "5f", 0x1000, 0x0800, CRC(b5715c86) SHA1(ed6aee778295b0182d32846b5e41776b5b15420c) ) // ab9.bin
ROM_LOAD( "5k", 0x1800, 0x0800, CRC(713086b3) SHA1(a1609bae637207a82920678f05bcc10a5ff096de) ) // ab11.bin
ROM_REGION( 0x1000, "gfx2", 0 )
ROM_LOAD( "ab7.bin", 0x0000, 0x0800, CRC(52294ef5) SHA1(1d76e16c95cb2873d898a4151a902113fccafe1c) )
ROM_RELOAD( 0x0800, 0x0800 )
ROM_REGION( 0x0120, "proms", 0 )
ROM_LOAD( "82s123.e7", 0x0000, 0x0020, CRC(2fc650bd) SHA1(8d0268dee78e47c712202b0ec4f1f51109b1f2a5) )
ROM_LOAD( "82s129.a4", 0x0020, 0x0100, CRC(3eb3a8e4) SHA1(19097b5f60d1030f8b82d9f1d3a241f93e5c75d6) )
@ -7699,10 +7753,6 @@ ROM_START( alibabab )
ROM_REGION( 0x0200, "namco", 0 ) // Sound PROMs
ROM_LOAD( "82s126.1m", 0x0000, 0x0100, CRC(a9cc86bf) SHA1(bbcec0570aeceb582ff8238a4bc8546a23430081) )
ROM_LOAD( "82s126.3m", 0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) ) // Timing - not used
// Unknown, used for the mystery items?
ROM_REGION( 0x1000, "user1", 0 )
ROM_LOAD( "ab7.bin", 0x0000, 0x0800, CRC(52294ef5) SHA1(1d76e16c95cb2873d898a4151a902113fccafe1c) )
ROM_END
@ -8333,72 +8383,63 @@ void pacman_state::init_ponpoko()
/* The gfx data is swapped wrt the other Pac-Man hardware games. */
/* Here we revert it to the usual format. */
int i, j;
uint8_t *RAM, temp;
uint8_t *ROM, temp;
int length = memregion("gfx1")->bytes()/2;
/* Characters */
RAM = memregion("gfx1")->base();
for (i = 0;i < length;i += 0x10)
ROM = memregion("gfx1")->base();
for (int i = 0; i < length; i += 0x10)
{
for (j = 0; j < 8; j++)
for (int j = 0; j < 8; j++)
{
temp = RAM[i+j+0x08];
RAM[i+j+0x08] = RAM[i+j+0x00];
RAM[i+j+0x00] = temp;
temp = ROM[i+j+0x08];
ROM[i+j+0x08] = ROM[i+j+0x00];
ROM[i+j+0x00] = temp;
}
}
/* Sprites */
RAM = memregion("gfx1")->base()+length;
for (i = 0;i < length;i += 0x20)
ROM = memregion("gfx1")->base()+length;
for (int i = 0; i < length; i += 0x20)
{
for (j = 0; j < 8; j++)
for (int j = 0; j < 8; j++)
{
temp = RAM[i+j+0x18];
RAM[i+j+0x18] = RAM[i+j+0x10];
RAM[i+j+0x10] = RAM[i+j+0x08];
RAM[i+j+0x08] = RAM[i+j+0x00];
RAM[i+j+0x00] = temp;
temp = ROM[i+j+0x18];
ROM[i+j+0x18] = ROM[i+j+0x10];
ROM[i+j+0x10] = ROM[i+j+0x08];
ROM[i+j+0x08] = ROM[i+j+0x00];
ROM[i+j+0x00] = temp;
}
}
}
void pacman_state::eyes_decode(uint8_t *data)
{
int j;
uint8_t swapbuffer[8];
for (j = 0; j < 8; j++)
{
for (int j = 0; j < 8; j++)
swapbuffer[j] = data[bitswap<16>(j,15,14,13,12,11,10,9,8,7,6,5,4,3,0,1,2)];
}
for (j = 0; j < 8; j++)
{
for (int j = 0; j < 8; j++)
data[j] = bitswap<8>(swapbuffer[j],7,4,5,6,3,2,1,0);
}
}
void pacman_state::init_eyes()
{
/* CPU ROMs */
/* Data lines D3 and D5 swapped */
uint8_t *RAM = memregion("maincpu")->base();
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0; i < 0xc000; i++)
{
RAM[i] = bitswap<8>(RAM[i],7,6,3,4,5,2,1,0);
}
ROM[i] = bitswap<8>(ROM[i],7,6,3,4,5,2,1,0);
/* Graphics ROMs */
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
RAM = memregion("gfx1")->base();
ROM = memregion("gfx1")->base();
int len = memregion("gfx1")->bytes();
for (int i = 0; i < len; i += 8)
eyes_decode(&RAM[i]);
eyes_decode(&ROM[i]);
}
void pacman_state::mspacman_install_patches(uint8_t *ROM)
@ -8453,38 +8494,39 @@ void pacman_state::mspacman_install_patches(uint8_t *ROM)
void pacman_state::init_mspacman()
{
/* CPU ROMs */
// CPU ROMs
/* Pac-Man code is in low bank */
// Pac-Man code is in low bank
uint8_t *ROM = memregion("maincpu")->base();
/* decrypted Ms. Pac-Man code is in high bank */
// decrypted Ms. Pac-Man code is in high bank
uint8_t *DROM = &memregion("maincpu")->base()[0x10000];
/* copy ROMs into decrypted bank */
// copy ROMs into decrypted bank
for (int i = 0; i < 0x1000; i++)
{
DROM[0x0000+i] = ROM[0x0000+i]; /* pacman.6e */
DROM[0x1000+i] = ROM[0x1000+i]; /* pacman.6f */
DROM[0x2000+i] = ROM[0x2000+i]; /* pacman.6h */
DROM[0x3000+i] = bitswap<8>(ROM[0xb000+bitswap<12>(i,11,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt u7 */
DROM[0x0000+i] = ROM[0x0000+i]; // pacman.6e
DROM[0x1000+i] = ROM[0x1000+i]; // pacman.6f
DROM[0x2000+i] = ROM[0x2000+i]; // pacman.6h
DROM[0x3000+i] = bitswap<8>(ROM[0xb000+bitswap<12>(i,11,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); // decrypt u7
}
for (int i = 0; i < 0x800; i++)
{
DROM[0x8000+i] = bitswap<8>(ROM[0x8000+bitswap<11>(i,8,7,5,9,10,6,3,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt u5 */
DROM[0x8800+i] = bitswap<8>(ROM[0x9800+bitswap<11>(i,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt half of u6 */
DROM[0x9000+i] = bitswap<8>(ROM[0x9000+bitswap<11>(i,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt half of u6 */
DROM[0x9800+i] = ROM[0x1800+i]; /* mirror of pacman.6f high */
DROM[0x8000+i] = bitswap<8>(ROM[0x8000+bitswap<11>(i,8,7,5,9,10,6,3,4,2,1,0)],0,4,5,7,6,3,2,1); // decrypt u5
DROM[0x8800+i] = bitswap<8>(ROM[0x9800+bitswap<11>(i,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); // decrypt half of u6
DROM[0x9000+i] = bitswap<8>(ROM[0x9000+bitswap<11>(i,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); // decrypt half of u6
DROM[0x9800+i] = ROM[0x1800+i]; // mirror of pacman.6f high
}
for (int i = 0; i < 0x1000; i++)
{
DROM[0xa000+i] = ROM[0x2000+i]; /* mirror of pacman.6h */
DROM[0xb000+i] = ROM[0x3000+i]; /* mirror of pacman.6j */
DROM[0xa000+i] = ROM[0x2000+i]; // mirror of pacman.6h
DROM[0xb000+i] = ROM[0x3000+i]; // mirror of pacman.6j
}
/* install patches into decrypted bank */
// install patches into decrypted bank
mspacman_install_patches(DROM);
/* mirror Pac-Man ROMs into upper addresses of normal bank */
// mirror Pac-Man ROMs into upper addresses of normal bank
for (int i = 0; i < 0x1000; i++)
{
ROM[0x8000+i] = ROM[0x0000+i];
@ -8493,7 +8535,7 @@ void pacman_state::init_mspacman()
ROM[0xb000+i] = ROM[0x3000+i];
}
/* initialize the banks */
// initialize the banks
membank("bank1")->configure_entries(0, 2, &ROM[0x00000], 0x10000);
membank("bank1")->set_entry(1);
}
@ -8506,13 +8548,30 @@ void pacman_state::init_mschamp()
void pacman_state::init_woodpek()
{
/* Graphics ROMs */
// Graphics ROMs
/* Data lines D4 and D6 and address lines A0 and A2 are swapped */
uint8_t *RAM = memregion("gfx1")->base();
// Data lines D4 and D6 and address lines A0 and A2 are swapped
uint8_t *ROM = memregion("gfx1")->base();
int len = memregion("gfx1")->bytes();
for (int i = 0; i < len; i += 8)
eyes_decode(&RAM[i]);
eyes_decode(&ROM[i]);
}
void alibaba_state::init_alibaba()
{
uint8_t *ROM = memregion("gfx2")->base();
int len = memregion("gfx2")->bytes();
// reorder clock graphics a bit to make it work with gfxdecode
for (int i = 0; i < len; i++)
{
if ((i & 0x3f) < 0x18)
{
ROM[i] = ROM[i + 8];
ROM[i + 8] = 0;
}
}
}
void pacman_state::init_pacplus()
@ -8536,7 +8595,7 @@ void pacman_state::init_drivfrcp()
void pacman_state::init_8bpm()
{
/* Data lines D0 and D6 swapped */
// Data lines D0 and D6 swapped
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0; i < 0x8000; i++)
{
@ -8551,7 +8610,7 @@ void pacman_state::init_8bpm()
void pacman_state::init_porky()
{
/* Data lines D0 and D4 swapped */
// Data lines D0 and D4 swapped
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0; i < 0x10000; i++)
{
@ -8571,7 +8630,7 @@ void pacman_state::init_porky()
void pacman_state::init_rocktrv2()
{
/* hack to pass the rom check for the bad rom */
// hack to pass the rom check for the bad rom
uint8_t *ROM = memregion("maincpu")->base();
ROM[0x7ffe] = 0xa7;
@ -8580,12 +8639,13 @@ void pacman_state::init_rocktrv2()
save_item(NAME(m_rocktrv2_question_bank));
}
/* The encryption is provided by a 74298 sitting on top of the rom at 6f.
The select line is tied to a2; a0 and a1 of the eprom are are left out of
socket and run through the 74298. Clock is tied to system clock. */
void pacman_state::init_mspacmbe()
{
/* Address lines A1 and A0 swapped if A2=0 */
// The encryption is provided by a 74298 sitting on top of the rom at 6f.
// The select line is tied to a2; a0 and a1 of the eprom are are left out of
// socket and run through the 74298. Clock is tied to system clock.
// Address lines A1 and A0 swapped if A2=0
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0x1000; i < 0x2000; i += 4)
{
@ -8600,7 +8660,7 @@ void pacman_state::init_mspacmbe()
uint8_t pacman_state::mspacii_protection_r(offs_t offset)
{
/* used by extra routine at $3FE, bit 4 of 504d needs to be low, and of 504e to be high */
// used by extra routine at $3FE, bit 4 of 504d needs to be low, and of 504e to be high
uint8_t data = ioport("IN1")->read();
return (data & 0xef) | (offset << 4 & 0x10);
}
@ -8623,8 +8683,8 @@ void pacman_state::init_superabc()
uint8_t pacman_state::cannonbp_protection_r(offs_t offset)
{
/* At 6p where a rom would usually be there is an epoxy resin chip with 'Novomatic Industrie' Cannon Ball tm 1984 label. */
/* As I have no clue about what shall be in this chip, what follows is only a simulation which is enough to play the game. */
// At 6p where a rom would usually be there is an epoxy resin chip with 'Novomatic Industrie' Cannon Ball tm 1984 label.
// As I have no clue about what shall be in this chip, what follows is only a simulation which is enough to play the game.
switch (offset)
{
default:
@ -8654,9 +8714,9 @@ uint8_t pacman_state::cannonbp_protection_r(offs_t offset)
if (m_maincpu->pc() == 0x2b97)
return (BIT(0x46, m_cannonb_bit_to_read--) << 7);
else
return 0xff; /* value taken from the bootlegs */
return 0xff; // value taken from the bootlegs
/* code at 0x2613 : HL += 0xd088 for start position - in the bootlegs, start position = 0x1088 */
// code at 0x2613 : HL += 0xd088 for start position - in the bootlegs, start position = 0x1088
case 0x0105: // player start x position -> register L
return 0x00;
case 0x0107: // player start y position -> register H
@ -8771,6 +8831,7 @@ void epospm_state::init_sprglobp2()
}
}
/*************************************
*
* Game drivers
@ -8911,8 +8972,8 @@ GAME( 1982, ponpoko, 0, woodpek, ponpoko, pacman_state, init_ponpoko,
GAME( 1982, ponpokov, ponpoko, woodpek, ponpoko, pacman_state, init_ponpoko, ROT0, "Sigma Enterprises Inc. (Venture Line license)", "Ponpoko (Venture Line)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, candory, ponpoko, woodpek, ponpoko, pacman_state, init_ponpoko, ROT0, "bootleg", "Candory (Ponpoko bootleg with Mario)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, alibaba, 0, alibaba, alibaba, pacman_state, empty_init, ROT90, "Sega", "Ali Baba and 40 Thieves", MACHINE_UNEMULATED_PROTECTION | MACHINE_SUPPORTS_SAVE )
GAME( 1982, alibabab, alibaba, alibaba, alibaba, pacman_state, empty_init, ROT90, "bootleg", "Mustafa and 40 Thieves (bootleg)", MACHINE_UNEMULATED_PROTECTION | MACHINE_SUPPORTS_SAVE )
GAME( 1982, alibaba, 0, alibaba, alibaba, alibaba_state, init_alibaba, ROT90, "Sega", "Ali Baba and 40 Thieves", MACHINE_SUPPORTS_SAVE )
GAME( 1982, alibabab, alibaba, alibaba, alibaba, alibaba_state, init_alibaba, ROT90, "bootleg", "Mustafa and 40 Thieves (bootleg)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, dremshpr, 0, dremshpr, dremshpr, pacman_state, empty_init, ROT270, "Sanritsu", "Dream Shopper", MACHINE_SUPPORTS_SAVE )

View File

@ -37,11 +37,11 @@ public:
, m_rocktrv2_prot_data(*this, "rocktrv2_prot")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
, m_screen(*this, "screen")
{ }
protected:
void _8bpm_portmap(address_map &map) ATTR_COLD;
void alibaba_map(address_map &map) ATTR_COLD;
void bigbucks_map(address_map &map) ATTR_COLD;
void bigbucks_portmap(address_map &map) ATTR_COLD;
void birdiy_map(address_map &map) ATTR_COLD;
@ -82,9 +82,9 @@ protected:
optional_shared_ptr<uint8_t> m_rocktrv2_prot_data;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<screen_device> m_screen;
uint8_t m_cannonb_bit_to_read = 0;
int m_mystery = 0;
uint8_t m_counter = 0;
int m_bigbucks_bank = 0;
uint8_t m_rocktrv2_question_bank = 0;
@ -111,9 +111,6 @@ protected:
IRQ_CALLBACK_MEMBER(interrupt_vector_r);
void coin_counter_w(int state);
void coin_lockout_global_w(int state);
void alibaba_sound_w(offs_t offset, uint8_t data);
uint8_t alibaba_mystery_1_r();
uint8_t alibaba_mystery_2_r();
void maketrax_protection_w(uint8_t data);
uint8_t mbrush_prot_r(offs_t offset);
uint8_t maketrax_special_port2_r(offs_t offset);
@ -194,6 +191,7 @@ protected:
DECLARE_MACHINE_RESET(maketrax);
DECLARE_VIDEO_START(pengo);
DECLARE_VIDEO_START(jrpacman);
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_s2650games(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vblank_irq(int state);
@ -230,7 +228,6 @@ public:
void _8bpm(machine_config &config);
void crush2(machine_config &config);
void korosuke(machine_config &config);
void alibaba(machine_config &config);
void drivfrcp(machine_config &config);
void pengojpm(machine_config &config);
void piranha(machine_config &config);
@ -246,10 +243,43 @@ private:
};
class alibaba_state : public pacman_state
{
public:
alibaba_state(const machine_config &mconfig, device_type type, const char *tag)
: pacman_state(mconfig, type, tag)
{ }
void alibaba(machine_config &config);
void init_alibaba();
protected:
virtual void machine_start() override ATTR_COLD;
private:
uint8_t m_mystery_control = 0;
uint8_t m_mystery_clock = 0;
uint8_t m_mystery_prescaler = 0;
void mystery_tick(int state);
uint8_t mystery_1_r();
uint8_t mystery_2_r();
void mystery_w(uint8_t data);
void sound_w(offs_t offset, uint8_t data);
void alibaba_map(address_map &map) ATTR_COLD;
void draw_clock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
};
class epospm_state : public pacman_state
{
public:
using pacman_state::pacman_state;
epospm_state(const machine_config &mconfig, device_type type, const char *tag)
: pacman_state(mconfig, type, tag)
{ }
void acitya(machine_config &config);
void theglobp(machine_config &config);
@ -297,7 +327,6 @@ class mspactwin_state : public clubpacm_state
public:
mspactwin_state(const machine_config &mconfig, device_type type, const char *tag)
: clubpacm_state(mconfig, type, tag)
, m_screen(*this, "screen")
, m_decrypted_opcodes(*this, "decrypted_opcodes")
, m_decrypted_opcodes_high(*this, "decrypted_opcodes_high")
{ }
@ -308,9 +337,6 @@ public:
void flipscreen_w(int state);
private:
required_device<screen_device> m_screen;
protected:
void mspactwin_map(address_map &map) ATTR_COLD;
void mspactwin_decrypted_map(address_map &map) ATTR_COLD;

View File

@ -185,6 +185,7 @@ TILE_GET_INFO_MEMBER(pacman_state::pacman_get_tile_info)
tileinfo.set(0, code, attr, 0);
}
/***************************************************************************
Start the video hardware emulation.
@ -264,25 +265,23 @@ void mspactwin_state::flipscreen_w(int state)
}
uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (m_bgpriority != 0)
bitmap.fill(0, cliprect);
else
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
/*************************************************************************
if (m_spriteram != nullptr)
Screen update
**************************************************************************/
void pacman_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint8_t *spriteram = m_spriteram;
uint8_t *spriteram_2 = m_spriteram2;
int offs;
rectangle spriteclip(2*8, 34*8-1, 0*8, 28*8-1);
spriteclip &= cliprect;
/* Draw the sprites. Note that it is important to draw them exactly in this */
/* order, to have the correct priorities. */
for (offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2)
for (int offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2)
{
int color;
int sx,sy;
@ -319,9 +318,10 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16
sx - 256,sy,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color & 0x3f, 0));
}
/* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
/* one pixel to the left to get a more correct placement */
for (offs = 2*2; offs >= 0; offs -= 2)
for (int offs = 2*2; offs >= 0; offs -= 2)
{
int color;
int sx,sy;
@ -359,8 +359,80 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16
}
}
uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
if (m_bgpriority != 0)
bitmap.fill(0, cliprect);
else
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
if (m_spriteram != nullptr)
draw_sprites(screen, bitmap, cliprect);
if (m_bgpriority != 0)
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
/*************************************************************************
Sega Ali Baba
**************************************************************************/
void alibaba_state::draw_clock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// inactive half
if (m_mystery_clock <= 16)
{
int x = 120;
int y = 112;
if (m_flipscreen)
{
x = 264 - x;
y = 208 - y;
}
m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, 0x1f, 1, 0, 0, x, y, 0);
}
// active half
int x = 120;
int y = 96 + (m_mystery_clock & 0x10);
int fx = 0, fy = 0;
if (m_flipscreen)
{
x = 264 - x;
y = 208 - y;
fx = !fx;
fy = !fy;
}
m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, m_mystery_clock ^ 0x1f, 1, fx, fy, x, y, 0);
}
uint32_t alibaba_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
// sprites clipped area is larger than with pacman
rectangle spriteclip = cliprect;
if (m_flipscreen)
spriteclip.min_x = 6*8;
else
spriteclip.max_x = 30*8-1;
spriteclip &= cliprect;
draw_sprites(screen, bitmap, spriteclip);
// draw the mystery item clock
if (m_mystery_control & 2)
draw_clock(screen, bitmap, cliprect);
return 0;
}
@ -415,12 +487,9 @@ S2650 Games
TILE_GET_INFO_MEMBER(pacman_state::s2650_get_tile_info)
{
int colbank, code, attr;
colbank = m_s2650games_tileram[tile_index & 0x1f] & 0x3;
code = m_videoram[tile_index] + (colbank << 8);
attr = m_colorram[tile_index & 0x1f];
int colbank = m_s2650games_tileram[tile_index & 0x1f] & 0x3;
int code = m_videoram[tile_index] + (colbank << 8);
int attr = m_colorram[tile_index & 0x1f];
tileinfo.set(0, code, attr & 0x1f, 0);
}
@ -447,16 +516,14 @@ uint32_t pacman_state::screen_update_s2650games(screen_device &screen, bitmap_in
{
uint8_t *spriteram = m_spriteram;
uint8_t *spriteram_2 = m_spriteram2;
int offs;
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);
for (offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2)
for (int offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2)
{
int color;
int sx,sy;
sx = 255 - spriteram_2[offs + 1];
sy = spriteram_2[offs] - 15;
color = spriteram[offs + 1] & 0x1f;
@ -469,14 +536,14 @@ uint32_t pacman_state::screen_update_s2650games(screen_device &screen, bitmap_in
sx,sy,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color & 0x3f, 0));
}
/* In the Pac Man based games (NOT Pengo) the first two sprites must be offset */
/* one pixel to the left to get a more correct placement */
for (offs = 2*2;offs >= 0;offs -= 2)
for (int offs = 2*2;offs >= 0;offs -= 2)
{
int color;
int sx,sy;
sx = 255 - spriteram_2[offs + 1];
sy = spriteram_2[offs] - 15;
color = spriteram[offs + 1] & 0x1f;
@ -489,6 +556,7 @@ uint32_t pacman_state::screen_update_s2650games(screen_device &screen, bitmap_in
sx,sy + m_xoffsethack,
m_palette->transpen_mask(*m_gfxdecode->gfx(1), color & 0x3f, 0));
}
return 0;
}
@ -500,9 +568,8 @@ void pacman_state::s2650games_videoram_w(offs_t offset, uint8_t data)
void pacman_state::s2650games_colorram_w(offs_t offset, uint8_t data)
{
int i;
m_colorram[offset & 0x1f] = data;
for (i = offset; i < 0x0400; i += 32)
for (int i = offset; i < 0x0400; i += 32)
m_bg_tilemap->mark_tile_dirty(i);
}
@ -554,7 +621,7 @@ TILEMAP_MAPPER_MEMBER(pacman_state::jrpacman_scan_rows)
TILE_GET_INFO_MEMBER(pacman_state::jrpacman_get_tile_info)
{
int color_index, code, attr;
int color_index;
if (tile_index < 1792)
{
color_index = tile_index & 0x1f;
@ -564,8 +631,8 @@ TILE_GET_INFO_MEMBER(pacman_state::jrpacman_get_tile_info)
color_index = tile_index + 0x80;
}
code = m_videoram[tile_index] | (m_charbank << 8);
attr = (m_videoram[color_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);
int code = m_videoram[tile_index] | (m_charbank << 8);
int attr = (m_videoram[color_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6);
tileinfo.set(0, code, attr, 0);
}

View File

@ -23,7 +23,6 @@ uint8_t pacman_state::pacplus_decrypt(int addr, uint8_t e)
uint32_t method = 0;
const uint8_t *tbl;
/* pick method from bits 0 2 5 7 9 of the address */
method = picktable[
(addr & 0x001) |
@ -43,14 +42,10 @@ uint8_t pacman_state::pacplus_decrypt(int addr, uint8_t e)
void pacman_state::pacplus_decode()
{
int i;
uint8_t *RAM;
/* CPU ROMs */
RAM = memregion("maincpu")->base();
for (i = 0; i < 0x4000; i++)
uint8_t *ROM = memregion("maincpu")->base();
for (int i = 0; i < 0x4000; i++)
{
RAM[i] = pacplus_decrypt(i,RAM[i]);
ROM[i] = pacplus_decrypt(i, ROM[i]);
}
}

View File

@ -395,11 +395,11 @@ void pengo_state::pengo(machine_config &config)
GFXDECODE(config, m_gfxdecode, m_palette, gfx_pengo);
PALETTE(config, m_palette, FUNC(pengo_state::pacman_palette), 128 * 4, 32);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
screen.set_screen_update(FUNC(pengo_state::screen_update_pacman));
screen.set_palette(m_palette);
screen.screen_vblank().set(FUNC(pengo_state::vblank_irq));
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(PIXEL_CLOCK, HTOTAL, HBEND, HBSTART, VTOTAL, VBEND, VBSTART);
m_screen->set_screen_update(FUNC(pengo_state::screen_update_pacman));
m_screen->set_palette(m_palette);
m_screen->screen_vblank().set(FUNC(pengo_state::vblank_irq));
MCFG_VIDEO_START_OVERRIDE(pengo_state,pengo)
@ -734,7 +734,6 @@ ROM_END
*
*************************************/
void pengo_state::decode_pengo6(int end, int nodecend)
{
/*