From 36b2294bd5a5900680a136e4f7de15a862fc3867 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 11 May 2021 17:30:17 +0200 Subject: pacman: mark mspactwin as a hack --- src/mame/drivers/namcos22.cpp | 6 +-- src/mame/drivers/pacman.cpp | 88 ++++++++++++++++++------------------------- src/mame/includes/pacman.h | 8 +--- src/mame/video/pacman.cpp | 68 ++++++++++++++++----------------- 4 files changed, 73 insertions(+), 97 deletions(-) diff --git a/src/mame/drivers/namcos22.cpp b/src/mame/drivers/namcos22.cpp index d96ba5f0483..ec1aa640991 100644 --- a/src/mame/drivers/namcos22.cpp +++ b/src/mame/drivers/namcos22.cpp @@ -2888,10 +2888,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(namcos22s_state::propcycl_pedal_update) if (pedal != 0) { - // the pedal has a simple 1-bit "light interrupted" sensor. the faster you pedal, - // the faster it pulses. this is connected to the clock input for timer A3, + // The pedal has a simple 1-bit "light interrupted" sensor. The faster you pedal, + // the faster it pulses. This is connected to the clock input for timer A3, // and timer A3 is configured by the MCU program to cause an interrupt each time - // it's clocked. by counting the number of interrupts in a frame, we can determine + // it's clocked. By counting the number of interrupts in a frame, it can determine // how fast the user is pedaling. // these values(in usec) may need tweaking: diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp index 2dc0dd20629..5eec52304b3 100644 --- a/src/mame/drivers/pacman.cpp +++ b/src/mame/drivers/pacman.cpp @@ -31,8 +31,10 @@ * Pacman Club / Club Lambada * Eeekk! - Known issues: + 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 Known to exist but dumps needed * Ms Pac Plus @@ -1137,12 +1139,12 @@ void mspactwin_state::mspactwin_map(address_map &map) { map(0x0000, 0x1fff).rom(); map(0x2000, 0x3fff).mirror(0x4000).rom(); - map(0x4000, 0x43ff).mirror(0xa000).mirror(0x8000).ram().w(FUNC(mspactwin_state::mspactwin_videoram_w)).share("videoram"); - map(0x4400, 0x47ff).mirror(0xa000).mirror(0x8000).ram().w(FUNC(mspactwin_state::pacman_colorram_w)).share("colorram"); + map(0x4000, 0x43ff).mirror(0x8000).ram().w(FUNC(mspactwin_state::mspactwin_videoram_w)).share("videoram"); + map(0x4400, 0x47ff).mirror(0x8000).ram().w(FUNC(mspactwin_state::pacman_colorram_w)).share("colorram"); map(0x4800, 0x4bff).mirror(0xa000).r(FUNC(mspactwin_state::pacman_read_nop)).nopw(); map(0x4c00, 0x4fef).mirror(0xa000).ram(); map(0x4ff0, 0x4fff).mirror(0xa000).ram().share("spriteram"); - map(0x5000, 0x5007).mirror(0xaf38).mirror(0x0030).w(m_mainlatch, FUNC(ls259_device::write_d0)); + map(0x5000, 0x5007).mirror(0x0030).w(m_mainlatch, FUNC(ls259_device::write_d0)); map(0x5040, 0x505f).mirror(0xaf00).w(m_namco_sound, FUNC(namco_device::pacman_sound_w)); map(0x5060, 0x506f).mirror(0xaf00).writeonly().share("spriteram2"); map(0x5070, 0x507f).mirror(0xaf00).nopw(); @@ -1157,8 +1159,8 @@ void mspactwin_state::mspactwin_map(address_map &map) void mspactwin_state::mspactwin_decrypted_map(address_map &map) { - map(0x0000, 0x3fff).rom().share("decrypted_opcodes"); - map(0x6000, 0x7fff).rom().share("decrypted_opcodes_mirror"); + map(0x0000, 0x3fff).mirror(0x4000).rom().share("decrypted_opcodes"); + map(0x4000, 0x5fff).unmapr(); // mirror only 6000-7fff map(0x8000, 0xbfff).rom().share("decrypted_opcodes_high"); } @@ -1663,7 +1665,6 @@ static INPUT_PORTS_START( pacmanpe ) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - INPUT_PORTS_END static INPUT_PORTS_START( pacuman ) @@ -1881,16 +1882,16 @@ static INPUT_PORTS_START( mspactwin ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY - PORT_DIPNAME( 0x10, 0x10, "Jama" ) + PORT_DIPNAME( 0x10, 0x10, "Jama" ) // Speed PORT_DIPSETTING( 0x10, "Slow" ) PORT_DIPSETTING( 0x00, "Fast" ) PORT_MODIFY("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL - PORT_DIPNAME( 0x80, 0x80, "Skip Screen" ) // Used to skip level + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) + PORT_DIPNAME( 0x80, 0x80, "Skip Screen" ) // Used to skip level PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) @@ -1901,7 +1902,7 @@ static INPUT_PORTS_START( mspactwin ) PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_MODIFY("DSW1") - PORT_DIPNAME( 0x0C, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:3,4") + PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW:3,4") PORT_DIPSETTING( 0x00, "1" ) PORT_DIPSETTING( 0x04, "2" ) PORT_DIPSETTING( 0x08, "3" ) @@ -1911,7 +1912,6 @@ static INPUT_PORTS_START( mspactwin ) PORT_DIPSETTING( 0x10, "15000" ) PORT_DIPSETTING( 0x20, "20000" ) PORT_DIPSETTING( 0x30, "None" ) - INPUT_PORTS_END static INPUT_PORTS_START( superabc ) @@ -4783,10 +4783,10 @@ ROM_END /***************************************************************************** - Ms PacMan Twin (SUSILU) - ----------------------- + Ms Pac Man Twin (SUSILU) + ------------------------ - Argentine official hack of Ms. PacMan that allows 2 players simultaneously. + Argentine official hack of Ms. Pac-Man that allows 2 players simultaneously. Very rare PCB. Was avoiding us for more of 22 years... The mainboard is a PacMan bootleg PCB, with a mini daughterboard (normal in mspacman boards) plugged in the Z80 socket. @@ -7876,19 +7876,10 @@ void pacman_state::init_eyes() eyes_decode(&RAM[i]); } - -#define BITSWAP12(val,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \ - bitswap<16>(val,15,14,13,12,B11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) - -#define BITSWAP11(val,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) \ - bitswap<16>(val,15,14,13,12,11,B10,B9,B8,B7,B6,B5,B4,B3,B2,B1,B0) - void pacman_state::mspacman_install_patches(uint8_t *ROM) { - int i; - /* copy forty 8-byte patches into Pac-Man code */ - for (i = 0; i < 8; i++) + for (int i = 0; i < 8; i++) { ROM[0x0410+i] = ROM[0x8008+i]; ROM[0x08E0+i] = ROM[0x81D8+i]; @@ -7951,13 +7942,13 @@ void pacman_state::init_mspacman() 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+BITSWAP12(i,11,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt u7 */ + 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+BITSWAP11(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+BITSWAP12(i,11,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+BITSWAP12(i,11,3,7,9,10,8,6,5,4,2,1,0)],0,4,5,7,6,3,2,1); /* decrypt half of u6 */ + 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++) @@ -8070,15 +8061,15 @@ 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 */ - uint8_t *RAM = memregion("maincpu")->base(); + uint8_t *ROM = memregion("maincpu")->base(); for (int i = 0x1000; i < 0x2000; i += 4) { if (!(i & 8)) { - uint8_t temp = RAM[i+1]; - RAM[i+1] = RAM[i+2]; - RAM[i+2] = temp; - }; + uint8_t temp = ROM[i+1]; + ROM[i+1] = ROM[i+2]; + ROM[i+2] = temp; + } } } @@ -8183,8 +8174,8 @@ void mspactwin_state::init_mspactwin() { uint8_t *rom = memregion("maincpu")->base(); - for (int A = 0x0000; A < 0x4000; A+=2) { - + for (int A = 0x0000; A < 0x4000; A+=2) + { // decode opcode m_decrypted_opcodes [A ] = bitswap<8>(rom[ A ] , 4, 5, 6, 7, 0, 1, 2, 3); m_decrypted_opcodes [A+1] = bitswap<8>(rom[ A+1] ^ 0x9A, 6, 4, 5, 7, 2, 0, 3, 1); @@ -8196,13 +8187,7 @@ void mspactwin_state::init_mspactwin() rom[ A+1] = bitswap<8>(rom[ A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); rom[0x8000+A ] = bitswap<8>(rom[0x8000+A ] , 0, 1, 2, 3, 4, 5, 6, 7); rom[0x8000+A+1] = bitswap<8>(rom[0x8000+A+1] ^ 0xA3, 2, 4, 6, 3, 7, 0, 5, 1); - - } - - for (int A = 0x0000; A < 0x2000; A++) { - m_decrypted_opcodes_mirror[A] = m_decrypted_opcodes[A+0x2000]; } - } @@ -8230,9 +8215,9 @@ GAME( 1980, newpuc2b, puckman, pacman, pacman, pacman_state, empty_init, GAME( 1980, newpuckx, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "New Puck-X", MACHINE_SUPPORTS_SAVE ) GAME( 1981, pacheart, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Pac-Man (Hearts)", MACHINE_SUPPORTS_SAVE ) GAME( 198?, bucaner, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Buccaneer", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, hangly, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Hangly-Man (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, hangly2, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Hangly-Man (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, hangly3, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Hangly-Man (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hangly, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack (Igleck)", "Hangly-Man (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hangly2, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack (Igleck)", "Hangly-Man (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, hangly3, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack (Igleck)", "Hangly-Man (set 3)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, baracuda, puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack (Coinex)", "Barracuda", MACHINE_SUPPORTS_SAVE ) GAME( 1981, popeyeman,puckman, pacman, pacman, pacman_state, empty_init, ROT90, "hack", "Popeye-Man", MACHINE_SUPPORTS_SAVE ) GAME( 1980, pacuman, puckman, pacman, pacuman, pacman_state, empty_init, ROT90, "bootleg (Recreativos Franco S.A.)", "Pacu-Man (Spanish bootleg of Puck Man)", MACHINE_SUPPORTS_SAVE ) // common bootleg in Spain, code is shifted a bit compared to the Puck Man sets. Title & Manufacturer info from cabinet/PCB, not displayed ingame @@ -8283,11 +8268,10 @@ GAME( 1992, mspacmanbco, mspacman, woodpek, mspacman, pacman_state, empty_init GAME( 1993, mspacmanbi, mspacman, woodpek, mspacman, pacman_state, empty_init, ROT90, "bootleg (Impeuropex)", "Ms. Pac-Man (Impeuropex bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 198?, pacmansp, puckman, pacman, pacmansp, pacman_state, empty_init, ROT90, "bootleg (Video Game SA)", "Puck Man (Spanish, 'Made in Greece' bootleg)", MACHINE_SUPPORTS_SAVE ) // probably a further conversion of the mspacmanbg bootleg, still has some MS Pacman code + extra features +GAME( 1992, mspactwin, 0, mspactwin, mspactwin, mspactwin_state, init_mspactwin, ROT90, "hack (Susilu)", "Ms Pac Man Twin (Argentina)", MACHINE_SUPPORTS_SAVE ) -GAME( 1992, mspactwin, 0, mspactwin, mspactwin, mspactwin_state, init_mspactwin, ROT90, "SUSILU", "Ms PacMan Twin (Argentina)", MACHINE_SUPPORTS_SAVE ) - -GAME( 1989, clubpacm, 0, clubpacm, clubpacm, clubpacm_state, empty_init, ROT90, "Miky SRL", "Pacman Club / Club Lambada (Argentina)", MACHINE_SUPPORTS_SAVE ) -GAME( 1990, clubpacma, clubpacm, clubpacm, clubpacma, clubpacm_state, init_clubpacma, ROT90, "Miky SRL", "Pacman Club (Argentina)", MACHINE_SUPPORTS_SAVE ) +GAME( 1989, clubpacm, 0, clubpacm, clubpacm, clubpacm_state, empty_init, ROT90, "hack (Miky SRL)", "Pacman Club / Club Lambada (Argentina)", MACHINE_SUPPORTS_SAVE ) +GAME( 1990, clubpacma, clubpacm, clubpacm, clubpacma, clubpacm_state, init_clubpacma, ROT90, "hack (Miky SRL)", "Pacman Club (Argentina)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, jumpshot, 0, pacman, jumpshot, pacman_state, init_jumpshot, ROT90, "Bally Midway", "Jump Shot", MACHINE_SUPPORTS_SAVE ) GAME( 1985, jumpshotp,jumpshot, pacman, jumpshotp,pacman_state, init_jumpshot, ROT90, "Bally Midway", "Jump Shot Engineering Sample", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h index 29d870394d9..e718ee849d5 100644 --- a/src/mame/includes/pacman.h +++ b/src/mame/includes/pacman.h @@ -300,7 +300,6 @@ public: : clubpacm_state(mconfig, type, tag) , m_screen(*this, "screen") , m_decrypted_opcodes(*this, "decrypted_opcodes") - , m_decrypted_opcodes_mirror(*this, "decrypted_opcodes_mirror") , m_decrypted_opcodes_high(*this, "decrypted_opcodes_high") { } @@ -314,16 +313,13 @@ private: required_device m_screen; protected: - void mspactwin_map(address_map &map); void mspactwin_decrypted_map(address_map &map); void mspactwin_videoram_w(offs_t offset, uint8_t data); - optional_shared_ptr m_decrypted_opcodes; - optional_shared_ptr m_decrypted_opcodes_mirror; - optional_shared_ptr m_decrypted_opcodes_high; - + required_shared_ptr m_decrypted_opcodes; + required_shared_ptr m_decrypted_opcodes_high; }; diff --git a/src/mame/video/pacman.cpp b/src/mame/video/pacman.cpp index 9a4ceaaf21a..0bdf54ed8f9 100644 --- a/src/mame/video/pacman.cpp +++ b/src/mame/video/pacman.cpp @@ -22,8 +22,6 @@ #include "includes/pacman.h" #include "video/resnet.h" - - /*************************************************************************** Convert the color PROMs into a more useable format. @@ -133,7 +131,7 @@ TILEMAP_MAPPER_MEMBER(pacman_state::pacman_scan_rows) TILE_GET_INFO_MEMBER(pacman_state::pacman_get_tile_info) { int code = m_videoram[tile_index] | (m_charbank << 8); - int attr = (m_colorram[tile_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6 ); + int attr = (m_colorram[tile_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6); tileinfo.set(0,code,attr,0); } @@ -179,7 +177,7 @@ VIDEO_START_MEMBER(pacman_state,pacman) VIDEO_START_MEMBER(pacman_state,birdiy) { - VIDEO_START_CALL_MEMBER( pacman ); + VIDEO_START_CALL_MEMBER(pacman); m_xoffsethack = 0; m_inv_spr = 1; // sprites are mirrored in X-axis compared to normal behaviour } @@ -187,33 +185,32 @@ VIDEO_START_MEMBER(pacman_state,birdiy) void pacman_state::pacman_videoram_w(offs_t offset, uint8_t data) { m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset ); + m_bg_tilemap->mark_tile_dirty(offset); } void pacman_state::pacman_colorram_w(offs_t offset, uint8_t data) { m_colorram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset ); + m_bg_tilemap->mark_tile_dirty(offset); } WRITE_LINE_MEMBER(pacman_state::flipscreen_w) { m_flipscreen = state; - m_bg_tilemap->set_flip(m_flipscreen * ( TILEMAP_FLIPX + TILEMAP_FLIPY ) ); + m_bg_tilemap->set_flip(m_flipscreen * (TILEMAP_FLIPX + TILEMAP_FLIPY)); } void mspactwin_state::mspactwin_videoram_w(offs_t offset, uint8_t data) { - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset ); - m_screen->update_partial(m_screen->vpos()); + m_screen->update_now(); // titlescreen + pacman_videoram_w(offset, data); } WRITE_LINE_MEMBER(mspactwin_state::flipscreen_w) { m_flipscreen = state; - m_bg_tilemap->set_flip(m_flipscreen * ( TILEMAP_FLIPX + TILEMAP_FLIPY ) ); + m_bg_tilemap->set_flip(m_flipscreen * (TILEMAP_FLIPX + TILEMAP_FLIPY)); // logerror("Flip: %02x\n", state); } @@ -223,9 +220,9 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 if (m_bgpriority != 0) bitmap.fill(0, cliprect); else - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - if( m_spriteram != nullptr ) + if (m_spriteram != nullptr) { uint8_t *spriteram = m_spriteram; uint8_t *spriteram_2 = m_spriteram2; @@ -236,7 +233,7 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 /* 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 (offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2) { int color; int sx,sy; @@ -256,10 +253,10 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 fx = (spriteram[offs] & 1) ^ m_inv_spr; fy = (spriteram[offs] & 2) ^ ((m_inv_spr) << 1); - color = ( spriteram[offs + 1] & 0x1f ) | (m_colortablebank << 5) | (m_palettebank << 6 ); + color = (spriteram[offs + 1] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6); m_gfxdecode->gfx(1)->transmask(bitmap,spriteclip, - ( spriteram[offs] >> 2 ) | (m_spritebank << 6), + (spriteram[offs] >> 2) | (m_spritebank << 6), color, fx,fy, sx,sy, @@ -267,7 +264,7 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 /* also plot the sprite with wraparound (tunnel in Crush Roller) */ m_gfxdecode->gfx(1)->transmask(bitmap,spriteclip, - ( spriteram[offs] >> 2 ) | (m_spritebank << 6), + (spriteram[offs] >> 2) | (m_spritebank << 6), color, fx,fy, sx - 256,sy, @@ -275,7 +272,7 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 } /* 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 (offs = 2*2; offs >= 0; offs -= 2) { int color; int sx,sy; @@ -291,13 +288,13 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 sx = 272 - spriteram_2[offs + 1]; sy = spriteram_2[offs] - 31; } - color = ( spriteram[offs + 1] & 0x1f ) | (m_colortablebank << 5) | (m_palettebank << 6 ); + color = (spriteram[offs + 1] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6); fx = (spriteram[offs] & 1) ^ m_inv_spr; fy = (spriteram[offs] & 2) ^ ((m_inv_spr) << 1); m_gfxdecode->gfx(1)->transmask(bitmap,spriteclip, - ( spriteram[offs] >> 2 ) | (m_spritebank << 6), + (spriteram[offs] >> 2) | (m_spritebank << 6), color, fx,fy, sx,sy + m_xoffsethack, @@ -305,7 +302,7 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 /* also plot the sprite with wraparound (tunnel in Crush Roller) */ m_gfxdecode->gfx(1)->transmask(bitmap,spriteclip, - ( spriteram[offs] >> 2 ) | (m_spritebank << 6), + (spriteram[offs] >> 2) | (m_spritebank << 6), color, fx,fy, sx - 256,sy + m_xoffsethack, @@ -314,7 +311,7 @@ uint32_t pacman_state::screen_update_pacman(screen_device &screen, bitmap_ind16 } if (m_bgpriority != 0) - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -405,7 +402,7 @@ uint32_t pacman_state::screen_update_s2650games(screen_device &screen, bitmap_in m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - for (offs = m_spriteram.bytes() - 2;offs > 2*2;offs -= 2) + for (offs = m_spriteram.bytes() - 2; offs > 2*2; offs -= 2) { int color; int sx,sy; @@ -509,7 +506,7 @@ TILEMAP_MAPPER_MEMBER(pacman_state::jrpacman_scan_rows) TILE_GET_INFO_MEMBER(pacman_state::jrpacman_get_tile_info) { int color_index, code, attr; - if( tile_index < 1792 ) + if (tile_index < 1792) { color_index = tile_index & 0x1f; } @@ -519,31 +516,31 @@ TILE_GET_INFO_MEMBER(pacman_state::jrpacman_get_tile_info) } code = m_videoram[tile_index] | (m_charbank << 8); - attr = (m_videoram[color_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6 ); + attr = (m_videoram[color_index] & 0x1f) | (m_colortablebank << 5) | (m_palettebank << 6); tileinfo.set(0,code,attr,0); } -void pacman_state::jrpacman_mark_tile_dirty( int offset ) +void pacman_state::jrpacman_mark_tile_dirty(int offset) { - if( offset < 0x20 ) + if (offset < 0x20) { /* line color - mark whole line as dirty */ int i; - for( i = 2 * 0x20; i < 56 * 0x20; i += 0x20 ) + for (i = 2 * 0x20; i < 56 * 0x20; i += 0x20) { - m_bg_tilemap->mark_tile_dirty(offset + i ); + m_bg_tilemap->mark_tile_dirty(offset + i); } } else if (offset < 1792) { /* tiles for playfield */ - m_bg_tilemap->mark_tile_dirty(offset ); + m_bg_tilemap->mark_tile_dirty(offset); } else { /* tiles & colors for top and bottom two rows */ - m_bg_tilemap->mark_tile_dirty(offset & ~0x80 ); + m_bg_tilemap->mark_tile_dirty(offset & ~0x80); } } @@ -562,8 +559,8 @@ VIDEO_START_MEMBER(pacman_state,jrpacman) m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(pacman_state::jrpacman_get_tile_info)), tilemap_mapper_delegate(*this, FUNC(pacman_state::jrpacman_scan_rows)), 8, 8, 36, 54); - m_bg_tilemap->set_transparent_pen(0 ); - m_bg_tilemap->set_scroll_cols(36 ); + m_bg_tilemap->set_transparent_pen(0); + m_bg_tilemap->set_scroll_cols(36); } void pacman_state::jrpacman_videoram_w(offs_t offset, uint8_t data) @@ -585,10 +582,9 @@ WRITE_LINE_MEMBER(pacman_state::jrpacman_spritebank_w) void pacman_state::jrpacman_scroll_w(uint8_t data) { - int i; - for( i = 2; i < 34; i++ ) + for (int i = 2; i < 34; i++) { - m_bg_tilemap->set_scrolly(i, data ); + m_bg_tilemap->set_scrolly(i, data); } } -- cgit v1.2.3