SDL-based reimplementation of the classic Chinese-language RPG "Xiān jiàn Qí Xiá Zhuàn" (also known as PAL).
Clone or download
Pull request Compare This branch is 13 commits ahead of sdlpal:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
3ds Fix 3DS Makefile and README Jun 14, 2018
3rd update SDL; fix mojave render presentation bug Oct 7, 2018
adplug Vita: merge latest changes Oct 22, 2018
android android hack for native file operation ( for sdlpal#86 ); obsolete co… May 31, 2018
docs Vita: merge latest changes Oct 22, 2018
emscripten emscripten tweaks Oct 20, 2018
incomplete_ports GLSL filter system May 15, 2018
ios merge touchoverlay to represent shader; fix touchoverlay display prob… Oct 20, 2018
libmad Eliminate more warnings & fix one typo bug May 7, 2017
liboggvorbis silenced compiler warnings Nov 5, 2017
macos add parameter uniform support & runtime switch/step handling Oct 20, 2018
native_midi Bump copyright to 2018 May 1, 2018
psp2 Vita: this port doesn't need ogg and mp3 support. Fix annoying warnin… Oct 19, 2018
scripts use bintray as prereleases storage that travis-ci built Aug 9, 2018
shaders GLSLP: enable filter_linear default Oct 20, 2018
tests Added the README file Feb 26, 2017
unix Message optimize in git revision generating Jun 7, 2018
wii Fix win32/unix GUI Jun 3, 2018
win32 replace UCS-2 encoded strings with baked-in UTF-8 Oct 20, 2018
winrt replace UCS-2 encoded strings with baked-in UTF-8 Oct 20, 2018
.appveyor.yml CI tweaks & bugfixes Aug 22, 2018
.gitignore macOS: fix random crash Aug 4, 2018
.gitmodules Native MIDI: Completely fix MinGW compilation problem May 4, 2017
.travis.yml disable bintray deployment uses git commit message, avoid it denies w… Oct 17, 2018
AUTHORS Update documentation files for github pages Apr 30, 2018
LICENSE add github-style license Aug 16, 2018
README.md Fix github pages build error Apr 30, 2018
SDL_stbimage.h glslp parser done; texture filter/wrapmode added; most singlepass gls… Oct 20, 2018
_config.yml markdown: update links as relative; set theme jekyll-theme-cayman Jun 14, 2017
ascii.h Bump copyright to 2018 May 1, 2018
audio.c Vita: merge latest changes Oct 22, 2018
audio.h Vita: merge latest changes Oct 22, 2018
aviplay.c Bump copyright to 2018 May 1, 2018
aviplay.h Bump copyright to 2018 May 1, 2018
battle.c bugfix: repeating monolithic magic across battles crash reported by @… Aug 16, 2018
battle.h fix sdlpal#103 (sdlpal#112) Oct 17, 2018
bintray.json use bintray as prereleases storage that travis-ci built Aug 9, 2018
codepage.h Bump copyright to 2018 May 1, 2018
common.h add shim; make win32 ver able to show wide charactor in title Oct 20, 2018
ending.c Bump copyright to 2018 May 1, 2018
ending.h Bump copyright to 2018 May 1, 2018
fight.c fix sdlpal#103 (sdlpal#112) Oct 17, 2018
fight.h bugfix: coop menu selectable should be binding to is_dying instead of… Aug 21, 2018
font.c Bump copyright to 2018 May 1, 2018
font.h Bump copyright to 2018 May 1, 2018
fontglyph.h Bump copyright to 2018 May 1, 2018
fontglyph_cn.h Add separate font flavors for Simplified Chinese, Traditional Chinese… Oct 28, 2017
fontglyph_jp.h Add separate font flavors for Simplified Chinese, Traditional Chinese… Oct 28, 2017
fontglyph_tw.h Add separate font flavors for Simplified Chinese, Traditional Chinese… Oct 28, 2017
game.c Bump copyright to 2018 May 1, 2018
game.h Bump copyright to 2018 May 1, 2018
global.c fix sdlpal#107; avoid over-treatment cost MP infinitly, both in singl… Oct 14, 2018
global.h Bump copyright to 2018 May 1, 2018
glslp.c add parameter uniform support & runtime switch/step handling Oct 20, 2018
glslp.h add parameter uniform support & runtime switch/step handling Oct 20, 2018
input.c Vita: merge latest changes Oct 22, 2018
input.h Vita: merge latest changes Oct 22, 2018
itemmenu.c fix sdlpal#110; make cursor appearing logic in item/magic selection m… Oct 14, 2018
itemmenu.h Bump copyright to 2018 May 1, 2018
magicmenu.c fix sdlpal#110; make cursor appearing logic in item/magic selection m… Oct 14, 2018
magicmenu.h Bump copyright to 2018 May 1, 2018
main.c emscripten tweaks Oct 20, 2018
main.h Bump copyright to 2018 May 1, 2018
map.c Bump copyright to 2018 May 1, 2018
map.h Bump copyright to 2018 May 1, 2018
midi.c Bump copyright to 2018 May 1, 2018
midi.h Bump copyright to 2018 May 1, 2018
mini_glloader.c add parameter uniform support & runtime switch/step handling Oct 20, 2018
mini_glloader.h add parameter uniform support & runtime switch/step handling Oct 20, 2018
mp3play.c Bump copyright to 2018 May 1, 2018
oggplay.c Bump copyright to 2018 May 1, 2018
overlay.c Bump copyright to 2018 May 1, 2018
palcfg.c UWP relative fixes: file picker, relative reference, bugfixes etc Oct 20, 2018
palcfg.h glslp parser done; texture filter/wrapmode added; most singlepass gls… Oct 20, 2018
palcommon.c Bump copyright to 2018 May 1, 2018
palcommon.h Bump copyright to 2018 May 1, 2018
palette.c Bump copyright to 2018 May 1, 2018
palette.h Bump copyright to 2018 May 1, 2018
play.c Bump copyright to 2018 May 1, 2018
play.h Bump copyright to 2018 May 1, 2018
players.h Vita: merge latest changes Oct 22, 2018
res.c Bump copyright to 2018 May 1, 2018
res.h Bump copyright to 2018 May 1, 2018
resampler.c Move most platform-specific code into separate files. Feb 21, 2017
resampler.h Fix rix play Jun 28, 2015
riff.h More robust AVI playing May 28, 2017
rixplay.cpp Vita: merge latest changes Oct 22, 2018
rngplay.c Bump copyright to 2018 May 1, 2018
rngplay.h Bump copyright to 2018 May 1, 2018
scene.c Bump copyright to 2018 May 1, 2018
scene.h Bump copyright to 2018 May 1, 2018
script.c replace UCS-2 encoded strings with baked-in UTF-8 Oct 20, 2018
script.h Bump copyright to 2018 May 1, 2018
sdlpal.cfg.example Update documentation files for github pages Apr 30, 2018
sdlpal.ico Change ICON & fix dialog Jul 15, 2015
sound.c Vita: merge latest changes Oct 22, 2018
stb_image.h glslp parser done; texture filter/wrapmode added; most singlepass gls… Oct 20, 2018
text.c Vita: merge latest changes Oct 22, 2018
text.h add back lacking image for gourd alchemy Aug 9, 2018
ui.c Bump copyright to 2018 May 1, 2018
ui.h Bump copyright to 2018 May 1, 2018
uibattle.c compile fix Oct 17, 2018
uibattle.h logic: fix ignored selection when only one enemy makes action missing… Jun 9, 2018
uigame.c fix sdlpal#107; avoid over-treatment cost MP infinitly, both in singl… Oct 14, 2018
uigame.h Bump copyright to 2018 May 1, 2018
util.c make LOGLEVEL_FATAL terminatable anywhere Oct 20, 2018
util.h GLSL filter system May 15, 2018
video.c Vita: merge latest changes Oct 22, 2018
video.h add parameter uniform support & runtime switch/step handling Oct 20, 2018
video_glsl.c bugfix: avoid wrong filter be dumped and makes next time startup wrong Oct 20, 2018
video_glsl.h add parameter uniform support & runtime switch/step handling Oct 20, 2018
yj1.c Bump copyright to 2018 May 1, 2018

README.md

SDLPAL

Travis CI AppVeyor

SDLPAL is an SDL-based open-source cross-platform reimplementation of the classic Chinese RPG game Xiān jiàn Qí Xiá Zhuàn (Chinese: 仙剑奇侠传/仙劍奇俠傳) (also known as Chinese Paladin or Legend of Sword and Fairy, or PAL for short).

Google Play

LICENSE

SDLPAL is originally created by Wei Mingzhi from 2009. Now it is owned by the SDLPAL development team. Please see AUTHORS for full author list.

Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
Copyright (c) 2011-2018, SDLPAL development team.
All rights reserved.

SDLPAL is distributed under the terms of GNU General Public License, version 3 (or any later version) as published by the Free Software Foundation. See LICENSE for details.

Many of the ideas of this program are based on documents from PAL Research Project, and portions of the code are based on the work done by Baldur and louyihua.

This program made extensive use of the following libraries:

This program does NOT include any code or data files of the original game, which are proprietary and copyrighted by SoftStar Inc.

Chat Room

Want to chat with other members of the SDLPal community?

We have a Gitter Room which you can join below.

Join the chat at https://gitter.im/sdlpal/sdlpal

Building the game

Currently, SDLPAL supports the following platforms:

  • Desktop platforms: Windows (both Windows Desktop and Universal Windows Platform), Linux and macOS
  • Mobile platforms: Android, iOS and Windows
  • Home consoles: 3DS, WII, PSP and others (some of them are not actively maintained now)

Before start building, you may find some inspiration from reading Our travis scripts.

To build SDLPAL, there are three major steps you need to do:

  1. Clone the source code from Github into your local folder using git or through corresponding GUI:
$ cd <parent-path-of-sdlpal>
$ git clone https://github.com/sdlpal/sdlpal.git
  1. Update all the submodules used by SDLPAL using git submodule or through corresponding GUI:
$ cd <parent-path-of-sdlpal>/sdlpal
$ git submodule update --init --recursive
  1. Follow the platform-specific steps listed below.

Windows

Visual Studio

To build SDLPAL as a Windows desktop app, you can use Microsoft Visual Studio 2017 to open the solution file sdlpal.sln under the win32 directory.

To build SDLPAL as a Universal Windows Platform app, you can use Microsoft Visual Studio 2017 to open the solution file SDLPal.UWP.sln under the winrt directory.

MinGW

To build SDLPAL as a Windows desktop app, you can also use MinGW. Steps for building under MinGW varies depends on the compiling environment you have:

  • If you need to compile SDLPAL under Windows shell environment, please go to the root of the source code tree and type:
C:\sdlpal> cd win32
C:\sdlpal> make -f Makefile.mingw
  • If you need to compile SDLPAL under msys shell environment, please go to the root of the source code tree and type:
$ cd win32
$ make
  • If you need to cross-compile SDLPAL under Linux shell environment, please go to the root of the source code tree and type:
$ cd win32
$ # This builds a 32-bit executable.
$ make HOST=i686-w64-mingw32-
$ # This builds a 64-bit executable.
$ make HOST=x86_64-w64-mingw32-

Linux or Unix

To build the game, please go to the root of the source code tree and type:

$ cd unix
$ make

You also need to have SDL 2.0 development files installed in the system. The compiled executable should be generated with the filename sdlpal at the current directory. By default, SDLPAL uses the FLTK library to provide setting GUI at launch. If you do not want to use the library, please define he macro PAL_NO_LAUNCH_UI in the Makefile. SDLPAL should also be able to compile and run under other Unix-like systems, however it's not tested.

macOS (OS X)

To compile, open Pal.xcodeproj with Xcode, and click Build. You need to have SDL framework installed at /Library/Frameworks.

iOS

To compile, please first install dependencies via CocoaPods following the above instruments, then open the project ios/SDLPal/SDLPal.xcworkplace with Xcode, and click Build.

$ cd iOS/SDLPAL
$ sudo gem install cocoapods # ONLY need do once on one machine
$ pod install # ONLY need do once in one repository

Android

To build the game, open the android directory through Android Studio, and click Make Project.

Nintendo 3DS

To build the game, please go to the root of the source code tree and type:

cd 3ds
make
make cia

You need to have DevkitPro ARM and SDL 1.2 for 3DS portlib installed. Creating a CIA package is not required to play the game, but in order to to that, a seperate makerom tool is required. The compiled executable should be generated with the filename sdlpal at the current directory.

Nintendo Wii

To build the game, please go to the root of the source code tree and type:

cd wii
make

You need to have DevkitPro PPC and SDL 1.2 for Wii portlib installed.

PS Vita

To build the game, please go to the root of the source code tree and type:

cd psp2
make

You need to have vitasdk toolchain with SDL2, vita2d_fbo and vitashaders installed.

Other platforms

To be written.

Choosing the battle system

By default, SDLPAL builds a "classic" turn-based battle system which is designed to be 100% the same as the original game.

SDLPAL also provides a revised battle system (deprecated and will be removed in future) which is more exciting yet somewhat harder than the original game. If you prefer this battle system, please define the macro ENABLE_REVISIED_BATTLE in Makefile or in common.h and recompile the project.

Running the game

The data files required for running the game are not included with the source package due to copyright issues, so you need to obtain them from a licensed game copy before you can run the game.

To run the game, copy all the files in the original game CD to a directory, then copy the built SDLPAL executable to the same directory, and run the executable.

Note that the filenames of data files should be all in lower-case under systems that use case-sensitive filesystems such as Linux or other Unix-like operating systems.

If you prefer using MIDI as background music source, please note that the MIDI playing feature is not yet complete under every supported platform. Currently, offical support is provided under Windows Desktop, Universal Windows Platform, Android, iOS and macOS. There is also a preliminary support for Linux that relys upon package timidity. Other platforms do not support playing MIDI for now.

Configuring the game

PAL has several variants using different and incompatible resource files, and SDLPAL supports several configuration options for supporting such variants. The default values are used to support the resources from original DOS version. If you want to change these configurations, you have two options: through the configuration GUI or by manipulating the configuration file sdlpal.cfg manually.

GUI

The configuration GUI provides options for you to change the most common configuration options. If you launch SDLPAL for the first time, it will bring you to the configuration GUI by default. Once you have saved configurations from the GUI, the GUI will not to show again on subsequent launches. However, you have the opportunity to bring the GUI back on fatal game program errors or through the in-game system menu.

Currently, the configuration GUI is available under the following platforms:

  • Desktop platforms: Windows (both Windows Desktop and Universal Windows Platform) and Linux
  • Mobile platforms: Android, Windows and iOS

Configuration GUIs for macOS is still unavailable for now and we welcome contributions to implement it.

Manually

To set the configuration options manually, create a file named as sdlpal.cfg (make sure to use lower-case file name in case-sensitive filesystems) in the game directory created by the above step. Please refer to the example file for format specfication.

Reporting issues

If you find any issues of SDLPAL, please feel free to report them to the development team through Github's issue tracking system using either English or Chinese.

Contributing to the game

Any original code & documentation contributions are welcomed as long as the contributed code & documentation is licensed under GPL. You can use Github's pull request system to submit your changes to the main repository here. But remember, as a step to keep the quality of code, you should write corresponding unit tests before your changes can be merged. The guidance of writting unit tests can be found here.