Repository: jquesnelle/nds4droid
Branch: master
Commit: c7b72507569b
Files: 1931
Total size: 17.0 MB
Directory structure:
gitextract_wy7erldf/
├── .gitignore
├── .idea/
│ ├── gradle.xml
│ └── runConfigurations.xml
├── LICENSE
├── README.md
├── app/
│ ├── build.gradle
│ ├── libs/
│ │ └── ouya-sdk.jar
│ ├── lint.xml
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ ├── java/
│ │ └── com/
│ │ └── opendoorstudios/
│ │ └── ds4droid/
│ │ ├── About.java
│ │ ├── Button.java
│ │ ├── ButtonLayoutEditor.java
│ │ ├── Cheats.java
│ │ ├── Controls.java
│ │ ├── DeSmuME.java
│ │ ├── EmulatorThread.java
│ │ ├── FileDialog.java
│ │ ├── KeyMapPreference.java
│ │ ├── KeyMapSettings.java
│ │ ├── MainActivity.java
│ │ ├── NDSScanner/
│ │ │ ├── CollectionActivity.java
│ │ │ ├── NdsRom.java
│ │ │ ├── RomCollection.java
│ │ │ └── RomDatabaseHelper.java
│ │ ├── Settings.java
│ │ ├── SliderPreference.java
│ │ ├── TransparencyPreference.java
│ │ └── ds4droidApplication.java
│ ├── jni/
│ │ ├── Android.mk
│ │ ├── Application.mk
│ │ ├── android-ndk-profiler/
│ │ │ ├── Android.mk
│ │ │ ├── armeabi/
│ │ │ │ └── libandroid-ndk-profiler.a
│ │ │ ├── armeabi-v7a/
│ │ │ │ └── libandroid-ndk-profiler.a
│ │ │ └── prof.h
│ │ ├── cpudetect/
│ │ │ ├── cpu.cpp
│ │ │ └── cpudetect.mk
│ │ ├── desmume/
│ │ │ ├── AUTHORS
│ │ │ ├── COPYING
│ │ │ ├── ChangeLog
│ │ │ ├── INSTALL
│ │ │ ├── Makefile.am
│ │ │ ├── Makefile.in
│ │ │ ├── NEWS
│ │ │ ├── README
│ │ │ ├── README.LIN
│ │ │ ├── README.MAC
│ │ │ ├── README.WIN
│ │ │ ├── aclocal.m4
│ │ │ ├── autogen.sh
│ │ │ ├── compile
│ │ │ ├── config.guess
│ │ │ ├── config.sub
│ │ │ ├── configure
│ │ │ ├── configure.ac
│ │ │ ├── depcomp
│ │ │ ├── dsm.txt
│ │ │ ├── dsv.txt
│ │ │ ├── install-sh
│ │ │ ├── missing
│ │ │ ├── src/
│ │ │ │ ├── ArmAnalyze.cpp
│ │ │ │ ├── ArmAnalyze.h
│ │ │ │ ├── ArmAnalyze_tabdef.inc
│ │ │ │ ├── ArmCJit.cpp
│ │ │ │ ├── ArmCJit.h
│ │ │ │ ├── ArmLJit.cpp
│ │ │ │ ├── ArmLJit.h
│ │ │ │ ├── ArmThreadedInterpreter.cpp
│ │ │ │ ├── ArmThreadedInterpreter.h
│ │ │ │ ├── CpuBase.cpp
│ │ │ │ ├── CpuBase.h
│ │ │ │ ├── Disassembler.cpp
│ │ │ │ ├── Disassembler.h
│ │ │ │ ├── FIFO.cpp
│ │ │ │ ├── FIFO.h
│ │ │ │ ├── GPU.cpp
│ │ │ │ ├── GPU.h
│ │ │ │ ├── GPU_osd.cpp
│ │ │ │ ├── GPU_osd.h
│ │ │ │ ├── GPU_osd_stub.cpp
│ │ │ │ ├── JitCommon.cpp
│ │ │ │ ├── JitCommon.h
│ │ │ │ ├── MMU.cpp
│ │ │ │ ├── MMU.h
│ │ │ │ ├── MMU_timing.h
│ │ │ │ ├── Makefile.am
│ │ │ │ ├── Makefile.in
│ │ │ │ ├── NDSSystem.cpp
│ │ │ │ ├── NDSSystem.h
│ │ │ │ ├── OGLES2Render.cpp
│ │ │ │ ├── OGLES2Render.h
│ │ │ │ ├── OGLRender.cpp
│ │ │ │ ├── OGLRender.h
│ │ │ │ ├── OGLRender_3_2.cpp
│ │ │ │ ├── OGLRender_3_2.h
│ │ │ │ ├── PACKED.h
│ │ │ │ ├── PACKED_END.h
│ │ │ │ ├── ROMReader.cpp
│ │ │ │ ├── ROMReader.h
│ │ │ │ ├── SPU.cpp
│ │ │ │ ├── SPU.h
│ │ │ │ ├── addons/
│ │ │ │ │ ├── slot1_none.cpp
│ │ │ │ │ ├── slot1_r4.cpp
│ │ │ │ │ ├── slot1_retail.cpp
│ │ │ │ │ ├── slot1_retail_nand.cpp
│ │ │ │ │ ├── slot2_expMemory.cpp
│ │ │ │ │ ├── slot2_gbagame.cpp
│ │ │ │ │ ├── slot2_guitarGrip.cpp
│ │ │ │ │ ├── slot2_mpcf.cpp
│ │ │ │ │ ├── slot2_none.cpp
│ │ │ │ │ ├── slot2_paddle.cpp
│ │ │ │ │ ├── slot2_piano.cpp
│ │ │ │ │ └── slot2_rumblepak.cpp
│ │ │ │ ├── addons.cpp
│ │ │ │ ├── addons.h
│ │ │ │ ├── agg2d.h
│ │ │ │ ├── agg2d.inl
│ │ │ │ ├── aggdraw.cpp
│ │ │ │ ├── aggdraw.h
│ │ │ │ ├── android/
│ │ │ │ │ ├── 7z/
│ │ │ │ │ │ ├── 7z.mk
│ │ │ │ │ │ ├── Asm/
│ │ │ │ │ │ │ ├── x64/
│ │ │ │ │ │ │ │ └── 7zCrcT8U.asm
│ │ │ │ │ │ │ └── x86/
│ │ │ │ │ │ │ └── 7zCrcT8U.asm
│ │ │ │ │ │ ├── C/
│ │ │ │ │ │ │ ├── 7zCrc.c
│ │ │ │ │ │ │ ├── 7zCrc.h
│ │ │ │ │ │ │ ├── 7zCrcT8.c
│ │ │ │ │ │ │ ├── 7zVersion.h
│ │ │ │ │ │ │ ├── Aes.c
│ │ │ │ │ │ │ ├── Aes.h
│ │ │ │ │ │ │ ├── Alloc.h
│ │ │ │ │ │ │ ├── Bra.c
│ │ │ │ │ │ │ ├── Bra.h
│ │ │ │ │ │ │ ├── Bra86.c
│ │ │ │ │ │ │ ├── BraIA64.c
│ │ │ │ │ │ │ ├── BwtSort.c
│ │ │ │ │ │ │ ├── BwtSort.h
│ │ │ │ │ │ │ ├── CpuArch.h
│ │ │ │ │ │ │ ├── HuffEnc.c
│ │ │ │ │ │ │ ├── HuffEnc.h
│ │ │ │ │ │ │ ├── LzFind.c
│ │ │ │ │ │ │ ├── LzFind.h
│ │ │ │ │ │ │ ├── LzFindMt.c
│ │ │ │ │ │ │ ├── LzFindMt.h
│ │ │ │ │ │ │ ├── LzHash.h
│ │ │ │ │ │ │ ├── LzmaDec.c
│ │ │ │ │ │ │ ├── LzmaDec.h
│ │ │ │ │ │ │ ├── LzmaEnc.c
│ │ │ │ │ │ │ ├── LzmaEnc.h
│ │ │ │ │ │ │ ├── LzmaUtil/
│ │ │ │ │ │ │ │ ├── Lzma86Dec.c
│ │ │ │ │ │ │ │ ├── Lzma86Dec.h
│ │ │ │ │ │ │ │ ├── Lzma86Enc.c
│ │ │ │ │ │ │ │ └── Lzma86Enc.h
│ │ │ │ │ │ │ ├── RotateDefs.h
│ │ │ │ │ │ │ ├── Sha256.c
│ │ │ │ │ │ │ ├── Sha256.h
│ │ │ │ │ │ │ ├── Sort.c
│ │ │ │ │ │ │ ├── Sort.h
│ │ │ │ │ │ │ ├── Threads.c
│ │ │ │ │ │ │ ├── Threads.h
│ │ │ │ │ │ │ └── Types.h
│ │ │ │ │ │ ├── CPP/
│ │ │ │ │ │ │ ├── 7zip/
│ │ │ │ │ │ │ │ ├── Archive/
│ │ │ │ │ │ │ │ │ ├── 7z/
│ │ │ │ │ │ │ │ │ │ ├── 7zCompressionMode.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zCompressionMode.h
│ │ │ │ │ │ │ │ │ │ ├── 7zDecode.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zDecode.h
│ │ │ │ │ │ │ │ │ │ ├── 7zEncode.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zEncode.h
│ │ │ │ │ │ │ │ │ │ ├── 7zExtract.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zFolderInStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zFolderInStream.h
│ │ │ │ │ │ │ │ │ │ ├── 7zFolderOutStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zFolderOutStream.h
│ │ │ │ │ │ │ │ │ │ ├── 7zHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zHandler.h
│ │ │ │ │ │ │ │ │ │ ├── 7zHandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zHeader.h
│ │ │ │ │ │ │ │ │ │ ├── 7zIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zIn.h
│ │ │ │ │ │ │ │ │ │ ├── 7zItem.h
│ │ │ │ │ │ │ │ │ │ ├── 7zOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zOut.h
│ │ │ │ │ │ │ │ │ │ ├── 7zProperties.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zProperties.h
│ │ │ │ │ │ │ │ │ │ ├── 7zRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zSpecStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── 7zSpecStream.h
│ │ │ │ │ │ │ │ │ │ ├── 7zUpdate.cpp
│ │ │ │ │ │ │ │ │ │ └── 7zUpdate.h
│ │ │ │ │ │ │ │ │ ├── ArchiveExports.cpp
│ │ │ │ │ │ │ │ │ ├── ArjHandler.cpp
│ │ │ │ │ │ │ │ │ ├── BZip2/
│ │ │ │ │ │ │ │ │ │ ├── BZip2Handler.cpp
│ │ │ │ │ │ │ │ │ │ ├── BZip2Handler.h
│ │ │ │ │ │ │ │ │ │ ├── BZip2HandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── BZip2Item.h
│ │ │ │ │ │ │ │ │ │ ├── BZip2Update.cpp
│ │ │ │ │ │ │ │ │ │ ├── BZip2Update.h
│ │ │ │ │ │ │ │ │ │ └── bz2Register.cpp
│ │ │ │ │ │ │ │ │ ├── Cab/
│ │ │ │ │ │ │ │ │ │ ├── CabBlockInStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── CabBlockInStream.h
│ │ │ │ │ │ │ │ │ │ ├── CabHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── CabHandler.h
│ │ │ │ │ │ │ │ │ │ ├── CabHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── CabHeader.h
│ │ │ │ │ │ │ │ │ │ ├── CabIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── CabIn.h
│ │ │ │ │ │ │ │ │ │ ├── CabItem.h
│ │ │ │ │ │ │ │ │ │ └── CabRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Chm/
│ │ │ │ │ │ │ │ │ │ ├── ChmHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── ChmHandler.h
│ │ │ │ │ │ │ │ │ │ ├── ChmHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── ChmHeader.h
│ │ │ │ │ │ │ │ │ │ ├── ChmIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── ChmIn.h
│ │ │ │ │ │ │ │ │ │ └── ChmRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Com/
│ │ │ │ │ │ │ │ │ │ ├── ComHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── ComHandler.h
│ │ │ │ │ │ │ │ │ │ ├── ComIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── ComIn.h
│ │ │ │ │ │ │ │ │ │ └── ComRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Common/
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2.cpp
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2.h
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2MT.cpp
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2MT.h
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2ST.cpp
│ │ │ │ │ │ │ │ │ │ ├── CoderMixer2ST.h
│ │ │ │ │ │ │ │ │ │ ├── CrossThreadProgress.cpp
│ │ │ │ │ │ │ │ │ │ ├── CrossThreadProgress.h
│ │ │ │ │ │ │ │ │ │ ├── DummyOutStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── DummyOutStream.h
│ │ │ │ │ │ │ │ │ │ ├── FindSignature.cpp
│ │ │ │ │ │ │ │ │ │ ├── FindSignature.h
│ │ │ │ │ │ │ │ │ │ ├── HandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── HandlerOut.h
│ │ │ │ │ │ │ │ │ │ ├── InStreamWithCRC.cpp
│ │ │ │ │ │ │ │ │ │ ├── InStreamWithCRC.h
│ │ │ │ │ │ │ │ │ │ ├── ItemNameUtils.cpp
│ │ │ │ │ │ │ │ │ │ ├── ItemNameUtils.h
│ │ │ │ │ │ │ │ │ │ ├── MultiStream.cpp
│ │ │ │ │ │ │ │ │ │ ├── MultiStream.h
│ │ │ │ │ │ │ │ │ │ ├── OutStreamWithCRC.cpp
│ │ │ │ │ │ │ │ │ │ ├── OutStreamWithCRC.h
│ │ │ │ │ │ │ │ │ │ ├── OutStreamWithSha1.cpp
│ │ │ │ │ │ │ │ │ │ ├── OutStreamWithSha1.h
│ │ │ │ │ │ │ │ │ │ ├── ParseProperties.cpp
│ │ │ │ │ │ │ │ │ │ └── ParseProperties.h
│ │ │ │ │ │ │ │ │ ├── Cpio/
│ │ │ │ │ │ │ │ │ │ ├── CpioHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── CpioHandler.h
│ │ │ │ │ │ │ │ │ │ ├── CpioHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── CpioHeader.h
│ │ │ │ │ │ │ │ │ │ ├── CpioIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── CpioIn.h
│ │ │ │ │ │ │ │ │ │ ├── CpioItem.h
│ │ │ │ │ │ │ │ │ │ └── CpioRegister.cpp
│ │ │ │ │ │ │ │ │ ├── DebHandler.cpp
│ │ │ │ │ │ │ │ │ ├── DllExports2.cpp
│ │ │ │ │ │ │ │ │ ├── DmgHandler.cpp
│ │ │ │ │ │ │ │ │ ├── ElfHandler.cpp
│ │ │ │ │ │ │ │ │ ├── GZip/
│ │ │ │ │ │ │ │ │ │ ├── GZipHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipHandler.h
│ │ │ │ │ │ │ │ │ │ ├── GZipHandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipHeader.h
│ │ │ │ │ │ │ │ │ │ ├── GZipIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipIn.h
│ │ │ │ │ │ │ │ │ │ ├── GZipItem.h
│ │ │ │ │ │ │ │ │ │ ├── GZipOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipOut.h
│ │ │ │ │ │ │ │ │ │ ├── GZipRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── GZipUpdate.cpp
│ │ │ │ │ │ │ │ │ │ └── GZipUpdate.h
│ │ │ │ │ │ │ │ │ ├── Hfs/
│ │ │ │ │ │ │ │ │ │ ├── HfsHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── HfsHandler.h
│ │ │ │ │ │ │ │ │ │ ├── HfsIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── HfsIn.h
│ │ │ │ │ │ │ │ │ │ └── HfsRegister.cpp
│ │ │ │ │ │ │ │ │ ├── IArchive.h
│ │ │ │ │ │ │ │ │ ├── Iso/
│ │ │ │ │ │ │ │ │ │ ├── IsoHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── IsoHandler.h
│ │ │ │ │ │ │ │ │ │ ├── IsoHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── IsoHeader.h
│ │ │ │ │ │ │ │ │ │ ├── IsoIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── IsoIn.h
│ │ │ │ │ │ │ │ │ │ ├── IsoItem.h
│ │ │ │ │ │ │ │ │ │ └── IsoRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Lzh/
│ │ │ │ │ │ │ │ │ │ ├── LzhCRC.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzhCRC.h
│ │ │ │ │ │ │ │ │ │ ├── LzhHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzhHandler.h
│ │ │ │ │ │ │ │ │ │ ├── LzhHeader.h
│ │ │ │ │ │ │ │ │ │ ├── LzhIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzhIn.h
│ │ │ │ │ │ │ │ │ │ ├── LzhItem.h
│ │ │ │ │ │ │ │ │ │ ├── LzhOutStreamWithCRC.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzhOutStreamWithCRC.h
│ │ │ │ │ │ │ │ │ │ └── LzhRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Lzma/
│ │ │ │ │ │ │ │ │ │ ├── LzmaArcRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaFiltersDecode.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaFiltersDecode.h
│ │ │ │ │ │ │ │ │ │ ├── LzmaHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaHandler.h
│ │ │ │ │ │ │ │ │ │ ├── LzmaIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaIn.h
│ │ │ │ │ │ │ │ │ │ └── LzmaItem.h
│ │ │ │ │ │ │ │ │ ├── MachoHandler.cpp
│ │ │ │ │ │ │ │ │ ├── MubHandler.cpp
│ │ │ │ │ │ │ │ │ ├── Nsis/
│ │ │ │ │ │ │ │ │ │ ├── NsisDecode.cpp
│ │ │ │ │ │ │ │ │ │ ├── NsisDecode.h
│ │ │ │ │ │ │ │ │ │ ├── NsisHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── NsisHandler.h
│ │ │ │ │ │ │ │ │ │ ├── NsisIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── NsisIn.h
│ │ │ │ │ │ │ │ │ │ └── NsisRegister.cpp
│ │ │ │ │ │ │ │ │ ├── PeHandler.cpp
│ │ │ │ │ │ │ │ │ ├── Rar/
│ │ │ │ │ │ │ │ │ │ ├── RarHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── RarHandler.h
│ │ │ │ │ │ │ │ │ │ ├── RarHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── RarHeader.h
│ │ │ │ │ │ │ │ │ │ ├── RarIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── RarIn.h
│ │ │ │ │ │ │ │ │ │ ├── RarItem.cpp
│ │ │ │ │ │ │ │ │ │ ├── RarItem.h
│ │ │ │ │ │ │ │ │ │ ├── RarRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── RarVolumeInStream.cpp
│ │ │ │ │ │ │ │ │ │ └── RarVolumeInStream.h
│ │ │ │ │ │ │ │ │ ├── RpmHandler.cpp
│ │ │ │ │ │ │ │ │ ├── Split/
│ │ │ │ │ │ │ │ │ │ ├── SplitHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── SplitHandler.h
│ │ │ │ │ │ │ │ │ │ ├── SplitHandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ └── SplitRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Tar/
│ │ │ │ │ │ │ │ │ │ ├── TarHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarHandler.h
│ │ │ │ │ │ │ │ │ │ ├── TarHandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarHeader.h
│ │ │ │ │ │ │ │ │ │ ├── TarIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarIn.h
│ │ │ │ │ │ │ │ │ │ ├── TarItem.h
│ │ │ │ │ │ │ │ │ │ ├── TarOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarOut.h
│ │ │ │ │ │ │ │ │ │ ├── TarRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── TarUpdate.cpp
│ │ │ │ │ │ │ │ │ │ └── TarUpdate.h
│ │ │ │ │ │ │ │ │ ├── Udf/
│ │ │ │ │ │ │ │ │ │ ├── UdfHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── UdfHandler.h
│ │ │ │ │ │ │ │ │ │ ├── UdfIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── UdfIn.h
│ │ │ │ │ │ │ │ │ │ └── UdfRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Wim/
│ │ │ │ │ │ │ │ │ │ ├── WimHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── WimHandler.h
│ │ │ │ │ │ │ │ │ │ ├── WimIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── WimIn.h
│ │ │ │ │ │ │ │ │ │ └── WimRegister.cpp
│ │ │ │ │ │ │ │ │ ├── XarHandler.cpp
│ │ │ │ │ │ │ │ │ ├── ZHandler.cpp
│ │ │ │ │ │ │ │ │ ├── Zip/
│ │ │ │ │ │ │ │ │ │ ├── ZipAddCommon.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipAddCommon.h
│ │ │ │ │ │ │ │ │ │ ├── ZipCompressionMode.h
│ │ │ │ │ │ │ │ │ │ ├── ZipHandler.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipHandler.h
│ │ │ │ │ │ │ │ │ │ ├── ZipHandlerOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipHeader.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipHeader.h
│ │ │ │ │ │ │ │ │ │ ├── ZipIn.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipIn.h
│ │ │ │ │ │ │ │ │ │ ├── ZipItem.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipItem.h
│ │ │ │ │ │ │ │ │ │ ├── ZipItemEx.h
│ │ │ │ │ │ │ │ │ │ ├── ZipOut.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipOut.h
│ │ │ │ │ │ │ │ │ │ ├── ZipRegister.cpp
│ │ │ │ │ │ │ │ │ │ ├── ZipUpdate.cpp
│ │ │ │ │ │ │ │ │ │ └── ZipUpdate.h
│ │ │ │ │ │ │ │ │ └── obj/
│ │ │ │ │ │ │ │ │ └── local/
│ │ │ │ │ │ │ │ │ └── armeabi-v7a/
│ │ │ │ │ │ │ │ │ ├── app_process
│ │ │ │ │ │ │ │ │ ├── gdb.setup
│ │ │ │ │ │ │ │ │ └── linker
│ │ │ │ │ │ │ │ ├── Bundles/
│ │ │ │ │ │ │ │ │ ├── Alone/
│ │ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ │ ├── Alone7z/
│ │ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ │ ├── AloneGCOV/
│ │ │ │ │ │ │ │ │ │ └── makefile
│ │ │ │ │ │ │ │ │ ├── Format7zFree/
│ │ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ │ └── SFXCon/
│ │ │ │ │ │ │ │ │ ├── Main.cpp
│ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ ├── CMAKE/
│ │ │ │ │ │ │ │ │ ├── CMakeLists_Alone.txt
│ │ │ │ │ │ │ │ │ └── generate.sh
│ │ │ │ │ │ │ │ ├── Common/
│ │ │ │ │ │ │ │ │ ├── CreateCoder.cpp
│ │ │ │ │ │ │ │ │ ├── CreateCoder.h
│ │ │ │ │ │ │ │ │ ├── FilePathAutoRename.cpp
│ │ │ │ │ │ │ │ │ ├── FilePathAutoRename.h
│ │ │ │ │ │ │ │ │ ├── FileStreams.cpp
│ │ │ │ │ │ │ │ │ ├── FileStreams.h
│ │ │ │ │ │ │ │ │ ├── FilterCoder.cpp
│ │ │ │ │ │ │ │ │ ├── FilterCoder.h
│ │ │ │ │ │ │ │ │ ├── InBuffer.cpp
│ │ │ │ │ │ │ │ │ ├── InBuffer.h
│ │ │ │ │ │ │ │ │ ├── InOutTempBuffer.cpp
│ │ │ │ │ │ │ │ │ ├── InOutTempBuffer.h
│ │ │ │ │ │ │ │ │ ├── LimitedStreams.cpp
│ │ │ │ │ │ │ │ │ ├── LimitedStreams.h
│ │ │ │ │ │ │ │ │ ├── LockedStream.cpp
│ │ │ │ │ │ │ │ │ ├── LockedStream.h
│ │ │ │ │ │ │ │ │ ├── MSBFDecoder.h
│ │ │ │ │ │ │ │ │ ├── MSBFEncoder.h
│ │ │ │ │ │ │ │ │ ├── MemBlocks.cpp
│ │ │ │ │ │ │ │ │ ├── MemBlocks.h
│ │ │ │ │ │ │ │ │ ├── MethodId.cpp
│ │ │ │ │ │ │ │ │ ├── MethodId.h
│ │ │ │ │ │ │ │ │ ├── MethodProps.cpp
│ │ │ │ │ │ │ │ │ ├── MethodProps.h
│ │ │ │ │ │ │ │ │ ├── OffsetStream.cpp
│ │ │ │ │ │ │ │ │ ├── OffsetStream.h
│ │ │ │ │ │ │ │ │ ├── OutBuffer.cpp
│ │ │ │ │ │ │ │ │ ├── OutBuffer.h
│ │ │ │ │ │ │ │ │ ├── OutMemStream.cpp
│ │ │ │ │ │ │ │ │ ├── OutMemStream.h
│ │ │ │ │ │ │ │ │ ├── ProgressMt.cpp
│ │ │ │ │ │ │ │ │ ├── ProgressMt.h
│ │ │ │ │ │ │ │ │ ├── ProgressUtils.cpp
│ │ │ │ │ │ │ │ │ ├── ProgressUtils.h
│ │ │ │ │ │ │ │ │ ├── RegisterArc.h
│ │ │ │ │ │ │ │ │ ├── RegisterCodec.h
│ │ │ │ │ │ │ │ │ ├── StreamBinder.cpp
│ │ │ │ │ │ │ │ │ ├── StreamBinder.h
│ │ │ │ │ │ │ │ │ ├── StreamObjects.cpp
│ │ │ │ │ │ │ │ │ ├── StreamObjects.h
│ │ │ │ │ │ │ │ │ ├── StreamUtils.cpp
│ │ │ │ │ │ │ │ │ ├── StreamUtils.h
│ │ │ │ │ │ │ │ │ ├── VirtThread.cpp
│ │ │ │ │ │ │ │ │ └── VirtThread.h
│ │ │ │ │ │ │ │ ├── Compress/
│ │ │ │ │ │ │ │ │ ├── ArjDecoder1.cpp
│ │ │ │ │ │ │ │ │ ├── ArjDecoder1.h
│ │ │ │ │ │ │ │ │ ├── ArjDecoder2.cpp
│ │ │ │ │ │ │ │ │ ├── ArjDecoder2.h
│ │ │ │ │ │ │ │ │ ├── BZip2Const.h
│ │ │ │ │ │ │ │ │ ├── BZip2Crc.cpp
│ │ │ │ │ │ │ │ │ ├── BZip2Crc.h
│ │ │ │ │ │ │ │ │ ├── BZip2Decoder.cpp
│ │ │ │ │ │ │ │ │ ├── BZip2Decoder.h
│ │ │ │ │ │ │ │ │ ├── BZip2Encoder.cpp
│ │ │ │ │ │ │ │ │ ├── BZip2Encoder.h
│ │ │ │ │ │ │ │ │ ├── BZip2Register.cpp
│ │ │ │ │ │ │ │ │ ├── Bcj2Coder.cpp
│ │ │ │ │ │ │ │ │ ├── Bcj2Coder.h
│ │ │ │ │ │ │ │ │ ├── Bcj2Register.cpp
│ │ │ │ │ │ │ │ │ ├── BcjCoder.cpp
│ │ │ │ │ │ │ │ │ ├── BcjCoder.h
│ │ │ │ │ │ │ │ │ ├── BcjRegister.cpp
│ │ │ │ │ │ │ │ │ ├── BitlDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── BitlDecoder.h
│ │ │ │ │ │ │ │ │ ├── BitlEncoder.h
│ │ │ │ │ │ │ │ │ ├── BitmDecoder.h
│ │ │ │ │ │ │ │ │ ├── BitmEncoder.h
│ │ │ │ │ │ │ │ │ ├── BranchCoder.cpp
│ │ │ │ │ │ │ │ │ ├── BranchCoder.h
│ │ │ │ │ │ │ │ │ ├── BranchMisc.cpp
│ │ │ │ │ │ │ │ │ ├── BranchMisc.h
│ │ │ │ │ │ │ │ │ ├── BranchRegister.cpp
│ │ │ │ │ │ │ │ │ ├── ByteSwap.cpp
│ │ │ │ │ │ │ │ │ ├── ByteSwap.h
│ │ │ │ │ │ │ │ │ ├── ByteSwapRegister.cpp
│ │ │ │ │ │ │ │ │ ├── CodecExports.cpp
│ │ │ │ │ │ │ │ │ ├── CopyCoder.cpp
│ │ │ │ │ │ │ │ │ ├── CopyCoder.h
│ │ │ │ │ │ │ │ │ ├── CopyRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Deflate64Register.cpp
│ │ │ │ │ │ │ │ │ ├── DeflateConst.h
│ │ │ │ │ │ │ │ │ ├── DeflateDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── DeflateDecoder.h
│ │ │ │ │ │ │ │ │ ├── DeflateEncoder.cpp
│ │ │ │ │ │ │ │ │ ├── DeflateEncoder.h
│ │ │ │ │ │ │ │ │ ├── DeflateNsisRegister.cpp
│ │ │ │ │ │ │ │ │ ├── DeflateRegister.cpp
│ │ │ │ │ │ │ │ │ ├── DllExports.cpp
│ │ │ │ │ │ │ │ │ ├── DllExports2.cpp
│ │ │ │ │ │ │ │ │ ├── HuffmanDecoder.h
│ │ │ │ │ │ │ │ │ ├── ImplodeDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── ImplodeDecoder.h
│ │ │ │ │ │ │ │ │ ├── ImplodeHuffmanDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── ImplodeHuffmanDecoder.h
│ │ │ │ │ │ │ │ │ ├── LZMA_Alone/
│ │ │ │ │ │ │ │ │ │ ├── LzmaAlone.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaBench.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaBench.h
│ │ │ │ │ │ │ │ │ │ ├── LzmaBenchCon.cpp
│ │ │ │ │ │ │ │ │ │ ├── LzmaBenchCon.h
│ │ │ │ │ │ │ │ │ │ └── makefile
│ │ │ │ │ │ │ │ │ ├── LzOutWindow.cpp
│ │ │ │ │ │ │ │ │ ├── LzOutWindow.h
│ │ │ │ │ │ │ │ │ ├── LzhDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── LzhDecoder.h
│ │ │ │ │ │ │ │ │ ├── LzmaDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── LzmaDecoder.h
│ │ │ │ │ │ │ │ │ ├── LzmaEncoder.cpp
│ │ │ │ │ │ │ │ │ ├── LzmaEncoder.h
│ │ │ │ │ │ │ │ │ ├── LzmaRegister.cpp
│ │ │ │ │ │ │ │ │ ├── Lzx.h
│ │ │ │ │ │ │ │ │ ├── Lzx86Converter.cpp
│ │ │ │ │ │ │ │ │ ├── Lzx86Converter.h
│ │ │ │ │ │ │ │ │ ├── LzxDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── LzxDecoder.h
│ │ │ │ │ │ │ │ │ ├── Mtf8.h
│ │ │ │ │ │ │ │ │ ├── PPMD_Alone/
│ │ │ │ │ │ │ │ │ │ ├── PpmdAlone.cpp
│ │ │ │ │ │ │ │ │ │ └── makefile
│ │ │ │ │ │ │ │ │ ├── PpmdContext.h
│ │ │ │ │ │ │ │ │ ├── PpmdDecode.h
│ │ │ │ │ │ │ │ │ ├── PpmdDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── PpmdDecoder.h
│ │ │ │ │ │ │ │ │ ├── PpmdEncode.h
│ │ │ │ │ │ │ │ │ ├── PpmdEncoder.cpp
│ │ │ │ │ │ │ │ │ ├── PpmdEncoder.h
│ │ │ │ │ │ │ │ │ ├── PpmdRegister.cpp
│ │ │ │ │ │ │ │ │ ├── PpmdSubAlloc.h
│ │ │ │ │ │ │ │ │ ├── PpmdType.h
│ │ │ │ │ │ │ │ │ ├── QuantumDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── QuantumDecoder.h
│ │ │ │ │ │ │ │ │ ├── RangeCoder.h
│ │ │ │ │ │ │ │ │ ├── RangeCoderBit.h
│ │ │ │ │ │ │ │ │ ├── Rar/
│ │ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ │ ├── Rar1Decoder.cpp
│ │ │ │ │ │ │ │ │ ├── Rar1Decoder.h
│ │ │ │ │ │ │ │ │ ├── Rar2Decoder.cpp
│ │ │ │ │ │ │ │ │ ├── Rar2Decoder.h
│ │ │ │ │ │ │ │ │ ├── Rar3Decoder.cpp
│ │ │ │ │ │ │ │ │ ├── Rar3Decoder.h
│ │ │ │ │ │ │ │ │ ├── Rar3Vm.cpp
│ │ │ │ │ │ │ │ │ ├── Rar3Vm.h
│ │ │ │ │ │ │ │ │ ├── RarCodecsRegister.cpp
│ │ │ │ │ │ │ │ │ ├── ShrinkDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── ShrinkDecoder.h
│ │ │ │ │ │ │ │ │ ├── ZDecoder.cpp
│ │ │ │ │ │ │ │ │ ├── ZDecoder.h
│ │ │ │ │ │ │ │ │ ├── ZlibDecoder.cpp
│ │ │ │ │ │ │ │ │ └── ZlibDecoder.h
│ │ │ │ │ │ │ │ ├── Crypto/
│ │ │ │ │ │ │ │ │ ├── 7zAes.cpp
│ │ │ │ │ │ │ │ │ ├── 7zAes.h
│ │ │ │ │ │ │ │ │ ├── 7zAesRegister.cpp
│ │ │ │ │ │ │ │ │ ├── HmacSha1.cpp
│ │ │ │ │ │ │ │ │ ├── HmacSha1.h
│ │ │ │ │ │ │ │ │ ├── MyAes.cpp
│ │ │ │ │ │ │ │ │ ├── MyAes.h
│ │ │ │ │ │ │ │ │ ├── Pbkdf2HmacSha1.cpp
│ │ │ │ │ │ │ │ │ ├── Pbkdf2HmacSha1.h
│ │ │ │ │ │ │ │ │ ├── RandGen.cpp
│ │ │ │ │ │ │ │ │ ├── RandGen.h
│ │ │ │ │ │ │ │ │ ├── Rar20Crypto.cpp
│ │ │ │ │ │ │ │ │ ├── Rar20Crypto.h
│ │ │ │ │ │ │ │ │ ├── RarAes.cpp
│ │ │ │ │ │ │ │ │ ├── RarAes.h
│ │ │ │ │ │ │ │ │ ├── Sha1.cpp
│ │ │ │ │ │ │ │ │ ├── Sha1.h
│ │ │ │ │ │ │ │ │ ├── WzAes.cpp
│ │ │ │ │ │ │ │ │ ├── WzAes.h
│ │ │ │ │ │ │ │ │ ├── ZipCrypto.cpp
│ │ │ │ │ │ │ │ │ ├── ZipCrypto.h
│ │ │ │ │ │ │ │ │ ├── ZipStrong.cpp
│ │ │ │ │ │ │ │ │ └── ZipStrong.h
│ │ │ │ │ │ │ │ ├── ICoder.h
│ │ │ │ │ │ │ │ ├── IDecl.h
│ │ │ │ │ │ │ │ ├── IPassword.h
│ │ │ │ │ │ │ │ ├── IProgress.h
│ │ │ │ │ │ │ │ ├── IStream.h
│ │ │ │ │ │ │ │ ├── MyVersion.h
│ │ │ │ │ │ │ │ ├── PropID.h
│ │ │ │ │ │ │ │ └── UI/
│ │ │ │ │ │ │ │ ├── Agent/
│ │ │ │ │ │ │ │ │ ├── Agent.cpp
│ │ │ │ │ │ │ │ │ ├── Agent.h
│ │ │ │ │ │ │ │ │ ├── AgentOut.cpp
│ │ │ │ │ │ │ │ │ ├── AgentProxy.cpp
│ │ │ │ │ │ │ │ │ ├── AgentProxy.h
│ │ │ │ │ │ │ │ │ ├── ArchiveFolder.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveFolderOpen.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveFolderOut.cpp
│ │ │ │ │ │ │ │ │ ├── IFolderArchive.h
│ │ │ │ │ │ │ │ │ ├── UpdateCallbackAgent.cpp
│ │ │ │ │ │ │ │ │ └── UpdateCallbackAgent.h
│ │ │ │ │ │ │ │ ├── Client7z/
│ │ │ │ │ │ │ │ │ ├── Client7z.cpp
│ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ ├── ClientCodec/
│ │ │ │ │ │ │ │ │ ├── ClientCodec.cpp
│ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ ├── Common/
│ │ │ │ │ │ │ │ │ ├── ArchiveCommandLine.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveCommandLine.h
│ │ │ │ │ │ │ │ │ ├── ArchiveExtractCallback.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveExtractCallback.h
│ │ │ │ │ │ │ │ │ ├── ArchiveName.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveName.h
│ │ │ │ │ │ │ │ │ ├── ArchiveOpenCallback.cpp
│ │ │ │ │ │ │ │ │ ├── ArchiveOpenCallback.h
│ │ │ │ │ │ │ │ │ ├── CompressCall.cpp
│ │ │ │ │ │ │ │ │ ├── CompressCall.h
│ │ │ │ │ │ │ │ │ ├── DefaultName.cpp
│ │ │ │ │ │ │ │ │ ├── DefaultName.h
│ │ │ │ │ │ │ │ │ ├── DirItem.h
│ │ │ │ │ │ │ │ │ ├── EnumDirItems.cpp
│ │ │ │ │ │ │ │ │ ├── EnumDirItems.h
│ │ │ │ │ │ │ │ │ ├── ExitCode.h
│ │ │ │ │ │ │ │ │ ├── Extract.cpp
│ │ │ │ │ │ │ │ │ ├── Extract.h
│ │ │ │ │ │ │ │ │ ├── ExtractMode.h
│ │ │ │ │ │ │ │ │ ├── ExtractingFilePath.cpp
│ │ │ │ │ │ │ │ │ ├── ExtractingFilePath.h
│ │ │ │ │ │ │ │ │ ├── HandlerLoader.h
│ │ │ │ │ │ │ │ │ ├── IFileExtractCallback.h
│ │ │ │ │ │ │ │ │ ├── LoadCodecs.cpp
│ │ │ │ │ │ │ │ │ ├── LoadCodecs.h
│ │ │ │ │ │ │ │ │ ├── OpenArchive.cpp
│ │ │ │ │ │ │ │ │ ├── OpenArchive.h
│ │ │ │ │ │ │ │ │ ├── PropIDUtils.cpp
│ │ │ │ │ │ │ │ │ ├── PropIDUtils.h
│ │ │ │ │ │ │ │ │ ├── Property.h
│ │ │ │ │ │ │ │ │ ├── SetProperties.cpp
│ │ │ │ │ │ │ │ │ ├── SetProperties.h
│ │ │ │ │ │ │ │ │ ├── SortUtils.cpp
│ │ │ │ │ │ │ │ │ ├── SortUtils.h
│ │ │ │ │ │ │ │ │ ├── TempFiles.cpp
│ │ │ │ │ │ │ │ │ ├── TempFiles.h
│ │ │ │ │ │ │ │ │ ├── Update.cpp
│ │ │ │ │ │ │ │ │ ├── Update.h
│ │ │ │ │ │ │ │ │ ├── UpdateAction.cpp
│ │ │ │ │ │ │ │ │ ├── UpdateAction.h
│ │ │ │ │ │ │ │ │ ├── UpdateCallback.cpp
│ │ │ │ │ │ │ │ │ ├── UpdateCallback.h
│ │ │ │ │ │ │ │ │ ├── UpdatePair.cpp
│ │ │ │ │ │ │ │ │ ├── UpdatePair.h
│ │ │ │ │ │ │ │ │ ├── UpdateProduce.cpp
│ │ │ │ │ │ │ │ │ ├── UpdateProduce.h
│ │ │ │ │ │ │ │ │ ├── WorkDir.cpp
│ │ │ │ │ │ │ │ │ ├── WorkDir.h
│ │ │ │ │ │ │ │ │ ├── ZipRegistry.cpp
│ │ │ │ │ │ │ │ │ └── ZipRegistry.h
│ │ │ │ │ │ │ │ ├── Console/
│ │ │ │ │ │ │ │ │ ├── ConsoleClose.cpp
│ │ │ │ │ │ │ │ │ ├── ConsoleClose.h
│ │ │ │ │ │ │ │ │ ├── ExtractCallbackConsole.cpp
│ │ │ │ │ │ │ │ │ ├── ExtractCallbackConsole.h
│ │ │ │ │ │ │ │ │ ├── List.cpp
│ │ │ │ │ │ │ │ │ ├── List.h
│ │ │ │ │ │ │ │ │ ├── Main.cpp
│ │ │ │ │ │ │ │ │ ├── MainAr.cpp
│ │ │ │ │ │ │ │ │ ├── OpenCallbackConsole.cpp
│ │ │ │ │ │ │ │ │ ├── OpenCallbackConsole.h
│ │ │ │ │ │ │ │ │ ├── PercentPrinter.cpp
│ │ │ │ │ │ │ │ │ ├── PercentPrinter.h
│ │ │ │ │ │ │ │ │ ├── UpdateCallbackConsole.cpp
│ │ │ │ │ │ │ │ │ ├── UpdateCallbackConsole.h
│ │ │ │ │ │ │ │ │ ├── UserInputUtils.cpp
│ │ │ │ │ │ │ │ │ ├── UserInputUtils.h
│ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ └── makefile.list
│ │ │ │ │ │ │ │ ├── Explorer/
│ │ │ │ │ │ │ │ │ ├── MyMessages.cpp
│ │ │ │ │ │ │ │ │ └── MyMessages.h
│ │ │ │ │ │ │ │ ├── FileManager/
│ │ │ │ │ │ │ │ │ ├── App.cpp
│ │ │ │ │ │ │ │ │ ├── App.h
│ │ │ │ │ │ │ │ │ ├── AppState.h
│ │ │ │ │ │ │ │ │ ├── ClassDefs.cpp
│ │ │ │ │ │ │ │ │ ├── ComboDialog.cpp
│ │ │ │ │ │ │ │ │ ├── ComboDialog.h
│ │ │ │ │ │ │ │ │ ├── ComboDialogRes.h
│ │ │ │ │ │ │ │ │ ├── ComboDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── CopyDialog.cpp
│ │ │ │ │ │ │ │ │ ├── CopyDialog.h
│ │ │ │ │ │ │ │ │ ├── CopyDialogRes.h
│ │ │ │ │ │ │ │ │ ├── CopyDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── ExtractCallback.cpp
│ │ │ │ │ │ │ │ │ ├── ExtractCallback.h
│ │ │ │ │ │ │ │ │ ├── FM.cpp
│ │ │ │ │ │ │ │ │ ├── FM_rc.cpp
│ │ │ │ │ │ │ │ │ ├── FSDrives.h.out
│ │ │ │ │ │ │ │ │ ├── FSFolder.cpp
│ │ │ │ │ │ │ │ │ ├── FSFolder.h
│ │ │ │ │ │ │ │ │ ├── FSFolderCopy.cpp
│ │ │ │ │ │ │ │ │ ├── FileFolderPluginOpen.cpp
│ │ │ │ │ │ │ │ │ ├── FileFolderPluginOpen.h
│ │ │ │ │ │ │ │ │ ├── FormatUtils.cpp
│ │ │ │ │ │ │ │ │ ├── FormatUtils.h
│ │ │ │ │ │ │ │ │ ├── HelpUtils.h
│ │ │ │ │ │ │ │ │ ├── IFolder.h
│ │ │ │ │ │ │ │ │ ├── LangUtils.cpp
│ │ │ │ │ │ │ │ │ ├── LangUtils.h
│ │ │ │ │ │ │ │ │ ├── ListViewDialog.cpp
│ │ │ │ │ │ │ │ │ ├── ListViewDialog.h
│ │ │ │ │ │ │ │ │ ├── ListViewDialogRes.h
│ │ │ │ │ │ │ │ │ ├── ListViewDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── MessagesDialog.cpp
│ │ │ │ │ │ │ │ │ ├── MessagesDialog.h
│ │ │ │ │ │ │ │ │ ├── MessagesDialogRes.h
│ │ │ │ │ │ │ │ │ ├── MessagesDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── MyLoadMenu.cpp
│ │ │ │ │ │ │ │ │ ├── MyLoadMenu.h
│ │ │ │ │ │ │ │ │ ├── NetFolder.h.OUT
│ │ │ │ │ │ │ │ │ ├── OpenCallback.cpp
│ │ │ │ │ │ │ │ │ ├── OpenCallback.h
│ │ │ │ │ │ │ │ │ ├── OverwriteDialog.cpp
│ │ │ │ │ │ │ │ │ ├── OverwriteDialog.h
│ │ │ │ │ │ │ │ │ ├── OverwriteDialogRes.h
│ │ │ │ │ │ │ │ │ ├── OverwriteDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── Panel.cpp
│ │ │ │ │ │ │ │ │ ├── Panel.h
│ │ │ │ │ │ │ │ │ ├── PanelCopy.cpp
│ │ │ │ │ │ │ │ │ ├── PanelCrc.cpp
│ │ │ │ │ │ │ │ │ ├── PanelFolderChange.cpp
│ │ │ │ │ │ │ │ │ ├── PanelItemOpen.cpp
│ │ │ │ │ │ │ │ │ ├── PanelItems.cpp
│ │ │ │ │ │ │ │ │ ├── PanelListNotify.cpp
│ │ │ │ │ │ │ │ │ ├── PanelMenu.cpp
│ │ │ │ │ │ │ │ │ ├── PanelOperations.cpp
│ │ │ │ │ │ │ │ │ ├── PanelSelect.cpp
│ │ │ │ │ │ │ │ │ ├── PanelSort.cpp
│ │ │ │ │ │ │ │ │ ├── PanelSplitFile.cpp
│ │ │ │ │ │ │ │ │ ├── PasswordDialog.cpp
│ │ │ │ │ │ │ │ │ ├── PasswordDialog.h
│ │ │ │ │ │ │ │ │ ├── PasswordDialogRes.h
│ │ │ │ │ │ │ │ │ ├── PasswordDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── PhysDriveFolder.h.out
│ │ │ │ │ │ │ │ │ ├── PluginInterface.h
│ │ │ │ │ │ │ │ │ ├── PluginLoader.h
│ │ │ │ │ │ │ │ │ ├── ProgramLocation.cpp
│ │ │ │ │ │ │ │ │ ├── ProgramLocation.h
│ │ │ │ │ │ │ │ │ ├── ProgressDialog2.cpp
│ │ │ │ │ │ │ │ │ ├── ProgressDialog2.h
│ │ │ │ │ │ │ │ │ ├── ProgressDialog2Res.h
│ │ │ │ │ │ │ │ │ ├── ProgressDialog2_rc.cpp
│ │ │ │ │ │ │ │ │ ├── ProgressDialogRes.h
│ │ │ │ │ │ │ │ │ ├── PropertyName.cpp
│ │ │ │ │ │ │ │ │ ├── PropertyName.h
│ │ │ │ │ │ │ │ │ ├── PropertyNameRes.h
│ │ │ │ │ │ │ │ │ ├── RegistryAssociations.cpp
│ │ │ │ │ │ │ │ │ ├── RegistryAssociations.h
│ │ │ │ │ │ │ │ │ ├── RegistryPlugins.h
│ │ │ │ │ │ │ │ │ ├── RegistryUtils.cpp
│ │ │ │ │ │ │ │ │ ├── RegistryUtils.h
│ │ │ │ │ │ │ │ │ ├── RootFolder.cpp
│ │ │ │ │ │ │ │ │ ├── RootFolder.h
│ │ │ │ │ │ │ │ │ ├── SplitDialog.cpp
│ │ │ │ │ │ │ │ │ ├── SplitDialog.h
│ │ │ │ │ │ │ │ │ ├── SplitDialogRes.h
│ │ │ │ │ │ │ │ │ ├── SplitDialog_rc.cpp
│ │ │ │ │ │ │ │ │ ├── SplitUtils.cpp
│ │ │ │ │ │ │ │ │ ├── SplitUtils.h
│ │ │ │ │ │ │ │ │ ├── StringUtils.cpp
│ │ │ │ │ │ │ │ │ ├── StringUtils.h
│ │ │ │ │ │ │ │ │ ├── SysIconUtils.cpp
│ │ │ │ │ │ │ │ │ ├── SysIconUtils.h
│ │ │ │ │ │ │ │ │ ├── TextPairs.cpp
│ │ │ │ │ │ │ │ │ ├── TextPairs.h
│ │ │ │ │ │ │ │ │ ├── UpdateCallback100.cpp
│ │ │ │ │ │ │ │ │ ├── UpdateCallback100.h
│ │ │ │ │ │ │ │ │ ├── ViewSettings.cpp
│ │ │ │ │ │ │ │ │ ├── ViewSettings.h
│ │ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ │ ├── makefile.list
│ │ │ │ │ │ │ │ │ ├── res/
│ │ │ │ │ │ │ │ │ │ ├── Add2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── AddPNG.h
│ │ │ │ │ │ │ │ │ │ ├── Copy2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── CopyPNG.h
│ │ │ │ │ │ │ │ │ │ ├── Delete2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── DeletePNG.h
│ │ │ │ │ │ │ │ │ │ ├── Extract2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── ExtractPNG.h
│ │ │ │ │ │ │ │ │ │ ├── Info2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── InfoPNG.h
│ │ │ │ │ │ │ │ │ │ ├── Move2PNG.h
│ │ │ │ │ │ │ │ │ │ ├── MovePNG.h
│ │ │ │ │ │ │ │ │ │ ├── ParentFolder.h
│ │ │ │ │ │ │ │ │ │ ├── Test2PNG.h
│ │ │ │ │ │ │ │ │ │ └── TestPNG.h
│ │ │ │ │ │ │ │ │ ├── resource.h
│ │ │ │ │ │ │ │ │ └── wxFM.cpp
│ │ │ │ │ │ │ │ └── GUI/
│ │ │ │ │ │ │ │ ├── BenchmarkDialog.cpp
│ │ │ │ │ │ │ │ ├── BenchmarkDialog.h
│ │ │ │ │ │ │ │ ├── BenchmarkDialogRes.h
│ │ │ │ │ │ │ │ ├── BenchmarkDialog_rc.cpp
│ │ │ │ │ │ │ │ ├── CompressDialog.cpp
│ │ │ │ │ │ │ │ ├── CompressDialog.h
│ │ │ │ │ │ │ │ ├── CompressDialogRes.h
│ │ │ │ │ │ │ │ ├── CompressDialog_rc.cpp
│ │ │ │ │ │ │ │ ├── ExtractDialog.cpp
│ │ │ │ │ │ │ │ ├── ExtractDialog.h
│ │ │ │ │ │ │ │ ├── ExtractDialogRes.h
│ │ │ │ │ │ │ │ ├── ExtractDialog_rc.cpp
│ │ │ │ │ │ │ │ ├── ExtractGUI.cpp
│ │ │ │ │ │ │ │ ├── ExtractGUI.h
│ │ │ │ │ │ │ │ ├── ExtractRes.h
│ │ │ │ │ │ │ │ ├── GUI.cpp
│ │ │ │ │ │ │ │ ├── UpdateCallbackGUI.cpp
│ │ │ │ │ │ │ │ ├── UpdateCallbackGUI.h
│ │ │ │ │ │ │ │ ├── UpdateGUI.cpp
│ │ │ │ │ │ │ │ ├── UpdateGUI.h
│ │ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ │ ├── makefile.list
│ │ │ │ │ │ │ │ ├── resource.h
│ │ │ │ │ │ │ │ └── wxGUI.cpp
│ │ │ │ │ │ │ ├── Common/
│ │ │ │ │ │ │ │ ├── AutoPtr.h
│ │ │ │ │ │ │ │ ├── Buffer.h
│ │ │ │ │ │ │ │ ├── CRC.cpp
│ │ │ │ │ │ │ │ ├── C_FileIO.cpp
│ │ │ │ │ │ │ │ ├── C_FileIO.h
│ │ │ │ │ │ │ │ ├── ComTry.h
│ │ │ │ │ │ │ │ ├── CommandLineParser.cpp
│ │ │ │ │ │ │ │ ├── CommandLineParser.h
│ │ │ │ │ │ │ │ ├── Defs.h
│ │ │ │ │ │ │ │ ├── DynamicBuffer.h
│ │ │ │ │ │ │ │ ├── IntToString.cpp
│ │ │ │ │ │ │ │ ├── IntToString.h
│ │ │ │ │ │ │ │ ├── Lang.cpp
│ │ │ │ │ │ │ │ ├── Lang.h
│ │ │ │ │ │ │ │ ├── ListFileUtils.cpp
│ │ │ │ │ │ │ │ ├── ListFileUtils.h
│ │ │ │ │ │ │ │ ├── MyCom.h
│ │ │ │ │ │ │ │ ├── MyException.h
│ │ │ │ │ │ │ │ ├── MyGuidDef.h
│ │ │ │ │ │ │ │ ├── MyInitGuid.h
│ │ │ │ │ │ │ │ ├── MyMap.cpp
│ │ │ │ │ │ │ │ ├── MyMap.h
│ │ │ │ │ │ │ │ ├── MyString.cpp
│ │ │ │ │ │ │ │ ├── MyString.h
│ │ │ │ │ │ │ │ ├── MyUnknown.h
│ │ │ │ │ │ │ │ ├── MyVector.cpp
│ │ │ │ │ │ │ │ ├── MyVector.h
│ │ │ │ │ │ │ │ ├── MyWindows.cpp
│ │ │ │ │ │ │ │ ├── MyWindows.h
│ │ │ │ │ │ │ │ ├── MyXml.cpp
│ │ │ │ │ │ │ │ ├── MyXml.h
│ │ │ │ │ │ │ │ ├── NewHandler.h
│ │ │ │ │ │ │ │ ├── StdInStream.cpp
│ │ │ │ │ │ │ │ ├── StdInStream.h
│ │ │ │ │ │ │ │ ├── StdOutStream.cpp
│ │ │ │ │ │ │ │ ├── StdOutStream.h
│ │ │ │ │ │ │ │ ├── StringConvert.cpp
│ │ │ │ │ │ │ │ ├── StringConvert.h
│ │ │ │ │ │ │ │ ├── StringToInt.cpp
│ │ │ │ │ │ │ │ ├── StringToInt.h
│ │ │ │ │ │ │ │ ├── TextConfig.cpp
│ │ │ │ │ │ │ │ ├── TextConfig.h
│ │ │ │ │ │ │ │ ├── Types.h
│ │ │ │ │ │ │ │ ├── UTFConvert.cpp
│ │ │ │ │ │ │ │ ├── UTFConvert.h
│ │ │ │ │ │ │ │ ├── Wildcard.cpp
│ │ │ │ │ │ │ │ └── Wildcard.h
│ │ │ │ │ │ │ ├── Windows/
│ │ │ │ │ │ │ │ ├── COM.cpp
│ │ │ │ │ │ │ │ ├── COM.h
│ │ │ │ │ │ │ │ ├── Clipboard.cpp
│ │ │ │ │ │ │ │ ├── Clipboard.h
│ │ │ │ │ │ │ │ ├── CommonDialog.h
│ │ │ │ │ │ │ │ ├── Control/
│ │ │ │ │ │ │ │ │ ├── ComboBox.h
│ │ │ │ │ │ │ │ │ ├── Controls.cpp
│ │ │ │ │ │ │ │ │ ├── Dialog.cpp
│ │ │ │ │ │ │ │ │ ├── Dialog.h
│ │ │ │ │ │ │ │ │ ├── DialogImpl.h
│ │ │ │ │ │ │ │ │ ├── Edit.h
│ │ │ │ │ │ │ │ │ ├── ListView.h
│ │ │ │ │ │ │ │ │ ├── ProgressBar.h
│ │ │ │ │ │ │ │ │ ├── Static.h
│ │ │ │ │ │ │ │ │ ├── StatusBar.h
│ │ │ │ │ │ │ │ │ ├── Window2.cpp
│ │ │ │ │ │ │ │ │ └── Window2.h
│ │ │ │ │ │ │ │ ├── DLL.cpp
│ │ │ │ │ │ │ │ ├── DLL.h
│ │ │ │ │ │ │ │ ├── Defs.h
│ │ │ │ │ │ │ │ ├── Error.cpp
│ │ │ │ │ │ │ │ ├── Error.h
│ │ │ │ │ │ │ │ ├── FileDir.cpp
│ │ │ │ │ │ │ │ ├── FileDir.h
│ │ │ │ │ │ │ │ ├── FileFind.cpp
│ │ │ │ │ │ │ │ ├── FileFind.h
│ │ │ │ │ │ │ │ ├── FileIO.cpp
│ │ │ │ │ │ │ │ ├── FileIO.h
│ │ │ │ │ │ │ │ ├── FileName.cpp
│ │ │ │ │ │ │ │ ├── FileName.h
│ │ │ │ │ │ │ │ ├── PropVariant.cpp
│ │ │ │ │ │ │ │ ├── PropVariant.h
│ │ │ │ │ │ │ │ ├── PropVariantConversions.cpp
│ │ │ │ │ │ │ │ ├── PropVariantConversions.h
│ │ │ │ │ │ │ │ ├── PropVariantUtils.cpp
│ │ │ │ │ │ │ │ ├── PropVariantUtils.h
│ │ │ │ │ │ │ │ ├── Registry.cpp
│ │ │ │ │ │ │ │ ├── Registry.h
│ │ │ │ │ │ │ │ ├── ResourceString.h
│ │ │ │ │ │ │ │ ├── Shell.h
│ │ │ │ │ │ │ │ ├── Synchronization.cpp
│ │ │ │ │ │ │ │ ├── Synchronization.h
│ │ │ │ │ │ │ │ ├── Synchronization2.h
│ │ │ │ │ │ │ │ ├── System.cpp
│ │ │ │ │ │ │ │ ├── System.h
│ │ │ │ │ │ │ │ ├── Thread.h
│ │ │ │ │ │ │ │ ├── Time.cpp
│ │ │ │ │ │ │ │ ├── Time.h
│ │ │ │ │ │ │ │ ├── Window.cpp
│ │ │ │ │ │ │ │ └── Window.h
│ │ │ │ │ │ │ ├── include_windows/
│ │ │ │ │ │ │ │ ├── basetyps.h
│ │ │ │ │ │ │ │ ├── tchar.h
│ │ │ │ │ │ │ │ └── windows.h
│ │ │ │ │ │ │ └── myWindows/
│ │ │ │ │ │ │ ├── StdAfx.h
│ │ │ │ │ │ │ ├── config.h
│ │ │ │ │ │ │ ├── initguid.h
│ │ │ │ │ │ │ ├── makefile
│ │ │ │ │ │ │ ├── makefile.depend
│ │ │ │ │ │ │ ├── makefile.list
│ │ │ │ │ │ │ ├── myAddExeFlag.cpp
│ │ │ │ │ │ │ ├── myGetTickCount.cpp
│ │ │ │ │ │ │ ├── myPrivate.h
│ │ │ │ │ │ │ ├── mySplitCommandLine.cpp
│ │ │ │ │ │ │ ├── test_emul.cpp
│ │ │ │ │ │ │ ├── wine_GetXXXDefaultLangID.cpp
│ │ │ │ │ │ │ └── wine_date_and_time.cpp
│ │ │ │ │ │ ├── DOCS/
│ │ │ │ │ │ │ ├── 7zC.txt
│ │ │ │ │ │ │ ├── 7zFormat.txt
│ │ │ │ │ │ │ ├── License.txt
│ │ │ │ │ │ │ ├── MANUAL/
│ │ │ │ │ │ │ │ ├── commands/
│ │ │ │ │ │ │ │ │ ├── add.htm
│ │ │ │ │ │ │ │ │ ├── bench.htm
│ │ │ │ │ │ │ │ │ ├── delete.htm
│ │ │ │ │ │ │ │ │ ├── extract.htm
│ │ │ │ │ │ │ │ │ ├── extract_full.htm
│ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ ├── list.htm
│ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ ├── test.htm
│ │ │ │ │ │ │ │ │ └── update.htm
│ │ │ │ │ │ │ │ ├── exit_codes.htm
│ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ ├── switches/
│ │ │ │ │ │ │ │ │ ├── ar_exclude.htm
│ │ │ │ │ │ │ │ │ ├── ar_include.htm
│ │ │ │ │ │ │ │ │ ├── ar_no.htm
│ │ │ │ │ │ │ │ │ ├── charset.htm
│ │ │ │ │ │ │ │ │ ├── exclude.htm
│ │ │ │ │ │ │ │ │ ├── include.htm
│ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ ├── list_tech.htm
│ │ │ │ │ │ │ │ │ ├── method.htm
│ │ │ │ │ │ │ │ │ ├── output_dir.htm
│ │ │ │ │ │ │ │ │ ├── overwrite.htm
│ │ │ │ │ │ │ │ │ ├── password.htm
│ │ │ │ │ │ │ │ │ ├── recurse.htm
│ │ │ │ │ │ │ │ │ ├── sfx.htm
│ │ │ │ │ │ │ │ │ ├── ssc.htm
│ │ │ │ │ │ │ │ │ ├── stdin.htm
│ │ │ │ │ │ │ │ │ ├── stdout.htm
│ │ │ │ │ │ │ │ │ ├── stop_switch.htm
│ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ ├── type.htm
│ │ │ │ │ │ │ │ │ ├── update.htm
│ │ │ │ │ │ │ │ │ ├── volume.htm
│ │ │ │ │ │ │ │ │ ├── working_dir.htm
│ │ │ │ │ │ │ │ │ └── yes.htm
│ │ │ │ │ │ │ │ └── syntax.htm
│ │ │ │ │ │ │ ├── Methods.txt
│ │ │ │ │ │ │ ├── copying.txt
│ │ │ │ │ │ │ ├── history.txt
│ │ │ │ │ │ │ ├── lzma.txt
│ │ │ │ │ │ │ ├── readme.txt
│ │ │ │ │ │ │ └── unRarLicense.txt
│ │ │ │ │ │ ├── GUI/
│ │ │ │ │ │ │ ├── Lang/
│ │ │ │ │ │ │ │ ├── af.txt
│ │ │ │ │ │ │ │ ├── ar.txt
│ │ │ │ │ │ │ │ ├── ast.txt
│ │ │ │ │ │ │ │ ├── az.txt
│ │ │ │ │ │ │ │ ├── ba.txt
│ │ │ │ │ │ │ │ ├── be.txt
│ │ │ │ │ │ │ │ ├── bg.txt
│ │ │ │ │ │ │ │ ├── bn.txt
│ │ │ │ │ │ │ │ ├── br.txt
│ │ │ │ │ │ │ │ ├── ca.txt
│ │ │ │ │ │ │ │ ├── cs.txt
│ │ │ │ │ │ │ │ ├── cy.txt
│ │ │ │ │ │ │ │ ├── da.txt
│ │ │ │ │ │ │ │ ├── de.txt
│ │ │ │ │ │ │ │ ├── el.txt
│ │ │ │ │ │ │ │ ├── en.ttt
│ │ │ │ │ │ │ │ ├── eo.txt
│ │ │ │ │ │ │ │ ├── es.txt
│ │ │ │ │ │ │ │ ├── et.txt
│ │ │ │ │ │ │ │ ├── eu.txt
│ │ │ │ │ │ │ │ ├── ext.txt
│ │ │ │ │ │ │ │ ├── fa.txt
│ │ │ │ │ │ │ │ ├── fi.txt
│ │ │ │ │ │ │ │ ├── fr.txt
│ │ │ │ │ │ │ │ ├── fur.txt
│ │ │ │ │ │ │ │ ├── fy.txt
│ │ │ │ │ │ │ │ ├── gl.txt
│ │ │ │ │ │ │ │ ├── he.txt
│ │ │ │ │ │ │ │ ├── hr.txt
│ │ │ │ │ │ │ │ ├── hu.txt
│ │ │ │ │ │ │ │ ├── hy.txt
│ │ │ │ │ │ │ │ ├── id.txt
│ │ │ │ │ │ │ │ ├── io.txt
│ │ │ │ │ │ │ │ ├── is.txt
│ │ │ │ │ │ │ │ ├── it.txt
│ │ │ │ │ │ │ │ ├── ja.txt
│ │ │ │ │ │ │ │ ├── ka.txt
│ │ │ │ │ │ │ │ ├── ko.txt
│ │ │ │ │ │ │ │ ├── ku-ckb.txt
│ │ │ │ │ │ │ │ ├── ku.txt
│ │ │ │ │ │ │ │ ├── lt.txt
│ │ │ │ │ │ │ │ ├── lv.txt
│ │ │ │ │ │ │ │ ├── mk.txt
│ │ │ │ │ │ │ │ ├── mn.txt
│ │ │ │ │ │ │ │ ├── mr.txt
│ │ │ │ │ │ │ │ ├── ms.txt
│ │ │ │ │ │ │ │ ├── nb.txt
│ │ │ │ │ │ │ │ ├── ne.txt
│ │ │ │ │ │ │ │ ├── nl.txt
│ │ │ │ │ │ │ │ ├── nn.txt
│ │ │ │ │ │ │ │ ├── pa-in.txt
│ │ │ │ │ │ │ │ ├── pl.txt
│ │ │ │ │ │ │ │ ├── ps.txt
│ │ │ │ │ │ │ │ ├── pt-br.txt
│ │ │ │ │ │ │ │ ├── pt.txt
│ │ │ │ │ │ │ │ ├── ro.txt
│ │ │ │ │ │ │ │ ├── ru.txt
│ │ │ │ │ │ │ │ ├── si.txt
│ │ │ │ │ │ │ │ ├── sk.txt
│ │ │ │ │ │ │ │ ├── sl.txt
│ │ │ │ │ │ │ │ ├── sq.txt
│ │ │ │ │ │ │ │ ├── sr-spc.txt
│ │ │ │ │ │ │ │ ├── sr-spl.txt
│ │ │ │ │ │ │ │ ├── sv.txt
│ │ │ │ │ │ │ │ ├── ta.txt
│ │ │ │ │ │ │ │ ├── th.txt
│ │ │ │ │ │ │ │ ├── tr.txt
│ │ │ │ │ │ │ │ ├── tt.txt
│ │ │ │ │ │ │ │ ├── uk.txt
│ │ │ │ │ │ │ │ ├── uz.txt
│ │ │ │ │ │ │ │ ├── va.txt
│ │ │ │ │ │ │ │ ├── vi.txt
│ │ │ │ │ │ │ │ ├── zh-cn.txt
│ │ │ │ │ │ │ │ └── zh-tw.txt
│ │ │ │ │ │ │ ├── help/
│ │ │ │ │ │ │ │ ├── #IDXHDR
│ │ │ │ │ │ │ │ ├── #ITBITS
│ │ │ │ │ │ │ │ ├── #STRINGS
│ │ │ │ │ │ │ │ ├── #SYSTEM
│ │ │ │ │ │ │ │ ├── #TOPICS
│ │ │ │ │ │ │ │ ├── #URLSTR
│ │ │ │ │ │ │ │ ├── #URLTBL
│ │ │ │ │ │ │ │ ├── $FIftiMain
│ │ │ │ │ │ │ │ ├── $OBJINST
│ │ │ │ │ │ │ │ ├── $WWAssociativeLinks/
│ │ │ │ │ │ │ │ │ └── Property
│ │ │ │ │ │ │ │ ├── $WWKeywordLinks/
│ │ │ │ │ │ │ │ │ ├── BTree
│ │ │ │ │ │ │ │ │ ├── Data
│ │ │ │ │ │ │ │ │ ├── Map
│ │ │ │ │ │ │ │ │ └── Property
│ │ │ │ │ │ │ │ ├── 7zip.hhc
│ │ │ │ │ │ │ │ ├── 7zip.hhk
│ │ │ │ │ │ │ │ ├── cmdline/
│ │ │ │ │ │ │ │ │ ├── commands/
│ │ │ │ │ │ │ │ │ │ ├── add.htm
│ │ │ │ │ │ │ │ │ │ ├── bench.htm
│ │ │ │ │ │ │ │ │ │ ├── delete.htm
│ │ │ │ │ │ │ │ │ │ ├── extract.htm
│ │ │ │ │ │ │ │ │ │ ├── extract_full.htm
│ │ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ │ ├── list.htm
│ │ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ │ ├── test.htm
│ │ │ │ │ │ │ │ │ │ └── update.htm
│ │ │ │ │ │ │ │ │ ├── exit_codes.htm
│ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ ├── switches/
│ │ │ │ │ │ │ │ │ │ ├── ar_exclude.htm
│ │ │ │ │ │ │ │ │ │ ├── ar_include.htm
│ │ │ │ │ │ │ │ │ │ ├── ar_no.htm
│ │ │ │ │ │ │ │ │ │ ├── charset.htm
│ │ │ │ │ │ │ │ │ │ ├── exclude.htm
│ │ │ │ │ │ │ │ │ │ ├── include.htm
│ │ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ │ ├── list_tech.htm
│ │ │ │ │ │ │ │ │ │ ├── method.htm
│ │ │ │ │ │ │ │ │ │ ├── output_dir.htm
│ │ │ │ │ │ │ │ │ │ ├── overwrite.htm
│ │ │ │ │ │ │ │ │ │ ├── password.htm
│ │ │ │ │ │ │ │ │ │ ├── recurse.htm
│ │ │ │ │ │ │ │ │ │ ├── sfx.htm
│ │ │ │ │ │ │ │ │ │ ├── ssc.htm
│ │ │ │ │ │ │ │ │ │ ├── stdin.htm
│ │ │ │ │ │ │ │ │ │ ├── stdout.htm
│ │ │ │ │ │ │ │ │ │ ├── stop_switch.htm
│ │ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ │ ├── type.htm
│ │ │ │ │ │ │ │ │ │ ├── update.htm
│ │ │ │ │ │ │ │ │ │ ├── volume.htm
│ │ │ │ │ │ │ │ │ │ ├── working_dir.htm
│ │ │ │ │ │ │ │ │ │ └── yes.htm
│ │ │ │ │ │ │ │ │ └── syntax.htm
│ │ │ │ │ │ │ │ ├── fm/
│ │ │ │ │ │ │ │ │ ├── about.htm
│ │ │ │ │ │ │ │ │ ├── benchmark.htm
│ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ ├── menu.htm
│ │ │ │ │ │ │ │ │ ├── options.htm
│ │ │ │ │ │ │ │ │ ├── plugins/
│ │ │ │ │ │ │ │ │ │ ├── 7-zip/
│ │ │ │ │ │ │ │ │ │ │ ├── add.htm
│ │ │ │ │ │ │ │ │ │ │ ├── extract.htm
│ │ │ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ │ │ ├── options.htm
│ │ │ │ │ │ │ │ │ │ │ └── style.css
│ │ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ │ └── style.css
│ │ │ │ │ │ │ │ │ └── style.css
│ │ │ │ │ │ │ │ ├── general/
│ │ │ │ │ │ │ │ │ ├── 7z.htm
│ │ │ │ │ │ │ │ │ ├── faq.htm
│ │ │ │ │ │ │ │ │ ├── formats.htm
│ │ │ │ │ │ │ │ │ ├── index.htm
│ │ │ │ │ │ │ │ │ ├── license.htm
│ │ │ │ │ │ │ │ │ ├── performance.htm
│ │ │ │ │ │ │ │ │ ├── register.htm
│ │ │ │ │ │ │ │ │ ├── style.css
│ │ │ │ │ │ │ │ │ └── thanks.htm
│ │ │ │ │ │ │ │ ├── start.htm
│ │ │ │ │ │ │ │ └── style.css
│ │ │ │ │ │ │ ├── kde/
│ │ │ │ │ │ │ │ ├── p7zip_compress.desktop
│ │ │ │ │ │ │ │ ├── p7zip_compress2.desktop
│ │ │ │ │ │ │ │ ├── p7zip_extract.desktop
│ │ │ │ │ │ │ │ ├── p7zip_extract_subdir.desktop
│ │ │ │ │ │ │ │ ├── p7zip_extract_to.desktop
│ │ │ │ │ │ │ │ └── p7zip_test.desktop
│ │ │ │ │ │ │ ├── p7zipForFilemanager
│ │ │ │ │ │ │ ├── p7zip_32.xpm
│ │ │ │ │ │ │ └── readme.txt
│ │ │ │ │ │ ├── README
│ │ │ │ │ │ ├── TODO
│ │ │ │ │ │ ├── check/
│ │ │ │ │ │ │ ├── check.sh
│ │ │ │ │ │ │ ├── check_7zr.sh
│ │ │ │ │ │ │ ├── check_Client7z.sh
│ │ │ │ │ │ │ ├── check_install.sh
│ │ │ │ │ │ │ ├── clean_all.sh
│ │ │ │ │ │ │ └── test/
│ │ │ │ │ │ │ ├── 7za.exe.lzma
│ │ │ │ │ │ │ ├── 7za.exe.lzma86
│ │ │ │ │ │ │ └── 7za.exe.lzma_eos
│ │ │ │ │ │ ├── contrib/
│ │ │ │ │ │ │ ├── VirtualFileSystemForMidnightCommander/
│ │ │ │ │ │ │ │ ├── ChangeLog
│ │ │ │ │ │ │ │ ├── readme
│ │ │ │ │ │ │ │ ├── readme.u7z
│ │ │ │ │ │ │ │ └── u7z
│ │ │ │ │ │ │ ├── gzip-like_CLI_wrapper_for_7z/
│ │ │ │ │ │ │ │ ├── README
│ │ │ │ │ │ │ │ ├── check/
│ │ │ │ │ │ │ │ │ └── check.sh
│ │ │ │ │ │ │ │ ├── man1/
│ │ │ │ │ │ │ │ │ └── p7zip.1
│ │ │ │ │ │ │ │ └── p7zip
│ │ │ │ │ │ │ └── qnx630sp3/
│ │ │ │ │ │ │ ├── qnx630sp3-shared
│ │ │ │ │ │ │ └── qnx630sp3-static
│ │ │ │ │ │ └── man1/
│ │ │ │ │ │ ├── 7z.1
│ │ │ │ │ │ ├── 7za.1
│ │ │ │ │ │ └── 7zr.1
│ │ │ │ │ ├── 7zip.cpp
│ │ │ │ │ ├── 7zip.h
│ │ │ │ │ ├── 7zipstreams.h
│ │ │ │ │ ├── OpenArchive.cpp
│ │ │ │ │ ├── OpenArchive.h
│ │ │ │ │ ├── draw.cpp
│ │ │ │ │ ├── dynarec/
│ │ │ │ │ │ ├── Android.mk
│ │ │ │ │ │ ├── arm_codegen.h
│ │ │ │ │ │ ├── arm_dpimacros.h
│ │ │ │ │ │ ├── arm_dpimacros_old.h
│ │ │ │ │ │ ├── arm_emit.h
│ │ │ │ │ │ ├── arm_stub.S
│ │ │ │ │ │ ├── arm_stub_old.S
│ │ │ │ │ │ ├── cpu.cpp
│ │ │ │ │ │ ├── cpu.h
│ │ │ │ │ │ ├── cpu_threaded.cpp
│ │ │ │ │ │ ├── dynarec.h
│ │ │ │ │ │ ├── dynarec_linker.cpp
│ │ │ │ │ │ ├── dynarec_linker.h
│ │ │ │ │ │ ├── exophasejit.cpp
│ │ │ │ │ │ ├── exophasejit.h
│ │ │ │ │ │ ├── warm.cpp
│ │ │ │ │ │ └── warm.h
│ │ │ │ │ ├── main.cpp
│ │ │ │ │ ├── main.h
│ │ │ │ │ ├── math-neon/
│ │ │ │ │ │ ├── Android.mk
│ │ │ │ │ │ ├── COPYING
│ │ │ │ │ │ ├── README
│ │ │ │ │ │ ├── math_acosf.c
│ │ │ │ │ │ ├── math_asinf.c
│ │ │ │ │ │ ├── math_atan2f.c
│ │ │ │ │ │ ├── math_atanf.c
│ │ │ │ │ │ ├── math_ceilf.c
│ │ │ │ │ │ ├── math_cosf.c
│ │ │ │ │ │ ├── math_coshf.c
│ │ │ │ │ │ ├── math_debug.c
│ │ │ │ │ │ ├── math_expf.c
│ │ │ │ │ │ ├── math_fabsf.c
│ │ │ │ │ │ ├── math_floorf.c
│ │ │ │ │ │ ├── math_fmodf.c
│ │ │ │ │ │ ├── math_frexpf.c
│ │ │ │ │ │ ├── math_invsqrtf.c
│ │ │ │ │ │ ├── math_ldexpf.c
│ │ │ │ │ │ ├── math_log10f.c
│ │ │ │ │ │ ├── math_logf.c
│ │ │ │ │ │ ├── math_mat2.c
│ │ │ │ │ │ ├── math_mat3.c
│ │ │ │ │ │ ├── math_mat4.c
│ │ │ │ │ │ ├── math_modf.c
│ │ │ │ │ │ ├── math_neon.h
│ │ │ │ │ │ ├── math_powf.c
│ │ │ │ │ │ ├── math_runfast.c
│ │ │ │ │ │ ├── math_sincosf.c
│ │ │ │ │ │ ├── math_sinf.c
│ │ │ │ │ │ ├── math_sinfv.c
│ │ │ │ │ │ ├── math_sinhf.c
│ │ │ │ │ │ ├── math_sqrtf.c
│ │ │ │ │ │ ├── math_sqrtfv.c
│ │ │ │ │ │ ├── math_tanf.c
│ │ │ │ │ │ ├── math_tanhf.c
│ │ │ │ │ │ ├── math_vec2.c
│ │ │ │ │ │ ├── math_vec3.c
│ │ │ │ │ │ └── math_vec4.c
│ │ │ │ │ ├── mic.cpp
│ │ │ │ │ ├── neontest.cpp
│ │ │ │ │ ├── neontest.h
│ │ │ │ │ ├── ogl.cpp
│ │ │ │ │ ├── sndopensl.cpp
│ │ │ │ │ ├── sndopensl.h
│ │ │ │ │ ├── throttle.cpp
│ │ │ │ │ ├── throttle.h
│ │ │ │ │ └── video.h
│ │ │ │ ├── arm_instructions.cpp
│ │ │ │ ├── arm_instructions.h
│ │ │ │ ├── arm_jit.cpp
│ │ │ │ ├── arm_jit.h
│ │ │ │ ├── armcpu.cpp
│ │ │ │ ├── armcpu.h
│ │ │ │ ├── armcpu_exec_inline.h
│ │ │ │ ├── bios.cpp
│ │ │ │ ├── bios.h
│ │ │ │ ├── bits.h
│ │ │ │ ├── build.bat
│ │ │ │ ├── cheatSystem.cpp
│ │ │ │ ├── cheatSystem.h
│ │ │ │ ├── commandline.cpp
│ │ │ │ ├── commandline.h
│ │ │ │ ├── common.cpp
│ │ │ │ ├── common.h
│ │ │ │ ├── cp15.cpp
│ │ │ │ ├── cp15.h
│ │ │ │ ├── ctrlssdl.cpp
│ │ │ │ ├── ctrlssdl.h
│ │ │ │ ├── debug.cpp
│ │ │ │ ├── debug.h
│ │ │ │ ├── desmume.mk
│ │ │ │ ├── desmume_config.cpp
│ │ │ │ ├── desmume_config.h
│ │ │ │ ├── driver.cpp
│ │ │ │ ├── driver.h
│ │ │ │ ├── emufile.cpp
│ │ │ │ ├── emufile.h
│ │ │ │ ├── emufile_types.h
│ │ │ │ ├── filter/
│ │ │ │ │ ├── 2xsai.cpp
│ │ │ │ │ ├── bilinear.cpp
│ │ │ │ │ ├── epx.cpp
│ │ │ │ │ ├── filter.h
│ │ │ │ │ ├── hq2x.cpp
│ │ │ │ │ ├── hq2x.h
│ │ │ │ │ ├── hq4x.cpp
│ │ │ │ │ ├── hq4x.h
│ │ │ │ │ ├── interp.h
│ │ │ │ │ ├── lq2x.cpp
│ │ │ │ │ ├── lq2x.h
│ │ │ │ │ └── scanline.cpp
│ │ │ │ ├── firmware.cpp
│ │ │ │ ├── firmware.h
│ │ │ │ ├── fs-linux.cpp
│ │ │ │ ├── fs-windows.cpp
│ │ │ │ ├── fs.h
│ │ │ │ ├── gdbstub.h
│ │ │ │ ├── gfx3d.cpp
│ │ │ │ ├── gfx3d.h
│ │ │ │ ├── instruction_attributes.h
│ │ │ │ ├── instruction_tabdef.inc
│ │ │ │ ├── instructions.h
│ │ │ │ ├── lua-engine.cpp
│ │ │ │ ├── matrix.cpp
│ │ │ │ ├── matrix.h
│ │ │ │ ├── mc.cpp
│ │ │ │ ├── mc.h
│ │ │ │ ├── mem.h
│ │ │ │ ├── metaspu/
│ │ │ │ │ ├── SndOut.cpp
│ │ │ │ │ ├── SndOut.h
│ │ │ │ │ ├── Timestretcher.cpp
│ │ │ │ │ ├── metaspu.cpp
│ │ │ │ │ └── metaspu.h
│ │ │ │ ├── mic.cpp
│ │ │ │ ├── mic.h
│ │ │ │ ├── mic_alsa.cpp
│ │ │ │ ├── mic_openal.cpp
│ │ │ │ ├── movie.cpp
│ │ │ │ ├── movie.h
│ │ │ │ ├── movie_r7b.cpp
│ │ │ │ ├── path.cpp
│ │ │ │ ├── path.h
│ │ │ │ ├── rasterize.cpp
│ │ │ │ ├── rasterize.h
│ │ │ │ ├── readwrite.cpp
│ │ │ │ ├── readwrite.h
│ │ │ │ ├── registers.h
│ │ │ │ ├── render3D.cpp
│ │ │ │ ├── render3D.h
│ │ │ │ ├── rtc.cpp
│ │ │ │ ├── rtc.h
│ │ │ │ ├── saves.cpp
│ │ │ │ ├── saves.h
│ │ │ │ ├── sequencer.h
│ │ │ │ ├── shaders.h
│ │ │ │ ├── slot1.cpp
│ │ │ │ ├── slot1.h
│ │ │ │ ├── sndsdl.cpp
│ │ │ │ ├── sndsdl.h
│ │ │ │ ├── texcache.cpp
│ │ │ │ ├── texcache.h
│ │ │ │ ├── thumb_instructions.cpp
│ │ │ │ ├── thumb_instructions.h
│ │ │ │ ├── thumb_tabdef.inc
│ │ │ │ ├── types.h
│ │ │ │ ├── utils/
│ │ │ │ │ ├── AsmJit/
│ │ │ │ │ │ ├── AsmJit.h
│ │ │ │ │ │ ├── COPYING.txt
│ │ │ │ │ │ ├── Config.h
│ │ │ │ │ │ ├── core/
│ │ │ │ │ │ │ ├── apibegin.h
│ │ │ │ │ │ │ ├── apiend.h
│ │ │ │ │ │ │ ├── assembler.cpp
│ │ │ │ │ │ │ ├── assembler.h
│ │ │ │ │ │ │ ├── assert.cpp
│ │ │ │ │ │ │ ├── assert.h
│ │ │ │ │ │ │ ├── buffer.cpp
│ │ │ │ │ │ │ ├── buffer.h
│ │ │ │ │ │ │ ├── build.h
│ │ │ │ │ │ │ ├── compiler.cpp
│ │ │ │ │ │ │ ├── compiler.h
│ │ │ │ │ │ │ ├── compilercontext.cpp
│ │ │ │ │ │ │ ├── compilercontext.h
│ │ │ │ │ │ │ ├── compilerfunc.cpp
│ │ │ │ │ │ │ ├── compilerfunc.h
│ │ │ │ │ │ │ ├── compileritem.cpp
│ │ │ │ │ │ │ ├── compileritem.h
│ │ │ │ │ │ │ ├── context.cpp
│ │ │ │ │ │ │ ├── context.h
│ │ │ │ │ │ │ ├── cpuinfo.cpp
│ │ │ │ │ │ │ ├── cpuinfo.h
│ │ │ │ │ │ │ ├── defs.cpp
│ │ │ │ │ │ │ ├── defs.h
│ │ │ │ │ │ │ ├── func.cpp
│ │ │ │ │ │ │ ├── func.h
│ │ │ │ │ │ │ ├── intutil.h
│ │ │ │ │ │ │ ├── lock.h
│ │ │ │ │ │ │ ├── logger.cpp
│ │ │ │ │ │ │ ├── logger.h
│ │ │ │ │ │ │ ├── memorymanager.cpp
│ │ │ │ │ │ │ ├── memorymanager.h
│ │ │ │ │ │ │ ├── memorymarker.cpp
│ │ │ │ │ │ │ ├── memorymarker.h
│ │ │ │ │ │ │ ├── operand.cpp
│ │ │ │ │ │ │ ├── operand.h
│ │ │ │ │ │ │ ├── podvector.h
│ │ │ │ │ │ │ ├── stringbuilder.cpp
│ │ │ │ │ │ │ ├── stringbuilder.h
│ │ │ │ │ │ │ ├── stringutil.cpp
│ │ │ │ │ │ │ ├── stringutil.h
│ │ │ │ │ │ │ ├── virtualmemory.cpp
│ │ │ │ │ │ │ ├── virtualmemory.h
│ │ │ │ │ │ │ ├── zonememory.cpp
│ │ │ │ │ │ │ └── zonememory.h
│ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ ├── x86/
│ │ │ │ │ │ │ ├── x86assembler.cpp
│ │ │ │ │ │ │ ├── x86assembler.h
│ │ │ │ │ │ │ ├── x86compiler.cpp
│ │ │ │ │ │ │ ├── x86compiler.h
│ │ │ │ │ │ │ ├── x86compilercontext.cpp
│ │ │ │ │ │ │ ├── x86compilercontext.h
│ │ │ │ │ │ │ ├── x86compilerfunc.cpp
│ │ │ │ │ │ │ ├── x86compilerfunc.h
│ │ │ │ │ │ │ ├── x86compileritem.cpp
│ │ │ │ │ │ │ ├── x86compileritem.h
│ │ │ │ │ │ │ ├── x86cpuinfo.cpp
│ │ │ │ │ │ │ ├── x86cpuinfo.h
│ │ │ │ │ │ │ ├── x86defs.cpp
│ │ │ │ │ │ │ ├── x86defs.h
│ │ │ │ │ │ │ ├── x86func.cpp
│ │ │ │ │ │ │ ├── x86func.h
│ │ │ │ │ │ │ ├── x86operand.cpp
│ │ │ │ │ │ │ ├── x86operand.h
│ │ │ │ │ │ │ ├── x86util.cpp
│ │ │ │ │ │ │ └── x86util.h
│ │ │ │ │ │ └── x86.h
│ │ │ │ │ ├── ConvertUTF.c
│ │ │ │ │ ├── ConvertUTF.h
│ │ │ │ │ ├── FileMap.cpp
│ │ │ │ │ ├── FileMap.h
│ │ │ │ │ ├── MemBuffer.cpp
│ │ │ │ │ ├── MemBuffer.h
│ │ │ │ │ ├── datetime.cpp
│ │ │ │ │ ├── datetime.h
│ │ │ │ │ ├── decrypt/
│ │ │ │ │ │ ├── crc.cpp
│ │ │ │ │ │ ├── crc.h
│ │ │ │ │ │ ├── decrypt.cpp
│ │ │ │ │ │ ├── decrypt.h
│ │ │ │ │ │ ├── header.cpp
│ │ │ │ │ │ └── header.h
│ │ │ │ │ ├── dlditool.cpp
│ │ │ │ │ ├── emufat.cpp
│ │ │ │ │ ├── emufat.h
│ │ │ │ │ ├── emufat_types.h
│ │ │ │ │ ├── guid.cpp
│ │ │ │ │ ├── guid.h
│ │ │ │ │ ├── libfat/
│ │ │ │ │ │ ├── bit_ops.h
│ │ │ │ │ │ ├── cache.cpp
│ │ │ │ │ │ ├── cache.h
│ │ │ │ │ │ ├── common.h
│ │ │ │ │ │ ├── directory.cpp
│ │ │ │ │ │ ├── directory.h
│ │ │ │ │ │ ├── disc.cpp
│ │ │ │ │ │ ├── disc.h
│ │ │ │ │ │ ├── disc_io.h
│ │ │ │ │ │ ├── fat.h
│ │ │ │ │ │ ├── fatdir.cpp
│ │ │ │ │ │ ├── fatdir.h
│ │ │ │ │ │ ├── fatfile.cpp
│ │ │ │ │ │ ├── fatfile.h
│ │ │ │ │ │ ├── file_allocation_table.cpp
│ │ │ │ │ │ ├── file_allocation_table.h
│ │ │ │ │ │ ├── filetime.cpp
│ │ │ │ │ │ ├── filetime.h
│ │ │ │ │ │ ├── libfat.cpp
│ │ │ │ │ │ ├── libfat_pc.h
│ │ │ │ │ │ ├── libfat_public_api.cpp
│ │ │ │ │ │ ├── libfat_public_api.h
│ │ │ │ │ │ ├── lock.cpp
│ │ │ │ │ │ ├── lock.h
│ │ │ │ │ │ ├── mem_allocate.h
│ │ │ │ │ │ ├── partition.cpp
│ │ │ │ │ │ └── partition.h
│ │ │ │ │ ├── lightning/
│ │ │ │ │ │ ├── Makefile.am
│ │ │ │ │ │ ├── Makefile.in
│ │ │ │ │ │ ├── arm/
│ │ │ │ │ │ │ ├── Makefile.frag
│ │ │ │ │ │ │ ├── README
│ │ │ │ │ │ │ ├── asm.h
│ │ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ │ ├── fp-swf.h
│ │ │ │ │ │ │ ├── fp-vfp.h
│ │ │ │ │ │ │ ├── fp.h
│ │ │ │ │ │ │ └── funcs.h
│ │ │ │ │ │ ├── asm-common.h
│ │ │ │ │ │ ├── config_lightning.h
│ │ │ │ │ │ ├── core-common.h
│ │ │ │ │ │ ├── fp-common.h
│ │ │ │ │ │ ├── funcs-common.h
│ │ │ │ │ │ ├── i386/
│ │ │ │ │ │ │ ├── Makefile.frag
│ │ │ │ │ │ │ ├── asm-32.h
│ │ │ │ │ │ │ ├── asm-64.h
│ │ │ │ │ │ │ ├── asm.h
│ │ │ │ │ │ │ ├── core-32.h
│ │ │ │ │ │ │ ├── core-64.h
│ │ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ │ ├── fp-32.h
│ │ │ │ │ │ │ ├── fp-64.h
│ │ │ │ │ │ │ ├── fp-sse.h
│ │ │ │ │ │ │ ├── fp-x87.h
│ │ │ │ │ │ │ ├── fp.h
│ │ │ │ │ │ │ └── funcs.h
│ │ │ │ │ │ ├── lightning.h
│ │ │ │ │ │ ├── mips/
│ │ │ │ │ │ │ ├── Makefile.frag
│ │ │ │ │ │ │ ├── README
│ │ │ │ │ │ │ ├── asm.h
│ │ │ │ │ │ │ ├── core-32.h
│ │ │ │ │ │ │ ├── core-64.h
│ │ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ │ ├── fp-32.h
│ │ │ │ │ │ │ ├── fp-64.h
│ │ │ │ │ │ │ ├── fp.h
│ │ │ │ │ │ │ └── funcs.h
│ │ │ │ │ │ ├── ppc/
│ │ │ │ │ │ │ ├── asm.h
│ │ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ │ ├── fp.h
│ │ │ │ │ │ │ └── funcs.h
│ │ │ │ │ │ └── sparc/
│ │ │ │ │ │ ├── asm.h
│ │ │ │ │ │ ├── core.h
│ │ │ │ │ │ ├── fp.h
│ │ │ │ │ │ └── funcs.h
│ │ │ │ │ ├── md5.cpp
│ │ │ │ │ ├── md5.h
│ │ │ │ │ ├── task.cpp
│ │ │ │ │ ├── task.h
│ │ │ │ │ ├── tinycc/
│ │ │ │ │ │ ├── .gitignore
│ │ │ │ │ │ ├── Android_arm.mk
│ │ │ │ │ │ ├── Android_x86.mk
│ │ │ │ │ │ ├── COPYING
│ │ │ │ │ │ ├── Changelog
│ │ │ │ │ │ ├── Makefile
│ │ │ │ │ │ ├── README
│ │ │ │ │ │ ├── TODO
│ │ │ │ │ │ ├── VERSION
│ │ │ │ │ │ ├── arm-gen.c
│ │ │ │ │ │ ├── c67-gen.c
│ │ │ │ │ │ ├── coff.h
│ │ │ │ │ │ ├── config.h
│ │ │ │ │ │ ├── configure
│ │ │ │ │ │ ├── elf.h
│ │ │ │ │ │ ├── examples/
│ │ │ │ │ │ │ ├── ex1.c
│ │ │ │ │ │ │ ├── ex2.c
│ │ │ │ │ │ │ ├── ex3.c
│ │ │ │ │ │ │ ├── ex4.c
│ │ │ │ │ │ │ └── ex5.c
│ │ │ │ │ │ ├── i386-asm.c
│ │ │ │ │ │ ├── i386-asm.h
│ │ │ │ │ │ ├── i386-gen.c
│ │ │ │ │ │ ├── i386-tok.h
│ │ │ │ │ │ ├── il-gen.c
│ │ │ │ │ │ ├── il-opcodes.h
│ │ │ │ │ │ ├── include/
│ │ │ │ │ │ │ ├── float.h
│ │ │ │ │ │ │ ├── stdarg.h
│ │ │ │ │ │ │ ├── stdbool.h
│ │ │ │ │ │ │ ├── stddef.h
│ │ │ │ │ │ │ ├── tcclib.h
│ │ │ │ │ │ │ └── varargs.h
│ │ │ │ │ │ ├── lib/
│ │ │ │ │ │ │ ├── Makefile
│ │ │ │ │ │ │ ├── alloca86-bt.S
│ │ │ │ │ │ │ ├── alloca86.S
│ │ │ │ │ │ │ ├── alloca86_64.S
│ │ │ │ │ │ │ ├── bcheck.c
│ │ │ │ │ │ │ └── libtcc1.c
│ │ │ │ │ │ ├── libtcc.c
│ │ │ │ │ │ ├── libtcc.h
│ │ │ │ │ │ ├── stab.def
│ │ │ │ │ │ ├── stab.h
│ │ │ │ │ │ ├── tcc-doc.texi
│ │ │ │ │ │ ├── tcc.c
│ │ │ │ │ │ ├── tcc.h
│ │ │ │ │ │ ├── tccasm.c
│ │ │ │ │ │ ├── tcccoff.c
│ │ │ │ │ │ ├── tccelf.c
│ │ │ │ │ │ ├── tccgen.c
│ │ │ │ │ │ ├── tccpe.c
│ │ │ │ │ │ ├── tccpp.c
│ │ │ │ │ │ ├── tccrun.c
│ │ │ │ │ │ ├── tcctok.h
│ │ │ │ │ │ ├── tests/
│ │ │ │ │ │ │ ├── Makefile
│ │ │ │ │ │ │ ├── asmtest.S
│ │ │ │ │ │ │ ├── boundtest.c
│ │ │ │ │ │ │ ├── gcctestsuite.sh
│ │ │ │ │ │ │ ├── libtcc_test.c
│ │ │ │ │ │ │ ├── tcctest.c
│ │ │ │ │ │ │ └── tests2/
│ │ │ │ │ │ │ ├── 00_assignment.c
│ │ │ │ │ │ │ ├── 00_assignment.expect
│ │ │ │ │ │ │ ├── 01_comment.c
│ │ │ │ │ │ │ ├── 01_comment.expect
│ │ │ │ │ │ │ ├── 02_printf.c
│ │ │ │ │ │ │ ├── 02_printf.expect
│ │ │ │ │ │ │ ├── 03_struct.c
│ │ │ │ │ │ │ ├── 03_struct.expect
│ │ │ │ │ │ │ ├── 04_for.c
│ │ │ │ │ │ │ ├── 04_for.expect
│ │ │ │ │ │ │ ├── 05_array.c
│ │ │ │ │ │ │ ├── 05_array.expect
│ │ │ │ │ │ │ ├── 06_case.c
│ │ │ │ │ │ │ ├── 06_case.expect
│ │ │ │ │ │ │ ├── 07_function.c
│ │ │ │ │ │ │ ├── 07_function.expect
│ │ │ │ │ │ │ ├── 08_while.c
│ │ │ │ │ │ │ ├── 08_while.expect
│ │ │ │ │ │ │ ├── 09_do_while.c
│ │ │ │ │ │ │ ├── 09_do_while.expect
│ │ │ │ │ │ │ ├── 10_pointer.c
│ │ │ │ │ │ │ ├── 10_pointer.expect
│ │ │ │ │ │ │ ├── 11_precedence.c
│ │ │ │ │ │ │ ├── 11_precedence.expect
│ │ │ │ │ │ │ ├── 12_hashdefine.c
│ │ │ │ │ │ │ ├── 12_hashdefine.expect
│ │ │ │ │ │ │ ├── 13_integer_literals.c
│ │ │ │ │ │ │ ├── 13_integer_literals.expect
│ │ │ │ │ │ │ ├── 14_if.c
│ │ │ │ │ │ │ ├── 14_if.expect
│ │ │ │ │ │ │ ├── 15_recursion.c
│ │ │ │ │ │ │ ├── 15_recursion.expect
│ │ │ │ │ │ │ ├── 16_nesting.c
│ │ │ │ │ │ │ ├── 16_nesting.expect
│ │ │ │ │ │ │ ├── 17_enum.c
│ │ │ │ │ │ │ ├── 17_enum.expect
│ │ │ │ │ │ │ ├── 18_include.c
│ │ │ │ │ │ │ ├── 18_include.expect
│ │ │ │ │ │ │ ├── 18_include.h
│ │ │ │ │ │ │ ├── 19_pointer_arithmetic.c
│ │ │ │ │ │ │ ├── 19_pointer_arithmetic.expect
│ │ │ │ │ │ │ ├── 20_pointer_comparison.c
│ │ │ │ │ │ │ ├── 20_pointer_comparison.expect
│ │ │ │ │ │ │ ├── 21_char_array.c
│ │ │ │ │ │ │ ├── 21_char_array.expect
│ │ │ │ │ │ │ ├── 22_floating_point.c
│ │ │ │ │ │ │ ├── 22_floating_point.expect
│ │ │ │ │ │ │ ├── 23_type_coercion.c
│ │ │ │ │ │ │ ├── 23_type_coercion.expect
│ │ │ │ │ │ │ ├── 24_math_library.c
│ │ │ │ │ │ │ ├── 24_math_library.expect
│ │ │ │ │ │ │ ├── 25_quicksort.c
│ │ │ │ │ │ │ ├── 25_quicksort.expect
│ │ │ │ │ │ │ ├── 26_character_constants.c
│ │ │ │ │ │ │ ├── 26_character_constants.expect
│ │ │ │ │ │ │ ├── 27_sizeof.c
│ │ │ │ │ │ │ ├── 27_sizeof.expect
│ │ │ │ │ │ │ ├── 28_strings.c
│ │ │ │ │ │ │ ├── 28_strings.expect
│ │ │ │ │ │ │ ├── 29_array_address.c
│ │ │ │ │ │ │ ├── 29_array_address.expect
│ │ │ │ │ │ │ ├── 30_hanoi.c
│ │ │ │ │ │ │ ├── 30_hanoi.expect
│ │ │ │ │ │ │ ├── 31_args.c
│ │ │ │ │ │ │ ├── 31_args.expect
│ │ │ │ │ │ │ ├── 32_led.c
│ │ │ │ │ │ │ ├── 32_led.expect
│ │ │ │ │ │ │ ├── 33_ternary_op.c
│ │ │ │ │ │ │ ├── 33_ternary_op.expect
│ │ │ │ │ │ │ ├── 34_array_assignment.c
│ │ │ │ │ │ │ ├── 34_array_assignment.expect
│ │ │ │ │ │ │ ├── 35_sizeof.c
│ │ │ │ │ │ │ ├── 35_sizeof.expect
│ │ │ │ │ │ │ ├── 36_array_initialisers.c
│ │ │ │ │ │ │ ├── 36_array_initialisers.expect
│ │ │ │ │ │ │ ├── 37_sprintf.c
│ │ │ │ │ │ │ ├── 37_sprintf.expect
│ │ │ │ │ │ │ ├── 38_multiple_array_index.c
│ │ │ │ │ │ │ ├── 38_multiple_array_index.expect
│ │ │ │ │ │ │ ├── 39_typedef.c
│ │ │ │ │ │ │ ├── 39_typedef.expect
│ │ │ │ │ │ │ ├── 40_stdio.c
│ │ │ │ │ │ │ ├── 40_stdio.expect
│ │ │ │ │ │ │ ├── 41_hashif.c
│ │ │ │ │ │ │ ├── 41_hashif.expect
│ │ │ │ │ │ │ ├── 42_function_pointer.c
│ │ │ │ │ │ │ ├── 42_function_pointer.expect
│ │ │ │ │ │ │ ├── 43_void_param.c
│ │ │ │ │ │ │ ├── 43_void_param.expect
│ │ │ │ │ │ │ ├── 44_scoped_declarations.c
│ │ │ │ │ │ │ ├── 44_scoped_declarations.expect
│ │ │ │ │ │ │ ├── 45_empty_for.c
│ │ │ │ │ │ │ ├── 45_empty_for.expect
│ │ │ │ │ │ │ ├── 46_grep.c
│ │ │ │ │ │ │ ├── 47_switch_return.c
│ │ │ │ │ │ │ ├── 47_switch_return.expect
│ │ │ │ │ │ │ ├── 48_nested_break.c
│ │ │ │ │ │ │ ├── 48_nested_break.expect
│ │ │ │ │ │ │ ├── 49_bracket_evaluation.c
│ │ │ │ │ │ │ ├── 49_bracket_evaluation.expect
│ │ │ │ │ │ │ ├── 50_logical_second_arg.c
│ │ │ │ │ │ │ ├── 50_logical_second_arg.expect
│ │ │ │ │ │ │ ├── 51_static.c
│ │ │ │ │ │ │ ├── 51_static.expect
│ │ │ │ │ │ │ ├── 52_unnamed_enum.c
│ │ │ │ │ │ │ ├── 52_unnamed_enum.expect
│ │ │ │ │ │ │ ├── 54_goto.c
│ │ │ │ │ │ │ ├── 54_goto.expect
│ │ │ │ │ │ │ ├── 55_lshift_type.c
│ │ │ │ │ │ │ ├── 55_lshift_type.expect
│ │ │ │ │ │ │ ├── LICENSE
│ │ │ │ │ │ │ └── Makefile
│ │ │ │ │ │ ├── tests2/
│ │ │ │ │ │ │ ├── 00_assignment.c
│ │ │ │ │ │ │ ├── 00_assignment.expect
│ │ │ │ │ │ │ ├── 01_comment.c
│ │ │ │ │ │ │ ├── 01_comment.expect
│ │ │ │ │ │ │ ├── 02_printf.c
│ │ │ │ │ │ │ ├── 02_printf.expect
│ │ │ │ │ │ │ ├── 03_struct.c
│ │ │ │ │ │ │ ├── 03_struct.expect
│ │ │ │ │ │ │ ├── 04_for.c
│ │ │ │ │ │ │ ├── 04_for.expect
│ │ │ │ │ │ │ ├── 05_array.c
│ │ │ │ │ │ │ ├── 05_array.expect
│ │ │ │ │ │ │ ├── 06_case.c
│ │ │ │ │ │ │ ├── 06_case.expect
│ │ │ │ │ │ │ ├── 07_function.c
│ │ │ │ │ │ │ ├── 07_function.expect
│ │ │ │ │ │ │ ├── 08_while.c
│ │ │ │ │ │ │ ├── 08_while.expect
│ │ │ │ │ │ │ ├── 09_do_while.c
│ │ │ │ │ │ │ ├── 09_do_while.expect
│ │ │ │ │ │ │ ├── 10_pointer.c
│ │ │ │ │ │ │ ├── 10_pointer.expect
│ │ │ │ │ │ │ ├── 11_precedence.c
│ │ │ │ │ │ │ ├── 11_precedence.expect
│ │ │ │ │ │ │ ├── 12_hashdefine.c
│ │ │ │ │ │ │ ├── 12_hashdefine.expect
│ │ │ │ │ │ │ ├── 13_integer_literals.c
│ │ │ │ │ │ │ ├── 13_integer_literals.expect
│ │ │ │ │ │ │ ├── 14_if.c
│ │ │ │ │ │ │ ├── 14_if.expect
│ │ │ │ │ │ │ ├── 15_recursion.c
│ │ │ │ │ │ │ ├── 15_recursion.expect
│ │ │ │ │ │ │ ├── 16_nesting.c
│ │ │ │ │ │ │ ├── 16_nesting.expect
│ │ │ │ │ │ │ ├── 17_enum.c
│ │ │ │ │ │ │ ├── 17_enum.expect
│ │ │ │ │ │ │ ├── 18_include.c
│ │ │ │ │ │ │ ├── 18_include.expect
│ │ │ │ │ │ │ ├── 18_include.h
│ │ │ │ │ │ │ ├── 19_pointer_arithmetic.c
│ │ │ │ │ │ │ ├── 19_pointer_arithmetic.expect
│ │ │ │ │ │ │ ├── 20_pointer_comparison.c
│ │ │ │ │ │ │ ├── 20_pointer_comparison.expect
│ │ │ │ │ │ │ ├── 21_char_array.c
│ │ │ │ │ │ │ ├── 21_char_array.expect
│ │ │ │ │ │ │ ├── 22_floating_point.c
│ │ │ │ │ │ │ ├── 22_floating_point.expect
│ │ │ │ │ │ │ ├── 23_type_coercion.c
│ │ │ │ │ │ │ ├── 23_type_coercion.expect
│ │ │ │ │ │ │ ├── 24_math_library.c
│ │ │ │ │ │ │ ├── 24_math_library.expect
│ │ │ │ │ │ │ ├── 25_quicksort.c
│ │ │ │ │ │ │ ├── 25_quicksort.expect
│ │ │ │ │ │ │ ├── 26_character_constants.c
│ │ │ │ │ │ │ ├── 26_character_constants.expect
│ │ │ │ │ │ │ ├── 27_sizeof.c
│ │ │ │ │ │ │ ├── 27_sizeof.expect
│ │ │ │ │ │ │ ├── 28_strings.c
│ │ │ │ │ │ │ ├── 28_strings.expect
│ │ │ │ │ │ │ ├── 29_array_address.c
│ │ │ │ │ │ │ ├── 29_array_address.expect
│ │ │ │ │ │ │ ├── 30_hanoi.c
│ │ │ │ │ │ │ ├── 30_hanoi.expect
│ │ │ │ │ │ │ ├── 31_args.c
│ │ │ │ │ │ │ ├── 31_args.expect
│ │ │ │ │ │ │ ├── 32_led.c
│ │ │ │ │ │ │ ├── 32_led.expect
│ │ │ │ │ │ │ ├── 33_ternary_op.c
│ │ │ │ │ │ │ ├── 33_ternary_op.expect
│ │ │ │ │ │ │ ├── 34_array_assignment.c
│ │ │ │ │ │ │ ├── 34_array_assignment.expect
│ │ │ │ │ │ │ ├── 35_sizeof.c
│ │ │ │ │ │ │ ├── 35_sizeof.expect
│ │ │ │ │ │ │ ├── 36_array_initialisers.c
│ │ │ │ │ │ │ ├── 36_array_initialisers.expect
│ │ │ │ │ │ │ ├── 37_sprintf.c
│ │ │ │ │ │ │ ├── 37_sprintf.expect
│ │ │ │ │ │ │ ├── 38_multiple_array_index.c
│ │ │ │ │ │ │ ├── 38_multiple_array_index.expect
│ │ │ │ │ │ │ ├── 39_typedef.c
│ │ │ │ │ │ │ ├── 39_typedef.expect
│ │ │ │ │ │ │ ├── 40_stdio.c
│ │ │ │ │ │ │ ├── 40_stdio.expect
│ │ │ │ │ │ │ ├── 41_hashif.c
│ │ │ │ │ │ │ ├── 41_hashif.expect
│ │ │ │ │ │ │ ├── 42_function_pointer.c
│ │ │ │ │ │ │ ├── 42_function_pointer.expect
│ │ │ │ │ │ │ ├── 43_void_param.c
│ │ │ │ │ │ │ ├── 43_void_param.expect
│ │ │ │ │ │ │ ├── 44_scoped_declarations.c
│ │ │ │ │ │ │ ├── 44_scoped_declarations.expect
│ │ │ │ │ │ │ ├── 45_empty_for.c
│ │ │ │ │ │ │ ├── 45_empty_for.expect
│ │ │ │ │ │ │ ├── 46_grep.c
│ │ │ │ │ │ │ ├── 47_switch_return.c
│ │ │ │ │ │ │ ├── 47_switch_return.expect
│ │ │ │ │ │ │ ├── 48_nested_break.c
│ │ │ │ │ │ │ ├── 48_nested_break.expect
│ │ │ │ │ │ │ ├── 49_bracket_evaluation.c
│ │ │ │ │ │ │ ├── 49_bracket_evaluation.expect
│ │ │ │ │ │ │ ├── 50_logical_second_arg.c
│ │ │ │ │ │ │ ├── 50_logical_second_arg.expect
│ │ │ │ │ │ │ ├── 51_static.c
│ │ │ │ │ │ │ ├── 51_static.expect
│ │ │ │ │ │ │ ├── 52_unnamed_enum.c
│ │ │ │ │ │ │ ├── 52_unnamed_enum.expect
│ │ │ │ │ │ │ ├── 54_goto.c
│ │ │ │ │ │ │ ├── 54_goto.expect
│ │ │ │ │ │ │ ├── 55_lshift_type.c
│ │ │ │ │ │ │ ├── 55_lshift_type.expect
│ │ │ │ │ │ │ ├── LICENSE
│ │ │ │ │ │ │ └── Makefile
│ │ │ │ │ │ ├── texi2pod.pl
│ │ │ │ │ │ ├── ucontext.h
│ │ │ │ │ │ ├── win32/
│ │ │ │ │ │ │ ├── build-tcc.bat
│ │ │ │ │ │ │ ├── examples/
│ │ │ │ │ │ │ │ ├── dll.c
│ │ │ │ │ │ │ │ ├── fib.c
│ │ │ │ │ │ │ │ ├── hello_dll.c
│ │ │ │ │ │ │ │ └── hello_win.c
│ │ │ │ │ │ │ ├── include/
│ │ │ │ │ │ │ │ ├── _mingw.h
│ │ │ │ │ │ │ │ ├── assert.h
│ │ │ │ │ │ │ │ ├── conio.h
│ │ │ │ │ │ │ │ ├── ctype.h
│ │ │ │ │ │ │ │ ├── dir.h
│ │ │ │ │ │ │ │ ├── direct.h
│ │ │ │ │ │ │ │ ├── dirent.h
│ │ │ │ │ │ │ │ ├── dos.h
│ │ │ │ │ │ │ │ ├── errno.h
│ │ │ │ │ │ │ │ ├── excpt.h
│ │ │ │ │ │ │ │ ├── fcntl.h
│ │ │ │ │ │ │ │ ├── fenv.h
│ │ │ │ │ │ │ │ ├── inttypes.h
│ │ │ │ │ │ │ │ ├── io.h
│ │ │ │ │ │ │ │ ├── limits.h
│ │ │ │ │ │ │ │ ├── locale.h
│ │ │ │ │ │ │ │ ├── malloc.h
│ │ │ │ │ │ │ │ ├── math.h
│ │ │ │ │ │ │ │ ├── mem.h
│ │ │ │ │ │ │ │ ├── memory.h
│ │ │ │ │ │ │ │ ├── process.h
│ │ │ │ │ │ │ │ ├── sec_api/
│ │ │ │ │ │ │ │ │ ├── conio_s.h
│ │ │ │ │ │ │ │ │ ├── crtdbg_s.h
│ │ │ │ │ │ │ │ │ ├── io_s.h
│ │ │ │ │ │ │ │ │ ├── mbstring_s.h
│ │ │ │ │ │ │ │ │ ├── search_s.h
│ │ │ │ │ │ │ │ │ ├── stdio_s.h
│ │ │ │ │ │ │ │ │ ├── stdlib_s.h
│ │ │ │ │ │ │ │ │ ├── stralign_s.h
│ │ │ │ │ │ │ │ │ ├── string_s.h
│ │ │ │ │ │ │ │ │ ├── sys/
│ │ │ │ │ │ │ │ │ │ └── timeb_s.h
│ │ │ │ │ │ │ │ │ ├── tchar_s.h
│ │ │ │ │ │ │ │ │ ├── time_s.h
│ │ │ │ │ │ │ │ │ └── wchar_s.h
│ │ │ │ │ │ │ │ ├── setjmp.h
│ │ │ │ │ │ │ │ ├── share.h
│ │ │ │ │ │ │ │ ├── signal.h
│ │ │ │ │ │ │ │ ├── stdint.h
│ │ │ │ │ │ │ │ ├── stdio.h
│ │ │ │ │ │ │ │ ├── stdlib.h
│ │ │ │ │ │ │ │ ├── string.h
│ │ │ │ │ │ │ │ ├── sys/
│ │ │ │ │ │ │ │ │ ├── fcntl.h
│ │ │ │ │ │ │ │ │ ├── file.h
│ │ │ │ │ │ │ │ │ ├── locking.h
│ │ │ │ │ │ │ │ │ ├── stat.h
│ │ │ │ │ │ │ │ │ ├── time.h
│ │ │ │ │ │ │ │ │ ├── timeb.h
│ │ │ │ │ │ │ │ │ ├── types.h
│ │ │ │ │ │ │ │ │ ├── unistd.h
│ │ │ │ │ │ │ │ │ └── utime.h
│ │ │ │ │ │ │ │ ├── tchar.h
│ │ │ │ │ │ │ │ ├── time.h
│ │ │ │ │ │ │ │ ├── vadefs.h
│ │ │ │ │ │ │ │ ├── values.h
│ │ │ │ │ │ │ │ ├── wchar.h
│ │ │ │ │ │ │ │ ├── wctype.h
│ │ │ │ │ │ │ │ └── winapi/
│ │ │ │ │ │ │ │ ├── basetsd.h
│ │ │ │ │ │ │ │ ├── basetyps.h
│ │ │ │ │ │ │ │ ├── guiddef.h
│ │ │ │ │ │ │ │ ├── intrin.h
│ │ │ │ │ │ │ │ ├── poppack.h
│ │ │ │ │ │ │ │ ├── pshpack1.h
│ │ │ │ │ │ │ │ ├── pshpack2.h
│ │ │ │ │ │ │ │ ├── pshpack4.h
│ │ │ │ │ │ │ │ ├── pshpack8.h
│ │ │ │ │ │ │ │ ├── reason.h
│ │ │ │ │ │ │ │ ├── specstrings.h
│ │ │ │ │ │ │ │ ├── stralign.h
│ │ │ │ │ │ │ │ ├── tvout.h
│ │ │ │ │ │ │ │ ├── winbase.h
│ │ │ │ │ │ │ │ ├── wincon.h
│ │ │ │ │ │ │ │ ├── windef.h
│ │ │ │ │ │ │ │ ├── windows.h
│ │ │ │ │ │ │ │ ├── winerror.h
│ │ │ │ │ │ │ │ ├── wingdi.h
│ │ │ │ │ │ │ │ ├── winnetwk.h
│ │ │ │ │ │ │ │ ├── winnls.h
│ │ │ │ │ │ │ │ ├── winnt.h
│ │ │ │ │ │ │ │ ├── winreg.h
│ │ │ │ │ │ │ │ ├── winuser.h
│ │ │ │ │ │ │ │ └── winver.h
│ │ │ │ │ │ │ ├── lib/
│ │ │ │ │ │ │ │ ├── chkstk.S
│ │ │ │ │ │ │ │ ├── crt1.c
│ │ │ │ │ │ │ │ ├── dllcrt1.c
│ │ │ │ │ │ │ │ ├── dllmain.c
│ │ │ │ │ │ │ │ ├── gdi32.def
│ │ │ │ │ │ │ │ ├── kernel32.def
│ │ │ │ │ │ │ │ ├── msvcrt.def
│ │ │ │ │ │ │ │ ├── user32.def
│ │ │ │ │ │ │ │ └── wincrt1.c
│ │ │ │ │ │ │ ├── tcc-win32.txt
│ │ │ │ │ │ │ └── tools/
│ │ │ │ │ │ │ ├── tiny_impdef.c
│ │ │ │ │ │ │ └── tiny_libmaker.c
│ │ │ │ │ │ ├── x86_64-asm.h
│ │ │ │ │ │ └── x86_64-gen.c
│ │ │ │ │ ├── tinyxml/
│ │ │ │ │ │ ├── tinystr.cpp
│ │ │ │ │ │ ├── tinystr.h
│ │ │ │ │ │ ├── tinyxml.cpp
│ │ │ │ │ │ ├── tinyxml.h
│ │ │ │ │ │ ├── tinyxmlerror.cpp
│ │ │ │ │ │ └── tinyxmlparser.cpp
│ │ │ │ │ ├── valuearray.h
│ │ │ │ │ ├── vfat.cpp
│ │ │ │ │ ├── vfat.h
│ │ │ │ │ ├── xstring.cpp
│ │ │ │ │ ├── xstring.h
│ │ │ │ │ └── xstring_r7b.h
│ │ │ │ ├── version.cpp
│ │ │ │ ├── version.h
│ │ │ │ ├── wifi.cpp
│ │ │ │ └── wifi.h
│ │ │ └── wxwin.m4
│ │ ├── desmume_compat.mk
│ │ ├── desmume_neon.mk
│ │ └── desmume_v7.mk
│ └── res/
│ ├── drawable/
│ │ └── bkg_griditem.xml
│ ├── layout/
│ │ ├── about.xml
│ │ ├── activity_main.xml
│ │ ├── cheatedit.xml
│ │ ├── cheatrow.xml
│ │ ├── cheats.xml
│ │ ├── dialog_slider.xml
│ │ ├── dialog_slider_noimg.xml
│ │ ├── file_dialog_main.xml
│ │ ├── file_dialog_row.xml
│ │ ├── fragment_list.xml
│ │ ├── griditem_rom.xml
│ │ └── keymap.xml
│ ├── menu/
│ │ ├── activity_collection.xml
│ │ └── activity_main.xml
│ ├── values/
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── fileendings.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ ├── values-de/
│ │ ├── arrays.xml
│ │ ├── colors.xml
│ │ └── strings.xml
│ ├── values-fr/
│ │ └── strings.xml
│ ├── values-he/
│ │ └── strings.xml
│ ├── values-it/
│ │ └── strings.xml
│ ├── values-ja/
│ │ └── strings.xml
│ ├── values-ko/
│ │ └── strings.xml
│ ├── values-nl/
│ │ └── strings.xml
│ ├── values-pt/
│ │ └── strings.xml
│ ├── values-pt-rBR/
│ │ └── strings.xml
│ ├── values-ro/
│ │ └── strings.xml
│ ├── values-sw600dp/
│ │ └── dimens.xml
│ ├── values-sw720dp-land/
│ │ └── dimens.xml
│ ├── values-v11/
│ │ └── styles.xml
│ ├── values-v14/
│ │ └── styles.xml
│ ├── values-zh-rCN/
│ │ └── strings.xml
│ └── xml/
│ ├── keymap.xml
│ └── settings.xml
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Built application files
/*/build/
app/src/main/libs
app/src/main/objs
build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
.gradle/
# Signing files
.signing/
# User-specific configurations
.idea/libraries/
.idea/workspace.xml
.idea/tasks.xml
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
*.iml
# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
*.bak
================================================
FILE: .idea/gradle.xml
================================================
================================================
FILE: .idea/runConfigurations.xml
================================================
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: README.md
================================================
# nds4droid
nds4droid is a free (including ad-free) open source Nintendo DS emulator for Android smartphones. It is based off of [DeSmuME](https://en.wikipedia.org/wiki/DeSmuME) and has a wide variety of options for balancing performance and accuracy. In addition, it has been translated into several languages. Enjoy!
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
android {
compileSdkVersion 10
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.opendoorstudios.ds4droid"
minSdkVersion 10
targetSdkVersion 10
}
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile files('libs/ouya-sdk.jar')
}
================================================
FILE: app/lint.xml
================================================
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/About.java
================================================
package com.opendoorstudios.ds4droid;
import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.widget.TextView;
public class About extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.about);
final TextView textVersion = (TextView)findViewById(R.id.about_versionstring);
final StringBuilder build = new StringBuilder();
String family, library;
DeSmuME.load();
switch(DeSmuME.getCPUFamily()) {
case 1: family = "ARM"; break;
case 2: family = "x86"; break;
default: family = "unknown"; break;
}
switch(DeSmuME.getCPUType()) {
case DeSmuME.CPUTYPE_COMPAT: library = "compat"; break;
case DeSmuME.CPUTYPE_V7: library = "v7"; break;
case DeSmuME.CPUTYPE_NEON: library = "neon"; break;
default: library = "unknown";
}
String version = null;
try {
version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(version == null)
version = "unknown";
build.append(getString(R.string.app_name)).append(" ").append(version).append(
" ").append(family).append("/").append(library);
textVersion.setText(build.toString());
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/Button.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.util.HashMap;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Rect;
import android.preference.PreferenceManager;
class Button {
Button(int id) {
this.id = id;
this.position = null;
this.bitmap = null;
}
Button(Rect position, int id) {
this.position = position;
this.id = id;
this.bitmap = null;
}
Button(Rect position, int id, Bitmap bitmap) {
this.position = position;
this.id = id;
this.bitmap = bitmap;
}
static final Button L_PORT_DEFAULT = new Button(new Rect(0, 590, 160, 680), Button.BUTTON_L);
static final Button R_PORT_DEFAULT = new Button(new Rect(610, 590, 768, 680), Button.BUTTON_R);
static final Button TOUCH_PORT_DEFAULT = new Button(new Rect(320, 590, 441, 659), Button.BUTTON_TOUCH);
static final Button DPAD_PORT_DEFAULT = new Button(new Rect(0, 760, 334, 1074), Button.BUTTON_DPAD);
static final Button ABXY_PORT_DEFAULT = new Button(new Rect(397, 755, 759, 1072), Button.BUTTON_ABXY);
static final Button START_PORT_DEFAULT = new Button(new Rect(270, 1082, 366, 1147), Button.BUTTON_START);
static final Button SELECT_PORT_DEFAULT = new Button(new Rect(400, 1082, 485, 1145), Button.BUTTON_SELECT);
//static final Button FASTFORWARD_PORT_DEFAULT = new Button(new Rect(595, 1190, 713, 1281), Button.BUTTON_FASTFORWARD);
static final Button OPTIONS_DEFAULT = new Button(new Rect(620, 1068, 768, 1152), Button.BUTTON_OPTIONS);
static final Button L_LAND_DEFAULT = new Button(new Rect(0, 0, 160, 90), Button.BUTTON_L);
static final Button R_LAND_DEFAULT = new Button(new Rect(994, 0, 1152, 90), Button.BUTTON_R);
static final Button DPAD_LAND_DEFAULT = new Button(new Rect(0, 454, 334, 768), Button.BUTTON_DPAD);
static final Button ABXY_LAND_DEFAULT = new Button(new Rect(770, 451, 1132, 768), Button.BUTTON_ABXY);
static final Button START_LAND_DEFAULT = new Button(new Rect(380, 703, 476, 768), Button.BUTTON_START);
static final Button TOUCH_LAND_DEFAULT = new Button(new Rect(506, 703, 627, 768), Button.BUTTON_TOUCH);
static final Button SELECT_LAND_DEFAULT = new Button(new Rect(667, 703, 752, 768), Button.BUTTON_SELECT);
//static final Button FASTFORWARD_LAND_DEFAULT = new Button(new Rect(487, 0, 645, 90), Button.BUTTON_FASTFORWARD);
static final Button OPTIONS_LAND_DEFAULT = new Button(new Rect(502, 0, 650, 84), Button.BUTTON_OPTIONS);
static final HashMap portraitToDefault;
static final HashMap landscapeToDefault;
static {
portraitToDefault = new HashMap();
portraitToDefault.put(Button.BUTTON_L, L_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_R, R_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_TOUCH, TOUCH_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_DPAD, DPAD_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_ABXY, ABXY_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_START, START_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_SELECT, SELECT_PORT_DEFAULT);
//portraitToDefault.put(Button.BUTTON_FASTFORWARD, FASTFORWARD_PORT_DEFAULT);
portraitToDefault.put(Button.BUTTON_OPTIONS, OPTIONS_DEFAULT);
landscapeToDefault = new HashMap();
landscapeToDefault.put(Button.BUTTON_L, L_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_R, R_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_TOUCH, TOUCH_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_DPAD, DPAD_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_ABXY, ABXY_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_START, START_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_SELECT, SELECT_LAND_DEFAULT);
//landscapeToDefault.put(Button.BUTTON_FASTFORWARD, FASTFORWARD_LAND_DEFAULT);
landscapeToDefault.put(Button.BUTTON_OPTIONS, OPTIONS_LAND_DEFAULT);
}
static Button load(Context context, int id, int resId, boolean landscape, boolean is565, Rect screen, Rect space, boolean forceLoad) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
final String prefLayoutBase = "Controls." + (landscape ? "Landscape." : "Portrait.");
final String prefBase = prefLayoutBase + getButtonName(id) + "." ;
final Button template = landscape ? landscapeToDefault.get(id) : portraitToDefault.get(id);
if(forceLoad || prefs.getBoolean(prefLayoutBase + "Draw" , true)) {
float controlxscale = (float)screen.width() / (float)space.width();
float controlyscale = (float)screen.height() / (float)space.height();
final Rect finalRect = new Rect(prefs.getInt(prefBase + "Left", (int) (template.position.left * controlxscale)),
prefs.getInt(prefBase + "Top", (int) (template.position.top * controlyscale)),
prefs.getInt(prefBase + "Right", (int) (template.position.right * controlxscale)),
prefs.getInt(prefBase + "Bottom", (int) (template.position.bottom * controlyscale)));
final BitmapFactory.Options controlOptions = new BitmapFactory.Options();
if(is565)
controlOptions.inPreferredConfig = Bitmap.Config.RGB_565;
final Bitmap originalControls = BitmapFactory.decodeResource(context.getResources(), resId, controlOptions);
final Bitmap controls = Bitmap.createScaledBitmap(originalControls, finalRect.width(), finalRect.height(), true);
return new Button(finalRect, id, controls);
}
else
return new Button(template.position, id);
}
static String getButtonName(int id) {
switch(id) {
case BUTTON_RIGHT: return "Right";
case BUTTON_DOWN: return "Down";
case BUTTON_UP: return "Up";
case BUTTON_LEFT: return "Left";
case BUTTON_A: return "A";
case BUTTON_B: return "B";
case BUTTON_X: return "X";
case BUTTON_Y: return "Y";
case BUTTON_L: return "L";
case BUTTON_R: return "R";
case BUTTON_START: return "Start";
case BUTTON_SELECT: return "Select";
case BUTTON_TOUCH: return "Touch";
case BUTTON_DPAD: return "DPad";
case BUTTON_ABXY: return "ABXY";
case BUTTON_UPLEFT: return "UpLeft";
case BUTTON_UPRIGHT: return "UpRight";
case BUTTON_DOWNLEFT: return "DownLeft";
case BUTTON_DOWNRIGHT: return "DownRight";
case BUTTON_OPTIONS: return "Options";
//case BUTTON_FASTFORWARD: return "Fast forward";
default: return "Unknown";
}
}
void apply(int[] states, boolean on) {
final int val = on ? 1 : 0;
switch(id) {
case BUTTON_UPLEFT:
states[Button.BUTTON_UP] = states[Button.BUTTON_LEFT] = val;
break;
case BUTTON_UPRIGHT:
states[Button.BUTTON_UP] = states[Button.BUTTON_RIGHT] = val;
break;
case BUTTON_DOWNLEFT:
states[Button.BUTTON_DOWN] = states[Button.BUTTON_LEFT] = val;
break;
case BUTTON_DOWNRIGHT:
states[Button.BUTTON_DOWN] = states[Button.BUTTON_RIGHT] = val;
break;
default:
if(id >= 0 && id < states.length)
states[id] = val;
break;
}
}
void applyToPrefs(SharedPreferences prefs, boolean landscape, boolean overwrite) {
final String prefLayoutBase = "Controls." + (landscape ? "Landscape." : "Portrait.");
final String prefBase = prefLayoutBase + getButtonName(id) + "." ;
if(prefs.contains(prefBase + "Left") && !overwrite)
return;
prefs.edit().putInt(prefBase + "Left", position.left).putInt(prefBase + "Top", position.top).putInt(prefBase + "Right", position.right).putInt(prefBase + "Bottom", position.bottom).apply();
}
static final int BUTTON_RIGHT = 0;
static final int BUTTON_DOWN = 1;
static final int BUTTON_UP = 2;
static final int BUTTON_LEFT = 3;
static final int BUTTON_A = 4;
static final int BUTTON_B = 5;
static final int BUTTON_X = 6;
static final int BUTTON_Y = 7;
static final int BUTTON_L = 8;
static final int BUTTON_R = 9;
static final int BUTTON_START = 10;
static final int BUTTON_SELECT = 11;
//meta buttons, aren't actually passed down
static final int BUTTON_TOUCH = 12;
static final int BUTTON_DPAD = 13;
static final int BUTTON_ABXY = 14;
static final int BUTTON_UPLEFT = 15;
static final int BUTTON_UPRIGHT = 16;
static final int BUTTON_DOWNLEFT = 17;
static final int BUTTON_DOWNRIGHT = 18;
static final int BUTTON_OPTIONS = 19;
//static final int BUTTON_FASTFORWARD = 20;
final Bitmap bitmap;
Rect position;
final int id;
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/ButtonLayoutEditor.java
================================================
package com.opendoorstudios.ds4droid;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
public class ButtonLayoutEditor extends Activity {
final int[] buttonsToLoad = { Button.BUTTON_L, Button.BUTTON_R, Button.BUTTON_TOUCH, Button.BUTTON_SELECT,
Button.BUTTON_START, Button.BUTTON_DPAD, Button.BUTTON_ABXY, Button.BUTTON_OPTIONS };
final int[] buttonResIds = { R.drawable.l, R.drawable.r, R.drawable.touch, R.drawable.select,
R.drawable.start, R.drawable.dpad, R.drawable.abxy, R.drawable.menu };
Bundle savedValues = null;
ButtonEditorView view = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(view = new ButtonEditorView(this));
savedValues = savedInstanceState;
}
@Override
public void onStop() {
super.onStop();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
for(Editing button : view.buttons) {
if(!button.position.equals(button.button.position)) {
button.button.position = button.position;
button.button.applyToPrefs(prefs, view.landscape, true);
}
}
}
static class Editing {
Editing(Button button) {
this.button = button;
sourceBitmapRect = new Rect(0, 0, button.bitmap.getWidth(), button.bitmap.getHeight());
position = new Rect(button.position.left, button.position.top, button.position.right, button.position.bottom);
}
final Button button;
int startX;
int startY;
final Rect sourceBitmapRect;
Rect startRect;
Rect position;
}
class ButtonEditorView extends SurfaceView implements Callback {
public ButtonEditorView(Context context) {
super(context);
setWillNotDraw(false);
getHolder().addCallback(this);
scaleDetector = new ScaleGestureDetector(ButtonLayoutEditor.this, new ScaleListener());
}
final ScaleGestureDetector scaleDetector;
class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
int x = (int)detector.getFocusX();
int y = (int)detector.getFocusY();
for(Editing button : buttons) {
if(button.position.contains(x, y)) {
scaling = button;
invalidate();
break;
}
}
handledScaleEvent = true;
return true;
}
@Override
public boolean onScale(ScaleGestureDetector detector) {
if(scaling == null)
return false;
//Log.i(MainActivity.TAG, "Scale factor: " + detector.getScaleFactor());
final int scaleX = (int) (scaling.position.width() * (detector.getScaleFactor() - 1.0f));
final int scaleY = (int) (scaling.position.height() * (detector.getScaleFactor() - 1.0f));
//TODO: weigh the initial spot
scaling.position.left -= (scaleX / 2);
scaling.position.right += (scaleX / 2);
scaling.position.top -= (scaleY / 2);
scaling.position.bottom += (scaleY / 2);
invalidate();
handledScaleEvent = true;
return true;
}
@Override
public void onScaleEnd(ScaleGestureDetector detector) {
scaling = null;
handledScaleEvent = true;
}
}
final ArrayList buttons = new ArrayList();
boolean landscape;
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
landscape = width > height;
boolean is565 = format == PixelFormat.RGB_565;
for(int i = 0 ; i < buttonsToLoad.length ; ++i) {
final int id = buttonsToLoad[i];
final Button button = Button.load(ButtonLayoutEditor.this, id, buttonResIds[i],
landscape, is565, new Rect(0, 0, width, height), landscape ? Controls.defaultLandSpace : Controls.defaultPortSpace, true);
if(savedValues != null) {
final Object saved = savedValues.get(Button.getButtonName(id));
if(saved != null && saved instanceof Rect)
button.position = (Rect)saved;
}
buttons.add(new Editing(button));
}
savedValues = null;
invalidate();
}
@Override
public void onDraw(Canvas canvas) {
for(Editing button : buttons) {
if(button.button.bitmap != null)
canvas.drawBitmap(button.button.bitmap, button.sourceBitmapRect, button.position, null);
}
}
@Override
public void surfaceCreated(SurfaceHolder holder) {
}
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
}
final HashMap editing = new HashMap();
Editing scaling = null;
boolean handledScaleEvent = false;
@Override
public boolean onTouchEvent(MotionEvent event) {
scaleDetector.onTouchEvent(event);
if(handledScaleEvent) {
handledScaleEvent = false;
return true;
}
int i = event.getActionIndex();
int id = event.getPointerId(i);
int x = (int) event.getX(i);
int y = (int) event.getY(i);
final Editing edit = editing.get(id);
switch(event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_POINTER_DOWN:
for(Editing button : buttons) {
if(button.position.contains(x, y)) {
button.startX = x;
button.startY = y;
button.startRect = new Rect(button.position.left, button.position.top, button.position.right, button.position.bottom);
editing.put(id, button);
invalidate();
break;
}
}
break;
case MotionEvent.ACTION_MOVE:
case MotionEvent.ACTION_UP:
if(edit != null) {
final int deltaX = x - edit.startX;
final int deltaY = y - edit.startY;
edit.position.left = edit.startRect.left + deltaX;
edit.position.right = edit.startRect.right + deltaX;
edit.position.top = edit.startRect.top + deltaY;
edit.position.bottom = edit.startRect.bottom + deltaY;
if(event.getActionMasked() == MotionEvent.ACTION_UP) {
editing.remove(id);
}
invalidate();
}
break;
case MotionEvent.ACTION_CANCEL:
if(edit != null)
editing.remove(edit);
invalidate();
break;
}
return true;
}
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/Cheats.java
================================================
package com.opendoorstudios.ds4droid;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.TextView;
public class Cheats extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cheats);
inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);
cheatList = (ListView) findViewById(R.id.cheatList);
cheatList.setAdapter(adapter = new CheatAdapter());
final android.widget.Button addButton = (android.widget.Button)findViewById(R.id.addcheat);
addButton.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
currentlyEditing = -1;
showEditDialog();
}
});
}
CheatAdapter adapter = null;
ListView cheatList = null;
LayoutInflater inflater;
int currentlyEditing = -1;
TextView editingDescription, editingCode;
boolean editingCheckedState = false;
void showEditDialog() {
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
View cheatEditView;
final AlertDialog dialog = builder.setPositiveButton(R.string.OK, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(currentlyEditing == -1)
DeSmuME.addCheat(editingDescription.getText().toString(), editingCode.getText().toString());
else
DeSmuME.updateCheat(editingDescription.getText().toString(), editingCode.getText().toString(), currentlyEditing);
DeSmuME.saveCheats();
adapter.notifyDataSetChanged();
dialog.dismiss();
}
}).setNegativeButton(R.string.cancel, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).setView(cheatEditView = inflater.inflate(R.layout.cheatedit, null)).create();
editingDescription = (TextView) cheatEditView.findViewById(R.id.cheatDesc);
editingCode = (TextView) cheatEditView.findViewById(R.id.cheatCode);
if(currentlyEditing != -1) {
editingDescription.setText(DeSmuME.getCheatName(currentlyEditing));
editingCode.setText(DeSmuME.getCheatCode(currentlyEditing));
}
dialog.show();
}
class CheatAdapter extends BaseAdapter {
@Override
public int getCount() {
return DeSmuME.getNumberOfCheats();
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null) {
convertView = inflater.inflate(R.layout.cheatrow, null);
final android.widget.Button edit = (Button) convertView.findViewById(R.id.cheatEdit);
final android.widget.Button delete = (Button) convertView.findViewById(R.id.cheatDelete);
edit.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
final Object tag = v.getTag();
if(tag != null && tag instanceof Integer) {
currentlyEditing = (Integer)tag;
showEditDialog();
}
}
});
delete.setOnClickListener(new android.view.View.OnClickListener() {
@Override
public void onClick(View v) {
final Object tag = v.getTag();
if(tag != null && tag instanceof Integer) {
DeSmuME.deleteCheat((Integer)tag);
notifyDataSetChanged();
}
}
});
}
final CheckBox cheatEnabled = (CheckBox) convertView.findViewById(R.id.cheatEnabled);
cheatEnabled.setText(DeSmuME.getCheatName(position));
editingCheckedState = true;
cheatEnabled.setChecked(DeSmuME.getCheatEnabled(position));
editingCheckedState = false; //dunno if we need to do this or not
cheatEnabled.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(editingCheckedState)
return;
final Object tag = buttonView.getTag();
if(tag != null && tag instanceof Integer)
DeSmuME.setCheatEnabled((Integer)tag, isChecked);
}
});
cheatEnabled.setTag(Integer.valueOf(position));
final android.widget.Button edit = (Button) convertView.findViewById(R.id.cheatEdit);
edit.setTag(Integer.valueOf(position));
edit.setEnabled(DeSmuME.getCheatType(position) == 1); //only support editing AR codes for now
final android.widget.Button delete = (Button) convertView.findViewById(R.id.cheatDelete);
delete.setTag(Integer.valueOf(position));
return convertView;
}
}
@Override
public void onStop() {
super.onStop();
DeSmuME.saveCheats();
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/Controls.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;
import com.opendoorstudios.ds4droid.MainActivity.NDSView;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.preference.PreferenceManager;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.HapticFeedbackConstants;
import android.view.KeyEvent;
import android.view.MotionEvent;
class Controls {
float xscale = 0, yscale = 0;
final Paint controlsPaint = new Paint();
NDSView view;
boolean landscape;
int currentAlpha = -1;
Rect screen;
int screenWidth = 0, screenHeight = 0;
int xBlack = 0, yBlack = 0;
Controls(NDSView view) {
this.view = view;
}
public void setView(NDSView view) {
this.view = view;
}
Button touchButton;
//Button fastForwardButton;
Button optionsButton;
final SparseArray keyMappings = new SparseArray();
public static final int[] KEYS_WITH_MAPPINGS = new int[] { Button.BUTTON_UP, Button.BUTTON_DOWN, Button.BUTTON_LEFT, Button.BUTTON_RIGHT,
Button.BUTTON_A, Button.BUTTON_B, Button.BUTTON_X, Button.BUTTON_Y, Button.BUTTON_START, Button.BUTTON_SELECT,
Button.BUTTON_TOUCH, Button.BUTTON_L, Button.BUTTON_R, Button.BUTTON_OPTIONS };
void loadMappings(Context context) {
keyMappings.clear();
final HashMap> buildKey = new HashMap>();
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
for(int id : KEYS_WITH_MAPPINGS) {
int map = prefs.getInt("Controls.KeyMap." + Button.getButtonName(id), 0);
if(map != 0) {
if(!buildKey.containsKey(map))
buildKey.put(map, new LinkedList());
buildKey.get(map).add(id);
}
}
//iterating over hashmaps is like 10x more complicated than it needs to be
final Iterator>> it = buildKey.entrySet().iterator();
while(it.hasNext()) {
final Entry> entry = it.next();
final int[] thisKeysMappings = new int[entry.getValue().size()];
int counter = 0;
for(Integer mapping : entry.getValue())
thisKeysMappings[counter++] = mapping.intValue();
keyMappings.put(entry.getKey(), thisKeysMappings);
}
}
void loadControls(Context context, int screenWidth, int screenHeight, int xBlack, int yBlack, int screenOption, boolean is565, boolean landscape) {
screen = new Rect(0, 0, this.screenWidth = screenWidth, this.screenHeight = screenHeight);
this.xBlack = xBlack;
this.yBlack = yBlack;
xscale = (float)(screen.width() - (xBlack * 2)) / (screenOption == 0 ? (landscape ? 512.0f : 256.0f) : 256.0f);
yscale = (float)(screen.height() - (yBlack*2)) / (screenOption == 0 ? (landscape ? 192.0f : 384.0f) : 192.0f);
for(int i = 0 ; i < buttonStates.length ; ++i)
buttonStates[i] = 0;
buttonsToDraw.clear();
buttonsToProcess.clear();
activeTouches.clear();
this.landscape = landscape;
final Rect space = landscape ? defaultLandSpace : defaultPortSpace;
final Button l = Button.load(context, Button.BUTTON_L, R.drawable.l, landscape, is565, screen, space, false);
if(l.bitmap != null) {
buttonsToDraw.add(l);
buttonsToProcess.add(l);
}
final Button r = Button.load(context, Button.BUTTON_R, R.drawable.r, landscape, is565, screen, space, false);
if(r.bitmap != null) {
buttonsToDraw.add(r);
buttonsToProcess.add(r);
}
touchButton = Button.load(context, Button.BUTTON_TOUCH, R.drawable.touch, landscape, is565, screen, space, false);
if(touchButton.bitmap != null)
buttonsToDraw.add(touchButton);
final Button start = Button.load(context, Button.BUTTON_START, R.drawable.start, landscape, is565, screen, space, false);
if(start.bitmap != null) {
buttonsToDraw.add(start);
buttonsToProcess.add(start);
}
final Button select = Button.load(context, Button.BUTTON_SELECT, R.drawable.select, landscape, is565, screen, space, false);
if(select.bitmap != null) {
buttonsToDraw.add(select);
buttonsToProcess.add(select);
}
/*
fastForwardButton = Button.load(context, Button.BUTTON_FASTFORWARD, R.drawable.ff, landscape, is565, space, space, false);
if(fastForwardButton.bitmap != null)
buttonsToDraw.add(fastForwardButton);
*/
optionsButton = Button.load(context, Button.BUTTON_OPTIONS, R.drawable.menu, landscape, is565, screen, space, false);
if(optionsButton.bitmap != null)
buttonsToDraw.add(optionsButton);
final Button dpad = Button.load(context, Button.BUTTON_DPAD, R.drawable.dpad, landscape, is565, screen, space, false);
if(dpad.bitmap != null) {
buttonsToDraw.add(dpad);
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.334f, 0.0f, 0.647f, 0.353f), Button.BUTTON_UP));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.631f, 0.35f, 0.973f, 0.643f), Button.BUTTON_RIGHT));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.0f, 0.35f, 0.356f, 0.643f), Button.BUTTON_LEFT));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.334f, 0.643f, 0.647f, 1.0f), Button.BUTTON_DOWN));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.026f, 0.047f, 0.344f, 0.334f), Button.BUTTON_UPLEFT));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.64f, 0.047f, 0.862f, 0.334f), Button.BUTTON_UPRIGHT));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.026f, 0.65f, 0.344f, 0.926f), Button.BUTTON_DOWNLEFT));
buttonsToProcess.add(new Button(getRatioRect(dpad.position, 0.64f, 0.65f, 0.862f, 0.926f), Button.BUTTON_DOWNRIGHT));
}
final Button abxy = Button.load(context, Button.BUTTON_ABXY, R.drawable.abxy, landscape, is565, screen, space, false);
if(abxy.bitmap != null) {
buttonsToDraw.add(abxy);
buttonsToProcess.add(new Button(getRatioRect(abxy.position, 0.317f, 0.0f, 0.676f, 0.378f), Button.BUTTON_X));
buttonsToProcess.add(new Button(getRatioRect(abxy.position, 0.662f, 0.293f, 1.0f, 0.681f), Button.BUTTON_A));
buttonsToProcess.add(new Button(getRatioRect(abxy.position, 0.317f, 0.611f, 0.676f, 1.0f), Button.BUTTON_B));
buttonsToProcess.add(new Button(getRatioRect(abxy.position, 0.0f, 0.293f, 0.334f, 0.681f), Button.BUTTON_Y));
}
}
static Rect getRatioRect(Rect base, float left, float top, float right, float bottom) {
final int width = base.width();
final int height = base.height();
return new Rect(
(int)(base.left + (width * left)),
(int)(base.top + (height * top)),
(int)(base.left + (width * right)),
(int)(base.top + (height * bottom))
);
}
//These coordinates are in our "native" coordinate space, which was arbitrarily chosen to be 768x1152 (exactly three times the DS native resolution)
public static final Rect defaultPortSpace = new Rect(0, 0, 768, 1152);
public static final Rect defaultLandSpace = new Rect(0, 0, 1152, 768);
//These are the final on/off values that will get sent to the emulator.
//They go from BUTTON_RIGHT to BUTTON_SELECT
final int[] buttonStates = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
//This map goes from pointer id (from the android os) to the different buttons we have
final SparseArray activeTouches = new SparseArray();
final ArrayList buttonsToDraw = new ArrayList();
final ArrayList buttonsToProcess = new ArrayList();
boolean touchScreenProcess(MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
float x = event.getX();
float y = event.getY();
if( x < xBlack || x > screenWidth - xBlack)
return true;
if( y < yBlack || y > screenHeight - yBlack)
return true;
x -= xBlack;
y -= yBlack;
x /= xscale;
y /= yscale;
//convert to bottom touch screen coordinates
if(landscape && view.dontRotate) {
final float newy = x / 1.33f;
final float newx = (192 - y) * 1.33f;
x = newx;
y = newy;
}
if(landscape && !view.dontRotate) {
if(!view.lcdSwap) {
if(view.screenOption != 2) // 2 is "touch only"
x -= 256;
if(x >= 0)
DeSmuME.touchScreenTouch((int)x, (int)y);
}
else {
if(x < 256)
DeSmuME.touchScreenTouch((int)x, (int)y);
}
}
else {
if(!view.lcdSwap) {
if(view.screenOption != 2) // 2 is "touch only"
y -= 192;
if(y >= 0)
DeSmuME.touchScreenTouch((int)x, (int)y);
}
else {
if(y < 192)
DeSmuME.touchScreenTouch((int)x, (int)y);
}
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
DeSmuME.touchScreenRelease();
if(touchButton.bitmap != null && !view.forceTouchScreen && touchButton.position.contains((int)event.getX(), (int)event.getY())) {
DeSmuME.touchScreenMode = false;
}
break;
default:
return false;
}
return true;
}
boolean onTouchEvent(MotionEvent event) {
if(xscale == 0 || yscale == 0)
return false;
if(DeSmuME.touchScreenMode || view.forceTouchScreen)
return touchScreenProcess(event);
else
{
switch(event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_POINTER_DOWN:
case MotionEvent.ACTION_MOVE:
{
int i = event.getActionIndex();
int id = event.getPointerId(i);
final Button existingTouch = activeTouches.get(id);
if(existingTouch != null) {
//reset touch, it may get re-set below but we need to deal with sliding off a button
existingTouch.apply(buttonStates, false);
}
int x = (int) event.getX(i);
int y = (int) event.getY(i);
boolean pressedButton = false;
for(Button process : buttonsToProcess) {
if(process.position.contains(x, y)) {
process.apply(buttonStates, true);
activeTouches.put(id, process);
if(view.haptic && (event.getActionMasked() != MotionEvent.ACTION_MOVE))
view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
pressedButton = true;
break;
}
}
/*
if(fastForwardButton.bitmap != null && fastForwardButton.position.contains(x, y))
DeSmuME.fastForwardMode = true;
*/
if(!pressedButton && view.alwaysTouch)
return touchScreenProcess(event);
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
if(touchButton.bitmap != null && touchButton.position.contains((int)event.getX(), (int)event.getY())) {
DeSmuME.touchScreenMode = true;
activeTouches.clear();
break;
}
/*
if(fastForwardButton.bitmap != null && fastForwardButton.position.contains((int)event.getX(), (int)event.getY()))
DeSmuME.fastForwardMode = false;
*/
if(view.alwaysTouch)
touchScreenProcess(event);
if(optionsButton.bitmap != null && optionsButton.position.contains((int)event.getX(), (int)event.getY()))
view.showMenu();
//FT
case MotionEvent.ACTION_CANCEL:
{
int i = event.getActionIndex();
int id = event.getPointerId(i);
Button button = activeTouches.get(id);
if(button == null)
break;
button.apply(buttonStates, false);
activeTouches.remove(id);
/*
if(fastForwardButton.bitmap != null && fastForwardButton.position.contains((int)event.getX(), (int)event.getY()))
DeSmuME.fastForwardMode = false;
*/
}
break;
default:
return false;
}
sendStates();
return true;
}
}
boolean onKeyDown(int keyCode, KeyEvent event) {
final int[] mappings = keyMappings.get(keyCode, null);
if(mappings == null)
return false;
for(int button : mappings) {
if(button >=0 && button < buttonStates.length)
buttonStates[button] = 1;
}
sendStates();
return true;
}
boolean onKeyUp(int keyCode, KeyEvent event) {
final int[] mappings = keyMappings.get(keyCode, null);
if(mappings == null)
return false;
for(int button : mappings) {
if(button >=0 && button < buttonStates.length)
buttonStates[button] = 0;
else if(button == Button.BUTTON_TOUCH)
DeSmuME.touchScreenMode = !DeSmuME.touchScreenMode;
else if(button == Button.BUTTON_OPTIONS)
view.showMenu();
}
sendStates();
return true;
}
void sendStates() {
DeSmuME.setButtons(buttonStates[Button.BUTTON_L], buttonStates[Button.BUTTON_R], buttonStates[Button.BUTTON_UP], buttonStates[Button.BUTTON_DOWN], buttonStates[Button.BUTTON_LEFT], buttonStates[Button.BUTTON_RIGHT],
buttonStates[Button.BUTTON_A], buttonStates[Button.BUTTON_B], buttonStates[Button.BUTTON_X], buttonStates[Button.BUTTON_Y],
buttonStates[Button.BUTTON_START], buttonStates[Button.BUTTON_SELECT], DeSmuME.lidOpen ? 1 : 0);
}
void drawControls(Canvas canvas) {
if(view.forceTouchScreen)
return;
if(currentAlpha != view.buttonAlpha)
controlsPaint.setAlpha(currentAlpha = view.buttonAlpha);
if(DeSmuME.touchScreenMode) {
if(touchButton.bitmap != null)
canvas.drawBitmap(touchButton.bitmap, touchButton.position.left, touchButton.position.top, controlsPaint);
}
else {
for(Button button : buttonsToDraw) {
if(button.bitmap != null && button.position != null)
canvas.drawBitmap(button.bitmap, button.position.left, button.position.top, controlsPaint);
}
}
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/DeSmuME.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.preference.PreferenceManager;
import android.util.Log;
class DeSmuME {
public static Context context;
static boolean loaded = false;
static final int CPUTYPE_COMPAT = 0;
static final int CPUTYPE_V7 = 1;
static final int CPUTYPE_NEON = 2;
static void load()
{
if(loaded)
return;
System.loadLibrary("cpudetect");
final int cpuType = getCPUType();
switch(cpuType) {
case CPUTYPE_NEON:
System.loadLibrary("desmumeneon");
Log.i(MainActivity.TAG, "Using NEON enhanced native library");
break;
case CPUTYPE_V7:
System.loadLibrary("desmumev7");
Log.i(MainActivity.TAG, "Using ARMv7 native library");
break;
default:
System.loadLibrary("desmumecompat");
Log.i(MainActivity.TAG, "Using compatibility native library");
break;
}
loaded = true;
}
static native int getCPUType();
static native int getCPUFamily();
static native void init();
static native void runCore();
static native void resize(Bitmap bitmap);
static native int draw(Bitmap bitmapMain, Bitmap bitmapTouch, boolean rotate);
static native void touchScreenTouch(int x, int y);
static native void touchScreenRelease();
static native void setButtons(int l, int r, int up, int down, int left, int right, int a, int b, int x, int y, int start, int select, int lid);
static native boolean loadRom(String path);
static native void setWorkingDir(String path, String temp);
static native void saveState(int slot);
static native void restoreState(int slot);
static native void loadSettings();
static native int getNativeWidth();
static native int getNativeHeight();
static native void setFilter(int index);
static native void change3D(int set);
static native void changeSound(int set);
static native void setSoundPaused(int set);
static native void reloadFirmware();
static native int getNumberOfCheats();
static native String getCheatName(int pos);
static native boolean getCheatEnabled(int pos);
static native String getCheatCode(int pos);
static native int getCheatType(int pos);
static native void addCheat(String description, String code);
static native void updateCheat(String description, String code, int pos);
static native void saveCheats();
static native void setCheatEnabled(int pos, boolean enabled);
static native void deleteCheat(int pos);
static native void setMicPaused(int set);
static native void closeRom();
static native void exit();
static native void changeCpuMode(int mode);
static native void changeSoundSynchMode(int mode);
static boolean touchScreenMode = false;
static boolean fastForwardMode = false;
static boolean inited = false;
static boolean romLoaded = false;
static boolean lidOpen = true;
static String loadedRom = null;
public static int getSettingInt(String name, int def)
{
SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(context);
if(!pm.contains(name))
return def;
try {
return pm.getInt(name, def);
}
catch(ClassCastException e) {
}
try {
String ret = pm.getString(name, String.valueOf(def));
return Integer.valueOf(ret);
}
catch(ClassCastException e) {
}
try {
Boolean ret = pm.getBoolean(name, def == 0 ? false : true);
return ret.booleanValue() ? 1 : 0;
}
catch(ClassCastException e) {
}
return def;
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/EmulatorThread.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.io.File;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import android.os.Environment;
import android.preference.PreferenceManager;
class EmulatorThread extends Thread {
public EmulatorThread(MainActivity activity) {
super("EmulatorThread");
this.activity = activity;
}
public void setCurrentActivity(MainActivity activity) {
this.activity = activity;
}
boolean soundPaused = true;
boolean frameFinished = false;
long lastDraw = 0;
final AtomicBoolean finished = new AtomicBoolean(false);
final AtomicBoolean paused = new AtomicBoolean(false);
String pendingRomLoad = null;
Integer pending3DChange = null;
Integer pendingSoundChange = null;
Integer pendingCPUChange = null;
Integer pendingSoundSyncModeChange = null;
public void loadRom(String path) {
pendingRomLoad = path;
synchronized(dormant) {
dormant.notifyAll();
}
}
public void change3D(int set) {
pending3DChange = set;
}
public void changeSound(int set) {
pendingSoundChange = set;
}
public void changeCPUMode(int set) {
pendingCPUChange = set;
}
public void changeSoundSyncMode(int set) {
pendingSoundSyncModeChange = set;
}
public void setCancel(boolean set) {
finished.set(set);
synchronized(dormant) {
dormant.notifyAll();
}
}
public void setPause(boolean set) {
paused.set(set);
if(DeSmuME.inited) {
DeSmuME.setSoundPaused(set ? 1 : 0);
DeSmuME.setMicPaused(set ? 1 : 0);
soundPaused = set;
}
synchronized(dormant) {
dormant.notifyAll();
}
}
Object dormant = new Object();
public Lock inFrameLock = new ReentrantLock();
int fps = 1;
MainActivity activity = null;
long frameCounter = 0;
@Override
public void run() {
if(!DeSmuME.inited) {
DeSmuME.context = activity;
DeSmuME.load();
final String defaultWorkingDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/nds4droid";
final String path = PreferenceManager.getDefaultSharedPreferences(activity).getString(Settings.DESMUME_PATH, defaultWorkingDir);
final File workingDir = new File(path);
final File tempDir = new File(path + "/Temp");
tempDir.mkdir();
DeSmuME.setWorkingDir(workingDir.getAbsolutePath(), tempDir.getAbsolutePath() + "/");
workingDir.mkdir();
new File(path + "/States").mkdir();
new File(path + "/Battery").mkdir();
new File(path + "/Cheats").mkdir();
//clear any previously extracted ROMs
final File[] cacheFiles = tempDir.listFiles();
if(cacheFiles != null) {
for(File cacheFile : cacheFiles) {
if(cacheFile.getAbsolutePath().toLowerCase().endsWith(".nds"))
cacheFile.delete();
}
}
DeSmuME.init();
DeSmuME.inited = true;
}
while(!finished.get()) {
if(pendingRomLoad != null) {
activity.msgHandler.sendEmptyMessage(MainActivity.LOADING_START);
if(DeSmuME.romLoaded)
DeSmuME.closeRom();
if(!DeSmuME.loadRom(pendingRomLoad)) {
activity.msgHandler.sendEmptyMessage(MainActivity.LOADING_END);
activity.msgHandler.sendEmptyMessage(MainActivity.ROM_ERROR);
DeSmuME.romLoaded = false;
DeSmuME.loadedRom = null;
}
else {
activity.msgHandler.sendEmptyMessage(MainActivity.LOADING_END);
DeSmuME.romLoaded = true;
DeSmuME.loadedRom = pendingRomLoad;
setPause(false);
}
pendingRomLoad = null;
}
if(pending3DChange != null) {
DeSmuME.change3D(pending3DChange.intValue());
pending3DChange = null;
}
if(pendingSoundChange != null) {
DeSmuME.changeSound(pendingSoundChange.intValue());
pendingSoundChange = null;
}
if(pendingCPUChange != null) {
DeSmuME.changeCpuMode(pendingCPUChange.intValue());
pendingCPUChange = null;
}
if(pendingSoundSyncModeChange != null) {
DeSmuME.changeSoundSynchMode(pendingSoundSyncModeChange.intValue());
pendingSoundSyncModeChange = null;
}
if(!paused.get()) {
if(soundPaused) {
DeSmuME.setSoundPaused(0);
DeSmuME.setMicPaused(0);
soundPaused = false;
}
inFrameLock.lock();
do {
DeSmuME.runCore();
} while(DeSmuME.fastForwardMode);
inFrameLock.unlock();
frameFinished = true;
}
else {
//hacky, but keeps thread alive so we don't lose contexts
try {
synchronized(dormant) {
dormant.wait();
}
}
catch (InterruptedException e) {
}
}
}
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/FileDialog.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.TreeMap;
import android.app.AlertDialog;
import android.app.ListActivity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
//This originally came from http://code.google.com/p/android-file-dialog/
public class FileDialog extends ListActivity {
public static class SelectionMode {
public static final int MODE_CREATE = 0;
public static final int MODE_OPEN = 1;
}
private static final String ITEM_KEY = "key";
private static final String ITEM_IMAGE = "image";
private static final String ROOT = "/";
public static final String START_PATH = "START_PATH";
public static final String FORMAT_FILTER = "FORMAT_FILTER";
public static final String RESULT_PATH = "RESULT_PATH";
public static final String SELECTION_MODE = "SELECTION_MODE";
public static final String CAN_SELECT_DIR = "CAN_SELECT_DIR";
private List path = null;
private TextView myPath;
private EditText mFileName;
private ArrayList> mList;
private String parentPath;
private String currentPath = ROOT;
private int selectionMode = SelectionMode.MODE_CREATE;
private String[] formatFilter = null;
private boolean canSelectDir = false;
private File selectedFile;
private HashMap lastPositions = new HashMap();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setResult(RESULT_CANCELED, getIntent());
setContentView(R.layout.file_dialog_main);
myPath = (TextView) findViewById(R.id.path);
selectionMode = getIntent().getIntExtra(SELECTION_MODE, SelectionMode.MODE_CREATE);
formatFilter = getIntent().getStringArrayExtra(FORMAT_FILTER);
canSelectDir = getIntent().getBooleanExtra(CAN_SELECT_DIR, false);
String startPath = getIntent().getStringExtra(START_PATH);
startPath = startPath != null ? startPath : ROOT;
if (canSelectDir) {
File file = new File(startPath);
selectedFile = file;
}
getDir(startPath);
}
private void getDir(String dirPath) {
boolean useAutoSelection = dirPath.length() < currentPath.length();
Integer position = lastPositions.get(parentPath);
getDirImpl(dirPath);
if (position != null && useAutoSelection) {
getListView().setSelection(position);
}
}
private void getDirImpl(final String dirPath) {
currentPath = dirPath;
final List item = new ArrayList();
path = new ArrayList();
mList = new ArrayList>();
File f = new File(currentPath);
File[] files = f.listFiles();
if (files == null) {
currentPath = ROOT;
f = new File(currentPath);
files = f.listFiles();
}
StringBuilder pathString = new StringBuilder(getText(R.string.location) + ": " + currentPath);
if(formatFilter != null) {
if(formatFilter.length > 0) {
pathString.append(" (");
for(int i = 0 ; i < formatFilter.length ; ++i) {
pathString.append(formatFilter[i]);
if(i != formatFilter.length - 1)
pathString.append(", ");
}
pathString.append(")");
}
}
myPath.setText(pathString.toString());
if (!currentPath.equals(ROOT)) {
item.add(ROOT);
addItem(ROOT, R.drawable.folder);
path.add(ROOT);
item.add("../");
addItem("../", R.drawable.updirectory);
path.add(f.getParent());
parentPath = f.getParent();
}
TreeMap dirsMap = new TreeMap();
TreeMap dirsPathMap = new TreeMap();
TreeMap filesMap = new TreeMap();
TreeMap filesPathMap = new TreeMap();
for (File file : files) {
if (file.isDirectory()) {
String dirName = file.getName();
dirsMap.put(dirName, dirName);
dirsPathMap.put(dirName, file.getPath());
} else {
final String fileName = file.getName();
final String fileNameLwr = fileName.toLowerCase();
if (formatFilter != null) {
boolean contains = false;
for (int i = 0; i < formatFilter.length; i++) {
final String formatLwr = formatFilter[i].toLowerCase();
if (fileNameLwr.endsWith(formatLwr)) {
contains = true;
break;
}
}
if (contains) {
filesMap.put(fileName, fileName);
filesPathMap.put(fileName, file.getPath());
}
} else {
filesMap.put(fileName, fileName);
filesPathMap.put(fileName, file.getPath());
}
}
}
item.addAll(dirsMap.tailMap("").values());
item.addAll(filesMap.tailMap("").values());
path.addAll(dirsPathMap.tailMap("").values());
path.addAll(filesPathMap.tailMap("").values());
SimpleAdapter fileList = new SimpleAdapter(this, mList, R.layout.file_dialog_row, new String[] {
ITEM_KEY, ITEM_IMAGE }, new int[] { R.id.fdrowtext, R.id.fdrowimage });
for (String dir : dirsMap.tailMap("").values()) {
addItem(dir, R.drawable.folder);
}
for (String file : filesMap.tailMap("").values()) {
addItem(file, R.drawable.file);
}
fileList.notifyDataSetChanged();
setListAdapter(fileList);
}
private void addItem(String fileName, int imageId) {
HashMap item = new HashMap();
item.put(ITEM_KEY, fileName);
item.put(ITEM_IMAGE, imageId);
mList.add(item);
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
File file = new File(path.get(position));
if (file.isDirectory()) {
if (file.canRead()) {
lastPositions.put(currentPath, position);
getDir(path.get(position));
if (canSelectDir) {
selectedFile = file;
v.setSelected(true);
}
} else {
new AlertDialog.Builder(this).setIcon(R.drawable.ic_launcher)
.setTitle("[" + file.getName() + "] " + getText(R.string.cant_read_folder))
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
}).show();
}
} else {
selectedFile = file;
v.setSelected(true);
getIntent().putExtra(RESULT_PATH, selectedFile.getPath());
setResult(RESULT_OK, getIntent());
finish();
}
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/KeyMapPreference.java
================================================
package com.opendoorstudios.ds4droid;
import android.content.Context;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnKeyListener;
import android.widget.RelativeLayout;
import android.widget.TextView;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
public class KeyMapPreference extends DialogPreference implements OnKeyListener {
public KeyMapPreference(Context context, AttributeSet attrs) {
super(context, attrs);
currentValuePreface = context.getResources().getString(R.string.KeymapValuePreface);
}
int currentValue;
TextView currentValueDesc;
final String currentValuePreface;
static String getKeyDesc(int value) {
if(value == 0)
return "(none)";
else {
final String ret = KEYCODE_SYMBOLIC_NAMES.get(value, "(none)");
return ret == null ? "(unknown)" : ret;
}
}
void sync() {
currentValueDesc.setText(currentValuePreface + " " + getKeyDesc(currentValue));
}
@Override
protected View onCreateDialogView() {
currentValue = getPersistedInt(0);
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout layout = (RelativeLayout)inflater.inflate(R.layout.keymap, null);
layout.setOnKeyListener(this);
layout.requestFocus();
currentValueDesc = (TextView)layout.findViewById(R.id.keymap_value);
sync();
return layout;
}
@Override
public CharSequence getSummary() {
String summary = super.getSummary().toString();
int value = getPersistedInt(currentValue);
return summary + " " + getKeyDesc(value);
}
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
/*switch(keyCode) {
case KeyEvent.KEYCODE_HOME:
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_SETTINGS:
case KeyEvent.KEYCODE_SEARCH:
return false;
}*/
currentValue = keyCode;
sync();
return true;
};
@Override
protected void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
if (!positiveResult) {
return;
}
if (shouldPersist()) {
persistInt(currentValue);
}
notifyChanged();
}
static {
KEYCODE_SYMBOLIC_NAMES = new SparseArray();
populateKeycodeSymbolicNames();
}
//This actually comes straight from the Android source code (android.view.KeyEvent) but it isn't in until ICS
private static final SparseArray KEYCODE_SYMBOLIC_NAMES;
private static void populateKeycodeSymbolicNames() {
SparseArray names = KEYCODE_SYMBOLIC_NAMES;
names.append(KeyEvent.KEYCODE_UNKNOWN, "UNKNOWN");
names.append(KeyEvent.KEYCODE_SOFT_LEFT, "SOFT_LEFT");
names.append(KeyEvent.KEYCODE_SOFT_RIGHT, "SOFT_RIGHT");
names.append(KeyEvent.KEYCODE_HOME, "HOME");
names.append(KeyEvent.KEYCODE_BACK, "BACK");
names.append(KeyEvent.KEYCODE_CALL, "CALL");
names.append(KeyEvent.KEYCODE_ENDCALL, "ENDCALL");
names.append(KeyEvent.KEYCODE_0, "0");
names.append(KeyEvent.KEYCODE_1, "1");
names.append(KeyEvent.KEYCODE_2, "2");
names.append(KeyEvent.KEYCODE_3, "3");
names.append(KeyEvent.KEYCODE_4, "4");
names.append(KeyEvent.KEYCODE_5, "5");
names.append(KeyEvent.KEYCODE_6, "6");
names.append(KeyEvent.KEYCODE_7, "7");
names.append(KeyEvent.KEYCODE_8, "8");
names.append(KeyEvent.KEYCODE_9, "9");
names.append(KeyEvent.KEYCODE_STAR, "STAR");
names.append(KeyEvent.KEYCODE_POUND, "POUND");
names.append(KeyEvent.KEYCODE_DPAD_UP, "DPAD_UP");
names.append(KeyEvent.KEYCODE_DPAD_DOWN, "DPAD_DOWN");
names.append(KeyEvent.KEYCODE_DPAD_LEFT, "DPAD_LEFT");
names.append(KeyEvent.KEYCODE_DPAD_RIGHT, "DPAD_RIGHT");
names.append(KeyEvent.KEYCODE_DPAD_CENTER, "DPAD_CENTER");
names.append(KeyEvent.KEYCODE_VOLUME_UP, "VOLUME_UP");
names.append(KeyEvent.KEYCODE_VOLUME_DOWN, "VOLUME_DOWN");
names.append(KeyEvent.KEYCODE_POWER, "POWER");
names.append(KeyEvent.KEYCODE_CAMERA, "CAMERA");
names.append(KeyEvent.KEYCODE_CLEAR, "CLEAR");
names.append(KeyEvent.KEYCODE_A, "A");
names.append(KeyEvent.KEYCODE_B, "B");
names.append(KeyEvent.KEYCODE_C, "C");
names.append(KeyEvent.KEYCODE_D, "D");
names.append(KeyEvent.KEYCODE_E, "E");
names.append(KeyEvent.KEYCODE_F, "F");
names.append(KeyEvent.KEYCODE_G, "G");
names.append(KeyEvent.KEYCODE_H, "H");
names.append(KeyEvent.KEYCODE_I, "I");
names.append(KeyEvent.KEYCODE_J, "J");
names.append(KeyEvent.KEYCODE_K, "K");
names.append(KeyEvent.KEYCODE_L, "L");
names.append(KeyEvent.KEYCODE_M, "M");
names.append(KeyEvent.KEYCODE_N, "N");
names.append(KeyEvent.KEYCODE_O, "O");
names.append(KeyEvent.KEYCODE_P, "P");
names.append(KeyEvent.KEYCODE_Q, "Q");
names.append(KeyEvent.KEYCODE_R, "R");
names.append(KeyEvent.KEYCODE_S, "S");
names.append(KeyEvent.KEYCODE_T, "T");
names.append(KeyEvent.KEYCODE_U, "U");
names.append(KeyEvent.KEYCODE_V, "V");
names.append(KeyEvent.KEYCODE_W, "W");
names.append(KeyEvent.KEYCODE_X, "X");
names.append(KeyEvent.KEYCODE_Y, "Y");
names.append(KeyEvent.KEYCODE_Z, "Z");
names.append(KeyEvent.KEYCODE_COMMA, "COMMA");
names.append(KeyEvent.KEYCODE_PERIOD, "PERIOD");
names.append(KeyEvent.KEYCODE_ALT_LEFT, "ALT_LEFT");
names.append(KeyEvent.KEYCODE_ALT_RIGHT, "ALT_RIGHT");
names.append(KeyEvent.KEYCODE_SHIFT_LEFT, "SHIFT_LEFT");
names.append(KeyEvent.KEYCODE_SHIFT_RIGHT, "SHIFT_RIGHT");
names.append(KeyEvent.KEYCODE_TAB, "TAB");
names.append(KeyEvent.KEYCODE_SPACE, "SPACE");
names.append(KeyEvent.KEYCODE_SYM, "SYM");
names.append(KeyEvent.KEYCODE_EXPLORER, "EXPLORER");
names.append(KeyEvent.KEYCODE_ENVELOPE, "ENVELOPE");
names.append(KeyEvent.KEYCODE_ENTER, "ENTER");
names.append(KeyEvent.KEYCODE_DEL, "DEL");
names.append(KeyEvent.KEYCODE_GRAVE, "GRAVE");
names.append(KeyEvent.KEYCODE_MINUS, "MINUS");
names.append(KeyEvent.KEYCODE_EQUALS, "EQUALS");
names.append(KeyEvent.KEYCODE_LEFT_BRACKET, "LEFT_BRACKET");
names.append(KeyEvent.KEYCODE_RIGHT_BRACKET, "RIGHT_BRACKET");
names.append(KeyEvent.KEYCODE_BACKSLASH, "BACKSLASH");
names.append(KeyEvent.KEYCODE_SEMICOLON, "SEMICOLON");
names.append(KeyEvent.KEYCODE_APOSTROPHE, "APOSTROPHE");
names.append(KeyEvent.KEYCODE_SLASH, "SLASH");
names.append(KeyEvent.KEYCODE_AT, "AT");
names.append(KeyEvent.KEYCODE_NUM, "NUM");
names.append(KeyEvent.KEYCODE_HEADSETHOOK, "HEADSETHOOK");
names.append(KeyEvent.KEYCODE_FOCUS, "FOCUS");
names.append(KeyEvent.KEYCODE_PLUS, "PLUS");
names.append(KeyEvent.KEYCODE_MENU, "MENU");
names.append(KeyEvent.KEYCODE_NOTIFICATION, "NOTIFICATION");
names.append(KeyEvent.KEYCODE_SEARCH, "SEARCH");
names.append(KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE, "MEDIA_PLAY_PAUSE");
names.append(KeyEvent.KEYCODE_MEDIA_STOP, "MEDIA_STOP");
names.append(KeyEvent.KEYCODE_MEDIA_NEXT, "MEDIA_NEXT");
names.append(KeyEvent.KEYCODE_MEDIA_PREVIOUS, "MEDIA_PREVIOUS");
names.append(KeyEvent.KEYCODE_MEDIA_REWIND, "MEDIA_REWIND");
names.append(KeyEvent.KEYCODE_MEDIA_FAST_FORWARD, "MEDIA_FAST_FORWARD");
names.append(KeyEvent.KEYCODE_MUTE, "MUTE");
names.append(KeyEvent.KEYCODE_PAGE_UP, "PAGE_UP");
names.append(KeyEvent.KEYCODE_PAGE_DOWN, "PAGE_DOWN");
names.append(KeyEvent.KEYCODE_PICTSYMBOLS, "PICTSYMBOLS");
names.append(KeyEvent.KEYCODE_SWITCH_CHARSET, "SWITCH_CHARSET");
if(!MainActivity.IS_OUYA) {
names.append(KeyEvent.KEYCODE_BUTTON_A, "BUTTON_A");
names.append(KeyEvent.KEYCODE_BUTTON_B, "BUTTON_B");
names.append(KeyEvent.KEYCODE_BUTTON_X, "BUTTON_X");
names.append(KeyEvent.KEYCODE_BUTTON_Y, "BUTTON_Y");
names.append(KeyEvent.KEYCODE_BUTTON_L1, "BUTTON_L1");
names.append(KeyEvent.KEYCODE_BUTTON_R1, "BUTTON_R1");
names.append(KeyEvent.KEYCODE_BUTTON_L2, "BUTTON_L2");
names.append(KeyEvent.KEYCODE_BUTTON_R2, "BUTTON_R2");
names.append(KeyEvent.KEYCODE_BUTTON_THUMBL, "BUTTON_THUMBL");
names.append(KeyEvent.KEYCODE_BUTTON_THUMBR, "BUTTON_THUMBR");
}
else {
//The OUYA interface guidelines wants us to call the buttons by these names
names.append(KeyEvent.KEYCODE_BUTTON_A, "O");
names.append(KeyEvent.KEYCODE_BUTTON_B, "A");
names.append(KeyEvent.KEYCODE_BUTTON_X, "U");
names.append(KeyEvent.KEYCODE_BUTTON_Y, "Y");
names.append(KeyEvent.KEYCODE_BUTTON_L1, "L1");
names.append(KeyEvent.KEYCODE_BUTTON_R1, "R1");
names.append(KeyEvent.KEYCODE_BUTTON_L2, "L2");
names.append(KeyEvent.KEYCODE_BUTTON_R2, "R2");
names.append(KeyEvent.KEYCODE_BUTTON_THUMBL, "L3");
names.append(KeyEvent.KEYCODE_BUTTON_THUMBR, "R3");
}
names.append(KeyEvent.KEYCODE_BUTTON_START, "BUTTON_START");
names.append(KeyEvent.KEYCODE_BUTTON_SELECT, "BUTTON_SELECT");
names.append(KeyEvent.KEYCODE_BUTTON_MODE, "BUTTON_MODE");
names.append(KeyEvent.KEYCODE_BUTTON_Z, "BUTTON_Z");
names.append(KeyEvent.KEYCODE_BUTTON_C, "BUTTON_C");
names.append(188, "KEYCODE_BUTTON_1"); //KEYCODE_BUTTON_1
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/KeyMapSettings.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import android.os.Bundle;
import android.preference.PreferenceActivity;
public class KeyMapSettings extends PreferenceActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.keymap);
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/MainActivity.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.io.File;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;
import android.view.WindowManager;
public class MainActivity extends Activity implements OnSharedPreferenceChangeListener {
static EmulatorThread coreThread;
static Controls controls;
NDSView view;
static final String TAG = "nds4droid";
Dialog loadingDialog = null;
Handler msgHandler = new Handler() {
@Override
public
void dispatchMessage(Message msg) {
switch(msg.what) {
case PICK_ROM:
pickRom();
break;
case LOADING_START:
if(loadingDialog == null) {
final String loadingMsg = getResources().getString(R.string.loading);
loadingDialog = ProgressDialog.show(MainActivity.this, null, loadingMsg, true);
break;
}
break;
case LOADING_END:
if(loadingDialog != null) {
loadingDialog.dismiss();
loadingDialog = null;
}
break;
case ROM_ERROR:
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage(R.string.rom_error).setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
arg0.dismiss();
pickRom();
}
}).setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface arg0) {
arg0.dismiss();
pickRom();
}
});
builder.create().show();
}
}
};
public static final int PICK_ROM = 1338;
public static final int LOADING_START = 1339;
public static final int LOADING_END = 1340;
public static final int ROM_ERROR = 1341;
public static boolean IS_OUYA = tv.ouya.console.api.OuyaFacade.getInstance().isRunningOnOUYAHardware();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(IS_OUYA)
Log.i(TAG, "Starting in OUYA mode");
view = new NDSView(this);
setContentView(view);
controls = new Controls(view);
Settings.applyDefaults(this);
prefs = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);
prefs.registerOnSharedPreferenceChangeListener(this);
loadJavaSettings(null);
if(savedInstanceState != null)
timeAtLastAutosave = savedInstanceState.getLong(LASTSAVE_KEY);
if(!DeSmuME.inited)
pickRom();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
void runEmulation() {
boolean created = false;
if(coreThread == null) {
coreThread = new EmulatorThread(this);
created = true;
}
else
coreThread.setCurrentActivity(this);
coreThread.setPause(!DeSmuME.romLoaded);
if(created)
coreThread.start();
}
void pauseEmulation() {
if(coreThread != null) {
coreThread.setPause(true);
}
}
void pickRom() {
Intent i = new Intent(this, prefs.getBoolean(Settings.DISABLE_ROM_BROWSER, false) ?
FileDialog.class : com.opendoorstudios.ds4droid.NDSScanner.CollectionActivity.class);
i.setAction(Intent.ACTION_PICK);
String startPath = Environment.getExternalStorageDirectory().getPath();
final File path = new File(prefs.getString(Settings.LAST_ROM_DIR, startPath));
if(path.exists()) //make sure this path actually exists -- otherwise default back to /mnt/sdcard/
startPath = path.getPath();
i.putExtra(FileDialog.START_PATH, startPath);
i.putExtra(FileDialog.FORMAT_FILTER, new String[] {".nds", ".zip", ".7z", ".rar"});
startActivityForResult(i, PICK_ROM);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode != PICK_ROM || resultCode != Activity.RESULT_OK)
return;
String romPath = data.getStringExtra(FileDialog.RESULT_PATH);
if(romPath != null) {
final File romDir = new File(romPath);
prefs.edit().putString(Settings.LAST_ROM_DIR, romDir.getParent()).apply();
runEmulation();
coreThread.loadRom(romPath);
timeAtLastAutosave = System.currentTimeMillis();
scheduleAutosave();
}
}
private static final String LASTSAVE_KEY = "LASTSAVE_KEY";
@Override
public void onSaveInstanceState(Bundle out) {
out.putLong(LASTSAVE_KEY, timeAtLastAutosave);
}
@Override
public void onResume() {
super.onResume();
runEmulation();
startDrawTimer();
if(DeSmuME.romLoaded)
scheduleAutosave();
}
@Override
public void onPause() {
super.onPause();
pauseEmulation();
stopDrawTimer();
cancelAutosave();
}
Timer drawtimer;
void startDrawTimer() {
drawtimer = new Timer();
drawtimer.schedule(new TimerTask() {
public void run(){
if(coreThread.frameFinished) {
coreThread.frameFinished = false;
view.postInvalidate();
}
}
}, 12, 12);
}
void stopDrawTimer() {
if (drawtimer != null)
drawtimer.cancel();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.activity_main, menu);
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
pauseEmulation();
menu.findItem(R.id.cheats).setVisible(DeSmuME.romLoaded);
menu.findItem(R.id.lid).setChecked(DeSmuME.lidOpen);
final String defaultWorkingDir = Environment.getExternalStorageDirectory().getAbsolutePath() + "/nds4droid";
final String statesPath = prefs.getString(Settings.DESMUME_PATH, defaultWorkingDir) + "/States/";
String romSaveName = DeSmuME.loadedRom != null ? new File(DeSmuME.loadedRom).getName() : null;
if(romSaveName != null)
romSaveName = romSaveName.substring(0, romSaveName.lastIndexOf('.'));
for(int i = 1 ; i <= 10 ; ++i) {
MenuItem saveItem = null, loadItem = null;
switch(i) {
case 1: saveItem = menu.findItem(R.id.save1); loadItem = menu.findItem(R.id.restore1); break;
case 2: saveItem = menu.findItem(R.id.save2); loadItem = menu.findItem(R.id.restore2); break;
case 3: saveItem = menu.findItem(R.id.save3); loadItem = menu.findItem(R.id.restore3); break;
case 4: saveItem = menu.findItem(R.id.save4); loadItem = menu.findItem(R.id.restore4); break;
case 5: saveItem = menu.findItem(R.id.save5); loadItem = menu.findItem(R.id.restore5); break;
case 6: saveItem = menu.findItem(R.id.save6); loadItem = menu.findItem(R.id.restore6); break;
case 7: saveItem = menu.findItem(R.id.save7); loadItem = menu.findItem(R.id.restore7); break;
case 8: saveItem = menu.findItem(R.id.save8); loadItem = menu.findItem(R.id.restore8); break;
case 9: saveItem = menu.findItem(R.id.save9); loadItem = menu.findItem(R.id.restore9); break;
case 10: loadItem = menu.findItem(R.id.restoreauto); break;
}
String newTitle = i == 10 ? "Autosave" : String.valueOf(i);
if(romSaveName != null) {
final File thisSave = new File(statesPath + romSaveName + ".ds" + i);
if(thisSave.exists()) {
final String date = new Date(thisSave.lastModified()).toString();
if(i == 10)
newTitle = "Autosave - " + date;
else
newTitle = String.format("%d - %s", i, date);
}
}
if(i != 10)
saveItem.setTitle(newTitle);
loadItem.setTitle(newTitle);
}
return true;
}
@Override
public void onOptionsMenuClosed(Menu menu) {
runEmulation();
}
@Override
public boolean onMenuItemSelected (int featureId, MenuItem item) {
switch(item.getItemId()) {
case R.id.load:
pickRom();
break;
case R.id.quicksave:
saveState(0);
break;
case R.id.quickrestore:
restoreState(0);
break;
case R.id.restore1: case R.id.restore2: case R.id.restore3: case R.id.restore4: case R.id.restore5:
case R.id.restore6: case R.id.restore7: case R.id.restore8: case R.id.restore9: case R.id.restoreauto:
{
String title = item.getTitle().toString();
final int spacePos = title.indexOf(' ');
if(spacePos != -1)
title = title.substring(0, spacePos);
final int state = title.equals("Autosave") ? 10 : Integer.valueOf(title);
restoreState(state);
}
break;
case R.id.save1: case R.id.save2: case R.id.save3: case R.id.save4: case R.id.save5:
case R.id.save6: case R.id.save7: case R.id.save8: case R.id.save9:
{
String title = item.getTitle().toString();
final int spacePos = title.indexOf(' ');
if(spacePos != -1)
title = title.substring(0, spacePos);
final int state = Integer.valueOf(title);
saveState(state);
}
break;
case R.id.settings:
startActivity(new Intent(this, Settings.class));
break;
case R.id.cheats:
startActivity(new Intent(this, Cheats.class));
break;
case R.id.exit:
DeSmuME.exit();
finish();
break;
case R.id.lid:
if(coreThread != null) {
boolean newState = !DeSmuME.lidOpen;
DeSmuME.lidOpen = newState;
item.setChecked(newState);
}
break;
case R.id.about:
startActivity(new Intent(this, About.class));
break;
default:
return false;
}
runEmulation();
return true;
}
static String getStateName(int slot) {
switch(slot) {
case 0: return "quick state";
case 10: return "autosave";
default: return "state " + slot;
}
}
void restoreState(int slot) {
if(DeSmuME.romLoaded) {
coreThread.inFrameLock.lock();
DeSmuME.restoreState(slot);
coreThread.inFrameLock.unlock();
view.stateText = "Restored " + getStateName(slot);
view.stateDrawStart = System.currentTimeMillis();
}
}
void saveState(int slot) {
if(DeSmuME.romLoaded) {
coreThread.inFrameLock.lock();
DeSmuME.saveState(slot);
coreThread.inFrameLock.unlock();
view.stateText = "Saved " + getStateName(slot);
view.stateDrawStart = System.currentTimeMillis();
}
}
SharedPreferences prefs = null;
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if(DeSmuME.inited)
DeSmuME.loadSettings();
loadJavaSettings(key);
}
void loadJavaSettings(String key)
{
if(key != null) {
if(DeSmuME.inited && key.equals(Settings.LANGUAGE))
DeSmuME.reloadFirmware();
}
if(view != null) {
view.showfps = prefs.getBoolean(Settings.SHOW_FPS, false);
view.showTouchMessage = prefs.getBoolean(Settings.SHOW_TOUCH_MESSAGE, true);
view.showSoundMessage = prefs.getBoolean(Settings.SHOW_SOUND_MESSAGE, true);
view.lcdSwap = prefs.getBoolean(Settings.LCD_SWAP, false);
view.buttonAlpha = (int)(prefs.getInt(Settings.BUTTON_TRANSPARENCY, 78) * 2.55f);
view.haptic = prefs.getBoolean(Settings.HAPTIC, false);
view.dontRotate = prefs.getBoolean(Settings.DONT_ROTATE_LCDS, false);
view.alwaysTouch = prefs.getBoolean(Settings.ALWAYS_TOUCH, false);
controls.loadMappings(this);
if(key != null) {
if(key.equals(Settings.SCREEN_FILTER)) {
int newFilter = DeSmuME.getSettingInt(Settings.SCREEN_FILTER, 0);
DeSmuME.setFilter(newFilter);
view.forceResize();
}
else if(key.equals(Settings.RENDERER)) {
int new3D = DeSmuME.getSettingInt(Settings.RENDERER, 2);
if(coreThread != null)
coreThread.change3D(new3D);
}
else if(key.equals(Settings.ENABLE_SOUND)) {
int newSound = DeSmuME.getSettingInt(Settings.ENABLE_SOUND, 0);
if(coreThread != null)
coreThread.changeSound(newSound);
}
else if(key.equals(Settings.CPU_MODE) || key.equals(Settings.JIT_SIZE)) {
int newCpuMode = DeSmuME.getSettingInt(Settings.CPU_MODE, 1);
if(coreThread != null)
coreThread.changeCPUMode(newCpuMode);
}
else if(key.equals(Settings.SOUND_SYNC_MODE)) {
int newSoundSyncMode = DeSmuME.getSettingInt(Settings.SOUND_SYNC_MODE, 0);
if(coreThread != null)
coreThread.changeSoundSyncMode(newSoundSyncMode);
}
else if(key.equals(Settings.ENABLE_AUTOSAVE) || key.equals(Settings.AUTOSVAE_FREQUENCY)) {
cancelAutosave();
if(coreThread != null) {
if(DeSmuME.romLoaded)
scheduleAutosave();
}
}
}
}
}
long timeAtLastAutosave = 0;
Timer autosaveTask;
void cancelAutosave() {
if(autosaveTask != null) {
autosaveTask.cancel();
autosaveTask = null;
}
}
void scheduleAutosave() {
cancelAutosave();
if(prefs.getBoolean(Settings.ENABLE_AUTOSAVE, true)) {
final int freqSel = Integer.valueOf(prefs.getString(Settings.AUTOSVAE_FREQUENCY, "1"));
long autosaveDelay = 0;
switch(freqSel) {
case 0: autosaveDelay = 1 * 60 * 1000; break; //1 minute
case 2: autosaveDelay = 15 * 60 * 1000; break; //15 minutes
case 3: autosaveDelay = 30 * 60 * 1000; break; //30 minutes
case 4: autosaveDelay = 60 * 60 * 1000; break; //1 hour
default: autosaveDelay = 5 * 60 * 1000; break; //5 minutes
}
long timeSinceLastAuto = System.currentTimeMillis() - timeAtLastAutosave;
if(timeSinceLastAuto >= autosaveDelay)
timeSinceLastAuto = autosaveDelay;
autosaveTask = new Timer();
autosaveTask.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
if(!coreThread.paused.get()) {
saveState(10);
timeAtLastAutosave = System.currentTimeMillis();
}
}
}, autosaveDelay - timeSinceLastAuto, autosaveDelay);
}
}
class NDSView extends SurfaceView implements Callback {
Bitmap emuBitmapMain, emuBitmapTouch;
final Paint emuPaint = new Paint();
final Paint hudPaint = new Paint();
final float defhudsize = 15;
float curhudsize = defhudsize;
public boolean showfps = false;
public boolean showTouchMessage = false;
public boolean showSoundMessage = false;
public boolean lcdSwap = false;
public boolean forceTouchScreen = false;
public int buttonAlpha = 78;
public boolean haptic = true;
public boolean alwaysTouch = false;
public NDSView(Context context) {
super(context);
getHolder().addCallback(this);
setKeepScreenOn(true);
setWillNotDraw(false);
setFocusable(true);
setFocusableInTouchMode(true);
hudPaint.setColor(Color.WHITE);
hudPaint.setShadowLayer(1, 0, 0, Color.BLACK);
hudPaint.setTextSize(defhudsize);
hudPaint.setAntiAlias(false);
}
boolean doForceResize = false;
public void forceResize() {
doForceResize = true;
}
@Override
public void onDraw(Canvas canvas) {
canvas.drawColor(Color.BLACK);
if(showTouchMessage) {
prefs.edit().putBoolean(Settings.SHOW_TOUCH_MESSAGE, showTouchMessage = false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setPositiveButton(R.string.OK, null).setMessage(R.string.touchnotify).create().show();
}
if(showSoundMessage) {
prefs.edit().putBoolean(Settings.SHOW_SOUND_MESSAGE, showSoundMessage = false).apply();
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage(R.string.soundmsg).setPositiveButton(R.string.yes, new Dialog.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
prefs.edit().putBoolean(Settings.ENABLE_SOUND, true).apply();
arg0.dismiss();
}
}).setNegativeButton(R.string.no, null).create().show();
}
synchronized(view) {
if(!DeSmuME.inited)
return;
if(doForceResize)
view.resize(width, height, pixelFormat);
if(emuBitmapMain == null)
return;
int data = DeSmuME.fastForwardMode ? fpsData : DeSmuME.draw(emuBitmapMain, emuBitmapTouch, landscape && dontRotate);
final boolean drawTouch = destTouch.left != 0 || destTouch.right != 0;
if(lcdSwap) {
if(drawTouch) {
canvas.drawBitmap(emuBitmapTouch, srcMain, destMain, emuPaint);
canvas.drawBitmap(emuBitmapMain, srcTouch, destTouch, emuPaint);
}
else
canvas.drawBitmap(emuBitmapMain, srcMain, destMain, emuPaint);
}
else {
canvas.drawBitmap(emuBitmapMain, srcMain, destMain, emuPaint);
if(drawTouch)
canvas.drawBitmap(emuBitmapTouch, srcTouch, destTouch, emuPaint);
}
controls.drawControls(canvas);
if(stateText != null) {
final long fadeHoldMs = 1000;
final float fadeAwayMs = 750.0f;
final long time = System.currentTimeMillis();
final long fadeDiff = time - stateDrawStart;
if(fadeDiff >= (fadeHoldMs + fadeAwayMs))
stateText = null;
else {
final boolean fading = fadeDiff > fadeHoldMs;
if(fading) {
final float fadeTime = (fadeDiff - fadeHoldMs) / fadeAwayMs;
final int fadeColor = Color.argb(255 - (int) (fadeTime * 255), 255, 255, 255);
hudPaint.setColor(fadeColor);
}
canvas.drawText(stateText, 10, curhudsize * 2, hudPaint);
if(fading)
hudPaint.setColor(Color.WHITE);
}
}
if (showfps)
{
if(data != fpsData || fpsText == null) {
int fps = (data >> 24) & 0xFF;
int fps3d = (data >> 16) & 0xFF;
int cpuload0 = (data >> 8) & 0xFF;
int cpuload1 = data & 0xFF;
fpsText = "Fps:"+fps+"/"+fps3d+"("+cpuload0+"%/"+cpuload1+"%)";
fpsData = data;
}
canvas.drawText(fpsText, 10, curhudsize, hudPaint);
}
}
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return controls.onTouchEvent(event);
}
boolean resized = false;
boolean sized = false;
boolean landscape = false;
boolean dontRotate = false;
int sourceWidth;
int sourceHeight;
Rect srcMain, destMain, srcTouch, destTouch;
int width = 0, height = 0, pixelFormat;
String stateText = null;
long stateDrawStart = 0;
int fpsData = 0;
int screenOption = 0;
String fpsText = null;
void resize(int newWidth, int newHeight, int newPixelFormat) {
synchronized(view) {
sourceWidth = DeSmuME.getNativeWidth();
sourceHeight = DeSmuME.getNativeHeight();
resized = true;
screenOption = Integer.valueOf(prefs.getString(Settings.SPECIFIC_SCREEN_ONLY, "0"));
final boolean hasScreenFilter = DeSmuME.getSettingInt(Settings.SCREEN_FILTER, 0) != 0;
final boolean is565 = newPixelFormat == PixelFormat.RGB_565 && !hasScreenFilter;
final boolean stretch = !prefs.getBoolean(Settings.MAINTAIN_ASPECT_RATIO, false);
landscape = newWidth > newHeight;
controls.setView(this);
int xBlack = 0, yBlack = 0;
forceTouchScreen = !prefs.getBoolean("Controls." + (landscape ? "Landscape." : "Portrait.") + "Draw", false);
final Rect emptyRect = new Rect(0, 0, 0, 0);
if(landscape) {
if(stretch) {
if(screenOption > 0) {
final Rect full = new Rect(0, 0, newWidth, newHeight);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(0, 0, newWidth / 2, newHeight);
destTouch = new Rect(newWidth / 2, 0, newWidth, newHeight);
}
}
else {
final float dsAspect = (screenOption > 0) ? (float)(sourceWidth) / (float)(sourceHeight / 2) :
(float)(sourceWidth * 2) / (float)(sourceHeight / 2);
final float screenAspect = (float)newWidth / (float)newHeight;
if(dsAspect > screenAspect) {
//the DS is "wider" than our screen -- match to the width
final int aspectHeight = (int)((float)newWidth / dsAspect);
final int black = yBlack = (newHeight - aspectHeight) / 2;
if(screenOption > 0) {
final Rect full = new Rect(0,black,newWidth,newHeight - black);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(0,black,newWidth / 2,newHeight - black);
destTouch = new Rect(newWidth / 2,black,newWidth,newHeight-black);
}
}
else {
//match to the height
final int aspectWidth = (int)((float)newHeight * dsAspect);
final int black = xBlack = (newWidth - aspectWidth) / 2;
if(screenOption > 0) {
final Rect full = new Rect(black, 0, newWidth - black, newHeight);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(black, 0, aspectWidth / 2 + black, newHeight);
destTouch = new Rect(aspectWidth / 2 + black, 0, newWidth - black, newHeight);
}
}
}
}
else {
if(stretch) {
if(screenOption > 0) {
final Rect full = new Rect(0, 0, newWidth, newHeight);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(0, 0, newWidth, newHeight / 2);
destTouch = new Rect(0, newHeight / 2, newWidth, newHeight);
}
}
else {
final float dsAspect = (screenOption > 0) ? (float)sourceWidth / (float)(sourceHeight / 2) :
(float)sourceWidth / (float)sourceHeight;
final float screenAspect = (float)newWidth / (float)newHeight;
if(dsAspect > screenAspect) {
//the DS is "wider" than our screen -- match to the width
final int aspectHeight = (int)((float)newWidth / dsAspect);
final int black = yBlack = (newHeight - aspectHeight) / 2;
if(screenOption > 0) {
final Rect full = new Rect(0, black, newWidth, newHeight - black);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(0,black,newWidth,aspectHeight / 2 + black);
destTouch = new Rect(0,aspectHeight / 2 + black,newWidth,newHeight-black);
}
}
else {
//match to the height
final int aspectWidth = (int)((float)newHeight * dsAspect);
final int black = xBlack = (newWidth - aspectWidth) / 2;
if(screenOption > 0) {
final Rect full = new Rect(black, 0, newWidth - black, newHeight);
destMain = screenOption == 1 ? full : emptyRect;
destTouch = screenOption == 1 ? emptyRect : full;
}
else {
destMain = new Rect(black, 0, aspectWidth + black, newHeight / 2);
destTouch = new Rect(black, newHeight / 2, aspectWidth + black, newHeight);
}
}
}
}
controls.loadControls(MainActivity.this, newWidth, newHeight, xBlack, yBlack, screenOption, is565, landscape);
if(landscape && dontRotate) {
emuBitmapMain = Bitmap.createBitmap(sourceHeight / 2, sourceWidth, is565 ? Config.RGB_565 : Config.ARGB_8888);
emuBitmapTouch = Bitmap.createBitmap(sourceHeight / 2, sourceWidth, is565 ? Config.RGB_565 : Config.ARGB_8888);
srcMain = new Rect(0, 0, sourceHeight / 2, sourceWidth);
srcTouch = new Rect(0, 0, sourceHeight / 2, sourceWidth);
}
else {
emuBitmapMain = Bitmap.createBitmap(sourceWidth, sourceHeight / 2, is565 ? Config.RGB_565 : Config.ARGB_8888);
emuBitmapTouch = Bitmap.createBitmap(sourceWidth, sourceHeight / 2, is565 ? Config.RGB_565 : Config.ARGB_8888);
srcMain = new Rect(0, 0, sourceWidth, sourceHeight / 2);
srcTouch = new Rect(0, 0, sourceWidth, sourceHeight / 2);
}
DeSmuME.resize(emuBitmapMain);
requestFocus();
width = newWidth;
height = newHeight;
pixelFormat = newPixelFormat;
sized = true;
doForceResize = false;
float max_wh = newWidth > newHeight ? newWidth : newHeight;
curhudsize = (max_wh / 384.0f) * defhudsize;
hudPaint.setTextSize(curhudsize);
}
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
synchronized(view) {
if(width > 0 && height > 0) //not sure why, but some devices are sending 0s for these values sometimes
view.resize(width, height, format);
}
}
@Override
public void surfaceCreated(SurfaceHolder arg0) {
}
@Override
public void surfaceDestroyed(SurfaceHolder arg0) {
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return controls.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
return controls.onKeyUp(keyCode, event);
}
public void showMenu() {
MainActivity.this.openOptionsMenu();
}
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/NDSScanner/CollectionActivity.java
================================================
package com.opendoorstudios.ds4droid.NDSScanner;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import com.opendoorstudios.ds4droid.R;
import com.opendoorstudios.ds4droid.FileDialog;
import com.opendoorstudios.ds4droid.Settings;
import java.io.File;
//==============================================================================
public class CollectionActivity extends Activity implements GridView.OnItemClickListener {
//--------------------------------------------------------------------------
private GridView grid;
private RomAdapter adapter;
private static RomCollection collection;
private String browserRoot;
private String[] browserFilter;
//--------------------------------------------------------------------------
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedInstanceState );
// nds4droid compatibility
setResult( RESULT_CANCELED );
browserFilter = getIntent().getStringArrayExtra(FileDialog.FORMAT_FILTER);
browserRoot = getIntent().getStringExtra(FileDialog.START_PATH);
setContentView( R.layout.fragment_list );
grid = (GridView)findViewById( R.id.list );
adapter = new RomAdapter();
grid.setAdapter( adapter );
grid.setOnItemClickListener( this );
}
@Override
protected void onDestroy() {
super.onDestroy();
if(adapter != null)
collection.removeListener(adapter);
}
//--------------------------------------------------------------------------
@Override
public boolean onCreateOptionsMenu( Menu menu ) {
getMenuInflater().inflate( R.menu.activity_collection, menu );
return true;
}
private void showFileBrowser() {
Intent i = new Intent(this, FileDialog.class);
i.setAction(Intent.ACTION_PICK);
i.putExtra(FileDialog.START_PATH, browserRoot);
i.putExtra(FileDialog.FORMAT_FILTER, browserFilter);
startActivityForResult(i, 0);
}
@Override
public boolean onMenuItemSelected (int featureId, MenuItem item) {
switch(item.getItemId()) {
case R.id.scanner_rescan:
collection.clear();
adapter.onScanFinished(collection);
collection.update( CollectionActivity.this );
return true;
case R.id.scanner_filebrowser:
showFileBrowser();
return true;
case R.id.scanner_settings:
startActivity(new Intent(this, Settings.class));
break;
}
return false;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if( resultCode != Activity.RESULT_OK)
return;
String romPath = data.getStringExtra(FileDialog.RESULT_PATH);
if(romPath != null) {
getIntent().putExtra(FileDialog.RESULT_PATH, romPath);
setResult(RESULT_OK, getIntent());
finish();
}
}
//--------------------------------------------------------------------------
@Override
public void onItemClick( AdapterView> parent, View view, int index, long id ) {
Log.d( "NDS", "onItemClick()" );
File FILE = collection.getRoms()[index].getFile();
getIntent().putExtra(FileDialog.RESULT_PATH, FILE.getAbsolutePath());
setResult(RESULT_OK, getIntent());
finish();
}
//--------------------------------------------------------------------------
//==========================================================================
private class RomAdapter extends BaseAdapter implements RomCollection.ScanListener {
//----------------------------------------------------------------------
public RomAdapter() {
// TODO Check shared preference for user's desired scanner root
File file = new File( Environment.getExternalStorageDirectory().getAbsolutePath() );
if(collection == null)
collection = new RomCollection( CollectionActivity.this, file );
collection.addListener( this );
collection.update( CollectionActivity.this );
}
//----------------------------------------------------------------------
@Override
public int getCount() {
return collection.getRoms().length;
}
//----------------------------------------------------------------------
@Override
public Object getItem( int index ) {
return collection.getRoms()[index];
}
//----------------------------------------------------------------------
@Override
public long getItemId( int index ) {
return collection.getRoms()[index].getGameCode();
}
//----------------------------------------------------------------------
@Override
public View getView( final int index, View view, ViewGroup parent ) {
final NdsRom rom = collection.getRoms()[index];
if ( view == null ) {
view = getLayoutInflater().inflate( R.layout.griditem_rom, parent, false );
}
final ImageView image_view = ( (ImageView)view.findViewById( R.id.icon ));
if ( rom.isIconLoaded() ) {
image_view.setImageBitmap( rom.getIcon() );
image_view.getDrawable().setFilterBitmap( false );
// Delegate icon loading to an AsyncTask
} else {
image_view.setImageDrawable( null );
new AsyncTask() {
protected Bitmap doInBackground( Void... xx ) {
return rom.getIcon();
}
protected void onPostExecute( Bitmap result ) {
Drawable[] transition = new Drawable[] { new ColorDrawable( 0 ), new BitmapDrawable( getResources(), result ) };
transition[1].setFilterBitmap( false );
TransitionDrawable drawable = new TransitionDrawable( transition );
image_view.setImageDrawable( drawable );
drawable.startTransition( 100 );
}
}.execute();
}
( (TextView )view.findViewById( R.id.title )).setText( rom.getTitle() );
return view;
}
//----------------------------------------------------------------------
private ProgressDialog pd;
@Override
public void onScanStarted( RomCollection collection ) {
pd = new ProgressDialog(CollectionActivity.this);
pd.setTitle(getString(R.string.ScanningForROMs));
pd.setIndeterminate(true);
pd.setCancelable(true);
pd.show();
}
//----------------------------------------------------------------------
@Override
public void onScanFinished( RomCollection collection ) {
pd.dismiss();
if(collection.getRoms().length == 0)
showFileBrowser();
else
notifyDataSetChanged();
}
//----------------------------------------------------------------------
}
//--------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/NDSScanner/NdsRom.java
================================================
package com.opendoorstudios.ds4droid.NDSScanner;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import java.io.*;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Collections;
import java.util.Locale;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
//==============================================================================
public class NdsRom {
// Data from http://nocash.emubase.de/gbatek.htm
//--------------------------------------------------------------------------
// title, gamecode, makercode are tightly packed; no offset needed until info
private static final int INFO_OFFSET = 0x56, INFO_ADDRESS = 0x68, ICON_OFFSET = 0x20;
protected final byte[] TITLE_BYTES = new byte[12],
GAMECODE_BYTES = new byte[ 4],
MAKERCODE_BYTES = new byte[ 2],
INFO_BYTES = new byte[ 4],
// Below only used if INFO_BYTES > 0
ICON_BYTES = new byte[512],
PALETTE_BYTES = new byte[ 32],
TITLE_JP_BYTES = new byte[256], // Japanese
TITLE_EN_BYTES = new byte[256], // English
TITLE_FR_BYTES = new byte[256], // French
TITLE_DE_BYTES = new byte[256], // German
TITLE_IT_BYTES = new byte[256], // Italian
TITLE_ES_BYTES = new byte[256]; // Spanish
private long game_code;
private Bitmap icon;
private String title_jp, title_en, title_fr, title_de, title_it, title_es;
static final String ROM_PATTERN = "^.*\\.(NDS|nds)$",
ZIP_PATTERN = "^.*\\.(ZIP|zip)$",
RAR_PATTERN = "^.*\\.(RAR|rar)$";
private final File FILE;
//--------------------------------------------------------------------------
public static NdsRom MakeRom(File f) {
final InputStream stream = NdsRom.getRomStream(f);
if(f == null)
return null;
return new NdsRom(f,stream);
}
private NdsRom(File file, InputStream stream ) {
FILE = file;
try {
stream.read( TITLE_BYTES );
stream.read( GAMECODE_BYTES );
stream.read( MAKERCODE_BYTES );
stream.skip( INFO_OFFSET );
stream.read( INFO_BYTES );
// Load info iff a valid address was provided in INFO_BYTES
int info_skip = composeInt( INFO_BYTES ) - INFO_ADDRESS - INFO_BYTES.length;
if ( info_skip > 0 ) {
longSkip( stream, info_skip );
stream.skip( ICON_OFFSET ); // Some junk data before the icon
// Also iterate to read large sections
int read_index = 0;
while ( read_index < ICON_BYTES.length ) {
read_index += stream.read( ICON_BYTES, read_index, ICON_BYTES.length - read_index );
}
stream.read( PALETTE_BYTES );
stream.read( TITLE_JP_BYTES );
stream.read( TITLE_EN_BYTES );
stream.read( TITLE_FR_BYTES );
stream.read( TITLE_DE_BYTES );
stream.read( TITLE_IT_BYTES );
stream.read( TITLE_ES_BYTES );
}
} catch ( IOException e ) {
e.printStackTrace();
}
finally {
try {
stream.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
//--------------------------------------------------------------------------
// Iterate to skip large sections, in case we're reading an archive
private void longSkip( InputStream stream, int skip ) throws IOException {
long skipped_total = 0;
while ( skipped_total < skip ) {
skipped_total += stream.skip( skip - skipped_total );
}
}
//--------------------------------------------------------------------------
private static int composeInt( byte[] bytes ) {
return ByteBuffer.wrap( bytes ).order( ByteOrder.LITTLE_ENDIAN ).getInt();
}
//--------------------------------------------------------------------------
public long getGameCode() {
if ( game_code == 0 ) game_code = composeInt( GAMECODE_BYTES );
return game_code;
}
//--------------------------------------------------------------------------
public Bitmap getIcon() {
if ( icon == null && composeInt( INFO_BYTES ) > 0 ) {
icon = Bitmap.createBitmap( 32, 32, Bitmap.Config.ARGB_8888 );
Canvas canvas = new Canvas( icon );
Paint paint = new Paint();
int x, y, index_a, index_b, color_a, color_b;
ByteBuffer palette = ByteBuffer.wrap( PALETTE_BYTES ).order( ByteOrder.LITTLE_ENDIAN );
for ( int i = 0; i < 512; i ++ ) {
index_a = ( ICON_BYTES[i] ) & 15;
index_b = ( ICON_BYTES[i] >>> 4 ) & 15;
color_a = palette.getShort( index_a * 2 );
color_b = palette.getShort( index_b * 2 );
// Oh fuck me
x = ( 2 * ( i % 4 ))
+ ( 8 * (( i / 32 ) % 4 ));
y = ( ( i / 4 ) % 8 )
+ ( 8 * ( i / 128 ) );
// X b b b b b g g|g g g r r r r r
paint.setARGB( index_a != 0 ? 255 : 0,
( color_a << 3 ) & 255,
( color_a >>> 2 ) & 255,
( color_a >>> 7 ) & 255 );
canvas.drawPoint( x, y, paint );
paint.setARGB( index_b != 0 ? 255 : 0,
( color_b << 3 ) & 255,
( color_b >>> 2 ) & 255,
( color_b >>> 7 ) & 255 );
canvas.drawPoint( x + 1, y, paint );
}
}
return icon;
}
//--------------------------------------------------------------------------
public boolean isIconLoaded() {
return icon != null;
}
//--------------------------------------------------------------------------
public String getTitle() {
return getTitle( null );
}
//--------------------------------------------------------------------------
public String getTitle( String lang ) {
try {
if ( Locale.JAPANESE.getLanguage().equals( lang )) {
if ( title_jp == null ) title_jp = new String( TITLE_JP_BYTES, "UTF-8" );
return title_jp;
} else if ( Locale.FRENCH.getLanguage().equals( lang )) {
if ( title_fr == null ) title_fr = new String( TITLE_FR_BYTES, "UTF-8" );
return title_fr;
} else if ( Locale.GERMAN.getLanguage().equals( lang )) {
if ( title_de == null ) title_de = new String( TITLE_DE_BYTES, "UTF-8" );
return title_de;
} else if ( Locale.ITALIAN.getLanguage().equals( lang )) {
if ( title_it == null ) title_it = new String( TITLE_IT_BYTES, "UTF-8" );
return title_it;
} else if ( "es".equals( lang )) { // Spanish not in Android?
if ( title_es == null ) title_es = new String( TITLE_ES_BYTES, "UTF-8" );
return title_es;
} else {
if ( title_en == null ) title_en = new String( TITLE_EN_BYTES, "UTF-8" );
return title_en;
}
} catch ( UnsupportedEncodingException e ) {
return null;
}
}
//--------------------------------------------------------------------------
public File getFile() { return FILE; }
//--------------------------------------------------------------------------
static boolean isRomArchive( ZipFile file ) {
for ( ZipEntry entry : Collections.list( file.entries() )) {
if ( entry.getName().matches( ROM_PATTERN )) return true;
}
return false;
}
//--------------------------------------------------------------------------
/*
private static boolean isRomArchive( RARFile file ) {
for ( RARArchivedFile entry : file.getArchivedFiles() ) {
if ( entry.getName().matches( ROM_PATTERN )) return true;
}
return false;
}
*/
//--------------------------------------------------------------------------
private static InputStream getRomStream( File file ) {
if ( file.getName().matches( ROM_PATTERN )) {
try { return new FileInputStream( file ); }
catch ( FileNotFoundException e ) { return null; }
}
if ( file.getName().matches( ZIP_PATTERN )) {
try { return getRomStream( new ZipFile( file )); }
catch ( IOException e ) { return null; }
}
/*
if ( file.getName().matches( RAR_PATTERN )) {
Log.d( "NDS", "\nLoading RAR file " + file.getName() );
try { return getRomStream( new RARFile( file )); }
catch ( IOException e ) { return null; }
}
*/
return null;
}
//--------------------------------------------------------------------------
private static InputStream getRomStream( ZipFile file ) {
for ( ZipEntry entry : Collections.list( file.entries() )){
if ( entry.getName().matches( ROM_PATTERN )) {
try { return file.getInputStream( entry ); }
catch ( IOException e ) { return null; }
}
}
return null;
}
//--------------------------------------------------------------------------
/*
private static InputStream getRomStream( RARFile file ) {
for ( RARArchivedFile entry : file.getArchivedFiles() ) {
if ( entry.getName().matches( ROM_PATTERN )) {
return file.extract( entry );
}
}
return null;
}
*/
//--------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/NDSScanner/RomCollection.java
================================================
package com.opendoorstudios.ds4droid.NDSScanner;
import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.AsyncTask;
import android.util.Log;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import java.util.zip.ZipFile;
//==============================================================================
public class RomCollection {
// NOTE: Rar archives weren't working for some reason. Probably need to plug in a new library.
//--------------------------------------------------------------------------
private static final FileFilter
DIR_FILTER = new FileFilter() { @Override public boolean accept( File file ) {
return file.isDirectory();
}},
NDS_FILTER = new FileFilter() {
@Override
public boolean accept( File file ) {
return !file.isDirectory() && file.getName().matches( NdsRom.ROM_PATTERN );
}
},
ZIP_FILTER = new FileFilter() {
@Override
public boolean accept( File file ) {
if ( file.getName().matches( NdsRom.ZIP_PATTERN ) ) {
try {
return NdsRom.isRomArchive( new ZipFile( file ) );
} catch ( IOException e ) { return false; }
}
return false;
}
},
/*
RAR_FILTER = new FileFilter() { @Override public boolean accept( File file ) {
if ( file.getName().matches( "^.*\\.(RAR|rar)$" )) {
try { return isRomArchive( new RARFile( file )); }
catch ( IOException e ) { return false; }
}
return false;
}},
*/
ALL_ROMS_FILTER = new FileFilter() {
@Override
public boolean accept( File file ) {
return NDS_FILTER.accept( file )
|| ZIP_FILTER.accept( file )
/*|| RAR_FILTER.accept( file )*/;
}
};
private SQLiteDatabase DB;
private final File ROOT;
private final Set LISTENERS = new HashSet();
private NdsRom[] roms;
//--------------------------------------------------------------------------
public RomCollection( Context context, File root ) {
try {
DB = new RomDatabaseHelper( context ).getWritableDatabase();
}
catch(Exception e) {
//for some reason, this is failing sometimes with a "SQLiteDatabaseLockedException".
//I can't get this to happen on my device, but I see on the Google Play ANR reports.
//I think it may have something to do with a previous instance of the activity not having
//closed the connection yet. I made the actual collection instance static, but just as
//an extra fallback we'll wait a bit here and try to reopen the DB
try {
Thread.sleep(500);
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
DB = new RomDatabaseHelper( context ).getWritableDatabase();
}
ROOT = root;
}
//--------------------------------------------------------------------------
public void update( final Context context ) {
new AsyncTask() {
@Override
public void onPreExecute() {
for ( ScanListener listener : LISTENERS ) {
listener.onScanStarted( RomCollection.this );
}
}
@Override
public Void doInBackground( Void... x ) {
SharedPreferences prefs = context.getSharedPreferences( "ndsscanner", Context.MODE_PRIVATE );
// Delete first, ask questions later
Cursor cursor = DB.query( "roms", new String[]{ "path" }, null, null, null, null, null );
DB.beginTransaction();
while ( cursor.moveToNext() ) {
if ( !new File( cursor.getString( 0 ) ).exists() ) {
DB.delete( "roms", "path=?", new String[]{ cursor.getString( 0 ) } );
}
}
DB.setTransactionSuccessful();
DB.endTransaction();
cursor.close();
long last_scan = prefs.getLong( "last_scan", 0 );
boolean recursive = prefs.getBoolean( "recursive", true );
DB.beginTransaction();
scanDirectory( ROOT, last_scan, recursive, 0 );
DB.setTransactionSuccessful();
DB.endTransaction();
prefs.edit().putLong( "last_scan", System.currentTimeMillis() ).commit();
return null;
}
@Override
public void onPostExecute( Void x ) {
roms = null;
for ( ScanListener listener : LISTENERS ) {
listener.onScanFinished( RomCollection.this );
}
}
}.execute();
}
public void clear() {
DB.beginTransaction();
DB.delete( "roms", null, null );
DB.setTransactionSuccessful();
DB.endTransaction();
}
//--------------------------------------------------------------------------
private void scanDirectory( File file, long last_scan, boolean recursive, int recursionLevel ) {
ContentValues vals = new ContentValues();
NdsRom rom;
InputStream stream;
if(recursionLevel > 5)
return; //if the ROMs are more than 5 layers deep... well... they'll just have to use the file browser
try
{
// Insert DB entries for all matching rom files
for ( File f : file.listFiles( ALL_ROMS_FILTER )) {
vals.clear();
rom = NdsRom.MakeRom(f);
if(f == null)
continue;
vals.put( "path", f.getAbsolutePath() );
vals.put( "title", rom.getTitle() );
vals.put( "gamecode", rom.getGameCode() );
DB.insertWithOnConflict( "roms", null, vals, SQLiteDatabase.CONFLICT_IGNORE );
}
// Subdirectories
if ( recursive ) for ( File dir : file.listFiles( DIR_FILTER )) {
if ( dir.lastModified() > last_scan ) scanDirectory( dir, last_scan, recursive, recursionLevel + 1 );
}
}
catch(Exception e)
{
//on my x86 emulator I'm not allowed to read /mnt/sdcard/.android_secure
//if we get this, just skip the directory
Log.d("nds4droid", "Unable to scan " + file.getAbsolutePath());
}
}
//--------------------------------------------------------------------------
public void addListener( ScanListener listener ) {
LISTENERS.add( listener );
}
//--------------------------------------------------------------------------
public void removeListener( ScanListener listener ) {
LISTENERS.remove( listener );
}
//--------------------------------------------------------------------------
public void clearListeners() {
LISTENERS.clear();
}
//--------------------------------------------------------------------------
public NdsRom[] getRoms() {
if ( roms == null ) {
final LinkedList list = new LinkedList();
Cursor c = DB.query( "roms", new String[]{ "path" },
null, null, null, null, "title" );
while ( c.moveToNext() ) {
final NdsRom rom = NdsRom.MakeRom(new File( c.getString( 0 )));
if(rom == null)
continue;
list.add(rom);
}
roms = new NdsRom[list.size()];
list.toArray(roms);
c.close();
}
return roms;
}
//--------------------------------------------------------------------------
//==========================================================================
public interface ScanListener {
//----------------------------------------------------------------------
public void onScanStarted( RomCollection collection );
public void onScanFinished( RomCollection collection );
//----------------------------------------------------------------------
}
//--------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/NDSScanner/RomDatabaseHelper.java
================================================
package com.opendoorstudios.ds4droid.NDSScanner;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
//==============================================================================
public class RomDatabaseHelper extends SQLiteOpenHelper {
//--------------------------------------------------------------------------
public static final String DB_NAME = "roms.db";
public static final int DB_VERSION = 1;
//--------------------------------------------------------------------------
public RomDatabaseHelper( Context context ) {
super( context, DB_NAME, null, DB_VERSION );
}
//--------------------------------------------------------------------------
@Override
public void onCreate( SQLiteDatabase db ) {
db.execSQL(
"CREATE TABLE roms ( " +
"path TEXT PRIMARY KEY, " +
"title TEXT , " +
"gamecode TEXT " +
");" );
}
//--------------------------------------------------------------------------
@Override
public void onUpgrade( SQLiteDatabase db, int old_version, int new_version ) {
switch ( old_version ) {
}
}
//--------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/Settings.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import java.util.Locale;
import java.util.Map.Entry;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.Environment;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.view.KeyEvent;
public class Settings extends PreferenceActivity {
static final int EDIT_LAYOUT_ID = 1337;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.settings);
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
findPreference(EDIT_LAYOUT).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference pref) {
startActivityForResult(new Intent(Settings.this, ButtonLayoutEditor.class), EDIT_LAYOUT_ID);
return true;
}
});
findPreference(RESET_LAYOUT).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
applyLayoutDefaults(prefs, true);
return true;
}
});
findPreference(EDIT_MAPPINGS).setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
startActivity(new Intent(Settings.this, KeyMapSettings.class));
return true;
}
});
}
static void applyLayoutDefaults(SharedPreferences prefs, boolean overwrite) {
SharedPreferences.Editor edit = prefs.edit();
for(Entry button : Button.portraitToDefault.entrySet()) {
final String prefBase = "Controls.Portrait." + Button.getButtonName(button.getValue().id);
if(!overwrite && prefs.contains(prefBase + ".Left"))
continue;
edit.remove(prefBase + ".Left");
edit.remove(prefBase + ".Right");
edit.remove(prefBase + ".Top");
edit.remove(prefBase + ".Bottom");
}
if(overwrite || !prefs.contains("Controls.Portrait.Draw"))
edit.putBoolean("Controls.Portrait.Draw", true);
for(Entry button : Button.landscapeToDefault.entrySet()) {
final String prefBase = "Controls.Landscape." + Button.getButtonName(button.getValue().id);
if(!overwrite && prefs.contains(prefBase + ".Left"))
continue;
edit.remove(prefBase + ".Left");
edit.remove(prefBase + ".Right");
edit.remove(prefBase + ".Top");
edit.remove(prefBase + ".Bottom");
}
if(overwrite || !prefs.contains("Controls.Landscape.Draw"))
edit.putBoolean("Controls.Landscape.Draw", true);
if(overwrite || !prefs.contains(BUTTON_TRANSPARENCY))
edit.putInt(BUTTON_TRANSPARENCY, 78);
if(overwrite || !prefs.contains(HAPTIC))
edit.putBoolean(HAPTIC, false);
if(overwrite || !prefs.contains(ALWAYS_TOUCH))
edit.putBoolean(ALWAYS_TOUCH, false);
edit.apply();
}
public static final String SHOW_TOUCH_MESSAGE = "ShowTouchMessage";
public static final String DESMUME_PATH = "DeSmuMEPath";
public static final String SHOW_FPS = "DisplayFps";
public static final String FRAME_SKIP = "FrameSkip";
public static final String SCREEN_FILTER = "Filter";
public static final String RENDERER = "Renderer";
public static final String ENABLE_SOUND = "SoundCore2";
public static final String SHOW_SOUND_MESSAGE = "ShowSoundMessage";
public static final String INSTALLED_RELEASE = "InstalledRelease";
public static final String EDIT_LAYOUT = "Controls.EditLayout";
public static final String RESET_LAYOUT = "Controls.ResetLayout";
public static final String LCD_SWAP = "LCDsSwap";
public static final String BUTTON_TRANSPARENCY = "Controls.Transparency";
public static final String HAPTIC = "Controls.Haptic";
public static final String EDIT_MAPPINGS = "Controls.EditMappings";
public static final String MAPPING_UP = "Controls.KeyMap.Up";
public static final String MAPPING_DOWN = "Controls.KeyMap.Down";
public static final String MAPPING_LEFT = "Controls.KeyMap.Left";
public static final String MAPPING_RIGHT = "Controls.KeyMap.Right";
public static final String MAPPING_A = "Controls.KeyMap.A";
public static final String MAPPING_B = "Controls.KeyMap.B";
public static final String MAPPING_X = "Controls.KeyMap.X";
public static final String MAPPING_Y = "Controls.KeyMap.Y";
public static final String MAPPING_START = "Controls.KeyMap.Start";
public static final String MAPPING_SELECT = "Controls.KeyMap.Select";
public static final String MAPPING_L = "Controls.KeyMap.L";
public static final String MAPPING_R = "Controls.KeyMap.R";
public static final String MAPPING_TOUCH = "Controls.KeyMap.Touch";
public static final String MAPPING_OPTIONS = "Controls.KeyMap.Options";
public static final String DONT_ROTATE_LCDS = "WindowRotate";
public static final String LANGUAGE = "Language";
public static final String ENABLE_MICROPHONE = "EnableMicrophone";
public static final String ALWAYS_TOUCH = "Controls.AlwaysTouch";
public static final String MAINTAIN_ASPECT_RATIO = "MaintainAspectRatio";
public static final String MAIN_SCREEN_ONLY = "MainScreenOnly";
public static final String SPECIFIC_SCREEN_ONLY = "SpecificScreenOnly";
public static final String FIRST_OUYA_RUN = "FirstOUYARun";
public static final String LAST_ROM_DIR = "LastROMDir";
public static final String CPU_MODE = "CpuMode";
public static final String SOUND_SYNC_MODE = "SynchMode";
public static final String JIT_SIZE ="JitSize";
public static final String ENABLE_FOG = "EnableFog";
public static final String ENABLE_AUTOSAVE = "EnableAutosave";
public static final String AUTOSVAE_FREQUENCY = "AutosaveFrequency";
public static final String DISABLE_ROM_BROWSER = "DisableROMBrowser";
static void applyMappingDefaults(SharedPreferences prefs, boolean overwrite) {
final SharedPreferences.Editor editor = prefs.edit();
if(overwrite || !prefs.contains(MAPPING_UP))
editor.putInt(MAPPING_UP, KeyEvent.KEYCODE_DPAD_UP);
if(overwrite || !prefs.contains(MAPPING_DOWN))
editor.putInt(MAPPING_DOWN, KeyEvent.KEYCODE_DPAD_DOWN);
if(overwrite || !prefs.contains(MAPPING_LEFT))
editor.putInt(MAPPING_LEFT, KeyEvent.KEYCODE_DPAD_LEFT);
if(overwrite || !prefs.contains(MAPPING_RIGHT))
editor.putInt(MAPPING_RIGHT, KeyEvent.KEYCODE_DPAD_RIGHT);
if(overwrite || !prefs.contains(MAPPING_A))
editor.putInt(MAPPING_A, KeyEvent.KEYCODE_BUTTON_B);
if(overwrite || !prefs.contains(MAPPING_B))
editor.putInt(MAPPING_B, KeyEvent.KEYCODE_BUTTON_A);
if(overwrite || !prefs.contains(MAPPING_X))
editor.putInt(MAPPING_X, KeyEvent.KEYCODE_BUTTON_Y);
if(overwrite || !prefs.contains(MAPPING_Y))
editor.putInt(MAPPING_Y, KeyEvent.KEYCODE_BUTTON_X);
if(overwrite || !prefs.contains(MAPPING_START))
editor.putInt(MAPPING_START, KeyEvent.KEYCODE_BUTTON_THUMBR);
if(overwrite || !prefs.contains(MAPPING_SELECT))
editor.putInt(MAPPING_SELECT, KeyEvent.KEYCODE_BUTTON_THUMBL);
if(overwrite || !prefs.contains(MAPPING_L))
editor.putInt(MAPPING_L, KeyEvent.KEYCODE_BUTTON_L1);
if(overwrite || !prefs.contains(MAPPING_R))
editor.putInt(MAPPING_R, KeyEvent.KEYCODE_BUTTON_R1);
if(overwrite || !prefs.contains(MAPPING_TOUCH))
editor.putInt(MAPPING_TOUCH, KeyEvent.KEYCODE_T);
if(overwrite || !prefs.contains(MAPPING_OPTIONS))
editor.putInt(MAPPING_OPTIONS, KeyEvent.KEYCODE_BUTTON_START);
editor.apply();
}
public static void applyDefaults(Context context) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
if(MainActivity.IS_OUYA) {
//check if we should overwrite settings with the OUYA defaults
if(!prefs.contains(FIRST_OUYA_RUN)) {
editor.putBoolean(FIRST_OUYA_RUN, true);
editor.putBoolean("Controls.Landscape.Draw", false);
editor.putBoolean("Controls.Portrait.Draw", false);
editor.putBoolean(SHOW_TOUCH_MESSAGE, false);
editor.putBoolean(ALWAYS_TOUCH, true);
editor.putBoolean(ENABLE_SOUND, true);
editor.putBoolean(ENABLE_MICROPHONE, false);
editor.putBoolean(SHOW_SOUND_MESSAGE, false);
editor.apply();
}
}
if(prefs.contains(INSTALLED_RELEASE)) {
int currentInstall = prefs.getInt(INSTALLED_RELEASE, 0);
if(prefs.contains(FRAME_SKIP)) {
int currentFS = Integer.valueOf(prefs.getString(FRAME_SKIP, "0"));
//from version 20->21 the default frameskip changed from 1 to 3
if(currentInstall <= 20 && currentFS == 1)
editor.putString(FRAME_SKIP, "3");
}
if(prefs.contains(CPU_MODE)) {
//the new default cpu engine in 35 is "lightning jit"
if(currentInstall <= 34)
editor.putString(CPU_MODE, "2");
}
}
if(!prefs.contains(SHOW_TOUCH_MESSAGE))
editor.putBoolean(SHOW_TOUCH_MESSAGE, true);
if(!prefs.contains(SHOW_FPS))
editor.putBoolean(SHOW_FPS, false);
if(!prefs.contains(FRAME_SKIP))
editor.putString(FRAME_SKIP, "3");
if(!prefs.contains(SCREEN_FILTER))
editor.putString(SCREEN_FILTER, "0");
if(!prefs.contains(RENDERER))
editor.putString(RENDERER, "2");
if(!prefs.contains(ENABLE_SOUND))
editor.putBoolean(ENABLE_SOUND, false);
if(!prefs.contains(SHOW_SOUND_MESSAGE))
editor.putBoolean(SHOW_SOUND_MESSAGE, true);
if(!prefs.contains(LCD_SWAP))
editor.putBoolean(LCD_SWAP, false);
if(!prefs.contains(DONT_ROTATE_LCDS))
editor.putBoolean(DONT_ROTATE_LCDS, false);
if(!prefs.contains(ENABLE_MICROPHONE))
editor.putBoolean(ENABLE_MICROPHONE, true);
if(!prefs.contains(MAINTAIN_ASPECT_RATIO))
editor.putBoolean(MAINTAIN_ASPECT_RATIO, true);
if(!prefs.contains(MAIN_SCREEN_ONLY))
editor.putBoolean(MAIN_SCREEN_ONLY, false);
if(!prefs.contains(SPECIFIC_SCREEN_ONLY))
editor.putString(SPECIFIC_SCREEN_ONLY, "0");
if(!prefs.contains(LAST_ROM_DIR))
editor.putString(LAST_ROM_DIR, Environment.getExternalStorageDirectory().getPath() );
if(!prefs.contains(CPU_MODE))
editor.putString(CPU_MODE, "2");
if(!prefs.contains(SOUND_SYNC_MODE))
editor.putString(SOUND_SYNC_MODE, "0");
if(!prefs.contains(ENABLE_FOG))
editor.putBoolean(ENABLE_FOG, true);
if(!prefs.contains(JIT_SIZE))
editor.putInt(JIT_SIZE,10);
if(!prefs.contains(ENABLE_AUTOSAVE))
editor.putBoolean(ENABLE_AUTOSAVE, true);
if(!prefs.contains(AUTOSVAE_FREQUENCY))
editor.putString(AUTOSVAE_FREQUENCY, "1");
if(!prefs.contains(DISABLE_ROM_BROWSER))
editor.putBoolean(DISABLE_ROM_BROWSER, false);
if(!prefs.contains(LANGUAGE)) {
final String userLanguage = Locale.getDefault().getISO3Language();
int lang = 1; //english
if(userLanguage.equals("jpn"))
lang = 0;
else if(userLanguage.equals("fra"))
lang = 2;
else if(userLanguage.equals("deu"))
lang = 3;
else if(userLanguage.equals("ita"))
lang = 4;
else if(userLanguage.equals("spa"))
lang = 5;
editor.putString(LANGUAGE, String.valueOf(lang));
}
applyLayoutDefaults(prefs, false);
applyMappingDefaults(prefs, false);
try {
PackageInfo info = context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
editor.putInt(INSTALLED_RELEASE, info.versionCode);
} catch (NameNotFoundException e) {
}
editor.apply();
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/SliderPreference.java
================================================
package com.opendoorstudios.ds4droid;
import android.content.Context;
import android.preference.DialogPreference;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.SeekBar.OnSeekBarChangeListener;
public class SliderPreference extends DialogPreference implements OnSeekBarChangeListener {
public SliderPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}
private SeekBar seek;
private int currentValue;
private static final int defaultValue = 10;
private TextView currentValueDisplay;
@Override
protected View onCreateDialogView() {
currentValue = getPersistedInt(defaultValue);
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.dialog_slider_noimg, null);
((TextView) view.findViewById(R.id.min_value_noimg)).setText("0");
((TextView) view.findViewById(R.id.max_value_noimg)).setText("100");
currentValueDisplay = (TextView)view.findViewById(R.id.current_value_noimg);
currentValueDisplay.setText(String.valueOf(currentValue));
seek = (SeekBar) view.findViewById(R.id.seek_bar_noimg);
seek.setMax(100);
seek.setProgress(currentValue);
seek.setOnSeekBarChangeListener(this);
return view;
}
@Override
protected void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
if (!positiveResult) {
return;
}
if (shouldPersist()) {
persistInt(currentValue);
}
notifyChanged();
}
@Override
public CharSequence getSummary() {
String summary = super.getSummary().toString();
int value = getPersistedInt(currentValue);
return summary + " (currently " + value + ")";
}
public void onProgressChanged(SeekBar seek, int value, boolean fromTouch) {
currentValueDisplay.setText(String.valueOf(currentValue = value));
}
@Override
public void onStartTrackingTouch(SeekBar paramSeekBar) {
// TODO Auto-generated method stub
}
@Override
public void onStopTrackingTouch(SeekBar paramSeekBar) {
// TODO Auto-generated method stub
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/TransparencyPreference.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.preference.DialogPreference;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.SeekBar.OnSeekBarChangeListener;
public class TransparencyPreference extends DialogPreference implements OnSeekBarChangeListener {
final Drawable example;
public TransparencyPreference(Context context, AttributeSet attrs) {
super(context, attrs);
example = context.getResources().getDrawable(R.drawable.dpad);
}
private SeekBar seek;
private ImageView img;
private DisplayMetrics metrics;
static final int defaultValue = 78;
private int currentValue;
@Override
protected View onCreateDialogView() {
currentValue = getPersistedInt(defaultValue);
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.dialog_slider, null);
((TextView) view.findViewById(R.id.min_value)).setText("0");
((TextView) view.findViewById(R.id.max_value)).setText("100");
seek = (SeekBar) view.findViewById(R.id.seek_bar);
seek.setMax(100);
seek.setProgress(currentValue);
seek.setOnSeekBarChangeListener(this);
img = (ImageView) view.findViewById(R.id.current_value);
img.setImageDrawable(example);
img.setAlpha((int)(currentValue * 2.55f));
return view;
}
@Override
protected void onDialogClosed(boolean positiveResult) {
super.onDialogClosed(positiveResult);
if (!positiveResult) {
return;
}
if (shouldPersist()) {
persistInt(currentValue);
}
notifyChanged();
}
@Override
public CharSequence getSummary() {
String summary = super.getSummary().toString();
int value = getPersistedInt(currentValue);
return summary + " (currently " + value + "%)";
}
public void onProgressChanged(SeekBar seek, int value, boolean fromTouch) {
currentValue = value;
img.setAlpha((int)(currentValue * 2.55f));
}
@Override
public void onStartTrackingTouch(SeekBar arg0) {
// TODO Auto-generated method stub
}
@Override
public void onStopTrackingTouch(SeekBar arg0) {
// TODO Auto-generated method stub
}
}
================================================
FILE: app/src/main/java/com/opendoorstudios/ds4droid/ds4droidApplication.java
================================================
package com.opendoorstudios.ds4droid;
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
import android.app.Application;
public class ds4droidApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
}
}
================================================
FILE: app/src/main/jni/Android.mk
================================================
# Android ndk makefile for ds4droid
LOCAL_BUILD_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(LOCAL_BUILD_PATH)/cpudetect/cpudetect.mk
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
include $(LOCAL_BUILD_PATH)/desmume_neon.mk
include $(LOCAL_BUILD_PATH)/desmume_v7.mk
endif
include $(LOCAL_BUILD_PATH)/desmume_compat.mk
include $(LOCAL_BUILD_PATH)/desmume/src/android/7z/7z.mk
================================================
FILE: app/src/main/jni/Application.mk
================================================
# Android ndk makefile for nds4droid
APP_STL := gnustl_static
APP_ABI := armeabi armeabi-v7a x86
# For releases
APP_CFLAGS := -Ofast -ftree-vectorize -fsingle-precision-constant -fprefetch-loop-arrays -fvariable-expansion-in-unroller -ffast-math -funroll-loops -fomit-frame-pointer -fno-math-errno -funsafe-math-optimizations -ffinite-math-only -fdata-sections -fbranch-target-load-optimize2 -fno-exceptions -fno-stack-protector -fforce-addr -funswitch-loops -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-loop-if-convert-stores -ftree-loop-distribution -floop-interchange -ftree-loop-linear -floop-block -Wno-psabi
# For profiling
#APP_CFLAGS := -Ofast -ftree-vectorize -fsingle-precision-constant -fprefetch-loop-arrays -fvariable-expansion-in-unroller -ffast-math -funroll-loops -fno-math-errno -funsafe-math-optimizations -ffinite-math-only -fdata-sections -fbranch-target-load-optimize2 -fno-exceptions -fno-stack-protector -fforce-addr -funswitch-loops -ftree-loop-im -ftree-loop-ivcanon -fivopts -ftree-loop-if-convert-stores -ftree-loop-distribution -floop-interchange -ftree-loop-linear -floop-block -Wno-psabi
# To generate data for profile guided optimizations
#APP_CFLAGS += -fprofile-generate=/sdcard/profile
#APP_LDFLAGS := -fprofile-generate=/sdcard/profile
# To use profile guide optimizaions
#APP_CFLAGS += -Wno-coverage-mismatch -fprofile-correction -fprofile-use=d:/ds/profile
#APP_LDFLAGS := -fprofile-use=d:/ds/profile
# For debugging
#APP_CFLAGS := -Wno-psabi
NDK_TOOLCHAIN_VERSION=4.9
APP_PLATFORM := android-9
================================================
FILE: app/src/main/jni/android-ndk-profiler/Android.mk
================================================
TARGET_thumb_release_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_thumb_release_CFLAGS))
TARGET_thumb_release_CFLAGS := $(filter-out -fomit-frame-pointer,$(TARGET_thumb_release_CFLAGS))
TARGET_arm_release_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_arm_release_CFLAGS))
TARGET_arm_release_CFLAGS := $(filter-out -fomit-frame-pointer,$(TARGET_arm_release_CFLAGS))
TARGET_CFLAGS := $(filter-out -ffunction-sections,$(TARGET_CFLAGS))
LOCAL_PATH := $(call my-dir)
# include libandprof.a in the build
include $(CLEAR_VARS)
LOCAL_MODULE := android-ndk-profiler
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libandroid-ndk-profiler.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := -llog
include $(PREBUILT_STATIC_LIBRARY)
================================================
FILE: app/src/main/jni/android-ndk-profiler/prof.h
================================================
/*
* Part of the android-ndk-profiler library.
* Copyright (C) Richard Quirk
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#ifndef prof_h_seen
#define prof_h_seen
#ifdef __cplusplus
extern "C" {
#endif
void monstartup(const char *libname);
void moncleanup(void);
#ifdef __cplusplus
}
#endif
#endif
================================================
FILE: app/src/main/jni/cpudetect/cpu.cpp
================================================
/*
Copyright (C) 2012 Jeffrey Quesnelle
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#include
#include
#define JNI_NOARGS(X) Java_com_opendoorstudios_ds4droid_DeSmuME_##X(JNIEnv* env, jclass* clazz)
#define CPUTYPE_COMPAT 0
#define CPUTYPE_V7 1
#define CPUTYPE_NEON 2
extern "C"
{
jint JNI_NOARGS(getCPUType)
{
AndroidCpuFamily cpuFamily = android_getCpuFamily();
uint64_t cpuFeatures = android_getCpuFeatures();
if (cpuFamily == ANDROID_CPU_FAMILY_ARM &&
(cpuFeatures & ANDROID_CPU_ARM_FEATURE_NEON) != 0)
{
return CPUTYPE_NEON;
}
else if (cpuFamily == ANDROID_CPU_FAMILY_ARM &&
(cpuFeatures & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0)
{
return CPUTYPE_V7;
}
else
{
return CPUTYPE_COMPAT;
}
}
jint JNI_NOARGS(getCPUFamily)
{
return (int)android_getCpuFamily();
}
}
================================================
FILE: app/src/main/jni/cpudetect/cpudetect.mk
================================================
# Android ndk makefile for cpudetect
LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := libcpudetect
LOCAL_SRC_FILES := cpu.cpp
LOCAL_ARM_MODE := thumb
LOCAL_ARM_NEON := false
LOCAL_CFLAGS := -fexceptions
LOCAL_STATIC_LIBRARIES := cpufeatures
include $(BUILD_SHARED_LIBRARY)
$(call import-module,cpufeatures)
================================================
FILE: app/src/main/jni/desmume/AUTHORS
================================================
Original author
---------------
yopyop
Current team
------------
Guillaume Duhamel
Normmatt
Bernat Muoz (shash)
Riccardo Magliocchetti
Max Tabachenko (CrazyMax)
zeromus
rogerman
Luigi__
Contributors
------------
Allustar
amponzi
Anthony Molinaro
ape
Damien Nozay (damdoum)
delfare
Romain Vallet
snkmad
Theo Berkau
thoduv
Tim Seidel (Mighty Max)
Pascal Giard (evilynux)
Ben Jaques (masscat)
Jeff Bland
Bernat Muoz (shash)
matusz
nitsuja
gocha
pa__
adelikat
hi-coder
WinterMute
pengvado
dormito
ldesnogue
Thanks to our super testers for this release
------------
nash679
pokefan999
dottorleo
================================================
FILE: app/src/main/jni/desmume/COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
================================================
FILE: app/src/main/jni/desmume/ChangeLog
================================================
0.9.7 -> 0.9.8 (r3812-r4228)
Yes, it's been a while since the last release, but we haven't been completely idle. There's a brand new top shelf Cocoa frontend to make life far more pleasant for OSX users, and a host of compatibility fixes.
General/Core:
bug: fix more IPC FIFO errors
bug: import more save files correctly
bug: don't autopatch already-patched roms
bug: fix bugs in piano and guitar grip
bug: fix ARM7's VRAMSTAT register
bug: fix memory leaks on compact flash emulation
bug: fix reading of rom from low header area
bug: spu: fix some poppy interpolation audio quality issues
bug: improve timing of dma operations by running through normal mem cycle accounting; fixes an annoying number of games and graphical glitches
bug: fix opcode MRC and fake bios CRC16
enh: jitter some related register and irq events to simulate pipeline effects and stimulate some race conditions to other outcomes
enh: fake (deterministic) some tiny jitter from human's hand holding stylus; some games were accidentally depending on this
enh: support nocash-stylep rints from arm
enh: add lua apis for accessing vram
enh: platforms other than windows receive threading optimizations
enh: provide diagnostics when system powers off (useful for homebrewers returning from main())
enh: clarify handling of different console types within the family (ds,dslite,debug)
enh: vfat support for slot-1 devices
enh: emulate temperature register
enh: add paddle emulation
Graphics:
bug: fix occasional crash from uninitialized blending table
bug: fix some 2d alpha blending cases resulting in white screens
bug: fix VRAM_I B_OBJ mirroring and fix sprites rendering across the end of vram
bug: fix rotoscaled sprites wrapping around screen
bug: dont fix rotscaled bitmap sprites with alpha==0
bug: opengl: fix degradation of toon rendering during loadstate
bug: opengl: alpha blending fixes
bug: many refinements to opengl renderer
bug: opengl: support rear-plane/ClearImage emulation (fixes many graphics)
bug: rasterizer: fix some rare alpha blending cases
bug: fix bug in environment mapping introduced after 0.9.6
bug: fix totally glitched out 3d graphics with several improvements involving matrix stack
bug: fix memory overflows in epx filter
bug: prevent backdrop from blending with ???
enh: opengl: better depth buffering emulation
enh: better support for line segment "polys" by detection and special rendering logic
enh: opengl: support quad primitives directly
enh: add hq4x filter
Windows:
bug: fix a long-standing loadstate crash
bug: fix lag frame accounting
bug: fix glitches in cheat entry menu
bug: stop compact flash emulation from accidentally scanning c:\ sometimes
enh: add support for game database for improved save type detection
enh: hotkey for limit framerate toggle
enh: remove stop and reset toolbar buttons which were accidentally getting used
enh: additional complexification to desmume's behaviour run from a console prompt. whether it's better is uncertain.
enh: add support for cheats databases
enh: improvements to ram search tool
enh: preliminary support for varying stylus pressure
enh: add [Display] Show Console=1 to ini file
enh: more graceful cheat parsing and add some hotkeys
enh: add 5x window size
enh: add big endian and 20.12 toggle to memview and ramwatch
enh: improve FPS throttle feedback and granularity
enh: add lua menu API
enh: hud font switching
enh: add optional file association for .nds to path config dialog
Cocoa:
enh: Big update to cocoa frontend. Pretty much entirely new. (rogerman)
Linux:
bug: gtk: glitches in rom and recent rom loading
bug: glade: normalize savestate slot to hotkey mapping
enh: support soundtouch for use by metaspu
enh: gtk: add SPU mode selection (Tobias Jakobi)
enh: cli: better fps limiting (Thomas Jones)
Wx:
bug: some small fixes here and there (Jan Bcken)
enh: lot of code cleanup (Jan Bcken)
0.9.6 -> 0.9.7 (r3493-r3812)
General/Core:
bug: fix a ton of old, broken cpu opcodes and CP15 logic
bug: return Z1 and Z2 from TSC (fixes some touch logic)
bug: gba slot save type detection improved
bug: handle unusual rom headers more correctly
bug: dont confuse motion pack commands with save memory commands
bug: make cheat system a little less flaky and add AR 1.54 support
bug: fix nondeterministic backup memory behaviour while rerecording
bug: correct emulation of register accesses of wrong size and during powerdown
bug: rewrite --cflash-path emulation
bug: rewrite IPC/GX FIFO, IRQ flag generation, and wait-for-IRQ logics
bug: rewrite RTC calendar handling; now supports years > 2038
enh: auto-DLDI patching for homebrew
enh: --gbaslot-rom=self mounts self.nds in slot2
enh: more realistic exception handling
enh: piano controller emulation
enh: modular slot-1 system for exact emulation of homebrew cards
Graphics:
bug: edge marking colors were wrong
bug: handle some "invalid" vram configurations correctly
bug: convert half of geometry engine to fixed point
bug: fix sprite blend+fadein/fadeout
bug: improve rasterizer shadows
bug: fix main memory display DMA
bug: fix some raster fx timing bugs
enh: add a hack for improving some non-stencil shadows
Windows:
bug: misc fixes and improvements to gpu viewer tools
bug: sub screen layer display toggling fixed
bug: fixes and improvements to ram watch, ram search, cheats list
bug: fix start-paused commandline
bug: fix memory leaks when sound disabled
bug: improve load average calculators and add arm7 load average
enh: background input support
enh: add vsync option
enh: support more knobs on joysticks
enh: import cheats from R4 database
enh: add xinput rumble for 360 pads
Linux/OSX:
bug: crash less in recent roms list
enh: Add horizontal screen layout and swap screen ability to gtk frontend (noodlebox)
enh: Big improvement to joystick support, support complex configurations and multiple devices (noodlebox)
0.9.5 -> 0.9.6 (r3075-r3493)
Users of gtk, cli and gtk-glade frontends please note that now we
have a common directory in ~/.config/desmume for config file,
saves and savestates. The old .desmume.ini will be moved
automatically with the name config but you have to move your saves
manually.
Some save files may be invalidated due to use of broken crc logic.
Back up your DSV files before using this version of the emulator or else
the game might wipe it.
General/Core:
bug: emulate keypad interrupt
bug: spu overhaul, add capture support
bug: fix dma address reloading
bug: fix rom close memory corruption
bug: fix div and sqrt busy flag bug
bug: fix vectest
bug: fix lid savestate desync
bug: fix texcache memory GB explosion when games use tons of tiny 3d sprites
bug: fix huge rerecording movie file handle leak
bug: fix EXXXXXXX cheat codes and some add/edit/save/load bugs
bug: add 8MBit - 512MBit flash emulation
bug: fix firmware booted-from-card flag
bug: fix some failures to wake
bug: fix some rtc calendar logic
bug: op_bkpt emulation
bug: correctly emulate POWCNT1 and POWCNT2 and SPI power device
bug: corrections to bootup stack configuration
bug: protect bios from being overwritten
bug: initialize save data to 0xFF instead of 0x00
bug: handle relocated irq vectors
bug: support patched firmwares
bug: handle 8bit auxspidata, 32bit BLDY, 32bit div regs
bug: fix some divide by zero cases
bug: don't print \n in ideas debug message
bug: don't let games read off end of cart and crash emulator
bug: fix SWI 0x0E crc16 ; some save files using wrong crc may be invalidated
bug: fix many big endian bugs
bug: fix CPSR.I idle wakeup
bug: fix loadstate crashes, mostly when sound is enabled
enh: support devkitpro argv
enh: add gbaslot-rom commandline
enh: add no$gba debug message
enh: add rtc start to dsm header
Graphics:
bug: fix a mistakenly rendered OBJ window and 3d blend effects
bug: fixes to matrix stacks, fixing lots of garbled geometry
bug: fix fog density registers
bug: fix hblank dma to run also on scanline 262
bug: fix w/z depth flags for broken GUIs in dual screen 3d games
bug: fixes to poly sorting
bug: block 8bit vram writes
enh: improve accuracy of opengl shaders
Windows:
bug: fix 16bpp display
bug: more fixes to multi-gamepads
bug: cheat windows robustification
bug: fix that sticky pause state when resetting and loading roms
bug: dont crash when no sound device is available
bug: change F10 to be save slot 0
bug: fix --start-paused
enh: try not to screensave while using gamepad
enh: add EPX and EPX1.5X resize filters
enh: add a japanese translation which will soon be stale like the others
enh: add fancy ctrl+printscreen with emulator info on it
enh: add "lockdown" window mode to keep window safe from fast stylus action
enh: add alt+enter fullscreen command
enh: add card eject command
enh: add ddraw software mode forcer
enh: improve oam viewer
enh: default 3d to rasterizer so we dont have to suggest it 1000 times a day
enh: add dump-all-memory tool
enh: add reload rom menu/hotkey
Linux/OSX:
bug: fix building for nosse2 systems
bug: fix --num-cores
bug: fix occasional touchscreen failures
bug: fix crash starting dsm record
enh: add --nojoy=1 to fix laptops with accelerometers
enh: add simple auto frameskip mode in the gtk frontend
enh: add gui for configuring joystick in the gtk frontend
enh: make the cli frontend read the ini config file too
enh: additional OpenAL microphone backend (ncalexan)
enh: common place for config and saves (Jan Steffens)
enh: libagg is now optional if you don't need the hud
0.9.4 -> 0.9.5 (r2437-r3075)
0.9.5 introduces an entirely rewritten main emulation loop
This totally changes the timing, and totally breaks old savestates.
The OSX build is now based on the GTK port which is more up-to-date.
Assorted Highlights:
* synchronous SPU mode to fix streaming sounds
* win32: lua engine, path configuration, 7z dearchiving support
General/Core:
bug: rewrite main emulation loop and cycle accounting, fixes a lot of timings
bug: add more detailed timing emulation, removes much bogus lag
bug: rewrite DMA,gxfifo,gxstat; fix many games and no more alternate flush mode
bug: fix cflash directory support for non-windows and sector-writing
bug: fix freeze in cart irq
bug: correctly emulate dma to/from tcm
bug: fix in thumb LSR carryflag
bug: fix thumb BX PC switch to arm state
bug: fix adpcm looping, remove adpcm caching (no longer necessary)
bug: fixes to swi 3,4,5,8,0x10
bug: fixes to exmemstat and ipc sync registers
bug: support new backup commands
bug: improve bootup bios/firmware emulation steps
enh: gbaslot: add guitar grip, gbagame flash support, expansion memory pak
enh: add more powerful antigrain-based drawing library and rewrite OSD system
enh: ideas-style debugging prints
enh: most optimizations now SSE instead of SSE2
enh: more improvements to frameskipping and frame advance/speed controls
Graphics:
bug: fix backdrop blending with garbage
bug: fix 256B granularity sprite addressing for sub gpu
bug: fix obj blending, bmp obj rendering, and some obj window cases
bug: fix 128-wide captures
bug: fix 16color BG line buffer overflow
bug: fix color overflow in capture blending
bug: fix disp fifo capture
bug: fix simultaneous vram display and capture via same bank
bug: fix 3d overflow acknowledge registers
bug: fix 32bit toon table writes
bug: change 3d cores to use 18bit color
bug: fix boxtest (addition overflow!), move clipper to main graphics engine
bug: fix failure in some cases of polygon clipping
bug: fix disp3dcnt emulations
bug: fixes to poly sorting
bug: fix ogl renderer wireframe support
bug: swrast: fix backface culling of nonconvex polys
bug: swrast: add clear image and scroll emulation
bug: swrast: add fog emulation
bug: swrast: fixes to shadow rendering
bug: swrast: preliminary edge marking, works decent
enh: swrast: multicore optimization for a few fps speedup
Windows:
bug: fix support for multiple gamepads and gamepad hotkeys
bug: fix mic noise code and load wav instead of raw; effective in more cases
bug: fix for several sticky and broken hotkeys, and f10 hotkeys
bug: fixes in ram search, add DTCM and ITCM searching, ...
bug: fix sound settings vol slider
bug: recover from missing window -32000 problem
bug: don't turn on mic unless mic input is enabled
enh: x64 build type now supported
enh: side-by-side and single screen view modes, many fixes to window resizing
enh: choose any gap size by dragging bottom window edge (must be enabled)
enh: choose a gap color
enh: import/export no$GBA savefiles directly
enh: multicore optimization for filters, rotation, OSD
enh: soundview can now mute channels
enh: new ioregview
enh: common commandline system, many arguments shared with linux
enh: improve map view tool to support more modes
enh: add "FORCE AS CURRENT" recovery tool for mis-sized savefiles
enh: add some kind of very small savestate rewinding buffer
enh: autoframeskip works better
enh: add Italian translation
enh: added 2x resizing filters (hq2x, hq2xs, lq2x, lq2xs, 2xsai, supereagle)
(scanlines, nearest2x, bilinear)
Linux:
enh: alsa microphone support
enh: hud and osd notification for gtk and cli frontends
enh: add support for the SSE optimizations
0.9.2 -> 0.9.4 (r1844->r2352->r2437)
0.9.3 was skipped due to emu news sites sneaking it out of our staging area and
releasing it prematurely while it still had bugs. I was going to curse them
individually, but then I decided that they would just like the publicity.
Highlights:
* New save autodetection and save file format
* Full rerecording support
General/Core:
bug: fix many 64 bit and endian issues
bug: fix mic input, which was nearly useless before
bug: fix failures of large dmas
bug: fix in ipc sync which broke devkitpro touch
bug: screenshots now exclude hud and rotation
bug: rewritten vram mapping (fixes corrupted or missing BG)
enh: add universal commandline system (same commandline options on every port)
enh: cheats: added Action Replay code parser
enh: more reliable and useful frameskipping
enh: SPU: speedup: add adpcm caching
enh: SPU: speedup: interpolation is now optional
enh: print svn build number so we can identify people's svn builds from screenshots
Graphics:
bug: add polygon y-sorting (fixes 3d guis)
bug: fix texcoordgen mode 3; fixes some ortho sprites and some entirely broken games
bug: display capture fixes
bug: fix a number of OBJ modes
bug: fixes to affine BG modes
bug: better emulate some translucent OBJ
bug: more correct handling of color effect windows and backdrop colors
bug: fix matrix stack overrun which crashed emulator
bug: swrast: add clear depth image emulation and other fixes to depth buffering
bug: swrast: fix some toon and highlight cases
bug: fix bug in matrix stack, fixes some broken models
enh: add alternate flush mode HACK 3d config toggle, fixes some entirely broken 3d games
Windows:
bug: more robust cheats engine and dialog
enh: more solid avi and wav recording
enh: improved tools: memory viewer
enh: added tools: spu viewer, ram watch, ram search
enh: change build configuration system
enh: speedup: add gpu core disabling to hide useless screens
enh: add background pause feature (for when emulator loses focus)
enh: add missing autohold for L and R
enh: add chinese translation
Gtk frontend:
enh: switch all of menu/toolbar system to GtkAction + GtkUIManager
enh: remove the gtglext 3d code
enh: improve/speedup screen resize and final presentation logic in gtk frontend
enh: minimal rerecording hookups
Cli frontend:
enh: hooked the frameskip (szigor)
enh: misc usability improvements: auto pause switch for pausing when focus is lost and exit on escape pressing (szigor)
enh: hook the fake noise mic; use m to toggle
0.9.1 -> 0.9.2
General/Core:
bug: fix error in SBCS/RSCS flags; fixes many odd behaviors and crashes [zeromus]
bug: add support for sleep mode and power registers [luigi__]
bug: important fixes to RTC so correct time is actually told [luigi__]
bug: fix card reads below 0x8000; fixes some game freezes [normatt]
bug: fix 4 mbit save type; fix non-autodetect savefile dumping [zeromus, matusz]
enh: add sram to GBA game addon emulation for importing savefiles [zeromus]
enh: many improvements and feature hookups in linux ports [matusz, luigi__]
Graphics:
bug: fix specular texture mapping mode [luigi__]
bug: repairs to some capture modes and vram mapping [zeromus, CrazyMax]
bug: viewports finally correctly handled [zeromus]
enh: add software rasterizer. quirky, but on par with opengl [zeromus]
Windows:
bug: mitigate bad frameskipper; default to old frameskipping mode [zeromus]
bug: fixes with recent roms and zipfile loading [zeromus]
bug: fix window position memory [zeromus]
enh: bios and firmware may now be used and booted [luigi__]
enh: many display, OSD, and input enhancements [luigi__]
enh: brand new hotkey and controls binding system [zeromus]
enh: configurable screen separation [luigi__]
enh: fast forward key [pa__]
enh: improvements to mic [luigi__]
enh: faster updates in debug tools, up to once per frame [pa__]
Mac OS X Port:
enh: added Italian translation thanks to Paolo Bernini [jeff]
enh: resurrection of GDB stub [sigmaris]
0.9 -> 0.9.1
General/Core:
enh: GBA slot emulation [CrazyMax]
- Rumble support (windows only)
- GBA game
enh: Mic support (windows only?) [luigi__]
enh: Preliminary cheats system [CrazyMax]
enh: Savestates invalidated, as more variables have been added.
bug: Added PSG white noise [luigi__]
bug: fix arm/thumb ROR [zeromus]
bug: [ 2550645 ] Super Princess Peach: crash when starting a puzzle [zeromus]
bug: win32: fix spu wav file writer (regression from 0.8) [zeromus,luigi__]
bug: Much work on FIFOs, still not finished [CrazyMax]
bug: Many fixes to dma [zeromus, CrazyMax]
bug: bios WaitForVblank and WaitForInterrupt fixed [luigi__]
Graphics:
bug: Added sprite blending [luigi__]
bug: more correct mosaic effects, still imperfect [zeromus]
bug: Many fixes to tile rendering; all graphics tests now pass [luigi__]
bug: fix crashes in some affine BG [zeromus]
bug: Implement some pos test function [luigi__]
bug: fix texture mapping across texture and palette banks and to unmapped banks [zeromus]
bug: fix texture handling for texels with MSB set (fixes some texture corruption) [zeromus]
bug: fix texture coordinate generation, including environment mapping [zeromus]
bug: texture cache invalidates when palettes change, prevents some texture corruption [zeromus]
bug: fix display capturing from 2d+3d source when display mode is display-vram [zeromus]
bug: [ 2488334 ].1 fixes to layer compositing [luigi__]
bug: [ 2488334 ].3 fix bug in support for hdma affine bg parameters [zeromus]
bug: Improvements to 3d h-scrolling [luigi__]
bug: Fix some errors in rendering 512 tall BG [zeromus,CrazyMax] (still not fully resolved)
bug: Add optional fragment shading pipeline (more precision) [luigi__]
bug: Fix bug where some sprites got cut of on x=255 [zeromus]
bug: Implement GXSTAT register [CrazyMax]
Windows:
bug: resizing and rotating work in vista [luigi__]
enh: 0 frameskip now lets emulator run at excess speed [zeromus]
Mac OS X Port:
bug: left key setting no longer gets confused with the right key [jeff]
enh: more keys can be mapped
0.8 -> 0.9
There have been so many changes that this list can hardly be considered complete.
For this release, we have formatted the list into a high level overview of big changes and bad bugs relative to the previous release. Hopefully what you're interested in.
This list does not include items which are solely performance boosts, for let us just say that virtually every system has been speeded up.
* The savestate system is totally changed and incompatible with old savestates.
* The 3d system should be considered rewritten.
General/Core:
enh: Convert to c++
enh: Add functions for a lid open/close. Holding key (default "Backspace" in Windows port) while game is freeze/non freeze. [CrazyMax]
enh: Add secure area decryption from ndstool [zeromus]
enh: Change savestate code to support loosely bound chunks and more easily other parts of the emu (GE, GPU).
The savestate format is changed, but from now on it is in principle more resilient
(though it will continue to break as we tinker with the internals) [zeromus]
enh: Added SSE2 optimizations for matrices. Since we now make an SSE2 build, more optimizations can be made. [CrazyMax]
enh: Add a preliminary GUI hud system [CrazyMax,zeromus]
CPU/MMU:
bug: Many fixes in IPC and GE FIFOs. Fixes freezes in NSMB, dsracing, and others. [CrazyMax,luigi__,shash]
bug: Fix ARM instructions SBC and RSC (likewise SBC in thumb) [normatt]
bug: Fixed Thumb LDMIA (fixes ingame Dead'n'Furious) [shash]
bug: Fix repeating DMA (fixes NSMB parallax BG) [zeromus]
bug: Proper handling for unaligned CPU accesses [luigi__]
bug: Proper handling for undefined instruction exceptions [Salva Peir]
bug: correctly return vram control register values (fixes homebrew 3d games) [zeromus]
enh: Remove 16MB of WRAM at 0x01****** from arm9. Mapped to unused instead. Nobody knows what this was. [zeromus]
enh: Changed instruction execution to 16 at a time blocks (tested and stable) [shash]
Hardware:
bug: Newer and better sqrt and div emulation; makes SM64DS playable [luigi__,shash,zeromus]
bug: Add preliminary RTC implementations [CrazyMax]
enh: Add cosine interpolation in the SPU (conditionally compiled) [zeromus,luigi__]
enh: Experimental: always one silent non-mixing SPU core at 44.1khz synched with emu, for more precision.
The audible core runs with the host, causing music to slow down but not tear or pitch bend. [zeromus]
Graphics:
- Overhaul 3d:
. Move entire GE to core emu.
. Move OpenGL renderer to emu core for optional use by platforms, removing ogl_collector. Now every platform shares the same 3d code.
. Reorganize 3d code to defer rendering to after 3d vblank. Eliminates tearing, and texturing artifacts. [zeromus]
. Add optional fragment shading pipeline (more precision) [luigi__]
. Move lighting model to software instead of using opengl's fixed function model [zeromus]
. Render shadow volumes; toon shading and highlight table [zeromus, luigi__]
. Added texture caching! big speed up. [CrazyMax]
bug: Many assorted tweaks and improvements to 3d and 2d precision [zeromus,CrazyMax,luigi__]
bug: Fixes to GE: command unpacking, projection and pos-vector mode matrix handling, mult and load commands [zeromus]
bug: Fix a bug in texture transformation mode 1 [zeromus]
bug: Fixed GPU rendering bugs in sprites and BG [CrazyMax]
bug: Fixes to texture conversion [CrazyMax,zeromus]
bug: Fixes in capture display (no blinking in many games with dual 3D) [CrazyMax]
bug: Fixes in master brightness (this fixes some games with black screens) [CrazyMax]
bug: Fixes in screen, backdrop, and sprite blending [luigi__]
bug: Changed clear depths and how depth initial values are calculated (fixes SM64DS skybox, Castlevania) [shash,lugi__]
bug: Add 3d layer h-scrolling [zeromus]
bug: Added transparency and fixed material alpha support and alpha testing on the 3D core [shash]
bug: Rewrite VRAM mapping control and rendering (more accurate) [CrazyMax,luigi__]
bug: convert colors to opengl better to prevent alpha=31 polys from being ever so slightly transparent [zeromus]
enh: Add MMU->GPU signal for when vram mappings change to function as a texture cache invalidate signal [zeromus]
enh: Make matrix 4x4 multiply routines use W-coordinate; carry w coord through pipeline [zeromus]
Mac OS X port:
bug: Fixed: Filenames and paths with unicode characters now work. [Jeff]
bug: Fixed: Load state from file button works again. [Jeff]
enh: Save State panel now pauses emulation while the file selection box is open. [Jeff]
bug: Fixed: Frozen video output (and/or messed 3d emulation) after loading a state. [Jeff]
bug: Added option to load the most recent file upon launching the program. [Jeff]
enh: Added French translation (thanks to Pierre Rudloff). [Jeff]
enh: Added basic key mapping configuration to application preferences (thanks to Julio Gorg). [Jeff]
enh: Added keyboard shortcuts for Execute, Pause and Reset command (thanks to Julio Gorg). [Jeff]
enh: Default key mappings are no longer case sensitive. [Jeff]
enh: Added ability to limit speed. [Jeff]
enh: Fixed: Video output should work on software-only 3D renderers. [Jeff]
Windows port:
bug: Fix a race condition in NDS_3D_Reset and NDS_glInit [zeromus]
bug: Fix the buggy auto frameskip logic which made the emu slow to a crawl. Now it runs fast! [zeromus]
bug: Fix resizing, rotate & aspect ration of main window. [CrazyMax,_zeromus]
bug: Remove multithreading from user interface after finding several synchronization issues [zeromus]
enh: recent roms menu [luigi_]
enh: Changed graphics render core to DirectDraw (work faster) [CrazyMax]
enh: Add an arm9 cpu load average calculator similar to no$. but I dont think it works right. [zeromus]
enh: Rewrite all debug tools (autoupdate works now) [CrazyMax]
enh: Rewrite input core & replace config input dialog [CrazyMax]
enh: Add AVI output [zeromus]
enh: Add pause toggle and frame advance hotkeys [adelikat]
enh: Add frame counter display and hud messages framework [adelikat]
enh: Main window remembers position, size, and a few other emu preferences [adelikat]
enh: Removed directx sdk dependency for easier building. [zeromus]
enh: Savestate doesnt unpause emu if it is already paused [adelikat]
0.7.3 -> 0.8
Cocoa:
- Save State As function now works. [Jeff B]
- Recent Items menu now works. [Jeff B]
- Opening NDS files from Finder now works. [Jeff B]
- Added screenshot feature. [Jeff B]
- Added preferences. [Jeff B]
- Many more strings are translatable now. [Jeff B]
- Default screen color is black (better represents being "off" and easier on eyes at night). [Jeff B]
- Added sound. [Jeff B]
- Now is a universal binary. [Jeff B]
- Leopard resolution icon added. [Jeff B]
- Added a Japanese translation. [Jeff B]
- Added an optional status bar (resize handle no longer overlaps screen). [Jeff B]
- New ROM Info and About DeSmuME windows have been added. [Jeff B]
- Fixed several bugs in window resizing. [Jeff B]
- Added FAT image support for homebrew games (thanks to TypeError). [Jeff B]
- Key config can be changed on the command line. Save/load hotkeys changed (so expose doesn't override). [Jeff B]
- Key bindings may work better on non-US keyboards now (needs testing). [Jeff B]
general:
- Encapsulate GDB debug stub to avoid certain problems [shash]
- Fixed CPU LD*/ST* bugs [shash]
- Fixed New SMB mini-games freeze [shash]
- Fixed possible segfault in ROMReader on ia64 and amd64. [evilynux]
- Fixed a crash bug with 2D background corrupting memory [shash]
- Flag check optimization [carlo_bramini]
- Applied some endian fixes in GPU (thanks to Phazz) [Jeff B]
gtk-glade:
- Added DeSmuME version in about dialog. [evilynux]
- Updated website url in about dialog. [evilynux]
- Added Brazilian Portuguese translation by Dreampeppers99. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
gtk:
- Updated website url in about dialog. [evilynux]
- Better desktop menu entry following FreeDesktop specifications. [evilynux]
windows port:
- Added an "about" box [shash]
- DirectInput control interface with joystick support [CrazyMax]
- Matrix and Light viewer [Acid Burn]
0.7.2 -> 0.7.3
gtk-glade:
- Full localization using intltool/gettext. [evilynux]
general:
- Added a README.TRANSLATION documenting the localization process. [evilynux]
MacOS X:
- Initial version of the Mac interface added. [Jeff B]
0.7.1 -> 0.7.2
spu:
- big endian fixes. [cyberwarriorx]
gpu:
- big endian fixes. [marcus_c]
gtk-glade:
- opengl improvements. [masscat]
general:
- Added support for setting NDS firmware language value. [masscat]
- Function added for setting firmware language. [masscat]
- Mac/msys compilation fixes. [cyberwarriorx]
- Fix compilation when pkg-config macros are not available [evilynux]
0.7.0 -> 0.7.1
general:
- Added GDB debugger stub [masscat]
- Added new/different GBAMP CFlash image reader/writer [masscat]
gpu:
- Major speedup to the 2D core [shash]
gtk-glade:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
cli:
- Added command line options. [masscat]
- Added FPS limiter [masscat]
- Added option to use OpenGl to render window (allows resizing). [masscat]
windows port:
- Added command line options. [masscat]
- Added multiple language support [cyberwarriorx]
- Added Danish language translation [thomas-2007]
0.6.0 -> 0.7.0
general:
- Added support for *.duc files [cyberwarriorx]
gpu:
- Added support for sprite rotation/scaling [shash]
- Added support for the 3D core (openGL and null plugins) [shash]
windows port:
- A bunch of fixes [Dmitry Krutskih]
- Fixed a bug in sound that was causing it to still not work for some
people [cyberwarriorx]
gtk:
- Added 3D emulation
- Added command line options.
- Added option to use OpenGL to render window (allows resizing).
gtk-glade:
- Added 3D emulation
0.5.0 -> 0.6.0
general:
- Added zipped (based on zziplib) and gzipped (based on zlib) rom support.
arm:
- Added relocation interrupt vector.
- Added region access right checks.
- Enabled LDC/STC instructions.
- Fixed powersave (cp15) IRQ wait.
- Fixed MOV instructions
gpu:
- Added special color effects.
- Added windowing feature.
- Fixed transparent direct color backgrounds.
- Fixed disabled sprites showing.
- Fixed 8/32 bit access to gpu registers.
- Fixed missing backgrounds
- Support for master brightness
wifi:
- Added RF chip interface.
- Added BB chip interface.
windows port:
- Fixed address calculation in disassembler.
- Added Force Maintain Ratio option for window stretching
linux port (cli, gtk and gtk-glade):
all:
- Added joystick support.
- Fixed X and Y buttons.
gtk-glade:
- Added joystick configuration.
- Improved I/O registers viewer tool.
- Added save and load states support.
0.3.3 -> 0.5.0
arm:
- Fixed MSR with immediate value opcode.
- Fixed LSR_0 thumb opcode (C flag is correctly set now).
- Fixed LDR*/STR* opcodes.
- Fixed unaligned memory access on THUMB Core.
- Added relocating SWI routines.
bios:
- Added decompression functions.
- Added GetPitchTable function.
- Added GetVolumeTable function.
- Added GetCRC16 function.
- Added experimental SoundBias function.
- Added GetSineTable function.
cart:
- Added CompactFlash/FAT emulation.
- Added Get ROM chip ID Cartridge command.
gpu:
- Added framebuffer emulation.
- Fixed a bug in GPU (xfin could be greater than LG causing a segfault).
- Added support for Display Mode 0(Display Off).
- Added the basic framework for Display Mode 3(Display from Main RAM).
spu:
- Added sound emulation.
- Added sound core system.
- Added WAV write core.
- Added dummy core.
- Added Direct Sound core.
linux port:
- Added GTK+ GUI.
- Added command line interface.
- Added stylus and arm9 keypad support in CLI version.
- Added FPS display.
- Added basic frameskip.
windows port:
- Fixed a bug when displaying a ROM's information.
- Added key configuration.
- Removed the debug key.
- Added new experimental auto frameskip/frame limit code.
- Added sound settings dialog.
- Added a few menu options for accessing the website, forums, and for
submitting bugs.
general:
- Rewrote code in C.
- Fixed warnings.
- Used defines and typedef's to make things more portable and easier to
read.
- Added autotools stuff.
- Changes to logging system.
- Added screenshot function.
- Translated most french to english.
- Added savestate support.
- Added firmware reading support(needs work).
- Added Backup Memory support with autodetection.
- Fixed some endianess issues.
- Fixed things so Visual C++ can compile code.
- Added bsd support.
- Reworked ROM loading so you can load a different rom without any problems.
- Finished NDS_Reset. Now the emulation can be reset even while running.
================================================
FILE: app/src/main/jni/desmume/INSTALL
================================================
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
================================================
FILE: app/src/main/jni/desmume/Makefile.am
================================================
EXTRA_DIST = README.LIN README.MAC README.WIN dsm.txt dsv.txt autogen.sh \
$(PO_FILES_IN)
DISTCLEANFILES = $(PO_FILES)
SUBDIRS = $(PO_DIR) src
================================================
FILE: app/src/main/jni/desmume/Makefile.in
================================================
# Makefile.in generated by automake 1.11.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in \
$(top_srcdir)/autopackage/default.apspec.in \
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
compile config.guess config.sub depcomp install-sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/wxwin.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = autopackage/default.apspec
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir dist dist-all distcheck
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ALL_LINGUAS = @ALL_LINGUAS@
ALSA_CFLAGS = @ALSA_CFLAGS@
ALSA_LIBS = @ALSA_LIBS@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DATADIRNAME = @DATADIRNAME@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
GLADEUI_UNINSTALLED_DIR = @GLADEUI_UNINSTALLED_DIR@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GREP = @GREP@
GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
GTHREAD_LIBS = @GTHREAD_LIBS@
GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
HAVE_PKG = @HAVE_PKG@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
INTLLIBS = @INTLLIBS@
INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
INTLTOOL_MERGE = @INTLTOOL_MERGE@
INTLTOOL_PERL = @INTLTOOL_PERL@
INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@
INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@
INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@
INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@
LDFLAGS = @LDFLAGS@
LIBAGG_CFLAGS = @LIBAGG_CFLAGS@
LIBAGG_LIBS = @LIBAGG_LIBS@
LIBGLADE_CFLAGS = @LIBGLADE_CFLAGS@
LIBGLADE_LIBS = @LIBGLADE_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSOUNDTOUCH_CFLAGS = @LIBSOUNDTOUCH_CFLAGS@
LIBSOUNDTOUCH_LIBS = @LIBSOUNDTOUCH_LIBS@
LTLIBOBJS = @LTLIBOBJS@
LUA_CFLAGS = @LUA_CFLAGS@
LUA_LIBS = @LUA_LIBS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MSGFMT_OPTS = @MSGFMT_OPTS@
MSGMERGE = @MSGMERGE@
OBJEXT = @OBJEXT@
OSMESA_LIBS = @OSMESA_LIBS@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
POFILES = @POFILES@
POSUB = @POSUB@
PO_DIR = @PO_DIR@
PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
RANLIB = @RANLIB@
SDLCONFIG = @SDLCONFIG@
SDL_CFLAGS = @SDL_CFLAGS@
SDL_LIBS = @SDL_LIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UI_DIR = @UI_DIR@
UPDATEDESKTOP = @UPDATEDESKTOP@
USE_MAINTAINER_MODE = @USE_MAINTAINER_MODE@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
WX_CFLAGS = @WX_CFLAGS@
WX_CFLAGS_ONLY = @WX_CFLAGS_ONLY@
WX_CONFIG_PATH = @WX_CONFIG_PATH@
WX_CPPFLAGS = @WX_CPPFLAGS@
WX_CXXFLAGS = @WX_CXXFLAGS@
WX_CXXFLAGS_ONLY = @WX_CXXFLAGS_ONLY@
WX_LIBS = @WX_LIBS@
WX_LIBS_STATIC = @WX_LIBS_STATIC@
WX_RESCOMP = @WX_RESCOMP@
WX_VERSION = @WX_VERSION@
XGETTEXT = @XGETTEXT@
XMKMF = @XMKMF@
X_CFLAGS = @X_CFLAGS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
desmume_arch = @desmume_arch@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
intltool__v_merge_options_ = @intltool__v_merge_options_@
intltool__v_merge_options_0 = @intltool__v_merge_options_0@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = README.LIN README.MAC README.WIN dsm.txt dsv.txt autogen.sh \
$(PO_FILES_IN)
DISTCLEANFILES = $(PO_FILES)
SUBDIRS = $(PO_DIR) src
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
autopackage/default.apspec: $(top_builddir)/config.status $(top_srcdir)/autopackage/default.apspec.in
cd $(top_builddir) && $(SHELL) ./config.status $@
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__remove_distdir)
dist-lzma: distdir
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
$(am__remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__remove_distdir)
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__remove_distdir)
dist dist-all: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lzma*) \
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/_build
mkdir $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
distcheck distclean distclean-generic distclean-tags \
distcleancheck distdir distuninstallcheck dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
================================================
FILE: app/src/main/jni/desmume/NEWS
================================================
================================================
FILE: app/src/main/jni/desmume/README
================================================
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2012 DeSmuME team
Last Updated: March 31, 2012
Contents:
1) About ................................................................... 14
2) Credits ................................................................. 59
3) Contact Information ..................................................... 72
4) License ................................................................. 82
1) About ______________________________________________________________________
DeSmuME is software that allows you to emulate a Nintendo DS system. Think of
it as a Swiss-Army knife for Nintendo DS emulation, giving you access to many
powerful tools for testing DS features, from viewing ROM properties to managing
Action Replay cheats. And best of all, this software is completely free and
open-source.
For information on how to install or operate DeSmuME for your operating system,
please see the README file that should be present with your installation.
Port-specific README files:
* README.LIN for the Linux port
* README.WIN for the Windows port
* README.MAC for the Macintosh port
Note that each DeSmuME port may have a different feature set from another port.
You may see more feature parity between ports over time as we continue
developing DeSmuME.
You can find our documentation on our online Wiki page. The major pages of
interest are:
* Official Documentation: http://wiki.desmume.org/index.php?title=Main_Page
This is the main Wiki page that contains all of our official documentation.
* Manuals: http://wiki.desmume.org/index.php?title=Manual
The manuals contain detailed information about how to operate DeSmuME for each
port.
* FAQ: http://wiki.desmume.org/index.php?title=Faq
The Frequently Asked Questions (FAQ) page has a lot of useful general
information about DeSmuME. Do note that some of the information may be platform
specific, and may not directly apply to your version of DeSmuME.
* Build Instructions:
http://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source
This page contains detailed port-specific instructions about how to make your
own build of DeSmuME directly from the source code.
2) Credits ____________________________________________________________________
See the AUTHORS file for list of DeSmuME team members.
Special thanks go to:
* yopyop (original author of DeSmuME),
for releasing the source code of this great emulator.
* Martin Korth (author of GBATEK),
for his well-written Gameboy Advance and Nintendo DS documentation.
3) Contact Information ________________________________________________________
Official Website: http://desmume.org
Public Forum: http://forum.desmume.org
Developer Chat: irc://irc.freenode.net/desmume
Bug Reports: http://sourceforge.net/tracker/?group_id=164579&atid=832291
Please don't ask for ROMs, BIOS files, or any other copyrighted stuff.
4) License ____________________________________________________________________
This file is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 2 of the License, or (at your option) any later
version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this software. If not, see .
* See the GNU General Public License details in COPYING.
================================================
FILE: app/src/main/jni/desmume/README.LIN
================================================
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2007 DeSmuME team
1) Compiling instructions...................................13
2) How to use DeSmuME.......................................53
3) Contact information......................................142
4) Disclaimer...............................................160
1 Compiling instructions______________________________________
DeSmuME is written in C using the gtk+ and SDL libraries.
So you need a working C compiler, such as gcc and
the above libraries runtime and development packages:
* http://www.gtk.org
* http://www.libsdl.org/
Once these libraries are installed, you should be ready to
install DeSmuME.
DeSmuME provides another interface based on libglade, to use
it, you'll need glade:
* http://glade.gnome.org/
1.1 From a release archive____________________________________
Uncompress the DeSmuME archive, move to the newly created
directory, type "./configure", then "make".
It will generate three programs:
1) "desmume" in the "src/gtk" directory;
2) "desmume-cli" in the "src/cli" directory.
If glade is installed on your system, you'll get a third
binary:
3) "desmume-glade" in the "src/gtk-glade" directory.
You can even type "make install" to install those programs on
your system (in /usr/local/ by default), then uninstalling is
done by typing "make uninstall".
1.2 From a CVS copy___________________________________________
Move to the toplevel directory (the one that contains the
configure.ac file). Type "./autogen.sh" to generate the
configure/install scripts and needed Makefiles. Then you can follow the
same procedure as in 1.1 .
2 How to use DeSmuME__________________________________________
There are three versions of DeSmuME under Linux. These are a
Gtk+ build, a Glade build and a CLI SDL build. All these builds
have some common command line options:
--disable-limiter Disables the 60 fps limiter
--soft-convert Use software colour conversion during OpenGL
screen rendering. May produce better or worse
frame rates depending on hardware.
--arm9gdb=PORT_NUM Enable the ARM9 GDB stub on the given port
--arm7gdb=PORT_NUM Enable the ARM7 GDB stub on the given port
--cflash=PATH_TO_DISK_IMAGE
Enable disk image GBAMP compact flash emulation
--help Display this message
NOTE:
The Gtk+ and Glade builds use gtkGLext to handle the OpenGL
rendering and contexts. You may get improved performance by
also passing the argument --gdk-gl-force-indirect. This has
been seen to improve things for Nvidia based graphics cards
under Linux.
GDB Debugger Stubs:
Source level debugging of ARM9 and/or ARM7 code is supported
using a GDB/Insight debugger.
The GDB stubs are enabled from the command line using the
following options:
--arm9gdb= (for the ARM9)
--arm7gdb= (for the ARM7)
The PORT_NUM is the TCP port upon which the stub will listen for
connections. Once enabled you can connect to the stub using the
following command at the GDB debugger prompt (assuming GDB and
DeSmuME are running on the same machine):
target remote :
NOTE: there are problems with the ARM support when stepping code
with GDB versions prior to version 6.6. It is recommended that
you use at least version 6.6 if possible.
GBAMP compact flash emulation:
The default behaviour of DeSmumME is to attempt to emulate the
FAT image for the contents of the directory where the running
.nds file was located.
This behaviour can be altered using the
--cflash= command line option. Using this
option DeSmuME will emulation a GBAMP and read and write sectors
from/to the disk image file.
The disk image file must be created and populated with files
using some external tool.
NOTE: currently if desmume fails to open the disk image file it
will silently continue minus a working GBAMP emulation.
2.1 Gtk+ version______________________________________________
Type "desmume" in a shell, a window should appear, then open
a rom file using the "open" button, next use the "run" button
to start emulation.
The following command line options are specific to the Gtk+
build:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
--disable-3d Disables the 3D emulation
2.2 CLI SDL version_______________________________________________
Just type "desmume-cli path-to-a-rom" in a shell.
The following command line options are specific to the CLI
build:
--opengl-2d Enables using OpenGL for screen rendering
--disable-sound Disables the sound emulation
3 Contact information_________________________________________
General inquiries should go to:
E-mail: guillaume@desmume.org
Linux Port-related inquiries should go to:
E-mail: guillaume@desmume.org
Web: http://desmume.org
Please don't ask for roms, bios files or any other copyrighted
stuff.
If you want to submit a bug report, please run desmume, go into
the "Help" menu, and click on "Submit a bug report". If you're
having trouble with it, please feel free to email.
4 Disclaimer__________________________________________________
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be
useful,but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
See the GNU General Public License details in COPYING.
================================================
FILE: app/src/main/jni/desmume/README.MAC
================================================
DeSmuME
_________________________________________
Copyright (C) 2006 yopyop
Copyright (C) 2006-2012 DeSmuME team
Last Updated: March 31, 2012
Contents:
1) System Requirements ..................................................... 15
2) Quick Start Guide for Using DeSmuME for OS X ............................ 36
3) Additional Documentation ............................................... 108
4) Contact Information .................................................... 138
5) License ................................................................ 257
1) System Requirements ________________________________________________________
DeSmuME is a very demanding app, especially for CPU usage. Before you begin,
make sure that your Mac meets the listed system requirements.
If your Mac meets only the minimum requirements, then you should expect to run
most simple 2D-only games with some frameskip, but you will be unable to run
complex 2D games or any 3D-heavy games. However, if your Mac meets the
recommended requirements, then you should expect to run almost every game,
including very complex 3D-heavy games, with minimal to no frameskip.
Operating System: OS X v10.5 (Leopard) or later
CPU: Can run on any PowerPC G4, G5, or Intel processor
2.1 GHz Intel Core 2 Duo (minimum)
3.0 GHz Intel Core 2 Duo or faster (recommended)
RAM: 512 MB (minimum)
2 GB (recommended)
2) Quick Start Guide for Using DeSmuME for OS X _______________________________
Installing DeSmuME is as easy as copying DeSmuME.app to your Applications
folder (or other folder of your choice). Double-click the app to start DeSmuME.
Note that DeSmuME for OS X may have a different feature set than DeSmuME for
Windows and DeSmuME for Linux. As of this writing, some features that are
present in DeSmuME for Windows are not present in DeSmuME for OS X.
The rest of this section will be a guide to help you quickly get started using
DeSmuME for OS X.
Loading a ROM and Starting the Emulator:
Simply double-click the desired ROM from the Finder to play the game. By
default, DeSmuME will load the ROM and start emulation. Also, there are
additional ROM loading options that you can change in DeSmuME > Preferences if
you need them.
Using the DS Controller:
Each DS controller button can be mapped to a button of your choice on your
keyboard, gamepad, or joystick. You can view the mappings by clicking on Input
in DeSmuME > Preferences, and then clicking the Controller tab on the Input
page. To change a mapping, click on the DS control that you want to change,
then press the button on your input device to map it.
By default, the DS controller is mapped to the following keys on your keyboard:
Up - Up Arrow
Down - Down Arrow
Left - Left Arrow
Right - Right Arrow
A Button - X
B Button - Z
X Button - S
Y Button - A
L Trigger - Q
R Trigger - W
Start - Return
Select - Tab
Lid - Delete (Backspace)
Debug - \
Microphone - `
Using the DS Touch Pad:
Touch pad input is emulated using the left mouse button. Simply click in the
touch pad area of the DS display window to use the DS touch pad.
Rotating the DS Display:
Some games require that the DS display be at a certain rotation in order to
look correct. Rotation options can be found by choosing
View > Display Rotation. You can also use the toolbar buttons Rotate Left and
Rotate Right to rotate the display by 90 degrees counterclockwise or clockwise,
respectively.
Freezing and Restoring the Emulation State:
Save states are a powerful feature that allows you to freeze the emulation
state and restore it later. However, note that save states are only a
temporary means of saving -- more permanent saves must be done using the
in-game save (or ROM save).
- To freeze the emulation state, choose File > Save State File.
- To restore the emulation state, choose File > Open State File.
You can also freeze/restore emulation states without having to manage the
Open/Save dialogs. There are ten available save state "slots" that you can
use to quickly freeze/restore the emulation state.
- To quick freeze the emulation state, choose File > Save State Slot > Slot #.
The default hotkey for this is (Shift-#).
- To quick restore the emulation state, choose File > Load State Slot > Slot #.
The default hotkey for this is (#).
3) Additional Documentation ___________________________________________________
The quick start guide in this Read Me is by no means a complete reference to
everything that DeSmuME can do! If you need any additional information about
DeSmuME, then you can reference our online Wiki pages for up-to-date
information.
* Official Documentation: http://wiki.desmume.org/index.php?title=Main_Page
This is the main Wiki page that contains all of our official documentation.
* FAQ: http://wiki.desmume.org/index.php?title=Faq
The Frequently Asked Questions (FAQ) page has a lot of useful general
information about DeSmuME. Do note that some of the information may be platform
specific, and may not directly apply to the OS X version of DeSmuME.
* DeSmuME Manual for OS X:
http://wiki.desmume.org/index.php?title=DeSmuME_Manual_for_the_Macintosh_port
This page contains complete and detailed information about how to operate
DeSmuME for OS X.
* DeSmuME Build Instructions for OS X:
http://wiki.desmume.org/index.php?title=Installing_DeSmuME_from_source_on_OS_X
This page contains complete and detailed instructions about how to make your
own build of DeSmuME for OS X directly from the source code.
4) Contact Information ________________________________________________________
Thank you for you interest in DeSmuME! If you want to tell us how useful
DeSmuME is in your life, your love (or hate) of certain NDS games, your passion
for NDS homebrew development, or anything else related to DeSmuME or NDS
emulation, then there are various ways for you to contact us!
However, keep in mind that there are a few of rules that you need to follow:
- Do not ask us to provide ROMs, BIOS files, or any other copyrighted stuff.
We don't want to have to deal with any legal issues that could get us in
trouble, or worse, completely shut down.
- When contacting us, please use the appropriate means to do it. For example,
if you simply want to tell us how much you love or hate us, then use the
comments on the official webpage. Another example: If you want to post on the
forum, be sure to keep the topic focused on DeSmuME; questions that ask for
things like us providing you the latest Pokemon cheats are not DeSmuME
related, and we will instead refer you to a Pokemon cheaters forum. Finally,
our developer chat channel is intended for furthering the development work of
DeSmuME; questions about how to use DeSmuME should not come here, but instead
go to the Support forum. In short, use the appropriate contact method. That's
why the different methods exist!
* Official Website: http://desmume.org
Our official website has the latest news on DeSmuME releases, and also has a
lot of other useful information about DeSmuME. You can comment on different
posts telling us how you feel about DeSmuME. Is DeSmuME the best thing in your
life? Is it making you cry? Or is it a bunch of blah? Let us know here!
* Public Forum: http://forum.desmume.org
If you have a question about DeSmuME, then this is the place to ask it. But
before you ask it, be aware that your question may have already been
answered before, so try the following things first:
- Read the manual and the FAQ. A lot of questions people have are usually
already answered in our documentation.
- Do a forum search about your question.
If you still need to ask a question, then be sure to provide us the following
information:
- DeSmuME app version
- Your operating system and OS version
- The name of the ROM (if a ROM is involved)
- The serial code of the ROM (if a ROM is involved)
The app version can be found by choosing DeSmuME > About DeSmuME in the DeSmuME
app. Alternatively, you can select the DeSmuME app in the Finder and choose
File > Get Info.
You can find your operating system and OS version by choosing About This Mac in
the Apple menu.
The ROM name and serial can be found by choosing File > ROM Info in the DeSmuME
application.
It is very important that you provide us with this information! If you don't,
then it will take much longer for us to respond to your question.
* Live Developer Chat Channel: irc://irc.freenode.net/desmume
We have a live developer chatline on Freenode IRC at #desmume. This channel
is meant for discussing the development of DeSmuME, and shows the real work
that goes on behind the scenes. If you are interested in doing any sort of
software programming, software testing, documentation, or graphics work, then
please join our chat channel! We would love for you to join us!
* Bug Reports: http://sourceforge.net/tracker/?group_id=164579&atid=832291
If you believe that you have found a bug, you may submit a bug report by
choosing Help > Submit a Bug Report in the DeSmuME application, or by
following the above link. This will take you to our bug tracker on SourceForge.
Do note that you will need a SourceForge account in order to submit a bug
report.
Bug submissions are very welcome and encouraged. However, when you submit a bug
to us, you MUST provide the following information, or else your bug submission
may be rejected:
- DeSmuME app version
- Your operating system and OS version
- Your Mac model identifier
- The name of the running ROM when the bug was observed (or "None", if no ROM
was running)
- The serial code of the running ROM when the bug was observed (or "None", if
no ROM was running)
- A description of the exact behavior you observed
- A description of the behavior you expected
You can find your Mac model identifier in the System Profiler app. The app is
located in the Applications/Utilities folder.
When you write your description, make sure that they are as detailed as
possible. The better your descriptions are, the faster we can test and fix
bugs.
For example, if you observed a bug in the game Golden Sun: Dark Dawn, then the
bug report could look something like this:
App Version: v0.9.8
Operating System: OS X v10.6.8
Mac Model Identifier: iMac 11,2
ROM Name: GOLDENSUN_DD
ROM Serial: NTR-BO5E-USA
Observed Behavior: I tried to load a save state using the
File > Load State > Slot 3 menu option, but the game froze. If I reset, I
can get the game working again.
Expected Behavior: The game should continue running from the point where I
made the save state.
We will try to get your bug tested as soon as possible, but any fixes may take
longer, depending on the complexity of the bug. Also, some bugs may require us
to ask you for certain files, such as your ROM saves, save states, or console
logs. For the above example, we would probably ask you for your save states to
help us track down the bug.
5) License ____________________________________________________________________
This file is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 2 of the License, or (at your option) any later
version.
This file is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this software. If not, see .
* See the GNU General Public License details in COPYING.
================================================
FILE: app/src/main/jni/desmume/README.WIN
================================================
Manual
From DeSmuME
Jump to: navigation, search
Contents
[hide]
* 1 DeSmuME Platform Specific Manuals
* 2 DeSmuME Common command line arguments
o 2.1 --load-slot=NUM [gtk,win]
o 2.2 --play-movie=PATH_TO_PLAY_MOVIE [gtk,win]
o 2.3 --record-movie=PATH_TO_RECORD_MOVIE [gtk,win]
o 2.4 --start-paused=START_PAUSED [gtk,win]
o 2.5 --cflash-image=PATH_TO_DISK_IMAGE [gtk,win]
o 2.6 --cflash-path=PATH_TO_DISK_DIRECTORY [gtk,win]
o 2.7 --bios-arm9=BIOS_ARM9_PATH [gtk,win]
o 2.8 --bios-arm7=BIOS_ARM9_PATH [gtk,win]
o 2.9 --bios-swi=BIOS_SWI [gtk,win]
o 2.10 --num-cores=NUM [win]
o 2.11 --scanline-filter-a=NUM [win]
o 2.12 --scanline-filter-b=NUM [win]
o 2.13 --arm9gdb=PORT_NUM [gtk,win]
o 2.14 --arm7gdb=PORT_NUM [gtk,win]
o 2.15 -h, --help [gtk,win]
o 2.16 --opengl-2d [gtk]
o 2.17 --soft-convert [gtk]
o 2.18 --3d-engine=ENGINE [gtk]
o 2.19 --disable-sound [gtk]
o 2.20 --disable-limiter [gtk]
o 2.21 --save-type=TYPE [gtk]
o 2.22 --fwlang=LANG [gtk]
o 2.23 --timeout=SECONDS [gtk]
o 2.24 --display=DISPLAY [gtk]
o 2.25 -v, --version [gtk]
[edit] DeSmuME Platform Specific Manuals
DeSmuME places responsibility on the developers of each port to expose emulation features in a way that is tuned to the needs of that platform. As a consequence, some ports are able to move well ahead of the others. Conversely, some ports are far behind some others. As a consequence, some behaviours and menu structures are different in each port. Therefore, the decision was made to create separate manuals for each port as well: when a specific port is changed, only the manual for that specific port needs to be altered.
DeSmuME Manual for the Windows port
DeSmuME Manual for the Linux GTK+ port
DeSmuME Manual for the Linux Glade port
DeSmuME Manual for the Linux command line port
DeSmuME Manual for the Macintosh port
[edit] DeSmuME Common command line arguments
The GTK+ and windows ports share common command line arguments. We are trying slowly to move over to a common command line handling engine. The commandline arguments for these platforms are described here:
[edit] --load-slot=NUM [gtk,win]
Loads savegame from slot NUM
[edit] --play-movie=PATH_TO_PLAY_MOVIE [gtk,win]
Specifies a dsm format movie to play
[edit] --record-movie=PATH_TO_RECORD_MOVIE [gtk,win]
Specifies a path to a new dsm format movie
[edit] --start-paused=START_PAUSED [gtk,win]
Indicates that emulation should start paused
[edit] --cflash-image=PATH_TO_DISK_IMAGE [gtk,win]
Requests cflash in gbaslot with fat image at this path
[edit] --cflash-path=PATH_TO_DISK_DIRECTORY [gtk,win]
Requests cflash in gbaslot with filesystem rooted at this path
[edit] --bios-arm9=BIOS_ARM9_PATH [gtk,win]
Specifies a path to an arm9 bios which will be used
[edit] --bios-arm7=BIOS_ARM9_PATH [gtk,win]
Specifies a path to an arm7 bios which will be used
[edit] --bios-swi=BIOS_SWI [gtk,win]
Set to 1 to enable the emulation of SWI via the provided bios files, which I hope you have provided with the above options. (default 0)
[edit] --num-cores=NUM [win]
Overrides the emulator's autodetection for number of processors. Presently, any system with more than one core (this may inadvertantly include singlecore systems with hyperthreading, but I can't test it) will operate with somewhat reduced OSD functionality, with lower quality and no asynchronous composition. In the future, other optimizations will require higher numbers of cores (optimizations for quad-core are planned, but it won't be too impressive)
[edit] --scanline-filter-a=NUM [win]
Intensity of fadeout for scanlines filter (edge) (default 2)
[edit] --scanline-filter-b=NUM [win]
Intensity of fadeout for scanlines filter (corner) (default 4)
[edit] --arm9gdb=PORT_NUM [gtk,win]
Enable the ARM9 GDB stub on the given port
[edit] --arm7gdb=PORT_NUM [gtk,win]
Enable the ARM7 GDB stub on the given port
[edit] -h, --help [gtk,win]
Show summary of options.
[edit] --opengl-2d [gtk]
Enables using OpenGL for screen rendering
[edit] --soft-convert [gtk]
Use software colour conversion during OpenGL screen rendering. May produce better or worse frame rates depending on hardware.
[edit] --3d-engine=ENGINE [gtk]
Select available 3d emulation:
0 = 3d disabled
1 = internal desmume software rasterizer (default)
2 = osmesa or gtkglext opengl (if available, depending on compilation options, see desmume --help)
[edit] --disable-sound [gtk]
Disables the sound emulation
[edit] --disable-limiter [gtk]
Disables the 60 fps limiter
[edit] --save-type=TYPE [gtk]
Select savetype from the following:
0 = Autodetect
1 = EEPROM 4kbit
2 = EEPROM 64kbit
3 = EEPROM 512kbit
4 = FRAM 256kbit
5 = FLASH 2mbit
6 = FLASH 4mbit
[edit] --fwlang=LANG [gtk]
Set the language in the firmware, LANG as follows:
0 = Japanese
1 = English
2 = French
3 = German
4 = Italian
5 = Spanish
[edit] --timeout=SECONDS [gtk]
Quit desmume after the specified seconds for testing purpose.
[edit] --display=DISPLAY [gtk]
X display to use.
[edit] -v, --version [gtk]
Show version of program.
Retrieved from http://wiki.desmume.org/index.php?title=Manual
This page was last modified on 22 November 2009, at 18:17.
====================================================================
DeSmuME Manual for the Windows port
From DeSmuME
Jump to: navigation, search
NOTE: This refers to the 0.9.5 revision of desmume, and may or may not accurately reflect any other revision.
Contents
[hide]
* 1 Quick Getting Started Guide
o 1.1 Menu Layout
+ 1.1.1 File Menu
# 1.1.1.1 File | Open ROM
# 1.1.1.2 File | Recent ROM
# 1.1.1.3 File | ROM Info
# 1.1.1.4 File | Close ROM
# 1.1.1.5 File | Save State As...
# 1.1.1.6 File | Load State As...
# 1.1.1.7 File | Save State
# 1.1.1.8 File | Load State
# 1.1.1.9 File | Import Backup Memory
# 1.1.1.10 File | Export Backup Memory
# 1.1.1.11 File | Save Screenshot As...
# 1.1.1.12 File | Quick Screenshot
# 1.1.1.13 File | Record AVI
# 1.1.1.14 File | Stop AVI
# 1.1.1.15 File | Record WAV
# 1.1.1.16 File | Record Movie
# 1.1.1.17 File | Play Movie
# 1.1.1.18 File | Stop Movie
# 1.1.1.19 File | Lua Scripting | New Lua Script Window
# 1.1.1.20 File | Lua Scripting | Close All Script Windows
# 1.1.1.21 File | Quit
+ 1.1.2 Emulation Menu
# 1.1.2.1 Emulation | Pause
# 1.1.2.2 Emulation | Reset
# 1.1.2.3 Emulation | Shut Up
# 1.1.2.4 Emulation | GBA Slot
# 1.1.2.5 Emulation | Cheats
# 1.1.2.6 Emulation | Cheats | List
# 1.1.2.7 Emulation | Cheats | Search
# 1.1.2.8 Emulation | Cheats | Disable
+ 1.1.3 View Menu
# 1.1.3.1 View | LCDs layout
# 1.1.3.2 View | Rotation
# 1.1.3.3 View | Window size
# 1.1.3.4 View | Window size | Always On Top
# 1.1.3.5 View | Screen Separation
# 1.1.3.6 View | Screen Separation | White,Gray,Black
# 1.1.3.7 View | Screen Separation | Editable via border dragging
# 1.1.3.8 View | Render
# 1.1.3.9 View | Force Maintain Ratio
# 1.1.3.10 View | Display Frame Counter
# 1.1.3.11 View | Display FPS
# 1.1.3.12 View | Display Input
# 1.1.3.13 View | Display Graphical Input
# 1.1.3.14 View | Display Lag Counter
# 1.1.3.15 View | Display Microphone
# 1.1.3.16 View | HUD Editing Mode
+ 1.1.4 Config Menu
# 1.1.4.1 Config | Save Type
# 1.1.4.2 Config | 3D Settings
# 1.1.4.3 Config | Control Config
# 1.1.4.4 Config | Control Config | Allow Left+Rt/Up+Dn
# 1.1.4.5 Config | Hotkey Config
# 1.1.4.6 Config | Sound Settings
# 1.1.4.7 Config | WIFI Settings
# 1.1.4.8 Config | Firmware Settings
# 1.1.4.9 Config | Emulation Settings
# 1.1.4.10 Config | Microphone Settings
# 1.1.4.11 Config | Path Settings
# 1.1.4.12 Config | Frame Skip
# 1.1.4.13 Config | Language
# 1.1.4.14 Config | Background Pause
# 1.1.4.15 Config | Enable State Rewinding
+ 1.1.5 Tools Menu
# 1.1.5.1 Tools | Disassembler
# 1.1.5.2 Tools | View Memory
# 1.1.5.3 Tools | View Registers
# 1.1.5.4 Tools | View Palette
# 1.1.5.5 Tools | View Tiles
# 1.1.5.6 Tools | View Maps
# 1.1.5.7 Tools | View OAM
# 1.1.5.8 Tools | View Matrices
# 1.1.5.9 Tools | View Lights
# 1.1.5.10 Tools | View Sound State
# 1.1.5.11 View | RAM Watch
# 1.1.5.12 View | RAM Search
# 1.1.5.13 Tools | View Layers
+ 1.1.6 Help Menu
# 1.1.6.1 Help | Website
# 1.1.6.2 Help | Forums
# 1.1.6.3 Help | Submit a bug report
# 1.1.6.4 Help | About
[edit] Quick Getting Started Guide
When you start the emulator for the first time, you probably just want to play a certain game. You can do this by going to 'File' in the menu, and selecting 'Open Rom'. This will open up an explorer window, within which you can browse to the rom (nds file) that you wish to play. Once the game has finished loading (and this should only take a few seconds at most), your game will automatically start running. But if you want, you can also compile from source. See the article Installing DeSmuME from source on Windows for details.
[edit] Menu Layout
The rest of this manual will be spend on explaining all the other options in the menu.
[edit] File Menu
[edit] File | Open ROM
This option is for loading games. A game is typically called a rom file. Just use the explorer window to browse to the file, and click on open. The game should just load and start. The desmume windows port is also able to load some compressed formats, like zip, rar, and 7z. Just as long as there is a valid game (rom) file in the compressed archive ending with an .nds extension, it should load fine.
[edit] File | Recent ROM
This menu option contains a list of the roms that you have most recently loaded. You can quickly access a game that way, without having browse to the right directory with the 'Open Rom' option.
[edit] File | ROM Info
This option offers some information about the internals of the rom file, like name, code, manufacturer, and size. This should not concern the casual gamer, but may come in handy for developers.
[edit] File | Close ROM
Just ends the current game and leaves the emulator more or less how it was when you first launched it.
[edit] File | Save State As...
Imagine you have gotten to a certian point in a game, and you need to do something else. The emulator let's you save the current state of the game, so that you can continue the game later at precisely the same point somewhere in the future.
Please note that the use of SAVESTATES is discouraged, as these are likely to break between emulator versions. Instead use SAVE FILES. These are likely to survive between emulator versions. This means that you will have to use save points within the game. SAVE FILES are stored in .dsv files.
[edit] File | Load State As...
Once you have saved a game's position, or 'state', you can load it again with this option.
[edit] File | Save State
This option works fairly similair to the 'Save As' option, altough it let's you save numbers instead os specifying a chosen name. Also, All the states saved via this option end up with a pre-determined name of 'game (rom) name'.dsx. So if the game is called MyGame, the first savefile will be called MyGame.ds0, the second one MyGame.ds1, etc.
[edit] File | Load State
This option let's you load the states that you saved via the 'File | Save State' option
[edit] File | Import Backup Memory
Backup Memory is the data the game uses to remember its own state. It is stored on the cart in a normal game. Desmume uses the .dsv extension and file format; other formats which can be imported are .duc and raw .sav, as well as no$gba savefiles (also using the .sav extension). People use pro action replays to capture duc files from their card and post it online without using emulators. These are frequently found on gamefaqs.com. See the faq for details on how to use this function, where it has been documented better.
[edit] File | Export Backup Memory
This lets you export the game's state for use in other Nintendo DS Emulators. It will write a 'raw' sav file or a no$gba savefile.
[edit] File | Save Screenshot As...
This lets you take a screenshot of the current view of the emulator, and specify it's name to save as a bitmap (.bmp) file.
[edit] File | Quick Screenshot
This option also dumps a screencapture, but it has a pre-determined filename and location. The name will be based on the name of the rom and somehow sequentially numbered, and placed in the directory specified in the Path Settings.
[edit] File | Record AVI
This option lets you capture what's going on in the emulator, and save it in an avi file.
[edit] File | Stop AVI
The 'Record AVI' option continues to record the game, untill you press the 'Stop Avi' option.
[edit] File | Record WAV
This option lets you capture the sound played in the emulator, and save it in a wav file. In contrast to the other option, this records, as faithfully as possible, the exact emulated audio output (which is not necessarily what you hear), although it will use the interpolation you have specified in the sound config.
[edit] File | Record Movie
This option lets you record the gameplay in TAS format, see http://tasvideos.org for details on TAS (tool-assisted speedruns).
[edit] File | Play Movie
This option lets you playback a pre-recorded TAS movie.
[edit] File | Stop Movie
This options lets you stop a movie which is playing or recording.
[edit] File | Lua Scripting | New Lua Script Window
Launches a lua scripting dashboard. Reference the FAQ for more information on lua in emulators.
[edit] File | Lua Scripting | Close All Script Windows
Closes all the lua dashboards.
[edit] File | Quit
Choosing this option exits the emulator.
[edit] Emulation Menu
[edit] Emulation | Pause
This option will pause the emulation, freezing it at the current moment of execution. Selecting it again will resume the execution of the ROM at the exact moment where you paused it.
[edit] Emulation | Reset
This option will reset the ROM that is currently loaded to the very start of the ROM, just as if you chose 'File | Open Rom' again.
[edit] Emulation | Shut Up
This option turns off all the currently-running sounds, effectively killing streams and decoded music and voiceovers. Sequenced music and sound effects will continue to play, and when you enter a new area in the game or someone else speaks, the sounds will play again. Use this to Shut Up an annoying sound.
[edit] Emulation | GBA Slot
This menu option pop-ups a new window, which lets you specirfy what to do with the GBA slot of the Nintendo DS. It has the following choices : NONE, Compact Flash, Rumble Pack, GBA Game, Guitar Grip. Rumble pack allows some games to use vibration. Memory extension... Extends memory, as introduced by the NDS Opera browser. And some DS games can have bonuses, unlockable by GBA cart. For example in Megaman ZX you can fight some Megaman Zero Bosses when correct cartridge is inserted. This is also commonly used by pokemon players for finding some pokemons from older GBA games. There are some GBA slot extensions which are not yet emulated by desmume. Compact Flash is is used for homebrew software emulation, for example that uses DLDI (Dynamically Linked Device Interface). As usual, see the FAQ for more up-to-date information on that.
[edit] Emulation | Cheats
This option pulls down a drop-down menu, and presents the options list and search. Be aware though, that cheats are sort of half baked right now. If you are not having luck, wait for some news on an improved cheat system. Also, it is impossible yet to use "commercial" codes, such as Action Replay and Codebreaker, so what you'll have to do is manually search for, and alter the memory positions to your advantage. They are called 'raw' or 'internal' cheats. There's an excellent article in the wiki on Using Cheats in DeSmuMe . In post-0.9.2 development builds, there is also the support for Action Replay cheat codes.
[edit] Emulation | Cheats | List
Choosing 'list' will list all the currently known cheats. Please refer to the article Using Cheats in DeSmuMe for further details on how to use the cheat mechanism in desmume.
[edit] Emulation | Cheats | Search
Choosing 'search' will let you search for cheats. Please refer to the article Using Cheats in DeSmuMe for further details on how to use the cheat mechanism in desmume.
[edit] Emulation | Cheats | Disable
Disables the cheat engine, and all active cheats.
[edit] View Menu
[edit] View | LCDs layout
This powerful menu controls how the NDS screens will be arranged into the window. Vertical and Horizontal will choose to stack them in the specified manner (vertical being traditional and default and horizontal being wide-screen). One LCD shows just one screen--whichever one is "first" (top) as described below. "Top First" means that the top screen is First and will be displayed on top. "Bottom first" means that the bottom screen is First and will be displayed on top (effectively switching the usual ordering of the screens for this game). "Main screen first" selects the main graphics engine (the one with 3d on it) to consider as first. This option will help you track the action and discard the useless status screen in many games. "Sub screen first" is added for the sake of completeness and you may occasionally find it helpful. Please note that these last two options may not work well in the case of dual screen 3d games, as the screens are always toggling around.
[edit] View | Rotation
This option will let you rotate the screen a pre-determined amount of degrees clockwise in order to adjust the angle of the display. Some programs require that you normally turn the DS on its side. You can set it up in that manner using this. The options are 0 (no rotation), 90, 180, and 270.
[edit] View | Window size
This option will let you enlarge the windows a pre-determined size. The resize options are: 1x, 1.5x, 2x, 3x, and 4x the default size. You can also adjust the window size by resizing the window as usual in Windows apps.
[edit] View | Window size | Always On Top
As featured in media players and IM programs and other emulators, etc., this will prevent other apps from displaying on top of desmume.
[edit] View | Screen Separation
This option controls how far the two windows should be apart of each other, in other words: how big the border between them should be. Valid choices are: None (which is the default), narrow border (which is slightly larger), DS (which is about the same amount of room there is on a real Nintendo DS).
[edit] View | Screen Separation | White,Gray,Black
Changes the colour of the gap. Savvy users may discover that they can edit this in the ini file to be any color they want.
[edit] View | Screen Separation | Editable via border dragging
When enabled, you can pick any gap size you want by dragging the bottom edge (not a corner) of the main window.
[edit] View | Render
These options will apply different resizing filters to the emulator screen display.
[edit] View | Force Maintain Ratio
Here you can choose, when re-sizing the windows, if you wan to maintain the ratio of the windows. Sometimes when the window size is changed it doesn't look correct on the screen. This option forces the window to maintain a correct ratio so it looks correct.
[edit] View | Display Frame Counter
Selecting this option will display the emulation frame number. This way you can tell how long you have been playing the game. It is also useful for timestamping emulation events (for example, you can tell if you made it out of a level faster than last time)
[edit] View | Display FPS
Selecting this option causes the 'frames-per-second' (or 'fps', for short) to be displayed. It also displays an additional '3D' counter, which tells how frequently the game is updating its 3d graphics. But unlike the fps counter, the 3d counter has nothing to do with the power of your system. If it is low, then the game is running slow on a retail cart, and so it runs slow in an emulator. The last number in parentheses is the arm9 load average, which indicates how hard the emulated CPU is working. This has nothing to do with the power of your system either.
[edit] View | Display Input
Selecting this option displays the emulated input that the emulator is recognizing and sending to the game software.
[edit] View | Display Graphical Input
Same as Display Input but it is a super-spiffy graphical version.
[edit] View | Display Lag Counter
This option displays the lag counter, which records frames where the game does not poll input.
[edit] View | Display Microphone
This option is somewhat less exciting than it sounds, but it displays some numbers which may help you diagnose whether your microphone is hooked up correctly.
[edit] View | HUD Editing Mode
This option will let you drag around hud elements to pick their position.
[edit] Config Menu
[edit] Config | Save Type
This option lets you specify the save type of a particular game. The default is 'automatic'. However, this is not fail-safe in all cases, so you might need to manually select one of the other savetypes. You may also need to set this before important a savefile from some other source, as they do not always contain sufficient information to guess the correct size.
[edit] Config | 3D Settings
This option lets you select the method that is used to draw the screen. You can choose between OpenGL (hardware accelerated) or SoftRasterizer (desmume's custom-crafted software renderer). Note that however hardware accelerated it may be, oftentimes SoftRasterizer will run faster.
Furthermore, you have three toggles for SoftRasterizer:
* Unrealistically High-Precision Color Interpolation - this affects how material colors get handled when polygons are clipped.
* Enable Edge Marking / Enable Fog - Using these you can prohibit emulation of these hardware features to gain a minor speedup.
Desmume 0.9.4 had an option called "Alternate Flush Mode" which fixed some games with flickering graphics, but this was removed in 0.9.5.
[edit] Config | Control Config
This option lets you configure keyboard keys or a joystick. The joystick support is implemented using a DirectInput control interface.
Here are the default control mappings (they may be subject to change):
Up arrow - Up
Left arrow - Left
Down arrow - Down
Right arrow - Right
x - A button
z - B button
s - X button
a - Y button
q - Left Trigger
w - Right Trigger
Enter - Start button
Right Shift - Select button
Backspace - Lid fold/unfold
[edit] Config | Control Config | Allow Left+Rt/Up+Dn
It is nearly impossible on an actual console to press left and right at the same time. You may accidentally (or on purpose!) be glitching games by sending input they did not expect if you enable this option. Most casual users can emulate the hardware better by leaving this unchecked.
[edit] Config | Hotkey Config
This menu option lets you define keys, that can be used to quickly select other options without having to go through the entire menu structure. Some examples are a hotkey for 'pause', or a hotkey for loading a specific savestate.
Here are the default hotkey mappings (they may be subject to change):
n - Frame advance
Space - Pause/Unpause
p - Load current state
1,2,3,4,5,6,7,8,9,0 - Select current state
F1-F10 - Load relevant state
Shift+F1-F10 - Save relevant state
[edit] Config | Sound Settings
This option lets you configure the way sound is generated.
The sync/async modes and sync methods give you different output:
* Dual sync/async: the traditional mode, which generates more sound when the game slows down. Gives clear sound in most cases but can cause streamed sounds to be garbled sometimes.
* Sync: always generates the same amount of sound, and uses one of the three available methods to compensate for too low or too high framerates. This mode shouldn't make streamed sounds garbled.
o Sync method 'N': created by Nitsuja. Basically stretches the sound. Sounds like No$GBA (without the crackling).
o Sync method 'Z': created by Zeromus. Stretches the sound to compensate for slowdowns, and resamples it to compensate for too high framerates. That resampling causes latency and can behave weird sometimes.
o Sync method 'P': taken from SPU2-X, an SPU2 plugin for PCSX2. Stretches the sound intelligently, giving clear sound in most cases, but also latency.
The sound core setting allows you to choose between the DirectX sound core and the dummy one which produces no sound. The WAV write core has been removed since the new "Record WAV" option made it useless.
The buffer size setting should be kept to its original value. However, if your sound isn't clear even at 60 fps, you can try increasing it.
The interpolation setting allows you to choose between three interpolation methods:
* None: Fast, but may sound bad.
* Linear: typical, sounds good
* Cosine: maybe slower than linear, but doesn't sound much better
Note that the DS has no interpolation method. While sometimes interpolation can make a noticeable improvement, it can also be unnoticeable or distort some sounds.
The ADPCM caching has been removed. It was needed due to a bug in ADPCM decoding which has been fixed. If you are still using 0.9.4, then enabling this can speed up some games while breaking the sound in others.
[edit] Config | WIFI Settings
WIFI support is currently under heavy development, but it is not useful yet. Therefore, you may find this option missing, or simply 'greyed-out' for now. Even if you can fiddle with it, it won't do anything useful.
[edit] Config | Firmware Settings
This option provides you with the same set of options that a real Nintendo DS firmware does. The most important here is the language, because multi-lingual games will often look at how this option is set.
[edit] Config | Emulation Settings
These options let you boot from the extracted BIOS and Firmware of a real Nintendo DS. unless you have extracted/downloaded the firmware or bios from a Nintendo DS that you actually own yourself, these settings have no value for you as desmume does not generally require them to run correctly. Occasionally, however, a game may require them in order to work.
[edit] Config | Microphone Settings
You can choose one of four modes. The first will attempt to use the windows default recording device (it is up to you to make your microphone take this role) and feed its input to the emulator. This works, but not perfectly, and it suffers from some unresolved conceptual issues, similar in nature to the emulator audio synchronization problem. The remainder of the options are triggered when using the mic hotkey. You can "Use internal noise sample" which works for many games that want you to blow on the mic; you can "Use rand() whitenoise" which will work for games that require blowing, but which don't work with the internal noise sample (note that this is NONDETERMINISTIC and not tas-safe); and finally you can supply your own microphone sample, which may be noise, or your nintendog's name, or any other thing. It has even been tested with bangai-o spirits level loading. This must be an 8bit mono pcm wav file.
[edit] Config | Path Settings
Use this dialog to configure the default paths for roms, savestates, screenshots, etc. Some people like everything in one directory and some people like using 50 directories; you can have it your way.
[edit] Config | Frame Skip
The first option, "Limit framerate" engages the throttler and prohibits the emulator from running more than 60fps. With this disabled, a fast computer may run the game doubly or triply fast.
The fixed skip options allow you to specify how many frames should be skipped, constantly. It is generally safe to choose 1 or 2 if you don't mind a slightly choppier game, in order to get a speedup. You may get accustomed to the degraded game performance and not notice. Note, however, that frameskipping can sometimes entirely fail in dual-screen 3d games or games that use capture.
The auto skip options will try engaging the frameskipping when the emulator is running slow, to keep the game from slowing down, but render all the frames when possible to maintain 60fps. This can make a game look sort of like a modern console 3d game which slows down when the action gets intense or too much of the world is visible.
Note that you can use the fast-forward hotkey to engage a special mode which disables the throttler and skips some large number of frames in order to run the game as quickly as possible. This may help you speed through cutscenes or other slow grinding in games and is easier to use than constantly fiddling with these menu options.
[edit] Config | Language
This lets you set the language the emulator displays its menus and options in. This won't change everything in the emulator, as due to the way it is coded, some things aren't translateable through this system, and it may very well be the case that your desired translation is incomplete.
[edit] Config | Background Pause
Selecting this option will pause the emulation whenever you put desmume in the background, or the window loses focus.
[edit] Config | Enable State Rewinding
This is a bit of an experimental option which will suck up a ton of your cpu power taking secret savestates every 0.25 seconds or so. With this enabled, the use of a rewind hotkey will permit you to rewind time a little bit in case you die.
[edit] Tools Menu
[edit] Tools | Disassembler
This option displays the ARM9 and ARM7 disassembler. Be aware though, that the windows are drawn exactly on top of each other, so that you have to move (drag n drop) the first windows before the second window shows.
[edit] Tools | View Memory
This tool displays the ARM7 and ARM9 memory. Be aware though, that the windows are drawn exactly on top of each other, so that you have to move (drag n drop) the first windows before the second window shows.
The "View mode" radio buttons allow you to choose how the memory will be shown:
* 8-bit : shows the memory as bytes
* 16-bit : shows the memory as words
* 32-bit : shows the memory as dwords
The "View address" textbox and button allow you to jump to a different address:
* Enter an hexadecimal address without 0x prefix, with up to 8 digits
* Click "Go" to jump to the entered address
The "View dump" buttons allow you to dump the current view:
* Text dump : dumps the view to a text file, in an human-readable form
* Raw dump : dumps the memory directly to a binary file which can be read with an hex editor
Note that if you dump memory to a file already containing (a) dump(s), the new dump will be appended to the existing one(s).
The scrollbar... well, you surely know how a scrollbar works.
The viewers additionally allow to edit the memory. For it, click on the value you want to edit, then type the new value. The new value is applied only once you've entirely entered it.
[edit] Tools | View Registers
This option lets you view the ARM7 and ARM9 I/O registers.
[edit] Tools | View Palette
This option lets you view the palette in detail.
[edit] Tools | View Tiles
This option lets you view the tiles in detail.
[edit] Tools | View Maps
This option lets you view the maps in detail.
[edit] Tools | View OAM
This option lets you view the OAM layer in detail.
[edit] Tools | View Matrices
This option lets you view the matrices in detail.
[edit] Tools | View Lights
This option lets you view the lights in detail.
[edit] Tools | View Sound State
This option displays the sound output.
[edit] View | RAM Watch
This option will pop-up a new window, with extensive and advanced features to watch the emulated RAM memory.
[edit] View | RAM Search
This option will pop-up a new window, with extensive and advanced features to search through the emulated RAM memory.
[edit] Tools | View Layers
This option lets you toggle BG layer visibility one by one. You can also toggle the rendering for an entire GPU engine, which can help your framerate in games where one screen is pointless.
[edit] Help Menu
[edit] Help | Website
This option directs your browser to the desmume homepage.
[edit] Help | Forums
This option directs your browser to the desmume forums.
[edit] Help | Submit a bug report
This option directs your browser to the SourceForge bugtracker for desmume.
[edit] Help | About
This option displays the authors of the emulator.
Retrieved from "http://wiki.desmume.org/index.php?title=DeSmuME_Manual_for_the_Windows_port"
This page was last modified on 22 November 2009, at 22:09.
====================================================================
Faq
From DeSmuME
Jump to: navigation, search
DesMuMe FAQ
This FAQ holds a list of many commonly asked questions about DeSmuME.
If the FAQ is unable to answer any questions you have, then please make sure that you also consult the manual. If this doesn't help, either, post your question on the forums.
Contents
[hide]
* 1 Release 0.9.4 Topics
o 1.1 Using old DeSmuME save files in 0.9.4
o 1.2 What is this NOSSE and dev stuff? / Why does desmume.exe crash when it loads? / Which EXE do I use?
* 2 Savegames and Savestates
o 2.1 Why does this game fail to save? / I get the error "Data could not be accessed. Turn off the power and reinsert the DS card." or "Unable to write data. Please turn off the power and reinsert the game card."
o 2.2 Why was the save file format and extension changed from .sav to .dsv ?
o 2.3 Can I use my save states across versions?
o 2.4 Can I convert an ideas or no$gba nocash .sav savefile to DeSmuME .dsv?
o 2.5 How do I make Pokemon saves?
o 2.6 Why can't Pokemon save after beating the elite 4?
* 3 Wi-Fi and WFC
o 3.1 Does DeSmuME support wifi?
o 3.2 Why do I get an assert in wifi.cpp which keeps me from playing a game?
o 3.3 If DeSmuME doesn't support wifi, then why does it make my firewall alert since 0.9.2?
o 3.4 Why did my build come with winpcap.dll? / Why do I get crashes when I run DeSmuME on vista which mention something about winpcap?
o 3.5 What is WFC / Nintendo WiFi Connection?
* 4 Troubleshooting and Errors
o 4.1 Help! My desmume window disappeared! Maybe I can hear sound and it is in the taskbar but I can't see the window
o 4.2 Does Scribblenauts work?
o 4.3 How do I use external BIOS files or firmware?
o 4.4 Why does my touch screen not work? Oh yes you did read my mind, I was using external firmware
o 4.5 I have a gameplay related question
o 4.6 Why doesn't my DeSmuME play this game?
o 4.7 Why doesn't my game boot or progress into the main game engine?
o 4.8 Why does the emulator take a long time to start up and/or devastate my system or unarchiver when I run it?
o 4.9 Why doesn't OpenGL 3D work in Linux?
o 4.10 Why doesn't OpenGL 3D work in windows?
o 4.11 My display is incorrect or corrupted or something is missing
o 4.12 My display has flickering graphics in a certain game
o 4.13 Why does music and FMV sound bad/distorted sometimes?
* 5 Performance
o 5.1 Why is the emulator slow?
o 5.2 Does DeSmuME make use of multiple CPU's or multiple cores?
o 5.3 In 0.9.4, what does the number/percentage in the DeSmuME title bar mean
o 5.4 In 0.9.5, what does the percentage in the FPS display mean
o 5.5 Why are there Two/Numbers in the FPS display?
* 6 Using The Emulator
o 6.1 What are the minimum hardware requirements for DeSmuME ?
o 6.2 What are the recommended hardware requirements for DeSmuME?
o 6.3 It is hard to zoom in on a widescreen display due to the unusual aspect ratio of the DS
o 6.4 But will you please add screen splitting / window tearing apart / fullscreen modes?
o 6.5 How do I enter 'cheat codes' in DeSmuME?
o 6.6 I entered a 'cheat code', and now the emulator freezes.
o 6.7 Does DeSmuME support the microphone?
o 6.8 Does the 'GBA slot' option let me play GBA games?
o 6.9 How do I "Close the DS"?
o 6.10 How do I use the stylus (pen) to 'touch' the screen?
o 6.11 How can I touch two points on the screen at once, as required by Hotel Dusk?
* 7 General Questions
o 7.1 What does DeSmuME emulate and on what systems?
o 7.2 What does DeSmuME mean?
o 7.3 Under what license is DeSmuME distributed ?
o 7.4 Can I freely copy DeSmuME ?
o 7.5 Where can I report bugs?
o 7.6 Can I attach files to bug reports I did not create myself ?
o 7.7 What is 'TAS' ?
o 7.8 What hardware features are emulated?
o 7.9 Does the GDB stub still work?
o 7.10 How do I enable the GDB stub on the Windows port ?
o 7.11 Does compact flash works?
o 7.12 Where/what is IRC?
o 7.13 Where is the manual?
o 7.14 Where is release 0.9.3?
o 7.15 What is DLDI?
o 7.16 How can I post a save file or AVI capture on the DeSmuME forum?
o 7.17 How can I record an AVI with a gap between the screens?
o 7.18 How can I post a large log or other text file on the DeSmuME IRC chat room?
o 7.19 What are the origins of DeSmuME?
* 8 SVN and Compiling
o 8.1 Why doesn't the DeSmuME team release pre-build SVN binaries ?
o 8.2 How do I get the latest svn code and build DeSmuME myself?
o 8.3 What is 'SVN' ?
o 8.4 What compilers are supported for building DeSmuME from source?
o 8.5 I'm Compiling using MSVC Express On Windows, and I get the error : "ml.exe" not found.
* 9 Development and Technical Questions
o 9.1 I have a patch, modification or other code addition
o 9.2 I'm a developer, and would like to contribute to the codebase. What can I do?
o 9.3 Im not a developer, but would like to help out anyway. What can I do?
o 9.4 What is this Lua stuff I see?
o 9.5 How do I easily capture the ASM code for troubleshooting purposes?
o 9.6 Where can I find technical details on the Nintendo DS and GBA?
* 10 Mac Users
o 10.1 Why can't I find a Mac binary?
o 10.2 Why does my Mac binary say something about being unsupported?
o 10.3 Why doesn't a menu option or tool exist in my Linux or Mac build?
[edit] Release 0.9.4 Topics
[edit] Using old DeSmuME save files in 0.9.4
DeSmuME will first try to load a dsv file. If the dsv is missing, it will try to load a sav and then it will immediately dump the dsv. The conversion process is supposed to be seamless.
[edit] What is this NOSSE and dev stuff? / Why does desmume.exe crash when it loads? / Which EXE do I use?
Use dev if you are a developer and want the gdb stub. Use nosse if the regular exe crashes for you because you are on an old computer. desmume.exe uses some SSE2 optimizations for 3D matrix calculations which have been disabled in desmume_nosse.exe. Any modern Intel CPU (AMD or intel) will support SSE2.
[edit] Savegames and Savestates
[edit] Why does this game fail to save? / I get the error "Data could not be accessed. Turn off the power and reinsert the DS card." or "Unable to write data. Please turn off the power and reinsert the game card."
Until version 0.9.4 DeSmuME's save size autodetection was poor. With 0.9.4, autodetection should work almost all the time. In fact, here is the entire list of games we currently know of that fail to autodetect correctly:
* Spider-Man 3 (should be autodetect_size=1, detected as 3)
* Over The Hedge (should be autodetect_size=1, detected as 3; same failure mechanism)
If you find any other game for which automatic savetype detection does not work, please let the developers know by posting on the forum or submitting a bug. If you want to fix it yourself, you may need to manually specify the correct save type for your game. Consult the manual for details on how to do this for your platform. You may also consult http://www.advanscene.com/ to easily identify the save type for your game.
[edit] Why was the save file format and extension changed from .sav to .dsv ?
Because it is better now. These raw save files that everyone uses aren't good enough and were causing problems with autodetection. See our bug tracker or forum for more details; the dsv format has been documented in the svn source tree as dsv.txt and if you don't like the degree of interoperability with other emulators, then go tell the other emulators to support our format.
[edit] Can I use my save states across versions?
Maybe, maybe not. Due to constant internal changes in DeSmuME, it is possible that a save state created with one version may not work with another version of DeSmuME. Savestate compatibility is preserved wherever possible, but it is not always possible. Please note that for easily confused gamers, the use of SAVESTATES is discouraged, as these are likely to break between emulator versions. Instead use SAVE FILES. These are likely to survive between emulator versions. This means that you will have to use save points within the game. SAVE FILES are stored in .dsv files. Also, see this article for further details : Savefile or savestate
[edit] Can I convert an ideas or no$gba nocash .sav savefile to DeSmuME .dsv?
1. Convert the save file using http://shunyweb.info/convert.php ; the target format should be "Acekard RPG | EZFlash V | RAW Format [Autodetection] (.sav)" 2. Load the game. Let it get to the main menu 3. Select the correct backup size*, as specified by advanscene.com (which is not always right, by the way) 4. Use File > Import Backup Memory and pick the converted save file 5. Reset the game
* Step 3 is not always necessary, if you are smart, however, it will never hurt to do it.
[edit] How do I make Pokemon saves?
Update to 0.9.4, which ensures the save type is detected automatically and correctly.
[edit] Why can't Pokemon save after beating the elite 4?
Your save file is 9KB. It should be 513KB. Your save file is broken due to you never having established the right savefile size. That means you made it all the way through the game without saving and then testing it by loading (which would not have worked, if you had tried it). See the above discussion for why that was a very bad idea. In 0.9.5+ or post-0.9.4 svn or 0.9.4+ rr builds you may see an option in the savetypes menu called FORCE AS CURRENT which, when used after picking the correct pokemon savefile size (4mbit) will hopefully permit subsequent saves to create a correct savefile.
In order to do that youll have to load your savestate first. If you have been using 0.9.4, since savestate compatibility between versions is not warranted, and definitely won't work between 0.9.4 and 0.9.5, you'll have to use Gocha's 0.9.4+ build which is located at http://tasvideos.org/forum/viewtopic.php?p=210670 which will be able to load an 0.9.4 savestate.
These instructions were not explicit enough for one user. In an effort to tailor this information to the intellectual capacity of the audience for this question, I will paste the instructions which apparently were simple enough for him to follow: go to the faq. follow the link to gocha's build. download gocha's build. load the savestate. set the size (4Mbit). use force as current. save the game. exit the emulator and verify that you can load the game from the savefile. if you can, then load it and play through to complete the game.
[edit] Wi-Fi and WFC
[edit] Does DeSmuME support wifi?
Wifi is not supported. It is currently under slow and incomplete development. Therefore, you may find this option missing, or simply 'greyed-out' for now. Also, since WIFI support does not work yet, don't ask any questions about it's functioning because it still is unfinished and does not work yet. Furthermore, current development activities focus mainly on the Windows build.
[edit] Why do I get an assert in wifi.cpp which keeps me from playing a game?
This was a glitch in 0.9.2 release which was fixed in 0.9.4.
[edit] If DeSmuME doesn't support wifi, then why does it make my firewall alert since 0.9.2?
Your firewall is stupid, or winsock is stupid, (I am not sure which yet) for alerting just when winsock gets initialized. The emulator hasnt actually tried to connect to the internet yet. How could it? There isn't any wifi. All we are doing is some network initialization code. For those of you who are still not satisfied, then I will admit that there is actually some wifi code--but it doesn't actually do anything yet! Except alert your firewall. Sorry. Also, maybe that is actually a good, unobtrusive time for firewalls to alert. But I am not sorry for calling them stupid. They are hyperactive crybabies.
[edit] Why did my build come with winpcap.dll? / Why do I get crashes when I run DeSmuME on vista which mention something about winpcap?
Because you are running an unofficial build, from dubious origins, made by unknown people. The DeSmuME team cannot support builds it did not create itself. Therefore, you are advised to stop using unofficial builds, as you can expect no support from the DeSmuME team or on the DeSmuME forums. Only use builds you downloaded from the DeSmuME website.
[edit] What is WFC / Nintendo WiFi Connection?
See the article Nintendo wifi config utility for more information.
[edit] Troubleshooting and Errors
[edit] Help! My desmume window disappeared! Maybe I can hear sound and it is in the taskbar but I can't see the window
Delete your ini file. This is caused by exiting the app while you have executed win+d show desktop mode. Desmume tries to remember the window position, but windows implements show desktop by setting the window position to something like x=-32000 and so that gets saved. There is supposed to be some code to handle that case, but I guess it is not working well. This is a problem in many windows apps and this solution will usually fix it. If you don't want to lose all the other settings in your ini file, poke around in it and find the offending items which should look like this:
[Video]
Window Size=0
Window width=0
Window height=0
WindowPosX=-32000
WindowPosY=-32000
Delete the -32000 items
[edit] Does Scribblenauts work?
It works in 0.9.4 but you must use external bios files and "emulate swi's with bios images". Speaking of work, it has come to my attention that several people worked for some years making this game. If that means anything to you people.
[edit] How do I use external BIOS files or firmware?
Config > emulation settings and supply the path. Do not ask us for BIOS files as we don't have them. It is only my psychic skills which enable me to know that this fixes Scribblenauts.
Since the menu option doesn't exist in the OS X port, it is impossible to play scribblenauts on it.
Like to MAC/OSX port, the Linux port(s) don't allow you to use external BIOS or Firmware files either.
[edit] Why does my touch screen not work? Oh yes you did read my mind, I was using external firmware
It's a bug. It is not a high priority since nobody yet has proven that they actually need the external firmware. If there was a way around it, I wouldve just told you.
[edit] I have a gameplay related question
Please check a site like http://www.gamefaqs.com, and don't post gameplay related questions on the forum or IRC *unless* you believe there is a bug in the emulation of DeSmuME.
[edit] Why doesn't my DeSmuME play this game?
Go to desmume.org and make sure you are using the latest version. The latest version is 0.9.4. Hint: DeSmuME 0.8 and 0.3.4 are very old, being numbers smaller than the latest version. Older versions will not be supported, under any circumstances.
[edit] Why doesn't my game boot or progress into the main game engine?
DeSmuME is not perfect yet. Some games may fail due to wifi emulation. You might find ways to patch the games to work better on emulators by searching on the internet, but that is not something you should seek help with on the DeSmuME forums. If it really doesn't boot up, you can submit a bug report for the game on the sourceforge bugtracker.
[edit] Why does the emulator take a long time to start up and/or devastate my system or unarchiver when I run it?
This is a problem with the DeSmuME 0.9.2 that some people impolitely distribute themselves. Redownload 0.9.2 from sourceforge.net or get a newer version. It isn't a virus or anything, it is a bug in the application that can just bring a system to its knees. It tries to allocate 1GB of virtual memory. This also crashes or freezes some virus scanners (I've seen it on AVG).
[edit] Why doesn't OpenGL 3D work in Linux?
Blame NVIDIA and ATI for putting out shoddy and/or closed source drivers. Then switch to software rasterizer.
[edit] Why doesn't OpenGL 3D work in windows?
You are probably using an ATI video card. ATI driver support of OpenGL is known to be poor. NVIDIA cards have a much more robust support of OpenGL, so getting one of those will help. Alternatively, you can switch to software rasterizer.
[edit] My display is incorrect or corrupted or something is missing
Try switching the 3D Renderer from OpenGL or SoftRasterizer, or vice versa, to see if that resolves the bug. In Windows, the default hotkey to do this quickly is numpad minus.
[edit] My display has flickering graphics in a certain game
In the 0.9.4 Windows port, you can choose 'Alternate Flush Mode' in the 'Config | 3D Settings' menu. This fixes some games with flickering graphics. This option is no longer necessary in 0.9.5. If you still have flickering graphics, find the discussion about frameskipping in this doc (try turning it off.)
[edit] Why does music and FMV sound bad/distorted sometimes?
Most DS music is sequenced music, loaded from the cart entirely when the level loads. This works mostly fine, but bonus points for you if your ears are good enough to spot the bugs. Your music that doesn't work well at all is probably streaming music, which loads from the cart on the fly and goes straight to the speakers, and possibly decoded along the way. This includes FMVs. This is much harder to emulate as it requires correct timing, which is not one of DeSmuME's strengths right now. At any rate, in 0.9.5 support for a synchronized SPU was added for the windows builds which can be optionally enabled to make these streaming sounds work correctly. Synchronizing audio is a hard problem to solve, and we're not finished solving it. The synchronous SPU comes with some other issues, which is why it is optional. Also available, if you are using the windows build, is a command from the menu Emulation > Shut Up to make the offending music go away.
[edit] Performance
[edit] Why is the emulator slow?
Because nobody pays us to work on it full time and it runs fast enough for us to be happy. Well, almost.
New releases may always be a step backwards in some (or many) cases from earlier releases in terms of speed. There is a delicate balance between compatibility and speed and sometimes one advances further than the other. At any rate, we have introduced a few speed hacks and toggles which you may find helpful:
* (0.9.4) If you are in Windows, make sure you're not using the NOSSE build. That one is slower.
* (0.9.5) If you are in Windows, try using the SSE2 build. It may be a little faster.
* (0.9.5) If you are in linux, try making a build with SSE and SSE2 extensions enabled because the code is ready to handle it. Someone should provide details on how to do this.
* If you are using someone else's unofficial "SVN" build, it probably is not fully optimized, since we make our Windows releases using some profiler-guided optimization, which helps by several FPS. For all I know, they are also carriers of viruses, and lately they tend to crash on Vista.
* If you can handle it, turn off the sound.
* Use frame skip. Even frameskipping by 1 will help and many games will stay playable. Frameskipping is continually tweaked in each release to get more bang for the buck, but beware that dual screen 3d games still may not work well under frameskip. If screens seem stuck, pick a different frameskip value.
* (0.9.4+) In the sound options, set interpolation to none which should help a little bit.
* (0.9.4 only) Turn on the sound option "ADPCM Caching"; this is new and experimental, and will break some things, but it should offer a substantial speedup in some cases.
* (0.9.5+) Use dual/asynch SPU mode -- even if you turn off the sound. Try alternate synch methods if you must use synch spu mode.
* (0.9.4+) There is now the option of disabling an entire screen. (Tools > View Layers > Main GPU, etc) Consider disabling a screen which is useless in the game you are playing.
* Try the software rasterizer. In many cases, especially games which make only light use of the 3d hardware, this will actually run faster, by as many as 10 FPS. But it might also run slower, again, by as many as 10 FPS.
* (0.9.5+) If you are using the software rasterizer, disable edge marking and fog if you feel like they aren't needed. If the game isn't using those features then this won't help.
* Buying a newer, faster computer is somewhat more expensive, but it has other side benefits.
* A faster CPU is more helpful than a bleeding edge graphics card. DeSmuME is more CPU intensive than it is GPU intensive. It just needs a graphics card that is glitch-free, and currently the NVIDIA cards have a better track record. A newer graphics card has a slim possibility of increasing speed.
* The cheapest way to get 60fps is to buy the cart. You may find that this is not enough, and you need to buy a console as well. Here are some steps that have worked well for me in the past:
o Look for neighbors that are mowing their own lawns. Ask them if they would like for you to do it instead.
o Borrow your daddy's lawn mower and mow the neighbor's lawn.
o After this, they will generally give you cash. As you repeat the above steps, this cash can accumulate to large values.
o Once the accumulated cash is sufficient, it can be taken to a merchant where it can be exchanged for games and consoles.
* My lawn needs mowing. It wont make your game run any faster if you mow it for me, but I am less likely to get evicted, which would be bad for my productivity.
[edit] Does DeSmuME make use of multiple CPU's or multiple cores?
Currently, the Windows port has two particular multicore optimizations (in 0.9.5+): first, the display logic runs in its own thread independent from the emulator. This is used to make the OSD run frame-rate independent from emulation. This thread performs color conversion, filtering, and directdraw presentation. The net result is a speedup by a few FPS. This codepath is disabled on single core systems, and may be disabled forcefully by the user with the --num-cores=1 command line argument. Second, the software rasterizer will run in a SLI mode using as many cores as you have specified (or have been detected) up to four. Still, DeSmuMe benefits MUCH more from a single CPU with a higher GHz than from multiple cores or from multiple CPUs.
[edit] In 0.9.4, what does the number/percentage in the DeSmuME title bar mean
* For the Windows port, the percentage is the emulated ARM9 CPU load average. The CPU in an actual Nintendo DS is an ARM9 CPU. The percentage shows us how busy the emulated CPU is. This number isnt really for you. You are far too curious. But go ahead and brag about how emulated games run at 99% on your system, it makes us laugh.
* For the Linux GTK and Glade ports, it's frames per second (fps).
[edit] In 0.9.5, what does the percentage in the FPS display mean
See above, it was moved here to save 915 million people from asking what it means in the title bar.
[edit] Why are there Two/Numbers in the FPS display?
The first is your actual FPS which is how fast the emu is running on your system. If it is less than 60 then you need speed hacks or more a more powerful CPU. The second is the 3d FPS, which is a rough gauge of how fast the game is supposed to be running. If you are seeing 60/15 then the game will feel slow because it is sloppily coded but theres NOTHING YOU CAN DO ABOUT IT short of turning off speed throttling and playing at 100fps.
[edit] Using The Emulator
[edit] What are the minimum hardware requirements for DeSmuME ?
From a purely technical viewpoint, there are no minimum requirements. However, for 'real-world' playable speeds, you would need at least the following :
* Windows OS: Windows XP or Vista
* Linux OS: Any recent Linux distribution with a 2.6 kernel.
* 2 GHz Processor
* 512 MB Available System Memory
* Available Hard Drive Space: A few MB for the emulator
* 128 MB 3D Video Card (Nvidia GeForce 6800 or better), ATI cards are not recommended.
* Optional: Sound Card, if you want sound support
* Optional: Microphone, if you wish to make use the Windows Microphone feature
[edit] What are the recommended hardware requirements for DeSmuME?
From a purely technical viewpoint, there are no recommended requirements. However, for 'real-world' playable speeds, the following gives you good performance:
* Windows OS: Windows XP or Vista
* Linux OS: Any recent Linux distribution with a 2.6 kernel.
* 3 GHz Processor
* 1 GB Available System Memory
* Available Hard Drive Space: A few MB for DeSmuME, 100MB or so for a bunch of savestates and savefiles.
* 512 MB 3D Video Card (Nvidia GeForce), ATI cards are not recommended.
* Sound Card.
* Microphone.
In general, the more GHz, the better. The faster memory, the better. DeSmuME 0.9.4 won't benefit from multiple cores. DeSmuME is at the moment, unfortunately, slower than no$gba.
[edit] It is hard to zoom in on a widescreen display due to the unusual aspect ratio of the DS
In fact it is hard to zoom in on a 4:3 screen, too. In 0.9.5, you can configure the screens to be side-by-side, so maybe this will make you happy. Additionally you can choose to display only one screen. I don't think anyone wants to add tear-apart windows, though.
[edit] But will you please add screen splitting / window tearing apart / fullscreen modes?
You think youre the first person to have thought of this? The answer is no. Of all the things in the world to code, we hate this the most.
[edit] How do I enter 'cheat codes' in DeSmuME?
As of 0.9.4, there are two types of cheat codes: Action Replay and 'raw' or 'internal' cheats. The 'raw' or 'internal' cheats include cheat-finding facilities where you may manually search for and alter the memory positions which work to your advantage. There's an excellent article on 'raw' or 'internal' cheats in the wiki on Using Cheats in DeSmuMe . For Action Replay Cheats, You can find codes for the NTSC games at http://us.codejunkies.com/Departments/DS-and-GBA.aspx and for the PAL at http://uk.codejunkies.com/Departments/DS-and-GBA.aspx.
[edit] I entered a 'cheat code', and now the emulator freezes.
Most likely it's a problem from the (Action Replay) cheat code you used. Using codes modify the game and can make it crash/freeze if it comes to an unexpected situation. It just depends on the code you use and what it's used for in the game. Find the .dct file in your emulator's folder that matches the game's filename, and then erase it to solve the 'freezing' problem.
[edit] Does DeSmuME support the microphone?
Yes, but only on the Windows and GNU/Linux ports. You do need to have an actual microphone attached to your PC, though. In 0.9.2 the microphone in Windows really only works for noise, but this was fixed in 0.9.4; it was fixed even further in 0.9.5. Linux support will exist in 0.9.5+ -- please note that it requires libasound.
When in windows, if it seems that the microphone is not working, bear in mind that it has no idea what kind of how many microphones you have. You will need to use the windows control panel to specify the correct microphone as the default audio input device, and then make sure in the recording level properties (volume control) that it is selected and at an appropriate volume.
[edit] Does the 'GBA slot' option let me play GBA games?
No. A 'real' DS can use the gba slot to play gba games, but DeSmuME does not emulate this. But a 'real' DS can also use the gba slot to access gba roms and sram so that ds games can import savefiles, and that part is emulated by DeSmuME. (please note that in 0.9.4 this is reportedly buggy for some games, including pokemon; this is supposed to have been fixed in 0.9.5) If you are looking for a Game Boy Advance (GBA) emulator, perhaps you can try mednafen or VisualBoy Advance.
[edit] How do I "Close the DS"?
This can be done using the 'lid' command or BACKSPACE key (this can be changed in the control configuration).
[edit] How do I use the stylus (pen) to 'touch' the screen?
You can use your mouse to emulate the stylus. Move the mouse cursor to the desired position, and then press the left mouse button in order to 'touch' the screen at the position the mouse cursor is located. Yes, we have really been asked this question before.
[edit] How can I touch two points on the screen at once, as required by Hotel Dusk?
One user got past this by first switching on one of the switches, then pausing the game, and sort of switching on an imaginary switch in the middle of the two switches while manipulating the frame advance hotkey. See, gbatek says that when two points are touched, that the hardware appears as if the average of the two points is actually pressed. But the game expects you to touch them at not-exactly-the-same-time.
[edit] General Questions
[edit] What does DeSmuME emulate and on what systems?
DeSmuME attempts to emulate, as faithfully as possible, the Nintendo DS and Nintendo DS Lite handheld game consoles (NDS). It currently runs on Windows, Linux, and mac OSX. DSi is not supported.
[edit] What does DeSmuME mean?
DeSmuME is a Nintendo DS emulator and the name is a play of words - DS Emu + ME (like FlashMe - firmware hack and PassMe mod-chip for DS) The name DeSmuME derives from the popular use of ME in Nintendo DS products by homebrew developers. So DeSmuME would equal DSemuMe. Other popular uses of ME include:
* LoadMe - a generic patcher for commercial DS roms that works with any GBA Flash Card
* PassMe - "mod-chip" using which takes authentication from an original DS card an allows execution of unauthenticated DS rom code - from the GBA cartridge slot / GBA flash card.
* FlashMe - a hacked firmware for DS that allows you to start code in DS mode from a flash card in the GBA slot.
* WifiMe - are a set of a custom drivers and software by FireFly for RALink based wireless network cards enabling to boot homebrew code on DS via Nintendo Wireless Multiboot method.
Its name is derived from emu which is short for emulator, DS and me. It's possibly supposed to mean "DS emulator for me".
[edit] Under what license is DeSmuME distributed ?
DeSmuME is distributed under the GNU General Public License, or GPL: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
[edit] Can I freely copy DeSmuME ?
Yes you can, as long as you adhere to the license as specified in the GNU GPL.
[edit] Where can I report bugs?
In the official bug tracker. Feel free to post to the bug tracker as long as you are willing to take ownership of testing that bug and letting the developers know when it is resolved to your satisfaction. Just don't submit a bug report and run. You may also request features around the same location, too, but in the other trackers.
[edit] Can I attach files to bug reports I did not create myself ?
SourceForge likes for folks to only respond on items they submit. If you see a ticket that represents something you are encountering, SourceForge doesn't necessarily want you commenting on that. The reasoning for this given by SourceForge is that they feel it is best to open your own ticket, which helps appreciate the extent of issues in many cases. The authors of DeSmuME may or may not agree with this point of view from SourceForge.
[edit] What is 'TAS' ?
TAS lets you record the gameplay in TAS format, see http://tasvideos.org for details on TAS (tool-assisted speedruns).
[edit] What hardware features are emulated?
* All known 2D graphics features are correct. Mosaics work but are imperfect. There may be small issues with colors as the correct color bit depths are not used at all points in the pipeline.
* All 3D features are emulated, except the following: wireframes and antialising. In 0.9.5, support for fog is added, as well as edge marking which mostly-works but is not perfect. In 0.9.5 the box test was significantly improved (dare I say perfected?) which fixed a number of games. The OpenGL engine is near its limit and renders some things incorrectly. Eventually the software rasterizer will support more features and be far more precise in the basic features. Both engines have trouble with some shadows, but software rasterizer is better. Software rasterizer has some noticeable texturing issues right now, especially in 2d games. Software rasterizer supports more correct lighting interpolation than opengl ever will (e.g. glitches at the edge of the screen while scrolling.) In software rasterizer, there are issues similar to 2d with incorrect bit depth being used in the pipeline. There are unfavorable edge conditions in each renderer; in OpenGL, textures tend to get overdrawn; in software rasterizer, edges of textures tend to be jittery (like the real DS)
One last thing -- if buttons and labels and menus rendering on the 3d screen are obscured (for example, a button but no label is on it) then you may need to use the software rasterizer. Or you may need to use OpenGL instead. Each renderer has strengths and weaknesses, which is why both are provided.
* All sound features are emulated. The microphone support is new and the manual should be consulted, where you will find out, among other things, that it is only supported in windows right now.
* Wifi is not supported. It is currently under slow and incomplete development. Therefore, you may find this option missing, or simply 'greyed-out' for now. Also, since WIFI support does not work yet, please don't ask any questions regarding it, because it still is unfinished and does not work yet.
* We are unaware of any outstanding issues in the core system hardware (CPU, DMA, MMU) but there are certainly still some. The instruction and memory timings are quite incorrect; however, this seems not to hurt most titles.
* DLDI - Dynamically Linked Driver Interface, commonly known as DLDI, is a driver framework that allows NDS and GBA homebrew to easily read and write to any number of different devices, just by substituting a driver file. The MPCF driver (GBA MoviePlayer CF-version) is the only one that is supported, so you will need to install it into your application before using it in desmume. You will find that a directory or fat image must be mounted via the commandline or UI for the "gbaslot" configuration. Right now, our codebase really only has libfat support for SLOT-2 devices and CF devices so more thorough support for other DLDI drivers is unlikely at this time.
* RTC (real-time clock) works; If it didn't, then the time in your games stays at 00:00:00, and your random number values always come up the same.
[edit] Does the GDB stub still work?
It seems as if it works in 0.9.4, tested with the Insight GDB variant on windows with a recent devKitPro. This support has been compiled into the dev+ build.
[edit] How do I enable the GDB stub on the Windows port ?
Add #define GDB_STUB to src/windows/userconfig/userconfig.h which you have created according to the instructions in src/windows/defaultconfig/userconfig.h ; sorry for this confusing system, but that's how it is for now.
[edit] Does compact flash works?
In 0.9.2+ it works, somewhat buggily, at least for directory scanning (i.e. not fat16 image) in windows via the gba slot. There is a bug that breaks it in linux, which has been fixed for 0.9.5+ along with some other work on that system.
[edit] Where/what is IRC?
IRC is an on-line communication system.
data you need:
* server: irc.freenode.net
* port: 6667
* channel: #desmume
what to use:
* mIRC - Windows
* ChatZilla - FireFox add-on
* xchat - X
* plenty other, see wikipedia
Language:
* Most of the people on the channel speak, or try to speak the English language.
[edit] Where is the manual?
A manual for DeSmuME is over at http://wiki.desmume.org/index.php?title=Manual. It may not have the information that other entries in this FAQ promised that it would.
[edit] Where is release 0.9.3?
Who cares? 0.9.4 is out now. DeSmuME 0.9.3 does not exist. It was sneaked out of our staging area. It has bugs, which is why we hadn't released it yet. So we decided not to release it at all. Any release claiming to be 0.9.3 won't be supported.
[edit] What is DLDI?
DLDI is a patching system for homebrew ROMs using libfat which makes DS homebrew much easier to write and much more user friendly. As you may know, there are many various flash cartridges for DS. These 'flashcarts' use different hardware, so to make a program run on all cards, youd have to write support for each and every card into the program. But no-one needs support for any other cards than their own. So a libfat developer, chism, developed DLDI. The program itself knows nothing about the hardware. However, when a DLDI patch is applied, libfat can use this patch to know how to write to the flashcart. So, if one user has an M3 flashcart, and downloads a program, they could patch it with the M3 DLDI patch and the program would work with it. Then, another user with a Supercart could download it, apply the Supercard DLDI patch, and it would work on their flashcart, too. The same patch should let the flashcart work with any libfat based program.
[edit] How can I post a save file or AVI capture on the DeSmuME forum?
After you created it, you can upload it to a free external service provider like MediaFire (http://www.mediafire.com/), and then put the provided links to the page in the message you post on the forum.
[edit] How can I record an AVI with a gap between the screens?
Learn how to use virtualdub and avisynth. Then use the following avisynth script which we have developed for this purpose:
####configuration####
gap = 64
#color = $aaaaaa
#color = $000000
color = $ffffff
##################
A = AviSource("c:\ds.avi", pixel_type="RGB32")
B = AviSource("c:\ds.avi", pixel_type="RGB32")
C = blankclip(fps=A.FrameRate, width=256, height=192+gap+192, color=color, length=A.FrameCount)
A = A.crop(0,0,256,192)
B = B.crop(0,192,256,192)
D = overlay(C,A)
D = overlay(D,B,0,192+gap)
return AudioDub(D,A)
We really don't want to put any smarts into the desmume avi dumper, preferring to do it with avisynth instead. It is a slippery slope, as there are about 50 things that people want avi dumpers to do and theyre better off learning how to do it outside the emu with other tools. To that end, if you have any particular needs regarding this do not hesitate to post in our forum and maybe we'll help you make a new avisynth script.
[edit] How can I post a large log or other text file on the DeSmuME IRC chat room?
Make use of an external text storage site, such as 'pastebin' (http://pastebin.com/), and post the url to it on the IRC channel.
[edit] What are the origins of DeSmuME?
DeSmuME is a freeware emulator for the Nintendo DS originally created by YopYop156. The original website was http://yopyop156.ifrance.com
Due to change in French laws regarding emulation YopYop decided to stop development of DeSmuME. However, he released the source under the GPL, and other programmers have picked it up and kept it under active development.
Yopyop said:
Its release under GPL. I have just removed the new 3D engine because its too much bugged. Hopefully it will be helpful for some of you.
The latest statement heard from yopyop was:
DeSmuME project is over.
You may dont know but there are a new law in France that could put me in big trouble.
With DeSmuME, I have closed the doors of game company but I can not offer to pay for it.
The worst thing is that I have found the bad coded instructions.
For those how have download the sources you have to look in sbc, rsbc instructions the Carry flag updating is wrong.
Sorry for the home brew programmers.
For the illegality the demonstration seemed to me convincing thus without proof clarify I prefer to stick to this decision.
It is also the fact that few people seem interested by the project. Put besides some people who sent demonstrations to me which did not go, I received only malls to wonder to make function such or such plays or to ask me why moved is in French .
Thus I will not do something of useless and illegal.
For the site it would not obstruct me if there were not the bond on the left which does nothing but add to confusion on the goal of the project.
And for the sources it is the same problem as for the project.
good week end
yopyop
edit the law relates to the royalties and the rights close, not?
[edit] SVN and Compiling
[edit] Why doesn't the DeSmuME team release pre-build SVN binaries ?
Because the DeSmuME team doesn't have trusted people to make the builds, and don't want to get involved on builds that could include whatever the author wants. Every newbie coder could do a version that, after 10 minutes of gameplay, for example, starts corrupting stuff from the hard disk. Also, anyone incapable of building it's own builds, probably isn't very helpful for submitting bug reports or helping the development team on SVN releases, so there isn't much point on them getting a SVN build.
[edit] How do I get the latest svn code and build DeSmuME myself?
Please check out the instructions related to your platform, over at Installing DeSmuME from source
[edit] What is 'SVN' ?
svn is a developers tool. It's used to let multiple developers work on the same codebase without conflicts. If youre an end-user, don't worry about it. And if you're a developer, see the question on how to get the latest svn code and build DeSmuME yourself. See wikipedia for more info
[edit] What compilers are supported for building DeSmuME from source?
* At the moment, for Windows Microsoft Visual C++ 2005 and 2008 are the only supported compilers. Dev-C++ is not supported. Microsoft's Visual C++ Express is free to install and use, so there's no reason not to use it.
* For Linux, any recent version of GCC and toolchain should work.
[edit] I'm Compiling using MSVC Express On Windows, and I get the error : "ml.exe" not found.
ml.exe was not included in earlier downloads of MSVC++ 2008 Express Edition. Uninstall, redownload and install again. 'ml.exe' shoud be located in the "Microsoft Visual Studio 9.0\VC\bin" directory.
[edit] Development and Technical Questions
[edit] I have a patch, modification or other code addition
Please add them to the appropriate sourceforge tracker. Patches go to the 'Patches' tracker : http://sourceforge.net/tracker/?group_id=164579&atid=832293
[edit] I'm a developer, and would like to contribute to the codebase. What can I do?
To start you off in the right direction, the best thing you can do is join the developer team on IRC and discuss your intentions with the developers.
[edit] Im not a developer, but would like to help out anyway. What can I do?
The most helpful thing you can do is use DeSmuME, learn its ins and outs, and learn how to compile svn builds. Then monitor it for regressions and report bugs. You can patrol the bug tracker for bugs which could use elucidation or which, based on your awareness of how the emulator is changing, might be fixed without us having specifically addressed the bug. Basically, be a super user. And hang out on irc. Also, adding to or perfecting the documentation in the wiki is useful. You could also watch for and answer questions placed on the DeSmuME forum.
[edit] What is this Lua stuff I see?
It is sort of a macro language for interacting with the running game software. Here is an example of it working with an NES game in another emulator, and youtubing for "fceux lua" should suffice to explain it if you don't get the picture from this url: http://www.youtube.com/watch?v=1XNTjVScm_8
[edit] How do I easily capture the ASM code for troubleshooting purposes?
Savestate during the problem or just before your problem occurs, and #define WANTASMLISTING in armcpu.cpp. Recompile. Then redirect stdout to a file. I know it isn't easy but its what we have for now.
A newer, and possibly better way, is to search for LOG_ARM9 in ndssystem.cpp and uncomment it. You will also need to trigger the condition for logging by setting dolog=true. Beware that this is very verbose, and can dump around 100MBytes of logs per frame.
[edit] Where can I find technical details on the Nintendo DS and GBA?
http://nocash.emubase.de/gbatek.htm
[edit] Mac Users
[edit] Why can't I find a Mac binary?
Maybe we haven't made it yet. There aren't a lot of people willing to compile Mac software. Just to be sure, go to https://sourceforge.net/project/showfiles.php?group_id=164579&package_id=186413
[edit] Why does my Mac binary say something about being unsupported?
You have probably downloaded the i386 version of DeSmuME for MAC, and are running on the PPC platform (or the other way around). Please verify if you're running on Intel (i386) hardware, or on PPC (G4, G5) hardware, and download the appropriate binary.
[edit] Why doesn't a menu option or tool exist in my Linux or Mac build?
Because making portable tools and platform harnesses are not our cup of tea and so a developer puts a feature into whichever ports he cares about. This policy is never going to change, although some features might migrate to other platforms over time. Better check the manual.
Retrieved from "http://wiki.desmume.org/index.php?title=Faq"
This page was last modified on 21 November 2009, at 21:55.
================================================
FILE: app/src/main/jni/desmume/aclocal.m4
================================================
# generated automatically by aclocal 1.11.5 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
# Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
[m4_warning([this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
# Public License, this file may be distributed as part of a program
# that contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# This file can be copied and used freely without restrictions. It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
#
# Macro to add for using GNU gettext.
# Ulrich Drepper , 1995, 1996
#
# Modified to never use included libintl.
# Owen Taylor , 12/15/1998
#
# Major rework to remove unused code
# Owen Taylor , 12/11/2002
#
# Added better handling of ALL_LINGUAS from GNU gettext version
# written by Bruno Haible, Owen Taylor 5/30/3002
#
# Modified to require ngettext
# Matthias Clasen 08/06/2004
#
# We need this here as well, since someone might use autoconf-2.5x
# to configure GLib then an older version to configure a package
# using AM_GLIB_GNU_GETTEXT
AC_PREREQ(2.53)
dnl
dnl We go to great lengths to make sure that aclocal won't
dnl try to pull in the installed version of these macros
dnl when running aclocal in the glib directory.
dnl
m4_copy([AC_DEFUN],[glib_DEFUN])
m4_copy([AC_REQUIRE],[glib_REQUIRE])
dnl
dnl At the end, if we're not within glib, we'll define the public
dnl definitions in terms of our private definitions.
dnl
# GLIB_LC_MESSAGES
#--------------------
glib_DEFUN([GLIB_LC_MESSAGES],
[AC_CHECK_HEADERS([locale.h])
if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include ], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES, 1,
[Define if your file defines LC_MESSAGES.])
fi
fi])
# GLIB_PATH_PROG_WITH_TEST
#----------------------------
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])
# GLIB_WITH_NLS
#-----------------
glib_DEFUN([GLIB_WITH_NLS],
dnl NLS is obligatory
[USE_NLS=yes
AC_SUBST(USE_NLS)
gt_cv_have_gettext=no
CATOBJEXT=NONE
XGETTEXT=:
INTLLIBS=
AC_CHECK_HEADER(libintl.h,
[gt_cv_func_dgettext_libintl="no"
libintl_extra_libs=""
#
# First check in libc
#
AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
[AC_TRY_LINK([
#include
],
[return !ngettext ("","", 1)],
gt_cv_func_ngettext_libc=yes,
gt_cv_func_ngettext_libc=no)
])
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
[AC_TRY_LINK([
#include
],
[return !dgettext ("","")],
gt_cv_func_dgettext_libc=yes,
gt_cv_func_dgettext_libc=no)
])
fi
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
AC_CHECK_FUNCS(bind_textdomain_codeset)
fi
#
# If we don't have everything we want, check in libintl
#
if test "$gt_cv_func_dgettext_libc" != "yes" \
|| test "$gt_cv_func_ngettext_libc" != "yes" \
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CHECK_LIB(intl, ngettext,
[AC_CHECK_LIB(intl, dgettext,
gt_cv_func_dgettext_libintl=yes)])])
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
AC_MSG_CHECKING([if -liconv is needed to use gettext])
AC_MSG_RESULT([])
AC_CHECK_LIB(intl, ngettext,
[AC_CHECK_LIB(intl, dcgettext,
[gt_cv_func_dgettext_libintl=yes
libintl_extra_libs=-liconv],
:,-liconv)],
:,-liconv)
fi
#
# If we found libintl, then check in it for bind_textdomain_codeset();
# we'll prefer libc if neither have bind_textdomain_codeset(),
# and both have dgettext and ngettext
#
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
glib_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $libintl_extra_libs"
unset ac_cv_func_bind_textdomain_codeset
AC_CHECK_FUNCS(bind_textdomain_codeset)
LIBS="$glib_save_LIBS"
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
gt_cv_func_dgettext_libc=no
else
if test "$gt_cv_func_dgettext_libc" = "yes" \
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
gt_cv_func_dgettext_libintl=no
fi
fi
fi
fi
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
gt_cv_have_gettext=yes
fi
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
INTLLIBS="-lintl $libintl_extra_libs"
fi
if test "$gt_cv_have_gettext" = "yes"; then
AC_DEFINE(HAVE_GETTEXT,1,
[Define if the GNU gettext() function is already present or preinstalled.])
GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
glib_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
AC_CHECK_FUNCS(dcgettext)
MSGFMT_OPTS=
AC_MSG_CHECKING([if msgfmt accepts -c])
GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: test 1.0\n"
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
"Last-Translator: test \n"
"Language-Team: C \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
AC_SUBST(MSGFMT_OPTS)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[case $host in
*-*-solaris*)
dnl On Solaris, if bind_textdomain_codeset is in libc,
dnl GNU format message catalog is always supported,
dnl since both are added to the libc all together.
dnl Hence, we'd like to go with DATADIRNAME=share and
dnl and CATOBJEXT=.gmo in this case.
AC_CHECK_FUNC(bind_textdomain_codeset,
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
;;
*-*-openbsd*)
CATOBJEXT=.mo
DATADIRNAME=share
;;
*)
CATOBJEXT=.mo
DATADIRNAME=lib
;;
esac])
LIBS="$glib_save_LIBS"
INSTOBJEXT=.mo
else
gt_cv_have_gettext=no
fi
fi
])
if test "$gt_cv_have_gettext" = "yes" ; then
AC_DEFINE(ENABLE_NLS, 1,
[always defined to indicate that i18n is enabled])
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is not GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext program is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
AC_OUTPUT_COMMANDS(
[case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac])
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.ac.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLLIBS)
AC_SUBST(PO_IN_DATADIR_TRUE)
AC_SUBST(PO_IN_DATADIR_FALSE)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
# AM_GLIB_GNU_GETTEXT
# -------------------
# Do checks necessary for use of gettext. If a suitable implementation
# of gettext is found in either in libintl or in the C library,
# it will set INTLLIBS to the libraries needed for use of gettext
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
# on various variables needed by the Makefile.in.in installed by
# glib-gettextize.
dnl
glib_DEFUN([GLIB_GNU_GETTEXT],
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
GLIB_LC_MESSAGES
GLIB_WITH_NLS
if test "$gt_cv_have_gettext" = "yes"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
desiredlanguages="$LINGUAS"
else
desiredlanguages="$ALL_LINGUAS"
fi
for desiredlang in $desiredlanguages; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
fi
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
# -------------------------------
# Define VARIABLE to the location where catalog files will
# be installed by po/Makefile.
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
glib_save_prefix="$prefix"
glib_save_exec_prefix="$exec_prefix"
glib_save_datarootdir="$datarootdir"
test "x$prefix" = xNONE && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
datarootdir=`eval echo "${datarootdir}"`
if test "x$CATOBJEXT" = "x.mo" ; then
localedir=`eval echo "${libdir}/locale"`
else
localedir=`eval echo "${datadir}/locale"`
fi
prefix="$glib_save_prefix"
exec_prefix="$glib_save_exec_prefix"
datarootdir="$glib_save_datarootdir"
AC_DEFINE_UNQUOTED($1, "$localedir",
[Define the location where the catalogs will be installed])
])
dnl
dnl Now the definitions that aclocal will find
dnl
ifdef(glib_configure_ac,[],[
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
])dnl
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
#
# Create a temporary file with TEST-FILE as its contents and pass the
# file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with
# 0 and perform ACTION-IF-FAIL for any other exit status.
AC_DEFUN([GLIB_RUN_PROG],
[cat >conftest.foo <<_ACEOF
$2
_ACEOF
if AC_RUN_LOG([$1 conftest.foo]); then
m4_ifval([$3], [$3], [:])
m4_ifvaln([$4], [else $4])dnl
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
fi])
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
# serial 42 IT_PROG_INTLTOOL
AC_DEFUN([IT_PROG_INTLTOOL], [
AC_PREREQ([2.50])dnl
AC_REQUIRE([AM_NLS])dnl
case "$am__api_version" in
1.[01234])
AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
;;
*)
;;
esac
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
if test -n "$1"; then
AC_MSG_CHECKING([for intltool >= $1])
AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
fi
AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
fi
if test -z "$AM_DEFAULT_VERBOSITY"; then
AM_DEFAULT_VERBOSITY=1
fi
AC_SUBST([AM_DEFAULT_VERBOSITY])
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
INTLTOOL__v_MERGE_0='@echo " ITMRG " [$]@;'
AC_SUBST(INTLTOOL_V_MERGE)
AC_SUBST(INTLTOOL__v_MERGE_)
AC_SUBST(INTLTOOL__v_MERGE_0)
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
intltool__v_merge_options_0='-q'
AC_SUBST(INTLTOOL_V_MERGE_OPTIONS)
AC_SUBST(intltool__v_merge_options_)
AC_SUBST(intltool__v_merge_options_0)
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< [$]@'
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< [$]@'
else
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.[$][$]RANDOM && mkdir [$][$]_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u [$][$]_it_tmp_dir $< [$]@ && rmdir [$][$]_it_tmp_dir'
fi
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
_IT_SUBST(INTLTOOL_DESKTOP_RULE)
_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
_IT_SUBST(INTLTOOL_KEYS_RULE)
_IT_SUBST(INTLTOOL_PROP_RULE)
_IT_SUBST(INTLTOOL_OAF_RULE)
_IT_SUBST(INTLTOOL_PONG_RULE)
_IT_SUBST(INTLTOOL_SERVER_RULE)
_IT_SUBST(INTLTOOL_SHEET_RULE)
_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
_IT_SUBST(INTLTOOL_UI_RULE)
_IT_SUBST(INTLTOOL_XAM_RULE)
_IT_SUBST(INTLTOOL_KBD_RULE)
_IT_SUBST(INTLTOOL_XML_RULE)
_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
_IT_SUBST(INTLTOOL_CAVES_RULE)
_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
_IT_SUBST(INTLTOOL_THEME_RULE)
_IT_SUBST(INTLTOOL_SERVICE_RULE)
_IT_SUBST(INTLTOOL_POLICY_RULE)
# Check the gettext tools to make sure they are GNU
AC_PATH_PROG(XGETTEXT, xgettext)
AC_PATH_PROG(MSGMERGE, msgmerge)
AC_PATH_PROG(MSGFMT, msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
fi
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
fi
AC_PATH_PROG(INTLTOOL_PERL, perl)
if test -z "$INTLTOOL_PERL"; then
AC_MSG_ERROR([perl not found])
fi
AC_MSG_CHECKING([for perl >= 5.8.1])
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
if test $? -ne 0; then
AC_MSG_ERROR([perl 5.8.1 is required for intltool])
else
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
AC_MSG_RESULT([$IT_PERL_VERSION])
fi
if test "x$2" != "xno-xml"; then
AC_MSG_CHECKING([for XML::Parser])
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
AC_MSG_RESULT([ok])
else
AC_MSG_ERROR([XML::Parser perl module is required for intltool])
fi
fi
# Substitute ALL_LINGUAS so we can use it in po/Makefile
AC_SUBST(ALL_LINGUAS)
# Set DATADIRNAME correctly if it is not set yet
# (copied from glib-gettext.m4)
if test -z "$DATADIRNAME"; then
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]],
[[extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr]])],
[DATADIRNAME=share],
[case $host in
*-*-solaris*)
dnl On Solaris, if bind_textdomain_codeset is in libc,
dnl GNU format message catalog is always supported,
dnl since both are added to the libc all together.
dnl Hence, we'd like to go with DATADIRNAME=share
dnl in this case.
AC_CHECK_FUNC(bind_textdomain_codeset,
[DATADIRNAME=share], [DATADIRNAME=lib])
;;
*)
[DATADIRNAME=lib]
;;
esac])
fi
AC_SUBST(DATADIRNAME)
IT_PO_SUBDIR([po])
])
# IT_PO_SUBDIR(DIRNAME)
# ---------------------
# All po subdirs have to be declared with this macro; the subdir "po" is
# declared by IT_PROG_INTLTOOL.
#
AC_DEFUN([IT_PO_SUBDIR],
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
dnl
dnl The following CONFIG_COMMANDS should be executed at the very end
dnl of config.status.
AC_CONFIG_COMMANDS_PRE([
AC_CONFIG_COMMANDS([$1/stamp-it], [
if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
fi
rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
>"$1/stamp-it.tmp"
[sed '/^#/d
s/^[[].*] *//
/^[ ]*$/d
'"s|^| $ac_top_srcdir/|" \
"$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
]
[sed '/^POTFILES =/,/[^\\]$/ {
/^POTFILES =/!d
r $1/POTFILES
}
' "$1/Makefile.in" >"$1/Makefile"]
rm -f "$1/Makefile.tmp"
mv "$1/stamp-it.tmp" "$1/stamp-it"
])
])dnl
])
# _IT_SUBST(VARIABLE)
# -------------------
# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
#
AC_DEFUN([_IT_SUBST],
[
AC_SUBST([$1])
m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
]
)
# deprecated macros
AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
# A hint is needed for aclocal from Automake <= 1.9.4:
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
# nls.m4 serial 5 (gettext-0.18)
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
dnl This file can can be used in projects which are not available under
dnl the GNU General Public License or the GNU Library General Public
dnl License but which still want to provide support for the GNU gettext
dnl functionality.
dnl Please note that the actual code of the GNU gettext library is covered
dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
dnl Authors:
dnl Ulrich Drepper , 1995-2000.
dnl Bruno Haible , 2000-2003.
AC_PREREQ([2.50])
AC_DEFUN([AM_NLS],
[
AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE([nls],
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT([$USE_NLS])
AC_SUBST([USE_NLS])
])
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant .
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see .])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
# 2010, 2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 12
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
AC_SUBST([am__nodep])dnl
_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
# Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
# 2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless `enable' is passed literally.
# For symmetry, `disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
# Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
# Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 1
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
================================================
FILE: app/src/main/jni/desmume/autogen.sh
================================================
#!/bin/sh
# intltoolize is optionnal as it's only required for the gtk-glade UI.
if test ! "x$(which intltoolize)" = "x"; then
echo "Running intltoolize"
intltoolize --copy --force --automake
else
if test ! "x$(which gintltoolize)" = "x"; then
echo "Running gintltoolize"
gintltoolize --copy --force --automake
fi
fi
autoreconf --install --force --verbose
================================================
FILE: app/src/main/jni/desmume/compile
================================================
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
scriptversion=2005-05-14.22
# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
# Written by Tom Tromey .
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
esac
ofile=
cfile=
eat=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:
================================================
FILE: app/src/main/jni/desmume/config.guess
================================================
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2012-02-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner. Please send patches (context
# diff format) to and include a ChangeLog
# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm:riscos:*:*|arm:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
i386)
eval $set_cc_for_build
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
================================================
FILE: app/src/main/jni/desmume/config.sub
================================================
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2012-02-10'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to . Submit a context
# diff and a properly formatted GNU ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
| open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze)
basic_machine=microblaze-xilinx
;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-kaos*)
os=-kaos
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
================================================
FILE: app/src/main/jni/desmume/configure
================================================
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for desmume 0.9.8.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
export CONFIG_SHELL
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='desmume'
PACKAGE_TARNAME='desmume'
PACKAGE_VERSION='0.9.8'
PACKAGE_STRING='desmume 0.9.8'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Factoring default headers for most tests.
ac_includes_default="\
#include
#ifdef HAVE_SYS_TYPES_H
# include
#endif
#ifdef HAVE_SYS_STAT_H
# include
#endif
#ifdef STDC_HEADERS
# include
# include
#else
# ifdef HAVE_STDLIB_H
# include
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include
# endif
# include
#endif
#ifdef HAVE_STRINGS_H
# include
#endif
#ifdef HAVE_INTTYPES_H
# include
#endif
#ifdef HAVE_STDINT_H
# include
#endif
#ifdef HAVE_UNISTD_H
# include
#endif"
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
USE_MAINTAINER_MODE
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
HAVE_GDB_STUB_FALSE
HAVE_GDB_STUB_TRUE
PO_DIR
UI_DIR
X_EXTRA_LIBS
X_LIBS
X_PRE_LIBS
X_CFLAGS
XMKMF
MKINSTALLDIRS
POSUB
POFILES
PO_IN_DATADIR_FALSE
PO_IN_DATADIR_TRUE
INTLLIBS
INSTOBJEXT
GMOFILES
CATOBJEXT
CATALOGS
MSGFMT_OPTS
GETTEXT_PACKAGE
HAVE_WX_FALSE
HAVE_WX_TRUE
WX_RESCOMP
WX_VERSION
WX_LIBS_STATIC
WX_LIBS
WX_CXXFLAGS_ONLY
WX_CFLAGS_ONLY
WX_CXXFLAGS
WX_CFLAGS
WX_CPPFLAGS
WX_CONFIG_PATH
HAVE_LIBSOUNDTOUCH_FALSE
HAVE_LIBSOUNDTOUCH_TRUE
LIBSOUNDTOUCH_LIBS
LIBSOUNDTOUCH_CFLAGS
HAVE_LIBAGG_FALSE
HAVE_LIBAGG_TRUE
LIBAGG_LIBS
LIBAGG_CFLAGS
HAVE_ALSA_FALSE
HAVE_ALSA_TRUE
ALSA_LIBS
ALSA_CFLAGS
HAVE_LUA_FALSE
HAVE_LUA_TRUE
LUA_LIBS
LUA_CFLAGS
UPDATEDESKTOP
GTKGLEXT_LIBS
GTKGLEXT_CFLAGS
GLADEUI_UNINSTALLED_DIR
LIBGLADE_LIBS
LIBGLADE_CFLAGS
GTHREAD_LIBS
GTHREAD_CFLAGS
GTK_LIBS
GTK_CFLAGS
GLIB_LIBS
GLIB_CFLAGS
HAVE_OPENAL_FALSE
HAVE_OPENAL_TRUE
HAVE_LIBOSMESA_FALSE
HAVE_LIBOSMESA_TRUE
OSMESA_LIBS
HAVE_GL_FALSE
HAVE_GL_TRUE
SDL_LIBS
SDL_CFLAGS
SDLCONFIG
HAVE_PKG
DATADIRNAME
ALL_LINGUAS
INTLTOOL_PERL
GMSGFMT
MSGFMT
MSGMERGE
XGETTEXT
INTLTOOL_POLICY_RULE
INTLTOOL_SERVICE_RULE
INTLTOOL_THEME_RULE
INTLTOOL_SCHEMAS_RULE
INTLTOOL_CAVES_RULE
INTLTOOL_XML_NOMERGE_RULE
INTLTOOL_XML_RULE
INTLTOOL_KBD_RULE
INTLTOOL_XAM_RULE
INTLTOOL_UI_RULE
INTLTOOL_SOUNDLIST_RULE
INTLTOOL_SHEET_RULE
INTLTOOL_SERVER_RULE
INTLTOOL_PONG_RULE
INTLTOOL_OAF_RULE
INTLTOOL_PROP_RULE
INTLTOOL_KEYS_RULE
INTLTOOL_DIRECTORY_RULE
INTLTOOL_DESKTOP_RULE
intltool__v_merge_options_0
intltool__v_merge_options_
INTLTOOL_V_MERGE_OPTIONS
INTLTOOL__v_MERGE_0
INTLTOOL__v_MERGE_
INTLTOOL_V_MERGE
AM_DEFAULT_VERBOSITY
INTLTOOL_EXTRACT
INTLTOOL_MERGE
INTLTOOL_UPDATE
USE_NLS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
EGREP
GREP
CPP
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
ac_ct_CC
CFLAGS
CC
RANLIB
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
EXEEXT
ac_ct_CXX
CPPFLAGS
LDFLAGS
CXXFLAGS
CXX
am__untar
am__tar
AMTAR
am__leading_dot
SET_MAKE
AWK
mkdir_p
MKDIR_P
INSTALL_STRIP_PROGRAM
STRIP
install_sh
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
desmume_arch
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_nls
enable_osmesa
enable_hud
enable_macosxhack
enable_openal
enable_glade
enable_wxwidgets
enable_wifi
with_x
enable_gdb_stub
enable_hardcore
enable_debug
enable_gpu_debug
enable_div_debug
enable_sqrt_debug
enable_dma_debug
enable_maintainer_mode
'
ac_precious_vars='build_alias
host_alias
target_alias
CXX
CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
CCC
CC
CFLAGS
CPP
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
GLIB_CFLAGS
GLIB_LIBS
GTK_CFLAGS
GTK_LIBS
GTHREAD_CFLAGS
GTHREAD_LIBS
LIBGLADE_CFLAGS
LIBGLADE_LIBS
GTKGLEXT_CFLAGS
GTKGLEXT_LIBS
LUA_CFLAGS
LUA_LIBS
ALSA_CFLAGS
ALSA_LIBS
LIBAGG_CFLAGS
LIBAGG_LIBS
LIBSOUNDTOUCH_CFLAGS
LIBSOUNDTOUCH_LIBS
XMKMF'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
$as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures desmume 0.9.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/desmume]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
X features:
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of desmume 0.9.8:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors
--disable-nls do not use Native Language Support
--enable-osmesa use off-screen mesa
--enable-hud Enable HUD rendering, requires libagg
--enable-macosxhack hack to build MacOSX package
--enable-openal enable experimental OpenAL microphone input
--enable-glade enable glade frontend
--enable-wxwidgets Enable cross platform wx widgets frontend
--enable-wifi enable experimental wifi comm support
--enable-gdb-stub enable gdb stub
--enable-hardcore turn on -W -Wall -Werror
--enable-debug enable debug information
--enable-gpu-debug enable gpu debug information
--enable-div-debug enable div debug information
--enable-sqrt-debug enable sqrt debug information
--enable-dma-debug enable dma debug information
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-x use the X Window System
Some influential environment variables:
CXX C++ compiler command
CXXFLAGS C++ compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CC C compiler command
CFLAGS C compiler flags
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
GLIB_LIBS linker flags for GLIB, overriding pkg-config
GTK_CFLAGS C compiler flags for GTK, overriding pkg-config
GTK_LIBS linker flags for GTK, overriding pkg-config
GTHREAD_CFLAGS
C compiler flags for GTHREAD, overriding pkg-config
GTHREAD_LIBS
linker flags for GTHREAD, overriding pkg-config
LIBGLADE_CFLAGS
C compiler flags for LIBGLADE, overriding pkg-config
LIBGLADE_LIBS
linker flags for LIBGLADE, overriding pkg-config
GTKGLEXT_CFLAGS
C compiler flags for GTKGLEXT, overriding pkg-config
GTKGLEXT_LIBS
linker flags for GTKGLEXT, overriding pkg-config
LUA_CFLAGS C compiler flags for LUA, overriding pkg-config
LUA_LIBS linker flags for LUA, overriding pkg-config
ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config
ALSA_LIBS linker flags for ALSA, overriding pkg-config
LIBAGG_CFLAGS
C compiler flags for LIBAGG, overriding pkg-config
LIBAGG_LIBS linker flags for LIBAGG, overriding pkg-config
LIBSOUNDTOUCH_CFLAGS
C compiler flags for LIBSOUNDTOUCH, overriding pkg-config
LIBSOUNDTOUCH_LIBS
linker flags for LIBSOUNDTOUCH, overriding pkg-config
XMKMF Path to xmkmf, Makefile generator for X Window System
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
desmume configure 0.9.8
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef $2
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
yes:no: )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by desmume $as_me 0.9.8, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
$as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
$as_echo "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
case $host in
*linux*) desmume_arch=linux;;
*mingw*) desmume_arch=windows;;
*darwin*) desmume_arch=linux;;
*bsd*) desmume_arch=linux;;
esac
am__api_version='1.11'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
test "$2" = conftest.file
)
then
# Ok.
:
else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
fi
else
STRIP="$ac_cv_prog_STRIP"
fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
if ${ac_cv_path_mkdir+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
{ test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
'mkdir (fileutils) '4.1*)
ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
break 3;;
esac
done
done
done
IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
if test "${ac_cv_path_mkdir+set}" = set; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
MKDIR_P="$ac_install_sh -d"
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
mkdir_p="$MKDIR_P"
case $mkdir_p in
[\\/$]* | ?:[\\/]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AWK+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$AWK" && break
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
# Define the identity of the package.
PACKAGE='desmume'
VERSION='0.9.8'
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF
# Some tools Automake needs.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -z "$CXX"; then
if test -n "$CCC"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
$as_echo "$CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CXX" && break
done
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
$as_echo "$ac_ct_CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CXX" && break
done
if test "x$ac_ct_CXX" = x; then
CXX="g++"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
fi
fi
fi
fi
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
$as_echo_n "checking whether the C++ compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C++ compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
$as_echo_n "checking for C++ compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
if ${ac_cv_cxx_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
$as_echo_n "checking whether $CXX accepts -g... " >&6; }
if ${ac_cv_prog_cxx_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
else
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
$as_echo "$ac_cv_prog_cxx_g" >&6; }
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
CXXFLAGS="-g -O2"
else
CXXFLAGS="-g"
fi
else
if test "$GXX" = yes; then
CXXFLAGS="-O2"
else
CXXFLAGS=
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_am_result" >&6; }
rm -f confinc confmf
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
enableval=$enable_dependency_tracking;
fi
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
am__nodep='_no'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
AMDEP_TRUE='#'
AMDEP_FALSE=
fi
depcc="$CXX" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_CXX_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_CXX_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_CXX_dependencies_compiler_type=none
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
am__fastdepCXX_TRUE=
am__fastdepCXX_FALSE='#'
else
am__fastdepCXX_TRUE='#'
am__fastdepCXX_FALSE=
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
RANLIB=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CC" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_CC_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_CC_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_CC_dependencies_compiler_type=none
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
am__fastdepCC_TRUE=
am__fastdepCC_FALSE='#'
else
am__fastdepCC_TRUE='#'
am__fastdepCC_FALSE=
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
done
ac_cv_prog_CPP=$CPP
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
{ test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
ac_cv_header_stdc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "memchr" >/dev/null 2>&1; then :
else
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "free" >/dev/null 2>&1; then :
else
ac_cv_header_stdc=no
fi
rm -f conftest*
fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
if test "$cross_compiling" = yes; then :
:
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
#else
# define ISLOWER(c) \
(('a' <= (c) && (c) <= 'i') \
|| ('j' <= (c) && (c) <= 'r') \
|| ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
int
main ()
{
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
return 2;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
else
ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
$as_echo "#define STDC_HEADERS 1" >>confdefs.h
fi
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
# See if we're dealing with a universal compiler.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __APPLE_CC__
not a universal capable compiler
#endif
typedef int dummy;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# Check for potential -arch flags. It is not universal unless
# there are at least two -arch flags with different values.
ac_arch=
ac_prev=
for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
if test -n "$ac_prev"; then
case $ac_word in
i?86 | x86_64 | ppc | ppc64)
if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
ac_arch=$ac_word
else
ac_cv_c_bigendian=universal
break
fi
;;
esac
ac_prev=
elif test "x$ac_word" = "x-arch"; then
ac_prev=arch
fi
done
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
&& defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
&& LITTLE_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# It does; now see whether it defined to BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
else
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# It does; now see whether it defined to _BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
#ifndef _BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
else
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# Compile a test program.
if test "$cross_compiling" = yes; then :
# Try to guess by grepping values from an object file.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
}
extern int foo;
int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ac_cv_c_bigendian=no
else
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
$as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
no)
;; #(
universal)
$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
as_fn_error $? "unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
# took this from geany, hope it works
REVISION="r0"
SVN=`which svn 2>/dev/null`
if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}" ; then
REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
fi
cat >>confdefs.h <<_ACEOF
#define SVN_REV "$REVISION"
_ACEOF
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
$as_echo "$PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
$as_echo "$ac_pt_PKG_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
PKG_CONFIG=""
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
$as_echo_n "checking whether NLS is requested... " >&6; }
# Check whether --enable-nls was given.
if test "${enable_nls+set}" = set; then :
enableval=$enable_nls; USE_NLS=$enableval
else
USE_NLS=yes
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
$as_echo "$USE_NLS" >&6; }
case "$am__api_version" in
1.01234)
as_fn_error $? "Automake 1.5 or newer is required to use intltool" "$LINENO" 5
;;
*)
;;
esac
INTLTOOL_REQUIRED_VERSION_AS_INT=`echo | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
if test -n ""; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for intltool >= " >&5
$as_echo_n "checking for intltool >= ... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_APPLIED_VERSION found" >&5
$as_echo "$INTLTOOL_APPLIED_VERSION found" >&6; }
test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
as_fn_error $? "Your intltool is too old. You need intltool or later." "$LINENO" 5
fi
# Extract the first word of "intltool-update", so it can be a program name with args.
set dummy intltool-update; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_INTLTOOL_UPDATE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $INTLTOOL_UPDATE in
[\\/]* | ?:[\\/]*)
ac_cv_path_INTLTOOL_UPDATE="$INTLTOOL_UPDATE" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_INTLTOOL_UPDATE="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
INTLTOOL_UPDATE=$ac_cv_path_INTLTOOL_UPDATE
if test -n "$INTLTOOL_UPDATE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_UPDATE" >&5
$as_echo "$INTLTOOL_UPDATE" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "intltool-merge", so it can be a program name with args.
set dummy intltool-merge; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_INTLTOOL_MERGE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $INTLTOOL_MERGE in
[\\/]* | ?:[\\/]*)
ac_cv_path_INTLTOOL_MERGE="$INTLTOOL_MERGE" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_INTLTOOL_MERGE="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
INTLTOOL_MERGE=$ac_cv_path_INTLTOOL_MERGE
if test -n "$INTLTOOL_MERGE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_MERGE" >&5
$as_echo "$INTLTOOL_MERGE" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "intltool-extract", so it can be a program name with args.
set dummy intltool-extract; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_INTLTOOL_EXTRACT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $INTLTOOL_EXTRACT in
[\\/]* | ?:[\\/]*)
ac_cv_path_INTLTOOL_EXTRACT="$INTLTOOL_EXTRACT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_INTLTOOL_EXTRACT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
INTLTOOL_EXTRACT=$ac_cv_path_INTLTOOL_EXTRACT
if test -n "$INTLTOOL_EXTRACT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_EXTRACT" >&5
$as_echo "$INTLTOOL_EXTRACT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
as_fn_error $? "The intltool scripts were not found. Please install intltool." "$LINENO" 5
fi
if test -z "$AM_DEFAULT_VERBOSITY"; then
AM_DEFAULT_VERBOSITY=1
fi
INTLTOOL_V_MERGE='$(INTLTOOL__v_MERGE_$(V))'
INTLTOOL__v_MERGE_='$(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))'
INTLTOOL__v_MERGE_0='@echo " ITMRG " $@;'
INTLTOOL_V_MERGE_OPTIONS='$(intltool__v_merge_options_$(V))'
intltool__v_merge_options_='$(intltool__v_merge_options_$(AM_DEFAULT_VERBOSITY))'
intltool__v_merge_options_0='-q'
INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -p $(top_srcdir)/po $< $@'
INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
if test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge 5000; then
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u --no-translations $< $@'
else
INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM && mkdir $$_it_tmp_dir && LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u $$_it_tmp_dir $< $@ && rmdir $$_it_tmp_dir'
fi
INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; $(INTLTOOL_V_MERGE)LC_ALL=C $(INTLTOOL_MERGE) $(INTLTOOL_V_MERGE_OPTIONS) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $@'
# Check the gettext tools to make sure they are GNU
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_XGETTEXT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $XGETTEXT in
[\\/]* | ?:[\\/]*)
ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_XGETTEXT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
XGETTEXT=$ac_cv_path_XGETTEXT
if test -n "$XGETTEXT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
$as_echo "$XGETTEXT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "msgmerge", so it can be a program name with args.
set dummy msgmerge; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_MSGMERGE+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MSGMERGE in
[\\/]* | ?:[\\/]*)
ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MSGMERGE="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
MSGMERGE=$ac_cv_path_MSGMERGE
if test -n "$MSGMERGE"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
$as_echo "$MSGMERGE" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_MSGFMT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MSGFMT in
[\\/]* | ?:[\\/]*)
ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MSGFMT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
MSGFMT=$ac_cv_path_MSGFMT
if test -n "$MSGFMT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
$as_echo "$MSGFMT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GMSGFMT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GMSGFMT in
[\\/]* | ?:[\\/]*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
GMSGFMT=$ac_cv_path_GMSGFMT
if test -n "$GMSGFMT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
$as_echo "$GMSGFMT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5
fi
xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
as_fn_error $? "GNU gettext tools not found; required for intltool" "$LINENO" 5
fi
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_INTLTOOL_PERL+:} false; then :
$as_echo_n "(cached) " >&6
else
case $INTLTOOL_PERL in
[\\/]* | ?:[\\/]*)
ac_cv_path_INTLTOOL_PERL="$INTLTOOL_PERL" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_INTLTOOL_PERL="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
INTLTOOL_PERL=$ac_cv_path_INTLTOOL_PERL
if test -n "$INTLTOOL_PERL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLTOOL_PERL" >&5
$as_echo "$INTLTOOL_PERL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$INTLTOOL_PERL"; then
as_fn_error $? "perl not found" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl >= 5.8.1" >&5
$as_echo_n "checking for perl >= 5.8.1... " >&6; }
$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
if test $? -ne 0; then
as_fn_error $? "perl 5.8.1 is required for intltool" "$LINENO" 5
else
IT_PERL_VERSION=`$INTLTOOL_PERL -e "printf '%vd', $^V"`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $IT_PERL_VERSION" >&5
$as_echo "$IT_PERL_VERSION" >&6; }
fi
if test "x" != "xno-xml"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML::Parser" >&5
$as_echo_n "checking for XML::Parser... " >&6; }
if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "XML::Parser perl module is required for intltool" "$LINENO" 5
fi
fi
# Substitute ALL_LINGUAS so we can use it in po/Makefile
# Set DATADIRNAME correctly if it is not set yet
# (copied from glib-gettext.m4)
if test -z "$DATADIRNAME"; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
DATADIRNAME=share
else
case $host in
*-*-solaris*)
ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
DATADIRNAME=share
else
DATADIRNAME=lib
fi
;;
*)
DATADIRNAME=lib
;;
esac
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_HAVE_PKG+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$HAVE_PKG"; then
ac_cv_prog_HAVE_PKG="$HAVE_PKG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_HAVE_PKG="${ac_tool_prefix}pkg-config"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
HAVE_PKG=$ac_cv_prog_HAVE_PKG
if test -n "$HAVE_PKG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PKG" >&5
$as_echo "$HAVE_PKG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_HAVE_PKG"; then
ac_ct_HAVE_PKG=$HAVE_PKG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_HAVE_PKG+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_HAVE_PKG"; then
ac_cv_prog_ac_ct_HAVE_PKG="$ac_ct_HAVE_PKG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_HAVE_PKG="pkg-config"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_HAVE_PKG=$ac_cv_prog_ac_ct_HAVE_PKG
if test -n "$ac_ct_HAVE_PKG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_HAVE_PKG" >&5
$as_echo "$ac_ct_HAVE_PKG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_HAVE_PKG" = x; then
HAVE_PKG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
HAVE_PKG=$ac_ct_HAVE_PKG
fi
else
HAVE_PKG="$ac_cv_prog_HAVE_PKG"
fi
if test "xHAVE_PKG" = "x" ; then
as_fn_error $? "pkg-config is required to build desmume" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5
$as_echo_n "checking for gzopen in -lz... " >&6; }
if ${ac_cv_lib_z_gzopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gzopen ();
int
main ()
{
return gzopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_z_gzopen=yes
else
ac_cv_lib_z_gzopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5
$as_echo "$ac_cv_lib_z_gzopen" >&6; }
if test "x$ac_cv_lib_z_gzopen" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBZ 1
_ACEOF
LIBS="-lz $LIBS"
else
as_fn_error $? "zlib was not found, we can't go further. Please install it or specify the location where it's installed." "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip_open in -lzzip" >&5
$as_echo_n "checking for zzip_open in -lzzip... " >&6; }
if ${ac_cv_lib_zzip_zzip_open+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzzip $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char zzip_open ();
int
main ()
{
return zzip_open ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_zzip_zzip_open=yes
else
ac_cv_lib_zzip_zzip_open=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zzip_zzip_open" >&5
$as_echo "$ac_cv_lib_zzip_zzip_open" >&6; }
if test "x$ac_cv_lib_zzip_zzip_open" = xyes; then :
LIBS="-lzzip $LIBS"
$as_echo "#define HAVE_LIBZZIP 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether zzip use void * as second parameter" >&5
$as_echo_n "checking whether zzip use void * as second parameter... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
void * v;
zzip_read(NULL, v, 0);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
$as_echo "#define ZZIP_OLD_READ 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
for ac_prog in sdl-config sdl11-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SDLCONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SDLCONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SDLCONFIG="$SDLCONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_SDLCONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
SDLCONFIG=$ac_cv_path_SDLCONFIG
if test -n "$SDLCONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDLCONFIG" >&5
$as_echo "$SDLCONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$SDLCONFIG" && break
done
if test ! "x$SDLCONFIG" = "x" ; then
SDL_CFLAGS=`$SDLCONFIG --cflags`
SDL_LIBS=`$SDLCONFIG --libs`
else
as_fn_error $? "sdl is required to build desmume" "$LINENO" 5
fi
for ac_header in GL/gl.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default"
if test "x$ac_cv_header_GL_gl_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GL_GL_H 1
_ACEOF
for ac_header in GL/glu.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "GL/glu.h" "ac_cv_header_GL_glu_h" "$ac_includes_default"
if test "x$ac_cv_header_GL_glu_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GL_GLU_H 1
_ACEOF
have_gl_h=yes LIBS="$LIBS -lGLU"
else
have_gl_h=no
fi
done
else
have_gl_h=no
fi
done
if test "have_gl_h" = "no" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building without GL support because of missing headers." >&5
$as_echo "$as_me: WARNING: Building without GL support because of missing headers." >&2;}
fi
if test "${have_gl_h}" = "yes"; then
HAVE_GL_TRUE=
HAVE_GL_FALSE='#'
else
HAVE_GL_TRUE='#'
HAVE_GL_FALSE=
fi
# Check whether --enable-osmesa was given.
if test "${enable_osmesa+set}" = set; then :
enableval=$enable_osmesa; osmesa=$enableval
else
osmesa=yes
fi
if test "x$osmesa" = "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldl" >&5
$as_echo_n "checking for main in -ldl... " >&6; }
if ${ac_cv_lib_dl_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_main=yes
else
ac_cv_lib_dl_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_main" >&5
$as_echo "$ac_cv_lib_dl_main" >&6; }
if test "x$ac_cv_lib_dl_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBDL 1
_ACEOF
LIBS="-ldl $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5
$as_echo_n "checking for main in -lGL... " >&6; }
if ${ac_cv_lib_GL_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lGL $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_GL_main=yes
else
ac_cv_lib_GL_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5
$as_echo "$ac_cv_lib_GL_main" >&6; }
if test "x$ac_cv_lib_GL_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGL 1
_ACEOF
LIBS="-lGL $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lOSMesa" >&5
$as_echo_n "checking for main in -lOSMesa... " >&6; }
if ${ac_cv_lib_OSMesa_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lOSMesa $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_OSMesa_main=yes
else
ac_cv_lib_OSMesa_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OSMesa_main" >&5
$as_echo "$ac_cv_lib_OSMesa_main" >&6; }
if test "x$ac_cv_lib_OSMesa_main" = xyes; then :
useosmesa=yes
$as_echo "#define HAVE_LIBOSMESA 1" >>confdefs.h
OSMESA_LIBS="-lOSMesa"
fi
fi
if test "${useosmesa}" = "yes"; then
HAVE_LIBOSMESA_TRUE=
HAVE_LIBOSMESA_FALSE='#'
else
HAVE_LIBOSMESA_TRUE='#'
HAVE_LIBOSMESA_FALSE=
fi
# Check whether --enable-hud was given.
if test "${enable_hud+set}" = set; then :
enableval=$enable_hud; libagg=yes
fi
# Check whether --enable-macosxhack was given.
if test "${enable_macosxhack+set}" = set; then :
enableval=$enable_macosxhack; GTK_MACOSX_HACK=yes
fi
HAVE_OPENAL=no
# Check whether --enable-openal was given.
if test "${enable_openal+set}" = set; then :
enableval=$enable_openal; openal=yes
fi
if test "x$openal" = "xyes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lopenal" >&5
$as_echo_n "checking for main in -lopenal... " >&6; }
if ${ac_cv_lib_openal_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lopenal $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_openal_main=yes
else
ac_cv_lib_openal_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openal_main" >&5
$as_echo "$ac_cv_lib_openal_main" >&6; }
if test "x$ac_cv_lib_openal_main" = xyes; then :
HAVE_OPENAL=yes
LIBS="$LIBS -lopenal"
fi
fi
if test "${HAVE_OPENAL}" = "yes"; then
HAVE_OPENAL_TRUE=
HAVE_OPENAL_FALSE='#'
else
HAVE_OPENAL_TRUE='#'
HAVE_OPENAL_FALSE=
fi
FOUND_GLIB=no
HAVE_ALSA=no
GLIB_VER=2.8
GTK_VER=2.14
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5
$as_echo_n "checking for GLIB... " >&6; }
if test -n "$GLIB_CFLAGS"; then
pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_VER\""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_VER") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= $GLIB_VER" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GLIB_LIBS"; then
pkg_cv_GLIB_LIBS="$GLIB_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= \$GLIB_VER\""; } >&5
($PKG_CONFIG --exists --print-errors "glib-2.0 >= $GLIB_VER") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= $GLIB_VER" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= $GLIB_VER" 2>&1`
else
GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= $GLIB_VER" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GLIB_PKG_ERRORS" >&5
FOUND_GLIB=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
FOUND_GLIB=no
else
GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
GLIB_LIBS=$pkg_cv_GLIB_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FOUND_GLIB=yes
fi
if test "x$FOUND_GLIB" = "xno"; then
if test ! "x$GTK_MACOSX_HACK" = "xyes"; then
as_fn_error $? "Glib is required to build desmume" "$LINENO" 5
fi
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5
$as_echo_n "checking for GTK... " >&6; }
if test -n "$GTK_CFLAGS"; then
pkg_cv_GTK_CFLAGS="$GTK_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_VER\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_VER") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK_VER" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GTK_LIBS"; then
pkg_cv_GTK_LIBS="$GTK_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_VER\""; } >&5
($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_VER") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= $GTK_VER" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= $GTK_VER" 2>&1`
else
GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= $GTK_VER" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GTK_PKG_ERRORS" >&5
HAVE_GTK=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_GTK=no
else
GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
GTK_LIBS=$pkg_cv_GTK_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_GTK=yes
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTHREAD" >&5
$as_echo_n "checking for GTHREAD... " >&6; }
if test -n "$GTHREAD_CFLAGS"; then
pkg_cv_GTHREAD_CFLAGS="$GTHREAD_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"gthread-2.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""gthread-2.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTHREAD_CFLAGS=`$PKG_CONFIG --cflags ""gthread-2.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GTHREAD_LIBS"; then
pkg_cv_GTHREAD_LIBS="$GTHREAD_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"gthread-2.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""gthread-2.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTHREAD_LIBS=`$PKG_CONFIG --libs ""gthread-2.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GTHREAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""gthread-2.0"" 2>&1`
else
GTHREAD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""gthread-2.0"" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GTHREAD_PKG_ERRORS" >&5
HAVE_GTHREAD=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_GTHREAD=no
else
GTHREAD_CFLAGS=$pkg_cv_GTHREAD_CFLAGS
GTHREAD_LIBS=$pkg_cv_GTHREAD_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_GTHREAD=yes
fi
# Check whether --enable-glade was given.
if test "${enable_glade+set}" = set; then :
enableval=$enable_glade; glade=$enableval
else
glade=yes
fi
if test "x$glade" = "xyes" ; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGLADE" >&5
$as_echo_n "checking for LIBGLADE... " >&6; }
if test -n "$LIBGLADE_CFLAGS"; then
pkg_cv_LIBGLADE_CFLAGS="$LIBGLADE_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"libglade-2.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""libglade-2.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBGLADE_CFLAGS=`$PKG_CONFIG --cflags ""libglade-2.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBGLADE_LIBS"; then
pkg_cv_LIBGLADE_LIBS="$LIBGLADE_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"libglade-2.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""libglade-2.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBGLADE_LIBS=`$PKG_CONFIG --libs ""libglade-2.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBGLADE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""libglade-2.0"" 2>&1`
else
LIBGLADE_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""libglade-2.0"" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBGLADE_PKG_ERRORS" >&5
HAVE_LIBGLADE=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_LIBGLADE=no
else
LIBGLADE_CFLAGS=$pkg_cv_LIBGLADE_CFLAGS
LIBGLADE_LIBS=$pkg_cv_LIBGLADE_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_LIBGLADE=yes
fi
cat >>confdefs.h <<_ACEOF
#define GLADEUI_UNINSTALLED_DIR "`pwd`/src/gtk-glade/glade/"
_ACEOF
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTKGLEXT" >&5
$as_echo_n "checking for GTKGLEXT... " >&6; }
if test -n "$GTKGLEXT_CFLAGS"; then
pkg_cv_GTKGLEXT_CFLAGS="$GTKGLEXT_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"gtkglext-1.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""gtkglext-1.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTKGLEXT_CFLAGS=`$PKG_CONFIG --cflags ""gtkglext-1.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$GTKGLEXT_LIBS"; then
pkg_cv_GTKGLEXT_LIBS="$GTKGLEXT_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"gtkglext-1.0\"\""; } >&5
($PKG_CONFIG --exists --print-errors ""gtkglext-1.0"") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_GTKGLEXT_LIBS=`$PKG_CONFIG --libs ""gtkglext-1.0"" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""gtkglext-1.0"" 2>&1`
else
GTKGLEXT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""gtkglext-1.0"" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$GTKGLEXT_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (\"gtkglext-1.0\") were not met:
$GTKGLEXT_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GTKGLEXT_CFLAGS
and GTKGLEXT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details." "$LINENO" 5
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables GTKGLEXT_CFLAGS
and GTKGLEXT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see .
See \`config.log' for more details" "$LINENO" 5; }
else
GTKGLEXT_CFLAGS=$pkg_cv_GTKGLEXT_CFLAGS
GTKGLEXT_LIBS=$pkg_cv_GTKGLEXT_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
$as_echo "#define GTKGLEXT_AVAILABLE 1" >>confdefs.h
fi
fi
# Extract the first word of "update-desktop-database", so it can be a program name with args.
set dummy update-desktop-database; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_UPDATEDESKTOP+:} false; then :
$as_echo_n "(cached) " >&6
else
case $UPDATEDESKTOP in
[\\/]* | ?:[\\/]*)
ac_cv_path_UPDATEDESKTOP="$UPDATEDESKTOP" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_UPDATEDESKTOP="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
UPDATEDESKTOP=$ac_cv_path_UPDATEDESKTOP
if test -n "$UPDATEDESKTOP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UPDATEDESKTOP" >&5
$as_echo "$UPDATEDESKTOP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Need check for both lua and lua5.1 to run on debian, see mysql bug #29945
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
$as_echo_n "checking for LUA... " >&6; }
if test -n "$LUA_CFLAGS"; then
pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua >= 5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "lua >= 5.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua >= 5.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LUA_LIBS"; then
pkg_cv_LUA_LIBS="$LUA_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua >= 5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "lua >= 5.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua >= 5.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua >= 5.1" 2>&1`
else
LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua >= 5.1" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LUA_PKG_ERRORS" >&5
HAVE_LUA=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_LUA=no
else
LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
LUA_LIBS=$pkg_cv_LUA_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_LUA=yes
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
$as_echo_n "checking for LUA... " >&6; }
if test -n "$LUA_CFLAGS"; then
pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= 5.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LUA_LIBS"; then
pkg_cv_LUA_LIBS="$LUA_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= 5.1\""; } >&5
($PKG_CONFIG --exists --print-errors "lua5.1 >= 5.1") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.1 >= 5.1" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
else
LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.1 >= 5.1" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LUA_PKG_ERRORS" >&5
HAVE_LUA=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_LUA=no
else
LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
LUA_LIBS=$pkg_cv_LUA_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_LUA=yes
fi
if test "${HAVE_LUA}x" = "yes"; then
HAVE_LUA_TRUE=
HAVE_LUA_FALSE='#'
else
HAVE_LUA_TRUE='#'
HAVE_LUA_FALSE=
fi
if test ! "x$HAVE_OPENAL" = "xyes" ; then
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA" >&5
$as_echo_n "checking for ALSA... " >&6; }
if test -n "$ALSA_CFLAGS"; then
pkg_cv_ALSA_CFLAGS="$ALSA_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa >= 1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "alsa >= 1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa >= 1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$ALSA_LIBS"; then
pkg_cv_ALSA_LIBS="$ALSA_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa >= 1.0\""; } >&5
($PKG_CONFIG --exists --print-errors "alsa >= 1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_ALSA_LIBS=`$PKG_CONFIG --libs "alsa >= 1.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
ALSA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "alsa >= 1.0" 2>&1`
else
ALSA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "alsa >= 1.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$ALSA_PKG_ERRORS" >&5
HAVE_ALSA=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_ALSA=no
else
ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS
ALSA_LIBS=$pkg_cv_ALSA_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_ALSA=yes
fi
fi
if test "${HAVE_ALSA}" = "yes"; then
HAVE_ALSA_TRUE=
HAVE_ALSA_FALSE='#'
else
HAVE_ALSA_TRUE='#'
HAVE_ALSA_FALSE=
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBAGG" >&5
$as_echo_n "checking for LIBAGG... " >&6; }
if test -n "$LIBAGG_CFLAGS"; then
pkg_cv_LIBAGG_CFLAGS="$LIBAGG_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libagg >= 2.5.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libagg >= 2.5.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBAGG_CFLAGS=`$PKG_CONFIG --cflags "libagg >= 2.5.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBAGG_LIBS"; then
pkg_cv_LIBAGG_LIBS="$LIBAGG_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libagg >= 2.5.0\""; } >&5
($PKG_CONFIG --exists --print-errors "libagg >= 2.5.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBAGG_LIBS=`$PKG_CONFIG --libs "libagg >= 2.5.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBAGG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libagg >= 2.5.0" 2>&1`
else
LIBAGG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libagg >= 2.5.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBAGG_PKG_ERRORS" >&5
FOUND_LIBAGG=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
FOUND_LIBAGG=no
else
LIBAGG_CFLAGS=$pkg_cv_LIBAGG_CFLAGS
LIBAGG_LIBS=$pkg_cv_LIBAGG_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FOUND_LIBAGG=yes
fi
if test "x$libagg" = "xyes" -a "${FOUND_LIBAGG}" = "yes"; then
HAVE_LIBAGG_TRUE=
HAVE_LIBAGG_FALSE='#'
else
HAVE_LIBAGG_TRUE='#'
HAVE_LIBAGG_FALSE=
fi
if test "x$libagg" = "xyes" ; then
if test "x$FOUND_LIBAGG" = "xyes" ; then
$as_echo "#define HAVE_LIBAGG 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: HUD rendering enabled, but libagg not found" >&5
$as_echo "$as_me: WARNING: HUD rendering enabled, but libagg not found" >&2;}
fi
fi
pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSOUNDTOUCH" >&5
$as_echo_n "checking for LIBSOUNDTOUCH... " >&6; }
if test -n "$LIBSOUNDTOUCH_CFLAGS"; then
pkg_cv_LIBSOUNDTOUCH_CFLAGS="$LIBSOUNDTOUCH_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"soundtouch >= 1.5.0\""; } >&5
($PKG_CONFIG --exists --print-errors "soundtouch >= 1.5.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSOUNDTOUCH_CFLAGS=`$PKG_CONFIG --cflags "soundtouch >= 1.5.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBSOUNDTOUCH_LIBS"; then
pkg_cv_LIBSOUNDTOUCH_LIBS="$LIBSOUNDTOUCH_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"soundtouch >= 1.5.0\""; } >&5
($PKG_CONFIG --exists --print-errors "soundtouch >= 1.5.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBSOUNDTOUCH_LIBS=`$PKG_CONFIG --libs "soundtouch >= 1.5.0" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBSOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "soundtouch >= 1.5.0" 2>&1`
else
LIBSOUNDTOUCH_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "soundtouch >= 1.5.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBSOUNDTOUCH_PKG_ERRORS" >&5
HAVE_LIBSOUNDTOUCH=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
HAVE_LIBSOUNDTOUCH=no
else
LIBSOUNDTOUCH_CFLAGS=$pkg_cv_LIBSOUNDTOUCH_CFLAGS
LIBSOUNDTOUCH_LIBS=$pkg_cv_LIBSOUNDTOUCH_LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
HAVE_LIBSOUNDTOUCH=yes
fi
if test "${HAVE_LIBSOUNDTOUCH}" = "yes"; then
HAVE_LIBSOUNDTOUCH_TRUE=
HAVE_LIBSOUNDTOUCH_FALSE='#'
else
HAVE_LIBSOUNDTOUCH_TRUE='#'
HAVE_LIBSOUNDTOUCH_FALSE=
fi
if test "x$HAVE_LIBSOUNDTOUCH" = "xyes"; then
$as_echo "#define HAVE_LIBSOUNDTOUCH 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SoundTouch library not found, pcsx2 resampler will be disabled" >&5
$as_echo "$as_me: WARNING: SoundTouch library not found, pcsx2 resampler will be disabled" >&2;}
fi
if test "x$HAVE_ALSA" = "xno"; then
if test "x$HAVE_OPENAL" = "xno"; then
$as_echo "#define FAKE_MIC 1" >>confdefs.h
fi
fi
# Check whether --enable-wxwidgets was given.
if test "${enable_wxwidgets+set}" = set; then :
enableval=$enable_wxwidgets; wxwidgets=$enableval
else
wxwidgets=no
fi
if test "x$wxwidgets" = "xyes" ; then
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
if test "$cross_compiling" = "yes"; then
wx_config_args="$wx_config_args --host=$host_alias"
fi
if test -x "$WX_CONFIG_NAME" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wx-config" >&5
$as_echo_n "checking for wx-config... " >&6; }
WX_CONFIG_PATH="$WX_CONFIG_NAME"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5
$as_echo "$WX_CONFIG_PATH" >&6; }
else
# Extract the first word of "$WX_CONFIG_NAME", so it can be a program name with args.
set dummy $WX_CONFIG_NAME; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_WX_CONFIG_PATH+:} false; then :
$as_echo_n "(cached) " >&6
else
case $WX_CONFIG_PATH in
[\\/]* | ?:[\\/]*)
ac_cv_path_WX_CONFIG_PATH="$WX_CONFIG_PATH" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy=""$WX_LOOKUP_PATH:$PATH""
for as_dir in $as_dummy
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_WX_CONFIG_PATH="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_WX_CONFIG_PATH" && ac_cv_path_WX_CONFIG_PATH="no"
;;
esac
fi
WX_CONFIG_PATH=$ac_cv_path_WX_CONFIG_PATH
if test -n "$WX_CONFIG_PATH"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $WX_CONFIG_PATH" >&5
$as_echo "$WX_CONFIG_PATH" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
min_wx_version=2.4.0
if test -z "" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version" >&5
$as_echo_n "checking for wxWidgets version >= $min_wx_version... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets version >= $min_wx_version ()" >&5
$as_echo_n "checking for wxWidgets version >= $min_wx_version ()... " >&6; }
fi
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args "
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
wx_ver_ok=""
if test "x$WX_VERSION" != x ; then
if test $wx_config_major_version -gt $wx_requested_major_version; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $wx_requested_major_version; then
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
fi
if test -n "$wx_ver_ok"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (version $WX_VERSION)" >&5
$as_echo "yes (version $WX_VERSION)" >&6; }
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wxWidgets static library" >&5
$as_echo_n "checking for wxWidgets static library... " >&6; }
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
if test "x$WX_LIBS_STATIC" = "x"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
wx_has_rescomp=""
if test $wx_config_major_version -gt 2; then
wx_has_rescomp=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -ge 7; then
wx_has_rescomp=yes
fi
fi
fi
if test "x$wx_has_rescomp" = x ; then
WX_RESCOMP=
else
WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
fi
if test "x$wx_has_cppflags" = x ; then
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
wxwin=yes
else
if test "x$WX_VERSION" = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no (version $WX_VERSION is not new enough)" >&5
$as_echo "no (version $WX_VERSION is not new enough)" >&6; }
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
:
fi
else
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
:
fi
if test "x$wxwin" = "xyes"; then
$as_echo "#define WANT_WX 1" >>confdefs.h
fi
fi
if test "x$wxwidgets" = "xyes"; then
HAVE_WX_TRUE=
HAVE_WX_FALSE='#'
else
HAVE_WX_TRUE='#'
HAVE_WX_FALSE=
fi
PO_DIR=""
UI_DIR="cli $UI_DIR"
if test "x$HAVE_GTK" = "xyes"; then
UI_DIR="gtk $UI_DIR"
fi
if test "x$wxwin" = "xyes"; then
UI_DIR="wx $UI_DIR"
fi
if test "x$HAVE_LIBGLADE" = "xyes"; then
UI_DIR="gtk-glade $UI_DIR"
GETTEXT_PACKAGE=desmume
cat >>confdefs.h <<_ACEOF
#define GETTEXT_PACKAGE "$GETTEXT_PACKAGE"
_ACEOF
ALL_LINGUAS="fr nb pt_BR sv zh_CN zh_TW"
for ac_header in locale.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default"
if test "x$ac_cv_header_locale_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LOCALE_H 1
_ACEOF
fi
done
if test $ac_cv_header_locale_h = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
$as_echo_n "checking for LC_MESSAGES... " >&6; }
if ${am_cv_val_LC_MESSAGES+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
return LC_MESSAGES
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
am_cv_val_LC_MESSAGES=yes
else
am_cv_val_LC_MESSAGES=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5
$as_echo "$am_cv_val_LC_MESSAGES" >&6; }
if test $am_cv_val_LC_MESSAGES = yes; then
$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
fi
fi
USE_NLS=yes
gt_cv_have_gettext=no
CATOBJEXT=NONE
XGETTEXT=:
INTLLIBS=
ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
if test "x$ac_cv_header_libintl_h" = xyes; then :
gt_cv_func_dgettext_libintl="no"
libintl_extra_libs=""
#
# First check in libc
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in libc" >&5
$as_echo_n "checking for ngettext in libc... " >&6; }
if ${gt_cv_func_ngettext_libc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
return !ngettext ("","", 1)
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
gt_cv_func_ngettext_libc=yes
else
gt_cv_func_ngettext_libc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_ngettext_libc" >&5
$as_echo "$gt_cv_func_ngettext_libc" >&6; }
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in libc" >&5
$as_echo_n "checking for dgettext in libc... " >&6; }
if ${gt_cv_func_dgettext_libc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
return !dgettext ("","")
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
gt_cv_func_dgettext_libc=yes
else
gt_cv_func_dgettext_libc=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_dgettext_libc" >&5
$as_echo "$gt_cv_func_dgettext_libc" >&6; }
fi
if test "$gt_cv_func_ngettext_libc" = "yes" ; then
for ac_func in bind_textdomain_codeset
do :
ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
_ACEOF
fi
done
fi
#
# If we don't have everything we want, check in libintl
#
if test "$gt_cv_func_dgettext_libc" != "yes" \
|| test "$gt_cv_func_ngettext_libc" != "yes" \
|| test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5
$as_echo_n "checking for bindtextdomain in -lintl... " >&6; }
if ${ac_cv_lib_intl_bindtextdomain+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char bindtextdomain ();
int
main ()
{
return bindtextdomain ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_intl_bindtextdomain=yes
else
ac_cv_lib_intl_bindtextdomain=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5
$as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; }
if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
$as_echo_n "checking for ngettext in -lintl... " >&6; }
if ${ac_cv_lib_intl_ngettext+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ngettext ();
int
main ()
{
return ngettext ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_intl_ngettext=yes
else
ac_cv_lib_intl_ngettext=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
$as_echo "$ac_cv_lib_intl_ngettext" >&6; }
if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5
$as_echo_n "checking for dgettext in -lintl... " >&6; }
if ${ac_cv_lib_intl_dgettext+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dgettext ();
int
main ()
{
return dgettext ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_intl_dgettext=yes
else
ac_cv_lib_intl_dgettext=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5
$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
if test "x$ac_cv_lib_intl_dgettext" = xyes; then :
gt_cv_func_dgettext_libintl=yes
fi
fi
fi
if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -liconv is needed to use gettext" >&5
$as_echo_n "checking if -liconv is needed to use gettext... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
$as_echo "" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
$as_echo_n "checking for ngettext in -lintl... " >&6; }
if ${ac_cv_lib_intl_ngettext+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl -liconv $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ngettext ();
int
main ()
{
return ngettext ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_intl_ngettext=yes
else
ac_cv_lib_intl_ngettext=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
$as_echo "$ac_cv_lib_intl_ngettext" >&6; }
if test "x$ac_cv_lib_intl_ngettext" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dcgettext in -lintl" >&5
$as_echo_n "checking for dcgettext in -lintl... " >&6; }
if ${ac_cv_lib_intl_dcgettext+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lintl -liconv $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dcgettext ();
int
main ()
{
return dcgettext ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_intl_dcgettext=yes
else
ac_cv_lib_intl_dcgettext=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dcgettext" >&5
$as_echo "$ac_cv_lib_intl_dcgettext" >&6; }
if test "x$ac_cv_lib_intl_dcgettext" = xyes; then :
gt_cv_func_dgettext_libintl=yes
libintl_extra_libs=-liconv
else
:
fi
else
:
fi
fi
#
# If we found libintl, then check in it for bind_textdomain_codeset();
# we'll prefer libc if neither have bind_textdomain_codeset(),
# and both have dgettext and ngettext
#
if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
glib_save_LIBS="$LIBS"
LIBS="$LIBS -lintl $libintl_extra_libs"
unset ac_cv_func_bind_textdomain_codeset
for ac_func in bind_textdomain_codeset
do :
ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
_ACEOF
fi
done
LIBS="$glib_save_LIBS"
if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
gt_cv_func_dgettext_libc=no
else
if test "$gt_cv_func_dgettext_libc" = "yes" \
&& test "$gt_cv_func_ngettext_libc" = "yes"; then
gt_cv_func_dgettext_libintl=no
fi
fi
fi
fi
if test "$gt_cv_func_dgettext_libc" = "yes" \
|| test "$gt_cv_func_dgettext_libintl" = "yes"; then
gt_cv_have_gettext=yes
fi
if test "$gt_cv_func_dgettext_libintl" = "yes"; then
INTLLIBS="-lintl $libintl_extra_libs"
fi
if test "$gt_cv_have_gettext" = "yes"; then
$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_MSGFMT+:} false; then :
$as_echo_n "(cached) " >&6
else
case "$MSGFMT" in
/*)
ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then
ac_cv_path_MSGFMT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no"
;;
esac
fi
MSGFMT="$ac_cv_path_MSGFMT"
if test "$MSGFMT" != "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
$as_echo "$MSGFMT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$MSGFMT" != "no"; then
glib_save_LIBS="$LIBS"
LIBS="$LIBS $INTLLIBS"
for ac_func in dcgettext
do :
ac_fn_c_check_func "$LINENO" "dcgettext" "ac_cv_func_dcgettext"
if test "x$ac_cv_func_dcgettext" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DCGETTEXT 1
_ACEOF
fi
done
MSGFMT_OPTS=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if msgfmt accepts -c" >&5
$as_echo_n "checking if msgfmt accepts -c... " >&6; }
cat >conftest.foo <<_ACEOF
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: test 1.0\n"
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
"Last-Translator: test \n"
"Language-Team: C \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
_ACEOF
if { { $as_echo "$as_me:${as_lineno-$LINENO}: \$MSGFMT -c -o /dev/null conftest.foo"; } >&5
($MSGFMT -c -o /dev/null conftest.foo) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
MSGFMT_OPTS=-c; { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
echo "$as_me: failed input was:" >&5
sed 's/^/| /' conftest.foo >&5
fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GMSGFMT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GMSGFMT in
[\\/]* | ?:[\\/]*)
ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
;;
esac
fi
GMSGFMT=$ac_cv_path_GMSGFMT
if test -n "$GMSGFMT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
$as_echo "$GMSGFMT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_XGETTEXT+:} false; then :
$as_echo_n "(cached) " >&6
else
case "$XGETTEXT" in
/*)
ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
;;
esac
fi
XGETTEXT="$ac_cv_path_XGETTEXT"
if test "$XGETTEXT" != ":"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
$as_echo "$XGETTEXT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
CATOBJEXT=.gmo
DATADIRNAME=share
else
case $host in
*-*-solaris*)
ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset"
if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
CATOBJEXT=.gmo
DATADIRNAME=share
else
CATOBJEXT=.mo
DATADIRNAME=lib
fi
;;
*-*-openbsd*)
CATOBJEXT=.mo
DATADIRNAME=share
;;
*)
CATOBJEXT=.mo
DATADIRNAME=lib
;;
esac
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS="$glib_save_LIBS"
INSTOBJEXT=.mo
else
gt_cv_have_gettext=no
fi
fi
fi
if test "$gt_cv_have_gettext" = "yes" ; then
$as_echo "#define ENABLE_NLS 1" >>confdefs.h
fi
if test "$XGETTEXT" != ":"; then
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5
$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; }
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
ac_config_commands="$ac_config_commands default-1"
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
if test "$gt_cv_have_gettext" = "yes"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5
$as_echo_n "checking for catalogs to be installed... " >&6; }
NEW_LINGUAS=
for presentlang in $ALL_LINGUAS; do
useit=no
if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
desiredlanguages="$LINGUAS"
else
desiredlanguages="$ALL_LINGUAS"
fi
for desiredlang in $desiredlanguages; do
# Use the presentlang catalog if desiredlang is
# a. equal to presentlang, or
# b. a variant of presentlang (because in this case,
# presentlang can be used as a fallback for messages
# which are not translated in the desiredlang catalog).
case "$desiredlang" in
"$presentlang"*) useit=yes;;
esac
done
if test $useit = yes; then
NEW_LINGUAS="$NEW_LINGUAS $presentlang"
fi
done
LINGUAS=$NEW_LINGUAS
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5
$as_echo "$LINGUAS" >&6; }
fi
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
MKINSTALLDIRS=
if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z "$MKINSTALLDIRS"; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
rm -f po/POTFILES
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
PO_DIR="po"
PO_MAKEFILE="po/Makefile.in"
fi
# Check whether --enable-wifi was given.
if test "${enable_wifi+set}" = set; then :
enableval=$enable_wifi;
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpcap" >&5
$as_echo_n "checking for main in -lpcap... " >&6; }
if ${ac_cv_lib_pcap_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpcap $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pcap_main=yes
else
ac_cv_lib_pcap_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_main" >&5
$as_echo "$ac_cv_lib_pcap_main" >&6; }
if test "x$ac_cv_lib_pcap_main" = xyes; then :
$as_echo "#define EXPERIMENTAL_WIFI_COMM 1" >>confdefs.h
LIBS="$LIBS -lpcap"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pcap library not found, wifi will not work" >&5
$as_echo "$as_me: WARNING: pcap library not found, wifi will not work" >&2;}
fi
fi
case $host in
*mingw*)
LIBS="$LIBS -ldxguid -ldxerr8 -ldsound -lopengl32 -lws2_32 -mwindows"
UI_DIR="windows"
;;
*darwin*)
if test "x$GTK_MACOSX_HACK" = "xyes" ; then
LIBS="$LIBS -framework Gtk -framework GLib"
CPPFLAGS="$CPPFLAGS -I/Library/Frameworks/Cairo.framework/Headers -I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/GLib.framework/Headers"
GLIB_LIBS=""
fi
$as_echo "#define HAVE_OPENAL 1" >>confdefs.h
LIBS="$LIBS -framework OpenGL -framework OpenAL"
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/OpenAL.framework/Headers"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
$as_echo_n "checking for X... " >&6; }
# Check whether --with-x was given.
if test "${with_x+set}" = set; then :
withval=$with_x;
fi
# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
if test "x$with_x" = xno; then
# The user explicitly disabled X.
have_x=disabled
else
case $x_includes,$x_libraries in #(
*\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
*,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
$as_echo_n "(cached) " >&6
else
# One or both of the vars are not set, and there is no cached value.
ac_x_includes=no ac_x_libraries=no
rm -f -r conftest.dir
if mkdir conftest.dir; then
cd conftest.dir
cat >Imakefile <<'_ACEOF'
incroot:
@echo incroot='${INCROOT}'
usrlibdir:
@echo usrlibdir='${USRLIBDIR}'
libdir:
@echo libdir='${LIBDIR}'
_ACEOF
if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
for ac_var in incroot usrlibdir libdir; do
eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
done
# Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
for ac_extension in a so sl dylib la dll; do
if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
test -f "$ac_im_libdir/libX11.$ac_extension"; then
ac_im_usrlibdir=$ac_im_libdir; break
fi
done
# Screen out bogus values from the imake configuration. They are
# bogus both because they are the default anyway, and because
# using them would break gcc on systems where it needs fixed includes.
case $ac_im_incroot in
/usr/include) ac_x_includes= ;;
*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
esac
case $ac_im_usrlibdir in
/usr/lib | /usr/lib64 | /lib | /lib64) ;;
*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
esac
fi
cd ..
rm -f -r conftest.dir
fi
# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='
/usr/X11/include
/usr/X11R7/include
/usr/X11R6/include
/usr/X11R5/include
/usr/X11R4/include
/usr/include/X11
/usr/include/X11R7
/usr/include/X11R6
/usr/include/X11R5
/usr/include/X11R4
/usr/local/X11/include
/usr/local/X11R7/include
/usr/local/X11R6/include
/usr/local/X11R5/include
/usr/local/X11R4/include
/usr/local/include/X11
/usr/local/include/X11R7
/usr/local/include/X11R6
/usr/local/include/X11R5
/usr/local/include/X11R4
/usr/X386/include
/usr/x386/include
/usr/XFree86/include/X11
/usr/include
/usr/local/include
/usr/unsupported/include
/usr/athena/include
/usr/local/x11r5/include
/usr/lpp/Xamples/include
/usr/openwin/include
/usr/openwin/share/include'
if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Xlib.h.
# First, try using that file with no special directory specified.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# We can compile using X headers with no special include directory.
ac_x_includes=
else
for ac_dir in $ac_x_header_dirs; do
if test -r "$ac_dir/X11/Xlib.h"; then
ac_x_includes=$ac_dir
break
fi
done
fi
rm -f conftest.err conftest.i conftest.$ac_ext
fi # $ac_x_includes = no
if test "$ac_x_libraries" = no; then
# Check for the libraries.
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
LIBS="-lX11 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
XrmInitialize ()
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
LIBS=$ac_save_LIBS
# We can link X programs with no special library path.
ac_x_libraries=
else
LIBS=$ac_save_LIBS
for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
do
# Don't even attempt the hair of trying to link an X program!
for ac_extension in a so sl dylib la dll; do
if test -r "$ac_dir/libX11.$ac_extension"; then
ac_x_libraries=$ac_dir
break 2
fi
done
done
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi # $ac_x_libraries = no
case $ac_x_includes,$ac_x_libraries in #(
no,* | *,no | *\'*)
# Didn't find X, or a directory has "'" in its name.
ac_cv_have_x="have_x=no";; #(
*)
# Record where we found X for the cache.
ac_cv_have_x="have_x=yes\
ac_x_includes='$ac_x_includes'\
ac_x_libraries='$ac_x_libraries'"
esac
fi
;; #(
*) have_x=yes;;
esac
eval "$ac_cv_have_x"
fi # $with_x != no
if test "$have_x" != yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
$as_echo "$have_x" >&6; }
no_x=yes
else
# If each of the values was on the command line, it overrides each guess.
test "x$x_includes" = xNONE && x_includes=$ac_x_includes
test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
# Update the cache value to reflect the command line values.
ac_cv_have_x="have_x=yes\
ac_x_includes='$x_includes'\
ac_x_libraries='$x_libraries'"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
fi
if test "$no_x" = yes; then
# Not all programs may use this symbol, but it does not hurt to define it.
$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
else
if test -n "$x_includes"; then
X_CFLAGS="$X_CFLAGS -I$x_includes"
fi
# It would also be nice to do this for all -L options, not just this one.
if test -n "$x_libraries"; then
X_LIBS="$X_LIBS -L$x_libraries"
# For Solaris; some versions of Sun CC require a space after -R and
# others require no space. Words are not sufficient . . . .
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
$as_echo_n "checking whether -R must be followed by a space... " >&6; }
ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
ac_xsave_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
X_LIBS="$X_LIBS -R$x_libraries"
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
X_LIBS="$X_LIBS -R $x_libraries"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
$as_echo "neither works" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_c_werror_flag=$ac_xsave_c_werror_flag
LIBS=$ac_xsave_LIBS
fi
# Check for system-dependent libraries X programs must link with.
# Do this before checking for the system-independent R6 libraries
# (-lICE), since we may need -lsocket or whatever for X linking.
if test "$ISC" = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
else
# Martyn Johnson says this is needed for Ultrix, if the X
# libraries were built with DECnet support. And Karl Berry says
# the Alpha needs dnet_stub (dnet does not exist).
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char XOpenDisplay ();
int
main ()
{
return XOpenDisplay ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dnet_ntoa ();
int
main ()
{
return dnet_ntoa ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dnet_dnet_ntoa=yes
else
ac_cv_lib_dnet_dnet_ntoa=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldnet_stub $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dnet_ntoa ();
int
main ()
{
return dnet_ntoa ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dnet_stub_dnet_ntoa=yes
else
ac_cv_lib_dnet_stub_dnet_ntoa=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
fi
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS="$ac_xsave_LIBS"
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
# to get the SysV transport functions.
# Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
# needs -lnsl.
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to T.E. Dickey.
# The functions gethostbyname, getservbyname, and inet_addr are
# in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
if test "x$ac_cv_func_gethostbyname" = xyes; then :
fi
if test $ac_cv_func_gethostbyname = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_nsl_gethostbyname=yes
else
ac_cv_lib_nsl_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
fi
if test $ac_cv_lib_nsl_gethostbyname = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lbsd $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gethostbyname ();
int
main ()
{
return gethostbyname ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_bsd_gethostbyname=yes
else
ac_cv_lib_bsd_gethostbyname=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
fi
fi
fi
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT
# 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
# on later versions), says Simon Leinen: it contains gethostby*
# variants that don't use the name server (or something). -lsocket
# must be given before -lnsl if both are needed. We assume that
# if connect needs -lnsl, so does gethostbyname.
ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
if test "x$ac_cv_func_connect" = xyes; then :
fi
if test $ac_cv_func_connect = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
$as_echo_n "checking for connect in -lsocket... " >&6; }
if ${ac_cv_lib_socket_connect+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char connect ();
int
main ()
{
return connect ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_socket_connect=yes
else
ac_cv_lib_socket_connect=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
$as_echo "$ac_cv_lib_socket_connect" >&6; }
if test "x$ac_cv_lib_socket_connect" = xyes; then :
X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
fi
fi
# Guillermo Gomez says -lposix is necessary on A/UX.
ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
if test "x$ac_cv_func_remove" = xyes; then :
fi
if test $ac_cv_func_remove = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
$as_echo_n "checking for remove in -lposix... " >&6; }
if ${ac_cv_lib_posix_remove+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lposix $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char remove ();
int
main ()
{
return remove ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_posix_remove=yes
else
ac_cv_lib_posix_remove=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
$as_echo "$ac_cv_lib_posix_remove" >&6; }
if test "x$ac_cv_lib_posix_remove" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
fi
fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
if test "x$ac_cv_func_shmat" = xyes; then :
fi
if test $ac_cv_func_shmat = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
$as_echo_n "checking for shmat in -lipc... " >&6; }
if ${ac_cv_lib_ipc_shmat+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lipc $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shmat ();
int
main ()
{
return shmat ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ipc_shmat=yes
else
ac_cv_lib_ipc_shmat=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
fi
fi
fi
# Check for libraries that X11R6 Xt/Xaw programs need.
ac_save_LDFLAGS=$LDFLAGS
test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
# check for ICE first), but we must link in the order -lSM -lICE or
# we get undefined symbols. So assume we have SM if we have ICE.
# These have to be linked with before -lX11, unlike the other
# libraries we check for below, so use a different variable.
# John Interrante, Karl Berry
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char IceConnectionNumber ();
int
main ()
{
return IceConnectionNumber ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_ICE_IceConnectionNumber=yes
else
ac_cv_lib_ICE_IceConnectionNumber=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
fi
LDFLAGS=$ac_save_LDFLAGS
fi
;;
esac
# Check whether --enable-gdb-stub was given.
if test "${enable_gdb_stub+set}" = set; then :
enableval=$enable_gdb_stub;
$as_echo "#define GDB_STUB 1" >>confdefs.h
wantgdbstub=yes
fi
if test "${wantgdbstub}" = "yes"; then
HAVE_GDB_STUB_TRUE=
HAVE_GDB_STUB_FALSE='#'
else
HAVE_GDB_STUB_TRUE='#'
HAVE_GDB_STUB_FALSE=
fi
# for developer use, enable lots of compile warnings,
# but don't require this generally, because some system's
# header files (BSD) can't handle it
#
# NB: must add -Werror after AC_PROG_CC, etc., so do this last
# Check whether --enable-hardcore was given.
if test "${enable_hardcore+set}" = set; then :
enableval=$enable_hardcore; case "${enableval}" in
yes) ENABLE_HARDCORE=1 ;;
no) ENABLE_HARDCORE=0 ;;
*) as_fn_error $? "bad value ${enableval} for --enable-hardcore" "$LINENO" 5 ;; esac
else
ENABLE_HARDCORE=0
fi
if test "x$ENABLE_HARDCORE" = "x1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enable hardcore compile warnings" >&5
$as_echo "$as_me: WARNING: enable hardcore compile warnings" >&2;}
if test "x$CXX" = "x"; then
CPPFLAGS="$CPPFLAGS -Wmissing-prototypes"
fi
CPPFLAGS="$CPPFLAGS -Wall -Wextra -D_FORTIFY_SOURCE=2 -Wno-missing-field-initializers -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-unused-parameter -Wmissing-declarations -Wundef -Wmissing-noreturn -Wredundant-decls -Wformat-nonliteral -Wformat-security -Winit-self -Wno-reorder"
fi
# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; $as_echo "#define DEBUG 1" >>confdefs.h
fi
# Check whether --enable-gpu-debug was given.
if test "${enable_gpu_debug+set}" = set; then :
enableval=$enable_gpu_debug; $as_echo "#define GPUDEBUG 1" >>confdefs.h
fi
# Check whether --enable-div-debug was given.
if test "${enable_div_debug+set}" = set; then :
enableval=$enable_div_debug; $as_echo "#define DIVDEBUG 1" >>confdefs.h
fi
# Check whether --enable-sqrt-debug was given.
if test "${enable_sqrt_debug+set}" = set; then :
enableval=$enable_sqrt_debug; $as_echo "#define SQRTDEBUG 1" >>confdefs.h
fi
# Check whether --enable-dma-debug was given.
if test "${enable_dma_debug+set}" = set; then :
enableval=$enable_dma_debug; $as_echo "#define DMADEBUG 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
MAINT=$MAINTAINER_MODE_TRUE
ac_config_files="$ac_config_files Makefile ${PO_MAKEFILE} src/Makefile src/cli/Makefile src/cli/doc/Makefile src/gtk/Makefile src/gtk/doc/Makefile src/gtk-glade/Makefile src/gtk-glade/doc/Makefile src/wx/Makefile src/gdbstub/Makefile autopackage/default.apspec"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
:mline
/\\$/{
N
s,\\\n,,
b mline
}
t clear
:clear
s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
b any
:quote
s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
s/\[/\\&/g
s/\]/\\&/g
s/\$/$$/g
H
:any
${
g
s/^\n//
s/\n/ /g
p
}
'
DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
else
am__EXEEXT_TRUE='#'
am__EXEEXT_FALSE=
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
ac_config_commands="$ac_config_commands po/stamp-it"
if test -z "${HAVE_GL_TRUE}" && test -z "${HAVE_GL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_GL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBOSMESA_TRUE}" && test -z "${HAVE_LIBOSMESA_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBOSMESA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_OPENAL_TRUE}" && test -z "${HAVE_OPENAL_FALSE}"; then
as_fn_error $? "conditional \"HAVE_OPENAL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LUA_TRUE}" && test -z "${HAVE_LUA_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LUA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_ALSA_TRUE}" && test -z "${HAVE_ALSA_FALSE}"; then
as_fn_error $? "conditional \"HAVE_ALSA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBAGG_TRUE}" && test -z "${HAVE_LIBAGG_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBAGG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_LIBSOUNDTOUCH_TRUE}" && test -z "${HAVE_LIBSOUNDTOUCH_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LIBSOUNDTOUCH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_WX_TRUE}" && test -z "${HAVE_WX_FALSE}"; then
as_fn_error $? "conditional \"HAVE_WX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${HAVE_GDB_STUB_TRUE}" && test -z "${HAVE_GDB_STUB_FALSE}"; then
as_fn_error $? "conditional \"HAVE_GDB_STUB\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -p'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
else
as_ln_s='cp -p'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
if test -x / >/dev/null 2>&1; then
as_test_x='test -x'
else
if ls -dL / >/dev/null 2>&1; then
as_ls_L_option=L
else
as_ls_L_option=
fi
as_test_x='
eval sh -c '\''
if test -d "$1"; then
test -d "$1/.";
else
case $1 in #(
-*)set "./$1";;
esac;
case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
???[sx]*):;;*)false;;esac;fi
'\'' sh
'
fi
as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by desmume $as_me 0.9.8, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_commands="$ac_config_commands"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
Configuration commands:
$config_commands
Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
desmume config.status 0.9.8
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
Copyright (C) 2010 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"${PO_MAKEFILE}") CONFIG_FILES="$CONFIG_FILES ${PO_MAKEFILE}" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/cli/Makefile") CONFIG_FILES="$CONFIG_FILES src/cli/Makefile" ;;
"src/cli/doc/Makefile") CONFIG_FILES="$CONFIG_FILES src/cli/doc/Makefile" ;;
"src/gtk/Makefile") CONFIG_FILES="$CONFIG_FILES src/gtk/Makefile" ;;
"src/gtk/doc/Makefile") CONFIG_FILES="$CONFIG_FILES src/gtk/doc/Makefile" ;;
"src/gtk-glade/Makefile") CONFIG_FILES="$CONFIG_FILES src/gtk-glade/Makefile" ;;
"src/gtk-glade/doc/Makefile") CONFIG_FILES="$CONFIG_FILES src/gtk-glade/doc/Makefile" ;;
"src/wx/Makefile") CONFIG_FILES="$CONFIG_FILES src/wx/Makefile" ;;
"src/gdbstub/Makefile") CONFIG_FILES="$CONFIG_FILES src/gdbstub/Makefile" ;;
"autopackage/default.apspec") CONFIG_FILES="$CONFIG_FILES autopackage/default.apspec" ;;
"po/stamp-it") CONFIG_COMMANDS="$CONFIG_COMMANDS po/stamp-it" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS"
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
ac_MKDIR_P=$MKDIR_P
case $MKDIR_P in
[\\/$]* | ?:[\\/]* ) ;;
*/*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
X"$file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirpart/$fdir; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
;;
"default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*)
sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
esac ;;
"po/stamp-it":C)
if ! grep "^# INTLTOOL_MAKEFILE$" "po/Makefile.in" > /dev/null ; then
as_fn_error $? "po/Makefile.in.in was not created by intltoolize." "$LINENO" 5
fi
rm -f "po/stamp-it" "po/stamp-it.tmp" "po/POTFILES" "po/Makefile.tmp"
>"po/stamp-it.tmp"
sed '/^#/d
s/^[[].*] *//
/^[ ]*$/d
'"s|^| $ac_top_srcdir/|" \
"$srcdir/po/POTFILES.in" | sed '$!s/$/ \\/' >"po/POTFILES"
sed '/^POTFILES =/,/[^\\]$/ {
/^POTFILES =/!d
r po/POTFILES
}
' "po/Makefile.in" >"po/Makefile"
rm -f "po/Makefile.tmp"
mv "po/stamp-it.tmp" "po/stamp-it"
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
================================================
FILE: app/src/main/jni/desmume/configure.ac
================================================
dnl --- Package name is first argument to AC_INIT
dnl --- Release version is second argument to AC_INIT
AC_INIT(desmume, [0.9.8])
dnl -- find host architecture for some os specific libraries
AC_CANONICAL_HOST
case $host in
*linux*) desmume_arch=linux;;
*mingw*) desmume_arch=windows;;
*darwin*) desmume_arch=linux;;
*bsd*) desmume_arch=linux;;
esac
AC_SUBST(desmume_arch)
AM_INIT_AUTOMAKE([1.10])
dnl -- make sure we have a c++ compiler
AC_PROG_CXX
dnl -- use ranlib for libraries
AC_PROG_RANLIB
dnl -- check for endianess
AC_C_BIGENDIAN
# took this from geany, hope it works
REVISION="r0"
SVN=`which svn 2>/dev/null`
if test -d ".svn" -a "x${SVN}" != "x" -a -x "${SVN}" ; then
REVISION=r`$SVN info|grep 'Last Changed Rev'|cut -d' ' -f4`
fi
AC_DEFINE_UNQUOTED([SVN_REV], "$REVISION", [subversion revision number])
dnl --- Other prerequisites ---
dnl - Check for pkg-config macros
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG])
dnl - Check for intltool/gettext macros
m4_ifdef([IT_PROG_INTLTOOL],[IT_PROG_INTLTOOL])
AC_CHECK_TOOL(HAVE_PKG, pkg-config, [])
if test "xHAVE_PKG" = "x" ; then
AC_MSG_ERROR([pkg-config is required to build desmume])
fi
dnl - Check for zlib
AC_CHECK_LIB(z, gzopen, [], [AC_MSG_ERROR([zlib was not found, we can't go further. Please install it or specify the location where it's installed.])])
dnl - Check for zziplib
AC_CHECK_LIB(zzip, zzip_open, [
LIBS="-lzzip $LIBS"
AC_DEFINE([HAVE_LIBZZIP])
AC_MSG_CHECKING([[whether zzip use void * as second parameter]])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[
void * v;
zzip_read(NULL, v, 0);]])],
AC_MSG_RESULT(yes),
AC_DEFINE([ZZIP_OLD_READ])
AC_MSG_RESULT(no))
])
dnl - Check for SDL
AC_PATH_PROGS(SDLCONFIG, [sdl-config sdl11-config])
if test ! "x$SDLCONFIG" = "x" ; then
SDL_CFLAGS=`$SDLCONFIG --cflags`
SDL_LIBS=`$SDLCONFIG --libs`
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
else
AC_MSG_ERROR([sdl is required to build desmume])
fi
dnl - Check for the OpenGL includes
AC_CHECK_HEADERS([GL/gl.h],
[AC_CHECK_HEADERS([GL/glu.h], [have_gl_h=yes LIBS="$LIBS -lGLU"], [have_gl_h=no])],
[have_gl_h=no])
if test "have_gl_h" = "no" ; then
AC_MSG_WARN([Building without GL support because of missing headers.])
fi
AM_CONDITIONAL([HAVE_GL], [test "${have_gl_h}" = "yes"])
dnl - if --enable-osmesa is used, check for it
AC_ARG_ENABLE([osmesa],
[AC_HELP_STRING([--enable-osmesa], [use off-screen mesa])],
[osmesa=$enableval],
[osmesa=yes])
if test "x$osmesa" = "xyes" ; then
AC_CHECK_LIB(dl, main)
AC_CHECK_LIB([GL], main)
AC_CHECK_LIB(OSMesa, main,[
useosmesa=yes
AC_DEFINE(HAVE_LIBOSMESA)
OSMESA_LIBS="-lOSMesa"
AC_SUBST(OSMESA_LIBS)
])
fi
AM_CONDITIONAL([HAVE_LIBOSMESA], [test "${useosmesa}" = "yes"])
dnl - make the usage of libagg for HUD rendering configurable
AC_ARG_ENABLE([hud],
[AC_HELP_STRING([--enable-hud], [Enable HUD rendering, requires libagg])],
[libagg=yes])
dnl - hack to help zero build gtk frontend macos x package
AC_ARG_ENABLE(macosxhack,
[AC_HELP_STRING(--enable-macosxhack, hack to build MacOSX package)],
[GTK_MACOSX_HACK=yes])
HAVE_OPENAL=no
dnl - openal support
AC_ARG_ENABLE(openal,
[AC_HELP_STRING(--enable-openal, enable experimental OpenAL microphone input)],
[openal=yes])
if test "x$openal" = "xyes" ; then
AC_CHECK_LIB([openal], [main],[
HAVE_OPENAL=yes
LIBS="$LIBS -lopenal"
])
fi
AM_CONDITIONAL([HAVE_OPENAL], [test "${HAVE_OPENAL}" = "yes"])
dnl - Check for GTK and/or libglade
FOUND_GLIB=no
HAVE_ALSA=no
GLIB_VER=2.8
GTK_VER=2.14
PKG_CHECK_MODULES(GLIB,
glib-2.0 >= $GLIB_VER,
FOUND_GLIB=yes,
FOUND_GLIB=no)
if test "x$FOUND_GLIB" = "xno"; then
if test ! "x$GTK_MACOSX_HACK" = "xyes"; then
AC_MSG_ERROR([Glib is required to build desmume])
fi
fi
PKG_CHECK_MODULES(GTK,
gtk+-2.0 >= $GTK_VER,
HAVE_GTK=yes,
HAVE_GTK=no)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
PKG_CHECK_MODULES(GTHREAD,
"gthread-2.0",
HAVE_GTHREAD=yes,
HAVE_GTHREAD=no)
AC_SUBST(GTHREAD_CFLAGS)
AC_SUBST(GTHREAD_LIBS)
AC_ARG_ENABLE([glade],
[AC_HELP_STRING([--enable-glade], [enable glade frontend])],
[glade=$enableval],
[glade=yes])
if test "x$glade" = "xyes" ; then
PKG_CHECK_MODULES(LIBGLADE,
"libglade-2.0",
HAVE_LIBGLADE=yes,
HAVE_LIBGLADE=no)
AC_SUBST(LIBGLADE_CFLAGS)
AC_SUBST(LIBGLADE_LIBS)
dnl uninstalled glade ui dir
AC_DEFINE_UNQUOTED(GLADEUI_UNINSTALLED_DIR,"`pwd`/src/gtk-glade/glade/",[path to glade ui dir])
AC_SUBST(GLADEUI_UNINSTALLED_DIR)
PKG_CHECK_MODULES(GTKGLEXT,
"gtkglext-1.0",
AC_DEFINE([GTKGLEXT_AVAILABLE], [1])
[])
AC_SUBST(GTKGLEXT_CFLAGS)
AC_SUBST(GTKGLEXT_LIBS)
fi
AC_PATH_PROG(UPDATEDESKTOP, [update-desktop-database])
# Need check for both lua and lua5.1 to run on debian, see mysql bug #29945
PKG_CHECK_MODULES(LUA,
lua >= 5.1,
HAVE_LUA=yes,
HAVE_LUA=no)
PKG_CHECK_MODULES(LUA,
lua5.1 >= 5.1,
HAVE_LUA=yes,
HAVE_LUA=no)
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS)
dnl -- force lua disabled
AM_CONDITIONAL([HAVE_LUA], [test "${HAVE_LUA}x" = "yes"])
if test ! "x$HAVE_OPENAL" = "xyes" ; then
PKG_CHECK_MODULES(ALSA, alsa >= 1.0, HAVE_ALSA=yes, HAVE_ALSA=no)
AC_SUBST(ALSA_CFLAGS)
AC_SUBST(ALSA_LIBS)
fi
AM_CONDITIONAL([HAVE_ALSA], [test "${HAVE_ALSA}" = "yes"])
PKG_CHECK_MODULES(LIBAGG, libagg >= 2.5.0, FOUND_LIBAGG=yes, FOUND_LIBAGG=no)
AM_CONDITIONAL([HAVE_LIBAGG], [test "x$libagg" = "xyes" -a "${FOUND_LIBAGG}" = "yes"])
if test "x$libagg" = "xyes" ; then
if test "x$FOUND_LIBAGG" = "xyes" ; then
AC_SUBST(LIBAGG_CFLAGS)
AC_SUBST(LIBAGG_LIBS)
AC_DEFINE([HAVE_LIBAGG])
else
AC_MSG_WARN([HUD rendering enabled, but libagg not found])
fi
fi
PKG_CHECK_MODULES(LIBSOUNDTOUCH, soundtouch >= 1.5.0, HAVE_LIBSOUNDTOUCH=yes, HAVE_LIBSOUNDTOUCH=no)
AC_SUBST(LIBSOUNDTOUCH_CFLAGS)
AC_SUBST(LIBSOUNDTOUCH_LIBS)
AM_CONDITIONAL([HAVE_LIBSOUNDTOUCH], [test "${HAVE_LIBSOUNDTOUCH}" = "yes"])
if test "x$HAVE_LIBSOUNDTOUCH" = "xyes"; then
AC_DEFINE([HAVE_LIBSOUNDTOUCH])
else
AC_MSG_WARN([SoundTouch library not found, pcsx2 resampler will be disabled])
fi
if test "x$HAVE_ALSA" = "xno"; then
if test "x$HAVE_OPENAL" = "xno"; then
AC_DEFINE([FAKE_MIC])
fi
fi
dnl - Check for wxWidgets
dnl - if --enable-wxwidgets is used, check for it
AC_ARG_ENABLE([wxwidgets],
[AC_HELP_STRING([--enable-wxwidgets], [Enable cross platform wx widgets frontend])],
[wxwidgets=$enableval],
[wxwidgets=no])
if test "x$wxwidgets" = "xyes" ; then
m4_include(wxwin.m4)
AM_PATH_WXCONFIG([2.4.0], wxwin=yes)
if test "x$wxwin" = "xyes"; then
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_LIBS)
AC_DEFINE([WANT_WX])
fi
fi
AM_CONDITIONAL([HAVE_WX], [test "x$wxwidgets" = "xyes"])
dnl - Determine which UIs to build and if po/ should be included
PO_DIR=""
UI_DIR="cli $UI_DIR"
if test "x$HAVE_GTK" = "xyes"; then
UI_DIR="gtk $UI_DIR"
fi
if test "x$wxwin" = "xyes"; then
UI_DIR="wx $UI_DIR"
fi
if test "x$HAVE_LIBGLADE" = "xyes"; then
AC_PROVIDE_IFELSE([IT_PROG_INTLTOOL],[
UI_DIR="gtk-glade $UI_DIR"
dnl -- localization for gtk-glade UI
GETTEXT_PACKAGE=desmume
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the gettext package name])
AC_SUBST(GETTEXT_PACKAGE)
ALL_LINGUAS="fr nb pt_BR sv zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
PO_DIR="po"
PO_MAKEFILE="po/Makefile.in"
],[
echo "WARNING: intltool and/or gettext are not available therefore the gtk-glade interface won't be installed."
])
fi
dnl - wifi support
AC_ARG_ENABLE(wifi,
[AC_HELP_STRING(--enable-wifi, enable experimental wifi comm support)],
[
AC_CHECK_LIB(pcap, main,[
AC_DEFINE(EXPERIMENTAL_WIFI_COMM)
LIBS="$LIBS -lpcap"],
[AC_MSG_WARN([pcap library not found, wifi will not work])])
])
dnl Set compiler library flags per host architecture
case $host in
*mingw*)
LIBS="$LIBS -ldxguid -ldxerr8 -ldsound -lopengl32 -lws2_32 -mwindows"
UI_DIR="windows"
;;
*darwin*)
if test "x$GTK_MACOSX_HACK" = "xyes" ; then
LIBS="$LIBS -framework Gtk -framework GLib"
CPPFLAGS="$CPPFLAGS -I/Library/Frameworks/Cairo.framework/Headers -I/Library/Frameworks/Gtk.framework/Headers -I/Library/Frameworks/GLib.framework/Headers"
GLIB_LIBS=""
AC_SUBST(GLIB_LIBS)
fi
dnl - openal is required on mac os x and we are not able to figure out if it's installed or not
AC_DEFINE(HAVE_OPENAL)
LIBS="$LIBS -framework OpenGL -framework OpenAL"
CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/OpenAL.framework/Headers"
AC_SUBST(CPPFLAGS)
dnl - extra hackery needed for X includes
AC_PATH_XTRA
;;
esac
AC_SUBST(UI_DIR)
AC_SUBST(PO_DIR)
dnl - Gdb stub
AC_ARG_ENABLE(gdb-stub,
[AC_HELP_STRING(--enable-gdb-stub, enable gdb stub)],
[
AC_DEFINE(GDB_STUB)
wantgdbstub=yes
])
AM_CONDITIONAL([HAVE_GDB_STUB], [test "${wantgdbstub}" = "yes"])
dnl - Compiler warnings
# for developer use, enable lots of compile warnings,
# but don't require this generally, because some system's
# header files (BSD) can't handle it
#
# NB: must add -Werror after AC_PROG_CC, etc., so do this last
AC_ARG_ENABLE(hardcore,
[AC_HELP_STRING(--enable-hardcore, turn on -W -Wall -Werror)],
[case "${enableval}" in
yes) ENABLE_HARDCORE=1 ;;
no) ENABLE_HARDCORE=0 ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-hardcore) ;; esac],
[ENABLE_HARDCORE=0])
if test "x[$]ENABLE_HARDCORE" = "x1"; then
AC_MSG_WARN(enable hardcore compile warnings)
if test "x$CXX" = "x"; then
dnl - only valid for C with newer gcc's
CPPFLAGS="[$]CPPFLAGS -Wmissing-prototypes"
fi
dnl - -Wshadow
CPPFLAGS="[$]CPPFLAGS -Wall -Wextra -D_FORTIFY_SOURCE=2 -Wno-missing-field-initializers -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-unused-parameter -Wmissing-declarations -Wundef -Wmissing-noreturn -Wredundant-decls -Wformat-nonliteral -Wformat-security -Winit-self -Wno-reorder"
fi
dnl - Enable debug mode
AC_ARG_ENABLE(debug,
AC_HELP_STRING(--enable-debug, enable debug information),
AC_DEFINE(DEBUG))
AC_ARG_ENABLE(gpu-debug,
AC_HELP_STRING(--enable-gpu-debug, enable gpu debug information),
AC_DEFINE(GPUDEBUG))
AC_ARG_ENABLE(div-debug,
AC_HELP_STRING(--enable-div-debug, enable div debug information),
AC_DEFINE(DIVDEBUG))
AC_ARG_ENABLE(sqrt-debug,
AC_HELP_STRING(--enable-sqrt-debug, enable sqrt debug information),
AC_DEFINE(SQRTDEBUG))
AC_ARG_ENABLE(dma-debug,
AC_HELP_STRING(--enable-dma-debug, enable dma debug information),
AC_DEFINE(DMADEBUG))
dnl - Enable memory profiling (disabled)
dnl - AC_ARG_ENABLE(memory-profiling,
dnl - AC_HELP_STRING(--enable-memory-profiling, enable memory profiling information),
dnl - AC_DEFINE(PROFILE_MEMORY_ACCESS))
dnl -- set maintainer mode
AM_MAINTAINER_MODE
AC_SUBST(USE_MAINTAINER_MODE)
dnl --- Finally, output all the makefiles
AC_CONFIG_FILES([Makefile
${PO_MAKEFILE}
src/Makefile
src/cli/Makefile
src/cli/doc/Makefile
src/gtk/Makefile
src/gtk/doc/Makefile
src/gtk-glade/Makefile
src/gtk-glade/doc/Makefile
src/wx/Makefile
src/gdbstub/Makefile
autopackage/default.apspec
])
AC_OUTPUT
================================================
FILE: app/src/main/jni/desmume/depcomp
================================================
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2012-03-27.16; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# A tabulation character.
tab=' '
# A newline character.
nl='
'
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
# However on
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
# tcc 0.9.26 (FIXME still under development at the moment of writing)
# will emit a similar output, but also prepend the continuation lines
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h',
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
< "$tmpdepfile" > "$depfile"
sed '
s/[ '"$tab"'][ '"$tab"']*/ /g
s/^ *//
s/ *\\*$//
s/^[^:]*: *//
/^$/d
/:$/d
s/$/ :/
' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
================================================
FILE: app/src/main/jni/desmume/dsm.txt
================================================
DSM is ascii plain text. It is derived from the FCEUX FM2 format.
It consists of several key-value pairs followed by an inputlog section.
The inputlog section can be identified by its starting with a | (pipe).
The inputlog section terminates at eof.
Newlines may be \r\n or \n
Key-value pairs consist of a key identifier, followed by a space separator, followed by the value text.
Value text is always terminated by a newline, which the value text will not include.
The value text is parsed differently depending on the type of the key.
The key-value pairs may be in any order, except that the first key must be version.
Integer keys (also used for booleans, with a 1 or 0) will have a value that is a simple integer not to exceed 32bits
- version (required) - the version of the movie file format; for now it is always 3
- emuVersion (required) - the version of the emulator used to produce the movie
- rerecordCount (optional) - the rerecord count
- romChecksum (optional) - the CRC32 of the rom used to make the movie. should match values specified on advanscene.com
- romSerial (optional) - a concatenation of other uniquely identifying information about the rom (name,gamecode,makercode)
- useExtBios (optional) - were bios files was used? defaults to false.
- swiFromBios (optional) - were swi emulated by ExtBios? (alternative is internal HLE bios). defaults to false.
The rom identification information may be used at a later point to warn about mismatches between movies and roms, but is not right now.
String keys have values that consist of the remainder of the key-value pair line. As a consequence, string values cannot contain newlines.
- romFilename (required) - the name of the file used to record the movie
- comment (optional) - simply a memo.
by convention, the first token in the comment value is the subject of the comment.
by convention, subsequent comments with the same subject will have their ordering preserved and may be used to approximate multiline comments.
by convention, the author of the movie should be stored in comment(s) with a subject of: author
Hex string keys (used for binary blobs) will have a value that is like 0x0123456789ABCDEF...
- romChecksum (required) - this is currently unused.
GUID keys have a value which is in the standard guid format: 452DE2C3-EF43-2FA9-77AC-0677FC51543B
- guid (required) a unique identifier for a movie, generated when the movie is created, which is used when loading a savestate to make sure it belongs to the current movie.
The inputlog section consists of lines beginning and ending with a | (pipe).
The fields are as follows, except as noted in note C.
|c|.............XXX YYY Z|
'R','L','D','U','T','S','B','A','Y','X','W','E','G'
field c is a variable length decimal integer which is a bitfield corresponding to miscellaneous input states which are valid at the start of the frame.
Therefore, no miscellaneous commands is represented by a value of 0.
Here are the currently defined bit values:
0x01 - Microphone Noise (hardcoded noise sample; to be held through duration of frame)
0x02 - Reset
0x04 - Lid
the format of the main section is as follows:
the field begins with 13 characters which constitute a bitfield.
any character other than ' ' or '.' means that the button was pressed.
by convention, the following mnemonics will be used in a column to remind us of which button corresponds to which column:
RLDUTSBAYXWEG (Right,Left,Down,Up,sTart,Select,B,A,Y,X,lshoulder,rshoulder,debuG)
This ordering is based on FCEUX to a certain extent, and arbitrary after that.
W and E were chosen for shoulders to suggest West and East for Left and Right.
While the emulator supports a 'lid' button, and to some extent a 'blow' button, these are not supported in the movies.
XXX: %03d, the x position of the stylus (0,0 topleft, 255,191 bottomright)
YYY: %03d, the y position of the stylus
Z: %1d, 1 if the stylus is pressed pressed; 0 if not
Additional fields after this main section may be added later without breaking the file format.
* Notes *
A. There is no key-value pair that indicates the length of the movie. This must be read by scanning the inputlog and counting the number of lines.
B. All movies start from power-on.
C. The emulator uses these framerate constants
arm7_cycles_per_frame = 560190
frames_per_second = 59.8261
================================================
FILE: app/src/main/jni/desmume/dsv.txt
================================================
The desmume save file format is merely a raw save file with a FOOTER.
This was chosen in order to maximize compatibility with other emulators,
which tend load the savefile as-is and let the game read out of whatever range
it is expecting. To assist with this, before writing the save file, desmume
will pad the raw save file out to the next highest known length. Note that this
may sometimes be incorrect if the savefile hasnt been written through to the end
during initialization. This could cause other emulators to fail to recognize the
save file.
Additionally, the footer makes it easier to analyze save files, because the
game's data will be at the correct addresses starting at offset 0x0000.
The footer format can be identified by locating the 16Byte ascii string
"|-DESMUME SAVE-|"
at the end of the file. This corresponds with the following save structure:
struct Footer {
u32 actually_written_size;
u32 padded_size;
u32 save_type; //(not currently used)
u32 address_size; //address bus size
u32 save_size; //size parameter of the save type (not currently used)
u32 version_number; //should be 0
char cookie[16];
};
note that padded_size should be where you see the end of the raw save data
and the beginning of desmume-specific information, including some junk before
the actual footer.
actually_written_size is the highest address (plus one) written to by the game.
The new desmume savefile system tries to make as few decisions as possible,
which is the reason for the behavior of actually_written_size and the disuse
of save_type and save_size. If few decisions are made, then few mistakes can
be made. That is the idea, anyway. We'll make decisions later if we need to.
save_type and save_size are reserved in case we do.
================================================
FILE: app/src/main/jni/desmume/install-sh
================================================
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-01-19.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for `test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for `test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
================================================
FILE: app/src/main/jni/desmume/missing
================================================
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-01-06.13; # UTC
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
\`g' are ignored when checking the name.
Send bug reports to ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
================================================
FILE: app/src/main/jni/desmume/src/ArmAnalyze.cpp
================================================
/*
Copyright (C) 2008-2010 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#include "ArmAnalyze.h"
#include "armcpu.h"
#include "instructions.h"
#include "Disassembler.h"
#include
///////////////////////////////////////////////////////////////////////////////////////////////
typedef u32 (FASTCALL* OpDecoder)(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d);
#define TEMPLATE template
///////////////////////////////////////////////////////////////////////////////////////////////
#define DCL_UNDEF_OP(name) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
d->IROp = IR_UND;\
d->ExecuteCycles = 1;\
return 1;\
}
#define DCL_OP1_ARG4(name, op, arg1, arg2, arg3, arg4) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op(arg1, arg2, arg3, arg4)\
return 1;\
}
#define DCL_OP1_ARG5(name, op, arg1, arg2, arg3, arg4, arg5) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op(arg1, arg2, arg3, arg4, arg5)\
return 1;\
}
#define DCL_OP1_ARG6(name, op, arg1, arg2, arg3, arg4, arg5, arg6) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op(arg1, arg2, arg3, arg4, arg5, arg6)\
return 1;\
}
#define DCL_OP2_ARG1(name, op1, op2, arg) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op1\
op2(arg)\
return 1;\
}
#define DCL_OP2_ARG2(name, op1, op2, arg1, arg2) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op1\
op2(arg1, arg2)\
return 1;\
}
#define DCL_OP2_ARG4(name, op1, op2, arg1, arg2, arg3, arg4) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op1\
op2(arg1, arg2, arg3, arg4)\
return 1;\
}
#define DCL_OP2_ARG5(name, op1, op2, arg1, arg2, arg3, arg4, arg5) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op1\
op2(arg1, arg2, arg3, arg4, arg5)\
return 1;\
}
#define DCL_OP2_ARG6(name, op1, op2, arg1, arg2, arg3, arg4, arg5, arg6) \
TEMPLATE u32 FASTCALL name(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d) \
{\
op1\
op2(arg1, arg2, arg3, arg4, arg5, arg6)\
return 1;\
}
#define THUMB_REGPOS(i, n) (((i)>>n)&0x7)
#define ARM_REGPOS(i, n) (((i)>>n)&0xF)
#define LOAD_CPSR \
d->FlagsSet |= ALL_FLAGS;\
d->TbitModified = 1;\
d->Reschedule = 1;
///////////////////////////////////////////////////////////////////////////////////////////////
//------------------------------------------------------------
// THUMB
//------------------------------------------------------------
namespace ThumbOpDecoder
{
//-----------------------------------------------------------------------------
// Undefined instruction
//-----------------------------------------------------------------------------
DCL_UNDEF_OP(OP_UND_THUMB)
//-----------------------------------------------------------------------------
// LSL
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LSL_0(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_LSL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = (opcode.ThumbOp>>6) & 0x1F;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
if (!d->Immediate)
d->FlagsNeeded |= FLAG_C;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_LSL_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = d->Rd;
d->Rs = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->I = 0;
d->R = 1;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// LSR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LSR_0(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_LSR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = (opcode.ThumbOp>>6) & 0x1F;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_LSR_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = d->Rd;
d->Rs = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->I = 0;
d->R = 1;
d->Typ = IRSHIFT_LSR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// ASR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ASR_0(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_ASR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ASR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->Immediate = (opcode.ThumbOp>>6) & 0x1F;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_ASR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ASR_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = d->Rd;
d->Rs = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->I = 0;
d->R = 1;
d->Typ = IRSHIFT_ASR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// ADD
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ADD_IMM3(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = (opcode.ThumbOp >> 6) & 0x07;
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADD_IMM8(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Rn = d->Rd;
d->Immediate = (opcode.ThumbOp & 0xFF);
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADD_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADD_SPE(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = (THUMB_REGPOS(opcode.ThumbOp, 0) | ((opcode.ThumbOp>>4)&8));
d->Rn = d->Rd;
d->Rm = ARM_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 0;
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 1;
}
else
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADD_2PC(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Rn = 15;
d->Immediate = ((opcode.ThumbOp&0xFF)<<2);
d->I = 1;
d->S = 0;
d->ReadPCMask = 0xFFFFFFFC;
d->R15Modified = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADD_2SP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Rn = 13;
d->Immediate = ((opcode.ThumbOp&0xFF)<<2);
d->I = 1;
d->S = 0;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// SUB
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SUB_IMM3(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SUB;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = (opcode.ThumbOp >> 6) & 0x07;
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SUB_IMM8(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SUB;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Rn = d->Rd;
d->Immediate = (opcode.ThumbOp & 0xFF);
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SUB_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SUB;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// MOV
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MOV_IMM8(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Rn = 0;
d->Immediate = (opcode.ThumbOp & 0xFF);
d->I = 1;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MOV_SPE(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
if (opcode.ThumbOp == 0x46C0)
{
d->IROp = IR_NOP;
d->ExecuteCycles = 1;
return 1;
}
d->IROp = IR_MOV;
d->Rd = (THUMB_REGPOS(opcode.ThumbOp, 0) | ((opcode.ThumbOp>>4)&8));
d->Rn = 0;
d->Rm = ARM_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 0;
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 1;
}
else
d->ExecuteCycles = 3;
return 1;
}
//-----------------------------------------------------------------------------
// CMP
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_CMP_IMM8(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_CMP;
d->Rd = 0;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Immediate = (opcode.ThumbOp & 0xFF);
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_CMP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_CMP;
d->Rd = 0;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_CMP_SPE(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_CMP;
d->Rd = 0;
d->Rn = (THUMB_REGPOS(opcode.ThumbOp, 0) | ((opcode.ThumbOp>>4)&8));
d->Rm = ARM_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 0;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// AND
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_AND(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_AND;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// EOR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_EOR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_EOR;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// ADC
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ADC_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADC;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsNeeded |= FLAG_C;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// SBC
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SBC_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SBC;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsNeeded |= FLAG_C;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// ROR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ROR_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MOV;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = d->Rd;
d->Rs = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rn = 0;
d->I = 0;
d->R = 1;
d->Typ = IRSHIFT_ROR;
d->S = 1;
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// TST
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_TST(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_TST;
d->Rd = 0;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// NEG
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_NEG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_RSB;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 1;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// CMN
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_CMN(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_CMN;
d->Rd = 0;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// ORR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ORR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ORR;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// BIC
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_BIC(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BIC;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// MVN
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MVN(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MVN;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rn = d->Rd;
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// MUL
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MUL_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MUL;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rs = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rm = d->Rd;
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// STRB / LDRB
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_STRB_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>6)&0x1F;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 1;
d->W = 0;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDRB_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>6)&0x1F;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 1;
d->W = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_STRB_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->P = 1;
d->U = 1;
d->B = 1;
d->W = 0;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDRB_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->P = 1;
d->U = 1;
d->B = 1;
d->W = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// LDRSB
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LDRSB_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->I = 0;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 1;
d->H = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// STRH / LDRH
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_STRH_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>5)&0x3E;
d->I = 1;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 0;
d->H = 1;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDRH_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>5)&0x3E;
d->I = 1;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 0;
d->H = 1;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_STRH_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->I = 0;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 0;
d->H = 1;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDRH_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->I = 0;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 0;
d->H = 1;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// LDRSH
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LDRSH_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDRx;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->I = 0;
d->P = 1;
d->U = 1;
d->W = 0;
d->S = 1;
d->H = 1;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// STR / LDR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_STR_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>4)&0x7C;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDR_IMM_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Immediate = (opcode.ThumbOp>>4)&0x7C;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_STR_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDR_REG_OFF(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 3);
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 0);
d->Rm = THUMB_REGPOS(opcode.ThumbOp, 6);
d->Immediate = 0;
d->I = 0;
d->R = 0;
d->Typ = IRSHIFT_LSL;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_STR_SPREL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STR;
d->Rn = 13;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Immediate = (opcode.ThumbOp&0xFF)<<2;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDR_SPREL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = 13;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Immediate = (opcode.ThumbOp&0xFF)<<2;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDR_PCREL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDR;
d->Rn = 15;
d->Rd = THUMB_REGPOS(opcode.ThumbOp, 8);
d->Immediate = (opcode.ThumbOp&0xFF)<<2;
d->I = 1;
d->P = 1;
d->U = 1;
d->B = 0;
d->W = 0;
d->ReadPCMask = 0xFFFFFFFC;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// Adjust SP
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_ADJUST_P_SP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_ADD;
d->Rd = 13;
d->Rn = 13;
d->Immediate = (opcode.ThumbOp&0x7F)<<2;
d->I = 1;
d->S = 0;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_ADJUST_M_SP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SUB;
d->Rd = 13;
d->Rn = 13;
d->Immediate = (opcode.ThumbOp&0x7F)<<2;
d->I = 1;
d->S = 0;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// PUSH / POP
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_PUSH(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STM;
d->Rn = 13;
d->RegisterList = (opcode.ThumbOp & 0xFF);
d->P = 1;
d->U = 0;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 3;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_PUSH_LR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STM;
d->Rn = 13;
d->RegisterList = (opcode.ThumbOp & 0xFF) | (1 << 14);
d->P = 1;
d->U = 0;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 4;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_POP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDM;
d->Rn = 13;
d->RegisterList = (opcode.ThumbOp & 0xFF);
d->P = 0;
d->U = 1;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_POP_PC(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDM;
d->Rn = 13;
d->RegisterList = (opcode.ThumbOp & 0xFF) | (1 << 15);
d->P = 0;
d->U = 1;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 5;
d->VariableCycles = 1;
d->R15Modified = 1;
if (PROCNUM == 0) d->TbitModified = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// STMIA / LDMIA
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_STMIA_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STM;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 8);
d->RegisterList = (opcode.ThumbOp & 0xFF);
d->P = 0;
d->U = 1;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDMIA_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDM;
d->Rn = THUMB_REGPOS(opcode.ThumbOp, 8);
d->RegisterList = (opcode.ThumbOp & 0xFF);
d->P = 0;
d->U = 1;
d->S = 0;
d->W = 1;
d->ExecuteCycles = 2;
d->VariableCycles = 1;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// BKPT
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_BKPT_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BKPT;
d->R15Modified = 1;
d->ExecuteCycles = 4;
return 1;
}
//-----------------------------------------------------------------------------
// SWI
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SWI_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SWI;
//d->Immediate = (opcode.ThumbOp & 0xFF);
d->Immediate = (opcode.ThumbOp & 0xFF) & 0x1F;
bool bypassBuiltinSWI =
(armcpu->intVector == 0x00000000 && armcpu->proc_ID==0)
|| (armcpu->intVector == 0xFFFF0000 && armcpu->proc_ID==1);
if (armcpu->swi_tab && !bypassBuiltinSWI)
{
if (d->Immediate == 0x04 || d->Immediate == 0x05 || d->Immediate == 0x06)
d->Reschedule = 1;
if (d->Immediate == 0x04 || d->Immediate == 0x05)
d->MayHalt = 1;
}
else
{
d->R15Modified = 1;
d->TbitModified = 1;
d->Reschedule = 1;
}
d->VariableCycles = 1;
d->ExecuteCycles = 3;
return 1;
}
//-----------------------------------------------------------------------------
// Branch
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_B_COND(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
u32 off = (u32)((s8)(opcode.ThumbOp&0xFF))<<1;
d->IROp = IR_B;
d->Cond = (opcode.ThumbOp>>8)&0xF;
d->Immediate = d->CalcR15(*d) + off;
d->R15Modified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_B_UNCOND(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
u32 off = (((opcode.ThumbOp)&0x7FF) | (BIT10(opcode.ThumbOp) * 0xFFFFF800))<<1;
d->IROp = IR_B;
d->Immediate = d->CalcR15(*d) + off;
d->R15Modified = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_BLX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_T32P2;
d->R15Modified = 1;
d->TbitModified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_BL_10(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_T32P1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_BL_11(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_T32P2;
d->R15Modified = 1;
d->ExecuteCycles = 4;
return 1;
}
TEMPLATE u32 FASTCALL OP_BX_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BX;
d->Rn = ARM_REGPOS(opcode.ThumbOp, 3);
d->R15Modified = 1;
d->TbitModified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_BLX_THUMB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BLX;
d->Rn = ARM_REGPOS(opcode.ArmOp, 3);
d->R15Modified = 1;
d->TbitModified = 1;
d->ExecuteCycles = 3;
return 1;
}
};
//------------------------------------------------------------
// ARM
//------------------------------------------------------------
namespace ArmOpDecoder
{
#define LSL_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_LSL;
#define S_LSL_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_LSL;\
d->S = 1;\
if (!d->Immediate) \
d->FlagsNeeded |= FLAG_C;
#define LSL_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_LSL;
#define S_LSL_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_LSL;\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;
#define LSR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_LSR;
#define S_LSR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_LSR;\
d->S = 1;
#define LSR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_LSR;
#define S_LSR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_LSR;\
d->FlagsNeeded |= FLAG_C;
#define ASR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_ASR;
#define S_ASR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_ASR;\
d->S = 1;
#define ASR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_ASR;
#define S_ASR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_ASR;\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;
#define ROR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_ROR;\
if (d->Immediate) \
d->FlagsNeeded |= FLAG_C;
#define S_ROR_IMM \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Immediate = ((opcode.ArmOp>>7)&0x1F);\
d->I = 0;\
d->R = 0;\
d->Typ = IRSHIFT_ROR;\
d->S = 1;\
if (d->Immediate) \
d->FlagsNeeded |= FLAG_C;
#define ROR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_ROR;
#define S_ROR_REG \
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);\
d->I = 0;\
d->R = 1;\
d->Typ = IRSHIFT_ROR;\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;
#define IMM_VALUE \
d->Immediate = ROR((opcode.ArmOp&0xFF), (opcode.ArmOp>>7)&0x1E);\
d->I = 1;
#define S_IMM_VALUE \
d->Immediate = ROR((opcode.ArmOp&0xFF), (opcode.ArmOp>>7)&0x1E);\
d->I = 1;\
d->S = 1;\
if (!((opcode.ArmOp>>8)&0xF)) \
d->FlagsNeeded |= FLAG_C;
//-----------------------------------------------------------------------------
// Undefined instruction
//-----------------------------------------------------------------------------
DCL_UNDEF_OP(OP_UND)
//-----------------------------------------------------------------------------
// AND / ANDS
//-----------------------------------------------------------------------------
#define OPDEF_AND(a, b) \
d->IROp = IR_AND;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_ANDS(a, b) \
d->IROp = IR_AND;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_AND_LSL_IMM, LSL_IMM, OPDEF_AND, 1, 3)
DCL_OP2_ARG2(OP_AND_LSL_REG, LSL_REG, OPDEF_AND, 2, 4)
DCL_OP2_ARG2(OP_AND_LSR_IMM, LSR_IMM, OPDEF_AND, 1, 3)
DCL_OP2_ARG2(OP_AND_LSR_REG, LSR_REG, OPDEF_AND, 2, 4)
DCL_OP2_ARG2(OP_AND_ASR_IMM, ASR_IMM, OPDEF_AND, 1, 3)
DCL_OP2_ARG2(OP_AND_ASR_REG, ASR_REG, OPDEF_AND, 2, 4)
DCL_OP2_ARG2(OP_AND_ROR_IMM, ROR_IMM, OPDEF_AND, 1, 3)
DCL_OP2_ARG2(OP_AND_ROR_REG, ROR_REG, OPDEF_AND, 2, 4)
DCL_OP2_ARG2(OP_AND_IMM_VAL, IMM_VALUE, OPDEF_AND, 1, 3)
DCL_OP2_ARG2(OP_AND_S_LSL_IMM, S_LSL_IMM, OPDEF_ANDS, 1, 3)
DCL_OP2_ARG2(OP_AND_S_LSL_REG, S_LSL_REG, OPDEF_ANDS, 2, 4)
DCL_OP2_ARG2(OP_AND_S_LSR_IMM, S_LSR_IMM, OPDEF_ANDS, 1, 3)
DCL_OP2_ARG2(OP_AND_S_LSR_REG, S_LSR_REG, OPDEF_ANDS, 2, 4)
DCL_OP2_ARG2(OP_AND_S_ASR_IMM, S_ASR_IMM, OPDEF_ANDS, 1, 3)
DCL_OP2_ARG2(OP_AND_S_ASR_REG, S_ASR_REG, OPDEF_ANDS, 2, 4)
DCL_OP2_ARG2(OP_AND_S_ROR_IMM, S_ROR_IMM, OPDEF_ANDS, 1, 3)
DCL_OP2_ARG2(OP_AND_S_ROR_REG, S_ROR_REG, OPDEF_ANDS, 2, 4)
DCL_OP2_ARG2(OP_AND_S_IMM_VAL, S_IMM_VALUE, OPDEF_ANDS, 1, 3)
//-----------------------------------------------------------------------------
// EOR / EORS
//-----------------------------------------------------------------------------
#define OPDEF_EOR(a, b) \
d->IROp = IR_EOR;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_EORS(a, b) \
d->IROp = IR_EOR;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_EOR_LSL_IMM, LSL_IMM, OPDEF_EOR, 1, 3)
DCL_OP2_ARG2(OP_EOR_LSL_REG, LSL_REG, OPDEF_EOR, 2, 4)
DCL_OP2_ARG2(OP_EOR_LSR_IMM, LSR_IMM, OPDEF_EOR, 1, 3)
DCL_OP2_ARG2(OP_EOR_LSR_REG, LSR_REG, OPDEF_EOR, 2, 4)
DCL_OP2_ARG2(OP_EOR_ASR_IMM, ASR_IMM, OPDEF_EOR, 1, 3)
DCL_OP2_ARG2(OP_EOR_ASR_REG, ASR_REG, OPDEF_EOR, 2, 4)
DCL_OP2_ARG2(OP_EOR_ROR_IMM, ROR_IMM, OPDEF_EOR, 1, 3)
DCL_OP2_ARG2(OP_EOR_ROR_REG, ROR_REG, OPDEF_EOR, 2, 4)
DCL_OP2_ARG2(OP_EOR_IMM_VAL, IMM_VALUE, OPDEF_EOR, 1, 3)
DCL_OP2_ARG2(OP_EOR_S_LSL_IMM, S_LSL_IMM, OPDEF_EORS, 1, 3)
DCL_OP2_ARG2(OP_EOR_S_LSL_REG, S_LSL_REG, OPDEF_EORS, 2, 4)
DCL_OP2_ARG2(OP_EOR_S_LSR_IMM, S_LSR_IMM, OPDEF_EORS, 1, 3)
DCL_OP2_ARG2(OP_EOR_S_LSR_REG, S_LSR_REG, OPDEF_EORS, 2, 4)
DCL_OP2_ARG2(OP_EOR_S_ASR_IMM, S_ASR_IMM, OPDEF_EORS, 1, 3)
DCL_OP2_ARG2(OP_EOR_S_ASR_REG, S_ASR_REG, OPDEF_EORS, 2, 4)
DCL_OP2_ARG2(OP_EOR_S_ROR_IMM, S_ROR_IMM, OPDEF_EORS, 1, 3)
DCL_OP2_ARG2(OP_EOR_S_ROR_REG, S_ROR_REG, OPDEF_EORS, 2, 4)
DCL_OP2_ARG2(OP_EOR_S_IMM_VAL, S_IMM_VALUE, OPDEF_EORS, 1, 3)
//-----------------------------------------------------------------------------
// SUB / SUBS
//-----------------------------------------------------------------------------
#define OPDEF_SUB(a, b) \
d->IROp = IR_SUB;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_SUBS(a, b) \
d->IROp = IR_SUB;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_SUB_LSL_IMM, LSL_IMM, OPDEF_SUB, 1, 3)
DCL_OP2_ARG2(OP_SUB_LSL_REG, LSL_REG, OPDEF_SUB, 2, 4)
DCL_OP2_ARG2(OP_SUB_LSR_IMM, LSR_IMM, OPDEF_SUB, 1, 3)
DCL_OP2_ARG2(OP_SUB_LSR_REG, LSR_REG, OPDEF_SUB, 2, 4)
DCL_OP2_ARG2(OP_SUB_ASR_IMM, ASR_IMM, OPDEF_SUB, 1, 3)
DCL_OP2_ARG2(OP_SUB_ASR_REG, ASR_REG, OPDEF_SUB, 2, 4)
DCL_OP2_ARG2(OP_SUB_ROR_IMM, ROR_IMM, OPDEF_SUB, 1, 3)
DCL_OP2_ARG2(OP_SUB_ROR_REG, ROR_REG, OPDEF_SUB, 2, 4)
DCL_OP2_ARG2(OP_SUB_IMM_VAL, IMM_VALUE, OPDEF_SUB, 1, 3)
DCL_OP2_ARG2(OP_SUB_S_LSL_IMM, LSL_IMM, OPDEF_SUBS, 1, 3)
DCL_OP2_ARG2(OP_SUB_S_LSL_REG, LSL_REG, OPDEF_SUBS, 2, 4)
DCL_OP2_ARG2(OP_SUB_S_LSR_IMM, LSR_IMM, OPDEF_SUBS, 1, 3)
DCL_OP2_ARG2(OP_SUB_S_LSR_REG, LSR_REG, OPDEF_SUBS, 2, 4)
DCL_OP2_ARG2(OP_SUB_S_ASR_IMM, ASR_IMM, OPDEF_SUBS, 1, 3)
DCL_OP2_ARG2(OP_SUB_S_ASR_REG, ASR_REG, OPDEF_SUBS, 2, 4)
DCL_OP2_ARG2(OP_SUB_S_ROR_IMM, ROR_IMM, OPDEF_SUBS, 1, 3)
DCL_OP2_ARG2(OP_SUB_S_ROR_REG, ROR_REG, OPDEF_SUBS, 2, 4)
DCL_OP2_ARG2(OP_SUB_S_IMM_VAL, IMM_VALUE, OPDEF_SUBS, 1, 3)
//-----------------------------------------------------------------------------
// RSB / RSBS
//-----------------------------------------------------------------------------
#define OPDEF_RSB(a, b) \
d->IROp = IR_RSB;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_RSBS(a, b) \
d->IROp = IR_RSB;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_RSB_LSL_IMM, LSL_IMM, OPDEF_RSB, 1, 3)
DCL_OP2_ARG2(OP_RSB_LSL_REG, LSL_REG, OPDEF_RSB, 2, 4)
DCL_OP2_ARG2(OP_RSB_LSR_IMM, LSR_IMM, OPDEF_RSB, 1, 3)
DCL_OP2_ARG2(OP_RSB_LSR_REG, LSR_REG, OPDEF_RSB, 2, 4)
DCL_OP2_ARG2(OP_RSB_ASR_IMM, ASR_IMM, OPDEF_RSB, 1, 3)
DCL_OP2_ARG2(OP_RSB_ASR_REG, ASR_REG, OPDEF_RSB, 2, 4)
DCL_OP2_ARG2(OP_RSB_ROR_IMM, ROR_IMM, OPDEF_RSB, 1, 3)
DCL_OP2_ARG2(OP_RSB_ROR_REG, ROR_REG, OPDEF_RSB, 2, 4)
DCL_OP2_ARG2(OP_RSB_IMM_VAL, IMM_VALUE, OPDEF_RSB, 1, 3)
DCL_OP2_ARG2(OP_RSB_S_LSL_IMM, LSL_IMM, OPDEF_RSBS, 1, 3)
DCL_OP2_ARG2(OP_RSB_S_LSL_REG, LSL_REG, OPDEF_RSBS, 2, 4)
DCL_OP2_ARG2(OP_RSB_S_LSR_IMM, LSR_IMM, OPDEF_RSBS, 1, 3)
DCL_OP2_ARG2(OP_RSB_S_LSR_REG, LSR_REG, OPDEF_RSBS, 2, 4)
DCL_OP2_ARG2(OP_RSB_S_ASR_IMM, ASR_IMM, OPDEF_RSBS, 1, 3)
DCL_OP2_ARG2(OP_RSB_S_ASR_REG, ASR_REG, OPDEF_RSBS, 2, 4)
DCL_OP2_ARG2(OP_RSB_S_ROR_IMM, ROR_IMM, OPDEF_RSBS, 1, 3)
DCL_OP2_ARG2(OP_RSB_S_ROR_REG, ROR_REG, OPDEF_RSBS, 2, 4)
DCL_OP2_ARG2(OP_RSB_S_IMM_VAL, IMM_VALUE, OPDEF_RSBS, 1, 3)
//-----------------------------------------------------------------------------
// ADD / ADDS
//-----------------------------------------------------------------------------
#define OPDEF_ADD(a, b) \
d->IROp = IR_ADD;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_ADDS(a, b) \
d->IROp = IR_ADD;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_ADD_LSL_IMM, LSL_IMM, OPDEF_ADD, 1, 3)
DCL_OP2_ARG2(OP_ADD_LSL_REG, LSL_REG, OPDEF_ADD, 2, 4)
DCL_OP2_ARG2(OP_ADD_LSR_IMM, LSR_IMM, OPDEF_ADD, 1, 3)
DCL_OP2_ARG2(OP_ADD_LSR_REG, LSR_REG, OPDEF_ADD, 2, 4)
DCL_OP2_ARG2(OP_ADD_ASR_IMM, ASR_IMM, OPDEF_ADD, 1, 3)
DCL_OP2_ARG2(OP_ADD_ASR_REG, ASR_REG, OPDEF_ADD, 2, 4)
DCL_OP2_ARG2(OP_ADD_ROR_IMM, ROR_IMM, OPDEF_ADD, 1, 3)
DCL_OP2_ARG2(OP_ADD_ROR_REG, ROR_REG, OPDEF_ADD, 2, 4)
DCL_OP2_ARG2(OP_ADD_IMM_VAL, IMM_VALUE, OPDEF_ADD, 1, 3)
DCL_OP2_ARG2(OP_ADD_S_LSL_IMM, LSL_IMM, OPDEF_ADDS, 1, 3)
DCL_OP2_ARG2(OP_ADD_S_LSL_REG, LSL_REG, OPDEF_ADDS, 2, 4)
DCL_OP2_ARG2(OP_ADD_S_LSR_IMM, LSR_IMM, OPDEF_ADDS, 1, 3)
DCL_OP2_ARG2(OP_ADD_S_LSR_REG, LSR_REG, OPDEF_ADDS, 2, 4)
DCL_OP2_ARG2(OP_ADD_S_ASR_IMM, ASR_IMM, OPDEF_ADDS, 1, 3)
DCL_OP2_ARG2(OP_ADD_S_ASR_REG, ASR_REG, OPDEF_ADDS, 2, 4)
DCL_OP2_ARG2(OP_ADD_S_ROR_IMM, ROR_IMM, OPDEF_ADDS, 1, 3)
DCL_OP2_ARG2(OP_ADD_S_ROR_REG, ROR_REG, OPDEF_ADDS, 2, 4)
DCL_OP2_ARG2(OP_ADD_S_IMM_VAL, IMM_VALUE, OPDEF_ADDS, 1, 3)
//-----------------------------------------------------------------------------
// ADC / ADCS
//-----------------------------------------------------------------------------
#define OPDEF_ADC(a, b) \
d->IROp = IR_ADC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_ADCS(a, b) \
d->IROp = IR_ADC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_ADC_LSL_IMM, LSL_IMM, OPDEF_ADC, 1, 3)
DCL_OP2_ARG2(OP_ADC_LSL_REG, LSL_REG, OPDEF_ADC, 2, 4)
DCL_OP2_ARG2(OP_ADC_LSR_IMM, LSR_IMM, OPDEF_ADC, 1, 3)
DCL_OP2_ARG2(OP_ADC_LSR_REG, LSR_REG, OPDEF_ADC, 2, 4)
DCL_OP2_ARG2(OP_ADC_ASR_IMM, ASR_IMM, OPDEF_ADC, 1, 3)
DCL_OP2_ARG2(OP_ADC_ASR_REG, ASR_REG, OPDEF_ADC, 2, 4)
DCL_OP2_ARG2(OP_ADC_ROR_IMM, ROR_IMM, OPDEF_ADC, 1, 3)
DCL_OP2_ARG2(OP_ADC_ROR_REG, ROR_REG, OPDEF_ADC, 2, 4)
DCL_OP2_ARG2(OP_ADC_IMM_VAL, IMM_VALUE, OPDEF_ADC, 1, 3)
DCL_OP2_ARG2(OP_ADC_S_LSL_IMM, LSL_IMM, OPDEF_ADCS, 1, 3)
DCL_OP2_ARG2(OP_ADC_S_LSL_REG, LSL_REG, OPDEF_ADCS, 2, 4)
DCL_OP2_ARG2(OP_ADC_S_LSR_IMM, LSR_IMM, OPDEF_ADCS, 1, 3)
DCL_OP2_ARG2(OP_ADC_S_LSR_REG, LSR_REG, OPDEF_ADCS, 2, 4)
DCL_OP2_ARG2(OP_ADC_S_ASR_IMM, ASR_IMM, OPDEF_ADCS, 1, 3)
DCL_OP2_ARG2(OP_ADC_S_ASR_REG, ASR_REG, OPDEF_ADCS, 2, 4)
DCL_OP2_ARG2(OP_ADC_S_ROR_IMM, ROR_IMM, OPDEF_ADCS, 1, 3)
DCL_OP2_ARG2(OP_ADC_S_ROR_REG, ROR_REG, OPDEF_ADCS, 2, 4)
DCL_OP2_ARG2(OP_ADC_S_IMM_VAL, IMM_VALUE, OPDEF_ADCS, 1, 3)
//-----------------------------------------------------------------------------
// SBC / SBCS
//-----------------------------------------------------------------------------
#define OPDEF_SBC(a, b) \
d->IROp = IR_SBC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_SBCS(a, b) \
d->IROp = IR_SBC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_SBC_LSL_IMM, LSL_IMM, OPDEF_SBC, 1, 3)
DCL_OP2_ARG2(OP_SBC_LSL_REG, LSL_REG, OPDEF_SBC, 2, 4)
DCL_OP2_ARG2(OP_SBC_LSR_IMM, LSR_IMM, OPDEF_SBC, 1, 3)
DCL_OP2_ARG2(OP_SBC_LSR_REG, LSR_REG, OPDEF_SBC, 2, 4)
DCL_OP2_ARG2(OP_SBC_ASR_IMM, ASR_IMM, OPDEF_SBC, 1, 3)
DCL_OP2_ARG2(OP_SBC_ASR_REG, ASR_REG, OPDEF_SBC, 2, 4)
DCL_OP2_ARG2(OP_SBC_ROR_IMM, ROR_IMM, OPDEF_SBC, 1, 3)
DCL_OP2_ARG2(OP_SBC_ROR_REG, ROR_REG, OPDEF_SBC, 2, 4)
DCL_OP2_ARG2(OP_SBC_IMM_VAL, IMM_VALUE, OPDEF_SBC, 1, 3)
DCL_OP2_ARG2(OP_SBC_S_LSL_IMM, LSL_IMM, OPDEF_SBCS, 1, 3)
DCL_OP2_ARG2(OP_SBC_S_LSL_REG, LSL_REG, OPDEF_SBCS, 2, 4)
DCL_OP2_ARG2(OP_SBC_S_LSR_IMM, LSR_IMM, OPDEF_SBCS, 1, 3)
DCL_OP2_ARG2(OP_SBC_S_LSR_REG, LSR_REG, OPDEF_SBCS, 2, 4)
DCL_OP2_ARG2(OP_SBC_S_ASR_IMM, ASR_IMM, OPDEF_SBCS, 1, 3)
DCL_OP2_ARG2(OP_SBC_S_ASR_REG, ASR_REG, OPDEF_SBCS, 2, 4)
DCL_OP2_ARG2(OP_SBC_S_ROR_IMM, ROR_IMM, OPDEF_SBCS, 1, 3)
DCL_OP2_ARG2(OP_SBC_S_ROR_REG, ROR_REG, OPDEF_SBCS, 2, 4)
DCL_OP2_ARG2(OP_SBC_S_IMM_VAL, IMM_VALUE, OPDEF_SBCS, 1, 3)
//-----------------------------------------------------------------------------
// RSC / RSCS
//-----------------------------------------------------------------------------
#define OPDEF_RSC(a, b) \
d->IROp = IR_RSC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_RSCS(a, b) \
d->IROp = IR_RSC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
d->FlagsNeeded |= FLAG_C;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_RSC_LSL_IMM, LSL_IMM, OPDEF_RSC, 1, 3)
DCL_OP2_ARG2(OP_RSC_LSL_REG, LSL_REG, OPDEF_RSC, 2, 4)
DCL_OP2_ARG2(OP_RSC_LSR_IMM, LSR_IMM, OPDEF_RSC, 1, 3)
DCL_OP2_ARG2(OP_RSC_LSR_REG, LSR_REG, OPDEF_RSC, 2, 4)
DCL_OP2_ARG2(OP_RSC_ASR_IMM, ASR_IMM, OPDEF_RSC, 1, 3)
DCL_OP2_ARG2(OP_RSC_ASR_REG, ASR_REG, OPDEF_RSC, 2, 4)
DCL_OP2_ARG2(OP_RSC_ROR_IMM, ROR_IMM, OPDEF_RSC, 1, 3)
DCL_OP2_ARG2(OP_RSC_ROR_REG, ROR_REG, OPDEF_RSC, 2, 4)
DCL_OP2_ARG2(OP_RSC_IMM_VAL, IMM_VALUE, OPDEF_RSC, 1, 3)
DCL_OP2_ARG2(OP_RSC_S_LSL_IMM, LSL_IMM, OPDEF_RSCS, 1, 3)
DCL_OP2_ARG2(OP_RSC_S_LSL_REG, LSL_REG, OPDEF_RSCS, 2, 4)
DCL_OP2_ARG2(OP_RSC_S_LSR_IMM, LSR_IMM, OPDEF_RSCS, 1, 3)
DCL_OP2_ARG2(OP_RSC_S_LSR_REG, LSR_REG, OPDEF_RSCS, 2, 4)
DCL_OP2_ARG2(OP_RSC_S_ASR_IMM, ASR_IMM, OPDEF_RSCS, 1, 3)
DCL_OP2_ARG2(OP_RSC_S_ASR_REG, ASR_REG, OPDEF_RSCS, 2, 4)
DCL_OP2_ARG2(OP_RSC_S_ROR_IMM, ROR_IMM, OPDEF_RSCS, 1, 3)
DCL_OP2_ARG2(OP_RSC_S_ROR_REG, ROR_REG, OPDEF_RSCS, 2, 4)
DCL_OP2_ARG2(OP_RSC_S_IMM_VAL, IMM_VALUE, OPDEF_RSCS, 1, 3)
//-----------------------------------------------------------------------------
// TST
//-----------------------------------------------------------------------------
#define OPDEF_TST(a) \
d->IROp = IR_TST;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG1(OP_TST_LSL_IMM, S_LSL_IMM, OPDEF_TST, 1)
DCL_OP2_ARG1(OP_TST_LSL_REG, S_LSL_REG, OPDEF_TST, 2)
DCL_OP2_ARG1(OP_TST_LSR_IMM, S_LSR_IMM, OPDEF_TST, 1)
DCL_OP2_ARG1(OP_TST_LSR_REG, S_LSR_REG, OPDEF_TST, 2)
DCL_OP2_ARG1(OP_TST_ASR_IMM, S_ASR_IMM, OPDEF_TST, 1)
DCL_OP2_ARG1(OP_TST_ASR_REG, S_ASR_REG, OPDEF_TST, 2)
DCL_OP2_ARG1(OP_TST_ROR_IMM, S_ROR_IMM, OPDEF_TST, 1)
DCL_OP2_ARG1(OP_TST_ROR_REG, S_ROR_REG, OPDEF_TST, 2)
DCL_OP2_ARG1(OP_TST_IMM_VAL, S_IMM_VALUE, OPDEF_TST, 1)
//-----------------------------------------------------------------------------
// TEQ
//-----------------------------------------------------------------------------
#define OPDEF_TEQ(a) \
d->IROp = IR_TEQ;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG1(OP_TEQ_LSL_IMM, S_LSL_IMM, OPDEF_TEQ, 1)
DCL_OP2_ARG1(OP_TEQ_LSL_REG, S_LSL_REG, OPDEF_TEQ, 2)
DCL_OP2_ARG1(OP_TEQ_LSR_IMM, S_LSR_IMM, OPDEF_TEQ, 1)
DCL_OP2_ARG1(OP_TEQ_LSR_REG, S_LSR_REG, OPDEF_TEQ, 2)
DCL_OP2_ARG1(OP_TEQ_ASR_IMM, S_ASR_IMM, OPDEF_TEQ, 1)
DCL_OP2_ARG1(OP_TEQ_ASR_REG, S_ASR_REG, OPDEF_TEQ, 2)
DCL_OP2_ARG1(OP_TEQ_ROR_IMM, S_ROR_IMM, OPDEF_TEQ, 1)
DCL_OP2_ARG1(OP_TEQ_ROR_REG, S_ROR_REG, OPDEF_TEQ, 2)
DCL_OP2_ARG1(OP_TEQ_IMM_VAL, S_IMM_VALUE, OPDEF_TEQ, 1)
//-----------------------------------------------------------------------------
// CMP
//-----------------------------------------------------------------------------
#define OPDEF_CMP(a) \
d->IROp = IR_CMP;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG1(OP_CMP_LSL_IMM, LSL_IMM, OPDEF_CMP, 1)
DCL_OP2_ARG1(OP_CMP_LSL_REG, LSL_REG, OPDEF_CMP, 2)
DCL_OP2_ARG1(OP_CMP_LSR_IMM, LSR_IMM, OPDEF_CMP, 1)
DCL_OP2_ARG1(OP_CMP_LSR_REG, LSR_REG, OPDEF_CMP, 2)
DCL_OP2_ARG1(OP_CMP_ASR_IMM, ASR_IMM, OPDEF_CMP, 1)
DCL_OP2_ARG1(OP_CMP_ASR_REG, ASR_REG, OPDEF_CMP, 2)
DCL_OP2_ARG1(OP_CMP_ROR_IMM, ROR_IMM, OPDEF_CMP, 1)
DCL_OP2_ARG1(OP_CMP_ROR_REG, ROR_REG, OPDEF_CMP, 2)
DCL_OP2_ARG1(OP_CMP_IMM_VAL, IMM_VALUE, OPDEF_CMP, 1)
//-----------------------------------------------------------------------------
// CMN
//-----------------------------------------------------------------------------
#define OPDEF_CMN(a) \
d->IROp = IR_CMN;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->FlagsSet |= ALL_FLAGS;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG1(OP_CMN_LSL_IMM, LSL_IMM, OPDEF_CMN, 1)
DCL_OP2_ARG1(OP_CMN_LSL_REG, LSL_REG, OPDEF_CMN, 2)
DCL_OP2_ARG1(OP_CMN_LSR_IMM, LSR_IMM, OPDEF_CMN, 1)
DCL_OP2_ARG1(OP_CMN_LSR_REG, LSR_REG, OPDEF_CMN, 2)
DCL_OP2_ARG1(OP_CMN_ASR_IMM, ASR_IMM, OPDEF_CMN, 1)
DCL_OP2_ARG1(OP_CMN_ASR_REG, ASR_REG, OPDEF_CMN, 2)
DCL_OP2_ARG1(OP_CMN_ROR_IMM, ROR_IMM, OPDEF_CMN, 1)
DCL_OP2_ARG1(OP_CMN_ROR_REG, ROR_REG, OPDEF_CMN, 2)
DCL_OP2_ARG1(OP_CMN_IMM_VAL, IMM_VALUE, OPDEF_CMN, 1)
//-----------------------------------------------------------------------------
// ORR / ORRS
//-----------------------------------------------------------------------------
#define OPDEF_ORR(a, b) \
d->IROp = IR_ORR;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_ORRS(a, b) \
d->IROp = IR_ORR;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_ORR_LSL_IMM, LSL_IMM, OPDEF_ORR, 1, 3)
DCL_OP2_ARG2(OP_ORR_LSL_REG, LSL_REG, OPDEF_ORR, 2, 4)
DCL_OP2_ARG2(OP_ORR_LSR_IMM, LSR_IMM, OPDEF_ORR, 1, 3)
DCL_OP2_ARG2(OP_ORR_LSR_REG, LSR_REG, OPDEF_ORR, 2, 4)
DCL_OP2_ARG2(OP_ORR_ASR_IMM, ASR_IMM, OPDEF_ORR, 1, 3)
DCL_OP2_ARG2(OP_ORR_ASR_REG, ASR_REG, OPDEF_ORR, 2, 4)
DCL_OP2_ARG2(OP_ORR_ROR_IMM, ROR_IMM, OPDEF_ORR, 1, 3)
DCL_OP2_ARG2(OP_ORR_ROR_REG, ROR_REG, OPDEF_ORR, 2, 4)
DCL_OP2_ARG2(OP_ORR_IMM_VAL, IMM_VALUE, OPDEF_ORR, 1, 3)
DCL_OP2_ARG2(OP_ORR_S_LSL_IMM, S_LSL_IMM, OPDEF_ORRS, 1, 3)
DCL_OP2_ARG2(OP_ORR_S_LSL_REG, S_LSL_REG, OPDEF_ORRS, 2, 4)
DCL_OP2_ARG2(OP_ORR_S_LSR_IMM, S_LSR_IMM, OPDEF_ORRS, 1, 3)
DCL_OP2_ARG2(OP_ORR_S_LSR_REG, S_LSR_REG, OPDEF_ORRS, 2, 4)
DCL_OP2_ARG2(OP_ORR_S_ASR_IMM, S_ASR_IMM, OPDEF_ORRS, 1, 3)
DCL_OP2_ARG2(OP_ORR_S_ASR_REG, S_ASR_REG, OPDEF_ORRS, 2, 4)
DCL_OP2_ARG2(OP_ORR_S_ROR_IMM, S_ROR_IMM, OPDEF_ORRS, 1, 3)
DCL_OP2_ARG2(OP_ORR_S_ROR_REG, S_ROR_REG, OPDEF_ORRS, 2, 4)
DCL_OP2_ARG2(OP_ORR_S_IMM_VAL, S_IMM_VALUE, OPDEF_ORRS, 1, 3)
//-----------------------------------------------------------------------------
// MOV / MOVS
//-----------------------------------------------------------------------------
#define OPDEF_MOV(a, b) \
if (opcode.ArmOp == 0xE1A00000)\
{\
/*nop: MOV R0, R0*/\
d->IROp = IR_NOP;\
d->ExecuteCycles = 1;\
return 1;\
}\
d->IROp = IR_MOV;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_MOVS(a, b) \
d->IROp = IR_MOV;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_MOV_LSL_IMM, LSL_IMM, OPDEF_MOV, 1, 3)
DCL_OP2_ARG2(OP_MOV_LSL_REG, LSL_REG, OPDEF_MOV, 2, 4)
DCL_OP2_ARG2(OP_MOV_LSR_IMM, LSR_IMM, OPDEF_MOV, 1, 3)
DCL_OP2_ARG2(OP_MOV_LSR_REG, LSR_REG, OPDEF_MOV, 2, 4)
DCL_OP2_ARG2(OP_MOV_ASR_IMM, ASR_IMM, OPDEF_MOV, 1, 3)
DCL_OP2_ARG2(OP_MOV_ASR_REG, ASR_REG, OPDEF_MOV, 2, 4)
DCL_OP2_ARG2(OP_MOV_ROR_IMM, ROR_IMM, OPDEF_MOV, 1, 3)
DCL_OP2_ARG2(OP_MOV_ROR_REG, ROR_REG, OPDEF_MOV, 2, 4)
DCL_OP2_ARG2(OP_MOV_IMM_VAL, IMM_VALUE, OPDEF_MOV, 1, 3)
DCL_OP2_ARG2(OP_MOV_S_LSL_IMM, S_LSL_IMM, OPDEF_MOVS, 1, 3)
DCL_OP2_ARG2(OP_MOV_S_LSL_REG, S_LSL_REG, OPDEF_MOVS, 2, 4)
DCL_OP2_ARG2(OP_MOV_S_LSR_IMM, S_LSR_IMM, OPDEF_MOVS, 1, 3)
DCL_OP2_ARG2(OP_MOV_S_LSR_REG, S_LSR_REG, OPDEF_MOVS, 2, 4)
DCL_OP2_ARG2(OP_MOV_S_ASR_IMM, S_ASR_IMM, OPDEF_MOVS, 1, 3)
DCL_OP2_ARG2(OP_MOV_S_ASR_REG, S_ASR_REG, OPDEF_MOVS, 2, 4)
DCL_OP2_ARG2(OP_MOV_S_ROR_IMM, S_ROR_IMM, OPDEF_MOVS, 1, 3)
DCL_OP2_ARG2(OP_MOV_S_ROR_REG, S_ROR_REG, OPDEF_MOVS, 2, 4)
DCL_OP2_ARG2(OP_MOV_S_IMM_VAL, S_IMM_VALUE, OPDEF_MOVS, 1, 3)
//-----------------------------------------------------------------------------
// BIC / BICS
//-----------------------------------------------------------------------------
#define OPDEF_BIC(a, b) \
d->IROp = IR_BIC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_BICS(a, b) \
d->IROp = IR_BIC;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_BIC_LSL_IMM, LSL_IMM, OPDEF_BIC, 1, 3)
DCL_OP2_ARG2(OP_BIC_LSL_REG, LSL_REG, OPDEF_BIC, 2, 4)
DCL_OP2_ARG2(OP_BIC_LSR_IMM, LSR_IMM, OPDEF_BIC, 1, 3)
DCL_OP2_ARG2(OP_BIC_LSR_REG, LSR_REG, OPDEF_BIC, 2, 4)
DCL_OP2_ARG2(OP_BIC_ASR_IMM, ASR_IMM, OPDEF_BIC, 1, 3)
DCL_OP2_ARG2(OP_BIC_ASR_REG, ASR_REG, OPDEF_BIC, 2, 4)
DCL_OP2_ARG2(OP_BIC_ROR_IMM, ROR_IMM, OPDEF_BIC, 1, 3)
DCL_OP2_ARG2(OP_BIC_ROR_REG, ROR_REG, OPDEF_BIC, 2, 4)
DCL_OP2_ARG2(OP_BIC_IMM_VAL, IMM_VALUE, OPDEF_BIC, 1, 3)
DCL_OP2_ARG2(OP_BIC_S_LSL_IMM, S_LSL_IMM, OPDEF_BICS, 1, 3)
DCL_OP2_ARG2(OP_BIC_S_LSL_REG, S_LSL_REG, OPDEF_BICS, 2, 4)
DCL_OP2_ARG2(OP_BIC_S_LSR_IMM, S_LSR_IMM, OPDEF_BICS, 1, 3)
DCL_OP2_ARG2(OP_BIC_S_LSR_REG, S_LSR_REG, OPDEF_BICS, 2, 4)
DCL_OP2_ARG2(OP_BIC_S_ASR_IMM, S_ASR_IMM, OPDEF_BICS, 1, 3)
DCL_OP2_ARG2(OP_BIC_S_ASR_REG, S_ASR_REG, OPDEF_BICS, 2, 4)
DCL_OP2_ARG2(OP_BIC_S_ROR_IMM, S_ROR_IMM, OPDEF_BICS, 1, 3)
DCL_OP2_ARG2(OP_BIC_S_ROR_REG, S_ROR_REG, OPDEF_BICS, 2, 4)
DCL_OP2_ARG2(OP_BIC_S_IMM_VAL, S_IMM_VALUE, OPDEF_BICS, 1, 3)
//-----------------------------------------------------------------------------
// MVN / MVNS
//-----------------------------------------------------------------------------
#define OPDEF_MVN(a, b) \
d->IROp = IR_MVN;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
d->ExecuteCycles = b;\
return 1;\
}\
d->ExecuteCycles = a;\
return 1;
#define OPDEF_MVNS(a, b) \
d->IROp = IR_MVN;\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->S = 1;\
if (d->Rd == 15)\
{\
d->R15Modified = 1;\
LOAD_CPSR\
d->ExecuteCycles = b;\
return 1;\
}\
d->FlagsSet |= FLAG_C | FLAG_N | FLAG_Z;\
d->ExecuteCycles = a;\
return 1;
DCL_OP2_ARG2(OP_MVN_LSL_IMM, LSL_IMM, OPDEF_MVN, 1, 3)
DCL_OP2_ARG2(OP_MVN_LSL_REG, LSL_REG, OPDEF_MVN, 2, 4)
DCL_OP2_ARG2(OP_MVN_LSR_IMM, LSR_IMM, OPDEF_MVN, 1, 3)
DCL_OP2_ARG2(OP_MVN_LSR_REG, LSR_REG, OPDEF_MVN, 2, 4)
DCL_OP2_ARG2(OP_MVN_ASR_IMM, ASR_IMM, OPDEF_MVN, 1, 3)
DCL_OP2_ARG2(OP_MVN_ASR_REG, ASR_REG, OPDEF_MVN, 2, 4)
DCL_OP2_ARG2(OP_MVN_ROR_IMM, ROR_IMM, OPDEF_MVN, 1, 3)
DCL_OP2_ARG2(OP_MVN_ROR_REG, ROR_REG, OPDEF_MVN, 2, 4)
DCL_OP2_ARG2(OP_MVN_IMM_VAL, IMM_VALUE, OPDEF_MVN, 1, 3)
DCL_OP2_ARG2(OP_MVN_S_LSL_IMM, S_LSL_IMM, OPDEF_MVNS, 1, 3)
DCL_OP2_ARG2(OP_MVN_S_LSL_REG, S_LSL_REG, OPDEF_MVNS, 2, 4)
DCL_OP2_ARG2(OP_MVN_S_LSR_IMM, S_LSR_IMM, OPDEF_MVNS, 1, 3)
DCL_OP2_ARG2(OP_MVN_S_LSR_REG, S_LSR_REG, OPDEF_MVNS, 2, 4)
DCL_OP2_ARG2(OP_MVN_S_ASR_IMM, S_ASR_IMM, OPDEF_MVNS, 1, 3)
DCL_OP2_ARG2(OP_MVN_S_ASR_REG, S_ASR_REG, OPDEF_MVNS, 2, 4)
DCL_OP2_ARG2(OP_MVN_S_ROR_IMM, S_ROR_IMM, OPDEF_MVNS, 1, 3)
DCL_OP2_ARG2(OP_MVN_S_ROR_REG, S_ROR_REG, OPDEF_MVNS, 2, 4)
DCL_OP2_ARG2(OP_MVN_S_IMM_VAL, S_IMM_VALUE, OPDEF_MVNS, 1, 3)
//-----------------------------------------------------------------------------
// MUL / MULS / MLA / MLAS
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MUL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MUL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MLA(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MLA;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MUL_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MUL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MLA_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MLA;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// UMULL / UMULLS / UMLAL / UMLALS
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_UMULL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_UMULL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_UMLAL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_UMLAL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_UMULL_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_UMULL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_UMLAL_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_UMLAL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// SMULL / SMULLS / SMLAL / SMLALS
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMULL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMULL_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAL_S(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAL;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->S = 1;
d->FlagsSet |= FLAG_N | FLAG_Z;
d->VariableCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// SWP / SWPB
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SWP(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SWP;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->B = 0;
d->ExecuteCycles = 4;
d->VariableCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_SWPB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SWP;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->B = 1;
d->ExecuteCycles = 4;
d->VariableCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// LDRH
//-----------------------------------------------------------------------------
#define OPDEF_LDRH(p,u,i,w,cycle)\
d->IROp = IR_LDRx;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->I = i;\
if (i)\
{\
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));\
}\
else\
{\
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
}\
d->W = w;\
d->S = 0;\
d->H = 1;\
d->ExecuteCycles = cycle;\
d->VariableCycles = 1;\
d->Reschedule = 2;
DCL_OP1_ARG5(OP_LDRH_P_IMM_OFF, OPDEF_LDRH, 1, 1, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRH_M_IMM_OFF, OPDEF_LDRH, 1, 0, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRH_P_REG_OFF, OPDEF_LDRH, 1, 1, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRH_M_REG_OFF, OPDEF_LDRH, 1, 0, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRH_PRE_INDE_P_IMM_OFF, OPDEF_LDRH, 1, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRH_PRE_INDE_M_IMM_OFF, OPDEF_LDRH, 1, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRH_PRE_INDE_P_REG_OFF, OPDEF_LDRH, 1, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRH_PRE_INDE_M_REG_OFF, OPDEF_LDRH, 1, 0, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRH_POS_INDE_P_IMM_OFF, OPDEF_LDRH, 0, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRH_POS_INDE_M_IMM_OFF, OPDEF_LDRH, 0, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRH_POS_INDE_P_REG_OFF, OPDEF_LDRH, 0, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRH_POS_INDE_M_REG_OFF, OPDEF_LDRH, 0, 0, 0, 1, 3)
#undef OPDEF_LDRH
//-----------------------------------------------------------------------------
// STRH
//-----------------------------------------------------------------------------
#define OPDEF_STRH(p,u,i,w,cycle)\
d->IROp = IR_STRx;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->I = i;\
if (i)\
{\
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));\
}\
else\
{\
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
}\
d->W = w;\
d->S = 0;\
d->H = 1;\
d->ExecuteCycles = cycle;\
d->VariableCycles = 1;\
d->Reschedule = 2;
DCL_OP1_ARG5(OP_STRH_P_IMM_OFF, OPDEF_STRH, 1, 1, 1, 0, 2)
DCL_OP1_ARG5(OP_STRH_M_IMM_OFF, OPDEF_STRH, 1, 0, 1, 0, 2)
DCL_OP1_ARG5(OP_STRH_P_REG_OFF, OPDEF_STRH, 1, 1, 0, 0, 2)
DCL_OP1_ARG5(OP_STRH_M_REG_OFF, OPDEF_STRH, 1, 0, 0, 0, 2)
DCL_OP1_ARG5(OP_STRH_PRE_INDE_P_IMM_OFF, OPDEF_STRH, 1, 1, 1, 1, 2)
DCL_OP1_ARG5(OP_STRH_PRE_INDE_M_IMM_OFF, OPDEF_STRH, 1, 0, 1, 1, 2)
DCL_OP1_ARG5(OP_STRH_PRE_INDE_P_REG_OFF, OPDEF_STRH, 1, 1, 0, 1, 2)
DCL_OP1_ARG5(OP_STRH_PRE_INDE_M_REG_OFF, OPDEF_STRH, 1, 0, 0, 1, 2)
DCL_OP1_ARG5(OP_STRH_POS_INDE_P_IMM_OFF, OPDEF_STRH, 0, 1, 1, 1, 2)
DCL_OP1_ARG5(OP_STRH_POS_INDE_M_IMM_OFF, OPDEF_STRH, 0, 0, 1, 1, 2)
DCL_OP1_ARG5(OP_STRH_POS_INDE_P_REG_OFF, OPDEF_STRH, 0, 1, 0, 1, 2)
DCL_OP1_ARG5(OP_STRH_POS_INDE_M_REG_OFF, OPDEF_STRH, 0, 0, 0, 1, 2)
#undef OPDEF_STRH
//-----------------------------------------------------------------------------
// LDRSH
//-----------------------------------------------------------------------------
#define OPDEF_LDRSH(p,u,i,w,cycle)\
d->IROp = IR_LDRx;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->I = i;\
if (i)\
{\
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));\
}\
else\
{\
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
}\
d->W = w;\
d->S = 1;\
d->H = 1;\
d->ExecuteCycles = cycle;\
d->VariableCycles = 1;\
d->Reschedule = 2;
DCL_OP1_ARG5(OP_LDRSH_P_IMM_OFF, OPDEF_LDRSH, 1, 1, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRSH_M_IMM_OFF, OPDEF_LDRSH, 1, 0, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRSH_P_REG_OFF, OPDEF_LDRSH, 1, 1, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRSH_M_REG_OFF, OPDEF_LDRSH, 1, 0, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRSH_PRE_INDE_P_IMM_OFF, OPDEF_LDRSH, 1, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_PRE_INDE_M_IMM_OFF, OPDEF_LDRSH, 1, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_PRE_INDE_P_REG_OFF, OPDEF_LDRSH, 1, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_PRE_INDE_M_REG_OFF, OPDEF_LDRSH, 1, 0, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_POS_INDE_P_IMM_OFF, OPDEF_LDRSH, 0, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_POS_INDE_M_IMM_OFF, OPDEF_LDRSH, 0, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_POS_INDE_P_REG_OFF, OPDEF_LDRSH, 0, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSH_POS_INDE_M_REG_OFF, OPDEF_LDRSH, 0, 0, 0, 1, 3)
#undef OPDEF_LDRSH
//-----------------------------------------------------------------------------
// LDRSB
//-----------------------------------------------------------------------------
#define OPDEF_LDRSB(p,u,i,w,cycle)\
d->IROp = IR_LDRx;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->I = i;\
if (i)\
{\
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));\
}\
else\
{\
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);\
}\
d->W = w;\
d->S = 1;\
d->H = 0;\
d->ExecuteCycles = cycle;\
d->VariableCycles = 1;\
d->Reschedule = 2;
DCL_OP1_ARG5(OP_LDRSB_P_IMM_OFF, OPDEF_LDRSB, 1, 1, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRSB_M_IMM_OFF, OPDEF_LDRSB, 1, 0, 1, 0, 3)
DCL_OP1_ARG5(OP_LDRSB_P_REG_OFF, OPDEF_LDRSB, 1, 1, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRSB_M_REG_OFF, OPDEF_LDRSB, 1, 0, 0, 0, 3)
DCL_OP1_ARG5(OP_LDRSB_PRE_INDE_P_IMM_OFF, OPDEF_LDRSB, 1, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_PRE_INDE_M_IMM_OFF, OPDEF_LDRSB, 1, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_PRE_INDE_P_REG_OFF, OPDEF_LDRSB, 1, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_PRE_INDE_M_REG_OFF, OPDEF_LDRSB, 1, 0, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_POS_INDE_P_IMM_OFF, OPDEF_LDRSB, 0, 1, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_POS_INDE_M_IMM_OFF, OPDEF_LDRSB, 0, 0, 1, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_POS_INDE_P_REG_OFF, OPDEF_LDRSB, 0, 1, 0, 1, 3)
DCL_OP1_ARG5(OP_LDRSB_POS_INDE_M_REG_OFF, OPDEF_LDRSB, 0, 0, 0, 1, 3)
#undef OPDEF_LDRSB
//-----------------------------------------------------------------------------
// MRS / MSR
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MRS_CPSR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MRS;
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
//if (d->Rd == 15)
// d->R15Modified = 1;
d->P = 0;
d->FlagsNeeded |= ALL_FLAGS;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MRS_SPSR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MRS;
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->P = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MSR_CPSR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MSR;
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->P = 0;
d->OpData = (opcode.ArmOp >> 16) & 0xF;
if (BIT19(opcode.ArmOp))
d->FlagsSet |= ALL_FLAGS;
if (BIT16(opcode.ArmOp))
d->TbitModified = 1;
d->Reschedule = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MSR_SPSR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MSR;
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->P = 1;
d->OpData = (opcode.ArmOp >> 16) & 0xF;
d->Reschedule = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MSR_CPSR_IMM_VAL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MSR;
d->Immediate = ROR((opcode.ArmOp&0xFF), (opcode.ArmOp>>7)&0x1E);
d->P = 0;
d->I = 1;
d->OpData = (opcode.ArmOp >> 16) & 0xF;
if (BIT19(opcode.ArmOp))
d->FlagsSet |= ALL_FLAGS;
if (BIT16(opcode.ArmOp))
d->TbitModified = 1;
d->Reschedule = 1;
d->ExecuteCycles = 1;
return 1;
}
TEMPLATE u32 FASTCALL OP_MSR_SPSR_IMM_VAL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MSR;
d->Immediate = ROR((opcode.ArmOp&0xFF), (opcode.ArmOp>>7)&0x1E);
d->P = 1;
d->I = 1;
d->OpData = (opcode.ArmOp >> 16) & 0xF;
d->Reschedule = 1;
d->ExecuteCycles = 1;
return 1;
}
//-----------------------------------------------------------------------------
// Branch
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_BX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BX;
d->Rn = ARM_REGPOS(opcode.ArmOp, 0);
d->R15Modified = 1;
d->TbitModified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_BLX_REG(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BLX;
d->Rn = ARM_REGPOS(opcode.ArmOp, 0);
d->R15Modified = 1;
d->TbitModified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
u32 off = (u32)(((s32)opcode.ArmOp<<8)>>8);
d->IROp = IR_B;
d->Immediate = (d->CalcR15(*d) + (off<<2))&0xFFFFFFFC;
d->R15Modified = 1;
d->ExecuteCycles = 3;
return 1;
}
TEMPLATE u32 FASTCALL OP_BL(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
u32 off = (u32)(((s32)opcode.ArmOp<<8)>>8);
d->IROp = IR_BL;
d->Immediate = (d->CalcR15(*d) + (off<<2))&0xFFFFFFFC;
d->R15Modified = 1;
d->ExecuteCycles = 3;
return 1;
}
//-----------------------------------------------------------------------------
// CLZ
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_CLZ(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_CLZ;
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// QADD / QDADD / QSUB / QDSUB
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_QADD(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_QADD;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 3;
}
else
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_QSUB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_QSUB;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 3;
}
else
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_QDADD(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_QDADD;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 3;
}
else
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_QDSUB(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_QDSUB;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
if (d->Rd == 15)
{
d->R15Modified = 1;
d->ExecuteCycles = 3;
}
else
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// SMUL
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMUL_B_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMUL_B_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMUL_T_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMUL_T_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// SMLA
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMLA_B_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLA_B_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLA_T_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLA_T_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// SMLAL
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMLAL_B_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLALxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAL_B_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLALxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 0;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAL_T_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLALxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAL_T_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLALxy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->X = 1;
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// SMULW
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMULW_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULWy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMULW_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMULWy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// SMLAW
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SMLAW_B(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAWy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->Y = 0;
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_SMLAW_T(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SMLAWy;
d->Rd = ARM_REGPOS(opcode.ArmOp, 16);
d->Rn = ARM_REGPOS(opcode.ArmOp, 12);
d->Rs = ARM_REGPOS(opcode.ArmOp, 8);
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
d->Y = 1;
d->ExecuteCycles = 2;
return 1;
}
//-----------------------------------------------------------------------------
// LDR
//-----------------------------------------------------------------------------
#define IMM_OFF_12 \
d->Immediate = ((opcode.ArmOp)&0xFFF);\
d->I = 1;
#define OPDEF_LDR(p,u,b,w,cycle_a,cycle_b)\
d->IROp = IR_LDR;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->B = b;\
d->W = w;\
d->VariableCycles = 1;\
d->ExecuteCycles = cycle_a;\
if (!d->B && d->Rd == 15)\
{\
d->ExecuteCycles = cycle_b;\
d->R15Modified = 1;\
if (PROCNUM == 0) d->TbitModified = 1;\
}\
d->Reschedule = 2;
DCL_OP2_ARG6(OP_LDR_P_IMM_OFF, IMM_OFF_12, OPDEF_LDR, 1, 1, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_IMM_OFF, IMM_OFF_12, OPDEF_LDR, 1, 0, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSL_IMM_OFF, LSL_IMM, OPDEF_LDR, 1, 1, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSL_IMM_OFF, LSL_IMM, OPDEF_LDR, 1, 0, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSR_IMM_OFF, LSR_IMM, OPDEF_LDR, 1, 1, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSR_IMM_OFF, LSR_IMM, OPDEF_LDR, 1, 0, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ASR_IMM_OFF, ASR_IMM, OPDEF_LDR, 1, 1, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ASR_IMM_OFF, ASR_IMM, OPDEF_LDR, 1, 0, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ROR_IMM_OFF, ROR_IMM, OPDEF_LDR, 1, 1, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ROR_IMM_OFF, ROR_IMM, OPDEF_LDR, 1, 0, 0, 0, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_LDR, 1, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_LDR, 1, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_LDR, 1, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_LDR, 1, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_LDR, 1, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_LDR, 1, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_LDR, 1, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_LDR, 1, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_LDR, 1, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_LDR, 1, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_LDR, 0, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_LDR, 0, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_LDR, 0, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_LDR, 0, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_LDR, 0, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_LDR, 0, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_LDR, 0, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_LDR, 0, 0, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_P_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_LDR, 0, 1, 0, 1, 3, 5)
DCL_OP2_ARG6(OP_LDR_M_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_LDR, 0, 0, 0, 1, 3, 5)
//-----------------------------------------------------------------------------
// LDREX
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LDREX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_LDREX;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->VariableCycles = 1;
d->ExecuteCycles = 3;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// LDRB
//-----------------------------------------------------------------------------
DCL_OP2_ARG6(OP_LDRB_P_IMM_OFF, IMM_OFF_12, OPDEF_LDR, 1, 1, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_IMM_OFF, IMM_OFF_12, OPDEF_LDR, 1, 0, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSL_IMM_OFF, LSL_IMM, OPDEF_LDR, 1, 1, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSL_IMM_OFF, LSL_IMM, OPDEF_LDR, 1, 0, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSR_IMM_OFF, LSR_IMM, OPDEF_LDR, 1, 1, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSR_IMM_OFF, LSR_IMM, OPDEF_LDR, 1, 0, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ASR_IMM_OFF, ASR_IMM, OPDEF_LDR, 1, 1, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ASR_IMM_OFF, ASR_IMM, OPDEF_LDR, 1, 0, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ROR_IMM_OFF, ROR_IMM, OPDEF_LDR, 1, 1, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ROR_IMM_OFF, ROR_IMM, OPDEF_LDR, 1, 0, 1, 0, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_LDR, 1, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_LDR, 1, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_LDR, 1, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_LDR, 1, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_LDR, 1, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_LDR, 1, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_LDR, 1, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_LDR, 1, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_LDR, 1, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_LDR, 1, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_LDR, 0, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_LDR, 0, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_LDR, 0, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_LDR, 0, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_LDR, 0, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_LDR, 0, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_LDR, 0, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_LDR, 0, 0, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_P_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_LDR, 0, 1, 1, 1, 3, 3)
DCL_OP2_ARG6(OP_LDRB_M_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_LDR, 0, 0, 1, 1, 3, 3)
//-----------------------------------------------------------------------------
// STR
//-----------------------------------------------------------------------------
#define OPDEF_STR(p,u,b,w,cycle)\
d->IROp = IR_STR;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);\
d->P = p;\
d->U = u;\
d->B = b;\
d->W = w;\
d->VariableCycles = 1;\
d->ExecuteCycles = cycle;\
d->Reschedule = 2;
DCL_OP2_ARG5(OP_STR_P_IMM_OFF, IMM_OFF_12, OPDEF_STR, 1, 1, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_M_IMM_OFF, IMM_OFF_12, OPDEF_STR, 1, 0, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_P_LSL_IMM_OFF, LSL_IMM, OPDEF_STR, 1, 1, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_M_LSL_IMM_OFF, LSL_IMM, OPDEF_STR, 1, 0, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_P_LSR_IMM_OFF, LSR_IMM, OPDEF_STR, 1, 1, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_M_LSR_IMM_OFF, LSR_IMM, OPDEF_STR, 1, 0, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_P_ASR_IMM_OFF, ASR_IMM, OPDEF_STR, 1, 1, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_M_ASR_IMM_OFF, ASR_IMM, OPDEF_STR, 1, 0, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_P_ROR_IMM_OFF, ROR_IMM, OPDEF_STR, 1, 1, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_M_ROR_IMM_OFF, ROR_IMM, OPDEF_STR, 1, 0, 0, 0, 2)
DCL_OP2_ARG5(OP_STR_P_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_STR, 1, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_STR, 1, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_STR, 1, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_STR, 1, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_STR, 1, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_STR, 1, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_STR, 1, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_STR, 1, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_STR, 1, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_STR, 1, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_STR, 0, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_STR, 0, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_STR, 0, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_STR, 0, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_STR, 0, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_STR, 0, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_STR, 0, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_STR, 0, 0, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_P_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_STR, 0, 1, 0, 1, 2)
DCL_OP2_ARG5(OP_STR_M_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_STR, 0, 0, 0, 1, 2)
//-----------------------------------------------------------------------------
// STREX
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_STREX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_STREX;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rm = ARM_REGPOS(opcode.ArmOp, 12);
d->Rd = ARM_REGPOS(opcode.ArmOp, 0);
d->VariableCycles = 1;
d->ExecuteCycles = 2;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// STRB
//-----------------------------------------------------------------------------
DCL_OP2_ARG5(OP_STRB_P_IMM_OFF, IMM_OFF_12, OPDEF_STR, 1, 1, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_M_IMM_OFF, IMM_OFF_12, OPDEF_STR, 1, 0, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_P_LSL_IMM_OFF, LSL_IMM, OPDEF_STR, 1, 1, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_M_LSL_IMM_OFF, LSL_IMM, OPDEF_STR, 1, 0, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_P_LSR_IMM_OFF, LSR_IMM, OPDEF_STR, 1, 1, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_M_LSR_IMM_OFF, LSR_IMM, OPDEF_STR, 1, 0, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_P_ASR_IMM_OFF, ASR_IMM, OPDEF_STR, 1, 1, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_M_ASR_IMM_OFF, ASR_IMM, OPDEF_STR, 1, 0, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_P_ROR_IMM_OFF, ROR_IMM, OPDEF_STR, 1, 1, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_M_ROR_IMM_OFF, ROR_IMM, OPDEF_STR, 1, 0, 1, 0, 2)
DCL_OP2_ARG5(OP_STRB_P_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_STR, 1, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_IMM_OFF_PREIND, IMM_OFF_12, OPDEF_STR, 1, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_STR, 1, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_LSL_IMM_OFF_PREIND, LSL_IMM, OPDEF_STR, 1, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_STR, 1, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_LSR_IMM_OFF_PREIND, LSR_IMM, OPDEF_STR, 1, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_STR, 1, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_ASR_IMM_OFF_PREIND, ASR_IMM, OPDEF_STR, 1, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_STR, 1, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_ROR_IMM_OFF_PREIND, ROR_IMM, OPDEF_STR, 1, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_STR, 0, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_IMM_OFF_POSTIND, IMM_OFF_12, OPDEF_STR, 0, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_STR, 0, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_LSL_IMM_OFF_POSTIND, LSL_IMM, OPDEF_STR, 0, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_STR, 0, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_LSR_IMM_OFF_POSTIND, LSR_IMM, OPDEF_STR, 0, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_STR, 0, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_ASR_IMM_OFF_POSTIND, ASR_IMM, OPDEF_STR, 0, 0, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_P_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_STR, 0, 1, 1, 1, 2)
DCL_OP2_ARG5(OP_STRB_M_ROR_IMM_OFF_POSTIND, ROR_IMM, OPDEF_STR, 0, 0, 1, 1, 2)
//-----------------------------------------------------------------------------
// LDMIA / LDMIB / LDMDA / LDMDB
//-----------------------------------------------------------------------------
#define OPDEF_LDM(p,u,s,w,cycle_a,cycle_b)\
d->IROp = IR_LDM;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->RegisterList = (opcode.ArmOp & 0xFFFF);\
d->P = p;\
d->U = u;\
d->S = s;\
d->W = w;\
d->VariableCycles = 1;\
d->ExecuteCycles = cycle_a;\
d->Reschedule = 2;\
if (s) d->Reschedule = 1;\
if (BIT15(opcode.ArmOp))\
{\
d->ExecuteCycles = cycle_b;\
d->R15Modified = 1;\
if (PROCNUM == 0) d->TbitModified = 1;\
if (s) LOAD_CPSR\
}
DCL_OP1_ARG6(OP_LDMIA, OPDEF_LDM, 0, 1, 0, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMIB, OPDEF_LDM, 1, 1, 0, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMDA, OPDEF_LDM, 0, 0, 0, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMDB, OPDEF_LDM, 1, 0, 0, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMIA_W, OPDEF_LDM, 0, 1, 0, 1, 2, 4)
DCL_OP1_ARG6(OP_LDMIB_W, OPDEF_LDM, 1, 1, 0, 1, 2, 4)
DCL_OP1_ARG6(OP_LDMDA_W, OPDEF_LDM, 0, 0, 0, 1, 2, 2)
DCL_OP1_ARG6(OP_LDMDB_W, OPDEF_LDM, 1, 0, 0, 1, 2, 2)
DCL_OP1_ARG6(OP_LDMIA2, OPDEF_LDM, 0, 1, 1, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMIB2, OPDEF_LDM, 1, 1, 1, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMDA2, OPDEF_LDM, 0, 0, 1, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMDB2, OPDEF_LDM, 1, 0, 1, 0, 2, 2)
DCL_OP1_ARG6(OP_LDMIA2_W, OPDEF_LDM, 0, 1, 1, 1, 2, 2)
DCL_OP1_ARG6(OP_LDMIB2_W, OPDEF_LDM, 1, 1, 1, 1, 2, 2)
DCL_OP1_ARG6(OP_LDMDA2_W, OPDEF_LDM, 0, 0, 1, 1, 2, 2)
DCL_OP1_ARG6(OP_LDMDB2_W, OPDEF_LDM, 1, 0, 1, 1, 2, 2)
//-----------------------------------------------------------------------------
// STMIA / STMIB / STMDA / STMDB
//-----------------------------------------------------------------------------
#define OPDEF_STM(p,u,s,w,cycle)\
d->IROp = IR_STM;\
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);\
d->RegisterList = (opcode.ArmOp & 0xFFFF);\
d->P = p;\
d->U = u;\
d->S = s;\
d->W = w;\
d->Reschedule = 2;\
if (s) d->Reschedule = 1;\
d->VariableCycles = 1;\
d->ExecuteCycles = cycle;
DCL_OP1_ARG5(OP_STMIA, OPDEF_STM, 0, 1, 0, 0, 1)
DCL_OP1_ARG5(OP_STMIB, OPDEF_STM, 1, 1, 0, 0, 1)
DCL_OP1_ARG5(OP_STMDA, OPDEF_STM, 0, 0, 0, 0, 1)
DCL_OP1_ARG5(OP_STMDB, OPDEF_STM, 1, 0, 0, 0, 1)
DCL_OP1_ARG5(OP_STMIA_W, OPDEF_STM, 0, 1, 0, 1, 1)
DCL_OP1_ARG5(OP_STMIB_W, OPDEF_STM, 1, 1, 0, 1, 1)
DCL_OP1_ARG5(OP_STMDA_W, OPDEF_STM, 0, 0, 0, 1, 1)
DCL_OP1_ARG5(OP_STMDB_W, OPDEF_STM, 1, 0, 0, 1, 1)
DCL_OP1_ARG5(OP_STMIA2, OPDEF_STM, 0, 1, 1, 0, 1)
DCL_OP1_ARG5(OP_STMIB2, OPDEF_STM, 1, 1, 1, 0, 1)
DCL_OP1_ARG5(OP_STMDA2, OPDEF_STM, 0, 0, 1, 0, 1)
DCL_OP1_ARG5(OP_STMDB2, OPDEF_STM, 1, 0, 1, 0, 1)
DCL_OP1_ARG5(OP_STMIA2_W, OPDEF_STM, 0, 1, 1, 1, 1)
DCL_OP1_ARG5(OP_STMIB2_W, OPDEF_STM, 1, 1, 1, 1, 1)
DCL_OP1_ARG5(OP_STMDA2_W, OPDEF_STM, 0, 0, 1, 1, 1)
DCL_OP1_ARG5(OP_STMDB2_W, OPDEF_STM, 1, 0, 1, 1, 1)
//-----------------------------------------------------------------------------
// LDRD / STRD
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_LDRD_STRD_POST_INDEX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
if (BIT5(opcode.ArmOp))
d->IROp = IR_STRD;
else
d->IROp = IR_LDRD;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
if (BIT22(opcode.ArmOp))
{
d->I = 1;
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));
}
else
{
d->I = 0;
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
}
d->U = BIT23(opcode.ArmOp);
d->P = 0;
d->W = 1;
d->VariableCycles = 1;
d->ExecuteCycles = 3;
d->Reschedule = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_LDRD_STRD_OFFSET_PRE_INDEX(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
if (BIT5(opcode.ArmOp))
d->IROp = IR_STRD;
else
d->IROp = IR_LDRD;
d->Rn = ARM_REGPOS(opcode.ArmOp, 16);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
if (BIT22(opcode.ArmOp))
{
d->I = 1;
d->Immediate = (((opcode.ArmOp>>4)&0xF0)+(opcode.ArmOp&0xF));
}
else
{
d->I = 0;
d->Rm = ARM_REGPOS(opcode.ArmOp, 0);
}
d->U = BIT23(opcode.ArmOp);
d->P = 1;
d->W = BIT21(opcode.ArmOp);
d->VariableCycles = 1;
d->ExecuteCycles = 3;
d->Reschedule = 2;
return 1;
}
//-----------------------------------------------------------------------------
// STC
// the NDS has no coproc that responses to a STC, no feedback is given to the arm
//-----------------------------------------------------------------------------
DCL_UNDEF_OP(OP_STC_P_IMM_OFF)
DCL_UNDEF_OP(OP_STC_M_IMM_OFF)
DCL_UNDEF_OP(OP_STC_P_PREIND)
DCL_UNDEF_OP(OP_STC_M_PREIND)
DCL_UNDEF_OP(OP_STC_P_POSTIND)
DCL_UNDEF_OP(OP_STC_M_POSTIND)
DCL_UNDEF_OP(OP_STC_OPTION)
//-----------------------------------------------------------------------------
// LDC
// the NDS has no coproc that responses to a LDC, no feedback is given to the arm
//-----------------------------------------------------------------------------
DCL_UNDEF_OP(OP_LDC_P_IMM_OFF)
DCL_UNDEF_OP(OP_LDC_M_IMM_OFF)
DCL_UNDEF_OP(OP_LDC_P_PREIND)
DCL_UNDEF_OP(OP_LDC_M_PREIND)
DCL_UNDEF_OP(OP_LDC_P_POSTIND)
DCL_UNDEF_OP(OP_LDC_M_POSTIND)
DCL_UNDEF_OP(OP_LDC_OPTION)
//-----------------------------------------------------------------------------
// MCR / MRC
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_MCR(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MCR;
d->CRm = ARM_REGPOS(opcode.ArmOp, 0);
d->CP = (opcode.ArmOp>>5)&0x7;
d->CPNum = ARM_REGPOS(opcode.ArmOp, 8);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->CRn = ARM_REGPOS(opcode.ArmOp, 16);
d->CPOpc = (opcode.ArmOp>>21)&0x7;
if (d->CPNum == 15)
{
if (d->CRn == 1 && d->CRm == 0 && d->CPOpc == 0 && d->CP == 0)
d->InvalidICache = 2;
else if (d->CRn == 7 && d->CPOpc == 0)
{
if (d->CRm == 0 && d->CP == 4)
d->Reschedule = 1;
else if (d->CRm == 5 && d->CP >= 0 && d->CP <= 2)
d->InvalidICache = 1;
}
else if (d->CRn == 9 && d->CRm == 1 && d->CPOpc == 0 && d->CP == 0)
d->InvalidICache = 2;
}
d->ExecuteCycles = 2;
return 1;
}
TEMPLATE u32 FASTCALL OP_MRC(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_MRC;
d->CRm = ARM_REGPOS(opcode.ArmOp, 0);
d->CP = (opcode.ArmOp>>5)&0x7;
d->CPNum = ARM_REGPOS(opcode.ArmOp, 8);
d->Rd = ARM_REGPOS(opcode.ArmOp, 12);
d->CRn = ARM_REGPOS(opcode.ArmOp, 16);
d->CPOpc = (opcode.ArmOp>>21)&0x7;
d->ExecuteCycles = 4;
if (d->Rd == 15)
{
d->R15Modified = 1;
d->FlagsSet |= ALL_FLAGS;
}
return 1;
}
//-----------------------------------------------------------------------------
// SWI
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_SWI(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_SWI;
//d->Immediate = (opcode.ArmOp>>16)&0xFF;
d->Immediate = ((opcode.ArmOp>>16)&0xFF) & 0x1F;
bool bypassBuiltinSWI =
(armcpu->intVector == 0x00000000 && armcpu->proc_ID==0)
|| (armcpu->intVector == 0xFFFF0000 && armcpu->proc_ID==1);
if (armcpu->swi_tab && !bypassBuiltinSWI)
{
if (d->Immediate == 0x04 || d->Immediate == 0x05 || d->Immediate == 0x06)
d->Reschedule = 1;
if (d->Immediate == 0x04 || d->Immediate == 0x05)
d->MayHalt = 1;
}
else
{
d->R15Modified = 1;
d->Reschedule = 1;
}
d->VariableCycles = 1;
d->ExecuteCycles = 3;
return 1;
}
//-----------------------------------------------------------------------------
// BKPT
//-----------------------------------------------------------------------------
TEMPLATE u32 FASTCALL OP_BKPT(armcpu_t *armcpu, const OPCODE opcode, struct _Decoded* d)
{
d->IROp = IR_BKPT;
d->R15Modified = 1;
d->ExecuteCycles = 4;
return 1;
}
//-----------------------------------------------------------------------------
// CDP
//-----------------------------------------------------------------------------
DCL_UNDEF_OP(OP_CDP)
};
///////////////////////////////////////////////////////////////////////////////////////////////
static const OpDecoder thumb_opdecoder_set[2][1024] = {{
#define TABDECL(x) ThumbOpDecoder::x<0>
#include "thumb_tabdef.inc"
#undef TABDECL
},{
#define TABDECL(x) ThumbOpDecoder::x<1>
#include "thumb_tabdef.inc"
#undef TABDECL
}};
static const OpDecoder arm_cond_opdecoder_set[2][4096] = {{
#define TABDECL(x) ArmOpDecoder::x<0>
#include "instruction_tabdef.inc"
#undef TABDECL
},{
#define TABDECL(x) ArmOpDecoder::x<1>
#include "instruction_tabdef.inc"
#undef TABDECL
}};
///////////////////////////////////////////////////////////////////////////////////////////////
#define ARM_OPCODE_INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF))
#define THUMB_OPCODE_INDEX(i) ((i)>>6)
#define ARM_CONDITION(i) ((i)>>28)
#define THUMB2_HEAD(i) ((i)>>11)
static const u32 FlagList[] = {
FLAG_Z,
FLAG_C,
FLAG_N,
FLAG_V,
(FLAG_Z|FLAG_C),
(FLAG_N|FLAG_V),
(FLAG_Z|FLAG_N|FLAG_V),
NO_FLAGS
};
static const char *CondStrings[] ={
"(EQ) ",
"(NE) ",
"(CS) ",
"(CC) ",
"(MI) ",
"(PL) ",
"(VS) ",
"(VC) ",
"(HI) ",
"(LS) ",
"(GC) ",
"(LT) ",
"(GT) ",
"(LE) ",
"(AL) ",
"(UNCOND)"
};
static const char *FlagStrings[] = {
"( )",
"( V)",
"( C )",
"( CV)",
"( Z )",
"( Z V)",
"( ZC )",
"( ZCV)",
"(N )",
"(N V)",
"(N C )",
"(N CV)",
"(NZ )",
"(NZ V)",
"(NZC )",
"(NZCV)"
};
typedef struct _ProcessorConfig {
struct ARM
{
static u32 PCOffset[2];
static u32 PCStoreOffset[2]; //IR_STR,IR_STRx,IR_STREX,IR_STM
};
struct THUMB
{
static u32 PCOffset[2];
};
} ProcessorConfig;
u32 _ProcessorConfig::ARM::PCOffset[2] = {8,8};
u32 _ProcessorConfig::ARM::PCStoreOffset[2] = {8,12};
u32 _ProcessorConfig::THUMB::PCOffset[2] = {4,4};
u32 Decoded::CalcR15(const Decoded &d)
{
if (d.ThumbFlag)
return d.Address + ProcessorConfig::THUMB::PCOffset[d.ProcessID];
switch (d.IROp)
{
case IR_STR:
case IR_STRx:
case IR_STREX:
case IR_STM:
return d.Address + ProcessorConfig::ARM::PCStoreOffset[d.ProcessID];
default:
return d.Address + ProcessorConfig::ARM::PCOffset[d.ProcessID];
}
}
u32 Decoded::CalcNextInstruction(const Decoded &d)
{
if (d.ThumbFlag)
return d.Address + 2;
else
return d.Address + 4;
}
std::string ArmAnalyze::DumpInstruction(Decoded *Instructions, s32 InstructionsNum)
{
if (InstructionsNum <= 0)
return "";
char dasmbuf[1024] = {0};
char otherbuf[1024] = {0};
std::string retbuf;
retbuf.reserve(1024);
sprintf(dasmbuf, "CPU : %s, Mode : %s, Count : %d\n", CPU_STR(Instructions[0].ProcessID), Instructions[0].ThumbFlag?"THUMB":"ARM", InstructionsNum);
retbuf.append(dasmbuf);
for (s32 i = 0; i < InstructionsNum; i++)
{
Decoded &Inst = Instructions[i];
if (Inst.ThumbFlag)
des_thumb_instructions_set[THUMB_OPCODE_INDEX(Inst.Instruction.ThumbOp)](Inst.Address, Inst.Instruction.ThumbOp, dasmbuf);
else
des_arm_instructions_set[ARM_OPCODE_INDEX(Inst.Instruction.ArmOp)](Inst.Address, Inst.Instruction.ArmOp, dasmbuf);
sprintf(otherbuf, "%08X : ", Inst.Address);
retbuf.append(otherbuf);
retbuf.append(dasmbuf);
retbuf.append("\n");
}
return retbuf;
}
ArmAnalyze::ArmAnalyze(s32 MaxInstructionsNum, s32 MaxBlocksNum)
{
INFO("sizeof(armcpu_t) = %d\n", sizeof(armcpu_t));
INFO("sizeof(Decoded) = %d\n", sizeof(Decoded));
INFO("sizeof(JitBlock) = %d\n", sizeof(JitBlock));
m_Optimize = false;
m_OptimizeFlag = false;
m_MergeSubBlocks = false;
m_JumpEndDecode = false;
m_Instructions = new Decoded[MaxInstructionsNum + 1];
m_MaxInstructionsNum = MaxInstructionsNum + 1;
m_InstructionsNum = 0;
if (MaxBlocksNum <= 0) MaxBlocksNum = m_MaxInstructionsNum;
m_BlockInfos = new BlockInfo[MaxBlocksNum];
m_MaxBlocksNum = MaxBlocksNum;
m_BlocksNum = 0;
}
ArmAnalyze::~ArmAnalyze()
{
delete [] m_Instructions;
delete [] m_BlockInfos;
}
bool ArmAnalyze::Decode(armcpu_t *armcpu)
{
s32 InstNum = 0;
u32 StartAddress = armcpu->instruct_adr;
u32 AddressStep = 2;
if (armcpu->CPSR.bits.T)
{
StartAddress &= 0xFFFFFFFE;
AddressStep = 2;
}
else
{
StartAddress &= 0xFFFFFFFC;
AddressStep = 4;
}
u32 MaxEndAddress = StartAddress + (m_MaxInstructionsNum - 1) * AddressStep;
memset(m_Instructions, 0, sizeof(Decoded) * m_MaxInstructionsNum);
bool forceLoad = false;
bool newblock = true;
for (InstNum = 0; forceLoad || (InstNum < m_MaxInstructionsNum - 1); InstNum++)
{
Decoded &Inst = m_Instructions[InstNum];
Inst.ProcessID = armcpu->proc_ID;
Inst.Address = StartAddress + InstNum * AddressStep;
Inst.ThumbFlag = armcpu->CPSR.bits.T;
if (newblock)
{
Inst.Block = 1;
newblock = false;
}
armcpu->instruct_adr = Inst.Address;
if (armcpu->CPSR.bits.T)
{
Inst.Instruction.ThumbOp = _MMU_read16(Inst.ProcessID, MMU_AT_CODE, Inst.Address);
Inst.ReadPCMask = 0xFFFFFFFE;
Inst.Cond = 0xE;
// THUMB1
u32 ret = thumb_opdecoder_set[Inst.ProcessID][THUMB_OPCODE_INDEX(Inst.Instruction.ThumbOp)](armcpu, Inst.Instruction, &Inst);
if (ret == 0)
{
INFO("thumb opdecoder failed.\n");
break;
}
// THUMB2
if (Inst.IROp == IR_T32P1)
forceLoad = true;
else if (Inst.IROp == IR_T32P2)
{
forceLoad = false;
if (InstNum == 0)
INFO("thumb2 only has part2.\n");
else
{
Decoded &InstP1 = m_Instructions[InstNum-1];
if (InstP1.IROp == IR_T32P1)
{
if (THUMB2_HEAD(InstP1.Instruction.ThumbOp) == 0x1E
&& THUMB2_HEAD(Inst.Instruction.ThumbOp) == 0x1F)
{
//BL IMM
InstP1.IROp = IR_DUMMY;
Inst.IROp = IR_BL;
u32 op1 = (u32)InstP1.Instruction.ThumbOp;
u32 LR = InstP1.CalcR15(InstP1) + ((((s32)op1<<21)>>21)<<12);
Inst.Immediate = LR + ((Inst.Instruction.ThumbOp&0x7FF)<<1);
}
else if (THUMB2_HEAD(InstP1.Instruction.ThumbOp) == 0x1E
&& THUMB2_HEAD(Inst.Instruction.ThumbOp) == 0x1D)
{
//BLX IMM
InstP1.IROp = IR_DUMMY;
Inst.IROp = IR_BLX_IMM;
u32 op1 = (u32)InstP1.Instruction.ThumbOp;
u32 LR = InstP1.CalcR15(InstP1) + ((((s32)op1<<21)>>21)<<12);
Inst.Immediate = (LR + ((Inst.Instruction.ThumbOp&0x7FF)<<1))&0xFFFFFFFC;
}
else
INFO("thumb2 opdecoder failed.\n");
}
else
INFO("thumb2 only has part2.\n");
}
}
else if (forceLoad && Inst.IROp != IR_T32P2)
{
INFO("thumb2 only has part1.\n");
forceLoad = false;
}
}
else
{
Inst.Instruction.ArmOp = _MMU_read32(Inst.ProcessID, MMU_AT_CODE, Inst.Address);
Inst.ReadPCMask = 0xFFFFFFFC;
Inst.Cond = ARM_CONDITION(Inst.Instruction.ArmOp);
Inst.FlagsNeeded = FlagList[Inst.Cond / 2];
if (Inst.Cond == 0xF)
{
//UnconditionalExtension
Inst.Cond = 0xE;
if ((Inst.Instruction.ArmOp >> 24) & 0xF)
{
u32 off = (((s32)Inst.Instruction.ArmOp<<8)>>8);
u32 H = (Inst.Instruction.ArmOp >> 24) & 0x1;
Inst.IROp = IR_BLX_IMM;
Inst.Immediate = (Inst.CalcR15(Inst) + (off<<2) + H*2)&0xFFFFFFFE;
Inst.R15Modified = 1;
Inst.TbitModified = 1;
Inst.ExecuteCycles = 3;
}
else
{
INFO("arm uncond opdecoder failed.\n");
break;
}
}
else
{
u32 ret = arm_cond_opdecoder_set[Inst.ProcessID][ARM_OPCODE_INDEX(Inst.Instruction.ArmOp)](armcpu, Inst.Instruction, &Inst);
if (ret == 0)
{
INFO("arm opdecoder failed.\n");
break;
}
}
}
if ((Inst.Rd == 15 || Inst.Rn == 15 || Inst.Rm == 15 || Inst.Rs == 15 || (Inst.RegisterList & (1<<15))))
Inst.R15Used = 1;
if (Inst.IROp == IR_B || Inst.IROp == IR_BL || Inst.IROp == IR_BLX_IMM)
{
if (Inst.Immediate >= StartAddress && Inst.Immediate <= MaxEndAddress)
{
u32 slot = (Inst.Immediate - StartAddress) / AddressStep;
m_Instructions[slot].Block = 1;
}
}
if (Inst.Reschedule == 1 && Inst.Cond != 0xE && Inst.Cond != 0xF)
Inst.Reschedule = 2;
else if (Inst.Reschedule == 1 && (Inst.Cond == 0xE || Inst.Cond == 0xF))
newblock = true;
if (Inst.MayHalt || Inst.InvalidICache)
newblock = true;
if (Inst.IROp == IR_UND)
break;
if ((Inst.R15Modified || Inst.TbitModified)
&& (m_JumpEndDecode || Inst.Cond == 0xE || Inst.Cond == 0xF))
{
InstNum++;
break;
}
}
armcpu->instruct_adr = StartAddress;
IF_DEVELOPER(if(InstNum>m_MaxInstructionsNum) INFO("armanalyze overflow(%u, %u).\n", InstNum, m_MaxInstructionsNum););
m_InstructionsNum = InstNum;
return InstNum > 0;
}
bool ArmAnalyze::CreateBlocks()
{
s32 CurBlock = -1;
s32 InstNum = 0;
s32 CurBlockInstNum = 0;
for (; InstNum < m_InstructionsNum; InstNum++)
{
if (m_Instructions[InstNum].Block == 1)
{
if (CurBlock >= 0)
{
BlockInfo &Block = m_BlockInfos[CurBlock];
Block.R15Num = OptimizeFlag(Block.Instructions, CurBlockInstNum);
Block.SubBlocks = CreateSubBlocks(Block.Instructions, CurBlockInstNum);
Block.InstructionsNum = Optimize(Block.Instructions, CurBlockInstNum);
}
CurBlock++;
if (CurBlock >= m_MaxBlocksNum)
break;
CurBlockInstNum = 1;
m_BlockInfos[CurBlock].Instructions = &m_Instructions[InstNum];
}
else
{
CurBlockInstNum++;
}
}
if (CurBlock >= 0)
{
BlockInfo &Block = m_BlockInfos[CurBlock];
Block.R15Num = OptimizeFlag(Block.Instructions, CurBlockInstNum);
Block.SubBlocks = CreateSubBlocks(Block.Instructions, CurBlockInstNum);
Block.InstructionsNum = Optimize(Block.Instructions, CurBlockInstNum);
}
m_BlocksNum = CurBlock + 1;
return m_BlocksNum > 0;
}
void ArmAnalyze::GetInstructions(Decoded *&Instructions, s32 &InstructionsNum)
{
Instructions = m_Instructions;
InstructionsNum = m_InstructionsNum;
}
void ArmAnalyze::GetBlocks(BlockInfo *&BlockInfos, s32 &BlocksNum)
{
BlockInfos = m_BlockInfos;
BlocksNum = m_BlocksNum;
}
s32 ArmAnalyze::Optimize(Decoded *Instructions, s32 InstructionsNum)
{
if (!m_Optimize)
return InstructionsNum;
for (s32 i = 0; i < InstructionsNum; i++)
{
}
return InstructionsNum;
}
u32 ArmAnalyze::OptimizeFlag(Decoded *Instructions, s32 InstructionsNum)
{
u32 R15Num = 0;
if (!m_OptimizeFlag)
{
for (s32 i = InstructionsNum - 1; i >= 0; i--)
{
Decoded &Inst = Instructions[i];
if (Inst.R15Modified || Inst.R15Used)
R15Num++;
}
return R15Num;
}
u32 FlagsToGenerate = 0;
u32 FlagsNeeded = ALL_FLAGS;
for (s32 i = InstructionsNum - 1; i >= 0; i--)
{
Decoded &Inst = Instructions[i];
if (Inst.R15Modified || Inst.R15Used)
R15Num++;
if (Inst.FlagsNeeded || Inst.FlagsSet ||
Inst.R15Modified/* || Inst.TbitModified*/)
{
FlagsToGenerate = FlagsNeeded & Inst.FlagsSet;
//INFO("%s", DumpInstruction(&Inst, 1).c_str());
//INFO("ArmAnalyze::OptimizeFlag() : [%s %s]\n", FlagStrings[Inst.FlagsSet], FlagStrings[FlagsToGenerate]);
Inst.FlagsSet = FlagsToGenerate;
if (Inst.Cond != 0xE && Inst.Cond != 0xF)
{
FlagsNeeded |= Inst.FlagsNeeded;
}
else
{
FlagsNeeded = (FlagsNeeded & ~FlagsToGenerate) | Inst.FlagsNeeded;
}
if (Inst.R15Modified/* || Inst.TbitModified*/)
{
FlagsNeeded = ALL_FLAGS;
}
}
}
//INFO("\n\n");
return R15Num;
}
s32 ArmAnalyze::CreateSubBlocks(Decoded *Instructions, s32 InstructionsNum)
{
if (InstructionsNum <= 0)
return 0;
u32 nSubBlocks = 0;
u32 Cond = Instructions[0].Cond;
u32 CondFlg = FlagList[Cond / 2];
bool bNewBlock = true;
if (m_MergeSubBlocks)
{
for (s32 i = 0; i < InstructionsNum; i++)
{
Decoded &Inst = Instructions[i];
if (Cond != Inst.Cond)
bNewBlock = true;
if (bNewBlock)
{
Cond = Inst.Cond;
CondFlg = FlagList[Cond / 2];
nSubBlocks++;
bNewBlock = false;
}
Inst.SubBlock = nSubBlocks;
if (CondFlg & Inst.FlagsSet)
bNewBlock = true;
}
}
else
{
for (s32 i = 0; i < InstructionsNum; i++)
{
Decoded &Inst = Instructions[i];
if ((Cond != 0xE && Cond != 0xF) ||
Cond != Inst.Cond)
bNewBlock = true;
if (bNewBlock)
{
Cond = Inst.Cond;
nSubBlocks++;
bNewBlock = false;
}
Inst.SubBlock = nSubBlocks;
}
}
return nSubBlocks;
}
================================================
FILE: app/src/main/jni/desmume/src/ArmAnalyze.h
================================================
/*
Copyright (C) 2008-2010 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#ifndef ARM_ANALYZE
#define ARM_ANALYZE
#include "common.h"
#define FLAG_N (1<<3) // sign (neg)
#define FLAG_Z (1<<2) // zero
#define FLAG_C (1<<1) // carry
#define FLAG_V (1<<0) // overflow
#define ALL_FLAGS (FLAG_N|FLAG_Z|FLAG_C|FLAG_V)
#define NO_FLAGS 0
enum IROpCode
{
IR_UND,
IR_NOP,
IR_DUMMY,
IR_T32P1, //Part1 of THUMB2
IR_T32P2, //Part2 of THUMB2
//Logical Operations
IR_MOV, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_MVN, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_AND, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_TST, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_EOR, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_TEQ, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_ORR, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_BIC, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
//Arithmetic Operations
IR_ADD, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_ADC, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_SUB, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_SBC, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_RSB, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_RSC, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_CMP, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
IR_CMN, //I=0?REG:IMM, R=0?ShiftIsImm:ShiftIsReg, Typ=ShiftOp
//Multiply
IR_MUL,
IR_MLA,
IR_UMULL, //RdHi=Rd,RdLo=Rn
IR_UMLAL, //RdHi=Rd,RdLo=Rn
IR_SMULL, //RdHi=Rd,RdLo=Rn
IR_SMLAL, //RdHi=Rd,RdLo=Rn
IR_SMULxy, //Rm:X=0?Lower_16bit:Upper_16bit, Rs:Y=0?Lower_16bit:Upper_16bit
IR_SMLAxy, //Rm:X=0?Lower_16bit:Upper_16bit, Rs:Y=0?Lower_16bit:Upper_16bit
IR_SMULWy, //Rs:Y=0?Lower_16bit:Upper_16bit
IR_SMLAWy, //Rs:Y=0?Lower_16bit:Upper_16bit
IR_SMLALxy, //Rm:X=0?Lower_16bit:Upper_16bit, Rs:Y=0?Lower_16bit:Upper_16bit;RdHi=Rd,RdLo=Rn
//Memory Load/Store
IR_LDR, //P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB, B=0?Word:Byte, //I=0?REG:IMM
IR_STR, //P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB, B=0?Word:Byte, //I=0?REG:IMM
IR_LDRx, //P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB, S=0?unsigned:signed, H=0?byte:halfword, I=0?REG:IMM
IR_STRx, //P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB, S=0?unsigned:signed, H=0?byte:halfword, I=0?REG:IMM
IR_LDRD, //I=0?REG:IMM, P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB
IR_STRD, //I=0?REG:IMM, P=0?Post:Pre, U=0?Down:Up, W=0?no_WB:WB
IR_LDREX,
IR_STREX,
IR_LDM, //P=0?Post:Pre, U=0?Down:Up, S=0?No:load_PSR_or_force_user_mode, W=0?no_WB:WB
IR_STM, //P=0?Post:Pre, U=0?Down:Up, S=0?No:load_PSR_or_force_user_mode, W=0?no_WB:WB
IR_SWP,
//Jumps, Calls
IR_B, //IMM
IR_BL, //IMM
IR_BX, //REG
IR_BLX, //REG
IR_SWI,
//CPSR Mode
IR_MSR, //P=0?CPSR:SPSR
IR_MRS, //P=0?CPSR:SPSR
//Coprocessor Functions
//IR_CDP,
//IR_STC,
//IR_LDC,
IR_MCR,
IR_MRC,
//IR_MCRR,
//IR_MRRC,
//Others
IR_CLZ,
IR_QADD,
IR_QSUB,
IR_QDADD,
IR_QDSUB,
//UnconditionalExtension
//IR_PLD,
IR_BLX_IMM, //IMM
//IR_CDP2,
//IR_LDC2,
//IR_STC2,
//IR_MCR2,
//IR_MRC2,
//Debug
IR_BKPT,
//IR Num
IR_MAXNUM
};
enum IRShiftOpCode
{
IRSHIFT_UND,
IRSHIFT_LSL,
IRSHIFT_LSR,
IRSHIFT_ASR,
IRSHIFT_ROR
};
typedef union _OPCODE {
u32 ArmOp;
u16 ThumbOp;
} OPCODE;
#define INVALID_SUBBLOCK 0
typedef struct _Decoded
{
u16 Block;
u16 SubBlock;
u32 ProcessID;
u32 Address;
OPCODE Instruction;
u32 ExecuteCycles;
u32 VariableCycles:1;
u32 Cond:4;
u32 ThumbFlag:1;
u32 R15Used:1;
u32 R15Modified:1;
u32 TbitModified:1;
u32 Reschedule:2;//1:always reschedule, 2:may reschedule
u32 InvalidICache:2;//1:clean ICache, 2:clean jit cache
u32 MayHalt:1;
u8 FlagsNeeded:4;
u8 FlagsSet:4;
IROpCode IROp;
u32 ReadPCMask;
u32 OpData;//used in IR_MSR
u32 Immediate;
// Registers
u32 Rd:4;
u32 Rn:4;
u32 Rm:4;
u32 Rs:4;
u16 RegisterList;
// Coprocs
u32 CP:3;
u32 CRd:4;
u32 CRm:4;
u32 CRn:4;
u32 CPNum:4;
u32 CPOpc:4;
u32 I:1;
u32 S:1;
//u32 L:1;
u32 P:1;
//u32 A:1;
u32 U:1;
u32 X:1;
u32 Y:1;
u32 B:1;
u32 W:1;
u32 H:1;
//u32 N:1;
u32 R:1;
u32 Typ:3;
// CalcR15
static u32 CalcR15(const _Decoded &Instruction);
//
static u32 CalcNextInstruction(const _Decoded &Instruction);
}Decoded;
typedef struct _BlockInfo
{
Decoded *Instructions;
s32 InstructionsNum;
s32 R15Num;
s32 SubBlocks;
}BlockInfo;
struct ArmAnalyze
{
public:
static std::string DumpInstruction(Decoded *Instructions, s32 InstructionsNum);
public:
ArmAnalyze(s32 MaxInstructionsNum, s32 MaxBlocksNum = 0);
~ArmAnalyze();
bool Decode(struct armcpu_t *armcpu);
bool CreateBlocks();
void GetInstructions(Decoded *&Instructions, s32 &InstructionsNum);
void GetBlocks(BlockInfo *&BlockInfos, s32 &BlocksNum);
protected:
s32 Optimize(Decoded *Instructions, s32 InstructionsNum);
u32 OptimizeFlag(Decoded *Instructions, s32 InstructionsNum);
s32 CreateSubBlocks(Decoded *Instructions, s32 InstructionsNum);
public:
bool m_Optimize;
bool m_OptimizeFlag;
bool m_MergeSubBlocks;
bool m_JumpEndDecode;
protected:
Decoded *m_Instructions;
s32 m_MaxInstructionsNum;
s32 m_InstructionsNum;
BlockInfo *m_BlockInfos;
s32 m_MaxBlocksNum;
s32 m_BlocksNum;
};
#endif
================================================
FILE: app/src/main/jni/desmume/src/ArmAnalyze_tabdef.inc
================================================
/*
Copyright (C) 2006 yopyop
Copyright (C) 2007-2012 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
TABDECL(IR_UND),
TABDECL(IR_NOP),
TABDECL(IR_DUMMY),
TABDECL(IR_T32P1),
TABDECL(IR_T32P2),
TABDECL(IR_MOV),
TABDECL(IR_MVN),
TABDECL(IR_AND),
TABDECL(IR_TST),
TABDECL(IR_EOR),
TABDECL(IR_TEQ),
TABDECL(IR_ORR),
TABDECL(IR_BIC),
TABDECL(IR_ADD),
TABDECL(IR_ADC),
TABDECL(IR_SUB),
TABDECL(IR_SBC),
TABDECL(IR_RSB),
TABDECL(IR_RSC),
TABDECL(IR_CMP),
TABDECL(IR_CMN),
TABDECL(IR_MUL),
TABDECL(IR_MLA),
TABDECL(IR_UMULL),
TABDECL(IR_UMLAL),
TABDECL(IR_SMULL),
TABDECL(IR_SMLAL),
TABDECL(IR_SMULxy),
TABDECL(IR_SMLAxy),
TABDECL(IR_SMULWy),
TABDECL(IR_SMLAWy),
TABDECL(IR_SMLALxy),
TABDECL(IR_LDR),
TABDECL(IR_STR),
TABDECL(IR_LDRx),
TABDECL(IR_STRx),
TABDECL(IR_LDRD),
TABDECL(IR_STRD),
TABDECL(IR_LDREX),
TABDECL(IR_STREX),
TABDECL(IR_LDM),
TABDECL(IR_STM),
TABDECL(IR_SWP),
TABDECL(IR_B),
TABDECL(IR_BL),
TABDECL(IR_BX),
TABDECL(IR_BLX),
TABDECL(IR_SWI),
TABDECL(IR_MSR),
TABDECL(IR_MRS),
//TABDECL(IR_CDP),
//TABDECL(IR_STC),
//TABDECL(IR_LDC),
TABDECL(IR_MCR),
TABDECL(IR_MRC),
//TABDECL(IR_MCRR),
//TABDECL(IR_MRRC),
TABDECL(IR_CLZ),
TABDECL(IR_QADD),
TABDECL(IR_QSUB),
TABDECL(IR_QDADD),
TABDECL(IR_QDSUB),
//TABDECL(IR_PLD),
TABDECL(IR_BLX_IMM),
//TABDECL(IR_CDP2),
//TABDECL(IR_LDC2),
//TABDECL(IR_STC2),
//TABDECL(IR_MCR2),
//TABDECL(IR_MRC2),
TABDECL(IR_BKPT),
================================================
FILE: app/src/main/jni/desmume/src/ArmCJit.cpp
================================================
/*
Copyright (C) 2008-2010 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#include "ArmCJit.h"
#include "ArmAnalyze.h"
#include "instructions.h"
#include "Disassembler.h"
#include "armcpu.h"
#include "MMU.h"
#include "MMU_timing.h"
#include "JitCommon.h"
#include "utils/MemBuffer.h"
#include "utils/tinycc/libtcc.h"
#ifdef HAVE_JIT
#define GETCPUPTR (&ARMPROC)
#define GETCPU (ARMPROC)
#define READREG(i) ((i)==15?(d.CalcR15(d)&d.ReadPCMask):GETCPU.R[(i)])
#define REG_R(i) (i)==15?"_C":"",(i)==15?(u32*)(d.CalcR15(d)&d.ReadPCMask):&(GETCPU.R[(i)])
#define REG_W(i) (&(GETCPU.R[(i)]))
#define REG(i) (&(GETCPU.R[(i)]))
#define REGPTR(i) (&(GETCPU.R[(i)]))
#define TEMPLATE template
#define OPCDECODER_DECL(name) void FASTCALL name##_CDecoder(const Decoded &d, char *&szCodeBuffer)
#define WRITE_CODE(...) szCodeBuffer += sprintf(szCodeBuffer, __VA_ARGS__)
typedef void (FASTCALL* IROpCDecoder)(const Decoded &d, char *&szCodeBuffer);
typedef u32 (FASTCALL* Interpreter)(const Decoded &d);
typedef u32 (FASTCALL* MemOp1)(u32, u32*);
typedef u32 (FASTCALL* MemOp2)(u32, u32);
typedef u32 (* MemOp3)(u32, u32, u32*);
typedef u32 (* MemOp4)(u32, u32*, u32);
// (*(u32*)0x11)
// ((u32 (FASTCALL *)(u32,u32))0x11)(1,1);
// #define REG_R(p) (*(u32*)p)
// #define REG_SR(p) (*(s32*)p)
// #define REG_R_C(p) ((u32)p)
// #define REG_SR_C(p) ((s32)p)
// #define REG_W(p) (*(u32*)p)
// #define REG(p) (*(u32*)p)
// #define REGPTR(p) ((u32*)p)
namespace ArmCJit
{
//------------------------------------------------------------
// Memory type
//------------------------------------------------------------
enum {
MEMTYPE_GENERIC = 0, // no assumptions
MEMTYPE_MAIN = 1, // arm9:r/w arm7:r/w
MEMTYPE_DTCM_ARM9 = 2, // arm9:r/w
MEMTYPE_ERAM_ARM7 = 3, // arm7:r/w
MEMTYPE_SWIRAM = 4, // arm9:r/w arm7:r/w
MEMTYPE_COUNT,
};
u32 GuessAddressArea(u32 PROCNUM, u32 adr)
{
if(PROCNUM==ARMCPU_ARM9 && (adr & ~0x3FFF) == MMU.DTCMRegion)
return MEMTYPE_DTCM_ARM9;
else if((adr & 0x0F000000) == 0x02000000)
return MEMTYPE_MAIN;
else if(PROCNUM==ARMCPU_ARM7 && (adr & 0xFF800000) == 0x03800000)
return MEMTYPE_ERAM_ARM7;
else if((adr & 0xFF800000) == 0x03000000)
return MEMTYPE_SWIRAM;
else
return MEMTYPE_GENERIC;
}
u32 GuessAddressArea(u32 PROCNUM, u32 adr_s, u32 adr_e)
{
u32 mt_s = GuessAddressArea(PROCNUM, adr_s);
u32 mt_e = GuessAddressArea(PROCNUM, adr_e);
if (mt_s != mt_e)
return MEMTYPE_GENERIC;
return mt_s;
}
//------------------------------------------------------------
// Help function
//------------------------------------------------------------
u32 FASTCALL CalcShiftOp(const Decoded &d)
{
u32 PROCNUM = d.ProcessID;
u32 shiftop = 0;
switch (d.Typ)
{
case IRSHIFT_LSL:
if (!d.R)
shiftop = READREG(d.Rm)<= 32)
shiftop = 0;
else
shiftop = READREG(d.Rm)<>d.Immediate;
else
shiftop = 0;
}
else
{
shiftop = READREG(d.Rs)&0xFF;
if (shiftop >= 32)
shiftop = 0;
else
shiftop = READREG(d.Rm)>>shiftop;
}
break;
case IRSHIFT_ASR:
if (!d.R)
{
if (d.Immediate)
shiftop = (u32)(((s32)READREG(d.Rm))>>d.Immediate);
else
shiftop = BIT31(READREG(d.Rm))*0xFFFFFFFF;
}
else
{
shiftop = READREG(d.Rs)&0xFF;
if (shiftop == 32)
shiftop = READREG(d.Rm);
else if(shiftop<32)
shiftop = (u32)(((s32)READREG(d.Rm))>>shiftop);
else
shiftop = BIT31(READREG(d.Rm))*0xFFFFFFFF;
}
break;
case IRSHIFT_ROR:
if (!d.R)
{
if (d.Immediate)
shiftop = ROR(READREG(d.Rm),d.Immediate);
else
shiftop = ((u32)GETCPU.CPSR.bits.C<<31)|(READREG(d.Rm)>>1);
}
else
{
shiftop = READREG(d.Rs)&0x1F;
if (shiftop == 0)
shiftop = READREG(d.Rm);
else
shiftop = ROR(READREG(d.Rm),(shiftop&0x1F));
}
break;
}
return shiftop;
}
void FASTCALL IRShiftOpGenerate(const Decoded &d, char *&szCodeBuffer, bool clacCarry)
{
u32 PROCNUM = d.ProcessID;
switch (d.Typ)
{
case IRSHIFT_LSL:
if (!d.R)
{
if (clacCarry)
{
if (d.Immediate == 0)
WRITE_CODE("u32 c = ((Status_Reg*)%#p)->bits.C;\n", &(GETCPU.CPSR));
else
WRITE_CODE("u32 c = BIT_N(REG_R%s(%#p), %u);\n", REG_R(d.Rm), 32-d.Immediate);
}
if (d.Immediate == 0)
WRITE_CODE("u32 shift_op = REG_R%s(%#p);\n", REG_R(d.Rm));
else
WRITE_CODE("u32 shift_op = REG_R%s(%#p)<<%u;\n", REG_R(d.Rm), d.Immediate);
}
else
{
if (clacCarry)
{
WRITE_CODE("u32 c;\n");
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0){\n");
WRITE_CODE("c=((Status_Reg*)%#p)->bits.C;\n", &(GETCPU.CPSR));
WRITE_CODE("shift_op=REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("}else if (shift_op < 32){\n");
WRITE_CODE("c = BIT_N(REG_R%s(%#p), 32-shift_op);\n", REG_R(d.Rm));
WRITE_CODE("shift_op = REG_R%s(%#p)<= 32)\n");
WRITE_CODE("shift_op=0;\n");
WRITE_CODE("else\n");
WRITE_CODE("shift_op=REG_R%s(%#p)<>%u;\n", REG_R(d.Rm), d.Immediate);
}
else
{
if (clacCarry)
{
WRITE_CODE("u32 c;\n");
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0){\n");
WRITE_CODE("c=((Status_Reg*)%#p)->bits.C;\n", &(GETCPU.CPSR));
WRITE_CODE("shift_op=REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("}else if (shift_op < 32){\n");
WRITE_CODE("c = BIT_N(REG_R%s(%#p), shift_op-1);\n", REG_R(d.Rm));
WRITE_CODE("shift_op = REG_R%s(%#p)>>shift_op;\n", REG_R(d.Rm));
WRITE_CODE("}else if (shift_op == 32){\n");
WRITE_CODE("c = BIT31(REG_R%s(%#p));\n", REG_R(d.Rm));
WRITE_CODE("shift_op=0;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("shift_op=c=0;}\n");
}
else
{
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n",REG_R(d.Rs));
WRITE_CODE("if (shift_op >= 32)\n");
WRITE_CODE("shift_op=0;\n");
WRITE_CODE("else\n");
WRITE_CODE("shift_op=REG_R%s(%#p)>>shift_op;\n", REG_R(d.Rm));
}
}
break;
case IRSHIFT_ASR:
if (!d.R)
{
if (clacCarry)
{
if (d.Immediate == 0)
WRITE_CODE("u32 c = BIT31(REG_R%s(%#p));\n", REG_R(d.Rm));
else
WRITE_CODE("u32 c = BIT_N(REG_R%s(%#p), %u);\n", REG_R(d.Rm), d.Immediate-1);
}
if (d.Immediate == 0)
WRITE_CODE("u32 shift_op = BIT31(REG_R%s(%#p))*0xFFFFFFFF;\n", REG_R(d.Rm));
else
WRITE_CODE("u32 shift_op = (u32)(REG_SR%s(%#p)>>%u);\n", REG_R(d.Rm), d.Immediate);
}
else
{
if (clacCarry)
{
WRITE_CODE("u32 c;\n");
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0){\n");
WRITE_CODE("c=((Status_Reg*)%#p)->bits.C;\n", &(GETCPU.CPSR));
WRITE_CODE("shift_op = REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("}else if (shift_op < 32){\n");
WRITE_CODE("c = BIT_N(REG_R%s(%#p), shift_op-1);\n", REG_R(d.Rm));
WRITE_CODE("shift_op = (u32)(REG_SR%s(%#p)>>shift_op);\n", REG_R(d.Rm));
WRITE_CODE("}else{\n");
WRITE_CODE("c = BIT31(REG_R%s(%#p));\n", REG_R(d.Rm));
WRITE_CODE("shift_op = BIT31(REG_R%s(%#p))*0xFFFFFFFF;}\n", REG_R(d.Rm));
}
else
{
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0)\n");
WRITE_CODE("shift_op = REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("else if (shift_op < 32)\n");
WRITE_CODE("shift_op = (u32)(REG_SR%s(%#p)>>shift_op);\n", REG_R(d.Rm));
WRITE_CODE("else\n");
WRITE_CODE("shift_op = BIT31(REG_R%s(%#p))*0xFFFFFFFF;\n", REG_R(d.Rm));
}
}
break;
case IRSHIFT_ROR:
if (!d.R)
{
if (clacCarry)
{
if (d.Immediate == 0)
WRITE_CODE("u32 c = BIT0(REG_R%s(%#p));\n", REG_R(d.Rm));
else
WRITE_CODE("u32 c = BIT_N(REG_R%s(%#p), %u);\n", REG_R(d.Rm), d.Immediate-1);
}
if (d.Immediate == 0)
WRITE_CODE("u32 shift_op = (((u32)((Status_Reg*)%#p)->bits.C)<<31)|(REG_R%s(%#p)>>1);\n", &(GETCPU.CPSR), REG_R(d.Rm));
else
WRITE_CODE("u32 shift_op = ROR(REG_R%s(%#p), %u);\n", REG_R(d.Rm), d.Immediate);
}
else
{
if (clacCarry)
{
WRITE_CODE("u32 c;\n");
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0xFF;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0){\n");
WRITE_CODE("c=((Status_Reg*)%#p)->bits.C;\n", &(GETCPU.CPSR));
WRITE_CODE("shift_op = REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("}else{\n");
WRITE_CODE("shift_op &= 0x1F;\n");
WRITE_CODE("if (shift_op != 0){\n");
WRITE_CODE("c = BIT_N(REG_R%s(%#p), shift_op-1);\n", REG_R(d.Rm));
WRITE_CODE("shift_op = ROR(REG_R%s(%#p), shift_op);\n", REG_R(d.Rm));
WRITE_CODE("}else{\n");
WRITE_CODE("c = BIT31(REG_R%s(%#p));\n", REG_R(d.Rm));
WRITE_CODE("shift_op = REG_R%s(%#p);}}\n", REG_R(d.Rm));
}
else
{
WRITE_CODE("u32 shift_op = REG_R%s(%#p)&0x1F;\n", REG_R(d.Rs));
WRITE_CODE("if (shift_op == 0)\n");
WRITE_CODE("shift_op = REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("else\n");
WRITE_CODE("shift_op = ROR(REG_R%s(%#p), shift_op);\n", REG_R(d.Rm));
}
}
break;
default:
INFO("Unknow Shift Op : %u.\n", d.Typ);
if (clacCarry)
WRITE_CODE("u32 c = 0;\n");
WRITE_CODE("u32 shift_op = 0;\n");
break;
}
}
void FASTCALL DataProcessLoadCPSRGenerate(const Decoded &d, char *&szCodeBuffer)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("{\n");
WRITE_CODE("Status_Reg SPSR;\n");
WRITE_CODE("SPSR.val = ((Status_Reg*)%#p)->val;\n", &(GETCPU.SPSR));
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,SPSR.bits.mode);\n", armcpu_switchMode, GETCPUPTR);
WRITE_CODE("((Status_Reg*)%#p)->val = SPSR.val;\n", &(GETCPU.CPSR));
WRITE_CODE("((void (*)(void*))%#p)((void*)%#p);\n", armcpu_changeCPSR, GETCPUPTR);
WRITE_CODE("REG_W(%#p)&=(0xFFFFFFFC|((((Status_Reg*)%#p)->bits.T)<<1));\n", REG_W(15), &(GETCPU.CPSR));
WRITE_CODE("}\n");
}
void FASTCALL LDM_S_LoadCPSRGenerate(const Decoded &d, char *&szCodeBuffer)
{
u32 PROCNUM = d.ProcessID;
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
void FASTCALL R15ModifiedGenerate(const Decoded &d, char *&szCodeBuffer)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("(*(u32*)%#p) = REG(%#p);\n", &(GETCPU.instruct_adr), REG(15));
WRITE_CODE("return ExecuteCycles;\n");
}
//------------------------------------------------------------
// IROp decoder
//------------------------------------------------------------
OPCDECODER_DECL(IR_UND)
{
u32 PROCNUM = d.ProcessID;
INFO("IR_UND\n");
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruction), d.ThumbFlag?d.Instruction.ThumbOp:d.Instruction.ArmOp);
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), d.Address);
WRITE_CODE("((u32 (*)(void*))%#p)((void*)%#p);\n", TRAPUNDEF, GETCPUPTR);
WRITE_CODE("return ExecuteCycles;\n");
}
OPCDECODER_DECL(IR_NOP)
{
}
OPCDECODER_DECL(IR_DUMMY)
{
}
OPCDECODER_DECL(IR_T32P1)
{
u32 PROCNUM = d.ProcessID;
INFO("IR_T32P1\n");
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruction), d.ThumbFlag?d.Instruction.ThumbOp:d.Instruction.ArmOp);
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), d.Address);
WRITE_CODE("((u32 (*)(void*))%#p)((void*)%#p);\n", TRAPUNDEF, GETCPUPTR);
WRITE_CODE("return ExecuteCycles;\n");
}
OPCDECODER_DECL(IR_T32P2)
{
u32 PROCNUM = d.ProcessID;
INFO("IR_T32P2\n");
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruction), d.ThumbFlag?d.Instruction.ThumbOp:d.Instruction.ArmOp);
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), d.Address);
WRITE_CODE("((u32 (*)(void*))%#p)((void*)%#p);\n", TRAPUNDEF, GETCPUPTR);
WRITE_CODE("return ExecuteCycles;\n");
}
OPCDECODER_DECL(IR_MOV)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("REG_W(%#p)=%u;\n",REG_W(d.Rd), d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=%u;\n", &(GETCPU.CPSR), d.Immediate==0 ? 1 : 0);
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("REG_W(%#p)=shift_op;\n", REG_W(d.Rd));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_MVN)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(d.Rd), ~d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=%u;\n", &(GETCPU.CPSR), BIT31(~d.Immediate));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=%u;\n", &(GETCPU.CPSR), (~d.Immediate)==0 ? 1 : 0);
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_W(%#p)=~shift_op;\n", REG_W(d.Rd));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_AND)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_W(%#p)=REG_R%s(%#p)&%u;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_W(%#p)=REG_R%s(%#p)&shift_op;\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_TST)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_R%s(%#p)&%u;\n", REG_R(d.Rn), d.Immediate);
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_R%s(%#p)&shift_op;\n", REG_R(d.Rn));
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
}
OPCDECODER_DECL(IR_EOR)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_W(%#p)=REG_R%s(%#p)^%u;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_W(%#p)=REG_R%s(%#p)^shift_op;\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_TEQ)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_R%s(%#p)^%u;\n", REG_R(d.Rn), d.Immediate);
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_R%s(%#p)^shift_op;\n", REG_R(d.Rn));
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
}
OPCDECODER_DECL(IR_ORR)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_W(%#p)=REG_R%s(%#p)|%u;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_W(%#p)=REG_R%s(%#p)|shift_op;\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_BIC)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 shift_op=REG_W(%#p)=REG_R%s(%#p)&%u;\n", REG_W(d.Rd), REG_R(d.Rn), ~d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u;\n", &(GETCPU.CPSR), BIT31(d.Immediate));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
else
{
const bool clacCarry = d.S && !d.R15Modified && (d.FlagsSet & FLAG_C);
IRShiftOpGenerate(d, szCodeBuffer, clacCarry);
WRITE_CODE("shift_op=REG_W(%#p)=REG_R%s(%#p)&(~shift_op);\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=c;\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(shift_op==0);\n", &(GETCPU.CPSR));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_ADD)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)+%u;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate);
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=CarryFrom(v, %u);\n", &(GETCPU.CPSR), d.Immediate);
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromADD(REG(%#p), v, %u);\n", &(GETCPU.CPSR), REG(d.Rd), d.Immediate);
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)+shift_op;\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=CarryFrom(v, shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromADD(REG(%#p), v, shift_op);\n", &(GETCPU.CPSR), REG(d.Rd));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_ADC)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)+%u+((Status_Reg*)%#p)->bits.C;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate, &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((v^%u^-1) & (v^REG(%#p)));\n", &(GETCPU.CPSR), d.Immediate, REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=REG(%#p)<=v;\n", &(GETCPU.CPSR), REG(d.Rd));
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=REG(%#p)bits.C;\n", REG_W(d.Rd), REG_R(d.Rn), &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((v^shift_op^-1) & (v^REG(%#p)));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=REG(%#p)<=v;\n", &(GETCPU.CPSR), REG(d.Rd));
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=REG(%#p)bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(v, %u);\n", &(GETCPU.CPSR), d.Immediate);
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(REG(%#p), v, %u);\n", &(GETCPU.CPSR), REG(d.Rd), d.Immediate);
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)-shift_op;\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(v, shift_op);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(REG(%#p), v, shift_op);\n", &(GETCPU.CPSR), REG(d.Rd));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_SBC)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)-%u-!((Status_Reg*)%#p)->bits.C;\n", REG_W(d.Rd), REG_R(d.Rn), d.Immediate, &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((v^%u) & (v^REG(%#p)));\n", &(GETCPU.CPSR), d.Immediate, REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=v>=%u;\n", &(GETCPU.CPSR), d.Immediate);
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=v>%u;\n", &(GETCPU.CPSR), d.Immediate);
}
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)-shift_op-!((Status_Reg*)%#p)->bits.C;\n", REG_W(d.Rd), REG_R(d.Rn), &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((v^shift_op) & (v^REG(%#p)));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=v>=shift_op;\n", &(GETCPU.CPSR));
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=v>shift_op;\n", &(GETCPU.CPSR));
}
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_RSB)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=%u-REG_R%s(%#p);\n", REG_W(d.Rd), d.Immediate, REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(%u, v);\n", &(GETCPU.CPSR), d.Immediate);
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(REG(%#p), %u, v);\n", &(GETCPU.CPSR), REG(d.Rd), d.Immediate);
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=shift_op-REG_R%s(%#p);\n", REG_W(d.Rd), REG_R(d.Rn));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(shift_op, v);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(REG(%#p), shift_op, v);\n", &(GETCPU.CPSR), REG(d.Rd));
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_RSC)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=%u-REG_R%s(%#p)-!((Status_Reg*)%#p)->bits.C;\n", REG_W(d.Rd), d.Immediate, REG_R(d.Rn), &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((%u^v) & (%u^REG(%#p)));\n", &(GETCPU.CPSR), d.Immediate, d.Immediate, REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u>=v;\n", &(GETCPU.CPSR), d.Immediate);
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=%u>v;\n", &(GETCPU.CPSR), d.Immediate);
}
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
if (d.S && !d.R15Modified && ((d.FlagsSet & FLAG_C) || (d.FlagsSet & FLAG_V)))
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=shift_op-REG_R%s(%#p)-!((Status_Reg*)%#p)->bits.C;\n", REG_W(d.Rd), REG_R(d.Rn), &(GETCPU.CPSR));
if (d.S && !d.R15Modified)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT31((v^shift_op) & (shift_op^REG(%#p)));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_C)
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.C)\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=shift_op>=v;\n", &(GETCPU.CPSR));
WRITE_CODE("else\n");
WRITE_CODE("((Status_Reg*)%#p)->bits.C=shift_op>v;\n", &(GETCPU.CPSR));
}
}
}
if (d.R15Modified)
{
if (d.S)
{
DataProcessLoadCPSRGenerate(d, szCodeBuffer);
}
R15ModifiedGenerate(d, szCodeBuffer);
}
}
OPCDECODER_DECL(IR_CMP)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 tmp=REG_R%s(%#p)-%u;\n", REG_R(d.Rn), d.Immediate);
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(tmp);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(tmp==0);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(REG_R%s(%#p), %u);\n", &(GETCPU.CPSR), REG_R(d.Rn), d.Immediate);
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(tmp, REG_R%s(%#p), %u);\n", &(GETCPU.CPSR), REG_R(d.Rn), d.Immediate);
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("u32 tmp=REG_R%s(%#p)-shift_op;\n", REG_R(d.Rn));
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(tmp);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(tmp==0);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=!BorrowFrom(REG_R%s(%#p), shift_op);\n", &(GETCPU.CPSR), REG_R(d.Rn));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromSUB(tmp, REG_R%s(%#p), shift_op);\n", &(GETCPU.CPSR), REG_R(d.Rn));
}
}
}
OPCDECODER_DECL(IR_CMN)
{
u32 PROCNUM = d.ProcessID;
if (d.I)
{
WRITE_CODE("u32 tmp=REG_R%s(%#p)+%u;\n", REG_R(d.Rn), d.Immediate);
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(tmp);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(tmp==0);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=CarryFrom(REG_R%s(%#p), %u);\n", &(GETCPU.CPSR), REG_R(d.Rn), d.Immediate);
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromADD(tmp, REG_R%s(%#p), %u);\n", &(GETCPU.CPSR), REG_R(d.Rn), d.Immediate);
}
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("u32 tmp=REG_R%s(%#p)+shift_op;\n", REG_R(d.Rn));
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(tmp);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(tmp==0);\n", &(GETCPU.CPSR));
if (d.FlagsSet & FLAG_C)
WRITE_CODE("((Status_Reg*)%#p)->bits.C=CarryFrom(REG_R%s(%#p), shift_op);\n", &(GETCPU.CPSR), REG_R(d.Rn));
if (d.FlagsSet & FLAG_V)
WRITE_CODE("((Status_Reg*)%#p)->bits.V=OverflowFromADD(tmp, REG_R%s(%#p), shift_op);\n", &(GETCPU.CPSR), REG_R(d.Rn));
}
}
}
OPCDECODER_DECL(IR_MUL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)*v;\n", REG_W(d.Rd), REG_R(d.Rm));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
}
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFFFFFF)){\n");
WRITE_CODE("ExecuteCycles+=1+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFFFF)){\n");
WRITE_CODE("ExecuteCycles+=1+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFF)){\n");
WRITE_CODE("ExecuteCycles+=1+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=1+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_MLA)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)*v+REG_R%s(%#p);\n", REG_W(d.Rd), REG_R(d.Rm), REG_R(d.Rn));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd));
}
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFFFFFF)){\n");
WRITE_CODE("ExecuteCycles+=2+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFFFF)){\n");
WRITE_CODE("ExecuteCycles+=2+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if((v==0)||(v==0xFF)){\n");
WRITE_CODE("ExecuteCycles+=2+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=2+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_UMULL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("u64 res=(u64)REG_R%s(%#p)*v;\n", REG_R(d.Rm));
WRITE_CODE("REG_W(%#p)=(u32)res;\n", REG_W(d.Rn));
WRITE_CODE("REG_W(%#p)=(u32)(res>>32);\n", REG_W(d.Rd));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0)&&(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd), REG(d.Rn));
}
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=2+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=2+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=2+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=2+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_UMLAL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 v=REG_R%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("u64 res=(u64)REG_R%s(%#p)*v;\n", REG_R(d.Rm));
WRITE_CODE("u32 tmp=(u32)res;\n");
WRITE_CODE("REG_W(%#p)=(u32)(res>>32)+REG_R%s(%#p)+CarryFrom(tmp,REG_R%s(%#p));\n", REG_W(d.Rd), REG_R(d.Rd), REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)+tmp;\n", REG_W(d.Rn), REG_R(d.Rn));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0)&&(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd), REG(d.Rn));
}
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=3+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=3+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v >>= 8;\n");
WRITE_CODE("if(v==0){\n");
WRITE_CODE("ExecuteCycles+=3+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=3+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_SMULL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("s64 v=REG_SR%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("s64 res=(s64)REG_SR%s(%#p)*v;\n", REG_R(d.Rm));
WRITE_CODE("REG_W(%#p)=(u32)res;\n", REG_W(d.Rn));
WRITE_CODE("REG_W(%#p)=(u32)(res>>32);\n", REG_W(d.Rd));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0)&&(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd), REG(d.Rn));
}
WRITE_CODE("u32 v2 = v&0xFFFFFFFF;\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFFFFFF)){\n");
WRITE_CODE("ExecuteCycles+=2+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFFFF)){\n");
WRITE_CODE("ExecuteCycles+=2+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFF)){\n");
WRITE_CODE("ExecuteCycles+=2+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=2+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_SMLAL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("s64 v=REG_SR%s(%#p);\n", REG_R(d.Rs));
WRITE_CODE("s64 res=(s64)REG_SR%s(%#p)*v;\n", REG_R(d.Rm));
WRITE_CODE("u32 tmp=(u32)res;\n");
WRITE_CODE("REG_W(%#p)=(u32)(res>>32)+REG_R%s(%#p)+CarryFrom(tmp,REG_R%s(%#p));\n", REG_W(d.Rd), REG_R(d.Rd), REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=REG_R%s(%#p)+tmp;\n", REG_W(d.Rn), REG_R(d.Rn));
if (d.S)
{
if (d.FlagsSet & FLAG_N)
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(REG(%#p));\n", &(GETCPU.CPSR), REG(d.Rd));
if (d.FlagsSet & FLAG_Z)
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=(REG(%#p)==0)&&(REG(%#p)==0);\n", &(GETCPU.CPSR), REG(d.Rd), REG(d.Rn));
}
WRITE_CODE("u32 v2 = v&0xFFFFFFFF;\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFFFFFF)){\n");
WRITE_CODE("ExecuteCycles+=3+1;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFFFF)){\n");
WRITE_CODE("ExecuteCycles+=3+2;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("v2 >>= 8;\n");
WRITE_CODE("if((v2==0)||(v2==0xFF)){\n");
WRITE_CODE("ExecuteCycles+=3+3;\n");
WRITE_CODE("}else{\n");
WRITE_CODE("ExecuteCycles+=3+4;\n");
WRITE_CODE("}}}\n");
}
OPCDECODER_DECL(IR_SMULxy)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("REG_W(%#p)=(u32)(", REG_W(d.Rd));
if (d.X)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p))*", REG_R(d.Rm));
if (d.Y)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p)));\n", REG_R(d.Rs));
}
OPCDECODER_DECL(IR_SMLAxy)
{
u32 PROCNUM = d.ProcessID;
if (!d.X && !d.Y)
{
WRITE_CODE("u32 tmp=(u32)((s16)REG_R%s(%#p) * (s16)REG_R%s(%#p));\n", REG_R(d.Rm), REG_R(d.Rs));
WRITE_CODE("REG_W(%#p) = tmp + REG_R%s(%#p);\n", REG_W(d.Rd), REG_R(d.Rn));
WRITE_CODE("if (OverflowFromADD(REG(%#p), tmp, REG_R%s(%#p)))\n", REG(d.Rd), REG_R(d.Rn));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
}
else
{
WRITE_CODE("u32 tmp=(u32)(");
if (d.X)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p))*", REG_R(d.Rm));
if (d.Y)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p)));\n", REG_R(d.Rs));
WRITE_CODE("u32 a = REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p) = tmp + a;\n", REG_W(d.Rd));
WRITE_CODE("if (SIGNED_OVERFLOW(tmp, a, REG(%#p)))\n", REG(d.Rd));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
}
}
OPCDECODER_DECL(IR_SMULWy)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("s64 tmp = (s64)");
if (d.Y)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p)) * (s64)((s32)REG_R%s(%#p));\n", REG_R(d.Rs), REG_R(d.Rm));
WRITE_CODE("REG_W(%#p) = ((tmp>>16)&0xFFFFFFFF);\n", REG_W(d.Rd));
}
OPCDECODER_DECL(IR_SMLAWy)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("s64 tmp = (s64)");
if (d.Y)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p)) * (s64)((s32)REG_R%s(%#p));\n", REG_R(d.Rs), REG_R(d.Rm));
WRITE_CODE("u32 a = REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("tmp = ((tmp>>16)&0xFFFFFFFF);\n");
WRITE_CODE("REG_W(%#p) = tmp + a;\n", REG_W(d.Rd));
WRITE_CODE("if (SIGNED_OVERFLOW((u32)tmp, a, REG(%#p)))\n", REG(d.Rd));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
}
OPCDECODER_DECL(IR_SMLALxy)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("s64 tmp=(s64)(");
if (d.X)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p))*", REG_R(d.Rm));
if (d.Y)
WRITE_CODE("HWORD(");
else
WRITE_CODE("LWORD(");
WRITE_CODE("REG_R%s(%#p)));\n", REG_R(d.Rs));
WRITE_CODE("u64 res = (u64)tmp + REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p) = (u32)res;\n", REG_W(d.Rn));
WRITE_CODE("REG_W(%#p) = REG_R%s(%#p) + (res + ((tmp<0)*0xFFFFFFFF));\n", REG_W(d.Rd), REG_R(d.Rd));
}
template
static u32 FASTCALL MEMOP_LDR(u32 adr, u32 *dstreg)
{
u32 data = READ32(GETCPU.mem_if->data, adr);
if(adr&3)
data = ROR(data, 8*(adr&3));
*dstreg = data;
return MMU_aluMemAccessCycles(cycle,adr);
}
template
static u32 FASTCALL MEMOP_LDRB(u32 adr, u32 *dstreg)
{
*dstreg = READ8(GETCPU.mem_if->data, adr);
return MMU_aluMemAccessCycles(cycle,adr);
}
static const MemOp1 LDR_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDR<0,MEMTYPE_GENERIC,3>,
MEMOP_LDR<0,MEMTYPE_MAIN,3>,
MEMOP_LDR<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDR<0,MEMTYPE_GENERIC,3>,//MEMOP_LDR<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDR<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDR<1,MEMTYPE_GENERIC,3>,
MEMOP_LDR<1,MEMTYPE_MAIN,3>,
MEMOP_LDR<1,MEMTYPE_GENERIC,3>,//MEMOP_LDR<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDR<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDR<1,MEMTYPE_SWIRAM,3>,
}
};
static const MemOp1 LDR_R15_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDR<0,MEMTYPE_GENERIC,5>,
MEMOP_LDR<0,MEMTYPE_MAIN,5>,
MEMOP_LDR<0,MEMTYPE_DTCM_ARM9,5>,
MEMOP_LDR<0,MEMTYPE_GENERIC,5>,//MEMOP_LDR<0,MEMTYPE_ERAM_ARM7,5>,
MEMOP_LDR<0,MEMTYPE_SWIRAM,5>,
},
{
MEMOP_LDR<1,MEMTYPE_GENERIC,5>,
MEMOP_LDR<1,MEMTYPE_MAIN,5>,
MEMOP_LDR<1,MEMTYPE_GENERIC,5>,//MEMOP_LDR<1,MEMTYPE_DTCM_ARM9,5>,
MEMOP_LDR<1,MEMTYPE_ERAM_ARM7,5>,
MEMOP_LDR<1,MEMTYPE_SWIRAM,5>,
}
};
static const MemOp1 LDRB_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDRB<0,MEMTYPE_GENERIC,3>,
MEMOP_LDRB<0,MEMTYPE_MAIN,3>,
MEMOP_LDRB<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRB<0,MEMTYPE_GENERIC,3>,//MEMOP_LDRB<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRB<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDRB<1,MEMTYPE_GENERIC,3>,
MEMOP_LDRB<1,MEMTYPE_MAIN,3>,
MEMOP_LDRB<1,MEMTYPE_GENERIC,3>,//MEMOP_LDRB<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRB<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRB<1,MEMTYPE_SWIRAM,3>,
}
};
OPCDECODER_DECL(IR_LDR)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("u32 adr = REG_R%s(%#p) %c shift_op;\n", REG_R(d.Rn), d.U?'+':'-');
adr_guess = READREG(d.Rn) + (CalcShiftOp(d) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.U?'+':'-', d.Immediate);
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("REG_W(%#p) = adr %c shift_op;\n", REG_W(d.Rn), d.U?'+':'-');
}
adr_guess = READREG(d.Rn);
}
if (d.B)
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDRB_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
else
{
if (d.R15Modified)
{
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDR_R15_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
if (PROCNUM == 0)
{
WRITE_CODE("((Status_Reg*)%#p)->bits.T=BIT0(REG(%#p));\n", &(GETCPU.CPSR), REG(15));
WRITE_CODE("REG(%#p) &= 0xFFFFFFFE;\n", REG(15));
}
else
WRITE_CODE("REG(%#p) &= 0xFFFFFFFC;\n", REG(15));
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDR_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
}
template
static u32 FASTCALL MEMOP_STR(u32 adr, u32 data)
{
WRITE32(GETCPU.mem_if->data, adr, data);
return MMU_aluMemAccessCycles(cycle,adr);
}
template
static u32 FASTCALL MEMOP_STRB(u32 adr, u32 data)
{
WRITE8(GETCPU.mem_if->data, adr, data);
return MMU_aluMemAccessCycles(cycle,adr);
}
static const MemOp2 STR_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STR<0,MEMTYPE_GENERIC,2>,
MEMOP_STR<0,MEMTYPE_MAIN,2>,
MEMOP_STR<0,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STR<0,MEMTYPE_GENERIC,2>,//MEMOP_STR<0,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STR<0,MEMTYPE_SWIRAM,2>,
},
{
MEMOP_STR<1,MEMTYPE_GENERIC,2>,
MEMOP_STR<1,MEMTYPE_MAIN,2>,
MEMOP_STR<1,MEMTYPE_GENERIC,2>,//MEMOP_STR<1,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STR<1,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STR<1,MEMTYPE_SWIRAM,2>,
}
};
static const MemOp2 STRB_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STRB<0,MEMTYPE_GENERIC,2>,
MEMOP_STRB<0,MEMTYPE_MAIN,2>,
MEMOP_STRB<0,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STRB<0,MEMTYPE_GENERIC,2>,//MEMOP_STRB<0,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STRB<0,MEMTYPE_SWIRAM,2>,
},
{
MEMOP_STRB<1,MEMTYPE_GENERIC,2>,
MEMOP_STRB<1,MEMTYPE_MAIN,2>,
MEMOP_STRB<1,MEMTYPE_GENERIC,2>,//MEMOP_STRB<1,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STRB<1,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STRB<1,MEMTYPE_SWIRAM,2>,
}
};
OPCDECODER_DECL(IR_STR)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("u32 adr = REG_R%s(%#p) %c shift_op;\n", REG_R(d.Rn), d.U?'+':'-');
adr_guess = READREG(d.Rn) + (CalcShiftOp(d) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
adr_guess = READREG(d.Rn);
}
if (d.B)
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32))%#p)(adr,REG_R%s(%#p));\n", STRB_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REG_R(d.Rd));
else
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32))%#p)(adr,REG_R%s(%#p));\n", STR_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REG_R(d.Rd));
if (!d.P)
{
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.U?'+':'-', d.Immediate);
else
{
IRShiftOpGenerate(d, szCodeBuffer, false);
WRITE_CODE("REG_W(%#p) = adr %c shift_op;\n", REG_W(d.Rn), d.U?'+':'-');
}
}
}
template
static u32 FASTCALL MEMOP_LDRH(u32 adr, u32 *dstreg)
{
*dstreg = READ16(GETCPU.mem_if->data, adr);
return MMU_aluMemAccessCycles(cycle,adr);
}
template
static u32 FASTCALL MEMOP_LDRSH(u32 adr, u32 *dstreg)
{
*dstreg = (s16)READ16(GETCPU.mem_if->data, adr);
return MMU_aluMemAccessCycles(cycle,adr);
}
template
static u32 FASTCALL MEMOP_LDRSB(u32 adr, u32 *dstreg)
{
*dstreg = (s8)READ8(GETCPU.mem_if->data, adr);
return MMU_aluMemAccessCycles(cycle,adr);
}
static const MemOp1 LDRH_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDRH<0,MEMTYPE_GENERIC,3>,
MEMOP_LDRH<0,MEMTYPE_MAIN,3>,
MEMOP_LDRH<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRH<0,MEMTYPE_GENERIC,3>,//MEMOP_LDRH<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRH<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDRH<1,MEMTYPE_GENERIC,3>,
MEMOP_LDRH<1,MEMTYPE_MAIN,3>,
MEMOP_LDRH<1,MEMTYPE_GENERIC,3>,//MEMOP_LDRH<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRH<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRH<1,MEMTYPE_SWIRAM,3>,
}
};
static const MemOp1 LDRSH_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDRSH<0,MEMTYPE_GENERIC,3>,
MEMOP_LDRSH<0,MEMTYPE_MAIN,3>,
MEMOP_LDRSH<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRSH<0,MEMTYPE_GENERIC,3>,//MEMOP_LDRSH<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRSH<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDRSH<1,MEMTYPE_GENERIC,3>,
MEMOP_LDRSH<1,MEMTYPE_MAIN,3>,
MEMOP_LDRSH<1,MEMTYPE_GENERIC,3>,//MEMOP_LDRSH<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRSH<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRSH<1,MEMTYPE_SWIRAM,3>,
}
};
static const MemOp1 LDRSB_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDRSB<0,MEMTYPE_GENERIC,3>,
MEMOP_LDRSB<0,MEMTYPE_MAIN,3>,
MEMOP_LDRSB<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRSB<0,MEMTYPE_GENERIC,3>,//MEMOP_LDRSB<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRSB<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDRSB<1,MEMTYPE_GENERIC,3>,
MEMOP_LDRSB<1,MEMTYPE_MAIN,3>,
MEMOP_LDRSB<1,MEMTYPE_GENERIC,3>,//MEMOP_LDRSB<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRSB<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRSB<1,MEMTYPE_SWIRAM,3>,
}
};
OPCDECODER_DECL(IR_LDRx)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c REG_R%s(%#p);\n", REG_R(d.Rn), d.U?'+':'-', REG_R(d.Rm));
adr_guess = READREG(d.Rn) + (READREG(d.Rm) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
adr_guess = READREG(d.Rn);
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.U?'+':'-', d.Immediate);
else
WRITE_CODE("REG_W(%#p) = adr %c REG_R%s(%#p);\n", REG_W(d.Rn), d.U?'+':'-', REG_R(d.Rm));
}
if (d.H)
{
if (d.S)
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDRSH_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
else
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDRH_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
else
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDRSB_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
template
static u32 FASTCALL MEMOP_STRH(u32 adr, u32 data)
{
WRITE16(GETCPU.mem_if->data, adr, data);
return MMU_aluMemAccessCycles(cycle,adr);
}
static const MemOp2 STRH_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STRH<0,MEMTYPE_GENERIC,2>,
MEMOP_STRH<0,MEMTYPE_MAIN,2>,
MEMOP_STRH<0,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STRH<0,MEMTYPE_GENERIC,2>,//MEMOP_STRH<0,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STRH<0,MEMTYPE_SWIRAM,2>,
},
{
MEMOP_STRH<1,MEMTYPE_GENERIC,2>,
MEMOP_STRH<1,MEMTYPE_MAIN,2>,
MEMOP_STRH<1,MEMTYPE_GENERIC,2>,//MEMOP_STRH<1,MEMTYPE_DTCM_ARM9,2>,
MEMOP_STRH<1,MEMTYPE_ERAM_ARM7,2>,
MEMOP_STRH<1,MEMTYPE_SWIRAM,2>,
}
};
OPCDECODER_DECL(IR_STRx)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c REG_R%s(%#p);\n", REG_R(d.Rn), d.U?'+':'-', REG_R(d.Rm));
adr_guess = READREG(d.Rn) + (READREG(d.Rm) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
adr_guess = READREG(d.Rn);
}
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32))%#p)(adr,REG_R%s(%#p));\n", STRH_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REG_R(d.Rd));
if (!d.P)
{
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.U?'+':'-', d.Immediate);
else
WRITE_CODE("REG_W(%#p) = adr %c REG_R%s(%#p);\n", REG_W(d.Rn), d.U?'+':'-', REG_R(d.Rm));
}
}
template
static u32 FASTCALL MEMOP_LDRD(u32 adr, u32 *dstreg)
{
*dstreg = READ32(GETCPU.mem_if->data, adr);
*(dstreg+1) = READ32(GETCPU.mem_if->data, adr+4);
return MMU_aluMemCycles(cycle, MMU_memAccessCycles(adr) + MMU_memAccessCycles(adr+4));
}
static const MemOp1 LDRD_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDRD<0,MEMTYPE_GENERIC,3>,
MEMOP_LDRD<0,MEMTYPE_MAIN,3>,
MEMOP_LDRD<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRD<0,MEMTYPE_GENERIC,3>,//MEMOP_LDRD<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRD<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_LDRD<1,MEMTYPE_GENERIC,3>,
MEMOP_LDRD<1,MEMTYPE_MAIN,3>,
MEMOP_LDRD<1,MEMTYPE_GENERIC,3>,//MEMOP_LDRD<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_LDRD<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_LDRD<1,MEMTYPE_SWIRAM,3>,
}
};
OPCDECODER_DECL(IR_LDRD)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c REG_R%s(%#p);\n", REG_R(d.Rn), d.U?'+':'-', REG_R(d.Rm));
adr_guess = READREG(d.Rn) + (READREG(d.Rm) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
adr_guess = READREG(d.Rn);
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.Immediate, d.U?'+':'-');
else
WRITE_CODE("REG_W(%#p) = adr %c REG_R%s(%#p);\n", REG_W(d.Rn), d.U?'+':'-', REG_R(d.Rm));
}
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDRD_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
template
static u32 FASTCALL MEMOP_STRD(u32 adr, u32 *srcreg)
{
WRITE32(GETCPU.mem_if->data, adr, *srcreg);
WRITE32(GETCPU.mem_if->data, adr+4, *(srcreg+1));
return MMU_aluMemCycles(cycle, MMU_memAccessCycles(adr) + MMU_memAccessCycles(adr+4));
}
static const MemOp1 STRD_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STRD<0,MEMTYPE_GENERIC,3>,
MEMOP_STRD<0,MEMTYPE_MAIN,3>,
MEMOP_STRD<0,MEMTYPE_DTCM_ARM9,3>,
MEMOP_STRD<0,MEMTYPE_GENERIC,3>,//MEMOP_STRD<0,MEMTYPE_ERAM_ARM7,3>,
MEMOP_STRD<0,MEMTYPE_SWIRAM,3>,
},
{
MEMOP_STRD<1,MEMTYPE_GENERIC,3>,
MEMOP_STRD<1,MEMTYPE_MAIN,3>,
MEMOP_STRD<1,MEMTYPE_GENERIC,3>,//MEMOP_STRD<1,MEMTYPE_DTCM_ARM9,3>,
MEMOP_STRD<1,MEMTYPE_ERAM_ARM7,3>,
MEMOP_STRD<1,MEMTYPE_SWIRAM,3>,
}
};
OPCDECODER_DECL(IR_STRD)
{
u32 PROCNUM = d.ProcessID;
u32 adr_guess = 0;
if (d.P)
{
if (d.I)
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c %u;\n", REG_R(d.Rn), d.U?'+':'-', d.Immediate);
adr_guess = READREG(d.Rn) + (d.Immediate * (d.U?1:-1));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p) %c REG_R%s(%#p);\n", REG_R(d.Rn), d.U?'+':'-', REG_R(d.Rm));
adr_guess = READREG(d.Rn) + (READREG(d.Rm) * (d.U?1:-1));
}
if (d.W)
WRITE_CODE("REG_W(%#p) = adr;\n", REG_W(d.Rn));
}
else
{
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
adr_guess = READREG(d.Rn);
if (d.I)
WRITE_CODE("REG_W(%#p) = adr %c %u;\n", REG_W(d.Rn), d.Immediate, d.U?'+':'-');
else
WRITE_CODE("REG_W(%#p) = adr %c REG_R%s(%#p);\n", REG_W(d.Rn), d.U?'+':'-', REG_R(d.Rm));
}
if (d.Rd == 14)
WRITE_CODE("REG_W(%#p) = %u;\n", REG_W(15), d.CalcR15(d));
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", STRD_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
OPCDECODER_DECL(IR_LDREX)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
u32 adr_guess = READREG(d.Rn);
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32*))%#p)(adr,REGPTR(%#p));\n", LDR_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REGPTR(d.Rd));
}
OPCDECODER_DECL(IR_STREX)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 adr = REG_R%s(%#p);\n", REG_R(d.Rn));
u32 adr_guess = READREG(d.Rn);
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32, u32))%#p)(adr,REG_R%s(%#p));\n", STR_Tab[PROCNUM][GuessAddressArea(PROCNUM,adr_guess)], REG_R(d.Rd));
WRITE_CODE("REG_W(%#p) = 0;\n", REG_W(d.Rm));
}
template
static u32 MEMOP_LDM_SEQUENCE(u32 adr, u32 count, u32 *regs)
{
u32 c = 0;
u8 *ptr = _MMU_read_getrawptr32(adr, adr+(count-1)*4);
if (ptr)
{
#ifdef WORDS_BIGENDIAN
if (up)
{
for (u32 i = 0; i < count; i++)
{
regs[i] = T1ReadLong_guaranteedAligned(ptr, i * sizeof(u32));
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
regs[i] = T1ReadLong_guaranteedAligned(ptr, i * sizeof(u32));
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
#else
memcpy(regs, ptr, sizeof(u32) * count);
if (up)
{
for (u32 i = 0; i < count; i++)
{
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
#endif
}
else
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
regs[i] = READ32(GETCPU.mem_if->data, adr);
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
regs[i] = READ32(GETCPU.mem_if->data, adr);
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
return MMU_aluMemCycles(cycle, c);
}
template
static u32 MEMOP_LDM(u32 adr, u32 count, u32 *regs_ptr)
{
u32 c = 0;
u32 **regs = (u32 **)regs_ptr;
u8 *ptr = _MMU_read_getrawptr32(adr, adr+(count-1)*4);
if (ptr)
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
*(regs[i]) = T1ReadLong_guaranteedAligned(ptr, i * sizeof(u32));
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
*(regs[i]) = T1ReadLong_guaranteedAligned(ptr, i * sizeof(u32));
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
else
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
*(regs[i]) = READ32(GETCPU.mem_if->data, adr);
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
*(regs[i]) = READ32(GETCPU.mem_if->data, adr);
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
return MMU_aluMemCycles(cycle, c);
}
static const MemOp3 LDM_SEQUENCE_Up_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,2,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_MAIN,2,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,2,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,2,true>,//MEMOP_LDM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,2,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_SWIRAM,2,true>,
},
{
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,2,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_MAIN,2,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,2,true>,//MEMOP_LDM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,2,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,2,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_SWIRAM,2,true>,
}
};
static const MemOp3 LDM_Up_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM<0,MEMTYPE_GENERIC,2,true>,
MEMOP_LDM<0,MEMTYPE_MAIN,2,true>,
MEMOP_LDM<0,MEMTYPE_DTCM_ARM9,2,true>,
MEMOP_LDM<0,MEMTYPE_GENERIC,2,true>,//MEMOP_LDM<0,MEMTYPE_ERAM_ARM7,2,true>,
MEMOP_LDM<0,MEMTYPE_SWIRAM,2,true>,
},
{
MEMOP_LDM<1,MEMTYPE_GENERIC,2,true>,
MEMOP_LDM<1,MEMTYPE_MAIN,2,true>,
MEMOP_LDM<1,MEMTYPE_GENERIC,2,true>,//MEMOP_LDM<1,MEMTYPE_DTCM_ARM9,2,true>,
MEMOP_LDM<1,MEMTYPE_ERAM_ARM7,2,true>,
MEMOP_LDM<1,MEMTYPE_SWIRAM,2,true>,
}
};
static const MemOp3 LDM_SEQUENCE_Up_R15_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,4,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_MAIN,4,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,4,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,4,true>,//MEMOP_LDM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,4,true>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_SWIRAM,4,true>,
},
{
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,4,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_MAIN,4,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,4,true>,//MEMOP_LDM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,4,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,4,true>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_SWIRAM,4,true>,
}
};
static const MemOp3 LDM_Up_R15_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM<0,MEMTYPE_GENERIC,4,true>,
MEMOP_LDM<0,MEMTYPE_MAIN,4,true>,
MEMOP_LDM<0,MEMTYPE_DTCM_ARM9,4,true>,
MEMOP_LDM<0,MEMTYPE_GENERIC,4,true>,//MEMOP_LDM<0,MEMTYPE_ERAM_ARM7,4,true>,
MEMOP_LDM<0,MEMTYPE_SWIRAM,4,true>,
},
{
MEMOP_LDM<1,MEMTYPE_GENERIC,4,true>,
MEMOP_LDM<1,MEMTYPE_MAIN,4,true>,
MEMOP_LDM<1,MEMTYPE_GENERIC,4,true>,//MEMOP_LDM<1,MEMTYPE_DTCM_ARM9,4,true>,
MEMOP_LDM<1,MEMTYPE_ERAM_ARM7,4,true>,
MEMOP_LDM<1,MEMTYPE_SWIRAM,4,true>,
}
};
static const MemOp3 LDM_SEQUENCE_Down_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,2,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_MAIN,2,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,2,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,2,false>,//MEMOP_LDM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,2,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_SWIRAM,2,false>,
},
{
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,2,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_MAIN,2,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,2,false>,//MEMOP_LDM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,2,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,2,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_SWIRAM,2,false>,
}
};
static const MemOp3 LDM_Down_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM<0,MEMTYPE_GENERIC,2,false>,
MEMOP_LDM<0,MEMTYPE_MAIN,2,false>,
MEMOP_LDM<0,MEMTYPE_DTCM_ARM9,2,false>,
MEMOP_LDM<0,MEMTYPE_GENERIC,2,false>,//MEMOP_LDM<0,MEMTYPE_ERAM_ARM7,2,false>,
MEMOP_LDM<0,MEMTYPE_SWIRAM,2,false>,
},
{
MEMOP_LDM<1,MEMTYPE_GENERIC,2,false>,
MEMOP_LDM<1,MEMTYPE_MAIN,2,false>,
MEMOP_LDM<1,MEMTYPE_GENERIC,2,false>,//MEMOP_LDM<1,MEMTYPE_DTCM_ARM9,2,false>,
MEMOP_LDM<1,MEMTYPE_ERAM_ARM7,2,false>,
MEMOP_LDM<1,MEMTYPE_SWIRAM,2,false>,
}
};
static const MemOp3 LDM_SEQUENCE_Down_R15_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,4,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_MAIN,4,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,4,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_GENERIC,4,false>,//MEMOP_LDM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,4,false>,
MEMOP_LDM_SEQUENCE<0,MEMTYPE_SWIRAM,4,false>,
},
{
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,4,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_MAIN,4,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_GENERIC,4,false>,//MEMOP_LDM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,4,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,4,false>,
MEMOP_LDM_SEQUENCE<1,MEMTYPE_SWIRAM,4,false>,
}
};
static const MemOp3 LDM_Down_R15_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_LDM<0,MEMTYPE_GENERIC,4,false>,
MEMOP_LDM<0,MEMTYPE_MAIN,4,false>,
MEMOP_LDM<0,MEMTYPE_DTCM_ARM9,4,false>,
MEMOP_LDM<0,MEMTYPE_GENERIC,4,false>,//MEMOP_LDM<0,MEMTYPE_ERAM_ARM7,4,false>,
MEMOP_LDM<0,MEMTYPE_SWIRAM,4,false>,
},
{
MEMOP_LDM<1,MEMTYPE_GENERIC,4,false>,
MEMOP_LDM<1,MEMTYPE_MAIN,4,false>,
MEMOP_LDM<1,MEMTYPE_GENERIC,4,false>,//MEMOP_LDM<1,MEMTYPE_DTCM_ARM9,4,false>,
MEMOP_LDM<1,MEMTYPE_ERAM_ARM7,4,false>,
MEMOP_LDM<1,MEMTYPE_SWIRAM,4,false>,
}
};
OPCDECODER_DECL(IR_LDM)
{
u32 PROCNUM = d.ProcessID;
u32 SequenceFlag = 0;//0:no sequence start,1:one sequence start,2:one sequence end,3:more than one sequence start
u32 Count = 0;
u32* Regs[16];
for(u32 RegisterList = d.RegisterList, n = 0; RegisterList; RegisterList >>= 1, n++)
{
if (RegisterList & 0x1)
{
Regs[Count] = &GETCPU.R[n];
Count++;
if (SequenceFlag == 0)
SequenceFlag = 1;
else if (SequenceFlag == 2)
SequenceFlag = 3;
}
else
{
if (SequenceFlag == 1)
SequenceFlag = 2;
}
}
bool NeedWriteBack = false;
if (d.W)
{
if (d.RegisterList & (1 << d.Rn))
{
u32 bitList = (~((2 << d.Rn)-1)) & 0xFFFF;
if (/*!d.S && */(d.RegisterList & bitList))
NeedWriteBack = true;
}
else
NeedWriteBack = true;
}
bool IsOneSequence = (SequenceFlag == 1 || SequenceFlag == 2);
if (NeedWriteBack)
WRITE_CODE("u32 adr_old = REG_R%s(%#p);\n", REG_R(d.Rn));
if (d.P)
WRITE_CODE("u32 adr = (REG_R%s(%#p) %c 4) & 0xFFFFFFFC;\n", REG_R(d.Rn), d.U?'+':'-');
else
WRITE_CODE("u32 adr = REG_R%s(%#p) & 0xFFFFFFFC;\n", REG_R(d.Rn));
if (d.S)
{
if (d.R15Modified)
{
//WRITE_CODE("((Status_Reg*)%#p)->val=((Status_Reg*)%#p)->val;\n", &(GETCPU.CPSR), &(GETCPU.SPSR));
}
else
WRITE_CODE("u32 oldmode = ((u32 (*)(void*,u8))%#p)((void*)%#p,%u);\n", armcpu_switchMode, GETCPUPTR, SYS);
}
if (IsOneSequence)
{
if (d.U)
{
if (d.R15Modified)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", LDM_SEQUENCE_Up_R15_Tab[PROCNUM][0], Count, Regs[0]);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", LDM_SEQUENCE_Up_Tab[PROCNUM][0], Count, Regs[0]);
}
else
{
if (d.R15Modified)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", LDM_SEQUENCE_Down_R15_Tab[PROCNUM][0], Count, Regs[0]);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", LDM_SEQUENCE_Down_Tab[PROCNUM][0], Count, Regs[0]);
}
}
else
{
WRITE_CODE("static const u32* Regs[]={");
for (u32 i = 0; i < Count; i++)
{
WRITE_CODE("(u32*)%#p", Regs[i]);
if (i != Count - 1)
WRITE_CODE(",");
}
WRITE_CODE("};\n");
if (d.U)
{
if (d.R15Modified)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", LDM_Up_R15_Tab[PROCNUM][0], Count);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", LDM_Up_Tab[PROCNUM][0], Count);
}
else
{
if (d.R15Modified)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", LDM_Down_R15_Tab[PROCNUM][0], Count);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", LDM_Down_Tab[PROCNUM][0], Count);
}
}
if (d.S)
{
if (NeedWriteBack)
WRITE_CODE("REG_W(%#p)=adr_old %c %u;\n", REG_W(d.Rn), d.U?'+':'-', Count*4);
if (d.R15Modified)
{
LDM_S_LoadCPSRGenerate(d, szCodeBuffer);
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,oldmode);\n", armcpu_switchMode, GETCPUPTR);
}
else
{
if (d.R15Modified)
{
if (PROCNUM == 0)
{
WRITE_CODE("((Status_Reg*)%#p)->bits.T=BIT0(REG(%#p));\n", &(GETCPU.CPSR), REG(15));
WRITE_CODE("REG(%#p)&=0xFFFFFFFE;\n", REG(15));
}
else
WRITE_CODE("REG(%#p)&=0xFFFFFFFC;\n", REG(15));
}
if (NeedWriteBack)
WRITE_CODE("REG_W(%#p)=adr_old %c %u;\n", REG_W(d.Rn), d.U?'+':'-', Count*4);
if (d.R15Modified)
R15ModifiedGenerate(d, szCodeBuffer);
}
}
template
static u32 MEMOP_STM_SEQUENCE(u32 adr, u32 count, u32 *regs)
{
u32 c = 0;
u8 *ptr = _MMU_write_getrawptr32(adr, adr+(count-1)*4);
if (ptr)
{
#ifdef WORDS_BIGENDIAN
if (up)
{
for (u32 i = 0; i < count; i++)
{
T1WriteLong(ptr, i * sizeof(u32), regs[i]);
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
T1WriteLong(ptr, i * sizeof(u32), regs[i]);
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
#else
memcpy(ptr, regs, sizeof(u32) * count);
if (up)
{
for (u32 i = 0; i < count; i++)
{
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
#endif
}
else
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
WRITE32(GETCPU.mem_if->data, adr, regs[i]);
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
WRITE32(GETCPU.mem_if->data, adr, regs[i]);
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
return MMU_aluMemCycles(cycle, c);
}
template
static u32 MEMOP_STM(u32 adr, u32 count, u32 *regs_ptr)
{
u32 c = 0;
u32 **regs = (u32 **)regs_ptr;
u8 *ptr = _MMU_write_getrawptr32(adr, adr+(count-1)*4);
if (ptr)
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
T1WriteLong(ptr, i * sizeof(u32), *(regs[i]));
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
T1WriteLong(ptr, i * sizeof(u32), *(regs[i]));
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
else
{
if (up)
{
for (u32 i = 0; i < count; i++)
{
WRITE32(GETCPU.mem_if->data, adr, *(regs[i]));
c += MMU_memAccessCycles(adr);
adr += 4;
}
}
else
{
adr = adr+(count-1)*4;
for (s32 i = (s32)count - 1; i >= 0; i--)
{
WRITE32(GETCPU.mem_if->data, adr, *(regs[i]));
c += MMU_memAccessCycles(adr);
adr -= 4;
}
}
}
return MMU_aluMemCycles(cycle, c);
}
static const MemOp3 STM_SEQUENCE_Up_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STM_SEQUENCE<0,MEMTYPE_GENERIC,1,true>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_MAIN,1,true>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,1,true>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_GENERIC,1,true>,//MEMOP_STM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,1,true>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_SWIRAM,1,true>,
},
{
MEMOP_STM_SEQUENCE<1,MEMTYPE_GENERIC,1,true>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_MAIN,1,true>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_GENERIC,1,true>,//MEMOP_STM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,1,true>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,1,true>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_SWIRAM,1,true>,
}
};
static const MemOp3 STM_Up_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STM<0,MEMTYPE_GENERIC,1,true>,
MEMOP_STM<0,MEMTYPE_MAIN,1,true>,
MEMOP_STM<0,MEMTYPE_DTCM_ARM9,1,true>,
MEMOP_STM<0,MEMTYPE_GENERIC,1,true>,//MEMOP_STM<0,MEMTYPE_ERAM_ARM7,1,true>,
MEMOP_STM<0,MEMTYPE_SWIRAM,1,true>,
},
{
MEMOP_STM<1,MEMTYPE_GENERIC,1,true>,
MEMOP_STM<1,MEMTYPE_MAIN,1,true>,
MEMOP_STM<1,MEMTYPE_GENERIC,1,true>,//MEMOP_STM<1,MEMTYPE_DTCM_ARM9,1,true>,
MEMOP_STM<1,MEMTYPE_ERAM_ARM7,1,true>,
MEMOP_STM<1,MEMTYPE_SWIRAM,1,true>,
}
};
static const MemOp3 STM_SEQUENCE_Down_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STM_SEQUENCE<0,MEMTYPE_GENERIC,1,false>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_MAIN,1,false>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_DTCM_ARM9,1,false>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_GENERIC,1,false>,//MEMOP_STM_SEQUENCE<0,MEMTYPE_ERAM_ARM7,1,false>,
MEMOP_STM_SEQUENCE<0,MEMTYPE_SWIRAM,1,false>,
},
{
MEMOP_STM_SEQUENCE<1,MEMTYPE_GENERIC,1,false>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_MAIN,1,false>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_GENERIC,1,false>,//MEMOP_STM_SEQUENCE<1,MEMTYPE_DTCM_ARM9,1,false>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_ERAM_ARM7,1,false>,
MEMOP_STM_SEQUENCE<1,MEMTYPE_SWIRAM,1,false>,
}
};
static const MemOp3 STM_Down_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_STM<0,MEMTYPE_GENERIC,1,false>,
MEMOP_STM<0,MEMTYPE_MAIN,1,false>,
MEMOP_STM<0,MEMTYPE_DTCM_ARM9,1,false>,
MEMOP_STM<0,MEMTYPE_GENERIC,1,false>,//MEMOP_STM<0,MEMTYPE_ERAM_ARM7,1,false>,
MEMOP_STM<0,MEMTYPE_SWIRAM,1,false>,
},
{
MEMOP_STM<1,MEMTYPE_GENERIC,1,false>,
MEMOP_STM<1,MEMTYPE_MAIN,1,false>,
MEMOP_STM<1,MEMTYPE_GENERIC,1,false>,//MEMOP_STM<1,MEMTYPE_DTCM_ARM9,1,false>,
MEMOP_STM<1,MEMTYPE_ERAM_ARM7,1,false>,
MEMOP_STM<1,MEMTYPE_SWIRAM,1,false>,
}
};
OPCDECODER_DECL(IR_STM)
{
u32 PROCNUM = d.ProcessID;
bool StoreR15 = false;
u32 SequenceFlag = 0;//0:no sequence start,1:one sequence start,2:one sequence end,3:more than one sequence start
u32 Count = 0;
u32* Regs[16];
for(u32 RegisterList = d.RegisterList, n = 0; RegisterList; RegisterList >>= 1, n++)
{
if (RegisterList & 0x1)
{
Regs[Count] = &GETCPU.R[n];
Count++;
if (n == 15)
StoreR15 = true;
if (SequenceFlag == 0)
SequenceFlag = 1;
else if (SequenceFlag == 2)
SequenceFlag = 3;
}
else
{
if (SequenceFlag == 1)
SequenceFlag = 2;
}
}
if (d.S)
WRITE_CODE("if (((Status_Reg*)%#p)->bits.mode!=%u){\n", &(GETCPU.CPSR), USR);
if (StoreR15)
WRITE_CODE("REG_W(%#p) = %u;\n", REG_W(15), d.CalcR15(d));
bool IsOneSequence = (SequenceFlag == 1 || SequenceFlag == 2);
if (d.W)
WRITE_CODE("u32 adr_old = REG_R%s(%#p);\n", REG_R(d.Rn));
if (d.P)
WRITE_CODE("u32 adr = (REG_R%s(%#p) %c 4) & 0xFFFFFFFC;\n", REG_R(d.Rn), d.U?'+':'-');
else
WRITE_CODE("u32 adr = REG_R%s(%#p) & 0xFFFFFFFC;\n", REG_R(d.Rn));
if (d.S)
WRITE_CODE("u32 oldmode = ((u32 (*)(void*,u8))%#p)((void*)%#p,%u);\n", armcpu_switchMode, GETCPUPTR, SYS);
if (IsOneSequence)
{
if (d.U)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", STM_SEQUENCE_Up_Tab[PROCNUM][0], Count, Regs[0]);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)%#p);\n", STM_SEQUENCE_Down_Tab[PROCNUM][0], Count, Regs[0]);
}
else
{
WRITE_CODE("static const u32* Regs[]={");
for (u32 i = 0; i < Count; i++)
{
WRITE_CODE("(u32*)%#p", Regs[i]);
if (i != Count - 1)
WRITE_CODE(",");
}
WRITE_CODE("};\n");
if (d.U)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", STM_Up_Tab[PROCNUM][0], Count);
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32, u32*))%#p)(adr, %u,(u32*)&Regs[0]);\n", STM_Down_Tab[PROCNUM][0], Count);
}
if (d.S)
{
if (d.W)
WRITE_CODE("REG_W(%#p)=adr_old %c %u;\n", REG_W(d.Rn), d.U?'+':'-', Count*4);
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,oldmode);\n", armcpu_switchMode, GETCPUPTR);
WRITE_CODE("}else ExecuteCycles+=2;\n");
}
else
{
if (d.W)
WRITE_CODE("REG_W(%#p)=adr_old %c %u;\n", REG_W(d.Rn), d.U?'+':'-', Count*4);
}
}
template
static u32 MEMOP_SWP(u32 adr, u32 *Rd, u32 Rm)
{
u32 tmp = ROR(READ32(GETCPU.mem_if->data, adr), (adr & 3)<<3);
WRITE32(GETCPU.mem_if->data, adr, Rm);
*Rd = tmp;
return MMU_aluMemCycles(cycle, MMU_memAccessCycles(adr) + MMU_memAccessCycles(adr));
}
template
static u32 MEMOP_SWPB(u32 adr, u32 *Rd, u32 Rm)
{
u32 tmp = READ8(GETCPU.mem_if->data, adr);
WRITE8(GETCPU.mem_if->data, adr, Rm);
*Rd = tmp;
return MMU_aluMemCycles(cycle, MMU_memAccessCycles(adr) + MMU_memAccessCycles(adr));
}
static const MemOp4 SWP_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_SWP<0,MEMTYPE_GENERIC,4>,
MEMOP_SWP<0,MEMTYPE_MAIN,4>,
MEMOP_SWP<0,MEMTYPE_DTCM_ARM9,4>,
MEMOP_SWP<0,MEMTYPE_GENERIC,4>,//MEMOP_SWP<0,MEMTYPE_ERAM_ARM7,4>,
MEMOP_SWP<0,MEMTYPE_SWIRAM,4>,
},
{
MEMOP_SWP<1,MEMTYPE_GENERIC,4>,
MEMOP_SWP<1,MEMTYPE_MAIN,4>,
MEMOP_SWP<1,MEMTYPE_GENERIC,4>,//MEMOP_SWP<1,MEMTYPE_DTCM_ARM9,4>,
MEMOP_SWP<1,MEMTYPE_ERAM_ARM7,4>,
MEMOP_SWP<1,MEMTYPE_SWIRAM,4>,
}
};
static const MemOp4 SWPB_Tab[2][MEMTYPE_COUNT] =
{
{
MEMOP_SWPB<0,MEMTYPE_GENERIC,4>,
MEMOP_SWPB<0,MEMTYPE_MAIN,4>,
MEMOP_SWPB<0,MEMTYPE_DTCM_ARM9,4>,
MEMOP_SWPB<0,MEMTYPE_GENERIC,4>,//MEMOP_SWPB<0,MEMTYPE_ERAM_ARM7,4>,
MEMOP_SWPB<0,MEMTYPE_SWIRAM,4>,
},
{
MEMOP_SWPB<1,MEMTYPE_GENERIC,4>,
MEMOP_SWPB<1,MEMTYPE_MAIN,4>,
MEMOP_SWPB<1,MEMTYPE_GENERIC,4>,//MEMOP_SWPB<1,MEMTYPE_DTCM_ARM9,4>,
MEMOP_SWPB<1,MEMTYPE_ERAM_ARM7,4>,
MEMOP_SWPB<1,MEMTYPE_SWIRAM,4>,
}
};
OPCDECODER_DECL(IR_SWP)
{
u32 PROCNUM = d.ProcessID;
if (d.B)
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32*, u32))%#p)(REG_R%s(%#p),REGPTR(%#p),REG_R%s(%#p));\n", SWPB_Tab[PROCNUM][0], REG_R(d.Rn), REGPTR(d.Rd), REG_R(d.Rm));
else
WRITE_CODE("ExecuteCycles+=((u32 (*)(u32, u32*, u32))%#p)(REG_R%s(%#p),REGPTR(%#p),REG_R%s(%#p));\n", SWP_Tab[PROCNUM][0], REG_R(d.Rn), REGPTR(d.Rd), REG_R(d.Rm));
}
OPCDECODER_DECL(IR_B)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(15), d.Immediate);
R15ModifiedGenerate(d, szCodeBuffer);
}
OPCDECODER_DECL(IR_BL)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(14), d.CalcNextInstruction(d) | d.ThumbFlag);
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(15), d.Immediate);
R15ModifiedGenerate(d, szCodeBuffer);
}
OPCDECODER_DECL(IR_BX)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 tmp = REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("((Status_Reg*)%#p)->bits.T=BIT0(tmp);\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=tmp & (0xFFFFFFFC|(BIT0(tmp)<<1));\n", REG_W(15));
R15ModifiedGenerate(d, szCodeBuffer);
}
OPCDECODER_DECL(IR_BLX)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 tmp = REG_R%s(%#p);\n", REG_R(d.Rn));
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(14), d.CalcNextInstruction(d) | d.ThumbFlag);
WRITE_CODE("((Status_Reg*)%#p)->bits.T=BIT0(tmp);\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=tmp & (0xFFFFFFFC|(BIT0(tmp)<<1));\n", REG_W(15));
R15ModifiedGenerate(d, szCodeBuffer);
}
OPCDECODER_DECL(IR_SWI)
{
u32 PROCNUM = d.ProcessID;
if (GETCPU.swi_tab)
{
if (PROCNUM == 0)
WRITE_CODE("if ((*(u32*)%#p) != 0x00000000){\n", &(GETCPU.intVector));
else
WRITE_CODE("if ((*(u32*)%#p) != 0xFFFF0000){\n", &(GETCPU.intVector));
if (d.MayHalt)
{
if (d.ThumbFlag)
{
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), d.Address);
//WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.next_instruction), d.CalcNextInstruction(d));
// alway set r15 to next_instruction
WRITE_CODE("REG_W(%#p) = %u;\n", REG_W(15), d.CalcNextInstruction(d));
}
else
{
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), d.Address);
//WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.next_instruction), d.CalcNextInstruction(d));
// alway set r15 to next_instruction
WRITE_CODE("REG_W(%#p) = %u;\n", REG_W(15), d.CalcNextInstruction(d));
}
}
WRITE_CODE("ExecuteCycles+=((u32 (*)())%#p)()+3;\n", GETCPU.swi_tab[d.Immediate]);
if (d.MayHalt)
R15ModifiedGenerate(d, szCodeBuffer);
WRITE_CODE("}else{\n");
}
{
WRITE_CODE("Status_Reg tmp;\n");
WRITE_CODE("tmp.val = ((Status_Reg*)%#p)->val;\n", &(GETCPU.CPSR));
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,%u);\n", armcpu_switchMode, GETCPUPTR, SVC);
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(14), d.CalcNextInstruction(d));
WRITE_CODE("((Status_Reg*)%#p)->val = tmp.val;\n", &(GETCPU.SPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.T=0;\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.I=1;\n", &(GETCPU.CPSR));
WRITE_CODE("((void (*)(void*))%#p)((void*)%#p);\n", armcpu_changeCPSR, GETCPUPTR);
WRITE_CODE("REG_W(%#p)= (*(u32*)%#p) + 0x08;\n", REG_W(15), &(GETCPU.intVector));
WRITE_CODE("ExecuteCycles+=3;\n");
R15ModifiedGenerate(d, szCodeBuffer);
}
if (GETCPU.swi_tab)
WRITE_CODE("}\n");
}
OPCDECODER_DECL(IR_MSR)
{
u32 PROCNUM = d.ProcessID;
if (d.P)
{
u32 byte_mask = (BIT0(d.OpData)?0x000000FF:0x00000000) |
(BIT1(d.OpData)?0x0000FF00:0x00000000) |
(BIT2(d.OpData)?0x00FF0000:0x00000000) |
(BIT3(d.OpData)?0xFF000000:0x00000000);
WRITE_CODE("if(((Status_Reg*)%#p)->bits.mode!=%u&&((Status_Reg*)%#p)->bits.mode!=%u){\n",
&(GETCPU.CPSR), USR, &(GETCPU.CPSR), SYS);
if (d.I)
WRITE_CODE("(*(u32*)%#p) = ((*(u32*)%#p) & %u) | %u);\n",
&(GETCPU.SPSR.val), &(GETCPU.SPSR.val), ~byte_mask, byte_mask & d.Immediate);
else
WRITE_CODE("(*(u32*)%#p) = ((*(u32*)%#p) & %u) | (REG_R%s(%#p) & %u);\n",
&(GETCPU.SPSR.val), &(GETCPU.SPSR.val), ~byte_mask, REG_R(d.Rm), byte_mask);
WRITE_CODE("((void (*)(void*))%#p)((void*)%#p);\n", armcpu_changeCPSR, GETCPUPTR);
WRITE_CODE("}\n");
}
else
{
u32 byte_mask_usr = (BIT3(d.OpData)?0xFF000000:0x00000000);
u32 byte_mask_other = (BIT0(d.OpData)?0x000000FF:0x00000000) |
(BIT1(d.OpData)?0x0000FF00:0x00000000) |
(BIT2(d.OpData)?0x00FF0000:0x00000000) |
(BIT3(d.OpData)?0xFF000000:0x00000000);
WRITE_CODE("u32 byte_mask=(((Status_Reg*)%#p)->bits.mode==%u)?%u:%u;\n",
&(GETCPU.CPSR), USR, byte_mask_usr, byte_mask_other);
if (BIT0(d.OpData))
{
WRITE_CODE("if(((Status_Reg*)%#p)->bits.mode!=%u){\n", &(GETCPU.CPSR), USR);
if (d.I)
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,%u);\n", armcpu_switchMode, GETCPUPTR, d.Immediate & 0x1F);
else
WRITE_CODE("((u32 (*)(void*,u8))%#p)((void*)%#p,REG_R%s(%#p)&0x1F);\n", armcpu_switchMode, GETCPUPTR, REG_R(d.Rm));
WRITE_CODE("}\n");
}
if (d.I)
WRITE_CODE("(*(u32*)%#p) = ((*(u32*)%#p) & ~byte_mask) | (%u & byte_mask);\n",
&(GETCPU.CPSR.val), &(GETCPU.CPSR.val), d.Immediate);
else
WRITE_CODE("(*(u32*)%#p)=((*(u32*)%#p)&~byte_mask)|(REG_R%s(%#p)&byte_mask);\n",
&(GETCPU.CPSR.val), &(GETCPU.CPSR.val), REG_R(d.Rm));
WRITE_CODE("((void (*)(void*))%#p)((void*)%#p);\n", armcpu_changeCPSR, GETCPUPTR);
}
}
OPCDECODER_DECL(IR_MRS)
{
u32 PROCNUM = d.ProcessID;
if (d.P)
WRITE_CODE("REG_W(%#p)= (*(u32*)%#p);\n", REG_W(d.Rd), &(GETCPU.SPSR.val));
else
WRITE_CODE("REG_W(%#p)= (*(u32*)%#p);\n", REG_W(d.Rd), &(GETCPU.CPSR.val));
}
OPCDECODER_DECL(IR_MCR)
{
u32 PROCNUM = d.ProcessID;
if (d.CPNum == 15)
{
WRITE_CODE("((BOOL (*)(u32,u8,u8,u8,u8))%#p)(REG_R%s(%#p),%u,%u,%u,%u);\n",
armcp15_moveARM2CP, REG_R(d.Rd), d.CRn, d.CRm, d.CPOpc, d.CP);
}
else
{
INFO("ARM%c: MCR P%i, 0, R%i, C%i, C%i, %i, %i (don't allocated coprocessor)\n",
PROCNUM?'7':'9', d.CPNum, d.Rd, d.CRn, d.CRm, d.CPOpc, d.CP);
}
}
OPCDECODER_DECL(IR_MRC)
{
u32 PROCNUM = d.ProcessID;
if (d.CPNum == 15)
{
if (d.Rd == 15)
{
WRITE_CODE("u32 data = 0;\n");
WRITE_CODE("((BOOL (*)(u32*,u8,u8,u8,u8))%#p)(&data,%u,%u,%u,%u);\n",
armcp15_moveCP2ARM, d.CRn, d.CRm, d.CPOpc, d.CP);
WRITE_CODE("((Status_Reg*)%#p)->bits.N=BIT31(data);\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.Z=BIT30(data);\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.C=BIT29(data);\n", &(GETCPU.CPSR));
WRITE_CODE("((Status_Reg*)%#p)->bits.V=BIT28(data);\n", &(GETCPU.CPSR));
}
else
{
WRITE_CODE("((BOOL (*)(u32*,u8,u8,u8,u8))%#p)(REGPTR(%#p),%u,%u,%u,%u);\n",
armcp15_moveCP2ARM, REGPTR(d.Rd), d.CRn, d.CRm, d.CPOpc, d.CP);
}
}
else
{
INFO("ARM%c: MRC P%i, 0, R%i, C%i, C%i, %i, %i (don't allocated coprocessor)\n",
PROCNUM?'7':'9', d.CPNum, d.Rd, d.CRn, d.CRm, d.CPOpc, d.CP);
}
}
static const u8 CLZ_TAB[16]=
{
0, // 0000
1, // 0001
2, 2, // 001X
3, 3, 3, 3, // 01XX
4, 4, 4, 4, 4, 4, 4, 4 // 1XXX
};
OPCDECODER_DECL(IR_CLZ)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 Rm = REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("if(Rm==0){\n");
WRITE_CODE("REG_W(%#p)=32;\n", REG_W(d.Rd));
WRITE_CODE("}else{\n");
WRITE_CODE("Rm |= (Rm >>1);\n");
WRITE_CODE("Rm |= (Rm >>2);\n");
WRITE_CODE("Rm |= (Rm >>4);\n");
WRITE_CODE("Rm |= (Rm >>8);\n");
WRITE_CODE("Rm |= (Rm >>16);\n");
WRITE_CODE("static const u8* CLZ_TAB = (u8*)%#p;\n", CLZ_TAB);
WRITE_CODE("u32 pos = CLZ_TAB[Rm&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>4)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>8)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>12)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>16)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>20)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>24)&0xF] + \n");
WRITE_CODE(" CLZ_TAB[(Rm>>28)&0xF];\n");
WRITE_CODE("REG_W(%#p)=32-pos;}\n", REG_W(d.Rd));
}
OPCDECODER_DECL(IR_QADD)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 res = REG_R%s(%#p) + REG_R%s(%#p);\n", REG_R(d.Rn), REG_R(d.Rm));
WRITE_CODE("if(SIGNED_OVERFLOW(REG_R%s(%#p),REG_R%s(%#p),res)){\n",
REG_R(d.Rn), REG_R(d.Rm));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}else{\n");
if (d.R15Modified)
{
WRITE_CODE("REG_W(%#p)=res & 0xFFFFFFFC;\n", REG_W(d.Rd));
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("REG_W(%#p)=res;\n", REG_W(d.Rd));
WRITE_CODE("}\n");
}
OPCDECODER_DECL(IR_QSUB)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 res = REG_R%s(%#p) - REG_R%s(%#p);\n", REG_R(d.Rm), REG_R(d.Rn));
WRITE_CODE("if(SIGNED_UNDERFLOW(REG_R%s(%#p),REG_R%s(%#p),res)){\n",
REG_R(d.Rm), REG_R(d.Rn));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}else{\n");
if (d.R15Modified)
{
WRITE_CODE("REG_W(%#p)=res & 0xFFFFFFFC;\n", REG_W(d.Rd));
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("REG_W(%#p)=res;\n", REG_W(d.Rd));
WRITE_CODE("}\n");
}
OPCDECODER_DECL(IR_QDADD)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 mul = REG_R%s(%#p)<<1;\n", REG_R(d.Rn));
WRITE_CODE("if(BIT31(REG_R%s(%#p))!=BIT31(mul)){\n", REG_R(d.Rn));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}\n");
WRITE_CODE("u32 res = mul + REG_R%s(%#p);\n", REG_R(d.Rm));
WRITE_CODE("if(SIGNED_OVERFLOW(REG_R%s(%#p),mul, res)){\n", REG_R(d.Rm));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}else{\n");
if (d.R15Modified)
{
WRITE_CODE("REG_W(%#p)=res & 0xFFFFFFFC;\n", REG_W(d.Rd));
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("REG_W(%#p)=res;\n", REG_W(d.Rd));
WRITE_CODE("}\n");
}
OPCDECODER_DECL(IR_QDSUB)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("u32 mul = REG_R%s(%#p)<<1;\n", REG_R(d.Rn));
WRITE_CODE("if(BIT31(REG_R%s(%#p))!=BIT31(mul)){\n", REG_R(d.Rn));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}\n");
WRITE_CODE("u32 res = REG_R%s(%#p) - mul;\n", REG_R(d.Rm));
WRITE_CODE("if(SIGNED_UNDERFLOW(REG_R%s(%#p),mul, res)){\n", REG_R(d.Rm));
WRITE_CODE("((Status_Reg*)%#p)->bits.Q=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=0x80000000-BIT31(res);\n", REG_W(d.Rd));
WRITE_CODE("}else{\n");
if (d.R15Modified)
{
WRITE_CODE("REG_W(%#p)=res & 0xFFFFFFFC;\n", REG_W(d.Rd));
R15ModifiedGenerate(d, szCodeBuffer);
}
else
WRITE_CODE("REG_W(%#p)=res;\n", REG_W(d.Rd));
WRITE_CODE("}\n");
}
OPCDECODER_DECL(IR_BLX_IMM)
{
u32 PROCNUM = d.ProcessID;
if(d.ThumbFlag)
WRITE_CODE("((Status_Reg*)%#p)->bits.T=0;\n", &(GETCPU.CPSR));
else
WRITE_CODE("((Status_Reg*)%#p)->bits.T=1;\n", &(GETCPU.CPSR));
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(14), d.CalcNextInstruction(d) | d.ThumbFlag);
WRITE_CODE("REG_W(%#p)=%u;\n", REG_W(15), d.Immediate);
R15ModifiedGenerate(d, szCodeBuffer);
}
OPCDECODER_DECL(IR_BKPT)
{
u32 PROCNUM = d.ProcessID;
INFO("ARM%c: Unimplemented opcode BKPT\n", PROCNUM?'7':'9');
}
};
static const IROpCDecoder iropcdecoder_set[IR_MAXNUM] = {
#define TABDECL(x) ArmCJit::x##_CDecoder
#include "ArmAnalyze_tabdef.inc"
#undef TABDECL
};
////////////////////////////////////////////////////////////////////
template
static u32 FASTCALL RunInterpreter(const Decoded &d)
{
u32 cycles;
GETCPU.next_instruction = d.CalcNextInstruction(d);
GETCPU.R[15] = d.CalcR15(d);
if (thumb)
{
u32 opcode = d.Instruction.ThumbOp;
cycles = thumb_instructions_set[PROCNUM][opcode>>6](opcode);
}
else
{
u32 opcode = d.Instruction.ArmOp;
if(CONDITION(opcode) == 0xE || TEST_COND(CONDITION(opcode), CODE(opcode), GETCPU.CPSR))
cycles = arm_instructions_set[PROCNUM][INSTRUCTION_INDEX(opcode)](opcode);
else
cycles = 1;
}
GETCPU.instruct_adr = GETCPU.next_instruction;
return cycles;
}
static const Interpreter s_OpDecode[2][2] = {RunInterpreter<0,false>, RunInterpreter<0,true>, RunInterpreter<1,false>, RunInterpreter<1,true>};
////////////////////////////////////////////////////////////////////
static void FASTCALL InterpreterFallback(const Decoded &d, char *&szCodeBuffer)
{
u32 PROCNUM = d.ProcessID;
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.next_instruction), d.CalcNextInstruction(d));
WRITE_CODE("REG_W(%#p) = %u;\n", REG_W(15), d.CalcR15(d));
if (d.ThumbFlag)
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32))%#p)(%u);\n", thumb_instructions_set[PROCNUM][d.Instruction.ThumbOp>>6], d.Instruction.ThumbOp);
else
WRITE_CODE("ExecuteCycles+=((u32 (FASTCALL *)(u32))%#p)(%u);\n", arm_instructions_set[PROCNUM][INSTRUCTION_INDEX(d.Instruction.ArmOp)], d.Instruction.ArmOp);
WRITE_CODE("(*(u32*)%#p) = (*(u32*)%#p);\n", &(GETCPU.instruct_adr), &(GETCPU.next_instruction));
if (d.R15Modified)
WRITE_CODE("return ExecuteCycles;\n");
}
////////////////////////////////////////////////////////////////////
static const u32 s_CacheReserveMin = 4 * 1024 * 1024;
static u32 s_CacheReserve = 16 * 1024 * 1024;
static MemBuffer* s_CodeBuffer = NULL;
static void ReleaseCodeBuffer()
{
delete s_CodeBuffer;
s_CodeBuffer = NULL;
}
static void InitializeCodeBuffer()
{
ReleaseCodeBuffer();
s_CodeBuffer = new MemBuffer(MemBuffer::kRead|MemBuffer::kWrite|MemBuffer::kExec,s_CacheReserveMin);
s_CodeBuffer->Reserve(s_CacheReserve);
s_CacheReserve = s_CodeBuffer->GetReservedSize();
INFO("CodeBuffer : start=%#p, size1=%u, size2=%u\n",
s_CodeBuffer->GetBasePtr(), s_CodeBuffer->GetCommittedSize(), s_CacheReserve);
}
static void ResetCodeBuffer()
{
u8* base = s_CodeBuffer->GetBasePtr();
u32 size = s_CodeBuffer->GetUsedSize();
PROGINFO("CodeBuffer : used=%u\n", size);
s_CodeBuffer->Reset();
FlushIcacheSection(base, base + size);
}
static u8* AllocCodeBuffer(size_t size)
{
//return s_CodeBuffer->Alloc(size);
static const u32 align = 4 - 1;
u32 size_new = size + align;
uintptr_t ptr = (uintptr_t)s_CodeBuffer->Alloc(size_new);
if (ptr == 0)
return NULL;
uintptr_t retptr = (ptr + align) & ~align;
return (u8*)retptr;
}
////////////////////////////////////////////////////////////////////
static MemBuffer* s_CMemBuffer = NULL;
static char* s_CBufferBase = NULL;
static char* s_CBuffer = NULL;
static char* s_CBufferCur = NULL;
static void ReleaseCBuffer()
{
delete s_CMemBuffer;
s_CMemBuffer = NULL;
s_CBufferBase = NULL;
s_CBuffer = NULL;
s_CBufferCur = NULL;
}
static void InitializeCBuffer()
{
ReleaseCBuffer();
static const int Size = 1024 * 1024;
s_CMemBuffer = new MemBuffer(MemBuffer::kRead|MemBuffer::kWrite,Size);
s_CMemBuffer->Reserve();
s_CBufferBase = (char*)s_CMemBuffer->Alloc(Size);
{
char* szCodeBuffer = s_CBufferBase;
WRITE_CODE("typedef unsigned char u8;\n");
WRITE_CODE("typedef unsigned short u16;\n");
WRITE_CODE("typedef unsigned int u32;\n");
WRITE_CODE("typedef unsigned long long u64;\n");
WRITE_CODE("typedef signed char s8;\n");
WRITE_CODE("typedef signed short s16;\n");
WRITE_CODE("typedef signed int s32;\n");
WRITE_CODE("typedef signed long long s64;\n");
WRITE_CODE("typedef int BOOL;\n");
#ifdef __MINGW32__
WRITE_CODE("#define FASTCALL __attribute__((fastcall))\n");
#elif defined (__i386__) && !defined(__clang__)
WRITE_CODE("#define FASTCALL __attribute__((regparm(3)))\n");
#elif defined(_MSC_VER) || defined(__INTEL_COMPILER)
//WRITE_CODE("#define FASTCALL __fastcall\n");
WRITE_CODE("#define FASTCALL __attribute__((fastcall))\n");
#else
WRITE_CODE("#define FASTCALL\n");
#endif
WRITE_CODE("#define BIT(n) (1<<(n))\n");
WRITE_CODE("#define BIT_N(i,n) (((i)>>(n))&1)\n");
WRITE_CODE("#define BIT0(i) ((i)&1)\n");
//WRITE_CODE("#define BIT1(i) BIT_N((i),1)\n");
//WRITE_CODE("#define BIT2(i) BIT_N((i),2)\n");
//WRITE_CODE("#define BIT3(i) BIT_N((i),3)\n");
//WRITE_CODE("#define BIT4(i) BIT_N((i),4)\n");
//WRITE_CODE("#define BIT5(i) BIT_N((i),5)\n");
//WRITE_CODE("#define BIT6(i) BIT_N((i),6)\n");
//WRITE_CODE("#define BIT7(i) BIT_N((i),7)\n");
//WRITE_CODE("#define BIT8(i) BIT_N((i),8)\n");
//WRITE_CODE("#define BIT9(i) BIT_N((i),9)\n");
//WRITE_CODE("#define BIT10(i) BIT_N((i),10)\n");
//WRITE_CODE("#define BIT11(i) BIT_N((i),11)\n");
//WRITE_CODE("#define BIT12(i) BIT_N((i),12)\n");
//WRITE_CODE("#define BIT13(i) BIT_N((i),13)\n");
//WRITE_CODE("#define BIT14(i) BIT_N((i),14)\n");
//WRITE_CODE("#define BIT15(i) BIT_N((i),15)\n");
//WRITE_CODE("#define BIT16(i) BIT_N((i),16)\n");
//WRITE_CODE("#define BIT17(i) BIT_N((i),17)\n");
//WRITE_CODE("#define BIT18(i) BIT_N((i),18)\n");
//WRITE_CODE("#define BIT19(i) BIT_N((i),19)\n");
//WRITE_CODE("#define BIT20(i) BIT_N((i),20)\n");
//WRITE_CODE("#define BIT21(i) BIT_N((i),21)\n");
//WRITE_CODE("#define BIT22(i) BIT_N((i),22)\n");
//WRITE_CODE("#define BIT23(i) BIT_N((i),23)\n");
//WRITE_CODE("#define BIT24(i) BIT_N((i),24)\n");
//WRITE_CODE("#define BIT25(i) BIT_N((i),25)\n");
//WRITE_CODE("#define BIT26(i) BIT_N((i),26)\n");
//WRITE_CODE("#define BIT27(i) BIT_N((i),27)\n");
WRITE_CODE("#define BIT28(i) BIT_N((i),28)\n");
WRITE_CODE("#define BIT29(i) BIT_N((i),29)\n");
WRITE_CODE("#define BIT30(i) BIT_N((i),30)\n");
WRITE_CODE("#define BIT31(i) ((i)>>31)\n");
WRITE_CODE("#define HWORD(i) ((s32)(((s32)(i))>>16))\n");
WRITE_CODE("#define LWORD(i) (s32)(((s32)((i)<<16))>>16)\n");
WRITE_CODE("#define NEG(i) ((i)>>31)\n");
WRITE_CODE("#define POS(i) ((~(i))>>31)\n");
#ifdef WORDS_BIGENDIAN
WRITE_CODE("typedef union{\n");
WRITE_CODE(" struct{\n");
WRITE_CODE(" u32 N : 1,\n");
WRITE_CODE(" Z : 1,\n");
WRITE_CODE(" C : 1,\n");
WRITE_CODE(" V : 1,\n");
WRITE_CODE(" Q : 1,\n");
WRITE_CODE(" RAZ : 19,\n");
WRITE_CODE(" I : 1,\n");
WRITE_CODE(" F : 1,\n");
WRITE_CODE(" T : 1,\n");
WRITE_CODE(" mode : 5;\n");
WRITE_CODE(" } bits;\n");
WRITE_CODE(" u32 val;\n");
WRITE_CODE("} Status_Reg;\n");
#else
WRITE_CODE("typedef union{\n");
WRITE_CODE(" struct{\n");
WRITE_CODE(" u32 mode : 5,\n");
WRITE_CODE(" T : 1,\n");
WRITE_CODE(" F : 1,\n");
WRITE_CODE(" I : 1,\n");
WRITE_CODE(" RAZ : 19,\n");
WRITE_CODE(" Q : 1,\n");
WRITE_CODE(" V : 1,\n");
WRITE_CODE(" C : 1,\n");
WRITE_CODE(" Z : 1,\n");
WRITE_CODE(" N : 1;\n");
WRITE_CODE(" } bits;\n");
WRITE_CODE(" u32 val;\n");
WRITE_CODE("} Status_Reg;\n");
#endif
WRITE_CODE("#define REG_R(p) (*(u32*)(p))\n");
WRITE_CODE("#define REG_SR(p) (*(s32*)(p))\n");
WRITE_CODE("#define REG_R_C(p) ((u32)(p))\n");
WRITE_CODE("#define REG_SR_C(p) ((s32)(p))\n");
WRITE_CODE("#define REG_W(p) (*(u32*)(p))\n");
WRITE_CODE("#define REG(p) (*(u32*)(p))\n");
WRITE_CODE("#define REGPTR(p) ((u32*)(p))\n");
WRITE_CODE("static const u8* arm_cond_table = (const u8*)%#p;\n", arm_cond_table);
WRITE_CODE("#define TEST_COND(cond,inst,CPSR) ((arm_cond_table[((CPSR>>24)&0xf0)|(cond)]) & (1<<(inst)))\n");
#if 0
WRITE_CODE("inline u32 ROR(u32 i, u32 j)\n");
WRITE_CODE("{return ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j))));}\n");
//WRITE_CODE("inline u32 UNSIGNED_OVERFLOW(u32 a,u32 b,u32 c)\n");
//WRITE_CODE("{return BIT31(((a)&(b)) | (((a)|(b))&(~c)));}\n");
//WRITE_CODE("inline u32 UNSIGNED_UNDERFLOW(u32 a,u32 b,u32 c)\n");
//WRITE_CODE("{return BIT31(((~a)&(b)) | (((~a)|(b))&(c)));}\n");
WRITE_CODE("inline u32 SIGNED_OVERFLOW(u32 a,u32 b,u32 c)\n");
WRITE_CODE("{return BIT31(((a)&(b)&(~c)) | ((~a)&(~(b))&(c)));}\n");
WRITE_CODE("inline u32 SIGNED_UNDERFLOW(u32 a,u32 b,u32 c)\n");
WRITE_CODE("{return BIT31(((a)&(~(b))&(~c)) | ((~a)&(b)&(c)));}\n");
WRITE_CODE("inline BOOL CarryFrom(s32 left, s32 right)\n");
WRITE_CODE("{u32 res = (0xFFFFFFFFU - (u32)left);\n");
WRITE_CODE("return ((u32)right > res);}\n");
WRITE_CODE("inline BOOL BorrowFrom(s32 left, s32 right)\n");
WRITE_CODE("{return ((u32)right > (u32)left);}\n");
WRITE_CODE("inline BOOL OverflowFromADD(s32 alu_out, s32 left, s32 right)\n");
WRITE_CODE("{return ((left >= 0 && right >= 0) || (left < 0 && right < 0))\n");
WRITE_CODE("&& ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));}\n");
WRITE_CODE("inline BOOL OverflowFromSUB(s32 alu_out, s32 left, s32 right)\n");
WRITE_CODE("{return ((left < 0 && right >= 0) || (left >= 0 && right < 0))\n");
WRITE_CODE("&& ((left < 0 && alu_out >= 0) || (left >= 0 && alu_out < 0));}\n");
#else
WRITE_CODE("#define ROR(i, j) ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j))))\n");
//WRITE_CODE("#define UNSIGNED_OVERFLOW(a,b,c) BIT31(((a)&(b)) | (((a)|(b))&(~c)))\n");
//WRITE_CODE("#define UNSIGNED_UNDERFLOW(a,b,c) BIT31(((~a)&(b)) | (((~a)|(b))&(c)))\n");
WRITE_CODE("#define SIGNED_OVERFLOW(a,b,c) BIT31(((a)&(b)&(~c)) | ((~a)&(~(b))&(c)))\n");
WRITE_CODE("#define SIGNED_UNDERFLOW(a,b,c) BIT31(((a)&(~(b))&(~c)) | ((~a)&(b)&(c)))\n");
WRITE_CODE("#define CarryFrom(left, right) ((u32)(right) > (0xFFFFFFFFU - (u32)(left)))\n");
WRITE_CODE("#define BorrowFrom(left, right) ((u32)(right) > (u32)(left))\n");
//WRITE_CODE("#define OverflowFromADD(alu_out, left, right) ");
//WRITE_CODE("(((s32)(left) >= 0 && (s32)(right) >= 0) || ((s32)(left) < 0 && (s32)(right) < 0))");
//WRITE_CODE("&& (((s32)(left) < 0 && (s32)(alu_out) >= 0) || ((s32)(left) >= 0 && (s32)(alu_out) < 0))\n");
//WRITE_CODE("#define OverflowFromSUB(alu_out, left, right) ");
//WRITE_CODE("(((s32)(left) < 0 && (s32)(right) >= 0) || ((s32)(left) >= 0 && (s32)(right) < 0))");
//WRITE_CODE("&& (((s32)(left) < 0 && (s32)(alu_out) >= 0) || ((s32)(left) >= 0 && (s32)(alu_out) < 0))\n");
WRITE_CODE("#define OverflowFromADD(alu_out, left, right) ((NEG(left) & NEG(right) & POS(alu_out)) | (POS(left) & POS(right) & NEG(alu_out)))\n");
WRITE_CODE("#define OverflowFromSUB(alu_out, left, right) ((NEG(left) & POS(right) & POS(alu_out)) | (POS(left) & NEG(right) & NEG(alu_out)))\n");
#endif
s_CBuffer = szCodeBuffer;
}
s_CBufferCur = s_CBuffer;
}
static void ResetCBuffer()
{
s_CBufferCur = s_CBuffer;
}
////////////////////////////////////////////////////////////////////
struct CompiledAddress
{
u32 Address;
u32 ProcessID;
};
static const u32 s_MaxCompiledAddress = 16;
static CompiledAddress s_CompiledAddress[s_MaxCompiledAddress] = {0};
static u32 s_CurCompiledAddress = 0;
static void TccErrOutput(void *opaque, const char *msg)
{
INFO("%s\n", msg);
}
static bool TccGenerateNativeCode()
{
bool ret = false;
int size;
u8* ptr;
char szFunName[64];
TCCState *s = tcc_new();
//tcc_set_output_type(s, TCC_OUTPUT_MEMORY);
//tcc_set_options(s, "-Werror");
tcc_set_error_func(s, NULL, TccErrOutput);
tcc_set_options(s, "-nostdlib");
if (tcc_compile_string(s, s_CBufferBase) == -1)
{
INFO("%s\n", s_CBufferBase);
goto cleanup;
}
size = tcc_relocate(s, NULL);
if (size == -1)
goto cleanup;
ptr = AllocCodeBuffer(size);
if (!ptr)
{
INFO("JIT: cache full, reset cpu.\n");
arm_cjit.Reset();
ptr = AllocCodeBuffer(size);
if (!ptr)
{
INFO("JIT: alloc code buffer failed, size : %u.\n", size);
goto cleanup;
}
}
if (tcc_relocate(s, ptr) == -1)
goto cleanup;
ret = true;
FlushIcacheSection(ptr, ptr + size);
for (u32 i = 0; i < s_CurCompiledAddress; i++)
{
sprintf(szFunName, "ArmOp_%u_%u", s_CompiledAddress[i].Address, s_CompiledAddress[i].ProcessID);
uintptr_t opfun = (uintptr_t)tcc_get_symbol(s, szFunName);
JITLUT_HANDLE(s_CompiledAddress[i].Address, s_CompiledAddress[i].ProcessID) = opfun;
}
cleanup:
tcc_delete(s);
memset(s_CompiledAddress, 0, sizeof(s_CompiledAddress));
s_CurCompiledAddress = 0;
ResetCBuffer();
return ret;
}
static bool IsAddressCompiled(u32 Address, u32 ProcessID)
{
//is address already compiled
for (u32 i = 0; i < s_CurCompiledAddress; i++)
{
if (s_CompiledAddress[i].Address == Address &&
s_CompiledAddress[i].ProcessID == ProcessID)
return true;
}
return false;
}
static bool TccCompileCCode(const BlockInfo &blockinfo)
{
s_CompiledAddress[s_CurCompiledAddress].Address = blockinfo.Instructions[0].Address;
s_CompiledAddress[s_CurCompiledAddress].ProcessID = blockinfo.Instructions[0].ProcessID;
s_CurCompiledAddress++;
if (s_CurCompiledAddress >= s_MaxCompiledAddress)
return TccGenerateNativeCode();
return true;
}
static void ResetTcc()
{
ResetCBuffer();
memset(s_CompiledAddress, 0, sizeof(s_CompiledAddress));
s_CurCompiledAddress = 0;
}
////////////////////////////////////////////////////////////////////
static ArmAnalyze *s_pArmAnalyze = NULL;
TEMPLATE static u32 armcpu_compileblock(BlockInfo &blockinfo, bool runblock)
{
u32 Cycles = 0;
Decoded *Instructions = blockinfo.Instructions;
s32 InstructionsNum = blockinfo.InstructionsNum;
u32 adr = Instructions[0].Address;
//find a better way
if (IsAddressCompiled(adr, PROCNUM))
{
TccGenerateNativeCode();
return 0;
}
char* szCodeBuffer = s_CBufferCur;
WRITE_CODE("u32 ArmOp_%u_%u(){\n", adr, PROCNUM);
WRITE_CODE("u32 ExecuteCycles=0;\n");
u32 CurSubBlock = INVALID_SUBBLOCK;
u32 CurInstructions = 0;
u32 ConstCycles = 0;
bool IsSubBlockStart = false;
for (s32 i = 0; i < InstructionsNum; i++)
{
Decoded &Inst = Instructions[i];
if (CurSubBlock != Inst.SubBlock)
{
if (ConstCycles > 0)
{
WRITE_CODE("ExecuteCycles+=%u;\n", ConstCycles);
ConstCycles = 0;
}
if (IsSubBlockStart)
{
WRITE_CODE("}\n");
WRITE_CODE("else ExecuteCycles+=%u;\n", CurInstructions);
IsSubBlockStart = false;
}
if (Inst.Cond != 0xE && Inst.Cond != 0xF)
{
WRITE_CODE("if(TEST_COND(%u,0,(*(u32*)%#p))){\n", Inst.Cond, &GETCPU.CPSR.val);
IsSubBlockStart = true;
}
CurInstructions = 0;
CurSubBlock = Inst.SubBlock;
}
CurInstructions++;
if (!Inst.VariableCycles)
ConstCycles += Inst.ExecuteCycles;
WRITE_CODE("{\n");
if ((Inst.R15Modified || Inst.TbitModified) && (ConstCycles > 0))
{
WRITE_CODE("ExecuteCycles+=%u;\n", ConstCycles);
ConstCycles = 0;
}
if (Inst.ThumbFlag)
{
if ((Inst.IROp >= IR_LDM && Inst.IROp <= IR_STM))
InterpreterFallback(Inst, szCodeBuffer);
else
iropcdecoder_set[Inst.IROp](Inst, szCodeBuffer);
}
else
{
if ((Inst.IROp >= IR_LDM && Inst.IROp <= IR_STM))
InterpreterFallback(Inst, szCodeBuffer);
else
iropcdecoder_set[Inst.IROp](Inst, szCodeBuffer);
}
WRITE_CODE("}\n");
if (runblock)
Cycles += s_OpDecode[PROCNUM][Inst.ThumbFlag](Inst);
}
if (ConstCycles > 0)
{
WRITE_CODE("ExecuteCycles+=%u;\n", ConstCycles);
ConstCycles = 0;
}
Decoded &LastIns = Instructions[InstructionsNum - 1];
if (IsSubBlockStart)
{
WRITE_CODE("}\n");
IsSubBlockStart = false;
}
WRITE_CODE("(*(u32*)%#p) = %u;\n", &(GETCPU.instruct_adr), LastIns.Address + (LastIns.ThumbFlag ? 2 : 4));
WRITE_CODE("return ExecuteCycles;}\n");
s_CBufferCur = szCodeBuffer;
TccCompileCCode(blockinfo);
return Cycles;
}
TEMPLATE u32 armcpu_compileCJIT()
{
u32 adr = ARMPROC.instruct_adr;
u32 Cycles = 0;
if (!JITLUT_MAPPED(adr & 0x0FFFFFFF, PROCNUM))
{
INFO("JIT: use unmapped memory address %08X\n", adr);
execute = false;
return 1;
}
if (!s_pArmAnalyze->Decode(GETCPUPTR) || !s_pArmAnalyze->CreateBlocks())
{
INFO("JIT: unknow error cpu[%d].\n", PROCNUM);
return 1;
}
BlockInfo *BlockInfos;
s32 BlockInfoNum;
s_pArmAnalyze->GetBlocks(BlockInfos, BlockInfoNum);
for (s32 BlockNum = 0; BlockNum < BlockInfoNum; BlockNum++)
{
Cycles += armcpu_compileblock(BlockInfos[BlockNum], BlockNum == 0);
}
return Cycles;
}
static void cpuReserve()
{
InitializeCBuffer();
InitializeCodeBuffer();
s_pArmAnalyze = new ArmAnalyze(CommonSettings.jit_max_block_size);
s_pArmAnalyze->m_MergeSubBlocks = true;
s_pArmAnalyze->m_OptimizeFlag = true;
s_pArmAnalyze->m_JumpEndDecode = true;
}
static void cpuShutdown()
{
ReleaseCBuffer();
ReleaseCodeBuffer();
JitLutReset();
delete s_pArmAnalyze;
s_pArmAnalyze = NULL;
}
static void cpuReset()
{
ResetCodeBuffer();
ResetTcc();
JitLutReset();
}
static void cpuSync()
{
armcpu_sync();
}
TEMPLATE static void cpuClear(u32 Addr, u32 Size)
{
JITLUT_HANDLE(Addr, PROCNUM) = (uintptr_t)NULL;
}
static u32 cpuGetCacheReserve()
{
return s_CacheReserve / 1024 /1024;
}
static void cpuSetCacheReserve(u32 reserveInMegs)
{
s_CacheReserve = reserveInMegs * 1024 * 1024;
}
static const char* cpuDescription()
{
return "Arm CJit";
}
CpuBase arm_cjit =
{
cpuReserve,
cpuShutdown,
cpuReset,
cpuSync,
cpuClear<0>, cpuClear<1>,
cpuExecuteCJIT<0>, cpuExecuteCJIT<1>,
cpuGetCacheReserve,
cpuSetCacheReserve,
cpuDescription
};
template u32 armcpu_compileCJIT<0>();
template u32 armcpu_compileCJIT<1>();
#endif
================================================
FILE: app/src/main/jni/desmume/src/ArmCJit.h
================================================
/*
Copyright (C) 2008-2010 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#ifndef ARM_CJIT
#define ARM_CJIT
#include "common.h"
#include "CpuBase.h"
#include "JitCommon.h"
#include "armcpu.h"
typedef u32 (* ArmOpCompiled)();
template u32 armcpu_compileCJIT();
template u32 cpuExecuteCJIT()
{
ArmOpCompiled opfun = (ArmOpCompiled)JITLUT_HANDLE(ARMPROC.instruct_adr, PROCNUM);
if (opfun)
return opfun();
return armcpu_compileCJIT();
}
extern CpuBase arm_cjit;
#endif
================================================
FILE: app/src/main/jni/desmume/src/ArmLJit.cpp
================================================
/*
Copyright (C) 2008-2010 DeSmuME team
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the this software. If not, see .
*/
#include
#include "ArmLJit.h"
#include "ArmAnalyze.h"
#include "instructions.h"
#include "Disassembler.h"
#include "armcpu.h"
#include "MMU.h"
#include "MMU_timing.h"
#include "JitCommon.h"
#include "utils/MemBuffer.h"
#include "utils/lightning/lightning.h"
#ifdef _MSC_VER
#include
#endif
#ifdef HAVE_JIT
#define GETCPUPTR (&ARMPROC)
#define GETCPU (ARMPROC)
#define TEMPLATE template
#define OPDECODER_DECL(name) void FASTCALL name##_Decoder(const Decoded &d, RegisterMap ®Map)
typedef void (FASTCALL* IROpDecoder)(const Decoded &d, RegisterMap ®Map);
typedef u32 (* ArmOpCompiled)();
typedef u32 (* MemOp1)(u32, u32*);
typedef u32 (* MemOp2)(u32, u32);
typedef u32 (* MemOp3)(u32, u32, u32*);
typedef u32 (* MemOp4)(u32, u32*, u32);
#define HWORD(i) ((s32)(((s32)(i))>>16))
#define LWORD(i) (s32)(((s32)((i)<<16))>>16)
#define DEBUG_BKPT _O(0xcc);
namespace ArmLJit
{
//------------------------------------------------------------
// RegisterMap Imp
//------------------------------------------------------------
enum LocalRegType
{
LRT_R,
LRT_V,
};
static jit_gpr_t LocalMap[JIT_V_NUM + JIT_R_NUM];
FORCEINLINE u32 LOCALREG_INIT()
{
for (u32 i = 0; i < JIT_V_NUM; i++)
LocalMap[i] = JIT_V(i);
for (u32 i = 0; i < JIT_R_NUM; i++)
LocalMap[i + JIT_V_NUM] = JIT_R(i);
return JIT_V_NUM + JIT_R_NUM;
}
FORCEINLINE jit_gpr_t LOCALREG(u32 i)
{
return LocalMap[i];
}
FORCEINLINE LocalRegType LOCALREGTYPE(u32 i)
{
if (i < JIT_V_NUM)
return LRT_V;
return LRT_R;
}
FORCEINLINE RegisterMap::GuestRegId REGID(u32 i)
{
return (RegisterMap::GuestRegId)(i);
}
class RegisterMapImp : public RegisterMap
{
public:
RegisterMapImp(u32 HostRegCount);
void CallABI(void* funptr,
const std::vector &args,
const std::vector &flushs,
u32 hostreg_ret,
ImmData::Type type_ret);
protected:
void StartBlock();
void EndBlock();
void StoreGuestReg(u32 hostreg, GuestRegId guestreg);
void LoadGuestReg(u32 hostreg, GuestRegId guestreg);
void StoreImm(GuestRegId guestreg, const ImmData &data);
void LoadImm(u32 hostreg, const ImmData &data);
bool IsPerdureHostReg(u32 hostreg);
private:
int m_StackExecyc;
int m_StackTemp;
};
RegisterMapImp::RegisterMapImp(u32 HostRegCount)
: RegisterMap(HostRegCount)
{
}
void RegisterMapImp::CallABI(void* funptr,
const std::vector &args,
const std::vector &flushs,
u32 hostreg_ret,
ImmData::Type type_ret)
{
jit_prepare(args.size());
for (std::vector::const_reverse_iterator itr = args.rbegin();
itr != args.rend(); itr++)
{
const ABIOp &Op = *itr;
switch (Op.type)
{
case ABIOp::IMM:
{
u32 tmp = AllocTempReg();
switch (Op.immdata.type)
{
case ImmData::IMM8:
jit_movi_ui(LOCALREG(tmp), Op.immdata.imm8);
jit_pusharg_uc(LOCALREG(tmp));
break;
case ImmData::IMM16:
jit_movi_ui(LOCALREG(tmp), Op.immdata.imm16);
jit_pusharg_us(LOCALREG(tmp));
break;
case ImmData::IMM32:
jit_movi_ui(LOCALREG(tmp), Op.immdata.imm32);
jit_pusharg_ui(LOCALREG(tmp));
break;
case ImmData::IMMPTR:
jit_movi_p(LOCALREG(tmp), Op.immdata.immptr);
jit_pusharg_p(LOCALREG(tmp));
break;
default:
break;
}
ReleaseTempReg(tmp);
}
break;
case ABIOp::GUSETREG:
{
u32 reg = MapReg(REGID(Op.regdata));
Lock(reg);
jit_pusharg_ui(LOCALREG(reg));
Unlock(reg);
}
break;
case ABIOp::HOSTREG:
jit_pusharg_ui(LOCALREG(Op.regdata));
break;
case ABIOp::TEMPREG:
{
u32 tmp = Op.regdata;
jit_pusharg_ui(LOCALREG(tmp));
ReleaseTempReg(tmp);
}
break;
case ABIOp::GUSETREGPTR:
{
u32 cpuptr = GetCpuPtrReg();
u32 tmp = AllocTempReg();
if (REGID(Op.regdata) >= R0 && REGID(Op.regdata) <= R15)
jit_addi_p(LOCALREG(tmp), LOCALREG(cpuptr), jit_field(armcpu_t, R[Op.regdata]));
else if (REGID(Op.regdata) == CPSR)
jit_addi_p(LOCALREG(tmp), LOCALREG(cpuptr), jit_field(armcpu_t, CPSR));
else if (REGID(Op.regdata) == SPSR)
jit_addi_p(LOCALREG(tmp), LOCALREG(cpuptr), jit_field(armcpu_t, SPSR));
jit_pusharg_p(LOCALREG(tmp));
ReleaseTempReg(tmp);
}
break;
default:
break;
}
}
for (size_t i = 0; i < flushs.size(); i++)
{
FlushGuestReg(flushs[i]);
}
for (u32 i = 0; i < m_HostRegCount; i++)
{
if (m_State.HostRegs[i].alloced &&
m_State.HostRegs[i].guestreg != INVALID_REG_ID &&
!IsPerdureHostReg(i))
FlushHostReg(i);
}
jit_finish(funptr);
if (hostreg_ret != INVALID_REG_ID)
{
switch (type_ret)
{
case ImmData::IMM8:
jit_retval_uc(LOCALREG(hostreg_ret));
break;
case ImmData::IMM16:
jit_retval_us(LOCALREG(hostreg_ret));
break;
case ImmData::IMM32:
jit_retval_ui(LOCALREG(hostreg_ret));
break;
case ImmData::IMMPTR:
jit_retval_p(LOCALREG(hostreg_ret));
break;
default:
break;
}
}
m_Profile.CallABICount++;
}
void RegisterMapImp::StartBlock()
{
jit_prolog(0);
m_StackExecyc = jit_allocai(sizeof(u32));
m_StackTemp = jit_allocai(sizeof(u32));
SetImm32(EXECUTECYCLES, 0);
jit_movi_p(LOCALREG(GetCpuPtrReg()), m_Cpu);
}
void RegisterMapImp::EndBlock()
{
if (IsImm(EXECUTECYCLES))
{
jit_movi_ui(JIT_RET, GetImm32(EXECUTECYCLES));
jit_ret();
}
else
{
u32 execyc = MapReg(EXECUTECYCLES);
Lock(execyc);
jit_movr_ui(JIT_RET, LOCALREG(execyc));
jit_ret();
Unlock(execyc);
}
}
void RegisterMapImp::StoreGuestReg(u32 hostreg, GuestRegId guestreg)
{
if (guestreg >= R0 && guestreg <= SPSR)
{
u32 cpuptr = GetCpuPtrReg();
if (guestreg >= R0 && guestreg <= R15)
jit_stxi_ui(jit_field(armcpu_t, R[guestreg]), LOCALREG(cpuptr), LOCALREG(hostreg));
else if (guestreg == CPSR)
jit_stxi_ui(jit_field(armcpu_t, CPSR), LOCALREG(cpuptr), LOCALREG(hostreg));
else if (guestreg == SPSR)
jit_stxi_ui(jit_field(armcpu_t, SPSR), LOCALREG(cpuptr), LOCALREG(hostreg));
}
else if (guestreg == EXECUTECYCLES)
{
jit_stxi_ui(m_StackExecyc, JIT_FP, LOCALREG(hostreg));
}
m_Profile.StoreRegCount++;
}
void RegisterMapImp::LoadGuestReg(u32 hostreg, GuestRegId guestreg)
{
if (guestreg >= R0 && guestreg <= SPSR)
{
Lock(hostreg);
u32 cpuptr = GetCpuPtrReg();
if (guestreg >= R0 && guestreg <= R15)
jit_ldxi_ui(LOCALREG(hostreg), LOCALREG(cpuptr), jit_field(armcpu_t, R[guestreg]));
else if (guestreg == CPSR)
jit_ldxi_ui(LOCALREG(hostreg), LOCALREG(cpuptr), jit_field(armcpu_t, CPSR));
else if (guestreg == SPSR)
jit_ldxi_ui(LOCALREG(hostreg), LOCALREG(cpuptr), jit_field(armcpu_t, SPSR));
Unlock(hostreg);
}
else if (guestreg == EXECUTECYCLES)
{
jit_ldxi_ui(LOCALREG(hostreg), JIT_FP, m_StackExecyc);
}
m_Profile.LoadRegCount++;
}
void RegisterMapImp::StoreImm(GuestRegId guestreg, const ImmData &data)
{
u32 regmode = 0; //0:freereg 1:tempreg 2:backupreg
u32 tmp = FindFreeHostReg();
if (tmp == INVALID_REG_ID)
{
if (!m_IsInMerge)
{
tmp = AllocTempReg();
regmode = 1;
}
else
{
tmp = FindFirstHostReg();
jit_stxi_ui(m_StackTemp, JIT_FP, LOCALREG(tmp));
regmode = 2;
m_Profile.BackupRegCount++;
}
}
switch (data.type)
{
case ImmData::IMM8:
jit_movi_ui(LOCALREG(tmp), data.imm8);
break;
case ImmData::IMM16:
jit_movi_ui(LOCALREG(tmp), data.imm16);
break;
case ImmData::IMM32:
jit_movi_ui(LOCALREG(tmp), data.imm32);
break;
case ImmData::IMMPTR:
jit_movi_p(LOCALREG(tmp), data.immptr);
break;
default:
break;
}
StoreGuestReg(tmp, guestreg);
if (regmode == 1)
ReleaseTempReg(tmp);
else if (regmode == 2)
jit_ldxi_ui(LOCALREG(tmp), JIT_FP, m_StackTemp);
}
void RegisterMapImp::LoadImm(u32 hostreg, const ImmData &data)
{
switch (data.type)
{
case ImmData::IMM8:
jit_movi_ui(LOCALREG(hostreg), data.imm8);
break;
case ImmData::IMM16:
jit_movi_ui(LOCALREG(hostreg), data.imm16);
break;
case ImmData::IMM32:
jit_movi_ui(LOCALREG(hostreg), data.imm32);
break;
case ImmData::IMMPTR:
jit_movi_p(LOCALREG(hostreg), data.immptr);
break;
default:
break;
}
}
bool RegisterMapImp::IsPerdureHostReg(u32 hostreg)
{
return LOCALREGTYPE(hostreg) == LRT_V;
}
//------------------------------------------------------------
// Memory function
//------------------------------------------------------------
enum {
MEMTYPE_GENERIC = 0, // no assumptions
MEMTYPE_MAIN = 1, // arm9:r/w arm7:r/w
MEMTYPE_DTCM_ARM9 = 2, // arm9:r/w
MEMTYPE_ERAM_ARM7 = 3, // arm7:r/w
MEMTYPE_SWIRAM = 4, // arm9:r/w arm7:r/w
MEMTYPE_COUNT,
};
template
static u32 MEMOP_LDR(u32 adr, u32 *dstreg)
{
u32 data = READ32(cpu->mem_if->data, adr);
if(adr&3)
data = ROR(data, 8*(adr&3));
*dstreg = data;
return MMU_aluMemAccessCycles