Skip to content

Commit

Permalink
Merge branch 'libretro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien authored Aug 12, 2024
2 parents 7e6891e + 479f120 commit c19eb8c
Show file tree
Hide file tree
Showing 67 changed files with 833 additions and 790 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ jobs:
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
./configure --platform=miyoo
make -j$(getconf _NPROCESSORS_ONLN)
mv PicoDrive-miyoo.zip PicoDrive-miyoo-$ver.zip
mv PicoDrive-miyoo.ipk PicoDrive-miyoo-$ver.ipk
- name: artifacts
uses: actions/upload-artifact@v4
with:
name: Miyoo
path: PicoDrive-miyoo*.zip
path: PicoDrive-miyoo*.ipk

build-retrofw:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ PicoDrive
picodrive
picodrive_libretro*
PicoDrive*.opk
PicoDrive*.ipk
PicoDrive*.zip
pico_int_offs.h
amalgamate
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ all: PicoDrive-dge.zip
CFLAGS += -DSDL_SURFACE_SW # some legacy dinguces had bugs in HWSURFACE
else
ifneq (,$(filter %__MIYOO__, $(CFLAGS)))
PicoDrive-miyoo.zip: .od_data
PicoDrive-miyoo.ipk: .od_data
rm -f .od_data/default.*.desktop .od_data/PicoDrive.dge
cd .od_data && zip -9 -r ../$@ *
all: PicoDrive-miyoo.zip
gm2xpkg -i platform/miyoo/pkg.cfg
mv picodrive.ipk $@
@gm2xpkg -c platform/miyoo/pkg.cfg >/dev/null 2>&1
all: PicoDrive-miyoo.ipk
else
PicoDrive.opk: .od_data
rm -f .od_data/PicoDrive.dge
Expand Down
130 changes: 81 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,108 @@
This is yet another SEGA 8 bit and 16 bit console emulator for emulating most
of the hardware SEGA has published up to and including the 32X.
This is yet another SEGA 8 bit and 16 bit console emulator.

Emulated 16 bit systems: Mega Drive/Genesis, Sega/Mega CD, 32X, Pico.
Emulated 8 bit systems: SG-1000, SC-3000, Master System/Mark III, Game Gear.
It can run games developed for most consumer hardware released
by SEGA, up to and including the 32X:
- **16 bit systems:** Mega Drive/Genesis, Sega/Mega CD, 32X, Pico
- **8 bit systems**: SG-1000, SC-3000, Master System/Mark III, Game Gear

PicoDrive was originally written having ARM-based handheld devices
in mind, but later had got various improvements for other architectures
too, like SH2 recompilers for MIPS (mips32r2), ARM64 (armv8), RISC-V (RV64IM)
PicoDrive was originally created with ARM-based handheld devices
in mind, but later received various cross-platform improvements
such as SH2 recompilers for MIPS (mips32r2), ARM64 (armv8), RISC-V (RV64IM)
and PowerPC (G4/2.03).

PicoDrive was the first emulator ever to properly emulate Virtua Racing and
PicoDrive was the first software to properly emulate Virtua Racing and
its SVP chip.

Currently the main development happens in the
[irixxxx's fork](https://github.com/irixxxx/picodrive),
[notaz's repo](https://github.com/notaz/picodrive) isn't updated as much.
At present, most development activity occurs in
[irixxxx's fork](https://github.com/irixxxx/picodrive);
[notaz's repo](https://github.com/notaz/picodrive) is updated less frequently.

### compiling
### Sega Pico and Storyware Pages

For platforms for which release builds are supplied the most easy way is to
use the release script in tools/release.sh. See the release script for details.
To make a platform build use
PicoDrive can use Storyware pages and pad overlays in png format in the same
directory as the cartridge image. The selected page is displayed automatically
if the pen is used on the storyware or pad. Details about how to correctly name
the pages can be found in the *How to run Sega Pico games* section in
`platform/base_readme.txt`.

> tools/release.sh [version] [platforms...]
### Gallery

This will deliver a file for each platform in a the release-[version] directory.
A list of platforms is in the release script.
Some images of demos and homebrew software:

If you want to build an executable for a unixoid platform not listed in the
platform list, try using
| ![Titan Overdrive 2](https://github.com/irixxxx/picodrive/assets/31696370/02a4295b-ac9d-4114-bcd1-b5dd6e5930d0) | ![Raycast Demo](https://github.com/irixxxx/picodrive/assets/31696370/6e9c0bfe-49a9-45aa-bad7-544de065e388) | ![OpenLara](https://github.com/irixxxx/picodrive/assets/31696370/8a00002a-5c10-4d1d-a948-739bf978282a) |
| --- | --- | --- |
| [_MegaDrive: Titan Overdrive 2_](https://demozoo.org/productions/170767/) | [_MegaCD: RaycastDemo_](https://github.com/matteusbeus/RaycastDemo) | [_32X: OpenLara_](https://github.com/XProger/OpenLara/releases) |
|![Titan Overdrive 2](https://github.com/irixxxx/picodrive/assets/31696370/2e263e81-51c8-4daa-ab16-0b2cd5554f84)|![DMA David](https://github.com/irixxxx/picodrive/assets/31696370/fbbeac15-8665-4d3e-9729-d1f8c35e417a)|![Doom Resurrection](https://github.com/irixxxx/picodrive/assets/31696370/db7b7153-b917-4850-8442-a748c2fbb968)|
| [_MegaDrive: Titan Overdrive 2_](https://www.pouet.net/prod.php?which=69648) | [_MegaDrive: DMA David_](http://www.mode5.net/DMA_David.html) | [_32X: Doom Resurrection_](https://archive.org/details/doom-32x-all-versions) |

> configure --platform=generic
| ![Cheril Perils Classics](https://github.com/irixxxx/picodrive/assets/31696370/653914a4-9f90-45f8-bd91-56e784df7550) | ![Stygian Quest](https://github.com/irixxxx/picodrive/assets/31696370/8196801b-85c8-4d84-97e1-ae57ab3d577f) | ![Sword of Stone](https://github.com/irixxxx/picodrive/assets/31696370/3c4a8f40-dad6-4fa4-b188-46b428a4b8c6) |
| --- | --- | --- |
| [_SG-1000: Cheril Perils Classic_](https://www.smspower.org/Homebrew/CherilPerilsClassic-SG) | [_MasterSystem: Stygian Quest_](https://www.smspower.org/Homebrew/StygianQuest-SMS) | [_GameGear: The Sword of Stone_](https://www.smspower.org/Homebrew/SwordOfStone-GG) |
| ![Nyan Cat](https://github.com/irixxxx/picodrive/assets/31696370/6fe0d38b-549d-4faa-9351-b260a89dc745) | ![Anguna the Prison Dungeon](https://github.com/irixxxx/picodrive/assets/31696370/3264b962-7da2-4257-9ff7-1b509bd50cdf) | ![Turrican](https://github.com/irixxxx/picodrive/assets/31696370/c4eb2f2c-806e-4f4b-ac94-5c2cda82e962) |
| [_SG-1000: Nyan Cat_](https://www.smspower.org/Homebrew/NyanCat-SG) | [_MS: Anguna the Prison Dungeon_](https://www.smspower.org/Homebrew/AngunaThePrisonDungeon-SMS) | [_GameGear: Turrican_](https://www.smspower.org/Homebrew/GGTurrican-GG) |

If DRC is available for the platform, it should be enabled automatically.
For gp2x, wiz, and caanoo you may need to compile libpng first.
### Compiling

After configure, compile with
For platforms where release builds are provided, the simplest method is to
use the release script `tools/release.sh`. See the script itself for details.
To create platform builds run the command:

> make
```
tools/release.sh [version] [platforms...]
```

This will generate a file for each platform in the `release-[version]` directory.
A list of supported platforms can be found in the release script.

### helix MP3 decoder for ARM
These commands should create an executable for a unixoid platform not included in the list:

For 32 bit ARM platforms, the optimized helix MP3 decoder can be used to play
MP3 audio files with CD games. The helix source files are however not supplied
due to licensing issues. If you have legally obtained the sources, put them in
the platform/common/helix directory.

To compile the helix sources, set CROSS_COMPILE to your cross compiler prefix
(e.g. arm-linux-gnueabi-) and LIBGCC to your cross compiler's libgcc.a
(e.g. /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a), and compile with

> make -C platform/common/helix CROSS_COMPILE=$CROSS_COMPILE LIBGCC=$LIBGCC
```
configure --platform=generic
make
```

This will result in a shared library named ${CROSS_COMPILE}helix_mp3.so. Copy
this as libhelix.so to where the PicoDrive binary is on the target device.
To compile PicoDrive as a libretro core, use this command:

```
make -f Makefile.libretro
```

Also, the support for helix must be enabled in PicoDrive by compiling with
### Helix MP3 decoder for ARM

> make PLATFORM_MP3=1
This switch is automatically enabled for Gamepark Holdings devices (gp2x,
caanoo and wiz). Without installing libhelix.so those devices will not play
For 32 bit ARM platforms, the optimized helix MP3 decoder can be used to play
MP3 audio files with CD games. Due to licensing issues, the helix source files
cannot be provided here; if you have obtained the sources legally, place them in
the `platform/common/helix` directory.

To compile the helix sources:

- Set the environment variable `CROSS_COMPILE` to your cross compiler prefix
(e.g. `arm-linux-gnueabi-`)
- Set the environment variable `LIBGCC` to your cross compiler's `libgcc.a`
(e.g. `/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a`)
- Run the command:
```
make -C platform/common/helix CROSS_COMPILE=$CROSS_COMPILE LIBGCC=$LIBGCC
```
- Copy the resulting shared library named `${CROSS_COMPILE}helix_mp3.so` as
`libhelix.so` to the directory containing the PicoDrive binary on the target device.

In addition, helix support must be enabled in PicoDrive itself by compiling with:

```
make PLATFORM_MP3=1
```

This switch is enabled automatically for Gamepark Holdings devices (`gp2x`,
`caanoo` and `wiz`). Without installing `libhelix.so`, these devices will not play
MP3 audio.

### Installing

### installing
The release script produces packages or zip archives which have to be installed
manually on the target device. Usually this involves unpacking the archive or
copying the package to a directory on either the internal device storage or an
SD card. Device-specific instructions can be found on the internet.

The release scripts produces zip files which need to be installed on the
target device manually. Usually that means unpacking the file to some
directory on the device storage or on an SD card. See device specific
descriptions on the net.

Send bug reports, fixes etc to <[email protected]>
Send bug reports, fixes etc. to <[email protected]>
1 change: 1 addition & 0 deletions cpu/DrZ80/drz80.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
;@ Reesy's Z80 Emulator Version 0.001

;@ (c) Copyright 2004 Reesy, All rights reserved
;@ (c) Copyright 2021-24 irixxxx, All rights reserved
;@ DrZ80 is free for non-commercial use.

;@ For commercial use, separate licencing terms must be obtained.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_arm.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Basic macros to emit ARM instructions and some utils
* Copyright (C) 2008,2009,2010 notaz
* Copyright (C) 2019-2024 kub
* Copyright (C) 2019-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_arm64.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Basic macros to emit ARM A64 instructions and some utils
* Copyright (C) 2019-2024 kub
* Copyright (C) 2019-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_mips.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Basic macros to emit MIPS32/MIPS64 Release 1 or 2 instructions and some utils
* Copyright (C) 2019-2024 kub
* Copyright (C) 2019-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_ppc.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Basic macros to emit PowerISA 2.03 64 bit instructions and some utils
* Copyright (C) 2020-2024 kub
* Copyright (C) 2020-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_riscv.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Basic macros to emit RISC-V RV64IM instructions and some utils
* Copyright (C) 2019-2024 kub
* Copyright (C) 2019-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/drc/emit_x86.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Basic macros to emit x86 instructions and some utils
* Copyright (C) 2008,2009,2010 notaz
* Copyright (C) 2019-2024 kub
* Copyright (C) 2019-2024 irixxxx
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion cpu/sh2/compiler.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* SH2 recompiler
* (C) notaz, 2009,2010,2013
* (C) kub, 2018-2024
* (C) irixxxx, 2018-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/32x/32x.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2009,2010,2013
* (C) irixxxx, 2019-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion pico/32x/draw.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2009,2010
* (C) kub, 2019
* (C) irixxxx, 2019-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion pico/32x/draw_arm.S
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@*
@* PicoDrive
@* (C) notaz, 2010
@* (C) kub, 2019
@* (C) irixxxx, 2019-2023
@*
@* This work is licensed under the terms of MAME license.
@* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion pico/32x/memory.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2009,2010,2013
* (C) kub, 2019
* (C) irixxxx, 2019-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
2 changes: 1 addition & 1 deletion pico/32x/memory_arm.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* PicoDrive 32X memory access functions, assembler version
* (C) KUB, 2018
* (C) irixxxx, 2018-2021
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/32x/pwm.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* PicoDrive
* (C) notaz, 2009,2010,2013
* (C) irixxxx, 2019-2023
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/32x/sh2soc.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* SH2 peripherals/"system on chip"
* (C) notaz, 2013
* (C) irixxxx, 2019-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/cart.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* PicoDrive
* (c) Copyright Dave, 2004
* (C) notaz, 2006-2010
* (C) irixxxx, 2020-2024
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/carthw/carthw.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Support for a few cart mappers and some protection.
* (C) notaz, 2008-2011
* (C) irixxxx, 2021-2022
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
1 change: 1 addition & 0 deletions pico/carthw/svp/compiler.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* SSP1601 to ARM recompiler
* (C) notaz, 2008,2009,2010
* (C) irixxxx, 2019-2023
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.
Expand Down
Loading

0 comments on commit c19eb8c

Please sign in to comment.