Skip to content

Commit fc9f2d4

Browse files
committed
Merge remote-tracking branch 'upstream'
2 parents 3cf1e26 + 975cdaf commit fc9f2d4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4749
-1071
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
submodules: true
2525
- name: make
2626
run: LDFLAGS=-Wl,--no-undefined make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.libretro
27+
- name: artifacts
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: Libretro-linux
31+
path: picodrive_libretro.so
2732

2833
build-win32:
2934
runs-on: ubuntu-latest
@@ -234,6 +239,7 @@ jobs:
234239
run: |
235240
git config --global --add safe.directory $PWD
236241
ver=$(cut -d'"' -f2 platform/common/version.h)-$(git rev-parse --short HEAD)
242+
# toolchain has EGL, but retrofw 2.2 has not, so disable it
237243
./configure --platform=retrofw
238244
make -j$(getconf _NPROCESSORS_ONLN)
239245
mv PicoDrive.opk PicoDrive-retrofw-$ver.opk

ChangeLog

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,221 @@
1+
2.05 (2025-05-31)
2+
+ added lightgun support for SDL platforms, using the host mouse for Menacer, Justifier, and Light Phaser
3+
* improved handling of OpenGL (may enable OpenGL video mode on devices with JZ4770 CPUs)
4+
* improved SDL Joystick/Pad support (should now work with what devices are supported by SDL)
5+
* improved support for Windows platform
6+
* slightly improved SDL window resize handling
7+
* slightly improved UI for keyboard settings
8+
* fixed major VDP window rendering regression (games using a VDP window with color table != 0)
9+
* fixed interlaced mode rendering in ARMv7 assembly
10+
* fixed VDP sprite parsing for MD (fixes a test case in SpriteMaskingTestRom)
11+
* fixed crash in VDP rendering (DMA pointer wraparound)
12+
* fixed pads not initialized correctly after state load
13+
* fixed 32X VINT timing
14+
* improved 32X interrupt handling (needs work, still not fully as the SH7604 handles it)
15+
* improved 32X WDT handling
16+
* several 32X CPU snychronisation fixes
17+
18+
2.04 (2025-04-01)
19+
+ added mouse support for SDL platforms, using the host mouse for Sega Mouse, Pico Pen
20+
* improved scaling when resizing the window on SDL platforms (Linux, OSX, Windows)
21+
+ added preselect window sizes for integer scaling for SDL platforms
22+
+ added fullscreen mode for SDL platforms (well, sort of)
23+
* attempted to improve pad detection for ps2
24+
+ noticeably improved save state accuracy (for retroarch run-ahead)
25+
* made the DC filter reacting faster (closer to real MD according to notaz' measurements)
26+
* fixed a crash when using MD VDP hscroll in conjunction with 2-cell mode
27+
* fixed handling shadow/highlight in MD VDP layer A window (fixes Int. Super Star Soccer)
28+
* added toggling the field bit in MD VDP status for interlace modes
29+
+ added some support for MD VDP non-linear color DAC (Knuckles Chaotix color test)
30+
* fixed MD+ playing binary tracks as audio (fixes a bug in DOOM Fusion)
31+
* improve MCD CPU sync (fixes Shadow of the Beast)
32+
* fixed 32X handling of MD H32 mode (MD and 32X layer have 4 px offset)
33+
* fixed GG region code reading (fixes Pop Breaker)
34+
* fixed GG screen in 224 and 240 line mode (fixes Micro Machines)
35+
* fixed GG/SMS display off after scanline start (fixes Madou I)
36+
37+
2.03 (2025-02-15)
38+
+ added support for Pico keyboard (thanks @qufb for supplying this, literally years ago. Mea maxima culpa!)
39+
+ added support for SC-3000 keyboard and cassette drive
40+
+ added configurable mapping for physical keyboard
41+
+ added virtual keyboard for devices not having a physical keyboard
42+
* improved window handling
43+
* fix bug in libretro frontend for Pico pad handling (thanks @theLilaQ)
44+
* fixes for PS2 vsync handling (thanks @fjtrujy; this is still not being perfect)
45+
* fix a crash for MD when rendering in 2-cell VSRAM mode (thanks @notaz for pointing this out)
46+
* more fixes for MD+ (for running Doom 32x Resurrection and Fusion)
47+
* fix for 32X screen rendering (for running Sonic Robo Blast 2)
48+
* fix handling of the 32X cycles UI option
49+
* other minor bug fixes and optimizations
50+
51+
2.02 (2024-12-29)
52+
* fixes for MSU and MD+ (for running Doom 32x Resurrection and Fusion)
53+
+ minimal SMS 3D glasses support
54+
* updates to libretro common (apparently fixes some obscure bugs)
55+
* some CD fixes
56+
* fix a cartridge mapping bug for ARM32 (cyclone)
57+
* fixes for 32X watchdog timer handling (for running Sonic Robo Blast 2, thanks @notaz)
58+
* other minor bug fixes
59+
60+
2.01 (2024-10-17)
61+
+ added windows build
62+
+ added integer scaling for SDL window mode
63+
+ added support for mode 1
64+
+ added support for MD+/32X+
65+
* improved CD emulation compatibility
66+
+ added support for J-cart games (with 2 additional on-cart controller ports)
67+
+ added some more mappings for Mega Drive games
68+
+ added PS2 support for multitap and up to 4 controllers
69+
* fixes for PS2 and PSP (audio, menu)
70+
* other bug fixes
71+
72+
2.00 (2024-07-19)
73+
* improved system detection by extension
74+
* improved save/load (Z80, VDP state)
75+
* improved some auto mappings for SMS
76+
+ added stereo for YM2612 DAC output
77+
+ updated libchdr for zstd support
78+
* fixes for pandora
79+
* changed miyoo build to ipk
80+
* switched miyoo menu key to RESET
81+
+ added some more MD cartridges
82+
* added more keys for some opendingux devices
83+
* several fixes for SH2 DRC
84+
* several VDP rendering fixes
85+
* a lot of other bug fixes (32X reset, Z80 timing, etc.)
86+
87+
2.00-beta3 (2024-04-28)
88+
* bug fixes (VDP reset, Z80 reset)
89+
* improvements for Sega/Mega CD
90+
91+
2.00-beta2 (2024-03-26)
92+
+ substantial overhaul of Sega Pico UI
93+
supports png images for pad overlays and storyware, new hotkeys, new option (see below)
94+
* improved z80 and 68k timing for md and alike
95+
* improved timing for 68k access to z80 bus
96+
* improved 68k open bus read
97+
+ implemented "busy" status bit in ym2612
98+
* fixes for big endian CPUs for state save/load
99+
100+
2.00-beta1 (2024-03-03)
101+
+ added ps2 standalone target (thanks to fjtrujy for the fundamentals)
102+
* improved psp support
103+
* fixed menu RGB/BGR handling
104+
* fixed several Z80 related timing inaccuracies
105+
* slightly increased volume for CD audio
106+
* other bug fixes
107+
108+
2.00-alpha3 (2024-01-13)
109+
* improved pandora layer handling
110+
+ added handling of "fantom bitmap" (DMA to background color)
111+
+ added SMS option to select TMS bitmap for legacy gfx modes
112+
+ added stereo sound support for GG
113+
+ overall revision of Pico support (correct sound, better handling of pen, better save/load handling)
114+
115+
2.00-alpha2 (2023-12-14)
116+
* bug fixes and improvements for psp, miyoo, opendingux, pandora
117+
+ UI fixes and improvements
118+
* other bugfixes
119+
120+
2.00-alpha1 (2023-11-09)
121+
+ improved MD FM sound (DAC ladder effect/clipping, filtering, native rate)
122+
+ added support for 32X using MD H32 mode
123+
+ added support for MSU-MD (cartridge+audio CD for MD and 32X)
124+
+ added basic MD multiplayer support (team player, 4-way play)
125+
+ added mapping for some additional Mega Drive games
126+
+ added support for both Overdrive demos
127+
* improved save/load handling (SVP, MD mapping, MCD/32X cycle counter)
128+
+ added more mappers for SMS cartridges
129+
+ added some support for GG cartridges running in SMS mode
130+
* improved SMS graphics if 1st column is blanked
131+
+ added missing TMS9918 modes
132+
+ added SG-1000/SC-3000 support (no kbd yet, upcoming)
133+
+ added additional handhelds/host systems (miyoo, gkd, rg99, odbeta)
134+
* improved handling of files by extension
135+
+ revised menu (more consistent options handling, option profiles)
136+
+ added dynarec support for PS3 using libretro
137+
* add CI to repo (including artifact uploading for the curious)
138+
* improved psp support
139+
+ revived pandora support
140+
* a plethora of bug fixes and minor improvements (also most probably new bugs ;-))
141+
142+
1.99 (2021-11-14)
143+
+ improved Master System support
144+
+ added SRAM save support for SMS cartridges
145+
+ added a lot of mappers for SMS cartridges
146+
+ added Game Gear support
147+
+ added Master System TMS9918 modes 0 and 2
148+
+ added upscaling for improved aspect ratios
149+
* improved Sega/Mega CD support
150+
+ added mapping for some additional Mega Drive games
151+
+ improvements for libretro support (new menu structure courtesy of jdgleaver)
152+
* a load of bug fixes and minor improvements (also most probably new bugs ;-))
153+
154+
1.98 (2021-04-02)
155+
+ CHD support for CD images
156+
+ mp3 playback support via minimp3
157+
+ big endian host platform support
158+
+ sound low pass filtering for more realistic sound (original HW has analog low pass filter)
159+
+ menu revision
160+
* improvements for 8bit fast rendererer (mainly better PAL support)
161+
+ basic support for legacy dingux (somewhat limited) and retrofw devices
162+
+ experimental support for PSP (incomplete)
163+
* a load of bug fixes and minor improvements (also most probably new bugs ;-))
164+
165+
1.97 (2020-11-23)
166+
+ powerpc support for DRC
167+
+ 2x mode in SDL video overlay mode for better color resolution
168+
+ FM support for Master System (YM2413) (thanks to @hiroshica for supplying)
169+
* bug fixes
170+
171+
1.96 (2020-05-16)
172+
+ added YM2612 SSG-EG emulation
173+
* optimisations for SH2 DRC
174+
+ added a DC filter to 32X PWM sound to reduce clipping
175+
* improved VDP emulation (some Overdrive 2 support)
176+
+ completely rewrote VDP FIFO handling for improved timing accuracy
177+
+ revived SVP DRC for ARM
178+
179+
1.95 (2019-11-27)
180+
+ added RISC-V code emitter for SH2 DRC
181+
* SH2 DRC optimisations
182+
183+
1.94 (2019-10-12)
184+
+ revive Helix Mp3 decoder support for ARM (Helix sources not supplied due to licensing)
185+
* update GPH device support to use newer GCC 4.7
186+
* ARM specific optimisations (speedup for emulated memory access, 32X draw code, DRC disassemblers)
187+
* a lot of SH2 DRC and 32X emulation fixes to improve game compatibility
188+
* improved DRC code generation (generated code now noticeably faster)
189+
* improved SH2 DRC memory access functions (added 32 bit versions, sign extension)
190+
* improved SH2 DRC register caching
191+
+ added branch caching to SH2 DRC
192+
* optimisations to DRC ARM backend (code reordering, literal pool)
193+
+ added polling/idling loop detection and basic loop optimisation to SH2 DRC
194+
+ added call/return cache for SH2 DRC
195+
+ added cache for communication areas between 32X CPUs
196+
+ added T bit caching to ARM SH2 DRC backend (kept in host CPU flags as long as possible if possible)
197+
+ added x86_64. MIPS and aarch64 backends to SH2 DRC
198+
* 32X DMA emulation optimisation
199+
+ revised SH2 DRC branch handling and host code block linking
200+
+ added 32X PWM interrupt optimisation (configurable since it may not work with all games)
201+
* improved auto frameskipping
202+
203+
1.93 (2019-01-25)
204+
+ implemented SSF2 mapper for 32X
205+
+ revived x86 DRC
206+
+ added 68K overclocking
207+
+ improved FAME/C 68K emulation speed
208+
+ support for SMS cheats
209+
* 32X DRC bug fixes and improvements
210+
* other bug fixes
211+
212+
1.92 (2017-10-04)
213+
+ some support for obscure VDP features (128K, debug register)
214+
+ import SPI EEPROM from GPGX
215+
* fixes for FAME/C 68k emulation
216+
+ added Raspberry Pi 1,2 support
217+
+ other bug fixes
218+
1219
1.91 (2013-10-12)
2220
+ Added OpenDingux support (Paul Cercueil).
3221
* Save directory changed to ~/.picodrive/ for generic platform build

Makefile

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ endif
4444

4545
ifeq "$(ASAN)" "1"
4646
CFLAGS += -fsanitize=address -fsanitize=leak -fsanitize=bounds -fno-omit-frame-pointer -fno-common -O1 -g
47-
LDLIBS += -fsanitize=address -fsanitize=leak -fsanitize=bounds -static-libasan
47+
LDFLAGS += -fsanitize=address -fsanitize=leak -fsanitize=bounds -static-libasan
4848
else
4949
ifeq "$(DEBUG)" "0"
5050
CFLAGS += -O3 -DNDEBUG
@@ -173,26 +173,16 @@ use_inputmap ?= 1
173173
PLATFORM := generic
174174
endif
175175
ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2"))
176-
CFLAGS += -DHAVE_GLES -DRASPBERRY
177-
CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/
178-
LDFLAGS += -ldl -lbcm_host -L/opt/vc/lib
179-
# Stupid renaming occured in latest raspbian...
180-
ifneq (,$(wildcard /opt/vc/lib/libbrcmGLESv2.so))
181-
LDFLAGS += -lbrcmEGL -lbrcmGLESv2
182-
else
183-
LDFLAGS += -lEGL -lGLESv2 # on raspi GLESv1_CM is included in GLESv2
184-
endif
176+
CFLAGS += -DHAVE_GLES -DEGL_NO_X11 -DSDL_BUFFER_3X -DSDL_REDRAW_EVT
185177
OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
186-
OBJS += platform/common/plat_sdl.o platform/common/input_sdlkbd.o
178+
OBJS += platform/common/plat_sdl.o platform/common/inputmap_kbd.o
187179
OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o
188180
OBJS += platform/libpicofe/linux/plat.o
189181
USE_FRONTEND = 1
190182
endif
191183
ifeq "$(PLATFORM)" "generic"
192-
#ifeq (y,$(shell echo "\#include <GLES/gl.h>" | $(CC) -E -xc - >/dev/null 2>&1 && echo y))
193184
ifeq "$(HAVE_GLES)" "1"
194-
CFLAGS += -DHAVE_GLES
195-
LDFLAGS += -lEGL -lGLESv1_CM
185+
CFLAGS += -DHAVE_GLES -DEGL_NO_X11
196186
endif
197187
CFLAGS += -DSDL_OVERLAY_2X -DSDL_BUFFER_3X -DSDL_REDRAW_EVT
198188
OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
@@ -298,13 +288,13 @@ ifeq "$(USE_FRONTEND)" "1"
298288

299289
# common
300290
OBJS += platform/common/main.o platform/common/emu.o platform/common/upscale.o \
301-
platform/common/menu_pico.o platform/common/config_file.o
291+
platform/common/menu_pico.o platform/common/keyboard.o platform/common/config_file.o
302292

303293
# libpicofe
304294
OBJS += platform/libpicofe/input.o platform/libpicofe/readpng.o \
305295
platform/libpicofe/fonts.o
306296
ifneq (,$(filter %HAVE_GLES, $(CFLAGS)))
307-
OBJS += platform/libpicofe/gl.o platform/libpicofe/gl_platform.o
297+
OBJS += platform/libpicofe/gl.o platform/libpicofe/gl_platform.o platform/libpicofe/gl_loader.o
308298
endif
309299

310300
# libpicofe - sound

Makefile.libretro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,13 +439,11 @@ else ifneq (,$(findstring armv,$(platform)))
439439
else ifeq ($(platform), emscripten)
440440
TARGET := $(TARGET_NAME)_libretro_$(platform).bc
441441
ARCH = unknown
442-
CFLAGS += -D__EMSCRIPTEN__
443442
ifeq ($(EMULATORJS_THREADS), 1)
444443
LDFLAGS += -pthread
445444
CFLAGS += -pthread
446445
CXXFLAGS += -pthread
447446
endif
448-
449447
STATIC_LINKING = 1
450448
STATIC_LINKING_LINK = 1
451449

@@ -661,7 +659,7 @@ SHARED ?= -shared
661659
LDFLAGS += $(SHARED) $(fpic)
662660

663661
ifeq ($(ARCH),)
664-
ARCH = $(shell $(CC) -dumpmachine | awk -F '-' '{print $$1}')
662+
ARCH = $(shell $(CC) $(CFLAGS) -dumpmachine | awk -F '-' '{print $$1}')
665663
endif
666664
PLATFORM = libretro
667665
NO_CONFIG_MAK = yes

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,49 @@ Further instructions can be found in `platform/base_readme.txt`.
2929
PicoDrive can use Storyware pages and pad overlays in png format in the same
3030
directory as the cartridge image. The selected page is displayed automatically
3131
if the pen is used on the storyware or pad. Details about how to correctly name
32-
the pages can be found in the *How to run Sega Pico games* section in
33-
`platform/base_readme.txt`.
32+
the pages can be found in `platform/base_readme.txt`.
33+
34+
### Sega Pico Pen and Sega Mouse
35+
36+
On all platforms with physical mouse support, PicoDrive can use real mouse
37+
input to emulate a Sega Mouse or the Pico Pen. A physical mouse can be operated
38+
in either a captured or uncaptured state, selectable via the `Capture mouse`
39+
hotkey. Mouse mode can be activated by setting `mouse` as the input device for
40+
one of the pads. It depends on the game as to which pad should be used for mouse
41+
input. More information is located in `platform/base_readme.txt`.
42+
43+
### Sega Menacer and Light Phaser and Konami Justifier
44+
45+
PicoDrive can use a physical mouse for light gun emulation on all platforms
46+
with mouse support. This can be activated by selecting an input device of
47+
either `light gun` or `justifier`. The `light gun` setting represents the Sega
48+
Menacer for the Mega Drive or the Light Phaser for the Master System; it may
49+
be attached to either pad input port. The `justifier` is only available on
50+
input 2. Supplementary information is provided in `platform/base_readme.txt`.
51+
52+
### Sega Pico and SC-3000 Keyboards
53+
54+
PicoDrive provides support for the Pico and SC-3000 keyboards. This can be
55+
enabled in the `Controls` configuration menu. Once enabled, keyboard input may
56+
be activated via the `Keyboard` emulator hotkey.
57+
58+
Both physical keyboard support and a virtual keyboard overlay are available.
59+
Physical keyboards are assigned a default key mapping corresponding to an
60+
American PC layout, but the mapping can be redefined in the `Controls`
61+
configuration menu. Note that only 'unmodified' physical key presses (e.g.
62+
`a`, `1` etc) can be mapped to emulated keyboard input; special characters
63+
entered via modifier/meta keys (e.g. `Ctrl`, `Shift` etc) will not work.
64+
Additional information may be found in `platform/base_readme.txt`.
65+
66+
### Sega SC-3000 Cassette Drive
67+
68+
In addition to keyboard support, PicoDrive emulates the SC-3000 cassette tape
69+
drive which may be used in conjunction with BASIC cartridges. Tape emulation
70+
includes an automatic start/stop feature, where the tape is only advanced when
71+
it is accessed by the SC-3000; manual pausing of the tape is unnecessary for
72+
multi-part loading or saving.
73+
74+
PicoDrive supports tape files in `WAV` and `bitstream` format.
3475

3576
### Gallery
3677

0 commit comments

Comments
 (0)