├── .github └── workflows │ └── compilation.yml ├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── COPYING ├── Makefile ├── Makefile.common ├── README.md ├── allegrowrapper ├── wrapalleg.c └── wrapalleg.h ├── control ├── core_audio_mixer.c ├── core_audio_mixer.h ├── jni ├── Android.mk └── Application.mk ├── libretro-common ├── audio │ ├── conversion │ │ ├── float_to_s16.c │ │ └── s16_to_float.c │ └── resampler │ │ ├── audio_resampler.c │ │ └── drivers │ │ ├── sinc_resampler.c │ │ └── sinc_resampler_neon.S ├── compat │ ├── compat_posix_string.c │ ├── compat_snprintf.c │ ├── compat_strcasestr.c │ ├── compat_strl.c │ └── fopen_utf8.c ├── encodings │ ├── encoding_crc32.c │ └── encoding_utf.c ├── features │ └── features_cpu.c ├── file │ ├── config_file.c │ ├── config_file_userdata.c │ ├── file_path.c │ └── file_path_io.c ├── formats │ └── wav │ │ └── rwav.c ├── include │ ├── array │ │ └── rhmap.h │ ├── audio │ │ ├── audio_resampler.h │ │ └── conversion │ │ │ ├── float_to_s16.h │ │ │ └── s16_to_float.h │ ├── boolean.h │ ├── compat │ │ ├── fopen_utf8.h │ │ ├── intrinsics.h │ │ ├── msvc.h │ │ ├── msvc │ │ │ └── stdint.h │ │ ├── posix_string.h │ │ ├── strcasestr.h │ │ └── strl.h │ ├── defines │ │ └── ps3_defines.h │ ├── encodings │ │ ├── crc32.h │ │ └── utf.h │ ├── features │ │ └── features_cpu.h │ ├── file │ │ ├── config_file.h │ │ ├── config_file_userdata.h │ │ └── file_path.h │ ├── filters.h │ ├── formats │ │ └── rwav.h │ ├── libretro.h │ ├── lists │ │ └── string_list.h │ ├── memalign.h │ ├── retro_assert.h │ ├── retro_common_api.h │ ├── retro_environment.h │ ├── retro_inline.h │ ├── retro_math.h │ ├── retro_miscellaneous.h │ ├── retro_timers.h │ ├── streams │ │ ├── file_stream.h │ │ └── file_stream_transforms.h │ ├── string │ │ └── stdstring.h │ ├── time │ │ └── rtime.h │ └── vfs │ │ ├── vfs.h │ │ └── vfs_implementation.h ├── lists │ └── string_list.c ├── memmap │ └── memalign.c ├── streams │ ├── file_stream.c │ └── file_stream_transforms.c ├── string │ └── stdstring.c ├── time │ └── rtime.c └── vfs │ └── vfs_implementation.c ├── libretro.c ├── libretro_core_options.h ├── libretro_core_options_intl.h ├── link.T └── src ├── audio.c ├── audio.h ├── config.h ├── cpu.c ├── cpu.h ├── cset.c ├── cset.h ├── keyboard.c ├── keyboard.h ├── score.c ├── score.h ├── table.c ├── table.h ├── vdc.c ├── vdc.h ├── vkeyb ├── img2c.py ├── odyssey2_keyboard.inc ├── odyssey2_keyboard.png ├── ui.c ├── ui.h ├── vkeyb.c ├── vkeyb.h ├── vkeyb_config.c ├── vkeyb_config.h ├── vkeyb_layout.c └── vkeyb_layout.h ├── vmachine.c ├── vmachine.h ├── voice.c ├── voice.h ├── vpp.c ├── vpp.h ├── vpp_cset.c └── vpp_cset.h /.github/workflows/compilation.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | pull_request: 6 | repository_dispatch: 7 | types: [run_build] 8 | 9 | jobs: 10 | build-ps2: 11 | runs-on: ubuntu-latest 12 | container: ps2dev/ps2dev:latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Install dependencies 17 | run: | 18 | apk add build-base 19 | 20 | - name: Get Information Variables 21 | id: core 22 | run: | 23 | echo "::set-output name=info::$(echo o2em)" 24 | echo "::set-output name=platform::$(echo ps2)" 25 | echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" 26 | 27 | - name: Compile project 28 | run: | 29 | make platform=${{ steps.core.outputs.platform }} clean all 30 | 31 | - name: Upload artifacts 32 | if: ${{ success() }} 33 | uses: actions/upload-artifact@v2 34 | with: 35 | name: ${{ steps.core.outputs.info }}_libretro_${{ steps.core.outputs.platform }}-${{ steps.core.outputs.sha8 }} 36 | path: ${{ steps.core.outputs.info }}_libretro_${{ steps.core.outputs.platform }}.a 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.so 3 | *.dll 4 | *.dylib 5 | *.exe 6 | .project 7 | .cproject 8 | .pydevproject 9 | .settings 10 | -------------------------------------------------------------------------------- /.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=o2em 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 | -------------------------------------------------------------------------------- /Makefile.common: -------------------------------------------------------------------------------- 1 | LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro-common 2 | 3 | INCFLAGS := \ 4 | -I$(CORE_DIR) \ 5 | -I$(CORE_DIR)/src \ 6 | -I$(CORE_DIR)/allegrowrapper \ 7 | -I$(LIBRETRO_COMM_DIR)/include 8 | 9 | ifneq (,$(findstring msvc2003,$(platform))) 10 | INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc 11 | endif 12 | 13 | SOURCES_C := \ 14 | $(CORE_DIR)/src/audio.c \ 15 | $(CORE_DIR)/src/cpu.c \ 16 | $(CORE_DIR)/src/cset.c \ 17 | $(CORE_DIR)/src/keyboard.c \ 18 | $(CORE_DIR)/src/score.c \ 19 | $(CORE_DIR)/src/table.c \ 20 | $(CORE_DIR)/src/vdc.c \ 21 | $(CORE_DIR)/src/vmachine.c \ 22 | $(CORE_DIR)/src/voice.c \ 23 | $(CORE_DIR)/src/vpp.c \ 24 | $(CORE_DIR)/src/vpp_cset.c \ 25 | $(CORE_DIR)/libretro.c \ 26 | $(CORE_DIR)/allegrowrapper/wrapalleg.c \ 27 | $(CORE_DIR)/src/vkeyb/ui.c \ 28 | $(CORE_DIR)/src/vkeyb/vkeyb.c \ 29 | $(CORE_DIR)/src/vkeyb/vkeyb_config.c \ 30 | $(CORE_DIR)/src/vkeyb/vkeyb_layout.c 31 | 32 | ifneq ($(STATIC_LINKING), 1) 33 | SOURCES_C += \ 34 | $(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \ 35 | $(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \ 36 | $(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \ 37 | $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \ 38 | $(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \ 39 | $(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \ 40 | $(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \ 41 | $(LIBRETRO_COMM_DIR)/file/file_path.c \ 42 | $(LIBRETRO_COMM_DIR)/file/file_path_io.c \ 43 | $(LIBRETRO_COMM_DIR)/streams/file_stream.c \ 44 | $(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \ 45 | $(LIBRETRO_COMM_DIR)/string/stdstring.c \ 46 | $(LIBRETRO_COMM_DIR)/time/rtime.c \ 47 | $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c 48 | ifeq ($(HAVE_VOICE), 1) 49 | SOURCES_C += \ 50 | $(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.c \ 51 | $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.c \ 52 | $(LIBRETRO_COMM_DIR)/audio/resampler/audio_resampler.c \ 53 | $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler.c \ 54 | $(LIBRETRO_COMM_DIR)/features/features_cpu.c \ 55 | $(LIBRETRO_COMM_DIR)/file/config_file.c \ 56 | $(LIBRETRO_COMM_DIR)/file/config_file_userdata.c \ 57 | $(LIBRETRO_COMM_DIR)/formats/wav/rwav.c \ 58 | $(LIBRETRO_COMM_DIR)/lists/string_list.c \ 59 | $(LIBRETRO_COMM_DIR)/memmap/memalign.c 60 | endif 61 | endif 62 | 63 | ifeq ($(HAVE_VOICE), 1) 64 | SOURCES_C += $(CORE_DIR)/core_audio_mixer.c 65 | endif 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | libretro-o2em 2 | ================== 3 | 4 | Port of O2EM to libretro. 5 | 6 | Place "o2rom.bin" (required) in your RetroArch/libretro "System Directory" folder. 7 | 8 | If you wish to use The Voice emulation, unzip the voice samples into a folder named "voice" under your RetroArch/libretro "System Directory" folder. There are two sets of voice samples: mainsamp.zip, which are the main voice samples, and sidsamp.zip which are the samples used by the game Sid the Spellbinder. You only need the latter if you want voice in that specific game. 9 | -------------------------------------------------------------------------------- /allegrowrapper/wrapalleg.c: -------------------------------------------------------------------------------- 1 | 2 | #include "wrapalleg.h" 3 | 4 | #include 5 | #include 6 | 7 | void alleg_downcase(char *p) 8 | { 9 | while(*p != '\0') 10 | { 11 | if(*p >= 97-32 && *p <= 122-32) 12 | *p += 32; 13 | ++p; 14 | } 15 | } 16 | 17 | ALLEGRO_BITMAP *create_bitmap(int w,int h) 18 | { 19 | ALLEGRO_BITMAP *buff = (ALLEGRO_BITMAP*) 20 | malloc(sizeof (ALLEGRO_BITMAP)); 21 | 22 | if (!buff) 23 | return NULL; 24 | 25 | buff->line = malloc(1*w*h); 26 | 27 | buff->w = w; 28 | buff->h = h; 29 | buff->pitch = w; 30 | buff->depth = 1; 31 | 32 | return buff; 33 | } 34 | 35 | int destroy_bitmap(ALLEGRO_BITMAP *buff) 36 | { 37 | if (buff) 38 | { 39 | if (buff->line) 40 | free(buff->line); 41 | buff->line = NULL; 42 | free(buff); 43 | } 44 | 45 | return 0; 46 | } 47 | 48 | 49 | void rect(ALLEGRO_BITMAP *buff,int x,int y,int x2,int y2,unsigned char color) { } 50 | void rectfill(ALLEGRO_BITMAP *buff,int x,int y,int x2,int y2,unsigned char color) { } 51 | void DrawHline(ALLEGRO_BITMAP *buff,int x,int y,int dx,int dy,unsigned char color) { } 52 | void DrawVline(ALLEGRO_BITMAP *buff,int x,int y,int dx,int dy,unsigned char color) { } 53 | void line(ALLEGRO_BITMAP *buff,int x1,int y1,int x2,int y2,unsigned char color) { } 54 | -------------------------------------------------------------------------------- /allegrowrapper/wrapalleg.h: -------------------------------------------------------------------------------- 1 | #ifndef WRAP_H 2 | #define WRAP_H 3 | 4 | #ifdef _MSC_VER 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | #define keypressed() 0 13 | #define poll_keyboard() 14 | #define yield_timeslice() 15 | 16 | typedef struct 17 | { 18 | unsigned char *line; 19 | int w; 20 | int h; 21 | int pitch; 22 | int depth; 23 | }ALLEGRO_BITMAP; 24 | 25 | typedef struct 26 | { 27 | unsigned char r; 28 | unsigned char g; 29 | unsigned char b; 30 | }APALETTE; 31 | 32 | 33 | extern ALLEGRO_BITMAP *create_bitmap(int w,int h); 34 | extern int destroy_bitmap(ALLEGRO_BITMAP *buff); 35 | extern void line(ALLEGRO_BITMAP *buff,int x1,int y1,int x2,int y2,unsigned char color); 36 | extern void rect(ALLEGRO_BITMAP *buff,int x,int y,int x2,int y2,unsigned char color); 37 | extern void rectfill(ALLEGRO_BITMAP *buff,int x,int y,int x2,int y2,unsigned char color); 38 | extern void alleg_upcase(char *p); 39 | extern void alleg_downcase(char *p); 40 | 41 | extern unsigned char key[256*2]; 42 | 43 | extern void update_joy(void); 44 | 45 | #define EMUWIDTH 340 46 | #define EMUHEIGHT 250 47 | 48 | #define TEX_WIDTH 400 49 | #define TEX_HEIGHT 300 50 | 51 | #define RGB565(r, g, b) ((((r) << 8) & 0xf800) | (((g) << 3) & 0x7e0) | (((b) >> 3) & 0x1f)) 52 | #define ABGR1555(r, g, b) ((((b) << 7) & 0x7C00) | (((g) << 2) & 0x3e0) | (((r) >> 3) & 0x1f)) 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.libretro.o2em 2 | Name: O2EM 3 | Depends: 4 | Version: 0.0.1 5 | Architecture: iphoneos-arm 6 | Description: Libretro iOS core of O2EM 7 | Maintainer: libretro 8 | Author: libretro 9 | Section: System 10 | Tag: role::developer 11 | -------------------------------------------------------------------------------- /core_audio_mixer.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (core_audio_mixer.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_CORE_AUDIO_MIXER__H 24 | #define __LIBRETRO_CORE_AUDIO_MIXER__H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef HAVE_CONFIG_H 31 | #include "config.h" 32 | #endif 33 | 34 | #include 35 | #include 36 | 37 | #include