cen64/os/winapi/main.c
Derek "Turtle" Roe 8b89df2fdc See long description
Replaced all references to simulation with emulation
Updated copyright year
Updated .gitignore to reduce chances of random files being uploaded to
the repo
Added .gitattributes to normalize all text files, and to ignore binary
files (which includes the logo and the NEC PDF)
2015-07-01 18:44:21 -05:00

50 lines
1.1 KiB
C

//
// os/posix/main.c: Entry point for WinAPI backend.
//
// CEN64: Cycle-Accurate Nintendo 64 Emulator.
// Copyright (C) 2015, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//
#include "cen64.h"
#include <winsock2.h>
#include <windows.h>
// Windows application entry point.
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) {
WSADATA wsa_data = {0};
WPARAM status = 255;
if (WSAStartup(MAKEWORD(2, 2), &wsa_data)) {
MessageBox(NULL, "Failed to initialize Winsock.", "CEN64",
MB_OK | MB_ICONEXCLAMATION);
return status;
}
status = cen64_main(__argc, (const char **) __argv);
WSACleanup();
return status;
}
// "Hides" the console window (after waiting for input).
void hide_console(void) {
printf("\n");
system("PAUSE");
FreeConsole();
}
// "Unhides" the console window.
void show_console(void) {
AllocConsole();
freopen("CONOUT$", "wb", stdout);
freopen("CONOUT$", "wb", stderr);
}