summaryrefslogtreecommitdiff
path: root/emulators/fmsx
AgeCommit message (Collapse)AuthorFilesLines
2010-01-07Update fmsx to 3.5.1.obache11-297/+142
approved by agc@. New in This Version * After a long pause, finally updated fMSX-Unix port. fMSX-Unix source code is once again available as part of the core source code distribution. It has been debugged on the Ubuntu Linux. Let me know of any incompatibilities with other Unix flavors. * Extended fMSX-Symbian port to support UIQ3 phones from Sony Ericsson and Motorola. As I only have key-operated Motorola Z8, testers with pen-based SE phones are badly needed. * Added run-time compatibility with 8bpp, 16bpp, 24bpp (32bit pixels) and 32bpp screen depths to fMSX-Unix. IMPORTANT: At this moment, built-in config menu, debugger, and NetPlay dialog will only work at X11 screen depth that matches your compile-time setting (i.e. -DBPPxx) in Makefile. Make sure you always compile fMSX-Unix for your default screen depth. * Disabled secondary slots for primary slot #0 in MSX1 mode. DiskROM boots in MSX1 mode again. * Now syncing all sound channels after loading state, sound does not get "stuck" any more. * Renamed command line option -zoom/-nozoom into -soft/-nosoft. * Moved a few key definitions, so that "!@#$%^..." characters can now be used as indices into Keys[]. This is done for compatibility with GDK key events. * Renamed KeyMap[] to KeyState[] to avoid name clash with MacOSX system API. * ALT swaps joysticks 1/2 on all platforms where applicable. * CONTROL/SHIFT keys now act as FIRE-A/FIRE-B joystick buttons on all platforms. * Improved fMSX-Symbian sound code, although sound problems still persist on some UIQ3 phones. * Split fMSX-Symbian/S60 configuration menu into four tabs, making "Video" and "Audio" settings separate. * Added "Audio Latency", "Skip Frames", and "Sync Updates" settings to fMSX-Symbian. * Added to fMSX-Symbian ability to use Nokia E61/E62 [FUNC] key in the built-in menu. * Fixed an fMSX-Symbian bug where pieces of virtual keyboard remained on screen after closing it. * Pressing [8] key on fMSX-Symbian now invokes virtual keyboard, if enabled, for the phones which do not have the [EDIT] key. New in fMSX 3.4 * Added network play option to fMSX-Windows and fMSX-Symbian! * Now not opening printer file until the first character is printed. * Fixed OUTD/OUTDR opcodes to modify B register before the OUT operation. * No longer trying to load state files from LoadFile(). * Defined "INLINE" properly, depending on the C standard supported by the compiler. * Finally retired #ifdef SOUND as sound is always compiled in anyway. * Added new, much better, scanline simulation and video softening effects to fMSX-Windows. * fMSX-Windows full-screen mode now runs in 640x480 resolution. * Fixed problem with full-screen SCREEN 6/7 in fMSX-Windows. * fMSX-MSDOS has got complete (non-truncated) emulation for SCREEN 6/7 and TEXT80 screen modes. * fMSX-MSDOS now always runs in 640x480x15bpp VESA screen mode. * Added options to simulate TV scanlines (-tv/-notv) and zoom display (-zoom/ -nozoom) to fMSX-MSDOS. * Options -sync/-nosync/-vsync work properly again in fMSX-MSDOS. * Added new "Fill & Soften" zoom mode to fMSX-Symbian. It is rather slow though. * Added ability to use virtual keyboard in fMSX-Symbian to enter filename when saving files from the built-in menu. * Fixed problem with gameplay being too fast in fMSX-Symbian. * Fixed possible source of instabilities in the S60 open file dialog in fMSX-Symbian. * Fixed exit via Symbian-specific menu. * Fixed premature termination of the emulation thread when exiting fMSX-Symbian, soundtrack recording and config saving work again. * The [C] ("Clear") key is no longer used to toggle sound in fMSX-Symbian. It acts as [BACKSPACE] instead. New in fMSX 3.3 * Save state format has changed due to serious changes to the emulator architecture! * Added OpZ80() function and the FAST_RDOP macro to the Z80 emulation to optimize code access in architectures with memory-mapped I/O. * Added subslot support to all slots. * Moved PAINTER.ROM to slot 0:1, FMPAC to slot 0:2, MSXDOS2.ROM to slot 3:0. * Reduced the number of user cartridges back to two (A/B). All the other slots are taken by system cartridges (MSXDOS2, FMPAC, etc.). * Locked user cartridges in slots 1/2 to subslot 0, as external cartridges often do not use subslots. * If Konami's GMASTER2.ROM or GMASTER.ROM is present in the program directory, fMSX will now load it as a system cartridge. * Fixed state file name autogeneration. * Fixed -rom option behaviour. * Fixed hangup when switching from MSX1 to MSX2 mode. * Fixed MSXDOS2.ROM and FMPAC.ROM support. * Fixed StateID() function to take all cartridges and system ROMs into account. * Fixed non-working joystick autofire. * Now checking joysticks and mice once per frame. * Now accelerating horizontal mouse movement in 512-wide screen modes. * Mouse buttons are now merged with joystick buttons. * Fixed mouse-as-joystick option. * Improved file type detection, now automatically detecting saved states, disk images, cartridge ROMs, fixed font files. * Readded proper support for fixed text mode fonts with LoadFNT(). * Added proper emulation for the WD1793 FDC (WD1793.c). * Added unified .FDI disk image support (FDIDisk.c). * Added support for standard, SV738, Arabic, and Brazilian WD1793-based disk interfaces. * Added support for GZIPped disk images. * Made disk geometry discovery smarter (CP/M-80 v2.2 now boots). * Moved 720kB floppy utilities (Floppy.c) and SCC sound chip emulation (SCC.c) into EMULib. * Added command line option to patch DiskROM calls (-simbdos). With this option on, fMSX takes over DiskROM disk access routines. When -wd1793 is used, fMSX will simulate real WD1793 FDC instead. * Rehashed built-in menu to make screen space for more options. * Added menu options to select RAM and VRAM sizes, create new disk images, save disk images, patch DiskROM calls, load and use fixed text mode fonts. * Added virtual keyboard to fMSX-Symbian, invoked by pressing [EDIT] or left [SHIFT] key. The keyboard can work in three modes: "Off", "Single Key Entry", and "Multiple Keys Entry". * Added display orientation settings to fMSX-Symbian ("Landscape", "Portrait", and "Auto"). * Finally fixed opendir() problem in EMULib-Symbian. All built-in menu file dialogs work now! * Further extended and optimized Symbian screen rendering routines. * Fixed and optimized TV scanline simulation in fMSX-Symbian, made scanline effect stronger. * Now saving RAM and VRAM size settings in fMSX-Symbian. * fMSX-Symbian now uses true 512-wide display drivers for SCREEN6, SCREEN7, and TEXT80. * fMSX-Symbian will now save printer output to E:\Others\fMSX\PRINTER.OUT. * Fixed system warnings in when flipping Nokia E70 open/closed. * Fixed possible crash when selecting an initial file in fMSX-Symbian. * Improved "About" box in fMSX-Symbian. * Moved fMSX-Symbian file selection root to E:\. * When initial file selection cancelled, fMSX-Symbian will now boot into plain BASIC (i.e. no cartridges and no disks). * Renamed fMSX-Symbian binary and resource files to avoid name clash with fMSX/S60 port by Juha Riihimaki. * Fixed mouse support in fMSX-MSDOS. New in fMSX 3.2 * Added ChangePrinter() function to set printer redirection file. * Moved disk operations to a separate submenu of the built-in menu and added "Eject Disk" options. * Added an easy "Load File" option to the built-in menu and the fMSX-Windows. * Added options to redirect printer and sound logging output to the built-in menu and the fMSX-Windows. * Added error messages to fMSX-Windows and fMSX-Symbian. * Added frame rate display option to fMSX-Symbian. * Added "fill screen" zoom option to fMSX-Symbian. * Added MIDI soundtrack logging to fMSX-Symbian (saved into E:\Sounds and can be used as ringtones). * Added configurable button and key mappings to fMSX-Symbian. * fMSX-Symbian application menu is now split into three pages. New in fMSX 3.1 * fMSX-Windows and fMSX-DOS are now compiled with OpenWatcom C++ and use the new EMULib framework. Note that keyboard assignments have changed! * Added hardware reset key ([F11]) to reboot MSX. * Added universal screen buffer based Z80 debugger ([F10]) that works on all platforms. * Added universal configuration menu ([F8]) that works on all platforms. * Added ResetMSX() function to restart MSX, possibly in a new operating mode. * Extended LoadCart() function to load or eject cartridges at runtime. * Added Mode variable to store all configuration options. * Replaced -vperiod/-hperiod settings with easier to understand -pal/-ntsc settings. * Replaced -uperiod setting with a finer -skip setting that controls the percentage of skipped frames. * Fixed Z80 NMI handling to comply with the standard. * Fixed SRAM file saving. * Fixed state file name generation. * Added autofire options for joystick buttons. * fMSX-Windows has got a new menu-based GUI, improved sound, and faster graphics updates. * Fixed USB joypad support in fMSX-Windows. * fMSX-MSDOS now uses 16BPP screen mode. * Updated the documentation. New in fMSX 3.0 * Added transparent support for GZIPped disk images as disks. You can now pass .GZ file names in -diska/-diskb command line options. * Added transparent support for directories as disks (thanks to Miguel Colom). You can now pass directory names in -diska/-diskb command line options. Changes to such disks will not be saved for safety reasons. * Added DirectDraw-based full screen mode to fMSX-Windows. Press [ALT]+ [ENTER] to switch in and out of the full screen mode. Use it with caution, as DirectDraw is notoriously unstable. * Added a full-fledged debugger to fMSX-Windows. Press [F11] to invoke the debugger. * Fixed several bugs in MIDI implementations that made some games silent when logging soundtrack or using MIDI output in fMSX-Windows. * Better adapted fMSX-MSDOS to 320x200 VGA screen. * "Sync to VBlanks" option is now default in fMSX-MSDOS. New in fMSX 2.8 * Fixed initial envelope volume in AY8910.c, thanks to Koichi Nishida. * Fixed a problem with 8kB/16kB cartridges failing to execute in the MSX1 mode. * When guessing a MegaROM mapper type, fMSX now tries to look at a data file CARTS.CRC containing pairs of cartridge CRCs and mapper types. * Added support for the third cartridge slot. You can now give up to three cartridge names on the command line and three -rom options. * Cartridges are now inserted into slots 1:X (A), 2:X (B), and 3:0 (C). The RS232.ROM has been moved to slot 3:3. * Added support for the 64kB Panasonic FM-PAC cartridge with 8kB SRAM (-rom 7). * fMSX loads files FMPAC.ROM, MSXDOS2.ROM, and PAINTER.ROM automatically, as long as they are in the program directory and there is an empty cartridge slot available. * Added support for ASCII/8kB cartridges with 8kB SRAM (Xanadu, Royal Blood). Please, inform me if this has broken support for any "normal" ASCII/8kB cartridges. * Added support for ASCII/16kB cartridges with 2kB SRAM (Hydlide 2). Please, inform me if this has broken support for any "normal" ASCII/16kB cartridges. * All battery-backed SRAM save files have now got .SAV extension. For example, GameMaster2.rom will produce a SRAM file named GameMaster2.sav. * Added reporting of bad memory writes with -verbose 8. * The R-Type cartridge and its variants are supported by the ASCII/16kB MegaROM mapper (-rom 5). * HAL's Hole In One Special cartridge is supported by the GENERIC/16kB MegaROM mapper (-rom 1). * Konami's Majutsushi (aka Mah Jong 2 or RC765) cartridge is supported by the GENERIC/8kB MegaROM mapper (-rom 0), although the D/A audio circuit emulation is not implemented. * Added fast-forwarding option ([F9]) and moved fixed font switch to a different key ([CONTROL]-[F9]). * Changed [F6],[F9],[F10] assignments in fMSX-Windows to comply with other fMSX ports. * Added Options menu to fMSX-Windows. * fMSX-FreeBSD now compiles without changes on FreeBSD 5.x (FreeBSD 4.x users may have to change the location of the soundcart.h). * Fixed sound in fMSX-FreeBSD by increasing the number of sound fragments from 8 to 64. If any of FreeBSD developers are reading this, could you explain why this is needed? New in fMSX 2.7 * Switched to the latest version of the OpenWatcom C/C++ compiler. * The infamous Windows problem with spaces in directory names seems to be fixed by using a newer compiler. * Made some arrays "const" to facilitate porting to run-from-ROM platforms (cellphones, PDAs, etc.). * Joystick problems in fMSX-Windows are fixed. * Descreased the default sound volume in fMSX-Unix. * Increased the default wave synthesis frequency to 44.1kHz. * Minor fixes to the Unix sound drivers. * Removed MIDI volume control from Windows sound drivers. * Added TV raster effect to fMSX-Windows. New in fMSX 2.6 * Added separate (and correct) emulation for the i8255 PPI chip. * Added masking to lower bits of video table addresses. * Added timing and other fixes to the Z80 core (courtesy of Omar Cornut). * Fixed line coincidence and VBlank handling (thanks to Vincent van Dam). * Save state (.STA) file format has changed. * Fixed a bug that messed up screen table addresses when restoring state. * Fixed a bug that left dummy memory page dirty when loading GZIPped ROMs. * Fixed a -home option bug on Solaris (thanks to Eric Boon). * Fixed fMSX-Unix to allow it to have an application icon under WindowMaker. New in fMSX 2.5 * Added emulation state saving and loading. * Added support for GZIPped ROM files and state file. * Changed keyboard handler in fMSX-Unix. Hopefully, the key assignments should now be more natural. * Added sound on/off switch to fMSX-Unix and fMSX-MSDOS. * Keyboard assignments changed everywhere.
2009-06-14Remove @dirrm entries from PLISTsjoerg1-2/+1
2008-03-03Mechanical changes to add DESTDIR support to packages that installjlam1-6/+8
their files via a custom do-install target.
2007-02-22Whitespace cleanup, courtesy of pkglint.wiz1-2/+2
Patch provided by Sergey Svishchev in private mail.
2007-02-19Modular Xorg support.joerg1-3/+3
2006-10-04Update MASTER_SITES and/or HOMEPAGE, from Sergey Svishchev.wiz1-3/+3
2006-04-22Removed the superfluous "quotes" and 'quotes' from variables that don'trillig1-2/+2
need them, for example RESTRICTED and SUBST_MESSAGE.*.
2006-03-04Point MAINTAINER to pkgsrc-users@NetBSD.org in the case where nojlam1-2/+2
developer is officially maintaining the package. The rationale for changing this from "tech-pkg" to "pkgsrc-users" is that it implies that any user can try to maintain the package (by submitting patches to the mailing list). Since the folks most likely to care about the package are the folks that want to use it or are already using it, this would leverage the energy of users who aren't developers.
2006-02-05Recursive revision bump / recommended bump for gettext ABI change.joerg1-1/+2
2006-01-15Use sun audio only on NetBSD and SunOS. Link with LIBOSSAUDIO.joerg4-10/+31
Add DragonFly support.
2005-12-11Fixed the build error introduced by the late pkglint patch by quotingrillig1-3/+3
the -D defines in the DEFS variable correctly.
2005-12-05Fixed pkglint warnings. The warnings are mostly quoting issues, forrillig1-2/+2
example MAKE_ENV+=FOO=${BAR} is changed to MAKE_ENV+=FOO=${BAR:Q}. Some other changes are outlined in http://mail-index.netbsd.org/tech-pkg/2005/12/02/0034.html
2005-06-16Create directories before installing files into them.jlam1-1/+3
2005-06-01Massive cleanup of buildlink3.mk and builtin.mk files in pkgsrc.jlam1-2/+3
Several changes are involved since they are all interrelated. These changes affect about 1000 files. The first major change is rewriting bsd.builtin.mk as well as all of the builtin.mk files to follow the new example in bsd.builtin.mk. The loop to include all of the builtin.mk files needed by the package is moved from bsd.builtin.mk and into bsd.buildlink3.mk. bsd.builtin.mk is now included by each of the individual builtin.mk files and provides some common logic for all of the builtin.mk files. Currently, this includes the computation for whether the native or pkgsrc version of the package is preferred. This causes USE_BUILTIN.* to be correctly set when one builtin.mk file includes another. The second major change is teach the builtin.mk files to consider files under ${LOCALBASE} to be from pkgsrc-controlled packages. Most of the builtin.mk files test for the presence of built-in software by checking for the existence of certain files, e.g. <pthread.h>, and we now assume that if that file is under ${LOCALBASE}, then it must be from pkgsrc. This modification is a nod toward LOCALBASE=/usr. The exceptions to this new check are the X11 distribution packages, which are handled specially as noted below. The third major change is providing builtin.mk and version.mk files for each of the X11 distribution packages in pkgsrc. The builtin.mk file can detect whether the native X11 distribution is the same as the one provided by pkgsrc, and the version.mk file computes the version of the X11 distribution package, whether it's built-in or not. The fourth major change is that the buildlink3.mk files for X11 packages that install parts which are part of X11 distribution packages, e.g. Xpm, Xcursor, etc., now use imake to query the X11 distribution for whether the software is already provided by the X11 distribution. This is more accurate than grepping for a symbol name in the imake config files. Using imake required sprinkling various builtin-imake.mk helper files into pkgsrc directories. These files are used as input to imake since imake can't use stdin for that purpose. The fifth major change is in how packages note that they use X11. Instead of setting USE_X11, package Makefiles should now include x11.buildlink3.mk instead. This causes the X11 package buildlink3 and builtin logic to be executed at the correct place for buildlink3.mk and builtin.mk files that previously set USE_X11, and fixes packages that relied on buildlink3.mk files to implicitly note that X11 is needed. Package buildlink3.mk should also include x11.buildlink3.mk when linking against the package libraries requires also linking against the X11 libraries. Where it was obvious, redundant inclusions of x11.buildlink3.mk have been removed.
2005-03-13Back previous, irrelevant quoting fix.uebayasi1-3/+3
2005-03-07Fix quoting.uebayasi1-3/+3
2005-02-23Add RMD160 digests to the SHA1 onesagc1-1/+2
2004-11-27Drop maintainership.martin1-2/+2
2004-01-20Move WRKSRC definition away from the first paragraph in a Makefile.agc1-2/+2
2003-07-17s/netbsd.org/NetBSD.org/grant1-2/+2
2003-03-29Place WRKSRC where it belongs, to make pkglint happy; ok'ed by wiz.jmmv1-3/+2
2001-10-31Move pkg/ files into package's toplevel directoryzuntum2-1/+1
2001-07-05remove a test that changed the way the package was built depending on DISPLAYperry1-5/+7
2001-06-03- updated to 2.4kei6-88/+170
New in This Version (2.4) As I now have five (!) different emulators to maintain in addition to my academic studies, I expect you, people, to look for bugs and fix them if possible. Please, submit your fixes and bug reports! * Small fix to the DI instruction. * Small fix to the HALT instruction. * Added -sync option to fMSX-MSDOS on public request. * Fixed PHYDIO DiskROM call (4010h) to return the number of remaining sectors in register B (thanks, Maarten!). * Fixed ASCII mappers to prevent memory corruption when switching ROM pages in disconnected slots. * Fixed palette to span to true white. * Added SetWave() call to the sound API. * SCC emulation now makes use of waveforms via SetWave(). * SCC gets silenced when 0 frequency is written (thanks, Maarten!). * Fixed SCC+ emulation. * Vertical screen adjustment is only computed once, when refresh starts. * Moved picture 10 pixels down when the screen is 192 pixels high. * Removed unused SprCol variable. * Added wave synthesis sound to fMSX-Windows. * Fixed fMSX-MSDOS to restore palette when exiting the debugger. New in fMSX 2.3 * Now, when you buy fMSX-Windows, you also fMSX-MSDOS. * Added modular FMPAC (aka YM2413 aka OPLL) emulation. * FMPAC soundtrack can be logged into a MIDI file. * Sound and MIDI logging APIs have been integrated and rewritten to accomodate MIDI instruments, dynamic instrument changes, drum usage, etc. * Added PAL/NTSC switch on a bit in VDP[9] (thanks, Alex!). * Added support for the overscan (Mantra demos and games run now). * Added sprite support to SCREEN3 (no idea why it was not there). * Added support for YJK (SCREEN12) and YAE (SCREEN10/11) screens. * Added separate handling for IE0 and IE1 IRQs (Xevious, etc.). * Added masking of Character Table address (SourceOfPower demo runs now). * Fixed Z80 interrupt handling after EI (thanks, Maarten!). * IE0 and IE1 IRQs are now reset when disabled. * IE0 IRQ is now set when enabled. * Palette sequencer now resets when writing to VDP[16]. * Fixed mapper #1 to support generic 16kB-paged MegaROMs (HoleInOneSpecial). * Fixed cartridge loader to correctly load MegaROMs with "AB" signature in the last 16kB page (R-Type). * Mappers #0 and #1 are now renamed to Generic/8kB and Generic/16kB. * Fixed mapper #3 to have hardwired ROM at addresses 4000h-5FFFh (thanks, Sean!). * Added mapper #6 that corresponds to the Konami GameMaster2 cartridge with SRAM (thanks again, Sean!). * Added key click and motor relay click emulation via Drum() call. * Major rewrite of the sound drivers and sound logging system. * Added mouse emulation to fMSX-MSDOS. * Added border emulation via VGA border to fMSX-MSDOS. * Added built-in debugger to fMSX-MSDOS (F11). * Fixed static palette in fMSX-MSDOS. * Fixed fMSX-Unix to work in 24BPP and 32BPP modes. * Added static palette to fMSX-Unix. * Minor fixes to fMSX-Unix makefile. * fMSX-Windows now runs in 16BPP HiColor mode. * Changed Setup Panel in fMSX-Windows. * HPeriod and VPeriod scrollbars are gone from fMSX-Windows as timing control is done automatically. * PAL and NTSC buttons are gone from fMSX-Windows as PAL/NTSC switch is done automatically. - minor inprovements or modifies. It is now selectable if use sun-compatible sound or ossaudio by defining USE_SUN_AUDIO to YES or NO in /etc/mk.conf (default YES) XXX Though it can be build in both conditions, sound still doesn't work properly. On my macppc box, if USE_SUN_AUDIO to YES, it generates continuous hum and nothing changes by play command in BASIC interpreter within the emulator. if set it to NO, it keeps quiet. cleanup package Makefile some.
2001-04-20Move to sha1 digests, and add distfile sizes.agc1-2/+3
2001-04-17+ move the distfile digest/checksum value from files/md5 to distinfoagc3-9/+7
+ move the patch digest/checksum values from files/patch-sum to distinfo
2001-02-25Cleanup MKDIR usage => INSTALL_*_DIRhubertf1-5/+5
XXX need to teach pkglint to be more picky about this
2001-02-17Update to new COMMENT style: COMMENT var in Makefile instead of pkg/COMMENT.wiz2-2/+2
2000-08-18Replace MIRROR_DISTFILES and NO_CDROM with the more descriptive andhubertf1-2/+1
more fine-grained NO_{BIN,SRC}_ON_{FTP,CDROM} definitions. MIRROR_DISTFILES and NO_CDROM are now dead.
2000-08-06Update to 2.2. Enable sound.wiz7-46/+48
Changes since last version (2.1): * Interrupt system rewritten. * Mapper management rewritten. * Keyboard assignments changed again. Check the documentation! * Made a new MSDOS port of fMSX (still in development). * Integrated modular AY8910 emulation. * Integrated modular SCC emulation. * Integrated SndUnix/SndWin/SndMSDOS sound drivers. * Sound track is now logged to MIDI files. * Added a table of I/O handler functions to Z80 core for easy expansion. * Added ability to load flat (no mapper) 64kB ROMs. * Added automatic MegaROM mapper guessing (-rom 6). * Added standard PAL/NTSC timings. * Added V9958 version flag in MSX2+ mode (VDP S1). * Added correct emulation of HR/VR flags (VDP S2). * Fixed border color in SCREEN8 (VDP R7). * Fixed blinking frequency in TEXT80 (VDP R13). * Added ADJUST register emulation (VDP R18). * Added V9938 character scrolling to SCREEN0 and TEXT80 (VDP R23). * Added scrolling to SCREEN1, SCREEN2, and SCREEN3 (VDP R23). * Fixed scrolling bug in SCREEN6 and SCREEN7 (VDP R23). * Made left/right borders 9/7 pixels in SCREEN0 and TEXT80. * Added -home option to tell fMSX where to find system ROMs. * Added -auto option for auto fire on pressing SPACE. * Fixed information printed on -help. * Fixed crash in fMSX-Windows when switching from 8kB to 16kB MegaROMs. * Fixed trash in MSX2 logo in fMSX-Windows that appeared after reset. * Better resizing in fMSX-Windows Setup panel.
2000-07-28fMSX is a portable emulator of MSX home computers written in C.martin10-0/+263
This pkg was submitted by SUNAGAWA Keiki in PR pkg/6731, modified slightly by me.