summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar MetalliC <0vetal0@gmail.com>2017-12-14 01:29:56 +0200
committerGravatarGravatar GitHub <noreply@github.com>2017-12-14 01:29:56 +0200
commit3fbce8e55b76f1767f538867b834e5189510d6e0 (patch) (github)
treed7aa417b1bc5ca097aed88c69c34f3d6ee3c2b5c
parent8bfcc5c50ed11edb03481cee105696ff874f63d2 (diff)
parent3af3f197475ee8b77e35be93e8b79aeb22514bfb (diff)
downloadmame-3fbce8e55b76f1767f538867b834e5189510d6e0.tar.bz2
mame-3fbce8e55b76f1767f538867b834e5189510d6e0.zip
Merge pull request #2932 from DavidHaywood/101217
* pgm2: fix end of sprite list handling (nw) * pgm2: dynamic resolution change (nw) * pgm2: fix bug in yzoom code causing hang (nw)
-rw-r--r--src/mame/drivers/pgm2.cpp11
-rw-r--r--src/mame/includes/pgm2.h2
-rw-r--r--src/mame/video/pgm2.cpp16
3 files changed, 25 insertions, 4 deletions
diff --git a/src/mame/drivers/pgm2.cpp b/src/mame/drivers/pgm2.cpp
index f7b2cdd139d..311f3dc9897 100644
--- a/src/mame/drivers/pgm2.cpp
+++ b/src/mame/drivers/pgm2.cpp
@@ -356,6 +356,7 @@ static ADDRESS_MAP_START( pgm2_map, AS_PROGRAM, 32, pgm2_state )
AM_RANGE(0x30120000, 0x30120003) AM_RAM AM_SHARE("bgscroll") // scroll
AM_RANGE(0x30120008, 0x3012000b) AM_RAM AM_SHARE("fgscroll")
+ AM_RANGE(0x3012000c, 0x3012000f) AM_RAM AM_SHARE("vidmode")
AM_RANGE(0x30120030, 0x30120033) AM_WRITE16(share_bank_w, 0xffff0000)
AM_RANGE(0x30120038, 0x3012003b) AM_WRITE(sprite_encryption_w)
// there are other 0x301200xx regs
@@ -570,10 +571,16 @@ static MACHINE_CONFIG_START( pgm2 )
MCFG_PGM2_MEMCARD_ADD("memcard_p2")
MCFG_PGM2_MEMCARD_ADD("memcard_p3")
MCFG_PGM2_MEMCARD_ADD("memcard_p4")
+MACHINE_CONFIG_END
-
+// not strictly needed as the video code supports changing on the fly, but makes recording easier etc.
+static MACHINE_CONFIG_DERIVED( pgm2_lores, pgm2 )
+ MCFG_SCREEN_MODIFY("screen")
+ // note, +8 to y position too, could be a sprite reg to move sprites intead
+ MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0+8, 224+8-1)
MACHINE_CONFIG_END
+
/* using macros for the video / sound roms because the locations never change between sets, and
we're going to have a LOT of clones to cover all the internal rom regions and external rom revision
combinations, so it keeps things readable */
@@ -1119,7 +1126,7 @@ GAME( 2011, kov3_102, kov3, pgm2, pgm2, pgm2_state, kov3_102, ROT0,
GAME( 2011, kov3_100, kov3, pgm2, pgm2, pgm2_state, kov3_100, ROT0, "IGS", "Knights of Valour 3 (V100, China)", MACHINE_NOT_WORKING )
// King of Fighters '98: Ultimate Match Hero
-GAME( 2009, kof98umh, 0, pgm2, pgm2, pgm2_state, kof98umh, ROT0, "IGS / SNK Playmore / NewChannel", "The King of Fighters '98: Ultimate Match HERO (China, V100, 09-08-23)", MACHINE_NOT_WORKING )
+GAME( 2009, kof98umh, 0, pgm2_lores, pgm2, pgm2_state, kof98umh, ROT0, "IGS / SNK Playmore / NewChannel", "The King of Fighters '98: Ultimate Match HERO (China, V100, 09-08-23)", MACHINE_NOT_WORKING )
// Jigsaw World Arena
diff --git a/src/mame/includes/pgm2.h b/src/mame/includes/pgm2.h
index 6964760ee8c..d3052a22b3f 100644
--- a/src/mame/includes/pgm2.h
+++ b/src/mame/includes/pgm2.h
@@ -33,6 +33,7 @@ public:
m_sp_videoram(*this, "sp_videoram"),
m_bgscroll(*this, "bgscroll"),
m_fgscroll(*this, "fgscroll"),
+ m_vidmode(*this, "vidmode"),
m_gfxdecode2(*this, "gfxdecode2"),
m_gfxdecode3(*this, "gfxdecode3"),
m_arm_aic(*this, "arm_aic"),
@@ -133,6 +134,7 @@ private:
required_shared_ptr<uint32_t> m_sp_videoram;
required_shared_ptr<uint32_t> m_bgscroll;
required_shared_ptr<uint32_t> m_fgscroll;
+ required_shared_ptr<uint32_t> m_vidmode;
required_device<gfxdecode_device> m_gfxdecode2;
required_device<gfxdecode_device> m_gfxdecode3;
required_device<arm_aic_device> m_arm_aic;
diff --git a/src/mame/video/pgm2.cpp b/src/mame/video/pgm2.cpp
index 88fa0c838fc..8f416b469c8 100644
--- a/src/mame/video/pgm2.cpp
+++ b/src/mame/video/pgm2.cpp
@@ -216,12 +216,15 @@ void pgm2_state::draw_sprites(screen_device &screen, const rectangle &cliprect,
draw_sprite_line(cliprect, mask_offset, palette_offset, x, realy, flipx, reverse, sizex, pal, 1, zoomx_bits, growx);
realy++;
- if (zoomy_bit)
+ if (zoomy_bit) // draw it again
{
palette_offset = pre_palette_offset;
mask_offset = pre_mask_offset;
+ draw_sprite_line(cliprect, mask_offset, palette_offset, x, realy, flipx, reverse, sizex, pal, 1, zoomx_bits, growx);
+ realy++;
}
- else ydraw++;
+
+ ydraw++;
}
}
}
@@ -258,6 +261,15 @@ void pgm2_state::copy_sprites_from_bitmap(screen_device &screen, bitmap_rgb32 &b
uint32_t pgm2_state::screen_update_pgm2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
+
+ int mode = m_vidmode[0] & 0x00010000; // other bits not used?
+
+ if (mode)
+ m_screen->set_visible_area(0, 448 - 1, 0, 224 - 1);
+ else // note, +8 to y position too, could be a sprite reg to move sprites intead
+ m_screen->set_visible_area(0, 320 - 1, 8, 224 + 8 - 1);
+
+
m_fg_tilemap->set_scrollx(0, m_fgscroll[0] & 0xffff);
m_fg_tilemap->set_scrolly(0, m_fgscroll[0] >> 16);
m_bg_tilemap->set_scrolly(0, (m_bgscroll[0x0/4] & 0xffff0000)>>16 );