diff --git a/Assets/gamedb/gamedb_intv.txt b/Assets/gamedb/gamedb_intv.txt index 0ff1d4a292..d425c862c1 100644 --- a/Assets/gamedb/gamedb_intv.txt +++ b/Assets/gamedb/gamedb_intv.txt @@ -2,6 +2,7 @@ sha1:094B207668C03A6D903270490F495DDC237CD8D7 Atlantis INTV board=7 sha1:1B6FD19E745E50E8EA679BD5ADFB719D1F276BC5 Beauty and the Beast (1982) (Imagic) [!] INTV board=7 +sha1:397B1A6036A6E7A63FA9182ED9B07F6A3DEA85B7 Blowout INTV board=11 sha1:49B474D0317CC0E6C83CE77BA46D5DED2EC56005 Body Slam - Super Pro Wrestling (1988) (Intv Corp) INTV board=2 sha1:97C69DC3DA5AEE80E6EF1BAF90B6C3EC8025ABFF Centipede (1983) (Atarisoft) INTV board=6 sha1:A402BCC8D1E50FEBC01AC2D91237742192AFF7C7 Championship Tennis (1985) (Mattel) INTV board=1 @@ -13,6 +14,7 @@ sha1:85AF8649C04198B00CECDEA2661192DB6631DC80 Defender (1983) (Atarisoft) INTV sha1:D6054E8EAD16F3E076C26880FE641543E8519E18 Demon Attack (1982) (Imagic) [!] INTV board=7 sha1:6E281043C7BB37B20CFC48CFEFB5F28922B3A3CE Dig Dug (1987) (Intv Corp) INTV board=5 sha1:B55D83D2F5B2BF408EA696D6B7D56E71782C3507 Diner (1987) (Intv Corp) INTV board=2 +sha1:F91D4507BAF41626D839308659E68DE048C767C8 Flappy Bird INTV board=0 sha1:EE4018D4384121B9E29A37C4583BFBCC55E6ED4E Game Factory (Prototype) (1983) (Mattel) [!] INTV board=9 sha1:2D96762D78A63F606B74C6619F3B2B82C381FCCE Hover Force (1986) (Intv Corp) INTV board=2 sha1:3EF8ACBC764F7916337A07407222C0BCE092A058 King of the Mountain (1982) (Mattel) INTV board=1 @@ -20,11 +22,13 @@ sha1:97073F31A8C9B5B04E773FCB145C4235A4712FF7 Land Battle (1982) (Mattel) INTV sha1:6EEAEB4CA39D30B6255814CD9F92CF8D092C393D Learning Fun I - Math Master Factor Fun (1987) (Intv Corp) INTV board=2 sha1:134AF61BC7B06489D35A7474F8A29EF80DB6F332 Learning Fun II - Word Wizard Memory Fun (1987) (Intv Corp) INTV board=2 sha1:1390F0076470504037720B20F84404D502988231 Microsurgeon (1982) (Imagic) [!] INTV board=7 -sha1:21F6AABE3462594EA5E20EEED7AEF493BE427911 Ms PcaMan INTV board=10 +sha1:C4ABF77C2CFC0E7B590E2260C56360F9738C45D6 Minehunter INTV board=0 +sha1:2DB40CF210534E563D5ECA5C923C1F937AFE6994 Ms PcaMan INTV board=10 sha1:BAF51811E8238AD56F74879E839A8AF6B5612962 MTE201 Intellivision Test Cartridge (1978) (Mattel) INTV board=8 sha1:66DDC9C56EDEE06564C1252C7C6BC3123DA8C31D Pac-Man (1983) (Atarisoft) INTV board=5 sha1:48023975E4BA875B745B5B9AAC0FB562922B50C3 Pac-Man (1983) (Intv Corp) INTV board=5 sha1:7A606D908D6D25B1F6033DBACC997EA813576D94 Pole Position (1986) (Intv Corp) INTV board=2 +sha1:ECC12AAAC0019D43924562862EAF3661FA40EC02 Scarfinger INTV board=2 sha1:BA455F1DF7A4BADDDB129C724F2E9ACA46D6F636 Slam Dunk - Super Pro Basketball (1987) (Intv Corp) INTV board=2 sha1:CBC9B04ED52034283CD307ED5D3B2843E70F0409 Spiker! - Super Pro Volleyball (1988) (Intv Corp) INTV board=2 sha1:8547B9CF117ED1A1CAF0953A8B545587206DC4F7 Stadium Mud Buggies (1988) (Intv Corp) INTV board=2 @@ -33,4 +37,4 @@ sha1:08C97D4E23B8033D9437241C1F4D8A1486D1E9EA Super Pro Football (1986) (Intv C sha1:DE35812076BDA03999A55B2969A67299CCFB83C4 Tower of Doom (1986) (Intv Corp) INTV board=3 sha1:EA784E2921DD3A7CAF85C029DE7D937C80D50C58 Triple Challenge (1986) (Intv Corp) INTV board=9 sha1:4CCF494F9664D5B9E05237D1BC2EEE8A7830F067 USCF Chess (1981) (Mattel) INTV board=4 -sha1:8AEF03392F53BC947E4F521A29F31A3C32D01104 World Series Major League Baseball (1983) (Mattel) [!] INTV board=1 +sha1:8AEF03392F53BC947E4F521A29F31A3C32D01104 World Series Major League Baseball (1983) (Mattel) [!] INTV board=1 \ No newline at end of file diff --git a/src/BizHawk.Client.Common/RomGame.cs b/src/BizHawk.Client.Common/RomGame.cs index f9f4b02d6e..e00093f7ce 100644 --- a/src/BizHawk.Client.Common/RomGame.cs +++ b/src/BizHawk.Client.Common/RomGame.cs @@ -14,6 +14,10 @@ namespace BizHawk.Client.Common public GameInfo GameInfo { get; } public string Extension { get; } + // false positives of the header check (512 bytes in intv games) + public const string Flappy_Bird_INTV = "SHA1:C4ABF77C2CFC0E7B590E2260C56360F9738C45D6"; + public const string Minehunter_INTV = "SHA1:F91D4507BAF41626D839308659E68DE048C767C8"; + private const int BankSize = 1024; public RomGame(HawkFile file) @@ -56,6 +60,8 @@ namespace BizHawk.Client.Common stream.Position = 0; stream.Read(FileData, 0, fileLength); + string SHA1_check = SHA1Checksum.ComputePrefixedHex(FileData); + // if there was no header offset, RomData is equivalent to FileData // (except in cases where the original interleaved file data is necessary.. in that case we'll have problems.. // but this whole architecture is not going to withstand every peculiarity and be fast as well. @@ -71,6 +77,12 @@ namespace BizHawk.Client.Common // (-Asnivor) RomData = FileData; } + else if (SHA1_check == Flappy_Bird_INTV || SHA1_check == Minehunter_INTV) + { + // several INTV games have sizes that are multiples of 512 bytes + Console.WriteLine("False positive detected in Header Check, using entire file."); + RomData = FileData; + } else { // if there was a header offset, read the whole file into FileData and then copy it into RomData (this is unfortunate, in case RomData isn't needed) @@ -104,7 +116,7 @@ namespace BizHawk.Client.Common // for now only .A78 games, but probably should be for other systems as well RomData = FileData; } - + CheckForPatchOptions(); if (patch != null) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Cartridge.cs b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Cartridge.cs index 811c837891..8a31f9fee2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Cartridge.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Intellivision/Cartridge.cs @@ -11,7 +11,7 @@ namespace BizHawk.Emulation.Cores.Intellivision private ushort[] Cart_Ram = new ushort[0x800]; - // There are 10 mappers Intellivision games use (not counting intellicart which is handled seperately) + // There are several mappers Intellivision games use (not counting intellicart which is handled seperately) // we will pick the mapper from the game DB and default to 0 private int _mapper = 0; @@ -213,6 +213,17 @@ namespace BizHawk.Emulation.Cores.Intellivision return Data[addr - 0x8000]; } break; + case 11: + if (addr >= 0x5000 && addr <= 0x5FFF) + { + return Data[addr - 0x5000]; + } + + if (addr >= 0xD000 && addr <= 0xDFFF) + { + return Data[addr - 0xC000]; + } + break; } return null;