2021-04-25 03:17:47 +00:00
|
|
|
|
//
|
|
|
|
|
// SNA.cpp
|
|
|
|
|
// Clock Signal
|
|
|
|
|
//
|
|
|
|
|
// Created by Thomas Harte on 24/04/2021.
|
|
|
|
|
// Copyright © 2021 Thomas Harte. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "SNA.hpp"
|
2021-04-25 03:38:00 +00:00
|
|
|
|
#include "../../Analyser/Static/ZXSpectrum/Target.hpp"
|
2021-04-25 03:17:47 +00:00
|
|
|
|
|
|
|
|
|
using namespace Storage::State;
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<Analyser::Static::Target> SNA::load(const std::string &file_name) {
|
2021-04-25 03:38:00 +00:00
|
|
|
|
using Target = Analyser::Static::ZXSpectrum::Target;
|
|
|
|
|
auto result = std::make_unique<Target>();
|
|
|
|
|
|
|
|
|
|
// SNAs are always for 48kb machines.
|
|
|
|
|
result->model = Target::Model::FortyEightK;
|
|
|
|
|
|
2021-04-25 03:17:47 +00:00
|
|
|
|
// 0x1a byte header:
|
|
|
|
|
//
|
|
|
|
|
// 00 I
|
|
|
|
|
// 01 HL'
|
|
|
|
|
// 03 DE'
|
|
|
|
|
// 05 BC'
|
|
|
|
|
// 07 AF'
|
|
|
|
|
// 09 HL
|
|
|
|
|
// 0B DE
|
|
|
|
|
// 0D BC
|
|
|
|
|
// 0F IY
|
|
|
|
|
// 11 IX
|
|
|
|
|
// 13 IFF2 (in bit 2)
|
|
|
|
|
// 14 R
|
|
|
|
|
// 15 AF
|
|
|
|
|
// 17 SP
|
|
|
|
|
// 19 interrupt mode
|
|
|
|
|
// 1A border colour
|
|
|
|
|
// 1B– 48kb RAM contents
|
2021-04-25 03:19:41 +00:00
|
|
|
|
//
|
|
|
|
|
// (perform a POP to get the PC)
|
2021-04-25 03:17:47 +00:00
|
|
|
|
|
|
|
|
|
(void)file_name;
|
2021-04-25 03:38:00 +00:00
|
|
|
|
|
|
|
|
|
return result;
|
2021-04-25 03:17:47 +00:00
|
|
|
|
}
|