mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3012412a5d | ||
|
|
91fa4284c4 | ||
|
|
93d29b5f87 | ||
|
|
b6cdba145f | ||
|
|
38a40e82f3 | ||
|
|
d29a764de2 | ||
|
|
0d74454355 | ||
|
|
1a248ea897 | ||
|
|
556b9687ca | ||
|
|
8be63b7f11 | ||
|
|
8c963f4dcf | ||
|
|
87316495e8 | ||
|
|
45b50fe78a | ||
|
|
c31da0fe10 | ||
|
|
0d376a3d35 | ||
|
|
ff9710426f | ||
|
|
aa537687c4 | ||
|
|
ae30b73333 | ||
|
|
28ac087bca | ||
|
|
fc3d66195f | ||
|
|
f7ca54104b | ||
|
|
d8513d78e4 | ||
|
|
d0ad06e7c5 | ||
|
|
cae31a72d1 | ||
|
|
1405c8693b | ||
|
|
5c5a71237c |
@@ -2,7 +2,7 @@ name: Emscripten Build
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
EM_VERSION: 2.0.25
|
||||
EM_VERSION: 2.0.34
|
||||
EM_CACHE_FOLDER: 'emsdk-cache'
|
||||
|
||||
jobs:
|
||||
|
||||
+4
-11
@@ -2,7 +2,6 @@ cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(xsystem35 LANGUAGES C)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
enable_testing()
|
||||
|
||||
include(CheckIncludeFile)
|
||||
@@ -70,14 +69,10 @@ else()
|
||||
set(HAVE_WEBP 1)
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads)
|
||||
if (CMAKE_USE_PTHREADS_INIT)
|
||||
find_library(PORTMIDI portmidi)
|
||||
if (PORTMIDI)
|
||||
set(HAVE_PORTMIDI 1)
|
||||
set(ENABLE_MIDI_PORTMIDI 1)
|
||||
endif()
|
||||
find_library(PORTMIDI portmidi)
|
||||
if (PORTMIDI)
|
||||
set(HAVE_PORTMIDI 1)
|
||||
set(ENABLE_MIDI_PORTMIDI 1)
|
||||
endif()
|
||||
|
||||
set(DEFAULT_FONT_PATH ${CMAKE_INSTALL_PREFIX}/share/xsystem35/fonts/)
|
||||
@@ -161,7 +156,6 @@ else()
|
||||
list(APPEND SUMMARY_MIDI "raw")
|
||||
set(MIDI_DEVICE "/dev/midi" CACHE STRING "midi device")
|
||||
set(ENABLE_MIDI_RAWMIDI 1)
|
||||
option(QUIET_MIDI "No display midi stdout" OFF)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||
@@ -186,7 +180,6 @@ else()
|
||||
if (HAVE_PORTMIDI AND ENABLE_MIDI_PORTMIDI)
|
||||
list(APPEND SRC_MIDI midi.portmidi.c)
|
||||
list(APPEND SUMMARY_MIDI "PortMidi")
|
||||
link_libraries(${PORTMIDI} Threads::Threads)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
|
||||
System 3.5 for X Window System Version 1.7 (開発版)
|
||||
|
||||
インストールドキュメント
|
||||
|
||||
|
||||
0. 目次
|
||||
|
||||
1. 必要環境と対応機能
|
||||
2. コンパイルとインストール
|
||||
3. コンパイル時のオプション
|
||||
4. サポート
|
||||
|
||||
|
||||
1. 必要環境と対応機能
|
||||
|
||||
1.1 必要環境
|
||||
* X11R6
|
||||
* gtk+ 2.0.0 以上
|
||||
* SYSV IPC in kernel
|
||||
* zlib
|
||||
* Ogg Vorbis library (libvorbis)
|
||||
|
||||
1.2 推奨環境
|
||||
* スケーラブルフォント(例えば X-TT など)
|
||||
(http://X-TT.dsl.gr.jp/index-ja.html)
|
||||
* MIT-SHM extension をサポートした X Server。次のようにチェックします。
|
||||
$ xdpyinfo | grep MIT-SHM
|
||||
* MMX Pentinum 以降 (for IA32 platform)
|
||||
|
||||
1.3 対応機能
|
||||
* ALSA (for Linux) 0.9.x 以上
|
||||
(http://www.alsa-project.org/)
|
||||
* ESD (Esound) 0.2.8 以上
|
||||
(http://www.tux.org/~ricdude/EsounD.html)
|
||||
(ftp://ftp.gnome.org/pub/GNOME/stable/sources/esound/ or mirrors)
|
||||
* Joystick (for Linux kernel 2.2.x)
|
||||
* SDL(Simple DirectMedia Layer) 1.0.x 以上
|
||||
(http://www.devolution.com/~slouken/SDL)
|
||||
* FreeType Library 2.0 以上
|
||||
(http://www.freetype.org/)
|
||||
* midi デバイス(OSS /dev/midi, /dev/sequencer)を介した外部/仮想MIDI音源
|
||||
|
||||
1.4 注意点
|
||||
* コンパイルには GNU Make (gmake) と gtk-config と nasm (assembler)
|
||||
が必要です。(nasm は IA-32 platform のみ)
|
||||
* また gcc 以外でのコンパイルは多分出来ないと思います。標準 cc でコンパイル
|
||||
を通すためのパッチは大歓迎です。
|
||||
|
||||
|
||||
2. コンパイルとインストール
|
||||
|
||||
2.1 プログラムのコンパイルとインストール
|
||||
|
||||
$ tar xvfz xsystem35-(version).tar.gz # ソースコードの展開
|
||||
$ cd xsystem35-(version) # xsystem35 のトップディレクトリに移動
|
||||
$ cp src/xsys35rc.sample ~/.xsys35rc # 設定ファイルのコピー
|
||||
$ ./configure # `configure' スクリプトの実行
|
||||
$ make # xsystem35 のコンパイル
|
||||
[必要なら root になる]
|
||||
# make install # xsystem35 のインストール
|
||||
|
||||
default では make install で /usr/local/bin にインストールされます。
|
||||
|
||||
2.2 ゲームデータのインストール
|
||||
|
||||
contrib ディレクトリにゲームデータをインストールするプログラムが入っています。
|
||||
/cdromにCD-ROMをマウントした後、
|
||||
|
||||
$ cd ./contrib
|
||||
$ ./instgame kichiku.inf
|
||||
|
||||
のようにしてインストールします。 詳しくは contrib/README.TXTを御覧下さい。
|
||||
|
||||
|
||||
3. コンパイル時のオプション
|
||||
|
||||
$ ./configure --help
|
||||
で使用可能なオプションの一覧がでます。
|
||||
|
||||
* audio 関連
|
||||
|
||||
--enable-audio=xxx
|
||||
オーディオデバイスのうち xxx を有効にしてコンパイルします。xxx には今の所
|
||||
oss, alsa, esd が使えます。カンマで区切って並べて指定する事で複数のデバイ
|
||||
スをゲーム起動時に選択できます。(ex. --enable-audio=oss,alsa,esd)
|
||||
このオプションを指定しない時は OS ごとに適切なデバイスが組み込まれます。
|
||||
|
||||
--with-default-output=xxx
|
||||
--enable-audioで複数のデバイスを選択した時、デフォルトのデバイスをこの
|
||||
オプションで指定できます。指定しない場合は使用可能なデバイスのうち任意の
|
||||
デバイスを使用します。
|
||||
|
||||
--with-oss-audiodev=xxx
|
||||
OSS での DSP デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/dsp です。(*1)
|
||||
|
||||
--with-oss-mixerdev=xxx
|
||||
OSS での MIXER デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/mixer です。(*1)
|
||||
|
||||
--enable-cdrom=xxx
|
||||
CD-ROM デバイスのうち xxx を有効にしてコンパイルします。CD-DA の代わりに
|
||||
MP3などを外部プレイヤを使って演奏することも出来ます。xxx には linux,bsd,
|
||||
mp3 が使えます。
|
||||
カンマで区切って並べて指定することで複数のデバイスをゲーム起動時に選択
|
||||
できます。(ex. --enable-cdrom=linux,mp3)
|
||||
CD-DA を使うか MP3 を使うかの指定については README.music を御覧下さい。
|
||||
このオプションを指定しない時は OS ごとに適切なデバイスが組み込まれます。
|
||||
|
||||
--with-cdromdev=xxx
|
||||
CD-ROM デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/cdrom です。(*1)
|
||||
|
||||
--enable-midi=xxx
|
||||
MIDI デバイスのうち xxx を有効にしてコンパイルします。xxx にはいまのところ
|
||||
extp,raw,seq が使えます。extp は外部プレイヤを使って MIDI を演奏します。
|
||||
raw は Raw midi デバイス (/dev/midiなど)を通して外部MIDI機器を接続している
|
||||
場合に使います。seq は OSS sequencer device (/dev/sequencer) を通して MIDI
|
||||
機器を接続している場合に使います。カンマで区切って並べて指定することで複数
|
||||
のデバイスをゲーム起動時に選択できます。(ex. --enable-midi=extp,raw,seq)
|
||||
|
||||
--with-mididev=xxx
|
||||
Raw MIDI デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/midi です。(*1)
|
||||
|
||||
--with-seqdev=xxx
|
||||
Sequencer MIDI デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/sequencer です。(*1)
|
||||
|
||||
--with-midiplayer=xxx
|
||||
外部 MIDI プレイヤを指定します。デフォルトは midiplay -4 です。(*1)
|
||||
|
||||
--enable-qmidi
|
||||
外部 MIDI プレイヤを実行する際に、プレイヤーの実行時メッセージを抑止
|
||||
します。
|
||||
|
||||
|
||||
* graphics 関連
|
||||
|
||||
--enable-sdl
|
||||
SDL を有効にしてコンパイルします。
|
||||
|
||||
--enable-bgr
|
||||
X server の color order が BGR の時指定します。SunとSGIのプラットフォーム
|
||||
ではデフォルトでこの指定が有効になっています。それ以外のプラットフォーム
|
||||
では不要です。ただし、sgi O2 および、Sun sparc のマシンの中には RGB の
|
||||
並びのものもあるので、その場合は --enable-bgr=no あるいは --disable-bgr
|
||||
としてください。詳しくは doc/README.color を御覧下さい。
|
||||
|
||||
|
||||
* その他
|
||||
|
||||
--enable-joy
|
||||
Joystic support を有効にしてコンパイルします。Linux kernel 2.2 以降に
|
||||
対応しています。
|
||||
|
||||
--with-joydev=xxx
|
||||
Joystick デバイスのデバイスファイルを xxx で指定します。デフォルトは
|
||||
/dev/js0 です。(*1)
|
||||
|
||||
--with-locale=xxxx
|
||||
X の locale 機構を使う場合に指定します。Linux libc5 System 等では通常
|
||||
使用している locale を指定して下さい。(ex. --with-locale=ja_JP.ujis)
|
||||
それ以外では必要無いと思います。
|
||||
|
||||
--with-cachesize=xxxx
|
||||
データキャッシュの大きさを指定します。単位は MB で、デフォルトは 20MB
|
||||
です。データのほとんどは展開済み CG のキャッシュに使われます。シナリオ
|
||||
などのデータは mmap を使っていますので、キャッシングは xsystem35 の管理
|
||||
外です。
|
||||
|
||||
--enable-mmx
|
||||
IA32 プラットフォームで MMX を使うようにします。nasm というアセンブラが
|
||||
必要になります。IA32 ではデフォルトで有効にします。無効にする場合は =no
|
||||
を指定して下さい。実行時に MMX 命令が使用可能かどうかチェックしますので、
|
||||
MMX 命令を持たないCPUでも有効のままでかまいません。
|
||||
|
||||
--enable-debug
|
||||
debuging を有効にします。
|
||||
有効にしてコンパイルすると -debuglv # オプションが使えるようになります。
|
||||
debug level に関しては src/xsystem35.h を参照して下さい。
|
||||
|
||||
## (*1) 実行時に読み込む設定ファイル ~/.xsys35rc でも指定できます。
|
||||
|
||||
|
||||
参考: 私の開発時の configure オプション(実際には1行です)
|
||||
|
||||
./configure --enable-midi=extp,raw,seq --enable-audio=oss,alsa,esd
|
||||
--enable-cdrom=linux,mp3 --enable-debug
|
||||
|
||||
4. サポート
|
||||
|
||||
http://www.aist-nara.ac.jp/~masaki-c/private/unitbase/xsys35/index.html
|
||||
または READMEの 8. サポートの項を御覧下さい。
|
||||
@@ -1,11 +1,75 @@
|
||||
# xsytem35-sdl2
|
||||
|
||||
This is a multi-platform port of xsystem35, a free implementation of AriceSoft's System3.x game engine.
|
||||
This is a multi-platform port of `xsystem35`, a free implementation of
|
||||
AliceSoft's System 3.x game engine.
|
||||
|
||||
## Download
|
||||
Prebuilt binaries for Windows and Android can be downloaded from the [Releases](https://github.com/kichikuou/xsystem35-sdl2/releases) page.
|
||||
## Unique Features
|
||||
|
||||
## Build
|
||||
In addition to the original System 3.x's functionalities, xsystem35-sdl2 has
|
||||
the following features.
|
||||
|
||||
### Playing audio files as fake CD music
|
||||
|
||||
Many System 3.x games had music as audio tracks on the CD-ROM. Xsystem35 can
|
||||
play music from audio files instead, to avoid the hassle of inserting CDs. To
|
||||
use ripped audio files, create a file named `playlist.txt` in the game
|
||||
directory, and enter the paths to your tracks, one per line. For example:
|
||||
|
||||
```
|
||||
# The first line is not used
|
||||
BGM/track02.mp3
|
||||
BGM/track03.mp3
|
||||
...
|
||||
```
|
||||
|
||||
The first line is not used, because track 1 of game CD is usually a data track.
|
||||
|
||||
### Unicode translation support
|
||||
|
||||
The original System 3.x only supported Shift_JIS (a Japanese character
|
||||
encoding), but xsystem35 supports Unicode and is able to run games translated
|
||||
into languages other than Japanese and English.
|
||||
|
||||
See [xsys35c](https://github.com/kichikuou/xsys35c)'s document for how to
|
||||
build a game with Unicode mode.
|
||||
|
||||
### Debugging
|
||||
|
||||
Xsystem35 has a built-in debugger that allows you to step through the game and
|
||||
examine / modify variables in the game. There are two ways to use the debugger:
|
||||
|
||||
- Through [Visual Studio Code](https://code.visualstudio.com/) (recommended):
|
||||
The [vscode-system3x](https://github.com/kichikuou/vscode-system3x) extension
|
||||
provides graphical debugging interface for System 3.x.
|
||||
- Using CUI debugger: Running xsystem35 with `-debugger` option will start the
|
||||
debugger with console interface. Type `help` to see a list of available
|
||||
commands.
|
||||
|
||||
## Installing
|
||||
|
||||
Prebuilt packages for Windows and Android can be downloaded from the
|
||||
[Releases](https://github.com/kichikuou/xsystem35-sdl2/releases) page. For
|
||||
other platforms, see the [Building](#building) section.
|
||||
|
||||
## Running
|
||||
### Windows
|
||||
|
||||
Execute `xsytem35`, and it will show a dialog to select a folder. Select the
|
||||
game folder (where the ALD files are located).
|
||||
|
||||
### Android
|
||||
|
||||
Make a Zip file containing all the game files, copy it to your device, and load
|
||||
it.
|
||||
|
||||
### Other Platforms
|
||||
|
||||
Run xsystem35 from within the game directory.
|
||||
|
||||
cd /path/to/game_directory
|
||||
xsystem35
|
||||
|
||||
## Building
|
||||
### Linux (Debian / Ubuntu)
|
||||
|
||||
$ sudo apt install build-essential cmake libgtk-3-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libwebp-dev libcjson-dev
|
||||
@@ -41,7 +105,9 @@ Prebuilt binaries for Windows and Android can be downloaded from the [Releases](
|
||||
$ emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel ../../
|
||||
$ make
|
||||
|
||||
To use the generated binary, checkout [Kichikuou on Web](https://github.com/kichikuou/web) and copy `out/xsystem35.*` into its `docs` directory.
|
||||
To use the generated binary, checkout
|
||||
[Kichikuou on Web](https://github.com/kichikuou/web) and copy `out/xsystem35.*`
|
||||
into its `docs` directory.
|
||||
|
||||
### Android
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ android {
|
||||
}
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 28
|
||||
versionCode 5
|
||||
versionName "0.2.3"
|
||||
versionCode 6
|
||||
versionName "2.2.0"
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
|
||||
|
||||
+1
-3
@@ -1,5 +1,5 @@
|
||||
#cmakedefine PACKAGE "@PACKAGE@"
|
||||
#define VERSION "2.1.0"
|
||||
#define VERSION "2.2.0"
|
||||
|
||||
#cmakedefine CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@"
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
#cmakedefine MIDI_DEVICE "@MIDI_DEVICE@"
|
||||
#cmakedefine SEQ_DEVICE "@SEQ_DEVICE@"
|
||||
|
||||
#cmakedefine QUIET_MIDI @QUIET_MIDI@
|
||||
|
||||
#cmakedefine HAVE_GETLOGIN @HAVE_GETLOGIN@
|
||||
#cmakedefine HAVE_JPEG @HAVE_JPEG@
|
||||
#cmakedefine HAVE_MMAP @HAVE_MMAP@
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# 20世紀アリス これDPS? Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, 20cDPS_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, 20cDPS_ga.ald
|
||||
MidiA, gamedata/*MA.ald, 20cDPS_ma.ald
|
||||
SaveA, , 20cDPS_sa.asd
|
||||
Ain, gamedata/*.ain, system39.ain
|
||||
@@ -1,10 +0,0 @@
|
||||
# 20世紀アリス かえるにょ国にょアリス Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, 20cKaeru_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, 20cKaeru_ga.ald
|
||||
WaveA, gamedata/*WA.ald, 20cKaeru_wa.ald
|
||||
MidiA, gamedata/*MA.ald, 20cKaeru_ma.ald
|
||||
DataA, gamedata/*DA.ald, 20cKaeru_da.ald
|
||||
Ain, gamedata/*.ain, system39.ain
|
||||
SaveA, , 20cKaeru_sa.asd
|
||||
SaveZ, , 20cKaeru_sz.asd
|
||||
@@ -1,14 +0,0 @@
|
||||
# ATLACH-NACHA Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, atlach_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, atlach_ga.ald
|
||||
GraphicsB, gamedata/*gb.ald, atlach_gb.ald
|
||||
WaveA, gamedata/*wa.ald, atlach_wa.ald
|
||||
SaveA, , atlach_sa.asd
|
||||
SaveB, , atlach_sb.asd
|
||||
SaveC, , atlach_sc.asd
|
||||
SaveD, , atlach_sd.asd
|
||||
SaveE, , atlach_se.asd
|
||||
SaveF, , atlach_sf.asd
|
||||
SaveG, , atlach_sg.asd
|
||||
SaveH, , atlach_sh.asd
|
||||
@@ -1,6 +0,0 @@
|
||||
# Ningen Kari Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, ningen_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, ningen_ga.ald
|
||||
WaveA, gamedata/*wa.ald, ningen_wa.ald
|
||||
SaveA, , ningen_sa.asd
|
||||
@@ -1,12 +0,0 @@
|
||||
# Zero-shiki Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, zero_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, zero_ga.ald
|
||||
WaveA, gamedata/*wa.ald, zero_wa.ald
|
||||
SaveA, , zero_sa.asd
|
||||
SaveB, , zero_sb.asd
|
||||
SaveC, , zero_sc.asd
|
||||
SaveD, , zero_sd.asd
|
||||
SaveE, , zero_se.asd
|
||||
, gamedata/map_data.dat, MAP_DATA.DAT
|
||||
, gamedata/ur_data.dat, UR_DATA.DAT
|
||||
@@ -1,115 +0,0 @@
|
||||
ゲームデータインストール用スクリプト instgame の使い方について
|
||||
|
||||
スクリプト作成 奈良木 さん
|
||||
ドキュメント作成 近間@NAIST
|
||||
0. 目次
|
||||
|
||||
1. ファイルの説明
|
||||
2. 使い方
|
||||
3. その他の情報
|
||||
4. 著作権など
|
||||
5. 連絡先
|
||||
|
||||
|
||||
1. ファイルの説明
|
||||
|
||||
instgame スクリプト本体
|
||||
456atlach.inf ATLACH-NACHA 用設定ファイル (アリスの館456収録)
|
||||
456ningen.inf 人間狩り 用設定ファイル (アリスの館456収録
|
||||
456zero.inf 零式 用設定ファイル (アリスの館456収録)
|
||||
ambi.inf AmbivalenZ for WIN95 用設定ファイル
|
||||
atlach_new.inf ATLACH-NACHA (廉価版) 用設定ファイル
|
||||
darcrows.inf DARCROWS 用設定ファイル
|
||||
diabo.inf DiaboLiQue 用設定ファイル
|
||||
diabo_new.inf DiaboLiQue (廉価版) 用設定ファイル
|
||||
hushaby.inf HushaBy Baby 用設定ファイル
|
||||
katsumi.inf いけないかつみ先生 用設定ファイル
|
||||
kichiku.inf 鬼畜王ランス 用設定ファイル
|
||||
mamatoto.inf ママトト 用設定ファイル
|
||||
mamori.inf 守り神様 用設定ファイル
|
||||
miko.inf 戦巫女 用設定ファイル
|
||||
mugen.inf 無幻泡影 for WIN95 用設定ファイル
|
||||
oudou.inf 王道勇者 用設定ファイル
|
||||
panyo.inf かえるにょぱにょ〜ん 用設定ファイル
|
||||
panyo_new.inf かえるにょぱにょ〜ん(廉価版) 用設定ファイル
|
||||
pascha.inf ぱすてるチャイム 用設定ファイル
|
||||
persiom.inf PERSIOM 用設定ファイル
|
||||
progood.inf ぷろすちゅーでんとGOOD 用設定ファイル
|
||||
rance4.inf ランス4 forWIN 用設定ファイル
|
||||
seeinao.inf SeeIn青 用設定ファイル
|
||||
toushin2.inf 闘神都市II forWIN 用設定ファイル
|
||||
dalk.inf DALK 用設定ファイル (アリスの館456収録)
|
||||
drstop.inf Dr.Stop! 用設定ファイル (アリスの館456収録)
|
||||
rance1.inf Rance1 用設定ファイル (アリスの館456収録)
|
||||
rance2.inf Rance2 用設定ファイル (アリスの館456収録)
|
||||
rance3.inf Rance3 用設定ファイル (アリスの館456収録)
|
||||
toushin.inf 闘神都市 用設定ファイル (アリスの館456収録)
|
||||
zero_new.inf 零式 (廉価版) 用設定ファイル
|
||||
20cKaeru.inf 20世紀アリス かえるにょ国にょアリス 用設定ファイル
|
||||
20cDPS.inf 20世紀アリス これDPS? 用設定ファイル
|
||||
onlyyou_r.inf Only You リクルス 用設定ファイル
|
||||
daiakuji.inf 大悪司 用設定ファイル
|
||||
tsuma.inf 妻みぐい 用設定ファイル
|
||||
|
||||
2. 使い方
|
||||
|
||||
ゲームのCD-ROMをドライブに入れてマウントし、
|
||||
% ./instgame kichiku.inf
|
||||
のように実行します。
|
||||
|
||||
デフォルトではCDROMは/cdromにマウントされているものとしています。
|
||||
また、データのインストール先は ~/game/kichiku/ の下になります。
|
||||
|
||||
デフォルトでは設定用ファイルのファイル名が~/game/の下のディレクトリ名に
|
||||
なります。
|
||||
|
||||
これらのデフォルトの条件を変えるには以下のオプションを使います。
|
||||
|
||||
-c : CD-ROMのマウントされている位置を指定します(default: -c /cdrom)
|
||||
-d : ゲームデータのインストール先を指定します (default: -d ~/game/target>)
|
||||
|
||||
データが正常にコピーされると、~/game/の下にkichiku.grと言うファイルが作成
|
||||
されます。これはゲームデータの場所をプログラム(xsystem35)に知らせるためのも
|
||||
ので、
|
||||
% xsystem35 -gamefile ~/game/kichiku.gr
|
||||
のように指定するのに使います。(「ゲームリソースファイル」とでも呼んで下さい)
|
||||
|
||||
デフォルトでは、*.grというファイルも設定用ファイルのファイル名と同じ名前に
|
||||
なりますが、以下のオプションで変更可能です。
|
||||
|
||||
-g : ゲームリソースファイルのファイル名を指定します
|
||||
(default: -g ~/game/<target>.inf)
|
||||
|
||||
|
||||
3. その他の情報
|
||||
|
||||
その他のオプションに、指定のファイルはCD-ROMからコピーせずにリンクを張る、
|
||||
という指定が出来ます。
|
||||
|
||||
% ./instgame -k Graphics kichiku.inf
|
||||
|
||||
とすると、kichiku_ga.ald と kichiku_gb.ald のファイルはコピーされずに、
|
||||
CD-ROM上のデータへのシンボリックリンクになります。ただし、そうするとゲーム中
|
||||
はCD-ROMをマウントしておかなければならないので、CD-ROMをマウントしたまま
|
||||
CD-DAの演奏可能な一部のシステムでのみ可能です。
|
||||
|
||||
|
||||
このオプションはゲームデータのインストール時の動作を規定するものなので、
|
||||
自分でCD-ROMからファイルをコピーして、ゲームリソースファイルをエディタで
|
||||
編集すれば、全く自由にデータの配置を行なう事が出来ます。もちろん、ゲーム
|
||||
リソースファイルのファイル名や置き場所も自由にして出来ます。
|
||||
ゲームリソースファイルの書式については doc/GRFMT.TXT を御覧下さい。
|
||||
|
||||
|
||||
4. 著作権など
|
||||
|
||||
instgameは 奈良木 さんがつくられたものですので、著作権は奈良木さんに
|
||||
属します。奈良木さんの意向により、GPLに基づいて再配布可能です。
|
||||
|
||||
ドキュメントの不備は私(近間)までどうぞ。
|
||||
|
||||
|
||||
5. 連絡先
|
||||
|
||||
奈良木さん <naraki@debian.or.jp>
|
||||
近間@NAIST <masaki-c@is.aist-nara.ac.jp>
|
||||
@@ -1,18 +0,0 @@
|
||||
# AmbivalenZ Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, ambi_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, ambi_ga.ald
|
||||
SaveA, , ambi_sa.asd
|
||||
SaveB, , ambi_sb.asd
|
||||
SaveC, , ambi_sc.asd
|
||||
SaveD, , ambi_sd.asd
|
||||
SaveE, , ambi_se.asd
|
||||
SaveF, , ambi_sf.asd
|
||||
SaveG, , ambi_sg.asd
|
||||
SaveH, , ambi_sh.asd
|
||||
SaveI, , ambi_si.asd
|
||||
SaveJ, , ambi_sj.asd
|
||||
SaveK, , ambi_sk.asd
|
||||
SaveL, , ambi_sl.asd
|
||||
SaveM, , ambi_sm.asd
|
||||
SaveN, , ambi_sn.asd
|
||||
@@ -1,30 +0,0 @@
|
||||
# ATLACH-NACHA (low price version) Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, atlach_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, atlach_ga.ald
|
||||
WaveA, gamedata/*wa.ald, atlach_wa.ald
|
||||
SaveA, , atlach_sa.asd
|
||||
SaveB, , atlach_sb.asd
|
||||
SaveC, , atlach_sc.asd
|
||||
SaveD, , atlach_sd.asd
|
||||
SaveE, , atlach_se.asd
|
||||
SaveF, , atlach_sf.asd
|
||||
SaveG, , atlach_sg.asd
|
||||
SaveH, , atlach_sh.asd
|
||||
SaveI, , atlach_si.asd
|
||||
SaveJ, , atlach_sj.asd
|
||||
SaveK, , atlach_sk.asd
|
||||
SaveL, , atlach_sl.asd
|
||||
SaveM, , atlach_sm.asd
|
||||
SaveN, , atlach_sn.asd
|
||||
SaveO, , atlach_so.asd
|
||||
SaveP, , atlach_sp.asd
|
||||
SaveQ, , atlach_sq.asd
|
||||
SaveR, , atlach_sr.asd
|
||||
SaveS, , atlach_ss.asd
|
||||
SaveT, , atlach_st.asd
|
||||
SaveU, , atlach_su.asd
|
||||
SaveV, , atlach_sv.asd
|
||||
SaveW, , atlach_sw.asd
|
||||
SaveX, , atlach_sx.asd
|
||||
SaveY, , atlach_sy.asd
|
||||
@@ -1,37 +0,0 @@
|
||||
# シェル・クレイル Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, chairs_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ald, chairs_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ald, chairs_wa.ald
|
||||
BGMA, GAMEDATA/*BA.ald, chairs_ba.ald
|
||||
WAIA, GAMEDATA/*WA.wai, chairs_wa.wai
|
||||
BGIA, GAMEDATA/*BA.bgi, chairs_ba.bgi
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
Init, GAMEDATA/*.ini, system39.ini
|
||||
SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD
|
||||
SaveA, , chairs_sa.asd
|
||||
SaveB, , chairs_sb.asd
|
||||
SaveC, , chairs_sc.asd
|
||||
SaveD, , chairs_sd.asd
|
||||
SaveE, , chairs_se.asd
|
||||
SaveF, , chairs_sf.asd
|
||||
SaveG, , chairs_sg.asd
|
||||
SaveH, , chairs_sh.asd
|
||||
SaveI, , chairs_si.asd
|
||||
SaveJ, , chairs_sj.asd
|
||||
SaveK, , chairs_sk.asd
|
||||
SaveL, , chairs_sl.asd
|
||||
SaveM, , chairs_sm.asd
|
||||
SaveN, , chairs_sn.asd
|
||||
SaveO, , chairs_so.asd
|
||||
SaveP, , chairs_sp.asd
|
||||
SaveQ, , chairs_sq.asd
|
||||
SaveR, , chairs_sr.asd
|
||||
SaveS, , chairs_ss.asd
|
||||
SaveT, , chairs_st.asd
|
||||
SaveU, , chairs_su.asd
|
||||
SaveV, , chairs_sv.asd
|
||||
SaveW, , chairs_sw.asd
|
||||
SaveX, , chairs_sx.asd
|
||||
SaveY, , chairs_sy.asd
|
||||
SaveZ, , chairs_sz.asd
|
||||
@@ -1,19 +0,0 @@
|
||||
# 大悪司 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, daiakuji_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, daiakuji_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, daiakuji_wa.ald
|
||||
DataA, GAMEDATA/*DA.ALD, daiakuji_da.ald
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
SaveA, , daiakuji_sa.asd
|
||||
SaveB, , daiakuji_sb.asd
|
||||
SaveC, , daiakuji_sc.asd
|
||||
SaveD, , daiakuji_sd.asd
|
||||
SaveE, , daiakuji_se.asd
|
||||
SaveF, , daiakuji_sf.asd
|
||||
SaveG, , daiakuji_sg.asd
|
||||
SaveH, , daiakuji_sh.asd
|
||||
SaveI, , daiakuji_si.asd
|
||||
SaveJ, , daiakuji_sj.asd
|
||||
SaveK, , daiakuji_sk.asd
|
||||
SaveL, , daiakuji_sl.asd
|
||||
@@ -1,17 +0,0 @@
|
||||
# dalk Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, dalk/dalk_sa.ald, dalk_sa.ald
|
||||
GraphicsA, dalk/dalk_ga.ald, dalk_ga.ald
|
||||
MidiA, dalk/dalk_ma.ald, dalk_ma.ald
|
||||
WaveA, dalk/dalk_wa.ald, dalk_wa.ald
|
||||
DataA, dalk/dalk_da.ald, dalk_da.ald
|
||||
SaveA, , dalk_sa.asd
|
||||
SaveB, , dalk_sb.asd
|
||||
SaveC, , dalk_sc.asd
|
||||
SaveD, , dalk_sd.asd
|
||||
SaveE, , dalk_se.asd
|
||||
SaveF, , dalk_sf.asd
|
||||
SaveG, , dalk_sg.asd
|
||||
SaveH, , dalk_sh.asd
|
||||
SaveI, , dalk_si.asd
|
||||
SaveJ, , dalk_sj.asd
|
||||
@@ -1,35 +0,0 @@
|
||||
# DARCROWS Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ALD, hime_sa.ald
|
||||
GraphicsA, gamedata/*GA.ALD, hime_ga.ald
|
||||
GraphicsB, gamedata/*GB.ALD, hime_gb.ald
|
||||
WaveA, gamedata/*WA.ALD, hime_wa.ald
|
||||
WaveB, gamedata/*WB.ALD, hime_wb.ald
|
||||
MidiA, gamedata/*MA.ALD, hime_ma.ald
|
||||
ResourceA, gamedata/*RA.ALD, hime_ra.ald
|
||||
SaveA, , hime_sa.asd
|
||||
SaveB, , hime_sb.asd
|
||||
SaveC, , hime_sc.asd
|
||||
SaveD, , hime_sd.asd
|
||||
SaveE, , hime_se.asd
|
||||
SaveF, , hime_sf.asd
|
||||
SaveG, , hime_sg.asd
|
||||
SaveH, , hime_sh.asd
|
||||
SaveI, , hime_si.asd
|
||||
SaveJ, , hime_sj.asd
|
||||
SaveK, , hime_sk.asd
|
||||
SaveL, , hime_sl.asd
|
||||
SaveM, , hime_sm.asd
|
||||
SaveN, , hime_sn.asd
|
||||
SaveO, , hime_so.asd
|
||||
SaveP, , hime_sp.asd
|
||||
SaveQ, , hime_sq.asd
|
||||
SaveR, , hime_sr.asd
|
||||
SaveS, , hime_ss.asd
|
||||
SaveT, , hime_st.asd
|
||||
SaveU, , hime_su.asd
|
||||
SaveV, , hime_sv.asd
|
||||
SaveW, , hime_sw.asd
|
||||
SaveX, , hime_sx.asd
|
||||
SaveY, , hime_sy.asd
|
||||
SaveZ, , hime_sz.asd
|
||||
@@ -1,16 +0,0 @@
|
||||
# DiaboLiQue Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, diabo_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, diabo_ga.ald
|
||||
GraphicsB, gamedata/*gb.ald, diabo_gb.ald
|
||||
WaveA, gamedata/*wa.ald, diabo_wa.ald
|
||||
SaveA, , diabo_sa.asd
|
||||
SaveB, , diabo_sb.asd
|
||||
SaveC, , diabo_sc.asd
|
||||
SaveD, , diabo_sd.asd
|
||||
SaveE, , diabo_se.asd
|
||||
SaveF, , diabo_sf.asd
|
||||
SaveG, , diabo_sg.asd
|
||||
SaveH, , diabo_sh.asd
|
||||
SaveI, , diabo_si.asd
|
||||
SaveJ, , diabo_sj.asd
|
||||
@@ -1,30 +0,0 @@
|
||||
# DiaboLiQue (low price version) Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, diabo_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, diabo_ga.ald
|
||||
WaveA, gamedata/*wa.ald, diabo_wa.ald
|
||||
SaveA, , diabo_sa.asd
|
||||
SaveB, , diabo_sb.asd
|
||||
SaveC, , diabo_sc.asd
|
||||
SaveD, , diabo_sd.asd
|
||||
SaveE, , diabo_se.asd
|
||||
SaveF, , diabo_sf.asd
|
||||
SaveG, , diabo_sg.asd
|
||||
SaveH, , diabo_sh.asd
|
||||
SaveI, , diabo_si.asd
|
||||
SaveJ, , diabo_sj.asd
|
||||
SaveK, , diabo_sk.asd
|
||||
SaveL, , diabo_sl.asd
|
||||
SaveM, , diabo_sm.asd
|
||||
SaveN, , diabo_sn.asd
|
||||
SaveO, , diabo_so.asd
|
||||
SaveP, , diabo_sp.asd
|
||||
SaveQ, , diabo_sq.asd
|
||||
SaveR, , diabo_sr.asd
|
||||
SaveS, , diabo_ss.asd
|
||||
SaveT, , diabo_st.asd
|
||||
SaveU, , diabo_su.asd
|
||||
SaveV, , diabo_sv.asd
|
||||
SaveW, , diabo_sw.asd
|
||||
SaveX, , diabo_sx.asd
|
||||
SaveY, , diabo_sy.asd
|
||||
@@ -1,10 +0,0 @@
|
||||
# DrStop! Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, drstop\!/ds_sa.ald, ds_sa.ald
|
||||
GraphicsA, drstop\!/ds_ga.ald, ds_ga.ald
|
||||
MidiA, drstop\!/ds_ma.ald, ds_ma.ald
|
||||
SaveA, , ds_sa.asd
|
||||
SaveB, , ds_sb.asd
|
||||
SaveC, , ds_sc.asd
|
||||
SaveD, , ds_sd.asd
|
||||
SaveE, , ds_se.asd
|
||||
@@ -1,38 +0,0 @@
|
||||
# エスカレイヤー Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, esuka_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, esuka_ga.ald
|
||||
GraphicsB, GAMEDATA/*GB.ALD, esuka_gb.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, esuka_wa.ald
|
||||
WaveB, GAMEDATA/*WB.ALD, esuka_wb.ald
|
||||
BGMA, GAMEDATA/*BA.ALD, esuka_ba.ald
|
||||
WAIA, GAMEDATA/*WA.WAI, esuka_wa.wai
|
||||
BGIA, GAMEDATA/*BA.BGI, esuka_ba.bgi
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
Init, GAMEDATA/*.ini, system39.ini
|
||||
SaveA, , esuka_sa.asd
|
||||
SaveB, , esuka_sb.asd
|
||||
SaveC, , esuka_sc.asd
|
||||
SaveD, , esuka_sd.asd
|
||||
SaveE, , esuka_se.asd
|
||||
SaveF, , esuka_sf.asd
|
||||
SaveG, , esuka_sg.asd
|
||||
SaveH, , esuka_sh.asd
|
||||
SaveI, , esuka_si.asd
|
||||
SaveJ, , esuka_sj.asd
|
||||
SaveK, , esuka_sk.asd
|
||||
SaveL, , esuka_sl.asd
|
||||
SaveM, , esuka_sm.asd
|
||||
SaveN, , esuka_sn.asd
|
||||
SaveO, , esuka_so.asd
|
||||
SaveP, , esuka_sp.asd
|
||||
SaveQ, , esuka_sq.asd
|
||||
SaveR, , esuka_sr.asd
|
||||
SaveS, , esuka_ss.asd
|
||||
SaveT, , esuka_st.asd
|
||||
SaveU, , esuka_su.asd
|
||||
SaveV, , esuka_sv.asd
|
||||
SaveW, , esuka_sw.asd
|
||||
SaveX, , esuka_sx.asd
|
||||
SaveY, , esuka_sy.asd
|
||||
SaveZ, , esuka_sz.asd
|
||||
@@ -1,8 +0,0 @@
|
||||
# Hushaby Baby Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ALD, hushaby_sa.ald
|
||||
GraphicsA, gamedata/*GA.ALD, hushaby_ga.ald
|
||||
WaveA, gamedata/*WA.ALD, hushaby_wa.ald
|
||||
MidiA, gamedata/*MA.ALD, hushaby_ma.ald
|
||||
SaveA, , hushaby_sa.asd
|
||||
|
||||
@@ -1,151 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# instgame: xsystem3.5 data install script
|
||||
#
|
||||
# Author: Hiroshi Naraki<naraki@debian.or.jp>
|
||||
#
|
||||
# $Id: instgame,v 1.5 1999/05/18 21:52:02 chikama Exp $
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# default value
|
||||
$cdrom_dir = "/cdrom";
|
||||
$dest_base_dir = "~/game";
|
||||
|
||||
# get program name
|
||||
($program) = ($0 =~ m%([^/]+)$%);
|
||||
|
||||
# get home directory
|
||||
$home = $ENV{'HOME'};
|
||||
|
||||
# show usage and exit
|
||||
sub usage {
|
||||
print "Usage: $program [options] <target>.inf \n";
|
||||
print " -c directory cdrom directory.(default: /cdrom) \n";
|
||||
print " -d directory destination game directory.(default: ~/game/<target>)\n";
|
||||
print " -g file game resource file name.(default: ~/game/<target>.gr)\n";
|
||||
print " -k tag keep the tagged file from copying.\n";
|
||||
}
|
||||
|
||||
;# parsing options
|
||||
while (@ARGV) {
|
||||
$_ = shift;
|
||||
s/^-// || do { $target = $_; last };
|
||||
$_ eq 'c' && @ARGV && do { $cdrom_dir = shift; next }; # install from
|
||||
$_ eq 'd' && @ARGV && do { $dest_base_dir = shift; next }; # install to
|
||||
$_ eq 'g' && @ARGV && do { $grfile = shift; next }; # gr-file to
|
||||
$_ eq 'k' && @ARGV && do { @keep_list = (@keep_list, shift); next }; # keep tag
|
||||
$_ eq 'v' && @ARGV && do { $debug = 1; next }; # debug
|
||||
&usage;
|
||||
exit;
|
||||
}
|
||||
|
||||
# nothing target
|
||||
if (! -f $target ) {
|
||||
&usage;
|
||||
exit;
|
||||
}
|
||||
# decide game resource file name
|
||||
$base = $target;
|
||||
$base =~ s%.*/%%;
|
||||
$base =~ s/\.inf//;
|
||||
$dest_dir = $dest_base_dir."/".$base;
|
||||
$grfile = $dest_base_dir."/".$base.".gr";
|
||||
|
||||
# expand directory name
|
||||
$dest_dir =~ s/~/$home/;
|
||||
$grfile =~ s/~/$home/;
|
||||
|
||||
# print variables if debug
|
||||
if ($debug) {
|
||||
print "cdrom_dir:$cdrom_dir\n";
|
||||
print "dest_dir:$dest_dir\n";
|
||||
print "grfile :$grfile\n";
|
||||
}
|
||||
|
||||
-d $cdrom_dir || die "$!:$cdrom_dir\n";
|
||||
|
||||
&make_dir($dest_dir);
|
||||
|
||||
open( DAT, $target) || die "Can't open $target:$!\n";
|
||||
|
||||
open( FILE, "> $grfile" ) || die "Can't create file $grfile:$!\n";
|
||||
print FILE "# System 3.5 GameResource File: [$target]\n";
|
||||
|
||||
while( $line = <DAT>) {
|
||||
$line =~ s/\#.*|\s//g;
|
||||
$line eq /^$/ && do { next };
|
||||
@data = split(/,/,$line);
|
||||
$tag = $data[0];
|
||||
$from = $data[1];
|
||||
$to = $data[2];
|
||||
|
||||
if( $to eq '' ) {
|
||||
&view_action("Ignore ", $tag, $from, $to);
|
||||
next;
|
||||
}
|
||||
$to = $dest_dir."/".$to;
|
||||
if( $tag eq '' ) {
|
||||
$keep = 0;
|
||||
} else {
|
||||
$keep = grep(/$tag*/, @keep_list );
|
||||
}
|
||||
if( $keep ) {
|
||||
$from = $cdrom_dir."/".$from ;
|
||||
&view_action("Linking", $tag, $from, $to);
|
||||
# symlink($from, $to) if !$debug;
|
||||
system("ln -s $from $to") if !$debug;
|
||||
} elsif( $from eq '' ) {
|
||||
# &view_action("Create ", $tag, $from, $to);
|
||||
# system("touch $to") if !$debug;
|
||||
&view_action("Skip ", $tag, $from, $to);
|
||||
} else {
|
||||
$from = $cdrom_dir."/".$from ;
|
||||
foreach ( <${from}>) {
|
||||
&view_action("Copying", $tag, $from, $to);
|
||||
system("cp $from $to") if !$debug;
|
||||
}
|
||||
}
|
||||
|
||||
# Create game resource file
|
||||
if( $tag ne '' ) {
|
||||
print "writing: $tag $to\n" if $debug;
|
||||
print FILE "$tag $to\n";
|
||||
}
|
||||
}
|
||||
close(FILE);
|
||||
close(DAT);
|
||||
exit;
|
||||
|
||||
sub view_action {
|
||||
local($action, $tag, $from, $to ) = @_;
|
||||
|
||||
print "$action $tag: $from -> $to\n";
|
||||
}
|
||||
|
||||
# mkdir destination directories.
|
||||
sub make_dir {
|
||||
local($target ) = @_;
|
||||
|
||||
@dest = split(/\//,$target);
|
||||
foreach $dir ( @dest ) {
|
||||
$work .= $dir.'/';
|
||||
print "checking $work\n" if $debug;
|
||||
if( !-d $work ) {
|
||||
print "mkdir $work\n" if $debug;
|
||||
mkdir( $work,0777) || die "Can't mkdir $work:$!\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
# kakurezuki Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, tsuki_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, tsuki_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, tsuki_wa.ald
|
||||
SaveA, , tsuki_sa.asd
|
||||
SaveB, , tsuki_sb.asd
|
||||
SaveC, , tsuki_sc.asd
|
||||
SaveD, , tsuki_sd.asd
|
||||
SaveE, , tsuki_se.asd
|
||||
SaveF, , tsuki_sf.asd
|
||||
SaveG, , tsuki_sg.asd
|
||||
SaveH, , tsuki_sh.asd
|
||||
SaveI, , tsuki_si.asd
|
||||
SaveJ, , tsuki_sj.asd
|
||||
SaveK, , tsuki_sk.asd
|
||||
@@ -1,17 +0,0 @@
|
||||
# Ikenai Katsumisensei Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, katsumi_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, katsumi_ga.ald
|
||||
GraphicsB, gamedata/*gb.ald, katsumi_gb.ald
|
||||
WaveA, gamedata/*wa.ald, katsumi_wa.ald
|
||||
SaveA, , katsumi_sa.asd
|
||||
SaveB, , katsumi_sb.asd
|
||||
SaveC, , katsumi_sc.asd
|
||||
SaveD, , katsumi_sd.asd
|
||||
SaveE, , katsumi_se.asd
|
||||
SaveF, , katsumi_sf.asd
|
||||
SaveG, , katsumi_sg.asd
|
||||
SaveH, , katsumi_sh.asd
|
||||
SaveI, , katsumi_si.asd
|
||||
SaveJ, , katsumi_sj.asd
|
||||
gamedata/gaiji.dat, gaiji.dat
|
||||
@@ -1,16 +0,0 @@
|
||||
# Kichikuoh Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, kichiku_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, kichiku_ga.ald
|
||||
GraphicsB, gamedata/*gb.ald, kichiku_gb.ald
|
||||
WaveA, gamedata/*wa.ald, kichiku_wa.ald
|
||||
SaveA, , kichiku_sa.asd
|
||||
SaveB, , kichiku_sb.asd
|
||||
SaveC, , kichiku_sc.asd
|
||||
SaveD, , kichiku_sd.asd
|
||||
SaveE, , kichiku_se.asd
|
||||
SaveF, , kichiku_sf.asd
|
||||
SaveG, , kichiku_sg.asd
|
||||
SaveH, , kichiku_sh.asd
|
||||
SaveI, , kichiku_si.asd
|
||||
SaveJ, , kichiku_sj.asd
|
||||
@@ -1,34 +0,0 @@
|
||||
# MAMATOTO Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, mamatoto_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, mamatoto_ga.ald
|
||||
GraphicsB, GAMEDATA/*GB.ALD, mamatoto_gb.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, mamatoto_wa.ald
|
||||
MidiA, GAMEDATA/*MA.ALD, mamatoto_ma.ald
|
||||
DataA, GAMEDATA/*DA.ALD, mamatoto_da.ald
|
||||
SaveA, , mamatoto_sa.asd
|
||||
SaveB, , mamatoto_sb.asd
|
||||
SaveC, , mamatoto_sc.asd
|
||||
SaveD, , mamatoto_sd.asd
|
||||
SaveE, , mamatoto_se.asd
|
||||
SaveF, , mamatoto_sf.asd
|
||||
SaveG, , mamatoto_sg.asd
|
||||
SaveH, , mamatoto_sh.asd
|
||||
SaveI, , mamatoto_si.asd
|
||||
SaveJ, , mamatoto_sj.asd
|
||||
SaveK, , mamatoto_sk.asd
|
||||
SaveL, , mamatoto_sl.asd
|
||||
SaveM, , mamatoto_sm.asd
|
||||
SaveN, , mamatoto_sn.asd
|
||||
SaveO, , mamatoto_so.asd
|
||||
SaveP, , mamatoto_sp.asd
|
||||
SaveQ, , mamatoto_sq.asd
|
||||
SaveR, , mamatoto_sr.asd
|
||||
SaveS, , mamatoto_ss.asd
|
||||
SaveT, , mamatoto_st.asd
|
||||
SaveU, , mamatoto_su.asd
|
||||
SaveV, , mamatoto_sv.asd
|
||||
SaveW, , mamatoto_sw.asd
|
||||
SaveX, , mamatoto_sx.asd
|
||||
SaveY, , mamatoto_sy.asd
|
||||
SaveZ, , mamatoto_sz.asd
|
||||
@@ -1,17 +0,0 @@
|
||||
# MamoriGami Sama Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, mamori_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, mamori_ga.ald
|
||||
GraphicsB, GAMEDATA/*GB.ALD, mamori_gb.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, mamori_wa.ald
|
||||
MidiA, GAMEDATA/*MA.ALD, mamori_ma.ald
|
||||
SaveA, , mamori_sa.asd
|
||||
SaveB, , mamori_sb.asd
|
||||
SaveC, , mamori_sc.asd
|
||||
SaveD, , mamori_sd.asd
|
||||
SaveE, , mamori_se.asd
|
||||
SaveF, , mamori_sf.asd
|
||||
SaveG, , mamori_sg.asd
|
||||
SaveH, , mamori_sh.asd
|
||||
SaveI, , mamori_si.asd
|
||||
SaveJ, , mamori_sj.asd
|
||||
@@ -1,9 +0,0 @@
|
||||
# Ikusa Miko Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, miko_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, miko_ga.ald
|
||||
WaveA, gamedata/*wa.ald, miko_wa.ald
|
||||
SaveA, , miko_sa.asd
|
||||
SaveB, , miko_sb.asd
|
||||
SaveC, , miko_sc.asd
|
||||
SaveJ, , miko_sj.asd
|
||||
@@ -1,7 +0,0 @@
|
||||
# mugen hoyo Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, mugen_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, mugen_ga.ald
|
||||
SaveA, , mugen_sa.asd
|
||||
SaveB, , mugen_sb.asd
|
||||
SaveC, , mugen_sc.asd
|
||||
@@ -1,41 +0,0 @@
|
||||
# Night Demon Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ald, nd_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ald, nd_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ald, nd_wa.ald
|
||||
BGMA, GAMEDATA/*BA.ald, nd_ba.ald
|
||||
WAIA, GAMEDATA/*WA.wai, nd_wa.wai
|
||||
BGIA, GAMEDATA/*BA.bgi, nd_ba.bgi
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
Init, GAMEDATA/*.ini, system39.ini
|
||||
SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD
|
||||
ALK01, GAMEDATA/AliceLogo.alk, AliceLogo.alk
|
||||
ALK02, GAMEDATA/NightDemonDemo1.alk, NightDemonDemo1.alk
|
||||
ALK03, GAMEDATA/NightDemonDemo2.alk, NightDemonDemo2.alk
|
||||
ALK04, GAMEDATA/NightDemonDemo3.alk, NightDemonDemo3.alk
|
||||
SaveA, , nd_sa.asd
|
||||
SaveB, , nd_sb.asd
|
||||
SaveC, , nd_sc.asd
|
||||
SaveD, , nd_sd.asd
|
||||
SaveE, , nd_se.asd
|
||||
SaveF, , nd_sf.asd
|
||||
SaveG, , nd_sg.asd
|
||||
SaveH, , nd_sh.asd
|
||||
SaveI, , nd_si.asd
|
||||
SaveJ, , nd_sj.asd
|
||||
SaveK, , nd_sk.asd
|
||||
SaveL, , nd_sl.asd
|
||||
SaveM, , nd_sm.asd
|
||||
SaveN, , nd_sn.asd
|
||||
SaveO, , nd_so.asd
|
||||
SaveP, , nd_sp.asd
|
||||
SaveQ, , nd_sq.asd
|
||||
SaveR, , nd_sr.asd
|
||||
SaveS, , nd_ss.asd
|
||||
SaveT, , nd_st.asd
|
||||
SaveU, , nd_su.asd
|
||||
SaveV, , nd_sv.asd
|
||||
SaveW, , nd_sw.asd
|
||||
SaveX, , nd_sx.asd
|
||||
SaveY, , nd_sy.asd
|
||||
SaveZ, , nd_sz.asd
|
||||
@@ -1,32 +0,0 @@
|
||||
# Only You リクルス Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, onlyyou_r_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, onlyyou_r_ga.ald
|
||||
WaveA, gamedata/*WA.ald, onlyyou_r_wa.ald
|
||||
Ain, gamedata/*.ain, System39.ain
|
||||
SaveA, , onlyyou_r_sa.asd
|
||||
SaveB, , onlyyou_r_sb.asd
|
||||
SaveC, , onlyyou_r_sc.asd
|
||||
SaveD, , onlyyou_r_sd.asd
|
||||
SaveE, , onlyyou_r_se.asd
|
||||
SaveF, , onlyyou_r_sf.asd
|
||||
SaveG, , onlyyou_r_sg.asd
|
||||
SaveH, , onlyyou_r_sh.asd
|
||||
SaveI, , onlyyou_r_si.asd
|
||||
SaveJ, , onlyyou_r_sj.asd
|
||||
SaveK, , onlyyou_r_sk.asd
|
||||
SaveL, , onlyyou_r_sl.asd
|
||||
SaveM, , onlyyou_r_sm.asd
|
||||
SaveN, , onlyyou_r_sn.asd
|
||||
SaveO, , onlyyou_r_so.asd
|
||||
SaveP, , onlyyou_r_sp.asd
|
||||
SaveQ, , onlyyou_r_sq.asd
|
||||
SaveR, , onlyyou_r_sr.asd
|
||||
SaveS, , onlyyou_r_ss.asd
|
||||
SaveT, , onlyyou_r_st.asd
|
||||
SaveU, , onlyyou_r_su.asd
|
||||
SaveV, , onlyyou_r_sv.asd
|
||||
SaveW, , onlyyou_r_sw.asd
|
||||
SaveX, , onlyyou_r_sx.asd
|
||||
SaveY, , onlyyou_r_sy.asd
|
||||
SaveZ, , onlyyou_r_sz.asd
|
||||
@@ -1,16 +0,0 @@
|
||||
# Oudou Yusha Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, oudou_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, oudou_ga.ald
|
||||
GraphicsB, gamedata/*gb.ald, oudou_gb.ald
|
||||
WaveA, gamedata/*wa.ald, oudou_wa.ald
|
||||
SaveA, , oudou_sa.asd
|
||||
SaveB, , oudou_sb.asd
|
||||
SaveC, , oudou_sc.asd
|
||||
SaveD, , oudou_sd.asd
|
||||
SaveE, , oudou_se.asd
|
||||
SaveF, , oudou_sf.asd
|
||||
SaveG, , oudou_sg.asd
|
||||
SaveH, , oudou_sh.asd
|
||||
SaveI, , oudou_si.asd
|
||||
SaveJ, , oudou_sj.asd
|
||||
@@ -1,36 +0,0 @@
|
||||
# Kaerunyo Panyon Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, panyo_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, panyo_ga.ald
|
||||
WaveA, gamedata/*wa.ald, panyo_wa.ald
|
||||
SaveA, , panyo_sa.asd
|
||||
SaveB, , panyo_sb.asd
|
||||
SaveC, , panyo_sc.asd
|
||||
SaveD, , panyo_sd.asd
|
||||
SaveE, , panyo_se.asd
|
||||
SaveF, , panyo_sf.asd
|
||||
SaveG, , panyo_sg.asd
|
||||
SaveH, , panyo_sh.asd
|
||||
SaveI, , panyo_si.asd
|
||||
SaveJ, , panyo_sj.asd
|
||||
SaveK, , panyo_sk.asd
|
||||
SaveL, , panyo_sl.asd
|
||||
SaveM, , panyo_sm.asd
|
||||
SaveN, , panyo_sn.asd
|
||||
SaveO, , panyo_so.asd
|
||||
, gamedata/floor_1.map, floor_1.map
|
||||
, gamedata/floor_2.map, floor_2.map
|
||||
, gamedata/floor_3.map, floor_3.map
|
||||
, gamedata/floor_4.map, floor_4.map
|
||||
, gamedata/floor_5.map, floor_5.map
|
||||
, gamedata/floor_6.map, floor_6.map
|
||||
, gamedata/floor_7.map, floor_7.map
|
||||
, gamedata/floor_8.map, floor_8.map
|
||||
, gamedata/floor_9.map, floor_9.map
|
||||
, gamedata/floor_10.map, floor_10.map
|
||||
, gamedata/floor_11.map, floor_11.map
|
||||
, gamedata/floor_12.map, floor_12.map
|
||||
, gamedata/floor_13.map, floor_13.map
|
||||
, gamedata/floor_14.map, floor_14.map
|
||||
, gamedata/floor_15.map, floor_15.map
|
||||
, gamedata/floor_16.map, floor_16.map
|
||||
@@ -1,63 +0,0 @@
|
||||
# Kaerunyo Panyon (low price version) Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, panyo_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, panyo_ga.ald
|
||||
WaveA, gamedata/*wa.ald, panyo_wa.ald
|
||||
SaveA, , panyo_sa.asd
|
||||
SaveB, , panyo_sb.asd
|
||||
SaveC, , panyo_sc.asd
|
||||
SaveD, , panyo_sd.asd
|
||||
SaveE, , panyo_se.asd
|
||||
SaveF, , panyo_sf.asd
|
||||
SaveG, , panyo_sg.asd
|
||||
SaveH, , panyo_sh.asd
|
||||
SaveI, , panyo_si.asd
|
||||
SaveJ, , panyo_sj.asd
|
||||
SaveK, , panyo_sk.asd
|
||||
SaveL, , panyo_sl.asd
|
||||
SaveM, , panyo_sm.asd
|
||||
SaveN, , panyo_sn.asd
|
||||
SaveO, , panyo_so.asd
|
||||
SaveP, , panyo_sp.asd
|
||||
SaveQ, , panyo_sq.asd
|
||||
SaveR, , panyo_sr.asd
|
||||
SaveS, , panyo_ss.asd
|
||||
SaveT, , panyo_st.asd
|
||||
SaveU, , panyo_su.asd
|
||||
SaveV, , panyo_sv.asd
|
||||
SaveW, , panyo_sw.asd
|
||||
SaveX, , panyo_sx.asd
|
||||
SaveY, , panyo_sy.asd
|
||||
, gamedata/floor_1.map, floor_1.map
|
||||
, gamedata/floor_2.map, floor_2.map
|
||||
, gamedata/floor_3.map, floor_3.map
|
||||
, gamedata/floor_4.map, floor_4.map
|
||||
, gamedata/floor_5.map, floor_5.map
|
||||
, gamedata/floor_6.map, floor_6.map
|
||||
, gamedata/floor_7.map, floor_7.map
|
||||
, gamedata/floor_8.map, floor_8.map
|
||||
, gamedata/floor_9.map, floor_9.map
|
||||
, gamedata/floor_10.map, floor_10.map
|
||||
, gamedata/floor_11.map, floor_11.map
|
||||
, gamedata/floor_12.map, floor_12.map
|
||||
, gamedata/floor_13.map, floor_13.map
|
||||
, gamedata/floor_14.map, floor_14.map
|
||||
, gamedata/floor_15.map, floor_15.map
|
||||
, gamedata/floor_16.map, floor_16.map
|
||||
, gamedata/floor_17.map, floor_17.map
|
||||
, gamedata/floor_18.map, floor_18.map
|
||||
, gamedata/floor_19.map, floor_19.map
|
||||
, gamedata/floor_20.map, floor_20.map
|
||||
, gamedata/floor_21.map, floor_21.map
|
||||
, gamedata/floor_22.map, floor_22.map
|
||||
, gamedata/floor_23.map, floor_23.map
|
||||
, gamedata/floor_24.map, floor_24.map
|
||||
, gamedata/floor_25.map, floor_25.map
|
||||
, gamedata/floor_26.map, floor_26.map
|
||||
, gamedata/floor_27.map, floor_27.map
|
||||
, gamedata/floor_28.map, floor_28.map
|
||||
, gamedata/floor_29.map, floor_29.map
|
||||
, gamedata/floor_30.map, floor_30.map
|
||||
, gamedata/floor_31.map, floor_31.map
|
||||
, gamedata/floor_32.map, floor_32.map
|
||||
, gamedata/floor_33.map, floor_33.map
|
||||
@@ -1,33 +0,0 @@
|
||||
# PastelChime Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ALD, pascha_sa.ald
|
||||
GraphicsA, gamedata/*GA.ALD, pascha_ga.ald
|
||||
WaveA, gamedata/*WA.ALD, pascha_wa.ald
|
||||
MidiA, gamedata/*MA.ALD, pascha_ma.ald
|
||||
DataA, gamedata/*DA.ALD, pascha_da.ald
|
||||
SaveA, , pascha_sa.asd
|
||||
SaveB, , pascha_sb.asd
|
||||
SaveC, , pascha_sc.asd
|
||||
SaveD, , pascha_sd.asd
|
||||
SaveE, , pascha_se.asd
|
||||
SaveF, , pascha_sf.asd
|
||||
SaveG, , pascha_sg.asd
|
||||
SaveH, , pascha_sh.asd
|
||||
SaveI, , pascha_si.asd
|
||||
SaveJ, , pascha_sj.asd
|
||||
SaveK, , pascha_sk.asd
|
||||
SaveL, , pascha_sl.asd
|
||||
SaveM, , pascha_sm.asd
|
||||
SaveN, , pascha_sn.asd
|
||||
SaveO, , pascha_so.asd
|
||||
SaveP, , pascha_sp.asd
|
||||
SaveQ, , pascha_sq.asd
|
||||
SaveR, , pascha_sr.asd
|
||||
SaveS, , pascha_ss.asd
|
||||
SaveT, , pascha_st.asd
|
||||
SaveU, , pascha_su.asd
|
||||
SaveV, , pascha_sv.asd
|
||||
SaveW, , pascha_sw.asd
|
||||
SaveX, , pascha_sx.asd
|
||||
SaveY, , pascha_sy.asd
|
||||
SaveZ, , pascha_sz.asd
|
||||
@@ -1,20 +0,0 @@
|
||||
# Persiom Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, persiom_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, persiom_ga.ald
|
||||
GraphicsB, GAMEDATA/*GB.ALD, persiom_gb.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, persiom_wa.ald
|
||||
MidiA, GAMEDATA/*MA.ALD, persiom_ma.ald
|
||||
DataA, GAMEDATA/*DA.ALD, persiom_da.ald
|
||||
SaveA, , persiom_sa.asd
|
||||
SaveB, , persiom_sb.asd
|
||||
SaveC, , persiom_sc.asd
|
||||
SaveD, , persiom_sd.asd
|
||||
SaveE, , persiom_se.asd
|
||||
SaveF, , persiom_sf.asd
|
||||
SaveG, , persiom_sg.asd
|
||||
SaveH, , persiom_sh.asd
|
||||
SaveI, , persiom_si.asd
|
||||
SaveJ, , persiom_sj.asd
|
||||
SaveK, , persiom_sk.asd
|
||||
SaveL, , persiom_sl.asd
|
||||
@@ -1,17 +0,0 @@
|
||||
# prostudent good Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, progood_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, progood_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, progood_wa.ald
|
||||
DataA, GAMEDATA/*DA.ALD, progood_da.ald
|
||||
SaveA, , progood_sa.asd
|
||||
SaveB, , progood_sb.asd
|
||||
SaveC, , progood_sc.asd
|
||||
SaveD, , progood_sd.asd
|
||||
SaveE, , progood_se.asd
|
||||
SaveF, , progood_sf.asd
|
||||
SaveG, , progood_sg.asd
|
||||
SaveH, , progood_sh.asd
|
||||
SaveI, , progood_si.asd
|
||||
SaveJ, , progood_sj.asd
|
||||
SaveK, , progood_sk.asd
|
||||
@@ -1,20 +0,0 @@
|
||||
# Rance 1 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, rance1/rancesa.ald, rance1_sa.ald
|
||||
GraphicsA, rance1/rancega.ald, rance1_ga.ald
|
||||
MidiA, rance1/rancema.ald, rance1_ma.ald
|
||||
WaveA, rance1/rancewa.ald, rance1_wa.ald
|
||||
SaveA, , rance1_sa.asd
|
||||
SaveB, , rance1_sb.asd
|
||||
SaveC, , rance1_sc.asd
|
||||
SaveD, , rance1_sd.asd
|
||||
SaveE, , rance1_se.asd
|
||||
SaveF, , rance1_sf.asd
|
||||
SaveG, , rance1_sg.asd
|
||||
SaveH, , rance1_sh.asd
|
||||
SaveI, , rance1_si.asd
|
||||
SaveJ, , rance1_sj.asd
|
||||
SaveK, , rance1_sk.asd
|
||||
SaveL, , rance1_sl.asd
|
||||
SaveM, , rance1_sm.asd
|
||||
SaveN, , rance1_sn.asd
|
||||
@@ -1,20 +0,0 @@
|
||||
# Rance 2 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, rance2/rance2sa.ald, rance2_sa.ald
|
||||
GraphicsA, rance2/rance2ga.ald, rance2_ga.ald
|
||||
MidiA, rance2/rance2ma.ald, rance2_ma.ald
|
||||
WaveA, rance2/rance2wa.ald, rance2_wa.ald
|
||||
SaveA, , rance2_sa.asd
|
||||
SaveB, , rance2_sb.asd
|
||||
SaveC, , rance2_sc.asd
|
||||
SaveD, , rance2_sd.asd
|
||||
SaveE, , rance2_se.asd
|
||||
SaveF, , rance2_sf.asd
|
||||
SaveG, , rance2_sg.asd
|
||||
SaveH, , rance2_sh.asd
|
||||
SaveI, , rance2_si.asd
|
||||
SaveJ, , rance2_sj.asd
|
||||
SaveK, , rance2_sk.asd
|
||||
SaveL, , rance2_sl.asd
|
||||
SaveM, , rance2_sm.asd
|
||||
SaveN, , rance2_sn.asd
|
||||
@@ -1,15 +0,0 @@
|
||||
# Rance 3 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, rance3/rance3sa.ald, rance3sa.ald
|
||||
GraphicsA, rance3/rance3ga.ald, rance3ga.ald
|
||||
WaveA, rance3/rance3wa.ald, rance3wa.ald
|
||||
MidiA, rance3/rance3ma.ald, rance3ma.ald
|
||||
DataA, rance3/rance3da.ald, rance3da.ald
|
||||
SaveA, , rance3sa.asd
|
||||
SaveB, , rance3sb.asd
|
||||
SaveC, , rance3sc.asd
|
||||
SaveD, , rance3sd.asd
|
||||
SaveE, , rance3se.asd
|
||||
SaveF, , rance3sf.asd
|
||||
SaveG, , rance3sg.asd
|
||||
SaveH, , rance3sh.asd
|
||||
@@ -1,15 +0,0 @@
|
||||
# Rance 4 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, rance4_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, rance4_ga.ald
|
||||
WaveA, gamedata/*wa.ald, rance4_wa.ald
|
||||
SaveA, , rance4_sa.asd
|
||||
SaveB, , rance4_sb.asd
|
||||
SaveC, , rance4_sc.asd
|
||||
SaveD, , rance4_sd.asd
|
||||
SaveE, , rance4_se.asd
|
||||
SaveF, , rance4_sf.asd
|
||||
SaveG, , rance4_sg.asd
|
||||
SaveH, , rance4_sh.asd
|
||||
SaveI, , rance4_si.asd
|
||||
SaveJ, , rance4_sj.asd
|
||||
@@ -1,36 +0,0 @@
|
||||
# Rance5D Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, r5d_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, r5d_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, r5d_wa.ald
|
||||
BGMA, GAMEDATA/*BA.ALD, r5d_ba.ald
|
||||
BGIA, GAMEDATA/*BA.BGI, r5d_ba.bgi
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
Init, GAMEDATA/*.ini, system39.ini
|
||||
SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD
|
||||
SaveA, , r5d_sa.asd
|
||||
SaveB, , r5d_sb.asd
|
||||
SaveC, , r5d_sc.asd
|
||||
SaveD, , r5d_sd.asd
|
||||
SaveE, , r5d_se.asd
|
||||
SaveF, , r5d_sf.asd
|
||||
SaveG, , r5d_sg.asd
|
||||
SaveH, , r5d_sh.asd
|
||||
SaveI, , r5d_si.asd
|
||||
SaveJ, , r5d_sj.asd
|
||||
SaveK, , r5d_sk.asd
|
||||
SaveL, , r5d_sl.asd
|
||||
SaveM, , r5d_sm.asd
|
||||
SaveN, , r5d_sn.asd
|
||||
SaveO, , r5d_so.asd
|
||||
SaveP, , r5d_sp.asd
|
||||
SaveQ, , r5d_sq.asd
|
||||
SaveR, , r5d_sr.asd
|
||||
SaveS, , r5d_ss.asd
|
||||
SaveT, , r5d_st.asd
|
||||
SaveU, , r5d_su.asd
|
||||
SaveV, , r5d_sv.asd
|
||||
SaveW, , r5d_sw.asd
|
||||
SaveX, , r5d_sx.asd
|
||||
SaveY, , r5d_sy.asd
|
||||
SaveZ, , r5d_sz.asd
|
||||
@@ -1,31 +0,0 @@
|
||||
# SeeInAO Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, seeinao_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, seeinao_ga.ald
|
||||
WaveA, gamedata/*WA.ald, seeinao_wa.ald
|
||||
MidiA, gamedata/*MA.ald, seeinao_ma.ald
|
||||
SaveA, , seeinao_sa.asd
|
||||
SaveB, , seeinao_sb.asd
|
||||
SaveC, , seeinao_sc.asd
|
||||
SaveD, , seeinao_sd.asd
|
||||
SaveE, , seeinao_se.asd
|
||||
SaveF, , seeinao_sf.asd
|
||||
SaveG, , seeinao_sg.asd
|
||||
SaveH, , seeinao_sh.asd
|
||||
SaveI, , seeinao_si.asd
|
||||
SaveJ, , seeinao_sj.asd
|
||||
SaveK, , seeinao_sk.asd
|
||||
SaveL, , seeinao_sl.asd
|
||||
SaveM, , seeinao_sm.asd
|
||||
SaveN, , seeinao_sn.asd
|
||||
SaveO, , seeinao_so.asd
|
||||
SaveP, , seeinao_sp.asd
|
||||
SaveQ, , seeinao_sq.asd
|
||||
SaveR, , seeinao_sr.asd
|
||||
SaveS, , seeinao_ss.asd
|
||||
SaveT, , seeinao_st.asd
|
||||
SaveU, , seeinao_su.asd
|
||||
SaveV, , seeinao_sv.asd
|
||||
SaveW, , seeinao_sw.asd
|
||||
SaveX, , seeinao_sx.asd
|
||||
SaveY, , seeinao_sy.asd
|
||||
@@ -1,16 +0,0 @@
|
||||
# Toushin Toshi Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, ???_?s?s/*_sa.ald, toushin_sa.ald
|
||||
GraphicsA, ???_?s?s/*_ga.ald, toushin_ga.ald
|
||||
MidiA, ???_?s?s/*_ma.ald, toushin_ma.ald
|
||||
WaveA, ???_?s?s/*_wa.ald, toushin_wa.ald
|
||||
DataA, ???_?s?s/*_da.ald, toushin_da.ald
|
||||
SaveA, , toushin_sa.asd
|
||||
SaveB, , toushin_sb.asd
|
||||
SaveC, , toushin_sc.asd
|
||||
SaveD, , toushin_sd.asd
|
||||
SaveE, , toushin_se.asd
|
||||
SaveF, , toushin_sf.asd
|
||||
SaveG, , toushin_sg.asd
|
||||
SaveH, , toushin_sh.asd
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# Toushintoshi2 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, toushin2_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, toushin2_ga.ald
|
||||
WaveA, gamedata/*wa.ald, toushin2_wa.ald
|
||||
DataA, gamedata/*da.ald, toushin2_da.ald
|
||||
SaveA, , toushin2_sa.asd
|
||||
SaveB, , toushin2_sb.asd
|
||||
SaveC, , toushin2_sc.asd
|
||||
SaveD, , toushin2_sd.asd
|
||||
SaveE, , toushin2_se.asd
|
||||
SaveF, , toushin2_sf.asd
|
||||
SaveG, , toushin2_sg.asd
|
||||
SaveH, , toushin2_sh.asd
|
||||
SaveI, , toushin2_si.asd
|
||||
SaveJ, , toushin2_sj.asd
|
||||
@@ -1,32 +0,0 @@
|
||||
# 妻みぐい Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*SA.ald, tsuma_sa.ald
|
||||
GraphicsA, gamedata/*GA.ald, tsuma_ga.ald
|
||||
WaveA, gamedata/*WA.ald, tsuma_wa.ald
|
||||
Ain, gamedata/*.ain, system39.ain
|
||||
SaveA, , tsuma_sa.asd
|
||||
SaveB, , tsuma_sb.asd
|
||||
SaveC, , tsuma_sc.asd
|
||||
SaveD, , tsuma_sd.asd
|
||||
SaveE, , tsuma_se.asd
|
||||
SaveF, , tsuma_sf.asd
|
||||
SaveG, , tsuma_sg.asd
|
||||
SaveH, , tsuma_sh.asd
|
||||
SaveI, , tsuma_si.asd
|
||||
SaveJ, , tsuma_sj.asd
|
||||
SaveK, , tsuma_sk.asd
|
||||
SaveL, , tsuma_sl.asd
|
||||
SaveM, , tsuma_sm.asd
|
||||
SaveN, , tsuma_sn.asd
|
||||
SaveO, , tsuma_so.asd
|
||||
SaveP, , tsuma_sp.asd
|
||||
SaveQ, , tsuma_sq.asd
|
||||
SaveR, , tsuma_sr.asd
|
||||
SaveS, , tsuma_ss.asd
|
||||
SaveT, , tsuma_st.asd
|
||||
SaveU, , tsuma_su.asd
|
||||
SaveV, , tsuma_sv.asd
|
||||
SaveW, , tsuma_sw.asd
|
||||
SaveX, , tsuma_sx.asd
|
||||
SaveY, , tsuma_sy.asd
|
||||
SaveZ, , tsuma_sz.asd
|
||||
@@ -1,38 +0,0 @@
|
||||
# 妻みぐい2 Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, GAMEDATA/*SA.ALD, tsuma2_sa.ald
|
||||
GraphicsA, GAMEDATA/*GA.ALD, tsuma2_ga.ald
|
||||
WaveA, GAMEDATA/*WA.ALD, tsuma2_wa.ald
|
||||
WaveB, GAMEDATA/*WB.ALD, tsuma2_wb.ald
|
||||
BGMA, GAMEDATA/*BA.ALD, tsuma2_ba.ald
|
||||
WAIA, GAMEDATA/*WA.WAI, tsuma2_wa.wai
|
||||
BGIA, GAMEDATA/*BA.BGI, tsuma2_ba.bgi
|
||||
Ain, GAMEDATA/*.ain, system39.ain
|
||||
Init, GAMEDATA/*.ini, system39.ini
|
||||
SACT01, GAMEDATA/SACTEFAM.KLD, SACTEFAM.KLD
|
||||
SaveA, , tsuma2_sa.asd
|
||||
SaveB, , tsuma2_sb.asd
|
||||
SaveC, , tsuma2_sc.asd
|
||||
SaveD, , tsuma2_sd.asd
|
||||
SaveE, , tsuma2_se.asd
|
||||
SaveF, , tsuma2_sf.asd
|
||||
SaveG, , tsuma2_sg.asd
|
||||
SaveH, , tsuma2_sh.asd
|
||||
SaveI, , tsuma2_si.asd
|
||||
SaveJ, , tsuma2_sj.asd
|
||||
SaveK, , tsuma2_sk.asd
|
||||
SaveL, , tsuma2_sl.asd
|
||||
SaveM, , tsuma2_sm.asd
|
||||
SaveN, , tsuma2_sn.asd
|
||||
SaveO, , tsuma2_so.asd
|
||||
SaveP, , tsuma2_sp.asd
|
||||
SaveQ, , tsuma2_sq.asd
|
||||
SaveR, , tsuma2_sr.asd
|
||||
SaveS, , tsuma2_ss.asd
|
||||
SaveT, , tsuma2_st.asd
|
||||
SaveU, , tsuma2_su.asd
|
||||
SaveV, , tsuma2_sv.asd
|
||||
SaveW, , tsuma2_sw.asd
|
||||
SaveX, , tsuma2_sx.asd
|
||||
SaveY, , tsuma2_sy.asd
|
||||
SaveZ, , tsuma2_sz.asd
|
||||
@@ -1,32 +0,0 @@
|
||||
# Zero-shiki (low price version) Install infomation
|
||||
# Tag, #origin, #destination
|
||||
ScenarioA, gamedata/*sa.ald, zero_sa.ald
|
||||
GraphicsA, gamedata/*ga.ald, zero_ga.ald
|
||||
WaveA, gamedata/*wa.ald, zero_wa.ald
|
||||
SaveA, , zero_sa.asd
|
||||
SaveB, , zero_sb.asd
|
||||
SaveC, , zero_sc.asd
|
||||
SaveD, , zero_sd.asd
|
||||
SaveE, , zero_se.asd
|
||||
SaveF, , zero_sf.asd
|
||||
SaveG, , zero_sg.asd
|
||||
SaveH, , zero_sh.asd
|
||||
SaveI, , zero_si.asd
|
||||
SaveJ, , zero_sj.asd
|
||||
SaveK, , zero_sk.asd
|
||||
SaveL, , zero_sl.asd
|
||||
SaveM, , zero_sm.asd
|
||||
SaveN, , zero_sn.asd
|
||||
SaveO, , zero_so.asd
|
||||
SaveP, , zero_sp.asd
|
||||
SaveQ, , zero_sq.asd
|
||||
SaveR, , zero_sr.asd
|
||||
SaveS, , zero_ss.asd
|
||||
SaveT, , zero_st.asd
|
||||
SaveU, , zero_su.asd
|
||||
SaveV, , zero_sv.asd
|
||||
SaveW, , zero_sw.asd
|
||||
SaveX, , zero_sx.asd
|
||||
SaveY, , zero_sy.asd
|
||||
, gamedata/map_data.dat, MAP_DATA.DAT
|
||||
, gamedata/ur_data.dat, UR_DATA.DAT
|
||||
@@ -1,23 +0,0 @@
|
||||
BUG INFORMATION for
|
||||
System 3.5 for X Window System Version 1.7
|
||||
|
||||
|
||||
* いけないかつみ先生の外字はサポートしていません。
|
||||
|
||||
|
||||
* Ctrl+Cで強制終了したり、異常終了した場合 IPC Keyがまれに残る事があります。
|
||||
% ipcs
|
||||
でidを確認し、
|
||||
% ipcrm shm ???
|
||||
で消して下さい。(Linuxの場合。その他は man ipcrm してください)
|
||||
|
||||
|
||||
* SDL を有効にしてコンパイルしフルスクリーンで実行した場合、真中クリックに
|
||||
よるメニューが表示されません。その場合、F4 キーで一旦フルスクリーンを解除
|
||||
してください。
|
||||
|
||||
|
||||
* フルスクリーン実行中にマウスの真中ボタンクリックによるポップアップ
|
||||
メニューを出すと、マウスカーソルが画面の表示領域を超えて動いてしまいます。
|
||||
|
||||
[EOF]
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
Q. FreeBSD でコンパイルできない。make とするとエラーが出る。
|
||||
A. gmake (GNU make) を使ってください。
|
||||
|
||||
|
||||
Q. cant load font JISX0201.1976-0 と出て終了してしまう。
|
||||
A. ~/.xsys35rc に自分のシステムにインストールされているフォントを指定して
|
||||
いますか?
|
||||
|
||||
% xlsfonts | grep 0-0-0-0 | grep jisx0201.1976
|
||||
|
||||
とやって表示されるフォント名を ~/.xsys35rc の font_gothic と font_mincho
|
||||
に書きます。今の所この2つしか使用していません。
|
||||
@@ -100,7 +100,6 @@
|
||||
= 動きません
|
||||
|
||||
[王子さま Lv1]
|
||||
= 動きません
|
||||
|
||||
[Only You 〜リ・クルス〜]
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
|
||||
色がおかしいぞ???
|
||||
|
||||
|
||||
起動してみて色がおかしいと思った方はこのドキュメントを読み進めて下さい。
|
||||
|
||||
|
||||
1. i386系
|
||||
|
||||
色がおかしいと言うことはまず無いと思いますが、ビデオカードの中には packed24
|
||||
と呼ばれる 1pixel につき 3byte を使って 1600万色モードを実現しているものが
|
||||
あります。例えば Matrox Mystique などがあります(通常は 1pixel につき 4byte
|
||||
を使って 1600万色モードを実現しています)。
|
||||
|
||||
xdpyinfo とやって supported pixmap formats のリストに
|
||||
depth 24, bits_per_pixel 24, scanline_pad 32
|
||||
とあれば packed24 です。
|
||||
|
||||
この packed24 にも対応していますが、速度の面から 16bpp または32bpp で X server
|
||||
を起動することを推奨します。
|
||||
|
||||
|
||||
2. PPC系
|
||||
|
||||
linuxPPCでは X server として Xpmac と XF68_FBDev のどちらかが使われて
|
||||
います。LinuxPPC R4 あたりの X Server では次のような不具合があるそうなの
|
||||
でうまく回避して下さい。
|
||||
|
||||
* Xpmac でアクセラレーションを有効にしたものを使うとXが固まるので、
|
||||
xsystem35 を -no-shm オプション付で実行して下さい。設定ファイル(.xsys35rc)
|
||||
に -no-shmに関する設定を書いておくこともできます。
|
||||
|
||||
|
||||
3. SGI系, Sparc系
|
||||
|
||||
これらの X Server は ピクセルのRGBのならびがi386系などとは逆になっています。
|
||||
行儀の良いアプリケーションは X Server から情報を取り出して適切に処理する事で
|
||||
どのようなRGBの並びにも対応できるはずなのですが、xsystem35は手抜きをしていて
|
||||
ハードコーディングしています。これは速度(?)と利用数の問題と言う事で.. (^^;;;
|
||||
|
||||
xdpyinfo として Visual のところで
|
||||
|
||||
class: TrueColor
|
||||
depth: 24 planes
|
||||
red, green, blue masks: 0xff, 0xff00, 0xff0000
|
||||
|
||||
のようになっていたら、BGR の並びと言うことになります。SGI 系と Sparc 系では
|
||||
これがデフォルトの動作ですが、sgi O2 や sparc の一部の機種では
|
||||
|
||||
class: TrueColor
|
||||
depth: 24 planes
|
||||
red, green, blue masks: 0xff0000, 0xff00, 0xff
|
||||
|
||||
となっている場合があります。この場合、configure に --disable-bgr をつけて
|
||||
コンパイルしてください。
|
||||
|
||||
@@ -103,16 +103,19 @@ target_compile_options(modules PRIVATE -Wno-pointer-sign)
|
||||
|
||||
if (EMSCRIPTEN)
|
||||
set(LIBS
|
||||
"SHELL:-s USE_ZLIB=1"
|
||||
"SHELL:-s USE_LIBJPEG=1"
|
||||
"SHELL:-s USE_SDL=2")
|
||||
target_compile_options(modules PRIVATE ${LIBS})
|
||||
target_link_options(modules PRIVATE ${LIBS})
|
||||
endif()
|
||||
|
||||
if (SDL2MIXER_FOUND)
|
||||
if (ANDROID)
|
||||
elseif (ANDROID)
|
||||
target_link_libraries(modules PRIVATE ${ndk_zlib})
|
||||
if (SDL2MIXER_FOUND)
|
||||
target_link_libraries(modules PRIVATE SDL2 SDL2_mixer)
|
||||
else()
|
||||
endif()
|
||||
else()
|
||||
target_link_libraries(modules PRIVATE ZLIB::ZLIB)
|
||||
if (SDL2MIXER_FOUND)
|
||||
target_link_libraries(modules PRIVATE PkgConfig::SDL2MIXER)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "ags.h"
|
||||
#include "cg.h"
|
||||
#include "image.h"
|
||||
#include "counter.h"
|
||||
#include "input.h"
|
||||
// #include "alpha_plane.h"
|
||||
#include "surface.h"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "system.h"
|
||||
#include "surface.h"
|
||||
// #include "gleffectcopy.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ags.h"
|
||||
#include "input.h"
|
||||
#include "graph.h"
|
||||
@@ -53,10 +53,6 @@ static void ec11_prepare(void);
|
||||
static void ec12_cb(int step);
|
||||
static void ec13_cb(int step);
|
||||
|
||||
static int get_ecounter(void) {
|
||||
return get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void gle_set_check_clik() {
|
||||
}
|
||||
@@ -255,13 +251,13 @@ static void ec5_cb(int step) {
|
||||
|
||||
#define EC_WAIT \
|
||||
if ((key |= sys_getInputInfo()) && ecp.cancel) break; \
|
||||
key = sys_keywait(cnt - get_ecounter(), ecp.cancel);
|
||||
key = sys_keywait(cnt - sdl_getTicks(), ecp.cancel);
|
||||
|
||||
static void ec7_cb() {
|
||||
int i, j, y, key = 0, cnt;
|
||||
int waitcnt = ecp.time == 0 ? 40 : (ecp.time/60);
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA7_D + ecp.h / ECA7_D -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i + 1, ECA7_D); j++) {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "menu.h"
|
||||
#include "input.h"
|
||||
#include "nact.h"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "utfsjis.h"
|
||||
#include "ags.h"
|
||||
#include "nact.h"
|
||||
@@ -241,7 +241,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
|
||||
char mbuf[20];
|
||||
int cw, delta, wcnt;
|
||||
|
||||
wcnt = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
wcnt = sdl_getTicks();
|
||||
|
||||
mbuf[0] = '\0';
|
||||
msg = get_char(msg, mbuf, sizeof(mbuf) -1);
|
||||
@@ -272,7 +272,7 @@ static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB
|
||||
needupdate = FALSE;
|
||||
|
||||
// keywait
|
||||
delta = get_high_counter(SYSTEMCOUNTER_MSEC) - wcnt;
|
||||
delta = sdl_getTicks() - wcnt;
|
||||
if (delta < wSpeed) {
|
||||
if (sys_keywait(wSpeed - delta, KEYWAIT_NONCANCELABLE)) {
|
||||
|
||||
@@ -313,14 +313,14 @@ static int ntmsg_keywait() {
|
||||
night.waitkey = -1;
|
||||
|
||||
while (night.waitkey == -1 && !nact->is_quit) {
|
||||
int st = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int st = sdl_getTicks();
|
||||
int interval = 25;
|
||||
|
||||
if (!night.zhiding) {
|
||||
interval = night.sp[SPNO_MSG_KEYANIM]->u.anime.interval;
|
||||
hakanim(i++);
|
||||
}
|
||||
sys_keywait(interval - (get_high_counter(SYSTEMCOUNTER_MSEC) - st), KEYWAIT_NONCANCELABLE);
|
||||
sys_keywait(interval - (sdl_getTicks() - st), KEYWAIT_NONCANCELABLE);
|
||||
}
|
||||
|
||||
night.waittype = KEYWAIT_NONE;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "input.h"
|
||||
#include "sdl_core.h"
|
||||
#include "xsystem35.h"
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "sprite.h"
|
||||
#include "surface.h"
|
||||
#include "sactcg.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
|
||||
@@ -378,7 +377,7 @@ int nt_sp_eupdate(int type, int time, int cancel) {
|
||||
|
||||
sf_copyall(sf0, sfsrc); // 全部の効果タイプにこの処理は要らないんだけど
|
||||
|
||||
ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
ecp.sttime = ecp.curtime = sdl_getTicks();
|
||||
ecp.edtime = ecp.curtime + time;
|
||||
ecp.oldstep = 0;
|
||||
|
||||
@@ -423,11 +422,11 @@ int nt_sp_eupdate(int type, int time, int cancel) {
|
||||
break;
|
||||
}
|
||||
|
||||
while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) {
|
||||
while ((ecp.curtime = sdl_getTicks()) < ecp.edtime) {
|
||||
int rest;
|
||||
|
||||
cb(sfsrc, sfdst);
|
||||
rest = 15 - (get_high_counter(SYSTEMCOUNTER_MSEC) - ecp.curtime);
|
||||
rest = 15 - (sdl_getTicks() - ecp.curtime);
|
||||
key = sys_keywait(rest, cancel ? KEYWAIT_CANCELABLE : KEYWAIT_NONCANCELABLE);
|
||||
|
||||
if (cancel && key) break;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "list.h"
|
||||
#include "counter.h"
|
||||
#include "ags.h"
|
||||
#include "graphics.h"
|
||||
// #include "sact.h"
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
#include "system.h"
|
||||
#include "surface.h"
|
||||
#include "music.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ngraph.h"
|
||||
#include "input.h"
|
||||
|
||||
@@ -81,18 +81,18 @@ void ndd_run(int demonum) {
|
||||
while (sys_getInputInfo());
|
||||
|
||||
mus_bgm_play(ndemo_mus[demonum], 0, 100);
|
||||
start = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
start = sdl_getTicks();
|
||||
ct = 0;
|
||||
for (i = 0; i <= ndemo_nums[demonum];) {
|
||||
int offset;
|
||||
int cur1, cur = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int cur1, cur = sdl_getTicks();
|
||||
|
||||
offset = alk->offset[i];
|
||||
|
||||
jpeg2surface(fp, offset); ct++;
|
||||
ags_updateFull();
|
||||
|
||||
cur1 = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
cur1 = sdl_getTicks();
|
||||
if (cur1 - cur < 33) {
|
||||
if (sys_keywait(33 - (cur1 - cur), KEYWAIT_CANCELABLE)) break;
|
||||
} else {
|
||||
|
||||
@@ -59,15 +59,17 @@ static void Get() {
|
||||
*var = (int)(genrand() * num) + 1;
|
||||
}
|
||||
|
||||
DEBUG_COMMAND_YET("RandMT.Get %d,%p:\n", num, var);
|
||||
DEBUG_COMMAND("RandMT.Get %d,%p:\n", num, var);
|
||||
}
|
||||
|
||||
static void GetNoOverlap() { /* not used ? */
|
||||
int p1 = getCaliValue();
|
||||
int p2 = getCaliValue();
|
||||
int *var1 = getCaliVariable();
|
||||
|
||||
DEBUG_COMMAND_YET("RandMT.GetNoOverlap %p:\n", p1);
|
||||
static void GetNoOverlap() {
|
||||
int min = getCaliValue();
|
||||
int n = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
|
||||
*var = (int)(genrand() * n) + min;
|
||||
|
||||
DEBUG_COMMAND("RandMT.GetNoOverlap %d,%d,%p:\n", min, n, var);
|
||||
}
|
||||
|
||||
static const ModuleFunc functions[] = {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "surface.h"
|
||||
#include "ngraph.h"
|
||||
#include "sprite.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
static surface_t *smask_get(int no);
|
||||
static surface_t *smask_mul(surface_t *sf, int val);
|
||||
@@ -127,11 +127,11 @@ int sp_eupdate_amap(int index, int time, int cancel) {
|
||||
sfdst = sf_dup(sf0);
|
||||
sf_copyall(sf0, sfsrc);
|
||||
|
||||
ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
ecp.sttime = ecp.curtime = sdl_getTicks();
|
||||
ecp.edtime = ecp.curtime + time*10;
|
||||
ecp.oldstep = 0;
|
||||
|
||||
while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) {
|
||||
while ((ecp.curtime = sdl_getTicks()) < ecp.edtime) {
|
||||
int curstep = 255 * (ecp.curtime - ecp.sttime)/ (ecp.edtime - ecp.sttime);
|
||||
// 元になるマスクのalpha値を16倍して欲しいところだけ取り出す
|
||||
mask2 = smask_mul(mask, curstep);
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "list.h"
|
||||
#include "counter.h"
|
||||
#include "menu.h"
|
||||
#include "input.h"
|
||||
#include "nact.h"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "surface.h"
|
||||
#include "ngraph.h"
|
||||
#include "sprite.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "randMT.h"
|
||||
|
||||
typedef void entrypoint (double step, int p1, int p2, int *retx, int *rety);
|
||||
@@ -78,9 +78,9 @@ int sp_quake_screen(int type, int p1, int p2, int time, int cancel) {
|
||||
|
||||
if (type > 1) return OK;
|
||||
|
||||
sttime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
sttime = sdl_getTicks();
|
||||
edtime = time * 10 + sttime;
|
||||
while ((curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < edtime) {
|
||||
while ((curtime = sdl_getTicks()) < edtime) {
|
||||
int adjx, adjy;
|
||||
|
||||
cb[type]((double)(curtime - sttime)/(edtime - sttime), p1, p2, &adjx, &adjy);
|
||||
|
||||
@@ -363,10 +363,8 @@ int sp_set_move(int wNum, int wX, int wY) {
|
||||
sp->move.to.x = wX - sact.origin.x;
|
||||
sp->move.to.y = wY - sact.origin.y;
|
||||
|
||||
if (sp->move.time == 0) {
|
||||
sp->move.time = -1;
|
||||
if (!sp->move.time && !sp->move.speed)
|
||||
sp->move.speed = 100;
|
||||
}
|
||||
|
||||
sp->cur = sp->loc;
|
||||
|
||||
@@ -382,17 +380,18 @@ int sp_set_movetime(int wNum, int wTime) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
sact.sp[wNum]->move.time = wTime * 10;
|
||||
sact.sp[wNum]->move.speed = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// スプライト移動速度の設定
|
||||
int sp_set_movespeed(int wNum, int wTime) {
|
||||
int sp_set_movespeed(int wNum, int wSpeed) {
|
||||
sp_assert_no(wNum);
|
||||
|
||||
if (wTime == 0) wTime = 1;
|
||||
if (wSpeed == 0) wSpeed = 1;
|
||||
|
||||
sact.sp[wNum]->move.speed = wTime ;
|
||||
sact.sp[wNum]->move.time = -1;
|
||||
sact.sp[wNum]->move.speed = wSpeed;
|
||||
sact.sp[wNum]->move.time = 0;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "ags.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "sact.h"
|
||||
#include "sprite.h"
|
||||
|
||||
@@ -44,7 +44,7 @@ static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) {
|
||||
if (e->type != AGSEVENT_TIMER) return 0;
|
||||
|
||||
// 現在時刻の取得
|
||||
now = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
now = sdl_getTicks();
|
||||
|
||||
// 指定時間までスキップ
|
||||
if ((now - sp->u.anime.starttime) < sp->u.anime.interval) return 0;
|
||||
@@ -85,7 +85,7 @@ int sp_anime_setup(sprite_t *sp) {
|
||||
int n = 0;
|
||||
|
||||
sp->u.anime.interval = 500; // デフォルトの間隔 0.5秒
|
||||
sp->u.anime.starttime = get_high_counter(SYSTEMCOUNTER_MSEC); // 開始時刻
|
||||
sp->u.anime.starttime = sdl_getTicks(); // 開始時刻
|
||||
sp->u.anime.tick = 0; // カウンタ初期化
|
||||
|
||||
// アニメパターンはいくつあるか
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "sprite.h"
|
||||
#include "surface.h"
|
||||
#include "sactcg.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
|
||||
@@ -422,15 +421,15 @@ int sp_eupdate(int type, int time, int cancel) {
|
||||
ec19_prepare(sfsrc, sfdst);
|
||||
}
|
||||
|
||||
ecp.sttime = ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
ecp.sttime = ecp.curtime = sdl_getTicks();
|
||||
ecp.edtime = ecp.curtime + time*10;
|
||||
ecp.oldstep = 0;
|
||||
|
||||
while ((ecp.curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < ecp.edtime) {
|
||||
while ((ecp.curtime = sdl_getTicks()) < ecp.edtime) {
|
||||
int rest;
|
||||
|
||||
(*cb[type-1])(sfsrc, sfdst);
|
||||
rest = 15 - (get_high_counter(SYSTEMCOUNTER_MSEC) - ecp.curtime);
|
||||
rest = 15 - (sdl_getTicks() - ecp.curtime);
|
||||
key = sys_keywait(rest, cancel ? KEYWAIT_CANCELABLE : KEYWAIT_NONCANCELABLE);
|
||||
|
||||
if (cancel && key) break;
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "menu.h"
|
||||
#include "input.h"
|
||||
#include "nact.h"
|
||||
@@ -80,7 +80,6 @@ static void cb_defocused_swsp(void* s, void* data);
|
||||
static int cb_focused(sprite_t *sp);
|
||||
static int cb_defocused(sprite_t *sp);
|
||||
static void cb_waitkey_simple(agsevent_t *e);
|
||||
static void cb_waitkey_sprite(agsevent_t *e);
|
||||
static void cb_waitkey_selection(agsevent_t *e);
|
||||
|
||||
/*
|
||||
@@ -212,7 +211,7 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
switch (e->type) {
|
||||
case AGSEVENT_KEY_PRESS:
|
||||
if (e->d3 == KEY_Z) {
|
||||
cur = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
cur = sdl_getTicks();
|
||||
if (!sact.zhiding) {
|
||||
slist_foreach(sact.sp_zhide, cb_defocused_zkey, &update);
|
||||
sact.zhiding = TRUE;
|
||||
@@ -243,7 +242,7 @@ static void cb_waitkey_simple(agsevent_t *e) {
|
||||
case AGSEVENT_KEY_RELEASE:
|
||||
switch(e->d3) {
|
||||
case KEY_Z:
|
||||
cur = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
cur = sdl_getTicks();
|
||||
if (500 < (cur - sact.zofftime) || !sact.zdooff) {
|
||||
slist_foreach(sact.sp_zhide, cb_focused_zkey, &update);
|
||||
sact.zhiding = FALSE;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "list.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ags.h"
|
||||
#include "nact.h"
|
||||
#include "input.h"
|
||||
@@ -69,7 +69,7 @@ static void hidesprite(sprite_t *sp) {
|
||||
スプライトがドロップされた時の各種処理を含む
|
||||
*/
|
||||
static boolean waitcond(int endtime) {
|
||||
int curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int curtime = sdl_getTicks();
|
||||
if (curtime >= endtime) return TRUE;
|
||||
|
||||
if (sact.dropped) {
|
||||
@@ -146,7 +146,7 @@ int sp_keywait(int *vOK, int *vRND, int *vD01, int *vD02, int *vD03, int timeout
|
||||
}
|
||||
|
||||
// 終了時間の計算
|
||||
curtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
curtime = sdl_getTicks();
|
||||
endtime = timeout < 0 ? INT_MAX : (curtime + timeout * 10);
|
||||
|
||||
// スプライトキー待ちメイン
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "nact.h"
|
||||
#include "sact.h"
|
||||
#include "sprite.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
/*
|
||||
@@ -64,7 +63,8 @@ static void move_drain(sprite_t *sp) {
|
||||
sact.teventremovelist = slist_append(sact.teventremovelist, sp);
|
||||
|
||||
sp->move.moving = FALSE;
|
||||
sp->move.time = 0; // 移動時間の初期化
|
||||
if (sp->move.speed > 0)
|
||||
sp->move.time = 0;
|
||||
}
|
||||
|
||||
// SP_MOVE の timer event callback
|
||||
@@ -114,15 +114,18 @@ static int move_cb(sprite_t *sp, agsevent_t *e) {
|
||||
void spev_move_setup(void* data, void* userdata) {
|
||||
sprite_t *sp = (sprite_t *)data;
|
||||
|
||||
// 非表示のものは移動しない(いいのかな)
|
||||
if (!sp->show) return;
|
||||
// Hidden sprite just moves to its final location.
|
||||
if (!sp->show) {
|
||||
sp->cur = sp->loc = sp->move.to;
|
||||
return;
|
||||
}
|
||||
|
||||
// move 開始時刻の記録
|
||||
sp->move.starttime = sact.movestarttime;
|
||||
sp->move.moving = TRUE;
|
||||
|
||||
// MOVE_SPEED で設定した場合は、移動量を考慮して移動時間を決定
|
||||
if (sp->move.time == -1) {
|
||||
if (sp->move.speed > 0) {
|
||||
// speed から timeへ
|
||||
int dx = sp->move.to.x - sp->loc.x;
|
||||
int dy = sp->move.to.y - sp->loc.y;
|
||||
@@ -155,10 +158,10 @@ void spev_move_waitend(sprite_t *sp, int dx, int dy, int time) {
|
||||
sp->move.to.x = dx;
|
||||
sp->move.to.y = dy;
|
||||
sp->move.speed = time;
|
||||
sp->move.time = -1;
|
||||
sp->move.time = 0;
|
||||
|
||||
sact.movelist = slist_append(sact.movelist, sp);
|
||||
sact.movestarttime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
sact.movestarttime = sdl_getTicks();
|
||||
slist_foreach(sact.movelist, spev_move_setup, NULL);
|
||||
slist_free(sact.movelist);
|
||||
sact.movelist = NULL;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ags.h"
|
||||
#include "nact.h"
|
||||
#include "input.h"
|
||||
@@ -269,7 +269,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
|
||||
char mbuf[20], rbuf[20];
|
||||
int cw, delta, wcnt;
|
||||
|
||||
wcnt = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
wcnt = sdl_getTicks();
|
||||
|
||||
mbuf[0] = rbuf[0] = '\0';
|
||||
msg = get_char(msg, mbuf, rbuf, sizeof(mbuf) -1);
|
||||
@@ -317,7 +317,7 @@ void smsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wF
|
||||
needupdate = FALSE;
|
||||
|
||||
// keywait
|
||||
delta = get_high_counter(SYSTEMCOUNTER_MSEC) - wcnt;
|
||||
delta = sdl_getTicks() - wcnt;
|
||||
if (delta < wSpeed) {
|
||||
if (sys_keywait(wSpeed - delta, KEYWAIT_NONCANCELABLE)) {
|
||||
|
||||
@@ -404,7 +404,7 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
sact.waitkey = -1;
|
||||
|
||||
while (sact.waitkey == -1 && !nact->is_quit) {
|
||||
int st = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int st = sdl_getTicks();
|
||||
int interval = 25;
|
||||
|
||||
// アニメパターンがある場合、その更新
|
||||
@@ -418,7 +418,7 @@ int smsg_keywait(int wNum1, int wNum2, int msglen) {
|
||||
update_mark(minfo[j].sp, minfo[j].cg);
|
||||
i++;
|
||||
}
|
||||
sys_keywait(interval - (get_high_counter(SYSTEMCOUNTER_MSEC) - st), KEYWAIT_NONCANCELABLE);
|
||||
sys_keywait(interval - (sdl_getTicks() - st), KEYWAIT_NONCANCELABLE);
|
||||
}
|
||||
|
||||
sact.waittype = KEYWAIT_NONE;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "surface.h"
|
||||
#include "ngraph.h"
|
||||
#include "sprite.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "randMT.h"
|
||||
|
||||
/*
|
||||
@@ -51,9 +51,9 @@ int sp_quake_sprite(int wType, int wAmplitudeX, int wAmplitudeY, int wCount, int
|
||||
int i = 0, key;
|
||||
SList *node;
|
||||
|
||||
edtime = wCount * 10 + get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
edtime = wCount * 10 + sdl_getTicks();
|
||||
|
||||
while ((curtime = get_high_counter(SYSTEMCOUNTER_MSEC)) < edtime) {
|
||||
while ((curtime = sdl_getTicks()) < edtime) {
|
||||
if (wType == 0) { // 全てのスプライトを同じように動かす
|
||||
int adjx = (int)(genrand() * wAmplitudeX/2);
|
||||
int adjy = (int)(genrand() * wAmplitudeY/2);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "nact.h"
|
||||
#include "sact.h"
|
||||
#include "sprite.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
/*
|
||||
|
||||
@@ -63,7 +63,7 @@ static void tevent_callback(agsevent_t *e) {
|
||||
int update = 0;
|
||||
|
||||
// SP_MOVE の同期移動のためのカウンタの読み込み
|
||||
sact.movecurtime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
sact.movecurtime = sdl_getTicks();
|
||||
|
||||
for (node = sact.teventlisteners; node; node = node->next) {
|
||||
sprite_t *sp = (sprite_t *)node->data;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "sdl_core.h"
|
||||
#include "ags.h"
|
||||
#include "graphics.h"
|
||||
#include "sact.h"
|
||||
@@ -95,7 +95,7 @@ int sp_update_all(boolean syncscreen) {
|
||||
// スプライト移動がある場合は移動開始
|
||||
if (sact.movelist) {
|
||||
// 移動開始時間を合わせる
|
||||
sact.movestarttime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
sact.movestarttime = sdl_getTicks();
|
||||
slist_foreach(sact.movelist, spev_move_setup, NULL);
|
||||
slist_free(sact.movelist);
|
||||
sact.movelist = NULL;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "modules.h"
|
||||
#include "nact.h"
|
||||
#include "ags.h"
|
||||
#include "counter.h"
|
||||
#include "music.h"
|
||||
#include "sdl_core.h"
|
||||
|
||||
@@ -466,7 +465,7 @@ static void PlayAnimeData() {
|
||||
dib = ags_getDIB();
|
||||
|
||||
for (loop = 0; loop < p1; loop++) {
|
||||
int cnt = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int cnt = sdl_getTicks();
|
||||
is_backcopied = FALSE;
|
||||
|
||||
for (i = 0; i < SLOT; i++) {
|
||||
@@ -543,7 +542,7 @@ static void PlayAnimeData() {
|
||||
if (is_backcopied && !SDL_RectEmpty(&maprect))
|
||||
ags_updateArea(maprect.x, maprect.y, maprect.w, maprect.h);
|
||||
|
||||
int now = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int now = sdl_getTicks();
|
||||
if (now - cnt < interval) {
|
||||
sdl_sleep(interval - (now-cnt));
|
||||
}
|
||||
|
||||
+243
-46
@@ -1,12 +1,31 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <zlib.h>
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "xsystem35.h"
|
||||
#include "filecheck.h"
|
||||
#include "modules.h"
|
||||
#include "nact.h"
|
||||
#include "ngraph.h"
|
||||
|
||||
#define NUM_MAPS 16
|
||||
#define NUM_LAYERS 3
|
||||
#define MAPDATASIZE (128 * 128 * sizeof(WORD) * NUM_LAYERS)
|
||||
|
||||
typedef struct {
|
||||
DWORD size;
|
||||
DWORD map;
|
||||
} RecordHeader;
|
||||
|
||||
static void *mapdata[NUM_MAPS];
|
||||
static int setChipParam_index;
|
||||
static MyRectangle chip_params[NUM_LAYERS];
|
||||
static int window_width;
|
||||
static int window_height;
|
||||
static int map_width;
|
||||
|
||||
static void MakeMapSetParam() {
|
||||
int p1 = getCaliValue();
|
||||
@@ -14,7 +33,16 @@ static void MakeMapSetParam() {
|
||||
int p3 = getCaliValue();
|
||||
int p4 = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.MakeMapSetParam %d,%d,%d,%d:\n", p1,p2,p3,p4);
|
||||
if (p1 != NUM_LAYERS) {
|
||||
WARNING("Unexpected number of layers: %d\n", p1);
|
||||
return;
|
||||
}
|
||||
setChipParam_index = 0;
|
||||
window_width = p2;
|
||||
window_height = p3;
|
||||
map_width = p4;
|
||||
|
||||
DEBUG_COMMAND("oujimisc.MakeMapSetParam %d,%d,%d,%d:\n", p1,p2,p3,p4);
|
||||
}
|
||||
|
||||
static void MakeMapSetChipParam() {
|
||||
@@ -24,21 +52,49 @@ static void MakeMapSetChipParam() {
|
||||
int p4 = getCaliValue();
|
||||
int p5 = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5);
|
||||
|
||||
if (setChipParam_index >= NUM_LAYERS) {
|
||||
WARNING("unexpected MakeMapSeChipParam call\n");
|
||||
return;
|
||||
}
|
||||
MyRectangle *r = &chip_params[setChipParam_index++];
|
||||
r->x = p1;
|
||||
r->y = p2;
|
||||
r->w = p3;
|
||||
r->h = p4;
|
||||
|
||||
DEBUG_COMMAND("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5);
|
||||
}
|
||||
|
||||
static void MakeMapDraw() {
|
||||
int p1 = getCaliValue(); /* ISys3xDIB */
|
||||
int p2 = getCaliValue();
|
||||
int p3 = getCaliValue();
|
||||
int p4 = getCaliValue();
|
||||
int p5 = getCaliValue();
|
||||
int *p6 = getCaliVariable();
|
||||
int *p7 = getCaliVariable();
|
||||
int *p8 = getCaliVariable();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:\n", p1,p2,p3,p4,p5,p6,p7,p8);
|
||||
int dstX = getCaliValue();
|
||||
int dstY = getCaliValue();
|
||||
int posX = getCaliValue();
|
||||
int posY = getCaliValue();
|
||||
int *a1 = getCaliVariable();
|
||||
int *a2 = getCaliVariable();
|
||||
int *a3 = getCaliVariable();
|
||||
|
||||
for (int y = 0; y < window_height; y++) {
|
||||
for (int x = 0; x < window_width; x++) {
|
||||
int index = (y + posY) * map_width + (x + posX);
|
||||
int c1 = a1[index];
|
||||
int c2 = a2[index];
|
||||
int c3 = a3[index];
|
||||
MyRectangle *r1 = &chip_params[0];
|
||||
MyRectangle *r2 = &chip_params[1];
|
||||
MyRectangle *r3 = &chip_params[2];
|
||||
surface_t *dib = ags_getDIB();
|
||||
if (c3) {
|
||||
ags_copyArea(r3->x + c3 * r3->w, r3->y, r3->w, r3->h, dstX + x * r3->w, dstY + y * r3->h);
|
||||
} else {
|
||||
ags_copyArea(r1->x + c1 * r1->w, r1->y, r1->w, r1->h, dstX + x * r1->w, dstY + y * r1->h);
|
||||
gr_blend_alpha_map(dib, dstX + x * r2->w, dstY + y * r2->h, dib, r2->x + c2 * r2->w, r2->y, r2->w, r2->h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_COMMAND("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:\n", p1,dstX,dstY,posX,posY,a1,a2,a3);
|
||||
}
|
||||
|
||||
static void MakeMapInit() {
|
||||
@@ -49,19 +105,43 @@ static void MakeMapInit() {
|
||||
|
||||
static void DrawNumber() {
|
||||
int p1 = getCaliValue(); /* ISys3xDIB */
|
||||
int p2 = getCaliValue();
|
||||
int p3 = getCaliValue();
|
||||
int p4 = getCaliValue();
|
||||
int p5 = getCaliValue();
|
||||
int p6 = getCaliValue();
|
||||
int p7 = getCaliValue();
|
||||
int p8 = getCaliValue();
|
||||
int srcX = getCaliValue();
|
||||
int srcY = getCaliValue();
|
||||
int width = getCaliValue();
|
||||
int height = getCaliValue();
|
||||
int dstX = getCaliValue();
|
||||
int dstY = getCaliValue();
|
||||
int num = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5,p6,p7,p8);
|
||||
char buf[6];
|
||||
sprintf(buf, "%5d", num);
|
||||
|
||||
surface_t *dib = ags_getDIB();
|
||||
for (char *c = buf; *c; c++) {
|
||||
if (*c != ' ') {
|
||||
int sx = srcX + (*c - '0') * width;
|
||||
gr_blend_alpha_map(dib, dstX, dstY, dib, sx, srcY, width, height);
|
||||
}
|
||||
dstX += width;
|
||||
}
|
||||
|
||||
DEBUG_COMMAND("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:\n", p1,srcX,srcY,width,height,dstX,dstY,num);
|
||||
}
|
||||
|
||||
static void TempMapCreateShadow() {
|
||||
DEBUG_COMMAND_YET("oujimisc.TempMapCreateShadow:\n");
|
||||
for (int i = 0; i < NUM_MAPS; i++) {
|
||||
dridata *dfile = ald_getdata(DRIFILE_DATA, i);
|
||||
if (!dfile)
|
||||
continue;
|
||||
if (dfile->size != MAPDATASIZE)
|
||||
WARNING("unexpected map data size %d", dfile->size);
|
||||
free(mapdata[i]);
|
||||
mapdata[i] = malloc(dfile->size);
|
||||
memcpy(mapdata[i], dfile->data, dfile->size);
|
||||
ald_freedata(dfile);
|
||||
}
|
||||
|
||||
DEBUG_COMMAND("oujimisc.TempMapCreateShadow:\n");
|
||||
}
|
||||
|
||||
static void TempMapInit() {
|
||||
@@ -72,48 +152,165 @@ static void TempMapInit() {
|
||||
}
|
||||
|
||||
static void TempMapLoadToShadow() {
|
||||
int p1 = getCaliValue();
|
||||
int *p2 = getCaliVariable();
|
||||
int *p3 = getCaliVariable();
|
||||
int *p4 = getCaliVariable();
|
||||
int p5 = getCaliValue();
|
||||
int map = getCaliValue();
|
||||
int *a1 = getCaliVariable();
|
||||
int a1page = preVarPage;
|
||||
int *a2 = getCaliVariable();
|
||||
int a2page = preVarPage;
|
||||
int *a3 = getCaliVariable();
|
||||
int a3page = preVarPage;
|
||||
int size = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:\n", p1,p2,p3,p4,p5);
|
||||
if (!mapdata[map]) {
|
||||
WARNING("No map %d\n", map);
|
||||
return;
|
||||
}
|
||||
if (a1page == 0 || a2page == 0 || a3page == 0) {
|
||||
WARNING("non-array destination variable\n");
|
||||
return;
|
||||
}
|
||||
WORD *p = mapdata[map];
|
||||
for (int i = 0; i < size; i++)
|
||||
*a1++ = SDL_SwapLE16(*p++);
|
||||
for (int i = 0; i < size; i++)
|
||||
*a2++ = SDL_SwapLE16(*p++);
|
||||
for (int i = 0; i < size; i++)
|
||||
*a3++ = SDL_SwapLE16(*p++);
|
||||
|
||||
DEBUG_COMMAND("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:\n", map,a1,a2,a3,size);
|
||||
}
|
||||
|
||||
static void TempMapSaveToShadow() {
|
||||
int p1 = getCaliValue();
|
||||
int *p2 = getCaliVariable();
|
||||
int *p3 = getCaliVariable();
|
||||
int *p4 = getCaliVariable();
|
||||
int p5 = getCaliValue();
|
||||
int map = getCaliValue();
|
||||
int *a1 = getCaliVariable();
|
||||
int a1page = preVarPage;
|
||||
int *a2 = getCaliVariable();
|
||||
int a2page = preVarPage;
|
||||
int *a3 = getCaliVariable();
|
||||
int a3page = preVarPage;
|
||||
int size = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:\n", p1,p2,p3,p4,p5);
|
||||
if (!mapdata[map]) {
|
||||
WARNING("No map %d\n", map);
|
||||
return;
|
||||
}
|
||||
if (a1page == 0 || a2page == 0 || a3page == 0) {
|
||||
WARNING("non-array source variable\n");
|
||||
return;
|
||||
}
|
||||
WORD *p = mapdata[map];
|
||||
for (int i = 0; i < size; i++)
|
||||
*p++ = SDL_SwapLE16(*a1++);
|
||||
for (int i = 0; i < size; i++)
|
||||
*p++ = SDL_SwapLE16(*a2++);
|
||||
for (int i = 0; i < size; i++)
|
||||
*p++ = SDL_SwapLE16(*a3++);
|
||||
|
||||
DEBUG_COMMAND("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:\n", map,a1,a2,a3,size);
|
||||
}
|
||||
|
||||
static void TempMapFileSave() {
|
||||
int p1 = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.TempMapFileSave %d:\n", p1);
|
||||
|
||||
char fname[32];
|
||||
sprintf(fname, "王子_M%d.asd", p1);
|
||||
FILE *fp = fc_open(fname, 'w');
|
||||
if (!fp) {
|
||||
WARNING("Cannot open %s\n", fname);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_MAPS; i++) {
|
||||
if (!mapdata[i])
|
||||
continue;
|
||||
unsigned long size = compressBound(MAPDATASIZE);
|
||||
void *compressed = malloc(size);
|
||||
int r = compress2(compressed, &size, mapdata[i], MAPDATASIZE, Z_BEST_COMPRESSION);
|
||||
if (r != Z_OK) {
|
||||
WARNING("compress2() failed: %d\n", r);
|
||||
free(compressed);
|
||||
continue;
|
||||
}
|
||||
RecordHeader hdr = { size, i };
|
||||
fwrite(&hdr, sizeof(hdr), 1, fp);
|
||||
fwrite(compressed, size, 1, fp);
|
||||
free(compressed);
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
DEBUG_COMMAND("oujimisc.TempMapFileSave %d:\n", p1);
|
||||
}
|
||||
|
||||
static void TempMapFileLoad() {
|
||||
int p1 = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.TempMapFileLoad %d:\n", p1);
|
||||
|
||||
char fname[32];
|
||||
sprintf(fname, "王子_M%d.asd", p1);
|
||||
FILE *fp = fc_open(fname, 'r');
|
||||
if (!fp) {
|
||||
WARNING("Cannot open %s\n", fname);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < NUM_MAPS; i++) {
|
||||
RecordHeader hdr;
|
||||
if (fread(&hdr, sizeof(hdr), 1, fp) != 1) {
|
||||
WARNING("fread error\n");
|
||||
break;
|
||||
}
|
||||
if (hdr.map != i) {
|
||||
WARNING("unexpected map no. %d != %d\n", hdr.map, i);
|
||||
break;
|
||||
}
|
||||
if (!mapdata[i]) {
|
||||
WARNING("map %d is not allocated\n", i);
|
||||
break;
|
||||
}
|
||||
void *compressed = malloc(hdr.size);
|
||||
if (fread(compressed, hdr.size, 1, fp) != 1) {
|
||||
WARNING("fread error\n");
|
||||
free(compressed);
|
||||
break;
|
||||
}
|
||||
unsigned long raw_size = MAPDATASIZE;
|
||||
int r = uncompress(mapdata[i], &raw_size, compressed, hdr.size);
|
||||
if (r != Z_OK)
|
||||
WARNING("uncompress() failed: %d\n", r);
|
||||
free(compressed);
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
DEBUG_COMMAND("oujimisc.TempMapFileLoad %d:\n", p1);
|
||||
}
|
||||
|
||||
static void CalcMoveDiffer() {
|
||||
int *p1 = getCaliVariable();
|
||||
int *p2 = getCaliVariable();
|
||||
int p3 = getCaliValue();
|
||||
int p4 = getCaliValue();
|
||||
int p5 = getCaliValue();
|
||||
int p6 = getCaliValue();
|
||||
int *p7 = getCaliVariable();
|
||||
int p8 = getCaliValue();
|
||||
int *dx = getCaliVariable();
|
||||
int *dy = getCaliVariable();
|
||||
int moveL = getCaliValue();
|
||||
int moveU = getCaliValue();
|
||||
int moveR = getCaliValue();
|
||||
int moveD = getCaliValue();
|
||||
int *pt = getCaliVariable();
|
||||
int duration = getCaliValue();
|
||||
|
||||
DEBUG_COMMAND_YET("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:\n", p1,p2,p3,p4,p5,p6,p7,p8);
|
||||
int t = min(*pt, duration);
|
||||
if (moveL) {
|
||||
*dx = moveL - moveL * t / duration;
|
||||
*dy = 0;
|
||||
} else if (moveU) {
|
||||
*dx = 0;
|
||||
*dy = moveU - moveU * t / duration;
|
||||
} else if (moveR) {
|
||||
*dx = moveR * t / duration;
|
||||
*dy = 0;
|
||||
} else if (moveD) {
|
||||
*dx = 0;
|
||||
*dy = moveD * t / duration;
|
||||
}
|
||||
|
||||
*pt = t >= duration ? 1 : 0;
|
||||
|
||||
DEBUG_COMMAND("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:\n", dx,dy,moveL,moveU,moveR,moveD,pt,duration);
|
||||
}
|
||||
|
||||
static const ModuleFunc functions[] = {
|
||||
|
||||
+7
-1
@@ -1,6 +1,7 @@
|
||||
add_library(src_lib STATIC
|
||||
gameresource.c
|
||||
hankaku.c
|
||||
msgqueue.c
|
||||
utfsjis.c
|
||||
)
|
||||
target_compile_options(src_lib PRIVATE -Wno-pointer-sign -Wall)
|
||||
@@ -57,7 +58,7 @@ target_sources(xsystem35 PRIVATE
|
||||
|
||||
# Misc
|
||||
target_sources(xsystem35 PRIVATE
|
||||
LittleEndian.c counter.c input.c profile.c mt19937-1.c filecheck.c mmap.c)
|
||||
LittleEndian.c input.c profile.c mt19937-1.c filecheck.c mmap.c)
|
||||
|
||||
# Scenario
|
||||
target_sources(xsystem35 PRIVATE
|
||||
@@ -108,9 +109,11 @@ if (EMSCRIPTEN)
|
||||
|
||||
elseif (ANDROID)
|
||||
|
||||
target_link_libraries(src_lib PRIVATE SDL2)
|
||||
target_link_libraries(xsystem35 PRIVATE SDL2 SDL2_ttf SDL2_mixer ${ndk_zlib} ${ndk_log})
|
||||
|
||||
else() # non-emscripten, non-android
|
||||
target_link_libraries(src_lib PRIVATE PkgConfig::SDL2)
|
||||
target_link_libraries(xsystem35 PRIVATE m ZLIB::ZLIB)
|
||||
target_link_libraries(xsystem35 PRIVATE PkgConfig::SDL2)
|
||||
target_link_libraries(xsystem35 PRIVATE PkgConfig::SDL2TTF)
|
||||
@@ -127,6 +130,9 @@ else() # non-emscripten, non-android
|
||||
target_link_libraries(xsystem35 PRIVATE ${cJSON})
|
||||
endif()
|
||||
endif()
|
||||
if (ENABLE_MIDI_PORTMIDI)
|
||||
target_link_libraries(xsystem35 PRIVATE ${PORTMIDI})
|
||||
endif()
|
||||
|
||||
install(TARGETS xsystem35 RUNTIME DESTINATION bin)
|
||||
|
||||
|
||||
@@ -37,18 +37,12 @@
|
||||
#include "ags.h"
|
||||
#include "sdl_core.h"
|
||||
#include "alpha_plane.h"
|
||||
#include "counter.h"
|
||||
#include "utfsjis.h"
|
||||
#include "input.h"
|
||||
#include "font.h"
|
||||
#include "cursor.h"
|
||||
#include "image.h"
|
||||
|
||||
#define check_param ags_check_param
|
||||
#define check_param_xy ags_check_param_xy
|
||||
|
||||
static void initPal(Palette256 *sys_pal);
|
||||
|
||||
static Palette256 pal_256;
|
||||
static boolean need_update = TRUE;
|
||||
static boolean fade_outed = FALSE;
|
||||
@@ -143,8 +137,10 @@ void ags_setWorldSize(int width, int height, int depth) {
|
||||
nact->ags.dib = sdl_getDIB();
|
||||
|
||||
/* DIBが8以上の場合は、alpha plane を用意 */
|
||||
if (depth > 8)
|
||||
nact->ags.dib->alpha = calloc(width * height, sizeof(BYTE));
|
||||
if (depth > 8) {
|
||||
nact->ags.dib->alpha = malloc(width * height);
|
||||
memset(nact->ags.dib->alpha, 255, width * height);
|
||||
}
|
||||
|
||||
fade_outed = FALSE; /* thanx tajiri@wizard */
|
||||
|
||||
@@ -191,8 +187,8 @@ void ags_getWindowInfo(DispInfo *info) {
|
||||
sdl_getWindowInfo(info);
|
||||
}
|
||||
|
||||
void ags_setExposeSwitch(boolean bool) {
|
||||
need_update = bool;
|
||||
void ags_setExposeSwitch(boolean expose) {
|
||||
need_update = expose;
|
||||
}
|
||||
|
||||
void ags_updateArea(int x, int y, int w, int h) {
|
||||
@@ -246,41 +242,41 @@ void ags_setPaletteToSystem(int src, int cnt) {
|
||||
}
|
||||
|
||||
void ags_drawRectangle(int x, int y, int w, int h, int col) {
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
sdl_drawRectangle(x, y, w, h, col);
|
||||
}
|
||||
|
||||
void ags_fillRectangle(int x, int y, int w, int h, int col) {
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
sdl_fillRectangle(x, y, w, h, col);
|
||||
}
|
||||
|
||||
void ags_drawLine(int x0, int y0, int x1, int y1, int col) {
|
||||
if (!check_param_xy(&x0, &y0)) return;
|
||||
if (!check_param_xy(&x1, &y1)) return;
|
||||
if (!ags_check_param_xy(&x0, &y0)) return;
|
||||
if (!ags_check_param_xy(&x1, &y1)) return;
|
||||
|
||||
sdl_drawLine(x0, y0, x1, y1, col);
|
||||
}
|
||||
|
||||
void ags_copyArea(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyArea(sx, sy, w, h, dx, dy);
|
||||
}
|
||||
|
||||
void ags_scaledCopyArea(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int mirror_sw) {
|
||||
if (!check_param(&sx, &sy, &sw, &sh)) return;
|
||||
if (!check_param(&dx, &dy, &dw, &dh)) return;
|
||||
if (!ags_check_param(&sx, &sy, &sw, &sh)) return;
|
||||
if (!ags_check_param(&dx, &dy, &dw, &dh)) return;
|
||||
|
||||
sdl_scaledCopyArea(sx, sy, sw, sh, dx, dy, dw, dh, mirror_sw);
|
||||
}
|
||||
|
||||
void ags_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int col) {
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP(sx, sy, w, h, dx, dy, col);
|
||||
}
|
||||
@@ -288,13 +284,13 @@ void ags_copyAreaSP(int sx, int sy, int w, int h, int dx, int dy, int col) {
|
||||
void ags_wrapColor(int x, int y, int w, int h, int p1, int p2) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
sdl_wrapColor(x, y, w, h, p1, p2);
|
||||
}
|
||||
|
||||
void ags_getPixel(int x, int y, Palette *cell) {
|
||||
if (!check_param_xy(&x, &y)) return;
|
||||
if (!ags_check_param_xy(&x, &y)) return;
|
||||
|
||||
sdl_getPixel(x, y, cell);
|
||||
}
|
||||
@@ -302,7 +298,7 @@ void ags_getPixel(int x, int y, Palette *cell) {
|
||||
void ags_changeColorArea(int sx, int sy, int w, int h, int dst, int src, int cnt) {
|
||||
if (nact->sys_world_depth != 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
|
||||
{
|
||||
agsurface_t *dib = nact->ags.dib;
|
||||
@@ -322,7 +318,7 @@ void ags_changeColorArea(int sx, int sy, int w, int h, int dst, int src, int cnt
|
||||
}
|
||||
|
||||
void* ags_saveRegion(int x, int y, int w, int h) {
|
||||
if (!check_param(&x, &y, &w, &h)) return NULL;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return NULL;
|
||||
|
||||
return (void *)sdl_saveRegion(x, y, w, h);
|
||||
}
|
||||
@@ -330,7 +326,7 @@ void* ags_saveRegion(int x, int y, int w, int h) {
|
||||
void ags_restoreRegion(void *region, int x, int y) {
|
||||
if (region == NULL) return;
|
||||
|
||||
if (!check_param_xy(&x, &y)) return;
|
||||
if (!ags_check_param_xy(&x, &y)) return;
|
||||
|
||||
sdl_restoreRegion(region, x, y);
|
||||
}
|
||||
@@ -338,7 +334,7 @@ void ags_restoreRegion(void *region, int x, int y) {
|
||||
void ags_putRegion(void *region, int x, int y) {
|
||||
if (region == NULL) return;
|
||||
|
||||
if (!check_param_xy(&x, &y)) return;
|
||||
if (!ags_check_param_xy(&x, &y)) return;
|
||||
|
||||
sdl_putRegion(region, x, y);
|
||||
}
|
||||
@@ -346,8 +342,8 @@ void ags_putRegion(void *region, int x, int y) {
|
||||
void ags_copyRegion(void *region, int sx, int sy , int w, int h, int dx, int dy) {
|
||||
if (region == NULL) return;
|
||||
|
||||
if (!check_param_xy(&dx, &dy)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param_xy(&dx, &dy)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_CopyRegion(region, sx, sy, w, h, dx, dy);
|
||||
}
|
||||
@@ -359,7 +355,7 @@ void ags_delRegion(void *region) {
|
||||
}
|
||||
|
||||
MyRectangle ags_drawString(int x, int y, const char *src, int col) {
|
||||
if (!check_param_xy(&x, &y)) return (MyRectangle){};
|
||||
if (!ags_check_param_xy(&x, &y)) return (MyRectangle){};
|
||||
|
||||
char *utf8 = toUTF8(src);
|
||||
SDL_Rect r = sdl_drawString(x, y, utf8, col);
|
||||
@@ -397,7 +393,7 @@ void ags_drawCg8bit(cgdata *cg, int x, int y) {
|
||||
w = cg->width;
|
||||
h = cg->height;
|
||||
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
cg->data_offset = abs(sy - y) * cg->width + abs(sx - x);
|
||||
sdl_drawImage8_fromData(cg, x, y, w, h);
|
||||
@@ -411,7 +407,7 @@ void ags_drawCg16bit(cgdata *cg, int x, int y) {
|
||||
w = cg->width;
|
||||
h = cg->height;
|
||||
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
cg->data_offset = abs(sy - y) * cg->width + abs(sx - x);
|
||||
sdl_drawImage16_fromData(cg, x, y, w, h);
|
||||
@@ -420,8 +416,8 @@ void ags_drawCg16bit(cgdata *cg, int x, int y) {
|
||||
void ags_copyArea_shadow(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP16_shadow(sx, sy, w, h, dx, dy, 255);
|
||||
}
|
||||
@@ -429,8 +425,8 @@ void ags_copyArea_shadow(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
void ags_copyArea_transparent(int sx, int sy, int w, int h, int dx, int dy, int col) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP(sx, sy, w, h, dx, dy, col);
|
||||
}
|
||||
@@ -438,8 +434,8 @@ void ags_copyArea_transparent(int sx, int sy, int w, int h, int dx, int dy, int
|
||||
void ags_copyArea_alphaLevel(int sx, int sy, int w, int h, int dx, int dy, int lv) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP16_alphaLevel(sx, sy, w, h, dx, dy, lv);
|
||||
}
|
||||
@@ -447,8 +443,8 @@ void ags_copyArea_alphaLevel(int sx, int sy, int w, int h, int dx, int dy, int l
|
||||
void ags_copyArea_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int lv) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP16_alphaBlend(sx, sy, w, h, dx, dy, lv);
|
||||
}
|
||||
@@ -456,14 +452,14 @@ void ags_copyArea_alphaBlend(int sx, int sy, int w, int h, int dx, int dy, int l
|
||||
void ags_copyArea_whiteLevel(int sx, int sy, int w, int h, int dx, int dy, int lv) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP16_whiteLevel(sx, sy, w, h, dx, dy, lv);
|
||||
}
|
||||
|
||||
MyRectangle ags_floodFill(int x, int y, int col) {
|
||||
if (!check_param_xy(&x, &y))
|
||||
if (!ags_check_param_xy(&x, &y))
|
||||
return (MyRectangle){};
|
||||
|
||||
return sdl_floodFill(x, y, col);
|
||||
@@ -472,8 +468,8 @@ MyRectangle ags_floodFill(int x, int y, int col) {
|
||||
void ags_copyFromAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copy_from_alpha(sx, sy, w, h, dx, dy, flg);
|
||||
}
|
||||
@@ -481,8 +477,8 @@ void ags_copyFromAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_C
|
||||
void ags_copyToAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flg) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copy_to_alpha(sx, sy, w, h, dx, dy, flg);
|
||||
}
|
||||
@@ -490,7 +486,7 @@ void ags_copyToAlpha(int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COP
|
||||
void ags_alpha_uppercut(int sx, int sy, int w, int h, int s, int d) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
|
||||
alpha_uppercut(nact->ags.dib, sx, sy, w, h, s, d);
|
||||
}
|
||||
@@ -498,7 +494,7 @@ void ags_alpha_uppercut(int sx, int sy, int w, int h, int s, int d) {
|
||||
void ags_alpha_lowercut(int sx, int sy, int w, int h, int s, int d) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
|
||||
alpha_lowercut(nact->ags.dib, sx, sy, w, h, s, d);
|
||||
}
|
||||
@@ -506,7 +502,7 @@ void ags_alpha_lowercut(int sx, int sy, int w, int h, int s, int d) {
|
||||
void ags_alpha_setLevel(int x, int y, int w, int h, int lv) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
alpha_set_level(nact->ags.dib, x, y, w, h, lv);
|
||||
}
|
||||
@@ -514,8 +510,8 @@ void ags_alpha_setLevel(int x, int y, int w, int h, int lv) {
|
||||
void ags_alpha_copyArea(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
alpha_copy_area(nact->ags.dib, sx, sy, w, h, dx, dy);
|
||||
}
|
||||
@@ -523,7 +519,7 @@ void ags_alpha_copyArea(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
void ags_alpha_getPixel(int x, int y, int *pic) {
|
||||
if (nact->sys_world_depth == 8) return;
|
||||
|
||||
if (!check_param_xy(&x, &y)) {
|
||||
if (!ags_check_param_xy(&x, &y)) {
|
||||
*pic = 0;
|
||||
} else {
|
||||
alpha_get_pixel(nact->ags.dib, x, y, (BYTE *)pic);
|
||||
@@ -537,7 +533,7 @@ void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b) {
|
||||
savey = y;
|
||||
savew = w;
|
||||
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
offset = abs(savey - y) * savew + abs(savex - x);
|
||||
|
||||
@@ -549,7 +545,7 @@ void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b) {
|
||||
*/
|
||||
void ags_fader(ags_faderinfo_t *i) {
|
||||
int cnt_st, step, key = 0, canceled_key = 0;
|
||||
cnt_st = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
cnt_st = sdl_getTicks();
|
||||
|
||||
i->callback(0);
|
||||
|
||||
@@ -559,12 +555,12 @@ void ags_fader(ags_faderinfo_t *i) {
|
||||
while(step < i->step_max) {
|
||||
int lefttime, leftstep, mstime, cnt1, cnt2;
|
||||
|
||||
cnt1 = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
cnt1 = sdl_getTicks();
|
||||
i->callback(step);
|
||||
key = sys_getInputInfo();
|
||||
/* 実際の fade にかかった時間 */
|
||||
sdl_sleep(0); /* It's a magic !!! */
|
||||
cnt2 = get_high_counter(SYSTEMCOUNTER_MSEC) - cnt1;
|
||||
cnt2 = sdl_getTicks() - cnt1;
|
||||
|
||||
lefttime = i->effect_time - (cnt1 + cnt2 - cnt_st); /* fade 残り時間 */
|
||||
leftstep = i->step_max - step; /* fade 残りステップ数 */
|
||||
@@ -689,7 +685,7 @@ void ags_setCursorLocation(int x, int y, boolean is_dibgeo) {
|
||||
int dx[8], dy[8];
|
||||
int i, delx, dely;
|
||||
MyPoint p;
|
||||
if (!check_param_xy(&x, &y)) return;
|
||||
if (!ags_check_param_xy(&x, &y)) return;
|
||||
|
||||
/* DIB 座表系か Window 座表系か */
|
||||
if (is_dibgeo) {
|
||||
@@ -739,8 +735,8 @@ void ags_copyArea_shadow_withrate(int sx, int sy, int w, int h, int dx, int dy,
|
||||
|
||||
if (lv == 0) return;
|
||||
|
||||
if (!check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!check_param(&dx, &dy, &w, &h)) return;
|
||||
if (!ags_check_param(&sx, &sy, &w, &h)) return;
|
||||
if (!ags_check_param(&dx, &dy, &w, &h)) return;
|
||||
|
||||
sdl_copyAreaSP16_shadow(sx, sy, w, h, dx, dy, lv);
|
||||
}
|
||||
@@ -758,7 +754,7 @@ int ags_getCursorMoveTime() {
|
||||
*
|
||||
*/
|
||||
void ags_zoom(int x, int y, int w, int h) {
|
||||
if (!check_param(&x, &y, &w, &h)) return;
|
||||
if (!ags_check_param(&x, &y, &w, &h)) return;
|
||||
|
||||
sdl_zoom(x, y, w, h);
|
||||
}
|
||||
@@ -767,6 +763,6 @@ agsurface_t *ags_getDIB() {
|
||||
return nact->ags.dib;
|
||||
}
|
||||
|
||||
void ags_autorepeat(boolean bool) {
|
||||
sdl_setAutoRepeat(bool);
|
||||
void ags_autorepeat(boolean enable) {
|
||||
sdl_setAutoRepeat(enable);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ extern boolean ags_check_param_xy(int *x, int *y);
|
||||
extern agsurface_t *ags_getDIB();
|
||||
|
||||
/* 画面更新 */
|
||||
extern void ags_setExposeSwitch(boolean bool);
|
||||
extern void ags_setExposeSwitch(boolean expose);
|
||||
extern void ags_updateFull(void);
|
||||
extern void ags_updateArea(int x, int y, int width, int height);
|
||||
|
||||
@@ -230,7 +230,7 @@ extern int ags_getCursorMoveTime();
|
||||
extern void ags_setAntialiasedStringMode(boolean mode);
|
||||
extern boolean ags_getAntialiasedStringMode();
|
||||
extern void ags_fader(ags_faderinfo_t *);
|
||||
extern void ags_autorepeat(boolean bool);
|
||||
extern void ags_autorepeat(boolean enable);
|
||||
|
||||
#define RMASK16 0xf800
|
||||
#define GMASK16 0x07e0
|
||||
|
||||
+31
-74
@@ -26,42 +26,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <SDL_timer.h>
|
||||
#include <SDL_mixer.h>
|
||||
|
||||
#include "portab.h"
|
||||
#include "system.h"
|
||||
#include "counter.h"
|
||||
#include "cdrom.h"
|
||||
#include "music_private.h"
|
||||
|
||||
/*
|
||||
CPUパワーがあまってあまってどうしようもない人へ :-)
|
||||
|
||||
使い方
|
||||
|
||||
1. とりあえず mpg123 などの プレイヤーを用意する。
|
||||
esd を使いたい場合は Ver 0.59q 以降を入れよう。
|
||||
プレーヤーにはあらかじめパスを通しておく。
|
||||
|
||||
2. % cat ~/game/kichiku.playlist
|
||||
mpg123 -quite
|
||||
$(HOME)/game/kichiku/mp3/trk02.mp3
|
||||
$(HOME)/game/kichiku/mp3/trk03.mp3
|
||||
$(HOME)/game/kichiku/mp3/trk04.mp3
|
||||
$(HOME)/game/kichiku/mp3/trk05.mp3
|
||||
$(HOME)/game/kichiku/mp3/trk06.mp3
|
||||
|
||||
ってなファイルを用意する。( $(HOME)は適当にかえてね )
|
||||
1行目はプレーヤーとそのオプション
|
||||
2行目以降はトラック2から順にファイルをならべる
|
||||
|
||||
|
||||
3 configure で --enable-cdrom=mp3 を追加する
|
||||
|
||||
4 実行時オプションに -devcd ~/game/kichiku.playlist のように上で作成したファイルを指定
|
||||
|
||||
*/
|
||||
|
||||
static int cdrom_init(char *);
|
||||
static int cdrom_exit();
|
||||
static int cdrom_start(int, int);
|
||||
@@ -83,59 +55,46 @@ cdromdevice_t cdrom = {
|
||||
|
||||
static boolean enabled = FALSE;
|
||||
static char *playlist[PLAYLIST_MAX];
|
||||
static int lastindex; // 最終トラック番号
|
||||
static Mix_Music *mix_music;
|
||||
static int trackno; // 現在演奏中のトラック
|
||||
static int counter; // 演奏時間測定用カウンタ
|
||||
static int start_time;
|
||||
|
||||
static int cdrom_init(char *config_file) {
|
||||
char lbuf[256];
|
||||
int lcnt = 1;
|
||||
char *s;
|
||||
|
||||
FILE *fp = fopen(config_file, "rt");
|
||||
static int cdrom_init(char *playlist_path) {
|
||||
char buf[256];
|
||||
|
||||
FILE *fp = fopen(playlist_path, "r");
|
||||
if (fp) {
|
||||
// Skip the first line
|
||||
fgets(lbuf, sizeof(lbuf), fp);
|
||||
fgets(buf, sizeof(buf), fp);
|
||||
} else {
|
||||
fp = fopen("_inmm.ini", "rt");
|
||||
fp = fopen("_inmm.ini", "r");
|
||||
}
|
||||
if (!fp)
|
||||
if (!fp) {
|
||||
NOTICE("cdrom: Cannot open playlist %s\n", playlist_path);
|
||||
return NG;
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
if (++lcnt >= (PLAYLIST_MAX +2)) {
|
||||
for (int track = 2; track < PLAYLIST_MAX; track++) {
|
||||
if (!fgets(buf, sizeof(buf), fp))
|
||||
break;
|
||||
}
|
||||
if (!fgets(lbuf, sizeof(lbuf) -1, fp)) {
|
||||
if (feof(fp)) {
|
||||
for (char *s = buf; *s; s++) {
|
||||
if (*s == '\\')
|
||||
*s = '/';
|
||||
else if (*s == '\r' || *s == '\n') {
|
||||
*s = '\0';
|
||||
break;
|
||||
} else {
|
||||
perror("fgets()");
|
||||
fclose(fp);
|
||||
return NG;
|
||||
}
|
||||
}
|
||||
if (NULL == (playlist[lcnt -2] = malloc(strlen(lbuf) + 1))) {
|
||||
fclose(fp);
|
||||
return NG;
|
||||
if (*buf) {
|
||||
playlist[track] = strdup(buf);
|
||||
prv.cd_maxtrk = track;
|
||||
}
|
||||
s = lbuf;
|
||||
while (*s != '\n' && *s != 0) s++;
|
||||
if (*s == '\n') *s=0;
|
||||
strcpy(playlist[lcnt - 2], lbuf);
|
||||
}
|
||||
lastindex = lcnt -1;
|
||||
fclose(fp);
|
||||
NOTICE("cdrom: Loaded playlist from %s\n", playlist_path);
|
||||
|
||||
trackno = 0;
|
||||
prv.cd_maxtrk = lastindex;
|
||||
|
||||
reset_counter_high(SYSTEMCOUNTER_MP3, 10, 0);
|
||||
enabled = TRUE;
|
||||
|
||||
NOTICE("cdrom mp3 external player mode\n");
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -150,10 +109,8 @@ static int cdrom_exit() {
|
||||
static int cdrom_start(int trk, int loop) {
|
||||
if (!enabled) return 0;
|
||||
|
||||
/* 曲数よりも多い指定は不可*/
|
||||
if (trk > lastindex) {
|
||||
if (trk >= PLAYLIST_MAX || !playlist[trk])
|
||||
return NG;
|
||||
}
|
||||
|
||||
if (mix_music)
|
||||
Mix_FreeMusic(mix_music);
|
||||
@@ -161,15 +118,15 @@ static int cdrom_start(int trk, int loop) {
|
||||
#ifdef __ANDROID__
|
||||
// Mix_LoadMUS uses SDL_RWFromFile which requires absolute path on Android
|
||||
char path[PATH_MAX];
|
||||
if (!realpath(playlist[trk -2], path))
|
||||
if (!realpath(playlist[trk], path))
|
||||
return NG;
|
||||
mix_music = Mix_LoadMUS(path);
|
||||
#else
|
||||
mix_music = Mix_LoadMUS(playlist[trk -2]);
|
||||
mix_music = Mix_LoadMUS(playlist[trk]);
|
||||
#endif
|
||||
|
||||
if (!mix_music) {
|
||||
WARNING("Cannot load %s: %s\n", playlist[trk -2], Mix_GetError());
|
||||
WARNING("Cannot load %s: %s\n", playlist[trk], Mix_GetError());
|
||||
return NG;
|
||||
}
|
||||
if (Mix_PlayMusic(mix_music, loop == 0 ? -1 : loop) != 0) {
|
||||
@@ -179,7 +136,7 @@ static int cdrom_start(int trk, int loop) {
|
||||
}
|
||||
|
||||
trackno = trk;
|
||||
counter = get_high_counter(SYSTEMCOUNTER_MP3);
|
||||
start_time = SDL_GetTicks();
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -206,12 +163,12 @@ static int cdrom_getPlayingInfo (cd_time *inf) {
|
||||
mix_music = NULL;
|
||||
return NG;
|
||||
}
|
||||
int cnt = get_high_counter(SYSTEMCOUNTER_MP3) - counter;
|
||||
int ms = SDL_GetTicks() - start_time;
|
||||
|
||||
inf->t = trackno;
|
||||
inf->m = cnt / (60*100); cnt %= (60*100);
|
||||
inf->s = cnt / 100; cnt %= 100;
|
||||
inf->f = (cnt * CD_FPS) / 100;
|
||||
inf->m = ms / (60*1000); ms %= (60*1000);
|
||||
inf->s = ms / 1000; ms %= 1000;
|
||||
inf->f = (ms * CD_FPS) / 1000;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
+2
-7
@@ -441,15 +441,10 @@ void commands2F26() {
|
||||
}
|
||||
|
||||
void commands2F27() {
|
||||
int num = getCaliValue();
|
||||
int num = getCaliValue();
|
||||
const char *string = sl_getString(0);
|
||||
|
||||
if (num > 0) {
|
||||
svar_set(num, string);
|
||||
} else {
|
||||
WARNING("MS: num <= 0\n");
|
||||
}
|
||||
|
||||
svar_set(num, string);
|
||||
DEBUG_COMMAND("MS(new) %d, %s:\n", num, string);
|
||||
}
|
||||
|
||||
|
||||
+7
-8
@@ -177,7 +177,6 @@ void exec_command(void) {
|
||||
DEBUG_MESSAGE("%d:%x\n", sl_getPage(), sl_getIndex());
|
||||
|
||||
int page, index;
|
||||
int bool;
|
||||
int c0 = sl_getc();
|
||||
|
||||
if (c0 == BREAKPOINT)
|
||||
@@ -1194,13 +1193,13 @@ void exec_command(void) {
|
||||
/* puts("選択"); */
|
||||
sel_select();
|
||||
break;
|
||||
case '{':
|
||||
/* puts("条件文"); */
|
||||
bool = getCaliValue();
|
||||
index = sl_getaddr();
|
||||
if (bool == 0) {
|
||||
sl_jmpNear(index);
|
||||
}
|
||||
case '{': // conditional statement
|
||||
{
|
||||
int cond = getCaliValue();
|
||||
index = sl_getaddr();
|
||||
if (!cond)
|
||||
sl_jmpNear(index);
|
||||
}
|
||||
break;
|
||||
case '~':
|
||||
/* label far call */
|
||||
|
||||
+2
-7
@@ -31,12 +31,9 @@ void commandDC() {
|
||||
int page = getCaliValue();
|
||||
int maxindex = getCaliValue();
|
||||
int save = getCaliValue();
|
||||
boolean bool;
|
||||
|
||||
bool = v_allocateArrayBuffer(page, maxindex + 1, save == 0 ? false : true);
|
||||
if(!bool) {
|
||||
if (!v_allocateArrayBuffer(page, maxindex + 1, save == 0 ? false : true))
|
||||
WARNING("commandDC(): Array allocate failed\n");
|
||||
}
|
||||
DEBUG_COMMAND("DC %d,%d,%d:\n", page, maxindex, save);
|
||||
}
|
||||
|
||||
@@ -57,11 +54,9 @@ void commandDS() {
|
||||
int varno = preVarNo;
|
||||
int offset = getCaliValue();
|
||||
int page = getCaliValue();
|
||||
boolean bool;
|
||||
|
||||
DEBUG_COMMAND("DS %p,%p,%d,%d:\n",point_var, data_var, offset, page);
|
||||
bool = v_defineArrayVar(varno, point_var, offset, page);
|
||||
if (!bool) {
|
||||
if (!v_defineArrayVar(varno, point_var, offset, page)) {
|
||||
WARNING("commandDS(): Array allocate failed\n");
|
||||
WARNING("if you are playing 'Pastel Chime', please patch to scenario(see patch/README.TXT for detail)\n");
|
||||
}
|
||||
|
||||
+1
-5
@@ -52,11 +52,7 @@ void commandMS() {
|
||||
int num = getCaliValue();
|
||||
const char *str = sl_getString(':');
|
||||
|
||||
if (num > 0) { /* thanx tajiri@wizard */
|
||||
svar_set(num, str);
|
||||
} else {
|
||||
WARNING("MS: num(%d) <= 0\n", num);
|
||||
}
|
||||
svar_set(num, str);
|
||||
DEBUG_COMMAND("MS %d,%s:\n",num,str);
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -31,7 +31,6 @@
|
||||
#include "xsystem35.h"
|
||||
#include "scenario.h"
|
||||
#include "ags.h"
|
||||
#include "counter.h"
|
||||
#include "input.h"
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
@@ -772,7 +771,7 @@ void commandVA() { /* from Panyo */
|
||||
/* 開始 (p3=コマ数,0:無限(開始位置==終了位置のとき))*/
|
||||
inAnimation = TRUE;
|
||||
VAcmd[p1].elaspCut = 0;
|
||||
VAcmd[p1].startTime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
VAcmd[p1].startTime = sdl_getTicks();
|
||||
VAcmd[p1].totalCut = p3;
|
||||
|
||||
if (p3 == 0) {
|
||||
@@ -1015,7 +1014,7 @@ static void va_animationAlone(int i) {
|
||||
static void va_update() {
|
||||
boolean proceeding = FALSE;
|
||||
int i;
|
||||
int curTime = get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
int curTime = sdl_getTicks();
|
||||
|
||||
for (i = 0; i < VACMD_MAX; i++) {
|
||||
if (VAcmd[i].state == VA_RUNNING) {
|
||||
|
||||
+51
-21
@@ -30,7 +30,6 @@
|
||||
#include "sdl_core.h"
|
||||
#include "ags.h"
|
||||
#include "scenario.h"
|
||||
#include "counter.h"
|
||||
#include "randMT.h"
|
||||
#include "selection.h"
|
||||
#include "message.h"
|
||||
@@ -38,6 +37,31 @@
|
||||
#include "nact.h"
|
||||
#include "font.h"
|
||||
|
||||
static struct {
|
||||
uint32_t base;
|
||||
int divisor;
|
||||
} counters[257]; // [0] for ZT 1-5, [1..256] for ZT 10-11
|
||||
|
||||
static void reset_counter(int num, int divisor, int offset) {
|
||||
counters[num].base = sdl_getTicks() - offset;
|
||||
counters[num].divisor = divisor;
|
||||
}
|
||||
|
||||
static uint32_t get_counter(int num) {
|
||||
// Allow up to 10 get_counter() calls in single animation frame.
|
||||
static int frame = -1;
|
||||
static int count = 0;
|
||||
if (nact->frame_count == frame) {
|
||||
if (++count >= 10)
|
||||
nact->wait_vsync = TRUE;
|
||||
} else {
|
||||
frame = nact->frame_count;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
return sdl_getTicks() - counters[num].base;
|
||||
}
|
||||
|
||||
void commandZC() {
|
||||
/* システムの使用環境を変更する */
|
||||
int m = getCaliValue();
|
||||
@@ -191,7 +215,7 @@ void commandZT0() {
|
||||
c1 = sl_getc();
|
||||
c2 = sl_getc();
|
||||
if (c1 == 0x41 && c2 == 0x7f) {
|
||||
reset_counter(0);
|
||||
reset_counter(0, 1, 0);
|
||||
return;
|
||||
} else {
|
||||
sl_jmpNear(sv);
|
||||
@@ -214,7 +238,7 @@ void commandZT1() {
|
||||
/* タイマーを n の数値でクリアする */
|
||||
int n = getCaliValue();
|
||||
|
||||
reset_counter(n);
|
||||
reset_counter(0, 1, n);
|
||||
|
||||
DEBUG_COMMAND("ZT1 %d:\n", n);
|
||||
}
|
||||
@@ -222,10 +246,9 @@ void commandZT1() {
|
||||
void commandZT2() {
|
||||
/* タイマーを var に取得する 1/10 sec */
|
||||
int *var = getCaliVariable();
|
||||
int val = get_counter(100);
|
||||
int val = get_counter(0) / 100;
|
||||
|
||||
if (val > 65535) val = 65535;
|
||||
*var = val;
|
||||
*var = val & 0xffff;
|
||||
|
||||
DEBUG_COMMAND("ZT2 %p:\n", var);
|
||||
}
|
||||
@@ -233,10 +256,9 @@ void commandZT2() {
|
||||
void commandZT3() {
|
||||
/* タイマーを var に取得する 1/30 sec */
|
||||
int *var = getCaliVariable();
|
||||
int val = get_counter(33);
|
||||
int val = get_counter(0) * 3 / 100;
|
||||
|
||||
if (val > 65535) val = 65535;
|
||||
*var = val;
|
||||
*var = val & 0xffff;
|
||||
|
||||
DEBUG_COMMAND("ZT3 %p:\n", var);
|
||||
}
|
||||
@@ -244,10 +266,9 @@ void commandZT3() {
|
||||
void commandZT4() {
|
||||
/* タイマーを var に取得する 1/60 sec */
|
||||
int *var = getCaliVariable();
|
||||
int val = get_counter(17);
|
||||
int val = get_counter(0) * 3 / 50;
|
||||
|
||||
if (val > 65535) val = 65535;
|
||||
*var = val;
|
||||
*var = val & 0xffff;
|
||||
|
||||
DEBUG_COMMAND("ZT4 %p:\n", var);
|
||||
}
|
||||
@@ -255,10 +276,9 @@ void commandZT4() {
|
||||
void commandZT5() {
|
||||
/* タイマーを var に取得する */
|
||||
int *var = getCaliVariable();
|
||||
int val = get_counter(10);
|
||||
int val = get_counter(0) / 10;
|
||||
|
||||
if (val > 65535) val = 65535;
|
||||
*var = val;
|
||||
*var = val & 0xffff;
|
||||
|
||||
DEBUG_COMMAND("ZT5 %d:\n", val);
|
||||
}
|
||||
@@ -269,7 +289,14 @@ void commandZT10() {
|
||||
int base = getCaliValue();
|
||||
int count = getCaliValue();
|
||||
|
||||
reset_counter_high(num, base ? base : 1, count);
|
||||
if (num > 256) {
|
||||
WARNING("invalid timer id %d\n", num);
|
||||
} else if (num == 0) {
|
||||
for (int i = 1; i <= 256; i++)
|
||||
reset_counter(i, base, count);
|
||||
} else {
|
||||
reset_counter(num, base, count);
|
||||
}
|
||||
|
||||
DEBUG_COMMAND("ZT10 %d,%d,%d:\n", num, base, count);
|
||||
}
|
||||
@@ -278,11 +305,14 @@ void commandZT11() {
|
||||
/* 高精度タイマー取得 */
|
||||
int num = getCaliValue();
|
||||
int *var = getCaliVariable();
|
||||
int val = get_high_counter(num);
|
||||
|
||||
*var = val;
|
||||
|
||||
DEBUG_COMMAND("ZT11 %d,%d,%d:\n", num, val, *var);
|
||||
|
||||
int divisor = counters[num].divisor ? counters[num].divisor : 1;
|
||||
if (num > 256)
|
||||
WARNING("invalid timer id %d\n", num);
|
||||
else
|
||||
*var = (get_counter(num) / divisor) & 0xffff;
|
||||
|
||||
DEBUG_COMMAND("ZT11 %d,%d:\n", num, *var);
|
||||
}
|
||||
|
||||
void commandZT20() {
|
||||
|
||||
-106
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
* counter.c 内部カウンタ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*
|
||||
*/
|
||||
/* $Id: counter.c,v 1.10 2000/11/25 13:09:03 chikama Exp $ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include "counter.h"
|
||||
#include "nact.h"
|
||||
|
||||
#define HICOUNTER_MAX (256 + EXTER_HIGHTCOUNTER_NUM)
|
||||
static struct timeval tv_base;
|
||||
static int counter_init = 0;
|
||||
|
||||
static int counter_init_high[HICOUNTER_MAX];
|
||||
static struct timeval tv_high[HICOUNTER_MAX];
|
||||
static int division_high[HICOUNTER_MAX] = { [0 ...( HICOUNTER_MAX-1 )]=1};
|
||||
|
||||
// Allow up to 10 get_counter() calls in single animation frame
|
||||
void counter_throttle(void) {
|
||||
static int frame = -1;
|
||||
static int count = 0;
|
||||
|
||||
if (nact->frame_count == frame) {
|
||||
if (++count >= 10)
|
||||
nact->wait_vsync = TRUE;
|
||||
} else {
|
||||
frame = nact->frame_count;
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int get_counter(int division) {
|
||||
long sec, usec, usec2;
|
||||
struct timeval tv;
|
||||
|
||||
counter_throttle();
|
||||
gettimeofday(&tv, NULL);
|
||||
sec = tv.tv_sec - tv_base.tv_sec;
|
||||
usec = tv.tv_usec - tv_base.tv_usec;
|
||||
usec2 = sec * 1000l + usec / 1000l;
|
||||
return counter_init + (int)(usec2 / division);
|
||||
}
|
||||
|
||||
/* カウンタ〜を valでリセット */
|
||||
/* 初期化時に一度呼んでおく */
|
||||
void reset_counter(int val) {
|
||||
counter_init = val;
|
||||
gettimeofday(&tv_base, NULL);
|
||||
}
|
||||
|
||||
|
||||
int get_high_counter(int num) {
|
||||
long sec, usec, usec2;
|
||||
struct timeval tv;
|
||||
struct timeval tv_base = tv_high[num -1];
|
||||
int division = division_high[num -1];
|
||||
|
||||
counter_throttle();
|
||||
gettimeofday(&tv, NULL);
|
||||
sec = tv.tv_sec - tv_base.tv_sec;
|
||||
usec = tv.tv_usec - tv_base.tv_usec;
|
||||
usec2 = sec * (1000l/division)+ usec / 1000l /division;
|
||||
return counter_init_high[num -1] + usec2;
|
||||
}
|
||||
|
||||
/* 高精度カウンタ〜 thanx tajiri@wizard */
|
||||
/* カウンタ〜を valでリセット */
|
||||
/* 初期化時に一度呼んでおく */
|
||||
void reset_counter_high(int num,int division,int val) {
|
||||
if (num == 0) {
|
||||
int i;
|
||||
for (i = 0; i < 256; i++) {
|
||||
counter_init_high[i] = val;
|
||||
gettimeofday(&tv_high[i], NULL);
|
||||
division_high[i]=division;
|
||||
}
|
||||
} else {
|
||||
counter_init_high[num -1] = val;
|
||||
gettimeofday(&tv_high[num -1], NULL);
|
||||
division_high[num -1]=division;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* counter.h 内部カウンタ
|
||||
*
|
||||
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
|
||||
* 1998- <masaki-c@is.aist-nara.ac.jp>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
/* $Id: counter.h,v 1.7 2000/11/25 13:09:03 chikama Exp $ */
|
||||
|
||||
#ifndef __XSYSTEM35_COUNTER__
|
||||
#define __XSYSTEM35_COUNTER__
|
||||
|
||||
#define EXTER_HIGHTCOUNTER_NUM 3
|
||||
#define SYSTEMCOUNTER_MP3 (256 + 1)
|
||||
#define SYSTEMCOUNTER_MIDI (256 + 2)
|
||||
#define SYSTEMCOUNTER_MSEC (256 + 3) /* 1msec no reset counter */
|
||||
|
||||
extern int get_counter(int division);
|
||||
extern void reset_counter(int val);
|
||||
extern int get_high_counter(int num);
|
||||
extern void reset_counter_high(int num, int division, int val);
|
||||
|
||||
#endif /* !__XSYSTEM35_COUNTER__ */
|
||||
+2
-3
@@ -49,7 +49,6 @@ static struct {
|
||||
void dbg_init(const char *symbols_path, boolean use_dap) {
|
||||
dbg_impl = use_dap ? &dbg_dap_impl : &dbg_cui_impl;
|
||||
dbg_impl->init(symbols_path);
|
||||
dbg_state = DBG_STOPPED_ENTRY;
|
||||
}
|
||||
|
||||
void dbg_quit() {
|
||||
@@ -539,11 +538,11 @@ void dbg_onsleep(void) {
|
||||
dbg_impl->onsleep();
|
||||
}
|
||||
|
||||
boolean dbg_console_vprintf(const char *format, va_list ap) {
|
||||
boolean dbg_console_vprintf(int lv, const char *format, va_list ap) {
|
||||
if (!dbg_impl || !dbg_impl->console_output)
|
||||
return false;
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), format, ap);
|
||||
dbg_impl->console_output(buf);
|
||||
dbg_impl->console_output(lv, buf);
|
||||
return true;
|
||||
}
|
||||
|
||||
+3
-2
@@ -30,6 +30,7 @@ typedef enum {
|
||||
DBG_STOPPED_NEXT,
|
||||
DBG_STOPPED_BREAKPOINT,
|
||||
DBG_STOPPED_INTERRUPT,
|
||||
DBG_STOPPED_EXCEPTION,
|
||||
} DebuggerState;
|
||||
|
||||
extern DebuggerState dbg_state;
|
||||
@@ -45,7 +46,7 @@ void dbg_quit();
|
||||
void dbg_main(void);
|
||||
void dbg_onsleep(void);
|
||||
BYTE dbg_handle_breakpoint(int page, int addr);
|
||||
boolean dbg_console_vprintf(const char *format, va_list ap);
|
||||
boolean dbg_console_vprintf(int lv, const char *format, va_list ap);
|
||||
|
||||
#else // ENABLE_DEBUGGER
|
||||
|
||||
@@ -55,7 +56,7 @@ boolean dbg_console_vprintf(const char *format, va_list ap);
|
||||
#define dbg_main()
|
||||
#define dbg_onsleep()
|
||||
#define dbg_handle_breakpoint(page, addr) BREAKPOINT
|
||||
#define dbg_console_vprintf(format, ap) false
|
||||
#define dbg_console_vprintf(lv, format, ap) false
|
||||
|
||||
#endif // ENABLE_DEBUGGER
|
||||
|
||||
|
||||
@@ -345,6 +345,7 @@ static void dbg_cui_init(const char *symbols_path) {
|
||||
win_alloc_console();
|
||||
win_set_ctrl_c_handler(sigint_handler);
|
||||
#endif
|
||||
dbg_state = DBG_STOPPED_ENTRY;
|
||||
}
|
||||
|
||||
static void dbg_cui_quit(void) {
|
||||
|
||||
+63
-80
@@ -20,7 +20,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <SDL_mutex.h>
|
||||
#include <SDL_thread.h>
|
||||
#ifdef _WIN32
|
||||
#include <fcntl.h>
|
||||
@@ -31,6 +30,7 @@
|
||||
#include "debugger.h"
|
||||
#include "debugger_private.h"
|
||||
#include "debug_symbol.h"
|
||||
#include "msgqueue.h"
|
||||
#include "system.h"
|
||||
#include "nact.h"
|
||||
#include "variable.h"
|
||||
@@ -42,8 +42,14 @@ enum VariablesReference {
|
||||
VREF_STRINGS,
|
||||
};
|
||||
|
||||
static boolean initialized = false;
|
||||
// Exception Breakpoint Filters.
|
||||
static const char ebf_warnings[] = "warnings";
|
||||
|
||||
static bool initialized;
|
||||
static char *symbols_path;
|
||||
static char *src_dir;
|
||||
static struct msgq *queue;
|
||||
static bool break_on_warnings;
|
||||
|
||||
cJSON *create_source(const char *name) {
|
||||
cJSON *source = cJSON_CreateObject();
|
||||
@@ -82,7 +88,7 @@ static void emit_terminated_event(void) {
|
||||
send_json(event);
|
||||
}
|
||||
|
||||
static void emit_stop_event(void) {
|
||||
static void emit_stopped_event(void) {
|
||||
const char *reason;
|
||||
switch (dbg_state) {
|
||||
case DBG_STOPPED_ENTRY: reason = "entry"; break;
|
||||
@@ -90,6 +96,7 @@ static void emit_stop_event(void) {
|
||||
case DBG_STOPPED_NEXT: reason = "step"; break;
|
||||
case DBG_STOPPED_BREAKPOINT: reason = "breakpoint"; break;
|
||||
case DBG_STOPPED_INTERRUPT: reason = "pause"; break;
|
||||
case DBG_STOPPED_EXCEPTION: reason = "exception"; break;
|
||||
default: reason = "unknown"; break;
|
||||
}
|
||||
|
||||
@@ -102,7 +109,7 @@ static void emit_stop_event(void) {
|
||||
send_json(event);
|
||||
}
|
||||
|
||||
static void emit_output_event(const char *output) {
|
||||
static void emit_output_event(int lv, const char *output) {
|
||||
cJSON *event = cJSON_CreateObject(), *body;
|
||||
cJSON_AddStringToObject(event, "type", "event");
|
||||
cJSON_AddStringToObject(event, "event", "output");
|
||||
@@ -117,34 +124,52 @@ static void emit_output_event(const char *output) {
|
||||
cJSON_AddNumberToObject(body, "line", line);
|
||||
|
||||
send_json(event);
|
||||
|
||||
if (break_on_warnings && lv <= 1)
|
||||
dbg_state = DBG_STOPPED_EXCEPTION;
|
||||
}
|
||||
|
||||
static void cmd_initialize(cJSON *args, cJSON *resp) {
|
||||
if (!symbols) {
|
||||
cJSON_AddBoolToObject(resp, "success", false);
|
||||
cJSON_AddStringToObject(resp, "message", "xsystem35: Cannot load debug symbols");
|
||||
return;
|
||||
}
|
||||
cJSON *body;
|
||||
cJSON *body, *filters, *filter;
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
cJSON_AddItemToObjectCS(resp, "body", body = cJSON_CreateObject());
|
||||
cJSON_AddBoolToObject(body, "supportsConditionalBreakpoints", true);
|
||||
cJSON_AddBoolToObject(body, "supportsConfigurationDoneRequest", true);
|
||||
cJSON_AddBoolToObject(body, "supportsEvaluateForHovers", true);
|
||||
cJSON_AddBoolToObject(body, "supportsSetVariable", true);
|
||||
cJSON_AddItemToObjectCS(body, "exceptionBreakpointFilters", filters = cJSON_CreateArray());
|
||||
cJSON_AddItemToArray(filters, filter = cJSON_CreateObject());
|
||||
cJSON_AddStringToObject(filter, "filter", ebf_warnings);
|
||||
cJSON_AddStringToObject(filter, "label", "Stop on warnings");
|
||||
}
|
||||
|
||||
static void cmd_launch(cJSON *args, cJSON *resp) {
|
||||
cJSON *noDebug = cJSON_GetObjectItemCaseSensitive(args, "noDebug");
|
||||
if (cJSON_IsTrue(noDebug)) {
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
initialized = true;
|
||||
return;
|
||||
}
|
||||
|
||||
symbols = dsym_load(symbols_path);
|
||||
if (!symbols) {
|
||||
cJSON_AddBoolToObject(resp, "success", false);
|
||||
cJSON_AddStringToObject(resp, "message", "xsystem35: Cannot load debug symbols");
|
||||
return;
|
||||
}
|
||||
|
||||
cJSON *srcDir = cJSON_GetObjectItemCaseSensitive(args, "srcDir");
|
||||
if (cJSON_IsString(srcDir))
|
||||
src_dir = strdup(srcDir->valuestring);
|
||||
if (cJSON_IsTrue(cJSON_GetObjectItemCaseSensitive(args, "stopOnEntry")))
|
||||
dbg_state = DBG_STOPPED_ENTRY;
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
|
||||
emit_initialized_event();
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
static void cmd_configurationDone(cJSON *args, cJSON *resp) {
|
||||
initialized = true;
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
}
|
||||
|
||||
@@ -236,6 +261,17 @@ static void cmd_setBreakpoints(cJSON *args, cJSON *resp) {
|
||||
}
|
||||
}
|
||||
|
||||
static void cmd_setExceptionBreakpoints(cJSON *args, cJSON *resp) {
|
||||
cJSON *filters = cJSON_GetObjectItemCaseSensitive(args, "filters");
|
||||
break_on_warnings = false;
|
||||
cJSON *filter;
|
||||
cJSON_ArrayForEach(filter, filters) {
|
||||
if (cJSON_IsString(filter) && !strcmp(filter->valuestring, ebf_warnings))
|
||||
break_on_warnings = true;
|
||||
}
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
}
|
||||
|
||||
static void cmd_evaluate(cJSON *args, cJSON *resp) {
|
||||
cJSON *expression = cJSON_GetObjectItemCaseSensitive(args, "expression");
|
||||
if (!cJSON_IsString(expression)) {
|
||||
@@ -304,7 +340,7 @@ static void cmd_scopes(cJSON *args, cJSON *resp) {
|
||||
cJSON_AddItemToArray(scopes, strings = cJSON_CreateObject());
|
||||
cJSON_AddStringToObject(strings, "name", "Strings");
|
||||
cJSON_AddNumberToObject(strings, "variablesReference", VREF_STRINGS);
|
||||
cJSON_AddNumberToObject(strings, "indexedVariables", svar_count() + 1);
|
||||
cJSON_AddNumberToObject(strings, "indexedVariables", svar_maxindex() + 1);
|
||||
cJSON_AddBoolToObject(strings, "expensive", false);
|
||||
}
|
||||
|
||||
@@ -345,11 +381,7 @@ static void cmd_variables(cJSON *args, cJSON *resp) {
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
cJSON_AddItemToObjectCS(resp, "body", body = cJSON_CreateObject());
|
||||
cJSON_AddItemToObjectCS(body, "variables", variables = cJSON_CreateArray());
|
||||
if (start == 0) {
|
||||
start++;
|
||||
count--;
|
||||
}
|
||||
int end = svar_count() + 1;
|
||||
int end = svar_maxindex() + 1;
|
||||
if (end > start + count)
|
||||
end = start + count;
|
||||
for (int i = start; i < end; i++) {
|
||||
@@ -402,7 +434,7 @@ static void cmd_setVariable(cJSON *args, cJSON *resp) {
|
||||
cJSON_AddStringToObject(body, "value", new_value);
|
||||
} else if (cJSON_IsNumber(vref) && vref->valueint == VREF_STRINGS) {
|
||||
int idx;
|
||||
if (sscanf(name->valuestring, "[%d]", &idx) != 1 || idx < 1 || idx > svar_count()) {
|
||||
if (sscanf(name->valuestring, "[%d]", &idx) != 1 || (unsigned)idx > svar_maxindex()) {
|
||||
cJSON_AddBoolToObject(resp, "success", false);
|
||||
cJSON_AddStringToObject(resp, "message", "invalid string index");
|
||||
return;
|
||||
@@ -480,6 +512,8 @@ static boolean handle_request(cJSON *request) {
|
||||
cmd_evaluate(args, resp);
|
||||
} else if (!strcmp(command->valuestring, "setBreakpoints")) {
|
||||
cmd_setBreakpoints(args, resp);
|
||||
} else if (!strcmp(command->valuestring, "setExceptionBreakpoints")) {
|
||||
cmd_setExceptionBreakpoints(args, resp);
|
||||
} else if (!strcmp(command->valuestring, "threads")) {
|
||||
cmd_threads(args, resp);
|
||||
} else if (!strcmp(command->valuestring, "scopes")) {
|
||||
@@ -508,55 +542,6 @@ static boolean handle_message(char *msg) {
|
||||
return continue_repl;
|
||||
}
|
||||
|
||||
struct cmdq_elem {
|
||||
char *cmd;
|
||||
struct cmdq_elem *next;
|
||||
};
|
||||
|
||||
struct {
|
||||
SDL_mutex *mutex;
|
||||
SDL_cond *cond_nonempty;
|
||||
struct cmdq_elem *head;
|
||||
struct cmdq_elem *last;
|
||||
} cmd_queue;
|
||||
|
||||
static boolean cmdq_isempty(void) {
|
||||
return !cmd_queue.head;
|
||||
}
|
||||
|
||||
static void cmdq_enqueue(char *cmd) {
|
||||
struct cmdq_elem *e = malloc(sizeof(struct cmdq_elem));
|
||||
e->cmd = cmd;
|
||||
e->next = NULL;
|
||||
|
||||
SDL_LockMutex(cmd_queue.mutex);
|
||||
if (!cmd_queue.head) {
|
||||
cmd_queue.head = cmd_queue.last = e;
|
||||
} else {
|
||||
cmd_queue.last->next = e;
|
||||
cmd_queue.last = e;
|
||||
}
|
||||
SDL_UnlockMutex(cmd_queue.mutex);
|
||||
SDL_CondSignal(cmd_queue.cond_nonempty);
|
||||
}
|
||||
|
||||
static char *cmdq_dequeue(void) {
|
||||
SDL_LockMutex(cmd_queue.mutex);
|
||||
while (!cmd_queue.head)
|
||||
SDL_CondWait(cmd_queue.cond_nonempty, cmd_queue.mutex);
|
||||
|
||||
struct cmdq_elem *e = cmd_queue.head;
|
||||
cmd_queue.head = e->next;
|
||||
if (!e->next)
|
||||
cmd_queue.last = NULL;
|
||||
|
||||
SDL_UnlockMutex(cmd_queue.mutex);
|
||||
|
||||
char *cmd = e->cmd;
|
||||
free(e);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
static int read_command_thread(void *data) {
|
||||
int content_length = -1;
|
||||
char header[512];
|
||||
@@ -570,19 +555,19 @@ static int read_command_thread(void *data) {
|
||||
}
|
||||
char *buf = malloc(content_length);
|
||||
fread(buf, content_length, 1, stdin);
|
||||
cmdq_enqueue(buf);
|
||||
msgq_enqueue(queue, buf);
|
||||
content_length = -1;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown Debug Adapter Protocol header: %s", header);
|
||||
}
|
||||
}
|
||||
cmdq_enqueue(NULL); // EOF
|
||||
msgq_enqueue(queue, NULL); // EOF
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dbg_dap_init(const char *symbols_path) {
|
||||
cmd_queue.mutex = SDL_CreateMutex();
|
||||
cmd_queue.cond_nonempty = SDL_CreateCond();
|
||||
static void dbg_dap_init(const char *path) {
|
||||
symbols_path = strdup(path);
|
||||
queue = msgq_new();
|
||||
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(stdin), _O_BINARY);
|
||||
@@ -591,10 +576,8 @@ static void dbg_dap_init(const char *symbols_path) {
|
||||
|
||||
SDL_CreateThread(read_command_thread, "Debugger", NULL);
|
||||
|
||||
symbols = dsym_load(symbols_path);
|
||||
|
||||
while (!initialized) {
|
||||
char *msg = cmdq_dequeue();
|
||||
char *msg = msgq_dequeue(queue);
|
||||
if (!msg)
|
||||
break;
|
||||
handle_message(msg);
|
||||
@@ -606,12 +589,12 @@ static void dbg_dap_quit(void) {
|
||||
}
|
||||
|
||||
static void dbg_dap_repl(void) {
|
||||
emit_stop_event();
|
||||
emit_stopped_event();
|
||||
dbg_state = DBG_RUNNING;
|
||||
|
||||
boolean continue_repl = true;
|
||||
while (continue_repl) {
|
||||
char *msg = cmdq_dequeue();
|
||||
char *msg = msgq_dequeue(queue);
|
||||
if (!msg)
|
||||
break;
|
||||
continue_repl = handle_message(msg);
|
||||
@@ -619,13 +602,13 @@ static void dbg_dap_repl(void) {
|
||||
}
|
||||
|
||||
static void dbg_dap_onsleep(void) {
|
||||
while (!cmdq_isempty()) {
|
||||
char *msg = cmdq_dequeue();
|
||||
while (!msgq_isempty(queue)) {
|
||||
char *msg = msgq_dequeue(queue);
|
||||
if (!msg)
|
||||
break;
|
||||
handle_message(msg);
|
||||
}
|
||||
if (dbg_state == DBG_STOPPED_INTERRUPT)
|
||||
if (dbg_state == DBG_STOPPED_INTERRUPT || dbg_state == DBG_STOPPED_EXCEPTION)
|
||||
dbg_main();
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ typedef struct {
|
||||
void (*quit)(void);
|
||||
void (*repl)(void);
|
||||
void (*onsleep)(void);
|
||||
void (*console_output)(const char *output);
|
||||
void (*console_output)(int lv, const char *output);
|
||||
} DebuggerImpl;
|
||||
|
||||
extern DebuggerImpl dbg_cui_impl;
|
||||
|
||||
+33
-38
@@ -32,7 +32,6 @@
|
||||
#include "ags.h"
|
||||
#include "system.h"
|
||||
#include "nact.h"
|
||||
#include "counter.h"
|
||||
|
||||
/* saved parameter */
|
||||
struct ecopyparam {
|
||||
@@ -54,16 +53,12 @@ static ecopyparam_t ecp;
|
||||
#define EC_WAIT \
|
||||
if ((key |= sys_getInputInfo()) && ecp.cancel) break; \
|
||||
do { \
|
||||
int wait_ms = cnt - get_ecounter(); \
|
||||
int wait_ms = cnt - sdl_getTicks(); \
|
||||
if (wait_ms >= 16) \
|
||||
key = sys_keywait(wait_ms, ecp.cancel ? KEYWAIT_CANCELABLE : KEYWAIT_NONCANCELABLE); \
|
||||
} while (0)
|
||||
|
||||
|
||||
static int get_ecounter(void) {
|
||||
return get_high_counter(SYSTEMCOUNTER_MSEC);
|
||||
}
|
||||
|
||||
static void eCopyUpdateArea(int sx, int sy, int w, int h, int dx, int dy) {
|
||||
MyRectangle src = {sx, sy, w, h};
|
||||
MyPoint dst = {
|
||||
@@ -77,7 +72,7 @@ static int eCopyArea1(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = 0; y < h - 24; y += 24) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy + h - y, w, y, dx, dy);
|
||||
@@ -92,7 +87,7 @@ static int eCopyArea2(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = 0; y < h - 24; y += 24) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy , w, y, dx, dy + h - y);
|
||||
@@ -113,7 +108,7 @@ static int eCopyArea3(int dx, int dy, int w, int h, int opt) {
|
||||
}
|
||||
y1 = dy;
|
||||
y2 = dy + h - 1;
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
while (h > 0) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, y1, w, 1, dx, y1);
|
||||
@@ -137,7 +132,7 @@ static int eCopyArea4(int dx, int dy, int w, int h, int opt) {
|
||||
}
|
||||
x1 = dx;
|
||||
x2 = dx + w - 1;
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
while (w > 0) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(x1, dy, 1, h, x1, dy);
|
||||
@@ -157,7 +152,7 @@ static int eCopyArea5(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
static int hx[16]={ 0,32,16,48, 0,32,16,48,16,48, 0,32,16,48, 0,32};
|
||||
static int hy[16]={ 0, 0,16,16,32,32,48,48, 0, 0,16,16,32,32,48,48};
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 16; i++) {
|
||||
cnt += waitcnt;
|
||||
for (y = 0; y < (h -63); y += 64) {
|
||||
@@ -178,7 +173,7 @@ static int eCopyArea6(int dx, int dy, int w, int h, int opt) {
|
||||
int i, x, y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 7; i++) {
|
||||
cnt += waitcnt;
|
||||
for (x = 0; x < (w -63); x += 64) {
|
||||
@@ -200,7 +195,7 @@ static int eCopyArea7(int dx, int dy, int w, int h, int opt) {
|
||||
int i, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < (w/2 - E7_8X+1); i+=E7_8X) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy+i*h/w, w, E7_8X*h/w, dx, dy+i*h/w);
|
||||
@@ -217,7 +212,7 @@ static int eCopyArea8(int dx, int dy, int w, int h, int opt) {
|
||||
int i, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = E7_8X; i < (w/2 -E7_8X+1); i+=E7_8X) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx+ w/2 - i , dy + h/2 - i*h/w, 2*i, 2*i*h/w ,dx+ w/2-i, dy + h/2 - i*h/w);
|
||||
@@ -234,7 +229,7 @@ static int eCopyArea9(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
static int hintY[4] = {0,8,8,0};
|
||||
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 4; i++) {
|
||||
cnt+=waitcnt;
|
||||
for (y = 0; y < h -15; y+=16) {
|
||||
@@ -271,7 +266,7 @@ static int eCopyArea11(int dx, int dy, int w, int h, int opt) {
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
#define ECA11_SLICE 16
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i+1, ECA11_SLICE); j++) {
|
||||
@@ -290,7 +285,7 @@ static int eCopyArea12(int dx, int dy, int w, int h, int opt) {
|
||||
int x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (x = 0; x < (w -7); x += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy);
|
||||
@@ -304,7 +299,7 @@ static int eCopyArea13(int dx, int dy, int w, int h, int opt) {
|
||||
int x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (x = (w -8); x > 8; x -= 8) {
|
||||
cnt +=waitcnt;
|
||||
eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy);
|
||||
@@ -318,7 +313,7 @@ static int eCopyArea14(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = 0; y < (h -7); y += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy + y, w, 8, dx, dy + y);
|
||||
@@ -332,7 +327,7 @@ static int eCopyArea15(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 20 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = (h -8); y > 8; y -= 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy + y, w, 8, dx, dy + y);
|
||||
@@ -346,7 +341,7 @@ static int eCopyArea16(int dx, int dy, int w, int h, int opt) {
|
||||
int i, x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 8; i++) {
|
||||
cnt += waitcnt;
|
||||
for (x = 0; x < (w -15); x += 16) {
|
||||
@@ -364,7 +359,7 @@ static int eCopyArea17(int dx, int dy, int w, int h, int opt) {
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
#define E17X 18
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < E17X; i++) {
|
||||
cnt += waitcnt;
|
||||
for (y = 0; y < (h - E17X + 1); y += E17X) {
|
||||
@@ -380,7 +375,7 @@ static int eCopyArea18(int dx, int dy, int w, int h, int opt) {
|
||||
int x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (x = 0; x < (w/2 -7); x += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx + w/2 - x - 8, dy, 8, h, dx + w/2 - x - 8, dy);
|
||||
@@ -395,7 +390,7 @@ static int eCopyArea19(int dx, int dy, int w, int h, int opt) {
|
||||
int x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (x = 0; x < (w/2 -7); x += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx + x, dy, 8, h, dx + x, dy);
|
||||
@@ -410,7 +405,7 @@ static int eCopyArea20(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = 0; y < (h/2 -7); y += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy + h/2 - y - 8, w, 8, dx, dy + h/2 - y - 8);
|
||||
@@ -425,7 +420,7 @@ static int eCopyArea21(int dx, int dy, int w, int h, int opt) {
|
||||
int y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 30 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (y = 0; y < (h/2 -7); y += 8) {
|
||||
cnt += waitcnt;
|
||||
eCopyUpdateArea(dx, dy + y , w, 8, dx, dy + y);
|
||||
@@ -440,7 +435,7 @@ static int eCopyArea22(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
int i, x, y, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 80 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 2; i++) {
|
||||
cnt += waitcnt;
|
||||
for (y = 0; y < (h -3); y+=4) {
|
||||
@@ -465,7 +460,7 @@ static int eCopyArea23(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
static int hintX[4] = {0,2,2,0};
|
||||
static int hintY[4] = {0,2,0,2};
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 4; i++) {
|
||||
cnt += waitcnt;
|
||||
for (y = 0; y < (h -3); y+=4) {
|
||||
@@ -487,7 +482,7 @@ static int eCopyArea24(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
int waitcnt = opt == 0 ? 100 : opt;
|
||||
static int slices[8]={80,70,60,48,32,16,8,4};
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < 8; i++ ) {
|
||||
cnt += waitcnt;
|
||||
sdl_Mosaic(sx, sy, w, h, dx, dy, slices[i]);
|
||||
@@ -506,7 +501,7 @@ static int eCopyArea25(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
int w2=w/2,h2=h/2,h1=h-1,mr=(int)(sqrt(w2*w2+h2*h2));
|
||||
int ux=0,uy=0,ux_y=h2-1,uw,uh;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (r = SCA25_6_SLICE; r < mr; r += SCA25_6_SLICE ) {
|
||||
cnt += waitcnt;
|
||||
rr=r*r;
|
||||
@@ -549,7 +544,7 @@ static int eCopyArea26(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
int w2=w/2,w1=w-1,h2=h/2,h1=h-1,mr=(int)(sqrt(w2*w2+h2*h2));
|
||||
int ux=0,uy=0,ux_y=0,uw,uh;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (r = mr - SCA25_6_SLICE; r > 0; r -= SCA25_6_SLICE) {
|
||||
cnt += waitcnt;
|
||||
rr=r*r;
|
||||
@@ -687,7 +682,7 @@ static int eCopyArea33(int dx, int dy, int w, int h, int opt) {
|
||||
int i, j, y, key = 0, cnt,dyy=dy+h-1;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i+1, ECA11_SLICE); j++) {
|
||||
@@ -706,7 +701,7 @@ static int eCopyArea34(int dx, int dy, int w, int h, int opt) {
|
||||
int i, j, y, key = 0, cnt,dyy=dy+h-1,h2=h/2;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA11_SLICE + h / ECA11_SLICE/2 -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i+1, ECA11_SLICE); j++) {
|
||||
@@ -880,7 +875,7 @@ static int eCopyArea39(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
dy2 = dy+h-1;
|
||||
sy1 = sy;
|
||||
sy2 = sy+h-1;
|
||||
cnt=get_ecounter();
|
||||
cnt=sdl_getTicks();
|
||||
for (i = 0; i < h2; i++) {
|
||||
cnt+=waitcnt;
|
||||
ags_copyArea_alphaBlend(sx, sy1, w, 1, dx, dy1, 128);
|
||||
@@ -924,7 +919,7 @@ static int eCopyArea40(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
dx2 = dx+w-1;
|
||||
sx1 = sx;
|
||||
sx2 = sx+w-1;
|
||||
cnt=get_ecounter();
|
||||
cnt=sdl_getTicks();
|
||||
for (i = 0; i < w2; i++) {
|
||||
cnt+=waitcnt;
|
||||
ags_copyArea_alphaBlend(sx1, sy, 1, h, dx1, dy, 128);
|
||||
@@ -1100,7 +1095,7 @@ static int eCopyArea48(int dx, int dy, int w, int h, int opt) {
|
||||
int i, j, x, key = 0, cnt;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA11_SLICE + w / ECA11_SLICE -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i+1, ECA11_SLICE); j++) {
|
||||
@@ -1119,7 +1114,7 @@ static int eCopyArea49(int dx, int dy, int w, int h, int opt) {
|
||||
int i, j, x, key = 0, cnt, dxx = dx + w - 1;
|
||||
int waitcnt = opt == 0 ? 40 : opt;
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
for (i = 0; i < ECA11_SLICE + w / ECA11_SLICE -1; i++) {
|
||||
cnt += waitcnt;
|
||||
for (j = 0; j < min(i+1, ECA11_SLICE); j++) {
|
||||
@@ -1180,7 +1175,7 @@ static int eCopyArea5sp(int sx, int sy, int w, int h, int dx, int dy, int opt) {
|
||||
step[i] = 50 * sin((2 * M_PI * i) / 50);
|
||||
}
|
||||
|
||||
cnt = get_ecounter();
|
||||
cnt = sdl_getTicks();
|
||||
|
||||
for (i = 150; i < h + 200; i++) {
|
||||
cnt += waitcnt;
|
||||
|
||||
-126
@@ -33,10 +33,6 @@
|
||||
#include "alpha_plane.h"
|
||||
#include "ags.h"
|
||||
|
||||
/* fader */
|
||||
static const int fadeX[16] = {0,2,2,0,1,3,3,1,1,3,3,1,0,2,2,0};
|
||||
static const int fadeY[16] = {0,2,0,2,1,3,1,3,0,2,0,2,1,3,1,3};
|
||||
|
||||
static void (*copy_from_alpha)(agsurface_t *, BYTE *, BYTE *, int, int, ALPHA_DIB_COPY_TYPE);
|
||||
static void (*copy_to_alpha)(agsurface_t *, BYTE *, BYTE *, int, int, ALPHA_DIB_COPY_TYPE);
|
||||
|
||||
@@ -44,33 +40,6 @@ static void (*copy_to_alpha)(agsurface_t *, BYTE *, BYTE *, int, int, ALPHA_DIB_
|
||||
/* private methods image操作 16bpp */
|
||||
/******************************************************************************/
|
||||
|
||||
static void fadeOut16(SDL_Surface *dst, int lv, int col) {
|
||||
WORD *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < dst->h; y += 4) {
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < dst->w; x += 4) {
|
||||
*(yld + fadeX[lv]) = col;
|
||||
yld += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fadeIn16(SDL_Surface *src, SDL_Surface *dst, int lv) {
|
||||
WORD *yls, *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < src->h; y += 4) {
|
||||
yls = PIXEL_AT(src, 0, y + fadeY[lv]);
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < src->w; x += 4) {
|
||||
*(yld + fadeX[lv]) = *(yls + fadeX[lv]);
|
||||
yls += 4; yld += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void image_copy_from_alpha16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) {
|
||||
int x, y;
|
||||
BYTE *yls;
|
||||
@@ -193,73 +162,10 @@ static void image_copy_to_alpha16(agsurface_t *dib, BYTE *sdata, BYTE *ddata, in
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* private methods image操作 packed 24bpp */
|
||||
/******************************************************************************/
|
||||
|
||||
static void fadeOut24p(SDL_Surface *dst, int lv, int col) {
|
||||
BYTE *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < dst->h; y += 4) {
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < dst->w; x += 4) {
|
||||
*(yld + fadeX[lv]) =
|
||||
*(yld + fadeX[lv] +1) =
|
||||
*(yld + fadeX[lv] +2) = (BYTE)col;
|
||||
yld += (4*3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fadeIn24p(SDL_Surface *src, SDL_Surface *dst, int lv) {
|
||||
DWORD *yls;
|
||||
BYTE *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < src->h; y += 4) {
|
||||
yls = PIXEL_AT(src, 0, y + fadeY[lv]);
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < src->w; x += 4) {
|
||||
*(yld + fadeX[lv] ) = PIXB24(*(yls + fadeX[lv]));
|
||||
*(yld + fadeX[lv] +1) = PIXG24(*(yls + fadeX[lv]));
|
||||
*(yld + fadeX[lv] +2) = PIXR24(*(yls + fadeX[lv]));
|
||||
yls += 4; yld += (4*3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* private methods image操作 24/32bpp */
|
||||
/******************************************************************************/
|
||||
|
||||
static void fadeOut24(SDL_Surface *dst, int lv, int col) {
|
||||
DWORD *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < dst->h; y += 4) {
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < dst->w; x += 4) {
|
||||
*(yld + fadeX[lv]) = col;
|
||||
yld += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void fadeIn24(SDL_Surface *src, SDL_Surface *dst, int lv) {
|
||||
DWORD *yls, *yld;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < src->h; y += 4) {
|
||||
yls = PIXEL_AT(src, 0, y + fadeY[lv]);
|
||||
yld = PIXEL_AT(dst, 0, y + fadeY[lv]);
|
||||
for (x = 0; x < src->w; x += 4) {
|
||||
*(yld + fadeX[lv]) = *(yls + fadeX[lv]);
|
||||
yls += 4; yld += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void image_copy_from_alpha24(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) {
|
||||
int x, y;
|
||||
BYTE *yls;
|
||||
@@ -405,38 +311,6 @@ void image_setdepth(int depth) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fade out for 16/24/32
|
||||
*/
|
||||
void image_fadeOut(SDL_Surface *img, int lv, int col) {
|
||||
switch(img->format->BytesPerPixel) {
|
||||
case 2:
|
||||
fadeOut16(img, lv, col); break;
|
||||
case 3:
|
||||
fadeOut24p(img, lv, col); break;
|
||||
case 4:
|
||||
fadeOut24(img, lv, col); break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fade in for 16/24/32
|
||||
*/
|
||||
void image_fadeIn(SDL_Surface *src, SDL_Surface *dst, int lv) {
|
||||
switch(dst->format->BytesPerPixel) {
|
||||
case 2:
|
||||
fadeIn16(src, dst, lv); break;
|
||||
case 3:
|
||||
fadeIn24p(src, dst, lv); break;
|
||||
case 4:
|
||||
fadeIn24(src, dst, lv); break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void image_copy_from_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag) {
|
||||
BYTE *sdata = GETOFFSET_ALPHA(dib, sx, sy);
|
||||
BYTE *ddata = GETOFFSET_PIXEL(dib, dx, dy);
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "ags.h"
|
||||
|
||||
extern void image_setdepth(int);
|
||||
extern void image_fadeOut(SDL_Surface *img, int lv, int col);
|
||||
extern void image_fadeIn(SDL_Surface *src, SDL_Surface *dst, int lv);
|
||||
extern void image_copy_from_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag);
|
||||
extern void image_copy_to_alpha(agsurface_t *dib, int sx, int sy, int w, int h, int dx, int dy, ALPHA_DIB_COPY_TYPE flag);
|
||||
extern void image_Mosaic(SDL_Surface *dib, int sx, int sy, int w, int h, int dx, int dy, int slice);
|
||||
|
||||
+2
-3
@@ -26,7 +26,6 @@
|
||||
#include "config.h"
|
||||
#include "input.h"
|
||||
#include "sdl_core.h"
|
||||
#include "counter.h"
|
||||
#include "xsystem35.h"
|
||||
#include "message.h"
|
||||
#include "texthook.h"
|
||||
@@ -92,9 +91,9 @@ int sys_keywait(int msec, unsigned flags) {
|
||||
}
|
||||
|
||||
int key=0, n;
|
||||
int end = msec == INT_MAX ? INT_MAX : get_high_counter(SYSTEMCOUNTER_MSEC) + msec;
|
||||
int end = msec == INT_MAX ? INT_MAX : sdl_getTicks() + msec;
|
||||
while (!((flags & KEYWAIT_SKIPPABLE) && msgskip_isSkipping()) &&
|
||||
(n = end - get_high_counter(SYSTEMCOUNTER_MSEC)) > 0) {
|
||||
(n = end - sdl_getTicks()) > 0) {
|
||||
if (n <= 16)
|
||||
sdl_sleep(n);
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user