From b219c3580da55f3396a2d8df8301a777b783d833 Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 24 Jan 2004 02:17:57 +0000 Subject: Changed tape loading to use functions for peek/poke --- src/spec.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/spec.c') diff --git a/src/spec.c b/src/spec.c index 7f0bd7f..1fba973 100644 --- a/src/spec.c +++ b/src/spec.c @@ -244,6 +244,19 @@ static void DumpZ80(Z80 *z80) /* ---------------------------------------- PRIVATE FUNCTIONS */ +static Z80Byte Peek(Z80Word addr) +{ + return mem[addr]; +} + + +static void Poke(Z80Word addr, Z80Byte val) +{ + if (addr>=ROMLEN) + mem[addr]=val; +} + + void DrawScanlineAt(int y, int sline) { int aline; @@ -339,13 +352,13 @@ static int EDCallback(Z80 *z80, Z80Val data) } else { - if (TAPSave(tape_out,HIBYTE(state.AF),&state.IX,&state.DE,mem)) + if (TAPSave(tape_out,HIBYTE(state.AF),&state.IX,&state.DE,Peek)) { - state.AF&=~eZ80_Carry; + state.AF|=eZ80_Carry; } else { - state.AF|=eZ80_Carry; + state.AF&=~eZ80_Carry; } } break; @@ -357,13 +370,13 @@ static int EDCallback(Z80 *z80, Z80Val data) } else { - if (TAPLoad(tape_in,HIBYTE(state.AF),&state.IX,&state.DE,mem)) + if (TAPLoad(tape_in,HIBYTE(state.AF),&state.IX,&state.DE,Poke)) { - state.AF&=~eZ80_Carry; + state.AF|=eZ80_Carry; } else { - state.AF|=eZ80_Carry; + state.AF&=~eZ80_Carry; } } break; @@ -595,6 +608,8 @@ const Z80Label *SPECGetLabel(void) { static const Z80Label label[]= { + {0x04c6, "SAVE"}, + {0x0562, "LOAD"}, {0x5c00, "KSTATE"}, {0x5c01, "KSTATE+1"}, {0x5c02, "KSTATE+2"}, -- cgit v1.2.3