ReXGlue SDK
Loading...
Searching...
No Matches
xboxkrnl.h
Go to the documentation of this file.
1
17
18#pragma once
19
20#include <cstring>
21
22#include <rex/platform.h>
23#include <rex/types.h>
26#include <rex/ppc/context.h>
29#include <rex/memory.h>
30#include <rex/title.h>
31
32namespace rex::kernel::xboxkrnl {
33
34struct X_RTL_CRITICAL_SECTION;
35
36REX_KERNEL_API void RtlInitializeCriticalSection(X_RTL_CRITICAL_SECTION* cs);
44 u32 spin_count);
45} // namespace rex::kernel::xboxkrnl
46
47namespace rex::kernel::xboxkrnl {
48
55REX_KERNEL_API u32 NtSetEvent(u32 handle, be_u32* previous_state_ptr);
62
71REX_KERNEL_API u32 NtWaitForMultipleObjectsEx(u32 count, be_u32* handles, u32 wait_type,
72 u32 wait_mode, u32 alertable, u64* timeout_ptr);
73
81REX_KERNEL_API u32 KeWaitForSingleObject(u32 object_address, u32 wait_reason, u32 processor_mode,
82 u32 alertable, u64* timeout_ptr);
90REX_KERNEL_API u32 KeSetEvent(u32 event_address, u32 increment, u32 wait);
91
100 rex::kernel::X_KSPINLOCK* lock, bool change_irql = true);
109 rex::kernel::X_KSPINLOCK* lock, u32 old_irql,
110 bool change_irql = true);
111
120REX_KERNEL_API void KeInitializeApc(rex::kernel::XAPC* apc, u32 thread_ptr, u32 kernel_routine,
121 u32 rundown_routine, u32 normal_routine, u32 apc_mode,
122 u32 normal_context);
135 u32 arg1, u32 arg2, u32 priority_increment, PPCContext* ctx);
136
137} // namespace rex::kernel::xboxkrnl
138
139namespace rex::kernel {
140
141#pragma pack(push, 4)
142
144 be_u32 display_width;
145 be_u32 display_height;
148 be_u32 is_hi_def;
151 be_u32 reserved_0;
153 be_u32 reserved[3];
154};
155REX_STATIC_ASSERT_SIZE(X_VIDEO_MODE, 48);
156
162inline void FillXVideoMode(const VideoMode& mode, X_VIDEO_MODE& out) {
163 std::memset(&out, 0, sizeof(X_VIDEO_MODE));
164 out.display_width = mode.width;
165 out.display_height = mode.height;
166 out.is_interlaced = 0;
167 out.is_widescreen = mode.width * 3 >= mode.height * 4;
168 out.is_hi_def = mode.width >= 1280 || mode.height >= 720;
169 out.refresh_rate = mode.refresh_rate;
170 out.video_standard = 1;
171 out.reserved_0 = 0x4A;
172 out.unknown_0x01 = 0x01;
173}
174
175#pragma pack(pop)
176
177} // namespace rex::kernel
178
179namespace rex::kernel::xboxkrnl {
180
187
188} // namespace rex::kernel::xboxkrnl
Definition heap.h:594
Guest list and spin lock structures.
Definition export.h:24
u32 X_STATUS
Definition status.h:23
void FillXVideoMode(const VideoMode &mode, X_VIDEO_MODE &out)
Definition xboxkrnl.h:162
Definition endian.h:27
Platform flags, packing macros and export markers.
#define REX_KERNEL_API
Definition platform.h:297
Definition context.h:387
Definition title.h:26
Definition thread.h:189
Definition list.h:42
Definition xboxkrnl.h:143
be_u32 unknown_0x01
Definition xboxkrnl.h:152
be_u32 video_standard
Definition xboxkrnl.h:150
be_u32 is_interlaced
Definition xboxkrnl.h:146
be_u32 is_hi_def
Definition xboxkrnl.h:148
be_u32 is_widescreen
Definition xboxkrnl.h:147
be_u32 reserved_0
Definition xboxkrnl.h:151
be_f32 refresh_rate
Definition xboxkrnl.h:149
Integer types, byte order wrappers and size literals.
void KeInitializeApc(rex::kernel::XAPC *apc, u32 thread_ptr, u32 kernel_routine, u32 rundown_routine, u32 normal_routine, u32 apc_mode, u32 normal_context)
u32 KeSetEvent(u32 event_address, u32 increment, u32 wait)
u32 KeKfAcquireSpinLock(rex::kernel::GuestAddressSpace &memory, PPCContext *ctx, rex::kernel::X_KSPINLOCK *lock, bool change_irql=true)
void KeKfReleaseSpinLock(rex::kernel::GuestAddressSpace &memory, PPCContext *ctx, rex::kernel::X_KSPINLOCK *lock, u32 old_irql, bool change_irql=true)
X_STATUS RtlInitializeCriticalSectionAndSpinCount(X_RTL_CRITICAL_SECTION *cs, u32 spin_count)
u32 NtWaitForMultipleObjectsEx(u32 count, be_u32 *handles, u32 wait_type, u32 wait_mode, u32 alertable, u64 *timeout_ptr)
void VdQueryVideoMode(kernel::X_VIDEO_MODE *video_mode)
u32 NtSetEvent(u32 handle, be_u32 *previous_state_ptr)
u32 KeInsertQueueApc(rex::kernel::GuestAddressSpace &memory, rex::kernel::XAPC *apc, u32 arg1, u32 arg2, u32 priority_increment, PPCContext *ctx)
u32 KeWaitForSingleObject(u32 object_address, u32 wait_reason, u32 processor_mode, u32 alertable, u64 *timeout_ptr)
u32 NtClearEvent(u32 handle)