|
|
1.1 root 1: /*
1.1.1.6 root 2: Hatari - main.h
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
1.1 root 6: */
7:
1.1.1.6 root 8: #ifndef HATARI_MAIN_H
9: #define HATARI_MAIN_H
1.1 root 10:
11:
1.1.1.13 root 12: /* Name and version for window title: */
13: // #define PROG_NAME "Hatari CVS (" __DATE__ ")"
1.1.1.14! root 14: #define PROG_NAME "Hatari v1.0.1"
1.1 root 15:
16:
17: #include <stdio.h>
18: #include <stdlib.h>
19: #include <string.h>
20: #include <math.h>
21: #include <time.h>
22:
1.1.1.8 root 23: #include <SDL_types.h>
24:
25:
1.1.1.13 root 26: typedef signed char BOOL;
27:
1.1 root 28: #ifndef FALSE
29: #define FALSE 0
30: #define TRUE (!0)
31: #endif
32:
1.1.1.12 root 33: #ifdef WIN32
34: #define PATHSEP '\\'
35: #else
36: #define PATHSEP '/'
37: #endif
38:
1.1 root 39: #define CALL_VAR(func) { ((void(*)(void))func)(); }
40:
41:
1.1.1.4 root 42: /* 68000 operand sizes */
1.1 root 43: #define SIZE_BYTE 1
44: #define SIZE_WORD 2
45: #define SIZE_LONG 4
46:
47: /* 68000 Register defines */
48: enum {
49: REG_D0, /* D0.. */
50: REG_D1,
51: REG_D2,
52: REG_D3,
53: REG_D4,
54: REG_D5,
55: REG_D6,
56: REG_D7, /* ..D7 */
57: REG_A0, /* A0.. */
58: REG_A1,
59: REG_A2,
60: REG_A3,
61: REG_A4,
62: REG_A5,
63: REG_A6,
1.1.1.8 root 64: REG_A7, /* ..A7 (also SP) */
1.1 root 65: };
66:
67: /* 68000 Condition code's */
1.1.1.10 root 68: #define SR_AUX 0x0010
69: #define SR_NEG 0x0008
70: #define SR_ZERO 0x0004
71: #define SR_OVERFLOW 0x0002
72: #define SR_CARRY 0x0001
73:
74: #define SR_CLEAR_AUX 0xffef
75: #define SR_CLEAR_NEG 0xfff7
76: #define SR_CLEAR_ZERO 0xfffb
77: #define SR_CLEAR_OVERFLOW 0xfffd
78: #define SR_CLEAR_CARRY 0xfffe
79:
80: #define SR_CCODE_MASK (SR_AUX|SR_NEG|SR_ZERO|SR_OVERFLOW|SR_CARRY)
81: #define SR_MASK 0xFFE0
82:
83: #define SR_TRACEMODE 0x8000
84: #define SR_SUPERMODE 0x2000
85: #define SR_IPL 0x0700
1.1 root 86:
1.1.1.10 root 87: #define SR_CLEAR_IPL 0xf8ff
1.1 root 88: #define SR_CLEAR_TRACEMODE 0x7fff
89: #define SR_CLEAR_SUPERMODE 0xdfff
90:
91: /* Exception vectors */
1.1.1.6 root 92: #define EXCEPTION_BUSERROR 0x00000008
1.1 root 93: #define EXCEPTION_ADDRERROR 0x0000000c
1.1.1.6 root 94: #define EXCEPTION_ILLEGALINS 0x00000010
95: #define EXCEPTION_DIVZERO 0x00000014
96: #define EXCEPTION_CHK 0x00000018
97: #define EXCEPTION_TRAPV 0x0000001c
98: #define EXCEPTION_TRACE 0x00000024
99: #define EXCEPTION_LINE_A 0x00000028
100: #define EXCEPTION_LINE_F 0x0000002c
101: #define EXCEPTION_HBLANK 0x00000068
102: #define EXCEPTION_VBLANK 0x00000070
103: #define EXCEPTION_TRAP0 0x00000080
104: #define EXCEPTION_TRAP1 0x00000084
105: #define EXCEPTION_TRAP2 0x00000088
106: #define EXCEPTION_TRAP13 0x000000B4
107: #define EXCEPTION_TRAP14 0x000000B8
1.1 root 108:
109:
110: /* Size of 68000 instructions */
111: #define MAX_68000_INSTRUCTION_SIZE 10 /* Longest 68000 instruction is 10 bytes(6+4) */
112: #define MIN_68000_INSTRUCTION_SIZE 2 /* Smallest 68000 instruction is 2 bytes(ie NOP) */
113:
114: /* Illegal Opcode used to help emulation. eg. free entries are 8 to 15 inc' */
115: #define GEMDOS_OPCODE 8 /* Free op-code to intercept GemDOS trap */
1.1.1.7 root 116: #define SYSINIT_OPCODE 10 /* Free op-code to initialize system (connected drives etc.) */
1.1 root 117: #define VDI_OPCODE 12 /* Free op-code to call VDI handlers AFTER Trap#2 */
1.1.1.6 root 118:
1.1 root 119:
120: #define PRG_HEADER_SIZE 0x1c /* Size of header at start of ST .prg files */
121:
122:
123: extern BOOL bQuitProgram;
1.1.1.2 root 124: extern BOOL bEnableDebug;
1.1 root 125:
126: extern void Main_MemorySnapShot_Capture(BOOL bSave);
127: extern void Main_PauseEmulation(void);
128: extern void Main_UnPauseEmulation(void);
1.1.1.13 root 129: extern void Main_RequestQuit(void);
1.1.1.12 root 130: extern void Main_WaitOnVbl(void);
1.1.1.9 root 131: extern void Main_WarpMouse(int x, int y);
132: extern void Main_EventHandler(void);
1.1 root 133:
1.1.1.6 root 134: #endif /* ifndef HATARI_MAIN_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.