Subject: pkg/6731: fmsx package
To: None <gnats-bugs@gnats.netbsd.org>
From: None <kei_sun@ba2.so-net.ne.jp>
List: netbsd-bugs
Date: 01/05/1999 07:27:49
>Number:         6731
>Category:       pkg
>Synopsis:       fmsx package is missing.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan  4 14:50:01 1999
>Last-Modified:
>Originator:     SUNAGAWA Keiki
>Organization:
	individual
>Release:        1998/12/06
>Environment:
	
System: NetBSD azarin 1.3I NetBSD 1.3I (AZARIN) #38: Wed Dec 23 07:16:40 JST 1998     kei@azarin:/var/src/sys/arch/macppc/compile/AZARIN macppc


>Description:

>From the document fMSX.html:

fMSX is a portable emulator of MSX home computers written in C. You
can always get the latest fMSX source code and support files from
 
               http://www.komkon.org/fms/fMSX/
 
MSX is an old Z80-based family of home computers which appeared in
1982 as an attempt to establish a single standard in home computing
similar to VHS in video. They were popular in Asian (Korea, Japan) and
South American (Brazil, Chile) countries as well as in Europe
(Netherlands, France, Spain) and former Soviet Union, but they are
virtually unknown in USA. Although MSX standard quietly died to year
1988, the world got to see MSX2, MSX2+, and TurboR extensions of the
standard.

>How-To-Repeat:
	cd to /usr/pkgsrc/emulators and ls.
>Fix:
	Aplly following patch.  I tested it on sparc and macppc.

Index: pkgsrc/emulators/fmsx/Makefile
diff -c /dev/null pkgsrc/emulators/fmsx/Makefile:1.1.2.2
*** /dev/null	Tue Jan  5 07:12:59 1999
--- pkgsrc/emulators/fmsx/Makefile	Tue Jan  5 07:01:00 1999
***************
*** 0 ****
--- 1,57 ----
+ # $NetBSD$
+ 
+ PKGNAME=	fmsx-2.0b_unix
+ DISTNAME=	fMSX
+ CATEGORIES=	emulators
+ MASTER_SITES=	http://www.komkon.org/fms/fMSX/
+ EXTRACT_SUFX=	.tar.Z
+ 
+ WRKSRC= 	${WRKDIR}/MSX
+ 
+ MAINTAINER=	packages@netbsd.org
+ HOMEPAGE=	http://www.komkon.org/fms/fMSX/
+ 
+ USE_X11=	yes
+ 
+ DEFS+=		-DFontDir=\"\\\"${PREFIX}/lib/X11/fmsx/\"\\\"
+ DEFS+=		-DRomDir=\"\\\"${PREFIX}/lib/X11/fmsx/\"\\\"
+ .if (${MACHINE} == "alpha" || ${MACHINE} == "arm32" || \
+ ${MACHINE} == "i386" || ${MACHINE} == "pica" || \
+ ${MACHINE} == "pmax" || ${MACHINE} == "vax")
+ DEFS+=		-DLSB_FIRST
+ .else
+ DEFS+=		-DMSB_FIRST
+ .endif
+ .if defined(ShmDefines)
+ DEFS+=		-DMITSHM
+ .endif
+ 
+ MAKE_ENV+=	DEFS="${DEFS}"
+ 
+ pre-install:
+ 	@${MKDIR} ${PREFIX}/lib/X11/fmsx \
+ 		&& ${CHMOD} a+rx ${PREFIX}/lib/X11/fmsx
+ 	@${MKDIR} ${PREFIX}/share/doc/fmsx \
+ 		&& ${CHMOD} a+rx ${PREFIX}/share/doc/fmsx
+ 
+ # Makefile of fMSX doesn't have install target.
+ do-install:
+ 	${INSTALL_PROGRAM} ${WRKSRC}/fmsx ${PREFIX}/bin
+ 	${INSTALL_PROGRAM} ${WRKSRC}/rddsk ${PREFIX}/bin
+ 	${INSTALL_PROGRAM} ${WRKSRC}/wrdsk ${PREFIX}/bin
+ 	${MKDIR} ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/CYRILLIC.FNT ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/ITALIC.FNT ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/CMOS.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/DISK.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/KANJI.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/MSX.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/MSX2.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/MSX2EXT.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/MSX2P.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/MSX2PEXT.ROM ${PREFIX}/lib/X11/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/PAINTER.ROM ${PREFIX}/lib/X11/fmsx
+ 	${MKDIR} ${PREFIX}/share/doc/fmsx
+ 	${INSTALL_DATA} ${WRKSRC}/fMSX.html ${PREFIX}/share/doc/fmsx
+ 
+ .include "../../mk/bsd.pkg.mk"
Index: pkgsrc/emulators/fmsx/files/md5
diff -c /dev/null pkgsrc/emulators/fmsx/files/md5:1.1.2.1
*** /dev/null	Tue Jan  5 07:12:59 1999
--- pkgsrc/emulators/fmsx/files/md5	Mon Jan  4 04:14:26 1999
***************
*** 0 ****
--- 1,3 ----
+ $NetBSD$
+ 
+ MD5 (fMSX.tar.Z) = 5cf149449ec1ee756a843a4fc354d3e0
Index: pkgsrc/emulators/fmsx/patches/patch-aa
diff -c /dev/null pkgsrc/emulators/fmsx/patches/patch-aa:1.1.2.1
*** /dev/null	Tue Jan  5 07:13:00 1999
--- pkgsrc/emulators/fmsx/patches/patch-aa	Mon Jan  4 04:14:26 1999
***************
*** 0 ****
--- 1,22 ----
+ --- Makefile.orig	Sat May 30 19:41:21 1998
+ +++ Makefile	Mon Jan  4 01:48:25 1999
+ @@ -39,8 +39,8 @@
+  # change the -L/usr/X11R6/lib to the directory where X11
+  # libraries libX11.* and libXext.* are located on your system.
+  CC      = gcc
+ -DEFINES = -DFMSX -DUNIX -DLSB_FIRST -DDEBUG -DMITSHM -DSOUND -DBPP8
+ -CFLAGS  = -O3 -fomit-frame-pointer -I/usr/X11/include -L/usr/X11/lib ${DEFINES}
+ +DEFINES = -DFMSX -DUNIX -DDEBUG -DBPP8 ${DEFS}
+ +CFLAGS  = -O3 -fomit-frame-pointer -I/usr/X11R6/include -L/usr/X11R6/lib ${DEFINES}
+  OBJECTS = fMSX.o MSX.o Z80.o Patch.o Debug.o Unix.o LibUnix.o Sound.o
+  
+  # Make the standard distribution: fMSX and DASM.
+ @@ -59,7 +59,7 @@
+  
+  # Clean up.
+  clean:
+ -	rm -f *.o fmsx dasm psgplay
+ +	rm -f *.o fmsx dasm psgplay rddsk wrdsk *.core
+  
+  # Dependencies for the object files.
+  fMSX.o:		fMSX.c MSX.h Z80.h Help.h
Index: pkgsrc/emulators/fmsx/patches/patch-ab
diff -c /dev/null pkgsrc/emulators/fmsx/patches/patch-ab:1.1.2.1
*** /dev/null	Tue Jan  5 07:13:00 1999
--- pkgsrc/emulators/fmsx/patches/patch-ab	Mon Jan  4 04:14:27 1999
***************
*** 0 ****
--- 1,161 ----
+ --- MSX.c.orig	Mon Jan  4 02:38:31 1999
+ +++ MSX.c	Mon Jan  4 03:05:34 1999
+ @@ -54,6 +54,24 @@
+  byte *FontBuf;                      /* Font for text modes    */
+  byte UseFont     = 0;               /* Use ext. font when 1   */
+  
+ +char *MsxRom     = "MSX.ROM";
+ +char *Msx2Rom    = "MSX2.ROM";
+ +char *Msx2ExtRom = "MSX2EXT.ROM";
+ +char *Msx2PRom   = "MSX2P.ROM";
+ +char *Msx2PExtRom = "MSX2PEXT.ROM";
+ +char *DiskRom    = "DISK.ROM";
+ +char *CmosRom    = "CMOS.ROM";
+ +char *KanjiRom   = "KANJI.ROM";
+ +char *Rs232Rom   = "RS232.ROM";
+ +char *FmPacRom   = "FMPAC.ROM";
+ +char *PainterRom = "PAINTER.ROM";
+ +/* char *MsxDos2Rom = "MSXDOS2.ROM"; */
+ +
+ +char FontPathBuf[80];
+ +char RomPathBuf[80];
+ +char *FontPath   = NULL;
+ +char *RomPath    = NULL;
+ +
+  char *SndName    = NULL;            /* Sound log file         */
+  FILE *SndStream;
+  
+ @@ -310,31 +328,44 @@
+    {
+      case 0:
+        if(Verbose) printf("  Opening MSX.ROM...");
+ -      F=fopen("MSX.ROM","rb");
+ +      RomPath=strcpy(RomPathBuf, RomDir);
+ +      strcat(RomPath,MsxRom);
+ +      if((F=fopen(RomPath,"rb"))||(F=fopen(MsxRom,"rb")))
+ +        ;
+        break;
+      case 1:
+        if(Verbose) printf("  Opening MSX2EXT.ROM...");
+        J=0;
+ -      if(F=fopen("MSX2EXT.ROM","rb"))
+ +      RomPath=strcpy(RomPathBuf, RomDir);
+ +      strcat(RomPath,Msx2ExtRom);
+ +      if((F=fopen(RomPath,"rb"))||(F=fopen(Msx2ExtRom,"rb")))
+        {
+          if(LoadROM("OK\n    MSX2 ROM Extension",F,3,1,0)) J=1;
+          fclose(F);
+        }
+        if(!J) { PRINTFAILED;return(0); }
+        if(Verbose) printf("  Opening MSX2.ROM...");
+ -      F=fopen("MSX2.ROM","rb");
+ +      RomPath=strcpy(RomPathBuf, RomDir);
+ +      strcat(RomPath,Msx2Rom);
+ +      if((F=fopen(RomPath,"rb"))||(F=fopen(Msx2Rom,"rb")))
+ +        ;
+        break;
+      case 2:
+        if(Verbose) printf("  Opening MSX2PEXT.ROM...");
+        J=0;
+ -      if(F=fopen("MSX2PEXT.ROM","rb"))
+ +      RomPath=strcpy(RomPathBuf, RomDir);
+ +      strcat(RomPath,Msx2PExtRom);
+ +      if((F=fopen(RomPath,"rb"))||(F=fopen(Msx2PExtRom,"rb")))
+        {
+          if(LoadROM("OK\n    MSX2+ ROM Extension",F,3,1,0)) J=1;
+          fclose(F);
+        }
+        if(!J) { PRINTFAILED;return(0); }
+        if(Verbose) printf("  Opening MSX2P.ROM...");
+ -      F=fopen("MSX2P.ROM","rb");
+ +      RomPath=strcpy(RomPathBuf, RomDir);
+ +      strcat(RomPath,Msx2PRom);
+ +      if((F=fopen(RomPath,"rb"))||(F=fopen(Msx2PRom,"rb")))
+ +        ;
+        break;
+    }
+  
+ @@ -359,7 +390,9 @@
+      }
+    if(Verbose) printf(".OK\n");
+  
+ -  if(F=fopen("DISK.ROM","rb"))
+ +  RomPath=strcpy(RomPathBuf, RomDir);
+ +  strcat(RomPath,DiskRom);
+ +  if((F=fopen(RomPath,"rb"))||(F=fopen(DiskRom,"rb")))
+    {
+      if(LoadROM("Found DISK.ROM",F,3,1,1))
+      {
+ @@ -376,7 +409,9 @@
+    }
+  
+    /* Try to load CMOS memory contents */
+ -  if(F=fopen("CMOS.ROM","rb"))
+ +  RomPath=strcpy(RomPathBuf,RomDir);
+ +  strcat(RomPath,CmosRom);
+ +  if((F=fopen(RomPath,"rb"))||(F=fopen(CmosRom,"rb")))
+    {
+      if(Verbose) printf("Found CMOS.ROM: loading...");
+      if(fread(RTC,1,sizeof(RTC),F)!=sizeof(RTC))
+ @@ -386,7 +421,9 @@
+    else memcpy(RTC,RTCInit,sizeof(RTC));
+  
+    /* Try to load Kanji alphabet ROM */
+ -  if(F=fopen("KANJI.ROM","rb"))
+ +  RomPath=strcpy(RomPathBuf,RomDir);
+ +  strcat(RomPath,KanjiRom);
+ +  if((F=fopen(RomPath,"rb"))||(F=fopen(KanjiRom,"rb")))
+    {
+      if(Verbose) printf("Found KANJI.ROM: loading...");
+      if(Kanji=malloc(0x20000))
+ @@ -398,11 +435,15 @@
+    }
+  
+    /* Try to load RS232 support ROM */
+ -  if(F=fopen("RS232.ROM","rb"))
+ +  RomPath=strcpy(RomPathBuf,RomDir);
+ +  strcat(RomPath,Rs232Rom);
+ +  if((F=fopen(RomPath,"rb"))||(F=fopen(Rs232Rom,"rb")))
+    { LoadROM("Found RS232.ROM",F,3,0,1);fclose(F); }
+  
+    /* Try to load FM-PAC support ROM */
+ -  if(F=fopen("FMPAC.ROM","rb"))
+ +  RomPath=strcpy(RomPathBuf,RomDir);
+ +  strcat(RomPath,FmPacRom);
+ +  if((F=fopen(RomPath,"rb"))||(F=fopen(FmPacRom,"rb")))
+    { LoadROM("Found FMPAC.ROM",F,3,3,1);fclose(F); }
+  
+    /* Try to load cartridges */
+ @@ -422,7 +463,9 @@
+      }
+  
+      /* Try to load PAINTER ROM */
+ -    if(F=fopen("PAINTER.ROM","rb"))
+ +    RomPath=strcpy(RomPathBuf,RomDir);
+ +    strcat(RomPath,PainterRom);
+ +    if((F=fopen(RomPath,"rb"))||(F=fopen(PainterRom,"rb")))
+      {
+        /* Find an empty slot */
+        if(MemMap[1][0][2]==EmptyRAM) J=1;
+ @@ -445,7 +488,9 @@
+    }
+  
+    /* Read font, if found */
+ -  if(F=fopen(FontName,"rb"))
+ +    FontPath=strcpy(FontPathBuf,FontDir);
+ +    strcat(FontPath,FontName);
+ +  if((F=fopen(FontPath,"rb"))||(F=fopen(FontName,"rb")))
+    {
+      if(Verbose) printf("Using %s font: allocating memory...",FontName);
+      if(FontBuf=malloc(2048))
+ @@ -604,7 +649,9 @@
+    if(SaveCMOS)
+    {
+      if(Verbose) printf("Writing CMOS.ROM...");
+ -    if(F=fopen("CMOS.ROM","wb"))
+ +    RomPath=strcpy(RomPathBuf,RomDir);
+ +    strcat(RomPath,CmosRom);
+ +    if((F=fopen(RomPath,"wb"))||(F=fopen(CmosRom,"wb")))
+        if(fwrite(RTC,1,sizeof(RTC),F)!=sizeof(RTC))
+        { fclose(F);F=0; }
+      if(F) { fclose(F);PRINTOK; }
Index: pkgsrc/emulators/fmsx/patches/patch-ac
diff -c /dev/null pkgsrc/emulators/fmsx/patches/patch-ac:1.1.2.1
*** /dev/null	Tue Jan  5 07:13:00 1999
--- pkgsrc/emulators/fmsx/patches/patch-ac	Tue Jan  5 07:02:37 1999
***************
*** 0 ****
--- 1,12 ----
+ --- Sound.c.orig	Mon Jan  4 06:43:54 1999
+ +++ Sound.c	Mon Jan  4 06:44:13 1999
+ @@ -50,7 +50,9 @@
+  
+  #include <sys/audioio.h>
+  #include <sys/conf.h>
+ +#ifndef __NetBSD__
+  #include <stropts.h>
+ +#endif
+  #include <signal.h>
+  
+  static unsigned char dsp_ulaw[256] = {
Index: pkgsrc/emulators/fmsx/pkg/COMMENT
diff -c /dev/null pkgsrc/emulators/fmsx/pkg/COMMENT:1.1.2.1
*** /dev/null	Tue Jan  5 07:13:00 1999
--- pkgsrc/emulators/fmsx/pkg/COMMENT	Mon Jan  4 04:14:27 1999
***************
*** 0 ****
--- 1 ----
+ An MSX (Z80-based computer) emulator.
Index: pkgsrc/emulators/fmsx/pkg/DESCR
diff -c /dev/null pkgsrc/emulators/fmsx/pkg/DESCR:1.1.2.2
*** /dev/null	Tue Jan  5 07:13:01 1999
--- pkgsrc/emulators/fmsx/pkg/DESCR	Tue Jan  5 07:07:32 1999
***************
*** 0 ****
--- 1,13 ----
+ fMSX is a portable emulator of MSX home computers written in C. You
+ can always get the latest fMSX source code and support files from
+ 
+ 		http://www.komkon.org/fms/fMSX/
+ 
+ MSX is an old Z80-based family of home computers which appeared in
+ 1982 as an attempt to establish a single standard in home computing
+ similar to VHS in video. They were popular in Asian (Korea, Japan) and
+ South American (Brazil, Chile) countries as well as in Europe
+ (Netherlands, France, Spain) and former Soviet Union, but they are
+ virtually unknown in USA. Although MSX standard quietly died to year
+ 1988, the world got to see MSX2, MSX2+, and TurboR extensions of the
+ standard.
Index: pkgsrc/emulators/fmsx/pkg/PLIST
diff -c /dev/null pkgsrc/emulators/fmsx/pkg/PLIST:1.1.2.1
*** /dev/null	Tue Jan  5 07:13:01 1999
--- pkgsrc/emulators/fmsx/pkg/PLIST	Mon Jan  4 04:14:28 1999
***************
*** 0 ****
--- 1,18 ----
+ @comment $NetBSD$
+ bin/fmsx
+ bin/rddsk
+ bin/wrdsk
+ lib/X11/fmsx/CYRILLIC.FNT
+ lib/X11/fmsx/ITALIC.FNT
+ lib/X11/fmsx/CMOS.ROM
+ lib/X11/fmsx/DISK.ROM
+ lib/X11/fmsx/KANJI.ROM
+ lib/X11/fmsx/MSX.ROM
+ lib/X11/fmsx/MSX2.ROM
+ lib/X11/fmsx/MSX2EXT.ROM
+ lib/X11/fmsx/MSX2P.ROM
+ lib/X11/fmsx/MSX2PEXT.ROM
+ lib/X11/fmsx/PAINTER.ROM
+ share/doc/fmsx/fMSX.html
+ @dirrm lib/X11/fmsx
+ @dirrm share/doc/fmsx
>Audit-Trail:
>Unformatted: