Add tests for controller fire attempt suppression and usecode interpreter functionality
- Enhanced isometric_controls_tests.cpp to include assertions for controller fire attempt suppression under various conditions. - Added tests for the Usecode interpreter in usecode_vm_tests.cpp, verifying script execution and stack manipulation. - Introduced a new PowerShell script, clean-old-build-artifacts.ps1, to facilitate the cleanup of old build artifacts in specified directories.
This commit is contained in:
parent
49a15602b6
commit
ffb1918f35
41 changed files with 3611 additions and 349 deletions
|
|
@ -776,15 +776,7 @@ void ProcessKernel::refreshActiveGroup(const u16 (&groupCounts)[32])
|
|||
if (groupCounts[activeGroup_] != 0) {
|
||||
return;
|
||||
}
|
||||
u8 highestGroup = 1;
|
||||
for (const EntityDispatchEntryBase* entry : processes_) {
|
||||
if (entry != nullptr) {
|
||||
const u8 groupId = entry->bytes[0x08] & 0x1f;
|
||||
if (groupId > highestGroup && groupId != 30 && groupId != 31) {
|
||||
highestGroup = groupId;
|
||||
}
|
||||
}
|
||||
}
|
||||
const u8 highestGroup = ported::selectHighestOrdinaryProcessGroup(processes_.data(), processes_.size());
|
||||
setActiveGroup(highestGroup);
|
||||
groupSelectionPending_ = false;
|
||||
}
|
||||
|
|
@ -1103,18 +1095,10 @@ void ProcessKernel::scanRunnableProcesses(u8 activeGroup, void (*run)(EntityDisp
|
|||
EntityDispatchEntry::unlinkSleep(*entry);
|
||||
}
|
||||
}
|
||||
if ((readLe16(*entry, 0x16) & 0x40) != 0) {
|
||||
writeLe16(*entry, 0x16, static_cast<u16>(readLe16(*entry, 0x16) & ~0x40));
|
||||
} else {
|
||||
const u8 groupId = entry->bytes[0x08] & 0x1f;
|
||||
const u16 flags = readLe16(*entry, 0x16);
|
||||
if ((readLe16(*entry, 0x18) & 0x1000) == 0 && readLe16(*entry, 0x24) == 0 &&
|
||||
readLe16(*entry, 0x26) == 0 && (flags & 1) == 0 &&
|
||||
((flags & 2) != 0 || groupId == activeGroup_ || groupId == 30 || groupId == 31)) {
|
||||
currentProcessId_ = static_cast<u16>(id);
|
||||
run(*entry, context);
|
||||
currentProcessId_ = 0;
|
||||
}
|
||||
if (ported::prepareProcessForSchedulerRun(*entry, activeGroup_, waitingForProcess)) {
|
||||
currentProcessId_ = static_cast<u16>(id);
|
||||
run(*entry, context);
|
||||
currentProcessId_ = 0;
|
||||
}
|
||||
}
|
||||
clearTerminatedProcesses();
|
||||
|
|
@ -1236,13 +1220,7 @@ void EntityDispatchEntry::setGroupId(EntityDispatchEntryBase& entry, u8 groupId,
|
|||
|
||||
void EntityDispatchEntry::incrementGroupId(EntityDispatchEntryBase& entry, ProcessKernel& kernel, u16 (&groupCounts)[32])
|
||||
{
|
||||
const u8 previousGroup = entry.bytes[groupIdOffset] & 0x1f;
|
||||
const u8 nextGroup = static_cast<u8>(previousGroup + 1);
|
||||
if (nextGroup >= 30 || kernel.activeGroup() != previousGroup) {
|
||||
throw std::invalid_argument("process group cannot advance from the current active group");
|
||||
}
|
||||
setGroupId(entry, nextGroup, groupCounts);
|
||||
kernel.setActiveGroup(nextGroup);
|
||||
ported::incrementEntityDispatchEntryGroupId(entry, kernel, groupCounts);
|
||||
}
|
||||
|
||||
void EntityDispatchEntry::setSourceType(EntityDispatchEntryBase& entry, u16 sourceType)
|
||||
|
|
@ -1375,24 +1353,4 @@ bool ProcessKernel::pendingKeyEventOverflowed() const
|
|||
return pendingKeyEventOverflowed_;
|
||||
}
|
||||
|
||||
void ProcessKernel::dispatchPendingKeyEvents(
|
||||
void (*deliver)(EntityDispatchEntryBase&, u16, u16, KeyEvent&, void*), void* context)
|
||||
{
|
||||
while (auto event = popPendingKeyEvent()) {
|
||||
const std::size_t subscriberCount = keyboardSubscriberIds_.size();
|
||||
for (std::size_t index = 0; index < subscriberCount; ++index) {
|
||||
const u16 id = keyboardSubscriberIds_[index];
|
||||
auto* process = processAt(id);
|
||||
if (!process || allocationSizeAt(id) < 0x34 ||
|
||||
(readLe16(*process, 0x16) & 0x08) != 0 ||
|
||||
(readLe16(*process, 0x18) & 0x180) != 0x80 ||
|
||||
(reinterpret_cast<const u8*>(process)[0x32] & 0x10) == 0) {
|
||||
continue;
|
||||
}
|
||||
KeyEvent copy = *event;
|
||||
deliver(*process, 0x10, 0, copy, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace remorse
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "remorse/fixed_map.h"
|
||||
#include "remorse/collision.h"
|
||||
#include "remorse/glob_archive.h"
|
||||
|
||||
#include "remorse/entity_dispatch_entry.h"
|
||||
|
|
@ -377,6 +378,9 @@ std::optional<std::vector<ItemFindZCandidate>> collectZMatches(const StagedFixed
|
|||
const auto area = itemFindAreaAroundItem(origin, shapes[origin.data.shape]);
|
||||
for (const auto itemNumber : itemFindCandidateOrder(area, *chains)) {
|
||||
const auto& candidate = *byId[itemNumber];
|
||||
if ((candidate.data.flags & liveItemEtherealFlag) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (checkRectangle && (candidate.data.x < area.minX || candidate.data.x > area.maxX ||
|
||||
candidate.data.y < area.minY || candidate.data.y > area.maxY)) {
|
||||
continue;
|
||||
|
|
@ -455,7 +459,8 @@ std::optional<std::vector<u16>> dispatchStagedItemGrab(const StagedFixedMapItem&
|
|||
|
||||
LiveFixedMapItems::LiveFixedMapItems(std::vector<StagedFixedMapItem> items,
|
||||
std::vector<StagedContainedFixedMapItem> containedItems)
|
||||
: items_(std::move(items)), allocatedIds_(0x2800), hatchedGlobIds_(0x2800), parentById_(0x2800),
|
||||
: items_(std::move(items)), allocatedIds_(0x2800), destroyedIds_(0x2800),
|
||||
hatchedGlobIds_(0x2800), parentById_(0x2800),
|
||||
containedItemData_(0x2800), containedNextById_(0x2800), containedHeadById_(0x2800),
|
||||
containedTailById_(0x2800)
|
||||
{
|
||||
|
|
@ -734,6 +739,112 @@ bool LiveFixedMapItems::insertItem(StagedFixedMapItem item)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LiveFixedMapItems::pushItemToEtherealVoid(u16 itemNumber)
|
||||
{
|
||||
const auto item = std::find_if(items_.begin(), items_.end(), [itemNumber](const auto& candidate) {
|
||||
return candidate.itemNumber == itemNumber;
|
||||
});
|
||||
if (item == items_.end()) {
|
||||
return false;
|
||||
}
|
||||
if ((item->data.flags & liveItemEtherealFlag) == 0) {
|
||||
item->data.flags |= liveItemEtherealFlag;
|
||||
etherealStack_.push_back(itemNumber);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::optional<u16> LiveFixedMapItems::popItemFromEtherealVoid()
|
||||
{
|
||||
while (!etherealStack_.empty()) {
|
||||
const u16 itemNumber = etherealStack_.back();
|
||||
etherealStack_.pop_back();
|
||||
const auto item = std::find_if(items_.begin(), items_.end(), [itemNumber](const auto& candidate) {
|
||||
return candidate.itemNumber == itemNumber;
|
||||
});
|
||||
if (item == items_.end()) {
|
||||
continue;
|
||||
}
|
||||
item->data.flags &= static_cast<u16>(~liveItemEtherealFlag);
|
||||
return itemNumber;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<u16> LiveFixedMapItems::popItemToCoords(u16 x, u16 y, u8 z)
|
||||
{
|
||||
if (x > 0x7fff || y > 0x7fff) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto itemNumber = popItemFromEtherealVoid();
|
||||
if (!itemNumber) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto* item = findItem(*itemNumber);
|
||||
if (item && item->data.shape == 1408 && z > 0) {
|
||||
--z;
|
||||
}
|
||||
return moveItem(*itemNumber, x, y, z) ? itemNumber : std::nullopt;
|
||||
}
|
||||
|
||||
bool LiveFixedMapItems::destroyItem(u16 itemNumber)
|
||||
{
|
||||
if (itemNumber < 0x100 || itemNumber >= allocatedIds_.size() || !allocatedIds_[itemNumber] ||
|
||||
destroyedIds_[itemNumber] || containedHeadById_[itemNumber] != 0) {
|
||||
return false;
|
||||
}
|
||||
const auto worldItem = std::find_if(items_.begin(), items_.end(), [itemNumber](const auto& item) {
|
||||
return item.itemNumber == itemNumber;
|
||||
});
|
||||
const bool wasContained = worldItem == items_.end() && parentById_[itemNumber] != 0 &&
|
||||
containedItemData_[itemNumber].has_value();
|
||||
if (worldItem == items_.end() && !wasContained) {
|
||||
return false;
|
||||
}
|
||||
if (wasContained && !unlinkContainedItem(itemNumber)) {
|
||||
return false;
|
||||
}
|
||||
if (worldItem != items_.end()) {
|
||||
items_.erase(worldItem);
|
||||
}
|
||||
containedItemData_[itemNumber].reset();
|
||||
containedNextById_[itemNumber] = 0;
|
||||
parentById_[itemNumber] = 0;
|
||||
destroyedIds_[itemNumber] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LiveFixedMapItems::canCreateItemAt(u16 shape, u16 x, u16 y, u8 z,
|
||||
const std::vector<ShapeTypeInfo>& shapes) const
|
||||
{
|
||||
constexpr u32 blockingShapeFlags = 0x0002 | 0x0004;
|
||||
if (shape >= shapes.size() || x > 0x7fff || y > 0x7fff) {
|
||||
return false;
|
||||
}
|
||||
const auto& createdShape = shapes[shape];
|
||||
if ((createdShape.flags & blockingShapeFlags) == 0) {
|
||||
return true;
|
||||
}
|
||||
const auto createdBody = makeCollisionBody(WorldPoint{static_cast<s32>(x) * crusaderCoordinateScale,
|
||||
static_cast<s32>(y) * crusaderCoordinateScale, z}, createdShape);
|
||||
for (const auto& item : items_) {
|
||||
if ((item.data.flags & liveItemEtherealFlag) != 0 || item.data.shape >= shapes.size()) {
|
||||
continue;
|
||||
}
|
||||
const auto& obstacleShape = shapes[item.data.shape];
|
||||
if ((obstacleShape.flags & blockingShapeFlags) == 0) {
|
||||
continue;
|
||||
}
|
||||
const WorldPoint itemLocation{static_cast<s32>(item.data.x) * crusaderCoordinateScale,
|
||||
static_cast<s32>(item.data.y) * crusaderCoordinateScale, item.data.z};
|
||||
if (collisionBodiesOverlap(createdBody, makeCollisionBody(itemLocation, obstacleShape,
|
||||
(item.data.flags & 0x0020) != 0))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LiveFixedMapItems::moveItemIntoContainer(u16 itemNumber, u16 containerItemNumber,
|
||||
const std::vector<ShapeTypeInfo>& shapes)
|
||||
{
|
||||
|
|
@ -809,6 +920,12 @@ bool LiveFixedMapItems::releaseItem(u16 itemNumber, const ProcessKernel& kernel)
|
|||
hatchedGlobIds_[itemNumber]) {
|
||||
return false;
|
||||
}
|
||||
if (destroyedIds_[itemNumber]) {
|
||||
destroyedIds_[itemNumber] = false;
|
||||
allocatedIds_[itemNumber] = false;
|
||||
freeItemIds_.push_back(itemNumber);
|
||||
return true;
|
||||
}
|
||||
const auto worldItem = std::find_if(items_.begin(), items_.end(), [itemNumber](const auto& item) {
|
||||
return item.itemNumber == itemNumber;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ namespace {
|
|||
|
||||
constexpr u16 flagInvisible = 0x0010;
|
||||
constexpr u16 flagFlipped = 0x0020;
|
||||
constexpr u16 flagEthereal = liveItemEtherealFlag;
|
||||
constexpr u32 siSolid = 0x0002;
|
||||
constexpr u32 siLand = 0x0008;
|
||||
constexpr u32 siOccl = 0x0010;
|
||||
|
|
@ -135,6 +136,9 @@ std::vector<SceneItem> collectSceneItems(
|
|||
if ((item.flags & flagInvisible) != 0 && !options.includeHiddenMarkers) {
|
||||
continue;
|
||||
}
|
||||
if ((item.flags & flagEthereal) != 0) {
|
||||
continue;
|
||||
}
|
||||
if ((info.flags & siRoof) != 0 && !options.includeRoofs) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
12
rebuild/remorse/src/ported/controller_fire_sleep_gate.cpp
Normal file
12
rebuild/remorse/src/ported/controller_fire_sleep_gate.cpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include "remorse/isometric_controls.h"
|
||||
|
||||
namespace remorse {
|
||||
|
||||
bool controllerFireAttemptSuppressed(bool previousAttemptSlept, u8 scanCode,
|
||||
u8 eventMode, u8 keyState)
|
||||
{
|
||||
return previousAttemptSlept && eventMode != 0 &&
|
||||
(scanCode == 0x39 || (scanCode == 0x52 && keyState == 0));
|
||||
}
|
||||
|
||||
} // namespace remorse
|
||||
|
|
@ -6,5 +6,13 @@ namespace remorse::ported {
|
|||
|
||||
void setEntityDispatchEntryGroupId(EntityDispatchEntryBase& entry, u8 groupId,
|
||||
u16 (&groupCounts)[32]);
|
||||
void incrementEntityDispatchEntryGroupId(EntityDispatchEntryBase& entry, ProcessKernel& kernel,
|
||||
u16 (&groupCounts)[32]);
|
||||
bool prepareProcessForSchedulerRun(EntityDispatchEntryBase& entry, u8 activeGroup,
|
||||
bool waitingForProcess);
|
||||
u8 selectHighestOrdinaryProcessGroup(EntityDispatchEntryBase* const* processes,
|
||||
std::size_t processCount);
|
||||
bool isKeyboardInterruptDispatchEligible(const EntityDispatchEntryBase& process,
|
||||
std::size_t allocationSize, u8 activeGroup);
|
||||
|
||||
} // namespace remorse::ported
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
#include "entity_dispatch_entry_port.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace remorse::ported {
|
||||
|
||||
void setEntityDispatchEntryGroupId(EntityDispatchEntryBase& entry, u8 groupId,
|
||||
|
|
@ -15,4 +17,19 @@ void setEntityDispatchEntryGroupId(EntityDispatchEntryBase& entry, u8 groupId,
|
|||
}
|
||||
}
|
||||
|
||||
void incrementEntityDispatchEntryGroupId(EntityDispatchEntryBase& entry, ProcessKernel& kernel,
|
||||
u16 (&groupCounts)[32])
|
||||
{
|
||||
const u8 previousGroup = entry.bytes[0x08] & 0x1f;
|
||||
const u8 nextGroup = static_cast<u8>(previousGroup + 1);
|
||||
if (nextGroup >= 30) {
|
||||
throw std::invalid_argument("process group cannot advance beyond group 29");
|
||||
}
|
||||
if (kernel.activeGroup() != previousGroup) {
|
||||
throw std::invalid_argument("process group must match the active group");
|
||||
}
|
||||
setEntityDispatchEntryGroupId(entry, nextGroup, groupCounts);
|
||||
kernel.setActiveGroup(nextGroup);
|
||||
}
|
||||
|
||||
} // namespace remorse::ported
|
||||
29
rebuild/remorse/src/ported/game_start_fresh_map.cpp
Normal file
29
rebuild/remorse/src/ported/game_start_fresh_map.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "remorse/game_start.h"
|
||||
|
||||
#include "remorse/entity_dispatch_entry.h"
|
||||
#include "remorse/fixed_map.h"
|
||||
|
||||
namespace remorse {
|
||||
|
||||
bool startFreshGameMapOne(ProcessKernel& kernel, LiveFixedMapItems& items,
|
||||
const std::vector<ShapeTypeInfo>& shapes, u16 (&groupCounts)[32])
|
||||
{
|
||||
if (!items.initializeAvatar() ||
|
||||
!runFreshGameTeleporterStartup(kernel, items, 1, 0x1e, shapes, groupCounts)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const StagedFixedMapItem* avatar = items.findItem(1);
|
||||
if (avatar == nullptr) {
|
||||
return false;
|
||||
}
|
||||
const auto stagingTeleporter = findNearbyActiveTeleportEgg(*avatar, items.mapItems(), shapes, 1);
|
||||
if (!stagingTeleporter) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return runFreshGameTeleporterStartup(kernel, items, stagingTeleporter->data.mapNumber,
|
||||
static_cast<u8>(stagingTeleporter->data.quality & 0xff), shapes, groupCounts);
|
||||
}
|
||||
|
||||
} // namespace remorse
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#include "remorse/entity_dispatch_entry.h"
|
||||
#include "entity_dispatch_entry_port.h"
|
||||
|
||||
namespace remorse {
|
||||
|
||||
void ProcessKernel::dispatchPendingKeyEvents(
|
||||
void (*deliver)(EntityDispatchEntryBase&, u16, u16, KeyEvent&, void*), void* context)
|
||||
{
|
||||
while (auto event = popPendingKeyEvent()) {
|
||||
const std::size_t subscriberCount = keyboardSubscriberIds_.size();
|
||||
for (std::size_t index = 0; index < subscriberCount; ++index) {
|
||||
const u16 processId = keyboardSubscriberIds_[index];
|
||||
auto* process = processAt(processId);
|
||||
if (process == nullptr || !ported::isKeyboardInterruptDispatchEligible(
|
||||
*process, allocationSizeAt(processId), activeGroup_)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
KeyEvent processEvent = *event;
|
||||
deliver(*process, 0x10, 0, processEvent, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace remorse
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
#include "entity_dispatch_entry_port.h"
|
||||
|
||||
namespace remorse::ported {
|
||||
namespace {
|
||||
|
||||
u16 readLe16(const EntityDispatchEntryBase& process, u16 offset)
|
||||
{
|
||||
return static_cast<u16>(process.bytes[offset] |
|
||||
(static_cast<u16>(process.bytes[offset + 1]) << 8));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool isKeyboardInterruptDispatchEligible(const EntityDispatchEntryBase& process,
|
||||
std::size_t allocationSize, u8 activeGroup)
|
||||
{
|
||||
const u16 processFlags = readLe16(process, 0x16);
|
||||
const u16 extensionFlags = readLe16(process, 0x18);
|
||||
const u8 processGroup = process.bytes[0x08] & 0x1f;
|
||||
return allocationSize >= 0x34 && (processFlags & 0x08) == 0 &&
|
||||
(extensionFlags & 0x180) == 0x80 &&
|
||||
(process.bytes[0x32] & 0x10) != 0 &&
|
||||
(processGroup >= activeGroup || processGroup == 30 || processGroup == 31);
|
||||
}
|
||||
|
||||
} // namespace remorse::ported
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#include "entity_dispatch_entry_port.h"
|
||||
|
||||
namespace remorse::ported {
|
||||
|
||||
u8 selectHighestOrdinaryProcessGroup(EntityDispatchEntryBase* const* processes,
|
||||
std::size_t processCount)
|
||||
{
|
||||
u8 highestGroup = 1;
|
||||
for (std::size_t processId = 0; processId < processCount; ++processId) {
|
||||
const EntityDispatchEntryBase* process = processes[processId];
|
||||
if (process == nullptr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const u8 groupId = process->bytes[0x08] & 0x1f;
|
||||
if (groupId > highestGroup && groupId != 30 && groupId != 31) {
|
||||
highestGroup = groupId;
|
||||
}
|
||||
}
|
||||
return highestGroup;
|
||||
}
|
||||
|
||||
} // namespace remorse::ported
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#include "entity_dispatch_entry_port.h"
|
||||
|
||||
namespace remorse::ported {
|
||||
namespace {
|
||||
|
||||
u16 readLe16(const EntityDispatchEntryBase& entry, u16 offset)
|
||||
{
|
||||
return static_cast<u16>(entry.bytes[offset] | (static_cast<u16>(entry.bytes[offset + 1]) << 8));
|
||||
}
|
||||
|
||||
void writeLe16(EntityDispatchEntryBase& entry, u16 offset, u16 value)
|
||||
{
|
||||
entry.bytes[offset] = static_cast<u8>(value & 0xff);
|
||||
entry.bytes[offset + 1] = static_cast<u8>(value >> 8);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool prepareProcessForSchedulerRun(EntityDispatchEntryBase& entry, u8 activeGroup,
|
||||
bool waitingForProcess)
|
||||
{
|
||||
const u16 processFlags = readLe16(entry, 0x16);
|
||||
if ((processFlags & 0x40) != 0) {
|
||||
writeLe16(entry, 0x16, static_cast<u16>(processFlags & ~0x40));
|
||||
return false;
|
||||
}
|
||||
|
||||
const u8 groupId = entry.bytes[0x08] & 0x1f;
|
||||
return !waitingForProcess && (processFlags & 0x08) == 0 &&
|
||||
(readLe16(entry, 0x18) & 0x1000) == 0 && readLe16(entry, 0x24) == 0 &&
|
||||
readLe16(entry, 0x26) == 0 && (processFlags & 1) == 0 &&
|
||||
((processFlags & 2) != 0 || groupId == activeGroup || groupId == 30 || groupId == 31);
|
||||
}
|
||||
|
||||
} // namespace remorse::ported
|
||||
|
|
@ -68,6 +68,15 @@ bool UsecodeInterpreterState::pushWord(u16 value)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool UsecodeInterpreterState::pushByte(u8 value)
|
||||
{
|
||||
if (stackTop == 0) {
|
||||
return false;
|
||||
}
|
||||
valueStack[--stackTop] = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UsecodeInterpreterState::pushDword(u32 value)
|
||||
{
|
||||
if (stackTop < sizeof(value)) {
|
||||
|
|
@ -107,7 +116,7 @@ std::optional<u32> UsecodeInterpreterState::popDword()
|
|||
}
|
||||
|
||||
UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
||||
std::size_t& programCounter, std::vector<u8>& frame,
|
||||
std::size_t& programCounter, std::vector<u8>& frame, std::size_t frameBaseOffset,
|
||||
const UsecodeOpcodeServices& services)
|
||||
{
|
||||
if (programCounter >= code.size()) {
|
||||
|
|
@ -119,7 +128,7 @@ UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
|||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const auto rawOffset = static_cast<s8>(code[programCounter]);
|
||||
const auto localIndex = static_cast<std::ptrdiff_t>(usecodeFrameBaseOffset) + rawOffset;
|
||||
const auto localIndex = static_cast<std::ptrdiff_t>(frameBaseOffset) + rawOffset;
|
||||
const bool byteOperation = opcode == 0x00 || opcode == 0x3e;
|
||||
const std::size_t valueSize = byteOperation ? sizeof(u8) : sizeof(u16);
|
||||
if (localIndex < 0 || static_cast<std::size_t>(localIndex) > frame.size() ||
|
||||
|
|
@ -194,7 +203,7 @@ UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
|||
temporaryWord = *result;
|
||||
return UsecodeStepResult::Advanced;
|
||||
}
|
||||
if (opcode == 0x14 || opcode == 0x1c || opcode == 0x24 || opcode == 0x2a ||
|
||||
if (opcode == 0x14 || opcode == 0x1c || opcode == 0x1e || opcode == 0x24 || opcode == 0x2a ||
|
||||
opcode == 0x2c || opcode == 0x36) {
|
||||
const auto right = popWord();
|
||||
const auto left = right ? popWord() : std::nullopt;
|
||||
|
|
@ -205,6 +214,8 @@ UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
|||
u16 result = 0;
|
||||
if (opcode == 0x14) result = static_cast<u16>(*left + *right);
|
||||
else if (opcode == 0x1c) result = static_cast<u16>(*left - *right);
|
||||
else if (opcode == 0x1e) result = static_cast<u16>(
|
||||
static_cast<s16>(*left) * static_cast<s16>(*right));
|
||||
else if (opcode == 0x24) result = static_cast<u16>(*left == *right);
|
||||
else if (opcode == 0x2a) result = static_cast<u16>(*left <= *right);
|
||||
else if (opcode == 0x2c) result = static_cast<u16>(static_cast<s16>(*left) > static_cast<s16>(*right));
|
||||
|
|
@ -277,6 +288,13 @@ UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
|||
stackHighWatermark = std::max(stackHighWatermark, stackTop);
|
||||
return UsecodeStepResult::Advanced;
|
||||
}
|
||||
if (opcode == 0x74) {
|
||||
if (programCounter >= code.size()) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const u8 value = code[programCounter++];
|
||||
return pushByte(value) ? UsecodeStepResult::Advanced : UsecodeStepResult::StackFault;
|
||||
}
|
||||
if (opcode == 0x12) {
|
||||
const auto value = popWord();
|
||||
if (!value) {
|
||||
|
|
@ -298,17 +316,36 @@ UsecodeStepResult UsecodeInterpreterState::step(const std::vector<u8>& code,
|
|||
if (programCounter >= code.size()) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const std::size_t localOffset = code[programCounter++];
|
||||
const std::size_t localIndex = usecodeFrameBaseOffset + localOffset;
|
||||
if (localIndex > frame.size() || frame.size() - localIndex < sizeof(u32)) {
|
||||
const std::size_t operandOffset = code[programCounter++];
|
||||
const auto localIndex = static_cast<std::ptrdiff_t>(frameBaseOffset) + operandOffset;
|
||||
if (localIndex < 0 || static_cast<std::size_t>(localIndex) > frame.size() ||
|
||||
frame.size() - static_cast<std::size_t>(localIndex) < sizeof(u32)) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const u32 value = static_cast<u32>(frame[localIndex]) |
|
||||
(static_cast<u32>(frame[localIndex + 1]) << 8) |
|
||||
(static_cast<u32>(frame[localIndex + 2]) << 16) |
|
||||
(static_cast<u32>(frame[localIndex + 3]) << 24);
|
||||
const std::size_t localOffset = static_cast<std::size_t>(localIndex);
|
||||
const u32 value = static_cast<u32>(frame[localOffset]) |
|
||||
(static_cast<u32>(frame[localOffset + 1]) << 8) |
|
||||
(static_cast<u32>(frame[localOffset + 2]) << 16) |
|
||||
(static_cast<u32>(frame[localOffset + 3]) << 24);
|
||||
return pushDword(value) ? UsecodeStepResult::Advanced : UsecodeStepResult::StackFault;
|
||||
}
|
||||
if (opcode == 0x4b) {
|
||||
if (programCounter >= code.size()) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
if (!services.currentProcessId) {
|
||||
--programCounter;
|
||||
return UsecodeStepResult::UnsupportedOpcode;
|
||||
}
|
||||
const auto displacement = static_cast<s8>(code[programCounter++]);
|
||||
const auto localIndex = static_cast<std::ptrdiff_t>(frameBaseOffset) + displacement;
|
||||
if (localIndex < 0 || static_cast<std::size_t>(localIndex) >= frame.size()) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const u32 address = (static_cast<u32>(services.currentProcessId()) << 16) |
|
||||
static_cast<u16>(localIndex);
|
||||
return pushDword(address) ? UsecodeStepResult::Advanced : UsecodeStepResult::StackFault;
|
||||
}
|
||||
if (opcode == 0x4c) {
|
||||
if (programCounter >= code.size()) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
|
|
@ -482,6 +519,35 @@ std::optional<u16> UsecodeProcessTask::readMappedItemWord(FarPtr16 address) cons
|
|||
(static_cast<u16>(itemMemory[address.offset + 1]) << 8));
|
||||
}
|
||||
|
||||
std::optional<u16> UsecodeProcessTask::readMappedFarWord(FarPtr16 address) const
|
||||
{
|
||||
if (address.segment == processId) {
|
||||
if (address.offset > frame.size() || frame.size() - address.offset < sizeof(u16)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return static_cast<u16>(frame[address.offset] |
|
||||
(static_cast<u16>(frame[address.offset + 1]) << 8));
|
||||
}
|
||||
return readMappedItemWord(address);
|
||||
}
|
||||
|
||||
bool UsecodeProcessTask::writeMappedFarWord(FarPtr16 address, u16 value)
|
||||
{
|
||||
std::vector<u8>* memory = nullptr;
|
||||
if (address.segment == processId) {
|
||||
memory = &frame;
|
||||
} else if (address.segment == 0) {
|
||||
memory = &itemMemory;
|
||||
}
|
||||
if (memory == nullptr || address.offset > memory->size() ||
|
||||
memory->size() - address.offset < sizeof(u16)) {
|
||||
return false;
|
||||
}
|
||||
(*memory)[address.offset] = static_cast<u8>(value);
|
||||
(*memory)[address.offset + 1] = static_cast<u8>(value >> 8);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool writeUsecodeContextFactoryFields(u8* processBytes, std::size_t processSize,
|
||||
const UsecodeContextFactoryFields& fields)
|
||||
{
|
||||
|
|
@ -691,7 +757,62 @@ UsecodeStepResult UsecodeProcessTask::step(const UsecodeOpcodeServices& services
|
|||
if (halted) {
|
||||
return UsecodeStepResult::Returned;
|
||||
}
|
||||
const auto result = interpreter.step(code, programCounter, frame, services);
|
||||
if (programCounter < code.size() && code[programCounter] == 0x11) {
|
||||
if (code.size() - programCounter < 5) {
|
||||
return UsecodeStepResult::InvalidInstruction;
|
||||
}
|
||||
const u16 calleeClassId = static_cast<u16>(code[programCounter + 1] |
|
||||
(static_cast<u16>(code[programCounter + 2]) << 8));
|
||||
const u16 calleeEventSlot = static_cast<u16>(code[programCounter + 3] |
|
||||
(static_cast<u16>(code[programCounter + 4]) << 8));
|
||||
if (!services.callEvent) {
|
||||
return UsecodeStepResult::UnsupportedOpcode;
|
||||
}
|
||||
if (routineFrames.size() >= 31) {
|
||||
return UsecodeStepResult::StackFault;
|
||||
}
|
||||
auto calleeBody = services.callEvent(calleeClassId, calleeEventSlot);
|
||||
if (!calleeBody || calleeBody->bytes.size() <= usecodeEventBytecodeOffset) {
|
||||
return UsecodeStepResult::ServiceRejected;
|
||||
}
|
||||
constexpr std::size_t callFrameBytes = 3 * sizeof(u16);
|
||||
if (frameBaseOffset < callFrameBytes) {
|
||||
return UsecodeStepResult::StackFault;
|
||||
}
|
||||
routineFrames.push_back({classId, eventSlot, std::move(code), frame, frameBaseOffset,
|
||||
programCounter + 5});
|
||||
if (!interpreter.pushCodeAddress(calleeClassId, calleeEventSlot)) {
|
||||
code = std::move(routineFrames.back().code);
|
||||
frame = std::move(routineFrames.back().frame);
|
||||
routineFrames.pop_back();
|
||||
return UsecodeStepResult::StackFault;
|
||||
}
|
||||
const std::size_t calleeArgumentOffset = frameBaseOffset;
|
||||
classId = calleeClassId;
|
||||
eventSlot = calleeEventSlot;
|
||||
frameBaseOffset -= callFrameBytes;
|
||||
std::fill(frame.begin(), frame.end(), u8{0});
|
||||
const std::size_t copiedArgumentBytes = std::min(frame.size() - calleeArgumentOffset,
|
||||
interpreter.valueStack.size() - interpreter.stackTop);
|
||||
std::copy_n(interpreter.valueStack.begin() + interpreter.stackTop,
|
||||
copiedArgumentBytes, frame.begin() + calleeArgumentOffset);
|
||||
code = std::move(calleeBody->bytes);
|
||||
programCounter = usecodeEventBytecodeOffset;
|
||||
return UsecodeStepResult::Advanced;
|
||||
}
|
||||
const auto result = interpreter.step(code, programCounter, frame, frameBaseOffset, services);
|
||||
if (result == UsecodeStepResult::Returned && !routineFrames.empty()) {
|
||||
UsecodeRoutineFrame caller = std::move(routineFrames.back());
|
||||
routineFrames.pop_back();
|
||||
--interpreter.callFrameCount;
|
||||
classId = caller.classId;
|
||||
eventSlot = caller.eventSlot;
|
||||
frameBaseOffset = caller.frameBaseOffset;
|
||||
frame = std::move(caller.frame);
|
||||
code = std::move(caller.code);
|
||||
programCounter = caller.returnProgramCounter;
|
||||
return UsecodeStepResult::Advanced;
|
||||
}
|
||||
halted = result == UsecodeStepResult::Returned;
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "remorse/entity_dispatch_entry.h"
|
||||
#include "remorse/file_system.h"
|
||||
#include "remorse/fixed_map.h"
|
||||
#include "remorse/game_start.h"
|
||||
#include "remorse/glob_archive.h"
|
||||
#include "remorse/isometric_controls.h"
|
||||
#include "remorse/map_renderer.h"
|
||||
|
|
@ -342,7 +343,16 @@ void runUsecodeTasks(AppState& state)
|
|||
remorse::UsecodeOpcodeServices services;
|
||||
services.readFarWord = [task](remorse::u16 offset, remorse::u16 segment)
|
||||
-> std::optional<remorse::u16> {
|
||||
return task->readMappedItemWord(remorse::FarPtr16{offset, segment});
|
||||
return task->readMappedFarWord(remorse::FarPtr16{offset, segment});
|
||||
};
|
||||
services.callEvent = [&app](remorse::u16 classId, remorse::u16 eventSlot)
|
||||
-> std::optional<remorse::UsecodeEventBody> {
|
||||
if (!app.usecodeArchive) {
|
||||
return std::nullopt;
|
||||
}
|
||||
const auto usecodeClass = remorse::loadUsecodeClass(*app.usecodeArchive, classId);
|
||||
return usecodeClass
|
||||
? remorse::readUsecodeEventBody(*usecodeClass, eventSlot) : std::nullopt;
|
||||
};
|
||||
services.setInfo = [&app, processId](remorse::u16 eventType, remorse::u16 sourceItem) {
|
||||
return app.diagnosticKernel.setProcessInfo(processId, eventType, sourceItem);
|
||||
|
|
@ -360,6 +370,12 @@ void runUsecodeTasks(AppState& state)
|
|||
return static_cast<remorse::u16>(keycard < 64 &&
|
||||
(app.heldKeycards & (std::uint64_t{1} << keycard)) != 0);
|
||||
}
|
||||
if (ordinal == 0xac && argumentBytes == 2) {
|
||||
const remorse::u16 shape = static_cast<remorse::u16>(arguments[0] |
|
||||
(static_cast<remorse::u16>(arguments[1]) << 8));
|
||||
return shape < app.shapeTypes.size()
|
||||
? std::optional<remorse::u16>{app.shapeTypes[shape].family} : std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x15 && argumentBytes == 6) {
|
||||
return remorse::u16{0};
|
||||
}
|
||||
|
|
@ -373,10 +389,88 @@ void runUsecodeTasks(AppState& state)
|
|||
(static_cast<remorse::u16>(arguments[1]) << 8));
|
||||
const remorse::u16 segment = static_cast<remorse::u16>(arguments[2] |
|
||||
(static_cast<remorse::u16>(arguments[3]) << 8));
|
||||
const auto itemNumber = task->readMappedItemWord(remorse::FarPtr16{offset, segment});
|
||||
if (ordinal == 0x0a && argumentBytes == 4) {
|
||||
const auto itemNumber = task->readMappedFarWord(remorse::FarPtr16{offset, segment});
|
||||
if (itemNumber && app.liveItems && app.liveItems->destroyItem(*itemNumber)) {
|
||||
app.usecodeWorldMutationPending = true;
|
||||
}
|
||||
return remorse::u16{0};
|
||||
}
|
||||
if (ordinal == 0x30 && argumentBytes == 4) {
|
||||
const auto poppedItem = app.liveItems
|
||||
? app.liveItems->popItemFromEtherealVoid() : std::nullopt;
|
||||
if (poppedItem) {
|
||||
app.usecodeWorldMutationPending = true;
|
||||
}
|
||||
return poppedItem.value_or(0);
|
||||
}
|
||||
if (ordinal == 0x20 && argumentBytes == 10) {
|
||||
const remorse::u16 x = static_cast<remorse::u16>(arguments[4] |
|
||||
(static_cast<remorse::u16>(arguments[5]) << 8));
|
||||
const remorse::u16 y = static_cast<remorse::u16>(arguments[6] |
|
||||
(static_cast<remorse::u16>(arguments[7]) << 8));
|
||||
const auto poppedItem = app.liveItems
|
||||
? app.liveItems->popItemToCoords(x, y, arguments[8]) : std::nullopt;
|
||||
if (poppedItem) {
|
||||
app.usecodeWorldMutationPending = true;
|
||||
}
|
||||
return poppedItem.value_or(0);
|
||||
}
|
||||
if (ordinal == 0x19 && argumentBytes == 14) {
|
||||
const remorse::u16 shape = static_cast<remorse::u16>(arguments[4] |
|
||||
(static_cast<remorse::u16>(arguments[5]) << 8));
|
||||
const remorse::u16 frame = static_cast<remorse::u16>(arguments[6] |
|
||||
(static_cast<remorse::u16>(arguments[7]) << 8));
|
||||
const remorse::u16 x = static_cast<remorse::u16>(arguments[8] |
|
||||
(static_cast<remorse::u16>(arguments[9]) << 8));
|
||||
const remorse::u16 y = static_cast<remorse::u16>(arguments[10] |
|
||||
(static_cast<remorse::u16>(arguments[11]) << 8));
|
||||
const remorse::u8 z = arguments[12];
|
||||
if (!app.liveItems || frame > 0xff ||
|
||||
!app.liveItems->canCreateItemAt(shape, x, y, z, app.shapeTypes)) {
|
||||
return remorse::u16{0};
|
||||
}
|
||||
remorse::StagedFixedMapItem createdItem;
|
||||
createdItem.recordIndex = static_cast<std::size_t>(-1);
|
||||
createdItem.data.x = x;
|
||||
createdItem.data.y = y;
|
||||
createdItem.data.z = z;
|
||||
createdItem.data.shape = shape;
|
||||
createdItem.data.frame = static_cast<remorse::u8>(frame);
|
||||
const auto itemNumber = app.liveItems->allocateItem(createdItem);
|
||||
if (!itemNumber || !task->writeMappedFarWord(
|
||||
remorse::FarPtr16{offset, segment}, *itemNumber)) {
|
||||
return remorse::u16{0};
|
||||
}
|
||||
app.usecodeWorldMutationPending = true;
|
||||
return remorse::u16{1};
|
||||
}
|
||||
const auto itemNumber = task->readMappedFarWord(remorse::FarPtr16{offset, segment});
|
||||
if (ordinal == 0x10 && argumentBytes == 4) {
|
||||
const auto* item = itemNumber && app.liveItems
|
||||
? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? static_cast<remorse::u16>(item->data.quality & 0xff)
|
||||
: remorse::u16{0};
|
||||
}
|
||||
if (!itemNumber) {
|
||||
return std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x3c && argumentBytes == 4) {
|
||||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item && item->data.shape < app.shapeTypes.size()
|
||||
? std::optional<remorse::u16>{app.shapeTypes[item->data.shape].family}
|
||||
: std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x22 && argumentBytes == 4) {
|
||||
if (!app.liveItems || !app.liveItems->pushItemToEtherealVoid(*itemNumber)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
app.usecodeWorldMutationPending = true;
|
||||
return remorse::u16{0};
|
||||
}
|
||||
if (ordinal == 0x25) {
|
||||
return remorse::u16{0};
|
||||
}
|
||||
if (ordinal == 0xea && argumentBytes == 4) {
|
||||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? std::optional<remorse::u16>{static_cast<remorse::u16>(item->data.quality & 0xff)}
|
||||
|
|
@ -390,6 +484,18 @@ void runUsecodeTasks(AppState& state)
|
|||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? std::optional<remorse::u16>{item->data.mapNumber} : std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x09 && argumentBytes == 4) {
|
||||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? std::optional<remorse::u16>{item->data.z} : std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x13 && argumentBytes == 4) {
|
||||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? std::optional<remorse::u16>{item->data.x} : std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x14 && argumentBytes == 4) {
|
||||
const auto* item = app.liveItems ? app.liveItems->findItem(*itemNumber) : nullptr;
|
||||
return item ? std::optional<remorse::u16>{item->data.y} : std::nullopt;
|
||||
}
|
||||
if (ordinal == 0x24 && argumentBytes == 6) {
|
||||
const remorse::u16 shape = static_cast<remorse::u16>(arguments[4] |
|
||||
(static_cast<remorse::u16>(arguments[5]) << 8));
|
||||
|
|
@ -399,7 +505,7 @@ void runUsecodeTasks(AppState& state)
|
|||
app.usecodeWorldMutationPending = true;
|
||||
return remorse::u16{0};
|
||||
}
|
||||
if (ordinal == 0x59 && argumentBytes == 6) {
|
||||
if ((ordinal == 0x02 || ordinal == 0x59) && argumentBytes == 6) {
|
||||
const remorse::u8 frame = static_cast<remorse::u8>(arguments[4] |
|
||||
(static_cast<remorse::u16>(arguments[5]) << 8));
|
||||
if (!app.liveItems || !app.liveItems->setItemFrame(*itemNumber, frame)) {
|
||||
|
|
@ -621,32 +727,24 @@ void loadSceneAsync(HWND window, AppState& state)
|
|||
: remorse::WorldPoint{(minX + maxX) / 2, (minY + maxY) / 2, 0};
|
||||
remorse::MapRenderOptions options = fullSceneOptions(state.mapIndex, spawn);
|
||||
remorse::LiveFixedMapItems liveItems(std::move(*stagedItems), std::move(containedItems));
|
||||
liveItems.initializeAvatar();
|
||||
if (startingEgg) {
|
||||
std::lock_guard<std::mutex> kernelLock(state.kernelMutex);
|
||||
if (!remorse::runFreshGameTeleporterStartup(state.diagnosticKernel, liveItems,
|
||||
static_cast<remorse::u16>(state.mapIndex), 0x1e, *shapeTypes,
|
||||
state.diagnosticGroupCounts)) {
|
||||
setLoadFailure(state, L"The teleporter process could not resolve its map and egg destination.");
|
||||
if (state.mapIndex != 1 || !remorse::startFreshGameMapOne(state.diagnosticKernel,
|
||||
liveItems, *shapeTypes, state.diagnosticGroupCounts)) {
|
||||
setLoadFailure(state, L"The source-derived fresh-game start could not resolve map 1's level destination.");
|
||||
PostMessageW(window, sceneReadyMessage, 0, 0);
|
||||
return;
|
||||
}
|
||||
const auto* avatar = liveItems.findItem(1);
|
||||
const auto stagingTeleporter = avatar ? remorse::findNearbyActiveTeleportEgg(
|
||||
*avatar, liveItems.mapItems(), *shapeTypes, static_cast<remorse::u8>(state.mapIndex))
|
||||
: std::nullopt;
|
||||
if (!stagingTeleporter || !remorse::runFreshGameTeleporterStartup(
|
||||
state.diagnosticKernel, liveItems, stagingTeleporter->data.mapNumber,
|
||||
static_cast<remorse::u8>(stagingTeleporter->data.quality & 0xff), *shapeTypes,
|
||||
state.diagnosticGroupCounts)) {
|
||||
setLoadFailure(state, L"The staging teleporter could not resolve its level destination.");
|
||||
PostMessageW(window, sceneReadyMessage, 0, 0);
|
||||
return;
|
||||
}
|
||||
avatar = liveItems.findItem(1);
|
||||
spawn = remorse::WorldPoint{avatar->data.x * 2, avatar->data.y * 2, avatar->data.z};
|
||||
options.viewCenter = spawn;
|
||||
} else {
|
||||
if (!liveItems.initializeAvatar()) {
|
||||
setLoadFailure(state, L"The player item could not be initialized.");
|
||||
PostMessageW(window, sceneReadyMessage, 0, 0);
|
||||
return;
|
||||
}
|
||||
remorse::StagedFixedMapItem directStart;
|
||||
directStart.data.x = static_cast<remorse::u16>(spawn.x / 2);
|
||||
directStart.data.y = static_cast<remorse::u16>(spawn.y / 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue