From 5280f5aba20a42becd2508e5377edbc9a38e53c5 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 23 May 2024 22:03:40 -0400 Subject: [PATCH] Attempt to spot screen takeovers. --- Machines/Acorn/Archimedes/Archimedes.cpp | 15 ++++++++++++++- OSBindings/Mac/Clock SignalTests/8088Tests.mm | 2 +- .../ArchimedesStaticAnalyserTests.mm | 8 +++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index f6b94c7b5..0aafe8f90 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -185,7 +185,19 @@ class ConcreteMachine: return desc; }; - switch(comment & static_cast(~(1 << 17))) { + const uint32_t swi_code = comment & static_cast(~(1 << 17)); + switch(swi_code) { + // To consider: catching VDU 22, though that means parsing the output stream + // via OS_WriteC, SWI &00, sufficiently to be able to spot VDUs. + + case 0x400e3: // Wimp_SetMode + case 0x65: // OS_ScreenMode + case 0x3f: // OS_CheckModeValid + if(autoload_phase_ == AutoloadPhase::OpeningProgram) { + autoload_phase_ = AutoloadPhase::Ended; + } + break; + case 0x400d4: { uint32_t address = executor_.registers()[1] + 28; @@ -270,6 +282,7 @@ class ConcreteMachine: // Some default icon sizing assumptions are baked in here. const auto x_target = target_window_[0] + (static_cast(x1) + static_cast(x2)) / 2; const auto y_target = target_window_[1] + static_cast(y1) + 24; + cursor_actions_.clear(); cursor_actions_.push_back(CursorAction::move_to( x_target >> 1, 256 - (y_target >> 2) diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index ed1c4e35d..2aa017fc0 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -34,7 +34,7 @@ constexpr char TestSuiteHome[] = "/Users/tharte/Projects/ProcessorTests/8088/v1" using Flags = InstructionSet::x86::Flags; struct Registers { public: - static constexpr bool is_32bit = false; +// static constexpr bool is_32bit = false; uint8_t &al() { return ax_.halves.low; } uint8_t &ah() { return ax_.halves.high; } diff --git a/OSBindings/Mac/Clock SignalTests/ArchimedesStaticAnalyserTests.mm b/OSBindings/Mac/Clock SignalTests/ArchimedesStaticAnalyserTests.mm index d36009bf0..6e87e8047 100644 --- a/OSBindings/Mac/Clock SignalTests/ArchimedesStaticAnalyserTests.mm +++ b/OSBindings/Mac/Clock SignalTests/ArchimedesStaticAnalyserTests.mm @@ -29,6 +29,11 @@ static NSDictionary *mainProgramsBySHA1 = @{ @"8fcad522ea22b75b393ceb334cfef3f324b248ee": @"!E-TYPE", @"8ca4289ac423d4878129cb17d6177123b321108f": @"!StrtWrite", @"4f92efecfc1e3a510a816f570ccb7082f0154e37": @"!HeroQuest", + @"9bd6d2514c04ce02fcf8ef214815229b28be56d8": @"!adventure", + @"d3493850e8ed91ae0a55a53866139781ad65e63d": @"!Nebulus", + @"ba655bd8936859a33bab5fde447e33486c3b0d3e": @"!Attack", + @"a6502faf15ddb4acaed2ca859cedc1225e7fa762": @"!Wolf", +// @"04f588f87facd507e043b06f512e9bdb6fe996c0": // TODO: should decline to pick. // Various things that are not the first disk. @"2cff99237837e2291b845eb63977362ad9b4f040": @"", @@ -37,7 +42,8 @@ static NSDictionary *mainProgramsBySHA1 = @{ @"b7139d9bd927b8e4d933fd8aa3080a7249117495": @"", @"66a82651f86d9cf0aa5b54c55bcaa8fefd3901da": @"", @"c3d3cd9e28f5e7499fd70057f820c75219538c69": @"", - + @"81bfd4ab92c538f5b15ad64bba625aac2ffb243d": @"", + @"39318695b6e64c9d7270f2b6d8213a7d4b0b0c43": @"", }; #undef Record