ScreenshotWUPS/src/thread.h

42 lines
1.0 KiB
C
Raw Permalink Normal View History

2023-01-22 14:45:20 +01:00
#pragma once
#include "common.h"
2023-01-22 16:38:23 +01:00
#include "notifications/notifications.h"
2023-01-22 14:45:20 +01:00
#include <coreinit/messagequeue.h>
#include <coreinit/semaphore.h>
#include <coreinit/thread.h>
#include <gx2/enum.h>
#include <memory.h>
struct FSIOThreadData {
OSThread *thread;
void *stack;
OSMessageQueue queue;
OSMessage messages[2];
bool setup;
char threadName[0x50];
};
struct SaveScreenshotMessage {
2023-01-22 16:38:23 +01:00
NotificationModuleHandle notificationHandle;
2023-01-22 14:45:20 +01:00
uint8_t *sourceBuffer;
uint32_t width;
uint32_t height;
uint32_t pitch;
GX2SurfaceFormat format;
ImageOutputFormatEnum outputFormat;
bool convertRGBtoSRGB;
int quality;
GX2ScanTarget scanTarget;
OSCalendarTime time;
2023-01-22 14:45:20 +01:00
};
extern FSIOThreadData gThreadData;
extern bool gThreadsRunning;
#define FS_IO_QUEUE_COMMAND_STOP 0x13371337
#define FS_IO_QUEUE_COMMAND_PROCESS_FS_COMMAND 0x42424242
#define FS_IO_QUEUE_SYNC_RESULT 0x43434343
bool sendMessageToThread(SaveScreenshotMessage *param);
void startFSIOThreads();
void stopFSIOThreads();