An enhancement ONScripter project porting to many platforms, especially web.
Last updated Jul 7, 2026
815
Stars
53
Forks
14
Issues
+1
Stars/day
Attention Score
85
Topics
Language breakdown
C++ 69.6%
C 14.9%
Java 10.8%
Shell 2.1%
CMake 1.4%
HTML 1.0%
โธ Files
click to expand
README
Onscripter-Yuri
windows, linux, mac, android, retroarch and psv. This project is base on ONScripter-Jh by SDL2.
Online Demo: lifegame, luasnow, noesis1 (lazyload)
PSV: psv-OnscripterJH
Android : Google PlayStore
Multi Platform: github action release
Now it supprts utf8 script with option --enc:utf8 !
As the original Onsscripter only support sjis or gbk encoding, you can aslo convert them to utf8 like iconv -f gbk -t utf8 0.txt -o 0.txt.
New features :
- script
--enc:sjis and gbk --enc:gbk script
- [x] utf8 script --enc:utf8 // since v0.7.6
- [x] nt2, nt3 script encryption (Mine exclusive format)
- [x] long click or touch to invoke menu
- render
--fullscreen or alt+enter, scretch to fullscreen by --fullscreen2 or f10
- [x] arbitary resolution --width, --height
- [x] gles2 sharpness rendering by --sharpness 1.0 parameter, fix bugs on windows
- platform
- bugfix
00.txt problem)
- [x] fix lua animation problem
- [x] fix button position wrong in fulllscreen, strech fullscreen // since v0.7.5beta4
- [x] fix android onresume gles null pointer
- [x] fix android file stat problem (save not found)
- develop
1. Usage
(1) general command
You can also put these option inons_args file.
bash
./onsyuri --help
./onsyuri --root /path/to/game --save-dir /path/to/save --font /path/default.ttf --enc:sjis
./onsyuri --width 1280 --height 720 --sharpness=3.1
./onsyuri --fullscreen2 # fullscreen1 alt+f, fullscreen2 f10 (toggle stretch)
Usage: onsyuri [option ...]
-h, --help show this help and exit
-v, --version show the version information and exit
load options:
-f, --font file set a TTF font file
-r, --root path set the root path to the archives
--save-dir set save dir
--debug:1 print debug info
--enc:[gbk|sjis|utf8] change encoding of the script, default is gbk
render options:
--window start in windowed mode
--width 1280 force window width
--height 720 force window height
--fullscreen start in fullscreen mode (alt+f or alt+enter)
--fullscreen2 start in fullscreen mode with stretch (f10 to toggle stretch)
--sharpness 3.1 use gles to make image sharp
--no-video do not decode video
--no-vsync turn off vsync
other options:
--cdaudio use CD audio if available
--cdnumber no choose the CD-ROM drive number
--registry file set a registry file
--dll file set a dll file
--enable-wheeldown-advance advance the text on mouse wheel down
--disable-rescale do not rescale the images in the archives
--force-button-shortcut ignore useescspc and getenter command
--render-font-outline render the outline of a text instead of casting a shadow
--edit enable online modification of the volume and variables when 'z' is pressed
--key-exe file set a file (*.EXE) that includes a key table
--fontcache cache default font
โ If you force exit the game, the save might be damaged, try to remvoe envdata to play again.
(2) linux
You can either download the prebuild static elf from the release or build from source (see next part).
- Arch Linux
sh
Install with your AUR helper
yay -S onscripter-yuri
- Gentoo
sh
Enable gentoo-zh overlay (use 'repository' subcommamd for 'eselect' need install 'app-eselect/eselect-repository' first):
eselect repository enable gentoo-zh
Install onscripter-yuri:
emerge --ask games-emulation/onscripter-yuri
(3) web
This project can run in a browser through hosted web server. PressF10 to strech full in a webpage, F11 in fullscreen, F9 | Right Click| Long Click to invoke menu.
The structure is as bellow:
bash
onsyuri.html
onsyuri.js
onsyuri.wasm
onsyuri_index.json
[your game files]
It will load the game according to onsyuri_index.json, whitch is defined by <meta > in onsyuri.html.
json
{
"title": "game1",
"gamedir": "/onsyuri/game1",
"savedir": "/onsyuri_save/game1",
"args": [],
"lazyload": "true",
"files":[
{"path": "0.txt" , "url":"http://localhost:5500/asset/test/0.txt"},
{"path": "bgm/bgm.ogg" , "url":"http://localhost:5500/asset/test/bgm/bgm.ogg"},
{"path": "default.ttf" , "url":"http://localhost:5500/asset/test/default.ttf"}
]
}
This can be generated by onsyuri_index.py.
makexhrfsindex > onsyuri_lazyload.json after npm i -g browserfs(4) android
Install the apk, use3 figures|long touch for invoke menu, 4 figures to invoke skip.
You can either put game into /storage/emulated/0/Android/data/com.yuri.onscripter/files, or any directory by saf.
2. Build
(1) local windows
Install the dependency in msys2,sh
pacman -Syu --noconfirm
pacman -S --noconfirm make tar vim curl # util tools
pacman -S --noconfirm mingw-w64-x8664-binutils mingw-w64-x8664-gcc mingw-w64-x86_64-gdb # mingw64 compile tool
pacman -S --noconfirm mingw-w64-i686-binutils mingw-w64-i686-gcc mingw-w64-i686-gdb # mingw32 compile tool
pacman -S --noconfirm mingw-w64-i686-SDL2 mingw-w64-x86_64-SDL2
pacman -S --noconfirm mingw-w64-i686-SDL2image mingw-w64-x8664-SDL2_image
pacman -S --noconfirm mingw-w64-i686-SDL2ttf mingw-w64-x8664-SDL2_ttf
pacman -S --noconfirm mingw-w64-i686-SDL2mixer mingw-w64-x8664-SDL2_mixer
pacman -S --noconfirm mingw-w64-i686-brotli mingw-w64-x86_64-brotli
pacman -S --noconfirm mingw-w64-i686-mesa mingw-w64-x86_64-mesa
pacman -S --noconfirm mingw-w64-i686-lua mingw-w64-x86_64-lua
and then use these localmsys2mingw32.sh or localmsys2mingw64.sh to build.
sh
cd script
chmod +x *.sh
sh -c "export BUILDTYPE=Debug && export MSYS2HOME=/path/to/msys2 && ./local_msys2mingw32.sh"
(2) local linux
Install the dependencybash
linux64
sudo apt-get update
sudo apt-get -y install gcc gdb make cmake git curl
sudo apt-get -y install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev
sudo apt-get -y install libbz2-dev libjpeg-dev libpng-dev
sudo apt-get -y install liblua5.3-dev libgl1-mesa-dev
linux32
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get -y install gcc-multilib g++-multilib
sudo apt-get -y install libsdl2-dev:i386 libsdl2-ttf-dev:i386 libsdl2-image-dev:i386 libsdl2-mixer-dev:i386
sudo apt-get -y install libbz2-dev:i386 libjpeg-dev:i386 libpng-dev:i386
sudo apt-get -y install liblua5.3-dev:i386 libgl1-mesa-dev:i386
sh
cd script
chmod +x *.sh
sh -c "export BUILDTYPE=Debug && ./locallinux32.sh"
and then use locallinux32.sh or locallinux64.sh to build.
(3) cross web
Install emsdk and usecrossweb.sh to build.
You need to add $EMSDKHOME and $MSYS2HOME (if windows) user variable at first.
shell
cd script
chmod +x *.sh
sh -c "BUILDTYPE=Debug EMCSDKHOME=/path/to/emsdk ./cross_web.sh"
(4) cross linux
Install the dependency for cross compiler,shell
install in the target machine, aarch64
sudo apt-get -y install libx11-dev libxext-dev libasound2-dev
sudo apt-get -y install libgl1-mesa-dev mesa-utils
install in the target machine, armhf (if you want to run armhf in aarch64)
sudo dpkg --add-architecture armhf && sudo apt-get update
sudo apt-get -y install libc6:armhf
sudo apt-get -y install libx11-dev:armhf libxext-dev:armhf libasound2-dev:armhf
sudo apt-get -y install libgl1-mesa-dev:armhf mesa-utils:armhf
install in the local machine
sudo apt-get -y install tar make cmake curl git
sudo apt-get -y install crossbuild-essential-i386
sudo apt-get -y install crossbuild-essential-x86_64
sudo apt-get -y install crossbuild-essential-armhf
sudo apt-get -y install crossbuild-essential-arm64
then use crosslinuxa64.sh or crosslinuxa32.sh, crosslinux32.sh, crosslinux64.sh to compile.
For raspberrypi or the other arm64 devices cross compiling.
As there are many system bindings in SDL2,
just build libraries in the target machine, and use these build cache to link.
Or you can use docker_linuxarm64.sh for cross compile.
# at first build sdl2 in raspberry pi
sh -c "export SYSROOT=/ && ./local_linux64.sh"
copy prebuild of dependency to local
cp -rf /path/to/rpi/OnscripterYuri/thirdparty/build/archaarch64 thirdparty/build/archaarch64
use SKIP_PORTS to skip thirdpart builds
cd script
chmod +x *.sh
sh -c "export BUILDTYPE=Debug && export SKIPPORTS=yes && ./local_linux64.sh"
(5) cross mingw
Install mingw cross compiler and tools, indebian or wsl2,
shell
sudo apt-get -y install tar make cmake curl git
use pkg-config is to find sdl2 by compiling sdl2_image, do not install mingw-w64-tools, this pkg-config is broken
sudo apt-get -y install mingw-w64 zstd pkg-config
in msys2,
pacman -Syu --noconfirm
pacman -S --noconfirm make tar vim curl # util tools
pacman -S --noconfirm mingw-w64-x8664-gcc mingw-w64-x8664-gdb
pacman -S --noconfirm mingw-w64-x8664-binutils mingw-w64-x8664-pkg-config
pacman -S --noconfirm mingw-w64-i686-gcc mingw-w64-i686-gdb
pacman -S --noconfirm mingw-w64-i686-binutils mingw-w64-i686-pkg-config
then use crossmingw32.sh or crossmingw64.sh to compile.
If you want to make compatible for winxp, should use gcc below 12.
(6) cross llvmmingw
Download llvm-mingw and add${LLVMMINGWHOME}/bin to path,
then use crossllvmmingw32.sh or crossllvmmingw64.sh to compile (either bash (git bash) or msys2 shell).
If you want to build compatible for winxp, you can use i686-11.2.0-release-win32-dwarf-rtv9-rev1. Higher version like gcc 14 is not available.
Do not mix mingw and llvm-mingw libraries, which will cause ld.lld: error: undefined symbol: _chkstk_ms problem !
export PATH=/path/to/mingw32/bin:$PATH
export CC=i686-w64-mingw32-gcc
export CXX=i686-w64-mingw32-g++
export RC=i686-w64-mingw32-windres
echo CC=$(which $CC)
echo CXX=$(which $CXX)
echo RC=$(which $RC)
bash -c "./cross_llvmmingw32.sh"
(7) cross android
Install android sdk and ndk, thensh
prepare port dependencies
cd script
sh ./cross_android.sh
cd -
use ANDROID_HOME or local.properties for sdk
cd src/onsyuri_android/
chmod +x ./gradlew && ./gradlew assembleDebug
(8) cross by docker
You can easily build all supported platforms by docker, seedocker/docker_xxx.sh in detail.
If you want to build for linux arm in x86 platform, install qemu at first.
shell
sudo apt-get install qemu-user-static binfmt-support
3. Compatibility
|game|version|status|description| |----|-------|------|-----------|4. Issues (including already solved)
- general
- windows
change high dpi setting or edit reg as below:
set app_name=onsyuri.exe
reg add "HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /t regsz /v "%~dp0%appname%" /d "~ HIGHDPIAWARE" /f
- linux
- android
- web
5. Todo
video support (future plan)partly finish by invoke system player
web preloading (future plan)might not need ? lazyload partly solved
๐ More in this category