foxygit / fake-08-xbox360 Log in
main xbox360 commits tags

/platform/xex/runtime/extra_imports.S · 1.82 KB

raw
/* Imports that the xenon-forge headers do not declare yet.
 * Record: type (1 = function) << 24 | library (0 xboxkrnl, 1 xam) << 16 | ordinal */
#include "../sdk/thunks/macros.inc"

/* VOID XNotifyQueueUI(DWORD Type, DWORD UserIndex, ULONGLONG Areas,
 *                      PCWSTR Text, PVOID Context) - xam.xex ordinal 656.
 * Areas is one 64-bit register in the console ABI: callers pass it as a
 * 32-bit value in r5 (see xex_notify in runtime/xex.h), Text in r6. */
xbox360_stub XNotifyQueueUI, 0x01010290

/* VOID VdQueryVideoMode(PVOID Mode) - xboxkrnl ordinal 0x1CA. Mode starts
 * with DisplayWidth, DisplayHeight (ULONG); the block is 0x30 bytes. */
xbox360_stub VdQueryVideoMode, 0x010001ca

/*
 * ULONG VdInitializeScalerCommandBuffer(
 *     ULONG SourceXY, ULONG SourceWH, ULONG OutputXY, ULONG OutputWH,
 *     ULONG FrontBufferWH, ULONG VerticalFilterType, PVOID VerticalFilter,
 *     ULONG HorizontalFilterType, PVOID HorizontalFilter, ULONG Unknown9,
 *     PULONG Commands, ULONG CommandDwords)      - xboxkrnl ordinal 0x1C5
 * XY/WH are (x << 16 | y) and (w << 16 | h). Writes scaler packets for the
 * command ring into Commands (Direct3D pre-fills it with 0x80000000 NOPs).
 *
 * 12 arguments: 9-12 are on the stack. SysV callers put them at 8(r1) of
 * their frame, 4 bytes each; console callees read 8-byte slots from 0x50
 * of the caller frame (as in xenon-forge's VdSwap stub).
 */
.ifndef VdInitializeScalerCommandBuffer
	xbox360_function VdInitializeScalerCommandBuffer
	xbox360_frame 0x70
	li 12, 0
	stw 12, 0x50(1)
	lwz 11, 0x78(1)
	stw 11, 0x54(1)
	stw 12, 0x58(1)
	lwz 11, 0x7c(1)
	stw 11, 0x5c(1)
	stw 12, 0x60(1)
	lwz 11, 0x80(1)
	stw 11, 0x64(1)
	stw 12, 0x68(1)
	lwz 11, 0x84(1)
	stw 11, 0x6c(1)
	xbox360_call VdInitializeScalerCommandBuffer
	xbox360_return 0x70
	xbox360_end VdInitializeScalerCommandBuffer, 0x010001c5
.endif