SDLPAL
SDLPAL is an SDL-based cross-platform reimplementation of the classic Chinese RPG Legend of Sword and Fairy (also known as PAL).
Check the link above for a web-based demo of SDLPAL. It should work on most modern browsers (e.g., Google Chrome, Mozilla Firefox, Safari), though compatibility issues may exist on some platforms. To play, please prepare a ZIP file containing the original game resource data.
Gitee Mirror (Gitee 镜像)
If you experience difficulties downloading code from GitHub in mainland China, please use our Gitee mirror (updated hourly).
License
SDLPAL was originally created by Wei Mingzhi. It is now maintained by the SDLPAL development team. Please see AUTHORS for the full list of contributors.
Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
Copyright (c) 2011-2026, SDLPAL development team.
All rights reserved.SDLPAL is distributed under the terms of the GNU General Public License, version 3, as published by the Free Software Foundation. See LICENSE for details.
Many concepts in this program are based on documents from the PAL Research Project, and portions of the code are based on work by Baldur and louyihua.
This program makes extensive use of the following libraries:
SDL / SDL_mixer
libmad, libogg & libvorbis, libopus & opusfile
FLTK, TinySoundFont
OPL player from Adplug
OPL emulation cores from DOSBOX, MAME, and Chocolate Doom projects
Audio resampler from foo_input_adplug
AVI player from FFmpeg
Image decoder from stb
This program does NOT include any code or data files from the original game, which are proprietary and copyrighted by SoftStar Inc.
We recommend purchasing the original game from Steam to obtain the required data files.
FAQ
Please refer to the Wiki.
Building the Game
SDLPAL currently supports the following platforms:
Desktop: Windows (Desktop & UWP), GNU/Linux, and macOS.
Mobile: Android, iOS, and Windows Phone/Mobile.
Consoles: 3DS, Wii, PSP, and others (some may not be actively maintained).
For build environment inspiration, you can review our CI scripts.
General Build Steps
Clone the repository:
$ git clone https://github.com/sdlpal/sdlpal.git $ cd sdlpalUpdate submodules:
$ git submodule update --init --recursiveFollow platform-specific instructions:
Windows
Visual Studio: - For Desktop, open
win32/sdlpal.slnin Visual Studio 2017 or later.For UWP, open
winrt/SDLPal.UWP.sln.
MinGW:
Windows CMD:
cd win32 && make -f Makefile.mingwMSYS:
cd win32 && makeLinux Cross-compile:
cd win32 && make HOST=i686-w64-mingw32-(orx86_64for 64-bit).
GNU/Linux or Unix
Run cd unix && make. Ensure SDL 2.0 development files are installed. The executable sdlpal will be generated in the current directory. By default, it uses FLTK for the launch GUI; to disable this, define PAL_NO_LAUNCH_UI in the Makefile.
macOS
Open Pal.xcodeproj with Xcode and build. Ensure the SDL framework is installed in /Library/Frameworks.
iOS
Install dependencies via CocoaPods, then open ios/SDLPal/SDLPal.xcworkspace in Xcode.
$ cd iOS/SDLPAL
$ pod installAndroid
Open the android directory in Android Studio and select Make Project.
Note:
android/app/src/main/java/org/libsdl/appis a symlink. Ensure your Git client handles symbolic links correctly.Tip: On Windows, keep the repository path short (e.g., at the drive root) to avoid path length issues.
Running the Game
Resource files are not included. You must copy the original game data files into a directory, place the built SDLPAL executable in that same directory, and then run it.
Important: On case-sensitive filesystems (like Linux/macOS), ensure all game data filenames are in lower-case.
MIDI Support
MIDI support varies by platform. It is officially supported on Windows, Android, iOS, and macOS. GNU/Linux support is preliminary and requires the timidity package. Other platforms do not currently support MIDI.
Configuration
SDLPAL supports various versions of the original game through configuration.
GUI: On the first launch, a configuration window will appear. You can access it later via the in-game menu or after a crash. (Currently unavailable on macOS).
Manual: Create a
sdlpal.cfgfile in the game directory. Refer to sdlpal.cfg.example for the format.
Contributing & Issues
Issues: Report bugs via GitHub Issues in English or Chinese.
Contributions: PRs are welcome! Code must be licensed under the GPL. To maintain code quality, please include unit tests for new features. See the testing guide for details.
成为第一条评论!
Nobody's responded to this post yet. Add your thoughts and get the conversation going.