mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-18 01:30:56 +00:00
Updates autotests to new RomFetcher world.
This commit is contained in:
parent
dd64aef910
commit
f27e331462
@ -410,6 +410,7 @@ Description::Description(Name name) {
|
|||||||
|
|
||||||
case Name::AtariSTTOS100: *this = Description(name, "AtariST", "the UK TOS 1.00 ROM", "tos100.img", 192*1024, 0x1a586c64u); break;
|
case Name::AtariSTTOS100: *this = Description(name, "AtariST", "the UK TOS 1.00 ROM", "tos100.img", 192*1024, 0x1a586c64u); break;
|
||||||
case Name::AtariSTTOS104: *this = Description(name, "AtariST", "the UK TOS 1.04 ROM", "tos104.img", 192*1024, 0xa50d1d43u); break;
|
case Name::AtariSTTOS104: *this = Description(name, "AtariST", "the UK TOS 1.04 ROM", "tos104.img", 192*1024, 0xa50d1d43u); break;
|
||||||
|
case Name::AtariSTEmuTOS192: *this = Description(name, "AtariST", "the UK EmuTOS 1.92 ROM", "etos192uk.img", 192*1024, 0xfc3b9e61u); break;
|
||||||
|
|
||||||
case Name::ColecoVisionBIOS:
|
case Name::ColecoVisionBIOS:
|
||||||
*this = Description(name, "ColecoVision", "the ColecoVision BIOS", "coleco.rom", 8*1024, 0x3aa93ef3u);
|
*this = Description(name, "ColecoVision", "the ColecoVision BIOS", "coleco.rom", 8*1024, 0x3aa93ef3u);
|
||||||
@ -469,5 +470,10 @@ Description::Description(Name name) {
|
|||||||
case Name::MSXAmericanBIOS: *this = Description(name, "MSX", "an American MSX BIOS", "msx-american.rom", 32*1024, 0u); break;
|
case Name::MSXAmericanBIOS: *this = Description(name, "MSX", "an American MSX BIOS", "msx-american.rom", 32*1024, 0u); break;
|
||||||
case Name::MSXEuropeanBIOS: *this = Description(name, "MSX", "a European MSX BIOS", "msx-european.rom", 32*1024, 0u); break;
|
case Name::MSXEuropeanBIOS: *this = Description(name, "MSX", "a European MSX BIOS", "msx-european.rom", 32*1024, 0u); break;
|
||||||
case Name::MSXDOS: *this = Description(name, "MSX", "the MSX-DOS ROM", "disk.rom", 16*1024, 0x721f61dfu); break;
|
case Name::MSXDOS: *this = Description(name, "MSX", "the MSX-DOS ROM", "disk.rom", 16*1024, 0x721f61dfu); break;
|
||||||
|
|
||||||
|
case Name::SinclairQLJS:
|
||||||
|
*this = Description(name, "SinclairQL", "the Sinclair QL 'JS' ROM", "js.rom", 48*1024, 0x0f95aab5u);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,7 @@ enum Name {
|
|||||||
// Atari ST.
|
// Atari ST.
|
||||||
AtariSTTOS100,
|
AtariSTTOS100,
|
||||||
AtariSTTOS104,
|
AtariSTTOS104,
|
||||||
|
AtariSTEmuTOS192,
|
||||||
|
|
||||||
// ColecoVision.
|
// ColecoVision.
|
||||||
ColecoVisionBIOS,
|
ColecoVisionBIOS,
|
||||||
@ -95,6 +96,9 @@ enum Name {
|
|||||||
OricMicrodisc,
|
OricMicrodisc,
|
||||||
Oric8DOSBoot,
|
Oric8DOSBoot,
|
||||||
|
|
||||||
|
// Sinclair QL.
|
||||||
|
SinclairQLJS,
|
||||||
|
|
||||||
// Vic-20.
|
// Vic-20.
|
||||||
Vic20BASIC,
|
Vic20BASIC,
|
||||||
Vic20EnglishCharacters,
|
Vic20EnglishCharacters,
|
||||||
@ -116,6 +120,7 @@ enum Name {
|
|||||||
Spectrum128k,
|
Spectrum128k,
|
||||||
SpecrumPlus2,
|
SpecrumPlus2,
|
||||||
SpectrumPlus3,
|
SpectrumPlus3,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using Map = std::map<ROM::Name, std::vector<uint8_t>>;
|
using Map = std::map<ROM::Name, std::vector<uint8_t>>;
|
||||||
|
@ -35,7 +35,8 @@ class VanillaSerialPort: public Commodore::Serial::Port {
|
|||||||
_serialPort = std::make_shared<VanillaSerialPort>();
|
_serialPort = std::make_shared<VanillaSerialPort>();
|
||||||
|
|
||||||
auto rom_fetcher = CSROMFetcher();
|
auto rom_fetcher = CSROMFetcher();
|
||||||
_c1540 = std::make_unique<Commodore::C1540::Machine>(Commodore::C1540::Personality::C1540, rom_fetcher);
|
auto roms = rom_fetcher(Commodore::C1540::Machine::rom_request(Commodore::C1540::Personality::C1540));
|
||||||
|
_c1540 = std::make_unique<Commodore::C1540::Machine>(Commodore::C1540::Personality::C1540, roms);
|
||||||
_c1540->set_serial_bus(_serialBus);
|
_c1540->set_serial_bus(_serialBus);
|
||||||
Commodore::Serial::AttachPortAndBus(_serialPort, _serialBus);
|
Commodore::Serial::AttachPortAndBus(_serialPort, _serialBus);
|
||||||
}
|
}
|
||||||
|
@ -103,21 +103,20 @@ class EmuTOS: public ComparativeBusHandler {
|
|||||||
std::unique_ptr<EmuTOS> _machine;
|
std::unique_ptr<EmuTOS> _machine;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testImage:(NSString *)image trace:(NSString *)trace length:(int)length {
|
- (void)testImage:(ROM::Name)name trace:(NSString *)trace length:(int)length {
|
||||||
const std::vector<ROMMachine::ROM> rom_names = {{"AtariST", "", image.UTF8String, 0, 0 }};
|
const auto roms = CSROMFetcher()(ROM::Request(name));
|
||||||
const auto roms = CSROMFetcher()(rom_names);
|
|
||||||
NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:trace ofType:@"trace.txt.gz"];
|
NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:trace ofType:@"trace.txt.gz"];
|
||||||
_machine = std::make_unique<EmuTOS>(*roms[0], traceLocation.fileSystemRepresentation);
|
_machine = std::make_unique<EmuTOS>(roms.find(name)->second, traceLocation.fileSystemRepresentation);
|
||||||
_machine->run_for(HalfCycles(length));
|
_machine->run_for(HalfCycles(length));
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testEmuTOSStartup {
|
- (void)testEmuTOSStartup {
|
||||||
[self testImage:@"etos192uk.img" trace:@"etos192uk" length:313490];
|
[self testImage:ROM::Name::AtariSTEmuTOS192 trace:@"etos192uk" length:313490];
|
||||||
// TODO: assert that machine is now STOPped.
|
// TODO: assert that machine is now STOPped.
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)testTOSStartup {
|
- (void)testTOSStartup {
|
||||||
[self testImage:@"tos100.img" trace:@"tos100" length:54011091];
|
[self testImage:ROM::Name::AtariSTTOS100 trace:@"tos100" length:54011091];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -101,10 +101,11 @@ class QL: public ComparativeBusHandler {
|
|||||||
Tests the progression of Clock Signal's 68000 through the Sinclair QL's ROM against a known-good trace.
|
Tests the progression of Clock Signal's 68000 through the Sinclair QL's ROM against a known-good trace.
|
||||||
*/
|
*/
|
||||||
- (void)testStartup {
|
- (void)testStartup {
|
||||||
const std::vector<ROMMachine::ROM> rom_names = {{"SinclairQL", "", "js.rom", 0, 0 }};
|
constexpr ROM::Name rom_name = ROM::Name::SinclairQLJS;
|
||||||
const auto roms = CSROMFetcher()(rom_names);
|
ROM::Request request(rom_name);
|
||||||
|
const auto roms = CSROMFetcher()(request);
|
||||||
NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:@"qltrace" ofType:@".txt.gz"];
|
NSString *const traceLocation = [[NSBundle bundleForClass:[self class]] pathForResource:@"qltrace" ofType:@".txt.gz"];
|
||||||
_machine = std::make_unique<QL>(*roms[0], traceLocation.UTF8String);
|
_machine = std::make_unique<QL>(roms.find(rom_name)->second, traceLocation.UTF8String);
|
||||||
|
|
||||||
// This is how many cycles it takes to exhaust the supplied trace file.
|
// This is how many cycles it takes to exhaust the supplied trace file.
|
||||||
_machine->run_for(HalfCycles(23923180));
|
_machine->run_for(HalfCycles(23923180));
|
||||||
|
@ -24,8 +24,10 @@ struct ContentionAnalysis {
|
|||||||
HalfCycles pattern[8];
|
HalfCycles pattern[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
template <Sinclair::ZXSpectrum::VideoTiming video_timing> ContentionAnalysis analyse() {
|
using Timing = Sinclair::ZXSpectrum::Video::Timing;
|
||||||
Sinclair::ZXSpectrum::Video<video_timing> video;
|
|
||||||
|
template <Timing video_timing> ContentionAnalysis analyse() {
|
||||||
|
Sinclair::ZXSpectrum::Video::Video<video_timing> video;
|
||||||
ContentionAnalysis analysis;
|
ContentionAnalysis analysis;
|
||||||
|
|
||||||
// Advance to the start of the first interrupt.
|
// Advance to the start of the first interrupt.
|
||||||
@ -82,7 +84,7 @@ template <Sinclair::ZXSpectrum::VideoTiming video_timing> ContentionAnalysis ana
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)test48k {
|
- (void)test48k {
|
||||||
const auto analysis = analyse<Sinclair::ZXSpectrum::VideoTiming::FortyEightK>();
|
const auto analysis = analyse<Timing::FortyEightK>();
|
||||||
|
|
||||||
// Check time from interrupt.
|
// Check time from interrupt.
|
||||||
XCTAssertEqual(analysis.time_after_interrupt, 14335*2);
|
XCTAssertEqual(analysis.time_after_interrupt, 14335*2);
|
||||||
@ -105,7 +107,7 @@ template <Sinclair::ZXSpectrum::VideoTiming video_timing> ContentionAnalysis ana
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)test128k {
|
- (void)test128k {
|
||||||
const auto analysis = analyse<Sinclair::ZXSpectrum::VideoTiming::OneTwoEightK>();
|
const auto analysis = analyse<Timing::OneTwoEightK>();
|
||||||
|
|
||||||
// Check time from interrupt.
|
// Check time from interrupt.
|
||||||
XCTAssertEqual(analysis.time_after_interrupt, 14361*2);
|
XCTAssertEqual(analysis.time_after_interrupt, 14361*2);
|
||||||
@ -128,7 +130,7 @@ template <Sinclair::ZXSpectrum::VideoTiming video_timing> ContentionAnalysis ana
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)testPlus3 {
|
- (void)testPlus3 {
|
||||||
const auto analysis = analyse<Sinclair::ZXSpectrum::VideoTiming::Plus3>();
|
const auto analysis = analyse<Timing::Plus3>();
|
||||||
|
|
||||||
// Check time from interrupt.
|
// Check time from interrupt.
|
||||||
XCTAssertEqual(analysis.time_after_interrupt, 14361*2);
|
XCTAssertEqual(analysis.time_after_interrupt, 14361*2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user