diff -acrN GB.orig/Common.h GB/Common.h *** GB.orig/Common.h Fri Jul 7 08:38:48 2000 --- GB/Common.h Fri Jan 2 01:01:13 1998 *************** *** 18,24 **** /** obtain color numbers (when there is no 1:1 **/ /** correspondence, for example in X11). **/ /*************************************************************/ ! /* #define USE_XPAL */ #ifdef USE_XPAL #define XPAL(N) XPal[N] --- 18,24 ---- /** obtain color numbers (when there is no 1:1 **/ /** correspondence, for example in X11). **/ /*************************************************************/ ! #define USE_XPAL #ifdef USE_XPAL #define XPAL(N) XPal[N] *************** *** 31,43 **** /****************************************************************/ void RefreshLine(byte Y) { ! register byte Offset,*P,*T,*R,*Z,Z0,D0,X1,X2,Shift; unsigned int D1; #ifdef USE_XPAL #define PAL(N) Pal[N] #define WPAL(N) WPal[N] ! byte Pal[4],WPal[4]; Pal[0]=XPal[BPal[0]];Pal[1]=XPal[BPal[1]]; Pal[2]=XPal[BPal[2]];Pal[3]=XPal[BPal[3]]; WPal[0]=(XPal+8)[BPal[0]];WPal[1]=(XPal+8)[BPal[1]]; --- 31,44 ---- /****************************************************************/ void RefreshLine(byte Y) { ! register byte Offset,*P,*T,*Z,Z0,D0,X1,X2,Shift; ! unsigned short *R; unsigned int D1; #ifdef USE_XPAL #define PAL(N) Pal[N] #define WPAL(N) WPal[N] ! unsigned short Pal[4],WPal[4]; Pal[0]=XPal[BPal[0]];Pal[1]=XPal[BPal[1]]; Pal[2]=XPal[BPal[2]];Pal[3]=XPal[BPal[3]]; WPal[0]=(XPal+8)[BPal[0]];WPal[1]=(XPal+8)[BPal[1]]; *************** *** 53,59 **** if((LCDCONT&0x81)!=0x81) { /* Clearing screen buffer */ ! memset(R,XPAL(0),160); /* Clearing Z-buffer */ memset(Z,0x00,160/8); memset(Z+WIDTH*HEIGHT/8,0x00,160/8); --- 54,60 ---- if((LCDCONT&0x81)!=0x81) { /* Clearing screen buffer */ ! memset(R,XPAL(0),160*sizeof(unsigned short)); /* Clearing Z-buffer */ memset(Z,0x00,160/8); memset(Z+WIDTH*HEIGHT/8,0x00,160/8); *************** *** 180,186 **** 0xC0,0x40,0x80,0x00 }; ! byte *P,*T,*S,*R,*Z,I,J,K,N,D0; unsigned int D1; int Shift,DY; --- 181,188 ---- 0xC0,0x40,0x80,0x00 }; ! byte *T,*S,*R,*Z,I,J,K,N,D0; ! unsigned short *P; unsigned int D1; int Shift,DY; diff -acrN GB.orig/Help.h GB/Help.h *** GB.orig/Help.h Fri Jul 7 04:51:28 2000 --- GB/Help.h Fri Jan 2 00:34:16 1998 *************** *** 36,42 **** " -shm/-noshm - Use/don't use MIT SHM extensions for X [-shm]", #endif #ifdef UNIX ! " -saver/-nosaver - Save/don't save CPU when inactive [-saver]", " -colorN - Change color #N [white,#989898,#585858,black]", " -bcolorN - Change background color #N [same]", " -scolorN - Change sprite color #N [same]", --- 36,42 ---- " -shm/-noshm - Use/don't use MIT SHM extensions for X [-shm]", #endif #ifdef UNIX ! " -saver/-nosaver - Save/don't save CPU when inactive [-nosaver]", " -colorN - Change color #N [white,#989898,#585858,black]", " -bcolorN - Change background color #N [same]", " -scolorN - Change sprite color #N [same]", diff -acrN GB.orig/Makefile GB/Makefile *** GB.orig/Makefile Wed Jul 3 20:29:30 1996 --- GB/Makefile Fri Jan 2 00:22:12 1998 *************** *** 28,34 **** # libraries libX11.* and libXext.* are located on your system. CC = gcc DEFINES = -DUNIX -DLSB_FIRST -DDEBUG -DMITSHM ! CFLAGS = -O2 -I/usr/X11/include -L/usr/X11/lib/ ${DEFINES} OBJECTS = VGB.o GB.o Z80.o Debug.o Unix.o # Make the standard distribution: VGB, DASM, and utilities. --- 28,35 ---- # libraries libX11.* and libXext.* are located on your system. CC = gcc DEFINES = -DUNIX -DLSB_FIRST -DDEBUG -DMITSHM ! #CFLAGS = -O2 -I/usr/X11/include -L/usr/X11/lib/ ${DEFINES} ! CFLAGS = -g -I/usr/X11/include -L/usr/X11/lib/ ${DEFINES} OBJECTS = VGB.o GB.o Z80.o Debug.o Unix.o # Make the standard distribution: VGB, DASM, and utilities. diff -acrN GB.orig/Unix.c GB/Unix.c *** GB.orig/Unix.c Sat Jul 6 06:16:59 1996 --- GB/Unix.c Fri Jan 2 01:45:41 1998 *************** *** 52,66 **** char *Title = "Virtual GameBoy Unix/X 0.7"; ! int SaveCPU = 1; ! byte *XBuf,*ZBuf,XPal[12]; char *ColorNames[12] = { "white","#989898","#585858","black", "white","#989898","#585858","black", "white","#989898","#585858","black" }; void OnBreak(int Arg) { CPURunning=0; } --- 52,74 ---- char *Title = "Virtual GameBoy Unix/X 0.7"; ! int SaveCPU = 0; ! byte *ZBuf; ! unsigned short *XBuf; ! unsigned short XPal[12]; char *ColorNames[12] = { + #if 0 + "black","#585858","#989898","white", + "black","#585858","#989898","white", + "black","#585858","#989898","white" + #else "white","#989898","#585858","black", "white","#989898","#585858","black", "white","#989898","#585858","black" + #endif }; void OnBreak(int Arg) { CPURunning=0; } *************** *** 123,129 **** if(Verbose) printf("OK\n Using shared memory:\n Creating image..."); Img= XShmCreateImage ! (Dsp,DefaultVisualOfScreen(Scr),8,ZPixmap,NULL,&SHMInfo,WIDTH,HEIGHT); if(!Img) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Getting SHM info..."); --- 131,137 ---- if(Verbose) printf("OK\n Using shared memory:\n Creating image..."); Img= XShmCreateImage ! (Dsp,DefaultVisualOfScreen(Scr),16,ZPixmap,NULL,&SHMInfo,WIDTH,HEIGHT); if(!Img) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Getting SHM info..."); *************** *** 132,138 **** if(SHMInfo.shmid<0) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Allocating SHM..."); ! XBuf=(byte *)(Img->data=SHMInfo.shmaddr=shmat(SHMInfo.shmid,0,0)); if(!XBuf) { if(Verbose) printf("FAILED\n");return(0); } SHMInfo.readOnly=False; --- 140,146 ---- if(SHMInfo.shmid<0) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Allocating SHM..."); ! XBuf=(unsigned short *)(Img->data=SHMInfo.shmaddr=shmat(SHMInfo.shmid,0,0)); if(!XBuf) { if(Verbose) printf("FAILED\n");return(0); } SHMInfo.readOnly=False; *************** *** 144,156 **** #endif { if(Verbose) printf("OK\n Allocating screen buffer..."); ! XBuf=(byte *)malloc(sizeof(byte)*HEIGHT*WIDTH); if(!XBuf) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Creating image..."); Img= XCreateImage ! (Dsp,DefaultVisualOfScreen(Scr),8,ZPixmap,0,XBuf,WIDTH,HEIGHT,8,0); if(!Img) { if(Verbose) printf("FAILED\n");return(0); } } --- 152,164 ---- #endif { if(Verbose) printf("OK\n Allocating screen buffer..."); ! XBuf=(unsigned short *)malloc(sizeof(unsigned short)*HEIGHT*WIDTH); if(!XBuf) { if(Verbose) printf("FAILED\n");return(0); } if(Verbose) printf("OK\n Creating image..."); Img= XCreateImage ! (Dsp,DefaultVisualOfScreen(Scr),16,ZPixmap,0,(char*)XBuf,WIDTH,HEIGHT,8,0); if(!Img) { if(Verbose) printf("FAILED\n");return(0); } }