mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 01:55:19 -04:00
Xbox: Add support for disabling stuff that doesn't work in cxbx-reloaded
This commit is contained in:
parent
8a3f02dc0c
commit
e0970e1c9f
@ -164,7 +164,7 @@ cc_result Directory_Enum(const cc_string* dirPath, void* obj, Directory_EnumCall
|
||||
} while (FindNextFileA(find, &eA));
|
||||
|
||||
res = GetLastError(); /* return code from FindNextFile */
|
||||
FindClose(find);
|
||||
NtClose(find);
|
||||
return res == ERROR_NO_MORE_FILES ? 0 : res;
|
||||
}
|
||||
|
||||
@ -245,9 +245,7 @@ void Thread_Run(void** handle, Thread_StartFunc func, int stackSize, const char*
|
||||
|
||||
void Thread_Detach(void* handle) {
|
||||
NTSTATUS status = NtClose((HANDLE)handle);
|
||||
if (!NT_SUCCESS(status)) {
|
||||
Logger_Abort2(status, "Freeing thread handle");
|
||||
}
|
||||
if (!NT_SUCCESS(status)) Logger_Abort2(status, "Freeing thread handle");
|
||||
}
|
||||
|
||||
void Thread_Join(void* handle) {
|
||||
@ -265,24 +263,32 @@ void Mutex_Free(void* handle) {
|
||||
RtlDeleteCriticalSection((CRITICAL_SECTION*)handle);
|
||||
Mem_Free(handle);
|
||||
}
|
||||
void Mutex_Lock(void* handle) { RtlEnterCriticalSection((CRITICAL_SECTION*)handle); }
|
||||
void Mutex_Unlock(void* handle) { RtlLeaveCriticalSection((CRITICAL_SECTION*)handle); }
|
||||
|
||||
void Mutex_Lock(void* handle) {
|
||||
RtlEnterCriticalSection((CRITICAL_SECTION*)handle);
|
||||
}
|
||||
|
||||
void Mutex_Unlock(void* handle) {
|
||||
RtlLeaveCriticalSection((CRITICAL_SECTION*)handle);
|
||||
}
|
||||
|
||||
void* Waitable_Create(void) {
|
||||
void* handle = CreateEventA(NULL, false, false, NULL);
|
||||
if (!handle) {
|
||||
Logger_Abort2(GetLastError(), "Creating waitable");
|
||||
}
|
||||
HANDLE handle;
|
||||
NTSTATUS status = NtCreateEvent(&handle, NULL, SynchronizationEvent, false);
|
||||
|
||||
if (!NT_SUCCESS(status)) Logger_Abort2(status, "Creating waitable");
|
||||
return handle;
|
||||
}
|
||||
|
||||
void Waitable_Free(void* handle) {
|
||||
if (!CloseHandle((HANDLE)handle)) {
|
||||
Logger_Abort2(GetLastError(), "Freeing waitable");
|
||||
}
|
||||
NTSTATUS status = NtClose((HANDLE)handle);
|
||||
if (!NT_SUCCESS(status)) Logger_Abort2(status, "Freeing waitable");
|
||||
}
|
||||
|
||||
void Waitable_Signal(void* handle) {
|
||||
NtSetEvent((HANDLE)handle, NULL);
|
||||
}
|
||||
|
||||
void Waitable_Signal(void* handle) { NtSetEvent((HANDLE)handle, NULL); }
|
||||
void Waitable_Wait(void* handle) {
|
||||
WaitForSingleObject((HANDLE)handle, INFINITE);
|
||||
}
|
||||
@ -410,7 +416,9 @@ static void InitHDD(void) {
|
||||
void Platform_Init(void) {
|
||||
InitHDD();
|
||||
Stopwatch_Init();
|
||||
#ifndef CC_BUILD_CXBX
|
||||
nxNetInit(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void Platform_Free(void) {
|
||||
|
@ -40,6 +40,7 @@ static void OnDataReceived(UTR_T* utr) {
|
||||
}
|
||||
|
||||
static void OnDeviceChanged(xid_dev_t *xid_dev__, int status__) {
|
||||
Platform_LogConst("Getting devices");
|
||||
xid_dev_t* xid_dev = usbh_xid_get_device_list();
|
||||
Platform_LogConst("Devices check");
|
||||
|
||||
@ -75,11 +76,13 @@ void Window_Init(void) {
|
||||
DisplayInfo.ContentOffsetX = 10;
|
||||
DisplayInfo.ContentOffsetY = 10;
|
||||
|
||||
#ifndef CC_BUILD_CXBX
|
||||
usbh_core_init();
|
||||
usbh_xid_init();
|
||||
|
||||
usbh_install_xid_conn_callback(OnDeviceChanged, OnDeviceChanged);
|
||||
OnDeviceChanged(NULL, 0); // TODO useless call?
|
||||
#endif
|
||||
}
|
||||
|
||||
void Window_Free(void) { usbh_core_deinit(); }
|
||||
@ -108,7 +111,9 @@ void Window_RequestClose(void) {
|
||||
*----------------------------------------------------Input processing-----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
void Window_ProcessEvents(float delta) {
|
||||
#ifndef CC_BUILD_CXBX
|
||||
usbh_pooling_hubs();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Cursor_SetPosition(int x, int y) { } // Makes no sense for Xbox
|
||||
|
Loading…
x
Reference in New Issue
Block a user