--- hatari/src/includes/main.h 2019/04/01 07:11:28 1.1.1.8 +++ hatari/src/includes/main.h 2019/04/01 07:14:09 1.1.1.14 @@ -8,26 +8,10 @@ #ifndef HATARI_MAIN_H #define HATARI_MAIN_H -typedef int BOOL; -#define PROG_NAME "Hatari v0.50" /* Name, version for window title */ -#define PROG_VERSION "v0.50" -#define VERSION_STRING "0.50 " /* Always 6 bytes (inc' NULL) */ -#define VERSION_STRING_SIZE 6 /* Size of above (inc' NULL) */ - -//#define TOTALLY_FINAL_VERSION /* Web release version... */ - -#define FINAL_VERSION /* Full-speed non-debug version for release */ -//#define DEBUG_TO_FILE /* Use debug.txt files */ - -#ifndef FINAL_VERSION - #define USE_DEBUGGER /* Debugger version(non-release) */ - #define DEBUG_TO_FILE /* Use debug.txt files */ -#endif - -#ifdef TOTALLY_FINAL_VERSION - #undef DEBUG_TO_FILE /* Don't use debug files for final release */ -#endif +/* Name and version for window title: */ +// #define PROG_NAME "Hatari CVS (" __DATE__ ")" +#define PROG_NAME "Hatari v1.0.1" #include @@ -39,13 +23,19 @@ typedef int BOOL; #include -#define MAX_STRING_LENGTH 512 +typedef signed char BOOL; #ifndef FALSE #define FALSE 0 #define TRUE (!0) #endif +#ifdef WIN32 +#define PATHSEP '\\' +#else +#define PATHSEP '/' +#endif + #define CALL_VAR(func) { ((void(*)(void))func)(); } @@ -75,26 +65,26 @@ enum { }; /* 68000 Condition code's */ -#define SR_AUX 0x0010 -#define SR_NEG 0x0008 -#define SR_ZERO 0x0004 -#define SR_OVERFLOW 0x0002 -#define SR_CARRY 0x0001 - -#define SR_CLEAR_AUX 0xffef -#define SR_CLEAR_NEG 0xfff7 -#define SR_CLEAR_ZERO 0xfffb -#define SR_CLEAR_OVERFLOW 0xfffd -#define SR_CLEAR_CARRY 0xfffe - -#define SR_CCODE_MASK (SR_AUX|SR_NEG|SR_ZERO|SR_OVERFLOW|SR_CARRY) -#define SR_MASK 0xFFE0 - -#define SR_TRACEMODE 0x8000 -#define SR_SUPERMODE 0x2000 -#define SR_IPL 0x0700 +#define SR_AUX 0x0010 +#define SR_NEG 0x0008 +#define SR_ZERO 0x0004 +#define SR_OVERFLOW 0x0002 +#define SR_CARRY 0x0001 + +#define SR_CLEAR_AUX 0xffef +#define SR_CLEAR_NEG 0xfff7 +#define SR_CLEAR_ZERO 0xfffb +#define SR_CLEAR_OVERFLOW 0xfffd +#define SR_CLEAR_CARRY 0xfffe + +#define SR_CCODE_MASK (SR_AUX|SR_NEG|SR_ZERO|SR_OVERFLOW|SR_CARRY) +#define SR_MASK 0xFFE0 + +#define SR_TRACEMODE 0x8000 +#define SR_SUPERMODE 0x2000 +#define SR_IPL 0x0700 -#define SR_CLEAR_IPL 0xf8ff +#define SR_CLEAR_IPL 0xf8ff #define SR_CLEAR_TRACEMODE 0x7fff #define SR_CLEAR_SUPERMODE 0xdfff @@ -116,65 +106,13 @@ enum { #define EXCEPTION_TRAP13 0x000000B4 #define EXCEPTION_TRAP14 0x000000B8 -/* Find IPL - don't forget to call MakeSR() before you use it! */ -#define FIND_IPL ((SR>>8)&0x7) /* Size of 68000 instructions */ #define MAX_68000_INSTRUCTION_SIZE 10 /* Longest 68000 instruction is 10 bytes(6+4) */ #define MIN_68000_INSTRUCTION_SIZE 2 /* Smallest 68000 instruction is 2 bytes(ie NOP) */ -/* - All the following processor timings are based on a bog standard 8MHz 68000 as found in all standard ST's - - Clock cycles per line (50Hz) : 512 - NOPs per scan line (50Hz) : 128 - Scan lines per VBL (50Hz) : 313 (64 at top,200 screen,49 bottom) - - Clock cycles per line (60Hz) : 508 - NOPs per scan line (60Hz) : 127 - Scan lines per VBL (60Hz) : 263 - - Clock cycles per VBL (50Hz) : 160256 - NOPs per VBL (50Hz) : 40064 - - Pixels per clock cycle (low res) : 1 - Pixels per clock cycle (med res) : 2 - Pixels per clock cycle (high res) : 4 - Pixels per NOP (low res) : 4 - Pixels per NOP (med res) : 8 - Pixels per NOP (high res) : 16 -*/ -#define SCREEN_START_HBL 64 /* This is usually the first line of the displayed screen */ -#define SCREEN_HEIGHT_HBL 200 /* This is usually the height of the screen */ -#define FIRST_VISIBLE_HBL (SCREEN_START_HBL-OVERSCAN_TOP) /* Normal screen starts 64 lines in, top border is 28 lines */ -#define NUM_VISIBLE_LINES (OVERSCAN_TOP+SCREEN_HEIGHT_HBL+OVERSCAN_BOTTOM) /* Number of visible screen lines including top/bottom borders */ - -/* Assumes 32 pixels left+right */ -#define SCREENBYTES_LEFT 16 /* Bytes for left border in ST screen */ -#define SCREENBYTES_MIDDLE 160 /* Middle(320 pixels) */ -#define SCREENBYTES_RIGHT 16 /* right border */ -#define SCREENBYTES_LINE (SCREENBYTES_LEFT+SCREENBYTES_MIDDLE+SCREENBYTES_RIGHT) - -/* Overscan values */ -#define OVERSCAN_LEFT (SCREENBYTES_LEFT*2) /* Number of pixels in each border */ -#define OVERSCAN_RIGHT (SCREENBYTES_RIGHT*2) -#define OVERSCAN_TOP 29 -#define OVERSCAN_BOTTOM 38 -#define OVERSCAN_MIDDLE 320 /* Number of pixels across screen(low res) */ - -#define SCREEN_START_CYCLE 96 /* Cycle first normal pixel appears on */ -#define SCANLINES_PER_FRAME 313 /* Number of scan lines per frame */ -#define CYCLES_PER_LINE 512 /* Cycles per horiztonal line scan */ -#define CYCLES_VBL_IN (SCREEN_START_HBL*CYCLES_PER_LINE) /* ((28+64)*CYCLES_PER_LINE) */ -#define CYCLES_PER_FRAME (SCANLINES_PER_FRAME*CYCLES_PER_LINE) /* Cycles per VBL @ 50fps = 160256 */ -#define CYCLES_PER_SEC (CYCLES_PER_FRAME*50) /* Cycles per second */ -#define CYCLES_ENDLINE (64+320+88+40) /* DE(Display Enable) */ -#define CYCLES_HBL (CYCLES_PER_LINE+96) /* Cycles for first HBL - very inaccurate on ST */ -#define CYCLES_DEBUGGER 3000 /* Check debugger every 'x' cycles */ - /* Illegal Opcode used to help emulation. eg. free entries are 8 to 15 inc' */ #define GEMDOS_OPCODE 8 /* Free op-code to intercept GemDOS trap */ -#define RUNOLDGEMDOS_OPCODE 9 /* Free op-code to set PC to old GemDOS vector(if doesn't need to intercept) */ #define SYSINIT_OPCODE 10 /* Free op-code to initialize system (connected drives etc.) */ #define VDI_OPCODE 12 /* Free op-code to call VDI handlers AFTER Trap#2 */ @@ -184,16 +122,13 @@ enum { extern BOOL bQuitProgram; extern BOOL bEnableDebug; -extern BOOL bEmulationActive; -extern char szBootDiscImage[FILENAME_MAX]; -extern char szWorkingDir[FILENAME_MAX]; - extern void Main_MemorySnapShot_Capture(BOOL bSave); -extern void Main_SysError(char *Error,char *Title); -extern int Main_Message(char *lpText, char *lpCaption /*, unsigned int uType*/); extern void Main_PauseEmulation(void); extern void Main_UnPauseEmulation(void); -extern void Main_EventHandler(); +extern void Main_RequestQuit(void); +extern void Main_WaitOnVbl(void); +extern void Main_WarpMouse(int x, int y); +extern void Main_EventHandler(void); #endif /* ifndef HATARI_MAIN_H */