major restructuring, prepare for smp
This commit is contained in:
1 parent
b3569a2b90
commit
6bff37746d
229 files changed
+1617
-1489
No files matched your search
@@ -0,0 +1,125 @@
|
||||
// winmm.c - Win32 multimedia: waveform audio, timer
|
||||
// Stubs only; no audio hardware access at this stage.
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <ntlite/syscall.h>
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Types
|
||||
// ---------------------------------------------------------------------------
|
||||
typedef unsigned int MMRESULT;
|
||||
typedef void* HWAVEOUT;
|
||||
|
||||
#define MMSYSERR_NOERROR 0
|
||||
#define MMSYSERR_NOTSUPPORTED 8
|
||||
#define WAVERR_STILLPLAYING 33
|
||||
|
||||
// WAVEFORMATEX - standard PCM audio format descriptor.
|
||||
typedef struct {
|
||||
unsigned short wFormatTag;
|
||||
unsigned short nChannels;
|
||||
unsigned int nSamplesPerSec;
|
||||
unsigned int nAvgBytesPerSec;
|
||||
unsigned short nBlockAlign;
|
||||
unsigned short wBitsPerSample;
|
||||
unsigned short cbSize;
|
||||
} WAVEFORMATEX;
|
||||
|
||||
// WAVEHDR - buffer header submitted to waveOutWrite.
|
||||
typedef struct _WAVEHDR {
|
||||
char* lpData;
|
||||
unsigned int dwBufferLength;
|
||||
unsigned int dwBytesRecorded;
|
||||
uintptr_t dwUser;
|
||||
unsigned int dwFlags;
|
||||
unsigned int dwLoops;
|
||||
struct _WAVEHDR* lpNext;
|
||||
uintptr_t reserved;
|
||||
} WAVEHDR;
|
||||
|
||||
// MMTIME - used by waveOutGetPosition.
|
||||
typedef struct {
|
||||
unsigned int wType;
|
||||
union {
|
||||
unsigned int ms;
|
||||
unsigned int sample;
|
||||
unsigned int cb;
|
||||
unsigned int ticks;
|
||||
} u;
|
||||
} MMTIME;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Timer
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
__declspec(dllexport) unsigned long timeGetTime(void) {
|
||||
return (unsigned long)(SysGetTick() / 1000u);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Waveform audio (stubs - no audio hardware at this stage)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutOpen(HWAVEOUT* phwo, unsigned int deviceId,
|
||||
const WAVEFORMATEX* fmt, uintptr_t callback,
|
||||
uintptr_t callbackInstance, unsigned long flags) {
|
||||
(void)deviceId; (void)fmt; (void)callback; (void)callbackInstance; (void)flags;
|
||||
if (phwo) *phwo = (void*)0;
|
||||
return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutClose(HWAVEOUT hwo) {
|
||||
(void)hwo; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutPrepareHeader(HWAVEOUT hwo, WAVEHDR* hdr,
|
||||
unsigned int size) {
|
||||
(void)hwo; (void)hdr; (void)size; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutUnprepareHeader(HWAVEOUT hwo, WAVEHDR* hdr,
|
||||
unsigned int size) {
|
||||
(void)hwo; (void)hdr; (void)size; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutWrite(HWAVEOUT hwo, WAVEHDR* hdr, unsigned int size) {
|
||||
(void)hwo; (void)hdr; (void)size; return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutPause(HWAVEOUT hwo) {
|
||||
(void)hwo; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutRestart(HWAVEOUT hwo) {
|
||||
(void)hwo; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutReset(HWAVEOUT hwo) {
|
||||
(void)hwo; return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutSetVolume(HWAVEOUT hwo, unsigned long volume) {
|
||||
(void)hwo; (void)volume; return MMSYSERR_NOTSUPPORTED;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT waveOutGetPosition(HWAVEOUT hwo, MMTIME* mmt,
|
||||
unsigned int size) {
|
||||
(void)hwo; (void)size;
|
||||
if (mmt) { mmt->wType = 0; mmt->u.ms = 0; }
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Timer resolution control
|
||||
// No hardware timer reprogramming at this stage; pretend success so callers
|
||||
// that wrap their audio/game loop in timeBeginPeriod(1) don't bail out.
|
||||
// ---------------------------------------------------------------------------
|
||||
__declspec(dllexport) MMRESULT timeBeginPeriod(unsigned int uPeriod) {
|
||||
(void)uPeriod;
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
|
||||
__declspec(dllexport) MMRESULT timeEndPeriod(unsigned int uPeriod) {
|
||||
(void)uPeriod;
|
||||
return MMSYSERR_NOERROR;
|
||||
}
|
||||
Reference in new issue
Block a user