OSDN Git Service

VisualStudioでの警告抑制とコメント付加
[heavyosecpu/HeavyOSECPU.git] / osecpu.h
1 #ifndef _HDLOAD_OSECPU
2 #define _HDLOAD_OSECPU 1
3
4 // プロジェクトのすべてのファイルで読み込むヘッダ
5
6
7 /* Visual Studio で fopen()やsprintf() などの古い関数を使用する時に出る警告を抑止する*/
8 #define _CRT_SECURE_NO_WARNINGS 1
9
10 #include <stdio.h>
11 #include <string.h>
12 #include <limits.h>
13 #include <time.h>
14 #include <setjmp.h>
15 #include <stdlib.h>
16
17 struct PtrCtrl {
18         int liveSign;
19         int size, typ;
20         unsigned char *p0;
21 };
22
23 struct Ptr {    /* 32バイト(=256bit!) */
24         unsigned char *p;
25         int typ;
26         unsigned char *p0, *p1;
27         int liveSign;
28         struct PtrCtrl *pls;
29         int flags, dummy;       /* read/writeなど */
30 };
31
32 struct LabelTable {
33         unsigned char *p, *p1;
34         int opt, typ;
35 };
36
37 struct Regs {
38         int ireg[64]; /* 32bit整数レジスタ */
39         struct Ptr preg[64];    /* ポインタレジスタ */
40
41         int debugInfo0, debugInfo1, dmy[2]; /* 2304 */
42         struct PtrCtrl *ptrCtrl; /* 2320 */
43         char winClosed, autoSleep;
44         jmp_buf *setjmpEnv;
45
46         /* for-junkApi */
47         int argc;
48         const unsigned char **argv;
49         unsigned char *buf0, *buf1, *junkStack, lastConsoleChar, *junkStack1;
50
51         struct LabelTable *label;
52         int maxLabels;
53         unsigned char *jitbuf, *jitbuf1;
54         void(*errHndl)(struct Regs *);
55         char dbgr;
56         int mapDi1s[16][16];
57 };
58
59 #define KEY_ENTER               '¥n'
60 #define KEY_ESC                 27
61 #define KEY_BACKSPACE   8
62 #define KEY_TAB                 9
63 #define KEY_PAGEUP              0x1020
64 #define KEY_PAGEDWN             0x1021
65 #define KEY_END                 0x1022
66 #define KEY_HOME                0x1023
67 #define KEY_LEFT                0x1024
68 #define KEY_UP                  0x1025
69 #define KEY_RIGHT               0x1026
70 #define KEY_DOWN                0x1027
71 #define KEY_INS                 0x1028
72 #define KEY_DEL                 0x1029
73
74 static int *keybuf, keybuf_r, keybuf_w, keybuf_c;
75 static int *vram = NULL, v_xsiz, v_ysiz;
76
77 //デバッグ用。プログラム中の随所で加算される変数
78 static int di1_serial = 0;
79
80 // main.c
81 void putKeybuf(int i);
82
83 #include "switch.h"
84 #include "function.h"
85 #include "dependent.h"
86 #include "jitc.h"
87 #include "screen.h"
88 #include "comlib.h"
89
90 #if (USE_TEK5 != 0)
91
92 /* tek.cを移植するのは大変だと思ったので、断念 */
93 #error "tek is not supported. edit switch.h and set USE_TEK5=0"
94
95 //      #include "tek.c"
96 //      int tek5Decomp(unsigned char *buf, unsigned char *buf1, unsigned char *tmp);
97 #endif
98
99
100 #endif
101