Properly implement camera ports, add more cam commands

This commit is contained in:
wheremyfoodat 2024-01-23 16:29:05 +02:00
parent f78acb8049
commit 84b8bc8c48
2 changed files with 153 additions and 16 deletions

View file

@ -12,14 +12,25 @@
class Kernel;
class CAMService {
using Event = std::optional<Handle>;
struct Port {
Event bufferErrorInterruptevent = std::nullopt;
u16 transferBytes;
void reset() {
bufferErrorInterruptevent = std::nullopt;
transferBytes = 256;
}
};
Handle handle = KernelHandles::CAM;
Memory& mem;
Kernel& kernel;
MAKE_LOG_FUNCTION(log, camLogger)
using Event = std::optional<Handle>;
static constexpr size_t portCount = 4; // PORT_NONE, PORT_CAM1, PORT_CAM2, PORT_BOTH
std::array<Event, portCount> bufferErrorInterruptEvents;
static constexpr size_t portCount = 2;
std::array<Port, portCount> ports;
// Service commands
void driverInitialize(u32 messagePointer);
@ -33,7 +44,7 @@ class CAMService {
void setSize(u32 messagePointer);
void setTransferLines(u32 messagePointer);
void setTrimming(u32 messagePointer);
void setTrimminsParamsCenter(u32 messagePointer);
void setTrimmingParamsCenter(u32 messagePointer);
public:
CAMService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}