fix ps/2 mouse init, make Stall more precise, rename CurrentProcess to KeGetCurrentProcess, correct type about maneuvers, add file writing to win32
This commit is contained in:
1 parent
8c7564d5e1
commit
a37f5b1581
14 files changed
+288
-75
No files matched your search
+16
-12
@@ -102,17 +102,17 @@ int main() {
|
||||
|
||||
CloseHandle(h);
|
||||
|
||||
HBINK bink = BinkOpen(buf, BINKFROMMEMORY);
|
||||
if (!bink) {
|
||||
HBINK b = BinkOpen(buf, BINKFROMMEMORY);
|
||||
if (!b) {
|
||||
WriteConsoleA(h, "video: BinkOpen failed: ", 24, 0, 0);
|
||||
const char* err = BinkGetError();
|
||||
WriteConsoleA(h, err, strlen(err), 0, 0);
|
||||
WriteConsoleA(h, err, (unsigned int)strlen(err), 0, 0);
|
||||
WriteConsoleA(h, "\n", 1, 0, 0);
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
uint32_t width = bink->Width;
|
||||
uint32_t height = bink->Height;
|
||||
uint32_t width = b->Width;
|
||||
uint32_t height = b->Height;
|
||||
|
||||
uint32_t* fb = HeapAlloc(0, 0, width * height * sizeof(uint32_t));
|
||||
if (!fb) {
|
||||
@@ -131,19 +131,20 @@ int main() {
|
||||
bmi.bmiHeader.biCompression = BI_RGB;
|
||||
|
||||
while (1) {
|
||||
if (BinkWait(bink)) {
|
||||
if (BinkWait(b)) {
|
||||
_mm_pause();
|
||||
continue;
|
||||
}
|
||||
|
||||
BinkDoFrame(bink);
|
||||
BinkDoFrame(b);
|
||||
|
||||
if (BinkShouldSkip(bink)) {
|
||||
BinkNextFrame(bink);
|
||||
if (BinkShouldSkip(b)) {
|
||||
BinkNextFrame(b);
|
||||
BinkDoFrame(b);
|
||||
continue;
|
||||
}
|
||||
|
||||
BinkCopyToBuffer(bink, fb, width * 4, height, 0, 0,
|
||||
BinkCopyToBuffer(b, fb, width * 4, height, 0, 0,
|
||||
BINKSURFACE32);
|
||||
|
||||
// Welcome to the GDI pipeline!
|
||||
@@ -163,10 +164,13 @@ int main() {
|
||||
|
||||
EndPaint((HWND)0, &ps);
|
||||
|
||||
BinkNextFrame(bink);
|
||||
if (b->FrameNum == b->Frames)
|
||||
break;
|
||||
|
||||
BinkNextFrame(b);
|
||||
}
|
||||
|
||||
WriteConsoleA(h, "shell: goodbye\n", 15, 0, 0);
|
||||
|
||||
return 0;
|
||||
ExitProcess(0);
|
||||
}
|
||||
Reference in new issue
Block a user