summaryrefslogtreecommitdiff
path: root/include/z80.h
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2021-08-03 21:43:06 +0000
committerIan C <ianc@noddybox.co.uk>2021-08-03 21:43:06 +0000
commit0d08766ccc80cacfe0690cb8a1ea8f13038e404b (patch)
tree15eb862285cf96fef26b8fffb31dc60cd233a51c /include/z80.h
parentb7e8b634595445325d10f8fcddcb7d6cdaa8a922 (diff)
Sped up Z80 emulation
Diffstat (limited to 'include/z80.h')
-rw-r--r--include/z80.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/include/z80.h b/include/z80.h
index ab095d8..c9bd107 100644
--- a/include/z80.h
+++ b/include/z80.h
@@ -56,20 +56,30 @@ typedef signed char Z80Relative;
typedef unsigned short Z80Word;
-/* A Z80 16-bit register. To access the HI/LO component use the indexes
- Z80_HI_WORD and Z80_LO_WORD which will be initialised once Z80Init has been
- called.
+/* A Z80 16-bit register made up of 2 8-bit registers.
*/
+#ifdef Z80_LITTLE_ENDIAN
+typedef struct
+{
+ Z80Byte lo;
+ Z80Byte hi;
+} Z80RegPair;
+#endif
+
+#ifdef Z80_BIG_ENDIAN
+typedef struct
+{
+ Z80Byte hi;
+ Z80Byte lo;
+} Z80RegPair;
+#endif
+
typedef union
{
Z80Word w;
- Z80Byte b[2];
+ Z80RegPair b;
} Z80Reg;
-extern int Z80_HI_WORD;
-extern int Z80_LO_WORD;
-
-
/* The processor
*/
struct Z80Private;