From 582da14a14e45150d3b462f05c81a566b429ff1c Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 13 Mar 2017 08:15:36 -0400 Subject: [PATCH 1/2] Added an enumerated type and detection of Pitfall 2. --- .../Mac/Clock SignalTests/AtariStaticAnalyserTests.mm | 6 +++--- StaticAnalyser/Atari/StaticAnalyser.cpp | 3 +++ StaticAnalyser/StaticAnalyser.hpp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm b/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm index 50e0712e9..37524a77f 100644 --- a/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm +++ b/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm @@ -347,9 +347,9 @@ static NSDictionary *romRecordsBySHA1 = @{ Record(@"483fc907471c5c358fb3e624097861a2fc9c1e45", None, NO) // Picnic Record(@"57774193081acea010bd935a0449bc8f53157128", None, NO) // Piece o' Cake Record(@"d08b30ca2e5e351cac3bd3fb760b87a1a30aa300", Atari8k, NO) // Pigs in Space - Record(@"920cfbd517764ad3fa6a7425c031bd72dc7d927c", None, NO) // Pitfall II - Record(@"d0ec08b88d032627701ad72337524d91b26c656b", None, NO) // Pitfall! (1982) (Activision) (PAL) [!] - Record(@"8d525480445d48cc48460dc666ebad78c8fb7b73", None, NO) // Pitfall! + Record(@"920cfbd517764ad3fa6a7425c031bd72dc7d927c", Pitfall2, NO) // Pitfall II + Record(@"d0ec08b88d032627701ad72337524d91b26c656b", None, NO) // Pitfall! (PAL) + Record(@"8d525480445d48cc48460dc666ebad78c8fb7b73", None, NO) // Pitfall! (NTSC) Record(@"dcca30e4ae58c85a070f0c6cfaa4d27be2970d61", None, NO) // Planet of the Apes Record(@"ccfcbf52815a441158977292b719f7c5ed80c515", None, NO) // Planet Patrol Record(@"103398dd35ebd39450c5cac760fa332aac3f9458", None, NO) // Plaque Attack diff --git a/StaticAnalyser/Atari/StaticAnalyser.cpp b/StaticAnalyser/Atari/StaticAnalyser.cpp index d4bee728f..ec4f9e470 100644 --- a/StaticAnalyser/Atari/StaticAnalyser.cpp +++ b/StaticAnalyser/Atari/StaticAnalyser.cpp @@ -142,6 +142,9 @@ static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const St case 8192: DeterminePagingFor8kCartridge(target, segment, disassembly); break; + case 10495: + target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::Pitfall2; + break; case 12288: target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::CBSRamPlus; break; diff --git a/StaticAnalyser/StaticAnalyser.hpp b/StaticAnalyser/StaticAnalyser.hpp index 8c5bad7b4..c4471ce0c 100644 --- a/StaticAnalyser/StaticAnalyser.hpp +++ b/StaticAnalyser/StaticAnalyser.hpp @@ -36,7 +36,8 @@ enum class Atari2600PagingModel { Tigervision, CBSRamPlus, MNetwork, - Megaboy + Megaboy, + Pitfall2 }; /*! From a6897ebde0dca5fd4fd12a5b3903ecc5dacc7bfe Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 13 Mar 2017 20:43:12 -0400 Subject: [PATCH 2/2] Added an attempt to distinguish the MegaBoy (now with proper capitalisation) and a test for it. --- .../Mac/Clock SignalTests/AtariStaticAnalyserTests.mm | 1 + StaticAnalyser/Atari/StaticAnalyser.cpp | 11 +++++++++++ StaticAnalyser/StaticAnalyser.hpp | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm b/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm index 37524a77f..49af40019 100644 --- a/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm +++ b/OSBindings/Mac/Clock SignalTests/AtariStaticAnalyserTests.mm @@ -287,6 +287,7 @@ static NSDictionary *romRecordsBySHA1 = @{ Record(@"18fac606400c08a0469aebd9b071ae3aec2a3cf2", None, NO) // Math Gran Prix Record(@"aba25089d87cd6fee8d206b880baa5d938aae255", None, NO) // Maze Craze Record(@"0ae118373c7bda97da2f8d9c113e1e09ea7e49e1", None, NO) // Mega Force + Record(@"46977baf0e1ee6124b524258879c46f80d624fae", MegaBoy, NO) // MegaBoy Record(@"9c5748b38661dbadcbc9cd1ec6a6b0c550b0e3da", None, NO) // MegaMania Record(@"debb1572eadb20beb0e4cd2df8396def8eb02098", None, NO) // Meltdown Record(@"7fcf95459ea597a332bf5b6f56c8f891307b45b4", Atari16k, NO) // Midnight Magic diff --git a/StaticAnalyser/Atari/StaticAnalyser.cpp b/StaticAnalyser/Atari/StaticAnalyser.cpp index ec4f9e470..b54f4d521 100644 --- a/StaticAnalyser/Atari/StaticAnalyser.cpp +++ b/StaticAnalyser/Atari/StaticAnalyser.cpp @@ -116,6 +116,14 @@ static void DeterminePagingFor16kCartridge(StaticAnalyser::Target &target, const if(mnetwork_access_count > atari_access_count) target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::MNetwork; } +static void DeterminePagingFor64kCartridge(StaticAnalyser::Target &target, const Storage::Cartridge::Cartridge::Segment &segment, const StaticAnalyser::MOS6502::Disassembly &disassembly) +{ + // make an assumption that this is a Tigervision if there is a write to 3F + target.atari.paging_model = + (disassembly.external_stores.find(0x3f) != disassembly.external_stores.end()) ? + StaticAnalyser::Atari2600PagingModel::Tigervision : StaticAnalyser::Atari2600PagingModel::MegaBoy; +} + static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const Storage::Cartridge::Cartridge::Segment &segment) { if(segment.data.size() == 2048) @@ -154,6 +162,9 @@ static void DeterminePagingForCartridge(StaticAnalyser::Target &target, const St case 32768: target.atari.paging_model = StaticAnalyser::Atari2600PagingModel::Atari32k; break; + case 65536: + DeterminePagingFor64kCartridge(target, segment, disassembly); + break; default: break; } diff --git a/StaticAnalyser/StaticAnalyser.hpp b/StaticAnalyser/StaticAnalyser.hpp index c4471ce0c..3d5cf2f61 100644 --- a/StaticAnalyser/StaticAnalyser.hpp +++ b/StaticAnalyser/StaticAnalyser.hpp @@ -36,7 +36,7 @@ enum class Atari2600PagingModel { Tigervision, CBSRamPlus, MNetwork, - Megaboy, + MegaBoy, Pitfall2 };