How yurisizuku/onscripteryuri works
Main Components
• Core Engine (src/onsyuri)
• Script Parser & Handler: ScriptParser(.cpp/.h), ScriptHandler(.cpp/.h), LUAHandler
• Readers: DirectReader, NsaReader, SarReader, AVIWrapper
• Rendering Pipeline: GLES2Renderer (+ shader folder), DirtyRect, FontInfo, AnimationInfo
• Audio/Video: SDL_mixer (or system player on Android), AVIWrapper for video
• Built‑in Effects: builtin_dll modules (cascade, trig, snow, oldmovie)
• Utilities & SIMD: simd folder, Utils.h, coding2utf16, resize_image
• Platform Abstraction Layer
• File I/O: SDL_RWops, BrowserFS/IndexedDB (web), SAF (Android)
• Input: SDL2 input events, touch/long‑press abstractions (Android & web)
• Window & Graphics Context: SDL2/OpenGL ES2
• Audio Output: SDL_mixer or native audio APIs
• Frontend Wrappers (entry points)
• Native Desktop: onsyuri_main.cpp linked via CMake to a standalone binary
• Android: Java layer (MainActivity.java, SAFFile.java) + JNI bindings + C++ via CMake/Gradle
• Web: Emscripten build → onsyuri.html, .js, .wasm + onsyuri_index.json + onscripter web UI
• Libretro: SDL_libretro.c (RetroArch plug‑in)
• Tools & Packaging
• Script utilities: nscriptdecode, sarconv, onsyuri_index.py
• Build Scripts: shell scripts in /script (cross_*.sh, local_*.sh)
• Dockerfiles: per‑platform containers under /docker
• CI/CD: GitHub Actions workflows (build_linux.yml, build_android.yml, etc.)
• Configuration & Build System
• CMakeLists.txt, vcpkg.json, gradle files under src/onsyuri_android
Relationships & Data Flows
a. Frontend → Core Engine initialization (onsyuri_main)
b. Core Engine reads game assets via File I/O abstraction
c. ScriptParser parses .txt/.ns scripts → ScriptHandler dispatches commands
d. Rendering Module drives OpenGL ES2 via Platform Layer → screen
e. Audio Commands go through SDL_mixer or native player
f. Built‑in DLL effects loaded dynamically by Core
g. Save data written to IndexedDB (web) or SAF/OS FS
a. CMake + shell scripts → platform‑specific builds
b. Docker containers can automate cross‑compile steps
c. GitHub Actions trigger Docker or scripts → produce binaries/artifacts
Architectural Patterns
• Layered Architecture:
• Presentation (Frontend wrappers)
• Application Logic (Core Engine)
• Infrastructure (Platform Abstraction)
• External Dependencies (SDL2, Emscripten, Android SDK, Libretro)
• Plugin‑style Effects: builtin_dll modules loaded by name
• Cross‑compile Orchestration: Docker + shell scripts + CI pipelines
Technologies & Frameworks
• C++17, SDL2, OpenGL ES2
• Lua scripting
• Emscripten (WASM + JS) for web port
• Android NDK + JNI + Gradle for Android port
• Libretro API for RetroArch port
• CMake, vcpkg, Docker, GitHub Actions