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.
This commit is contained in:
Maddo 2026-09-27 11:48:14 +02:00
commit e757bb33d0
20 changed files with 1247 additions and 142 deletions

View file

@ -0,0 +1,29 @@
#include "remorse/usecode_vm.h"
#include <algorithm>
namespace remorse {
std::optional<UsecodeInterpreterState> UsecodeInterpreterState::initialize(
const std::vector<u8>& itemParameter)
{
if (itemParameter.size() > 0xcc) {
return std::nullopt;
}
UsecodeInterpreterState state;
state.stackTop -= itemParameter.size();
std::copy(itemParameter.begin(), itemParameter.end(),
state.valueStack.begin() + state.stackTop);
return state;
}
bool UsecodeInterpreterState::pushCodeAddress(u16 offset, u16 segment)
{
if (callFrameCount >= 0x1f) {
return false;
}
callFrames[callFrameCount++] = UsecodeCallFrame{offset, segment};
return true;
}
} // namespace remorse