OSDN Git Service

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