summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author MetalliC <0vetal0@gmail.com>2017-12-29 00:34:21 +0200
committer GitHub <noreply@github.com>2017-12-29 00:34:21 +0200
commit70bf7b64399149faa57c36642f9954d2c1daac80 (patch)
tree46a334d0904460631c9b66f656abd4e4cf10628d /src
parent7b2d70af1f199f531f9e0c386ed99f70920e4568 (diff)
parent845d5a5f62c2c042ad41dddf610e91f4c5206f2e (diff)
Merge pull request #2984 from DavidHaywood/231217
kov3: default sram, speedups, visible area fix
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/pgm2.cpp59
-rw-r--r--src/mame/includes/pgm2.h1
-rw-r--r--src/mame/video/pgm2.cpp17
3 files changed, 56 insertions, 21 deletions
diff --git a/src/mame/drivers/pgm2.cpp b/src/mame/drivers/pgm2.cpp
index 2fdebee69fc..584949f8894 100644
--- a/src/mame/drivers/pgm2.cpp
+++ b/src/mame/drivers/pgm2.cpp
@@ -629,6 +629,11 @@ static MACHINE_CONFIG_DERIVED( pgm2_lores, pgm2 )
MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 0, 240-1)
MACHINE_CONFIG_END
+static MACHINE_CONFIG_DERIVED( pgm2_hires, pgm2 )
+ MCFG_SCREEN_MODIFY("screen")
+ MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 240-1)
+MACHINE_CONFIG_END
+
static MACHINE_CONFIG_DERIVED( pgm2_ramrom, pgm2 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(pgm2_ram_rom_map)
@@ -859,15 +864,21 @@ ROM_END
ROM_LOAD32_WORD( "kov3_spb0.u10", 0x00000002, 0x4000000, CRC(90396065) SHA1(01bf9f69d77a792d5b39afbba70fbfa098e194f1) ) \
\
ROM_REGION( 0x4000000, "ymz774", ROMREGION_ERASEFF ) /* ymz774 */ \
- ROM_LOAD16_WORD_SWAP( "kov3_wave0.u13", 0x00000000, 0x4000000, CRC(aa639152) SHA1(2314c6bd05524525a31a2a4668a36a938b924ba4) )
-
-ROM_START( kov3 )
- ROM_REGION( 0x04000, "maincpu", 0 )
- ROM_LOAD( "kov3_igs036_china.rom", 0x00000000, 0x0004000, CRC(c7d33764) SHA1(5cd48f876e637d60391d39ac6e40bf243300cc75) )
+ ROM_LOAD16_WORD_SWAP( "kov3_wave0.u13", 0x00000000, 0x4000000, CRC(aa639152) SHA1(2314c6bd05524525a31a2a4668a36a938b924ba4) ) \
+ \
+ ROM_REGION( 0x10000, "sram", 0 ) \
+ ROM_LOAD( "kov3_sram", 0x00000000, 0x10000, CRC(d9608102) SHA1(dec5631642393f4ec76912c81fd60249bb45aa13) )
- ROM_REGION( 0x108, "default_card", 0 )
+#define KOV3_INTERNAL_CHINA \
+ ROM_REGION( 0x04000, "maincpu", 0 ) \
+ ROM_LOAD( "kov3_igs036_china.rom", 0x00000000, 0x0004000, CRC(c7d33764) SHA1(5cd48f876e637d60391d39ac6e40bf243300cc75) ) \
+ ROM_REGION( 0x108, "default_card", 0 ) \
ROM_LOAD( "blank_kov3_china_card.pg2", 0x000, 0x108, CRC(bd5a968f) SHA1(b9045eb70e02afda7810431c592208053d863980) )
+
+ROM_START( kov3 )
+ KOV3_INTERNAL_CHINA
+
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v104cn_raw.bin", 0x00000000, 0x0800000, CRC(1b5cbd24) SHA1(6471d4842a08f404420dea2bd1c8b88798c80fd5) )
@@ -875,8 +886,7 @@ ROM_START( kov3 )
ROM_END
ROM_START( kov3_102 )
- ROM_REGION( 0x04000, "maincpu", 0 )
- ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
+ KOV3_INTERNAL_CHINA
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v102cn_raw.bin", 0x00000000, 0x0800000, CRC(61d0dabd) SHA1(959b22ef4e342ca39c2386549ac7274f9d580ab8) )
@@ -885,8 +895,7 @@ ROM_START( kov3_102 )
ROM_END
ROM_START( kov3_100 )
- ROM_REGION( 0x04000, "maincpu", 0 )
- ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
+ KOV3_INTERNAL_CHINA
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v100cn_raw.bin", 0x00000000, 0x0800000, CRC(93bca924) SHA1(ecaf2c4676eb3d9f5e4fdbd9388be41e51afa0e4) )
@@ -1060,6 +1069,28 @@ READ32_MEMBER(pgm2_state::kof98umh_speedup_r)
return m_mainram[0x00060 / 4];
}
+READ32_MEMBER(pgm2_state::kov3_speedup_r)
+{
+ int pc = space.device().safe_pc();
+
+ if ((pc == 0x1000729a) || (pc == 0x1000729e))
+ {
+ if ((m_mainram[0x000b4 / 4] == 0x00) && (m_mainram[0x000b8 / 4] == 0x00))
+ space.device().execute().spin_until_interrupt();
+ }
+ /*
+ else
+ {
+ printf("pc is %08x\n", pc);
+ }
+ */
+
+ return m_mainram[0x000b4 / 4];
+}
+
+
+
+
READ32_MEMBER(pgm2_state::ddpdojh_speedup_r)
{
int pc = space.device().safe_pc();
@@ -1143,6 +1174,8 @@ DRIVER_INIT_MEMBER(pgm2_state,kov3)
// patch FPGA check
uint32_t* rom = (uint32_t*)memregion("maincpu")->base();
rom[0x2a8c / 4] = 0xe320f000; // not endian safe ?
+
+ machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x200000b4, 0x200000b7, read32_delegate(FUNC(pgm2_state::kov3_speedup_r),this));
}
void pgm2_state::decrypt_kov3_module(uint32_t addrxor, uint16_t dataxor)
@@ -1206,9 +1239,9 @@ GAME( 2008, kov2nl_300, kov2nl, pgm2, pgm2, pgm2_state, kov2nl,
GAME( 2010, ddpdojh, 0, pgm2_ramrom, pgm2, pgm2_state, ddpdojh, ROT270, "IGS", "Dodonpachi Daioujou Tamashii (V201, China)", 0 )
// Knights of Valour 3 - should be a V103 and V101 too
-GAME( 2011, kov3, 0, pgm2, pgm2, pgm2_state, kov3_104, ROT0, "IGS", "Knights of Valour 3 (V104, China)", MACHINE_NOT_WORKING )
-GAME( 2011, kov3_102, kov3, pgm2, pgm2, pgm2_state, kov3_102, ROT0, "IGS", "Knights of Valour 3 (V102, China)", MACHINE_NOT_WORKING )
-GAME( 2011, kov3_100, kov3, pgm2, pgm2, pgm2_state, kov3_100, ROT0, "IGS", "Knights of Valour 3 (V100, China)", MACHINE_NOT_WORKING )
+GAME( 2011, kov3, 0, pgm2_hires, pgm2, pgm2_state, kov3_104, ROT0, "IGS", "Knights of Valour 3 (V104, China, Hong Kong, Taiwan)", MACHINE_NOT_WORKING )
+GAME( 2011, kov3_102, kov3, pgm2_hires, pgm2, pgm2_state, kov3_102, ROT0, "IGS", "Knights of Valour 3 (V102, China, Hong Kong, Taiwan)", MACHINE_NOT_WORKING )
+GAME( 2011, kov3_100, kov3, pgm2_hires, pgm2, pgm2_state, kov3_100, ROT0, "IGS", "Knights of Valour 3 (V100, China, Hong Kong, Taiwan)", MACHINE_NOT_WORKING )
// King of Fighters '98: Ultimate Match Hero
GAME( 2009, kof98umh, 0, pgm2_lores, pgm2, pgm2_state, kof98umh, ROT0, "IGS / SNK Playmore / New Channel", "The King of Fighters '98: Ultimate Match HERO (China, V100, 09-08-23)", 0 )
diff --git a/src/mame/includes/pgm2.h b/src/mame/includes/pgm2.h
index 18dc4cb4076..d685a97d042 100644
--- a/src/mame/includes/pgm2.h
+++ b/src/mame/includes/pgm2.h
@@ -64,6 +64,7 @@ public:
DECLARE_READ32_MEMBER(kof98umh_speedup_r);
DECLARE_READ32_MEMBER(ddpdojh_speedup_r);
DECLARE_READ32_MEMBER(ddpdojh_speedup2_r);
+ DECLARE_READ32_MEMBER(kov3_speedup_r);
DECLARE_READ8_MEMBER(encryption_r);
DECLARE_WRITE8_MEMBER(encryption_w);
diff --git a/src/mame/video/pgm2.cpp b/src/mame/video/pgm2.cpp
index 4ec64174a5c..b471093108f 100644
--- a/src/mame/video/pgm2.cpp
+++ b/src/mame/video/pgm2.cpp
@@ -261,20 +261,21 @@ 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] & 0x00030000; // other bits not used?
- int mode = m_vidmode[0] & 0x00010000; // other bits not used?
-
- if (mode)
- m_screen->set_visible_area(0, 448 - 1, 0, 224 - 1);
- else
- m_screen->set_visible_area(0, 320 - 1, 0, 240 - 1);
-
+ switch (mode>>16)
+ {
+ default:
+ case 0x00: m_screen->set_visible_area(0, 320 - 1, 0, 240 - 1); break;
+ case 0x01: m_screen->set_visible_area(0, 448 - 1, 0, 224 - 1); break;
+ case 0x02: m_screen->set_visible_area(0, 512 - 1, 0, 240 - 1); break;
+ }
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 );
- for (int y = 0; y < 224; y++)
+ for (int y = 0; y <= cliprect.max_y; y++)
{
uint16_t linescroll = (y & 1) ? ((m_lineram[(y >> 1)] & 0xffff0000) >> 16) : (m_lineram[(y >> 1)] & 0x0000ffff);
m_bg_tilemap->set_scrollx((y + ((m_bgscroll[0x0 / 4] & 0xffff0000) >> 16)) & 0x3ff, ((m_bgscroll[0x0 / 4] & 0x0000ffff) >> 0) + linescroll);