summaryrefslogtreecommitdiff
path: root/source/z80.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/z80.c')
-rw-r--r--source/z80.c106
1 files changed, 52 insertions, 54 deletions
diff --git a/source/z80.c b/source/z80.c
index d4205c5..e6cc2f9 100644
--- a/source/z80.c
+++ b/source/z80.c
@@ -333,64 +333,62 @@ const char *Z80Disassemble(Z80 *cpu, Z80Word *pc)
void Z80SaveSnapshot(Z80 *cpu, FILE *fp)
{
- STRPUT(fp, cpu->PC);
- STRPUT(fp, cpu->AF);
- STRPUT(fp, cpu->BC);
- STRPUT(fp, cpu->DE);
- STRPUT(fp, cpu->HL);
- STRPUT(fp, cpu->AF_);
- STRPUT(fp, cpu->BC_);
- STRPUT(fp, cpu->DE_);
- STRPUT(fp, cpu->HL_);
- STRPUT(fp, cpu->IX);
- STRPUT(fp, cpu->IY);
- STRPUT(fp, cpu->SP);
- STRPUT(fp, cpu->IFF1);
- STRPUT(fp, cpu->IFF2);
- STRPUT(fp, cpu->IM);
- STRPUT(fp, cpu->I);
- STRPUT(fp, cpu->R);
- STRPUT(fp, cpu->R);
-
- STRPUT(fp, cpu->priv->cycle);
- STRPUT(fp, cpu->priv->halt);
- STRPUT(fp, cpu->priv->shift);
- STRPUT(fp, cpu->priv->raise);
- STRPUT(fp, cpu->priv->devbyte);
- STRPUT(fp, cpu->priv->nmi);
- STRPUT(fp, cpu->priv->callback);
- STRPUT(fp, cpu->priv->last_cb);
+ PUT_ULong(fp, cpu->PC);
+ PUT_ULong(fp, cpu->AF.w);
+ PUT_ULong(fp, cpu->BC.w);
+ PUT_ULong(fp, cpu->DE.w);
+ PUT_ULong(fp, cpu->HL.w);
+ PUT_ULong(fp, cpu->AF_);
+ PUT_ULong(fp, cpu->BC_);
+ PUT_ULong(fp, cpu->DE_);
+ PUT_ULong(fp, cpu->HL_);
+ PUT_ULong(fp, cpu->IX.w);
+ PUT_ULong(fp, cpu->IY.w);
+ PUT_ULong(fp, cpu->SP);
+ PUT_Byte(fp, cpu->IFF1);
+ PUT_Byte(fp, cpu->IFF2);
+ PUT_Byte(fp, cpu->IM);
+ PUT_Byte(fp, cpu->I);
+ PUT_Byte(fp, cpu->R);
+ PUT_Byte(fp, cpu->R);
+
+ PUT_ULong(fp, cpu->priv->cycle);
+ PUT_Long(fp, cpu->priv->halt);
+ PUT_Byte(fp, cpu->priv->shift);
+ PUT_Long(fp, cpu->priv->raise);
+ PUT_Byte(fp, cpu->priv->devbyte);
+ PUT_Long(fp, cpu->priv->nmi);
+ PUT_Long(fp, cpu->priv->last_cb);
}
void Z80LoadSnapshot(Z80 *cpu, FILE *fp)
{
- STRGET(fp, cpu->PC);
- STRGET(fp, cpu->AF);
- STRGET(fp, cpu->BC);
- STRGET(fp, cpu->DE);
- STRGET(fp, cpu->HL);
- STRGET(fp, cpu->AF_);
- STRGET(fp, cpu->BC_);
- STRGET(fp, cpu->DE_);
- STRGET(fp, cpu->HL_);
- STRGET(fp, cpu->IX);
- STRGET(fp, cpu->IY);
- STRGET(fp, cpu->SP);
- STRGET(fp, cpu->IFF1);
- STRGET(fp, cpu->IFF2);
- STRGET(fp, cpu->IM);
- STRGET(fp, cpu->I);
- STRGET(fp, cpu->R);
- STRGET(fp, cpu->R);
-
- STRGET(fp, cpu->priv->cycle);
- STRGET(fp, cpu->priv->halt);
- STRGET(fp, cpu->priv->shift);
- STRGET(fp, cpu->priv->raise);
- STRGET(fp, cpu->priv->devbyte);
- STRGET(fp, cpu->priv->nmi);
- STRGET(fp, cpu->priv->callback);
- STRGET(fp, cpu->priv->last_cb);
+ cpu->PC = GET_ULong(fp);
+ cpu->AF.w = GET_ULong(fp);
+ cpu->BC.w = GET_ULong(fp);
+ cpu->DE.w = GET_ULong(fp);
+ cpu->HL.w = GET_ULong(fp);
+ cpu->AF_ = GET_ULong(fp);
+ cpu->BC_ = GET_ULong(fp);
+ cpu->DE_ = GET_ULong(fp);
+ cpu->HL_ = GET_ULong(fp);
+ cpu->IX.w = GET_ULong(fp);
+ cpu->IY.w = GET_ULong(fp);
+ cpu->SP = GET_ULong(fp);
+ cpu->IFF1 = GET_Byte(fp);
+ cpu->IFF2 = GET_Byte(fp);
+ cpu->IM = GET_Byte(fp);
+ cpu->I = GET_Byte(fp);
+ cpu->R = GET_Byte(fp);
+ cpu->R = GET_Byte(fp);
+
+ cpu->priv->cycle = GET_ULong(fp);
+ cpu->priv->halt = GET_Long(fp);
+ cpu->priv->shift = GET_Byte(fp);
+ cpu->priv->raise = GET_Long(fp);
+ cpu->priv->devbyte = GET_Byte(fp);
+ cpu->priv->nmi = GET_Long(fp);
+ cpu->priv->last_cb = GET_Long(fp);
}
/* END OF FILE */