From d989825216ee3d57eba094a335a9c22537771943 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 2 Nov 2021 03:47:39 -0700 Subject: [PATCH] Add bonus notes on VPOSR. --- Machines/Amiga/Chipset.cpp | 11 ++++++++++- Machines/Amiga/Chipset.hpp | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Machines/Amiga/Chipset.cpp b/Machines/Amiga/Chipset.cpp index 51d339edc..be3590d55 100644 --- a/Machines/Amiga/Chipset.cpp +++ b/Machines/Amiga/Chipset.cpp @@ -612,7 +612,16 @@ void Chipset::perform(const CPU::MC68000::Microcycle &cycle) { // Raster position. case Read(0x004): { // VPOSR; b15 = LOF, b0 = b8 of y position. const uint16_t position = uint16_t(y_ >> 8); - cycle.set_value16(position); + cycle.set_value16( + position | + (is_long_field_ ? 0x8000 : 0x0000) + ); + + // b8–b14 should be: + // 00 for PAL Agnus or fat Agnus + // 10 for NTSC Agnus or fat Agnus + // 20 for PAL high-res + // 30 for NTSC high-res } break; case Read(0x006): { // VHPOSR; b0–b7 = horizontal; b8–b15 = low bits of vertical position. const uint16_t position = uint16_t(((line_cycle_ >> 1) & 0x00ff) | (y_ << 8)); diff --git a/Machines/Amiga/Chipset.hpp b/Machines/Amiga/Chipset.hpp index 2521110c2..8ef5cf47a 100644 --- a/Machines/Amiga/Chipset.hpp +++ b/Machines/Amiga/Chipset.hpp @@ -253,6 +253,7 @@ class Chipset: private ClockingHint::Observer { bool hold_and_modify_ = false; bool dual_playfields_ = false; bool interlace_ = false; + bool is_long_field_ = false; class BitplaneShifter { public: