mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Fixes reload test, which really needs to sense the CRT-headed vsync output.
i.e. not the one heading back to the CPU.
This commit is contained in:
parent
8ce26e7182
commit
b33218c61e
@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
// Testing hook; not for any other user.
|
||||||
|
class VideoTester;
|
||||||
|
|
||||||
namespace Atari {
|
namespace Atari {
|
||||||
namespace ST {
|
namespace ST {
|
||||||
|
|
||||||
@ -278,6 +281,8 @@ class Video {
|
|||||||
}
|
}
|
||||||
pending_events_.emplace(insertion_point, type, delay);
|
pending_events_.emplace(insertion_point, type, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
friend class ::VideoTester;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,14 @@
|
|||||||
|
|
||||||
#include "../../../Machines/Atari/ST/Video.hpp"
|
#include "../../../Machines/Atari/ST/Video.hpp"
|
||||||
|
|
||||||
|
// Implement Atari::ST::Video's friend class, to expose some
|
||||||
|
// internal state.
|
||||||
|
struct VideoTester {
|
||||||
|
static bool vsync(Atari::ST::Video &video) {
|
||||||
|
return video.vertical_.sync;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@interface AtariSTVideoTests : XCTestCase
|
@interface AtariSTVideoTests : XCTestCase
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -272,13 +280,14 @@ struct RunLength {
|
|||||||
|
|
||||||
// MARK: - Address Reload Timing tests
|
// MARK: - Address Reload Timing tests
|
||||||
|
|
||||||
/// Tests that the current video address is reloaded constantly throughout hsync
|
/// Tests that the current video address is reloaded constantly throughout vsync (subject to caveat: observed .
|
||||||
- (void)testHsyncReload {
|
- (void)testVsyncReload {
|
||||||
|
|
||||||
// Set an initial video address of 0.
|
// Set an initial video address of 0.
|
||||||
[self setVideoBaseAddress:0];
|
[self setVideoBaseAddress:0];
|
||||||
|
|
||||||
// Find next area of non-vsync.
|
// Find next area of non-vsync.
|
||||||
while(_video->vsync()) {
|
while(VideoTester::vsync(*_video)) {
|
||||||
_video->run_for(Cycles(1));
|
_video->run_for(Cycles(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +296,7 @@ struct RunLength {
|
|||||||
|
|
||||||
// Find next area of vsync, checking that the address isn't
|
// Find next area of vsync, checking that the address isn't
|
||||||
// reloaded before then.
|
// reloaded before then.
|
||||||
while(!_video->vsync()) {
|
while(!VideoTester::vsync(*_video)) {
|
||||||
XCTAssertNotEqual([self currentVideoAddress], 0x800000);
|
XCTAssertNotEqual([self currentVideoAddress], 0x800000);
|
||||||
_video->run_for(Cycles(1));
|
_video->run_for(Cycles(1));
|
||||||
}
|
}
|
||||||
@ -305,7 +314,7 @@ struct RunLength {
|
|||||||
|
|
||||||
// Find end of vertical sync, set a different base address,
|
// Find end of vertical sync, set a different base address,
|
||||||
// check that it doesn't become current.
|
// check that it doesn't become current.
|
||||||
while(_video->vsync()) {
|
while(VideoTester::vsync(*_video)) {
|
||||||
_video->run_for(Cycles(1));
|
_video->run_for(Cycles(1));
|
||||||
}
|
}
|
||||||
[self setVideoBaseAddress:0];
|
[self setVideoBaseAddress:0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user