Crusader_Decomp/rebuild/remorse/include/remorse/usecode_vm.h
Maddo e757bb33d0 Add extensive tests for animation, input handling, and map rendering
- Enhanced animation archive tests to validate frame metadata and start frame selection logic.
- Introduced new tests for entity dispatch entry handling, including key event queuing and processing.
- Added tests for fixed map item interactions, including glob egg hatching and item movement.
- Expanded flex archive tests to cover teleport egg spawning and usecode event selection.
- Implemented isometric controls tests to verify directional key handling and animation state changes.
- Improved map renderer tests to ensure correct rendering of map previews and collision detection.
2026-09-27 11:48:14 +02:00

30 lines
No EOL
614 B
C++

#pragma once
#include <array>
#include <cstddef>
#include <optional>
#include <vector>
#include "remorse/compat.h"
namespace remorse {
struct UsecodeCallFrame {
u16 offset = 0;
u16 segment = 0;
};
class UsecodeInterpreterState {
public:
static std::optional<UsecodeInterpreterState> initialize(
const std::vector<u8>& itemParameter);
bool pushCodeAddress(u16 offset, u16 segment);
std::array<u8, 0xcc> valueStack{};
std::size_t stackTop = 0xcc;
std::array<UsecodeCallFrame, 32> callFrames{};
u16 callFrameCount = 0;
u16 stackLimit = 199;
};
} // namespace remorse