libz80 with compilation problems (uses up to much ram)
Diff: z80.c
- Revision:
- 1:78a39c3a30f6
- Parent:
- 0:b612024f5aee
--- a/z80.c Thu Mar 10 20:32:59 2011 +0000 +++ b/z80.c Sat Mar 12 22:39:10 2011 +0000 @@ -5,7 +5,7 @@ * (C) Gabriel Gambetta (ggambett@adinet.com.uy) 2000 - 2002 * * Version 1.99 - * + * modified for mbed 2011 Gert van der Knokke * --------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify @@ -171,19 +171,22 @@ */ /** Sets a flag */ -static void setFlag(Z80Context* ctx, Z80Flags flag) +//static void setFlag(Z80Context* ctx, Z80Flags flag) +static void setFlag(Z80Context* ctx, int flag) { BR.F |= flag; } /** Resets a flag */ -static void resFlag(Z80Context* ctx, Z80Flags flag) +// static void resFlag(Z80Context* ctx, Z80Flags flag) +static void resFlag(Z80Context* ctx, int flag) { BR.F &= ~flag; } /** Puts a value in a flag */ -static void valFlag(Z80Context* ctx, Z80Flags flag, int val) +//static void valFlag(Z80Context* ctx, Z80Flags flag, int val) +static void valFlag(Z80Context* ctx, int flag, int val) { if (val) SETFLAG(flag); @@ -192,7 +195,8 @@ } /** Returns a flag */ -static int getFlag(Z80Context* ctx, Z80Flags flag) +// static int getFlag(Z80Context* ctx, Z80Flags flag) +static int getFlag(Z80Context* ctx, int flag) { return (BR.F & flag) != 0; } @@ -374,7 +378,7 @@ static void doBIT (Z80Context* ctx, int b, byte val) { if (val & (1 << b)) - RESFLAG(F_Z | F_PV); + RESFLAG(F_Z | F_PV); else SETFLAG(F_Z | F_PV); @@ -628,7 +632,7 @@ adjustFlags(ctx, BR.A); } -#include "opcodes_impl.c" +#include "opcodes_impl.h" /* ---------------------------------------------------------