1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00
CLK/Machines/Sinclair/ZXSpectrum/State.hpp

48 lines
1.0 KiB
C++
Raw Permalink Normal View History

2021-04-25 17:00:43 +00:00
//
// State.hpp
// Clock Signal
//
// Created by Thomas Harte on 25/04/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#pragma once
2021-04-25 17:00:43 +00:00
#include "../../../Reflection/Struct.hpp"
#include "../../../Processors/Z80/State/State.hpp"
2021-04-26 21:39:11 +00:00
#include "Video.hpp"
2021-04-26 21:39:11 +00:00
#include "../../../Components/AY38910/AY38910.hpp"
2021-04-25 17:00:43 +00:00
2023-05-10 21:02:18 +00:00
namespace Sinclair::ZXSpectrum {
2021-04-25 17:00:43 +00:00
struct State: public Reflection::StructImpl<State> {
CPU::Z80::State z80;
Video::State video;
// In 16kb or 48kb mode, RAM will be 16kb or 48kb and represent
// memory in standard linear order. In 128kb mode, RAM will be
// 128kb with the first 16kb representing bank 0, the next bank 1, etc.
std::vector<uint8_t> ram;
2021-04-25 17:00:43 +00:00
// Meaningful for 128kb machines only.
uint8_t last_7ffd = 0;
2021-04-26 21:39:11 +00:00
GI::AY38910::State ay;
// Meaningful for the +2a and +3 only.
uint8_t last_1ffd = 0;
2021-04-25 17:00:43 +00:00
State() {
if(needs_declare()) {
DeclareField(z80);
DeclareField(video);
DeclareField(ram);
DeclareField(last_7ffd);
DeclareField(last_1ffd);
2021-04-26 21:39:11 +00:00
DeclareField(ay);
2021-04-25 17:00:43 +00:00
}
}
};
}