diff options
author | Ian C <ianc@noddybox.co.uk> | 2006-09-03 22:27:04 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2006-09-03 22:27:04 +0000 |
commit | 5ae0f154bd925c050e37b572ea30b51b09e8b569 (patch) | |
tree | 2af3ddbf5d93463a33161701f516dc0431c18390 /z80_decode.c | |
parent | 81295d66b59af1ca7cbd91f63c897d6f60b015b6 (diff) |
Extra sanity checks on start-up.
Diffstat (limited to 'z80_decode.c')
-rw-r--r-- | z80_decode.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/z80_decode.c b/z80_decode.c index 4b6929c..81760ae 100644 --- a/z80_decode.c +++ b/z80_decode.c @@ -27,6 +27,7 @@ */ #include <stdlib.h> +#include <limits.h> #include "z80.h" #include "z80_private.h" @@ -71,6 +72,8 @@ void Z80_InitialiseInternals(void) Z80Word f; Z80Reg r; + /* Check endianness + */ r.w=0x1234; if (r.b[0] == 0x12) @@ -88,6 +91,13 @@ void Z80_InitialiseInternals(void) exit(1); } + /* Check variable sizes + */ + if (CHAR_BIT!=8 || sizeof(Z80Word)!=2) + { + exit(2); + } + /* Initialise flag tables */ for(f=0;f<256;f++) |