view terminal_win.c @ 1107:fc125af5e4f1

Fix to the fix of handling of self modifying code. Was ORing the base address with the wrong register before calling the modified code handler
author Michael Pavone <pavone@retrodev.com>
date Mon, 12 Dec 2016 19:21:22 -0800
parents 0433fdd9ba66
children
line wrap: on
line source

#include <windows.h>
#include <stdio.h>

static char init_done;

void force_no_terminal()
{
	init_done = 1;
}

void init_terminal()
{
	if (!init_done) {
		AllocConsole();
		freopen("CONIN$", "r", stdin);
		freopen("CONOUT$", "w", stdout);
		freopen("CONOUT$", "w", stderr);
		init_done = 1;
	}
}