diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 5 | ||||
-rw-r--r-- | src/memmenu.c | 4 | ||||
-rw-r--r-- | src/util.c | 3 | ||||
-rw-r--r-- | src/zx81.c | 40 |
4 files changed, 26 insertions, 26 deletions
diff --git a/src/Makefile b/src/Makefile index 96c80bd..271fa37 100644 --- a/src/Makefile +++ b/src/Makefile @@ -18,7 +18,7 @@ # # ------------------------------------------------------------------------- # -# $Id: Makefile,v 1.8 2004-01-22 02:38:13 ianc Exp $ +# $Id: Makefile,v 1.9 2004-01-23 20:05:54 ianc Exp $ # @@ -114,7 +114,8 @@ zx81.o: /usr/local/include/SDL/SDL_keyboard.h zx81.o: /usr/local/include/SDL/SDL_keysym.h zx81.o: /usr/local/include/SDL/SDL_mouse.h /usr/local/include/SDL/SDL_video.h zx81.o: /usr/local/include/SDL/SDL_mutex.h /usr/local/include/SDL/SDL_quit.h -zx81.o: /usr/local/include/SDL/SDL_version.h gfx.h gui.h config.h exit.h +zx81.o: /usr/local/include/SDL/SDL_version.h gfx.h gui.h config.h util.h +zx81.o: exit.h config.o: /usr/include/stdlib.h /usr/include/sys/cdefs.h config.o: /usr/include/sys/_types.h /usr/include/machine/_types.h config.o: /usr/include/stdio.h /usr/include/string.h /usr/include/strings.h diff --git a/src/memmenu.c b/src/memmenu.c index 7f6f3fe..95429f9 100644 --- a/src/memmenu.c +++ b/src/memmenu.c @@ -219,8 +219,8 @@ int DisplayZ80State(Z80State *s, int y, Uint32 col) s->I,s->IM,s->R); y+=8; GFXPrintPaper(0,y,col,BLACK, - "IFF1=%2.2x IFF2=%2.2x CY=%8.8x", - s->IFF1,s->IFF2,s->cycle); + "IFF1=%2.2x IFF2=%2.2x", + s->IFF1,s->IFF2); return y+8; } @@ -116,8 +116,7 @@ void Debug(const char *format, ...) if (!fp) { - /*fp=fopen("debug.txt","w");*/ - fp=stdout; + fp=fopen("debug.txt","w"); setbuf(fp,NULL); } @@ -351,14 +351,12 @@ static void ULA_Video_Shifter(Z80 *z80, Z80Byte val) Z80GetState(z80,&state); - /* Extra check due to dodgy ULA emulation + /* Extra check due to out dodgy ULA emulation */ if (ULA.y>=0 && ULA.y<SCR_H) { Uint32 fg,bg; - GFXLock(); - /* Position on screen corresponding to ULA */ x=OFF_X+ULA.x*8; @@ -385,12 +383,10 @@ static void ULA_Video_Shifter(Z80 *z80, Z80Byte val) for(b=0;b<8;b++) { if (mem[base]&(1<<(7-b))) - GFXFastPlot(x+b,y,fg); + GFXPlot(x+b,y,fg); else - GFXFastPlot(x+b,y,bg); + GFXPlot(x+b,y,bg); } - - GFXUnlock(); } ULA.x=(ULA.x+1)&0x1f; @@ -406,13 +402,12 @@ static int CheckTimers(Z80 *z80, Z80Val val) { Z80ResetCycles(z80,val-HSYNC_PERIOD); - if (nmigen) + if (nmigen && hsync) { Z80NMI(z80); Debug("NMIGEN\n"); } - - if (hsync) + else if (hsync) { Debug("HSYNC\n"); if (ULA.release) @@ -429,14 +424,14 @@ static int CheckTimers(Z80 *z80, Z80Val val) } -static int Halt(Z80 *z80, Z80Val val) +static int CheckHalt(Z80 *z80, Z80Val val) { - Debug("HALT=%d\n",val); - - if (val && !nmigen && !hsync) + if (val) { - GUIMessage(eMessageBox,"EMULATOR BUG!", - "HALT without NMI or HSYNC\ngenerator active"); + if (!nmigen && !hsync) + GUIMessage(eMessageBox,"POSSIBLE BUG", + "Executed HALT while NMI generator\n" + "and HSYNC generator off"); } return TRUE; @@ -470,7 +465,7 @@ void ZX81Init(Z80 *z80) RomPatch(); Z80LodgeCallback(z80,eZ80_EDHook,EDCallback); Z80LodgeCallback(z80,eZ80_Instruction,CheckTimers); - Z80LodgeCallback(z80,eZ80_Halt,Halt); + Z80LodgeCallback(z80,eZ80_Halt,CheckHalt); /* Mirror the ROM */ @@ -714,9 +709,9 @@ const char *ZX81Info(Z80 *z80) { static char buff[80]; - sprintf(buff,"NMI: %s HS: %s ULA: (%d,%d,%d,%d)", - nmigen ? "ON ":"OFF", - hsync ? "ON ":"OFF", + sprintf(buff,"NMI: %s HS: %s ULA: (%d,%d,%d,%d)", + nmigen ? "ON":"OFF", + hsync ? "ON":"OFF", ULA.x,ULA.y,ULA.c,ULA.release); return buff; @@ -731,10 +726,15 @@ void ZX81EnableScreen(int enable) void ZX81Reset(Z80 *z80) { + int f; + scr_enable=TRUE; nmigen=FALSE; hsync=FALSE; + for(f=0;f<8;f++) + matrix[f]=0; + GFXStartFrame(); } |