Skip to content

Commit

Permalink
z80/z180: allow both to co-exist in one binary
Browse files Browse the repository at this point in the history
  • Loading branch information
EtchedPixels committed Mar 18, 2024
1 parent c76d6ab commit 4da31b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libz180/z180.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ static void doBIT_indexed(Z180Context* ctx, int b, ushort address)
}


byte doSetRes (Z180Context* ctx, int bit, int pos, byte val)
static byte doSetRes (Z180Context* ctx, int bit, int pos, byte val)
{
if (bit)
val |= (1 << pos);
Expand Down
3 changes: 3 additions & 0 deletions libz180/z180.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ typedef union
} br;
} Z180Regs;

#ifndef Z80FLAGS_ENUM
#define Z80FLAGS_ENUM

/** The Z180 flags */
typedef enum
Expand All @@ -72,6 +74,7 @@ typedef enum
F_Z = 64, /**< Zero */
F_S = 128 /**< Sign */
} Z180Flags;
#endif


/** A Z180 execution context. */
Expand Down
2 changes: 1 addition & 1 deletion libz80/z80.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ static void doBIT_indexed(Z80Context* ctx, int b, ushort address)
}


byte doSetRes (Z80Context* ctx, int bit, int pos, byte val)
static byte doSetRes (Z80Context* ctx, int bit, int pos, byte val)
{
if (bit)
val |= (1 << pos);
Expand Down
5 changes: 4 additions & 1 deletion libz80/z80.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ typedef union
} Z80Regs;


#ifndef Z80FLAGS_ENUM
#define Z80FLAGS_ENUM

/** The Z80 flags */
typedef enum
{
Expand All @@ -72,7 +75,7 @@ typedef enum
F_Z = 64, /**< Zero */
F_S = 128 /**< Sign */
} Z80Flags;

#endif

/** A Z80 execution context. */
typedef struct
Expand Down

0 comments on commit 4da31b7

Please sign in to comment.