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

54 lines
1.1 KiB
C++
Raw 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.
//
#ifndef State_hpp
#define State_hpp
#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
namespace Sinclair {
namespace ZXSpectrum {
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
}
}
};
}
}
#endif /* State_h */