├── jni ├── Application.mk └── Android.mk ├── .gitignore ├── link.T ├── README.md ├── .travis.yml ├── bupboop ├── License.txt ├── types.h └── coretone │ ├── sample.h │ ├── channel.h │ ├── coretone.h │ ├── music.h │ └── sample.c ├── core ├── Hash.h ├── Database.h ├── Region.h ├── Palette.h ├── Bios.h ├── Pair.h ├── boolean.h ├── Riot.h ├── Maria.h ├── Rect.h ├── BupChip.h ├── Sally.h ├── ProSystem.h ├── Memory.h ├── libretro_core_options_intl.h ├── Bios.c ├── Equates.h ├── Tia.h ├── Cartridge.h ├── Pokey.h ├── Palette.c ├── BupChip.c ├── Memory.c ├── Tia.c └── Hash.c ├── Makefile.common ├── libretro-common ├── include │ ├── retro_assert.h │ ├── retro_inline.h │ ├── boolean.h │ ├── compat │ │ ├── fopen_utf8.h │ │ ├── strcasestr.h │ │ ├── strl.h │ │ ├── posix_string.h │ │ ├── msvc.h │ │ └── msvc │ │ │ └── stdint.h │ ├── time │ │ └── rtime.h │ ├── vfs │ │ ├── vfs_implementation.h │ │ └── vfs.h │ ├── retro_timers.h │ ├── encodings │ │ └── utf.h │ ├── retro_environment.h │ ├── retro_common_api.h │ ├── streams │ │ └── file_stream.h │ └── retro_miscellaneous.h ├── compat │ ├── compat_strl.c │ ├── compat_strcasestr.c │ ├── fopen_utf8.c │ ├── compat_snprintf.c │ └── compat_posix_string.c ├── time │ └── rtime.c ├── file │ └── file_path_io.c └── streams │ └── file_stream_transforms.c └── .gitlab-ci.yml /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dll 4 | *.dylib 5 | *.exe 6 | -------------------------------------------------------------------------------- /link.T: -------------------------------------------------------------------------------- 1 | { 2 | global: retro_*; 3 | local: *; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | prosystem-libretro 2 | ================== 3 | 4 | Port of ProSystem to libretro. 5 | Bios are optionals. 6 | Place them in your RetroArch/libretro "System Directory" folder. 7 | 8 | NTSC/US bios name: "7800 BIOS (U).rom" 9 | PAL/EU bios name: "7800 BIOS (E).rom" 10 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | ROOT_DIR := $(LOCAL_PATH)/.. 4 | CORE_DIR := $(ROOT_DIR)/core 5 | 6 | include $(ROOT_DIR)/Makefile.common 7 | 8 | COREFLAGS := -DANDROID -D__LIBRETRO__ $(INCFLAGS) 9 | 10 | GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" 11 | ifneq ($(GIT_VERSION)," unknown") 12 | COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" 13 | endif 14 | 15 | include $(CLEAR_VARS) 16 | LOCAL_MODULE := retro 17 | LOCAL_SRC_FILES := $(SOURCES_C) 18 | LOCAL_CFLAGS := $(COREFLAGS) 19 | LOCAL_LDFLAGS := -Wl,-version-script=$(ROOT_DIR)/link.T 20 | LOCAL_LDLIBS := -lz 21 | include $(BUILD_SHARED_LIBRARY) 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | os: linux 3 | dist: trusty 4 | sudo: required 5 | addons: 6 | apt: 7 | packages: 8 | - g++-7 9 | sources: 10 | - ubuntu-toolchain-r-test 11 | env: 12 | global: 13 | - CORE=prosystem 14 | - COMPILER_NAME=gcc CXX=g++-7 CC=gcc-7 15 | matrix: 16 | - PLATFORM=linux_x64 17 | before_script: 18 | - pwd 19 | - mkdir -p ~/bin 20 | - ln -s /usr/bin/gcc-7 ~/bin/gcc 21 | - ln -s /usr/bin/g++-7 ~/bin/g++ 22 | - ln -s /usr/bin/cpp-7 ~/bin/cpp 23 | - export PATH=~/bin:$PATH 24 | - ls -l ~/bin 25 | - echo $PATH 26 | - g++-7 --version 27 | - g++ --version 28 | script: 29 | - cd ~/ 30 | - git clone --depth=50 https://github.com/libretro/libretro-super 31 | - cd libretro-super/travis 32 | - ./build.sh 33 | -------------------------------------------------------------------------------- /bupboop/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015 - 2016 Osman Celimli 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | 19 | -------------------------------------------------------------------------------- /bupboop/types.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * types.h 3 | * The usual gang of pairings for the 8.8, 16.16, and 32.32 fixed precision 4 | * math we love oh-so-very-much on platforms that aren't bouyant. 5 | *----------------------------------------------------------------------------- 6 | * Copyright (C) 2015 - 2016 Osman Celimli 7 | * For conditions of distribution and use, see copyright notice in bupboop.h 8 | ******************************************************************************/ 9 | #ifndef CORE_TYPES 10 | #define CORE_TYPES 11 | 12 | typedef struct int8p_s 13 | { 14 | int8_t cLo; 15 | int8_t cHi; 16 | } int8p_t; 17 | typedef struct uint8p_s 18 | { 19 | uint8_t ucLo; 20 | uint8_t ucHi; 21 | } uint8p_t; 22 | 23 | typedef struct int16p_s 24 | { 25 | int16_t sLo; 26 | int16_t sHi; 27 | } int16p_t; 28 | typedef struct uint16p_s 29 | { 30 | uint16_t usLo; 31 | uint16_t usHi; 32 | } uint16p_t; 33 | 34 | typedef struct int32p_s 35 | { 36 | int32_t iLo; 37 | int32_t iHi; 38 | } int32p_t; 39 | typedef struct uint32p_s 40 | { 41 | uint32_t uiLo; 42 | uint32_t uiHi; 43 | } uint32p_t; 44 | 45 | 46 | typedef union int8p8_u 47 | { 48 | int16_t sWhole; 49 | uint16_t usWhole; 50 | int8p_t cPair; 51 | uint8p_t ucPair; 52 | } int8p8_t; 53 | 54 | typedef union int16p16_u 55 | { 56 | int32_t iWhole; 57 | uint32_t uiWhole; 58 | int16p_t sPair; 59 | uint16p_t usPair; 60 | } int16p16_t; 61 | 62 | typedef union int32p32_u 63 | { 64 | int64_t lWhole; 65 | uint64_t ulWhole; 66 | int32p_t iPair; 67 | uint32p_t uiPair; 68 | } int32p32_t; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /core/Hash.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Hash.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef HASH_H 27 | #define HASH_H 28 | 29 | #include 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | extern void hash_Compute(char *s, const uint8_t* source, uint32_t length); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /core/Database.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Database.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef DATABASE_H 27 | #define DATABASE_H 28 | 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | extern void database_Initialize(void); 36 | extern void database_Load(const char *digest); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Makefile.common: -------------------------------------------------------------------------------- 1 | LIBRETRO_COMM_DIR := $(CORE_DIR)/../libretro-common 2 | BUPBOOP_DIR := $(CORE_DIR)/../bupboop 3 | 4 | INCFLAGS := -I$(CORE_DIR) \ 5 | -I$(LIBRETRO_COMM_DIR)/include 6 | 7 | ifneq (,$(findstring msvc2003,$(platform))) 8 | INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc 9 | endif 10 | 11 | ifeq ($(platform),unix) 12 | LIBS += -lm 13 | endif 14 | 15 | SOURCES_C := \ 16 | $(CORE_DIR)/libretro.c \ 17 | $(CORE_DIR)/Bios.c \ 18 | $(CORE_DIR)/BupChip.c \ 19 | $(CORE_DIR)/Cartridge.c \ 20 | $(CORE_DIR)/Database.c \ 21 | $(CORE_DIR)/Hash.c \ 22 | $(CORE_DIR)/Maria.c \ 23 | $(CORE_DIR)/Memory.c \ 24 | $(CORE_DIR)/Palette.c \ 25 | $(CORE_DIR)/Pokey.c \ 26 | $(CORE_DIR)/ProSystem.c \ 27 | $(CORE_DIR)/Region.c \ 28 | $(CORE_DIR)/Riot.c \ 29 | $(CORE_DIR)/Sally.c \ 30 | $(CORE_DIR)/Tia.c 31 | 32 | SOURCES_C += \ 33 | $(BUPBOOP_DIR)/coretone/channel.c \ 34 | $(BUPBOOP_DIR)/coretone/coretone.c \ 35 | $(BUPBOOP_DIR)/coretone/music.c \ 36 | $(BUPBOOP_DIR)/coretone/sample.c 37 | 38 | SOURCES_C += \ 39 | $(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \ 40 | $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \ 41 | $(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \ 42 | $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \ 43 | $(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \ 44 | $(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \ 45 | $(LIBRETRO_COMM_DIR)/file/file_path.c \ 46 | $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ 47 | $(LIBRETRO_COMM_DIR)/streams/file_stream.c \ 48 | $(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \ 49 | $(LIBRETRO_COMM_DIR)/string/stdstring.c \ 50 | $(LIBRETRO_COMM_DIR)/time/rtime.c \ 51 | $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c 52 | -------------------------------------------------------------------------------- /core/Region.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Region.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef REGION_H 27 | #define REGION_H 28 | 29 | #define REGION_NTSC 0 30 | #define REGION_PAL 1 31 | #define REGION_AUTO 2 32 | 33 | #include 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | extern void region_Reset(void); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /core/Palette.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Palette.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef PALETTE_H 27 | #define PALETTE_H 28 | 29 | #define PALETTE_SIZE 768 30 | 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern void palette_Load(const uint8_t* data); 39 | extern uint8_t palette_data[PALETTE_SIZE]; 40 | extern bool palette_default; 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /core/Bios.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Bios.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef BIOS_H 27 | #define BIOS_H 28 | 29 | #include 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | extern bool bios_Load(const char *filename); 37 | extern bool bios_IsLoaded(void); 38 | extern void bios_Store(void); 39 | extern void bios_Release(void); 40 | 41 | extern bool bios_enabled; 42 | extern uint16_t bios_size; 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libretro-common/include/retro_assert.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (retro_assert.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __RETRO_ASSERT_H 24 | #define __RETRO_ASSERT_H 25 | 26 | #include 27 | 28 | #ifdef RARCH_INTERNAL 29 | #include 30 | #define retro_assert(cond) ((void)( (cond) || (printf("Assertion failed at %s:%d.\n", __FILE__, __LINE__), abort(), 0) )) 31 | #else 32 | #define retro_assert(cond) assert(cond) 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /core/Pair.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Pair.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef PAIR_H 27 | #define PAIR_H 28 | 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | union Pair 36 | { 37 | uint16_t w; 38 | struct Join 39 | { 40 | #ifdef MSB_FIRST 41 | uint8_t h; 42 | uint8_t l; 43 | #else 44 | uint8_t l; 45 | uint8_t h; 46 | #endif 47 | } b; 48 | }; 49 | 50 | typedef union Pair pair; 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /core/boolean.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2015 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (boolean.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_BOOLEAN_H 24 | #define __LIBRETRO_SDK_BOOLEAN_H 25 | 26 | #ifndef __cplusplus 27 | 28 | #if defined(_MSC_VER) && !defined(SN_TARGET_PS3) 29 | /* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */ 30 | #define bool unsigned char 31 | #define true 1 32 | #define false 0 33 | #else 34 | #include 35 | #endif 36 | 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libretro-common/include/retro_inline.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (retro_inline.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_INLINE_H 24 | #define __LIBRETRO_SDK_INLINE_H 25 | 26 | #ifndef INLINE 27 | 28 | #if defined(_WIN32) || defined(__INTEL_COMPILER) 29 | #define INLINE __inline 30 | #elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L 31 | #define INLINE inline 32 | #elif defined(__GNUC__) 33 | #define INLINE __inline__ 34 | #else 35 | #define INLINE 36 | #endif 37 | 38 | #endif 39 | #endif 40 | -------------------------------------------------------------------------------- /libretro-common/include/boolean.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (boolean.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_BOOLEAN_H 24 | #define __LIBRETRO_SDK_BOOLEAN_H 25 | 26 | #ifndef __cplusplus 27 | 28 | #if defined(_MSC_VER) && _MSC_VER < 1800 && !defined(SN_TARGET_PS3) 29 | /* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */ 30 | #define bool unsigned char 31 | #define true 1 32 | #define false 0 33 | #else 34 | #include 35 | #endif 36 | 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /core/Riot.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Riot.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef RIOT_H 27 | #define RIOT_H 28 | 29 | #include 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | extern void riot_Reset(void); 37 | extern void riot_SetInput(const uint8_t* input); 38 | extern void riot_SetDRA(uint8_t data); 39 | extern void riot_SetDRB(uint8_t data); 40 | extern void riot_SetTimer(uint16_t timer, uint8_t intervals); 41 | extern void riot_UpdateTimer(uint8_t cycles); 42 | 43 | extern bool riot_timing; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /core/Maria.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Maria.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef MARIA_H 27 | #define MARIA_H 28 | 29 | #define MARIA_SURFACE_SIZE 93440 30 | 31 | #include 32 | #include "Rect.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern void maria_Reset(void); 39 | extern uint32_t maria_RenderScanline(void); 40 | extern void maria_Clear(void); 41 | 42 | extern rect maria_displayArea; 43 | extern rect maria_visibleArea; 44 | extern uint8_t maria_surface[MARIA_SURFACE_SIZE]; 45 | extern uint16_t maria_scanline; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /core/Rect.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Rect.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef RECT_H 27 | #define RECT_H 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | struct Rects 39 | { 40 | uint32_t left; 41 | uint32_t top; 42 | uint32_t right; 43 | uint32_t bottom; 44 | }; 45 | 46 | static INLINE uint32_t Rect_GetLength(struct Rects *rect) 47 | { 48 | return (rect->right - rect->left) + 1; 49 | } 50 | 51 | typedef struct Rects rect; 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /libretro-common/include/compat/fopen_utf8.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (fopen_utf8.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H 24 | #define __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H 25 | 26 | #ifdef _WIN32 27 | /* Defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */ 28 | /* TODO: enable */ 29 | /* #define fopen (use fopen_utf8 instead) */ 30 | void *fopen_utf8(const char * filename, const char * mode); 31 | #else 32 | #define fopen_utf8 fopen 33 | #endif 34 | #endif 35 | -------------------------------------------------------------------------------- /core/BupChip.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * BupChip.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef BUPCHIP_H 27 | #define BUPCHIP_H 28 | 29 | #include 30 | #include 31 | #include "../bupboop/types.h" 32 | #include "../bupboop/coretone/coretone.h" 33 | 34 | extern unsigned char bupchip_flags; 35 | extern unsigned char bupchip_volume; 36 | extern unsigned char bupchip_current_song; 37 | extern short bupchip_buffer[CORETONE_BUFFER_LEN * 4]; 38 | 39 | int bupchip_InitFromCDF(const char** cdf, size_t* cdfSize, const char *workingDir); 40 | void bupchip_ProcessAudioCommand(unsigned char data); 41 | void bupchip_Process(unsigned tick); 42 | void bupchip_Release(void); 43 | void bupchip_StateLoaded(void); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /core/Sally.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Sally.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef SALLY_H 27 | #define SALLY_H 28 | 29 | #include 30 | #include "Pair.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | extern void sally_Reset(void); 37 | extern uint32_t sally_ExecuteInstruction(void); 38 | extern uint32_t sally_ExecuteRES(void); 39 | extern uint32_t sally_ExecuteNMI(void); 40 | extern uint32_t sally_ExecuteIRQ(void); 41 | 42 | extern uint8_t sally_a; 43 | extern uint8_t sally_x; 44 | extern uint8_t sally_y; 45 | extern uint8_t sally_p; 46 | extern uint8_t sally_s; 47 | extern pair sally_pc; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libretro-common/include/time/rtime.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (rtime.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_RTIME_H__ 24 | #define __LIBRETRO_SDK_RTIME_H__ 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | RETRO_BEGIN_DECLS 33 | 34 | /* TODO/FIXME: Move all generic time handling functions 35 | * to this file */ 36 | 37 | /* Must be called before using rtime_localtime() */ 38 | void rtime_init(void); 39 | 40 | /* Must be called upon program termination */ 41 | void rtime_deinit(void); 42 | 43 | /* Thread-safe wrapper for localtime() */ 44 | struct tm *rtime_localtime(const time_t *timep, struct tm *result); 45 | 46 | RETRO_END_DECLS 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libretro-common/include/compat/strcasestr.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (strcasestr.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_COMPAT_STRCASESTR_H 24 | #define __LIBRETRO_SDK_COMPAT_STRCASESTR_H 25 | 26 | #include 27 | 28 | #if defined(RARCH_INTERNAL) && defined(HAVE_CONFIG_H) 29 | #include "../../../config.h" 30 | #endif 31 | 32 | #ifndef HAVE_STRCASESTR 33 | 34 | #include 35 | 36 | RETRO_BEGIN_DECLS 37 | 38 | /* Avoid possible naming collisions during link 39 | * since we prefer to use the actual name. */ 40 | #define strcasestr(haystack, needle) strcasestr_retro__(haystack, needle) 41 | 42 | char *strcasestr(const char *haystack, const char *needle); 43 | 44 | RETRO_END_DECLS 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /core/ProSystem.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * ProSystem.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef PRO_SYSTEM_H 27 | #define PRO_SYSTEM_H 28 | 29 | #include 30 | 31 | #include 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | extern void prosystem_Reset(void); 38 | extern void prosystem_ExecuteFrame(const uint8_t* input); 39 | extern bool prosystem_Save(char *buffer, bool fast_saves); 40 | extern bool prosystem_Load(const char *buffer, bool fast_saves); 41 | extern void prosystem_Close(bool persistent_data); 42 | uint32_t read_uint32_from_buffer(const char* buffer, uint32_t* offset); 43 | void save_uint32_to_buffer(char* buffer, uint32_t* size, uint32_t data); 44 | 45 | extern uint16_t prosystem_frequency; 46 | extern uint16_t prosystem_scanlines; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /core/Memory.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * ___ ___ ___ ___ ___ ____ ___ _ _ 3 | * /__/ /__/ / / /__ /__/ /__ / /_ / |/ / 4 | * / / \ /__/ ___/ ___/ ___/ / /__ / / emulator 5 | * 6 | * ---------------------------------------------------------------------------- 7 | * Copyright 2005 Greg Stanton 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | * ---------------------------------------------------------------------------- 23 | * Memory.h 24 | * ---------------------------------------------------------------------------- 25 | */ 26 | #ifndef MEMORY_H 27 | #define MEMORY_H 28 | 29 | #define MEMORY_SIZE 65536 30 | #define MEMORY_SOUPER_EXRAM_SIZE 32768 31 | 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern void memory_Reset(void); 39 | extern uint8_t memory_Read(uint16_t address); 40 | extern void memory_Write(uint16_t address, uint8_t data); 41 | extern void memory_WriteROM(uint16_t address, uint16_t size, const uint8_t* data); 42 | extern void memory_ClearROM(uint16_t address, uint16_t size); 43 | extern uint16_t memory_souper_GetRamAddress(uint16_t address); 44 | extern uint8_t memory_ram[MEMORY_SIZE]; 45 | extern uint8_t memory_rom[MEMORY_SIZE]; 46 | extern uint8_t memory_souper_ram[MEMORY_SOUPER_EXRAM_SIZE]; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /libretro-common/compat/compat_strl.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (compat_strl.c). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | /* Implementation of strlcpy()/strlcat() based on OpenBSD. */ 29 | 30 | #ifndef __MACH__ 31 | 32 | size_t strlcpy(char *dest, const char *source, size_t size) 33 | { 34 | size_t src_size = 0; 35 | size_t n = size; 36 | 37 | if (n) 38 | while (--n && (*dest++ = *source++)) src_size++; 39 | 40 | if (!n) 41 | { 42 | if (size) *dest = '\0'; 43 | while (*source++) src_size++; 44 | } 45 | 46 | return src_size; 47 | } 48 | 49 | size_t strlcat(char *dest, const char *source, size_t size) 50 | { 51 | size_t len = strlen(dest); 52 | 53 | dest += len; 54 | 55 | if (len > size) 56 | size = 0; 57 | else 58 | size -= len; 59 | 60 | return len + strlcpy(dest, source, size); 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /core/libretro_core_options_intl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBRETRO_CORE_OPTIONS_INTL_H__ 2 | #define LIBRETRO_CORE_OPTIONS_INTL_H__ 3 | 4 | #if defined(_MSC_VER) && (_MSC_VER >= 1500 && _MSC_VER < 1900) 5 | /* https://support.microsoft.com/en-us/kb/980263 */ 6 | #pragma execution_character_set("utf-8") 7 | #pragma warning(disable:4566) 8 | #endif 9 | 10 | #include 11 | 12 | /* 13 | ******************************** 14 | * VERSION: 1.3 15 | ******************************** 16 | * 17 | * - 1.3: Move translations to libretro_core_options_intl.h 18 | * - libretro_core_options_intl.h includes BOM and utf-8 19 | * fix for MSVC 2010-2013 20 | * - Added HAVE_NO_LANGEXTRA flag to disable translations 21 | * on platforms/compilers without BOM support 22 | * - 1.2: Use core options v1 interface when 23 | * RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION is >= 1 24 | * (previously required RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION == 1) 25 | * - 1.1: Support generation of core options v0 retro_core_option_value 26 | * arrays containing options with a single value 27 | * - 1.0: First commit 28 | */ 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /* 35 | ******************************** 36 | * Core Option Definitions 37 | ******************************** 38 | */ 39 | 40 | /* RETRO_LANGUAGE_JAPANESE */ 41 | 42 | /* RETRO_LANGUAGE_FRENCH */ 43 | 44 | /* RETRO_LANGUAGE_SPANISH */ 45 | 46 | /* RETRO_LANGUAGE_GERMAN */ 47 | 48 | /* RETRO_LANGUAGE_ITALIAN */ 49 | 50 | /* RETRO_LANGUAGE_DUTCH */ 51 | 52 | /* RETRO_LANGUAGE_PORTUGUESE_BRAZIL */ 53 | 54 | /* RETRO_LANGUAGE_PORTUGUESE_PORTUGAL */ 55 | 56 | /* RETRO_LANGUAGE_RUSSIAN */ 57 | 58 | /* RETRO_LANGUAGE_KOREAN */ 59 | 60 | /* RETRO_LANGUAGE_CHINESE_TRADITIONAL */ 61 | 62 | /* RETRO_LANGUAGE_CHINESE_SIMPLIFIED */ 63 | 64 | /* RETRO_LANGUAGE_ESPERANTO */ 65 | 66 | /* RETRO_LANGUAGE_POLISH */ 67 | 68 | /* RETRO_LANGUAGE_VIETNAMESE */ 69 | 70 | /* RETRO_LANGUAGE_ARABIC */ 71 | 72 | /* RETRO_LANGUAGE_GREEK */ 73 | 74 | /* RETRO_LANGUAGE_TURKISH */ 75 | 76 | /* RETRO_LANGUAGE_SLOVAK */ 77 | 78 | /* RETRO_LANGUAGE_PERSIAN */ 79 | 80 | /* RETRO_LANGUAGE_HEBREW */ 81 | 82 | /* RETRO_LANGUAGE_ASTURIAN */ 83 | 84 | /* RETRO_LANGUAGE_FINNISH */ 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /libretro-common/include/compat/strl.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (strl.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_COMPAT_STRL_H 24 | #define __LIBRETRO_SDK_COMPAT_STRL_H 25 | 26 | #include 27 | #include 28 | 29 | #if defined(RARCH_INTERNAL) && defined(HAVE_CONFIG_H) 30 | #include "../../../config.h" 31 | #endif 32 | 33 | #include 34 | 35 | RETRO_BEGIN_DECLS 36 | 37 | #ifdef __MACH__ 38 | #ifndef HAVE_STRL 39 | #define HAVE_STRL 40 | #endif 41 | #endif 42 | 43 | #ifndef HAVE_STRL 44 | /* Avoid possible naming collisions during link since 45 | * we prefer to use the actual name. */ 46 | #define strlcpy(dst, src, size) strlcpy_retro__(dst, src, size) 47 | 48 | #define strlcat(dst, src, size) strlcat_retro__(dst, src, size) 49 | 50 | size_t strlcpy(char *dest, const char *source, size_t size); 51 | size_t strlcat(char *dest, const char *source, size_t size); 52 | 53 | #endif 54 | 55 | char *strldup(const char *s, size_t n); 56 | 57 | RETRO_END_DECLS 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /libretro-common/compat/compat_strcasestr.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (compat_strcasestr.c). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | 27 | /* Pretty much strncasecmp. */ 28 | static int casencmp(const char *a, const char *b, size_t n) 29 | { 30 | size_t i; 31 | 32 | for (i = 0; i < n; i++) 33 | { 34 | int a_lower = tolower(a[i]); 35 | int b_lower = tolower(b[i]); 36 | if (a_lower != b_lower) 37 | return a_lower - b_lower; 38 | } 39 | 40 | return 0; 41 | } 42 | 43 | char *strcasestr_retro__(const char *haystack, const char *needle) 44 | { 45 | size_t i, search_off; 46 | size_t hay_len = strlen(haystack); 47 | size_t needle_len = strlen(needle); 48 | 49 | if (needle_len > hay_len) 50 | return NULL; 51 | 52 | search_off = hay_len - needle_len; 53 | for (i = 0; i <= search_off; i++) 54 | if (!casencmp(haystack + i, needle, needle_len)) 55 | return (char*)haystack + i; 56 | 57 | return NULL; 58 | } 59 | -------------------------------------------------------------------------------- /libretro-common/include/compat/posix_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (posix_string.h). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifndef __LIBRETRO_SDK_COMPAT_POSIX_STRING_H 24 | #define __LIBRETRO_SDK_COMPAT_POSIX_STRING_H 25 | 26 | #include 27 | 28 | #ifdef _MSC_VER 29 | #include 30 | #endif 31 | 32 | RETRO_BEGIN_DECLS 33 | 34 | #ifdef _WIN32 35 | #undef strtok_r 36 | #define strtok_r(str, delim, saveptr) retro_strtok_r__(str, delim, saveptr) 37 | 38 | char *strtok_r(char *str, const char *delim, char **saveptr); 39 | #endif 40 | 41 | #ifdef _MSC_VER 42 | #undef strcasecmp 43 | #undef strdup 44 | #define strcasecmp(a, b) retro_strcasecmp__(a, b) 45 | #define strdup(orig) retro_strdup__(orig) 46 | int strcasecmp(const char *a, const char *b); 47 | char *strdup(const char *orig); 48 | 49 | /* isblank is available since MSVC 2013 */ 50 | #if _MSC_VER < 1800 51 | #undef isblank 52 | #define isblank(c) retro_isblank__(c) 53 | int isblank(int c); 54 | #endif 55 | 56 | #endif 57 | 58 | RETRO_END_DECLS 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /libretro-common/compat/fopen_utf8.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (fopen_utf8.c). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0500 || defined(_XBOX) 29 | #ifndef LEGACY_WIN32 30 | #define LEGACY_WIN32 31 | #endif 32 | #endif 33 | 34 | #ifdef _WIN32 35 | #undef fopen 36 | 37 | void *fopen_utf8(const char * filename, const char * mode) 38 | { 39 | #if defined(LEGACY_WIN32) 40 | char * filename_local = utf8_to_local_string_alloc(filename); 41 | if (filename_local) 42 | { 43 | FILE *ret = fopen(filename_local, mode); 44 | free(filename_local); 45 | return ret; 46 | } 47 | #else 48 | wchar_t * filename_w = utf8_to_utf16_string_alloc(filename); 49 | if (filename_w) 50 | { 51 | FILE *ret = NULL; 52 | wchar_t *mode_w = utf8_to_utf16_string_alloc(mode); 53 | if (mode_w) 54 | { 55 | ret = _wfopen(filename_w, mode_w); 56 | free(mode_w); 57 | } 58 | free(filename_w); 59 | return ret; 60 | } 61 | #endif 62 | return NULL; 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /bupboop/coretone/sample.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * sample.h 3 | * Audio sample management. 4 | *----------------------------------------------------------------------------- 5 | * Copyright (C) 2015 - 2016 Osman Celimli 6 | * For conditions of distribution and use, see copyright notice in coretone.c 7 | ******************************************************************************/ 8 | #ifndef CORETONE_SAMPLE 9 | #define CORETONE_SAMPLE 10 | 11 | /****************************************************************************** 12 | * Operating Parameters 13 | ******************************************************************************/ 14 | #ifndef CORETONE_SAMPLES_MAXENTRIES 15 | #define CORETONE_SAMPLES_MAXENTRIES 256 16 | #endif 17 | 18 | #ifndef CORETONE_SAMPLES_MAXLENGTH 19 | #define CORETONE_SAMPLES_MAXLENGTH 32768 20 | #endif 21 | 22 | /****************************************************************************** 23 | * Sample Package Format 24 | ******************************************************************************/ 25 | /* Sample Packages are composed of three major regions: 26 | * 27 | * The HEADER, which contains an identifier string and the number of samples 28 | * included within the package. 29 | * 30 | * The DIRECTORY, which contains the DATA OFFSET, LENGTH, SAMPLE FREQUENCY (Sf), 31 | * and CONTENT FREQUENCY (Bf) of each sample in the package. Each of these 32 | * values is 32-Bits yielding 16-Bytes per entry. 33 | * 34 | * The DATA AREA, which contains the 8-Bit signed PCM data for all of the 35 | * samples in the package. 36 | * 37 | * It is expected that the sample package starts at a 32-Bit aligned address 38 | * and will remain at said address for the duration of its use by the SoftSynth. 39 | */ 40 | #define CORETONE_SMPPAK_HEAD_MAGICWORD "CSMP" 41 | #define CORETONE_SMPPAK_HEAD_MAGICLEN 4 42 | #define CORETONE_SMPPAK_HEAD_COUNT 4 43 | #define CORETONE_SMPPAK_HEAD_SIZE 8 44 | 45 | #define CORETONE_SMPPAK_DIR_BASE 8 46 | 47 | /* Note that the entry offsets below are in uint32_t counts intead of bytes */ 48 | #define CORETONE_SMPPAK_ENTRY_OFF 0 49 | #define CORETONE_SMPPAK_ENTRY_SLEN 1 50 | #define CORETONE_SMPPAK_ENTRY_SFREQ 2 51 | #define CORETONE_SMPPAK_ENTRY_BFREQ 3 52 | #define CORETONE_SMPPAK_ENTRY_SIZE 4 53 | 54 | /****************************************************************************** 55 | * Function Defines 56 | ******************************************************************************/ 57 | void ct_sample_get(uint32_t uiSample, int8_t **ppData, uint32_t *puiLen); 58 | int16p16_t ct_sample_calcPhase(uint32_t uiSample, int16p16_t freq); 59 | 60 | int32_t ct_sample_setup(uint8_t *pSamplePak); 61 | #endif 62 | -------------------------------------------------------------------------------- /libretro-common/time/rtime.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (rtime.c). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #ifdef HAVE_THREADS 24 | #include 25 | #include 26 | #endif 27 | 28 | #include 29 | #include