├── .gitignore ├── COPYING ├── README.md ├── SDL ├── Makefile ├── distinfo ├── files │ ├── KOSMakefile.mk │ ├── SDL_config_dreamcast.h │ ├── SDL_dcaudio.c │ ├── SDL_dcaudio.h │ ├── SDL_dcevents.c │ ├── SDL_dcevents_c.h │ ├── SDL_dcmouse.c │ ├── SDL_dcmouse_c.h │ ├── SDL_dcvideo.c │ ├── SDL_dcvideo.h │ ├── SDL_syscdrom.c │ ├── SDL_syscond.c │ ├── SDL_syscond_c.h │ ├── SDL_sysjoystick.c │ ├── SDL_sysmutex.c │ ├── SDL_sysmutex_c.h │ ├── SDL_syssem.c │ ├── SDL_syssem_c.h │ ├── SDL_systhread.c │ ├── SDL_systhread_c.h │ ├── SDL_systimer.c │ ├── aica.c │ └── aica.h └── pkg-descr ├── SDL_ttf ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── cglm ├── Makefile └── pkg-descr ├── config.mk ├── curl ├── Makefile ├── distinfo ├── files │ ├── CMakeLists.txt │ └── FindPolarSSL.cmake └── pkg-descr ├── expat ├── Makefile ├── distinfo └── pkg-descr ├── freetype ├── Makefile ├── distinfo └── pkg-descr ├── libADX ├── Makefile └── pkg-descr ├── libAL ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libGL ├── Makefile └── pkg-descr ├── libKGL ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libbearssl ├── Makefile └── pkg-descr ├── libbz2 ├── Makefile ├── distinfo ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libchipmunk ├── Makefile └── pkg-descr ├── libcmark ├── Makefile └── pkg-descr ├── libconio ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libdcplib ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libfastmem ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libimageload ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libjimtcl ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libjpeg ├── Makefile ├── distinfo ├── files │ ├── KOSMakefile.mk │ ├── jpeg.h │ ├── kos_img.c │ └── kos_texture.c └── pkg-descr ├── libkmg ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libkosh ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libmodplug ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libmp3 ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libmpeg ├── Makefile ├── distinfo ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libogg ├── Makefile ├── distinfo ├── files │ ├── KOSMakefile.mk │ └── config_types.h └── pkg-descr ├── liboggvorbisplay ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libopusplay ├── Makefile └── pkg-descr ├── libparallax ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libpcx ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libpng ├── Makefile ├── distinfo ├── files │ ├── KOSMakefile.mk │ ├── kos_img.c │ ├── kos_texture.c │ ├── kospng.h │ ├── readpng.c │ ├── readpng.h │ └── writepng.c └── pkg-descr ├── libsmb2 ├── Makefile └── pkg-descr ├── libtga ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libtremor ├── Makefile ├── files │ ├── KOSMakefile.mk │ ├── README │ ├── main.c │ ├── sndoggvorbis.c │ ├── sndoggvorbis.h │ └── sndvorbisfile.h └── pkg-descr ├── libtsunami ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libvldmail ├── Makefile └── pkg-descr ├── libvorbis ├── Makefile ├── distinfo ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libwav ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── libyaml ├── Makefile ├── distinfo └── pkg-descr ├── libzip ├── Makefile ├── distinfo ├── files │ └── libzip-1.0.1.patch └── pkg-descr ├── lua ├── Makefile ├── distinfo ├── files │ └── KOSMakefile.mk └── pkg-descr ├── micropython ├── Makefile ├── files │ ├── KOSMakefile.mk │ └── mpconfigport.h └── pkg-descr ├── mruby ├── Makefile ├── files │ └── KOSMakefile.mk └── pkg-descr ├── opus ├── Makefile ├── distinfo └── pkg-descr ├── opusfile ├── Makefile ├── distinfo └── pkg-descr ├── polarssl ├── Makefile ├── distinfo ├── files │ └── polarssl-1.3.9.patch └── pkg-descr ├── raylib4dc ├── Makefile └── pkg-descr ├── scripts ├── build.mk ├── clean.mk ├── depends.mk ├── download.mk ├── kos-ports.mk ├── lib.mk ├── portinfo.mk ├── precision.mk ├── setup.mk ├── uninstall.mk ├── unpack.mk ├── validate.mk ├── validate_dist.py ├── vercmp.sh └── version.mk ├── stb_image ├── Makefile ├── distinfo ├── files │ ├── KOSMakefile.mk │ └── stb_image.cpp └── pkg-descr ├── utils ├── build-all.sh ├── calc_dist.py ├── clean-all.sh └── uninstall-all.sh └── zlib ├── Makefile ├── distinfo ├── files ├── KOSMakefile.mk └── kos_zlib.c └── pkg-descr /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | *~ 3 | *.tmp 4 | build-stamp 5 | build/ 6 | dist/ 7 | include/* 8 | lib/* 9 | examples/* 10 | inst 11 | .DS_Store 12 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Most of the scripts (in the scripts/ and utils/ subdirectories) in the kos-ports 2 | distribution are distributed under the following two-clause BSD license: 3 | 4 | Copyright (C) 2015-2023 Lawrence Sebald 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 21 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- 29 | 30 | The file scripts/vercmp.sh is Copyright (C) 2010 Dennis Willamson, and is 31 | distributed under the Creative Commons Attribution-ShareAlike 3.0 Unported 32 | license. A human-readable summary of this license can be found at 33 | http://creativecommons.org/licenses/by-sa/3.0/ 34 | 35 | The full text of the license can be found at 36 | http://creativecommons.org/licenses/by-sa/3.0/legalcode 37 | 38 | -------------------------------------------------------------------------------- 39 | 40 | Individual ports are made available under their own licenses. Please check each 41 | individual port that you use in order to ensure that the license requirements of 42 | each are fulfilled. 43 | 44 | The scripts used to build each port may or may not be Copyrighted. Once again, 45 | check with each individual port if in doubt. 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # kos-ports: KallistiOS Package Manager 2 | 3 | ## Introduction 4 | **kos-ports** is a package manager and repository of various useful libraries that 5 | have been ported to the Dreamcast operating system 6 | [KallistiOS](https://github.com/KallistiOS/KallistiOS). These libraries include 7 | common audiovisual formats (jpg, png, mp3, ogg, mpeg), compression formats (libbz2, 8 | zlib), scripting languages (Lua, Tcl, MicroPython), gaming APIs (OpenGL, OpenAL, 9 | SDL), and more. Each port is meant to be as self-contained as possible and should 10 | build on the current version of KallistiOS. Dependency libraries will be fetched and 11 | built automatically, if necessary. 12 | 13 | ## Prerequisites 14 | ### KallistiOS 15 | Users must have a [KallistiOS](https://github.com/KallistiOS/KallistiOS) environment 16 | set up already. This means you must have an SH4 toolchain built and have already 17 | compiled KallistiOS itself. Before attempting to build a port, make sure you have 18 | sourced your KallistiOS `environ.sh` file in your current terminal. 19 | 20 | ### Environment 21 | 1. `curl` or `wget` are required to download packages. `curl` is used by default, 22 | but `wget` may be set as an alternative in `config.mk`. 23 | 2. GNU make and Bash. Other make tools and shells have not been tested and 24 | may not work properly. 25 | 3. Git and CMake may be required for some packages in the collection. 26 | 4. Python is required to validate packages. If you don't have Python and wish to 27 | skip validation, you can set this in `config.mk`. 28 | 29 | ### Building a port 30 | kos-ports was modelled after the FreeBSD ports collection, so some users may 31 | be familiar with the usage. 32 | 33 | To build a port, simply enter its directory and type `make install clean`. 34 | 35 | The package management scripts should fetch, unpack, patch, and build the package 36 | as well as any dependencies, then clean up files after itself. Once built, the 37 | package's headers will be available in `kos-ports/include` and the built library 38 | in `kos-ports/lib`. These paths are automatically included in your build flags if 39 | you are using the KOS Makefile system. 40 | 41 | ## Using the ports tree 42 | There are a few available `make` targets that can be used in each port directory: 43 | 44 | - **install**: Perform all steps to download, patch, build, and install the port in 45 | question. 46 | - **clean**: Clean up any dist files and intermediate build results. 47 | - **uninstall**: Uninstall the port. This does not make sure dependencies are still 48 | fulfilled, so keep that in mind! 49 | - **portinfo**: Print to the terminal a description and various metadata about the 50 | port in question. 51 | 52 | ### Managing all ports 53 | The following helper scripts are provided in the `utils` directory to perform 54 | the above operations on **all** ports in the tree: 55 | - `build-all.sh` will **install** all ports. 56 | - `uninstall-all.sh` will **uninstall** all ports. 57 | - `clean-all.sh` will **clean** all ports. 58 | 59 | #### Lesser used targets (mainly for internal use): 60 | - **version-check**: Check the version of the port that is currently installed. 61 | - **depends-check**: Check if all dependencies of the port are installed. 62 | - **abi-check**: Check if the current KOS floating-point ABI is compatible. 63 | - **fetch**: Download dist files from upstream. 64 | - **validate-dist**: Check downloaded distfiles for validity, if enabled. 65 | - **unpack**: Unpack any fetched packages for the port. 66 | - **build-stamp**: Build the port, but do not install it. 67 | - **clean-dist**: Clean up any dist files. Does not clean build files. 68 | - **clean-build**: Cleans up build files, leaving dist files in place. 69 | 70 | ## Porting a new library 71 | Porting a new library is meant to be a relatively simple task. Take a look at 72 | an existing port, such as `libpng`, to get an idea how the package manager works. 73 | If you need assistance, feel free to reach out using the usual support channels. 74 | -------------------------------------------------------------------------------- /SDL/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = SDL 3 | PORTVERSION = 1.2.15 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = LGPLv2.1 7 | SHORT_DESC = Simple Directmedia Library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = http://libsdl.org/release 14 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 15 | 16 | TARGET = libSDL.a 17 | HDR_DIRECTORY = include 18 | HDR_INSTDIR = SDL 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /SDL/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (SDL-1.2.15.tar.gz) = d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00 2 | SIZE (SDL-1.2.15.tar.gz) = 3920622 3 | -------------------------------------------------------------------------------- /SDL/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libSDL.a 2 | OBJS = src/audio/dc/SDL_dcaudio.o \ 3 | src/audio/dc/aica.o \ 4 | src/audio/SDL_audio.o \ 5 | src/audio/SDL_audiocvt.o \ 6 | src/audio/SDL_audiodev.o \ 7 | src/audio/SDL_mixer.o \ 8 | src/audio/SDL_wave.o \ 9 | src/cdrom/dc/SDL_syscdrom.o \ 10 | src/cdrom/SDL_cdrom.o \ 11 | src/cpuinfo/SDL_cpuinfo.o \ 12 | src/events/SDL_active.o \ 13 | src/events/SDL_events.o \ 14 | src/events/SDL_expose.o \ 15 | src/events/SDL_keyboard.o \ 16 | src/events/SDL_mouse.o \ 17 | src/events/SDL_quit.o \ 18 | src/events/SDL_resize.o \ 19 | src/file/SDL_rwops.o \ 20 | src/joystick/dc/SDL_sysjoystick.o \ 21 | src/joystick/SDL_joystick.o \ 22 | src/loadso/dummy/SDL_sysloadso.o \ 23 | src/SDL.o \ 24 | src/SDL_error.o \ 25 | src/SDL_fatal.o \ 26 | src/stdlib/SDL_getenv.o \ 27 | src/stdlib/SDL_iconv.o \ 28 | src/stdlib/SDL_malloc.o \ 29 | src/stdlib/SDL_qsort.o \ 30 | src/stdlib/SDL_stdlib.o \ 31 | src/stdlib/SDL_string.o \ 32 | src/thread/dc/SDL_syscond.o \ 33 | src/thread/dc/SDL_sysmutex.o \ 34 | src/thread/dc/SDL_syssem.o \ 35 | src/thread/dc/SDL_systhread.o \ 36 | src/thread/SDL_thread.o \ 37 | src/timer/dc/SDL_systimer.o \ 38 | src/timer/SDL_timer.o \ 39 | src/video/dc/SDL_dcevents.o \ 40 | src/video/dc/SDL_dcmouse.o \ 41 | src/video/dc/SDL_dcvideo.o \ 42 | src/video/SDL_blit.o \ 43 | src/video/SDL_blit_0.o \ 44 | src/video/SDL_blit_1.o \ 45 | src/video/SDL_blit_A.o \ 46 | src/video/SDL_blit_N.o \ 47 | src/video/SDL_bmp.o \ 48 | src/video/SDL_cursor.o \ 49 | src/video/SDL_gamma.o \ 50 | src/video/SDL_pixels.o \ 51 | src/video/SDL_RLEaccel.o \ 52 | src/video/SDL_stretch.o \ 53 | src/video/SDL_surface.o \ 54 | src/video/SDL_video.o \ 55 | src/video/SDL_yuv.o \ 56 | src/video/SDL_yuv_sw.o 57 | 58 | defaultall: replacefiles $(OBJS) subdirs linklib 59 | 60 | replacefiles: 61 | cp ../../files/aica.[ch] src/audio/dc/ 62 | cp ../../files/SDL_dcaudio.[ch] src/audio/dc/ 63 | cp ../../files/SDL_syscdrom.c src/cdrom/dc/ 64 | cp ../../files/SDL_sysjoystick.c src/joystick/dc/ 65 | cp ../../files/SDL_syscond_c.h src/thread/dc/ 66 | cp ../../files/SDL_syscond.c src/thread/dc/ 67 | cp ../../files/SDL_syssem_c.h src/thread/dc/ 68 | cp ../../files/SDL_syssem.c src/thread/dc/ 69 | cp ../../files/SDL_sysmutex_c.h src/thread/dc/ 70 | cp ../../files/SDL_sysmutex.c src/thread/dc/ 71 | cp ../../files/SDL_systhread_c.h src/thread/dc/ 72 | cp ../../files/SDL_systhread.c src/thread/dc/ 73 | cp ../../files/SDL_systimer.c src/timer/dc/ 74 | cp ../../files/SDL_dcevents_c.h src/video/dc/ 75 | cp ../../files/SDL_dcevents.c src/video/dc/ 76 | cp ../../files/SDL_dcmouse_c.h src/video/dc/ 77 | cp ../../files/SDL_dcmouse.c src/video/dc/ 78 | cp ../../files/SDL_dcvideo.[ch] src/video/dc/ 79 | cp ../../files/SDL_config_dreamcast.h include/ 80 | sed -e 's/#if defined(__DREAMCAST__)/#if defined\(_arch_dreamcast\)/' -ibak include/SDL_config.h 81 | 82 | KOS_CFLAGS += -Isrc -Isrc/audio -Isrc/cdrom -Isrc/endian -Isrc/events \ 83 | -Isrc/joystick -Isrc/thread/dc -Isrc/thread -Isrc/timer \ 84 | -Isrc/video -DNO_SIGNAL_H -DENABLE_DC -Iinclude 85 | 86 | include ${KOS_PORTS}/scripts/lib.mk 87 | -------------------------------------------------------------------------------- /SDL/files/SDL_config_dreamcast.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2012 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | #ifndef _SDL_config_dreamcast_h 24 | #define _SDL_config_dreamcast_h 25 | 26 | #include "SDL_platform.h" 27 | 28 | /* This is a set of defines to configure the SDL features */ 29 | #include 30 | 31 | #define SDL_HAS_64BIT_TYPE 1 32 | 33 | /* Useful headers */ 34 | #define HAVE_SYS_TYPES_H 1 35 | #define HAVE_STDIO_H 1 36 | #define STDC_HEADERS 1 37 | #define HAVE_STRING_H 1 38 | #define HAVE_CTYPE_H 1 39 | 40 | /* C library functions */ 41 | #define HAVE_MALLOC 1 42 | #define HAVE_CALLOC 1 43 | #define HAVE_REALLOC 1 44 | #define HAVE_FREE 1 45 | #define HAVE_ALLOCA 1 46 | #define HAVE_GETENV 1 47 | #define HAVE_PUTENV 1 48 | #define HAVE_QSORT 1 49 | #define HAVE_ABS 1 50 | #define HAVE_BCOPY 1 51 | #define HAVE_MEMSET 1 52 | #define HAVE_MEMCPY 1 53 | #define HAVE_MEMMOVE 1 54 | #define HAVE_MEMCMP 1 55 | #define HAVE_STRLEN 1 56 | #define HAVE_STRDUP 1 57 | #define HAVE_INDEX 1 58 | #define HAVE_RINDEX 1 59 | #define HAVE_STRCHR 1 60 | #define HAVE_STRRCHR 1 61 | #define HAVE_STRSTR 1 62 | #define HAVE_STRTOL 1 63 | #define HAVE_STRTOD 1 64 | #define HAVE_ATOI 1 65 | #define HAVE_ATOF 1 66 | #define HAVE_STRCMP 1 67 | #define HAVE_STRNCMP 1 68 | #define HAVE_STRICMP 1 69 | #define HAVE_STRCASECMP 1 70 | #define HAVE_SSCANF 1 71 | #define HAVE_SNPRINTF 1 72 | #define HAVE_VSNPRINTF 1 73 | 74 | /* Enable various audio drivers */ 75 | #define SDL_AUDIO_DRIVER_DC 1 76 | 77 | /* Enable various cdrom drivers */ 78 | #define SDL_CDROM_DC 1 79 | 80 | /* Enable various input drivers */ 81 | #define SDL_JOYSTICK_DC 1 82 | 83 | /* Enable various shared object loading systems */ 84 | #define SDL_LOADSO_DUMMY 1 85 | 86 | /* Enable various threading systems */ 87 | #define SDL_THREAD_DC 1 88 | 89 | /* Enable various timer systems */ 90 | #define SDL_TIMER_DC 1 91 | 92 | /* Enable various video drivers */ 93 | #define SDL_VIDEO_DRIVER_DC 1 94 | 95 | #endif /* _SDL_config_dreamcast_h */ 96 | -------------------------------------------------------------------------------- /SDL/files/SDL_dcaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | based on SDL_diskaudio.h by Sam Lantinga 21 | */ 22 | 23 | #ifndef _SDL_diskaudio_h 24 | #define _SDL_diskaudio_h 25 | 26 | #include "SDL_sysaudio.h" 27 | 28 | /* Hidden "this" pointer for the video functions */ 29 | #define _THIS SDL_AudioDevice *this 30 | 31 | struct SDL_PrivateAudioData { 32 | /* The file descriptor for the audio device */ 33 | Uint8 *mixbuf; 34 | Uint32 mixlen; 35 | int playing; 36 | int leftpos,rightpos; 37 | int nextbuf; 38 | }; 39 | 40 | #endif /* _SDL_diskaudio_h */ 41 | -------------------------------------------------------------------------------- /SDL/files/SDL_dcevents.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on SDL_nullevents.c by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | 27 | Modified by Lawrence Sebald 28 | Modified by Falco Girgis 29 | */ 30 | 31 | #include "SDL.h" 32 | #include "SDL_sysevents.h" 33 | #include "SDL_events_c.h" 34 | #include "SDL_dcvideo.h" 35 | #include "SDL_dcevents_c.h" 36 | 37 | #include 38 | 39 | const static unsigned short sdl_key[]= { 40 | /*0*/ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 41 | 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 42 | 'u', 'v', 'w', 'x', 'y', 'z', 43 | /*1e*/ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 44 | /*28*/ SDLK_RETURN, SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_TAB, SDLK_SPACE, SDLK_MINUS, SDLK_PLUS, SDLK_LEFTBRACKET, 45 | SDLK_RIGHTBRACKET, SDLK_BACKSLASH , 0, SDLK_SEMICOLON, SDLK_QUOTE, 46 | /*35*/ '~', SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_CAPSLOCK, 47 | SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8, SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12, 48 | /*46*/ SDLK_PRINT, SDLK_SCROLLOCK, SDLK_PAUSE, SDLK_INSERT, SDLK_HOME, SDLK_PAGEUP, SDLK_DELETE, SDLK_END, SDLK_PAGEDOWN, SDLK_RIGHT, SDLK_LEFT, SDLK_DOWN, SDLK_UP, 49 | /*53*/ SDLK_NUMLOCK, SDLK_KP_DIVIDE, SDLK_KP_MULTIPLY, SDLK_KP_MINUS, SDLK_KP_PLUS, SDLK_KP_ENTER, 50 | SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4, SDLK_KP5, SDLK_KP6, 51 | /*5f*/ SDLK_KP7, SDLK_KP8, SDLK_KP9, SDLK_KP0, SDLK_KP_PERIOD, 0 /* S3 */ 52 | }; 53 | 54 | const static unsigned short sdl_shift[] = { 55 | SDLK_LCTRL,SDLK_LSHIFT,SDLK_LALT,0 /* S1 */, 56 | SDLK_RCTRL,SDLK_RSHIFT,SDLK_RALT,0 /* S2 */, 57 | }; 58 | 59 | #define MOUSE_WHEELUP (1<<4) 60 | #define MOUSE_WHEELDOWN (1<<5) 61 | 62 | const static char sdl_mousebtn[] = { 63 | MOUSE_WHEELUP, 64 | MOUSE_LEFTBUTTON, 65 | MOUSE_SIDEBUTTON, 66 | MOUSE_RIGHTBUTTON, 67 | MOUSE_WHEELDOWN 68 | }; 69 | 70 | static void mouse_update(void) { 71 | static int prev_buttons; 72 | maple_device_t *dev; 73 | mouse_state_t *state; 74 | int buttons, changed; 75 | int i; 76 | 77 | if(!(dev = maple_enum_type(0, MAPLE_FUNC_MOUSE)) || 78 | !(state = maple_dev_status(dev))) 79 | return; 80 | 81 | buttons = state->buttons; 82 | if(state->dz < 0) 83 | buttons |= MOUSE_WHEELUP; 84 | if(state->dz > 0) 85 | buttons |= MOUSE_WHEELDOWN; 86 | 87 | if(state->dx || state->dy) 88 | SDL_PrivateMouseMotion(0, 1, state->dx, state->dy); 89 | 90 | changed = buttons ^ prev_buttons; 91 | 92 | for(i = 0; i < sizeof(sdl_mousebtn); ++i) { 93 | if(changed & sdl_mousebtn[i]) { 94 | SDL_PrivateMouseButton((buttons & sdl_mousebtn[i]) ? 95 | SDL_PRESSED : SDL_RELEASED, i, 0, 0); 96 | } 97 | } 98 | 99 | prev_buttons = buttons; 100 | } 101 | 102 | static void keyboard_update(void) { 103 | #if KOS_VERSION_BELOW(2, 2, 0) 104 | static kbd_state_t old_state; 105 | #else 106 | static kbd_mods_t old_mods; 107 | #endif 108 | kbd_state_t *state; 109 | maple_device_t *dev; 110 | int shiftkeys; 111 | SDL_keysym keysym; 112 | int i; 113 | 114 | if(!(dev = maple_enum_type(0, MAPLE_FUNC_KEYBOARD))) 115 | return; 116 | 117 | state = maple_dev_status(dev); 118 | 119 | if(!state) 120 | return; 121 | 122 | #if KOS_VERSION_BELOW(2, 2, 0) 123 | shiftkeys = state->shift_keys ^ old_state.shift_keys; 124 | for(i = 0; i < sizeof(sdl_shift); ++i) { 125 | if((shiftkeys >> i) & 1) { 126 | keysym.sym = sdl_shift[i]; 127 | SDL_PrivateKeyboard(((state->shift_keys >> i) & 1) ? 128 | SDL_PRESSED : SDL_RELEASED, &keysym); 129 | } 130 | } 131 | 132 | for(i = 0; i < sizeof(sdl_key); ++i) { 133 | if(state->matrix[i] != old_state.matrix[i]) { 134 | int key = sdl_key[i]; 135 | if(key) { 136 | keysym.sym = key; 137 | SDL_PrivateKeyboard(state->matrix[i] ? 138 | SDL_PRESSED : SDL_RELEASED, &keysym); 139 | } 140 | } 141 | } 142 | 143 | old_state = *state; 144 | 145 | #else /* KOS 2.2.0+ */ 146 | shiftkeys = state->last_modifiers.raw ^ old_mods.raw; 147 | for(i = 0; i < sizeof(sdl_shift)/sizeof(sdl_shift[0]); ++i) { 148 | if((shiftkeys >> i) & 1) { 149 | keysym.sym = sdl_shift[i]; 150 | SDL_PrivateKeyboard(((state->last_modifiers.raw >> i) & 1) ? 151 | SDL_PRESSED : SDL_RELEASED, &keysym); 152 | } 153 | } 154 | 155 | for(i = 0; i < sizeof(sdl_key)/sizeof(sdl_key[0]); ++i) { 156 | int key = sdl_key[i]; 157 | keysym.sym = key; 158 | 159 | if(state->key_states[i].value == KEY_STATE_CHANGED_DOWN) { 160 | SDL_PrivateKeyboard(SDL_PRESSED, &keysym); 161 | } else if(state->key_states[i].value == KEY_STATE_CHANGED_UP) { 162 | SDL_PrivateKeyboard(SDL_RELEASED, &keysym); 163 | } 164 | } 165 | #endif 166 | } 167 | 168 | void DC_PumpEvents(_THIS) { 169 | keyboard_update(); 170 | mouse_update(); 171 | } 172 | 173 | void DC_InitOSKeymap(_THIS) { 174 | } -------------------------------------------------------------------------------- /SDL/files/SDL_dcevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on SDL_nullevents.h by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | #include "SDL_dcvideo.h" 29 | 30 | /* Variables and functions exported by SDL_sysevents.c to other parts 31 | of the native video subsystem (SDL_sysvideo.c) 32 | */ 33 | extern void DC_InitOSKeymap(_THIS); 34 | extern void DC_PumpEvents(_THIS); 35 | 36 | /* end of SDL_dcevents_c.h ... */ 37 | 38 | -------------------------------------------------------------------------------- /SDL/files/SDL_dcmouse.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on SDL_nullvideo.h by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | #include 29 | 30 | #include "SDL_error.h" 31 | #include "SDL_mouse.h" 32 | #include "SDL_events_c.h" 33 | 34 | #include "SDL_dcmouse_c.h" 35 | 36 | 37 | /* The implementation dependent data for the window manager cursor */ 38 | struct WMcursor { 39 | int unused; 40 | }; 41 | -------------------------------------------------------------------------------- /SDL/files/SDL_dcmouse_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on SDL_nullmouse.h by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | #include "SDL_dcvideo.h" 29 | 30 | /* Functions to be exported */ 31 | -------------------------------------------------------------------------------- /SDL/files/SDL_dcvideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on SDL_nullvideo.h by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | #ifndef _SDL_dcvideo_h 29 | #define _SDL_dcvideo_h 30 | 31 | #include "SDL_mouse.h" 32 | #include "SDL_sysvideo.h" 33 | #include "SDL_mutex.h" 34 | 35 | /* Hidden "this" pointer for the video functions */ 36 | #define _THIS SDL_VideoDevice *this 37 | 38 | 39 | /* Private display data */ 40 | 41 | struct SDL_PrivateVideoData { 42 | int w, h; 43 | void *buffer; 44 | }; 45 | 46 | #endif /* _SDL_dcvideo_h */ 47 | -------------------------------------------------------------------------------- /SDL/files/SDL_syscdrom.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on win32/SDL_syscdrom.c by 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | 27 | Modified by Lawrence Sebald 28 | */ 29 | 30 | /* Functions for system-level CD-ROM audio control */ 31 | 32 | #include 33 | 34 | #include "SDL_error.h" 35 | #include "SDL_cdrom.h" 36 | #include "SDL_syscdrom.h" 37 | 38 | /* The system-dependent CD control functions */ 39 | static const char *SDL_SYS_CDName(int drive); 40 | static int SDL_SYS_CDOpen(int drive); 41 | static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); 42 | static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); 43 | static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); 44 | static int SDL_SYS_CDPause(SDL_CD *cdrom); 45 | static int SDL_SYS_CDResume(SDL_CD *cdrom); 46 | static int SDL_SYS_CDStop(SDL_CD *cdrom); 47 | static int SDL_SYS_CDEject(SDL_CD *cdrom); 48 | static void SDL_SYS_CDClose(SDL_CD *cdrom); 49 | 50 | 51 | int SDL_SYS_CDInit(void) 52 | { 53 | /* Fill in our driver capabilities */ 54 | SDL_CDcaps.Name = SDL_SYS_CDName; 55 | SDL_CDcaps.Open = SDL_SYS_CDOpen; 56 | SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; 57 | SDL_CDcaps.Status = SDL_SYS_CDStatus; 58 | SDL_CDcaps.Play = SDL_SYS_CDPlay; 59 | SDL_CDcaps.Pause = SDL_SYS_CDPause; 60 | SDL_CDcaps.Resume = SDL_SYS_CDResume; 61 | SDL_CDcaps.Stop = SDL_SYS_CDStop; 62 | SDL_CDcaps.Eject = SDL_SYS_CDEject; 63 | SDL_CDcaps.Close = SDL_SYS_CDClose; 64 | 65 | return(0); 66 | } 67 | 68 | static const char *SDL_SYS_CDName(int drive) 69 | { 70 | return "/cd"; 71 | } 72 | 73 | static int SDL_SYS_CDOpen(int drive) 74 | { 75 | return(drive); 76 | } 77 | 78 | #define TRACK_CDDA 0 79 | static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) 80 | { 81 | CDROM_TOC toc; 82 | int ret,i; 83 | 84 | ret = cdrom_read_toc(&toc,0); 85 | if (ret!=ERR_OK) { 86 | return -1; 87 | } 88 | 89 | cdrom->numtracks = TOC_TRACK(toc.last)-TOC_TRACK(toc.first)+1; 90 | for(i=0;inumtracks;i++) { 91 | unsigned long entry = toc.entry[i]; 92 | cdrom->track[i].id = i+1; 93 | cdrom->track[i].type = (TOC_CTRL(toc.entry[i])==TRACK_CDDA)?SDL_AUDIO_TRACK:SDL_DATA_TRACK; 94 | cdrom->track[i].offset = TOC_LBA(entry)-150; 95 | cdrom->track[i].length = TOC_LBA((i+1 31 | #include 32 | 33 | #include "SDL_error.h" 34 | #include "SDL_thread.h" 35 | #include "SDL_systhread_c.h" 36 | 37 | #include 38 | 39 | struct SDL_mutex { 40 | int recursive; 41 | Uint32 owner; 42 | spinlock_t mutex; 43 | }; 44 | 45 | /* Create a mutex */ 46 | SDL_mutex *SDL_CreateMutex(void) 47 | { 48 | SDL_mutex *mutex; 49 | 50 | /* Allocate mutex memory */ 51 | mutex = (SDL_mutex *)malloc(sizeof(*mutex)); 52 | if ( mutex ) { 53 | spinlock_init(&mutex->mutex); 54 | mutex->recursive = 0; 55 | mutex->owner = 0; 56 | } else { 57 | SDL_OutOfMemory(); 58 | } 59 | return mutex; 60 | } 61 | 62 | /* Free the mutex */ 63 | void SDL_DestroyMutex(SDL_mutex *mutex) 64 | { 65 | if ( mutex ) { 66 | free(mutex); 67 | } 68 | } 69 | 70 | /* Lock the semaphore */ 71 | int SDL_mutexP(SDL_mutex *mutex) 72 | { 73 | #ifdef DISABLE_THREADS 74 | return 0; 75 | #else 76 | Uint32 this_thread; 77 | 78 | if ( mutex == NULL ) { 79 | SDL_SetError("Passed a NULL mutex"); 80 | return -1; 81 | } 82 | 83 | this_thread = SDL_ThreadID(); 84 | if ( mutex->owner == this_thread ) { 85 | ++mutex->recursive; 86 | } else { 87 | /* The order of operations is important. 88 | We set the locking thread id after we obtain the lock 89 | so unlocks from other threads will fail. 90 | */ 91 | spinlock_lock(&mutex->mutex); 92 | mutex->owner = this_thread; 93 | mutex->recursive = 0; 94 | } 95 | 96 | return 0; 97 | #endif /* DISABLE_THREADS */ 98 | } 99 | 100 | /* Unlock the mutex */ 101 | int SDL_mutexV(SDL_mutex *mutex) 102 | { 103 | #ifdef DISABLE_THREADS 104 | return 0; 105 | #else 106 | if ( mutex == NULL ) { 107 | SDL_SetError("Passed a NULL mutex"); 108 | return -1; 109 | } 110 | 111 | /* If we don't own the mutex, we can't unlock it */ 112 | if ( SDL_ThreadID() != mutex->owner ) { 113 | SDL_SetError("mutex not owned by this thread"); 114 | return -1; 115 | } 116 | 117 | if ( mutex->recursive ) { 118 | --mutex->recursive; 119 | } else { 120 | /* The order of operations is important. 121 | First reset the owner so another thread doesn't lock 122 | the mutex and set the ownership before we reset it, 123 | then release the lock semaphore. 124 | */ 125 | mutex->owner = 0; 126 | spinlock_unlock(&mutex->mutex); 127 | } 128 | return 0; 129 | #endif /* DISABLE_THREADS */ 130 | } 131 | -------------------------------------------------------------------------------- /SDL/files/SDL_sysmutex_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /SDL/files/SDL_syssem.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on generic/SDL_syssem.c 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | /* An implementation of semaphores using mutexes and condition variables */ 29 | 30 | #include 31 | 32 | #include "SDL_error.h" 33 | #include "SDL_timer.h" 34 | #include "SDL_thread.h" 35 | #include "SDL_systhread_c.h" 36 | 37 | 38 | #ifdef DISABLE_THREADS 39 | 40 | SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) 41 | { 42 | SDL_SetError("SDL not configured with thread support"); 43 | return (SDL_sem *)0; 44 | } 45 | 46 | void SDL_DestroySemaphore(SDL_sem *sem) 47 | { 48 | return; 49 | } 50 | 51 | int SDL_SemTryWait(SDL_sem *sem) 52 | { 53 | SDL_SetError("SDL not configured with thread support"); 54 | return -1; 55 | } 56 | 57 | int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) 58 | { 59 | SDL_SetError("SDL not configured with thread support"); 60 | return -1; 61 | } 62 | 63 | int SDL_SemWait(SDL_sem *sem) 64 | { 65 | SDL_SetError("SDL not configured with thread support"); 66 | return -1; 67 | } 68 | 69 | Uint32 SDL_SemValue(SDL_sem *sem) 70 | { 71 | return 0; 72 | } 73 | 74 | int SDL_SemPost(SDL_sem *sem) 75 | { 76 | SDL_SetError("SDL not configured with thread support"); 77 | return -1; 78 | } 79 | 80 | #else 81 | 82 | #include 83 | 84 | struct SDL_semaphore 85 | { 86 | semaphore_t sem; 87 | }; 88 | 89 | SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) 90 | { 91 | SDL_sem *rv; 92 | 93 | if((rv = (SDL_sem *)malloc(sizeof(SDL_sem)))) 94 | sem_init(&rv->sem, initial_value); 95 | else 96 | SDL_OutOfMemory(); 97 | 98 | return rv; 99 | } 100 | 101 | /* WARNING: 102 | You cannot call this function when another thread is using the semaphore. 103 | */ 104 | void SDL_DestroySemaphore(SDL_sem *sem) 105 | { 106 | if(!sem) { 107 | SDL_SetError("Passed a NULL semaphore"); 108 | return; 109 | } 110 | 111 | sem_destroy(&sem->sem); 112 | free(sem); 113 | } 114 | 115 | int SDL_SemTryWait(SDL_sem *sem) 116 | { 117 | int retval; 118 | 119 | if(!sem) { 120 | SDL_SetError("Passed a NULL semaphore"); 121 | return -1; 122 | } 123 | 124 | retval = sem_trywait(&sem->sem); 125 | if (retval==0) return 0; 126 | else return SDL_MUTEX_TIMEDOUT; 127 | 128 | return retval; 129 | } 130 | 131 | int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) 132 | { 133 | int retval; 134 | 135 | if(!sem) { 136 | SDL_SetError("Passed a NULL semaphore"); 137 | return -1; 138 | } 139 | 140 | /* A timeout of 0 is an easy case */ 141 | if(timeout == 0) { 142 | return SDL_SemTryWait(sem); 143 | } 144 | 145 | retval = sem_wait_timed(&sem->sem,timeout); 146 | if(retval==-1) retval= SDL_MUTEX_TIMEDOUT; 147 | 148 | return retval; 149 | } 150 | 151 | int SDL_SemWait(SDL_sem *sem) 152 | { 153 | if(!sem) { 154 | SDL_SetError("Passed a NULL semaphore"); 155 | return -1; 156 | } 157 | 158 | sem_wait(&sem->sem); 159 | return 0; 160 | } 161 | 162 | Uint32 SDL_SemValue(SDL_sem *sem) 163 | { 164 | if(!sem) { 165 | SDL_SetError("Passed a NULL semaphore"); 166 | return -1; 167 | } 168 | 169 | return sem_count(&sem->sem); 170 | } 171 | 172 | int SDL_SemPost(SDL_sem *sem) 173 | { 174 | if(!sem) { 175 | SDL_SetError("Passed a NULL semaphore"); 176 | return -1; 177 | } 178 | 179 | sem_signal(&sem->sem); 180 | return 0; 181 | } 182 | 183 | #endif /* DISABLE_THREADS */ 184 | -------------------------------------------------------------------------------- /SDL/files/SDL_syssem_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /SDL/files/SDL_systhread.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on generic/SDL_thread.c 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | /* Thread management routines for SDL */ 29 | 30 | #include "SDL_error.h" 31 | #include "SDL_thread.h" 32 | #include "SDL_thread_c.h" 33 | #include "SDL_systhread.h" 34 | 35 | #include 36 | 37 | #ifdef DISABLE_THREADS 38 | int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) 39 | { 40 | SDL_SetError("Threads are not supported on this platform"); 41 | return(-1); 42 | } 43 | 44 | void SDL_SYS_SetupThread(void) 45 | { 46 | return; 47 | } 48 | 49 | Uint32 SDL_ThreadID(void) 50 | { 51 | return(0); 52 | } 53 | 54 | void SDL_SYS_WaitThread(SDL_Thread *thread) 55 | { 56 | return; 57 | } 58 | 59 | void SDL_SYS_KillThread(SDL_Thread *thread) 60 | { 61 | return; 62 | } 63 | 64 | #else 65 | static void *thdfunc(void *args) 66 | { 67 | SDL_RunThread(args); 68 | return NULL; 69 | } 70 | 71 | int SDL_SYS_CreateThread(SDL_Thread *thread, void *args) 72 | { 73 | thread->handle = thd_create(1, thdfunc, args); 74 | if (thread->handle == NULL) { 75 | SDL_SetError("Not enough resources to create thread"); 76 | return(-1); 77 | } 78 | return(0); 79 | } 80 | 81 | void SDL_SYS_SetupThread(void) 82 | { 83 | return; 84 | } 85 | 86 | Uint32 SDL_ThreadID(void) 87 | { 88 | return (Uint32)thd_get_current(); 89 | } 90 | 91 | void SDL_SYS_WaitThread(SDL_Thread *thread) 92 | { 93 | thd_join(thread->handle, NULL); 94 | } 95 | 96 | void SDL_SYS_KillThread(SDL_Thread *thread) 97 | { 98 | thd_destroy(thread->handle); 99 | } 100 | #endif 101 | -------------------------------------------------------------------------------- /SDL/files/SDL_systhread_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /* Stub until we implement threads on this platform */ 24 | typedef struct kthread* SYS_ThreadHandle; 25 | /* 26 | #ifndef DISABLE_THREADS 27 | #define DISABLE_THREADS 28 | #endif 29 | */ 30 | -------------------------------------------------------------------------------- /SDL/files/SDL_systimer.c: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | BERO 20 | bero@geocities.co.jp 21 | 22 | based on win32/SDL_systimer.c 23 | 24 | Sam Lantinga 25 | slouken@libsdl.org 26 | */ 27 | 28 | #include 29 | 30 | #include "SDL_thread.h" 31 | #include "SDL_timer.h" 32 | #include "SDL_error.h" 33 | #include "SDL_timer_c.h" 34 | 35 | static unsigned start; 36 | 37 | /* 38 | jif = ms * HZ /1000 39 | ms = jif * 1000/HZ 40 | */ 41 | 42 | void SDL_StartTicks(void) 43 | { 44 | /* Set first ticks value */ 45 | start = timer_ms_gettime64(); 46 | } 47 | 48 | Uint32 SDL_GetTicks(void) 49 | { 50 | return(timer_ms_gettime64()-start); 51 | } 52 | 53 | void SDL_Delay(Uint32 ms) 54 | { 55 | thd_sleep(ms); 56 | } 57 | 58 | /* Data to handle a single periodic alarm */ 59 | static int timer_alive = 0; 60 | static SDL_Thread *timer = NULL; 61 | 62 | static int RunTimer(void *unused) 63 | { 64 | while ( timer_alive ) { 65 | if ( SDL_timer_running ) { 66 | SDL_ThreadedTimerCheck(); 67 | } 68 | SDL_Delay(10); 69 | } 70 | return(0); 71 | } 72 | 73 | /* This is only called if the event thread is not running */ 74 | int SDL_SYS_TimerInit(void) 75 | { 76 | timer_alive = 1; 77 | timer = SDL_CreateThread(RunTimer, NULL); 78 | if ( timer == NULL ) 79 | return(-1); 80 | return(SDL_SetTimerThreaded(1)); 81 | } 82 | 83 | void SDL_SYS_TimerQuit(void) 84 | { 85 | timer_alive = 0; 86 | if ( timer ) { 87 | SDL_WaitThread(timer, NULL); 88 | timer = NULL; 89 | } 90 | } 91 | 92 | int SDL_SYS_StartTimer(void) 93 | { 94 | SDL_SetError("Internal logic error: DC uses threaded timer"); 95 | return(-1); 96 | } 97 | 98 | void SDL_SYS_StopTimer(void) 99 | { 100 | return; 101 | } 102 | -------------------------------------------------------------------------------- /SDL/files/aica.h: -------------------------------------------------------------------------------- 1 | #ifndef _AICA_H_ 2 | #define _AICA_H_ 3 | 4 | #define AICA_MEM 0xa0800000 5 | 6 | #define SM_8BIT 1 7 | #define SM_16BIT 0 8 | #define SM_ADPCM 2 9 | 10 | void aica_play(int ch,int mode,unsigned long smpptr,int looptst,int loopend,int freq,int vol,int pan,int loopflag); 11 | void aica_stop(int ch); 12 | void aica_vol(int ch,int vol); 13 | void aica_pan(int ch,int pan); 14 | void aica_freq(int ch,int freq); 15 | int aica_get_pos(int ch); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /SDL/pkg-descr: -------------------------------------------------------------------------------- 1 | SDL is a cross-platform development library, primarily focused at developing 2 | games. SDL is written in C and has bindings (not included here) for many other 3 | programming languages. SDL has been used by many games, including commercial 4 | ones. SDL provides abstractions for video, sound, joystick/gamepad handling, 5 | keyboard input, and threads. 6 | 7 | The SDL version here is of the older 1.2.x line. The 2.x series has not been 8 | ported to the Dreamcast. 9 | 10 | URL: http://libsdl.org/ 11 | -------------------------------------------------------------------------------- /SDL_ttf/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = SDL_ttf 3 | PORTVERSION = 1.2 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = zlib License - http://opensource.org/licenses/Zlib 7 | SHORT_DESC = SDL TrueType font library 8 | 9 | # This port could use autotools, but it tries to build the glfont example which uses 10 | # functionality currently unsupported by gldc.. 11 | #PORT_AUTOTOOLS = 1 12 | 13 | # No dependencies beyond the base system. 14 | DEPENDENCIES = SDL libbz2 zlib libpng freetype 15 | 16 | # What files we need to download, and where from. 17 | GIT_REPOSITORY = https://github.com/libsdl-org/SDL_ttf.git 18 | GIT_BRANCH = SDL-1.2 19 | 20 | TARGET = libSDL_ttf.a 21 | #There's a problem here. Standard SDL_ttf will install SDL_ttf.h into the SDL folder. 22 | #There's no option in the build scripts to copy into a different ports inst/include so 23 | # instead I'm abusing the fact that INSTALLED_HDRS and HDR_DIRECTORY aren't mutually exclusive. 24 | INSTALLED_HDRS = SDL_ttf.h 25 | HDR_DIRECTORY = ../../../include/SDL 26 | HDR_INSTDIR = SDL 27 | 28 | #KOS Distributed extras (to be copied into the build tree) 29 | KOS_DISTFILES = KOSMakefile.mk 30 | 31 | include ${KOS_PORTS}/scripts/kos-ports.mk 32 | -------------------------------------------------------------------------------- /SDL_ttf/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libSDL_ttf.a 2 | OBJS = SDL_ttf.o 3 | 4 | KOS_CFLAGS += -I. \ 5 | -I${KOS_PORTS}/include/SDL -lSDL \ 6 | -I${KOS_PORTS}/include/zlib -I${KOS_PORTS}/include/bzlib \ 7 | -I${KOS_PORTS}/include/png -I${KOS_PORTS}/include/freetype2 \ 8 | -lfreetype -lz -lbz2 -lpng 9 | 10 | include ${KOS_PORTS}/scripts/lib.mk 11 | -------------------------------------------------------------------------------- /SDL_ttf/pkg-descr: -------------------------------------------------------------------------------- 1 | SDL_ttf is a TrueType font rendering library that is used with the SDL library, and almost as portable. It depends on freetype2 to handle the TrueType font data. It allows a programmer to use multiple TrueType fonts without having to code a font rendering routine themselves. With the power of outline fonts and antialiasing, high quality text output can be obtained without much effort. 2 | 3 | URL: https://github.com/libsdl-org/SDL_ttf 4 | -------------------------------------------------------------------------------- /cglm/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = cglm 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = MIT 7 | SHORT_DESC = Highly optimized 2D|3D math library, also known as OpenGL Mathematics (glm) for `C` 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # Don't attempt to copy the target library, it will be in the inst dir already. 13 | NOCOPY_TARGET = 1 14 | 15 | 16 | # What files we need to download, and where from. 17 | GIT_REPOSITORY = https://github.com/recp/cglm.git 18 | HDR_FULLDIR = cglm 19 | TARGET = libcglm.a 20 | EXAMPLES_DIR = test 21 | 22 | # cmake setup work. 23 | CMAKE_ARGS = -DCGLM_STATIC=ON 24 | MAKE_TARGET = all install 25 | 26 | include ${KOS_PORTS}/scripts/kos-ports.mk 27 | -------------------------------------------------------------------------------- /cglm/pkg-descr: -------------------------------------------------------------------------------- 1 | cglm is an optimized 3D math library written in C99 (compatible with C89). 2 | It is similar to the original glm library, except cglm is mainly for C. 3 | 4 | cglm stores matrices as column-major order but in the future row-major is 5 | considered to be supported as optional. 6 | 7 | URL: https://github.com/recp/cglm 8 | -------------------------------------------------------------------------------- /config.mk: -------------------------------------------------------------------------------- 1 | # Select how to download files inside the kos-ports tree. Examples are given for 2 | # cURL and wget. 3 | FETCH_CMD = curl --progress-bar -O -L 4 | #FETCH_CMD = wget --progress=bar 5 | 6 | # Set the command that will be used for extracting archive files. Currently this 7 | # only must extract .tar.gz archives (although the default will handle more than 8 | # that, most likely). 9 | UNPACK_CMD = tar xf 10 | 11 | # Select whether or not to automatically build library dependencies if they are 12 | # not already installed. If this is set to false, then the build system will 13 | # simply output an error message if a dependency is not met. If set to true, 14 | # then the build system will automatically try to build any unmet dependencies 15 | # recursively. 16 | BUILD_DEPENDS = true 17 | 18 | # Select whether or not to check if a port is compatible with KOS's current 19 | # floating-point precision ABI setting (KOS_SH4_PRECISION) before building. 20 | CHECK_PRECISION = true 21 | 22 | # Select whether or not to validate each file downloaded before unpacking them. 23 | # This requires Python to be installed. 24 | VALIDATE_DISTFILES = true 25 | 26 | # Autotools host triple. This should generally be the same as the KOS host. 27 | AUTOTOOLS_HOST = $(KOS_CC_PREFIX) 28 | 29 | # Command to run python 30 | PYTHON_CMD = python3 31 | -------------------------------------------------------------------------------- /curl/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = curl 3 | PORTVERSION = 7.64.1 4 | 5 | MAINTAINER = Damian Parrino 6 | LICENSE = custom 7 | SHORT_DESC = A library for transferring data with URL syntax. 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # Provide SSL support library 13 | DEPENDENCIES = zlib polarssl 14 | 15 | # What files we need to download, and where from. 16 | DOWNLOAD_SITE = https://curl.se/download 17 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 18 | 19 | TARGET = libcurl.a 20 | 21 | # attempt to install the headers locally. 22 | HDR_DIRECTORY = include/curl 23 | 24 | # cmake build arguments 25 | CMAKE_ARGS = -DCMAKE_USE_POLARSSL=1 -DUSE_UNIX_SOCKETS=0 -DENABLE_IPV6=0 -DENABLE_THREADED_RESOLVER=0 -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_POLICY_VERSION_MINIMUM=3.5 26 | 27 | # Add a pre-build target to adjust the source code 28 | PREBUILD = curl_prebuild 29 | curl_prebuild: 30 | cp files/CMakeLists.txt build/${PORTNAME}-${PORTVERSION} 31 | cp files/FindPolarSSL.cmake build/${PORTNAME}-${PORTVERSION}/CMake 32 | 33 | # Add a pre-install target to get the built library where we expect it. 34 | # This, copied from opus, might be solvable by 35 | # adding an equivalent to HDR_DIRECTORY for lib 36 | PREINSTALL = curl_preinstall 37 | curl_preinstall: 38 | cp build/${PORTNAME}-${PORTVERSION}/lib/${TARGET} build/${PORTNAME}-${PORTVERSION} 39 | 40 | include ${KOS_PORTS}/scripts/kos-ports.mk 41 | -------------------------------------------------------------------------------- /curl/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (curl-7.64.1.tar.gz) = 432d3f466644b9416bc5b649d344116a753aeaa520c8beaf024a90cba9d3d35d 2 | SIZE (curl-7.64.1.tar.gz) = 4008103 3 | -------------------------------------------------------------------------------- /curl/files/FindPolarSSL.cmake: -------------------------------------------------------------------------------- 1 | find_path(POLARSSL_INCLUDE_DIRS polarssl/ssl.h) 2 | 3 | find_library(POLARSSL_LIBRARY polarssl) 4 | 5 | set(POLARSSL_LIBRARIES "${POLARSSL_LIBRARY}") 6 | 7 | include(FindPackageHandleStandardArgs) 8 | find_package_handle_standard_args(PolarSSL DEFAULT_MSG 9 | POLARSSL_INCLUDE_DIRS POLARSSL_LIBRARY) 10 | 11 | mark_as_advanced(POLARSSL_INCLUDE_DIRS POLARSSL_LIBRARY) 12 | -------------------------------------------------------------------------------- /curl/pkg-descr: -------------------------------------------------------------------------------- 1 | curl is used in command lines or scripts to transfer data. curl is also libcurl, 2 | used in cars, television sets, routers, printers, audio equipment, mobile 3 | phones, tablets, medical devices, settop boxes, computer games, media players 4 | and is the Internet transfer engine for countless software applications in over 5 | twenty billion installations. 6 | 7 | URL: https://curl.se/ 8 | -------------------------------------------------------------------------------- /expat/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = expat 3 | PORTVERSION = 2.5.0 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = MIT (see COPYING in the source distribution) 7 | SHORT_DESC = A C library for parsing XML 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = autotools 11 | 12 | # Don't attempt to copy the target library, it will be in the inst dir already. 13 | NOCOPY_TARGET = 1 14 | 15 | # No external dependencies. 16 | DEPENDENCIES = 17 | 18 | # What files we need to download, and where from. 19 | DOWNLOAD_SITE = https://github.com/libexpat/libexpat/releases/download/R_2_5_0 20 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 21 | 22 | TARGET = libexpat.a 23 | HDR_INSTDIR = expat 24 | DISTFILE_DIR = ${PORTNAME}-${PORTVERSION} 25 | 26 | # Autotools setup work. 27 | CONFIGURE_ARGS = 28 | CONFIGURE_DEFS = RANLIB=${KOS_RANLIB} AR=${KOS_AR} 29 | MAKE_TARGET = all install 30 | 31 | # KOS Distributed extras (to be copied into the build tree) 32 | KOS_DISTFILES = 33 | 34 | include ${KOS_PORTS}/scripts/kos-ports.mk 35 | -------------------------------------------------------------------------------- /expat/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (expat-2.5.0.tar.gz) = 6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033 2 | SIZE (expat-2.5.0.tar.gz) = 719235 3 | -------------------------------------------------------------------------------- /expat/pkg-descr: -------------------------------------------------------------------------------- 1 | Expat is a stream-oriented XML parser library written in C. 2 | 3 | URL: https://libexpat.github.io/ 4 | -------------------------------------------------------------------------------- /freetype/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = freetype 3 | PORTVERSION = 2.13.3 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = FreeType License or GPLv2 (see docs/LICENSE.TXT in the source distribution) 7 | SHORT_DESC = Freely available software library to render fonts of various types. 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = autotools 11 | 12 | # Don't attempt to copy the target library, it will be in the inst dir already. 13 | NOCOPY_TARGET = 1 14 | 15 | # FreeType optionally uses bz2lib, zlib, and libpng. Provide them. 16 | DEPENDENCIES = libbz2 zlib libpng 17 | 18 | # What files we need to download, and where from. 19 | DOWNLOAD_SITES = https://download.savannah.gnu.org/releases/freetype/ \ 20 | https://sourceforge.net/projects/freetype/files/freetype2/2.13.3/ 21 | DOWNLOAD_FILES = freetype-2.13.3.tar.gz 22 | 23 | TARGET = libfreetype.a 24 | HDR_FULLDIR = freetype2 25 | DISTFILE_DIR = freetype-${PORTVERSION} 26 | 27 | 28 | # Autotools setup work. 29 | CONFIGURE_ARGS = --disable-mmap --with-brotli=no --with-harfbuzz=no 30 | CONFIGURE_DEFS = ZLIB_CFLAGS=-I${KOS_PORTS}/include/zlib ZLIB_LIBS=-lz \ 31 | BZIP2_CFLAGS=-I${KOS_PORTS}/include/bzlib BZIP2_LIBS=-lbz2 \ 32 | LIBPNG_CFLAGS="-I${KOS_PORTS}/include/png -std=gnu11" LIBPNG_LIBS=-lpng 33 | MAKE_TARGET = all install 34 | 35 | # KOS Distributed extras (to be copied into the build tree) 36 | KOS_DISTFILES = 37 | 38 | include ${KOS_PORTS}/scripts/kos-ports.mk 39 | -------------------------------------------------------------------------------- /freetype/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (freetype-2.13.3.tar.gz) = 5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 2 | SIZE (freetype-2.13.3.tar.gz) = 4063324 3 | -------------------------------------------------------------------------------- /freetype/pkg-descr: -------------------------------------------------------------------------------- 1 | FreeType is a freely available software library to render fonts. 2 | 3 | It is written in C, designed to be small, efficient, highly customizable, 4 | and portable while capable of producing high-quality output (glyph images) 5 | of most vector and bitmap font formats. 6 | 7 | URL: https://freetype.org/ 8 | -------------------------------------------------------------------------------- /libADX/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libADX 3 | PORTVERSION = 1.0.1 4 | 5 | MAINTAINER = SiZiOUS 6 | LICENSE = BSD 2-Clause License 7 | SHORT_DESC = Library for decoding ADX audio files 8 | 9 | KOS_MAKEFILE = Makefile 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORY = https://github.com/sega-dreamcast/libadx.git 13 | GIT_BRANCH = master 14 | GIT_TAG = v${PORTVERSION} 15 | 16 | TARGET = libADX.a 17 | INSTALLED_HDRS = include/adx.h include/snddrv.h 18 | HDR_INSTDIR = adx 19 | 20 | include ${KOS_PORTS}/scripts/kos-ports.mk 21 | -------------------------------------------------------------------------------- /libADX/pkg-descr: -------------------------------------------------------------------------------- 1 | LibADX is a library for decoding ADX audio files. ADX is a proprietary 2 | audio container and compression format developed by CRI Middleware 3 | specifically for use in video games; it is derived from ADPCM but with 4 | lossy compression. 5 | -------------------------------------------------------------------------------- /libAL/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libAL 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Luke Benstead 6 | LICENSE = MIT License 7 | SHORT_DESC = OpenAL implementation for KOS 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://gitlab.com/simulant/aldc.git 14 | 15 | TARGET = libAL.a 16 | INSTALLED_HDRS = include/AL/al.h include/AL/alc.h include/AL/alut.h 17 | HDR_COMDIR = AL 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /libAL/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libAL.a 2 | OBJS = src/alut.o src/buffer.o src/context.o src/core.o src/listener.o 3 | OBJS += src/math.o src/platform.o src/source.o 4 | 5 | KOS_CFLAGS += -Iinclude -ffast-math -O3 6 | 7 | include ${KOS_PORTS}/scripts/lib.mk 8 | -------------------------------------------------------------------------------- /libAL/pkg-descr: -------------------------------------------------------------------------------- 1 | ALdc is an OpenAL 1.1 implementation for KOS. 2 | 3 | It implements 3D positional audio for sound effects and offloads all of the panning and mixing to the AICA. 4 | -------------------------------------------------------------------------------- /libGL/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libGL 3 | PORTVERSION = 1.1.0 4 | 5 | MAINTAINER = Luke Benstead 6 | LICENSE = 2-clause BSD (see LICENSE in the source distribution) 7 | SHORT_DESC = GLdc, an OpenGL (tm) like graphics library for KOS 8 | 9 | PORT_BUILD = cmake 10 | 11 | GIT_REPOSITORY = https://gitlab.com/simulant/GLdc.git 12 | 13 | TARGET = libGL.a 14 | INSTALLED_HDRS = include/GL/gl.h include/GL/glext.h include/GL/glkos.h include/GL/glu.h 15 | HDR_COMDIR = GL 16 | EXAMPLES_DIR = samples 17 | 18 | # -DCMAKE_BUILD_TYPE=Release forces GLdc to build with upstream's release optimization 19 | # flags. Remove this argument to create a build without overriding $KOS_CFLAGS. 20 | CMAKE_ARGS = -DCMAKE_BUILD_TYPE=Release 21 | 22 | PREINSTALL = move_samples 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | move_samples: 26 | mv build/${PORTNAME}-${PORTVERSION}/*.elf build/${PORTNAME}-${PORTVERSION}/samples 27 | -------------------------------------------------------------------------------- /libGL/pkg-descr: -------------------------------------------------------------------------------- 1 | GLdc is a partial implementation of OpenGL 1.2 for the Sega Dreamcast for use 2 | with the KallistiOS SDK. The aim is to implement as much of OpenGL 1.2 as 3 | possible, and to add additional features via extensions. 4 | 5 | Note that this is not a full implementation of any version of OpenGL and is not 6 | endorsed by or associated with the Khronos Group or SGI. 7 | -------------------------------------------------------------------------------- /libKGL/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libKGL 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = KallistiGL, deprecated OpenGL (tm) like graphics library for KOS 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libgl \ 14 | https://github.com/KallistiOS/libkgl.git 15 | 16 | TARGET = libKGL.a 17 | INSTALLED_HDRS = include/gl.h include/glext.h include/glu.h include/glut.h 18 | HDR_COMDIR = KGL 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libKGL/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libKGL.a 2 | OBJS = gl-rgb.o gl-fog.o gl-sh4-light.o gl-light.o gl-clip.o gl-clip-arrays.o 3 | OBJS += gl-arrays.o gl-pvr.o gl-matrix.o gl-api.o gl-texture.o glu-texture.o 4 | OBJS += gl-framebuffer.o gl-cap.o gl-error.o 5 | 6 | KOS_CFLAGS += -Iinclude -ffast-math -O3 -DBUILD_LIBGL 7 | 8 | include ${KOS_PORTS}/scripts/lib.mk 9 | -------------------------------------------------------------------------------- /libKGL/pkg-descr: -------------------------------------------------------------------------------- 1 | KallistiGL is an OpenGL (tm) like library written for KOS. The current version 2 | of this library implements much of version 1.1 of the OpenGL specification and 3 | some additional functionality beyond that. 4 | 5 | Note that this is not a full implementation of any version of OpenGL and is not 6 | endorsed by or associated with the Khronos Group or SGI. 7 | -------------------------------------------------------------------------------- /libbearssl/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libbearssl 3 | PORTVERSION = 1.0.1 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = MIT License 7 | SHORT_DESC = BearSSL is an implementation of the SSL/TLS protocol (RFC 5246) written in C. 8 | 9 | KOS_MAKEFILE = Makefile 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORY = https://www.bearssl.org/git/BearSSL 13 | TARGET = libbearssl.a 14 | HDR_DIRECTORY = inc 15 | 16 | # Add a pre-install target to get the built library where we expect it. 17 | PREINSTALL = bearssl_preinstall 18 | 19 | MAKE_TARGET = lib 20 | 21 | include ${KOS_PORTS}/scripts/kos-ports.mk 22 | bearssl_preinstall: 23 | cp build/${PORTNAME}-${PORTVERSION}/build/${TARGET} build/${PORTNAME}-${PORTVERSION} 24 | -------------------------------------------------------------------------------- /libbearssl/pkg-descr: -------------------------------------------------------------------------------- 1 | BearSSL is an implementation of the SSL/TLS protocol (RFC 5246) written in C. 2 | It aims at offering the following features: 3 | 4 | Be correct and secure. In particular, insecure protocol versions and 5 | choices of algorithms are not supported, by design; cryptographic 6 | algorithm implementations are constant-time by default. 7 | 8 | Be small, both in RAM and code footprint. For instance, a minimal server 9 | implementation may fit in about 20 kilobytes of compiled code and 10 | 25 kilobytes of RAM. 11 | 12 | Be highly portable. BearSSL targets not only “big” operating systems like 13 | Linux and Windows, but also small embedded systems and even special 14 | contexts like bootstrap code. 15 | 16 | Be feature-rich and extensible. SSL/TLS has many defined cipher suites 17 | and extensions; BearSSL should implement most of them, and allow extra 18 | algorithm implementations to be added afterwards, possibly from third 19 | parties. 20 | 21 | 22 | URL: https://bearssl.org/ 23 | -------------------------------------------------------------------------------- /libbz2/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libbz2 3 | PORTVERSION = 1.0.8 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = BSD-like (see LICENSE in the source distribution) 7 | SHORT_DESC = Block-sorting compression library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = http://cdn-fastly.deb.debian.org/debian/pool/main/b/bzip2/ 14 | DOWNLOAD_FILES = bzip2_1.0.8.orig.tar.gz 15 | 16 | TARGET = libbz2.a 17 | INSTALLED_HDRS = bzlib.h 18 | HDR_INSTDIR = bzlib 19 | DISTFILE_DIR = bzip2-${PORTVERSION} 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /libbz2/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (bzip2_1.0.8.orig.tar.gz) = ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269 2 | SIZE (bzip2_1.0.8.orig.tar.gz) = 810029 3 | -------------------------------------------------------------------------------- /libbz2/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libbz2.a 2 | OBJS = blocksort.o huffman.o crctable.o randtable.o compress.o decompress.o \ 3 | bzlib.o 4 | 5 | KOS_CFLAGS += -I. 6 | 7 | include ${KOS_PORTS}/scripts/lib.mk 8 | -------------------------------------------------------------------------------- /libbz2/pkg-descr: -------------------------------------------------------------------------------- 1 | bzip2 is a freely available, open-source data compressor. It is believed by its 2 | author to be unencumbered by patents. It typically compresses data to within 3 | 10-15% of the best available techniques while maintaining higher compression and 4 | decompression speed. 5 | 6 | URL: http://bzip.org/ 7 | -------------------------------------------------------------------------------- /libchipmunk/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libchipmunk 3 | PORTVERSION = 7.0.3.1 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = MIT 7 | SHORT_DESC = A fast and lightweight 2D game physics library. 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://github.com/slembcke/Chipmunk2D.git 14 | #Official Chipmunk 7.0.3 does not build, so building straight from master 15 | #GIT_BRANCH = Chipmunk-$(PORTVERSION) 16 | TARGET = libchipmunk.a 17 | 18 | # This is required because the built-in cmake doesn't support custom install 19 | # of headers. It does support custom installation of the lib itself via 20 | # -DINSTALL_STATIC=ON and -DLIB_INSTALL_DIR=${KOS_PORTS}/${PORTNAME}/inst/lib 21 | # But that forces the attempt to install the headers locally. 22 | HDR_DIRECTORY = include/chipmunk 23 | 24 | # If the header installation issue above is fixed then install_static can be changed 25 | # Build_demos is reliant on a built-in library sokol that doesn't have a DC port 26 | CMAKE_ARGS = -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DBUILD_DEMOS=OFF -DINSTALL_STATIC=OFF 27 | 28 | # Add a pre-install target to get the built library where we expect it. 29 | # This, copied from opus, might be solvable by 30 | # adding an equivalent to HDR_DIRECTORY for lib 31 | PREINSTALL = chipmunk_preinstall 32 | 33 | include ${KOS_PORTS}/scripts/kos-ports.mk 34 | chipmunk_preinstall: 35 | cp build/${PORTNAME}-${PORTVERSION}/src/${TARGET} build/${PORTNAME}-${PORTVERSION} 36 | -------------------------------------------------------------------------------- /libchipmunk/pkg-descr: -------------------------------------------------------------------------------- 1 | Chipmunk2D is a simple, lightweight, fast and portable 2D rigid body 2 | physics library written in C. It’s licensed under the unrestrictive, 3 | OSI approved MIT license. Hundreds of shipping games have chosen Chipmunk 4 | because of the high quality, speed, and accuracy of its 2D physics simulations. 5 | 6 | URL: https://chipmunk-physics.net/ 7 | -------------------------------------------------------------------------------- /libcmark/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libcmark 3 | PORTVERSION = 0.31.0 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = Custom (see the file COPYING provided with headers or at https://github.com/commonmark/cmark/blob/master/COPYING) 7 | SHORT_DESC = CommonMark parsing and rendering library and program in C 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # This directs the behavior of creating a subdirectory 'build' and executing cmake at '..' 13 | CMAKE_OUTSOURCE = 1 14 | 15 | # What files we need to download, and where from. 16 | GIT_REPOSITORY = https://github.com/commonmark/cmark.git 17 | GIT_BRANCH = ${PORTVERSION} 18 | TARGET = libcmark.a 19 | 20 | INSTALLED_HDRS = src/*.h COPYING 21 | 22 | CMAKE_ARGS = -DBUILD_SHARED_LIBS=NO -DBUILD_TESTING=NO 23 | 24 | # Add a pre-install target to get the built library where we expect it. 25 | # This, copied from opus, might be solvable by 26 | # adding an equivalent to HDR_DIRECTORY for lib 27 | PREINSTALL = cmark_preinstall 28 | 29 | include ${KOS_PORTS}/scripts/kos-ports.mk 30 | cmark_preinstall: 31 | cp build/${PORTNAME}-${PORTVERSION}/build/src/${TARGET} build/${PORTNAME}-${PORTVERSION} 32 | -------------------------------------------------------------------------------- /libcmark/pkg-descr: -------------------------------------------------------------------------------- 1 | cmark is the C reference implementation of CommonMark, a rationalized 2 | version of Markdown syntax with a spec. 3 | 4 | It provides a shared library (libcmark) with functions for parsing 5 | CommonMark documents to an abstract syntax tree (AST), manipulating 6 | the AST, and rendering the document to HTML, groff man, LaTeX, 7 | CommonMark, or an XML representation of the AST. 8 | 9 | URL: https://commonmark.org/ 10 | -------------------------------------------------------------------------------- /libconio/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libconio 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Console-like I/O library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libconio \ 14 | https://github.com/KallistiOS/libconio.git 15 | 16 | TARGET = libconio.a 17 | INSTALLED_HDRS = include/conio.h include/draw.h include/input.h 18 | HDR_INSTDIR = conio 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libconio/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libconio.a 2 | OBJS = conio.o draw.o input.o 3 | KOS_CFLAGS += -Iinclude -DBUILD_LIBCONIO -DGFX 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libconio/pkg-descr: -------------------------------------------------------------------------------- 1 | libconio is a simple console-like I/O library for KOS. It provides a relatively 2 | simple way to deal with text-mode input and output, making it easy to develop 3 | something akin to a *nix shell. 4 | -------------------------------------------------------------------------------- /libdcplib/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libdcplib 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = LGPLv2 (with embedded system exemption) 7 | SHORT_DESC = A portable game programming library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libdcplib \ 14 | https://github.com/KallistiOS/libdcplib.git 15 | 16 | TARGET = libdcplib.a 17 | INSTALLED_HDRS = include/fnt.h include/sg.h include/ul.h 18 | HDR_INSTDIR = dcplib 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libdcplib/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libdcplib.a 2 | OBJS = ulError.o sg.o fnt.o fntTXF.o sgd.o sgIsect.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libdcplib/pkg-descr: -------------------------------------------------------------------------------- 1 | libdcplib is a Dreamcast "port" of the PLIB suite of game programming libraries. 2 | Much of the library is essentially rewritten from its original version to make 3 | it more closely map to the Dreamcast (instead of using OpenGL). The library 4 | provides a relatively simple object-oriented C++ API of useful primitives for 5 | writing games. 6 | 7 | The Dreamcast version of this library only supports a small subset of the 8 | primitives provided in current versions of PLIB. This port is based on a very 9 | old version of PLIB and has not been updated in many years. 10 | 11 | URL: http://plib.sourceforge.net/ 12 | -------------------------------------------------------------------------------- /libfastmem/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libfastmem 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = SiZiOUS 6 | LICENSE = LGPLv2.1 7 | SHORT_DESC = Very optimized set of memory manipulation functions 8 | 9 | DEPENDENCIES = 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORY = https://github.com/sega-dreamcast/libfastmem.git 13 | 14 | TARGET = libfastmem.a 15 | INSTALLED_HDRS = include/fastmem.h 16 | HDR_INSTDIR = fastmem 17 | 18 | # KOS Distributed extras (to be copied into the build tree) 19 | KOS_DISTFILES = KOSMakefile.mk 20 | 21 | include ${KOS_PORTS}/scripts/kos-ports.mk 22 | -------------------------------------------------------------------------------- /libfastmem/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libfastmem.a 2 | OBJS = memcpy_fast.o memset_fast.o memmove_fast.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libfastmem/pkg-descr: -------------------------------------------------------------------------------- 1 | libfastmem is a tiny library for KallistiOS that provides set of functions 2 | dedicated to memory manipulation, that are very optimized in terms of speed 3 | and/or memory. -------------------------------------------------------------------------------- /libimageload/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libimageload 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Library for decoding BMP, JPEG, and PCX images 8 | 9 | DEPENDENCIES = libjpeg 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libimageload \ 13 | https://github.com/KallistiOS/libimageload.git 14 | 15 | TARGET = libimageload.a 16 | INSTALLED_HDRS = include/imageload.h include/jitterdefs.h 17 | HDR_INSTDIR = imageload 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /libimageload/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libimageload.a 2 | OBJS = readpcx.o readbmp.o readjpeg.o imageload.o jitter.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libimageload/pkg-descr: -------------------------------------------------------------------------------- 1 | libimageload is a convenience library for loading multiple image file formats. 2 | It relies on libjpeg for JPEG decoding and has its own built-in decoding code 3 | for PCX and BMP files. 4 | 5 | The PCX decoding code in this library only supports 8bpp paletted images. Any 6 | other PCX formats will not work. 7 | -------------------------------------------------------------------------------- /libjimtcl/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libjimtcl 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Spencer (@spencerelliott) 6 | LICENSE = FreeBSD 7 | SHORT_DESC = An open-source, small footprint implementation of Tcl 8 | 9 | # What files we need to download, and where from. 10 | GIT_REPOSITORY = https://github.com/msteveb/jimtcl.git 11 | 12 | TARGET = libjim.a 13 | INSTALLED_HDRS = jim.h jim-win32compat.h jim-config.h 14 | HDR_INSTDIR = jimtcl 15 | 16 | # KOS Distributed extras (to be copied into the build tree) 17 | KOS_DISTFILES = KOSMakefile.mk 18 | 19 | include ${KOS_PORTS}/scripts/kos-ports.mk 20 | -------------------------------------------------------------------------------- /libjimtcl/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | PORTNAME = libjimtcl 2 | CONFIGURE_ARGS = --without-ext="aio,zlib" 3 | MAKE_TARGET = libjim.a 4 | HDR_INSTDIR = jimtcl 5 | 6 | AUTOTOOLS_HOST = sh-elf 7 | 8 | all: build-libjim fix-jimh 9 | 10 | build-libjim: 11 | CC=kos-cc ${CONFIGURE_DEFS} ./configure --prefix=${KOS_PORTS}/${PORTNAME}/inst --host=${AUTOTOOLS_HOST} ${CONFIGURE_ARGS} ; \ 12 | $(MAKE) ${MAKE_TARGET} 13 | 14 | fix-jimh: 15 | sed -i'' -e "s@#include @#include <${HDR_INSTDIR}/jim-win32compat.h>@g" jim.h 16 | sed -i'' -e "s@#include @#include <${HDR_INSTDIR}/jim-config.h>@g" jim.h 17 | 18 | include ${KOS_PORTS}/scripts/lib.mk 19 | -------------------------------------------------------------------------------- /libjimtcl/pkg-descr: -------------------------------------------------------------------------------- 1 | Jim Tcl is an open-source small footprint implementation of the Tcl programming 2 | language. Tcl, or Tool Command Language, originally by John Ousterhout, is an 3 | open-source multi-purpose C library which includes a powerful dynamic scripting 4 | language. 5 | 6 | URL: http://jim.tcl.tk/ 7 | -------------------------------------------------------------------------------- /libjpeg/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libjpeg 3 | PORTVERSION = 9.5 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = IJG license (see README in the source distribution!) 7 | SHORT_DESC = Freely available lossy image compression library (with KOS additions) 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITES = http://ijg.org/files \ 14 | https://sources.buildroot.net/libjpeg/ 15 | DOWNLOAD_FILES = jpegsrc.v9e.tar.gz 16 | 17 | TARGET = libjpeg.a 18 | INSTALLED_HDRS = jconfig.h jmorecfg.h jpeg.h jpeglib.h jpegint.h jerror.h 19 | HDR_INSTDIR = jpeg 20 | DISTFILE_DIR = jpeg-9e 21 | 22 | # KOS Distributed extras (to be copied into the build tree) 23 | KOS_DISTFILES = KOSMakefile.mk kos_img.c kos_texture.c jpeg.h 24 | 25 | include ${KOS_PORTS}/scripts/kos-ports.mk 26 | -------------------------------------------------------------------------------- /libjpeg/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (jpegsrc.v9e.tar.gz) = 4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d 2 | SIZE (jpegsrc.v9e.tar.gz) = 1046935 3 | -------------------------------------------------------------------------------- /libjpeg/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libjpeg.a 2 | 3 | COMOBJECTS = jaricom.o jcomapi.o jutils.o jerror.o jmemmgr.o jmemnobs.o 4 | CLIBOBJECTS= jcapimin.o jcapistd.o jcarith.o jctrans.o jcparam.o \ 5 | jdatadst.o jcinit.o jcmaster.o jcmarker.o jcmainct.o jcprepct.o \ 6 | jccoefct.o jccolor.o jcsample.o jchuff.o jcdctmgr.o jfdctfst.o \ 7 | jfdctflt.o jfdctint.o 8 | DLIBOBJECTS= jdapimin.o jdapistd.o jdarith.o jdtrans.o jdatasrc.o \ 9 | jdmaster.o jdinput.o jdmarker.o jdhuff.o jdmainct.o \ 10 | jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o \ 11 | jidctint.o jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o 12 | KOSOBJECTS = kos_img.o kos_texture.o 13 | OBJS = $(COMOBJECTS) $(CLIBOBJECTS) $(DLIBOBJECTS) $(KOSOBJECTS) 14 | 15 | KOS_CFLAGS += -I. 16 | 17 | defaultall: jconfig.h $(OBJS) subdirs linklib 18 | 19 | # Force the configuration file to be generated. 20 | jconfig.h: jconfig.txt 21 | cp $< $@ 22 | 23 | include ${KOS_PORTS}/scripts/lib.mk 24 | -------------------------------------------------------------------------------- /libjpeg/files/jpeg.h: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | jpeg.h 4 | (c)2001 Megan Potter 5 | */ 6 | 7 | #ifndef __JPEG_JPEG_H 8 | #define __JPEG_JPEG_H 9 | 10 | #include 11 | __BEGIN_DECLS 12 | 13 | #include 14 | 15 | #ifdef _arch_dreamcast 16 | #include 17 | 18 | /* Load a JPEG file into a texture; returns 0 for success, -1 for failure. */ 19 | int jpeg_to_texture(const char * filename, pvr_ptr_t tex, int size, int scale); 20 | #endif 21 | 22 | /* Load a JPEG into a KOS PIImage */ 23 | int jpeg_to_img(const char *filename, int scale, kos_img_t *rv); 24 | 25 | __END_DECLS 26 | 27 | #endif /* __JPEG_JPEG_H */ 28 | 29 | -------------------------------------------------------------------------------- /libjpeg/files/kos_img.c: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | kos_img.c 4 | (c)2002 Megan Potter 5 | 6 | Based on Andrew's jpeg_to_texture routine, but loads into a 7 | KOS plat-independent image. 8 | */ 9 | 10 | 11 | #include 12 | #include 13 | #include "jpeglib.h" 14 | 15 | /* Load a JPEG into a KOS PIImage */ 16 | int jpeg_to_img(const char *filename, int scale, kos_img_t * rv) { 17 | int i; 18 | uint16 * ourbuffer; 19 | uint16 * temp_tex; 20 | 21 | /* This struct contains the JPEG decompression parameters and pointers to 22 | * working space (which is allocated as needed by the JPEG library). 23 | */ 24 | struct jpeg_decompress_struct cinfo; 25 | 26 | struct jpeg_error_mgr jerr; 27 | 28 | /* More stuff */ 29 | FILE * infile; /* Source file */ 30 | JSAMPARRAY buffer; /* Output row buffer */ 31 | int row_stride; /* physical row width in output buffer */ 32 | 33 | assert( rv != NULL ); 34 | 35 | /* In this example we want to open the input file before doing anything else, 36 | * so that the setjmp() error recovery below can assume the file is open. 37 | * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that 38 | * requires it in order to read binary files. 39 | */ 40 | 41 | if ((infile = fopen(filename, "r")) == 0) { 42 | dbglog(DBG_ERROR, "jpeg_to_img: can't open '%s'\n", filename); 43 | return -1; 44 | } 45 | 46 | /* Step 1: allocate and initialize JPEG decompression object */ 47 | 48 | /* We set up the normal JPEG error routines */ 49 | cinfo.err = jpeg_std_error(&jerr); 50 | 51 | /* Now we can initialize the JPEG decompression object. */ 52 | jpeg_create_decompress(&cinfo); 53 | 54 | /* Step 2: specify data source (eg, a file) */ 55 | jpeg_stdio_src(&cinfo, (FILE*)infile); 56 | 57 | /* Step 3: read file parameters with jpeg_read_header() */ 58 | (void)jpeg_read_header(&cinfo, TRUE); 59 | /* We can ignore the return value from jpeg_read_header since 60 | * (a) suspension is not possible with the stdio data source, and 61 | * (b) we passed TRUE to reject a tables-only JPEG file as an error. 62 | * See libjpeg.doc for more info. 63 | */ 64 | 65 | /* Allocate the output buffers */ 66 | rv->w = cinfo.image_width; 67 | rv->h = cinfo.image_height; 68 | rv->data = (void *)( temp_tex = (uint16 *)malloc(rv->w * rv->h * 2) ); 69 | rv->fmt = KOS_IMG_FMT(KOS_IMG_FMT_RGB565, 0); 70 | rv->byte_count = rv->w * rv->h * 2; 71 | ourbuffer = (uint16 *)malloc(rv->w * 2); 72 | 73 | /* Step 4: set parameters for decompression */ 74 | assert( scale == 1 || scale == 2 || scale == 4 || scale == 8 ); 75 | cinfo.scale_num = 1; 76 | cinfo.scale_denom = scale; /* must be 1, 2, 4, or 8 */ 77 | 78 | /* Step 5: Start decompressor */ 79 | (void)jpeg_start_decompress(&cinfo); 80 | /* We can ignore the return value since suspension is not possible 81 | * with the stdio data source. 82 | */ 83 | 84 | /* We may need to do some setup of our own at this point before reading 85 | * the data. After jpeg_start_decompress() we have the correct scaled 86 | * output image dimensions available, as well as the output colormap 87 | * if we asked for color quantization. 88 | * In this example, we need to make an output work buffer of the right size. 89 | */ 90 | /* JSAMPLEs per row in output buffer */ 91 | row_stride = cinfo.output_width * cinfo.output_components; 92 | 93 | /* Make a one-row-high sample array that will go away when done with image */ 94 | buffer = (*cinfo.mem->alloc_sarray) 95 | ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); 96 | 97 | /* Step 6: while (scan lines remain to be read) */ 98 | /* jpeg_read_scanlines(...); */ 99 | 100 | /* Here we use the library's state variable cinfo.output_scanline as the 101 | * loop counter, so that we don't have to keep track ourselves. 102 | */ 103 | while (cinfo.output_scanline < cinfo.output_height) { 104 | /* jpeg_read_scanlines expects an array of pointers to scanlines. 105 | * Here the array is only one element long, but you could ask for 106 | * more than one scanline at a time if that's more convenient. 107 | */ 108 | (void)jpeg_read_scanlines(&cinfo, buffer, 1); 109 | 110 | for(i=0; i>3)<<11) + ((buffer[0][i*3+1]>>2)<<5) + (buffer[0][i*3+2]>>3); 112 | 113 | memcpy(temp_tex + cinfo.image_width*(cinfo.output_scanline-1), ourbuffer, 2*row_stride/3); 114 | } 115 | 116 | /* Step 7: Finish decompression */ 117 | (void)jpeg_finish_decompress(&cinfo); 118 | /* We can ignore the return value since suspension is not possible 119 | * with the stdio data source. 120 | */ 121 | 122 | /* Step 8: Release JPEG decompression object */ 123 | /* This is an important step since it will release a good deal of memory. */ 124 | jpeg_destroy_decompress(&cinfo); 125 | 126 | /* After finish_decompress, we can close the input file. 127 | * Here we postpone it until after no more JPEG errors are possible, 128 | * so as to simplify the setjmp error logic above. (Actually, I don't 129 | * think that jpeg_destroy can do an error exit, but why assume anything...) 130 | */ 131 | fclose(infile); 132 | 133 | /* At this point you may want to check to see whether any corrupt-data 134 | * warnings occurred (test whether jerr.pub.num_warnings is nonzero). 135 | */ 136 | 137 | free(ourbuffer); 138 | 139 | /* And we're done! */ 140 | return 0; 141 | } 142 | 143 | -------------------------------------------------------------------------------- /libjpeg/files/kos_texture.c: -------------------------------------------------------------------------------- 1 | /* Included from Andrew Kieschnick's Burritro */ 2 | #include 3 | #include "jpeglib.h" 4 | 5 | /* load n x n textures from jpegs */ 6 | 7 | int jpeg_to_texture(const char * filename, pvr_ptr_t tex, int n, int scale) 8 | { 9 | int i; 10 | unsigned short *ourbuffer; 11 | unsigned short *temp_tex; 12 | 13 | /* This struct contains the JPEG decompression parameters and pointers to 14 | * working space (which is allocated as needed by the JPEG library). 15 | */ 16 | struct jpeg_decompress_struct cinfo; 17 | 18 | struct jpeg_error_mgr jerr; 19 | 20 | /* More stuff */ 21 | FILE * infile; /* source file */ 22 | JSAMPARRAY buffer; /* Output row buffer */ 23 | int row_stride; /* physical row width in output buffer */ 24 | 25 | /* In this example we want to open the input file before doing anything else, 26 | * so that the setjmp() error recovery below can assume the file is open. 27 | * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that 28 | * requires it in order to read binary files. 29 | */ 30 | 31 | if ((infile = fopen(filename, "r")) == 0) { 32 | printf("jpeg_to_texture: can't open %s\n", filename); 33 | return -1; 34 | } 35 | 36 | ourbuffer = (unsigned short *)malloc(sizeof(unsigned short)*n); 37 | 38 | temp_tex = (unsigned short *)malloc(n*n*2); 39 | 40 | /* Step 1: allocate and initialize JPEG decompression object */ 41 | 42 | /* We set up the normal JPEG error routines */ 43 | cinfo.err = jpeg_std_error(&jerr); 44 | 45 | /* Now we can initialize the JPEG decompression object. */ 46 | jpeg_create_decompress(&cinfo); 47 | 48 | /* Step 2: specify data source (eg, a file) */ 49 | 50 | jpeg_stdio_src(&cinfo, (FILE*)infile); 51 | 52 | /* Step 3: read file parameters with jpeg_read_header() */ 53 | 54 | (void) jpeg_read_header(&cinfo, TRUE); 55 | /* We can ignore the return value from jpeg_read_header since 56 | * (a) suspension is not possible with the stdio data source, and 57 | * (b) we passed TRUE to reject a tables-only JPEG file as an error. 58 | * See libjpeg.doc for more info. 59 | */ 60 | 61 | /* Step 4: set parameters for decompression */ 62 | cinfo.scale_num = 1; 63 | cinfo.scale_denom = scale; /* must be 1, 2, 4, or 8 */ 64 | 65 | /* Step 5: Start decompressor */ 66 | 67 | (void) jpeg_start_decompress(&cinfo); 68 | /* We can ignore the return value since suspension is not possible 69 | * with the stdio data source. 70 | */ 71 | 72 | /* We may need to do some setup of our own at this point before reading 73 | * the data. After jpeg_start_decompress() we have the correct scaled 74 | * output image dimensions available, as well as the output colormap 75 | * if we asked for color quantization. 76 | * In this example, we need to make an output work buffer of the right size. 77 | */ 78 | /* JSAMPLEs per row in output buffer */ 79 | row_stride = cinfo.output_width * cinfo.output_components; 80 | /* Make a one-row-high sample array that will go away when done with image */ 81 | buffer = (*cinfo.mem->alloc_sarray) 82 | ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); 83 | 84 | /* Step 6: while (scan lines remain to be read) */ 85 | /* jpeg_read_scanlines(...); */ 86 | 87 | /* Here we use the library's state variable cinfo.output_scanline as the 88 | * loop counter, so that we don't have to keep track ourselves. 89 | */ 90 | while (cinfo.output_scanline < cinfo.output_height) { 91 | /* jpeg_read_scanlines expects an array of pointers to scanlines. 92 | * Here the array is only one element long, but you could ask for 93 | * more than one scanline at a time if that's more convenient. 94 | */ 95 | (void) jpeg_read_scanlines(&cinfo, buffer, 1); 96 | 97 | for(i=0; i>3)<<11) + ((buffer[0][i*3+1]>>2)<<5) + (buffer[0][i*3+2]>>3); 99 | 100 | memcpy(temp_tex + n*(cinfo.output_scanline-1), ourbuffer, 2*row_stride/3); 101 | } 102 | 103 | pvr_txr_load_ex(temp_tex, tex, n, n, PVR_TXRLOAD_16BPP); 104 | 105 | /* Step 7: Finish decompression */ 106 | 107 | (void) jpeg_finish_decompress(&cinfo); 108 | /* We can ignore the return value since suspension is not possible 109 | * with the stdio data source. 110 | */ 111 | 112 | /* Step 8: Release JPEG decompression object */ 113 | 114 | /* This is an important step since it will release a good deal of memory. */ 115 | jpeg_destroy_decompress(&cinfo); 116 | 117 | /* After finish_decompress, we can close the input file. 118 | * Here we postpone it until after no more JPEG errors are possible, 119 | * so as to simplify the setjmp error logic above. (Actually, I don't 120 | * think that jpeg_destroy can do an error exit, but why assume anything...) 121 | */ 122 | fclose(infile); 123 | 124 | /* At this point you may want to check to see whether any corrupt-data 125 | * warnings occurred (test whether jerr.pub.num_warnings is nonzero). 126 | */ 127 | 128 | free(ourbuffer); 129 | 130 | free(temp_tex); 131 | 132 | /* And we're done! */ 133 | return 0; 134 | } 135 | 136 | -------------------------------------------------------------------------------- /libjpeg/pkg-descr: -------------------------------------------------------------------------------- 1 | libjpeg is a freely available library that implements the JPEG image compression 2 | and decompression algorithms. JPEG is a lossy image compression format that 3 | does not support alpha channels. 4 | 5 | The KOS port of this library includes a bit of additional functionality to 6 | directly read JPEG images into textures or KOS platform-independent images. 7 | 8 | URL: http://ijg.org/ 9 | -------------------------------------------------------------------------------- /libkmg/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libkmg 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Library for decoding KMG images 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libkmg \ 14 | https://github.com/KallistiOS/libkmg.git 15 | 16 | TARGET = libkmg.a 17 | INSTALLED_HDRS = include/kmg.h 18 | HDR_INSTDIR = kmg 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libkmg/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libkmg.a 2 | OBJS = kmg.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libkmg/pkg-descr: -------------------------------------------------------------------------------- 1 | The KMG image format is a KOS-specific image format for storing platform- 2 | specific images. These images can be pre-transformed to various formats that 3 | make them much nicer to work with on the Dreamcast (such as pre-twiddling them 4 | or storing them with VQ compression). 5 | -------------------------------------------------------------------------------- /libkosh/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libkosh 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = The KallistiOS shell (library) 8 | 9 | DEPENDENCIES = libconio 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libkosh \ 13 | https://github.com/KallistiOS/libkosh.git 14 | 15 | TARGET = libkosh.a 16 | INSTALLED_HDRS = include/kosh.h 17 | HDR_INSTDIR = kosh 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /libkosh/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libkosh.a 2 | OBJS = kosh.o builtin.o chdir.o input.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libkosh/pkg-descr: -------------------------------------------------------------------------------- 1 | libkosh is a *nix-like shell for KOS, in a convenient library form. This library 2 | allows you to add a shell to your program with minimal effort(*). libkosh is 3 | built on top of libconio, providing text-mode I/O. 4 | 5 | (*): Minimal effort to add the shell, not minimal effort to find a reason for a 6 | shell in the first place. ;-) 7 | -------------------------------------------------------------------------------- /libmodplug/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libmodplug 3 | PORTVERSION = 0.7 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = Public Domain 7 | SHORT_DESC = A library for MOD-like tracker music formats 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libmodplug \ 14 | https://github.com/KallistiOS/libmodplug.git 15 | 16 | TARGET = libmodplug.a 17 | INSTALLED_HDRS = include/modplug.h include/sndfile.h include/stdafx.h 18 | HDR_INSTDIR = modplug 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libmodplug/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libmodplug.a 2 | KOS_CFLAGS += -Iinclude -DMODPLUG_BASIC_SUPPORT -DFASTSOUNDLIB 3 | OBJS= tables.o \ 4 | sndmix.o \ 5 | sndfile.o \ 6 | snd_fx.o \ 7 | snd_flt.o \ 8 | snd_dsp.o \ 9 | fastmix.o \ 10 | load_xm.o \ 11 | load_wav.o \ 12 | load_s3m.o \ 13 | load_mod.o \ 14 | load_it.o \ 15 | modplug.o 16 | # mmcmp.o \ 17 | # load_umx.o \ 18 | # load_ult.o \ 19 | # load_stm.o \ 20 | # load_ptm.o \ 21 | # load_okt.o \ 22 | # load_mtm.o \ 23 | # load_med.o \ 24 | # load_mdl.o \ 25 | # load_far.o \ 26 | # load_dsm.o \ 27 | # load_dmf.o \ 28 | # load_dbm.o \ 29 | # load_ams.o \ 30 | # load_amf.o \ 31 | # load_669.o \ 32 | # load_j2b.o \ 33 | # load_mt2.o \ 34 | # load_psm.o \ 35 | 36 | 37 | include ${KOS_PORTS}/scripts/lib.mk 38 | -------------------------------------------------------------------------------- /libmodplug/pkg-descr: -------------------------------------------------------------------------------- 1 | libmodplug is a library for decoding MOD-like tracker music formats. The music 2 | formats supported by this library are much simpler than those for full PCM 3 | music like Ogg Vorbis or MP3, but can still provide decent sequenced background 4 | music for games. 5 | 6 | This library, unlike those for Ogg Vorbis and MP3, does not provide sound output 7 | directly. Look at the example included with KOS for more information about using 8 | this library for your music. 9 | 10 | URL: http://modplug-xmms.sourceforge.net/ 11 | -------------------------------------------------------------------------------- /libmp3/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libmp3 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = GPLv2+ (XingMP3) and KOS License (KOS Glue) 7 | SHORT_DESC = Library for decoding and streaming MP3 audio 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libmp3 \ 14 | https://github.com/KallistiOS/libmp3.git 15 | 16 | TARGET = libmp3.a 17 | INSTALLED_HDRS = include/sndmp3.h include/sndserver.h 18 | HDR_INSTDIR = mp3 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libmp3/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libmp3.a 2 | SUBDIRS = xingmp3 libmp3 3 | LIB_OBJS = build/*.o 4 | KOS_CFLAGS += -Iinclude -std=c17 5 | 6 | include ${KOS_PORTS}/scripts/lib.mk 7 | -------------------------------------------------------------------------------- /libmp3/pkg-descr: -------------------------------------------------------------------------------- 1 | libmp3 is a library for decoding MP3 audio files and streaming them to the 2 | Dreamcast's sound hardware. The library itself is a small bit of glue code 3 | wrapped around the XingMP3 decoding library. 4 | 5 | Please note: XingMP3 is licensed under the GNU General Public License version 2 6 | (or at your option any later version). Thus, you must follow the licensing terms 7 | for the GPLv2 if you use this library. That basically means anything using this 8 | library *MUST* be open-source. 9 | 10 | Also note: MP3 decoding may or may not be subject to software patents in your 11 | jurisdiction. Please consult an experienced intellectual property lawyer if you 12 | have any doubts on this subject. 13 | -------------------------------------------------------------------------------- /libmpeg/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libmpeg 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Andy Barajas 6 | LICENSE = MIT 7 | SHORT_DESC = Library for decoding MPEG1 Video, MP2 Audio using pl_mpeg 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = https://github.com/Dreamcast-Projects/pl_mpeg/archive/refs/tags 14 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 15 | 16 | TARGET = libmpeg.a 17 | INSTALLED_HDRS = mpeg.h 18 | HDR_INSTDIR = mpeg 19 | DISTFILE_DIR = pl_mpeg-${PORTNAME}-${PORTVERSION} 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /libmpeg/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (libmpeg-1.0.0.tar.gz) = 914a67c7058550512d630fdf8158f3f20fa22e81248ba3db5518428084798129 2 | SIZE (libmpeg-1.0.0.tar.gz) = 4527455 3 | -------------------------------------------------------------------------------- /libmpeg/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libmpeg.a 2 | OBJS = mpeg.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libmpeg/pkg-descr: -------------------------------------------------------------------------------- 1 | MPEG1 Decode Library for Dreamcast - Version 0.8 (2023/09/19) 2 | Originally ported by Tashi (aka Twada) 3 | Further works done by Ian Robinson and Andy Barajas 4 | 5 | Overview: 6 | This library facilitates the playback of MPEG1 videos on the Sega Dreamcast console. 7 | It supports monaural audio and allows specifying a cancel button during playback. 8 | 9 | Key Features: 10 | - Video Playback: MPEG1 video playback. 11 | - Audio Support: Mono audio playback. Stereo videos will play only the left channel. 12 | - Cancel Button: Allows specifying a controller button combination to cancel playback. 13 | - Recommended Resolutions: 14 | - 4:3 Aspect Ratio: 320x240 pixels, Mono audio at 80kbits. 15 | - 16:9 Aspect Ratio: 368x208 pixels, Mono audio at 80kbits. 16 | 17 | To create compatible MPEG1 videos, use the following ffmpeg command: 18 | 19 | ffmpeg -i input.mp4 -vf "scale=320:240" -b:v 742k -minrate 742k -maxrate 742k -bufsize 742k -ac 1 -ar 32000 -c:a mp2 -b:a 64k -f mpeg output.mpg 20 | 21 | Licensing: 22 | - pl_mpeg.h - MIT License 23 | - mpeg.h, mpeg.c - Public Domain 24 | 25 | Acknowledgements: 26 | - Dominic Szablewski (https://phoboslab.org) for the decoding engine. 27 | 28 | -------------------------------------------------------------------------------- /libogg/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libogg 3 | PORTVERSION = 1.3.4 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = 3-clause BSD (see COPYING in the source distribution) 7 | SHORT_DESC = Multimedia container format access library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = https://ftp.osuosl.org/pub/xiph/releases/ogg 14 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 15 | 16 | TARGET = libogg.a 17 | INSTALLED_HDRS = include/ogg/ogg.h include/ogg/os_types.h \ 18 | include/ogg/config_types.h 19 | HDR_INSTDIR = ogg 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /libogg/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (libogg-1.3.4.tar.gz) = fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e 2 | SIZE (libogg-1.3.4.tar.gz) = 589570 3 | -------------------------------------------------------------------------------- /libogg/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libogg.a 2 | OBJS = src/bitwise.o src/framing.o 3 | 4 | KOS_CFLAGS += -Iinclude -fsigned-char -ffast-math 5 | 6 | defaultall: copytypes $(OBJS) subdirs linklib 7 | 8 | copytypes: 9 | cp ../../files/config_types.h include/ogg 10 | 11 | include ${KOS_PORTS}/scripts/lib.mk 12 | -------------------------------------------------------------------------------- /libogg/files/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | #include 5 | 6 | typedef int16_t ogg_int16_t; 7 | typedef uint16_t ogg_uint16_t; 8 | typedef int32_t ogg_int32_t; 9 | typedef uint32_t ogg_uint32_t; 10 | typedef int64_t ogg_int64_t; 11 | typedef uint64_t ogg_uint64_t; 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /libogg/pkg-descr: -------------------------------------------------------------------------------- 1 | Ogg is an open multimedia container format used along with the Vorbis audio 2 | codec (amongst other multimedia formats). This library provides an API for 3 | accessing ogg files and other ogg bitstreams. 4 | 5 | URL: https://www.xiph.org/ogg/ 6 | -------------------------------------------------------------------------------- /liboggvorbisplay/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = liboggvorbisplay 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = KOS License 7 | SHORT_DESC = Ogg Vorbis audio streaming library 8 | 9 | DEPENDENCIES = libvorbis 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/liboggvorbis \ 13 | https://github.com/KallistiOS/liboggvorbisplay.git 14 | 15 | TARGET = liboggvorbisplay.a 16 | INSTALLED_HDRS = include/oggvorbis/sndoggvorbis.h 17 | HDR_INSTDIR = oggvorbis 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /liboggvorbisplay/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = liboggvorbisplay.a 2 | OBJS = liboggvorbisplay/main.o liboggvorbisplay/sndoggvorbis.o 3 | KOS_CFLAGS += -Iinclude -Iliboggvorbisplay 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /liboggvorbisplay/pkg-descr: -------------------------------------------------------------------------------- 1 | liboggvorbisplay is the KOS glue library for libvorbis and libogg. This library 2 | provides a simple interface for spawning a decoding thread and maintaining the 3 | state of the stream in the background of any other computations that you might 4 | have ongoing. 5 | -------------------------------------------------------------------------------- /libopusplay/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libopusplay 3 | PORTVERSION = 2.1.0 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = KOS License 7 | SHORT_DESC = Opus audio playback library 8 | 9 | # Requires opusfile (which will pull in opus and libogg) 10 | DEPENDENCIES = opusfile 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libopusplay \ 14 | https://github.com/KallistiOS/libopusplay.git 15 | 16 | TARGET = libopusplay.a 17 | INSTALLED_HDRS = opusplay.h 18 | HDR_INSTDIR = opusplay 19 | 20 | KOS_MAKEFILE = Makefile 21 | 22 | # KOS Distributed extras (to be copied into the build tree) 23 | KOS_DISTFILES = 24 | 25 | include ${KOS_PORTS}/scripts/kos-ports.mk 26 | -------------------------------------------------------------------------------- /libopusplay/pkg-descr: -------------------------------------------------------------------------------- 1 | Opus is a totally open, royalty-free, highly versatile audio codec. Opus is 2 | unmatched for interactive speech and music transmission over the Internet, but 3 | is also intended for storage and streaming applications. It is standardized by 4 | the Internet Engineering Task Force (IETF) as RFC 6716 which incorporated 5 | technology from Skype's SILK codec and Xiph.Org's CELT codec. 6 | 7 | This library is a KallistiOS specific playback library, utilizing the Xiph.org 8 | Opusfile library. This library was not written by the Opus project. 9 | -------------------------------------------------------------------------------- /libparallax/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libparallax 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Simple (mostly 2D) game API library 8 | 9 | DEPENDENCIES = libpng libjpeg libkmg 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libparallax \ 13 | https://github.com/KallistiOS/libparallax.git 14 | 15 | TARGET = libparallax.a 16 | INSTALLED_HDRS = include/color.h include/context.h include/dr.h \ 17 | include/font.h include/list.h include/matrix.h \ 18 | include/prim.h include/sprite.h include/texture.h 19 | HDR_INSTDIR = plx 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /libparallax/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libparallax.a 2 | OBJS := $(patsubst %.c,%.o,$(wildcard src/*.c)) 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libparallax/pkg-descr: -------------------------------------------------------------------------------- 1 | libparallax is a simple (mostly) wrapper API around the PVR functionality in 2 | KOS to produce a relatively easy-to-use library for (mostly 2D) game 3 | programming. It is designed to extend and simplify the native low-level APIs in 4 | KOS with various functionality for games. In addition, it is designed to be a 5 | very thin wrapper, so as to be as fast as possible in submitting data to the 6 | video hardware. 7 | -------------------------------------------------------------------------------- /libpcx/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libpcx 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Library for decoding PCX images 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libpcx \ 14 | https://github.com/KallistiOS/libpcx.git 15 | 16 | TARGET = libpcx.a 17 | INSTALLED_HDRS = include/pcx.h 18 | HDR_INSTDIR = pcx 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libpcx/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libpcx.a 2 | OBJS = pcx.o pcx_texture.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libpcx/pkg-descr: -------------------------------------------------------------------------------- 1 | libpcx is a small library for decoding PCX image files. This library is limited 2 | to supporting only 8bpp paletted PCX images. All other PCX files will be 3 | rejected by the decoding code. 4 | -------------------------------------------------------------------------------- /libpng/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libpng 3 | PORTVERSION = 1.6.37 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = zlib License - http://opensource.org/licenses/Zlib 7 | SHORT_DESC = Freely available lossless image compression library (with KOS additions) 8 | 9 | DEPENDENCIES = zlib 10 | 11 | # What files we need to download, and where from. 12 | DOWNLOAD_SITES = https://download.sourceforge.net/libpng 13 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 14 | 15 | TARGET = libpng.a 16 | INSTALLED_HDRS = png.h pngconf.h readpng.h kospng.h pnglibconf.h 17 | HDR_INSTDIR = png 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk kos_texture.c kos_img.c readpng.h kospng.h \ 21 | readpng.c writepng.c 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libpng/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (libpng-1.6.37.tar.gz) = daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4 2 | SIZE (libpng-1.6.37.tar.gz) = 1495748 3 | -------------------------------------------------------------------------------- /libpng/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libpng.a 2 | OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \ 3 | pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \ 4 | pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o \ 5 | kos_img.o kos_texture.o readpng.o writepng.o 6 | 7 | KOS_CFLAGS += -I. \ 8 | -I$(KOS_PORTS)/include/zlib \ 9 | -DPNG_NO_MNG_FEATURES \ 10 | -DPNG_NO_READ_sCAL -DPNG_NO_WRITE_sCAL \ 11 | -DPNG_NO_SETJMP_SUPPORTED \ 12 | -DPNG_NO_WRITE_tIME \ 13 | -DBUILD_LIBPNG 14 | 15 | defaultall: pnglibconf.h fix-pngh $(OBJS) subdirs linklib 16 | 17 | # Force the configuration file to be generated. 18 | pnglibconf.h: scripts/pnglibconf.h.prebuilt 19 | cp $< $@ 20 | 21 | fix-pngh: 22 | @echo "Patching png.h for compatibility with KOS..." 23 | @echo "/* Compatibility with previous KOS code... */" >> png.h 24 | @echo "#include \"kospng.h\"" >> png.h 25 | 26 | include ${KOS_PORTS}/scripts/lib.mk 27 | -------------------------------------------------------------------------------- /libpng/files/kos_img.c: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | kos_img.c 4 | (c)2002 Jeffrey McBeth, Megan Potter 5 | 6 | Based on Jeff's png_load_texture routine, but loads into a 7 | KOS plat-independent image. 8 | */ 9 | 10 | 11 | #include 12 | #include 13 | #include "png.h" 14 | #include "readpng.h" 15 | 16 | /* load an n x n texture from a png */ 17 | 18 | #define LOAD565(r, g, b) (((r>>3)<<11) | ((g>>2)<<5) | ((b>>3))) 19 | #define LOAD1555(r, g, b, a) (((a>>7)<<15)|((r>>3)<<10)|((g>>3)<<5)|((b>>3))) 20 | #define LOAD4444(r, g, b, a) (((a>>4)<<12)|((r>>4)<<8)|((g>>4)<<4)|((b>>4))) 21 | 22 | /* not to be used outside of here */ 23 | void _png_copy_texture(uint8 *buffer, uint16 *temp_tex, 24 | uint32 channels, uint32 stride, 25 | uint32 mask, uint32 w, uint32 h) 26 | { 27 | uint32 i,j; 28 | uint16 *ourbuffer; 29 | uint8 *pRow; 30 | 31 | for(i = 0; i < h; i++) 32 | { 33 | pRow = &buffer[i*stride]; 34 | ourbuffer = &temp_tex[i*w]; 35 | 36 | if (channels == 3) 37 | { 38 | if (mask == PNG_NO_ALPHA) 39 | for(j = 0; j < w; j++) 40 | ourbuffer[j] = LOAD565(pRow[j*3], pRow[j*3+1], pRow[j*3+2]); 41 | else if (mask == PNG_MASK_ALPHA) 42 | for(j = 0; j < w; j++) 43 | ourbuffer[j] = LOAD1555(pRow[j*3],pRow[j*3+1],pRow[j*3+2],255); 44 | else if (mask == PNG_FULL_ALPHA) 45 | for(j = 0; j < w; j++) 46 | ourbuffer[j] = LOAD4444(pRow[j*3],pRow[j*3+1],pRow[j*3+2],255); 47 | 48 | } 49 | else if (channels == 4) 50 | { 51 | if (mask == PNG_NO_ALPHA) 52 | { 53 | for(j = 0; j < w; j++) 54 | ourbuffer[j] = LOAD565(pRow[j*4], pRow[j*4+1], pRow[j*4+2]); 55 | } 56 | else if (mask == PNG_MASK_ALPHA) 57 | for(j = 0; j < w; j++) 58 | ourbuffer[j] = LOAD1555(pRow[j*4],pRow[j*4+1],pRow[j*4+2],pRow[j*4+3]); 59 | else if (mask == PNG_FULL_ALPHA) 60 | for(j = 0; j < w; j++) 61 | ourbuffer[j] = LOAD4444(pRow[j*4],pRow[j*4+1],pRow[j*4+2],pRow[j*4+3]); 62 | } 63 | } 64 | } 65 | 66 | int png_to_img(const char * filename, uint32 mask, kos_img_t * rv) { 67 | uint16 *temp_tex; 68 | 69 | /* More stuff */ 70 | uint8 *buffer; /* Output row buffer */ 71 | uint32 row_stride; /* physical row width in output buffer */ 72 | uint32 channels; /* 3 for RGB 4 for RGBA */ 73 | 74 | FILE *infile; /* source file */ 75 | 76 | void *strs; /* internal structs */ 77 | 78 | assert( rv != NULL ); 79 | 80 | if ((infile = fopen(filename, "r")) == 0) { 81 | dbglog(DBG_ERROR, "png_to_texture: can't open %s\n", filename); 82 | return -1; 83 | } 84 | 85 | /* Step 1: Initialize loader */ 86 | strs = readpng_init(infile); 87 | if (!strs) { 88 | fclose(infile); 89 | return -2; 90 | } 91 | 92 | /* Step 1.5: Create output kos_img_t */ 93 | /* rv = (kos_img_t *)malloc(sizeof(kos_img_t)); */ 94 | 95 | /* Step 2: Read file */ 96 | buffer = readpng_get_image(strs,&channels, &row_stride, &rv->w, &rv->h); 97 | temp_tex = (uint16 *)malloc(sizeof(uint16) * rv->w * rv->h); 98 | rv->data = (void *)temp_tex; 99 | rv->byte_count = rv->w * rv->h * 2; 100 | 101 | _png_copy_texture(buffer, temp_tex, 102 | channels, row_stride, 103 | mask, rv->w, rv->h); 104 | 105 | switch (mask) { 106 | case PNG_NO_ALPHA: 107 | rv->fmt = KOS_IMG_FMT(KOS_IMG_FMT_RGB565, 0); 108 | break; 109 | case PNG_MASK_ALPHA: 110 | rv->fmt = KOS_IMG_FMT(KOS_IMG_FMT_ARGB1555, 0); 111 | break; 112 | case PNG_FULL_ALPHA: 113 | rv->fmt = KOS_IMG_FMT(KOS_IMG_FMT_ARGB4444, 0); 114 | break; 115 | } 116 | 117 | /* Step 3: Finish decompression */ 118 | free(buffer); 119 | readpng_cleanup(strs); 120 | 121 | fclose(infile); 122 | 123 | /* And we're done! */ 124 | return 0; 125 | } 126 | 127 | -------------------------------------------------------------------------------- /libpng/files/kos_texture.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "png.h" 3 | #include "readpng.h" 4 | 5 | /* load an n x n texture from a png */ 6 | 7 | /* not to be used outside of here */ 8 | extern void _png_copy_texture(uint8 *buffer, uint16 *temp_tex, 9 | uint32 channels, uint32 stride, 10 | uint32 mask, uint32 w, uint32 h); 11 | 12 | int png_load_texture(const char * filename, pvr_ptr_t *tex, uint32 mask, uint32 *w, uint32 *h) 13 | { 14 | uint16 *temp_tex; 15 | 16 | /* More stuff */ 17 | uint8 *buffer; /* Output row buffer */ 18 | uint32 row_stride; /* physical row width in output buffer */ 19 | uint32 channels; /* 3 for RGB 4 for RGBA */ 20 | 21 | FILE *infile; /* source file */ 22 | 23 | void * strs; /* internal structs */ 24 | 25 | // readpng_version_info(); 26 | 27 | if ((infile = fopen(filename, "r")) == 0) { 28 | printf("png_to_texture: can't open %s\n", filename); 29 | return -1; 30 | } 31 | 32 | /* Step 1: Initialize loader */ 33 | 34 | strs = readpng_init(infile); 35 | if (!strs) 36 | { 37 | fclose(infile); 38 | return -1; 39 | } 40 | 41 | /* Step 2: Read file */ 42 | 43 | buffer = readpng_get_image(strs, &channels, &row_stride, w, h); 44 | temp_tex = (uint16 *)malloc(sizeof(uint16)*(*w)*(*h)); 45 | 46 | _png_copy_texture(buffer, temp_tex, 47 | channels, row_stride, 48 | mask, *w, *h); 49 | 50 | *tex = pvr_mem_malloc((*w)*(*h)*2); 51 | pvr_txr_load_ex(temp_tex, *tex, *w, *h, PVR_TXRLOAD_16BPP); 52 | 53 | /* Step 3: Finish decompression */ 54 | free(buffer); 55 | readpng_cleanup(strs); 56 | 57 | fclose(infile); 58 | free(temp_tex); 59 | /* And we're done! */ 60 | return 0; 61 | 62 | } 63 | 64 | int png_to_texture(const char * filename, pvr_ptr_t tex, uint32 mask) 65 | { 66 | uint16 *temp_tex; 67 | 68 | /* More stuff */ 69 | uint8 *buffer; /* Output row buffer */ 70 | uint32 row_stride; /* physical row width in output buffer */ 71 | uint32 channels; /* 3 for RGB 4 for RGBA */ 72 | uint32 w,h; 73 | 74 | FILE *infile; /* source file */ 75 | 76 | void * strs; /* internal structs */ 77 | 78 | // readpng_version_info(); 79 | 80 | if ((infile = fopen(filename, "r")) == 0) { 81 | printf("png_to_texture: can't open %s\n", filename); 82 | return -1; 83 | } 84 | 85 | /* Step 1: Initialize loader */ 86 | strs = readpng_init(infile); 87 | if (!strs) 88 | { 89 | fclose(infile); 90 | return -1; 91 | } 92 | 93 | /* Step 2: Read file */ 94 | 95 | buffer = readpng_get_image(strs, &channels, &row_stride,&w,&h); 96 | temp_tex = (uint16 *)malloc(sizeof(uint16)*w*h); 97 | 98 | _png_copy_texture(buffer, temp_tex, 99 | channels, row_stride, 100 | mask, w, h); 101 | 102 | pvr_txr_load_ex(temp_tex, tex, w, h, PVR_TXRLOAD_16BPP); 103 | 104 | /* Step 3: Finish decompression */ 105 | free(buffer); 106 | readpng_cleanup(strs); 107 | 108 | fclose(infile); 109 | 110 | free(temp_tex); 111 | /* And we're done! */ 112 | 113 | return 0; 114 | } 115 | -------------------------------------------------------------------------------- /libpng/files/kospng.h: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | png.h 4 | (c)2002 Jeffrey McBeth 5 | */ 6 | 7 | #ifndef __PNG_READPNG_H 8 | #define __PNG_READPNG_H 9 | 10 | #include 11 | __BEGIN_DECLS 12 | 13 | #include 14 | 15 | #define PNG_NO_ALPHA 0 16 | #define PNG_MASK_ALPHA 1 17 | #define PNG_FULL_ALPHA 2 18 | 19 | #ifdef _arch_dreamcast 20 | #include 21 | 22 | /* Load a PNG file, allocating a texture, and returning the size of the file */ 23 | int png_load_texture(const char *filename, pvr_ptr_t *tex, uint32 alpha, uint32 *w, uint32 *h); 24 | 25 | /* Load a PNG file into a texture; returns 0 for success, -1 for failure. */ 26 | int png_to_texture(const char * filename, pvr_ptr_t tex, uint32 alpha); 27 | #endif 28 | 29 | /* Load a PNG to a KOS Platform Independent Image */ 30 | int png_to_img(const char * filename, uint32 mask, kos_img_t *rv); 31 | 32 | #ifndef BUILD_LIBPNG 33 | /* libpng has its own private png_write_data function, so we had to rename the 34 | one from writepng.c. This makes it so existing code will still work. */ 35 | #define png_write_data png_write_file 36 | #endif 37 | 38 | /* Write out a PNG file */ 39 | int png_write_file(const char *filename, uint8 *data, uint32 width, uint32 height); 40 | 41 | __END_DECLS 42 | 43 | #endif /* __PNG_PNG_H */ 44 | -------------------------------------------------------------------------------- /libpng/files/readpng.c: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | readpng.c 4 | (c)2002 Jeffrey McBeth 5 | 6 | */ 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "png.h" /* libpng header; includes zlib.h */ 16 | #include "readpng.h" /* typedefs, common macros, public prototypes */ 17 | 18 | /* This struct will hold our PNG info during procesing */ 19 | typedef struct { 20 | png_structp png_ptr; 21 | png_infop info_ptr; 22 | } readpng_structs_t; 23 | 24 | void readpng_version_info(void) 25 | { 26 | fprintf(stderr, " Compiled with libpng %s; using libpng %s.\n", 27 | PNG_LIBPNG_VER_STRING, png_libpng_ver); 28 | fprintf(stderr, " Compiled with zlib %s; using zlib %s.\n", 29 | ZLIB_VERSION, zlib_version); 30 | } 31 | 32 | 33 | /* return value = 0 for success, 1 for bad sig, 2 for bad IHDR, 4 for no mem */ 34 | 35 | void * readpng_init(FILE *infile) 36 | { 37 | uint8 sig[8]; 38 | readpng_structs_t * strs = malloc(sizeof(readpng_structs_t)); 39 | memset(strs, 0, sizeof(readpng_structs_t)); 40 | 41 | /* first do a quick check that the file really is a PNG image; could 42 | * have used slightly more general png_sig_cmp() function instead */ 43 | 44 | fread(sig, 1, 8, infile); 45 | if (!png_check_sig(sig, 8)) { 46 | free(strs); 47 | return NULL; /* bad signature */ 48 | } 49 | 50 | /* could pass pointers to user-defined error handlers instead of NULLs: */ 51 | 52 | strs->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); 53 | if (!strs->png_ptr) { 54 | free(strs); 55 | return NULL; /* out of memory */ 56 | } 57 | 58 | strs->info_ptr = png_create_info_struct(strs->png_ptr); 59 | if (!strs->info_ptr) { 60 | png_destroy_read_struct(&strs->png_ptr, NULL, NULL); 61 | free(strs); 62 | return NULL; /* out of memory */ 63 | } 64 | 65 | png_init_io(strs->png_ptr, infile); 66 | png_set_sig_bytes(strs->png_ptr, 8); /* we already read the 8 signature bytes */ 67 | 68 | png_read_info(strs->png_ptr, strs->info_ptr); /* read all PNG info up to image data */ 69 | 70 | /* OK, that's all we need for now; return happy */ 71 | 72 | return (void *)strs; 73 | } 74 | 75 | uint8 *readpng_get_image(void * strsv, uint32 *pChannels, uint32 *pRowbytes, uint32 *pWidth, uint32 *pHeight) 76 | { 77 | readpng_structs_t * strs = (readpng_structs_t *)strsv; 78 | 79 | png_uint_32 width, height; 80 | int bit_depth, color_type; 81 | uint8 *image_data = NULL; 82 | png_uint_32 i, rowbytes; 83 | png_bytepp row_pointers = NULL; 84 | 85 | 86 | /* alternatively, could make separate calls to png_get_image_width(), 87 | * etc., but want bit_depth and color_type for later [don't care about 88 | * compression_type and filter_type => NULLs] */ 89 | 90 | png_get_IHDR(strs->png_ptr, strs->info_ptr, &width, &height, &bit_depth, &color_type, 91 | NULL, NULL, NULL); 92 | 93 | *pWidth = width; 94 | *pHeight = height; 95 | 96 | /* expand palette images to RGB, low-bit-depth grayscale images to 8 bits, 97 | * transparency chunks to full alpha channel; strip 16-bit-per-sample 98 | * images to 8 bits per sample; and convert grayscale to RGB[A] */ 99 | 100 | if (color_type == PNG_COLOR_TYPE_PALETTE) 101 | png_set_expand(strs->png_ptr); 102 | if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) 103 | png_set_expand(strs->png_ptr); 104 | if (png_get_valid(strs->png_ptr, strs->info_ptr, PNG_INFO_tRNS)) 105 | png_set_expand(strs->png_ptr); 106 | if (bit_depth == 16) 107 | png_set_strip_16(strs->png_ptr); 108 | if (color_type == PNG_COLOR_TYPE_GRAY || 109 | color_type == PNG_COLOR_TYPE_GRAY_ALPHA) 110 | png_set_gray_to_rgb(strs->png_ptr); 111 | 112 | /* all transformations have been registered; now update info_ptr data, 113 | * get rowbytes and channels, and allocate image memory */ 114 | 115 | png_read_update_info(strs->png_ptr, strs->info_ptr); 116 | 117 | *pRowbytes = rowbytes = png_get_rowbytes(strs->png_ptr, strs->info_ptr); 118 | *pChannels = (int)png_get_channels(strs->png_ptr, strs->info_ptr); 119 | 120 | if ((image_data = (uint8 *)malloc(rowbytes*height)) == NULL) { 121 | png_destroy_read_struct(&strs->png_ptr, &strs->info_ptr, NULL); 122 | return NULL; 123 | } 124 | if ((row_pointers = (png_bytepp)malloc(height*sizeof(png_bytep))) == NULL) { 125 | png_destroy_read_struct(&strs->png_ptr, &strs->info_ptr, NULL); 126 | free(image_data); 127 | image_data = NULL; 128 | return NULL; 129 | } 130 | 131 | Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", *pChannels, rowbytes, height)); 132 | 133 | 134 | /* set the individual row_pointers to point at the correct offsets */ 135 | 136 | for (i = 0; i < height; ++i) 137 | row_pointers[i] = image_data + i*rowbytes; 138 | 139 | /* now we can go ahead and just read the whole image */ 140 | 141 | png_read_image(strs->png_ptr, row_pointers); 142 | 143 | free(row_pointers); 144 | row_pointers = NULL; 145 | 146 | png_read_end(strs->png_ptr, NULL); 147 | 148 | return image_data; 149 | } 150 | 151 | 152 | void readpng_cleanup(void * strsv) 153 | { 154 | readpng_structs_t * strs = (readpng_structs_t *)strsv; 155 | 156 | png_destroy_read_struct(&strs->png_ptr, &strs->info_ptr, NULL); 157 | free(strs); 158 | } 159 | -------------------------------------------------------------------------------- /libpng/files/readpng.h: -------------------------------------------------------------------------------- 1 | #ifndef TRUE 2 | # define TRUE 1 3 | # define FALSE 0 4 | #endif 5 | 6 | #ifndef MAX 7 | # define MAX(a,b) ((a) > (b)? (a) : (b)) 8 | # define MIN(a,b) ((a) < (b)? (a) : (b)) 9 | #endif 10 | 11 | #ifdef DEBUG 12 | # define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);} 13 | #else 14 | # define Trace(x) ; 15 | #endif 16 | 17 | void readpng_version_info(void); 18 | 19 | void * readpng_init(FILE *infile); 20 | 21 | /* pNumChannels will be 3 for RGB images, and 4 for RGBA images 22 | * pRowBytes is the number of bytes necesary to hold one row 23 | * the data gets returned as a flat stream of bytes, each row 24 | * starts at a multiple of pRowBytes 25 | * The caller is responsible for freeing the memory 26 | */ 27 | uint8 *readpng_get_image(void * strs, uint32 *pNumChannels, 28 | uint32 *pRowBytes, uint32 *pWidth, uint32 *pHeight); 29 | 30 | void readpng_cleanup(void * strs); 31 | -------------------------------------------------------------------------------- /libpng/files/writepng.c: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | writepng.c 4 | (c)2002 Jeffrey McBeth 5 | 6 | */ 7 | 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "png.h" 14 | #include "zlib.h" 15 | 16 | /* 17 | * Writes png images, assumes RGB888 pixel data 18 | */ 19 | 20 | int png_write_file(const char *filename, uint8 *data, uint32 width, uint32 height) 21 | { 22 | FILE *fp; 23 | uint32_t i; 24 | 25 | fp = fopen(filename, "wb"); 26 | if (!fp) return -1; 27 | 28 | png_structp png_ptr = png_create_write_struct 29 | (PNG_LIBPNG_VER_STRING, (png_voidp)NULL, 30 | NULL, NULL); 31 | if (!png_ptr) 32 | return -1; 33 | 34 | png_infop info_ptr = png_create_info_struct(png_ptr); 35 | if (!info_ptr) 36 | { 37 | png_destroy_write_struct(&png_ptr,(png_infopp)NULL); 38 | return -1; 39 | } 40 | 41 | png_init_io(png_ptr, fp); 42 | 43 | png_set_filter(png_ptr, 0, PNG_FILTER_VALUE_NONE); 44 | png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); 45 | 46 | png_set_IHDR(png_ptr, info_ptr, width, height, 8, 47 | PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, 48 | PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); 49 | 50 | png_bytepp row_pointers = (png_bytepp)malloc(sizeof(png_bytep)*height); 51 | 52 | for(i = 0; i < height; i++) 53 | row_pointers[i] = &data[3*i*width]; 54 | 55 | png_set_rows(png_ptr, info_ptr, row_pointers); 56 | 57 | png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); 58 | 59 | png_destroy_write_struct(&png_ptr, &info_ptr); 60 | 61 | free(row_pointers); 62 | fclose(fp); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /libpng/pkg-descr: -------------------------------------------------------------------------------- 1 | libpng is the official reference library for the Portable Network Graphic image 2 | file format. It supports almost all of the features defined by the format and 3 | is extensible to support additional features as needed. 4 | 5 | The KOS port of this library includes a bit of additional functionality to 6 | directly read PNG images into textures or KOS platform-independent images. 7 | 8 | URL: http://libpng.org/pub/png/libpng.html 9 | -------------------------------------------------------------------------------- /libsmb2/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libsmb2 3 | PORTVERSION = 6.2 4 | 5 | MAINTAINER = Ronnie Sahlberg 6 | LICENSE = LGPLv2.1 7 | SHORT_DESC = SMB2/3 userspace client 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = cmake 11 | 12 | # Don't attempt to copy the target library, it will be in the inst dir already. 13 | NOCOPY_TARGET = 1 14 | 15 | # What files we need to download, and where from. 16 | GIT_REPOSITORY = https://github.com/sahlberg/libsmb2.git 17 | GIT_BRANCH = ${PORTNAME}-${PORTVERSION} 18 | TARGET = libsmb2.a 19 | EXAMPLES_DIR = examples 20 | 21 | # cmake setup work. 22 | CMAKE_ARGS = -DINSTALL_INC_DIR=${KOS_PORTS}/${PORTNAME}/inst/ \ 23 | -DCMAKE_INSTALL_PREFIX=${KOS_PORTS}/${PORTNAME}/inst/ 24 | MAKE_TARGET = all install 25 | 26 | include ${KOS_PORTS}/scripts/kos-ports.mk -------------------------------------------------------------------------------- /libsmb2/pkg-descr: -------------------------------------------------------------------------------- 1 | Libsmb2 is a userspace client library for accessing SMB2/SMB3 shares on a 2 | network. 3 | It is high performance and fully async. It supports both zero-copy 4 | for SMB READ/WRITE commands as well as compounded commands. 5 | 6 | URL: https://github.com/sahlberg/libsmb2 7 | -------------------------------------------------------------------------------- /libtga/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libtga 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = Library for decoding TGA images 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libtga \ 14 | https://github.com/KallistiOS/libtga.git 15 | 16 | TARGET = libtga.a 17 | INSTALLED_HDRS = include/tga.h 18 | HDR_INSTDIR = tga 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libtga/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libtga.a 2 | OBJS = tga.o tga_texture.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libtga/pkg-descr: -------------------------------------------------------------------------------- 1 | libtga is a small library for decoding TGA image files. This library is limited 2 | to supporting only uncompressed 32bpp RGBA images. 3 | -------------------------------------------------------------------------------- /libtremor/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libtremor 3 | PORTVERSION = 19480 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = 3-clause BSD (see COPYING in the source distribution) 7 | SHORT_DESC = Vorbis audio decoder library (integer version) 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://gitlab.xiph.org/xiph/tremor.git 14 | GIT_BRANCH = lowmem 15 | 16 | TARGET = libtremor.a 17 | INSTALLED_HDRS = ivorbiscodec.h ivorbisfile.h sndoggvorbis.h 18 | HDR_INSTDIR = vorbis 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk sndoggvorbis.h sndoggvorbis.c main.c \ 22 | sndvorbisfile.h 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /libtremor/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libtremor.a 2 | OBJS = mdct.o dsp.o info.o misc.o floor1.o floor0.o vorbisfile.o res012.o \ 3 | mapping0.o codebook.o framing.o bitwise.o floor_lookup.o main.o \ 4 | sndoggvorbis.o 5 | 6 | KOS_CFLAGS += -DPACKAGE="libvorbisidec" -DVERSION="1.3.0" \ 7 | -DHAVE_DLFCN_H=1 -I. -fsigned-char -D_REENTRANT -ffast-math 8 | 9 | include ${KOS_PORTS}/scripts/lib.mk 10 | -------------------------------------------------------------------------------- /libtremor/files/README: -------------------------------------------------------------------------------- 1 | This is Xiph.Org's "Tremor" library, ported to KOS. It is meant to be 2 | pretty much a drop-in replacement for liboggvorbisplay, but it is smaller, 3 | a bit more efficient, and uses no floating point. It is probably also 4 | a bit less buggy on KOS (and SH-4 GCC ;) since it's less complex. 5 | 6 | To use it, you should basically just link -ltremor instead of 7 | -loggvorbisplay. Everything else should basically work as-is. 8 | 9 | Megan Potter 10 | 11 | -------------------------------------------------------------------------------- /libtremor/files/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "sndoggvorbis.h" 3 | 4 | static kthread_t * thd = NULL; 5 | 6 | static void *sndserver_thread(void *blagh) { 7 | printf("sndserver: pid is %d\n", thd_get_current()->tid); 8 | sndoggvorbis_mainloop(); 9 | return NULL; 10 | } 11 | 12 | int sndoggvorbis_init() { 13 | if (thd) { 14 | printf("sndserver: already initialized!\n"); 15 | return -1; 16 | } 17 | 18 | if (snd_stream_init() < 0) 19 | return -1; 20 | 21 | printf("sndserver: initializing libtremor 1.0 [Tremor r19480 lowmem based]\n"); 22 | thd = thd_create(0, sndserver_thread, NULL); 23 | if (thd != NULL) { 24 | /* Wait until the oggvorbis decoder thread is ready */ 25 | sndoggvorbis_wait_start(); 26 | printf("sndserver: successfully created thread\n"); 27 | return 0; 28 | } else { 29 | printf("sndserver: error creating thread\n"); 30 | return -1; 31 | } 32 | } 33 | 34 | void sndoggvorbis_thd_quit(); 35 | 36 | void sndoggvorbis_shutdown() { 37 | if (!thd) { 38 | printf("sndserver: not initialized!\n"); 39 | return; 40 | } 41 | 42 | sndoggvorbis_thd_quit(); 43 | thd_join(thd, NULL); 44 | thd = NULL; 45 | 46 | printf("sndserver: exited successfully\n"); 47 | } 48 | -------------------------------------------------------------------------------- /libtremor/files/sndoggvorbis.h: -------------------------------------------------------------------------------- 1 | /* KallistiOS ##version## 2 | 3 | sndoggvorbis.h 4 | (c)2001 Thorsten Titze 5 | 6 | An Ogg/Vorbis player library using sndstream and the official Xiphophorus 7 | libogg and libvorbis libraries. 8 | */ 9 | 10 | #ifndef __SNDOGGVORBIS_H 11 | #define __SNDOGGVORBIS_H 12 | 13 | #include 14 | __BEGIN_DECLS 15 | 16 | #include 17 | 18 | int sndoggvorbis_init(void); 19 | int sndoggvorbis_start(const char *filename, int loop); 20 | int sndoggvorbis_start_fd(FILE *f, int loop); 21 | void sndoggvorbis_stop(void); 22 | void sndoggvorbis_shutdown(void); 23 | 24 | int sndoggvorbis_isplaying(void); 25 | 26 | void sndoggvorbis_volume(int vol); 27 | 28 | void sndoggvorbis_mainloop(void); 29 | void sndoggvorbis_wait_start(void); 30 | 31 | void sndoggvorbis_setbitrateinterval(int interval); 32 | long sndoggvorbis_getbitrate(void); 33 | long sndoggvorbis_getposition(void); 34 | 35 | char *sndoggvorbis_getcommentbyname(const char *commentfield); 36 | char *sndoggvorbis_getartist(void); 37 | char *sndoggvorbis_gettitle(void); 38 | char *sndoggvorbis_getgenre(void); 39 | 40 | /* Enable/disable queued waiting */ 41 | void sndoggvorbis_queue_enable(void); 42 | void sndoggvorbis_queue_disable(void); 43 | 44 | /* Wait for the song to be queued */ 45 | void sndoggvorbis_queue_wait(void); 46 | 47 | /* Queue the song to start if it's in QUEUED */ 48 | void sndoggvorbis_queue_go(void); 49 | 50 | __END_DECLS 51 | 52 | #endif /* __SNDOGGVORBIS_H */ 53 | -------------------------------------------------------------------------------- /libtremor/files/sndvorbisfile.h: -------------------------------------------------------------------------------- 1 | /* KallistiOS Ogg/Vorbis Decoder Library 2 | * for KOS ##version## 3 | * 4 | * sndvorbisfile.h 5 | * (c)2001/2002 Thorsten Titze 6 | * 7 | * Basic Ogg/Vorbis stream information and decoding routines used by 8 | * libsndoggvorbis. May also be used directly for playback without 9 | * threading. 10 | */ 11 | 12 | /* Typedefinition for File Information Following the Ogg-Vorbis Spec 13 | * 14 | * TITLE :Track name 15 | * VERSION :The version field may be used to differentiate multiple version of the 16 | * same track title in a single collection. (e.g. remix info) 17 | * ALBUM :The collection name to which this track belongs 18 | * TRACKNUMBER :The track number of this piece if part of a specific larger collection 19 | * or album 20 | * ARTIST :Track performer 21 | * ORGANIZATION :Name of the organization producing the track (i.e. the 'record label') 22 | * DESCRIPTION :A short text description of the contents 23 | * GENRE :A short text indication of music genre 24 | * DATE :Date the track was recorded 25 | * LOCATION :Location where track was recorded 26 | * COPYRIGHT :Copyright information 27 | * ISRC :ISRC number for the track; see {the ISRC intro page} for more information on 28 | * ISRC numbers. 29 | * 30 | * (Based on v-comment.html found in original OggVorbis packages) 31 | */ 32 | typedef struct 33 | { 34 | char *artist; 35 | char *title; 36 | char *version; 37 | char *album; 38 | char *tracknumber; 39 | char *organization; 40 | char *description; 41 | char *genre; 42 | char *date; 43 | char *location; 44 | char *copyright; 45 | char *isrc; 46 | 47 | const char *filename; 48 | 49 | long nominalbitrate; 50 | long actualbitrate; 51 | long actualposition; 52 | } VorbisFile_info_t; 53 | -------------------------------------------------------------------------------- /libtremor/pkg-descr: -------------------------------------------------------------------------------- 1 | Vorbis is a public-domain, patent-free, lossy audio compression format usually 2 | paired with the Ogg file format. libtremor is decoder library for the Vorbis 3 | audio format that exclusively uses integer arithmetic, providing a potentially 4 | more efficient library where floating-point operations are prohibitively 5 | expensive. 6 | 7 | This library is a mostly drop-in replacement for the liboggvorbisplay/libvorbis/ 8 | libogg stack. 9 | 10 | URL: http://www.vorbis.com/ 11 | -------------------------------------------------------------------------------- /libtsunami/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libtsunami 3 | PORTVERSION = 2.0.0 4 | 5 | MAINTAINER = Nobody 6 | LICENSE = KOS License 7 | SHORT_DESC = C++ "scene graph" wrapper around libparallax 8 | 9 | DEPENDENCIES = libparallax 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORIES = git://git.code.sf.net/p/cadcdev/libtsunami \ 13 | https://github.com/KallistiOS/libtsunami.git 14 | 15 | TARGET = libtsunami.a 16 | HDR_DIRECTORY = include 17 | HDR_INSTDIR = tsu 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /libtsunami/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libtsunami.a 2 | OBJS_MAIN := $(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) 3 | OBJS_DRW := $(patsubst %.cpp,%.o,$(wildcard src/drawables/*.cpp)) 4 | OBJS_ANIMS := $(patsubst %.cpp,%.o,$(wildcard src/anims/*.cpp)) 5 | OBJS_TRIGS := $(patsubst %.cpp,%.o,$(wildcard src/triggers/*.cpp)) 6 | OBJS := $(OBJS_MAIN) $(OBJS_DRW) $(OBJS_ANIMS) $(OBJS_TRIGS) 7 | 8 | # GCC versions prior to 11.0 have incomplete C++17 support and need 9 | # to be forced to use the GNU dialect for std::filesystem support 10 | KOS_CPPFLAGS += -Iinclude -std=gnu++17 11 | 12 | include ${KOS_PORTS}/scripts/lib.mk 13 | -------------------------------------------------------------------------------- /libtsunami/pkg-descr: -------------------------------------------------------------------------------- 1 | libtsunami is a C++ "scene graph" API, wrapped around libparallax. libtsunami 2 | was actually designed as a part of the game Feet of Fury and was pulled directly 3 | from its code (by its original authors) or designed around the same concepts 4 | used in that game for managing the display. 5 | 6 | libtsunami is an object-oriented C++ library that allows you to describe 7 | drawable objects, animations, and triggers. All of these classes are reference 8 | counted for ease of memory management. 9 | -------------------------------------------------------------------------------- /libvldmail/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libvldmail 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Donald Haase 6 | LICENSE = MIT-0 7 | SHORT_DESC = An e-mail address validation library. 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://github.com/dertuxmalwieder/libvldmail.git 14 | TARGET = libvldmail.a 15 | INSTALLED_HDRS = src/vldmail.h 16 | 17 | #Passing this causes the test to be built as a .elf in the build dir. 18 | #It doesn't quite match the current scheme we have for 'examples' 19 | CMAKE_ARGS = -DBUILD_THE_TEST=1 20 | 21 | include ${KOS_PORTS}/scripts/kos-ports.mk 22 | -------------------------------------------------------------------------------- /libvldmail/pkg-descr: -------------------------------------------------------------------------------- 1 | libvldmail is a simple library for validating email addresses as being 2 | valid based off various RFC standards. 3 | 4 | URL: https://github.com/dertuxmalwieder/libvldmail 5 | -------------------------------------------------------------------------------- /libvorbis/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libvorbis 3 | PORTVERSION = 1.3.6 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = 3-clause BSD (see COPYING in the source distribution) 7 | SHORT_DESC = Vorbis audio codec library (floating-point version) 8 | 9 | DEPENDENCIES = libogg 10 | 11 | # What files we need to download, and where from. 12 | DOWNLOAD_SITE = https://ftp.osuosl.org/pub/xiph/releases/vorbis 13 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 14 | 15 | TARGET = libvorbis.a 16 | INSTALLED_HDRS = include/vorbis/codec.h include/vorbis/vorbisenc.h \ 17 | include/vorbis/vorbisfile.h 18 | HDR_INSTDIR = vorbis 19 | 20 | # KOS Distributed extras (to be copied into the build tree) 21 | KOS_DISTFILES = KOSMakefile.mk 22 | 23 | include ${KOS_PORTS}/scripts/kos-ports.mk 24 | -------------------------------------------------------------------------------- /libvorbis/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (libvorbis-1.3.6.tar.gz) = 6ed40e0241089a42c48604dc00e362beee00036af2d8b3f46338031c9e0351cb 2 | SIZE (libvorbis-1.3.6.tar.gz) = 1634357 3 | -------------------------------------------------------------------------------- /libvorbis/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libvorbis.a 2 | OBJS = lib/mdct.o lib/smallft.o lib/block.o lib/envelope.o lib/window.o \ 3 | lib/lsp.o lib/lpc.o lib/analysis.o lib/synthesis.o lib/psy.o lib/info.o \ 4 | lib/floor1.o lib/floor0.o lib/res0.o lib/mapping0.o lib/registry.o \ 5 | lib/codebook.o lib/sharedbook.o lib/lookup.o lib/bitrate.o \ 6 | lib/vorbisfile.o 7 | 8 | KOS_CFLAGS += -Iinclude -fsigned-char -ffast-math 9 | 10 | include ${KOS_PORTS}/scripts/lib.mk 11 | -------------------------------------------------------------------------------- /libvorbis/pkg-descr: -------------------------------------------------------------------------------- 1 | Vorbis is a public-domain, patent-free, lossy audio compression format usually 2 | paired with the Ogg file format. libvorbis is the official encoder/decoder 3 | library for the Vorbis audio format. 4 | 5 | libvorbis is the full floating-point codec library for Vorbis and must be used 6 | with libogg. For KOS-specific support, please use these two libraries along with 7 | the liboggvorbisplay library. 8 | 9 | URL: http://www.vorbis.com/ 10 | -------------------------------------------------------------------------------- /libwav/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libwav 3 | PORTVERSION = 1.0.0 4 | 5 | MAINTAINER = Andy Barajas 6 | LICENSE = Public Domain 7 | SHORT_DESC = Library for decoding WAV file headers 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://github.com/Dreamcast-Projects/libwav.git 14 | 15 | TARGET = libwav.a 16 | INSTALLED_HDRS = sndwav.h 17 | HDR_INSTDIR = wav 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /libwav/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libwav.a 2 | OBJS = libwav.o sndwav.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /libwav/pkg-descr: -------------------------------------------------------------------------------- 1 | libwav is a tiny library for decoding WAV files. This library is limited 2 | to supporting only uncompressed PCM type wav files. 3 | -------------------------------------------------------------------------------- /libyaml/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libyaml 3 | PORTVERSION = 0.2.5 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = MIT (see License in the source distribution) 7 | SHORT_DESC = A C library for parsing and emitting YAML 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = autotools 11 | 12 | # Don't attempt to copy the target library, it will be in the inst dir already. 13 | NOCOPY_TARGET = 1 14 | 15 | # No external dependencies. 16 | DEPENDENCIES = 17 | 18 | # What files we need to download, and where from. 19 | DOWNLOAD_SITE = https://github.com/yaml/libyaml/releases/download/${PORTVERSION} 20 | DOWNLOAD_FILES = yaml-${PORTVERSION}.tar.gz 21 | 22 | TARGET = libyaml.a 23 | HDR_INSTDIR = yaml 24 | DISTFILE_DIR = yaml-${PORTVERSION} 25 | 26 | # Autotools setup work. 27 | CONFIGURE_ARGS = 28 | CONFIGURE_DEFS = RANLIB=${KOS_RANLIB} AR=${KOS_AR} 29 | MAKE_TARGET = all install 30 | 31 | # KOS Distributed extras (to be copied into the build tree) 32 | KOS_DISTFILES = 33 | 34 | include ${KOS_PORTS}/scripts/kos-ports.mk 35 | -------------------------------------------------------------------------------- /libyaml/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (yaml-0.2.5.tar.gz) = c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4 2 | SIZE (yaml-0.2.5.tar.gz) = 609454 3 | -------------------------------------------------------------------------------- /libyaml/pkg-descr: -------------------------------------------------------------------------------- 1 | LibYAML is a C library for parsing and emitting YAML. 2 | 3 | YAML is a human-readable data serialization format designed to replace older 4 | formats such as ini files. LibYAML implements full support for both parsing and 5 | emitting YAML 1.1 documents. 6 | 7 | URL: https://pyyaml.org/wiki/LibYAML 8 | -------------------------------------------------------------------------------- /libzip/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = libzip 3 | PORTVERSION = 1.0.1 4 | 5 | MAINTAINER = Damian Parrino 6 | LICENSE = 3-clause BSD license 7 | SHORT_DESC = libzip is a C library for reading, creating, and modifying zip archives. 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # This port requires zlib 13 | DEPENDENCIES = zlib 14 | 15 | # What files we need to download, and where from. 16 | DOWNLOAD_SITE = https://libzip.org/download 17 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 18 | 19 | TARGET = libzip.a 20 | 21 | # Set cmake options 22 | CMAKE_ARGS = -Wno-dev -DCMAKE_INSTALL_PREFIX=../../inst \ 23 | -DCMAKE_C_FLAGS="-I{$KOS_PORTS}/include/zlib" \ 24 | -DZLIB_INCLUDE_DIR="${KOS_PORTS}/include/zlib" \ 25 | -DCMAKE_POLICY_VERSION_MINIMUM=3.5 26 | 27 | MAKE_TARGET = zip 28 | 29 | # Adjust the source code 30 | PREBUILD = libzip_prebuild 31 | 32 | # Add a pre-install target to get the built library where we expect it. 33 | # Copy the header files manually 34 | PREINSTALL = libzip_preinstall 35 | 36 | include ${KOS_PORTS}/scripts/kos-ports.mk 37 | libzip_prebuild: 38 | cd "build/${PORTNAME}-${PORTVERSION}" && \ 39 | patch -p1 < ../../files/${PORTNAME}-${PORTVERSION}.patch || { exit 1; } 40 | 41 | libzip_preinstall: 42 | cp "build/${PORTNAME}-${PORTVERSION}/lib/libzip.a" "build/${PORTNAME}-${PORTVERSION}" 43 | mkdir -p inst/include 44 | cp "build/${PORTNAME}-${PORTVERSION}/lib/zip.h" inst/include 45 | cp "build/${PORTNAME}-${PORTVERSION}/zipconf.h" inst/include 46 | -------------------------------------------------------------------------------- /libzip/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (libzip-1.0.1.tar.gz) = 0cef914d8f5105ccac44484f61413daa08d7204758e77240a4d20ebf967f3d49 2 | SIZE (libzip-1.0.1.tar.gz) = 659452 3 | -------------------------------------------------------------------------------- /libzip/files/libzip-1.0.1.patch: -------------------------------------------------------------------------------- 1 | diff -Naur original/lib/zip_source_filep.c libzip-1.0.1/lib/zip_source_filep.c 2 | --- original/lib/zip_source_filep.c 2015-05-04 17:49:13 3 | +++ libzip-1.0.1/lib/zip_source_filep.c 2024-08-19 12:53:37 4 | @@ -183,14 +183,14 @@ 5 | } 6 | sprintf(temp, "%s.XXXXXX", ctx->fname); 7 | 8 | - mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); 9 | +// mask = umask(S_IXUSR | S_IRWXG | S_IRWXO); 10 | if ((tfd=mkstemp(temp)) == -1) { 11 | zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); 12 | - umask(mask); 13 | +// umask(mask); 14 | free(temp); 15 | return -1; 16 | } 17 | - umask(mask); 18 | +// umask(mask); 19 | 20 | if ((tfp=fdopen(tfd, "r+b")) == NULL) { 21 | zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); 22 | @@ -246,10 +246,10 @@ 23 | zip_error_set(&ctx->error, ZIP_ER_RENAME, errno); 24 | return -1; 25 | } 26 | - mask = umask(022); 27 | - umask(mask); 28 | +// mask = umask(022); 29 | +// umask(mask); 30 | /* not much we can do if chmod fails except make the whole commit fail */ 31 | - (void)chmod(ctx->fname, 0666&~mask); 32 | +// (void)chmod(ctx->fname, 0666&~mask); 33 | free(ctx->tmpname); 34 | ctx->tmpname = NULL; 35 | return 0; 36 | -------------------------------------------------------------------------------- /libzip/pkg-descr: -------------------------------------------------------------------------------- 1 | libzip is a cross-platform ZIP library developed since 2005 that runs on Linux, 2 | macOS, Windows, and other operating systems. It prioritizes API stability, data 3 | integrity, and efficiency while supporting modern ZIP features including Zip64 4 | for large archives, multiple compression algorithms (Deflate, bzip2, LZMA, 5 | zstd), and various encryption methods. The library can read from files or memory 6 | buffers, allows reverting changes, and uses a BSD license making it suitable for 7 | commercial use. 8 | 9 | URL: https://libzip.org/ 10 | -------------------------------------------------------------------------------- /lua/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = lua 3 | PORTVERSION = 5.4.8 4 | 5 | MAINTAINER = Falco Girgis (GyroVorbis) 6 | LICENSE = MIT 7 | SHORT_DESC = Lightweight, embeddable, extensible scripting language 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = http://www.lua.org/ftp 14 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 15 | 16 | TARGET = liblua.a 17 | INSTALLED_HDRS = src/lua.h src/luaconf.h src/lualib.h src/lauxlib.h \ 18 | src/lua.hpp 19 | HDR_INSTDIR = lua 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /lua/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (lua-5.4.8.tar.gz) = 4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae 2 | SIZE (lua-5.4.8.tar.gz) = 374332 3 | -------------------------------------------------------------------------------- /lua/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = liblua.a 2 | OBJS = src/lapi.o src/lauxlib.o src/lbaselib.o src/lcode.o \ 3 | src/lcorolib.o src/lctype.o src/ldblib.o src/ldebug.o \ 4 | src/ldo.o src/ldump.o src/lfunc.o src/lgc.o src/linit.o \ 5 | src/liolib.o src/llex.o src/lmathlib.o src/lmem.o \ 6 | src/loadlib.o src/lobject.o src/lopcodes.o src/loslib.o \ 7 | src/lparser.o src/lstate.o src/lstring.o src/lstrlib.o \ 8 | src/ltable.o src/ltablib.o src/ltm.o src/lundump.o \ 9 | src/lutf8lib.o src/lvm.o src/lzio.o 10 | 11 | defaultall: fixconf $(OBJS) subdirs linklib 12 | 13 | fixconf: 14 | sed -e 's/#define LUA_32BITS[[:space:]+]0/#define LUA_32BITS 1/' -ibak src/luaconf.h 15 | 16 | KOS_CFLAGS += -Isrc 17 | 18 | include ${KOS_PORTS}/scripts/lib.mk 19 | -------------------------------------------------------------------------------- /lua/pkg-descr: -------------------------------------------------------------------------------- 1 | Lua is a lightweight, extensible, embeddable scripting language. Lua is a 2 | dynamically typed language with automatic garbage collection, amongst other 3 | features one would normally expect a scripting language to have. 4 | 5 | URL: http://www.lua.org/ 6 | -------------------------------------------------------------------------------- /micropython/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = micropython 3 | PORTVERSION = 1.26.0 4 | 5 | MAINTAINER = Aaron Glazer 6 | LICENSE = MIT 7 | SHORT_DESC = A lean and efficient Python implementation 8 | 9 | DEPENDENCIES = 10 | 11 | # What files we need to download, and where from. 12 | GIT_REPOSITORY = https://github.com/micropython/micropython.git 13 | GIT_BRANCH = master 14 | GIT_TAG = v${PORTVERSION} 15 | 16 | TARGET = libmicropython.a 17 | HDR_DIRECTORY = micropython_embed 18 | INSTALLED_HDRS = mpconfigport.h 19 | HDR_INSTDIR = micropython 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk mpconfigport.h 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /micropython/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libmicropython.a 2 | 3 | MP_EMBED_DIR = $(CURDIR)/micropython_embed 4 | 5 | MP_PORT_DIR = $(MP_EMBED_DIR)/port 6 | MP_PY_DIR = $(MP_EMBED_DIR)/py 7 | MP_RT_DIR = $(MP_EMBED_DIR)/shared/runtime 8 | 9 | OBJS = $(MP_PORT_DIR)/embed_util.o \ 10 | $(MP_PORT_DIR)/mphalport.o \ 11 | $(MP_PY_DIR)/argcheck.o \ 12 | $(MP_PY_DIR)/asmbase.o \ 13 | $(MP_PY_DIR)/bc.o \ 14 | $(MP_PY_DIR)/binary.o \ 15 | $(MP_PY_DIR)/builtinevex.o \ 16 | $(MP_PY_DIR)/builtinhelp.o \ 17 | $(MP_PY_DIR)/builtinimport.o \ 18 | $(MP_PY_DIR)/compile.o \ 19 | $(MP_PY_DIR)/emitbc.o \ 20 | $(MP_PY_DIR)/emitcommon.o \ 21 | $(MP_PY_DIR)/emitglue.o \ 22 | $(MP_PY_DIR)/emitnative.o \ 23 | $(MP_PY_DIR)/formatfloat.o \ 24 | $(MP_PY_DIR)/frozenmod.o \ 25 | $(MP_PY_DIR)/gc.o \ 26 | $(MP_PY_DIR)/lexer.o \ 27 | $(MP_PY_DIR)/malloc.o \ 28 | $(MP_PY_DIR)/map.o \ 29 | $(MP_PY_DIR)/modarray.o \ 30 | $(MP_PY_DIR)/modbuiltins.o \ 31 | $(MP_PY_DIR)/modcmath.o \ 32 | $(MP_PY_DIR)/modcollections.o \ 33 | $(MP_PY_DIR)/moderrno.o \ 34 | $(MP_PY_DIR)/modgc.o \ 35 | $(MP_PY_DIR)/modio.o \ 36 | $(MP_PY_DIR)/modmath.o \ 37 | $(MP_PY_DIR)/modmicropython.o \ 38 | $(MP_PY_DIR)/modstruct.o \ 39 | $(MP_PY_DIR)/modsys.o \ 40 | $(MP_PY_DIR)/modthread.o \ 41 | $(MP_PY_DIR)/mpprint.o \ 42 | $(MP_PY_DIR)/mpstate.o \ 43 | $(MP_PY_DIR)/mpz.o \ 44 | $(MP_PY_DIR)/nativeglue.o \ 45 | $(MP_PY_DIR)/nlr.o \ 46 | $(MP_PY_DIR)/nlrsetjmp.o \ 47 | $(MP_PY_DIR)/objarray.o \ 48 | $(MP_PY_DIR)/objattrtuple.o \ 49 | $(MP_PY_DIR)/objbool.o \ 50 | $(MP_PY_DIR)/objboundmeth.o \ 51 | $(MP_PY_DIR)/obj.o \ 52 | $(MP_PY_DIR)/objcell.o \ 53 | $(MP_PY_DIR)/objclosure.o \ 54 | $(MP_PY_DIR)/objcomplex.o \ 55 | $(MP_PY_DIR)/objdeque.o \ 56 | $(MP_PY_DIR)/objdict.o \ 57 | $(MP_PY_DIR)/objenumerate.o \ 58 | $(MP_PY_DIR)/objexcept.o \ 59 | $(MP_PY_DIR)/objfilter.o \ 60 | $(MP_PY_DIR)/objfloat.o \ 61 | $(MP_PY_DIR)/objfun.o \ 62 | $(MP_PY_DIR)/objgenerator.o \ 63 | $(MP_PY_DIR)/objgetitemiter.o \ 64 | $(MP_PY_DIR)/objint.o \ 65 | $(MP_PY_DIR)/objint_longlong.o \ 66 | $(MP_PY_DIR)/objint_mpz.o \ 67 | $(MP_PY_DIR)/objlist.o \ 68 | $(MP_PY_DIR)/objmap.o \ 69 | $(MP_PY_DIR)/objmodule.o \ 70 | $(MP_PY_DIR)/objnamedtuple.o \ 71 | $(MP_PY_DIR)/objnone.o \ 72 | $(MP_PY_DIR)/objobject.o \ 73 | $(MP_PY_DIR)/objpolyiter.o \ 74 | $(MP_PY_DIR)/objproperty.o \ 75 | $(MP_PY_DIR)/objrange.o \ 76 | $(MP_PY_DIR)/objreversed.o \ 77 | $(MP_PY_DIR)/objset.o \ 78 | $(MP_PY_DIR)/objsingleton.o \ 79 | $(MP_PY_DIR)/objslice.o \ 80 | $(MP_PY_DIR)/objstr.o \ 81 | $(MP_PY_DIR)/objstringio.o \ 82 | $(MP_PY_DIR)/objstrunicode.o \ 83 | $(MP_PY_DIR)/objtuple.o \ 84 | $(MP_PY_DIR)/objtype.o \ 85 | $(MP_PY_DIR)/objzip.o \ 86 | $(MP_PY_DIR)/opmethods.o \ 87 | $(MP_PY_DIR)/pairheap.o \ 88 | $(MP_PY_DIR)/parse.o \ 89 | $(MP_PY_DIR)/parsenumbase.o \ 90 | $(MP_PY_DIR)/parsenum.o \ 91 | $(MP_PY_DIR)/persistentcode.o \ 92 | $(MP_PY_DIR)/profile.o \ 93 | $(MP_PY_DIR)/pystack.o \ 94 | $(MP_PY_DIR)/qstr.o \ 95 | $(MP_PY_DIR)/reader.o \ 96 | $(MP_PY_DIR)/repl.o \ 97 | $(MP_PY_DIR)/ringbuf.o \ 98 | $(MP_PY_DIR)/runtime.o \ 99 | $(MP_PY_DIR)/runtime_utils.o \ 100 | $(MP_PY_DIR)/scheduler.o \ 101 | $(MP_PY_DIR)/scope.o \ 102 | $(MP_PY_DIR)/sequence.o \ 103 | $(MP_PY_DIR)/showbc.o \ 104 | $(MP_PY_DIR)/smallint.o \ 105 | $(MP_PY_DIR)/stackctrl.o \ 106 | $(MP_PY_DIR)/stream.o \ 107 | $(MP_PY_DIR)/unicode.o \ 108 | $(MP_PY_DIR)/vm.o \ 109 | $(MP_PY_DIR)/vstr.o \ 110 | $(MP_PY_DIR)/warning.o \ 111 | $(MP_RT_DIR)/gchelper_generic.o 112 | 113 | CFLAGS += -DMICROPY_GCREGS_SETJMP -DNDEBUG 114 | CFLAGS += -I$(CURDIR) 115 | CFLAGS += -I$(MP_EMBED_DIR) 116 | CFLAGS += -I$(MP_PORT_DIR) 117 | 118 | # Windows specific 119 | ifeq ($(OS),Windows_NT) 120 | # On Windows, the "python3" binary can exist but sometime it could not be usable here 121 | # So we try if indeed, "python3" exists and returns something like "Python {version}". 122 | # If yes, then we will use "python3" indeed, if not, we will try to use "python". 123 | MP_PYTHON_CMD = python 124 | MP_PYTHON3_USABLE := $(shell $(SHELL) -c 'python3 --version || :' 2>&1) 125 | ifeq ($(shell echo $(MP_PYTHON3_USABLE) | cut -c-6),Python) 126 | MP_PYTHON_CMD = python3 127 | endif 128 | MP_EMBED_FLAGS = PYTHON=$(MP_PYTHON_CMD) 129 | 130 | # "sed" can display some useless warning related to "permission denied". 131 | # We will just hide this, as this is not relevant. 132 | SED_FLAGS = >/dev/null 2>&1 133 | endif 134 | 135 | defaultall: | generatemp $(OBJS) subdirs linklib fixincludes cleanupbeforeinstall 136 | 137 | # Generate MicroPython (with verbose option set to "no") 138 | generatemp: export MICROPYTHON_TOP = $(CURDIR) 139 | generatemp: 140 | $(MAKE) -f ports/embed/embed.mk V=0 $(MP_EMBED_FLAGS) 141 | 142 | # Alter header files and replace #include "{variable}" with #include 143 | # This will fixes some other headers as well. 144 | fixincludes: 145 | @echo "Updating includes before installation..." 146 | @for _file in $(MP_PORT_DIR)/*.h $(MP_PY_DIR)/*.h $(MP_RT_DIR)/*.h; do \ 147 | sed -ri -e 's/#include "([^[:space:]]+)"/#include /g' $$_file $(SED_FLAGS); \ 148 | done 149 | @sed -i -e 's///' mpconfigport.h $(SED_FLAGS) 150 | @sed -i -e 's///' $(MP_PY_DIR)/mpconfig.h $(SED_FLAGS) 151 | 152 | # Remove source files (*.c/*.o) before installing the MicroPython port 153 | cleanupbeforeinstall: 154 | @echo "Performing final clean-up before installation..." 155 | @for _file in $(MP_PORT_DIR)/*.c $(MP_PY_DIR)/*.c $(MP_RT_DIR)/*.c $(MP_PORT_DIR)/*.o $(MP_PY_DIR)/*.o $(MP_RT_DIR)/*.o; do \ 156 | rm $$_file; \ 157 | done 158 | 159 | include ${KOS_PORTS}/scripts/lib.mk 160 | -------------------------------------------------------------------------------- /micropython/files/mpconfigport.h: -------------------------------------------------------------------------------- 1 | /* This file is part of the MicroPython project, http://micropython.org/ 2 | * The MIT License (MIT) 3 | * Copyright (c) 2022-2023 Damien P. George 4 | */ 5 | 6 | // Include common MicroPython embed configuration. 7 | #include 8 | 9 | // Use the minimal starting configuration (disables all optional features). 10 | #define MICROPY_CONFIG_ROM_LEVEL (MICROPY_CONFIG_ROM_LEVEL_MINIMUM) 11 | 12 | // MicroPython configuration. 13 | #define MICROPY_ENABLE_COMPILER (1) 14 | #define MICROPY_ENABLE_GC (1) 15 | #define MICROPY_PY_GC (1) 16 | #define MICROPY_READER_POSIX (1) 17 | -------------------------------------------------------------------------------- /micropython/pkg-descr: -------------------------------------------------------------------------------- 1 | This is the MicroPython project, which aims to put an implementation of 2 | Python 3.x on microcontrollers and small embedded systems. This project is in 3 | Beta stage and is subject to changes of the code-base, including project-wide 4 | name changes and API changes. 5 | 6 | MicroPython implements the entire Python 3.4 syntax and some select features 7 | from later versions. 8 | 9 | MicroPython can execute scripts in textual source form (.py files) or from 10 | precompiled bytecode (.mpy files). 11 | 12 | URL: http://www.micropython.org/ 13 | -------------------------------------------------------------------------------- /mruby/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = mruby 3 | PORTVERSION = 3.3.0 4 | 5 | MAINTAINER = SiZiOUS 6 | LICENSE = MIT 7 | SHORT_DESC = Lightweight Ruby 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://github.com/mruby/mruby.git 14 | GIT_BRANCH = master 15 | GIT_TAG = ${PORTVERSION} 16 | 17 | TARGET = libmruby.a 18 | HDR_DIRECTORY = build/$(KOS_ARCH)/include 19 | HDR_INSTDIR = mruby 20 | 21 | # KOS Distributed extras (to be copied into the build tree) 22 | KOS_DISTFILES = KOSMakefile.mk 23 | 24 | include ${KOS_PORTS}/scripts/kos-ports.mk 25 | -------------------------------------------------------------------------------- /mruby/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libmruby.a 2 | 3 | # Definition of build directories 4 | MRUBY_BUILD_DIR = $(CURDIR)/build 5 | MRUBY_BUILD_KOS_ARCH_DIR = $(MRUBY_BUILD_DIR)/$(KOS_ARCH) 6 | 7 | # Definition of headers directory (as we will need to alter the relations) 8 | MRUBY_INCLUDE_DIR = $(MRUBY_BUILD_KOS_ARCH_DIR)/include 9 | MRUBY_INCLUDE_MRUBY_DIR = $(MRUBY_INCLUDE_DIR)/mruby 10 | MRUBY_INCLUDE_PRESYM_DIR = $(MRUBY_INCLUDE_MRUBY_DIR)/presym 11 | 12 | # Handling mruby compiler executable (mrbc) 13 | # This compiler is necessary to transpile Ruby sources into a C source file 14 | MRUBY_COMPILER = mrbc 15 | MRUBY_INSTALL_DIR = $(DC_TOOLS_BASE) 16 | 17 | # Check Rake availability and set the mruby build command 18 | # On DreamSDK based on MinGW-w64/MSYS2, the "command -v rake" instruction 19 | # doesn't work because the executable flag ("x") isn't properly set. So we're 20 | # testing the expected path directly ("/mingw64/bin/rake"). 21 | export RAKE_AVAILABLE := $(shell \ 22 | (command -v rake >/dev/null 2>&1 || [ -f /mingw64/bin/rake ]) && \ 23 | rake --version >/dev/null 2>&1 && \ 24 | echo "1" || echo "0") 25 | 26 | # Handling DreamSDK wrappers if needed; it will only happen in this environment 27 | DREAMSDK_USE_WRAPPERS := $(if $(filter DreamSDK,$(ENVIRONMENT_NAME)),RAKE_AVAILABLE=$(RAKE_AVAILABLE),) 28 | 29 | # Define mruby build command using rake availability 30 | # Use "make" (which call "rake" internally) or try to call "rake" if needed 31 | MRUBY_BUILD_CMD := $(shell \ 32 | if [ "$(RAKE_AVAILABLE)" = "1" ]; then \ 33 | echo "$(MAKE)"; \ 34 | else \ 35 | ruby_path=$$(command -v ruby); \ 36 | if [ -n "$$ruby_path" ] && [ -f "$$(dirname "$$ruby_path")/rake" ]; then \ 37 | echo "rake"; \ 38 | else \ 39 | echo "echo 'Error: rake not found in PATH' && exit 1"; \ 40 | fi; \ 41 | fi) 42 | 43 | # Windows specific 44 | ifeq ($(OS),Windows_NT) 45 | # On Windows, all executables got a file extension 46 | EXECUTABLEEXTENSION = .exe 47 | 48 | # "sed" can display some useless warning related to "permission denied". 49 | # We will just hide this, as this is not relevant. 50 | SED_FLAGS = >/dev/null 2>&1 51 | endif 52 | 53 | # mruby compiler executable (mrbc) (with extension if necessary) 54 | MRUBY_COMPILER_BIN = $(MRUBY_COMPILER)$(EXECUTABLEEXTENSION) 55 | 56 | defaultall: | prepare generatemruby fixincludes copylib installmrbc 57 | 58 | # Preparing the location where the mruby compiler executable (mrbc) will be installed 59 | prepare: 60 | @if [ ! -d "$(MRUBY_INSTALL_DIR)" ]; then \ 61 | if [ -f "$(MRUBY_INSTALL_DIR)" ]; then \ 62 | echo "Error: unable to create directory: \"$(MRUBY_INSTALL_DIR)\""; \ 63 | echo "A file exists at this location. Please move or delete this file."; \ 64 | exit 1; \ 65 | else \ 66 | mkdir -p "$(MRUBY_INSTALL_DIR)"; \ 67 | fi \ 68 | fi 69 | 70 | # Generate mruby 71 | generatemruby: 72 | @echo "Generating mruby..." 73 | $(MRUBY_BUILD_CMD) MRUBY_CONFIG=dreamcast_shelf $(DREAMSDK_USE_WRAPPERS) 74 | 75 | # Copy final library file into the root directory 76 | copylib: 77 | @cp $(MRUBY_BUILD_KOS_ARCH_DIR)/lib/$(TARGET) $(CURDIR) 78 | 79 | # Install mruby compiler executable (mrbc) 80 | installmrbc: 81 | @echo "Installing $(MRUBY_COMPILER) to $(MRUBY_INSTALL_DIR)..." 82 | @cp $(MRUBY_BUILD_DIR)/host/bin/$(MRUBY_COMPILER_BIN) $(MRUBY_INSTALL_DIR) 83 | @strip $(MRUBY_INSTALL_DIR)/$(MRUBY_COMPILER_BIN) 84 | 85 | # Alter header files and alter #include directives 86 | # #include "{variable}" => #include 87 | # #include "" => #include 88 | # #include "mrbconf.h" => #include (in "mruby.h") 89 | fixincludes: 90 | @echo "Updating includes before installation..." 91 | @for _file in $(MRUBY_INCLUDE_DIR)/*.h $(MRUBY_INCLUDE_MRUBY_DIR)/*.h $(MRUBY_INCLUDE_PRESYM_DIR)/*.h; do \ 92 | sed -ri -e 's/#include "([^[:space:]]+)"/#include /g;s/#include <(mruby[^[:space:]]+)>/#include /g' $$_file $(SED_FLAGS); \ 93 | done 94 | @for _file in $(MRUBY_INCLUDE_DIR)/*.h; do \ 95 | sed -i -e 's/#include /#include /g' $$_file $(SED_FLAGS); \ 96 | done 97 | @for _file in $(MRUBY_INCLUDE_DIR)/*.h $(MRUBY_INCLUDE_MRUBY_DIR)/*.h $(MRUBY_INCLUDE_PRESYM_DIR)/*.h; do \ 98 | sed -i -e 's/#include 6 | LICENSE = 3-clause BSD (see COPYING in the source distribution) 7 | SHORT_DESC = Opus audio codec library 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = autotools 11 | 12 | # No dependencies beyond the base system. 13 | DEPENDENCIES = 14 | 15 | # What files we need to download, and where from. 16 | DOWNLOAD_SITE = https://ftp.osuosl.org/pub/xiph/releases/opus 17 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 18 | 19 | TARGET = libopus.a 20 | INSTALLED_HDRS = include/opus.h include/opus_defines.h include/opus_types.h \ 21 | include/opus_custom.h include/opus_multistream.h 22 | HDR_INSTDIR = opus 23 | 24 | # Autotools setup work. 25 | CONFIGURE_ARGS = --enable-fixed-point --disable-extra-programs --disable-doc \ 26 | --prefix=$(KOS_PORTS)/opus/inst 27 | CONFIGURE_DEFS = 28 | MAKE_TARGET = libopus.la 29 | 30 | # KOS Distributed extras (to be copied into the build tree) 31 | KOS_DISTFILES = 32 | 33 | # Add a pre-install target to get the built library where we expect it. 34 | PREINSTALL = opus_preinstall 35 | 36 | include ${KOS_PORTS}/scripts/kos-ports.mk 37 | opus_preinstall: 38 | cp build/${PORTNAME}-${PORTVERSION}/.libs/${TARGET} build/${PORTNAME}-${PORTVERSION} 39 | -------------------------------------------------------------------------------- /opus/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (opus-1.3.1.tar.gz) = 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d 2 | SIZE (opus-1.3.1.tar.gz) = 1040054 3 | -------------------------------------------------------------------------------- /opus/pkg-descr: -------------------------------------------------------------------------------- 1 | Opus is a totally open, royalty-free, highly versatile audio codec. Opus is 2 | unmatched for interactive speech and music transmission over the Internet, but 3 | is also intended for storage and streaming applications. It is standardized by 4 | the Internet Engineering Task Force (IETF) as RFC 6716 which incorporated 5 | technology from Skype's SILK codec and Xiph.Org's CELT codec. 6 | 7 | This library is the full fixed-point codec library for Opus and must be used 8 | with libogg. For higher-level work, you will probably want the opusfile library 9 | as well. 10 | 11 | URL: http://www.opus-codec.org/ 12 | -------------------------------------------------------------------------------- /opusfile/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = opusfile 3 | PORTVERSION = 0.11 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = 3-clause BSD (see COPYING in the source distribution) 7 | SHORT_DESC = Opus audio codec library high-level file access library 8 | 9 | # This port uses the autotools scripts that are included with the distfiles. 10 | PORT_BUILD = autotools 11 | 12 | # This port requires opus and libogg 13 | DEPENDENCIES = opus libogg 14 | 15 | # What files we need to download, and where from. 16 | DOWNLOAD_SITE = https://ftp.osuosl.org/pub/xiph/releases/opus 17 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 18 | 19 | TARGET = libopusfile.a 20 | INSTALLED_HDRS = include/opusfile.h 21 | HDR_INSTDIR = opusfile 22 | 23 | # Autotools setup work. 24 | CONFIGURE_ARGS = --enable-fixed-point --disable-http --disable-doc \ 25 | --prefix=$(KOS_PORTS)/opusfile/inst 26 | CONFIGURE_DEFS = DEPS_CFLAGS="-I$(KOS_PORTS)/include -I$(KOS_PORTS)/include/opus" \ 27 | DEPS_LIBS="-lopus -logg" 28 | MAKE_TARGET = libopusfile.la 29 | 30 | # KOS Distributed extras (to be copied into the build tree) 31 | KOS_DISTFILES = 32 | 33 | # Add a pre-install target to get the built library where we expect it. 34 | PREINSTALL = opusfile_preinstall 35 | 36 | include ${KOS_PORTS}/scripts/kos-ports.mk 37 | opusfile_preinstall: 38 | cp build/${PORTNAME}-${PORTVERSION}/.libs/${TARGET} build/${PORTNAME}-${PORTVERSION} 39 | -------------------------------------------------------------------------------- /opusfile/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (opusfile-0.11.tar.gz) = 74ce9b6cf4da103133e7b5c95df810ceb7195471e1162ed57af415fabf5603bf 2 | SIZE (opusfile-0.11.tar.gz) = 467420 3 | -------------------------------------------------------------------------------- /opusfile/pkg-descr: -------------------------------------------------------------------------------- 1 | The opusfile library provides seeking, decode, and playback of Opus streams in 2 | the Ogg container (.opus files) including over http(s) on posix and windows 3 | systems. 4 | 5 | URL: http://www.opus-codec.org/ 6 | -------------------------------------------------------------------------------- /polarssl/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = polarssl 3 | PORTVERSION = 1.3.9 4 | 5 | MAINTAINER = Damian Parrino 6 | LICENSE = GPL2 7 | SHORT_DESC = A Secure Socket Layer library. 8 | 9 | # This port uses CMake. 10 | PORT_BUILD = cmake 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = https://src.fedoraproject.org/repo/pkgs/polarssl/polarssl-1.3.9-gpl.tgz/48af7d1f0d5de512cbd6dacf5407884c 14 | DOWNLOAD_FILES = polarssl-1.3.9-gpl.tgz 15 | 16 | TARGET = libpolarssl.a 17 | 18 | # Library headers 19 | HDR_DIRECTORY = include/polarssl 20 | 21 | # Set cmake build settings 22 | CMAKE_ARGS = -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=FALSE -DENABLE_PROGRAMS=FALSE -DCMAKE_POLICY_VERSION_MINIMUM=3.5 23 | 24 | # Minor adjustments before building the source code 25 | PREBUILD = polarssl_prebuild 26 | 27 | # Add a pre-install target to get the built library where we expect it. 28 | # This, copied from opus, might be solvable by 29 | # adding an equivalent to HDR_DIRECTORY for lib 30 | PREINSTALL = polarssl_preinstall 31 | 32 | include ${KOS_PORTS}/scripts/kos-ports.mk 33 | polarssl_prebuild: 34 | cd "build/${PORTNAME}-${PORTVERSION}" && \ 35 | patch -p1 < ../../files/${PORTNAME}-${PORTVERSION}.patch || { exit 1; } 36 | 37 | polarssl_preinstall: 38 | cp build/${PORTNAME}-${PORTVERSION}/library/${TARGET} build/${PORTNAME}-${PORTVERSION} 39 | -------------------------------------------------------------------------------- /polarssl/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (polarssl-1.3.9-gpl.tgz) = d3605afc28ed4b7d1d9e3142d72e42855e4a23c07c951bbb0299556b02d36755 2 | SIZE (polarssl-1.3.9-gpl.tgz) = 1741396 3 | -------------------------------------------------------------------------------- /polarssl/files/polarssl-1.3.9.patch: -------------------------------------------------------------------------------- 1 | diff -Naur original/CMakeLists.txt polarssl-1.3.9/CMakeLists.txt 2 | --- original/CMakeLists.txt 2014-10-20 08:59:19 3 | +++ polarssl-1.3.9/CMakeLists.txt 2024-08-19 09:09:52 4 | @@ -25,7 +25,7 @@ 5 | set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} 6 | CACHE STRING "Choose the type of build: None Debug Release Coverage ASan Check CheckFull" 7 | FORCE) 8 | - 9 | +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=incompatible-pointer-types") 10 | if(CMAKE_BUILD_TYPE STREQUAL "Coverage") 11 | if(CMAKE_COMPILER_IS_GNUCC) 12 | set(CMAKE_SHARED_LINKER_FLAGS "--coverage") 13 | diff -Naur original/library/net.c polarssl-1.3.9/library/net.c 14 | --- original/library/net.c 2014-10-20 08:59:19 15 | +++ polarssl-1.3.9/library/net.c 2024-08-19 09:11:58 16 | @@ -81,7 +81,7 @@ 17 | defined(__DragonFly__) 18 | #include 19 | #elif defined(__APPLE__) || defined(HAVE_MACHINE_ENDIAN_H) || \ 20 | - defined(EFIX64) || defined(EFI32) 21 | + defined(EFIX64) || defined(EFI32) || defined(_arch_dreamcast) 22 | #include 23 | #elif defined(sun) 24 | #include 25 | -------------------------------------------------------------------------------- /polarssl/pkg-descr: -------------------------------------------------------------------------------- 1 | mbed TLS is a cryptographic library designed to easily integrate SSL/TLS and 2 | cryptographic capabilities into embedded and other products with minimal code 3 | overhead. Originally developed as PolarSSL, it was acquired by ARM and rebranded 4 | as mbed TLS, making it part of ARM's official product suite. 5 | 6 | URL: https://www.trustedfirmware.org/projects/mbed-tls/ 7 | -------------------------------------------------------------------------------- /raylib4dc/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = raylib4dc 3 | PORTVERSION = 5.5.0 4 | 5 | MAINTAINER = Andress Barajas 6 | LICENSE = zlib License - http://opensource.org/licenses/Zlib 7 | SHORT_DESC = raylib is a simple and easy-to-use library to enjoy videogames programming. 8 | 9 | DEPENDENCIES = libGL 10 | NOCOPY_TARGET = 1 11 | 12 | # What files we need to download, and where from. 13 | GIT_REPOSITORY = https://github.com/raylib4Consoles/raylib 14 | GIT_BRANCH = raylib4Consoles 15 | 16 | TARGET = libraylib.a 17 | HDRS = raylib.h raymath.h rlgl.h 18 | HDR_INSTDIR = raylib 19 | DISTFILE_DIR = ${PORTNAME}-${PORTVERSION}/src 20 | 21 | KOS_MAKEFILE = Makefile 22 | 23 | PREINSTALL = raylib_preinstall 24 | 25 | include ${KOS_PORTS}/scripts/kos-ports.mk 26 | raylib_preinstall: 27 | @mkdir -p inst/lib inst/include 28 | @cp build/${DISTFILE_DIR}/${TARGET} inst/lib 29 | @for hdr in ${HDRS}; do \ 30 | cp build/${DISTFILE_DIR}/$$hdr inst/include; \ 31 | done 32 | -------------------------------------------------------------------------------- /raylib4dc/pkg-descr: -------------------------------------------------------------------------------- 1 | raylib is a simple and easy-to-use library to enjoy videogames programming. 2 | 3 | raylib is highly inspired by Borland BGI graphics lib and by XNA framework 4 | and it's especially well suited for prototyping, tooling, graphical 5 | applications, embedded systems and education. 6 | 7 | NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames 8 | programming; no fancy interface, no visual helpers, no debug button... just 9 | coding in the most pure spartan-programmers way. 10 | 11 | URL: https://www.raylib.com/ 12 | -------------------------------------------------------------------------------- /scripts/build.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/build.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | KOS_MAKEFILE ?= KOSMakefile.mk 8 | 9 | build-stamp: fetch validate-dist unpack copy-kos-files $(PREBUILD) 10 | ifeq ($(PORT_BUILD), autotools) 11 | @if [ -z "${DISTFILE_DIR}" ] ; then \ 12 | cd build/${PORTNAME}-${PORTVERSION} ; \ 13 | else \ 14 | cd build/${DISTFILE_DIR} ; \ 15 | fi ; \ 16 | CC=kos-cc ${CONFIGURE_DEFS} ./configure --prefix=${KOS_PORTS}/${PORTNAME}/inst --host=${AUTOTOOLS_HOST} ${CONFIGURE_ARGS} ; \ 17 | $(MAKE) ${MAKE_TARGET} ; 18 | else ifeq ($(PORT_BUILD), cmake) 19 | @if [ -z "${DISTFILE_DIR}" ] ; then \ 20 | cd build/${PORTNAME}-${PORTVERSION} ; \ 21 | else \ 22 | cd build/${DISTFILE_DIR} ; \ 23 | fi ; \ 24 | if [ -z "${CMAKE_OUTSOURCE}" ] ; then \ 25 | p=. ; \ 26 | else \ 27 | mkdir build ; cd build ; \ 28 | p=.. ; \ 29 | fi ; \ 30 | kos-cmake -DCMAKE_INSTALL_INCLUDEDIR=${KOS_PORTS}/${PORTNAME}/inst/include \ 31 | -DCMAKE_INSTALL_LIBDIR=${KOS_PORTS}/${PORTNAME}/inst/lib $$p ${CMAKE_ARGS} ; \ 32 | cmake --build . -t $(or ${MAKE_TARGET},all) ; 33 | else 34 | @if [ -z "${DISTFILE_DIR}" ] ; then \ 35 | $(MAKE) -C build/${PORTNAME}-${PORTVERSION} -f ${KOS_MAKEFILE} ${MAKE_TARGET} ; \ 36 | else \ 37 | $(MAKE) -C build/${DISTFILE_DIR} -f ${KOS_MAKEFILE} ${MAKE_TARGET} ; \ 38 | fi 39 | endif 40 | touch build-stamp 41 | 42 | install: setup-check version-check abi-check depends-check force-install 43 | 44 | force-install: build-stamp $(PREINSTALL) 45 | @if [ ! -d "inst" ] ; then \ 46 | mkdir inst ; \ 47 | fi 48 | 49 | @cd inst ; \ 50 | if [ ! -d "lib" ] ; then \ 51 | mkdir lib ; \ 52 | fi ; \ 53 | if [ ! -d "include" ] ; then \ 54 | mkdir include ; \ 55 | fi 56 | 57 | @echo "Installing..." 58 | @cd build ; \ 59 | if [ -z "${DISTFILE_DIR}" ] ; then \ 60 | cd ${PORTNAME}-${PORTVERSION} ; \ 61 | else \ 62 | cd ${DISTFILE_DIR} ; \ 63 | fi ; \ 64 | if [ -z "${NOCOPY_TARGET}" ] ; then \ 65 | cp ${TARGET} ../../inst/lib ; \ 66 | fi ; \ 67 | for _file in ${INSTALLED_HDRS}; do \ 68 | cp $$_file ../../inst/include ; \ 69 | done ; \ 70 | if [ -n "${HDR_DIRECTORY}" ] ; then \ 71 | cp -R ${HDR_DIRECTORY}/. ../../inst/include ; \ 72 | fi ; \ 73 | if [ -n "${EXAMPLES_DIR}" ] ; then \ 74 | cp -R ${EXAMPLES_DIR}/. ../../inst/examples ; \ 75 | fi 76 | 77 | @if [ -n "${HDR_COMDIR}" ] ; then \ 78 | mkdir -p ${KOS_PORTS}/include/${HDR_COMDIR} ; \ 79 | for _file in ${KOS_PORTS}/${PORTNAME}/inst/include/*; do \ 80 | rm -f ${KOS_PORTS}/include/${HDR_COMDIR}/`basename $$_file` ; \ 81 | ln -s $$_file ${KOS_PORTS}/include/${HDR_COMDIR} ; \ 82 | done ; \ 83 | elif [ -n "${HDR_INSTDIR}" ] ; then \ 84 | rm -f ${KOS_PORTS}/include/${HDR_INSTDIR} ; \ 85 | ln -s ${KOS_PORTS}/${PORTNAME}/inst/include ${KOS_PORTS}/include/${HDR_INSTDIR} ; \ 86 | elif [ -n "${HDR_FULLDIR}" ] ; then \ 87 | rm -f ${KOS_PORTS}/include/${HDR_FULLDIR} ; \ 88 | ln -s ${KOS_PORTS}/${PORTNAME}/inst/include/${HDR_FULLDIR} ${KOS_PORTS}/include/${HDR_FULLDIR} ; \ 89 | else \ 90 | rm -f ${KOS_PORTS}/include/${PORTNAME} ; \ 91 | ln -s ${KOS_PORTS}/${PORTNAME}/inst/include ${KOS_PORTS}/include/${PORTNAME} ; \ 92 | fi 93 | 94 | @rm -f ${KOS_PORTS}/lib/${TARGET} 95 | @ln -s ${KOS_PORTS}/${PORTNAME}/inst/lib/${TARGET} ${KOS_PORTS}/lib/${TARGET} 96 | 97 | @rm -f ${KOS_PORTS}/examples/${PORTNAME} 98 | 99 | @if [ -n "${EXAMPLES_DIR}" ] ; then \ 100 | ln -s ${KOS_PORTS}/${PORTNAME}/inst/examples ${KOS_PORTS}/examples/${PORTNAME} ; \ 101 | fi 102 | 103 | @echo "Marking ${PORTNAME} ${PORTVERSION} as installed." 104 | @echo "${PORTVERSION}" > "${KOS_PORTS}/lib/.kos-ports/${PORTNAME}" 105 | -------------------------------------------------------------------------------- /scripts/clean.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/clean.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | clean-dist: 8 | @echo "Cleaning up dist files ..." 9 | -@rm -rf dist 10 | 11 | clean-build: 12 | @echo "Cleaning up build directories ..." 13 | -@rm -rf build 14 | -@rm -f build-stamp 15 | 16 | clean: clean-build clean-dist 17 | -------------------------------------------------------------------------------- /scripts/depends.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/depends.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | DEPENDENCIES ?= 8 | 9 | depends-check: 10 | ifeq (${BUILD_DEPENDS},false) 11 | @for _dep in ${DEPENDENCIES}; do \ 12 | if [ ! -f "${KOS_PORTS}/lib/.kos-ports/$$_dep" ] ; then \ 13 | echo "${PORTNAME} requires $$_dep to be installed. Please install the $$_dep port." ; \ 14 | echo "Exiting." ; \ 15 | exit 1 ; \ 16 | fi ; \ 17 | done 18 | else ifeq (${BUILD_DEPENDS},true) 19 | @for _dep in ${DEPENDENCIES}; do \ 20 | if [ ! -f "${KOS_PORTS}/lib/.kos-ports/$$_dep" ] ; then \ 21 | echo "${PORTNAME} requires $$_dep to be installed. Building..." ; \ 22 | ${MAKE} -C "${KOS_PORTS}/$$_dep" install clean || exit 1 ; \ 23 | fi ; \ 24 | done 25 | @echo "Finished processing dependencies for ${PORTNAME}." 26 | else 27 | @echo "BUILD_DEPENDS is not set in config.mk. Please correct your configuration." 28 | exit 1 29 | endif 30 | -------------------------------------------------------------------------------- /scripts/download.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/download.mk 4 | # Copyright (C) 2015, 2023 Lawrence Sebald 5 | # 6 | 7 | fetch: 8 | @if [ ! -d "dist" ] ; then \ 9 | mkdir dist ; \ 10 | fi 11 | 12 | @cd dist ; \ 13 | for _file in ${DOWNLOAD_FILES}; do \ 14 | if [ ! -f "$$_file" ] ; then \ 15 | if [ -n "${DOWNLOAD_SITES}" ] ; then \ 16 | for _site in ${DOWNLOAD_SITES}; do \ 17 | echo "Fetching $$_file from $$_site ..." ; \ 18 | file="$$_site/$$_file" ; \ 19 | ${FETCH_CMD} $$file ; \ 20 | if [ "$$?" -eq 0 ] ; then \ 21 | break; \ 22 | fi ; \ 23 | done ; \ 24 | else \ 25 | echo "Fetching $$_file from ${DOWNLOAD_SITE} ..." ; \ 26 | file="${DOWNLOAD_SITE}/$$_file" ; \ 27 | ${FETCH_CMD} $$file ; \ 28 | fi ; \ 29 | fi ; \ 30 | done 31 | 32 | @if [ -z "${DOWNLOAD_FILES}" ] ; then \ 33 | cd dist ; \ 34 | if [ -n "${GIT_REPOSITORY}" ] ; then \ 35 | _repos="${GIT_REPOSITORY}" ; \ 36 | elif [ -n "${GIT_REPOSITORIES}" ] ; then \ 37 | _repos="${GIT_REPOSITORIES}" ; \ 38 | fi ; \ 39 | if [ -n "$$_repos" ] ; then \ 40 | if [ ! -d "${PORTNAME}-${PORTVERSION}" ] ; then \ 41 | for _repo in $$_repos; do \ 42 | echo "Fetching ${PORTNAME} from $$_repo ..." ; \ 43 | if [ -n "${GIT_TAG}" ] ; then \ 44 | git clone --filter=tree:0 $$_repo --branch ${GIT_TAG} --single-branch --depth 1 ${PORTNAME}-${PORTVERSION} ; \ 45 | if [ "$$?" -eq 0 ] ; then \ 46 | break; \ 47 | else \ 48 | rm -rf ${PORTNAME}-${PORTVERSION} ; \ 49 | fi ; \ 50 | elif [ -n "${GIT_BRANCH}" ] ; then \ 51 | git clone --filter=tree:0 $$_repo --branch ${GIT_BRANCH} --single-branch ${PORTNAME}-${PORTVERSION} ; \ 52 | if [ "$$?" -eq 0 ] ; then \ 53 | break; \ 54 | else \ 55 | rm -rf ${PORTNAME}-${PORTVERSION} ; \ 56 | fi ; \ 57 | else \ 58 | git clone --filter=tree:0 $$_repo ${PORTNAME}-${PORTVERSION} ; \ 59 | if [ "$$?" -eq 0 ] ; then \ 60 | break; \ 61 | else \ 62 | rm -rf ${PORTNAME}-${PORTVERSION} ; \ 63 | fi ; \ 64 | fi ; \ 65 | done ; \ 66 | if [ ! -d "${PORTNAME}-${PORTVERSION}" ] ; then \ 67 | echo "Failed to clone Git repository!" ; \ 68 | exit 127 ; \ 69 | fi ; \ 70 | elif [ -z "${GIT_TAG}" ] ; then \ 71 | echo "Updating ${PORTNAME} from Git ..." ; \ 72 | cd ${PORTNAME}-${PORTVERSION} ; \ 73 | git pull ; \ 74 | cd .. ; \ 75 | fi ; \ 76 | if [ -z "${GIT_TAG}" -a -n "${GIT_CHANGESET}" ] ; then \ 77 | echo "Resetting to changeset ${GIT_CHANGESET}" ; \ 78 | cd ${PORTNAME}-${PORTVERSION} ; \ 79 | git reset --hard ${GIT_CHANGESET} ; \ 80 | cd .. ; \ 81 | fi ; \ 82 | elif [ -n "${SVN_REPOSITORY}" ] ; then \ 83 | if [ ! -d "${PORTNAME}-${PORTVERSION}" ] ; then \ 84 | echo "Fetching ${PORTNAME} from ${SVN_REPOSITORY} ..." ; \ 85 | if [ -n "${SVN_REVISION}" ] ; then \ 86 | svn checkout ${SVN_REPOSITORY} -r ${SVN_REVISION} ${PORTNAME}-${PORTVERSION} ; \ 87 | else \ 88 | svn checkout ${SVN_REPOSITORY} ${PORTNAME}-${PORTVERSION} ; \ 89 | fi ; \ 90 | else \ 91 | echo "Updating ${PORTNAME} from ${SVN_REPOSITORY} ..." ; \ 92 | cd ${PORTNAME}-${PORTVERSION} ; \ 93 | if [ -n "${SVN_REVISION}" ] ; then \ 94 | svn update -r "${SVN_REVISION}" ; \ 95 | else \ 96 | svn update ; \ 97 | fi ; \ 98 | fi ; \ 99 | fi ; \ 100 | fi 101 | -------------------------------------------------------------------------------- /scripts/kos-ports.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/kos-ports.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | # Grand central station for all the various sub-Makefiles. 8 | 9 | all: 10 | @echo "Please build your port with 'make install clean'." 11 | 12 | include ${KOS_PORTS}/config.mk 13 | 14 | include ${KOS_PORTS}/scripts/setup.mk 15 | include ${KOS_PORTS}/scripts/download.mk 16 | include ${KOS_PORTS}/scripts/unpack.mk 17 | include ${KOS_PORTS}/scripts/clean.mk 18 | include ${KOS_PORTS}/scripts/build.mk 19 | include ${KOS_PORTS}/scripts/version.mk 20 | include ${KOS_PORTS}/scripts/precision.mk 21 | include ${KOS_PORTS}/scripts/depends.mk 22 | include ${KOS_PORTS}/scripts/uninstall.mk 23 | include ${KOS_PORTS}/scripts/portinfo.mk 24 | include ${KOS_PORTS}/scripts/validate.mk 25 | -------------------------------------------------------------------------------- /scripts/lib.mk: -------------------------------------------------------------------------------- 1 | # KallistiOS ##version## 2 | # 3 | # Addons Makefile.prefab 4 | # Copyright (C) 2003 Megan Potter 5 | # 6 | 7 | # KallistiOS addons Makefile include 8 | # 9 | # Define "TARGET", "SUBDIRS" and "OBJS", and then include this file; 10 | # it will handle a lot of your build process. Everything in "OBJS" is 11 | # built by the compiler. If you build everything in subdirs and want to 12 | # just link at the end with this makefile, then define LIB_OBJS as 13 | # something like build/*.o. You'll also want to define LOCAL_CLEAN to 14 | # clean your build dir. 15 | 16 | defaultall: $(OBJS) subdirs linklib 17 | 18 | linklib: 19 | rm -f ${TARGET} 20 | ${KOS_AR} rcs ${TARGET} $(OBJS) $(LIB_OBJS) 21 | 22 | clean: 23 | -rm -f $(OBJS) $(LIB_OBJS) $(TARGET) 24 | 25 | include ${KOS_BASE}/Makefile.rules 26 | -------------------------------------------------------------------------------- /scripts/portinfo.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/portinfo.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | MAINTAINER ?= 8 | LICENSE ?= 9 | SHORT_DESC ?= 10 | 11 | portinfo: 12 | @echo "$(PORTNAME) $(PORTVERSION)" 13 | ifdef SHORT_DESC 14 | @echo "$(SHORT_DESC)" 15 | endif 16 | @echo "---------------------------------------------------" 17 | ifdef MAINTAINER 18 | @echo "KOS Port maintainer: $(MAINTAINER)" 19 | endif 20 | ifdef LICENSE 21 | @echo "License: $(LICENSE)" 22 | else 23 | @echo "License: Unknown" 24 | endif 25 | @if [ -f "pkg-descr" ] ; then \ 26 | echo "" ; \ 27 | cat pkg-descr ; \ 28 | fi 29 | -------------------------------------------------------------------------------- /scripts/precision.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/precision.mk 4 | # Copyright (C) 2024 Eric Fradella 5 | # 6 | 7 | REQUIRES_ABI ?= any 8 | 9 | abi-check: 10 | ifeq (${CHECK_PRECISION},true) 11 | ifeq (${REQUIRES_ABI},any) 12 | @echo "${PORTNAME} is compatible with any floating-point ABI." 13 | else 14 | @case " $(REQUIRES_ABI) " in *" $(KOS_SH4_PRECISION) "*) \ 15 | echo "${PORTNAME} is compatible with the ${KOS_SH4_PRECISION} floating-point ABI."; \ 16 | ;; \ 17 | *) \ 18 | echo "${PORTNAME} is not compatible with the ${KOS_SH4_PRECISION} floating-point ABI!"; \ 19 | echo "Change the KOS_SH4_PRECISION setting in your environ.sh to one of the following: ${REQUIRES_ABI}"; \ 20 | echo "Then rebuild KOS and try again."; \ 21 | exit 1; \ 22 | ;; \ 23 | esac 24 | endif 25 | else ifeq (${CHECK_PRECISION},false) 26 | @echo "CHECK_PRECISION is disabled in config.mk. Skipping ABI compatibility check." 27 | else 28 | @echo "CHECK_PRECISION is not set in config.mk. Please correct your configuration." 29 | exit 1 30 | endif 31 | -------------------------------------------------------------------------------- /scripts/setup.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/setup.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | setup-check: 8 | @cd ${KOS_PORTS} ; \ 9 | if [ ! -d "lib" ] ; then \ 10 | mkdir lib ; \ 11 | fi ; \ 12 | if [ ! -d "lib/.kos-ports" ] ; then \ 13 | mkdir lib/.kos-ports ; \ 14 | echo "Do not modify any of the files in this directory." >> lib/.kos-ports/README ; \ 15 | echo "" >> lib/.kos-ports/README ; \ 16 | echo "All files in this directory are for record-keeping purposes and maintain the" >> lib/.kos-ports/README ; \ 17 | echo "state of the ports collection. Modifying or deleting files in this directory" >> lib/.kos-ports/README ; \ 18 | echo "will probably break the entire ports collection, so don't do it." >> lib/.kos-ports/README ;\ 19 | fi ; \ 20 | if [ ! -d "include" ] ; then \ 21 | mkdir include ; \ 22 | fi ; \ 23 | if [ ! -d "examples" ] ; then \ 24 | mkdir examples ; \ 25 | fi || exit 1 26 | -------------------------------------------------------------------------------- /scripts/uninstall.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/uninstall.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | uninstall: 8 | @if [ -f ${KOS_PORTS}/lib/.kos-ports/${PORTNAME} ] ; then \ 9 | echo "Uninstalling ${PORTNAME}..." ; \ 10 | rm -f ${KOS_PORTS}/lib/.kos-ports/${PORTNAME} ; \ 11 | rm -f ${KOS_PORTS}/lib/${TARGET} ; \ 12 | if [ -n "${HDR_COMDIR}" ] ; then \ 13 | for _file in ${KOS_PORTS}/${PORTNAME}/inst/include/*; do \ 14 | rm -f ${KOS_PORTS}/include/${HDR_COMDIR}/`basename $$_file` ; \ 15 | done ; \ 16 | if [ -z "$$(ls -A ${KOS_PORTS}/include/${HDR_COMDIR})" ] ; then \ 17 | rm -rf ${KOS_PORTS}/include/${HDR_COMDIR} ; \ 18 | fi ; \ 19 | elif [ -n "${HDR_INSTDIR}" ] ; then \ 20 | rm -f ${KOS_PORTS}/include/${HDR_INSTDIR} ; \ 21 | elif [ -n "${HDR_FULLDIR}" ] ; then \ 22 | rm -f ${KOS_PORTS}/include/${HDR_FULLDIR} ; \ 23 | else \ 24 | rm -f ${KOS_PORTS}/include/${PORTNAME} ; \ 25 | fi ; \ 26 | rm -fr inst ; \ 27 | echo "Uninstalled ${PORTNAME}." ; \ 28 | echo "WARNING: Dependency checking not done, any dependent ports will be broken." ; \ 29 | else \ 30 | echo "${PORTNAME} does not appear to be installed." ; \ 31 | exit 1 ; \ 32 | fi 33 | -------------------------------------------------------------------------------- /scripts/unpack.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/unpack.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | unpack: fetch 8 | @if [ -d "build" ] ; then \ 9 | rm -rf build ; \ 10 | fi 11 | 12 | @mkdir build 13 | 14 | @if [ -n "${DOWNLOAD_FILES}" ]; then \ 15 | cd build ; \ 16 | for _file in "${DOWNLOAD_FILES}"; do \ 17 | echo "Unpacking $$_file ..." ; \ 18 | ${UNPACK_CMD} "../dist/$$_file" ; \ 19 | done ; \ 20 | else \ 21 | cd build ; \ 22 | echo "Copying SCM checkout of ${PORTNAME} ..." ; \ 23 | cp -r ../dist/${PORTNAME}-${PORTVERSION} . ; \ 24 | fi 25 | 26 | copy-kos-files: 27 | @echo "Copying KOS files..." 28 | @cd build ; \ 29 | if [ -z "${DISTFILE_DIR}" ] ; then \ 30 | cd ${PORTNAME}-${PORTVERSION} ; \ 31 | else \ 32 | cd ${DISTFILE_DIR} ; \ 33 | fi ; \ 34 | for _file in ${KOS_DISTFILES}; do \ 35 | cp "../../files/$$_file" . ; \ 36 | done 37 | -------------------------------------------------------------------------------- /scripts/validate.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/validate.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | validate-dist: 8 | ifeq (${VALIDATE_DISTFILES},true) 9 | @[ "${PYTHON_CMD}" ] || ( echo "PYTHON_CMD is not set in config.mk"; exit 1 ) 10 | @if [ -f "distinfo" ] ; then \ 11 | ${PYTHON_CMD} ${KOS_PORTS}/scripts/validate_dist.py || exit 1 ; \ 12 | fi 13 | endif 14 | -------------------------------------------------------------------------------- /scripts/validate_dist.py: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/validate_dist.py 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | import sys 8 | import os 9 | import hashlib 10 | 11 | def calc_sha256(fn): 12 | h = hashlib.sha256() 13 | with open('dist/' + fn, 'rb') as f: 14 | buf = f.read(1024*1024) 15 | while len(buf) > 0: 16 | h.update(buf) 17 | buf = f.read(1024*1024) 18 | return h.hexdigest() 19 | return None 20 | 21 | def file_size(fn): 22 | try: 23 | return os.path.getsize('dist/' + fn) 24 | except: 25 | return None 26 | 27 | # Script entry point. 28 | with open('distinfo', 'r') as f: 29 | lines = f.readlines() 30 | for l1, l2 in zip(lines[::2], lines[1::2]): 31 | # Remove newlines and any trailing whitespace... 32 | l1.rstrip() 33 | l2.rstrip() 34 | 35 | # Split each string into tokens and validate that they look sane. 36 | l1t = l1.split() 37 | l2t = l2.split() 38 | 39 | if l1t[0] != 'SHA256' or l1t[2] != '=' or l2t[0] != 'SIZE' or l2t[2] != '=' or l1t[1] != l2t[1]: 40 | sys.exit('Invalid distinfo') 41 | if not l1t[1].startswith('(') or not l1t[1].endswith(')'): 42 | sys.exit('Invalid distinfo') 43 | 44 | fn = l1t[1].lstrip('(').rstrip(')') 45 | 46 | # Validate that everything matches the distinfo for this file. 47 | size = file_size(fn) 48 | 49 | if size == None: 50 | sys.exit('File not found: %s' % (fn,)) 51 | 52 | if size != int(l2t[3]): 53 | sys.exit('File "%s" is incorrect size (expected %d)' % (fn, int(l2t[3]))) 54 | 55 | sha = calc_sha256(fn) 56 | 57 | if sha == None: 58 | sys.exit('File not found: %s' % (fn, )) 59 | 60 | if sha != l1t[3]: 61 | sys.exit('File "%s" is corrupt!' % (fn, )) 62 | 63 | print('File "%s" is ok.' % (fn, )) 64 | sys.exit(0) 65 | -------------------------------------------------------------------------------- /scripts/vercmp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (C) 2010 Dennis Willamson 3 | # License: CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/) 4 | # Obtained from: 5 | # http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format 6 | 7 | # The only modifications made were to remove the test code and to add the bit at 8 | # the bottom to return back to the calling shell 9 | # Returns 0 if the version numbers are identical, 1 if the first is greater than 10 | # the second, 2 if the second is greater than the first. 11 | vercomp () { 12 | if [[ $1 == $2 ]] 13 | then 14 | return 0 15 | fi 16 | local IFS=. 17 | local i ver1=($1) ver2=($2) 18 | # fill empty fields in ver1 with zeros 19 | for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) 20 | do 21 | ver1[i]=0 22 | done 23 | for ((i=0; i<${#ver1[@]}; i++)) 24 | do 25 | if [[ -z ${ver2[i]} ]] 26 | then 27 | # fill empty fields in ver2 with zeros 28 | ver2[i]=0 29 | fi 30 | if ((10#${ver1[i]} > 10#${ver2[i]})) 31 | then 32 | return 1 33 | fi 34 | if ((10#${ver1[i]} < 10#${ver2[i]})) 35 | then 36 | return 2 37 | fi 38 | done 39 | return 0 40 | } 41 | 42 | vercomp $1 $2 43 | exit $? 44 | -------------------------------------------------------------------------------- /scripts/version.mk: -------------------------------------------------------------------------------- 1 | # kos-ports ##version## 2 | # 3 | # scripts/version.mk 4 | # Copyright (C) 2015 Lawrence Sebald 5 | # 6 | 7 | version-check: 8 | @if [ -f ${KOS_PORTS}/lib/.kos-ports/${PORTNAME} ] ; then \ 9 | a=`cat ${KOS_PORTS}/lib/.kos-ports/${PORTNAME}` ; \ 10 | ${KOS_PORTS}/scripts/vercmp.sh $$a ${PORTVERSION} ; \ 11 | res=$$? ; \ 12 | if [ "$$res" -eq "0" ] ; then \ 13 | echo "${PORTNAME} is already installed and is latest version. Exiting." ; \ 14 | exit 1 ; \ 15 | elif [ "$$res" -eq "1" ] ; then \ 16 | echo "${PORTNAME} is already installed and is newer than latest version!" ; \ 17 | echo "Ports collection out of sync. Please update! Exiting." ; \ 18 | exit 255 ; \ 19 | else \ 20 | echo "${PORTNAME} $$a installed. Update to ${PORTVERSION}." ; \ 21 | fi ; \ 22 | else \ 23 | echo "${PORTNAME} is not currently installed." ; \ 24 | fi 25 | -------------------------------------------------------------------------------- /stb_image/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = stb_image 3 | PORTVERSION = 2.29 4 | 5 | MAINTAINER = Jason Rost (OniEnzeru) 6 | LICENSE = Public Domain 7 | SHORT_DESC = Single header library for image loading supporting many common formats. 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = https://raw.githubusercontent.com/nothings/stb/master/ 14 | # Format KOS-PORTS wants to work with 15 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 16 | # Actual downloaded file into dist ( we will package and tar this for compat ) 17 | DOWNLOAD_FILESB = stb_image.h 18 | 19 | TARGET = libstb_image.a 20 | INSTALLED_HDRS = stb_image.h 21 | HDR_INSTDIR = stb_image 22 | 23 | # KOS Distributed extras (to be copied into the build tree) 24 | KOS_DISTFILES = KOSMakefile.mk stb_image.cpp 25 | 26 | include ${KOS_PORTS}/scripts/kos-ports.mk 27 | 28 | fetch: 29 | @if [ ! -d "dist" ]; then \ 30 | mkdir dist ; \ 31 | fi 32 | 33 | @cd dist ; \ 34 | for _file in ${DOWNLOAD_FILESB}; do \ 35 | if [ ! -f "$$_file" ] ; then \ 36 | echo "fetchB"; \ 37 | echo "Fetching $$_file from ${DOWNLOAD_SITE} ..." ; \ 38 | file="${DOWNLOAD_SITE}/$$_file" ; \ 39 | ${FETCH_CMD} $$file ; \ 40 | fi ; \ 41 | mkdir -p ${PORTNAME}-${PORTVERSION}; \ 42 | mv ${DOWNLOAD_FILESB} ${PORTNAME}-${PORTVERSION}/ ; \ 43 | tar -czvf ${PORTNAME}-${PORTVERSION}.tar.gz ${PORTNAME}-${PORTVERSION} ; \ 44 | done 45 | # Create proper directory structure for the .tar.gz and move header inside 46 | # Tar the downloaded file so that KOS flags know what to do with the single header 47 | -------------------------------------------------------------------------------- /stb_image/distinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KallistiOS/kos-ports/57fb1f4b332e1d2af4b8becaa0aa994602b3f72d/stb_image/distinfo -------------------------------------------------------------------------------- /stb_image/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libstb_image.a 2 | OBJS = stb_image.o 3 | KOS_CFLAGS += -Iinclude 4 | 5 | include ${KOS_PORTS}/scripts/lib.mk 6 | -------------------------------------------------------------------------------- /stb_image/files/stb_image.cpp: -------------------------------------------------------------------------------- 1 | // Required to initialize STB_IMAGE 2 | #define STB_IMAGE_IMPLEMENTATION 3 | #include "stb_image.h" -------------------------------------------------------------------------------- /stb_image/pkg-descr: -------------------------------------------------------------------------------- 1 | Primarily of interest to game developers and other people who can avoid problematic images and only need the trivial interface. 2 | 3 | Supports: 4 | JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib) 5 | PNG 1/2/4/8/16-bit-per-channel 6 | 7 | TGA (not sure what subset, if a subset) 8 | BMP non-1bpp, non-RLE 9 | PSD (composited view only, no extra channels, 8/16 bit-per-channel) 10 | 11 | GIF (*comp always reports as 4-channel) 12 | HDR (radiance rgbE format) 13 | PIC (Softimage PIC) 14 | PNM (PPM and PGM binary only) 15 | 16 | Animated GIF still needs a proper API, but here's one way to do it: 17 | http://gist.github.com/urraka/685d9a6340b26b830d49 18 | 19 | - decode from memory or through FILE (define STBI_NO_STDIO to remove code) 20 | - decode from arbitrary I/O callbacks 21 | - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON) 22 | 23 | URL: https://github.com/nothings/stb/blob/master/stb_image.h 24 | -------------------------------------------------------------------------------- /utils/build-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # kos-ports ##version## 3 | # 4 | # utils/build-all.sh 5 | # Copyright (C) 2015 Lawrence Sebald 6 | # Copyright (C) 2024 Andy Barajas 7 | # 8 | 9 | cd ${KOS_PORTS} 10 | errors="" 11 | error_count=0 12 | 13 | for _dir in ${KOS_PORTS}/* ; do 14 | if [ -d "${_dir}" ] ; then 15 | if [ -f "${_dir}/Makefile" ] ; then 16 | echo "Checking if ${_dir} is installed and up-to-date..." 17 | ${KOS_MAKE} -C "${_dir}" version-check > /dev/null 2>&1 18 | rv=$? 19 | if [ "$rv" -eq 0 ] ; then 20 | echo "Building ${_dir}..." 21 | ${KOS_MAKE} -C "${_dir}" install clean 22 | rv=$? 23 | echo $rv 24 | if [ "$rv" -ne 0 ] ; then 25 | echo "Error building ${_dir}." 26 | errors="${errors}${_dir}: Build failed with return code ${rv}\n" 27 | error_count=$((error_count + 1)) 28 | fi 29 | else 30 | echo "${_dir} is already installed and up-to-date. Skipping." 31 | fi 32 | fi 33 | fi 34 | done 35 | 36 | if [ -n "$errors" ]; then 37 | echo "\n-------------------------------------------------" 38 | echo "$error_count error(s) occurred during the build process:" 39 | echo "$errors" 40 | fi 41 | exit $error_count 42 | -------------------------------------------------------------------------------- /utils/calc_dist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # kos-ports ##version## 3 | # 4 | # utils/calc_dist.py 5 | # Copyright (C) 2015 Lawrence Sebald 6 | # 7 | 8 | import os 9 | import sys 10 | import hashlib 11 | 12 | for arg in sys.argv[1:]: 13 | h = hashlib.sha256() 14 | with open(arg, 'rb') as f: 15 | buf = f.read(1024*1024) 16 | while len(buf) > 0: 17 | h.update(buf) 18 | buf = f.read(1024*1024) 19 | print("SHA256 (%s) = %s" % (arg, h.hexdigest())) 20 | print("SIZE (%s) = %d" % (arg, os.path.getsize(arg))) 21 | -------------------------------------------------------------------------------- /utils/clean-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # kos-ports ##version## 3 | # 4 | # utils/clean-all.sh 5 | # Copyright (C) 2015 Lawrence Sebald 6 | # 7 | 8 | cd ${KOS_PORTS} 9 | 10 | for _dir in ${KOS_PORTS}/* ; do 11 | if [ -d "${_dir}" ] ; then 12 | if [ -f "${_dir}/Makefile" ] ; then 13 | echo "Cleaning in ${_dir}..." 14 | ${KOS_MAKE} -C "${_dir}" clean 15 | fi 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /utils/uninstall-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # kos-ports ##version## 3 | # 4 | # utils/uninstall-all.sh 5 | # Copyright (C) 2015 Lawrence Sebald 6 | # 7 | 8 | cd ${KOS_PORTS} 9 | 10 | for _dir in ${KOS_PORTS}/* ; do 11 | if [ -d "${_dir}" ] ; then 12 | if [ -f "${_dir}/Makefile" ] ; then 13 | echo "Uninstalling in ${_dir}..." 14 | ${KOS_MAKE} -C "${_dir}" uninstall 15 | fi 16 | fi 17 | done 18 | -------------------------------------------------------------------------------- /zlib/Makefile: -------------------------------------------------------------------------------- 1 | # Port Metadata 2 | PORTNAME = zlib 3 | PORTVERSION = 1.3.1 4 | 5 | MAINTAINER = Lawrence Sebald 6 | LICENSE = zlib License - http://opensource.org/licenses/Zlib 7 | SHORT_DESC = Lossless data compression library 8 | 9 | # No dependencies beyond the base system. 10 | DEPENDENCIES = 11 | 12 | # What files we need to download, and where from. 13 | DOWNLOAD_SITE = http://zlib.net 14 | DOWNLOAD_FILES = ${PORTNAME}-${PORTVERSION}.tar.gz 15 | 16 | TARGET = libz.a 17 | INSTALLED_HDRS = zlib.h zconf.h 18 | 19 | # KOS Distributed extras (to be copied into the build tree) 20 | KOS_DISTFILES = KOSMakefile.mk kos_zlib.c 21 | 22 | include ${KOS_PORTS}/scripts/kos-ports.mk 23 | -------------------------------------------------------------------------------- /zlib/distinfo: -------------------------------------------------------------------------------- 1 | SHA256 (zlib-1.3.1.tar.gz) = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 2 | SIZE (zlib-1.3.1.tar.gz) = 1512791 3 | -------------------------------------------------------------------------------- /zlib/files/KOSMakefile.mk: -------------------------------------------------------------------------------- 1 | TARGET = libz.a 2 | OBJS = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o \ 3 | infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o kos_zlib.o 4 | 5 | KOS_CFLAGS += -I. -DHAVE_UNISTD_H -DHAVE_STDARG_H 6 | 7 | include ${KOS_PORTS}/scripts/lib.mk 8 | -------------------------------------------------------------------------------- /zlib/files/kos_zlib.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | /* Macros taken from gzip source to read header values */ 6 | static int gzmagic[2] = {0x1f, 0x8b}; 7 | #define SH(p) ((unsigned short)(unsigned char)((p)[0]) | ((unsigned short)(unsigned char)((p)[1]) << 8)) 8 | #define LG(p) ((unsigned long)(SH(p)) | ((unsigned long)(SH((p)+2)) << 16)) 9 | 10 | /* will verify it is a valid gzip file 11 | * BTW, this is a severely hacked down version of the one in gzio.c 12 | * returns 0 if successful, 1 if not 13 | */ 14 | static int check_header(file_t f) 15 | { 16 | unsigned char i, c, method, flags; 17 | 18 | /* Check the gzip magic header */ 19 | for (i = 0; i < 2; i++) 20 | { 21 | fs_read(f,&c,1); 22 | if (c != gzmagic[i]) 23 | return 1; 24 | } 25 | 26 | fs_read(f,&method,1); 27 | fs_read(f,&flags,1); 28 | 29 | if (method != Z_DEFLATED || (flags & 0xE0) != 0) 30 | return 1; 31 | 32 | return 0; 33 | } 34 | 35 | int zlib_getlength(char *filename) 36 | { 37 | char temp[4]; 38 | file_t f; 39 | 40 | f = fs_open(filename, O_RDONLY); 41 | if (f < 0) 42 | return 0; 43 | if (check_header(f)) 44 | { 45 | size_t length; 46 | length = fs_total(f); 47 | fs_close(f); 48 | return length; 49 | } 50 | fs_seek(f, -4, SEEK_END); 51 | fs_read(f, temp, 4); 52 | fs_close(f); 53 | return LG(temp); 54 | } 55 | -------------------------------------------------------------------------------- /zlib/pkg-descr: -------------------------------------------------------------------------------- 1 | zlib is a free, open-source, general purpose lossless data compression library. 2 | It is believed to be legally unencumbered by patents. The compression algorithm 3 | used is the deflate algorithm that is used by Zip and gzip archives. 4 | 5 | URL: http://zlib.net/ 6 | --------------------------------------------------------------------------------