@patleeman/pi-boy 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1361) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -0
  3. package/index.ts +1 -0
  4. package/mgba-bridge/build.sh +31 -0
  5. package/mgba-bridge/src/main.c +740 -0
  6. package/mgba-bridge/vendor/mgba/.clang-format +34 -0
  7. package/mgba-bridge/vendor/mgba/.gitlab-ci.yml +267 -0
  8. package/mgba-bridge/vendor/mgba/CHANGES +2094 -0
  9. package/mgba-bridge/vendor/mgba/CMakeLists.txt +1373 -0
  10. package/mgba-bridge/vendor/mgba/CMakePresets.json +21 -0
  11. package/mgba-bridge/vendor/mgba/CONTRIBUTING.md +196 -0
  12. package/mgba-bridge/vendor/mgba/LICENSE +373 -0
  13. package/mgba-bridge/vendor/mgba/Makefile +1 -0
  14. package/mgba-bridge/vendor/mgba/Makefile.libretro +490 -0
  15. package/mgba-bridge/vendor/mgba/PORTING.md +21 -0
  16. package/mgba-bridge/vendor/mgba/README.md +270 -0
  17. package/mgba-bridge/vendor/mgba/README_DE.md +255 -0
  18. package/mgba-bridge/vendor/mgba/README_ES.md +255 -0
  19. package/mgba-bridge/vendor/mgba/README_JP.md +268 -0
  20. package/mgba-bridge/vendor/mgba/README_ZH_CN.md +268 -0
  21. package/mgba-bridge/vendor/mgba/Tupfile +3 -0
  22. package/mgba-bridge/vendor/mgba/include/mgba/core/bitmap-cache.h +64 -0
  23. package/mgba-bridge/vendor/mgba/include/mgba/core/cache-set.h +38 -0
  24. package/mgba-bridge/vendor/mgba/include/mgba/core/cheats.h +130 -0
  25. package/mgba-bridge/vendor/mgba/include/mgba/core/config.h +118 -0
  26. package/mgba-bridge/vendor/mgba/include/mgba/core/core.h +232 -0
  27. package/mgba-bridge/vendor/mgba/include/mgba/core/cpu.h +40 -0
  28. package/mgba-bridge/vendor/mgba/include/mgba/core/directories.h +42 -0
  29. package/mgba-bridge/vendor/mgba/include/mgba/core/input.h +91 -0
  30. package/mgba-bridge/vendor/mgba/include/mgba/core/interface.h +199 -0
  31. package/mgba-bridge/vendor/mgba/include/mgba/core/library.h +62 -0
  32. package/mgba-bridge/vendor/mgba/include/mgba/core/lockstep.h +77 -0
  33. package/mgba-bridge/vendor/mgba/include/mgba/core/log.h +88 -0
  34. package/mgba-bridge/vendor/mgba/include/mgba/core/map-cache.h +82 -0
  35. package/mgba-bridge/vendor/mgba/include/mgba/core/mem-search.h +62 -0
  36. package/mgba-bridge/vendor/mgba/include/mgba/core/rewind.h +47 -0
  37. package/mgba-bridge/vendor/mgba/include/mgba/core/scripting.h +65 -0
  38. package/mgba-bridge/vendor/mgba/include/mgba/core/serialize.h +61 -0
  39. package/mgba-bridge/vendor/mgba/include/mgba/core/sync.h +44 -0
  40. package/mgba-bridge/vendor/mgba/include/mgba/core/thread.h +135 -0
  41. package/mgba-bridge/vendor/mgba/include/mgba/core/tile-cache.h +63 -0
  42. package/mgba-bridge/vendor/mgba/include/mgba/core/timing.h +55 -0
  43. package/mgba-bridge/vendor/mgba/include/mgba/core/version.h +27 -0
  44. package/mgba-bridge/vendor/mgba/include/mgba/debugger/debugger.h +267 -0
  45. package/mgba-bridge/vendor/mgba/include/mgba/feature/commandline.h +71 -0
  46. package/mgba-bridge/vendor/mgba/include/mgba/feature/proxy-backend.h +83 -0
  47. package/mgba-bridge/vendor/mgba/include/mgba/feature/thread-proxy.h +41 -0
  48. package/mgba-bridge/vendor/mgba/include/mgba/feature/updater.h +51 -0
  49. package/mgba-bridge/vendor/mgba/include/mgba/feature/video-backend.h +81 -0
  50. package/mgba-bridge/vendor/mgba/include/mgba/feature/video-logger.h +145 -0
  51. package/mgba-bridge/vendor/mgba/include/mgba/gb/core.h +21 -0
  52. package/mgba-bridge/vendor/mgba/include/mgba/gb/interface.h +112 -0
  53. package/mgba-bridge/vendor/mgba/include/mgba/gba/core.h +21 -0
  54. package/mgba-bridge/vendor/mgba/include/mgba/gba/interface.h +168 -0
  55. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/arm.h +217 -0
  56. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/cli-debugger.h +18 -0
  57. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/debugger.h +52 -0
  58. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/memory-debugger.h +20 -0
  59. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/decoder-inlines.h +37 -0
  60. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/decoder.h +231 -0
  61. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-arm.h +336 -0
  62. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-inlines.h +32 -0
  63. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-thumb.h +113 -0
  64. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-arm.h +22 -0
  65. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-inlines.h +186 -0
  66. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-thumb.h +20 -0
  67. package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/macros.h +18 -0
  68. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/access-logger.h +57 -0
  69. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/cli-debugger.h +108 -0
  70. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/cli-el-backend.h +21 -0
  71. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/gdb-stub.h +62 -0
  72. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/parser.h +81 -0
  73. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/stack-trace.h +32 -0
  74. package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/symbols.h +29 -0
  75. package/mgba-bridge/vendor/mgba/include/mgba/internal/defines.h +31 -0
  76. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/audio.h +257 -0
  77. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/cheats.h +26 -0
  78. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/cli.h +28 -0
  79. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/debugger.h +20 -0
  80. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/symbols.h +19 -0
  81. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/gb.h +202 -0
  82. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/input.h +31 -0
  83. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/io.h +127 -0
  84. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/mbc.h +72 -0
  85. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/memory.h +385 -0
  86. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/overrides.h +21 -0
  87. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/cache-set.h +23 -0
  88. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/proxy.h +29 -0
  89. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/software.h +72 -0
  90. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/serialize.h +536 -0
  91. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio/lockstep.h +49 -0
  92. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio/printer.h +74 -0
  93. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio.h +52 -0
  94. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/timer.h +45 -0
  95. package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/video.h +201 -0
  96. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/audio.h +291 -0
  97. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/bios.h +73 -0
  98. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/ereader.h +127 -0
  99. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/gpio.h +110 -0
  100. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/matrix.h +35 -0
  101. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/unlicensed.h +77 -0
  102. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cheats.h +175 -0
  103. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/debugger/cli.h +30 -0
  104. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/dma.h +73 -0
  105. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/gba.h +194 -0
  106. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/input.h +34 -0
  107. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/io.h +190 -0
  108. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/memory.h +184 -0
  109. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/overrides.h +21 -0
  110. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/cache-set.h +22 -0
  111. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/common.h +27 -0
  112. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/gl.h +218 -0
  113. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/proxy.h +29 -0
  114. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/video-software.h +160 -0
  115. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/savedata.h +130 -0
  116. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/serialize.h +496 -0
  117. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sharkport.h +27 -0
  118. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/dolphin.h +41 -0
  119. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/gbp.h +38 -0
  120. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/lockstep.h +95 -0
  121. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio.h +98 -0
  122. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/timer.h +36 -0
  123. package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/video.h +251 -0
  124. package/mgba-bridge/vendor/mgba/include/mgba/internal/script/lua.h +12 -0
  125. package/mgba-bridge/vendor/mgba/include/mgba/internal/script/socket.h +31 -0
  126. package/mgba-bridge/vendor/mgba/include/mgba/internal/script/types.h +20 -0
  127. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/cli-debugger.h +18 -0
  128. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/debugger.h +43 -0
  129. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/memory-debugger.h +20 -0
  130. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/decoder.h +113 -0
  131. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/emitter-sm83.h +528 -0
  132. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/isa-sm83.h +20 -0
  133. package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/sm83.h +174 -0
  134. package/mgba-bridge/vendor/mgba/include/mgba/script/base.h +28 -0
  135. package/mgba-bridge/vendor/mgba/include/mgba/script/canvas.h +24 -0
  136. package/mgba-bridge/vendor/mgba/include/mgba/script/console.h +51 -0
  137. package/mgba-bridge/vendor/mgba/include/mgba/script/context.h +126 -0
  138. package/mgba-bridge/vendor/mgba/include/mgba/script/input.h +272 -0
  139. package/mgba-bridge/vendor/mgba/include/mgba/script/macros.h +680 -0
  140. package/mgba-bridge/vendor/mgba/include/mgba/script/storage.h +28 -0
  141. package/mgba-bridge/vendor/mgba/include/mgba/script/types.h +400 -0
  142. package/mgba-bridge/vendor/mgba/include/mgba/script.h +18 -0
  143. package/mgba-bridge/vendor/mgba/include/mgba-util/audio-buffer.h +34 -0
  144. package/mgba-bridge/vendor/mgba/include/mgba-util/audio-resampler.h +42 -0
  145. package/mgba-bridge/vendor/mgba/include/mgba-util/circle-buffer.h +39 -0
  146. package/mgba-bridge/vendor/mgba/include/mgba-util/common.h +352 -0
  147. package/mgba-bridge/vendor/mgba/include/mgba-util/configuration.h +50 -0
  148. package/mgba-bridge/vendor/mgba/include/mgba-util/convolve.h +33 -0
  149. package/mgba-bridge/vendor/mgba/include/mgba-util/crc32.h +26 -0
  150. package/mgba-bridge/vendor/mgba/include/mgba-util/dllexports.h +19 -0
  151. package/mgba-bridge/vendor/mgba/include/mgba-util/elf-read.h +45 -0
  152. package/mgba-bridge/vendor/mgba/include/mgba-util/formatting.h +36 -0
  153. package/mgba-bridge/vendor/mgba/include/mgba-util/geometry.h +31 -0
  154. package/mgba-bridge/vendor/mgba/include/mgba-util/gui/file-select.h +21 -0
  155. package/mgba-bridge/vendor/mgba/include/mgba-util/gui/font-metrics.h +15 -0
  156. package/mgba-bridge/vendor/mgba/include/mgba-util/gui/font.h +149 -0
  157. package/mgba-bridge/vendor/mgba/include/mgba-util/gui/menu.h +126 -0
  158. package/mgba-bridge/vendor/mgba/include/mgba-util/gui.h +136 -0
  159. package/mgba-bridge/vendor/mgba/include/mgba-util/hash.h +17 -0
  160. package/mgba-bridge/vendor/mgba/include/mgba-util/image/export.h +20 -0
  161. package/mgba-bridge/vendor/mgba/include/mgba-util/image/png-io.h +54 -0
  162. package/mgba-bridge/vendor/mgba/include/mgba-util/image.h +442 -0
  163. package/mgba-bridge/vendor/mgba/include/mgba-util/interpolator.h +51 -0
  164. package/mgba-bridge/vendor/mgba/include/mgba-util/macros.h +92 -0
  165. package/mgba-bridge/vendor/mgba/include/mgba-util/math.h +145 -0
  166. package/mgba-bridge/vendor/mgba/include/mgba-util/md5.h +34 -0
  167. package/mgba-bridge/vendor/mgba/include/mgba-util/memory.h +18 -0
  168. package/mgba-bridge/vendor/mgba/include/mgba-util/patch/fast.h +38 -0
  169. package/mgba-bridge/vendor/mgba/include/mgba-util/patch/ips.h +19 -0
  170. package/mgba-bridge/vendor/mgba/include/mgba-util/patch/ups.h +19 -0
  171. package/mgba-bridge/vendor/mgba/include/mgba-util/patch.h +26 -0
  172. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/3ds/3ds-vfs.h +17 -0
  173. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/3ds/threading.h +88 -0
  174. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/posix/threading.h +125 -0
  175. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/psp2/sce-vfs.h +18 -0
  176. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/psp2/threading.h +161 -0
  177. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/switch/threading.h +88 -0
  178. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/windows/getopt.h +609 -0
  179. package/mgba-bridge/vendor/mgba/include/mgba-util/platform/windows/threading.h +106 -0
  180. package/mgba-bridge/vendor/mgba/include/mgba-util/ring-fifo.h +30 -0
  181. package/mgba-bridge/vendor/mgba/include/mgba-util/sfo.h +30 -0
  182. package/mgba-bridge/vendor/mgba/include/mgba-util/sha1.h +33 -0
  183. package/mgba-bridge/vendor/mgba/include/mgba-util/socket.h +542 -0
  184. package/mgba-bridge/vendor/mgba/include/mgba-util/string.h +55 -0
  185. package/mgba-bridge/vendor/mgba/include/mgba-util/table.h +93 -0
  186. package/mgba-bridge/vendor/mgba/include/mgba-util/text-codec.h +36 -0
  187. package/mgba-bridge/vendor/mgba/include/mgba-util/threading.h +123 -0
  188. package/mgba-bridge/vendor/mgba/include/mgba-util/vector.h +128 -0
  189. package/mgba-bridge/vendor/mgba/include/mgba-util/vfs.h +125 -0
  190. package/mgba-bridge/vendor/mgba/intl/activate.py +70 -0
  191. package/mgba-bridge/vendor/mgba/intl/core_option_regex.py +95 -0
  192. package/mgba-bridge/vendor/mgba/intl/core_option_translation.py +633 -0
  193. package/mgba-bridge/vendor/mgba/intl/crowdin.yaml +13 -0
  194. package/mgba-bridge/vendor/mgba/intl/crowdin_prep.py +30 -0
  195. package/mgba-bridge/vendor/mgba/intl/crowdin_source_upload.py +93 -0
  196. package/mgba-bridge/vendor/mgba/intl/crowdin_translate.py +39 -0
  197. package/mgba-bridge/vendor/mgba/intl/crowdin_translation_download.py +93 -0
  198. package/mgba-bridge/vendor/mgba/intl/download_workflow.py +16 -0
  199. package/mgba-bridge/vendor/mgba/intl/initial_sync.py +125 -0
  200. package/mgba-bridge/vendor/mgba/intl/remove_initial_cycle.py +30 -0
  201. package/mgba-bridge/vendor/mgba/intl/upload_workflow.py +15 -0
  202. package/mgba-bridge/vendor/mgba/intl/v1_to_v2_converter.py +483 -0
  203. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_arm64-v8a +96 -0
  204. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_armeabi +96 -0
  205. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_armeabi-v7a +96 -0
  206. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_mips +96 -0
  207. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_mips64 +96 -0
  208. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_x86 +96 -0
  209. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_x86_64 +96 -0
  210. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.common +156 -0
  211. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux-portable_x86 +96 -0
  212. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux-portable_x86_64 +96 -0
  213. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux_x86 +96 -0
  214. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux_x86_64 +96 -0
  215. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.mingw_x86 +96 -0
  216. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.mingw_x86_64 +96 -0
  217. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.osx_x86 +96 -0
  218. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.osx_x86_64 +96 -0
  219. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.rules +45 -0
  220. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.vita_arm +96 -0
  221. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.wii_ppc +96 -0
  222. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.windows_x86 +96 -0
  223. package/mgba-bridge/vendor/mgba/libretro-build/Makefile.windows_x86_64 +96 -0
  224. package/mgba-bridge/vendor/mgba/libretro-build/include/libz/zconf.h +511 -0
  225. package/mgba-bridge/vendor/mgba/libretro-build/jni/Android.mk +23 -0
  226. package/mgba-bridge/vendor/mgba/libretro-build/jni/Application.mk +2 -0
  227. package/mgba-bridge/vendor/mgba/libretro-build/link.T +5 -0
  228. package/mgba-bridge/vendor/mgba/link.T +4 -0
  229. package/mgba-bridge/vendor/mgba/opt/libgba/mgba.c +94 -0
  230. package/mgba-bridge/vendor/mgba/opt/libgba/mgba.h +46 -0
  231. package/mgba-bridge/vendor/mgba/src/arm/CMakeLists.txt +19 -0
  232. package/mgba-bridge/vendor/mgba/src/arm/arm.c +264 -0
  233. package/mgba-bridge/vendor/mgba/src/arm/debugger/cli-debugger.c +187 -0
  234. package/mgba-bridge/vendor/mgba/src/arm/debugger/debugger.c +588 -0
  235. package/mgba-bridge/vendor/mgba/src/arm/debugger/memory-debugger.c +158 -0
  236. package/mgba-bridge/vendor/mgba/src/arm/decoder-arm.c +466 -0
  237. package/mgba-bridge/vendor/mgba/src/arm/decoder-thumb.c +344 -0
  238. package/mgba-bridge/vendor/mgba/src/arm/decoder.c +601 -0
  239. package/mgba-bridge/vendor/mgba/src/arm/isa-arm.c +784 -0
  240. package/mgba-bridge/vendor/mgba/src/arm/isa-thumb.c +417 -0
  241. package/mgba-bridge/vendor/mgba/src/core/CMakeLists.txt +47 -0
  242. package/mgba-bridge/vendor/mgba/src/core/bitmap-cache.c +187 -0
  243. package/mgba-bridge/vendor/mgba/src/core/cache-set.c +83 -0
  244. package/mgba-bridge/vendor/mgba/src/core/cheats.c +807 -0
  245. package/mgba-bridge/vendor/mgba/src/core/config.c +548 -0
  246. package/mgba-bridge/vendor/mgba/src/core/core-serialize.c +585 -0
  247. package/mgba-bridge/vendor/mgba/src/core/core.c +539 -0
  248. package/mgba-bridge/vendor/mgba/src/core/directories.c +196 -0
  249. package/mgba-bridge/vendor/mgba/src/core/flags.h.in +204 -0
  250. package/mgba-bridge/vendor/mgba/src/core/input.c +677 -0
  251. package/mgba-bridge/vendor/mgba/src/core/interface.c +154 -0
  252. package/mgba-bridge/vendor/mgba/src/core/library.c +584 -0
  253. package/mgba-bridge/vendor/mgba/src/core/lockstep.c +43 -0
  254. package/mgba-bridge/vendor/mgba/src/core/log.c +294 -0
  255. package/mgba-bridge/vendor/mgba/src/core/map-cache.c +219 -0
  256. package/mgba-bridge/vendor/mgba/src/core/mem-search.c +342 -0
  257. package/mgba-bridge/vendor/mgba/src/core/rewind.c +186 -0
  258. package/mgba-bridge/vendor/mgba/src/core/scripting.c +1481 -0
  259. package/mgba-bridge/vendor/mgba/src/core/sync.c +121 -0
  260. package/mgba-bridge/vendor/mgba/src/core/thread.c +726 -0
  261. package/mgba-bridge/vendor/mgba/src/core/tile-cache.c +283 -0
  262. package/mgba-bridge/vendor/mgba/src/core/timing.c +137 -0
  263. package/mgba-bridge/vendor/mgba/src/core/version.c.in +14 -0
  264. package/mgba-bridge/vendor/mgba/src/debugger/CMakeLists.txt +30 -0
  265. package/mgba-bridge/vendor/mgba/src/debugger/access-logger.c +592 -0
  266. package/mgba-bridge/vendor/mgba/src/debugger/cli-debugger-scripting.c +137 -0
  267. package/mgba-bridge/vendor/mgba/src/debugger/cli-debugger.c +1482 -0
  268. package/mgba-bridge/vendor/mgba/src/debugger/cli-el-backend.c +248 -0
  269. package/mgba-bridge/vendor/mgba/src/debugger/debugger.c +327 -0
  270. package/mgba-bridge/vendor/mgba/src/debugger/gdb-stub.c +918 -0
  271. package/mgba-bridge/vendor/mgba/src/debugger/parser.c +902 -0
  272. package/mgba-bridge/vendor/mgba/src/debugger/stack-trace.c +133 -0
  273. package/mgba-bridge/vendor/mgba/src/debugger/symbols.c +109 -0
  274. package/mgba-bridge/vendor/mgba/src/feature/CMakeLists.txt +24 -0
  275. package/mgba-bridge/vendor/mgba/src/feature/commandline.c +404 -0
  276. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-common.h +95 -0
  277. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-decoder.c +204 -0
  278. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-decoder.h +45 -0
  279. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-encoder.c +960 -0
  280. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-encoder.h +91 -0
  281. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-scale.c +36 -0
  282. package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-scale.h +21 -0
  283. package/mgba-bridge/vendor/mgba/src/feature/gui/cheats.c +195 -0
  284. package/mgba-bridge/vendor/mgba/src/feature/gui/cheats.h +18 -0
  285. package/mgba-bridge/vendor/mgba/src/feature/gui/gui-config.c +438 -0
  286. package/mgba-bridge/vendor/mgba/src/feature/gui/gui-config.h +19 -0
  287. package/mgba-bridge/vendor/mgba/src/feature/gui/gui-runner.c +853 -0
  288. package/mgba-bridge/vendor/mgba/src/feature/gui/gui-runner.h +114 -0
  289. package/mgba-bridge/vendor/mgba/src/feature/gui/remap.c +88 -0
  290. package/mgba-bridge/vendor/mgba/src/feature/gui/remap.h +27 -0
  291. package/mgba-bridge/vendor/mgba/src/feature/proxy-backend.c +286 -0
  292. package/mgba-bridge/vendor/mgba/src/feature/thread-proxy.c +213 -0
  293. package/mgba-bridge/vendor/mgba/src/feature/updater.c +227 -0
  294. package/mgba-bridge/vendor/mgba/src/feature/video-backend.c +45 -0
  295. package/mgba-bridge/vendor/mgba/src/feature/video-logger.c +1092 -0
  296. package/mgba-bridge/vendor/mgba/src/gb/CMakeLists.txt +53 -0
  297. package/mgba-bridge/vendor/mgba/src/gb/audio.c +1149 -0
  298. package/mgba-bridge/vendor/mgba/src/gb/cheats.c +190 -0
  299. package/mgba-bridge/vendor/mgba/src/gb/core.c +1539 -0
  300. package/mgba-bridge/vendor/mgba/src/gb/debugger/cli.c +115 -0
  301. package/mgba-bridge/vendor/mgba/src/gb/debugger/debugger.c +46 -0
  302. package/mgba-bridge/vendor/mgba/src/gb/debugger/symbols.c +61 -0
  303. package/mgba-bridge/vendor/mgba/src/gb/extra/proxy.c +328 -0
  304. package/mgba-bridge/vendor/mgba/src/gb/gb.c +1261 -0
  305. package/mgba-bridge/vendor/mgba/src/gb/input.c +29 -0
  306. package/mgba-bridge/vendor/mgba/src/gb/io.c +735 -0
  307. package/mgba-bridge/vendor/mgba/src/gb/mbc/huc-3.c +218 -0
  308. package/mgba-bridge/vendor/mgba/src/gb/mbc/licensed.c +84 -0
  309. package/mgba-bridge/vendor/mgba/src/gb/mbc/mbc-private.h +66 -0
  310. package/mgba-bridge/vendor/mgba/src/gb/mbc/mbc.c +583 -0
  311. package/mgba-bridge/vendor/mgba/src/gb/mbc/pocket-cam.c +142 -0
  312. package/mgba-bridge/vendor/mgba/src/gb/mbc/tama5.c +433 -0
  313. package/mgba-bridge/vendor/mgba/src/gb/mbc/unlicensed.c +601 -0
  314. package/mgba-bridge/vendor/mgba/src/gb/mbc.c +650 -0
  315. package/mgba-bridge/vendor/mgba/src/gb/memory.c +1079 -0
  316. package/mgba-bridge/vendor/mgba/src/gb/overrides.c +939 -0
  317. package/mgba-bridge/vendor/mgba/src/gb/renderers/cache-set.c +129 -0
  318. package/mgba-bridge/vendor/mgba/src/gb/renderers/software.c +1169 -0
  319. package/mgba-bridge/vendor/mgba/src/gb/serialize.c +310 -0
  320. package/mgba-bridge/vendor/mgba/src/gb/sio/lockstep.c +284 -0
  321. package/mgba-bridge/vendor/mgba/src/gb/sio/printer.c +237 -0
  322. package/mgba-bridge/vendor/mgba/src/gb/sio.c +106 -0
  323. package/mgba-bridge/vendor/mgba/src/gb/timer.c +150 -0
  324. package/mgba-bridge/vendor/mgba/src/gb/video.c +1216 -0
  325. package/mgba-bridge/vendor/mgba/src/gba/CMakeLists.txt +62 -0
  326. package/mgba-bridge/vendor/mgba/src/gba/audio.c +555 -0
  327. package/mgba-bridge/vendor/mgba/src/gba/bios.c +981 -0
  328. package/mgba-bridge/vendor/mgba/src/gba/cart/ereader.c +1639 -0
  329. package/mgba-bridge/vendor/mgba/src/gba/cart/gpio.c +584 -0
  330. package/mgba-bridge/vendor/mgba/src/gba/cart/matrix.c +134 -0
  331. package/mgba-bridge/vendor/mgba/src/gba/cart/unlicensed.c +255 -0
  332. package/mgba-bridge/vendor/mgba/src/gba/cart/vfame.c +320 -0
  333. package/mgba-bridge/vendor/mgba/src/gba/cheats/codebreaker.c +323 -0
  334. package/mgba-bridge/vendor/mgba/src/gba/cheats/gameshark.c +318 -0
  335. package/mgba-bridge/vendor/mgba/src/gba/cheats/gameshark.h +32 -0
  336. package/mgba-bridge/vendor/mgba/src/gba/cheats/parv3.c +442 -0
  337. package/mgba-bridge/vendor/mgba/src/gba/cheats/parv3.h +21 -0
  338. package/mgba-bridge/vendor/mgba/src/gba/cheats.c +386 -0
  339. package/mgba-bridge/vendor/mgba/src/gba/core.c +1822 -0
  340. package/mgba-bridge/vendor/mgba/src/gba/debugger/cli.c +116 -0
  341. package/mgba-bridge/vendor/mgba/src/gba/dma.c +363 -0
  342. package/mgba-bridge/vendor/mgba/src/gba/extra/battlechip.c +171 -0
  343. package/mgba-bridge/vendor/mgba/src/gba/extra/proxy.c +408 -0
  344. package/mgba-bridge/vendor/mgba/src/gba/gba.c +1095 -0
  345. package/mgba-bridge/vendor/mgba/src/gba/hle-bios-src.s +400 -0
  346. package/mgba-bridge/vendor/mgba/src/gba/hle-bios.c +103 -0
  347. package/mgba-bridge/vendor/mgba/src/gba/hle-bios.h +17 -0
  348. package/mgba-bridge/vendor/mgba/src/gba/hle-bios.make +18 -0
  349. package/mgba-bridge/vendor/mgba/src/gba/input.c +31 -0
  350. package/mgba-bridge/vendor/mgba/src/gba/io.c +1085 -0
  351. package/mgba-bridge/vendor/mgba/src/gba/memory.c +1974 -0
  352. package/mgba-bridge/vendor/mgba/src/gba/overrides.c +435 -0
  353. package/mgba-bridge/vendor/mgba/src/gba/renderers/cache-set.c +219 -0
  354. package/mgba-bridge/vendor/mgba/src/gba/renderers/common.c +59 -0
  355. package/mgba-bridge/vendor/mgba/src/gba/renderers/gl.c +2137 -0
  356. package/mgba-bridge/vendor/mgba/src/gba/renderers/software-bg.c +228 -0
  357. package/mgba-bridge/vendor/mgba/src/gba/renderers/software-mode0.c +576 -0
  358. package/mgba-bridge/vendor/mgba/src/gba/renderers/software-obj.c +431 -0
  359. package/mgba-bridge/vendor/mgba/src/gba/renderers/software-private.h +283 -0
  360. package/mgba-bridge/vendor/mgba/src/gba/renderers/video-software.c +1117 -0
  361. package/mgba-bridge/vendor/mgba/src/gba/savedata.c +792 -0
  362. package/mgba-bridge/vendor/mgba/src/gba/serialize.c +242 -0
  363. package/mgba-bridge/vendor/mgba/src/gba/sharkport.c +389 -0
  364. package/mgba-bridge/vendor/mgba/src/gba/sio/dolphin.c +217 -0
  365. package/mgba-bridge/vendor/mgba/src/gba/sio/gbp.c +150 -0
  366. package/mgba-bridge/vendor/mgba/src/gba/sio/lockstep.c +1063 -0
  367. package/mgba-bridge/vendor/mgba/src/gba/sio.c +493 -0
  368. package/mgba-bridge/vendor/mgba/src/gba/timer.c +153 -0
  369. package/mgba-bridge/vendor/mgba/src/gba/video.c +470 -0
  370. package/mgba-bridge/vendor/mgba/src/platform/cmake/DMGOverrides.cmake.in +6 -0
  371. package/mgba-bridge/vendor/mgba/src/platform/cmake/DebugStrip.cmake +12 -0
  372. package/mgba-bridge/vendor/mgba/src/platform/cmake/ExportDirectory.cmake +7 -0
  373. package/mgba-bridge/vendor/mgba/src/platform/cmake/FindFeature.cmake +88 -0
  374. package/mgba-bridge/vendor/mgba/src/platform/cmake/FindFunction.cmake +14 -0
  375. package/mgba-bridge/vendor/mgba/src/platform/cmake/FindSDL2.cmake +164 -0
  376. package/mgba-bridge/vendor/mgba/src/platform/cmake/Findepoxy.cmake +10 -0
  377. package/mgba-bridge/vendor/mgba/src/platform/cmake/devkitPro.cmake +44 -0
  378. package/mgba-bridge/vendor/mgba/src/platform/example/client-server/client.c +160 -0
  379. package/mgba-bridge/vendor/mgba/src/platform/example/client-server/server.c +168 -0
  380. package/mgba-bridge/vendor/mgba/src/platform/headless-main.c +379 -0
  381. package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro.c +2611 -0
  382. package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro.h +7846 -0
  383. package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro_core_options.h +721 -0
  384. package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro_core_options_intl.h +17798 -0
  385. package/mgba-bridge/vendor/mgba/src/platform/libretro/memory.c +22 -0
  386. package/mgba-bridge/vendor/mgba/src/platform/libretro/retro_inline.h +39 -0
  387. package/mgba-bridge/vendor/mgba/src/platform/opengl/gl.c +304 -0
  388. package/mgba-bridge/vendor/mgba/src/platform/opengl/gl.h +40 -0
  389. package/mgba-bridge/vendor/mgba/src/platform/opengl/gles2.c +1230 -0
  390. package/mgba-bridge/vendor/mgba/src/platform/opengl/gles2.h +117 -0
  391. package/mgba-bridge/vendor/mgba/src/platform/posix/memory.c +37 -0
  392. package/mgba-bridge/vendor/mgba/src/script/CMakeLists.txt +38 -0
  393. package/mgba-bridge/vendor/mgba/src/script/canvas.c +292 -0
  394. package/mgba-bridge/vendor/mgba/src/script/console.c +141 -0
  395. package/mgba-bridge/vendor/mgba/src/script/context.c +492 -0
  396. package/mgba-bridge/vendor/mgba/src/script/engines/lua.c +1617 -0
  397. package/mgba-bridge/vendor/mgba/src/script/image.c +338 -0
  398. package/mgba-bridge/vendor/mgba/src/script/input.c +612 -0
  399. package/mgba-bridge/vendor/mgba/src/script/socket.c +284 -0
  400. package/mgba-bridge/vendor/mgba/src/script/stdlib.c +306 -0
  401. package/mgba-bridge/vendor/mgba/src/script/storage.c +557 -0
  402. package/mgba-bridge/vendor/mgba/src/script/test.h +29 -0
  403. package/mgba-bridge/vendor/mgba/src/script/types.c +1886 -0
  404. package/mgba-bridge/vendor/mgba/src/sm83/CMakeLists.txt +16 -0
  405. package/mgba-bridge/vendor/mgba/src/sm83/debugger/cli-debugger.c +110 -0
  406. package/mgba-bridge/vendor/mgba/src/sm83/debugger/debugger.c +266 -0
  407. package/mgba-bridge/vendor/mgba/src/sm83/debugger/memory-debugger.c +84 -0
  408. package/mgba-bridge/vendor/mgba/src/sm83/decoder.c +608 -0
  409. package/mgba-bridge/vendor/mgba/src/sm83/isa-sm83.c +817 -0
  410. package/mgba-bridge/vendor/mgba/src/sm83/sm83.c +199 -0
  411. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/.clang-format +92 -0
  412. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/CMakeLists.txt +18 -0
  413. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/LICENSE +19 -0
  414. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/README.md +152 -0
  415. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/discord_register.h +26 -0
  416. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/discord_rpc.h +87 -0
  417. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/LICENSE +24 -0
  418. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/README.md +41 -0
  419. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/condition_variable +549 -0
  420. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/mutex +474 -0
  421. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/shared_mutex +497 -0
  422. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/thread +410 -0
  423. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/allocators.h +271 -0
  424. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/document.h +2573 -0
  425. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/encodedstream.h +299 -0
  426. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/encodings.h +716 -0
  427. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/error/en.h +74 -0
  428. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/error/error.h +155 -0
  429. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/filereadstream.h +99 -0
  430. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/filewritestream.h +104 -0
  431. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/fwd.h +151 -0
  432. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/biginteger.h +290 -0
  433. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/diyfp.h +258 -0
  434. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/dtoa.h +245 -0
  435. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/ieee754.h +78 -0
  436. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/itoa.h +304 -0
  437. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/meta.h +181 -0
  438. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/pow10.h +55 -0
  439. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/regex.h +701 -0
  440. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/stack.h +230 -0
  441. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/strfunc.h +55 -0
  442. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/strtod.h +269 -0
  443. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/swap.h +46 -0
  444. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/istreamwrapper.h +115 -0
  445. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/license.txt +57 -0
  446. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/memorybuffer.h +70 -0
  447. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/memorystream.h +71 -0
  448. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/msinttypes/inttypes.h +316 -0
  449. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/msinttypes/stdint.h +300 -0
  450. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/ostreamwrapper.h +81 -0
  451. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/pointer.h +1358 -0
  452. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/prettywriter.h +255 -0
  453. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/rapidjson.h +615 -0
  454. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/reader.h +1879 -0
  455. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/schema.h +2006 -0
  456. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/stream.h +179 -0
  457. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/stringbuffer.h +117 -0
  458. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/writer.h +610 -0
  459. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/CMakeLists.txt +90 -0
  460. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/backoff.h +40 -0
  461. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection.h +19 -0
  462. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection_unix.cpp +125 -0
  463. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection_win.cpp +128 -0
  464. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_linux.cpp +102 -0
  465. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_osx.m +80 -0
  466. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_win.cpp +185 -0
  467. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_rpc.cpp +504 -0
  468. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/dllmain.cpp +8 -0
  469. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/msg_queue.h +36 -0
  470. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/rpc_connection.cpp +137 -0
  471. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/rpc_connection.h +59 -0
  472. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/serialization.cpp +245 -0
  473. package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/serialization.h +215 -0
  474. package/mgba-bridge/vendor/mgba/src/third-party/inih/LICENSE.txt +27 -0
  475. package/mgba-bridge/vendor/mgba/src/third-party/inih/README.md +157 -0
  476. package/mgba-bridge/vendor/mgba/src/third-party/inih/ini.c +288 -0
  477. package/mgba-bridge/vendor/mgba/src/third-party/inih/ini.h +148 -0
  478. package/mgba-bridge/vendor/mgba/src/third-party/libpng/ANNOUNCE +47 -0
  479. package/mgba-bridge/vendor/mgba/src/third-party/libpng/AUTHORS +45 -0
  480. package/mgba-bridge/vendor/mgba/src/third-party/libpng/CHANGES +6109 -0
  481. package/mgba-bridge/vendor/mgba/src/third-party/libpng/CMakeLists.txt +931 -0
  482. package/mgba-bridge/vendor/mgba/src/third-party/libpng/INSTALL +465 -0
  483. package/mgba-bridge/vendor/mgba/src/third-party/libpng/LICENSE +134 -0
  484. package/mgba-bridge/vendor/mgba/src/third-party/libpng/Makefile.am +393 -0
  485. package/mgba-bridge/vendor/mgba/src/third-party/libpng/Makefile.in +2428 -0
  486. package/mgba-bridge/vendor/mgba/src/third-party/libpng/README +183 -0
  487. package/mgba-bridge/vendor/mgba/src/third-party/libpng/TODO +23 -0
  488. package/mgba-bridge/vendor/mgba/src/third-party/libpng/TRADEMARK +8 -0
  489. package/mgba-bridge/vendor/mgba/src/third-party/libpng/aclocal.m4 +1196 -0
  490. package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/arm_init.c +136 -0
  491. package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/filter_neon.S +253 -0
  492. package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/filter_neon_intrinsics.c +402 -0
  493. package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/palette_neon_intrinsics.c +149 -0
  494. package/mgba-bridge/vendor/mgba/src/third-party/libpng/autogen.sh +225 -0
  495. package/mgba-bridge/vendor/mgba/src/third-party/libpng/compile +348 -0
  496. package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.guess +1476 -0
  497. package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.h.in +126 -0
  498. package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.sub +1801 -0
  499. package/mgba-bridge/vendor/mgba/src/third-party/libpng/configure +16116 -0
  500. package/mgba-bridge/vendor/mgba/src/third-party/libpng/configure.ac +532 -0
  501. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/README.txt +5 -0
  502. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/README +83 -0
  503. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/android-ndk.c +39 -0
  504. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/linux-auxv.c +120 -0
  505. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/linux.c +161 -0
  506. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/README +49 -0
  507. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/pngcp.dfa +57 -0
  508. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/read.dfa +58 -0
  509. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/s_read.dfa +35 -0
  510. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/s_write.dfa +33 -0
  511. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/simple.dfa +36 -0
  512. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/write.dfa +45 -0
  513. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/README.txt +24 -0
  514. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/iccfrompng.c +185 -0
  515. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/pngpixel.c +371 -0
  516. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/pngtopng.c +98 -0
  517. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/simpleover.c +648 -0
  518. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/COPYING +340 -0
  519. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/LICENSE +50 -0
  520. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.mingw32 +131 -0
  521. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.sgi +105 -0
  522. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.unx +134 -0
  523. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.w32 +114 -0
  524. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/README +186 -0
  525. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/makevms.com +132 -0
  526. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng.c +323 -0
  527. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng.h +88 -0
  528. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng2.c +521 -0
  529. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng2.h +116 -0
  530. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readppm.c +188 -0
  531. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng-win.c +735 -0
  532. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng-x.c +911 -0
  533. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng2-win.c +1261 -0
  534. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng2-x.c +2143 -0
  535. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/toucan.png +0 -0
  536. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/wpng.c +865 -0
  537. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/writepng.c +401 -0
  538. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/writepng.h +133 -0
  539. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/fakepng.c +65 -0
  540. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/gentests.sh +102 -0
  541. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/makepng.c +1941 -0
  542. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngimage.c +1712 -0
  543. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngstest-errors.h +165 -0
  544. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngstest.c +3828 -0
  545. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngunknown.c +1294 -0
  546. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngvalid.c +12230 -0
  547. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/readpng.c +115 -0
  548. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/tarith.c +999 -0
  549. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/timepng.c +608 -0
  550. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/mips-msa/README +83 -0
  551. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/mips-msa/linux.c +64 -0
  552. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/Dockerfile +25 -0
  553. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/README.txt +37 -0
  554. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/build.sh +51 -0
  555. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc +190 -0
  556. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/libpng_read_fuzzer.options +2 -0
  557. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/png.dict +39 -0
  558. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/README +5 -0
  559. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/README +10 -0
  560. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/makefile +151 -0
  561. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/pngusr.dfa +40 -0
  562. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/pngusr.h +23 -0
  563. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/README +10 -0
  564. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/makefile +150 -0
  565. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/pngusr.dfa +39 -0
  566. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/pngusr.h +23 -0
  567. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/README +15 -0
  568. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/makefile +166 -0
  569. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/pngusr.dfa +40 -0
  570. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/pngusr.h +23 -0
  571. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/CHANGES.txt +13 -0
  572. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/CMakeLists.txt +24 -0
  573. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/LICENSE.txt +22 -0
  574. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/Makefile +62 -0
  575. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/README.txt +120 -0
  576. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/makevms.com +92 -0
  577. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.bat +41 -0
  578. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.c +427 -0
  579. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.sh +42 -0
  580. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pngminus.bat +4 -0
  581. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pngminus.sh +5 -0
  582. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.bat +41 -0
  583. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.c +620 -0
  584. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.sh +42 -0
  585. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/README +107 -0
  586. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/bad_interlace_conversions.txt +9 -0
  587. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g01.png +0 -0
  588. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g02.png +0 -0
  589. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g04.png +0 -0
  590. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g08.png +0 -0
  591. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g16.png +0 -0
  592. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn2c08.png +0 -0
  593. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn2c16.png +0 -0
  594. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p01.png +0 -0
  595. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p02.png +0 -0
  596. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p04.png +0 -0
  597. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p08.png +0 -0
  598. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn4a08.png +0 -0
  599. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn4a16.png +0 -0
  600. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn6a08.png +0 -0
  601. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn6a16.png +0 -0
  602. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g01.png +0 -0
  603. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g02.png +0 -0
  604. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g04.png +0 -0
  605. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn2c16.png +0 -0
  606. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn3p08.png +0 -0
  607. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbgn2c16.png +0 -0
  608. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbgn3p08.png +0 -0
  609. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbrn2c08.png +0 -0
  610. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbwn0g16.png +0 -0
  611. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbwn3p08.png +0 -0
  612. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbyn3p08.png +0 -0
  613. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n0g08.png +0 -0
  614. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n2c08.png +0 -0
  615. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n3p08.png +0 -0
  616. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp1n3p08.png +0 -0
  617. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn0g08.png +0 -0
  618. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn0g16.png +0 -0
  619. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn2c08.png +0 -0
  620. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn2c16.png +0 -0
  621. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn3p08.png +0 -0
  622. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn4a08.png +0 -0
  623. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn4a16.png +0 -0
  624. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn6a08.png +0 -0
  625. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn6a16.png +0 -0
  626. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbbn2c16.png +0 -0
  627. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbbn3p08.png +0 -0
  628. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbgn2c16.png +0 -0
  629. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbgn3p08.png +0 -0
  630. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbrn2c08.png +0 -0
  631. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbwn0g16.png +0 -0
  632. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbwn3p08.png +0 -0
  633. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbyn3p08.png +0 -0
  634. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n0g08.png +0 -0
  635. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n2c08.png +0 -0
  636. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n3p08.png +0 -0
  637. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp1n3p08.png +0 -0
  638. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/README +2 -0
  639. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g01.png +0 -0
  640. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g02.png +0 -0
  641. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g04.png +0 -0
  642. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p01.png +0 -0
  643. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p02.png +0 -0
  644. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p04.png +0 -0
  645. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g01.png +0 -0
  646. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g02.png +0 -0
  647. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g04.png +0 -0
  648. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/README +81 -0
  649. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/linux.c +57 -0
  650. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/linux_aux.c +34 -0
  651. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/bad_iCCP.png +0 -0
  652. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/badadler.png +0 -0
  653. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/badcrc.png +0 -0
  654. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/empty_ancillary_chunks.png +0 -0
  655. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_IDAT.png +0 -0
  656. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_bKGD_chunk.png +0 -0
  657. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_cHRM_chunk.png +0 -0
  658. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_eXIf_chunk.png +0 -0
  659. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_gAMA_chunk.png +0 -0
  660. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_hIST_chunk.png +0 -0
  661. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_iCCP_chunk.png +0 -0
  662. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_iTXt_chunk.png +0 -0
  663. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png +0 -0
  664. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png +0 -0
  665. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_pCAL_chunk.png +0 -0
  666. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_pHYs_chunk.png +0 -0
  667. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sCAL_chunk.png +0 -0
  668. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sPLT_chunk.png +0 -0
  669. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sRGB_chunk.png +0 -0
  670. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sTER_chunk.png +0 -0
  671. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_tEXt_chunk.png +0 -0
  672. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_tIME_chunk.png +0 -0
  673. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_zTXt_chunk.png +0 -0
  674. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-1.8-tRNS.png +0 -0
  675. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-1.8.png +0 -0
  676. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-linear-tRNS.png +0 -0
  677. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-linear.png +0 -0
  678. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-sRGB-tRNS.png +0 -0
  679. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-sRGB.png +0 -0
  680. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-tRNS.png +0 -0
  681. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1.png +0 -0
  682. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-1.8-tRNS.png +0 -0
  683. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-1.8.png +0 -0
  684. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-linear-tRNS.png +0 -0
  685. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-linear.png +0 -0
  686. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-sRGB-tRNS.png +0 -0
  687. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-sRGB.png +0 -0
  688. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-tRNS.png +0 -0
  689. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16.png +0 -0
  690. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-1.8-tRNS.png +0 -0
  691. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-1.8.png +0 -0
  692. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-linear-tRNS.png +0 -0
  693. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-linear.png +0 -0
  694. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-sRGB-tRNS.png +0 -0
  695. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-sRGB.png +0 -0
  696. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-tRNS.png +0 -0
  697. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2.png +0 -0
  698. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-1.8-tRNS.png +0 -0
  699. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-1.8.png +0 -0
  700. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-linear-tRNS.png +0 -0
  701. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-linear.png +0 -0
  702. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-sRGB-tRNS.png +0 -0
  703. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-sRGB.png +0 -0
  704. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-tRNS.png +0 -0
  705. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4.png +0 -0
  706. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-1.8-tRNS.png +0 -0
  707. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-1.8.png +0 -0
  708. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-linear-tRNS.png +0 -0
  709. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-linear.png +0 -0
  710. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-sRGB-tRNS.png +0 -0
  711. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-sRGB.png +0 -0
  712. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-tRNS.png +0 -0
  713. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8.png +0 -0
  714. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-1.8.png +0 -0
  715. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-linear.png +0 -0
  716. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-sRGB.png +0 -0
  717. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16.png +0 -0
  718. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-1.8.png +0 -0
  719. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-linear.png +0 -0
  720. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-sRGB.png +0 -0
  721. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8.png +0 -0
  722. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/makepngs.sh +94 -0
  723. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-1.8-tRNS.png +0 -0
  724. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-1.8.png +0 -0
  725. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-linear-tRNS.png +0 -0
  726. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-linear.png +0 -0
  727. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-sRGB-tRNS.png +0 -0
  728. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-sRGB.png +0 -0
  729. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-tRNS.png +0 -0
  730. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1.png +0 -0
  731. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-1.8-tRNS.png +0 -0
  732. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-1.8.png +0 -0
  733. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-linear-tRNS.png +0 -0
  734. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-linear.png +0 -0
  735. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-sRGB-tRNS.png +0 -0
  736. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-sRGB.png +0 -0
  737. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-tRNS.png +0 -0
  738. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2.png +0 -0
  739. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-1.8-tRNS.png +0 -0
  740. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-1.8.png +0 -0
  741. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-linear-tRNS.png +0 -0
  742. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-linear.png +0 -0
  743. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-sRGB-tRNS.png +0 -0
  744. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-sRGB.png +0 -0
  745. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-tRNS.png +0 -0
  746. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4.png +0 -0
  747. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-1.8-tRNS.png +0 -0
  748. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-1.8.png +0 -0
  749. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-linear-tRNS.png +0 -0
  750. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-linear.png +0 -0
  751. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-sRGB-tRNS.png +0 -0
  752. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-sRGB.png +0 -0
  753. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-tRNS.png +0 -0
  754. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8.png +0 -0
  755. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-1.8-tRNS.png +0 -0
  756. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-1.8.png +0 -0
  757. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-linear-tRNS.png +0 -0
  758. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-linear.png +0 -0
  759. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-sRGB-tRNS.png +0 -0
  760. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-sRGB.png +0 -0
  761. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-tRNS.png +0 -0
  762. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16.png +0 -0
  763. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-1.8-tRNS.png +0 -0
  764. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-1.8.png +0 -0
  765. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-linear-tRNS.png +0 -0
  766. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-linear.png +0 -0
  767. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-sRGB-tRNS.png +0 -0
  768. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-sRGB.png +0 -0
  769. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-tRNS.png +0 -0
  770. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8.png +0 -0
  771. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-1.8.png +0 -0
  772. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-linear.png +0 -0
  773. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-sRGB.png +0 -0
  774. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16.png +0 -0
  775. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-1.8.png +0 -0
  776. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-linear.png +0 -0
  777. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-sRGB.png +0 -0
  778. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8.png +0 -0
  779. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/README.txt +27 -0
  780. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/checksum-icc.c +102 -0
  781. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/chkfmt +144 -0
  782. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/cvtcolor.c +188 -0
  783. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/genpng.c +881 -0
  784. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/intgamma.sh +110 -0
  785. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/makesRGB.c +430 -0
  786. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/png-fix-itxt.c +164 -0
  787. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/pngcp.c +2453 -0
  788. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/pngfix.c +4049 -0
  789. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/reindent +25 -0
  790. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/sRGB.h +48 -0
  791. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/PngFile.c +454 -0
  792. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/PngFile.h +30 -0
  793. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/README.txt +61 -0
  794. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.c +978 -0
  795. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.dsp +147 -0
  796. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.dsw +29 -0
  797. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.ico +0 -0
  798. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.png +0 -0
  799. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.rc +152 -0
  800. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/cexcept.h +248 -0
  801. package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/resource.h +23 -0
  802. package/mgba-bridge/vendor/mgba/src/third-party/libpng/depcomp +791 -0
  803. package/mgba-bridge/vendor/mgba/src/third-party/libpng/example.c +1040 -0
  804. package/mgba-bridge/vendor/mgba/src/third-party/libpng/install-sh +518 -0
  805. package/mgba-bridge/vendor/mgba/src/third-party/libpng/intel/filter_sse2_intrinsics.c +391 -0
  806. package/mgba-bridge/vendor/mgba/src/third-party/libpng/intel/intel_init.c +52 -0
  807. package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng-config.in +127 -0
  808. package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng-manual.txt +5409 -0
  809. package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng.3 +6052 -0
  810. package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng.pc.in +12 -0
  811. package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpngpf.3 +24 -0
  812. package/mgba-bridge/vendor/mgba/src/third-party/libpng/ltmain.sh +11147 -0
  813. package/mgba-bridge/vendor/mgba/src/third-party/libpng/mips/filter_msa_intrinsics.c +808 -0
  814. package/mgba-bridge/vendor/mgba/src/third-party/libpng/mips/mips_init.c +130 -0
  815. package/mgba-bridge/vendor/mgba/src/third-party/libpng/missing +215 -0
  816. package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.5 +84 -0
  817. package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.c +4607 -0
  818. package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.h +3247 -0
  819. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngbar.jpg +0 -0
  820. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngbar.png +0 -0
  821. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngconf.h +623 -0
  822. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngdebug.h +153 -0
  823. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngerror.c +963 -0
  824. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngget.c +1249 -0
  825. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pnginfo.h +267 -0
  826. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngmem.c +284 -0
  827. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngnow.png +0 -0
  828. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngpread.c +1096 -0
  829. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngpriv.h +2152 -0
  830. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngread.c +4225 -0
  831. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrio.c +120 -0
  832. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrtran.c +5044 -0
  833. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrutil.c +4681 -0
  834. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngset.c +1802 -0
  835. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngstruct.h +489 -0
  836. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtest.c +2158 -0
  837. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtest.png +0 -0
  838. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtrans.c +864 -0
  839. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngusr.dfa +14 -0
  840. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwio.c +168 -0
  841. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwrite.c +2395 -0
  842. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwtran.c +575 -0
  843. package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwutil.c +2781 -0
  844. package/mgba-bridge/vendor/mgba/src/third-party/libpng/powerpc/filter_vsx_intrinsics.c +768 -0
  845. package/mgba-bridge/vendor/mgba/src/third-party/libpng/powerpc/powerpc_init.c +126 -0
  846. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/libpng.tgt +383 -0
  847. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/libpng.wpj +112 -0
  848. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngconfig.mak +160 -0
  849. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngstest.tgt +219 -0
  850. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngtest.tgt +179 -0
  851. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngvalid.tgt +210 -0
  852. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/PRJ0041.mak +21 -0
  853. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/README.txt +58 -0
  854. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/README_zlib.txt +44 -0
  855. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/libpng.sln +60 -0
  856. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/libpng.vcproj +419 -0
  857. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/pngtest.vcproj +267 -0
  858. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/zlib.vcproj +391 -0
  859. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/libpng/libpng.vcxproj +234 -0
  860. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pnglibconf/pnglibconf.vcxproj +61 -0
  861. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngstest/pngstest.vcxproj +219 -0
  862. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngtest/pngtest.vcxproj +220 -0
  863. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngunknown/pngunknown.vcxproj +219 -0
  864. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngvalid/pngvalid.vcxproj +219 -0
  865. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/vstudio.sln +109 -0
  866. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/zlib/zlib.vcxproj +175 -0
  867. package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/zlib.props +57 -0
  868. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/README.txt +79 -0
  869. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/SCOPTIONS.ppc +7 -0
  870. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/checksym.awk +173 -0
  871. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/descrip.mms +52 -0
  872. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/dfn.awk +203 -0
  873. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/genchk.cmake.in +37 -0
  874. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/genout.cmake.in +93 -0
  875. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/gensrc.cmake.in +138 -0
  876. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/intprefix.c +22 -0
  877. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng-config-body.in +96 -0
  878. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng-config-head.in +24 -0
  879. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng.pc.in +10 -0
  880. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libtool.m4 +8369 -0
  881. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltoptions.m4 +437 -0
  882. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltsugar.m4 +124 -0
  883. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltversion.m4 +23 -0
  884. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/lt~obsolete.m4 +99 -0
  885. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/macro.lst +3 -0
  886. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.32sunu +244 -0
  887. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.64sunu +244 -0
  888. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.acorn +57 -0
  889. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.aix +116 -0
  890. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.amiga +58 -0
  891. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.atari +71 -0
  892. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.bc32 +158 -0
  893. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.beos +222 -0
  894. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.cegcc +116 -0
  895. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.clang +87 -0
  896. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.clang-asan +87 -0
  897. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.darwin +225 -0
  898. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.dec +210 -0
  899. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.dj2 +72 -0
  900. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.freebsd +69 -0
  901. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.gcc +87 -0
  902. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.gcc-asan +87 -0
  903. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hp64 +231 -0
  904. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hpgcc +234 -0
  905. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hpux +229 -0
  906. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.ibmc +90 -0
  907. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.intel +115 -0
  908. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.linux +246 -0
  909. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.linux-opt +265 -0
  910. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.mips +103 -0
  911. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.msys +202 -0
  912. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.netbsd +55 -0
  913. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.openbsd +86 -0
  914. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sco +226 -0
  915. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sggcc +236 -0
  916. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sgi +237 -0
  917. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.so9 +247 -0
  918. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.solaris +243 -0
  919. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.std +134 -0
  920. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sunos +115 -0
  921. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.vcwin32 +113 -0
  922. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makevms.com +142 -0
  923. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/options.awk +898 -0
  924. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.dfa +920 -0
  925. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.h.prebuilt +219 -0
  926. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.mak +55 -0
  927. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pngwin.rc +112 -0
  928. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/prefix.c +24 -0
  929. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/smakefile.ppc +34 -0
  930. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/sym.c +15 -0
  931. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/symbols.c +58 -0
  932. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/symbols.def +255 -0
  933. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/test.cmake.in +31 -0
  934. package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/vers.c +19 -0
  935. package/mgba-bridge/vendor/mgba/src/third-party/libpng/test-driver +148 -0
  936. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7z.h +202 -0
  937. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zAlloc.c +80 -0
  938. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zAlloc.h +19 -0
  939. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zArcIn.c +1771 -0
  940. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf.c +36 -0
  941. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf.h +35 -0
  942. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf2.c +52 -0
  943. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrc.c +128 -0
  944. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrc.h +25 -0
  945. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrcOpt.c +115 -0
  946. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zDec.c +591 -0
  947. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zFile.c +286 -0
  948. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zFile.h +83 -0
  949. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zStream.c +176 -0
  950. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zTypes.h +375 -0
  951. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zVersion.h +27 -0
  952. package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zVersion.rc +55 -0
  953. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Aes.c +306 -0
  954. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Aes.h +38 -0
  955. package/mgba-bridge/vendor/mgba/src/third-party/lzma/AesOpt.c +184 -0
  956. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Alloc.c +455 -0
  957. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Alloc.h +51 -0
  958. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2.c +257 -0
  959. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2.h +146 -0
  960. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2Enc.c +311 -0
  961. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra.c +230 -0
  962. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra.h +64 -0
  963. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra86.c +82 -0
  964. package/mgba-bridge/vendor/mgba/src/third-party/lzma/BraIA64.c +53 -0
  965. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Compiler.h +33 -0
  966. package/mgba-bridge/vendor/mgba/src/third-party/lzma/CpuArch.c +218 -0
  967. package/mgba-bridge/vendor/mgba/src/third-party/lzma/CpuArch.h +336 -0
  968. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Delta.c +64 -0
  969. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Delta.h +19 -0
  970. package/mgba-bridge/vendor/mgba/src/third-party/lzma/DllSecur.c +108 -0
  971. package/mgba-bridge/vendor/mgba/src/third-party/lzma/DllSecur.h +20 -0
  972. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFind.c +1127 -0
  973. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFind.h +121 -0
  974. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFindMt.c +853 -0
  975. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFindMt.h +101 -0
  976. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzHash.h +57 -0
  977. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Dec.c +488 -0
  978. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Dec.h +120 -0
  979. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2DecMt.c +1082 -0
  980. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2DecMt.h +79 -0
  981. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Enc.c +803 -0
  982. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Enc.h +55 -0
  983. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86.h +111 -0
  984. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86Dec.c +54 -0
  985. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86Enc.c +106 -0
  986. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaDec.c +1185 -0
  987. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaDec.h +234 -0
  988. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaEnc.c +2976 -0
  989. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaEnc.h +76 -0
  990. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaLib.c +40 -0
  991. package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaLib.h +131 -0
  992. package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtCoder.c +601 -0
  993. package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtCoder.h +141 -0
  994. package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtDec.c +1138 -0
  995. package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtDec.h +201 -0
  996. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd.h +85 -0
  997. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7.c +712 -0
  998. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7.h +142 -0
  999. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7Dec.c +191 -0
  1000. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7Enc.c +187 -0
  1001. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Precomp.h +10 -0
  1002. package/mgba-bridge/vendor/mgba/src/third-party/lzma/RotateDefs.h +30 -0
  1003. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sha256.c +248 -0
  1004. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sha256.h +26 -0
  1005. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sort.c +141 -0
  1006. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sort.h +18 -0
  1007. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Threads.c +95 -0
  1008. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Threads.h +68 -0
  1009. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7z.dsp +241 -0
  1010. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7z.dsw +29 -0
  1011. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7zMain.c +686 -0
  1012. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/Precomp.c +4 -0
  1013. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/Precomp.h +10 -0
  1014. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/makefile +40 -0
  1015. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/makefile.gcc +75 -0
  1016. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.c +258 -0
  1017. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.dsp +168 -0
  1018. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.dsw +29 -0
  1019. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/makefile +28 -0
  1020. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/makefile.gcc +44 -0
  1021. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.def +4 -0
  1022. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.dsp +178 -0
  1023. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.dsw +29 -0
  1024. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLibExports.c +14 -0
  1025. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/makefile +34 -0
  1026. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/resource.rc +3 -0
  1027. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/Precomp.c +4 -0
  1028. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/Precomp.h +10 -0
  1029. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.c +640 -0
  1030. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.dsp +231 -0
  1031. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.dsw +29 -0
  1032. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/makefile +37 -0
  1033. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/makefile_con +38 -0
  1034. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/resource.rc +5 -0
  1035. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/setup.ico +0 -0
  1036. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Xz.c +90 -0
  1037. package/mgba-bridge/vendor/mgba/src/third-party/lzma/Xz.h +460 -0
  1038. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64.c +86 -0
  1039. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64.h +26 -0
  1040. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64Opt.c +69 -0
  1041. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzDec.c +2766 -0
  1042. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzEnc.c +1329 -0
  1043. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzEnc.h +60 -0
  1044. package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzIn.c +319 -0
  1045. package/mgba-bridge/vendor/mgba/src/third-party/zlib/CMakeLists.txt +249 -0
  1046. package/mgba-bridge/vendor/mgba/src/third-party/zlib/ChangeLog +1578 -0
  1047. package/mgba-bridge/vendor/mgba/src/third-party/zlib/FAQ +368 -0
  1048. package/mgba-bridge/vendor/mgba/src/third-party/zlib/INDEX +68 -0
  1049. package/mgba-bridge/vendor/mgba/src/third-party/zlib/Makefile +5 -0
  1050. package/mgba-bridge/vendor/mgba/src/third-party/zlib/Makefile.in +408 -0
  1051. package/mgba-bridge/vendor/mgba/src/third-party/zlib/README +118 -0
  1052. package/mgba-bridge/vendor/mgba/src/third-party/zlib/adler32.c +186 -0
  1053. package/mgba-bridge/vendor/mgba/src/third-party/zlib/amiga/Makefile.pup +69 -0
  1054. package/mgba-bridge/vendor/mgba/src/third-party/zlib/amiga/Makefile.sas +68 -0
  1055. package/mgba-bridge/vendor/mgba/src/third-party/zlib/compress.c +86 -0
  1056. package/mgba-bridge/vendor/mgba/src/third-party/zlib/configure +927 -0
  1057. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/README.contrib +57 -0
  1058. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/buffer_demo.adb +106 -0
  1059. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/mtest.adb +156 -0
  1060. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/read.adb +156 -0
  1061. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/readme.txt +65 -0
  1062. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/test.adb +463 -0
  1063. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-streams.adb +225 -0
  1064. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-streams.ads +114 -0
  1065. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-thin.adb +141 -0
  1066. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-thin.ads +450 -0
  1067. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.adb +701 -0
  1068. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.ads +328 -0
  1069. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.gpr +20 -0
  1070. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/Makefile +8 -0
  1071. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/README +4 -0
  1072. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/blast.c +466 -0
  1073. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/blast.h +83 -0
  1074. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/test.pk +0 -0
  1075. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/test.txt +1 -0
  1076. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/ZLib.pas +557 -0
  1077. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/ZLibConst.pas +11 -0
  1078. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/readme.txt +76 -0
  1079. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/zlibd32.mak +99 -0
  1080. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
  1081. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
  1082. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
  1083. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
  1084. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
  1085. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
  1086. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
  1087. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
  1088. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
  1089. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
  1090. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.build +33 -0
  1091. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.chm +0 -0
  1092. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.sln +21 -0
  1093. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
  1094. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/readme.txt +58 -0
  1095. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/gcc_gvmat64/gvmat64.S +574 -0
  1096. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/README +1 -0
  1097. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/infback9.c +615 -0
  1098. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/infback9.h +37 -0
  1099. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inffix9.h +107 -0
  1100. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inflate9.h +47 -0
  1101. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inftree9.c +324 -0
  1102. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inftree9.h +61 -0
  1103. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/test.cpp +24 -0
  1104. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/zfstream.cpp +329 -0
  1105. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/zfstream.h +128 -0
  1106. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream2/zstream.h +307 -0
  1107. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream2/zstream_test.cpp +25 -0
  1108. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/README +35 -0
  1109. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/TODO +17 -0
  1110. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/test.cc +50 -0
  1111. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/zfstream.cc +479 -0
  1112. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/zfstream.h +466 -0
  1113. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/Makefile +29 -0
  1114. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/Makefile.am +45 -0
  1115. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
  1116. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/MiniZip64_info.txt +74 -0
  1117. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/configure.ac +32 -0
  1118. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/crypt.h +132 -0
  1119. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/ioapi.c +257 -0
  1120. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/ioapi.h +210 -0
  1121. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/iowin32.c +462 -0
  1122. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/iowin32.h +28 -0
  1123. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/make_vms.com +25 -0
  1124. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/miniunz.c +659 -0
  1125. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/miniunzip.1 +63 -0
  1126. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.1 +46 -0
  1127. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.c +521 -0
  1128. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.pc.in +12 -0
  1129. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/mztools.c +291 -0
  1130. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/mztools.h +37 -0
  1131. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/unzip.c +2128 -0
  1132. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/unzip.h +437 -0
  1133. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/zip.c +2007 -0
  1134. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/zip.h +367 -0
  1135. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/example.pas +599 -0
  1136. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/readme.txt +76 -0
  1137. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/zlibd32.mak +99 -0
  1138. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/zlibpas.pas +276 -0
  1139. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/Makefile +42 -0
  1140. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/README +63 -0
  1141. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/puff.c +840 -0
  1142. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/puff.h +35 -0
  1143. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/pufftest.c +165 -0
  1144. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/zeros.raw +0 -0
  1145. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/testzlib/testzlib.c +275 -0
  1146. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/testzlib/testzlib.txt +10 -0
  1147. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/Makefile +14 -0
  1148. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/Makefile.msc +17 -0
  1149. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/untgz.c +674 -0
  1150. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/readme.txt +78 -0
  1151. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/miniunz.vcxproj +310 -0
  1152. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters +22 -0
  1153. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/minizip.vcxproj +307 -0
  1154. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters +22 -0
  1155. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlib.vcxproj +420 -0
  1156. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters +58 -0
  1157. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj +310 -0
  1158. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters +22 -0
  1159. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlib.rc +32 -0
  1160. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj +473 -0
  1161. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters +77 -0
  1162. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.def +158 -0
  1163. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.sln +135 -0
  1164. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj +657 -0
  1165. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters +118 -0
  1166. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/miniunz.vcxproj +314 -0
  1167. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/minizip.vcxproj +311 -0
  1168. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/testzlib.vcxproj +426 -0
  1169. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj +314 -0
  1170. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlib.rc +32 -0
  1171. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj +464 -0
  1172. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.def +158 -0
  1173. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.sln +117 -0
  1174. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj +688 -0
  1175. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/miniunz.vcxproj +316 -0
  1176. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/minizip.vcxproj +313 -0
  1177. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/testzlib.vcxproj +430 -0
  1178. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/testzlibdll.vcxproj +316 -0
  1179. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlib.rc +32 -0
  1180. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +467 -0
  1181. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.def +158 -0
  1182. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.sln +119 -0
  1183. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +692 -0
  1184. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/miniunz.vcxproj +316 -0
  1185. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/minizip.vcxproj +313 -0
  1186. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/testzlib.vcxproj +430 -0
  1187. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj +316 -0
  1188. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlib.rc +32 -0
  1189. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +467 -0
  1190. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.def +158 -0
  1191. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.sln +119 -0
  1192. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +692 -0
  1193. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/miniunz.vcproj +565 -0
  1194. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/minizip.vcproj +562 -0
  1195. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/testzlib.vcproj +852 -0
  1196. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj +565 -0
  1197. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlib.rc +32 -0
  1198. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibstat.vcproj +835 -0
  1199. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.def +158 -0
  1200. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.sln +144 -0
  1201. package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.vcproj +1156 -0
  1202. package/mgba-bridge/vendor/mgba/src/third-party/zlib/crc32.c +1116 -0
  1203. package/mgba-bridge/vendor/mgba/src/third-party/zlib/crc32.h +9446 -0
  1204. package/mgba-bridge/vendor/mgba/src/third-party/zlib/deflate.c +2211 -0
  1205. package/mgba-bridge/vendor/mgba/src/third-party/zlib/deflate.h +346 -0
  1206. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/algorithm.txt +209 -0
  1207. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/crc-doc.1.0.pdf +0 -0
  1208. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1950.txt +619 -0
  1209. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1951.txt +955 -0
  1210. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1952.txt +675 -0
  1211. package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/txtvsbin.txt +107 -0
  1212. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/README.examples +54 -0
  1213. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/enough.c +597 -0
  1214. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/fitblk.c +233 -0
  1215. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gun.c +702 -0
  1216. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzappend.c +504 -0
  1217. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzjoin.c +449 -0
  1218. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzlog.c +1061 -0
  1219. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzlog.h +91 -0
  1220. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gznorm.c +470 -0
  1221. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zlib_how.html +545 -0
  1222. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zpipe.c +205 -0
  1223. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zran.c +479 -0
  1224. package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zran.h +40 -0
  1225. package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzclose.c +25 -0
  1226. package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzguts.h +219 -0
  1227. package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzlib.c +639 -0
  1228. package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzread.c +652 -0
  1229. package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzwrite.c +677 -0
  1230. package/mgba-bridge/vendor/mgba/src/third-party/zlib/infback.c +641 -0
  1231. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffast.c +323 -0
  1232. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffast.h +11 -0
  1233. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffixed.h +94 -0
  1234. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inflate.c +1592 -0
  1235. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inflate.h +126 -0
  1236. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inftrees.c +304 -0
  1237. package/mgba-bridge/vendor/mgba/src/third-party/zlib/inftrees.h +62 -0
  1238. package/mgba-bridge/vendor/mgba/src/third-party/zlib/make_vms.com +867 -0
  1239. package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.bor +115 -0
  1240. package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.dj2 +104 -0
  1241. package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.emx +69 -0
  1242. package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.msc +112 -0
  1243. package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.tc +100 -0
  1244. package/mgba-bridge/vendor/mgba/src/third-party/zlib/nintendods/Makefile +126 -0
  1245. package/mgba-bridge/vendor/mgba/src/third-party/zlib/nintendods/README +5 -0
  1246. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/Makefile.emx +69 -0
  1247. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/Makefile.riscos +151 -0
  1248. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/README +3 -0
  1249. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/descrip.mms +48 -0
  1250. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/os2/Makefile.os2 +136 -0
  1251. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/os2/zlib.def +51 -0
  1252. package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/visual-basic.txt +160 -0
  1253. package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/README400 +48 -0
  1254. package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/bndsrc +119 -0
  1255. package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/make.sh +366 -0
  1256. package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/zlib.inc +527 -0
  1257. package/mgba-bridge/vendor/mgba/src/third-party/zlib/qnx/package.qpg +141 -0
  1258. package/mgba-bridge/vendor/mgba/src/third-party/zlib/treebuild.xml +116 -0
  1259. package/mgba-bridge/vendor/mgba/src/third-party/zlib/trees.c +1182 -0
  1260. package/mgba-bridge/vendor/mgba/src/third-party/zlib/trees.h +128 -0
  1261. package/mgba-bridge/vendor/mgba/src/third-party/zlib/uncompr.c +93 -0
  1262. package/mgba-bridge/vendor/mgba/src/third-party/zlib/watcom/watcom_f.mak +43 -0
  1263. package/mgba-bridge/vendor/mgba/src/third-party/zlib/watcom/watcom_l.mak +43 -0
  1264. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/DLL_FAQ.txt +397 -0
  1265. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.bor +109 -0
  1266. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.gcc +177 -0
  1267. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.msc +159 -0
  1268. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/README-WIN32.txt +103 -0
  1269. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/VisualC.txt +3 -0
  1270. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/zlib.def +97 -0
  1271. package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/zlib1.rc +40 -0
  1272. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h +534 -0
  1273. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h.cmakein +536 -0
  1274. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h.in +534 -0
  1275. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.3 +149 -0
  1276. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.3.pdf +0 -0
  1277. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.h +1935 -0
  1278. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.map +100 -0
  1279. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.pc.cmakein +13 -0
  1280. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.pc.in +13 -0
  1281. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib2ansi +152 -0
  1282. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zutil.c +325 -0
  1283. package/mgba-bridge/vendor/mgba/src/third-party/zlib/zutil.h +274 -0
  1284. package/mgba-bridge/vendor/mgba/src/tools/docgen.c +541 -0
  1285. package/mgba-bridge/vendor/mgba/src/tools/font-sdf.c +136 -0
  1286. package/mgba-bridge/vendor/mgba/src/tools/updater-main.c +377 -0
  1287. package/mgba-bridge/vendor/mgba/src/util/CMakeLists.txt +68 -0
  1288. package/mgba-bridge/vendor/mgba/src/util/audio-buffer.c +62 -0
  1289. package/mgba-bridge/vendor/mgba/src/util/audio-resampler.c +109 -0
  1290. package/mgba-bridge/vendor/mgba/src/util/circle-buffer.c +274 -0
  1291. package/mgba-bridge/vendor/mgba/src/util/configuration.c +233 -0
  1292. package/mgba-bridge/vendor/mgba/src/util/convolve.c +182 -0
  1293. package/mgba-bridge/vendor/mgba/src/util/crc32.c +138 -0
  1294. package/mgba-bridge/vendor/mgba/src/util/elf-read.c +128 -0
  1295. package/mgba-bridge/vendor/mgba/src/util/formatting.c +87 -0
  1296. package/mgba-bridge/vendor/mgba/src/util/gbk-table.c +129 -0
  1297. package/mgba-bridge/vendor/mgba/src/util/geometry.c +94 -0
  1298. package/mgba-bridge/vendor/mgba/src/util/gui/file-select.c +236 -0
  1299. package/mgba-bridge/vendor/mgba/src/util/gui/font-metrics.c +199 -0
  1300. package/mgba-bridge/vendor/mgba/src/util/gui/font.c +169 -0
  1301. package/mgba-bridge/vendor/mgba/src/util/gui/menu.c +412 -0
  1302. package/mgba-bridge/vendor/mgba/src/util/gui.c +81 -0
  1303. package/mgba-bridge/vendor/mgba/src/util/hash.c +108 -0
  1304. package/mgba-bridge/vendor/mgba/src/util/image/export.c +81 -0
  1305. package/mgba-bridge/vendor/mgba/src/util/image/font.c +274 -0
  1306. package/mgba-bridge/vendor/mgba/src/util/image/png-io.c +730 -0
  1307. package/mgba-bridge/vendor/mgba/src/util/image.c +1109 -0
  1308. package/mgba-bridge/vendor/mgba/src/util/interpolator.c +116 -0
  1309. package/mgba-bridge/vendor/mgba/src/util/md5.c +228 -0
  1310. package/mgba-bridge/vendor/mgba/src/util/memory.c +15 -0
  1311. package/mgba-bridge/vendor/mgba/src/util/patch-fast.c +130 -0
  1312. package/mgba-bridge/vendor/mgba/src/util/patch-ips.c +93 -0
  1313. package/mgba-bridge/vendor/mgba/src/util/patch-ups.c +254 -0
  1314. package/mgba-bridge/vendor/mgba/src/util/patch.c +25 -0
  1315. package/mgba-bridge/vendor/mgba/src/util/ring-fifo.c +104 -0
  1316. package/mgba-bridge/vendor/mgba/src/util/sfo.c +229 -0
  1317. package/mgba-bridge/vendor/mgba/src/util/sha1.c +258 -0
  1318. package/mgba-bridge/vendor/mgba/src/util/string.c +652 -0
  1319. package/mgba-bridge/vendor/mgba/src/util/table.c +682 -0
  1320. package/mgba-bridge/vendor/mgba/src/util/text-codec.c +197 -0
  1321. package/mgba-bridge/vendor/mgba/src/util/vector.c +18 -0
  1322. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-devlist.c +104 -0
  1323. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-dirent.c +173 -0
  1324. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-fd.c +282 -0
  1325. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-fifo.c +102 -0
  1326. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-file.c +159 -0
  1327. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-lzma.c +404 -0
  1328. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-mem.c +331 -0
  1329. package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-zip.c +804 -0
  1330. package/mgba-bridge/vendor/mgba/src/util/vfs.c +320 -0
  1331. package/mgba-bridge/vendor/mgba/tools/deploy-mac.py +178 -0
  1332. package/mgba-bridge/vendor/mgba/tools/deploy-win.sh +27 -0
  1333. package/mgba-bridge/vendor/mgba/tools/dlls.gdb +3 -0
  1334. package/mgba-bridge/vendor/mgba/tools/make-dotcode.py +154 -0
  1335. package/mgba-bridge/vendor/mgba/tools/perf.py +230 -0
  1336. package/mgba-bridge/vendor/mgba/tools/sanitize-deb.sh +74 -0
  1337. package/mgba-bridge/vendor/mgba/tools/snes-tile.py +94 -0
  1338. package/mgba-bridge/vendor/mgba/version.cmake +62 -0
  1339. package/package.json +47 -0
  1340. package/src/audio-output.ts +387 -0
  1341. package/src/config.ts +114 -0
  1342. package/src/constants.ts +37 -0
  1343. package/src/extension.ts +570 -0
  1344. package/src/gameboy-mgba.ts +133 -0
  1345. package/src/gameboy-types.ts +24 -0
  1346. package/src/gameboy.ts +33 -0
  1347. package/src/index.ts +1 -0
  1348. package/src/mgba/bridge-bin.ts +66 -0
  1349. package/src/mgba/bridge.ts +145 -0
  1350. package/src/mgba/protocol.ts +30 -0
  1351. package/src/mgba/stdio.ts +74 -0
  1352. package/src/notify.ts +12 -0
  1353. package/src/pi-boy-component.ts +372 -0
  1354. package/src/render/ansi.ts +239 -0
  1355. package/src/render/kitty.ts +154 -0
  1356. package/src/roms.ts +163 -0
  1357. package/src/runtime.ts +36 -0
  1358. package/src/save-state.ts +94 -0
  1359. package/src/terminal.ts +18 -0
  1360. package/tsconfig.json +11 -0
  1361. package/types/shims.d.ts +121 -0
@@ -0,0 +1,2143 @@
1
+ /*---------------------------------------------------------------------------
2
+
3
+ rpng2 - progressive-model PNG display program rpng2-x.c
4
+
5
+ This program decodes and displays PNG files progressively, as if it were
6
+ a web browser (though the front end is only set up to read from files).
7
+ It supports gamma correction, user-specified background colors, and user-
8
+ specified background patterns (for transparent images). This version is
9
+ for the X Window System (tested by the author under Unix and by Martin
10
+ Zinser under OpenVMS; may work under OS/2 with a little tweaking).
11
+
12
+ Thanks to Adam Costello and Pieter S. van der Meulen for the "diamond"
13
+ and "radial waves" patterns, respectively.
14
+
15
+ to do (someday, maybe):
16
+ - fix expose/redraw code: don't draw entire row if only part exposed
17
+ - 8-bit (colormapped) X support
18
+ - finish resizable checkerboard-gradient (sizes 4-128?)
19
+ - use %.1023s to simplify truncation of title-bar string?
20
+
21
+ ---------------------------------------------------------------------------
22
+
23
+ Changelog:
24
+ - 1.01: initial public release
25
+ - 1.02: modified to allow abbreviated options; fixed char/uchar mismatch
26
+ - 1.10: added support for non-default visuals; fixed X pixel-conversion
27
+ - 1.11: added -usleep option for demos; fixed command-line parsing bug
28
+ - 1.12: added -pause option for demos and testing
29
+ - 1.20: added runtime MMX-enabling/disabling and new -mmx* options
30
+ - 1.21: fixed some small X memory leaks (thanks to Fran�ois Petitjean)
31
+ - 1.22: fixed XFreeGC() crash bug (thanks to Patrick Welche)
32
+ - 1.23: added -bgpat 0 mode (std white/gray checkerboard, 8x8 squares)
33
+ - 1.30: added -loop option for -bgpat (ifdef FEATURE_LOOP); fixed bpp =
34
+ 24; added support for X resources (thanks to Gerhard Niklasch)
35
+ - 1.31: added code to skip unused chunks (thanks to Glenn Randers-Pehrson)
36
+ - 1.32: added AMD64/EM64T support (__x86_64__); added basic expose/redraw
37
+ handling
38
+ - 2.00: dual-licensed (added GNU GPL)
39
+ - 2.01: fixed 64-bit typo in readpng2.c; fixed -pause usage description
40
+ - 2.02: fixed improper display of usage screen on PNG error(s); fixed
41
+ unexpected-EOF and file-read-error cases; fixed Trace() cut-and-
42
+ paste bugs
43
+ - 2.03: deleted runtime MMX-enabling/disabling and obsolete -mmx* options
44
+ - 2.04: Added "void(foo);" statements to quiet pedantic compiler warnings
45
+ about unused variables (GR-P)
46
+ - 2.05: Use nanosleep() instead of usleep(), which is deprecated (GR-P).
47
+ - 2.06: check for integer overflow (Glenn R-P)
48
+ ---------------------------------------------------------------------------
49
+
50
+ Copyright (c) 1998-2010, 2014-2015, 2017 Greg Roelofs. All rights
51
+ reserved.
52
+
53
+ This software is provided "as is," without warranty of any kind,
54
+ express or implied. In no event shall the author or contributors
55
+ be held liable for any damages arising in any way from the use of
56
+ this software.
57
+
58
+ The contents of this file are DUAL-LICENSED. You may modify and/or
59
+ redistribute this software according to the terms of one of the
60
+ following two licenses (at your option):
61
+
62
+
63
+ LICENSE 1 ("BSD-like with advertising clause"):
64
+
65
+ Permission is granted to anyone to use this software for any purpose,
66
+ including commercial applications, and to alter it and redistribute
67
+ it freely, subject to the following restrictions:
68
+
69
+ 1. Redistributions of source code must retain the above copyright
70
+ notice, disclaimer, and this list of conditions.
71
+ 2. Redistributions in binary form must reproduce the above copyright
72
+ notice, disclaimer, and this list of conditions in the documenta-
73
+ tion and/or other materials provided with the distribution.
74
+ 3. All advertising materials mentioning features or use of this
75
+ software must display the following acknowledgment:
76
+
77
+ This product includes software developed by Greg Roelofs
78
+ and contributors for the book, "PNG: The Definitive Guide,"
79
+ published by O'Reilly and Associates.
80
+
81
+
82
+ LICENSE 2 (GNU GPL v2 or later):
83
+
84
+ This program is free software; you can redistribute it and/or modify
85
+ it under the terms of the GNU General Public License as published by
86
+ the Free Software Foundation; either version 2 of the License, or
87
+ (at your option) any later version.
88
+
89
+ This program is distributed in the hope that it will be useful,
90
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
91
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
92
+ GNU General Public License for more details.
93
+
94
+ You should have received a copy of the GNU General Public License
95
+ along with this program; if not, write to the Free Software Foundation,
96
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
97
+
98
+ ---------------------------------------------------------------------------*/
99
+
100
+ #define PROGNAME "rpng2-x"
101
+ #define LONGNAME "Progressive PNG Viewer for X"
102
+ #define VERSION "2.04 of 15 June 2014"
103
+ #define RESNAME "rpng2" /* our X resource application name */
104
+ #define RESCLASS "Rpng" /* our X resource class name */
105
+
106
+ #include <stdio.h>
107
+ #include <stdlib.h>
108
+ #include <ctype.h>
109
+ #include <string.h>
110
+ #include <setjmp.h> /* for jmpbuf declaration in readpng2.h */
111
+ #include <time.h>
112
+ #include <math.h> /* only for PvdM background code */
113
+ #include <X11/Xlib.h>
114
+ #include <X11/Xutil.h>
115
+ #include <X11/Xos.h>
116
+ #include <X11/keysym.h> /* defines XK_* macros */
117
+
118
+ #if _POSIX_C_SOURCE >= 199309L /* have nanosleep() */
119
+ # undef usleep
120
+ # define usleep(usec) { \
121
+ struct timespec ts; \
122
+ ts.tv_sec = 0; \
123
+ ts.tv_nsec = (usec) * 1000; \
124
+ nanosleep(&ts, NULL); }
125
+ # endif
126
+
127
+ #ifndef usleep /* have neither nanosleep() nor usleep() */
128
+ # define usleep(x) sleep(((x)+499999)/1000000)
129
+ #endif
130
+
131
+ #ifdef VMS
132
+ # include <unistd.h>
133
+ #endif
134
+
135
+ /* all for PvdM background code: */
136
+ #ifndef PI
137
+ # define PI 3.141592653589793238
138
+ #endif
139
+ #define PI_2 (PI*0.5)
140
+ #define INV_PI_360 (360.0 / PI)
141
+ #define MAX(a,b) (a>b?a:b)
142
+ #define MIN(a,b) (a<b?a:b)
143
+ #define CLIP(a,min,max) MAX(min,MIN((a),max))
144
+ #define ABS(a) ((a)<0?-(a):(a))
145
+ #define CLIP8P(c) MAX(0,(MIN((c),255))) /* 8-bit pos. integer (uch) */
146
+ #define ROUNDF(f) ((int)(f + 0.5))
147
+
148
+ #define QUIT(e,k) ((e.type == ButtonPress && e.xbutton.button == Button1) || \
149
+ (e.type == KeyPress && /* v--- or 1 for shifted keys */ \
150
+ ((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape)))
151
+
152
+ #define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */
153
+
154
+ #define rgb1_max bg_freq
155
+ #define rgb1_min bg_gray
156
+ #define rgb2_max bg_bsat
157
+ #define rgb2_min bg_brot
158
+
159
+ /* #define DEBUG */ /* this enables the Trace() macros */
160
+
161
+ #include "readpng2.h" /* typedefs, common macros, readpng2 prototypes */
162
+
163
+
164
+ /* could just include png.h, but this macro is the only thing we need
165
+ * (name and typedefs changed to local versions); note that side effects
166
+ * only happen with alpha (which could easily be avoided with
167
+ * "ush acopy = (alpha);") */
168
+
169
+ #define alpha_composite(composite, fg, alpha, bg) { \
170
+ ush temp = ((ush)(fg)*(ush)(alpha) + \
171
+ (ush)(bg)*(ush)(255 - (ush)(alpha)) + (ush)128); \
172
+ (composite) = (uch)((temp + (temp >> 8)) >> 8); \
173
+ }
174
+
175
+
176
+ #define INBUFSIZE 4096 /* with pseudo-timing on (1 sec delay/block), this
177
+ * block size corresponds roughly to a download
178
+ * speed 10% faster than theoretical 33.6K maximum
179
+ * (assuming 8 data bits, 1 stop bit and no other
180
+ * overhead) */
181
+
182
+ /* local prototypes */
183
+ static void rpng2_x_init (void);
184
+ static int rpng2_x_create_window (void);
185
+ static int rpng2_x_load_bg_image (void);
186
+ static void rpng2_x_display_row (ulg row);
187
+ static void rpng2_x_finish_display (void);
188
+ static void rpng2_x_redisplay_image (ulg startcol, ulg startrow,
189
+ ulg width, ulg height);
190
+ #ifdef FEATURE_LOOP
191
+ static void rpng2_x_reload_bg_image (void);
192
+ static int is_number (char *p);
193
+ #endif
194
+ static void rpng2_x_cleanup (void);
195
+ static int rpng2_x_msb (ulg u32val);
196
+
197
+
198
+ static char titlebar[1024], *window_name = titlebar;
199
+ static char *appname = LONGNAME;
200
+ static char *icon_name = PROGNAME;
201
+ static char *res_name = RESNAME;
202
+ static char *res_class = RESCLASS;
203
+ static char *filename;
204
+ static FILE *infile;
205
+
206
+ static mainprog_info rpng2_info;
207
+
208
+ static uch inbuf[INBUFSIZE];
209
+ static int incount;
210
+
211
+ static int pat = 6; /* must be less than num_bgpat */
212
+ static int bg_image = 0;
213
+ static int bgscale, bgscale_default = 16;
214
+ static ulg bg_rowbytes;
215
+ static uch *bg_data;
216
+
217
+ int pause_after_pass = FALSE;
218
+ int demo_timing = FALSE;
219
+ ulg usleep_duration = 0L;
220
+
221
+ static struct rgb_color {
222
+ uch r, g, b;
223
+ } rgb[] = {
224
+ { 0, 0, 0}, /* 0: black */
225
+ {255, 255, 255}, /* 1: white */
226
+ {173, 132, 57}, /* 2: tan */
227
+ { 64, 132, 0}, /* 3: medium green */
228
+ {189, 117, 1}, /* 4: gold */
229
+ {253, 249, 1}, /* 5: yellow */
230
+ { 0, 0, 255}, /* 6: blue */
231
+ { 0, 0, 120}, /* 7: medium blue */
232
+ {255, 0, 255}, /* 8: magenta */
233
+ { 64, 0, 64}, /* 9: dark magenta */
234
+ {255, 0, 0}, /* 10: red */
235
+ { 64, 0, 0}, /* 11: dark red */
236
+ {255, 127, 0}, /* 12: orange */
237
+ {192, 96, 0}, /* 13: darker orange */
238
+ { 24, 60, 0}, /* 14: dark green-yellow */
239
+ { 85, 125, 200}, /* 15: ice blue */
240
+ {192, 192, 192} /* 16: Netscape/Mosaic gray */
241
+ };
242
+ /* not used for now, but should be for error-checking:
243
+ static int num_rgb = sizeof(rgb) / sizeof(struct rgb_color);
244
+ */
245
+
246
+ /*
247
+ This whole struct is a fairly cheesy way to keep the number of
248
+ command-line options to a minimum. The radial-waves background
249
+ type is a particularly poor fit to the integer elements of the
250
+ struct...but a few macros and a little fixed-point math will do
251
+ wonders for ya.
252
+
253
+ type bits:
254
+ F E D C B A 9 8 7 6 5 4 3 2 1 0
255
+ | | | | |
256
+ | | +-+-+-- 0 = sharp-edged checkerboard
257
+ | | 1 = soft diamonds
258
+ | | 2 = radial waves
259
+ | | 3-7 = undefined
260
+ | +-- gradient #2 inverted?
261
+ +-- alternating columns inverted?
262
+ */
263
+ static struct background_pattern {
264
+ ush type;
265
+ int rgb1_max, rgb1_min; /* or bg_freq, bg_gray */
266
+ int rgb2_max, rgb2_min; /* or bg_bsat, bg_brot (both scaled by 10)*/
267
+ } bg[] = {
268
+ {0, 1,1, 16,16}, /* checkered: white vs. light gray (basic) */
269
+ {0+8, 2,0, 1,15}, /* checkered: tan/black vs. white/ice blue */
270
+ {0+24, 2,0, 1,0}, /* checkered: tan/black vs. white/black */
271
+ {0+8, 4,5, 0,2}, /* checkered: gold/yellow vs. black/tan */
272
+ {0+8, 4,5, 0,6}, /* checkered: gold/yellow vs. black/blue */
273
+ {0, 7,0, 8,9}, /* checkered: deep blue/black vs. magenta */
274
+ {0+8, 13,0, 5,14}, /* checkered: orange/black vs. yellow */
275
+ {0+8, 12,0, 10,11}, /* checkered: orange/black vs. red */
276
+ {1, 7,0, 8,0}, /* diamonds: deep blue/black vs. magenta */
277
+ {1, 12,0, 11,0}, /* diamonds: orange vs. dark red */
278
+ {1, 10,0, 7,0}, /* diamonds: red vs. medium blue */
279
+ {1, 4,0, 5,0}, /* diamonds: gold vs. yellow */
280
+ {1, 3,0, 0,0}, /* diamonds: medium green vs. black */
281
+ {2, 16, 100, 20, 0}, /* radial: ~hard radial color-beams */
282
+ {2, 18, 100, 10, 2}, /* radial: soft, curved radial color-beams */
283
+ {2, 16, 256, 100, 250}, /* radial: very tight spiral */
284
+ {2, 10000, 256, 11, 0} /* radial: dipole-moire' (almost fractal) */
285
+ };
286
+ static int num_bgpat = sizeof(bg) / sizeof(struct background_pattern);
287
+
288
+
289
+ /* X-specific variables */
290
+ static char *displayname;
291
+ static XImage *ximage;
292
+ static Display *display;
293
+ static int depth;
294
+ static Visual *visual;
295
+ static XVisualInfo *visual_list;
296
+ static int RShift, GShift, BShift;
297
+ static ulg RMask, GMask, BMask;
298
+ static Window window;
299
+ static GC gc;
300
+ static Colormap colormap;
301
+
302
+ static int have_nondefault_visual = FALSE;
303
+ static int have_colormap = FALSE;
304
+ static int have_window = FALSE;
305
+ static int have_gc = FALSE;
306
+
307
+
308
+
309
+
310
+ int main(int argc, char **argv)
311
+ {
312
+ #ifdef sgi
313
+ char tmpline[80];
314
+ #endif
315
+ char *p, *bgstr = NULL;
316
+ int rc, alen, flen;
317
+ int error = 0;
318
+ int timing = FALSE;
319
+ int have_bg = FALSE;
320
+ #ifdef FEATURE_LOOP
321
+ int loop = FALSE;
322
+ long loop_interval = -1; /* seconds (100,000 max) */
323
+ #endif
324
+ double LUT_exponent; /* just the lookup table */
325
+ double CRT_exponent = 2.2; /* just the monitor */
326
+ double default_display_exponent; /* whole display system */
327
+ XEvent e;
328
+ KeySym k;
329
+
330
+
331
+ /* First initialize a few things, just to be sure--memset takes care of
332
+ * default background color (black), booleans (FALSE), pointers (NULL),
333
+ * etc. */
334
+
335
+ displayname = (char *)NULL;
336
+ filename = (char *)NULL;
337
+ memset(&rpng2_info, 0, sizeof(mainprog_info));
338
+
339
+
340
+ /* Set the default value for our display-system exponent, i.e., the
341
+ * product of the CRT exponent and the exponent corresponding to
342
+ * the frame-buffer's lookup table (LUT), if any. This is not an
343
+ * exhaustive list of LUT values (e.g., OpenStep has a lot of weird
344
+ * ones), but it should cover 99% of the current possibilities. */
345
+
346
+ #if defined(NeXT)
347
+ /* third-party utilities can modify the default LUT exponent */
348
+ LUT_exponent = 1.0 / 2.2;
349
+ /*
350
+ if (some_next_function_that_returns_gamma(&next_gamma))
351
+ LUT_exponent = 1.0 / next_gamma;
352
+ */
353
+ #elif defined(sgi)
354
+ LUT_exponent = 1.0 / 1.7;
355
+ /* there doesn't seem to be any documented function to
356
+ * get the "gamma" value, so we do it the hard way */
357
+ infile = fopen("/etc/config/system.glGammaVal", "r");
358
+ if (infile) {
359
+ double sgi_gamma;
360
+
361
+ fgets(tmpline, 80, infile);
362
+ fclose(infile);
363
+ sgi_gamma = atof(tmpline);
364
+ if (sgi_gamma > 0.0)
365
+ LUT_exponent = 1.0 / sgi_gamma;
366
+ }
367
+ #elif defined(Macintosh)
368
+ LUT_exponent = 1.8 / 2.61;
369
+ /*
370
+ if (some_mac_function_that_returns_gamma(&mac_gamma))
371
+ LUT_exponent = mac_gamma / 2.61;
372
+ */
373
+ #else
374
+ LUT_exponent = 1.0; /* assume no LUT: most PCs */
375
+ #endif
376
+
377
+ /* the defaults above give 1.0, 1.3, 1.5 and 2.2, respectively: */
378
+ default_display_exponent = LUT_exponent * CRT_exponent;
379
+
380
+
381
+ /* If the user has set the SCREEN_GAMMA environment variable as suggested
382
+ * (somewhat imprecisely) in the libpng documentation, use that; otherwise
383
+ * use the default value we just calculated. Either way, the user may
384
+ * override this via a command-line option. */
385
+
386
+ if ((p = getenv("SCREEN_GAMMA")) != NULL)
387
+ rpng2_info.display_exponent = atof(p);
388
+ else
389
+ rpng2_info.display_exponent = default_display_exponent;
390
+
391
+
392
+ /* Now parse the command line for options and the PNG filename. */
393
+
394
+ while (*++argv && !error) {
395
+ if (!strncmp(*argv, "-display", 2)) {
396
+ if (!*++argv)
397
+ ++error;
398
+ else
399
+ displayname = *argv;
400
+ } else if (!strncmp(*argv, "-gamma", 2)) {
401
+ if (!*++argv)
402
+ ++error;
403
+ else {
404
+ rpng2_info.display_exponent = atof(*argv);
405
+ if (rpng2_info.display_exponent <= 0.0)
406
+ ++error;
407
+ }
408
+ } else if (!strncmp(*argv, "-bgcolor", 4)) {
409
+ if (!*++argv)
410
+ ++error;
411
+ else {
412
+ bgstr = *argv;
413
+ if (strlen(bgstr) != 7 || bgstr[0] != '#')
414
+ ++error;
415
+ else {
416
+ have_bg = TRUE;
417
+ bg_image = FALSE;
418
+ }
419
+ }
420
+ } else if (!strncmp(*argv, "-bgpat", 4)) {
421
+ if (!*++argv)
422
+ ++error;
423
+ else {
424
+ pat = atoi(*argv);
425
+ if (pat >= 0 && pat < num_bgpat) {
426
+ bg_image = TRUE;
427
+ have_bg = FALSE;
428
+ } else
429
+ ++error;
430
+ }
431
+ } else if (!strncmp(*argv, "-usleep", 2)) {
432
+ if (!*++argv)
433
+ ++error;
434
+ else {
435
+ usleep_duration = (ulg)atol(*argv);
436
+ demo_timing = TRUE;
437
+ }
438
+ } else if (!strncmp(*argv, "-pause", 2)) {
439
+ pause_after_pass = TRUE;
440
+ } else if (!strncmp(*argv, "-timing", 2)) {
441
+ timing = TRUE;
442
+ #ifdef FEATURE_LOOP
443
+ } else if (!strncmp(*argv, "-loop", 2)) {
444
+ loop = TRUE;
445
+ if (!argv[1] || !is_number(argv[1]))
446
+ loop_interval = 2;
447
+ else {
448
+ ++argv;
449
+ loop_interval = atol(*argv);
450
+ if (loop_interval < 0)
451
+ loop_interval = 2;
452
+ else if (loop_interval > 100000) /* bit more than one day */
453
+ loop_interval = 100000;
454
+ }
455
+ #endif
456
+ } else {
457
+ if (**argv != '-') {
458
+ filename = *argv;
459
+ if (argv[1]) /* shouldn't be any more args after filename */
460
+ ++error;
461
+ } else
462
+ ++error; /* not expecting any other options */
463
+ }
464
+ }
465
+
466
+ if (!filename)
467
+ ++error;
468
+
469
+
470
+ /* print usage screen if any errors up to this point */
471
+
472
+ if (error) {
473
+ fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
474
+ readpng2_version_info();
475
+ fprintf(stderr, "\n"
476
+ "Usage: ");
477
+ fprintf(stderr,
478
+ "%s [-display xdpy] [-gamma exp] [-bgcolor bg | -bgpat pat]\n"
479
+ " %*s [-usleep dur | -timing] [-pause]\n",
480
+ PROGNAME, (int)strlen(PROGNAME), " ");
481
+ fprintf(stderr,
482
+ #ifdef FEATURE_LOOP
483
+ " [-loop [sec]]"
484
+ #endif
485
+ " file.png\n\n");
486
+ fprintf(stderr,
487
+ " xdpy\tname of the target X display (e.g., ``hostname:0'')\n"
488
+ " exp \ttransfer-function exponent (``gamma'') of the display\n"
489
+ "\t\t system in floating-point format (e.g., ``%.1f''); equal\n"
490
+ "\t\t to the product of the lookup-table exponent (varies)\n",
491
+ default_display_exponent);
492
+ fprintf(stderr,
493
+ "\t\t and the CRT exponent (usually 2.2); must be positive\n"
494
+ " bg \tdesired background color in 7-character hex RGB format\n"
495
+ "\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
496
+ "\t\t used with transparent images; overrides -bgpat\n"
497
+ " pat \tdesired background pattern number (0-%d); used with\n"
498
+ "\t\t transparent images; overrides -bgcolor\n",
499
+ num_bgpat-1);
500
+ #ifdef FEATURE_LOOP
501
+ fprintf(stderr,
502
+ " -loop\tloops through background images after initial display\n"
503
+ "\t\t is complete (depends on -bgpat)\n"
504
+ " sec \tseconds to display each background image (default = 2)\n");
505
+ #endif
506
+ fprintf(stderr,
507
+ " dur \tduration in microseconds to wait after displaying each\n"
508
+ "\t\t row (for demo purposes)\n"
509
+ " -timing\tenables delay for every block read, to simulate modem\n"
510
+ "\t\t download of image (~36 Kbps)\n"
511
+ " -pause\tpauses after displaying each pass until mouse clicked\n"
512
+ "\nPress Q, Esc or mouse button 1 (within image window, after image\n"
513
+ "is displayed) to quit.\n");
514
+ exit(1);
515
+ }
516
+
517
+ if (!(infile = fopen(filename, "rb"))) {
518
+ fprintf(stderr, PROGNAME ": can't open PNG file [%s]\n", filename);
519
+ ++error;
520
+ } else {
521
+ incount = fread(inbuf, 1, INBUFSIZE, infile);
522
+ if (incount < 8 || !readpng2_check_sig(inbuf, 8)) {
523
+ fprintf(stderr, PROGNAME
524
+ ": [%s] is not a PNG file: incorrect signature\n",
525
+ filename);
526
+ ++error;
527
+ } else if ((rc = readpng2_init(&rpng2_info)) != 0) {
528
+ switch (rc) {
529
+ case 2:
530
+ fprintf(stderr, PROGNAME
531
+ ": [%s] has bad IHDR (libpng longjmp)\n", filename);
532
+ break;
533
+ case 4:
534
+ fprintf(stderr, PROGNAME ": insufficient memory\n");
535
+ break;
536
+ default:
537
+ fprintf(stderr, PROGNAME
538
+ ": unknown readpng2_init() error\n");
539
+ break;
540
+ }
541
+ ++error;
542
+ } else {
543
+ Trace((stderr, "about to call XOpenDisplay()\n"))
544
+ display = XOpenDisplay(displayname);
545
+ if (!display) {
546
+ readpng2_cleanup(&rpng2_info);
547
+ fprintf(stderr, PROGNAME ": can't open X display [%s]\n",
548
+ displayname? displayname : "default");
549
+ ++error;
550
+ }
551
+ }
552
+ if (error)
553
+ fclose(infile);
554
+ }
555
+
556
+
557
+ if (error) {
558
+ fprintf(stderr, PROGNAME ": aborting.\n");
559
+ exit(2);
560
+ }
561
+
562
+
563
+ /* set the title-bar string, but make sure buffer doesn't overflow */
564
+
565
+ alen = strlen(appname);
566
+ flen = strlen(filename);
567
+ if (alen + flen + 3 > 1023)
568
+ sprintf(titlebar, "%s: ...%s", appname, filename+(alen+flen+6-1023));
569
+ else
570
+ sprintf(titlebar, "%s: %s", appname, filename);
571
+
572
+
573
+ /* set some final rpng2_info variables before entering main data loop */
574
+
575
+ if (have_bg) {
576
+ unsigned r, g, b; /* this approach quiets compiler warnings */
577
+
578
+ sscanf(bgstr+1, "%2x%2x%2x", &r, &g, &b);
579
+ rpng2_info.bg_red = (uch)r;
580
+ rpng2_info.bg_green = (uch)g;
581
+ rpng2_info.bg_blue = (uch)b;
582
+ } else
583
+ rpng2_info.need_bgcolor = TRUE;
584
+
585
+ rpng2_info.state = kPreInit;
586
+ rpng2_info.mainprog_init = rpng2_x_init;
587
+ rpng2_info.mainprog_display_row = rpng2_x_display_row;
588
+ rpng2_info.mainprog_finish_display = rpng2_x_finish_display;
589
+
590
+
591
+ /* OK, this is the fun part: call readpng2_decode_data() at the start of
592
+ * the loop to deal with our first buffer of data (read in above to verify
593
+ * that the file is a PNG image), then loop through the file and continue
594
+ * calling the same routine to handle each chunk of data. It in turn
595
+ * passes the data to libpng, which will invoke one or more of our call-
596
+ * backs as decoded data become available. We optionally call sleep() for
597
+ * one second per iteration to simulate downloading the image via an analog
598
+ * modem. */
599
+
600
+ for (;;) {
601
+ Trace((stderr, "about to call readpng2_decode_data()\n"))
602
+ if (readpng2_decode_data(&rpng2_info, inbuf, incount))
603
+ ++error;
604
+ Trace((stderr, "done with readpng2_decode_data()\n"))
605
+
606
+ if (error || incount != INBUFSIZE || rpng2_info.state == kDone) {
607
+ if (rpng2_info.state == kDone) {
608
+ Trace((stderr, "done decoding PNG image\n"))
609
+ } else if (ferror(infile)) {
610
+ fprintf(stderr, PROGNAME
611
+ ": error while reading PNG image file\n");
612
+ exit(3);
613
+ } else if (feof(infile)) {
614
+ fprintf(stderr, PROGNAME ": end of file reached "
615
+ "(unexpectedly) while reading PNG image file\n");
616
+ exit(3);
617
+ } else /* if (error) */ {
618
+ /* will print error message below */
619
+ }
620
+ break;
621
+ }
622
+
623
+ if (timing)
624
+ sleep(1);
625
+
626
+ incount = fread(inbuf, 1, INBUFSIZE, infile);
627
+ }
628
+
629
+
630
+ /* clean up PNG stuff and report any decoding errors */
631
+
632
+ fclose(infile);
633
+ Trace((stderr, "about to call readpng2_cleanup()\n"))
634
+ readpng2_cleanup(&rpng2_info);
635
+
636
+ if (error) {
637
+ fprintf(stderr, PROGNAME ": libpng error while decoding PNG image\n");
638
+ exit(3);
639
+ }
640
+
641
+
642
+ #ifdef FEATURE_LOOP
643
+
644
+ if (loop && bg_image) {
645
+ Trace((stderr, "entering -loop loop (FEATURE_LOOP)\n"))
646
+ for (;;) {
647
+ int i, use_sleep;
648
+ struct timeval now, then;
649
+
650
+ /* get current time and add loop_interval to get target time */
651
+ if (gettimeofday(&then, NULL) == 0) {
652
+ then.tv_sec += loop_interval;
653
+ use_sleep = FALSE;
654
+ } else
655
+ use_sleep = TRUE;
656
+
657
+ /* do quick check for a quit event but don't wait for it */
658
+ /* GRR BUG: should also check for Expose events and redraw... */
659
+ if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask, &e))
660
+ if (QUIT(e,k))
661
+ break;
662
+
663
+ /* generate next background image */
664
+ if (++pat >= num_bgpat)
665
+ pat = 0;
666
+ rpng2_x_reload_bg_image();
667
+
668
+ /* wait for timeout, using whatever means are available */
669
+ if (use_sleep || gettimeofday(&now, NULL) != 0) {
670
+ for (i = loop_interval; i > 0; --i) {
671
+ sleep(1);
672
+ /* GRR BUG: also need to check for Expose (and redraw!) */
673
+ if (XCheckMaskEvent(display, KeyPressMask | ButtonPressMask,
674
+ &e) && QUIT(e,k))
675
+ break;
676
+ }
677
+ } else {
678
+ /* Y2038 BUG! */
679
+ if (now.tv_sec < then.tv_sec ||
680
+ (now.tv_sec == then.tv_sec && now.tv_usec < then.tv_usec))
681
+ {
682
+ int quit = FALSE;
683
+ long seconds_to_go = then.tv_sec - now.tv_sec;
684
+ long usleep_usec;
685
+
686
+ /* basically chew up most of remaining loop-interval with
687
+ * calls to sleep(1) interleaved with checks for quit
688
+ * events, but also recalc time-to-go periodically; when
689
+ * done, clean up any remaining time with usleep() call
690
+ * (could also use SIGALRM, but signals are a pain...) */
691
+ while (seconds_to_go-- > 1) {
692
+ int seconds_done = 0;
693
+
694
+ for (i = seconds_to_go; i > 0 && !quit; --i) {
695
+ sleep(1);
696
+ /* GRR BUG: need to check for Expose and redraw */
697
+ if (XCheckMaskEvent(display, KeyPressMask |
698
+ ButtonPressMask, &e) && QUIT(e,k))
699
+ quit = TRUE;
700
+ if (++seconds_done > 1000)
701
+ break; /* time to redo seconds_to_go meas. */
702
+ }
703
+ if (quit)
704
+ break;
705
+
706
+ /* OK, more than 1000 seconds since last check:
707
+ * correct the time-to-go measurement for drift */
708
+ if (gettimeofday(&now, NULL) == 0) {
709
+ if (now.tv_sec >= then.tv_sec)
710
+ break;
711
+ seconds_to_go = then.tv_sec - now.tv_sec;
712
+ } else
713
+ ++seconds_to_go; /* restore what we subtracted */
714
+ }
715
+ if (quit)
716
+ break; /* breaks outer do-loop, skips redisplay */
717
+
718
+ /* since difference between "now" and "then" is already
719
+ * eaten up to within a couple of seconds, don't need to
720
+ * worry about overflow--but might have overshot (neg.) */
721
+ if (gettimeofday(&now, NULL) == 0) {
722
+ usleep_usec = 1000000L*(then.tv_sec - now.tv_sec) +
723
+ then.tv_usec - now.tv_usec;
724
+ if (usleep_usec > 0)
725
+ usleep((ulg)usleep_usec);
726
+ }
727
+ }
728
+ }
729
+
730
+ /* composite image against new background and display (note that
731
+ * we do not take into account the time spent doing this...) */
732
+ rpng2_x_redisplay_image (0, 0, rpng2_info.width, rpng2_info.height);
733
+ }
734
+
735
+ } else /* FALL THROUGH and do the normal thing */
736
+
737
+ #endif /* FEATURE_LOOP */
738
+
739
+ /* wait for the user to tell us when to quit */
740
+
741
+ if (rpng2_info.state >= kWindowInit) {
742
+ Trace((stderr, "entering final wait-for-quit-event loop\n"))
743
+ do {
744
+ XNextEvent(display, &e);
745
+ if (e.type == Expose) {
746
+ XExposeEvent *ex = (XExposeEvent *)&e;
747
+ rpng2_x_redisplay_image (ex->x, ex->y, ex->width, ex->height);
748
+ }
749
+ } while (!QUIT(e,k));
750
+ } else {
751
+ fprintf(stderr, PROGNAME ": init callback never called: probable "
752
+ "libpng error while decoding PNG metadata\n");
753
+ exit(4);
754
+ }
755
+
756
+
757
+ /* we're done: clean up all image and X resources and go away */
758
+
759
+ Trace((stderr, "about to call rpng2_x_cleanup()\n"))
760
+ rpng2_x_cleanup();
761
+
762
+ (void)argc; /* Unused */
763
+
764
+ return 0;
765
+ }
766
+
767
+
768
+
769
+
770
+
771
+ /* this function is called by readpng2_info_callback() in readpng2.c, which
772
+ * in turn is called by libpng after all of the pre-IDAT chunks have been
773
+ * read and processed--i.e., we now have enough info to finish initializing */
774
+
775
+ static void rpng2_x_init(void)
776
+ {
777
+ ulg i;
778
+ ulg rowbytes = rpng2_info.rowbytes;
779
+
780
+ Trace((stderr, "beginning rpng2_x_init()\n"))
781
+ Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes))
782
+ Trace((stderr, " width = %ld\n", rpng2_info.width))
783
+ Trace((stderr, " height = %ld\n", rpng2_info.height))
784
+
785
+ /* Guard against integer overflow */
786
+ if (rpng2_info.height > ((size_t)(-1))/rpng2_info.rowbytes) {
787
+ fprintf(stderr, PROGNAME ": image_data buffer would be too large\n");
788
+ readpng2_cleanup(&rpng2_info);
789
+ return;
790
+ }
791
+
792
+ rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height);
793
+ if (!rpng2_info.image_data) {
794
+ readpng2_cleanup(&rpng2_info);
795
+ return;
796
+ }
797
+
798
+ rpng2_info.row_pointers = (uch **)malloc(rpng2_info.height * sizeof(uch *));
799
+ if (!rpng2_info.row_pointers) {
800
+ free(rpng2_info.image_data);
801
+ rpng2_info.image_data = NULL;
802
+ readpng2_cleanup(&rpng2_info);
803
+ return;
804
+ }
805
+
806
+ for (i = 0; i < rpng2_info.height; ++i)
807
+ rpng2_info.row_pointers[i] = rpng2_info.image_data + i*rowbytes;
808
+
809
+
810
+ /* do the basic X initialization stuff, make the window, and fill it with
811
+ * the user-specified, file-specified or default background color or
812
+ * pattern */
813
+
814
+ if (rpng2_x_create_window()) {
815
+
816
+ /* GRR TEMPORARY HACK: this is fundamentally no different from cases
817
+ * above; libpng should call our error handler to longjmp() back to us
818
+ * when png_ptr goes away. If we/it segfault instead, seems like a
819
+ * libpng bug... */
820
+
821
+ /* we're here via libpng callback, so if window fails, clean and bail */
822
+ readpng2_cleanup(&rpng2_info);
823
+ rpng2_x_cleanup();
824
+ exit(2);
825
+ }
826
+
827
+ rpng2_info.state = kWindowInit;
828
+ }
829
+
830
+
831
+
832
+
833
+
834
+ static int rpng2_x_create_window(void)
835
+ {
836
+ ulg bg_red = rpng2_info.bg_red;
837
+ ulg bg_green = rpng2_info.bg_green;
838
+ ulg bg_blue = rpng2_info.bg_blue;
839
+ ulg bg_pixel = 0L;
840
+ ulg attrmask;
841
+ int need_colormap = FALSE;
842
+ int screen, pad;
843
+ uch *xdata;
844
+ Window root;
845
+ XEvent e;
846
+ XGCValues gcvalues;
847
+ XSetWindowAttributes attr;
848
+ XTextProperty windowName, *pWindowName = &windowName;
849
+ XTextProperty iconName, *pIconName = &iconName;
850
+ XVisualInfo visual_info;
851
+ XSizeHints *size_hints;
852
+ XWMHints *wm_hints;
853
+ XClassHint *class_hints;
854
+
855
+
856
+ Trace((stderr, "beginning rpng2_x_create_window()\n"))
857
+
858
+ screen = DefaultScreen(display);
859
+ depth = DisplayPlanes(display, screen);
860
+ root = RootWindow(display, screen);
861
+
862
+ #ifdef DEBUG
863
+ XSynchronize(display, True);
864
+ #endif
865
+
866
+ if (depth != 16 && depth != 24 && depth != 32) {
867
+ int visuals_matched = 0;
868
+
869
+ Trace((stderr, "default depth is %d: checking other visuals\n",
870
+ depth))
871
+
872
+ /* 24-bit first */
873
+ visual_info.screen = screen;
874
+ visual_info.depth = 24;
875
+ visual_list = XGetVisualInfo(display,
876
+ VisualScreenMask | VisualDepthMask, &visual_info, &visuals_matched);
877
+ if (visuals_matched == 0) {
878
+ /* GRR: add 15-, 16- and 32-bit TrueColor visuals (also DirectColor?) */
879
+ fprintf(stderr, "default screen depth %d not supported, and no"
880
+ " 24-bit visuals found\n", depth);
881
+ return 2;
882
+ }
883
+ Trace((stderr, "XGetVisualInfo() returned %d 24-bit visuals\n",
884
+ visuals_matched))
885
+ visual = visual_list[0].visual;
886
+ depth = visual_list[0].depth;
887
+ /*
888
+ colormap_size = visual_list[0].colormap_size;
889
+ visual_class = visual->class;
890
+ visualID = XVisualIDFromVisual(visual);
891
+ */
892
+ have_nondefault_visual = TRUE;
893
+ need_colormap = TRUE;
894
+ } else {
895
+ XMatchVisualInfo(display, screen, depth, TrueColor, &visual_info);
896
+ visual = visual_info.visual;
897
+ }
898
+
899
+ RMask = visual->red_mask;
900
+ GMask = visual->green_mask;
901
+ BMask = visual->blue_mask;
902
+
903
+ /* GRR: add/check 8-bit support */
904
+ if (depth == 8 || need_colormap) {
905
+ colormap = XCreateColormap(display, root, visual, AllocNone);
906
+ if (!colormap) {
907
+ fprintf(stderr, "XCreateColormap() failed\n");
908
+ return 2;
909
+ }
910
+ have_colormap = TRUE;
911
+ if (depth == 8)
912
+ bg_image = FALSE; /* gradient just wastes palette entries */
913
+ }
914
+ if (depth == 15 || depth == 16) {
915
+ RShift = 15 - rpng2_x_msb(RMask); /* these are right-shifts */
916
+ GShift = 15 - rpng2_x_msb(GMask);
917
+ BShift = 15 - rpng2_x_msb(BMask);
918
+ } else if (depth > 16) {
919
+ RShift = rpng2_x_msb(RMask) - 7; /* these are left-shifts */
920
+ GShift = rpng2_x_msb(GMask) - 7;
921
+ BShift = rpng2_x_msb(BMask) - 7;
922
+ }
923
+ if (depth >= 15 && (RShift < 0 || GShift < 0 || BShift < 0)) {
924
+ fprintf(stderr, "rpng2 internal logic error: negative X shift(s)!\n");
925
+ return 2;
926
+ }
927
+
928
+ /*---------------------------------------------------------------------------
929
+ Finally, create the window.
930
+ ---------------------------------------------------------------------------*/
931
+
932
+ attr.backing_store = Always;
933
+ attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask;
934
+ attrmask = CWBackingStore | CWEventMask;
935
+ if (have_nondefault_visual) {
936
+ attr.colormap = colormap;
937
+ attr.background_pixel = 0;
938
+ attr.border_pixel = 1;
939
+ attrmask |= CWColormap | CWBackPixel | CWBorderPixel;
940
+ }
941
+
942
+ window = XCreateWindow(display, root, 0, 0, rpng2_info.width,
943
+ rpng2_info.height, 0, depth, InputOutput, visual, attrmask, &attr);
944
+
945
+ if (window == None) {
946
+ fprintf(stderr, "XCreateWindow() failed\n");
947
+ return 2;
948
+ } else
949
+ have_window = TRUE;
950
+
951
+ if (depth == 8)
952
+ XSetWindowColormap(display, window, colormap);
953
+
954
+ if (!XStringListToTextProperty(&window_name, 1, pWindowName))
955
+ pWindowName = NULL;
956
+ if (!XStringListToTextProperty(&icon_name, 1, pIconName))
957
+ pIconName = NULL;
958
+
959
+ /* OK if either hints allocation fails; XSetWMProperties() allows NULLs */
960
+
961
+ if ((size_hints = XAllocSizeHints()) != NULL) {
962
+ /* window will not be resizable */
963
+ size_hints->flags = PMinSize | PMaxSize;
964
+ size_hints->min_width = size_hints->max_width = (int)rpng2_info.width;
965
+ size_hints->min_height = size_hints->max_height =
966
+ (int)rpng2_info.height;
967
+ }
968
+
969
+ if ((wm_hints = XAllocWMHints()) != NULL) {
970
+ wm_hints->initial_state = NormalState;
971
+ wm_hints->input = True;
972
+ /* wm_hints->icon_pixmap = icon_pixmap; */
973
+ wm_hints->flags = StateHint | InputHint /* | IconPixmapHint */ ;
974
+ }
975
+
976
+ if ((class_hints = XAllocClassHint()) != NULL) {
977
+ class_hints->res_name = res_name;
978
+ class_hints->res_class = res_class;
979
+ }
980
+
981
+ XSetWMProperties(display, window, pWindowName, pIconName, NULL, 0,
982
+ size_hints, wm_hints, class_hints);
983
+
984
+ /* various properties and hints no longer needed; free memory */
985
+ if (pWindowName)
986
+ XFree(pWindowName->value);
987
+ if (pIconName)
988
+ XFree(pIconName->value);
989
+ if (size_hints)
990
+ XFree(size_hints);
991
+ if (wm_hints)
992
+ XFree(wm_hints);
993
+ if (class_hints)
994
+ XFree(class_hints);
995
+
996
+ XMapWindow(display, window);
997
+
998
+ gc = XCreateGC(display, window, 0, &gcvalues);
999
+ have_gc = TRUE;
1000
+
1001
+ /*---------------------------------------------------------------------------
1002
+ Allocate memory for the X- and display-specific version of the image.
1003
+ ---------------------------------------------------------------------------*/
1004
+
1005
+ if (depth == 24 || depth == 32) {
1006
+ xdata = (uch *)malloc(4*rpng2_info.width*rpng2_info.height);
1007
+ pad = 32;
1008
+ } else if (depth == 16) {
1009
+ xdata = (uch *)malloc(2*rpng2_info.width*rpng2_info.height);
1010
+ pad = 16;
1011
+ } else /* depth == 8 */ {
1012
+ xdata = (uch *)malloc(rpng2_info.width*rpng2_info.height);
1013
+ pad = 8;
1014
+ }
1015
+
1016
+ if (!xdata) {
1017
+ fprintf(stderr, PROGNAME ": unable to allocate image memory\n");
1018
+ return 4;
1019
+ }
1020
+
1021
+ ximage = XCreateImage(display, visual, depth, ZPixmap, 0,
1022
+ (char *)xdata, rpng2_info.width, rpng2_info.height, pad, 0);
1023
+
1024
+ if (!ximage) {
1025
+ fprintf(stderr, PROGNAME ": XCreateImage() failed\n");
1026
+ free(xdata);
1027
+ return 3;
1028
+ }
1029
+
1030
+ /* to avoid testing the byte order every pixel (or doubling the size of
1031
+ * the drawing routine with a giant if-test), we arbitrarily set the byte
1032
+ * order to MSBFirst and let Xlib worry about inverting things on little-
1033
+ * endian machines (e.g., Linux/x86, old VAXen, etc.)--this is not the
1034
+ * most efficient approach (the giant if-test would be better), but in
1035
+ * the interest of clarity, we'll take the easy way out... */
1036
+
1037
+ ximage->byte_order = MSBFirst;
1038
+
1039
+ /*---------------------------------------------------------------------------
1040
+ Fill window with the specified background color (default is black) or
1041
+ faked "background image" (but latter is disabled if 8-bit; gradients
1042
+ just waste palette entries).
1043
+ ---------------------------------------------------------------------------*/
1044
+
1045
+ if (bg_image)
1046
+ rpng2_x_load_bg_image(); /* resets bg_image if fails */
1047
+
1048
+ if (!bg_image) {
1049
+ if (depth == 24 || depth == 32) {
1050
+ bg_pixel = (bg_red << RShift) |
1051
+ (bg_green << GShift) |
1052
+ (bg_blue << BShift);
1053
+ } else if (depth == 16) {
1054
+ bg_pixel = (((bg_red << 8) >> RShift) & RMask) |
1055
+ (((bg_green << 8) >> GShift) & GMask) |
1056
+ (((bg_blue << 8) >> BShift) & BMask);
1057
+ } else /* depth == 8 */ {
1058
+
1059
+ /* GRR: add 8-bit support */
1060
+
1061
+ }
1062
+ XSetForeground(display, gc, bg_pixel);
1063
+ XFillRectangle(display, window, gc, 0, 0, rpng2_info.width,
1064
+ rpng2_info.height);
1065
+ }
1066
+
1067
+ /*---------------------------------------------------------------------------
1068
+ Wait for first Expose event to do any drawing, then flush and return.
1069
+ ---------------------------------------------------------------------------*/
1070
+
1071
+ do
1072
+ XNextEvent(display, &e);
1073
+ while (e.type != Expose || e.xexpose.count);
1074
+
1075
+ XFlush(display);
1076
+
1077
+ return 0;
1078
+
1079
+ } /* end function rpng2_x_create_window() */
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+ static int rpng2_x_load_bg_image(void)
1086
+ {
1087
+ uch *src;
1088
+ char *dest;
1089
+ uch r1, r2, g1, g2, b1, b2;
1090
+ uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;
1091
+ int k, hmax, max;
1092
+ int xidx, yidx, yidx_max;
1093
+ int even_odd_vert, even_odd_horiz, even_odd;
1094
+ int invert_gradient2 = (bg[pat].type & 0x08);
1095
+ int invert_column;
1096
+ int ximage_rowbytes = ximage->bytes_per_line;
1097
+ ulg i, row;
1098
+ ulg pixel;
1099
+
1100
+ /*---------------------------------------------------------------------------
1101
+ Allocate buffer for fake background image to be used with transparent
1102
+ images; if this fails, revert to plain background color.
1103
+ ---------------------------------------------------------------------------*/
1104
+
1105
+ bg_rowbytes = 3 * rpng2_info.width;
1106
+ bg_data = (uch *)malloc(bg_rowbytes * rpng2_info.height);
1107
+ if (!bg_data) {
1108
+ fprintf(stderr, PROGNAME
1109
+ ": unable to allocate memory for background image\n");
1110
+ bg_image = 0;
1111
+ return 1;
1112
+ }
1113
+
1114
+ bgscale = (pat == 0)? 8 : bgscale_default;
1115
+ yidx_max = bgscale - 1;
1116
+
1117
+ /*---------------------------------------------------------------------------
1118
+ Vertical gradients (ramps) in NxN squares, alternating direction and
1119
+ colors (N == bgscale).
1120
+ ---------------------------------------------------------------------------*/
1121
+
1122
+ if ((bg[pat].type & 0x07) == 0) {
1123
+ uch r1_min = rgb[bg[pat].rgb1_min].r;
1124
+ uch g1_min = rgb[bg[pat].rgb1_min].g;
1125
+ uch b1_min = rgb[bg[pat].rgb1_min].b;
1126
+ uch r2_min = rgb[bg[pat].rgb2_min].r;
1127
+ uch g2_min = rgb[bg[pat].rgb2_min].g;
1128
+ uch b2_min = rgb[bg[pat].rgb2_min].b;
1129
+ int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min;
1130
+ int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min;
1131
+ int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min;
1132
+ int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min;
1133
+ int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min;
1134
+ int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min;
1135
+
1136
+ for (row = 0; row < rpng2_info.height; ++row) {
1137
+ yidx = (int)(row % bgscale);
1138
+ even_odd_vert = (int)((row / bgscale) & 1);
1139
+
1140
+ r1 = r1_min + (r1_diff * yidx) / yidx_max;
1141
+ g1 = g1_min + (g1_diff * yidx) / yidx_max;
1142
+ b1 = b1_min + (b1_diff * yidx) / yidx_max;
1143
+ r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max;
1144
+ g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max;
1145
+ b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max;
1146
+
1147
+ r2 = r2_min + (r2_diff * yidx) / yidx_max;
1148
+ g2 = g2_min + (g2_diff * yidx) / yidx_max;
1149
+ b2 = b2_min + (b2_diff * yidx) / yidx_max;
1150
+ r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max;
1151
+ g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max;
1152
+ b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max;
1153
+
1154
+ dest = (char *)bg_data + row*bg_rowbytes;
1155
+ for (i = 0; i < rpng2_info.width; ++i) {
1156
+ even_odd_horiz = (int)((i / bgscale) & 1);
1157
+ even_odd = even_odd_vert ^ even_odd_horiz;
1158
+ invert_column =
1159
+ (even_odd_horiz && (bg[pat].type & 0x10));
1160
+ if (even_odd == 0) { /* gradient #1 */
1161
+ if (invert_column) {
1162
+ *dest++ = r1_inv;
1163
+ *dest++ = g1_inv;
1164
+ *dest++ = b1_inv;
1165
+ } else {
1166
+ *dest++ = r1;
1167
+ *dest++ = g1;
1168
+ *dest++ = b1;
1169
+ }
1170
+ } else { /* gradient #2 */
1171
+ if ((invert_column && invert_gradient2) ||
1172
+ (!invert_column && !invert_gradient2))
1173
+ {
1174
+ *dest++ = r2; /* not inverted or */
1175
+ *dest++ = g2; /* doubly inverted */
1176
+ *dest++ = b2;
1177
+ } else {
1178
+ *dest++ = r2_inv;
1179
+ *dest++ = g2_inv; /* singly inverted */
1180
+ *dest++ = b2_inv;
1181
+ }
1182
+ }
1183
+ }
1184
+ }
1185
+
1186
+ /*---------------------------------------------------------------------------
1187
+ Soft gradient-diamonds with scale = bgscale. Code contributed by Adam
1188
+ M. Costello.
1189
+ ---------------------------------------------------------------------------*/
1190
+
1191
+ } else if ((bg[pat].type & 0x07) == 1) {
1192
+
1193
+ hmax = (bgscale-1)/2; /* half the max weight of a color */
1194
+ max = 2*hmax; /* the max weight of a color */
1195
+
1196
+ r1 = rgb[bg[pat].rgb1_max].r;
1197
+ g1 = rgb[bg[pat].rgb1_max].g;
1198
+ b1 = rgb[bg[pat].rgb1_max].b;
1199
+ r2 = rgb[bg[pat].rgb2_max].r;
1200
+ g2 = rgb[bg[pat].rgb2_max].g;
1201
+ b2 = rgb[bg[pat].rgb2_max].b;
1202
+
1203
+ for (row = 0; row < rpng2_info.height; ++row) {
1204
+ yidx = (int)(row % bgscale);
1205
+ if (yidx > hmax)
1206
+ yidx = bgscale-1 - yidx;
1207
+ dest = (char *)bg_data + row*bg_rowbytes;
1208
+ for (i = 0; i < rpng2_info.width; ++i) {
1209
+ xidx = (int)(i % bgscale);
1210
+ if (xidx > hmax)
1211
+ xidx = bgscale-1 - xidx;
1212
+ k = xidx + yidx;
1213
+ *dest++ = (k*r1 + (max-k)*r2) / max;
1214
+ *dest++ = (k*g1 + (max-k)*g2) / max;
1215
+ *dest++ = (k*b1 + (max-k)*b2) / max;
1216
+ }
1217
+ }
1218
+
1219
+ /*---------------------------------------------------------------------------
1220
+ Radial "starburst" with azimuthal sinusoids; [eventually number of sinu-
1221
+ soids will equal bgscale?]. This one is slow but very cool. Code con-
1222
+ tributed by Pieter S. van der Meulen (originally in Smalltalk).
1223
+ ---------------------------------------------------------------------------*/
1224
+
1225
+ } else if ((bg[pat].type & 0x07) == 2) {
1226
+ uch ch;
1227
+ int ii, x, y, hw, hh, grayspot;
1228
+ double freq, rotate, saturate, gray, intensity;
1229
+ double angle=0.0, aoffset=0.0, maxDist, dist;
1230
+ double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t;
1231
+
1232
+ fprintf(stderr, "%s: computing radial background...",
1233
+ PROGNAME);
1234
+ fflush(stderr);
1235
+
1236
+ hh = (int)(rpng2_info.height / 2);
1237
+ hw = (int)(rpng2_info.width / 2);
1238
+
1239
+ /* variables for radial waves:
1240
+ * aoffset: number of degrees to rotate hue [CURRENTLY NOT USED]
1241
+ * freq: number of color beams originating from the center
1242
+ * grayspot: size of the graying center area (anti-alias)
1243
+ * rotate: rotation of the beams as a function of radius
1244
+ * saturate: saturation of beams' shape azimuthally
1245
+ */
1246
+ angle = CLIP(angle, 0.0, 360.0);
1247
+ grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw));
1248
+ freq = MAX((double)bg[pat].bg_freq, 0.0);
1249
+ saturate = (double)bg[pat].bg_bsat * 0.1;
1250
+ rotate = (double)bg[pat].bg_brot * 0.1;
1251
+ gray = 0.0;
1252
+ intensity = 0.0;
1253
+ maxDist = (double)((hw*hw) + (hh*hh));
1254
+
1255
+ for (row = 0; row < rpng2_info.height; ++row) {
1256
+ y = (int)(row - hh);
1257
+ dest = (char *)bg_data + row*bg_rowbytes;
1258
+ for (i = 0; i < rpng2_info.width; ++i) {
1259
+ x = (int)(i - hw);
1260
+ angle = (x == 0)? PI_2 : atan((double)y / (double)x);
1261
+ gray = (double)MAX(ABS(y), ABS(x)) / grayspot;
1262
+ gray = MIN(1.0, gray);
1263
+ dist = (double)((x*x) + (y*y)) / maxDist;
1264
+ intensity = cos((angle+(rotate*dist*PI)) * freq) *
1265
+ gray * saturate;
1266
+ intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5;
1267
+ hue = (angle + PI) * INV_PI_360 + aoffset;
1268
+ s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh));
1269
+ s = MIN(MAX(s,0.0), 1.0);
1270
+ v = MIN(MAX(intensity,0.0), 1.0);
1271
+
1272
+ if (s == 0.0) {
1273
+ ch = (uch)(v * 255.0);
1274
+ *dest++ = ch;
1275
+ *dest++ = ch;
1276
+ *dest++ = ch;
1277
+ } else {
1278
+ if ((hue < 0.0) || (hue >= 360.0))
1279
+ hue -= (((int)(hue / 360.0)) * 360.0);
1280
+ hue /= 60.0;
1281
+ ii = (int)hue;
1282
+ f = hue - (double)ii;
1283
+ p = (1.0 - s) * v;
1284
+ q = (1.0 - (s * f)) * v;
1285
+ t = (1.0 - (s * (1.0 - f))) * v;
1286
+ if (ii == 0) { red = v; green = t; blue = p; }
1287
+ else if (ii == 1) { red = q; green = v; blue = p; }
1288
+ else if (ii == 2) { red = p; green = v; blue = t; }
1289
+ else if (ii == 3) { red = p; green = q; blue = v; }
1290
+ else if (ii == 4) { red = t; green = p; blue = v; }
1291
+ else if (ii == 5) { red = v; green = p; blue = q; }
1292
+ *dest++ = (uch)(red * 255.0);
1293
+ *dest++ = (uch)(green * 255.0);
1294
+ *dest++ = (uch)(blue * 255.0);
1295
+ }
1296
+ }
1297
+ }
1298
+ fprintf(stderr, "done.\n");
1299
+ fflush(stderr);
1300
+ }
1301
+
1302
+ /*---------------------------------------------------------------------------
1303
+ Blast background image to display buffer before beginning PNG decode.
1304
+ ---------------------------------------------------------------------------*/
1305
+
1306
+ if (depth == 24 || depth == 32) {
1307
+ ulg red, green, blue;
1308
+ int bpp = ximage->bits_per_pixel;
1309
+
1310
+ for (row = 0; row < rpng2_info.height; ++row) {
1311
+ src = bg_data + row*bg_rowbytes;
1312
+ dest = ximage->data + row*ximage_rowbytes;
1313
+ if (bpp == 32) { /* slightly optimized version */
1314
+ for (i = rpng2_info.width; i > 0; --i) {
1315
+ red = *src++;
1316
+ green = *src++;
1317
+ blue = *src++;
1318
+ pixel = (red << RShift) |
1319
+ (green << GShift) |
1320
+ (blue << BShift);
1321
+ /* recall that we set ximage->byte_order = MSBFirst above */
1322
+ *dest++ = (char)((pixel >> 24) & 0xff);
1323
+ *dest++ = (char)((pixel >> 16) & 0xff);
1324
+ *dest++ = (char)((pixel >> 8) & 0xff);
1325
+ *dest++ = (char)( pixel & 0xff);
1326
+ }
1327
+ } else {
1328
+ for (i = rpng2_info.width; i > 0; --i) {
1329
+ red = *src++;
1330
+ green = *src++;
1331
+ blue = *src++;
1332
+ pixel = (red << RShift) |
1333
+ (green << GShift) |
1334
+ (blue << BShift);
1335
+ /* recall that we set ximage->byte_order = MSBFirst above */
1336
+ /* GRR BUG? this assumes bpp == 24 & bits are packed low */
1337
+ /* (probably need to use RShift, RMask, etc.) */
1338
+ *dest++ = (char)((pixel >> 16) & 0xff);
1339
+ *dest++ = (char)((pixel >> 8) & 0xff);
1340
+ *dest++ = (char)( pixel & 0xff);
1341
+ }
1342
+ }
1343
+ }
1344
+
1345
+ } else if (depth == 16) {
1346
+ ush red, green, blue;
1347
+
1348
+ for (row = 0; row < rpng2_info.height; ++row) {
1349
+ src = bg_data + row*bg_rowbytes;
1350
+ dest = ximage->data + row*ximage_rowbytes;
1351
+ for (i = rpng2_info.width; i > 0; --i) {
1352
+ red = ((ush)(*src) << 8); ++src;
1353
+ green = ((ush)(*src) << 8); ++src;
1354
+ blue = ((ush)(*src) << 8); ++src;
1355
+ pixel = ((red >> RShift) & RMask) |
1356
+ ((green >> GShift) & GMask) |
1357
+ ((blue >> BShift) & BMask);
1358
+ /* recall that we set ximage->byte_order = MSBFirst above */
1359
+ *dest++ = (char)((pixel >> 8) & 0xff);
1360
+ *dest++ = (char)( pixel & 0xff);
1361
+ }
1362
+ }
1363
+
1364
+ } else /* depth == 8 */ {
1365
+
1366
+ /* GRR: add 8-bit support */
1367
+
1368
+ }
1369
+
1370
+ XPutImage(display, window, gc, ximage, 0, 0, 0, 0, rpng2_info.width,
1371
+ rpng2_info.height);
1372
+
1373
+ return 0;
1374
+
1375
+ } /* end function rpng2_x_load_bg_image() */
1376
+
1377
+
1378
+
1379
+
1380
+
1381
+ static void rpng2_x_display_row(ulg row)
1382
+ {
1383
+ uch bg_red = rpng2_info.bg_red;
1384
+ uch bg_green = rpng2_info.bg_green;
1385
+ uch bg_blue = rpng2_info.bg_blue;
1386
+ uch *src, *src2=NULL;
1387
+ char *dest;
1388
+ uch r, g, b, a;
1389
+ int ximage_rowbytes = ximage->bytes_per_line;
1390
+ ulg i, pixel;
1391
+ static int rows=0, prevpass=(-1);
1392
+ static ulg firstrow;
1393
+
1394
+ /*---------------------------------------------------------------------------
1395
+ rows and firstrow simply track how many rows (and which ones) have not
1396
+ yet been displayed; alternatively, we could call XPutImage() for every
1397
+ row and not bother with the records-keeping.
1398
+ ---------------------------------------------------------------------------*/
1399
+
1400
+ Trace((stderr, "beginning rpng2_x_display_row()\n"))
1401
+
1402
+ if (rpng2_info.pass != prevpass) {
1403
+ if (pause_after_pass && rpng2_info.pass > 0) {
1404
+ XEvent e;
1405
+ KeySym k;
1406
+
1407
+ fprintf(stderr,
1408
+ "%s: end of pass %d of 7; click in image window to continue\n",
1409
+ PROGNAME, prevpass + 1);
1410
+ do
1411
+ XNextEvent(display, &e);
1412
+ while (!QUIT(e,k));
1413
+ }
1414
+ fprintf(stderr, "%s: pass %d of 7\r", PROGNAME, rpng2_info.pass + 1);
1415
+ fflush(stderr);
1416
+ prevpass = rpng2_info.pass;
1417
+ }
1418
+
1419
+ if (rows == 0)
1420
+ firstrow = row; /* first row that is not yet displayed */
1421
+
1422
+ ++rows; /* count of rows received but not yet displayed */
1423
+
1424
+ /*---------------------------------------------------------------------------
1425
+ Aside from the use of the rpng2_info struct, the lack of an outer loop
1426
+ (over rows) and moving the XPutImage() call outside the "if (depth)"
1427
+ tests, this routine is identical to rpng_x_display_image() in the non-
1428
+ progressive version of the program.
1429
+ ---------------------------------------------------------------------------*/
1430
+
1431
+ if (depth == 24 || depth == 32) {
1432
+ ulg red, green, blue;
1433
+ int bpp = ximage->bits_per_pixel;
1434
+
1435
+ src = rpng2_info.image_data + row*rpng2_info.rowbytes;
1436
+ if (bg_image)
1437
+ src2 = bg_data + row*bg_rowbytes;
1438
+ dest = ximage->data + row*ximage_rowbytes;
1439
+ if (rpng2_info.channels == 3) {
1440
+ for (i = rpng2_info.width; i > 0; --i) {
1441
+ red = *src++;
1442
+ green = *src++;
1443
+ blue = *src++;
1444
+ pixel = (red << RShift) |
1445
+ (green << GShift) |
1446
+ (blue << BShift);
1447
+ /* recall that we set ximage->byte_order = MSBFirst above */
1448
+ if (bpp == 32) {
1449
+ *dest++ = (char)((pixel >> 24) & 0xff);
1450
+ *dest++ = (char)((pixel >> 16) & 0xff);
1451
+ *dest++ = (char)((pixel >> 8) & 0xff);
1452
+ *dest++ = (char)( pixel & 0xff);
1453
+ } else {
1454
+ /* GRR BUG? this assumes bpp == 24 & bits are packed low */
1455
+ /* (probably need to use RShift, RMask, etc.) */
1456
+ *dest++ = (char)((pixel >> 16) & 0xff);
1457
+ *dest++ = (char)((pixel >> 8) & 0xff);
1458
+ *dest++ = (char)( pixel & 0xff);
1459
+ }
1460
+ }
1461
+ } else /* if (rpng2_info.channels == 4) */ {
1462
+ for (i = rpng2_info.width; i > 0; --i) {
1463
+ r = *src++;
1464
+ g = *src++;
1465
+ b = *src++;
1466
+ a = *src++;
1467
+ if (bg_image) {
1468
+ bg_red = *src2++;
1469
+ bg_green = *src2++;
1470
+ bg_blue = *src2++;
1471
+ }
1472
+ if (a == 255) {
1473
+ red = r;
1474
+ green = g;
1475
+ blue = b;
1476
+ } else if (a == 0) {
1477
+ red = bg_red;
1478
+ green = bg_green;
1479
+ blue = bg_blue;
1480
+ } else {
1481
+ /* this macro (from png.h) composites the foreground
1482
+ * and background values and puts the result into the
1483
+ * first argument */
1484
+ alpha_composite(red, r, a, bg_red);
1485
+ alpha_composite(green, g, a, bg_green);
1486
+ alpha_composite(blue, b, a, bg_blue);
1487
+ }
1488
+ pixel = (red << RShift) |
1489
+ (green << GShift) |
1490
+ (blue << BShift);
1491
+ /* recall that we set ximage->byte_order = MSBFirst above */
1492
+ if (bpp == 32) {
1493
+ *dest++ = (char)((pixel >> 24) & 0xff);
1494
+ *dest++ = (char)((pixel >> 16) & 0xff);
1495
+ *dest++ = (char)((pixel >> 8) & 0xff);
1496
+ *dest++ = (char)( pixel & 0xff);
1497
+ } else {
1498
+ /* GRR BUG? this assumes bpp == 24 & bits are packed low */
1499
+ /* (probably need to use RShift, RMask, etc.) */
1500
+ *dest++ = (char)((pixel >> 16) & 0xff);
1501
+ *dest++ = (char)((pixel >> 8) & 0xff);
1502
+ *dest++ = (char)( pixel & 0xff);
1503
+ }
1504
+ }
1505
+ }
1506
+
1507
+ } else if (depth == 16) {
1508
+ ush red, green, blue;
1509
+
1510
+ src = rpng2_info.row_pointers[row];
1511
+ if (bg_image)
1512
+ src2 = bg_data + row*bg_rowbytes;
1513
+ dest = ximage->data + row*ximage_rowbytes;
1514
+ if (rpng2_info.channels == 3) {
1515
+ for (i = rpng2_info.width; i > 0; --i) {
1516
+ red = ((ush)(*src) << 8);
1517
+ ++src;
1518
+ green = ((ush)(*src) << 8);
1519
+ ++src;
1520
+ blue = ((ush)(*src) << 8);
1521
+ ++src;
1522
+ pixel = ((red >> RShift) & RMask) |
1523
+ ((green >> GShift) & GMask) |
1524
+ ((blue >> BShift) & BMask);
1525
+ /* recall that we set ximage->byte_order = MSBFirst above */
1526
+ *dest++ = (char)((pixel >> 8) & 0xff);
1527
+ *dest++ = (char)( pixel & 0xff);
1528
+ }
1529
+ } else /* if (rpng2_info.channels == 4) */ {
1530
+ for (i = rpng2_info.width; i > 0; --i) {
1531
+ r = *src++;
1532
+ g = *src++;
1533
+ b = *src++;
1534
+ a = *src++;
1535
+ if (bg_image) {
1536
+ bg_red = *src2++;
1537
+ bg_green = *src2++;
1538
+ bg_blue = *src2++;
1539
+ }
1540
+ if (a == 255) {
1541
+ red = ((ush)r << 8);
1542
+ green = ((ush)g << 8);
1543
+ blue = ((ush)b << 8);
1544
+ } else if (a == 0) {
1545
+ red = ((ush)bg_red << 8);
1546
+ green = ((ush)bg_green << 8);
1547
+ blue = ((ush)bg_blue << 8);
1548
+ } else {
1549
+ /* this macro (from png.h) composites the foreground
1550
+ * and background values and puts the result back into
1551
+ * the first argument (== fg byte here: safe) */
1552
+ alpha_composite(r, r, a, bg_red);
1553
+ alpha_composite(g, g, a, bg_green);
1554
+ alpha_composite(b, b, a, bg_blue);
1555
+ red = ((ush)r << 8);
1556
+ green = ((ush)g << 8);
1557
+ blue = ((ush)b << 8);
1558
+ }
1559
+ pixel = ((red >> RShift) & RMask) |
1560
+ ((green >> GShift) & GMask) |
1561
+ ((blue >> BShift) & BMask);
1562
+ /* recall that we set ximage->byte_order = MSBFirst above */
1563
+ *dest++ = (char)((pixel >> 8) & 0xff);
1564
+ *dest++ = (char)( pixel & 0xff);
1565
+ }
1566
+ }
1567
+
1568
+ } else /* depth == 8 */ {
1569
+
1570
+ /* GRR: add 8-bit support */
1571
+
1572
+ }
1573
+
1574
+
1575
+ /*---------------------------------------------------------------------------
1576
+ Display after every 16 rows or when on one of last two rows. (Region
1577
+ may include previously displayed lines due to interlacing--i.e., not
1578
+ contiguous. Also, second-to-last row is final one in interlaced images
1579
+ with odd number of rows.) For demos, flush (and delay) after every 16th
1580
+ row so "sparse" passes don't go twice as fast.
1581
+ ---------------------------------------------------------------------------*/
1582
+
1583
+ if (demo_timing && (row - firstrow >= 16 || row >= rpng2_info.height-2)) {
1584
+ XPutImage(display, window, gc, ximage, 0, (int)firstrow, 0,
1585
+ (int)firstrow, rpng2_info.width, row - firstrow + 1);
1586
+ XFlush(display);
1587
+ rows = 0;
1588
+ usleep(usleep_duration);
1589
+ } else
1590
+ if (!demo_timing && ((rows & 0xf) == 0 || row >= rpng2_info.height-2)) {
1591
+ XPutImage(display, window, gc, ximage, 0, (int)firstrow, 0,
1592
+ (int)firstrow, rpng2_info.width, row - firstrow + 1);
1593
+ XFlush(display);
1594
+ rows = 0;
1595
+ }
1596
+
1597
+ }
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+ static void rpng2_x_finish_display(void)
1604
+ {
1605
+ Trace((stderr, "beginning rpng2_x_finish_display()\n"))
1606
+
1607
+ /* last row has already been displayed by rpng2_x_display_row(), so we
1608
+ * have nothing to do here except set a flag and let the user know that
1609
+ * the image is done */
1610
+
1611
+ rpng2_info.state = kDone;
1612
+ printf(
1613
+ "Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
1614
+ fflush(stdout);
1615
+ }
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+ static void rpng2_x_redisplay_image(ulg startcol, ulg startrow,
1622
+ ulg width, ulg height)
1623
+ {
1624
+ uch bg_red = rpng2_info.bg_red;
1625
+ uch bg_green = rpng2_info.bg_green;
1626
+ uch bg_blue = rpng2_info.bg_blue;
1627
+ uch *src, *src2=NULL;
1628
+ char *dest;
1629
+ uch r, g, b, a;
1630
+ ulg i, row, lastrow = 0;
1631
+ ulg pixel;
1632
+ int ximage_rowbytes = ximage->bytes_per_line;
1633
+
1634
+
1635
+ Trace((stderr, "beginning display loop (image_channels == %d)\n",
1636
+ rpng2_info.channels))
1637
+ Trace((stderr, " (width = %ld, rowbytes = %d, ximage_rowbytes = %d)\n",
1638
+ rpng2_info.width, rpng2_info.rowbytes, ximage_rowbytes))
1639
+ Trace((stderr, " (bpp = %d)\n", ximage->bits_per_pixel))
1640
+ Trace((stderr, " (byte_order = %s)\n", ximage->byte_order == MSBFirst?
1641
+ "MSBFirst" : (ximage->byte_order == LSBFirst? "LSBFirst" : "unknown")))
1642
+
1643
+ /*---------------------------------------------------------------------------
1644
+ Aside from the use of the rpng2_info struct and of src2 (for background
1645
+ image), this routine is identical to rpng_x_display_image() in the non-
1646
+ progressive version of the program--for the simple reason that redisplay
1647
+ of the image against a new background happens after the image is fully
1648
+ decoded and therefore is, by definition, non-progressive.
1649
+ ---------------------------------------------------------------------------*/
1650
+
1651
+ if (depth == 24 || depth == 32) {
1652
+ ulg red, green, blue;
1653
+ int bpp = ximage->bits_per_pixel;
1654
+
1655
+ for (lastrow = row = startrow; row < startrow+height; ++row) {
1656
+ src = rpng2_info.image_data + row*rpng2_info.rowbytes;
1657
+ if (bg_image)
1658
+ src2 = bg_data + row*bg_rowbytes;
1659
+ dest = ximage->data + row*ximage_rowbytes;
1660
+ if (rpng2_info.channels == 3) {
1661
+ for (i = rpng2_info.width; i > 0; --i) {
1662
+ red = *src++;
1663
+ green = *src++;
1664
+ blue = *src++;
1665
+ #ifdef NO_24BIT_MASKS
1666
+ pixel = (red << RShift) |
1667
+ (green << GShift) |
1668
+ (blue << BShift);
1669
+ /* recall that we set ximage->byte_order = MSBFirst above */
1670
+ if (bpp == 32) {
1671
+ *dest++ = (char)((pixel >> 24) & 0xff);
1672
+ *dest++ = (char)((pixel >> 16) & 0xff);
1673
+ *dest++ = (char)((pixel >> 8) & 0xff);
1674
+ *dest++ = (char)( pixel & 0xff);
1675
+ } else {
1676
+ /* this assumes bpp == 24 & bits are packed low */
1677
+ /* (probably need to use RShift, RMask, etc.) */
1678
+ *dest++ = (char)((pixel >> 16) & 0xff);
1679
+ *dest++ = (char)((pixel >> 8) & 0xff);
1680
+ *dest++ = (char)( pixel & 0xff);
1681
+ }
1682
+ #else
1683
+ red = (RShift < 0)? red << (-RShift) : red >> RShift;
1684
+ green = (GShift < 0)? green << (-GShift) : green >> GShift;
1685
+ blue = (BShift < 0)? blue << (-BShift) : blue >> BShift;
1686
+ pixel = (red & RMask) | (green & GMask) | (blue & BMask);
1687
+ /* recall that we set ximage->byte_order = MSBFirst above */
1688
+ if (bpp == 32) {
1689
+ *dest++ = (char)((pixel >> 24) & 0xff);
1690
+ *dest++ = (char)((pixel >> 16) & 0xff);
1691
+ *dest++ = (char)((pixel >> 8) & 0xff);
1692
+ *dest++ = (char)( pixel & 0xff);
1693
+ } else {
1694
+ /* GRR BUG */
1695
+ /* this assumes bpp == 24 & bits are packed low */
1696
+ /* (probably need to use RShift/RMask/etc. here, too) */
1697
+ *dest++ = (char)((pixel >> 16) & 0xff);
1698
+ *dest++ = (char)((pixel >> 8) & 0xff);
1699
+ *dest++ = (char)( pixel & 0xff);
1700
+ }
1701
+ #endif
1702
+ }
1703
+
1704
+ } else /* if (rpng2_info.channels == 4) */ {
1705
+ for (i = rpng2_info.width; i > 0; --i) {
1706
+ r = *src++;
1707
+ g = *src++;
1708
+ b = *src++;
1709
+ a = *src++;
1710
+ if (bg_image) {
1711
+ bg_red = *src2++;
1712
+ bg_green = *src2++;
1713
+ bg_blue = *src2++;
1714
+ }
1715
+ if (a == 255) {
1716
+ red = r;
1717
+ green = g;
1718
+ blue = b;
1719
+ } else if (a == 0) {
1720
+ red = bg_red;
1721
+ green = bg_green;
1722
+ blue = bg_blue;
1723
+ } else {
1724
+ /* this macro (from png.h) composites the foreground
1725
+ * and background values and puts the result into the
1726
+ * first argument */
1727
+ alpha_composite(red, r, a, bg_red);
1728
+ alpha_composite(green, g, a, bg_green);
1729
+ alpha_composite(blue, b, a, bg_blue);
1730
+ }
1731
+ #ifdef NO_24BIT_MASKS
1732
+ pixel = (red << RShift) |
1733
+ (green << GShift) |
1734
+ (blue << BShift);
1735
+ /* recall that we set ximage->byte_order = MSBFirst above */
1736
+ if (bpp == 32) {
1737
+ *dest++ = (char)((pixel >> 24) & 0xff);
1738
+ *dest++ = (char)((pixel >> 16) & 0xff);
1739
+ *dest++ = (char)((pixel >> 8) & 0xff);
1740
+ *dest++ = (char)( pixel & 0xff);
1741
+ } else {
1742
+ /* this assumes bpp == 24 & bits are packed low */
1743
+ /* (probably need to use RShift, RMask, etc.) */
1744
+ *dest++ = (char)((pixel >> 16) & 0xff);
1745
+ *dest++ = (char)((pixel >> 8) & 0xff);
1746
+ *dest++ = (char)( pixel & 0xff);
1747
+ }
1748
+ #else
1749
+ red = (RShift < 0)? red << (-RShift) : red >> RShift;
1750
+ green = (GShift < 0)? green << (-GShift) : green >> GShift;
1751
+ blue = (BShift < 0)? blue << (-BShift) : blue >> BShift;
1752
+ pixel = (red & RMask) | (green & GMask) | (blue & BMask);
1753
+ /* recall that we set ximage->byte_order = MSBFirst above */
1754
+ if (bpp == 32) {
1755
+ *dest++ = (char)((pixel >> 24) & 0xff);
1756
+ *dest++ = (char)((pixel >> 16) & 0xff);
1757
+ *dest++ = (char)((pixel >> 8) & 0xff);
1758
+ *dest++ = (char)( pixel & 0xff);
1759
+ } else {
1760
+ /* GRR BUG */
1761
+ /* this assumes bpp == 24 & bits are packed low */
1762
+ /* (probably need to use RShift/RMask/etc. here, too) */
1763
+ *dest++ = (char)((pixel >> 16) & 0xff);
1764
+ *dest++ = (char)((pixel >> 8) & 0xff);
1765
+ *dest++ = (char)( pixel & 0xff);
1766
+ }
1767
+ #endif
1768
+ }
1769
+ }
1770
+ /* display after every 16 lines */
1771
+ if (((row+1) & 0xf) == 0) {
1772
+ XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
1773
+ (int)lastrow, rpng2_info.width, 16);
1774
+ XFlush(display);
1775
+ lastrow = row + 1;
1776
+ }
1777
+ }
1778
+
1779
+ } else if (depth == 16) {
1780
+ ush red, green, blue;
1781
+
1782
+ for (lastrow = row = startrow; row < startrow+height; ++row) {
1783
+ src = rpng2_info.row_pointers[row];
1784
+ if (bg_image)
1785
+ src2 = bg_data + row*bg_rowbytes;
1786
+ dest = ximage->data + row*ximage_rowbytes;
1787
+ if (rpng2_info.channels == 3) {
1788
+ for (i = rpng2_info.width; i > 0; --i) {
1789
+ red = ((ush)(*src) << 8);
1790
+ ++src;
1791
+ green = ((ush)(*src) << 8);
1792
+ ++src;
1793
+ blue = ((ush)(*src) << 8);
1794
+ ++src;
1795
+ pixel = ((red >> RShift) & RMask) |
1796
+ ((green >> GShift) & GMask) |
1797
+ ((blue >> BShift) & BMask);
1798
+ /* recall that we set ximage->byte_order = MSBFirst above */
1799
+ *dest++ = (char)((pixel >> 8) & 0xff);
1800
+ *dest++ = (char)( pixel & 0xff);
1801
+ }
1802
+ } else /* if (rpng2_info.channels == 4) */ {
1803
+ for (i = rpng2_info.width; i > 0; --i) {
1804
+ r = *src++;
1805
+ g = *src++;
1806
+ b = *src++;
1807
+ a = *src++;
1808
+ if (bg_image) {
1809
+ bg_red = *src2++;
1810
+ bg_green = *src2++;
1811
+ bg_blue = *src2++;
1812
+ }
1813
+ if (a == 255) {
1814
+ red = ((ush)r << 8);
1815
+ green = ((ush)g << 8);
1816
+ blue = ((ush)b << 8);
1817
+ } else if (a == 0) {
1818
+ red = ((ush)bg_red << 8);
1819
+ green = ((ush)bg_green << 8);
1820
+ blue = ((ush)bg_blue << 8);
1821
+ } else {
1822
+ /* this macro (from png.h) composites the foreground
1823
+ * and background values and puts the result back into
1824
+ * the first argument (== fg byte here: safe) */
1825
+ alpha_composite(r, r, a, bg_red);
1826
+ alpha_composite(g, g, a, bg_green);
1827
+ alpha_composite(b, b, a, bg_blue);
1828
+ red = ((ush)r << 8);
1829
+ green = ((ush)g << 8);
1830
+ blue = ((ush)b << 8);
1831
+ }
1832
+ pixel = ((red >> RShift) & RMask) |
1833
+ ((green >> GShift) & GMask) |
1834
+ ((blue >> BShift) & BMask);
1835
+ /* recall that we set ximage->byte_order = MSBFirst above */
1836
+ *dest++ = (char)((pixel >> 8) & 0xff);
1837
+ *dest++ = (char)( pixel & 0xff);
1838
+ }
1839
+ }
1840
+ /* display after every 16 lines */
1841
+ if (((row+1) & 0xf) == 0) {
1842
+ XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
1843
+ (int)lastrow, rpng2_info.width, 16);
1844
+ XFlush(display);
1845
+ lastrow = row + 1;
1846
+ }
1847
+ }
1848
+
1849
+ } else /* depth == 8 */ {
1850
+
1851
+ /* GRR: add 8-bit support */
1852
+
1853
+ }
1854
+
1855
+ Trace((stderr, "calling final XPutImage()\n"))
1856
+ if (lastrow < startrow+height) {
1857
+ XPutImage(display, window, gc, ximage, 0, (int)lastrow, 0,
1858
+ (int)lastrow, rpng2_info.width, rpng2_info.height-lastrow);
1859
+ XFlush(display);
1860
+ }
1861
+
1862
+ (void)startcol;
1863
+ (void)width;
1864
+
1865
+ } /* end function rpng2_x_redisplay_image() */
1866
+
1867
+
1868
+
1869
+
1870
+
1871
+ #ifdef FEATURE_LOOP
1872
+
1873
+ static void rpng2_x_reload_bg_image(void)
1874
+ {
1875
+ char *dest;
1876
+ uch r1, r2, g1, g2, b1, b2;
1877
+ uch r1_inv, r2_inv, g1_inv, g2_inv, b1_inv, b2_inv;
1878
+ int k, hmax, max;
1879
+ int xidx, yidx, yidx_max;
1880
+ int even_odd_vert, even_odd_horiz, even_odd;
1881
+ int invert_gradient2 = (bg[pat].type & 0x08);
1882
+ int invert_column;
1883
+ ulg i, row;
1884
+
1885
+
1886
+ bgscale = (pat == 0)? 8 : bgscale_default;
1887
+ yidx_max = bgscale - 1;
1888
+
1889
+ /*---------------------------------------------------------------------------
1890
+ Vertical gradients (ramps) in NxN squares, alternating direction and
1891
+ colors (N == bgscale).
1892
+ ---------------------------------------------------------------------------*/
1893
+
1894
+ if ((bg[pat].type & 0x07) == 0) {
1895
+ uch r1_min = rgb[bg[pat].rgb1_min].r;
1896
+ uch g1_min = rgb[bg[pat].rgb1_min].g;
1897
+ uch b1_min = rgb[bg[pat].rgb1_min].b;
1898
+ uch r2_min = rgb[bg[pat].rgb2_min].r;
1899
+ uch g2_min = rgb[bg[pat].rgb2_min].g;
1900
+ uch b2_min = rgb[bg[pat].rgb2_min].b;
1901
+ int r1_diff = rgb[bg[pat].rgb1_max].r - r1_min;
1902
+ int g1_diff = rgb[bg[pat].rgb1_max].g - g1_min;
1903
+ int b1_diff = rgb[bg[pat].rgb1_max].b - b1_min;
1904
+ int r2_diff = rgb[bg[pat].rgb2_max].r - r2_min;
1905
+ int g2_diff = rgb[bg[pat].rgb2_max].g - g2_min;
1906
+ int b2_diff = rgb[bg[pat].rgb2_max].b - b2_min;
1907
+
1908
+ for (row = 0; row < rpng2_info.height; ++row) {
1909
+ yidx = (int)(row % bgscale);
1910
+ even_odd_vert = (int)((row / bgscale) & 1);
1911
+
1912
+ r1 = r1_min + (r1_diff * yidx) / yidx_max;
1913
+ g1 = g1_min + (g1_diff * yidx) / yidx_max;
1914
+ b1 = b1_min + (b1_diff * yidx) / yidx_max;
1915
+ r1_inv = r1_min + (r1_diff * (yidx_max-yidx)) / yidx_max;
1916
+ g1_inv = g1_min + (g1_diff * (yidx_max-yidx)) / yidx_max;
1917
+ b1_inv = b1_min + (b1_diff * (yidx_max-yidx)) / yidx_max;
1918
+
1919
+ r2 = r2_min + (r2_diff * yidx) / yidx_max;
1920
+ g2 = g2_min + (g2_diff * yidx) / yidx_max;
1921
+ b2 = b2_min + (b2_diff * yidx) / yidx_max;
1922
+ r2_inv = r2_min + (r2_diff * (yidx_max-yidx)) / yidx_max;
1923
+ g2_inv = g2_min + (g2_diff * (yidx_max-yidx)) / yidx_max;
1924
+ b2_inv = b2_min + (b2_diff * (yidx_max-yidx)) / yidx_max;
1925
+
1926
+ dest = (char *)bg_data + row*bg_rowbytes;
1927
+ for (i = 0; i < rpng2_info.width; ++i) {
1928
+ even_odd_horiz = (int)((i / bgscale) & 1);
1929
+ even_odd = even_odd_vert ^ even_odd_horiz;
1930
+ invert_column =
1931
+ (even_odd_horiz && (bg[pat].type & 0x10));
1932
+ if (even_odd == 0) { /* gradient #1 */
1933
+ if (invert_column) {
1934
+ *dest++ = r1_inv;
1935
+ *dest++ = g1_inv;
1936
+ *dest++ = b1_inv;
1937
+ } else {
1938
+ *dest++ = r1;
1939
+ *dest++ = g1;
1940
+ *dest++ = b1;
1941
+ }
1942
+ } else { /* gradient #2 */
1943
+ if ((invert_column && invert_gradient2) ||
1944
+ (!invert_column && !invert_gradient2))
1945
+ {
1946
+ *dest++ = r2; /* not inverted or */
1947
+ *dest++ = g2; /* doubly inverted */
1948
+ *dest++ = b2;
1949
+ } else {
1950
+ *dest++ = r2_inv;
1951
+ *dest++ = g2_inv; /* singly inverted */
1952
+ *dest++ = b2_inv;
1953
+ }
1954
+ }
1955
+ }
1956
+ }
1957
+
1958
+ /*---------------------------------------------------------------------------
1959
+ Soft gradient-diamonds with scale = bgscale. Code contributed by Adam
1960
+ M. Costello.
1961
+ ---------------------------------------------------------------------------*/
1962
+
1963
+ } else if ((bg[pat].type & 0x07) == 1) {
1964
+
1965
+ hmax = (bgscale-1)/2; /* half the max weight of a color */
1966
+ max = 2*hmax; /* the max weight of a color */
1967
+
1968
+ r1 = rgb[bg[pat].rgb1_max].r;
1969
+ g1 = rgb[bg[pat].rgb1_max].g;
1970
+ b1 = rgb[bg[pat].rgb1_max].b;
1971
+ r2 = rgb[bg[pat].rgb2_max].r;
1972
+ g2 = rgb[bg[pat].rgb2_max].g;
1973
+ b2 = rgb[bg[pat].rgb2_max].b;
1974
+
1975
+ for (row = 0; row < rpng2_info.height; ++row) {
1976
+ yidx = (int)(row % bgscale);
1977
+ if (yidx > hmax)
1978
+ yidx = bgscale-1 - yidx;
1979
+ dest = (char *)bg_data + row*bg_rowbytes;
1980
+ for (i = 0; i < rpng2_info.width; ++i) {
1981
+ xidx = (int)(i % bgscale);
1982
+ if (xidx > hmax)
1983
+ xidx = bgscale-1 - xidx;
1984
+ k = xidx + yidx;
1985
+ *dest++ = (k*r1 + (max-k)*r2) / max;
1986
+ *dest++ = (k*g1 + (max-k)*g2) / max;
1987
+ *dest++ = (k*b1 + (max-k)*b2) / max;
1988
+ }
1989
+ }
1990
+
1991
+ /*---------------------------------------------------------------------------
1992
+ Radial "starburst" with azimuthal sinusoids; [eventually number of sinu-
1993
+ soids will equal bgscale?]. This one is slow but very cool. Code con-
1994
+ tributed by Pieter S. van der Meulen (originally in Smalltalk).
1995
+ ---------------------------------------------------------------------------*/
1996
+
1997
+ } else if ((bg[pat].type & 0x07) == 2) {
1998
+ uch ch;
1999
+ int ii, x, y, hw, hh, grayspot;
2000
+ double freq, rotate, saturate, gray, intensity;
2001
+ double angle=0.0, aoffset=0.0, maxDist, dist;
2002
+ double red=0.0, green=0.0, blue=0.0, hue, s, v, f, p, q, t;
2003
+
2004
+ hh = (int)(rpng2_info.height / 2);
2005
+ hw = (int)(rpng2_info.width / 2);
2006
+
2007
+ /* variables for radial waves:
2008
+ * aoffset: number of degrees to rotate hue [CURRENTLY NOT USED]
2009
+ * freq: number of color beams originating from the center
2010
+ * grayspot: size of the graying center area (anti-alias)
2011
+ * rotate: rotation of the beams as a function of radius
2012
+ * saturate: saturation of beams' shape azimuthally
2013
+ */
2014
+ angle = CLIP(angle, 0.0, 360.0);
2015
+ grayspot = CLIP(bg[pat].bg_gray, 1, (hh + hw));
2016
+ freq = MAX((double)bg[pat].bg_freq, 0.0);
2017
+ saturate = (double)bg[pat].bg_bsat * 0.1;
2018
+ rotate = (double)bg[pat].bg_brot * 0.1;
2019
+ gray = 0.0;
2020
+ intensity = 0.0;
2021
+ maxDist = (double)((hw*hw) + (hh*hh));
2022
+
2023
+ for (row = 0; row < rpng2_info.height; ++row) {
2024
+ y = (int)(row - hh);
2025
+ dest = (char *)bg_data + row*bg_rowbytes;
2026
+ for (i = 0; i < rpng2_info.width; ++i) {
2027
+ x = (int)(i - hw);
2028
+ angle = (x == 0)? PI_2 : atan((double)y / (double)x);
2029
+ gray = (double)MAX(ABS(y), ABS(x)) / grayspot;
2030
+ gray = MIN(1.0, gray);
2031
+ dist = (double)((x*x) + (y*y)) / maxDist;
2032
+ intensity = cos((angle+(rotate*dist*PI)) * freq) *
2033
+ gray * saturate;
2034
+ intensity = (MAX(MIN(intensity,1.0),-1.0) + 1.0) * 0.5;
2035
+ hue = (angle + PI) * INV_PI_360 + aoffset;
2036
+ s = gray * ((double)(ABS(x)+ABS(y)) / (double)(hw + hh));
2037
+ s = MIN(MAX(s,0.0), 1.0);
2038
+ v = MIN(MAX(intensity,0.0), 1.0);
2039
+
2040
+ if (s == 0.0) {
2041
+ ch = (uch)(v * 255.0);
2042
+ *dest++ = ch;
2043
+ *dest++ = ch;
2044
+ *dest++ = ch;
2045
+ } else {
2046
+ if ((hue < 0.0) || (hue >= 360.0))
2047
+ hue -= (((int)(hue / 360.0)) * 360.0);
2048
+ hue /= 60.0;
2049
+ ii = (int)hue;
2050
+ f = hue - (double)ii;
2051
+ p = (1.0 - s) * v;
2052
+ q = (1.0 - (s * f)) * v;
2053
+ t = (1.0 - (s * (1.0 - f))) * v;
2054
+ if (ii == 0) { red = v; green = t; blue = p; }
2055
+ else if (ii == 1) { red = q; green = v; blue = p; }
2056
+ else if (ii == 2) { red = p; green = v; blue = t; }
2057
+ else if (ii == 3) { red = p; green = q; blue = v; }
2058
+ else if (ii == 4) { red = t; green = p; blue = v; }
2059
+ else if (ii == 5) { red = v; green = p; blue = q; }
2060
+ *dest++ = (uch)(red * 255.0);
2061
+ *dest++ = (uch)(green * 255.0);
2062
+ *dest++ = (uch)(blue * 255.0);
2063
+ }
2064
+ }
2065
+ }
2066
+ }
2067
+
2068
+ } /* end function rpng2_x_reload_bg_image() */
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+ static int is_number(char *p)
2075
+ {
2076
+ while (*p) {
2077
+ if (!isdigit(*p))
2078
+ return FALSE;
2079
+ ++p;
2080
+ }
2081
+ return TRUE;
2082
+ }
2083
+
2084
+ #endif /* FEATURE_LOOP */
2085
+
2086
+
2087
+
2088
+
2089
+
2090
+ static void rpng2_x_cleanup(void)
2091
+ {
2092
+ if (bg_image && bg_data) {
2093
+ free(bg_data);
2094
+ bg_data = NULL;
2095
+ }
2096
+
2097
+ if (rpng2_info.image_data) {
2098
+ free(rpng2_info.image_data);
2099
+ rpng2_info.image_data = NULL;
2100
+ }
2101
+
2102
+ if (rpng2_info.row_pointers) {
2103
+ free(rpng2_info.row_pointers);
2104
+ rpng2_info.row_pointers = NULL;
2105
+ }
2106
+
2107
+ if (ximage) {
2108
+ if (ximage->data) {
2109
+ free(ximage->data); /* we allocated it, so we free it */
2110
+ ximage->data = (char *)NULL; /* instead of XDestroyImage() */
2111
+ }
2112
+ XDestroyImage(ximage);
2113
+ ximage = NULL;
2114
+ }
2115
+
2116
+ if (have_gc)
2117
+ XFreeGC(display, gc);
2118
+
2119
+ if (have_window)
2120
+ XDestroyWindow(display, window);
2121
+
2122
+ if (have_colormap)
2123
+ XFreeColormap(display, colormap);
2124
+
2125
+ if (have_nondefault_visual)
2126
+ XFree(visual_list);
2127
+ }
2128
+
2129
+
2130
+
2131
+
2132
+
2133
+ static int rpng2_x_msb(ulg u32val)
2134
+ {
2135
+ int i;
2136
+
2137
+ for (i = 31; i >= 0; --i) {
2138
+ if (u32val & 0x80000000L)
2139
+ break;
2140
+ u32val <<= 1;
2141
+ }
2142
+ return i;
2143
+ }