From 0a6f1fcdf13e5d4518b8605dd7a55f49db6b1a70 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 20 Jan 2004 01:10:45 +0000 Subject: Added monitor; Various fixes --- src/spec.c | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) (limited to 'src/spec.c') diff --git a/src/spec.c b/src/spec.c index b0dc155..b094126 100644 --- a/src/spec.c +++ b/src/spec.c @@ -84,6 +84,7 @@ static Z80Byte mem[0x10000]; */ static Z80Val SCAN_CYCLES=224; static int scanline=0; +static int enable_screen=TRUE; /* GFX vars @@ -244,7 +245,7 @@ static void DumpZ80(Z80 *z80) /* ---------------------------------------- PRIVATE FUNCTIONS */ -void DrawScanline(int y) +void DrawScanlineAt(int y, int sline) { int aline; int f,r; @@ -253,7 +254,7 @@ void DrawScanline(int y) Z80Byte b; Z80Byte att; - aline=scanline-TOPL; + aline=sline-TOPL; GFXHLine(0,GFX_WIDTH-1,y,coltable[border].col); @@ -284,7 +285,7 @@ void DrawScanline(int y) } for(r=0,b=*scr++;r<8;r++) - if (b&(1<<(8-r))) + if (b&(1<<(7-r))) GFXFastPlot(f*8+r+OFF_X,y,coltable[ink].col); else GFXFastPlot(f*8+r+OFF_X,y,coltable[paper].col); @@ -294,6 +295,7 @@ void DrawScanline(int y) } } +#define DrawScanline(y) DrawScanlineAt(y,scanline) static void RomPatch(void) { @@ -403,15 +405,18 @@ static int CheckTimers(Z80 *z80, Z80Val val) Z80Interrupt(z80,0xff); - GFXEndFrame(TRUE); - GFXStartFrame(); + if (enable_screen) + { + GFXEndFrame(TRUE); + GFXStartFrame(); + } } /* Draw scanline */ y=scanline-TOPL+OFF_Y; - if (y>=0 && y=0 && y=ROMLEN) mem[addr]=val&0xff; @@ -830,6 +828,27 @@ const char *SPECInfo(Z80 *z80) } +void SPECEnableScreen(int enable) +{ + enable_screen=enable; +} + + +void SPECShowScreen(void) +{ + int f; + int y; + + for(f=0;f=0 && y