Mercurial > repos > blastem
annotate terminal_win.c @ 922:913a6336ce20
Shift slot number to slot behavior mapping by six slots in H40 mode. This makes the line change slot align with the point at which the display turns on and off at the end of the active display area. Also fixed a regression in which an external slot got accidentally changed into a sprite draw slot
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 28 Jan 2016 09:10:14 -0800 |
parents | 0433fdd9ba66 |
children |
rev | line source |
---|---|
794
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #include <windows.h> |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #include <stdio.h> |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
832
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
4 static char init_done; |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
5 |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
6 void force_no_terminal() |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
7 { |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
8 init_done = 1; |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
9 } |
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
10 |
794
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 void init_terminal() |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 { |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 if (!init_done) { |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 AllocConsole(); |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 freopen("CONIN$", "r", stdin); |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 freopen("CONOUT$", "w", stdout); |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 freopen("CONOUT$", "w", stderr); |
832
0433fdd9ba66
Added a command line option to force BlastEm to not open a new terminal even if it detects that stdin/out are not terminals
Michael Pavone <pavone@retrodev.com>
parents:
809
diff
changeset
|
18 init_done = 1; |
794
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } |
792be135d3af
Spawn a terminal for the debugger when needed if we are not already attached to one
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 } |