diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-06-17 15:32:38 +0200 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2019-06-17 15:32:38 +0200 |
commit | 617eb6951a04d7a76d132aa0f144e7b3c4702925 (patch) | |
tree | fb6444638c35ae1e6a178fabf5d49b0801f666e7 /src/CdStream.h | |
parent | Merge pull request #8 from GTAmodding/master (diff) | |
download | re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar.gz re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar.bz2 re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar.lz re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar.xz re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.tar.zst re3-617eb6951a04d7a76d132aa0f144e7b3c4702925.zip |
Diffstat (limited to '')
-rw-r--r-- | src/CdStream.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/CdStream.h b/src/CdStream.h new file mode 100644 index 00000000..80c7874f --- /dev/null +++ b/src/CdStream.h @@ -0,0 +1,47 @@ +#pragma once + +#define MAX_CDIMAGES 8 +#define CDSTREAM_SECTOR_SIZE 2048 + +#define _GET_INDEX(a) (a >> 24) +#define _GET_OFFSET(a) (a & 0xFFFFFF) + +enum +{ + STREAM_NONE = uint8( 0), + STREAM_SUCCESS = uint8( 1), + STREAM_READING = uint8(-1), // 0xFF, + STREAM_ERROR = uint8(-2), // 0xFE, + STREAM_ERROR_NOCD = uint8(-3), // 0xFD, + STREAM_ERROR_WRONGCD = uint8(-4), // 0xFC, + STREAM_ERROR_OPENCD = uint8(-5), // 0xFB, + STREAM_WAITING = uint8(-6) // 0xFA, +}; + +struct Queue +{ + int32 *items; + int32 head; + int32 tail; + int32 size; +}; + +VALIDATE_SIZE(Queue, 0x10); + + +void CdStreamInitThread(void); +void CdStreamInit(int32 numChannels); +uint32 GetGTA3ImgSize(void); +void CdStreamShutdown(void); +int32 CdStreamRead(int32 channel, void *buffer, uint32 offset, uint32 size); +int32 CdStreamGetStatus(int32 channel); +int32 CdStreamGetLastPosn(void); +int32 CdStreamSync(int32 channel); +void AddToQueue(Queue *queue, int32 item); +int32 GetFirstInQueue(Queue *queue); +void RemoveFirstInQueue(Queue *queue); +DWORD WINAPI CdStreamThread(LPVOID lpThreadParameter); +bool CdStreamAddImage(char const *path); +char *CdStreamGetImageName(int32 cd); +void CdStreamRemoveImages(void); +int32 CdStreamGetNumImages(void);
\ No newline at end of file |