diff options
Diffstat (limited to 'gemma.c')
-rw-r--r-- | gemma.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -42,7 +42,6 @@ static const char id[]="$Id$"; */ static Z80 *z80; static Z80Byte mem[0x10000]; -static int memctl[256]; static sig_atomic_t stop=FALSE; @@ -413,6 +412,16 @@ static void DisplayState(DString s, const char *label, /* ---------------------------------------- MEMORY */ +static Z80Byte Peek(Z80 *z80, Z80Word addr) +{ + return mem[addr]; +} + +static void Poke(Z80 *z80, Z80Word addr, Z80Byte b) +{ + mem[addr]=b; +} + static Z80Byte ReadPort(Z80 *z80, Z80Word addr) { Z80Byte b=0xff; @@ -970,11 +979,7 @@ void GEMMA_Stop(void) void GEMMA_Init(GtkWidget *top) { - int f; - - for(f=0;f<256;f++) memctl[f]=1; - - z80=Z80Init(mem,memctl,WritePort,ReadPort); + z80=Z80Init(Peek,Poke,ReadPort,WritePort,Peek); Z80SetPC(z80,0x100); if (!z80) |