Compare commits

..
57 Commits
Author SHA1 Message Date
kichikuou 70a940b216 Version 2.8.0 2023-02-12 09:33:29 +09:00
kichikuou db2bb03fdd Add -help description for -game option 2023-02-12 09:12:09 +09:00
kichikuou 5ef949ae14 Refactor ags_setWindowTitle() 2023-02-11 21:40:14 +09:00
kichikuou 043028cf7d Update game_compatibility.md 2023-02-11 16:18:09 +09:00
kichikuou eace5d1dbd Refactor game-specific hacks, add -game option
It's now possible to enable certain game-specific hacks by using the
`-game` command line option or the `game` property in the .xsys35rc
file.
2023-02-11 15:27:38 +09:00
kichikuou 878bea69d6 Add a test for stack commands 2023-02-10 21:30:02 +09:00
kichikuou ae8becc4a3 Fix menuReturnGoto when stack top is not a return address 2023-02-10 21:24:13 +09:00
kichikuou 1d863cfb2e Implement UR command 2023-02-10 20:56:53 +09:00
kichikuou 7bb2bee693 Label return should pop TPx 2023-02-10 20:56:53 +09:00
kichikuou 47e7f5542e Remove sl_retFar2
In System39.exe `%0` drops stack frames for label calls (Rance4 v2
relies on this behavior), so it's the same as `UD 1`.
2023-02-10 20:56:53 +09:00
kichikuou 8087d11b2b Fix UC command
* UC0 should restore values pushed by US/TPx
* UC1 should stop when the stack top is a page call
* UC1/2 should restore status pushes by TPx
* UC1/2 should not consume the count for non-call stack frames
* Add support for UC3 command
2023-02-10 20:56:53 +09:00
kichikuou 4f1521ac90 TOx commands are no-op if the stack top is of an unexpected type 2023-02-10 20:56:53 +09:00
kichikuou 99632397da Enable the hack in Rance4v2 recompiled with System3.9
The System3.9 compiler compiles `MT` command to `0x2F28`, so the hack
must be enabled in commands2F28().

Fixes https://github.com/kichikuou/xsystem35-sdl2/issues/36.
2023-02-10 20:50:12 +09:00
kichikuou 59283815d8 Properly implement Y 1900 command
It is the same as patchEC, but can be used in SCO files less than
version 390.
2023-02-08 10:43:06 +09:00
kichikuou a32c901eb8 Tweak the Rance4v2 hack
This fixes https://github.com/kichikuou/xsystem35-sdl2/issues/35.
2023-02-08 10:15:06 +09:00
kichikuou 03b84b8ba7 Make UR command safer
It's still unimplemented, but clears the output variables for safety.
2023-02-07 22:12:35 +09:00
kichikuou 720da4e42c Fix UC1 command 2023-02-07 22:05:00 +09:00
kichikuou c4dc799c94 Change the condition for applying Rance4v2 hack
Now it's determined by the MT command argument.
2023-02-07 21:31:03 +09:00
kichikuou ce271ae5eb Fix CG positioning issue in Rance 4.x (TOTO port)
G command should reset the effect of J0/J1, even if pixel extraction is
disabled by PC command.
2023-02-05 18:37:50 +09:00
kichikuou 526e5f8709 Fix VSP palette issue
This fixes a palette problem when drawing a VSP image on a non-8-bit
surface after executing `ZC 0` command.

cg->vsp_bank can be overridden by the `ZC 0` command.
2023-02-05 18:08:41 +09:00
kichikuou c967e63be9 Version 2.7.0 2023-01-28 16:22:24 +09:00
kichikuou d4a32aee17 Update game_compatibility.md 2023-01-28 16:13:25 +09:00
kichikuou 1191723612 Update emscripten to 3.1.27 2023-01-28 14:30:45 +09:00
kichikuou addf2e3728 Add BGM support for Rance4 v2
In Rance4 v2, `SS n` command plays the audio file n+999 stored in
WB.ald. Support this by reusing the CD->BGM bridge.
2023-01-28 14:24:26 +09:00
kichikuou 4785c8c77c Add cdrom.bgm.c and use it when DRIFILE_BGM exists
This enables BGM playback in the download edition of Daiakuji, where S*
commands are plumbed to the music system (*BA.ald).
2023-01-28 13:06:38 +09:00
kichikuou b1ac106057 Refactor bgm abstructions 2023-01-28 12:51:38 +09:00
kichikuou acdc40ec60 Refactor cdrom abstructions 2023-01-28 12:51:34 +09:00
kichikuou d9f635a6d0 Implement SV command 2023-01-28 09:53:44 +09:00
kichikuou e8357c4e6f Add a hack to improve map navigation of Rance4 v2 2023-01-28 09:53:41 +09:00
kichikuou 8e44a87069 Support Y1003 command
Used in Rance4 ver2.05. Similar to Y3, but waits for key release.
2023-01-26 21:44:29 +09:00
kichikuou d1befbd355 Add stub for SV command
Used in Rance4 ver2.05.
2023-01-26 18:35:55 +09:00
kichikuou ec0bae5490 Inline LittleEndian functions
Using memcpy(). Compilers are smart enough to eliminate memcpy()
completely.
2023-01-21 17:22:24 +09:00
kichikuou f5b3b1a936 Support ShSound module on WASM 2023-01-21 16:40:26 +09:00
kichikuou 1b546e3bab Update README.md 2023-01-15 13:52:00 +09:00
kichikuou d454899048 Add game compatibility table 2023-01-15 13:39:07 +09:00
kichikuou 7aa704b3f4 midi_sdlmixer: Check playing status in midi_get_playing_info()
This fixes an infinite loop in Buroburo waiting for MIDI playback to
finish.
2023-01-15 13:07:51 +09:00
kichikuou 50d7d7ee33 Fix handling of multi-volume ALD with inconsistent indexes
When contents of the index table differ between ALD files, System3.x
uses information from the file containing the entry.

For example, if link_table[k] in SA.ALD is { file_nr = 2, ptr_no = 10 }
and link_table[k] in SB.ALD is { file_nr = 2, ptr_no = 11 }, the entry
body is in SB.ALD, so ptr_no = 11 should be used.

CA_G*.ALD of Child Assassin has this issue.
2023-01-15 12:42:38 +09:00
kichikuou 586a9c855e Implement LXX 5 command
Used in Child Assassin.
2023-01-14 16:13:57 +09:00
kichikuou 9600e34229 Android: Upgrade AGP to 7.3.1 2023-01-08 13:35:51 +09:00
kichikuou 001c97ea00 Android: Include git revision in version string 2023-01-08 13:20:23 +09:00
kichikuou b100dbe26c Android CI: Generate signed apk 2023-01-08 13:19:01 +09:00
kichikuou 55e38f9db2 Android: Add activities to display open source notices 2023-01-06 14:21:32 +09:00
kichikuou ddf6fba393 Version 2.6.0 2023-01-01 15:23:29 +09:00
kichikuou 83fa5db82c Windows: Add a menu command to control automatic mouse movement 2022-12-29 21:57:53 +09:00
kichikuou 1807cf0c26 Android: Update SDL2 and companion libraries
- SDL 2.26.1
- SDL_ttf 2.20.1
- SDL_mixer 2.6.2
2022-12-29 14:24:20 +09:00
kichikuou 5906079d3f Windows CI: Use latest msys2 packages 2022-12-29 14:24:09 +09:00
kichikuou 7fba19fe18 New way to simulate right-clicks on touch devices
As with xsystem4-android, now touches outside the game's viewport are
treated as right-clicks,

The old method (two-finger touch) still works.
2022-12-29 14:23:43 +09:00
kichikuou 8de86e276d CI: Update GH actions 2022-11-26 16:47:29 +09:00
kichikuou 64a5f47258 Android: Use SDK-bundled CMake 3.22.1 2022-10-29 11:05:37 +09:00
kichikuou 29a139c8a1 Use the standard integer types
This replaces BYTE, WORD and DWORD types with uint8_t, uint16_t and
uint32_t respectively.
2022-10-29 09:34:21 +09:00
kichikuou b53c82e072 Replace debug printf() calls with WARNING() 2022-09-08 21:19:19 +09:00
kichikuou 307bb2623b Remove SDL_LockSurface() calls
It shouldn't be needed.
2022-09-04 22:26:58 +09:00
kichikuou d1712ab7b4 Remove newline character from debug print macro calls
Now "\n" is appended by the macros.
2022-09-02 20:37:26 +09:00
kichikuou 7c24ba276d Emscripten: Add nact_current_page() and nact_current_addr() 2022-08-28 09:25:03 +09:00
kichikuou c8f9880efb Fix buffer overrun in LE/QE command 2022-08-28 08:43:18 +09:00
kichikuou d508676c70 Refactoring: Introduce getCaliArray()
This replaces global preVar{No,Page,Index} variables.
2022-08-27 16:11:36 +09:00
kichikuou 92506d6a94 Refactor variable page management code
Now system variables can be accessed via varPage[0].
2022-08-27 13:22:27 +09:00
233 changed files with 4154 additions and 4090 deletions
+9 -4
View File
@@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Deps
run: sudo apt install ninja-build
@@ -14,10 +14,15 @@ jobs:
- name: Build
run: |
cd android
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > keystore.jks
ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle ./gradlew assembleRelease
env:
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: xsystem35-release-unsigned-apk
path: android/app/build/outputs/apk/release/app-release-unsigned.apk
name: xsystem35-apk
path: android/app/build/outputs/apk/release/app-release.apk
+5 -5
View File
@@ -2,7 +2,7 @@ name: Emscripten Build
on: [push, pull_request]
env:
EM_VERSION: 3.1.15
EM_VERSION: 3.1.27
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
@@ -10,17 +10,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}
- name: Setup Emscripten toolchain
uses: mymindstorm/setup-emsdk@v10
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
@@ -35,7 +35,7 @@ jobs:
mv src/xsystem35.* xsystem35/
- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: xsystem35-wasm
path: out/wasm/xsystem35
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
name: Linux ${{ matrix.build-type }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Deps
run: |
+3 -2
View File
@@ -19,6 +19,7 @@ jobs:
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
pacboy: >-
gcc:p
cmake:p
@@ -32,7 +33,7 @@ jobs:
ntldd-git:p
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
@@ -50,7 +51,7 @@ jobs:
run: ./make-installer.sh ../../out/release ${{ matrix.installer }}.nsi
- name: Upload
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.installer }}
path: tools/installer/${{ matrix.installer }}.exe
+2
View File
@@ -2,7 +2,9 @@ out
android/.gradle
android/app/.externalNativeBuild
android/app/build
android/app/src/main/assets
android/build
android/keystore.jks
.ccls-cache
.dir-locals.el
compile_commands.json
+1
View File
@@ -110,6 +110,7 @@ endif()
# CDROM
list(APPEND SRC_CDROM cdrom.bgm.c)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND SRC_CDROM cdrom.Linux.c)
list(APPEND SUMMARY_CDROM "Linux ioctl")
+5
View File
@@ -3,6 +3,11 @@
This is a multi-platform port of `xsystem35`, a free implementation of
AliceSoft's System 3.x game engine.
## Compatiblity
See the [game compatibility table](game_compatibility.md) for a list of games
that can be played on xsystem35-sdl2.
## Unique Features
In addition to the original System 3.x's functionalities, xsystem35-sdl2 has
+4 -6
View File
@@ -5,7 +5,6 @@ Prebuilt APKs are [here](https://github.com/kichikuou/xsystem35-sdl2/releases).
## Build
Prerequisites:
- CMake >=3.20
- Android SDK >=28
- Android NDK >=r15c
@@ -19,16 +18,15 @@ Example build instructions (for Debian bullseye):
```sh
# Install necessary packages
sudo apt install git wget unzip default-jdk-headless ninja-build
sudo apt install -t bullseye-backports cmake
# Install Android SDK / NDK
export ANDROID_SDK_ROOT=$HOME/android-sdk
mkdir -p $ANDROID_SDK_ROOT/cmdline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip
unzip commandlinetools-linux-7583922_latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
unzip commandlinetools-linux-8512546_latest.zip -d $ANDROID_SDK_ROOT/cmdline-tools
mv $ANDROID_SDK_ROOT/cmdline-tools/cmdline-tools $ANDROID_SDK_ROOT/cmdline-tools/tools
yes |$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager --licenses
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager ndk-bundle
$ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager ndk-bundle 'cmake;3.22.1'
export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle
# Check out and build xsystem35
@@ -42,7 +40,7 @@ cd xsystem35-sdl2/android
1. Create a ZIP file containing all the game files and BGM files (see [below](#preparing-a-zip) for details), and transfer it to your device.
2. Open the app. A list of installed games is displayed. Since nothing has been installed yet, only the "Install from ZIP" button is displayed. Tap it.
3. Select the ZIP file you created in 1.
4. The game starts. Two-finger touch is treated as a right click.
4. The game starts. To simulate right-click, tap the black bars on the left/right or top/bottom of the screen.
### Preparing a ZIP
- Include all files in the `GAMEDATA` folder (`.ALD` files and others). `.EXE` and `.DLL` are not really needed, but you can include them as well.
+18 -8
View File
@@ -16,8 +16,8 @@ android {
}
minSdkVersion 19
targetSdkVersion 31
versionCode 10
versionName "2.5.1"
versionCode 13
versionName "2.8.0" + gitRevision()
externalNativeBuild {
cmake {
arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
@@ -26,16 +26,28 @@ android {
}
}
}
signingConfigs {
release {
storeFile rootProject.file('keystore.jks')
storePassword System.getenv('KEYSTORE_PASSWORD')
keyAlias System.getenv('KEY_ALIAS')
keyPassword System.getenv('KEY_PASSWORD')
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
applicationVariants.all { variant ->
tasks["merge${variant.name.capitalize()}Assets"]
.dependsOn("externalNativeBuild${variant.name.capitalize()}")
}
if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
sourceSets.main {
jniLibs.srcDir 'libs'
assets.srcDir '../../fonts'
}
aaptOptions {
// Disable asset compression for fonts.
@@ -44,9 +56,7 @@ android {
}
externalNativeBuild {
cmake {
// xsystem35 requires CMake >=3.13, so SDK-bundled CMake
// (3.6 or 3.10.2) cannot be used.
version getInstalledCmakeVersion()
version '3.22.1'
path 'jni/CMakeLists.txt'
}
}
@@ -74,6 +84,6 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
static String getInstalledCmakeVersion() {
('cmake --version'.execute().text =~ /cmake version ([0-9.]+)/)[0][1]
static String gitRevision() {
' (git ' + "git rev-parse --short HEAD".execute().text.trim() + ')'
}
+31 -12
View File
@@ -1,22 +1,23 @@
cmake_minimum_required(VERSION 3.13)
project(GAME)
set(PROJECT_ROOT_DIR ../../..)
include(FetchContent)
FetchContent_Declare(
SDL
URL https://libsdl.org/release/SDL2-2.0.20.tar.gz
URL_HASH SHA1=18ce006cbf07502f48abfedc088c14404091f3d3
URL https://github.com/libsdl-org/SDL/releases/download/release-2.26.1/SDL2-2.26.1.tar.gz
URL_HASH SHA1=08a8cec21ffcebf44e4633a786d594a7811100d2
)
FetchContent_Declare(
SDL_ttf
URL https://github.com/libsdl-org/SDL_ttf/archive/refs/tags/release-2.0.18.tar.gz
URL_HASH SHA1=6fc5130757b447d46c3da6abd58687e8576de8b8
URL https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1.tar.gz
URL_HASH SHA1=f774ff407915ae4afa3d03e5a9395283d9090f28
)
FetchContent_Declare(
SDL_mixer
URL https://github.com/libsdl-org/SDL_mixer/archive/refs/tags/release-2.6.0.tar.gz
URL_HASH SHA1=a2aef03d74ac3dd9cd0004cff1834602a5dafa66
URL https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.2/SDL2_mixer-2.6.2.tar.gz
URL_HASH SHA1=036fc7839a6b8dc1af3dbfed4e2531224bbacdd7
)
# Compilation of SDL and companion libraries
@@ -28,18 +29,36 @@ endif()
FetchContent_GetProperties(SDL_ttf)
if(NOT sdl_ttf_POPULATED)
FetchContent_Populate(SDL_ttf)
set(SDL2TTF_SAMPLES OFF CACHE BOOL "Build the SDL2_ttf sample program(s)" FORCE)
set(SDL2TTF_INSTALL OFF CACHE BOOL "Enable SDL2_ttf install target" FORCE)
set(SDL2TTF_VENDORED ON CACHE BOOL "Use vendored third-party libraries" FORCE)
add_subdirectory(${sdl_ttf_SOURCE_DIR} ${sdl_ttf_BINARY_DIR})
endif()
FetchContent_GetProperties(SDL_mixer)
if(NOT sdl_mixer_POPULATED)
FetchContent_Populate(SDL_mixer)
SET(SDL2MIXER_OPUS OFF CACHE BOOL "Enable Opus music" FORCE)
SET(SDL2MIXER_FLAC OFF CACHE BOOL "Enable FLAC music" FORCE)
SET(SDL2MIXER_MOD OFF CACHE BOOL "Support loading MOD music" FORCE)
SET(SDL2MIXER_MIDI OFF CACHE BOOL "Enable MIDI music" FORCE)
SET(SDL2MIXER_SAMPLES OFF CACHE BOOL "Build the SDL2_mixer sample program(s)" FORCE)
set(SDL2MIXER_OPUS OFF CACHE BOOL "Enable Opus music" FORCE)
set(SDL2MIXER_FLAC OFF CACHE BOOL "Enable FLAC music" FORCE)
set(SDL2MIXER_MOD OFF CACHE BOOL "Support loading MOD music" FORCE)
set(SDL2MIXER_MIDI OFF CACHE BOOL "Enable MIDI music" FORCE)
set(SDL2MIXER_SAMPLES OFF CACHE BOOL "Build the SDL2_mixer sample program(s)" FORCE)
set(SDL2MIXER_INSTALL OFF CACHE BOOL "Enable SDL2_mixer install target" FORCE)
add_subdirectory(${sdl_mixer_SOURCE_DIR} ${sdl_mixer_BINARY_DIR})
endif()
# The main CMakeLists.txt of xsystem35
add_subdirectory(../../.. xsystem35)
add_subdirectory(${PROJECT_ROOT_DIR} xsystem35)
# Copy asset files
set(ASSETS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src/main/assets)
file(MAKE_DIRECTORY ${ASSETS_DIR}/licenses)
file(COPY_FILE ${PROJECT_ROOT_DIR}/fonts/MTLc3m.ttf ${ASSETS_DIR}/MTLc3m.ttf)
file(COPY_FILE ${PROJECT_ROOT_DIR}/fonts/mincho.otf ${ASSETS_DIR}/mincho.otf)
file(COPY_FILE ${PROJECT_ROOT_DIR}/COPYING ${ASSETS_DIR}/licenses/xsystem35)
file(COPY_FILE ${PROJECT_ROOT_DIR}/fonts/MTLc3m.ttf.license ${ASSETS_DIR}/licenses/MTLc3m)
file(COPY_FILE ${PROJECT_ROOT_DIR}/fonts/mincho.otf.license ${ASSETS_DIR}/licenses/mincho)
file(COPY_FILE ${sdl_SOURCE_DIR}/LICENSE.txt ${ASSETS_DIR}/licenses/SDL)
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/LICENSE.txt ${ASSETS_DIR}/licenses/SDL_ttf)
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/external/freetype/docs/GPLv2.TXT ${ASSETS_DIR}/licenses/freetype)
file(COPY_FILE ${sdl_ttf_SOURCE_DIR}/external/harfbuzz/COPYING ${ASSETS_DIR}/licenses/harfbuzz)
file(COPY_FILE ${sdl_mixer_SOURCE_DIR}/LICENSE.txt ${ASSETS_DIR}/licenses/SDL_mixer)
+1 -1
View File
@@ -13,6 +13,6 @@ LOCAL_SRC_FILES := YourSourceHere.c
LOCAL_SHARED_LIBRARIES := SDL2
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid
include $(BUILD_SHARED_LIBRARY)
+11
View File
@@ -94,6 +94,17 @@
</intent-filter>
-->
</activity>
<activity android:name=".LicensesMenuActivity"
android:label="@string/action_licenses"
android:parentActivityName=".LauncherActivity"
android:exported="false">
</activity>
<activity android:name=".LicensesActivity"
android:parentActivityName=".LicensesMenuActivity"
android:exported="false">
</activity>
</application>
</manifest>
@@ -106,6 +106,11 @@ class LauncherActivity : Activity(), LauncherObserver {
SAVEDATA_IMPORT_REQUEST)
true
}
R.id.licenses -> {
val intent = Intent(this, LicensesMenuActivity::class.java)
startActivity(intent)
true
}
else -> super.onOptionsItemSelected(item)
}
}
@@ -0,0 +1,23 @@
package io.github.kichikuou.xsystem35
import android.app.Activity
import android.os.Bundle
import android.widget.TextView
import java.io.BufferedReader
class LicensesActivity : Activity() {
companion object {
const val EXTRA_DISPLAY_NAME = "DISPLAY_NAME"
const val EXTRA_FILE_NAME = "FILE_NAME"
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_licenses)
actionBar?.title = intent.getStringExtra(EXTRA_DISPLAY_NAME)
val path = "licenses/" + intent.getStringExtra(EXTRA_FILE_NAME)
val text = assets.open(path).bufferedReader().use(BufferedReader::readText)
findViewById<TextView>(R.id.license_text).text = text
}
}
@@ -0,0 +1,38 @@
package io.github.kichikuou.xsystem35
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.widget.ListView
import android.widget.SimpleAdapter
class LicensesMenuActivity : Activity() {
class Entry(val displayName: String, val fileName: String, val url: String)
private val entries: ArrayList<Entry> = arrayListOf(
Entry("xsystem35-sdl2", "xsystem35", "https://github.com/kichikuou/xsystem35-sdl2"),
Entry("SDL", "SDL", "https://www.libsdl.org/"),
Entry("SDL_mixer", "SDL_mixer", "https://github.com/libsdl-org/SDL_mixer"),
Entry("SDL_ttf", "SDL_ttf", "https://github.com/libsdl-org/SDL_ttf"),
Entry("FreeType", "freetype", "https://freetype.org/"),
Entry("HarfBuzz", "harfbuzz", "https://harfbuzz.github.io/"),
Entry("MotoyaLCedar W3 mono", "MTLc3m", "https://github.com/aosp-mirror/platform_frameworks_base/tree/lollipop-release/data/fonts"),
Entry("Source Han Serif", "mincho", "https://github.com/adobe-fonts/source-han-serif/"),
)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_licenses_menu)
val items = entries.map { mapOf("name" to it.displayName, "url" to it.url)}
val listView = findViewById<ListView>(R.id.list)
listView.adapter = SimpleAdapter(this, items, android.R.layout.simple_list_item_2,
arrayOf("name", "url"), intArrayOf(android.R.id.text1, android.R.id.text2))
listView.setOnItemClickListener { _, _, pos, _ ->
val intent = Intent(this, LicensesActivity::class.java).apply {
putExtra(LicensesActivity.EXTRA_DISPLAY_NAME, entries[pos].displayName)
putExtra(LicensesActivity.EXTRA_FILE_NAME, entries[pos].fileName)
}
startActivity(intent)
}
}
}
@@ -248,7 +248,9 @@ public class HIDDeviceManager {
0x1689, // Razer Onza
0x1949, // Lab126, Inc.
0x1bad, // Harmonix
0x20d6, // PowerA
0x24c6, // PowerA
0x2c22, // Qanba
};
if (usbInterface.getInterfaceClass() == UsbConstants.USB_CLASS_VENDOR_SPEC &&
@@ -274,7 +276,9 @@ public class HIDDeviceManager {
0x0e6f, // PDP
0x0f0d, // Hori
0x1532, // Razer Wildcat
0x20d6, // PowerA
0x24c6, // PowerA
0x2dc8, /* 8BitDo */
0x2e24, // Hyperkin
};
@@ -15,19 +15,17 @@ import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.InputType;
import android.text.Selection;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.SparseArray;
@@ -35,11 +33,8 @@ import android.view.Display;
import android.view.Gravity;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.PointerIcon;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
@@ -49,6 +44,7 @@ import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -63,6 +59,115 @@ import java.util.Locale;
*/
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 26;
private static final int SDL_MICRO_VERSION = 1;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
// SDLActivity.debugSource(device.getSources(), "device[" + device.getName() + "]");
// SDLActivity.debugSource(event.getSource(), "event");
public static void debugSource(int sources, String prefix) {
int s = sources;
int s_copy = sources;
String cls = "";
String src = "";
int tst = 0;
int FLAG_TAINTED = 0x80000000;
if ((s & InputDevice.SOURCE_CLASS_BUTTON) != 0) cls += " BUTTON";
if ((s & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) cls += " JOYSTICK";
if ((s & InputDevice.SOURCE_CLASS_POINTER) != 0) cls += " POINTER";
if ((s & InputDevice.SOURCE_CLASS_POSITION) != 0) cls += " POSITION";
if ((s & InputDevice.SOURCE_CLASS_TRACKBALL) != 0) cls += " TRACKBALL";
int s2 = s_copy & ~InputDevice.SOURCE_ANY; // keep class bits
s2 &= ~( InputDevice.SOURCE_CLASS_BUTTON
| InputDevice.SOURCE_CLASS_JOYSTICK
| InputDevice.SOURCE_CLASS_POINTER
| InputDevice.SOURCE_CLASS_POSITION
| InputDevice.SOURCE_CLASS_TRACKBALL);
if (s2 != 0) cls += "Some_Unkown";
s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tst = InputDevice.SOURCE_BLUETOOTH_STYLUS;
if ((s & tst) == tst) src += " BLUETOOTH_STYLUS";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_DPAD;
if ((s & tst) == tst) src += " DPAD";
s2 &= ~tst;
tst = InputDevice.SOURCE_GAMEPAD;
if ((s & tst) == tst) src += " GAMEPAD";
s2 &= ~tst;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
tst = InputDevice.SOURCE_HDMI;
if ((s & tst) == tst) src += " HDMI";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_JOYSTICK;
if ((s & tst) == tst) src += " JOYSTICK";
s2 &= ~tst;
tst = InputDevice.SOURCE_KEYBOARD;
if ((s & tst) == tst) src += " KEYBOARD";
s2 &= ~tst;
tst = InputDevice.SOURCE_MOUSE;
if ((s & tst) == tst) src += " MOUSE";
s2 &= ~tst;
if (Build.VERSION.SDK_INT >= 26) {
tst = InputDevice.SOURCE_MOUSE_RELATIVE;
if ((s & tst) == tst) src += " MOUSE_RELATIVE";
s2 &= ~tst;
tst = InputDevice.SOURCE_ROTARY_ENCODER;
if ((s & tst) == tst) src += " ROTARY_ENCODER";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_STYLUS;
if ((s & tst) == tst) src += " STYLUS";
s2 &= ~tst;
tst = InputDevice.SOURCE_TOUCHPAD;
if ((s & tst) == tst) src += " TOUCHPAD";
s2 &= ~tst;
tst = InputDevice.SOURCE_TOUCHSCREEN;
if ((s & tst) == tst) src += " TOUCHSCREEN";
s2 &= ~tst;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
tst = InputDevice.SOURCE_TOUCH_NAVIGATION;
if ((s & tst) == tst) src += " TOUCH_NAVIGATION";
s2 &= ~tst;
}
tst = InputDevice.SOURCE_TRACKBALL;
if ((s & tst) == tst) src += " TRACKBALL";
s2 &= ~tst;
tst = InputDevice.SOURCE_ANY;
if ((s & tst) == tst) src += " ANY";
s2 &= ~tst;
if (s == FLAG_TAINTED) src += " FLAG_TAINTED";
s2 &= ~FLAG_TAINTED;
if (s2 != 0) src += " Some_Unkown";
Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src);
}
*/
public static boolean mIsResumedCalled, mHasFocus;
public static final boolean mHasMultiWindow = (Build.VERSION.SDK_INT >= 24);
@@ -105,7 +210,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
// Main components
protected static SDLActivity mSingleton;
protected static SDLSurface mSurface;
protected static View mTextEdit;
protected static DummyEdit mTextEdit;
protected static boolean mScreenKeyboardShown;
protected static ViewGroup mLayout;
protected static SDLClipboardHandler mClipboardHandler;
@@ -206,6 +311,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
mNextNativeState = NativeState.INIT;
mCurrentNativeState = NativeState.INIT;
}
protected SDLSurface createSDLSurface(Context context) {
return new SDLSurface(context);
}
// Setup
@Override
@@ -236,8 +345,18 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
errorMsgBrokenLib = e.getMessage();
}
if (mBrokenLibraries)
{
if (!mBrokenLibraries) {
String expected_version = String.valueOf(SDL_MAJOR_VERSION) + "." +
String.valueOf(SDL_MINOR_VERSION) + "." +
String.valueOf(SDL_MICRO_VERSION);
String version = nativeGetVersion();
if (!version.equals(expected_version)) {
mBrokenLibraries = true;
errorMsgBrokenLib = "SDL C/Java version mismatch (expected " + expected_version + ", got " + version + ")";
}
}
if (mBrokenLibraries) {
mSingleton = this;
AlertDialog.Builder dlgAlert = new AlertDialog.Builder(this);
dlgAlert.setMessage("An error occurred while trying to start the application. Please try again and/or reinstall."
@@ -274,7 +393,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
mHIDDeviceManager = HIDDeviceManager.acquire(this);
// Set up the surface
mSurface = new SDLSurface(getApplication());
mSurface = createSDLSurface(getApplication());
mLayout = new RelativeLayout(this);
mLayout.addView(mSurface);
@@ -778,6 +897,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
// C functions we call
public static native String nativeGetVersion();
public static native int nativeSetupJNI();
public static native int nativeRunMain(String library, String function, Object arguments);
public static native void nativeLowMemory();
@@ -1112,8 +1232,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
}
// This method is called by SDLControllerManager's API 26 Generic Motion Handler.
public static View getContentView()
{
public static View getContentView() {
return mLayout;
}
@@ -1184,6 +1303,77 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
return event.isPrintingKey() || event.getKeyCode() == KeyEvent.KEYCODE_SPACE;
}
public static boolean handleKeyEvent(View v, int keyCode, KeyEvent event, InputConnection ic) {
int deviceId = event.getDeviceId();
int source = event.getSource();
if (source == InputDevice.SOURCE_UNKNOWN) {
InputDevice device = InputDevice.getDevice(deviceId);
if (device != null) {
source = device.getSources();
}
}
// if (event.getAction() == KeyEvent.ACTION_DOWN) {
// Log.v("SDL", "key down: " + keyCode + ", deviceId = " + deviceId + ", source = " + source);
// } else if (event.getAction() == KeyEvent.ACTION_UP) {
// Log.v("SDL", "key up: " + keyCode + ", deviceId = " + deviceId + ", source = " + source);
// }
// Dispatch the different events depending on where they come from
// Some SOURCE_JOYSTICK, SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD
// So, we try to process them as JOYSTICK/DPAD/GAMEPAD events first, if that fails we try them as KEYBOARD
//
// Furthermore, it's possible a game controller has SOURCE_KEYBOARD and
// SOURCE_JOYSTICK, while its key events arrive from the keyboard source
// So, retrieve the device itself and check all of its sources
if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) {
// Note that we process events with specific key codes here
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (SDLControllerManager.onNativePadDown(deviceId, keyCode) == 0) {
return true;
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (SDLControllerManager.onNativePadUp(deviceId, keyCode) == 0) {
return true;
}
}
}
if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (isTextInputEvent(event)) {
if (ic != null) {
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
} else {
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
}
onNativeKeyDown(keyCode);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
onNativeKeyUp(keyCode);
return true;
}
}
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
// they are ignored here because sending them as mouse input to SDL is messy
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
case KeyEvent.ACTION_UP:
// mark the event as handled or it will be handled by system
// handling KEYCODE_BACK by system will call onBackPressed()
return true;
}
}
}
return false;
}
/**
* This method is called by SDL using JNI.
*/
@@ -1204,8 +1394,21 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
for (int id : ids) {
InputDevice device = InputDevice.getDevice(id);
if (device != null && (device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) != 0) {
nativeAddTouch(device.getId(), device.getName());
/* Allow SOURCE_TOUCHSCREEN and also Virtual InputDevices because they can send TOUCHSCREEN events */
if (device != null && ((device.getSources() & InputDevice.SOURCE_TOUCHSCREEN) == InputDevice.SOURCE_TOUCHSCREEN
|| device.isVirtual())) {
int touchDevId = device.getId();
/*
* Prevent id to be -1, since it's used in SDL internal for synthetic events
* Appears when using Android emulator, eg:
* adb shell input mouse tap 100 100
* adb shell input touchscreen tap 100 100
*/
if (touchDevId < 0) {
touchDevId -= 1;
}
nativeAddTouch(touchDevId, device.getName());
}
}
}
@@ -1688,455 +1891,6 @@ class SDLMain implements Runnable {
}
}
/**
SDLSurface. This is what we draw on, so we need to know when it's created
in order to do anything useful.
Because of this, that's where we set up the SDL thread
*/
class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
// Sensors
protected SensorManager mSensorManager;
protected Display mDisplay;
// Keep track of the surface size to normalize touch events
protected float mWidth, mHeight;
// Is SurfaceView ready for rendering
public boolean mIsSurfaceReady;
// Startup
public SDLSurface(Context context) {
super(context);
getHolder().addCallback(this);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
setOnGenericMotionListener(SDLActivity.getMotionListener());
// Some arbitrary defaults to avoid a potential division by zero
mWidth = 1.0f;
mHeight = 1.0f;
mIsSurfaceReady = false;
}
public void handlePause() {
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
public void handleResume() {
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
}
public Surface getNativeSurface() {
return getHolder().getSurface();
}
// Called when we have a valid drawing surface
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.v("SDL", "surfaceCreated()");
SDLActivity.onNativeSurfaceCreated();
}
// Called when we lose the surface
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()");
// Transition to pause, if needed
SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;
SDLActivity.handleNativeState();
mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();
}
// Called when the surface is resized
@Override
public void surfaceChanged(SurfaceHolder holder,
int format, int width, int height) {
Log.v("SDL", "surfaceChanged()");
if (SDLActivity.mSingleton == null) {
return;
}
mWidth = width;
mHeight = height;
int nDeviceWidth = width;
int nDeviceHeight = height;
try
{
if (Build.VERSION.SDK_INT >= 17) {
DisplayMetrics realMetrics = new DisplayMetrics();
mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels;
}
} catch(Exception ignored) {
}
synchronized(SDLActivity.getContext()) {
// In case we're waiting on a size change after going fullscreen, send a notification.
SDLActivity.getContext().notifyAll();
}
Log.v("SDL", "Window size: " + width + "x" + height);
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, mDisplay.getRefreshRate());
SDLActivity.onNativeResize();
// Prevent a screen distortion glitch,
// for instance when the device is in Landscape and a Portrait App is resumed.
boolean skip = false;
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {
if (mWidth > mHeight) {
skip = true;
}
} else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
if (mWidth < mHeight) {
skip = true;
}
}
// Special Patch for Square Resolution: Black Berry Passport
if (skip) {
double min = Math.min(mWidth, mHeight);
double max = Math.max(mWidth, mHeight);
if (max / min < 1.20) {
Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");
skip = false;
}
}
// Don't skip in MultiWindow.
if (skip) {
if (Build.VERSION.SDK_INT >= 24) {
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
Log.v("SDL", "Don't skip in Multi-Window");
skip = false;
}
}
}
if (skip) {
Log.v("SDL", "Skip .. Surface is not ready.");
mIsSurfaceReady = false;
return;
}
/* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
SDLActivity.onNativeSurfaceChanged();
/* Surface is ready */
mIsSurfaceReady = true;
SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
SDLActivity.handleNativeState();
}
// Key events
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
int deviceId = event.getDeviceId();
int source = event.getSource();
if (source == InputDevice.SOURCE_UNKNOWN) {
InputDevice device = InputDevice.getDevice(deviceId);
if (device != null) {
source = device.getSources();
}
}
// if (event.getAction() == KeyEvent.ACTION_DOWN) {
// Log.v("SDL", "key down: " + keyCode + ", deviceId = " + deviceId + ", source = " + source);
// } else if (event.getAction() == KeyEvent.ACTION_UP) {
// Log.v("SDL", "key up: " + keyCode + ", deviceId = " + deviceId + ", source = " + source);
// }
// Dispatch the different events depending on where they come from
// Some SOURCE_JOYSTICK, SOURCE_DPAD or SOURCE_GAMEPAD are also SOURCE_KEYBOARD
// So, we try to process them as JOYSTICK/DPAD/GAMEPAD events first, if that fails we try them as KEYBOARD
//
// Furthermore, it's possible a game controller has SOURCE_KEYBOARD and
// SOURCE_JOYSTICK, while its key events arrive from the keyboard source
// So, retrieve the device itself and check all of its sources
if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) {
// Note that we process events with specific key codes here
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (SDLControllerManager.onNativePadDown(deviceId, keyCode) == 0) {
return true;
}
} else if (event.getAction() == KeyEvent.ACTION_UP) {
if (SDLControllerManager.onNativePadUp(deviceId, keyCode) == 0) {
return true;
}
}
}
if ((source & InputDevice.SOURCE_KEYBOARD) != 0) {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (SDLActivity.isTextInputEvent(event)) {
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
}
SDLActivity.onNativeKeyDown(keyCode);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
}
if ((source & InputDevice.SOURCE_MOUSE) != 0) {
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
// they are ignored here because sending them as mouse input to SDL is messy
if ((keyCode == KeyEvent.KEYCODE_BACK) || (keyCode == KeyEvent.KEYCODE_FORWARD)) {
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
case KeyEvent.ACTION_UP:
// mark the event as handled or it will be handled by system
// handling KEYCODE_BACK by system will call onBackPressed()
return true;
}
}
}
return false;
}
// Touch events
@Override
public boolean onTouch(View v, MotionEvent event) {
/* Ref: http://developer.android.com/training/gestures/multi.html */
int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
int action = event.getActionMasked();
int pointerFingerId;
int i = -1;
float x,y,p;
/*
* Prevent id to be -1, since it's used in SDL internal for synthetic events
* Appears when using Android emulator, eg:
* adb shell input mouse tap 100 100
* adb shell input touchscreen tap 100 100
*/
if (touchDevId < 0) {
touchDevId -= 1;
}
// 12290 = Samsung DeX mode desktop mouse
// 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
// 0x2 = SOURCE_CLASS_POINTER
if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {
int mouseButton = 1;
try {
Object object = event.getClass().getMethod("getButtonState").invoke(event);
if (object != null) {
mouseButton = (Integer) object;
}
} catch(Exception ignored) {
}
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
// if we are. We'll leverage our existing mouse motion listener
SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
x = motionListener.getEventX(event);
y = motionListener.getEventY(event);
SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
} else {
switch(action) {
case MotionEvent.ACTION_MOVE:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_DOWN:
// Primary pointer up/down, the index is always zero
i = 0;
/* fallthrough */
case MotionEvent.ACTION_POINTER_UP:
case MotionEvent.ACTION_POINTER_DOWN:
// Non primary pointer up/down
if (i == -1) {
i = event.getActionIndex();
}
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
break;
case MotionEvent.ACTION_CANCEL:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
}
break;
default:
break;
}
}
return true;
}
// Sensor events
public void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(sensortype),
SensorManager.SENSOR_DELAY_GAME, null);
} else {
mSensorManager.unregisterListener(this,
mSensorManager.getDefaultSensor(sensortype));
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// TODO
}
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
// We thus should check here.
int newOrientation;
float x, y;
switch (mDisplay.getRotation()) {
case Surface.ROTATION_90:
x = -event.values[1];
y = event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;
break;
case Surface.ROTATION_270:
x = event.values[1];
y = -event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
break;
case Surface.ROTATION_180:
x = -event.values[0];
y = -event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
break;
case Surface.ROTATION_0:
default:
x = event.values[0];
y = event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;
break;
}
if (newOrientation != SDLActivity.mCurrentOrientation) {
SDLActivity.mCurrentOrientation = newOrientation;
SDLActivity.onNativeOrientationChanged(newOrientation);
}
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
y / SensorManager.GRAVITY_EARTH,
event.values[2] / SensorManager.GRAVITY_EARTH);
}
}
// Captured pointer events for API 26.
public boolean onCapturedPointerEvent(MotionEvent event)
{
int action = event.getActionMasked();
float x, y;
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
case MotionEvent.ACTION_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
case MotionEvent.ACTION_BUTTON_PRESS:
case MotionEvent.ACTION_BUTTON_RELEASE:
// Change our action value to what SDL's code expects.
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
action = MotionEvent.ACTION_DOWN;
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
action = MotionEvent.ACTION_UP;
}
x = event.getX(0);
y = event.getY(0);
int button = event.getButtonState();
SDLActivity.onNativeMouse(button, action, x, y, true);
return true;
}
return false;
}
}
/* This is a fake invisible editor view that receives the input and defines the
* pan&scan region
*/
@@ -2157,21 +1911,7 @@ class DummyEdit extends View implements View.OnKeyListener {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
/*
* This handles the hardware keyboard input
*/
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (SDLActivity.isTextInputEvent(event)) {
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
return true;
}
SDLActivity.onNativeKeyDown(keyCode);
return true;
} else if (event.getAction() == KeyEvent.ACTION_UP) {
SDLActivity.onNativeKeyUp(keyCode);
return true;
}
return false;
return SDLActivity.handleKeyEvent(v, keyCode, event, ic);
}
//
@@ -2195,9 +1935,10 @@ class DummyEdit extends View implements View.OnKeyListener {
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
ic = new SDLInputConnection(this, true);
outAttrs.inputType = InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI
| EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
outAttrs.inputType = InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_FLAG_MULTI_LINE;
outAttrs.imeOptions = EditorInfo.IME_FLAG_NO_EXTRACT_UI |
EditorInfo.IME_FLAG_NO_FULLSCREEN /* API 11 */;
return ic;
}
@@ -2205,9 +1946,17 @@ class DummyEdit extends View implements View.OnKeyListener {
class SDLInputConnection extends BaseInputConnection {
protected EditText mEditText;
protected String mCommittedText = "";
public SDLInputConnection(View targetView, boolean fullEditor) {
super(targetView, fullEditor);
mEditText = new EditText(SDL.getContext());
}
@Override
public Editable getEditable() {
return mEditText.getEditableText();
}
@Override
@@ -2230,59 +1979,84 @@ class SDLInputConnection extends BaseInputConnection {
}
}
return super.sendKeyEvent(event);
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
if (c == '\n') {
if (SDLActivity.onNativeSoftReturnKey()) {
return true;
}
}
nativeGenerateScancodeForUnichar(c);
if (!super.commitText(text, newCursorPosition)) {
return false;
}
SDLInputConnection.nativeCommitText(text.toString(), newCursorPosition);
return super.commitText(text, newCursorPosition);
updateText();
return true;
}
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
if (!super.setComposingText(text, newCursorPosition)) {
return false;
}
updateText();
return true;
}
nativeSetComposingText(text.toString(), newCursorPosition);
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
if (!super.deleteSurroundingText(beforeLength, afterLength)) {
return false;
}
updateText();
return true;
}
return super.setComposingText(text, newCursorPosition);
protected void updateText() {
final Editable content = getEditable();
if (content == null) {
return;
}
String text = content.toString();
int compareLength = Math.min(text.length(), mCommittedText.length());
int matchLength, offset;
/* Backspace over characters that are no longer in the string */
for (matchLength = 0; matchLength < compareLength; ) {
int codePoint = mCommittedText.codePointAt(matchLength);
if (codePoint != text.codePointAt(matchLength)) {
break;
}
matchLength += Character.charCount(codePoint);
}
/* FIXME: This doesn't handle graphemes, like '🌬️' */
for (offset = matchLength; offset < mCommittedText.length(); ) {
int codePoint = mCommittedText.codePointAt(offset);
nativeGenerateScancodeForUnichar('\b');
offset += Character.charCount(codePoint);
}
if (matchLength < text.length()) {
String pendingText = text.subSequence(matchLength, text.length()).toString();
for (offset = 0; offset < pendingText.length(); ) {
int codePoint = pendingText.codePointAt(offset);
if (codePoint == '\n') {
if (SDLActivity.onNativeSoftReturnKey()) {
return;
}
}
/* Higher code points don't generate simulated scancodes */
if (codePoint < 128) {
nativeGenerateScancodeForUnichar((char)codePoint);
}
offset += Character.charCount(codePoint);
}
SDLInputConnection.nativeCommitText(pendingText, 0);
}
mCommittedText = text;
}
public static native void nativeCommitText(String text, int newCursorPosition);
public native void nativeGenerateScancodeForUnichar(char c);
public native void nativeSetComposingText(String text, int newCursorPosition);
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
// Workaround to capture backspace key. Ref: http://stackoverflow.com/questions/14560344/android-backspace-in-webview-baseinputconnection
// and https://bugzilla.libsdl.org/show_bug.cgi?id=2265
if (beforeLength > 0 && afterLength == 0) {
boolean ret = true;
// backspace(s)
while (beforeLength-- > 0) {
boolean ret_key = sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
&& sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL));
ret = ret && ret_key;
}
return ret;
}
return super.deleteSurroundingText(beforeLength, afterLength);
}
public static native void nativeGenerateScancodeForUnichar(char c);
}
class SDLClipboardHandler implements
@@ -255,23 +255,21 @@ class SDLJoystickHandler_API16 extends SDLJoystickHandler {
@Override
public boolean handleMotionEvent(MotionEvent event) {
if ((event.getSource() & InputDevice.SOURCE_JOYSTICK) != 0) {
int actionPointerIndex = event.getActionIndex();
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_MOVE) {
SDLJoystick joystick = getJoystick(event.getDeviceId());
if (joystick != null) {
for (int i = 0; i < joystick.axes.size(); i++) {
InputDevice.MotionRange range = joystick.axes.get(i);
/* Normalize the value to -1...1 */
float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
}
for (int i = 0; i < joystick.hats.size() / 2; i++) {
int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
}
int actionPointerIndex = event.getActionIndex();
int action = event.getActionMasked();
if (action == MotionEvent.ACTION_MOVE) {
SDLJoystick joystick = getJoystick(event.getDeviceId());
if (joystick != null) {
for (int i = 0; i < joystick.axes.size(); i++) {
InputDevice.MotionRange range = joystick.axes.get(i);
/* Normalize the value to -1...1 */
float value = (event.getAxisValue(range.getAxis(), actionPointerIndex) - range.getMin()) / range.getRange() * 2.0f - 1.0f;
SDLControllerManager.onNativeJoy(joystick.device_id, i, value);
}
for (int i = 0; i < joystick.hats.size() / 2; i++) {
int hatX = Math.round(event.getAxisValue(joystick.hats.get(2 * i).getAxis(), actionPointerIndex));
int hatY = Math.round(event.getAxisValue(joystick.hats.get(2 * i + 1).getAxis(), actionPointerIndex));
SDLControllerManager.onNativeHat(joystick.device_id, i, hatX, hatY);
}
}
}
@@ -319,6 +317,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
KeyEvent.KEYCODE_BUTTON_X,
KeyEvent.KEYCODE_BUTTON_Y,
KeyEvent.KEYCODE_BACK,
KeyEvent.KEYCODE_MENU,
KeyEvent.KEYCODE_BUTTON_MODE,
KeyEvent.KEYCODE_BUTTON_START,
KeyEvent.KEYCODE_BUTTON_THUMBL,
@@ -360,6 +359,7 @@ class SDLJoystickHandler_API19 extends SDLJoystickHandler_API16 {
(1 << 2), // X -> X
(1 << 3), // Y -> Y
(1 << 4), // BACK -> BACK
(1 << 6), // MENU -> START
(1 << 5), // MODE -> GUIDE
(1 << 6), // START -> START
(1 << 7), // THUMBL -> LEFTSTICK
@@ -560,8 +560,6 @@ class SDLGenericMotionListener_API12 implements View.OnGenericMotionListener {
switch ( event.getSource() ) {
case InputDevice.SOURCE_JOYSTICK:
case InputDevice.SOURCE_GAMEPAD:
case InputDevice.SOURCE_DPAD:
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
@@ -691,8 +689,6 @@ class SDLGenericMotionListener_API26 extends SDLGenericMotionListener_API24 {
switch ( event.getSource() ) {
case InputDevice.SOURCE_JOYSTICK:
case InputDevice.SOURCE_GAMEPAD:
case InputDevice.SOURCE_DPAD:
return SDLControllerManager.handleJoystickMotionEvent(event);
case InputDevice.SOURCE_MOUSE:
@@ -0,0 +1,405 @@
package org.libsdl.app;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
/**
SDLSurface. This is what we draw on, so we need to know when it's created
in order to do anything useful.
Because of this, that's where we set up the SDL thread
*/
public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
View.OnKeyListener, View.OnTouchListener, SensorEventListener {
// Sensors
protected SensorManager mSensorManager;
protected Display mDisplay;
// Keep track of the surface size to normalize touch events
protected float mWidth, mHeight;
// Is SurfaceView ready for rendering
public boolean mIsSurfaceReady;
// Startup
public SDLSurface(Context context) {
super(context);
getHolder().addCallback(this);
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
mDisplay = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
setOnGenericMotionListener(SDLActivity.getMotionListener());
// Some arbitrary defaults to avoid a potential division by zero
mWidth = 1.0f;
mHeight = 1.0f;
mIsSurfaceReady = false;
}
public void handlePause() {
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}
public void handleResume() {
setFocusable(true);
setFocusableInTouchMode(true);
requestFocus();
setOnKeyListener(this);
setOnTouchListener(this);
enableSensor(Sensor.TYPE_ACCELEROMETER, true);
}
public Surface getNativeSurface() {
return getHolder().getSurface();
}
// Called when we have a valid drawing surface
@Override
public void surfaceCreated(SurfaceHolder holder) {
Log.v("SDL", "surfaceCreated()");
SDLActivity.onNativeSurfaceCreated();
}
// Called when we lose the surface
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
Log.v("SDL", "surfaceDestroyed()");
// Transition to pause, if needed
SDLActivity.mNextNativeState = SDLActivity.NativeState.PAUSED;
SDLActivity.handleNativeState();
mIsSurfaceReady = false;
SDLActivity.onNativeSurfaceDestroyed();
}
// Called when the surface is resized
@Override
public void surfaceChanged(SurfaceHolder holder,
int format, int width, int height) {
Log.v("SDL", "surfaceChanged()");
if (SDLActivity.mSingleton == null) {
return;
}
mWidth = width;
mHeight = height;
int nDeviceWidth = width;
int nDeviceHeight = height;
try
{
if (Build.VERSION.SDK_INT >= 17) {
DisplayMetrics realMetrics = new DisplayMetrics();
mDisplay.getRealMetrics( realMetrics );
nDeviceWidth = realMetrics.widthPixels;
nDeviceHeight = realMetrics.heightPixels;
}
} catch(Exception ignored) {
}
synchronized(SDLActivity.getContext()) {
// In case we're waiting on a size change after going fullscreen, send a notification.
SDLActivity.getContext().notifyAll();
}
Log.v("SDL", "Window size: " + width + "x" + height);
Log.v("SDL", "Device size: " + nDeviceWidth + "x" + nDeviceHeight);
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, mDisplay.getRefreshRate());
SDLActivity.onNativeResize();
// Prevent a screen distortion glitch,
// for instance when the device is in Landscape and a Portrait App is resumed.
boolean skip = false;
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {
if (mWidth > mHeight) {
skip = true;
}
} else if (requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) {
if (mWidth < mHeight) {
skip = true;
}
}
// Special Patch for Square Resolution: Black Berry Passport
if (skip) {
double min = Math.min(mWidth, mHeight);
double max = Math.max(mWidth, mHeight);
if (max / min < 1.20) {
Log.v("SDL", "Don't skip on such aspect-ratio. Could be a square resolution.");
skip = false;
}
}
// Don't skip in MultiWindow.
if (skip) {
if (Build.VERSION.SDK_INT >= 24) {
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
Log.v("SDL", "Don't skip in Multi-Window");
skip = false;
}
}
}
if (skip) {
Log.v("SDL", "Skip .. Surface is not ready.");
mIsSurfaceReady = false;
return;
}
/* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
SDLActivity.onNativeSurfaceChanged();
/* Surface is ready */
mIsSurfaceReady = true;
SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
SDLActivity.handleNativeState();
}
// Key events
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
return SDLActivity.handleKeyEvent(v, keyCode, event, null);
}
// Touch events
@Override
public boolean onTouch(View v, MotionEvent event) {
/* Ref: http://developer.android.com/training/gestures/multi.html */
int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount();
int action = event.getActionMasked();
int pointerFingerId;
int i = -1;
float x,y,p;
/*
* Prevent id to be -1, since it's used in SDL internal for synthetic events
* Appears when using Android emulator, eg:
* adb shell input mouse tap 100 100
* adb shell input touchscreen tap 100 100
*/
if (touchDevId < 0) {
touchDevId -= 1;
}
// 12290 = Samsung DeX mode desktop mouse
// 12290 = 0x3002 = 0x2002 | 0x1002 = SOURCE_MOUSE | SOURCE_TOUCHSCREEN
// 0x2 = SOURCE_CLASS_POINTER
if (event.getSource() == InputDevice.SOURCE_MOUSE || event.getSource() == (InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHSCREEN)) {
int mouseButton = 1;
try {
Object object = event.getClass().getMethod("getButtonState").invoke(event);
if (object != null) {
mouseButton = (Integer) object;
}
} catch(Exception ignored) {
}
// We need to check if we're in relative mouse mode and get the axis offset rather than the x/y values
// if we are. We'll leverage our existing mouse motion listener
SDLGenericMotionListener_API12 motionListener = SDLActivity.getMotionListener();
x = motionListener.getEventX(event);
y = motionListener.getEventY(event);
SDLActivity.onNativeMouse(mouseButton, action, x, y, motionListener.inRelativeMode());
} else {
switch(action) {
case MotionEvent.ACTION_MOVE:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
}
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_DOWN:
// Primary pointer up/down, the index is always zero
i = 0;
/* fallthrough */
case MotionEvent.ACTION_POINTER_UP:
case MotionEvent.ACTION_POINTER_DOWN:
// Non primary pointer up/down
if (i == -1) {
i = event.getActionIndex();
}
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, action, x, y, p);
break;
case MotionEvent.ACTION_CANCEL:
for (i = 0; i < pointerCount; i++) {
pointerFingerId = event.getPointerId(i);
x = event.getX(i) / mWidth;
y = event.getY(i) / mHeight;
p = event.getPressure(i);
if (p > 1.0f) {
// may be larger than 1.0f on some devices
// see the documentation of getPressure(i)
p = 1.0f;
}
SDLActivity.onNativeTouch(touchDevId, pointerFingerId, MotionEvent.ACTION_UP, x, y, p);
}
break;
default:
break;
}
}
return true;
}
// Sensor events
public void enableSensor(int sensortype, boolean enabled) {
// TODO: This uses getDefaultSensor - what if we have >1 accels?
if (enabled) {
mSensorManager.registerListener(this,
mSensorManager.getDefaultSensor(sensortype),
SensorManager.SENSOR_DELAY_GAME, null);
} else {
mSensorManager.unregisterListener(this,
mSensorManager.getDefaultSensor(sensortype));
}
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
// TODO
}
@Override
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
// Since we may have an orientation set, we won't receive onConfigurationChanged events.
// We thus should check here.
int newOrientation;
float x, y;
switch (mDisplay.getRotation()) {
case Surface.ROTATION_90:
x = -event.values[1];
y = event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE;
break;
case Surface.ROTATION_270:
x = event.values[1];
y = -event.values[0];
newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
break;
case Surface.ROTATION_180:
x = -event.values[0];
y = -event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
break;
case Surface.ROTATION_0:
default:
x = event.values[0];
y = event.values[1];
newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT;
break;
}
if (newOrientation != SDLActivity.mCurrentOrientation) {
SDLActivity.mCurrentOrientation = newOrientation;
SDLActivity.onNativeOrientationChanged(newOrientation);
}
SDLActivity.onNativeAccel(-x / SensorManager.GRAVITY_EARTH,
y / SensorManager.GRAVITY_EARTH,
event.values[2] / SensorManager.GRAVITY_EARTH);
}
}
// Captured pointer events for API 26.
public boolean onCapturedPointerEvent(MotionEvent event)
{
int action = event.getActionMasked();
float x, y;
switch (action) {
case MotionEvent.ACTION_SCROLL:
x = event.getAxisValue(MotionEvent.AXIS_HSCROLL, 0);
y = event.getAxisValue(MotionEvent.AXIS_VSCROLL, 0);
SDLActivity.onNativeMouse(0, action, x, y, false);
return true;
case MotionEvent.ACTION_HOVER_MOVE:
case MotionEvent.ACTION_MOVE:
x = event.getX(0);
y = event.getY(0);
SDLActivity.onNativeMouse(0, action, x, y, true);
return true;
case MotionEvent.ACTION_BUTTON_PRESS:
case MotionEvent.ACTION_BUTTON_RELEASE:
// Change our action value to what SDL's code expects.
if (action == MotionEvent.ACTION_BUTTON_PRESS) {
action = MotionEvent.ACTION_DOWN;
} else { /* MotionEvent.ACTION_BUTTON_RELEASE */
action = MotionEvent.ACTION_UP;
}
x = event.getX(0);
y = event.getY(0);
int button = event.getButtonState();
SDLActivity.onNativeMouse(button, action, x, y, true);
return true;
}
return false;
}
}
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/license_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="20dp" />
</ScrollView>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
@@ -6,4 +6,7 @@
<item
android:id="@+id/import_savedata"
android:title="@string/action_import_save_data" />
<item
android:id="@+id/licenses"
android:title="@string/action_licenses" />
</menu>
@@ -3,6 +3,7 @@
<string name="app_name">xsystem35</string>
<string name="action_export_save_data">セーブデータをエクスポート</string>
<string name="action_import_save_data">セーブデータをインポート</string>
<string name="action_licenses">オープンソースライセンス</string>
<string name="cancel">キャンセル</string>
<string name="cannot_find_ald">System 3.x のファイル (*.ald) が見つかりません。</string>
<string name="choose_a_file">ファイルを選択</string>
@@ -2,6 +2,7 @@
<string name="app_name">xsystem35</string>
<string name="action_export_save_data">Export Save Files</string>
<string name="action_import_save_data">Import Save Files</string>
<string name="action_licenses">Open source licenses</string>
<string name="cancel">Cancel</string>
<string name="cannot_find_ald">Cannot find System 3.x game files (*.ald).</string>
<string name="choose_a_file">Choose a file</string>
+1 -2
View File
@@ -7,8 +7,7 @@ buildscript {
google()
}
dependencies {
// AGP 7.1.x cannot be used due to https://issuetracker.google.com/issues/206099937
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
+1 -1
View File
@@ -1,6 +1,6 @@
#Thu Nov 11 18:20:34 PST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
+1 -1
View File
@@ -1,5 +1,5 @@
#cmakedefine PACKAGE "@PACKAGE@"
#define VERSION "2.5.1"
#define VERSION "2.8.0"
#cmakedefine CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@"
-189
View File
@@ -1,189 +0,0 @@
それぞれのゲームに付いての注意書き
[鬼畜王ランス]
[ランス4(for Win95)]
[闘神都市2(for Win95)]
[いけないかつみ先生]
= 外字データには対応していません
[かえるにょぱにょ〜ん]
= フロアデータ(floor_1.map 〜 floor_16.map) はセーブデータと同じディレク
トリに置いてください。
= 一部のキャラの絵と説明が違う(金魚と????)
[戦巫女]
= 戦巫女は2枚組のCDで、Windows版では一部のデータをCD-ROMに置いたままゲーム
することになっていますが、xsystem35 では CD-Audio と CD-ROM上のデータを
同時に使用することは出来ません。ハードディスク等に全てのデータをインス
トールするか、あるいは CD-Audio 以外の演奏方法(MP3等)を使用してください。
CD-Audio を使う場合は2枚目の CD に音楽データが入っています。
[零式(アリスの館456版)]
= マップデータ(MAP_DATA.DAT, UR_DATA.DATA)はセーブデータと同じディレクトリに
置いてください。
[ATLACH=NACHA(アリスの館456版)]
[人間狩り(アリスの館456版)]
[アリスの館456]
- DALK
- 闘神都市
- DrStop!
- ランス1
- ランス2
- ランス3
[王道勇者]
[ディアボリカ]
[AmbivalenZ(for Win95)]
[夢幻泡影 (for Win95)]
[ぱすてるチャイム]
= ぱすてるチャイムでは明らかにシナリオにおかしいところがあります。
そこで、これに対するパッチを作成しました。
patch というディレクトリの下に pastel.diff というパッチ当てのスクリプト
がありますので、ゲームのシナリオデータのあるディレクトリにコピーして
そのディレクトリに移動した後、 ./pastel.diff (シナリオファイル名) と
実行してください。
(例)
> ./pastel.diff pastel_sa.ald
古いデータは pastel_sa.ald.org として保存されます。
シナリオデータは Ver 1.00 と Ver 1.01 に適用できます。
(廉価版では直っている?)
[ぷろすちゅーでんとGood]
[守り神様]
[ママトト]
[HushByBaby]
[Darcrows]
[PERSIOM]
= DirectSound(3D Sound) には対応していません。
[隠れ月]
[SeeIn青]
[廉価版・デアボリカ]
[廉価版・アトラクナクア]
[廉価版・かえるにょ・ぱにょん]
[廉価版・零式]
[かえるにょ国にょありす(20世紀アリス)]
= 外部MIDIプレイヤーモードでは音楽がリピートされません。
[これDPS?(20世紀アリス)]
[夜が来る!]
= 動きません
[王子さま Lv1]
[Only You 〜リ・クルス〜]
[大悪司]
= オープニングが動かない
[王子さま Lv1.5]
[妻みぐい]
= オープニングが動かない
[エスカレイヤー]
= オープニングが動かない
[Rance5D]
[妻みぐい2]
= オープニングが動かない
[DALK外伝]
[ままにょにょ]
= System4につき動きません
/*
* その他
*/
* センチメンタルシーズン (Aliceの館 CDをベースに UNITBASE が移植したもの)
= http://www4.big.or.jp/~unitbase/sys35sdk/games.html
* Intruder (Aliceの館 CDをベースに UNITBASE が移植したもの)
= まだ完了していません
* Crecent Moon がぁる (Aliceの館 CDをベースに UNITBASE が移植したもの)
= http://www4.big.or.jp/~unitbase/sys35sdk/games.html
* あぶない天狗伝説 (Aliceの館 CD2をベースに UNITBASE が移植したもの)
= 掲載許可が下りません
* OnlyYou (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* ランス4.1 (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
= スプライトの色がおかしい
* ランス4.2 (system3版をベースに TOTOさんが移植したもの
= http://www1.interq.or.jp/t-takeda/index.html
= スプライトの色がおかしい
* アリスの館3 (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* 乙女戦記 (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* 闘神都市2外伝 (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* DPS全部 (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* ProStudentG (system3版をベースに TOTOさんが移植したもの)
= http://www1.interq.or.jp/t-takeda/index.html
* 学園KING (AliceCD Ver 1.??)
= CDが鳴らない
-> TOTOさんが、CD-DAに対応するためのシナリオパッチをつくっています。
http://www1.interq.or.jp/t-takeda/midi.html
* メイドのススメ (AliceCD Ver 1.02)
* ぶろぶろ (AliceCD Ver 1.02)
* 学園漂流戦記 (AliceCD Ver 1.02)
* 扉 (AliceCD Ver 2.02)
* 妖精 (AliceCD Ver 2.02)
/*
* 3rd party 製作 ゲーム
*/
#include "MISCGAME.TXT"
-58
View File
@@ -1,58 +0,0 @@
その他の SYSTEM 3.5 のゲームについて
README にある動作確認ゲーム以外にも、ネット上で公開されているSYSTEM3.5対応
のゲームのうち幾つかは動く事が確認されています。ここでは 1.4.0 preX での動作
状況です。1.4.0 公開時点で手に入るゲームを順次追加していっています。
また、XXXが動かないんだけど調べてください、XXXはちゃんと動きました、といった
情報もおよせください。
OKは問題なく動く。GOODが多少の問題あるもののゲームをやるぶんで気にはなるけど
耐えられる範囲のもの。BADは動かないものです。
(作者の敬称略)
【 ソフト名 】 【 ファイル名 】【 作者名 】【 動作 】
国立ファーブル図
書館司書〜
ブックルちゃん〜 SSYO_100.LZH 大塚ヒロ OK
バルーンぽっぷ BPOP_093.LZH 大塚ヒロ OK
Self self.lzh よこやまなおき OK
おせろっと othellotto.exe よこやまなおき OK
キャロル carol.lzh よこやまなおき GOOD(1)
積層四目並べ Te1.lzh 深叢 忍 OK
16Piece Puzzle 16p1.lzh 深叢 忍 OK
The Line Line0.lzh 深叢 忍 OK
Black Jack bj120.lzh かずき OK
マスカレイド (in AliceCD202) ちあぼう OK
戦娘ver2.12 ikusa212.lzh ちあぼう OK
できるかなー! (in AliceCD202) KIMM SOFT OK(2)
恋は計算どおり♪ koi.lzh SS OK
動体視力を鍛えるにょ game_191.lzh LazyRichField BAD(3)
集中力を鍛えるにょ game_22.lh LazyRichField GOOD(4)
1) 雪が降らない (grDrawFillCircle が未実装)
通信対戦が出来ない
2) メッセージサイズ300ドットの表示は 100 ドットに制限しています
3) DS 数字 となっている
4) 色がおかしい
最後にこれらのデータを公開している作者の方々のURLです。
大塚ヒロさん http://www.studioHIRO.com/
よこやまなおきさん http://www3.justnet.ne.jp/~naoki-yokoyama/
深叢 忍さん http://www2s.biglobe.ne.jp/~nin/
かずきさん http://www.din.or.jp/~kazuki/
桐ヶ屋 inc.(ちあぼう)さん http://www.eucaly.net/~kiri
KIMM SOFT/ネリワサヴィちーむ heavyd@syd.odn.ne.jp
SSさん http://www.sspzgr.net/
LazyRichFieldさん http://www2j.biglobe.ne.jp/~Lazy/staff/alice.htm
+83
View File
@@ -0,0 +1,83 @@
Game Compatibility
==================
| Game | Status | Notes |
| ------------------------------------------- | ----------- | ----- |
| 鬼畜王ランス | Supported | |
| Kichikuou Rance (EN) | Supported | |
| RanceIV -教団の遺産- | Supported | Win95 edition, [Ver2.05](https://hannylaboratory.blogspot.com/2023/01/blog-post_26.html) |
| Rance4 -Legacy of the Sect- (EN) | Supported | |
| 兰斯IV -教团的遗产- (CN) | Supported | |
| ランス4.1 | Supported | [Ver1.05](https://hannylaboratory.blogspot.com/2023/02/blog-post_9.html) |
| ランス4.2 | Supported | [Ver1.05](https://hannylaboratory.blogspot.com/2023/02/blog-post_9.html) |
| いけないかつみ先生 | Supported | Emojis are not supported |
| 闘神都市II | Supported | Win95 edition |
| かえるにょ・ぱにょ~ん | Supported | Normal / Low-priced edition |
| 戦巫女 | Supported | Normal / Low-priced edition |
| 零式 | Supported | From ALICEの館4・5・6 / Low-priced edition |
| アトラク=ナクア | Supported | From ALICEの館4・5・6 / Low-priced edition |
| Rance -光を求めて- | Supported | From ALICEの館4・5・6 |
| Rance II -反逆の少女達- | Supported | From ALICEの館4・5・6 |
| Rance III -リーザス陥落- | Supported | From ALICEの館4・5・6 |
| DALK | Supported | From ALICEの館4・5・6 |
| 闘神都市 | Supported | From ALICEの館4・5・6 |
| Dr.STOP | Supported | From ALICEの館4・5・6 |
| 人間狩り | Unsupported | From ALICEの館4・5・6 / アリスCD |
| 女の子図鑑 | Unknown | From ALICEの館4・5・6 |
| 恋のおわり | Unknown | |
| 王道勇者 | Supported | |
| AmbivalenZ | Supported | Win95 edition |
| DiaboLiQuE | Supported | Normal / Low-priced edition |
| 夢幻泡影 | Unknown | Win98 edition |
| ぱすてるチャイム | Supported | See [patch/README.TXT](patch/README.TXT) |
| ぷろすちゅーでんとGood | Supported | |
| 守り神様 | Supported | |
| ママトト | Supported | |
| HUSHABY BABY | Supported | |
| DARCROWS | Supported | |
| 隠れ月 | Supported | |
| PERSIOM | Supported | 3D sound is not supported |
| SeeIn青 | Supported | |
| かえるにょ国にょアリス | Supported | From 20世紀アリス |
| これD・P・S? | Supported | From 20世紀アリス |
| 夜が来る! | Unsupported | |
| Only you ~リ・クルス~ | Supported | |
| 大悪司 | Supported | Opening demo is not supported |
| 王子さまLv1 | Supported | |
| 王子さま1ヵ月後 | Supported | From 王子さまLV1.5 |
| 白鳳の子分叩き | Supported | From 王子さまLV1.5 |
| チェシャのお部屋1.5 | Supported | From 王子さまLV1.5 |
| 王子さま1/16 | Supported | From 王子さまLV1.5 |
| スパイ伊藤の「クイズ!俺にさぼらせろ」 | Supported | From 王子さまLV1.5 |
| 妻みぐい | Supported | Opening demo is not supported |
| 超昂天使エスカレイヤー | Supported | Opening demo is not supported |
| ランス5D | Supported | |
| Rance 5D - The Lonely Girl (MangaGamer) | Supported | |
| 俺の下であがけ | Unknown | |
| 楽園行 | Unknown | |
| 妻みぐい2 | Supported | Opening demo is not supported |
| シェル・クレイル | Supported | |
| ナイトデーモン | Supported | |
| 学園KING | Supported | From アリスCD |
| 学園KING 番外編 | Supported | From アリスCD |
| 蒼海に墜ちて | Supported | From アリスCD |
| ぶろぶろ | Supported | From アリスCD |
| 裸ぶろぶろ狂 | Supported | From アリスCD |
| メイドのススメ | Supported | From アリスCD |
| 学園漂流戦記 | Supported | From アリスCD |
| 学園漂流戦記2 | Supported | From アリスCD |
| 当たって!!KUDAKERO 予告編 | Supported | From アリスCD |
| 妖精 | Supported | From アリスCD |
| [扉] | Supported | From アリスCD |
| 叩き殺し太郎 | Supported | From アリスCD |
| バルーンぽっぷ | Supported | From アリスCD |
| 高速ひよこ2 | Unsupported | From アリスCD |
| おせろっと | Supported | From アリスCD |
| マスカレイド | Supported | From アリスCD |
| キャロル ~聖なる鐘が響く夜~ | Supported | From アリスCD, Online match is not supported |
| できるかなー? | Supported | From アリスCD |
| Child Assassin | Supported | From アリスCD |
| Klavier | Supported | From アリスCD |
| 弱肉狂食 | Unsupported | From アリスCD |
| 眼鏡大戦2 | Supported | From アリスCD |
| 妄想くん | Supported | From アリスCD |
+3 -3
View File
@@ -16,21 +16,21 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("AliceLogo.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("AliceLogo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetWaveNum() {
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("AliceLogo.SetWaveNum %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("AliceLogo.SetWaveNum %d,%d:", p1, p2);
}
static void Run() {
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("AliceLogo.Run %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("AliceLogo.Run %d,%d:", p1, p2);
}
static const ModuleFunc functions[] = {
-1
View File
@@ -26,7 +26,6 @@ add_library(modules STATIC
SACT/SACT.c
SACT/sactcg.c
SACT/sactsound.c
SACT/sactbgm.c
SACT/sacttimer.c
SACT/sactstring.c
SACT/sactcrypto.c
+4 -4
View File
@@ -10,7 +10,7 @@
static void Init() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Confirm.Init %d:\n", p1);
DEBUG_COMMAND_YET("Confirm.Init %d:", p1);
}
static void ExistKeyFile() {
@@ -20,7 +20,7 @@ static void ExistKeyFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.ExistKeyFile %s,%p,%p:\n",p1, p2, var);
DEBUG_COMMAND_YET("Confirm.ExistKeyFile %s,%p,%p:",p1, p2, var);
}
static void CheckProtectFile() {
@@ -30,7 +30,7 @@ static void CheckProtectFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.CheckProtectFile %s,%p,%p:\n", p1,p2,var);
DEBUG_COMMAND_YET("Confirm.CheckProtectFile %s,%p,%p:", p1,p2,var);
}
static void CreateKeyFile() {
@@ -40,7 +40,7 @@ static void CreateKeyFile() {
*var = 1;
DEBUG_COMMAND_YET("Confirm.CreateKeyFile %s,%p,%p:\n", p1,p2,var);
DEBUG_COMMAND_YET("Confirm.CreateKeyFile %s,%p,%p:", p1,p2,var);
}
static const ModuleFunc functions[] = {
+54 -54
View File
@@ -113,7 +113,7 @@ static int load_cg_main(int no) {
int sno;
if (sf == NULL) {
WARNING("load fail(cg==NULL,no=%d)\n", no);
WARNING("load fail(cg==NULL,no=%d)", no);
return 0;
}
@@ -136,7 +136,7 @@ static void Init() {
// surface0 を pre_freesurfno として返さないように。
pre_freesurfno = 1;
DEBUG_COMMAND("Gpx.Init %d:\n", p1);
DEBUG_COMMAND("Gpx.Init %d:", p1);
}
static void Gpx_reset(void) {
@@ -171,7 +171,7 @@ static void Create() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.Create %p,%d,%d,%d:\n", var, width, height, bpp);
DEBUG_COMMAND("Gpx.Create %p,%d,%d,%d:", var, width, height, bpp);
}
static void CreatePixelOnly() {
@@ -199,7 +199,7 @@ static void CreatePixelOnly() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.CreatePixelOnly %d,%d,%d,%d:\n", *var, width, height, bpp);
DEBUG_COMMAND("Gpx.CreatePixelOnly %d,%d,%d,%d:", *var, width, height, bpp);
}
static void CreateAMapOnly() {
@@ -225,7 +225,7 @@ static void CreateAMapOnly() {
suf[no] = s;
}
DEBUG_COMMAND("Gpx.CreateAMapOnly %p,%d,%d:\n", var, width, height);
DEBUG_COMMAND("Gpx.CreateAMapOnly %p,%d,%d:", var, width, height);
}
static void IsSurface() {
@@ -248,7 +248,7 @@ static void IsSurface() {
*var = (s->alpha && s->pixel) ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsSurface %d,%p:\n", p1, var);
DEBUG_COMMAND("Gpx.IsSurface %d,%p:", p1, var);
}
static void IsPixel() {
@@ -270,7 +270,7 @@ static void IsPixel() {
*var = s->pixel ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsPixel %d,%p:\n", p1, var);
DEBUG_COMMAND("Gpx.IsPixel %d,%p:", p1, var);
}
static void IsAlpha() {
@@ -292,7 +292,7 @@ static void IsAlpha() {
*var = s->alpha ? 1 : 0;
}
DEBUG_COMMAND("Gpx.IsAlpha %d,%p:\n", p1, var);
DEBUG_COMMAND("Gpx.IsAlpha %d,%p:", p1, var);
}
static void GetWidth() {
@@ -314,7 +314,7 @@ static void GetWidth() {
*var = s->width;
}
DEBUG_COMMAND("Gpx.GetWidth %d,%d:\n", p1, *var);
DEBUG_COMMAND("Gpx.GetWidth %d,%d:", p1, *var);
}
static void GetHeight() {
@@ -336,13 +336,13 @@ static void GetHeight() {
*var = s->height;
}
DEBUG_COMMAND("Gpx.GetHeight %d,%d:\n", p1, *var);
DEBUG_COMMAND("Gpx.GetHeight %d,%d:", p1, *var);
}
static void GetCreatedSurface() { /* not used ? */
int *var = getCaliVariable();
DEBUG_COMMAND_YET("Gpx.GetCreatedSurface %p:\n", var);
DEBUG_COMMAND_YET("Gpx.GetCreatedSurface %p:", var);
}
static void LoadCG() {
@@ -357,21 +357,21 @@ static void LoadCG() {
*var = load_cg_main(p1 -1);
DEBUG_COMMAND("Gpx.LoadCG %p,%d (%d):\n", var, p1, *var);
DEBUG_COMMAND("Gpx.LoadCG %p,%d (%d):", var, p1, *var);
}
static void GetCGPosX() { /* not useed ? */
int *var = getCaliVariable();
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.GetCgPosX %p,%d:\n", var, p1);
DEBUG_COMMAND_YET("Gpx.GetCgPosX %p,%d:", var, p1);
}
static void GetCGPosY() { /* not useed ? */
int *var = getCaliVariable();
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.GetCgPosY %p,%d:\n", var, p1);
DEBUG_COMMAND_YET("Gpx.GetCgPosY %p,%d:", var, p1);
}
static void Free() {
@@ -382,7 +382,7 @@ static void Free() {
*/
int p1 = getCaliValue();
DEBUG_COMMAND("Gpx.Free %d:\n", p1);
DEBUG_COMMAND("Gpx.Free %d:", p1);
if (p1 != 0) {
sf_free_one(p1);
@@ -395,7 +395,7 @@ static void FreeAll() {
*/
sf_free_all();
DEBUG_COMMAND("Gpx.FreeAll:\n");
DEBUG_COMMAND("Gpx.FreeAll:");
}
static void Copy() {
@@ -421,7 +421,7 @@ static void Copy() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.Copy %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss, sx, sy, sw, sh);
DEBUG_COMMAND("Gpx.Copy %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -439,7 +439,7 @@ static void CopyBright() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyBright %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9);
DEBUG_COMMAND_YET("Gpx.CopyBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void CopyAMap() {
@@ -465,7 +465,7 @@ static void CopyAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.CopyAMap %d,%d,%d,%d,%d,%d,%d,%d:\n", da, dx, dy, sa, sx, sy, sw, sh);
DEBUG_COMMAND("Gpx.CopyAMap %d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh);
src = sf_get(sa);
dst = sf_get(da);
@@ -483,7 +483,7 @@ static void Blend() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.Blend %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9);
DEBUG_COMMAND_YET("Gpx.Blend %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void BlendSrcBright() { /* not used ? */
@@ -498,7 +498,7 @@ static void BlendSrcBright() { /* not used ? */
int p9 = getCaliValue();
int p10 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendSrcBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
DEBUG_COMMAND_YET("Gpx.BlendSrcBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}
static void BlendAddSatur() { /* not used ? */
@@ -511,7 +511,7 @@ static void BlendAddSatur() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAddStatur %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.BlendAddStatur %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendAMap() {
@@ -537,7 +537,7 @@ static void BlendAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.BlendAMap %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss, sx, sy, sw, sh);
DEBUG_COMMAND("Gpx.BlendAMap %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -554,7 +554,7 @@ static void BlendAMapSrcOnly() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapSrcOnly %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.BlendAMapSrcOnly %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendAMapColor() { /* not used ? */
@@ -570,7 +570,7 @@ static void BlendAMapColor() { /* not used ? */
int p10 = getCaliValue();
int p11 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
DEBUG_COMMAND_YET("Gpx.BlendAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}
static void BlendAMapColorAlpha() { /* not used ? */
@@ -587,7 +587,7 @@ static void BlendAMapColorAlpha() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapColorAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
DEBUG_COMMAND_YET("Gpx.BlendAMapColorAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void BlendAMapAlpha() { /* not used ? */
@@ -601,7 +601,7 @@ static void BlendAMapAlpha() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9);
DEBUG_COMMAND_YET("Gpx.BlendAMapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void BlendAMapBright() { /* not used ? */
@@ -615,7 +615,7 @@ static void BlendAMapBright() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9);
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void BlendAMapAlphaSrcBright() { /* not used ? */
@@ -630,7 +630,7 @@ static void BlendAMapAlphaSrcBright() { /* not used ? */
int p9 = getCaliValue();
int p10 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
DEBUG_COMMAND_YET("Gpx.BlendAMapBright %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}
static void BlendUseAMapColor() { /* not used ? */
@@ -647,7 +647,7 @@ static void BlendUseAMapColor() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendUseAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
DEBUG_COMMAND_YET("Gpx.BlendUseAMapColor %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void BlendScreen() { /* not used ? */
@@ -660,7 +660,7 @@ static void BlendScreen() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendScreen %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.BlendScreen %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendMultiply() { /* not used ? */
@@ -673,7 +673,7 @@ static void BlendMultiply() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendMultiply %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.BlendMultiply %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void BlendScreenAlpha() { /* not used ? */
@@ -687,7 +687,7 @@ static void BlendScreenAlpha() { /* not used ? */
int p8 = getCaliValue();
int p9 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.BlendScreenAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9);
DEBUG_COMMAND_YET("Gpx.BlendScreenAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9);
}
static void Fill() {
@@ -713,7 +713,7 @@ static void Fill() {
int b = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.Fill %d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r, g, b);
DEBUG_COMMAND("Gpx.Fill %d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b);
dst = sf_get(ds);
gr_fill(dst, dx, dy, dw, dh, r, g, b);
@@ -731,7 +731,7 @@ static void FillAlphaColor() { /* not used ? */
int lv = getCaliValue();
surface_t *dst;
DEBUG_COMMAND_YET("Gpx.FillAlphaColor %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r, g, b, lv);
DEBUG_COMMAND_YET("Gpx.FillAlphaColor %d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r, g, b, lv);
dst = sf_get(ds);
gr_fill_alpha_color(dst, dx, dy, dw, dh, r, g, b, lv);
@@ -745,7 +745,7 @@ static void FillAMap() { /* not used ? */
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.FillAMap %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6);
DEBUG_COMMAND_YET("Gpx.FillAMap %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
}
static void FillAMapOverBorder() {
@@ -770,7 +770,7 @@ static void FillAMapOverBorder() {
int d = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.FillAMapOverBorder %d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, s, d);
DEBUG_COMMAND("Gpx.FillAMapOverBorder %d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, s, d);
dst = sf_get(ds);
gr_fill_alpha_overborder(dst, dx, dy, dw, dh, s, d);
@@ -785,7 +785,7 @@ static void FillAMapUnderBorder() { /* not used ? */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.FillAMapUnderBorder %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("Gpx.FillAMapUnderBorder %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void SaturDP_DPxSA() { /* not used ? */
@@ -798,7 +798,7 @@ static void SaturDP_DPxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.SaturDP_DPxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.SaturDP_DPxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void ScreenDA_DAxSA() { /* not used ? */
@@ -811,7 +811,7 @@ static void ScreenDA_DAxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.ScreenDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.ScreenDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void AddDA_DAxSA() { /* not used ? */
@@ -824,7 +824,7 @@ static void AddDA_DAxSA() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.AddDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.AddDA_DAxSA %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
static void SpriteCopyAMap() {
@@ -852,7 +852,7 @@ static void SpriteCopyAMap() {
int cl = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.SpriteCopyAMap %d,%d,%d,%d,%d,%d,%d,%d,%d:\n", da, dx, dy, sa, sx, sy, sw, sh, cl);
DEBUG_COMMAND("Gpx.SpriteCopyAMap %d,%d,%d,%d,%d,%d,%d,%d,%d:", da, dx, dy, sa, sx, sy, sw, sh, cl);
src = sf_get(sa);
dst = sf_get(da);
@@ -879,7 +879,7 @@ static void BrightDestOnly() {
int r = getCaliValue();
surface_t *dst;
DEBUG_COMMAND("Gpx.BrightDestOnly %d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, r);
DEBUG_COMMAND("Gpx.BrightDestOnly %d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, r);
dst = sf_get(ds);
@@ -900,7 +900,7 @@ static void CopyTextureWrap() { /* not used ? */
int p11 = getCaliValue();
int p12 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyTextureWrap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
DEBUG_COMMAND_YET("Gpx.CopyTextureWrap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}
static void CopyTextureWrapAlpha() { /* not used ? */
@@ -918,7 +918,7 @@ static void CopyTextureWrapAlpha() { /* not used ? */
int p12 = getCaliValue();
int p13 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyTextureWrapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
DEBUG_COMMAND_YET("Gpx.CopyTextureWrapAlpha %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
}
static void CopyStretch() {
@@ -948,7 +948,7 @@ static void CopyStretch() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND_YET("Gpx.CopyStretch %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
DEBUG_COMMAND_YET("Gpx.CopyStretch %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -968,7 +968,7 @@ static void CopyStretchBlend() { /* not used ? */
int p10 = getCaliValue();
int p11 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.CopyStretchBlend %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
DEBUG_COMMAND_YET("Gpx.CopyStretchBlend %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}
static void CopyStretchBlendAMap() {
@@ -998,7 +998,7 @@ static void CopyStretchBlendAMap() {
int sh = getCaliValue();
surface_t *src, *dst;
DEBUG_COMMAND("Gpx.CopyStretchBlendAMap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
DEBUG_COMMAND("Gpx.CopyStretchBlendAMap %d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, dw, dh, ss, sx, sy, sw, sh);
src = sf_get(ss);
dst = sf_get(ds);
@@ -1015,7 +1015,7 @@ static void StretchBlendScreen2x2() { /* not used ? */
int p7 = getCaliValue();
int p8 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.StretchBlendScreen2x2 %d,%d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7, p8);
DEBUG_COMMAND_YET("Gpx.StretchBlendScreen2x2 %d,%d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7, p8);
}
@@ -1049,7 +1049,7 @@ static void StretchBlendScreen2x2WDS() {
int sh = getCaliValue();
surface_t *src1, *src2, *dst;
DEBUG_COMMAND("Gpx.StretchBlendScreen2x2WDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
DEBUG_COMMAND("Gpx.StretchBlendScreen2x2WDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
src1 = sf_get(ss1);
src2 = sf_get(ss2);
@@ -1086,7 +1086,7 @@ static void BlendScreenWDS() {
int sh = getCaliValue();
surface_t *src1, *src2, *dst;
DEBUG_COMMAND("Gpx.BlendScreenWDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:\n", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
DEBUG_COMMAND("Gpx.BlendScreenWDS %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d:", ds, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh);
src1 = sf_get(ss1);
src2 = sf_get(ss2);
@@ -1149,10 +1149,10 @@ static void EffectCopy() {
case 11:
case 12:
case 13:
DEBUG_COMMAND("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
DEBUG_COMMAND("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
break;
default:
DEBUG_COMMAND_YET("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
DEBUG_COMMAND_YET("Gpx.EffectCopy %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", no, dx, dy, ss1, sx1, sy1, ss2, sx2, sy2, sw, sh, time, var);
}
dst = sf_get(ss1);
src = sf_get(ss2);
@@ -1163,7 +1163,7 @@ static void EffectCopy() {
static void SetClickCancelFlag() { /* not used ? */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("Gpx.SetClikCancelFlag %d:\n", p1);
DEBUG_COMMAND_YET("Gpx.SetClikCancelFlag %d:", p1);
}
static const ModuleFunc functions[] = {
+1 -1
View File
@@ -26,7 +26,7 @@ void gpx_effect(int no,
enum sdl_effect_type type = from_sact_effect(no);
if (type == EFFECT_INVALID) {
WARNING("Unimplemented effect %d\n", no);
WARNING("Unimplemented effect %d", no);
type = EFFECT_CROSSFADE;
}
SDL_Rect rect = { wx, wy, width, height };
+4 -4
View File
@@ -42,7 +42,7 @@ static void RandMTInit() {
*/
int p1 = getCaliValue(); /* ITimer */
DEBUG_COMMAND("Math.RandMTInit %d:\n", p1);
DEBUG_COMMAND("Math.RandMTInit %d:", p1);
}
static void RandMTGet() {
@@ -61,7 +61,7 @@ static void RandMTGet() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("Math.RandMTGet %d,%p:\n", num, var);
DEBUG_COMMAND("Math.RandMTGet %d,%p:", num, var);
}
static void RandMTMakeNumTable() {
@@ -74,7 +74,7 @@ static void RandMTMakeNumTable() {
numtblmax = p1;
DEBUG_COMMAND("Math.RandMTMakeNumTable %d:\n", p1);
DEBUG_COMMAND("Math.RandMTMakeNumTable %d:", p1);
}
static void RandMTGetNumTable() {
@@ -87,7 +87,7 @@ static void RandMTGetNumTable() {
*var = (int)(genrand() * numtblmax) + 1;
DEBUG_COMMAND("Math.RandMTGetNumTable %d:\n", *var);
DEBUG_COMMAND("Math.RandMTGetNumTable %d:", *var);
}
static const ModuleFunc functions[] = {
+8 -8
View File
@@ -26,7 +26,7 @@ static void Init() {
valid = true;
*p1 = 0;
DEBUG_COMMAND("MsgSkip.Init %p,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND("MsgSkip.Init %p,%d,%d,%d:", p1, p2, p3, p4);
}
static void Start() {
@@ -39,7 +39,7 @@ static void Start() {
free(path);
free(fname_utf8);
DEBUG_COMMAND("MsgSkip.Start %p,%d:\n", p1, p2);
DEBUG_COMMAND("MsgSkip.Start %p,%d:", p1, p2);
}
static void SetValid() {
@@ -48,7 +48,7 @@ static void SetValid() {
valid = p1;
msgskip_pause(!valid);
DEBUG_COMMAND("MsgSkip.SetValid %d:\n", p1);
DEBUG_COMMAND("MsgSkip.SetValid %d:", p1);
}
static void GetValid() {
@@ -56,7 +56,7 @@ static void GetValid() {
*p1 = valid;
DEBUG_COMMAND("MsgSkip.GetValid %p:\n", p1);
DEBUG_COMMAND("MsgSkip.GetValid %p:", p1);
}
static void SetAction() {
@@ -64,7 +64,7 @@ static void SetAction() {
action = p1;
DEBUG_COMMAND("MsgSkip.SetAcion %d:\n", p1);
DEBUG_COMMAND("MsgSkip.SetAcion %d:", p1);
}
static void GetAction() {
@@ -72,19 +72,19 @@ static void GetAction() {
*p1 = action;
DEBUG_COMMAND("MsgSkip.GetAcion %p:\n", p1);
DEBUG_COMMAND("MsgSkip.GetAcion %p:", p1);
}
static void PushStr() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("MsgSkip.PushStr %d:\n", p1);
DEBUG_COMMAND_YET("MsgSkip.PushStr %d:", p1);
}
static void PopStr() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("MsgSkip.PopStr %d:\n", p1);
DEBUG_COMMAND_YET("MsgSkip.PopStr %d:", p1);
}
static const ModuleFunc functions[] = {
+68 -68
View File
@@ -36,7 +36,7 @@ static void Init(void) { /* 0 */
*var = 1;
DEBUG_COMMAND_YET("NIGHTDLL.Init %p:\n", var);
DEBUG_COMMAND_YET("NIGHTDLL.Init %p:", var);
}
static void NIGHTDLL_reset(void) {
@@ -62,7 +62,7 @@ static void InitGame() { /* 1 */
ntmsg_init();
nt_sstr_init();
DEBUG_COMMAND_YET("NIGHTDLL.InitGame:\n");
DEBUG_COMMAND_YET("NIGHTDLL.InitGame:");
}
// メッセージの枠の表示
@@ -71,7 +71,7 @@ static void SetMsgFrame() { /* 2 */
ntmsg_set_frame(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgFram %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgFram %d:", p1);
}
// メッセージの表示位置の設定
@@ -80,21 +80,21 @@ static void SetMsgPlaceMethod(void) { /* 3 */
// 2=メッセージ枠+顔つき
ntmsg_set_place(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgPlaceMethod %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgPlaceMethod %d:", p1);
}
// 未実装?
static void SetMsgDrawEffect(void) { /* 4 */
int p1 = getCaliValue(); // 0, 1, 2, 3 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgDrawEffect %d:", p1);
}
// 未実装?
static void SetMsgClearEffect(void) { /* 5 */
int p1 = getCaliValue(); // 0, 1, 2, 4 (実際にはどれも機能しない?)
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetMsgClearEffect %d:", p1);
}
// 壁紙CGの設定
@@ -103,7 +103,7 @@ static void SetWallPaper(void) { /* 6 */
nt_gr_set_wallpaper(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetWallPaper %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetWallPaper %d:", p1);
}
// 背景CGの設定
@@ -112,7 +112,7 @@ static void SetScenery(void) { /* 7 */
nt_gr_set_scenery(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetScenery %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetScenery %d:", p1);
}
// 顔CGの設定
@@ -121,7 +121,7 @@ static void SetFace(void) { /* 8 */
nt_gr_set_face(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetFace %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetFace %d:", p1);
}
// 立ち絵左の設定
@@ -130,7 +130,7 @@ static void SetSpriteL(void) { /* 9 */
nt_gr_set_spL(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteL %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteL %d:", p1);
}
// 立ち絵中央の設定
@@ -139,7 +139,7 @@ static void SetSpriteM(void) { /* 10 */
nt_gr_set_spM(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteM %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteM %d:", p1);
}
// 立ち絵右の設定
@@ -148,7 +148,7 @@ static void SetSpriteR(void) { /* 11 */
nt_gr_set_spR(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteR %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteR %d:", p1);
}
// 立ち絵左の設定(季節違い?)
@@ -157,7 +157,7 @@ static void SetSpriteSeasonL(void) { /* 12 */
nt_gr_set_spsL(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonL %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonL %d:", p1);
}
// 立ち絵中央の設定(季節違い?)
@@ -166,7 +166,7 @@ static void SetSpriteSeasonM(void) { /* 13 */
nt_gr_set_spM(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonM %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonM %d:", p1);
}
// 立ち絵右の設定(季節違い?)
@@ -175,14 +175,14 @@ static void SetSpriteSeasonR(void) { /* 14 */
nt_gr_set_spsR(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonR %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSpriteSeasonR %d:", p1);
}
// 改行
static void StartNewLine(void) { /* 15 */
ntmsg_newline();
DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:\n");
DEBUG_COMMAND_YET("NIGHTDLL.StartNewLine:");
}
// メッセージフォントサイズの設定
@@ -191,7 +191,7 @@ static void SetFontSize(void) { /* 16 */
night.fontsize = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetFontSize %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetFontSize %d:", p1);
}
// フォントの種類の設定
@@ -200,7 +200,7 @@ static void SetFont(void) { /* 17 */
night.fonttype = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetFont %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetFont %d:", p1);
}
// 選択肢モード ON
@@ -209,7 +209,7 @@ static void SetSelMode(void) { /* 18 */
night.selmode = p1;
DEBUG_COMMAND_YET("NIGHTDLL.SetSelMode %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetSelMode %d:", p1);
}
// キー入力待ち後、改ページ
@@ -218,7 +218,7 @@ static void AnalyzeMessage(void) { /* 19 */
*var = ntmsg_ana();
DEBUG_COMMAND_YET("NIGHTDLL.AnalyzeMessage %p:\n", var);
DEBUG_COMMAND_YET("NIGHTDLL.AnalyzeMessage %p:", var);
}
// ~DRAWの効果時間
@@ -227,7 +227,7 @@ static void SetDrawTime(void) { /* 20 */
nt_gr_set_drawtime(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetDrawTime %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetDrawTime %d:", p1);
}
// 効果つき画面更新
@@ -236,7 +236,7 @@ static void Draw(void) { /* 21 */
nt_gr_draw(p1);
DEBUG_COMMAND_YET("NIGHTDLL.Draw %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.Draw %d:", p1);
}
// 音声データを再生
@@ -245,21 +245,21 @@ static void SetVoice(void) { /* 22 */
nt_voice_set(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetVoice %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetVoice %d:", p1);
}
// 未使用
static void WaitKey(void) { /* 23 */
int p1 = getCaliValue(); //
DEBUG_COMMAND_YET("NIGHTDLL.WaitKey %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.WaitKey %d:", p1);
}
static void AddFeeling(void) { /* 24 */
int p1 = getCaliValue(); // person(1:新開,2:星川,3:百瀬,4:いずみ,5:鏡花,6:真言美,7:マコト
int p2 = getCaliValue(); // val
DEBUG_COMMAND_YET("NIGHTDLL.AddFeeling %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.AddFeeling %d:", p1);
}
@@ -267,7 +267,7 @@ static void SubFeeling(void) { /* 25 */
int p1 = getCaliValue(); // person
int p2 = getCaliValue(); // val
DEBUG_COMMAND_YET("NIGHTDLL.SubFeeling %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SubFeeling %d:", p1);
}
static void CallEvent(void) { /* 26 */
@@ -275,7 +275,7 @@ static void CallEvent(void) { /* 26 */
nt_sco_callevent(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CallEvent %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.CallEvent %d:", p1);
}
static void ScreenCG(void) { /* 27 */
@@ -294,7 +294,7 @@ static void ScreenCG(void) { /* 27 */
nt_gr_screencg(no, x, y);
DEBUG_COMMAND_YET("NIGHTDLL.ScreenCG %d,%d,%d:\n", x, y, no);
DEBUG_COMMAND_YET("NIGHTDLL.ScreenCG %d,%d,%d:", x, y, no);
}
static void RunGameMain(void) { /* 28 */
@@ -310,7 +310,7 @@ static void RunGameMain(void) { /* 28 */
*p1 = nt_sco_main(p5);
DEBUG_COMMAND_YET("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5);
DEBUG_COMMAND_YET("NIGHTDLL.RunGameMain %p,%d,%d,%d,%d:", p1, p2, p3, p4, p5);
}
static void CheckNewGame(void) { /* 29 */
@@ -318,21 +318,21 @@ static void CheckNewGame(void) { /* 29 */
*p1 = 0;
DEBUG_COMMAND_YET("NIGHTDLL.CheckNewGame %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.CheckNewGame %p:", p1);
}
static void SaveStartData(void) { /* 30 */
DEBUG_COMMAND_YET("NIGHTDLL.SaveStartData:\n");
DEBUG_COMMAND_YET("NIGHTDLL.SaveStartData:");
}
static void PrintExitSystem(void) { /* 31 */
DEBUG_COMMAND_YET("NIGHTDLL.PrintExitSystem:\n");
DEBUG_COMMAND_YET("NIGHTDLL.PrintExitSystem:");
}
static void SetCalendar(void) { /* 32 */
int p1 = getCaliValue(); // 0, 1, 2
DEBUG_COMMAND_YET("NIGHTDLL.SetCalendar %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetCalendar %d:", p1);
}
static void SetDate(void) { /* 33 */
@@ -344,7 +344,7 @@ static void SetDate(void) { /* 33 */
night.Day = p2;
night.DayOfWeek = p3;
DEBUG_COMMAND_YET("NIGHTDLL.SetDate %d,%d,%d:\n", p1, p2, p3);
DEBUG_COMMAND_YET("NIGHTDLL.SetDate %d,%d,%d:", p1, p2, p3);
}
static void GetDate(void) { /* 34 */
@@ -356,11 +356,11 @@ static void GetDate(void) { /* 34 */
*p2 = night.Day;
*p3 = night.DayOfWeek;
DEBUG_COMMAND_YET("NIGHTDLL.GetDate %p,%p,%p:\n", p1, p2, p3);
DEBUG_COMMAND_YET("NIGHTDLL.GetDate %p,%p,%p:", p1, p2, p3);
}
static void SelectGameLevel(void) { /* 35 */
DEBUG_COMMAND_YET("NIGHTDLL.SelectGameLevel:\n");
DEBUG_COMMAND_YET("NIGHTDLL.SelectGameLevel:");
}
static void RunEventDungeon(void) { /* 36 */
@@ -369,13 +369,13 @@ static void RunEventDungeon(void) { /* 36 */
*p1 = 1;
DEBUG_COMMAND_YET("NIGHTDLL.RunEventDungeon %p,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.RunEventDungeon %p,%d:", p1, p2);
}
static void RunEventBattle(void) { /* 37 */
int p1 = getCaliValue(); // 実際には機能しない?
DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.RunEventBattle %d:", p1);
}
// CD再生開始
@@ -384,7 +384,7 @@ static void CDPlay(void) { /* 38 */
nt_cd_play(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDPlay %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDPlay %d:", p1);
}
// CD再生停止
@@ -393,7 +393,7 @@ static void CDStop(void) { /* 39 */
nt_cd_stop(p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDStop %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDStop %d:", p1);
}
// CDのmute
@@ -402,7 +402,7 @@ static void CDMute(void) { /* 40 */
nt_cd_mute(p1 == 0 ? FALSE : TRUE);
DEBUG_COMMAND_YET("NIGHTDLL.CDMute %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.CDMute %d:", p1);
}
// ch に効果音番号をセット
@@ -412,7 +412,7 @@ static void SoundEffectSetWave(void) { /* 41 */
nt_snd_setwave(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetWave %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetWave %d,%d:", p1, p2);
}
// ch にくり返し数をセット
@@ -422,7 +422,7 @@ static void SoundEffectSetLoop(void) { /* 42 */
nt_snd_setloop(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetLoop %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetLoop %d,%d:", p1, p2);
}
// ch に音量をセット
@@ -432,7 +432,7 @@ static void SoundEffectSetVolume(void) { /* 43 */
nt_snd_setvol(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetVolue %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetVolue %d,%d:", p1, p2);
}
// 効果音の再生を終るまで待つか待たないか?
@@ -442,7 +442,7 @@ static void SoundEffectSetSyncFlag(void) { /* 44 */
nt_snd_waitend(p1, p2 == 0 ? FALSE : TRUE);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectSetSyncFlag %d,%d:", p1, p2);
}
// ch の効果音を再生
@@ -451,7 +451,7 @@ static void SoundEffectPlay(void) { /* 45 */
nt_snd_play(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectPlay %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectPlay %d:", p1);
}
// ch の効果音を停止
@@ -461,7 +461,7 @@ static void SoundEffectStop(void) { /* 46 */
nt_snd_stop(p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStop %d,%d:\n", p1,p2);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStop %d,%d:", p1,p2);
}
// 全てのチャンネルの再生を停止
@@ -470,86 +470,86 @@ static void SoundEffectStopAll(void) { /* 47 */
nt_snd_stopall(p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStopAll %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SoundEffectStopAll %d:", p1);
}
static void RunSoundMode(void) { /* 48 */
DEBUG_COMMAND_YET("NIGHTDLL.RunSoundMode:\n");
DEBUG_COMMAND_YET("NIGHTDLL.RunSoundMode:");
}
static void RunMapEditor(void) { /* 49 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.RunMapEditor %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.RunMapEditor %p:", p1);
}
static void VisualListClear(void) { /* 50 */
DEBUG_COMMAND_YET("NIGHTDLL.VisualListClear:\n");
DEBUG_COMMAND_YET("NIGHTDLL.VisualListClear:");
}
static void VisualListAdd(void) { /* 51 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.VisualListAdd %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.VisualListAdd %d:", p1);
}
static void GetLocalCountCG(void) { /* 52 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetLocalCountCG %p,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.GetLocalCountCG %p,%d:", p1, p2);
}
static void PlayMemory(void) { /* 53 */
int *p1 = getCaliVariable(); // 回想ページ
int *p2 = getCaliVariable(); // 回想RESULT
DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.PlayMemory %p,%p:", p1, p2);
}
static void GetEventFlagTotal(void) { /* 54 */
int *p1 = getCaliVariable();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetEventFlagTotal %p,%d:\n", p1, p2);
DEBUG_COMMAND_YET("NIGHTDLL.GetEventFlagTotal %p,%d:", p1, p2);
}
static void SetPlayerName(void) { /* 55 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.SetPlayerName %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SetPlayerName %d:", p1);
}
static void GetPlayerName(void) { /* 56 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.GetPlayerName %d:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.GetPlayerName %d:", p1);
}
static void SaveGame(void) { /* 57 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.SaveGame %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.SaveGame %p:", p1);
}
static void LoadGame(void) { /* 58 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.LoadGame %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.LoadGame %p:", p1);
}
static void ExistSaveData(void) { /* 59 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistSaveData %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.ExistSaveData %p:", p1);
}
static void ExistStartData(void) { /* 60 */
int *p1 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.ExistStartData %p:\n", p1);
DEBUG_COMMAND_YET("NIGHTDLL.ExistStartData %p:", p1);
}
static void SetAreaData(void) { /* 61 */
@@ -557,27 +557,27 @@ static void SetAreaData(void) { /* 61 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("NIGHTDLL.SetAreaData %d,%d,%d:\n", p1, p2, p3);
DEBUG_COMMAND_YET("NIGHTDLL.SetAreaData %d,%d,%d:", p1, p2, p3);
}
static void RunBattleTest(void) { /* 62 */
DEBUG_COMMAND_YET("NIGHTDLL.RunBattleTest:\n");
DEBUG_COMMAND_YET("NIGHTDLL.RunBattleTest:");
}
static void RunTrainingTest(void) { /* 63 */
DEBUG_COMMAND_YET("NIGHTDLL.RunTrainingTest:\n");
DEBUG_COMMAND_YET("NIGHTDLL.RunTrainingTest:");
}
static void TestEventCall(void) { /* 64 */
DEBUG_COMMAND_YET("NIGHTDLL.TestEventCall:\n");
DEBUG_COMMAND_YET("NIGHTDLL.TestEventCall:");
}
static void Test(void) { /* 65 */
DEBUG_COMMAND_YET("NIGHTDLL.Test:\n");
DEBUG_COMMAND_YET("NIGHTDLL.Test:");
}
static void DebugScenario(void) { /* 66 */
DEBUG_COMMAND_YET("NIGHTDLL.DebugScenario:\n");
DEBUG_COMMAND_YET("NIGHTDLL.DebugScenario:");
}
static void GetDLLTime(void) { /* 67 */
@@ -589,7 +589,7 @@ static void GetDLLTime(void) { /* 67 */
int *p6 = getCaliVariable();
int *p7 = getCaliVariable();
DEBUG_COMMAND_YET("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("NIGHTDLL.GetDLLTime %p,%p,%p,%p,%p,%p,%p:", p1, p2, p3, p4, p5, p6, p7);
}
static const ModuleFunc functions[] = {
+7 -7
View File
@@ -55,7 +55,7 @@ extern int ntsel_dosel(void);
static void ntmsg_out(int wNum, int wSize, int wColorR, int wColorG, int wColorB, int wFont, int wSpeed, int wLineSpace);
static void set_align(char *msg, sprite_t *sp, int wSize);
static BYTE *get_char(BYTE *msg, char *mbuf, int bufmax);
static uint8_t *get_char(uint8_t *msg, char *mbuf, int bufmax);
static void cb_keyrelease(agsevent_t *e);
static void cb_mousemove(agsevent_t *e);
static void setup_hakanim();
@@ -177,20 +177,20 @@ void ntmsg_set_place(int type) {
}
void ntmsg_newline() {
BYTE buf[2] = {'\n', '\0'};
uint8_t buf[2] = {'\n', '\0'};
ntmsg_add(buf);
}
void ntmsg_add(const char *msg) {
int len;
SACT_DEBUG("len = %d\n", strlen(msg));
SACT_DEBUG("len = %d", strlen(msg));
if (msg[0] == '\0') return;
len = MSGBUFMAX - (int)strlen(night.msgbuf);
if (len < 0) {
WARNING("buf shortage (%d)\n", len);
WARNING("buf shortage (%d)", len);
return;
}
strncat(night.msgbuf, msg, len);
@@ -371,14 +371,14 @@ static void set_align(char *msg, sprite_t *sp, int wSize) {
}
static BYTE *get_char(BYTE *msg, char *mbuf, int bufmax) {
static uint8_t *get_char(uint8_t *msg, char *mbuf, int bufmax) {
if (msg[0] == '\n') {
mbuf[0] = '\n';
mbuf[1] = '\0';
return msg +1;
}
BYTE *p = advance_char(msg, nact->encoding);
uint8_t *p = advance_char(msg, nact->encoding);
while (msg < p)
*mbuf++ = *msg++;
*mbuf = '\0';
@@ -475,7 +475,7 @@ int ntmsg_update(sprite_t *sp, MyRectangle *r) {
gre_BlendUseAMap(sf0, dx, dy, sf0, dx, dy, sp->u.msg.canvas, sx, sy, w, h, sp->u.msg.canvas, sx, sy, sp->blendrate);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d",
sp->no, sx, sy, w, h, dx, dy);
return OK;
+3 -3
View File
@@ -30,7 +30,7 @@ static struct _scoadr scene2adr(int no) {
struct _scoadr adr = {0, 0};
snprintf(label, 7, "E%05d", no);
SACT_DEBUG("seaching %6s\n", label);
SACT_DEBUG("seaching %6s", label);
for (i = 0; i < nact->ain.fncnum; i++) {
if (0 == strncmp(nact->ain.fnc[i].name, label, 6)) {
adr.page = nact->ain.fnc[i].page;
@@ -39,7 +39,7 @@ static struct _scoadr scene2adr(int no) {
}
}
WARNING("no scene %d\n", no);
WARNING("no scene %d", no);
return adr;
}
@@ -53,7 +53,7 @@ static void ntmain(struct _scoadr inadr) {
while (!nact->is_quit) {
for (int cnt = 0; !nact->is_quit && !nact->wait_vsync && cnt < 10000; cnt++) {
//SACT_DEBUG("%d:%x\n", sl_getPage(), sl_getIndex());
//SACT_DEBUG("%d:%x", sl_getPage(), sl_getIndex());
if (!nact->popupmenu_opened) {
exec_command();
if (sl_getPage() == inadr.page &&
+1 -1
View File
@@ -23,7 +23,7 @@ void nt_voice_set(int no) {
}
void nt_cd_play(int no) {
mus_cdrom_start(no +1, 0);
muscd_start(no + 1, 0);
}
void nt_cd_stop(int msec) {
+3 -3
View File
@@ -44,7 +44,7 @@ static cginfo_t *cgs[CGMAX];
#define spcg_assert_no(no) \
if ((no) > (CGMAX -1)) { \
WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); \
WARNING("no is too large (should be %d < %d)", (no), CGMAX); \
return NG; \
} \
@@ -71,7 +71,7 @@ static cginfo_t *nt_scg_new(enum cgtype type, int no, surface_t *sf) {
*/
static cginfo_t *nt_scg_get(int no) {
if (no >= (CGMAX -1)) {
WARNING("no is too large (should be %d < %d)\n", (no), CGMAX);
WARNING("no is too large (should be %d < %d)", (no), CGMAX);
return NULL;
}
@@ -80,7 +80,7 @@ static cginfo_t *nt_scg_get(int no) {
surface_t *sf = sf_loadcg_no(no - 1);
if (!sf) {
WARNING("load fail (%d)\n", no -1);
WARNING("load fail (%d)", no -1);
return NULL;
}
return nt_scg_new(CG_LINKED, no, sf);
+11 -11
View File
@@ -5,7 +5,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
int sw, sh;
int *row, *col;
int x, y;
BYTE *sdata, *ddata;
uint8_t *sdata, *ddata;
dst->width = dw;
dst->height = dh;
@@ -57,14 +57,14 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
#define SCALEDCOPYAREA(type) { \
int x, y; \
type *sl, *dl; \
BYTE *_sl, *_dl; \
uint8_t *_sl, *_dl; \
for (y = 0; y < dh; y++) { \
sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\
dl = (type *)(ddata + y * dst->bytes_per_line);\
for (x = 0; x < dw; x++) { \
*(dl + x) = *(sl + *(row + x)); \
} \
_dl = (BYTE *)dl; \
_dl = (uint8_t *)dl; \
while(*(col + y) == *(col + y + 1)) { \
_sl = _dl; \
_dl += dst->bytes_per_line; \
@@ -75,29 +75,29 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
switch(dst->depth) {
case 8:
SCALEDCOPYAREA(BYTE); break;
SCALEDCOPYAREA(uint8_t); break;
case 16:
SCALEDCOPYAREA(WORD); break;
SCALEDCOPYAREA(uint16_t); break;
case 24:
case 32:
SCALEDCOPYAREA(DWORD); break;
SCALEDCOPYAREA(uint32_t); break;
default:
break;
}
if (src->alpha) {
int x, y;
BYTE *sl, *dl;
BYTE *_sl, *_dl;
uint8_t *sl, *dl;
uint8_t *_sl, *_dl;
sdata = GETOFFSET_ALPHA(src, 0, 0);
ddata = GETOFFSET_ALPHA(dst, 0, 0);
for (y = 0; y < dh; y++) {
sl = (BYTE *)(sdata + *(y + col) * src->width);
dl = (BYTE *)(ddata + y * dst->width);
sl = (uint8_t *)(sdata + *(y + col) * src->width);
dl = (uint8_t *)(ddata + y * dst->width);
for (x = 0; x < dw; x++) {
*(dl + x) = *(sl + *(row + x));
}
_dl = (BYTE *)dl;
_dl = (uint8_t *)dl;
while(*(col + y) == *(col + y + 1)) {
_sl = _dl;
_dl += dst->width;
+2 -2
View File
@@ -96,7 +96,7 @@ int nt_sp_draw2(sprite_t *sp, cginfo_t *cg, MyRectangle *r) {
}
}
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d",
sp->no, sx, sy, w, h, dx, dy);
return OK;
@@ -136,7 +136,7 @@ int nt_sp_draw_scg(sprite_t *sp, MyRectangle *r) {
sf0, dx, dy,
cg->sf, sx, sy, w, h);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d",
sp->no, sx, sy, w, h, dx, dy);
return OK;
+1 -1
View File
@@ -47,7 +47,7 @@ int nt_sp_eupdate(int no, int time, int cancel) {
enum sdl_effect_type type = from_sact_effect(no - 100);
if (type == EFFECT_INVALID) {
WARNING("Unimplemented effect %d\n", no);
WARNING("Unimplemented effect %d", no);
type = EFFECT_CROSSFADE;
}
SDL_Rect rect = { 0, 0, sf0->width, sf0->height };
+4 -4
View File
@@ -68,7 +68,7 @@ static MyRectangle get_updatearea() {
// surface0との領域の積をとる
SDL_IntersectRect(&rsf0, &clip, &result);
SACT_DEBUG("clipped area x=%d y=%d w=%d h=%d\n",
SACT_DEBUG("clipped area x=%d y=%d w=%d h=%d",
result.x, result.y, result.w, result.h);
return result;
@@ -150,7 +150,7 @@ int nt_sp_updateme(sprite_t *sp) {
updatearea = slist_append(updatearea, r);
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d\n",
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d",
r->x, r->y, sp->no, r->w, r->h);
return OK;
@@ -178,7 +178,7 @@ int nt_sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
updatearea = slist_append(updatearea, r);
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d\n",
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d",
r->x, r->y, sp->no, r->w, r->h);
return OK;
@@ -223,7 +223,7 @@ int nt_sp_draw_wall(sprite_t *sp, MyRectangle *area) {
h = area->h;
gr_fill(sf0, sx, sy, w, h, 0, 0, 0);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, \n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d",
sp->no, sx, sy, w, h);
return OK;
+5 -5
View File
@@ -51,7 +51,7 @@ static void ndd_run(int demonum) {
int mus = ndemo_mus[demonum];
if (mus)
mus_bgm_play(mus, 0, 100);
musbgm_play(mus, 0, 100);
uint32_t start = sdl_getTicks();
while (!nact->is_quit) {
@@ -65,7 +65,7 @@ static void ndd_run(int demonum) {
ags_updateFull();
cgdata_free(cg);
} else {
WARNING("Cannot decode CG %d in %s\n", i, alk_path);
WARNING("Cannot decode CG %d in %s", i, alk_path);
}
int wait_ms = (i + 1) * (1000 / FPS) - (sdl_getTicks() - start);
@@ -79,7 +79,7 @@ static void ndd_run(int demonum) {
}
if (mus)
mus_bgm_stop(ndemo_mus[demonum], 0);
musbgm_stop(ndemo_mus[demonum], 0);
alk_free(alk);
}
@@ -92,7 +92,7 @@ static void Init() {
*var = 1;
DEBUG_COMMAND("NightDemonDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND("NightDemonDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void Run() {
@@ -101,7 +101,7 @@ static void Run() {
ndd_run(p1);
DEBUG_COMMAND("NightDemonDemo.Run %d,%d:\n", p1, p2);
DEBUG_COMMAND("NightDemonDemo.Run %d,%d:", p1, p2);
}
static const ModuleFunc functions[] = {
+3 -3
View File
@@ -40,7 +40,7 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ITimer */
DEBUG_COMMAND_YET("RandMT.Init %p:\n", p1);
DEBUG_COMMAND_YET("RandMT.Init %p:", p1);
}
static void Get() {
@@ -59,7 +59,7 @@ static void Get() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("RandMT.Get %d,%p:\n", num, var);
DEBUG_COMMAND("RandMT.Get %d,%p:", num, var);
}
static void GetNoOverlap() {
@@ -69,7 +69,7 @@ static void GetNoOverlap() {
*var = (int)(genrand() * n) + min;
DEBUG_COMMAND("RandMT.GetNoOverlap %d,%d,%p:\n", min, n, var);
DEBUG_COMMAND("RandMT.GetNoOverlap %d,%d,%p:", min, n, var);
}
static const ModuleFunc functions[] = {
+140 -138
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -99,8 +99,8 @@ static surface_t *smask_get(int no) {
// ベースになるマスクの alpha 値を拡大して取り出す
static surface_t *smask_mul(surface_t *sf, int val) {
surface_t *out = sf_create_alpha(sf->width, sf->height);
BYTE *src = sf->alpha;
BYTE *dst = out->alpha;
uint8_t *src = sf->alpha;
uint8_t *dst = out->alpha;
int pix = sf->width * sf->height;
while(pix--) {
-93
View File
@@ -1,93 +0,0 @@
/*
* sactbgm.c: SACT Music 関連
*
* 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: sactbgm.c,v 1.4 2003/08/30 21:29:16 chikama Exp $ */
#include "config.h"
#include <stdio.h>
#include "portab.h"
#include "system.h"
#include "ald_manager.h"
#include "music.h"
// 指定の番号の音楽が存在するかチェック
int smus_check(int no) {
dridata *dfile = ald_getdata(DRIFILE_BGM, no -1);
int st = 0;
if (dfile == NULL) {
st = 0;
} else {
st = 1;
ald_freedata(dfile);
}
return st;
}
// 指定の番号の音楽の長さを取得
int smus_getlength(int no) {
return mus_bgm_getlength(no);
}
// 指定の番号の音楽の再生位置を取得
int smus_getpos(int no) {
return mus_bgm_getpos(no);
}
// 指定の番号の音楽の再生開始
int smus_play(int no, int time, int vol) {
mus_bgm_play(no, time, vol);
return OK;
}
// 指定の番号の音楽の再生停止
int smus_stop(int no, int fadetime) {
mus_bgm_stop(no, fadetime);
return OK;
}
// 指定の番号の音楽のボリュームフェード
int smus_fade(int no, int time, int vol) {
mus_bgm_fade(no, time, vol);
return OK;
}
// 指定の番号の音楽が終了するのを待つ
int smus_wait(int no, int timeout) {
mus_bgm_wait(no, timeout);
return OK;
}
// 指定の番号の音楽が指定の位置まで再生されるのを待つ
int smus_waitpos(int no, int index) {
mus_bgm_waitpos(no, index);
return OK;
}
// 全ての音楽の再生を停止
int smus_stopall(int time) {
mus_bgm_stopall(time);
return OK;
}
+3 -3
View File
@@ -41,7 +41,7 @@
#define spcg_assert_no(no) \
if ((no) > (CGMAX -1)) { \
WARNING("no is too large (should be %d < %d)\n", (no), CGMAX); \
WARNING("no is too large (should be %d < %d)", (no), CGMAX); \
return NG; \
} \
@@ -68,7 +68,7 @@ static cginfo_t *scg_new(enum cgtype type, int no, surface_t *sf) {
*/
static cginfo_t *scg_get(int no) {
if (no >= (CGMAX -1)) {
WARNING("no is too large (should be %d < %d)\n", (no), CGMAX);
WARNING("no is too large (should be %d < %d)", (no), CGMAX);
return NULL;
}
@@ -77,7 +77,7 @@ static cginfo_t *scg_get(int no) {
surface_t *sf = sf_loadcg_no(no - 1);
if (!sf) {
WARNING("load fail (%d)\n", no -1);
WARNING("load fail (%d)", no -1);
return NULL;
}
return scg_new(CG_LINKED, no, sf);
+11 -11
View File
@@ -5,7 +5,7 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
int sw, sh;
int *row, *col;
int x, y;
BYTE *sdata, *ddata;
uint8_t *sdata, *ddata;
dst->width = dw;
dst->height = dh;
@@ -57,14 +57,14 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
#define SCALEDCOPYAREA(type) { \
int x, y; \
type *sl, *dl; \
BYTE *_sl, *_dl; \
uint8_t *_sl, *_dl; \
for (y = 0; y < dh; y++) { \
sl = (type *)(sdata + *(y + col) * src->bytes_per_line);\
dl = (type *)(ddata + y * dst->bytes_per_line);\
for (x = 0; x < dw; x++) { \
*(dl + x) = *(sl + *(row + x)); \
} \
_dl = (BYTE *)dl; \
_dl = (uint8_t *)dl; \
while(*(col + y) == *(col + y + 1)) { \
_sl = _dl; \
_dl += dst->bytes_per_line; \
@@ -75,29 +75,29 @@ static surface_t *stretch(surface_t *src, int dw, int dh, int mirror) {
switch(dst->depth) {
case 8:
SCALEDCOPYAREA(BYTE); break;
SCALEDCOPYAREA(uint8_t); break;
case 16:
SCALEDCOPYAREA(WORD); break;
SCALEDCOPYAREA(uint16_t); break;
case 24:
case 32:
SCALEDCOPYAREA(DWORD); break;
SCALEDCOPYAREA(uint32_t); break;
default:
break;
}
if (src->alpha) {
int x, y;
BYTE *sl, *dl;
BYTE *_sl, *_dl;
uint8_t *sl, *dl;
uint8_t *_sl, *_dl;
sdata = GETOFFSET_ALPHA(src, 0, 0);
ddata = GETOFFSET_ALPHA(dst, 0, 0);
for (y = 0; y < dh; y++) {
sl = (BYTE *)(sdata + *(y + col) * src->width);
dl = (BYTE *)(ddata + y * dst->width);
sl = (uint8_t *)(sdata + *(y + col) * src->width);
dl = (uint8_t *)(ddata + y * dst->width);
for (x = 0; x < dw; x++) {
*(dl + x) = *(sl + *(row + x));
}
_dl = (BYTE *)dl;
_dl = (uint8_t *)dl;
while(*(col + y) == *(col + y + 1)) {
_sl = _dl;
_dl += dst->width;
+5 -5
View File
@@ -32,22 +32,22 @@
*/
int scryp_encrypt_word(int *array, int num, int key) {
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
return OK;
}
int scryp_decrypt_word(int *array, int num, int key) {
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
return OK;
}
int scryp_encrypt_str(int strno, int key) {
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
return OK;
}
int scryp_decrypt_str(int strno, int key) {
WARNING("str = '%s'\n", svar_get(strno));
WARNING("NOT IMPLEMENTED\n");
WARNING("str = '%s'", svar_get(strno));
WARNING("NOT IMPLEMENTED");
return OK;
}
+1 -1
View File
@@ -167,7 +167,7 @@ int ssnd_playLRrev(int no) {
// 指定の番号の効果音が存在するかどうかをチェック
int ssnd_getlinknum(int no) {
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
return OK;
}
+6 -6
View File
@@ -44,14 +44,14 @@ static int compare_spriteno_smallfirst(const void *a, const void *b);
#define sp_assert_no(no) do { \
if ((no) >= SPRITEMAX) { \
WARNING("no is too large (should be %d < %d)\n", no, SPRITEMAX); \
WARNING("no is too large (should be %d < %d)", no, SPRITEMAX); \
return NG; \
} \
} while (0)
#define sp_assert_null(no) do { \
if (sact.sp[no] == NULL) { \
WARNING("sprite %d is NULL\n", no); \
WARNING("sprite %d is NULL", no); \
return NG; \
} \
} while (0)
@@ -81,7 +81,7 @@ static int sp_draw_wall(sprite_t *sp) {
h = sact.updaterect.h;
gr_fill(sf0, sx, sy, w, h, 0, 0, 0);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, \n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d",
sp->no, sx, sy, w, h);
return OK;
@@ -711,7 +711,7 @@ int sp_sound_set(int wNumSP, int wNumWave1, int wNumWave2, int wNumWave3) {
// すべてのスプライトサウンドの終了を待つ
int sp_sound_wait() {
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
return OK;
}
@@ -728,10 +728,10 @@ int sp_sound_ob(int wNumWave) {
* @return: TRUE:入っている, FALSE: 入っていない
*/
boolean sp_is_insprite(sprite_t *sp, int x, int y) {
BYTE *dp;
uint8_t *dp;
if (x < 0 || y < 0 || x >= sf0->width || y >= sf0->height) return FALSE;
dp = GETOFFSET_PIXEL(sact.dmap, x, y);
return (*(WORD *)dp == sp->no);
return (*(uint16_t *)dp == sp->no);
}
+1 -1
View File
@@ -62,7 +62,7 @@ static int eventCB_ANIM(sprite_t *sp, agsevent_t *e) {
sp->curcg = sp->cg3; break;
}
// SACT_DEBUG("anime update\n");
// SACT_DEBUG("anime update");
// カウントアップ
sp->u.anime.tick++;
+10 -10
View File
@@ -35,20 +35,20 @@
#include "ngraph.h"
#include "sprite.h"
static void fill_dmap(int dx ,int dy, int w, int h, WORD val);
static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, WORD val);
static void fill_dmap(int dx ,int dy, int w, int h, uint16_t val);
static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, uint16_t val);
// 矩形の depthmap を描画
static void fill_dmap(int dx ,int dy, int w, int h, WORD val) {
BYTE *dp, *dp_;
static void fill_dmap(int dx ,int dy, int w, int h, uint16_t val) {
uint8_t *dp, *dp_;
int x, y;
dp = dp_ = (GETOFFSET_PIXEL(sact.dmap, dx, dy));
for (x = 0; x < w; x++) {
*((WORD *)dp + x) = val;
*((uint16_t *)dp + x) = val;
}
dp += sact.dmap->bytes_per_line;
@@ -59,16 +59,16 @@ static void fill_dmap(int dx ,int dy, int w, int h, WORD val) {
}
// alphamapにしたがって、alpha値が0より大きいところを指定のdepthとする
static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, WORD val) {
BYTE *sp, *dp;
static void fill_dmap_mask(surface_t *src, int sx, int sy, int dx ,int dy, int w, int h, uint16_t val) {
uint8_t *sp, *dp;
int x, y;
dp = GETOFFSET_PIXEL(sact.dmap, dx, dy);
sp = GETOFFSET_ALPHA(src, sx, sy);
for (y = 0; y < h; y++) {
BYTE *yls = (BYTE *)(sp + y * src->width);
WORD *yld = (WORD *)(dp + y * sact.dmap->bytes_per_line);
uint8_t *yls = (uint8_t *)(sp + y * src->width);
uint16_t *yld = (uint16_t *)(dp + y * sact.dmap->bytes_per_line);
for (x = 0; x < w; x++) {
if (*yls > 0) *yld = val;
yls++; yld++;
@@ -137,7 +137,7 @@ int sp_draw2(sprite_t *sp, cginfo_t *cg) {
}
}
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n", sp->no, sx, sy, w, h, dx, dy);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d", sp->no, sx, sy, w, h, dx, dy);
return OK;
}
+1 -1
View File
@@ -48,7 +48,7 @@ int sp_eupdate(int type, int time, int cancel) {
enum sdl_effect_type sdl_effect = from_sact_effect(type);
if (sdl_effect == EFFECT_INVALID) {
WARNING("Unimplemented effect %d\n", type);
WARNING("Unimplemented effect %d", type);
type = EFFECT_CROSSFADE;
}
SDL_Rect rect = { 0, 0, sf0->width, sf0->height };
+4 -4
View File
@@ -91,7 +91,7 @@ static void cb_focused_swsp(void* s, void* data) {
int *update = (int *)data;
boolean oldstate = sp->show;
SACT_DEBUG("show up spex %d\n", sp->no);
SACT_DEBUG("show up spex %d", sp->no);
sp->show = TRUE;
if (oldstate != sp->show) {
@@ -109,7 +109,7 @@ static void cb_defocused_swsp(void* s, void* data) {
int *update = (int *)data;
boolean oldstate = sp->show;
SACT_DEBUG("hide spex %d\n", sp->no);
SACT_DEBUG("hide spex %d", sp->no);
sp->show = FALSE;
if (oldstate != sp->show) {
@@ -173,7 +173,7 @@ static int cb_focused(sprite_t *sp) {
update++;
}
sp->focused = TRUE;
SACT_DEBUG("get forcused %d, type %d\n", sp->no, sp->type);
SACT_DEBUG("get forcused %d, type %d", sp->no, sp->type);
if (sp->numsound1) {
ssnd_play(sp->numsound1);
}
@@ -196,7 +196,7 @@ static int cb_defocused(sprite_t *sp) {
sp->curcg = sp->cg1;
update++;
sp->focused = FALSE;
SACT_DEBUG("lost forcused %d\n", sp->no);
SACT_DEBUG("lost forcused %d", sp->no);
}
return update;
+2 -2
View File
@@ -75,7 +75,7 @@ static int move_cb(sprite_t *sp, agsevent_t *e) {
// 現在時刻の取得
now = sact.movecurtime;
SACT_DEBUG("no = %d now = %d st = %d, ed = %d\n",
SACT_DEBUG("no = %d now = %d st = %d, ed = %d",
sp->no, now, sp->move.starttime, sp->move.endtime);
if (now >= sp->move.endtime) {
@@ -139,7 +139,7 @@ void spev_move_setup(void* data, void* userdata) {
// タイマコールバック登録
spev_add_teventlistener(sp, move_cb);
SACT_DEBUG("no=%d,from(%d,%d@%d)to(%d,%d@%d),time=%d\n", sp->no,
SACT_DEBUG("no=%d,from(%d,%d@%d)to(%d,%d@%d),time=%d", sp->no,
sp->cur.x, sp->cur.y, sp->move.starttime,
sp->move.to.x, sp->move.to.y, sp->move.endtime,
sp->move.time);
+8 -8
View File
@@ -51,8 +51,8 @@ static void replacestr_cb(void* data, void* userdata);
static char *replacestr(char *msg);
static void update_mark(sprite_t *sp, cginfo_t *cg);
static int setupmark(int wNum1, int wNum2, struct markinfo *minfo);
static int get_linelen(BYTE *msg);
static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax);
static int get_linelen(uint8_t *msg);
static uint8_t *get_char(uint8_t *msg, char *mbuf, char *rbuf, int bufmax);
static void append_to_log(char *msg);
static void sactlog_newline();
static void set_align(char *msg, sprite_t *sp, int wSize, int wAlign);
@@ -194,7 +194,7 @@ void smsg_add(const char *msg) {
len = MSGBUFMAX - (int)strlen(sact.msgbuf);
if (len < 0) {
WARNING("buf shortage (%d)\n", len);
WARNING("buf shortage (%d)", len);
return;
}
@@ -210,7 +210,7 @@ void smsg_add(const char *msg) {
@param size: 改行幅
*/
void smsg_newline(int wNum, int size) {
BYTE buf[3];
uint8_t buf[3];
if (!is_messagesprite(wNum)) return;
@@ -461,14 +461,14 @@ int smsg_update(sprite_t *sp) {
gre_BlendUseAMap(sf0, dx, dy, sf0, dx, dy, sp->u.msg.canvas, sx, sy, w, h, sp->u.msg.canvas, sx, sy, sp->blendrate);
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d\n",
SACT_DEBUG("do update no=%d, sx=%d, sy=%d, w=%d, h=%d, dx=%d, dy=%d",
sp->no, sx, sy, w, h, dx, dy);
return OK;
}
// 改行を含む文字列バッファ中から、改行までの文字列の長さを取り出す
static int get_linelen(BYTE *msg) {
static int get_linelen(uint8_t *msg) {
int c = 0;
while (*msg) {
@@ -494,7 +494,7 @@ static int get_linelen(BYTE *msg) {
// 改行の場合 : 改行幅もいっしょに
// ルビつき文字の場合: メッセージ本体と対応するルビ文字列
// それ以外 : 全角|半角文字1文字
static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) {
static uint8_t *get_char(uint8_t *msg, char *mbuf, char *rbuf, int bufmax) {
if (msg[0] == '\n') {
mbuf[0] = '\n';
mbuf[1] = msg[1];
@@ -515,7 +515,7 @@ static BYTE *get_char(BYTE *msg, char *mbuf, char *rbuf, int bufmax) {
}
msg++; rbuf[i] = '\0';
} else {
BYTE *p = advance_char(msg, nact->encoding);
uint8_t *p = advance_char(msg, nact->encoding);
while (msg < p)
*mbuf++ = *msg++;
*mbuf = '\0';
+3 -3
View File
@@ -64,7 +64,7 @@ static void get_updatearea() {
// surface0との領域の積をとる
SDL_IntersectRect(&rsf0, &clip, &sact.updaterect);
SACT_DEBUG("clipped area x=%d y=%d w=%d h=%d\n",
SACT_DEBUG("clipped area x=%d y=%d w=%d h=%d",
sact.updaterect.x, sact.updaterect.y,
sact.updaterect.w, sact.updaterect.h);
@@ -168,7 +168,7 @@ int sp_updateme(sprite_t *sp) {
updatearea = slist_append(updatearea, r);
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d\n",
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d",
r->x, r->y, sp->no, r->w, r->h);
return OK;
@@ -196,7 +196,7 @@ int sp_updateme_part(sprite_t *sp, int x, int y, int w, int h) {
updatearea = slist_append(updatearea, r);
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d\n",
SACT_DEBUG("x = %d, y = %d, spno = %d w=%d,h=%d",
r->x, r->y, sp->no, r->w, r->h);
return OK;
+57 -57
View File
@@ -49,7 +49,7 @@ static void GetAtArray(void) { /* 0 */
int *vResult = getCaliVariable();
int i, j;
DEBUG_COMMAND("ShArray.GetAtArray %p,%d,%d,%p:\n", vAry, cnt, type, vResult);
DEBUG_COMMAND("ShArray.GetAtArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
j = *vAry; vAry++;
for (i = 1; i < cnt; i++) {
@@ -93,7 +93,7 @@ static void AddAtArray(void) { /* 1 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.AddAtArray %p,%p,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.AddAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) + (*vAry2);
@@ -119,7 +119,7 @@ static void SubAtArray(void) { /* 2 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.SubAtArray %p,%p,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.SubAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) - (*vAry2);
@@ -145,7 +145,7 @@ static void MulAtArray(void) { /* 3 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MulAtArray %p,%p,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.MulAtArray %p,%p,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
int result = (*vAry1) * (*vAry2);
@@ -171,7 +171,7 @@ static void DivAtArray(void) { /* 4 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.DivAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.DivAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry2 == 0) {
@@ -201,7 +201,7 @@ static void MinAtArray(void) { /* 5 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MinAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.MinAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry1 < *vAry2) {
@@ -224,7 +224,7 @@ static void MaxAtArray(void) { /* 6 */
int cnt = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.MaxAtArray: %d,%d,%d:\n", vAry1, vAry2, cnt);
DEBUG_COMMAND("ShArray.MaxAtArray: %d,%d,%d:", vAry1, vAry2, cnt);
for (i = 0; i < cnt; i++) {
if (*vAry1 > *vAry2) {
@@ -247,7 +247,7 @@ static void AndNumArray(void) { /* 7 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.AndNumArray: %p,%d,%d:\n", vAry, cnt, val);
DEBUG_COMMAND("ShArray.AndNumArray: %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) &= val;
@@ -268,7 +268,7 @@ static void OrNumArray(void) { /* 8 */
int val = getCaliValue();
int i;
DEBUG_COMMAND_YET("ShArray.OrNumArray: %p,%d,%d:\n", vAry, cnt, val);
DEBUG_COMMAND_YET("ShArray.OrNumArray: %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) |= val;
@@ -289,7 +289,7 @@ static void XorNumArray(void) { /* 9 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.XorNumArray %p,%d,%d:\n", vAry, cnt, val);
DEBUG_COMMAND("ShArray.XorNumArray %p,%d,%d:", vAry, cnt, val);
for (i = 0; i < cnt; i++) {
(*vAry) ^= val;
@@ -313,7 +313,7 @@ static void SetEquArray(void) { /* 10 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.SetEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = (*vAry == val) ? 1 : 0;
@@ -337,7 +337,7 @@ static void SetNotArray(void) { /* 11 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.SetNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = (*vAry != val) ? 1 : 0;
@@ -360,7 +360,7 @@ static void SetLowArray(void) { /* 12 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetLowArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.SetLowArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) = ((*vAry < val) ? 1 : 0);
@@ -383,7 +383,7 @@ static void SetHighArray(void) { /* 13 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetHighArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.SetHighArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) = ((*vAry > val) ? 1 : 0);
@@ -410,7 +410,7 @@ static void SetRangeArray(void) { /* 14 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetRangeArray %p,%d,%d,%d,%p:\n", vAry, cnt, min, max, vResults);
DEBUG_COMMAND("ShArray.SetRangeArray %p,%d,%d,%d,%p:", vAry, cnt, min, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults = ((*vAry > min) && (*vAry < max)) ? 1 : 0;
@@ -437,7 +437,7 @@ static void SetAndEquArray(void) { /* 15 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.SetAndEquArray: %p,%d,%d,%d,%p:\n", vAry, mask, cnt, val, vResults);
DEBUG_COMMAND("ShArray.SetAndEquArray: %p,%d,%d,%d,%p:", vAry, mask, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults = ((*vAry & mask) == val) ? 1 : 0;
@@ -461,7 +461,7 @@ static void AndEquArray(void) { /* 16 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.AndEquArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry == val) ? 1 : 0);
@@ -485,7 +485,7 @@ static void AndNotArray(void) { /* 17 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.AndNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry != val) ? 1 : 0);
@@ -509,7 +509,7 @@ static void AndLowArray(void) { /* 18 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndLowArray: %d,%d,%d,%d:\n", vAry, cnt, min, vResults);
DEBUG_COMMAND("ShArray.AndLowArray: %d,%d,%d,%d:", vAry, cnt, min, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry < min) ? 1 : 0);
@@ -533,7 +533,7 @@ static void AndHighArray(void) { /* 19 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndHighArray: %p,%d,%d,%p:\n", vAry, cnt, max, vResults);
DEBUG_COMMAND("ShArray.AndHighArray: %p,%d,%d,%p:", vAry, cnt, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= ((*vAry > max) ? 1 : 0);
@@ -559,7 +559,7 @@ static void AndRangeArray(void) { /* 20 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndRangeArray %d,%d,%d,%d,%d:\n", vAry, cnt, min, max, vResults);
DEBUG_COMMAND("ShArray.AndRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResults);
for (i = 0; i < cnt; i++) {
*vResults &= (((*vAry > min) && (*vAry < max)) ? 1 : 0);
@@ -586,7 +586,7 @@ static void AndAndEquArray(void) { /* 21 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.AndAndEquArray: %d,%d,%d,%d,%d:\n", vAry, mask, cnt, val, vResults);
DEBUG_COMMAND("ShArray.AndAndEquArray: %d,%d,%d,%d,%d:", vAry, mask, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
(*vResults) &= (((*vAry & mask) == val) ? 1 : 0);
@@ -600,7 +600,7 @@ static void OrEquArray(void) { /* 22 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrEquArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.OrEquArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrNotArray(void) { /* 23 */
@@ -618,7 +618,7 @@ static void OrNotArray(void) { /* 23 */
int *vResults = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.OrNotArray %p,%d,%d,%p:\n", vAry, cnt, val, vResults);
DEBUG_COMMAND("ShArray.OrNotArray %p,%d,%d,%p:", vAry, cnt, val, vResults);
for (i = 0; i < cnt; i++) {
// if (*vAry != val) *vResults = 1;
@@ -633,7 +633,7 @@ static void OrLowArray(void) { /* 24 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.OrLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrHighArray(void) { /* 25 */
@@ -642,7 +642,7 @@ static void OrHighArray(void) { /* 25 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.OrHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void OrRangeArray(void) { /* 26 */
@@ -652,7 +652,7 @@ static void OrRangeArray(void) { /* 26 */
int p4 = getCaliValue();
int p5 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrRangeArray: %d,%d,%d,%d,%d:\n", p1, p2, p3, p4,p5);
DEBUG_COMMAND_YET("ShArray.OrRangeArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
}
static void OrAndEquArray(void) { /* 27 */
@@ -662,7 +662,7 @@ static void OrAndEquArray(void) { /* 27 */
int p4 = getCaliValue();
int p5 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.OrAndEquArray: %d,%d,%d,%d,%d:\n", p1, p2, p3, p4,p5);
DEBUG_COMMAND_YET("ShArray.OrAndEquArray: %d,%d,%d,%d,%d:", p1, p2, p3, p4,p5);
}
static void EnumEquArray(void) { /* 28 */
@@ -680,7 +680,7 @@ static void EnumEquArray(void) { /* 28 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumEquArray %p,%d,%d,%p:\n", vAry, cnt, val, vResult);
DEBUG_COMMAND("ShArray.EnumEquArray %p,%d,%d,%p:", vAry, cnt, val, vResult);
*vResult = 0;
@@ -698,7 +698,7 @@ static void EnumEquArray2(void) { /* 29 */
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumEquArray2: %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6);
DEBUG_COMMAND_YET("ShArray.EnumEquArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
}
static void EnumEquNotArray2(void) { /* 30 */
@@ -721,7 +721,7 @@ static void EnumEquNotArray2(void) { /* 30 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumEquNotArray2 %p,%p,%d,%d,%d,%p:\n", vAry1, vAry2, cnt, val1, val2, vResult);
DEBUG_COMMAND("ShArray.EnumEquNotArray2 %p,%p,%d,%d,%d,%p:", vAry1, vAry2, cnt, val1, val2, vResult);
*vResult = 0;
@@ -748,7 +748,7 @@ static void EnumNotArray(void) { /* 31 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumNotArray %p, %d, %d, %p:\n", vAry, cnt, val, vResult);
DEBUG_COMMAND("ShArray.EnumNotArray %p, %d, %d, %p:", vAry, cnt, val, vResult);
*vResult = 0;
@@ -768,7 +768,7 @@ static void EnumNotArray2(void) { /* 32 */
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumNotArray2: %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6);
DEBUG_COMMAND_YET("ShArray.EnumNotArray2: %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
}
static void EnumLowArray(void) { /* 33 */
@@ -777,7 +777,7 @@ static void EnumLowArray(void) { /* 33 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.EnumLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void EnumHighArray(void) { /* 34 */
@@ -786,7 +786,7 @@ static void EnumHighArray(void) { /* 34 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.EnumHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.EnumHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void EnumRangeArray(void) { /* 35 */
@@ -806,7 +806,7 @@ static void EnumRangeArray(void) { /* 35 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.EnumRangeArray %d,%d,%d,%d,%d:\n", vAry, cnt, min, max, vResult);
DEBUG_COMMAND("ShArray.EnumRangeArray %d,%d,%d,%d,%d:", vAry, cnt, min, max, vResult);
*vResult = 0;
@@ -837,7 +837,7 @@ static void GrepEquArray(void) { /* 36 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepEquArray %p,%d,%d,%p,%p:\n", vAry, cnt, val, vMatch, vResult);
DEBUG_COMMAND("ShArray.GrepEquArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
*vResult = 0;
@@ -869,7 +869,7 @@ static void GrepNotArray(void) { /* 37 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepNotArray %p,%d,%d,%p,%p:\n", vAry, cnt, val, vMatch, vResult);
DEBUG_COMMAND("ShArray.GrepNotArray %p,%d,%d,%p,%p:", vAry, cnt, val, vMatch, vResult);
*vResult = 0;
@@ -892,7 +892,7 @@ static void GrepEquArray2(void) { /* 38 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepEquArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShArray.GrepEquArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepNotArray2(void) { /* 39 */
@@ -904,7 +904,7 @@ static void GrepNotArray2(void) { /* 39 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepNotArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShArray.GrepNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepEquNotArray2(void) { /* 40 */
@@ -916,7 +916,7 @@ static void GrepEquNotArray2(void) { /* 40 */
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.GrepEquNotArray2: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShArray.GrepEquNotArray2: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void GrepLowArray(void) { /* 41 */
@@ -937,7 +937,7 @@ static void GrepLowArray(void) { /* 41 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepLowArray: %p,%d,%d,%p,%p:\n", vAry, cnt, min, vMatch, vResult);
DEBUG_COMMAND("ShArray.GrepLowArray: %p,%d,%d,%p,%p:", vAry, cnt, min, vMatch, vResult);
*vResult = 0;
@@ -969,7 +969,7 @@ static void GrepHighArray(void) { /* 42 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepHighArray: %p,%d,%d,%p,%p:\n", vAry, cnt, max, vMatch, vResult);
DEBUG_COMMAND("ShArray.GrepHighArray: %p,%d,%d,%p,%p:", vAry, cnt, max, vMatch, vResult);
*vResult = 0;
@@ -1003,7 +1003,7 @@ static void GrepRangeArray(void) { /* 43 */
int *vResult = getCaliVariable();
int i;
DEBUG_COMMAND("ShArray.GrepRangeArray %p,%d,%d,%d,%p,%p:\n", vAry, cnt, max, min, vMatch, vResult);
DEBUG_COMMAND("ShArray.GrepRangeArray %p,%d,%d,%d,%p,%p:", vAry, cnt, max, min, vMatch, vResult);
*vResult = 0;
@@ -1040,7 +1040,7 @@ static void GrepLowOrderArray(void) { /* 44 */
int *vResult = getCaliVariable();
int i, j, k = 0;
DEBUG_COMMAND("ShArray.GrepLowOrderArray %p,%d,%d,%d,%p,%p,%p:\n", vAry, cnt, min, max, v1, vLastMatch, vResult);
DEBUG_COMMAND("ShArray.GrepLowOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
*vResult = 0;
for (i = 0; i < cnt; i++) {
@@ -1091,7 +1091,7 @@ static void GrepHighOrderArray(void) { /* 45 */
int *vResult = getCaliVariable();
int i, j, k = 0;
DEBUG_COMMAND("ShArray.GrepHighOrderArray %p,%d,%d,%d,%p,%p,%p:\n", vAry, cnt, min, max, v1, vLastMatch, vResult);
DEBUG_COMMAND("ShArray.GrepHighOrderArray %p,%d,%d,%d,%p,%p,%p:", vAry, cnt, min, max, v1, vLastMatch, vResult);
*vResult = 0;
for (i = 0; i < cnt; i++) {
@@ -1125,7 +1125,7 @@ static void ChangeEquArray(void) { /* 46 */
int dst = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.ChangeEquArray: %d,%d,%d,%d:\n", vAry, cnt, src, dst);
DEBUG_COMMAND("ShArray.ChangeEquArray: %d,%d,%d,%d:", vAry, cnt, src, dst);
for (i = 0; i < cnt; i++) {
if (*vAry == src) {
@@ -1141,7 +1141,7 @@ static void ChangeNotArray(void) { /* 47 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeNotArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.ChangeNotArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeLowArray(void) { /* 48 */
@@ -1150,7 +1150,7 @@ static void ChangeLowArray(void) { /* 48 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeLowArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.ChangeLowArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeHighArray(void) { /* 49 */
@@ -1159,7 +1159,7 @@ static void ChangeHighArray(void) { /* 49 */
int p3 = getCaliValue();
int p4 = getCaliValue();
DEBUG_COMMAND_YET("ShArray.ChangeHighArray: %d,%d,%d,%d:\n", p1, p2, p3, p4);
DEBUG_COMMAND_YET("ShArray.ChangeHighArray: %d,%d,%d,%d:", p1, p2, p3, p4);
}
static void ChangeRangeArray(void) { /* 50 */
@@ -1179,7 +1179,7 @@ static void ChangeRangeArray(void) { /* 50 */
int val = getCaliValue();
int i;
DEBUG_COMMAND("ShArray.ChangeRangeArray %p,%d,%d,%d,%d:\n", vAry, cnt, min, max, val);
DEBUG_COMMAND("ShArray.ChangeRangeArray %p,%d,%d,%d,%d:", vAry, cnt, min, max, val);
for (i = 0; i < cnt; i++) {
if ((*vAry > min) && (*vAry < max)) {
@@ -1212,7 +1212,7 @@ static void CopyArrayToRect(void) { /* 51 */
int dh = getCaliValue();
int x, y;
DEBUG_COMMAND("ShArray.CopyArrayToRect %p,%d,%d,%d,%d,%p,%d,%d:\n", vSrc, sw, sh, sx, sy, vDst, dw, dh);
DEBUG_COMMAND("ShArray.CopyArrayToRect %p,%d,%d,%d,%d,%p,%d,%d:", vSrc, sw, sh, sx, sy, vDst, dw, dh);
vSrc += (sy * sw + sx);
for (y = 0; y < dh; y++) {
@@ -1246,7 +1246,7 @@ static void CopyRectToArray(void) { /* 52 */
int dy = getCaliValue();
int x, y;
DEBUG_COMMAND("ShArray.CopyRectToArray %p,%d,%d,%p,%d,%d,%d,%d:\n", vSrc, sw, sh, vDst, dw, dh, dx, dy);
DEBUG_COMMAND("ShArray.CopyRectToArray %p,%d,%d,%p,%d,%d,%d,%d:", vSrc, sw, sh, vDst, dw, dh, dx, dy);
vDst += (dy * dw + dx);
for (y = 0; y < sh; y++) {
@@ -1270,9 +1270,9 @@ static void ChangeSecretArray(void) { /* 53 */
int cnt = getCaliValue();
int type = getCaliValue();
int *vResult = getCaliVariable();
static WORD key[4] = { 0x7A7A, 0xADAD, 0xBCBC, 0xCECE }; /* key */
static uint16_t key[4] = { 0x7A7A, 0xADAD, 0xBCBC, 0xCECE }; /* key */
DEBUG_COMMAND("ShArray.ChangeSecretArray %p,%d,%d,%p:\n", vAry, cnt, type, vResult);
DEBUG_COMMAND("ShArray.ChangeSecretArray %p,%d,%d,%p:", vAry, cnt, type, vResult);
*vResult = 0;
@@ -1301,7 +1301,7 @@ static void ChangeSecretArray(void) { /* 53 */
エンコードその1
*/
int i, j = 0;
WORD ax = key[3] ^ 0x5a5a;
uint16_t ax = key[3] ^ 0x5a5a;
for (i = 0; i < cnt; i++) {
(*vAry) ^= ax; ax = (key[i&3] ^ *vAry);
j ^= ax;
@@ -1322,7 +1322,7 @@ static void ChangeSecretArray(void) { /* 53 */
エンコードその2
*/
int i, j = 0, k;
WORD ax = key[3] ^ 0x5a5a;
uint16_t ax = key[3] ^ 0x5a5a;
for (i = 0; i < cnt; i++) {
k = *vAry;
*vAry ^= ax; ax = (key[i&3] ^ k);
+23 -23
View File
@@ -62,7 +62,7 @@ static void SetIntNumBase(void) { /* 0 */
numbase = base;
DEBUG_COMMAND("ShCalc.SetIntNumBase %d:\n", base);
DEBUG_COMMAND("ShCalc.SetIntNumBase %d:", base);
}
@@ -76,13 +76,13 @@ static void SetIntNum16(void) { /* 1 */
l_1000A0D8 = mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.SetIntNum16 %p:\n", var);
DEBUG_COMMAND("ShCalc.SetIntNum16 %p:", var);
}
static void SetIntNum32(void) { /* 2 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.SetIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.SetIntNum32: %d:", p1);
}
static void GetIntNum16(void) { /* 3 */
@@ -102,13 +102,13 @@ static void GetIntNum16(void) { /* 3 */
*var = i;
DEBUG_COMMAND("ShCalc.GetIntNum16 %d:\n", var);
DEBUG_COMMAND("ShCalc.GetIntNum16 %d:", var);
}
static void GetIntNum32(void) { /* 4 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.GetIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.GetIntNum32: %d:", p1);
}
static void AddIntNum16(void) { /* 5 */
@@ -121,25 +121,25 @@ static void AddIntNum16(void) { /* 5 */
l_1000A0D8 += mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.AddIntNum16 %p:\n", var);
DEBUG_COMMAND("ShCalc.AddIntNum16 %p:", var);
}
static void AddIntNum32(void) { /* 6 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.AddIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.AddIntNum32: %d:", p1);
}
static void SubIntNum16(void) { /* 7 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.SubIntNum16: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.SubIntNum16: %d:", p1);
}
static void SubIntNum32(void) { /* 8 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.SubIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.SubIntNum32: %d:", p1);
}
static void MulIntNum16(void) { /* 9 */
@@ -152,13 +152,13 @@ static void MulIntNum16(void) { /* 9 */
l_1000A0D8 *= mul64(*var, numbase);
DEBUG_COMMAND("ShCalc.MulIntNum16: %p:\n", var);
DEBUG_COMMAND("ShCalc.MulIntNum16: %p:", var);
}
static void MulIntNum32(void) { /* 10 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.MulIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.MulIntNum32: %d:", p1);
}
static void DivIntNum16(void) { /* 11 */
@@ -175,13 +175,13 @@ static void DivIntNum16(void) { /* 11 */
i = mul64(l_1000A0C8, numbase);
l_1000A0D8 = div64(l_1000A0D8, i);
DEBUG_COMMAND("ShCalc.DivIntNum16 %p:\n", var);
DEBUG_COMMAND("ShCalc.DivIntNum16 %p:", var);
}
static void DivIntNum32(void) { /* 12 */
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.DivIntNum32: %d:\n", p1);
DEBUG_COMMAND_YET("ShCalc.DivIntNum32: %d:", p1);
}
static void CmpIntNum16(void) { /* 13 */
@@ -189,7 +189,7 @@ static void CmpIntNum16(void) { /* 13 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.CmpIntNum16: %d,%d,%d:\n", p1, p2, p3);
DEBUG_COMMAND_YET("ShCalc.CmpIntNum16: %d,%d,%d:", p1, p2, p3);
}
static void CmpIntNum32(void) { /* 14 */
@@ -197,7 +197,7 @@ static void CmpIntNum32(void) { /* 14 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.CmpIntNum32: %d,%d,%d:\n", p1, p2, p3);
DEBUG_COMMAND_YET("ShCalc.CmpIntNum32: %d,%d,%d:", p1, p2, p3);
}
static void GetLengthNum16(void) { /* 15 */
@@ -221,14 +221,14 @@ static void GetLengthNum16(void) { /* 15 */
*vResult = 1;
}
DEBUG_COMMAND("ShCalc.GetLengthNum16 %p,%p:\n", var, vResult);
DEBUG_COMMAND("ShCalc.GetLengthNum16 %p,%p:", var, vResult);
}
static void GetLengthNum32(void) { /* 16 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShCalc.GetLengthNum32: %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("ShCalc.GetLengthNum32: %d,%d:", p1, p2);
}
static void NumToRate(void) { /* 17 */
@@ -259,7 +259,7 @@ static void NumToRate(void) { /* 17 */
*vResult = i;
DEBUG_COMMAND("ShCalc.NumToRate %d,%d,%d,%d,%p:\n", p1, p2, p3, flag, vResult);
DEBUG_COMMAND("ShCalc.NumToRate %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
}
@@ -291,7 +291,7 @@ static void NumToRateNum(void) { /* 18 */
*vResult = i;
DEBUG_COMMAND("ShCalc.NumToRateNum %d,%d,%d,%d,%p:\n", p1, p2, p3, flag, vResult);
DEBUG_COMMAND("ShCalc.NumToRateNum %d,%d,%d,%d,%p:", p1, p2, p3, flag, vResult);
}
static void SetRandomSeed() {
@@ -304,7 +304,7 @@ static void SetRandomSeed() {
sgenrand(seed);
DEBUG_COMMAND("ShCalc.SetRandomSeed %d:\n", seed);
DEBUG_COMMAND("ShCalc.SetRandomSeed %d:", seed);
}
static void GetRandomNumA() {
@@ -317,7 +317,7 @@ static void GetRandomNumA() {
*var = (int)(genrand() * num) + 1;
}
DEBUG_COMMAND("ShCalc.GetRandomNumA %d,%p:\n", num, var);
DEBUG_COMMAND("ShCalc.GetRandomNumA %d,%p:", num, var);
}
static void NumToBit() {
@@ -339,7 +339,7 @@ static void NumToBit() {
*var = 0;
}
DEBUG_COMMAND("ShCalc.NumToBit %d,%p:\n", beki, var);
DEBUG_COMMAND("ShCalc.NumToBit %d,%p:", beki, var);
}
static void BitToNum() {
@@ -358,7 +358,7 @@ static void BitToNum() {
int *var = getCaliVariable();
int i;
DEBUG_COMMAND("ShCalc.BitToNum %d,%p:\n", val, var);
DEBUG_COMMAND("ShCalc.BitToNum %d,%p:", val, var);
if (val == 0) {
*var = 0;
+30 -30
View File
@@ -95,13 +95,13 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ISurface */
DEBUG_COMMAND("ShGraph.Init %d:\n", p1);
DEBUG_COMMAND("ShGraph.Init %d:", p1);
}
static void GetSurfaceData() {
int p1 = getCaliValue(); /* ISurface */
DEBUG_COMMAND_YET("ShGraph.GetSurfaceData %d:\n", p1);
DEBUG_COMMAND_YET("ShGraph.GetSurfaceData %d:", p1);
}
static void ChangeEquColor() {
@@ -113,7 +113,7 @@ static void ChangeEquColor() {
int *p6 = getCaliVariable();
int p7 = getCaliValue(); /* ISurface */
DEBUG_COMMAND_YET("ShGraph.ChangeEquColor %d,%d,%d,%d,%p,%p,%d:\n", p1, p2, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShGraph.ChangeEquColor %d,%d,%d,%d,%p,%p,%d:", p1, p2, p3, p4, p5, p6, p7);
}
static void ChangeNotColor() {
@@ -136,9 +136,9 @@ static void ChangeNotColor() {
int p7 = getCaliValue(); /* ISurface */
agsurface_t *dib;
int x, y;
BYTE *dp;
uint8_t *dp;
DEBUG_COMMAND("ShGraph.ChangeNotColor %d,%d,%d,%d,%p,%p,%d:\n", x0, y0, width, height, src, dst, p7);
DEBUG_COMMAND("ShGraph.ChangeNotColor %d,%d,%d,%d,%p,%p,%d:", x0, y0, width, height, src, dst, p7);
ags_check_param(&x0, &y0, &width, &height);
@@ -148,12 +148,12 @@ static void ChangeNotColor() {
switch(dib->depth) {
case 16:
{
WORD pic16s = PIX16(*src, *(src+1), *(src+2));
WORD pic16d = PIX16(*dst, *(dst+1), *(dst+2));
WORD *yl;
uint16_t pic16s = PIX16(*src, *(src+1), *(src+2));
uint16_t pic16d = PIX16(*dst, *(dst+1), *(dst+2));
uint16_t *yl;
for (y = 0; y < height; y++) {
yl = (WORD *)(dp + y * dib->bytes_per_line);
yl = (uint16_t *)(dp + y * dib->bytes_per_line);
for (x = 0; x < width; x++) {
if (*yl != pic16s) {
*yl = pic16d;
@@ -166,12 +166,12 @@ static void ChangeNotColor() {
case 24:
case 32:
{
DWORD pic24s = PIX24(*src, *(src+1), *(src+2)) & 0xf0f0f0;
DWORD pic24d = PIX24(*dst, *(dst+1), *(dst+2)) & 0xf0f0f0;
DWORD *yl;
uint32_t pic24s = PIX24(*src, *(src+1), *(src+2)) & 0xf0f0f0;
uint32_t pic24d = PIX24(*dst, *(dst+1), *(dst+2)) & 0xf0f0f0;
uint32_t *yl;
for (y = 0; y < height; y++) {
yl = (DWORD *)(dp + y * dib->bytes_per_line);
yl = (uint32_t *)(dp + y * dib->bytes_per_line);
for (x = 0; x < width; x++) {
if ((*yl & 0xf0f0f0) != pic24s) {
*yl = pic24d;
@@ -218,7 +218,7 @@ static void ResetAnimeData() {
*/
int no = getCaliValue();
DEBUG_COMMAND("ShGraph.ResetAnimeData %d:\n", no);
DEBUG_COMMAND("ShGraph.ResetAnimeData %d:", no);
if (no > 0 && no <= SLOT) {
memset(&src[no-1], 0, sizeof(struct animsrc));
@@ -258,7 +258,7 @@ static void SetAnimeSrc() {
int *pal = getCaliVariable();
int r, g, b;
DEBUG_COMMAND("ShGraph.SetAnimeSrc %d,%d,%d,%d,%d,%d,%d,%p:\n", no, x0, y0, w, h, uw, uh, pal);
DEBUG_COMMAND("ShGraph.SetAnimeSrc %d,%d,%d,%d,%d,%d,%d,%p:", no, x0, y0, w, h, uw, uh, pal);
if (no <= 0 || no > SLOT) return;
@@ -298,7 +298,7 @@ static void SetAnimeDst() {
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeDst %d,%p,%p,%d,%d,%d,%d:\n", no, p1, p2, p3, p4, p5, p6);
DEBUG_COMMAND("ShGraph.SetAnimeDst %d,%p,%p,%d,%d,%d,%d:", no, p1, p2, p3, p4, p5, p6);
if (no <= 0 || no > SLOT) return;
@@ -332,7 +332,7 @@ static void AddAnimeData() {
int p6 = getCaliValue();
int i;
DEBUG_COMMAND("ShGraph.AddAnimeData %d,%d,%d,%d,%p,%d:\n", no, p2, p3, p4, p5, p6);
DEBUG_COMMAND("ShGraph.AddAnimeData %d,%d,%d,%d,%p,%d:", no, p2, p3, p4, p5, p6);
if (no <= 0 || no > SLOT) return;
@@ -366,7 +366,7 @@ static void AddAnimeRemain() {
int no = getCaliValue();
int i, _max = 0;
DEBUG_COMMAND("ShGraph.AddAnimeRemain %d:\n", no);
DEBUG_COMMAND("ShGraph.AddAnimeRemain %d:", no);
if (no <= 0 || no > SLOT) return;
@@ -397,7 +397,7 @@ static void SetAnimeRect() {
int w = getCaliValue();
int h = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeRect %d,%d,%d,%d:\n", x, y, w, h);
DEBUG_COMMAND("ShGraph.SetAnimeRect %d,%d,%d,%d:", x, y, w, h);
maprect.x = x;
maprect.y = y;
@@ -423,7 +423,7 @@ static void SetAnimeBack() {
int p5 = getCaliValue();
int p6 = getCaliValue();
DEBUG_COMMAND("ShGraph.SetAnimeBack %d,%d,%d,%d,%d,%d:\n", sx, sy, w, h, p5, p6);
DEBUG_COMMAND("ShGraph.SetAnimeBack %d,%d,%d,%d,%d,%d:", sx, sy, w, h, p5, p6);
mapback.x = sx;
mapback.y = sy;
@@ -451,7 +451,7 @@ static void PlayAnimeData() {
boolean is_backcopied;
agsurface_t *dib;
DEBUG_COMMAND("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p4, p5, p6);
DEBUG_COMMAND("ShGraph.PlayAnimeData %d,%d,%d,%d,%d,%d:", p1, p2, p3, p4, p5, p6);
interval = p2 * 10;
@@ -551,7 +551,7 @@ static void PlayAnimeData() {
static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, int r, int g, int b) {
int x, y;
BYTE *sp, *dp;
uint8_t *sp, *dp;
agsurface_t *dib;
if (dx < 0 || dy < 0) return;
@@ -567,12 +567,12 @@ static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, i
switch(dib->depth) {
case 16:
{
WORD pic16 = PIX16(r, g, b);
WORD *yls, *yld;
uint16_t pic16 = PIX16(r, g, b);
uint16_t *yls, *yld;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * dib->bytes_per_line);
yld = (WORD *)(dp + y * dib->bytes_per_line);
yls = (uint16_t *)(sp + y * dib->bytes_per_line);
yld = (uint16_t *)(dp + y * dib->bytes_per_line);
for (x = 0; x < width; x++) {
if (*yls != pic16) {
*yld = *yls;
@@ -585,12 +585,12 @@ static void copy_sprite(int sx, int sy, int width, int height, int dx, int dy, i
case 24:
case 32:
{
DWORD pic24 = PIX24(r, g, b) & 0xf0f0f0;
DWORD *yls, *yld;
uint32_t pic24 = PIX24(r, g, b) & 0xf0f0f0;
uint32_t *yls, *yld;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * dib->bytes_per_line);
yld = (DWORD *)(dp + y * dib->bytes_per_line);
yls = (uint32_t *)(sp + y * dib->bytes_per_line);
yld = (uint32_t *)(dp + y * dib->bytes_per_line);
for (x = 0; x < width; x++) {
if ((*yls & 0xf0f0f0) != pic24) {
*yld = *yls;
+15 -15
View File
@@ -41,7 +41,7 @@
// キー変換テーブル
#define KEYMAP_MAX 8
static BYTE *keymap[KEYMAP_MAX];
static uint8_t *keymap[KEYMAP_MAX];
static void OutputMessageBox(void) { /* 0 */
int p1 = getCaliValue();
@@ -59,7 +59,7 @@ static void OutputMessageBox(void) { /* 0 */
free(title_utf8);
free(msg_utf8);
DEBUG_COMMAND("ShPort.OutputMessageBox: %d,%d,%d,%d,%p,%d:\n", p1, p2, title, msg, res, ISys3xSystem);
DEBUG_COMMAND("ShPort.OutputMessageBox: %d,%d,%d,%d,%p,%d:", p1, p2, title, msg, res, ISys3xSystem);
}
static void InputListNum(void) { /* 1 */
@@ -82,12 +82,12 @@ static void InputListNum(void) { /* 1 */
if (ni_param.value < 0) {
*res = 0;
} else {
*val = (WORD)ni_param.value;
*val = (uint16_t)ni_param.value;
*res = 1;
}
free(ni_param.title);
DEBUG_COMMAND("ShPort.InputListNum: %d,%d,%p,%d,%d,%p,%d:\n", flags, title, val, minval, maxval, res, ISys3xSystem);
DEBUG_COMMAND("ShPort.InputListNum: %d,%d,%p,%d,%d,%p,%d:", flags, title, val, minval, maxval, res, ISys3xSystem);
}
/**
@@ -98,7 +98,7 @@ static void InputListNum(void) { /* 1 */
static void Init(void) {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.Init: %d:\n", p1);
DEBUG_COMMAND_YET("ShPort.Init: %d:", p1);
}
/**
@@ -110,17 +110,17 @@ static void InitKeyStatus(void) {
int no = getCaliValue();
if (no >= KEYMAP_MAX) {
WARNING("Overflow keymap table(p1)\n", no);
WARNING("Overflow keymap table(p1)", no);
return;
}
if (keymap[no -1] == NULL) {
keymap[no -1] = calloc(256, sizeof(BYTE));
keymap[no -1] = calloc(256, sizeof(uint8_t));
} else {
memset(keymap[no -1], 0, 256);
}
DEBUG_COMMAND("ShPort.InitKeyStatus: %d:\n", no);
DEBUG_COMMAND("ShPort.InitKeyStatus: %d:", no);
}
/**
@@ -136,13 +136,13 @@ static void SetKeyStatus(void) {
int func = getCaliValue();
if (no >= KEYMAP_MAX) {
WARNING("Overflow keymap table(p1)\n", no);
WARNING("Overflow keymap table(p1)", no);
return;
}
keymap[no -1][key] = func;
DEBUG_COMMAND("ShPort.SetKeyStatus: %d,%d,%d:\n", no, key, func);
DEBUG_COMMAND("ShPort.SetKeyStatus: %d,%d,%d:", no, key, func);
}
/**
@@ -157,7 +157,7 @@ static void GetKeyStatus(void) {
int i;
if (no >= KEYMAP_MAX) {
WARNING("Overflow keymap table(p1)\n", no);
WARNING("Overflow keymap table(p1)", no);
return;
}
@@ -166,7 +166,7 @@ static void GetKeyStatus(void) {
*var |= (keymap[no -1][i] * RawKeyInfo[i]);
}
DEBUG_COMMAND("ShPort.GetKeyStatus: %d,%p:\n", no, var);
DEBUG_COMMAND("ShPort.GetKeyStatus: %d,%p:", no, var);
}
static void InputListString(void) {
@@ -178,7 +178,7 @@ static void InputListString(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputListString: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShPort.InputListString: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static void InputOpenFile(void) {
@@ -190,7 +190,7 @@ static void InputOpenFile(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputOpenFile: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShPort.InputOpenFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static void InputSaveFile(void) {
@@ -202,7 +202,7 @@ static void InputSaveFile(void) {
int p6 = getCaliValue();
int p7 = getCaliValue();
DEBUG_COMMAND_YET("ShPort.InputSaveFile: %d,%d,%d,%d,%d,%d,%d:\n", p1, p2, p3, p3, p4, p5, p6, p7);
DEBUG_COMMAND_YET("ShPort.InputSaveFile: %d,%d,%d,%d,%d,%d,%d:", p1, p2, p3, p3, p4, p5, p6, p7);
}
static const ModuleFunc functions[] = {
+105 -38
View File
@@ -26,8 +26,10 @@
#include <stdio.h>
#include <string.h>
#include <SDL.h>
#include "portab.h"
#include "LittleEndian.h"
#include "xsystem35.h"
#include "modules.h"
#include "nact.h"
@@ -35,12 +37,16 @@
#include "ald_manager.h"
#include "music.h"
#ifdef ENABLE_SDLMIXER
#include "pcm.sdlmixer.h"
#include "shpcmlib.c"
static struct {
SDL_AudioSpec spec; // must be 16-bit, stereo
uint8_t *buf;
uint32_t len;
} memwav;
static Mix_Chunk *chunk;
#endif
static void free_memory_wav(void) {
SDL_FreeWAV(memwav.buf);
memwav.buf = NULL;
}
static void Init() {
/*
@@ -48,7 +54,7 @@ static void Init() {
*/
int p1 = getCaliValue(); /* ISys3x */
DEBUG_COMMAND("ShSound.Init %d:\n", p1);
DEBUG_COMMAND("ShSound.Init %d:", p1);
}
static void wavLoad() {
@@ -61,7 +67,7 @@ static void wavLoad() {
int slot = getCaliValue();
int no = getCaliValue();
DEBUG_COMMAND("ShSound.wavLoad %d,%d:\n", slot, no);
DEBUG_COMMAND("ShSound.wavLoad %d,%d:", slot, no);
mus_wav_load(slot, no);
}
@@ -76,7 +82,7 @@ static void wavUnload() {
mus_wav_unload(slot);
DEBUG_COMMAND("ShSound.wavUnload %d:\n",slot);
DEBUG_COMMAND("ShSound.wavUnload %d:",slot);
}
static void wavUnloadRange() {
@@ -94,7 +100,7 @@ static void wavUnloadRange() {
mus_wav_unload(i);
}
DEBUG_COMMAND("ShSound.wavUnloadRange %d,%d:\n", slot, range);
DEBUG_COMMAND("ShSound.wavUnloadRange %d,%d:", slot, range);
}
static void wavUnloadAll() {
@@ -107,7 +113,7 @@ static void wavUnloadAll() {
mus_wav_unload(i);
}
DEBUG_COMMAND("ShSound.wavUnloadAll:\n");
DEBUG_COMMAND("ShSound.wavUnloadAll:");
}
static void wavLoadMemory() {
@@ -117,12 +123,26 @@ static void wavLoadMemory() {
no:
*/
int no = getCaliValue();
if (memwav.buf)
free_memory_wav();
dridata *dfile = ald_getdata(DRIFILE_WAVE, no - 1);
if (!dfile) {
WARNING("cannot open WAVE %d", no - 1);
return;
}
if (!SDL_LoadWAV_RW(SDL_RWFromConstMem(dfile->data, dfile->size), 1, &memwav.spec, &memwav.buf, &memwav.len)) {
WARNING("cannot load WAVE %d", no - 1);
return;
}
if (memwav.spec.channels != 2 || memwav.spec.format != AUDIO_S16LSB) {
WARNING("unexpected audio format");
free_memory_wav();
return;
}
#ifdef ENABLE_SDLMIXER
chunk = pcm_sdlmixer_load(no);
#endif
DEBUG_COMMAND("ShSound.wavLoadMemory %d:\n", no);
DEBUG_COMMAND("ShSound.wavLoadMemory %d:", no);
}
static void wavSendMemory() {
@@ -133,14 +153,40 @@ static void wavSendMemory() {
*/
int slot = getCaliValue();
#ifdef ENABLE_SDLMIXER
if (chunk) {
pcm_sdlmixer_load_chunk(slot, chunk);
chunk = NULL;
if (!memwav.buf) {
WARNING("wave not loaded");
return;
}
#endif
const uint8_t wave_header[] = {
'R', 'I', 'F', 'F',
0, 0, 0, 0, // filesize - 8 (filled later)
'W', 'A', 'V', 'E',
'f', 'm', 't', ' ',
16, 0, 0, 0, // size of fmt chunk
1, 0, // PCM format
2, 0, // stereo
0, 0, 0, 0, // sampling rate (filled later)
0, 0, 0, 0, // bytes / sec (filled later)
4, 0, // block size
16, 0, // bits / sample
'd', 'a', 't', 'a',
0, 0, 0, 0, // size of data chunk (filled later)
};
uint32_t wav_size = sizeof(wave_header) + memwav.len;
uint8_t *wav_buf = malloc(wav_size);
memcpy(wav_buf, wave_header, sizeof(wave_header));
LittleEndian_putDW(wav_size - 8, wav_buf, 4);
LittleEndian_putDW(memwav.spec.freq, wav_buf, 24);
LittleEndian_putDW(memwav.spec.freq * 4, wav_buf, 28);
LittleEndian_putDW(memwav.len, wav_buf, 40);
memcpy(wav_buf + sizeof(wave_header), memwav.buf, memwav.len);
mus_wav_load_data(slot, wav_buf, wav_size);
free_memory_wav();
free(wav_buf);
DEBUG_COMMAND("ShSound.wavSendMemory %d:\n", slot);
DEBUG_COMMAND("ShSound.wavSendMemory %d:", slot);
}
static void wavFadeVolumeMemory() {
@@ -153,13 +199,28 @@ static void wavFadeVolumeMemory() {
int start = getCaliValue();
int range = getCaliValue();
#ifdef ENABLE_SDLMIXER
if (chunk == NULL) return;
if (!memwav.buf)
return;
pcmlib_fade_volume_memory(chunk, start, range);
#endif
start *= memwav.spec.freq / 100; // 10ms -> sample
range *= memwav.spec.freq / 100; // 10ms -> sample
if (memwav.len / 4 < start + range)
return;
int16_t *buf = (int16_t*)memwav.buf + start * 2;
// 指定の場所から徐々に音量を下げる
for (int i = range; i > 0; i--) {
buf[0] = buf[0] * i / range;
buf[1] = buf[1] * i / range;
buf += 2;
}
// 残りは無音
memset(buf, 0, memwav.buf + memwav.len - (uint8_t*)buf);
DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:\n", start, range);
DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:", start, range);
}
static void wavReversePanMemory() {
@@ -167,13 +228,19 @@ static void wavReversePanMemory() {
wavLoadMemoryで読み込んだデータの左右のチャンネルを反転
*/
#ifdef ENABLE_SDLMIXER
if (chunk == NULL) return;
if (!memwav.buf)
return;
pcmlib_reverse_pan_memory(chunk);
#endif
int16_t *buf = (int16_t*)memwav.buf;
int len = memwav.len / 4;
for (int i = 0; i < len; i++) {
int16_t tmp = buf[0];
buf[0] = buf[1];
buf[1] = tmp;
buf += 2;
}
DEBUG_COMMAND("ShSound.wavReversePanMemory:\n");
DEBUG_COMMAND("ShSound.wavReversePanMemory:");
}
static void wavPlay() {
@@ -188,7 +255,7 @@ static void wavPlay() {
mus_wav_play(slot, loop == 0 ? 1 : -1);
DEBUG_COMMAND("ShSound.wavPlay %d, %d:\n", slot, loop);
DEBUG_COMMAND("ShSound.wavPlay %d, %d:", slot, loop);
}
static void wavPlayRing() {
@@ -206,7 +273,7 @@ static void wavPlayRing() {
mus_wav_play(start + (*cur % cnt), 1);
*cur = (*cur + 1) % cnt;
DEBUG_COMMAND("ShSound.wavPlayRing %d,%d,%d:\n", start, cnt, *cur);
DEBUG_COMMAND("ShSound.wavPlayRing %d,%d,%d:", start, cnt, *cur);
}
static void wavStop() {
@@ -217,7 +284,7 @@ static void wavStop() {
*/
int slot = getCaliValue();
DEBUG_COMMAND("ShSound.wavStop %d:\n", slot);
DEBUG_COMMAND("ShSound.wavStop %d:", slot);
mus_wav_stop(slot);
}
@@ -232,7 +299,7 @@ static void wavStopAll() {
mus_wav_stop(i);
}
DEBUG_COMMAND("ShSound.wavStopAll:\n");
DEBUG_COMMAND("ShSound.wavStopAll:");
}
static void wavPause() {
@@ -243,7 +310,7 @@ static void wavPause() {
*/
int slot = getCaliValue();
DEBUG_COMMAND_YET("ShSound.wavPause %d:\n", slot);
DEBUG_COMMAND_YET("ShSound.wavPause %d:", slot);
}
static void wavIsPlay() {
@@ -258,7 +325,7 @@ static void wavIsPlay() {
*result = mus_wav_get_playposition(slot);
DEBUG_COMMAND("ShSound.wavIsPlay %d,%p:\n", slot, result);
DEBUG_COMMAND("ShSound.wavIsPlay %d,%p:", slot, result);
}
static void wavIsPlayRange() {
@@ -280,7 +347,7 @@ static void wavIsPlayRange() {
*result = ret;
DEBUG_COMMAND("ShSound.wavIsPlayRange %d,%d,%p:\n", slot, range, result);
DEBUG_COMMAND("ShSound.wavIsPlayRange %d,%d,%p:", slot, range, result);
}
static const ModuleFunc functions[] = {
-70
View File
@@ -1,70 +0,0 @@
/*
* shpcmlib.c ShSound用 pcmlib
*
* 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: shpcmlib.c,v 1.2 2003/08/02 13:10:32 chikama Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <SDL_mixer.h>
#include "portab.h"
/*
*/
void pcmlib_reverse_pan_memory(Mix_Chunk *chunk) {
if (chunk == NULL) return;
short *buf = (short*)chunk->abuf;
int len = chunk->alen / 4;
for (int i = 0; i < len; i++) {
short tmp = buf[0];
buf[0] = buf[1];
buf[1] = tmp;
buf += 2;
}
}
/*
PCM
*/
void pcmlib_fade_volume_memory(Mix_Chunk *chunk, int start, int range) {
if (chunk == NULL) return;
start *= 441; // 10ms -> sample
range *= 441; // 10ms -> sample
if (chunk->alen / 4 < start + range)
return;
short *buf = (short*)chunk->abuf;
buf += start * 2;
// 指定の場所から徐々に音量を下げる
for (int i = range; i > 0; i--) {
buf[0] = buf[0] * i / range;
buf[1] = buf[1] * i / range;
buf += 2;
}
// 残りは無音
memset(buf, 0, chunk->abuf + chunk->alen - (Uint8*)buf);
}
+13 -11
View File
@@ -46,35 +46,35 @@ static void ExchangeString(void) {
int pat = getCaliValue();
int patr = getCaliValue();
svar_replaceAll(target, pat, patr);
DEBUG_COMMAND("ShString.ExchangeString: %d,%d,%d:\n", target, pat, patr);
DEBUG_COMMAND("ShString.ExchangeString: %d,%d,%d:", target, pat, patr);
}
static void SetNum16String(void) { /* 1 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum16String: %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("ShString.SetNum16String: %d,%d:", p1, p2);
}
static void SetNum16HalfString(void) { /* 2 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum16HalfString: %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("ShString.SetNum16HalfString: %d,%d:", p1, p2);
}
static void SetNum32String(void) { /* 3 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum32String: %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("ShString.SetNum32String: %d,%d:", p1, p2);
}
static void SetNum32HalfString(void) { /* 4 */
int p1 = getCaliValue();
int p2 = getCaliValue();
DEBUG_COMMAND_YET("ShString.SetNum32HalfString: %d,%d:\n", p1, p2);
DEBUG_COMMAND_YET("ShString.SetNum32HalfString: %d,%d:", p1, p2);
}
static void GetArrayString(void) { /* 5 */
@@ -82,16 +82,18 @@ static void GetArrayString(void) { /* 5 */
int p2 = getCaliValue();
int p3 = getCaliValue();
DEBUG_COMMAND_YET("ShString.GetArrayString: %d,%d,%d:\n", p1, p2, p3);
DEBUG_COMMAND_YET("ShString.GetArrayString: %d,%d,%d:", p1, p2, p3);
}
static void SetWindowTitle(void) { /* 6 */
int strno = getCaliValue();
int p2 = getCaliValue(); /* ISys3xSystem */
ags_setWindowTitle(svar_get(strno));
char *title_utf8 = toUTF8(svar_get(strno));
ags_setWindowTitle(title_utf8);
free(title_utf8);
DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:\n", strno, p2);
DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:", strno, p2);
}
static void FillString() {
@@ -113,7 +115,7 @@ static void FillString() {
svar_set(st + i, svar_get(src));
}
DEBUG_COMMAND("ShString.FillString: %d,%d,%d,%d:\n", st, cnt, src, p4);
DEBUG_COMMAND("ShString.FillString: %d,%d,%d,%d:", st, cnt, src, p4);
}
static void SetStringNum16(void) {
@@ -130,7 +132,7 @@ static void SetStringNum16(void) {
char _dst[100];
char *dst = _dst;
DEBUG_COMMAND("ShString.SetStringNum16: %d,%p:\n", st, var);
DEBUG_COMMAND("ShString.SetStringNum16: %d,%p:", st, var);
while(*str) {
@@ -160,7 +162,7 @@ static void SetStringNum32(void) {
int p1 = getCaliValue();
int *p2 = getCaliVariable();
DEBUG_COMMAND_YET("ShString.SetStringNum32: %d,%p:\n", p1, p2);
DEBUG_COMMAND_YET("ShString.SetStringNum32: %d,%p:", p1, p2);
}
static const ModuleFunc functions[] = {
+6 -6
View File
@@ -29,34 +29,34 @@ static void Init() {
dd.alk = alk_new("/home/masaki-c/game/daiakuji/dDemo.alk");
#endif
DEBUG_COMMAND_YET("dDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("dDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("dDemo.SetKeyCancelFlag %d:\n", cancelflag);
DEBUG_COMMAND_YET("dDemo.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("dDemo.SetLoopFlag %d:\n", loopflag);
DEBUG_COMMAND_YET("dDemo.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("dDemo.Run:\n");
DEBUG_COMMAND_YET("dDemo.Run:");
#ifdef DDEMODEV
mus_cdrom_start(13, 1);
muscd_start(13, 1);
// ddemo_scene();
while(0 == sys_getInputInfo()) {
usleep(1000 * 100);
}
mus_cdrom_stop();
muscd_stop();
#endif
}
+5 -5
View File
@@ -17,31 +17,31 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("eDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("eDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("eDEMO.SetKeyCancelFlag %d:\n", cancelflag);
DEBUG_COMMAND_YET("eDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("eDEMO.SetLoopFlag %d:\n", loopflag);
DEBUG_COMMAND_YET("eDEMO.SetLoopFlag %d:", loopflag);
}
static void SetDrawStaffFlag() {
/* Loop Flag */
int staffflag = getCaliValue();
DEBUG_COMMAND_YET("eDEMO.SetDrawStaffFlag %d:\n", staffflag);
DEBUG_COMMAND_YET("eDEMO.SetDrawStaffFlag %d:", staffflag);
}
static void Run() {
DEBUG_COMMAND_YET("eDEMO.Run:\n");
DEBUG_COMMAND_YET("eDEMO.Run:");
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -17,26 +17,26 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("eeDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("eeDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("eeDEMO.SetKeyCancelFlag %d:\n", cancelflag);
DEBUG_COMMAND_YET("eeDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("eeDEMO.SetLoopFlag %d:\n", loopflag);
DEBUG_COMMAND_YET("eeDEMO.SetLoopFlag %d:", loopflag);
}
static void Run() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("eeDEMO.Run %d:\n", p1);
DEBUG_COMMAND_YET("eeDEMO.Run %d:", p1);
}
static const ModuleFunc functions[] = {
+1 -1
View File
@@ -37,7 +37,7 @@ alk_t *alk_new(const char *path) {
mmap_t *m = map_file(path);
if (0 != strncmp(m->addr, "ALK0", 4)) {
WARNING("%s: not an ALK file\n", path);
WARNING("%s: not an ALK file", path);
unmap_file(m);
return NULL;
}
+2 -2
View File
@@ -46,7 +46,7 @@
* @param data:
* @return CGの種類(QNT/PMS8/PMS16のいずれか)
*/
static CG_TYPE check_cgformat(BYTE *data) {
static CG_TYPE check_cgformat(uint8_t *data) {
if (qnt_checkfmt(data)) {
return ALCG_QNT;
} else if (pms256_checkfmt(data)) {
@@ -94,7 +94,7 @@ surface_t *sf_getcg(void *b, size_t size) {
}
if (cg == NULL) {
WARNING("Unknown Cg Type\n");
WARNING("Unknown Cg Type");
return NULL;
}
+30 -30
View File
@@ -45,38 +45,38 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds
int w, h;
if (ss == NULL) {
WARNING("ss surface is null\n");
WARNING("ss surface is null");
return FALSE;
}
if (ss == NULL) {
WARNING("ss surface is null\n");
WARNING("ss surface is null");
return FALSE;
}
if (*sx > ss->width) {
WARNING("sx is too large (sx=%d,width=%d)\n", *sx, ss->width);
WARNING("sx is too large (sx=%d,width=%d)", *sx, ss->width);
return FALSE;
}
if (*sy > ss->height) {
WARNING("sy is too large (sy=%d,height=%d)\n", *sy, ss->height);
WARNING("sy is too large (sy=%d,height=%d)", *sy, ss->height);
return FALSE;
}
if (*sx < 0) {
WARNING("sx is too small (sx=%d)\n", *sx);
WARNING("sx is too small (sx=%d)", *sx);
return FALSE;
}
if (*sy < 0) {
WARNING("sy is too small (sy=%d)\n", *sy);
WARNING("sy is too small (sy=%d)", *sy);
return FALSE;
}
if (*dx > ds->width) {
WARNING("dx is too large (dx=%d,width=%d)\n", *dx, ds->width);
WARNING("dx is too large (dx=%d,width=%d)", *dx, ds->width);
return FALSE;
}
if (*dy > ds->height) {
WARNING("dy is too large (dy=%d,height=%d)\n", *dy, ds->height);
WARNING("dy is too large (dy=%d,height=%d)", *dy, ds->height);
return FALSE;
}
@@ -94,19 +94,19 @@ boolean gr_clip(surface_t *ss, int *sx, int *sy, int *sw, int *sh, surface_t *ds
*sh = min(ss->height - *sy, min(ds->height - *dy, *sh));
if (*sw <= 0) {
WARNING("sw become <=0\n");
WARNING("sw become <=0");
return FALSE;
}
if (*sh <= 0) {
WARNING("sh become <=0\n");
WARNING("sh become <=0");
return FALSE;
}
if (*sw != w) {
NOTICE("width change %d -> %d\n", w, *sw);
NOTICE("width change %d -> %d", w, *sw);
}
if (*sh != h) {
NOTICE("height change %d -> %d\n", h, *sh);
NOTICE("height change %d -> %d", h, *sh);
}
return TRUE;
@@ -129,16 +129,16 @@ boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) {
int w, h;
if (ss == NULL) {
WARNING("ss surface is null\n");
WARNING("ss surface is null");
return FALSE;
}
if (*sx > ss->width) {
WARNING("sx is too large (sx=%d,width=%d)\n", *sx, ss->width);
WARNING("sx is too large (sx=%d,width=%d)", *sx, ss->width);
return FALSE;
}
if (*sy > ss->height) {
WARNING("sy is too large (sy=%d,height=%d)\n", *sy, ss->height);
WARNING("sy is too large (sy=%d,height=%d)", *sy, ss->height);
return FALSE;
}
@@ -156,19 +156,19 @@ boolean gr_clip_xywh(surface_t *ss, int *sx, int *sy, int *sw, int *sh) {
*sh = min(ss->height - *sy, *sh);
if (*sw <= 0) {
WARNING("sw become <=0\n");
WARNING("sw become <=0");
return FALSE;
}
if (*sh <= 0) {
WARNING("sh become <=0\n");
WARNING("sh become <=0");
return FALSE;
}
if (*sw != w) {
NOTICE("width change %d -> %d\n", w, *sw);
NOTICE("width change %d -> %d", w, *sw);
}
if (*sh != h) {
NOTICE("height change %d -> %d\n", h, *sh);
NOTICE("height change %d -> %d", h, *sh);
}
return TRUE;
@@ -246,7 +246,7 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
float a1, a2, xd, yd;
int *row, *col;
int x, y;
BYTE *sp, *dp, *sa;
uint8_t *sp, *dp, *sa;
if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return;
if (!gr_clip_xywh(src, &sx, &sy, &sw, &sh)) return;
@@ -274,13 +274,13 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
switch(dst->depth) {
case 16:
{
WORD *yls, *yld;
BYTE *yla;
uint16_t *yls, *yld;
uint8_t *yla;
for (y = 0; y < dh; y++) {
yls = (WORD *)(sp + *(y + col) * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
yla = (BYTE *)(sa + *(y + col) * src->width);
yls = (uint16_t *)(sp + *(y + col) * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
yla = (uint8_t *)(sa + *(y + col) * src->width);
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND16(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x)));
}
@@ -297,13 +297,13 @@ void gr_copy_stretch_blend_alpha_map(surface_t *dst, int dx, int dy, int dw, int
case 24:
case 32:
{
DWORD *yls, *yld;
BYTE *yla;
uint32_t *yls, *yld;
uint8_t *yla;
for (y = 0; y < dh; y++) {
yls = (DWORD *)(sp + *(y + col) * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
yla = (BYTE *)(sa + *(y + col) * src->width);
yls = (uint32_t *)(sp + *(y + col) * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
yla = (uint8_t *)(sa + *(y + col) * src->width);
for (x = 0; x < dw; x++) {
*(yld + x) = ALPHABLEND24(*(yls+ *(row + x)), *(yld+x), *(yla+*(row+x)));
}
+18 -18
View File
@@ -1,5 +1,5 @@
void gr_fill_alpha_overborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d) {
BYTE *dp;
uint8_t *dp;
int x, y;
if (dst == NULL) return;
@@ -10,14 +10,14 @@ void gr_fill_alpha_overborder(surface_t *dst, int dx, int dy, int dw, int dh, in
for (y = 0; y < dh; y++) {
for (x = 0; x < dw; x++) {
if (*(dp + x) >= (BYTE)s) *(dp + x) = (BYTE)d;
if (*(dp + x) >= (uint8_t)s) *(dp + x) = (uint8_t)d;
}
dp += dst->width;
}
}
void gr_fill_alpha_underborder(surface_t *dst, int dx, int dy, int dw, int dh, int s, int d) {
BYTE *dp;
uint8_t *dp;
int x, y;
if (dst == NULL) return;
@@ -28,14 +28,14 @@ void gr_fill_alpha_underborder(surface_t *dst, int dx, int dy, int dw, int dh, i
for (y = 0; y < dh; y++) {
for (x = 0; x < dw; x++) {
if (*(dp + x) <= (BYTE)s) *(dp + x) = (BYTE)d;
if (*(dp + x) <= (uint8_t)s) *(dp + x) = (uint8_t)d;
}
dp += dst->width;
}
}
void gr_copy_alpha_map_sprite(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int cl) {
BYTE *sp, *dp;
uint8_t *sp, *dp;
int x, y;
if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return;
@@ -86,7 +86,7 @@ void gr_blend_alpha_wds_stretch2x2(surface_t *src1, int sx1, int sy1, surface_t
void gr_blend_alpha_wds(surface_t *src1, int sx1, int sy1, surface_t *src2, int sx2, int sy2, int sw, int sh, surface_t *dst, int dx, int dy) {
int x, y;
BYTE *sp1, *sp2, *dp, *sa;
uint8_t *sp1, *sp2, *dp, *sa;
sp1 = GETOFFSET_PIXEL(src1, sx1, sy1);
sp2 = GETOFFSET_PIXEL(src2, sx2, sy2);
@@ -96,14 +96,14 @@ void gr_blend_alpha_wds(surface_t *src1, int sx1, int sy1, surface_t *src2, int
switch(dst->depth) {
case 16:
{
WORD *yls1, *yls2, *yld;
BYTE *yla;
uint16_t *yls1, *yls2, *yld;
uint8_t *yla;
for (y = 0; y < sh; y++) {
yls1 = (WORD *)(sp1 + y * src1->bytes_per_line);
yls2 = (WORD *)(sp2 + y * src2->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
yla = (BYTE *)(sa + y * src1->width);
yls1 = (uint16_t *)(sp1 + y * src1->bytes_per_line);
yls2 = (uint16_t *)(sp2 + y * src2->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
yla = (uint8_t *)(sa + y * src1->width);
for (x = 0; x < sw; x++) {
*yld = SUTURADD16(*yls1, ALPHABLEND16(*yls1, *yls2, *yla));
@@ -116,14 +116,14 @@ void gr_blend_alpha_wds(surface_t *src1, int sx1, int sy1, surface_t *src2, int
case 24:
case 32:
{
DWORD *yls1, *yls2, *yld;
BYTE *yla;
uint32_t *yls1, *yls2, *yld;
uint8_t *yla;
for (y = 0; y < sh; y++) {
yls1 = (DWORD *)(sp1 + y * src1->bytes_per_line);
yls2 = (DWORD *)(sp2 + y * src2->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
yla = (BYTE *)(sa + y * src1->width);
yls1 = (uint32_t *)(sp1 + y * src1->bytes_per_line);
yls2 = (uint32_t *)(sp2 + y * src2->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
yla = (uint8_t *)(sa + y * src1->width);
for (x = 0; x < sw; x++) {
*yld = SUTURADD24(*yls1, ALPHABLEND24(*yls1, *yls2, *yla));
+1 -1
View File
@@ -14,7 +14,7 @@ int gr_blend_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, i
if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG;
if (src->alpha == NULL) {
WARNING("src alpha NULL\n");
WARNING("src alpha NULL");
return NG;
}
+11 -11
View File
@@ -42,7 +42,7 @@
*/
void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
int dx, dy, dw, dh;
BYTE *sp, *dp, r, g, b;
uint8_t *sp, *dp, r, g, b;
dx = x;
dy = y;
@@ -53,16 +53,16 @@ void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
int data_offset = (abs(dy - y) * cg->width + abs(dx - x)) * 3;
sp = (BYTE *)(cg->pic + data_offset);
sp = (uint8_t *)(cg->pic + data_offset);
dp = GETOFFSET_PIXEL(ds, dx, dy);
switch(ds->depth) {
case 16:
{
WORD *yl;
uint16_t *yl;
for (y = 0; y < dh; y++) {
yl = (WORD *)(dp + y * ds->bytes_per_line);
yl = (uint16_t *)(dp + y * ds->bytes_per_line);
for (x = 0; x < dw; x++) {
r = *sp;
g = *(sp +1);
@@ -78,10 +78,10 @@ void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
case 24:
case 32:
{
DWORD *yl;
uint32_t *yl;
for (y = 0; y < dh; y++) {
yl = (DWORD *)(dp + y * ds->bytes_per_line);
yl = (uint32_t *)(dp + y * ds->bytes_per_line);
for (x = 0; x < dw; x++) {
r = *sp;
g = *(sp +1);
@@ -105,8 +105,8 @@ void gr_drawimage24(surface_t *ds, cgdata *cg, int x, int y) {
*/
void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y) {
int dx, dy, dw, dh;
BYTE *dp;
WORD pic16, *sp;
uint8_t *dp;
uint16_t pic16, *sp;
dx = x;
dy = y;
@@ -117,7 +117,7 @@ void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y) {
int data_offset = (abs(dy - y) * cg->width + abs(dx - x)) * 2;
sp = (WORD *)(cg->pic + data_offset);
sp = (uint16_t *)(cg->pic + data_offset);
dp = GETOFFSET_PIXEL(ds, dx, dy);
switch(ds->depth) {
@@ -134,10 +134,10 @@ void gr_drawimage16(surface_t *ds, cgdata *cg, int x, int y) {
case 24:
case 32:
{
DWORD *yl;
uint32_t *yl;
for (y = 0; y < dh; y++) {
yl = (DWORD *)(dp + y * ds->bytes_per_line);
yl = (uint32_t *)(dp + y * ds->bytes_per_line);
for (x = 0; x < dw; x++) {
pic16 = *sp;
*yl = PIX24(PIXR16(pic16), PIXG16(pic16), PIXB16(pic16));
+1 -1
View File
@@ -42,7 +42,7 @@
* @param sh:
*/
int gr_copy(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) {
BYTE *sp, *dp;
uint8_t *sp, *dp;
if (src == NULL || dst == NULL) return NG;
if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG;
+3 -3
View File
@@ -42,7 +42,7 @@
* @param sh:
*/
int gr_copy_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) {
BYTE *sp, *dp;
uint8_t *sp, *dp;
if (!gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) return NG;
@@ -50,12 +50,12 @@ int gr_copy_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, in
dp = GETOFFSET_ALPHA(dst, dx, dy);
if (sp == NULL) {
WARNING("src alpha NULL\n");
WARNING("src alpha NULL");
return NG;
}
if (dp == NULL) {
WARNING("dst alpha NULL\n");
WARNING("dst alpha NULL");
return NG;
}
+7 -7
View File
@@ -9,7 +9,7 @@
void gr_copy_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) {
int x, y;
BYTE *sp, *dp;
uint8_t *sp, *dp;
if (!gr_clip(src, &sx, &sy, &width, &height, dst, &dx, &dy)) return;
@@ -21,11 +21,11 @@ void gr_copy_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int
switch(dst->depth) {
case 16:
{
WORD *yls, *yld;
uint16_t *yls, *yld;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
yls = (uint16_t *)(sp + y * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < width; x++) {
*yld = ALPHALEVEL16(*yls, lv);
@@ -37,11 +37,11 @@ void gr_copy_bright(surface_t *dst, int dx, int dy, surface_t *src, int sx, int
case 24:
case 32:
{
DWORD *yls, *yld;
uint32_t *yls, *yld;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
yls = (uint32_t *)(sp + y * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < width; x++) {
*yld = ALPHALEVEL24(*yls, lv);
+2 -2
View File
@@ -6,9 +6,9 @@
#include "ngraph.h"
#include "ags.h"
int gr_draw_amap(surface_t *dst, int dx, int dy, BYTE *src, int width, int height, int scanline) {
int gr_draw_amap(surface_t *dst, int dx, int dy, uint8_t *src, int width, int height, int scanline) {
int y;
BYTE *sp, *dp;
uint8_t *sp, *dp;
sp = src;
dp = GETOFFSET_ALPHA(dst, dx, dy);
+11 -11
View File
@@ -7,7 +7,7 @@
#include "ags.h"
int gr_expandcolor_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh, int r, int g, int b) {
BYTE *sp, *dp;
uint8_t *sp, *dp;
int x, y;
int col;
@@ -22,14 +22,14 @@ int gr_expandcolor_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx,
case 16:
col = PIX16(r, g, b);
{
WORD *yd;
BYTE *ys;
uint16_t *yd;
uint8_t *ys;
for (y = 0; y < sh; y++) {
ys = (BYTE *)(sp + y * src->bytes_per_line);
yd = (WORD *)(dp + y * dst->bytes_per_line);
ys = (uint8_t *)(sp + y * src->bytes_per_line);
yd = (uint16_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < sw; x++) {
if (*ys) {
*yd = ALPHABLEND16(col, *yd, (BYTE)*ys);
*yd = ALPHABLEND16(col, *yd, (uint8_t)*ys);
}
ys++; yd++;
}
@@ -38,15 +38,15 @@ int gr_expandcolor_blend(surface_t *dst, int dx, int dy, surface_t *src, int sx,
break;
case 32:
case 24: {
DWORD *yd;
BYTE *ys;
uint32_t *yd;
uint8_t *ys;
col = PIX24(r, g, b);
for (y = 0; y < sh; y++) {
ys = (BYTE *)(sp + y * src->bytes_per_line);
yd = (DWORD *)(dp + y * dst->bytes_per_line);
ys = (uint8_t *)(sp + y * src->bytes_per_line);
yd = (uint32_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < sw; x++) {
if (*ys) {
*yd = ALPHABLEND24(col, *yd, (BYTE)*ys);
*yd = ALPHABLEND24(col, *yd, (uint8_t)*ys);
}
ys++; yd++;
}
+5 -5
View File
@@ -7,7 +7,7 @@
#include "ags.h"
int gr_fill(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b) {
BYTE *dp, *dp_;
uint8_t *dp, *dp_;
int x, y;
if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) {
@@ -23,10 +23,10 @@ int gr_fill(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b)
case 16:
{
WORD pic16 = PIX16(r, g, b);
uint16_t pic16 = PIX16(r, g, b);
for (x = 0; x < dw; x++) {
*((WORD *)dp + x) = pic16;
*((uint16_t *)dp + x) = pic16;
}
break;
@@ -34,10 +34,10 @@ int gr_fill(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b)
case 24:
case 32:
{
DWORD pic24 = PIX24(r, g, b);
uint32_t pic24 = PIX24(r, g, b);
for (x = 0; x < dw; x++) {
*((DWORD *)dp + x) = pic24;
*((uint32_t *)dp + x) = pic24;
}
break;
+7 -7
View File
@@ -9,7 +9,7 @@
int gr_fill_alpha_color(surface_t *dst, int dx, int dy, int dw, int dh, int r, int g, int b, int lv) {
int x, y;
BYTE *dp;
uint8_t *dp;
if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) {
return NG;
@@ -20,11 +20,11 @@ int gr_fill_alpha_color(surface_t *dst, int dx, int dy, int dw, int dh, int r, i
switch(dst->depth) {
case 16:
{
WORD pic16 = PIX16(r, g, b);
WORD *yls;
uint16_t pic16 = PIX16(r, g, b);
uint16_t *yls;
for (y = 0; y < dh; y++) {
yls = (WORD *)(dp + y * dst->bytes_per_line);
yls = (uint16_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < dw; x++) {
*yls = ALPHABLEND16(pic16, *yls, lv);
yls++;
@@ -35,11 +35,11 @@ int gr_fill_alpha_color(surface_t *dst, int dx, int dy, int dw, int dh, int r, i
case 24:
case 32:
{
DWORD pic24 = PIX24(r, g, b);
DWORD *yls;
uint32_t pic24 = PIX24(r, g, b);
uint32_t *yls;
for (y = 0; y < dh; y++) {
yls = (DWORD *)(dp + y * dst->bytes_per_line);
yls = (uint32_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < dw; x++) {
*yls = ALPHABLEND24(pic24, *yls, lv);
yls++;
+1 -1
View File
@@ -7,7 +7,7 @@
#include "ags.h"
int gr_fill_alpha_map(surface_t *dst, int dx, int dy, int dw, int dh, int lv) {
BYTE *a;
uint8_t *a;
if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) {
return NG;
+13 -13
View File
@@ -6,7 +6,7 @@
#include "ags.h"
int gr_drawrect(surface_t *dst, int x, int y, int w, int h, int r, int g, int b) {
BYTE *dp;
uint8_t *dp;
int i;
int col = 0;
@@ -30,41 +30,41 @@ int gr_drawrect(surface_t *dst, int x, int y, int w, int h, int r, int g, int b)
case 8:
/* top */
for (i = 0; i < w; i++) {
*((BYTE *)dp + i) = col;
*((uint8_t *)dp + i) = col;
}
/* side */
h-=2;
for (i = 0; i < h; i++) {
dp += dst->bytes_per_line;
*((BYTE *)dp) = col;
*((BYTE *)dp + w - 1) = col;
*((uint8_t *)dp) = col;
*((uint8_t *)dp + w - 1) = col;
}
/* bottom */
dp += dst->bytes_per_line;
for (i = 0; i < w; i++) {
*((BYTE *)dp + i) = col;
*((uint8_t *)dp + i) = col;
}
break;
case 16:
/* top */
for (i = 0; i < w; i++) {
*((WORD *)dp + i) = col;
*((uint16_t *)dp + i) = col;
}
/* side */
h-=2;
for (i = 0; i < h; i++) {
dp += dst->bytes_per_line;
*((WORD *)dp) = col;
*((WORD *)dp + w - 1) = col;
*((uint16_t *)dp) = col;
*((uint16_t *)dp + w - 1) = col;
}
/* bottom */
dp += dst->bytes_per_line;
for (i = 0; i < w; i++) {
*((WORD *)dp + i) = col;
*((uint16_t *)dp + i) = col;
}
break;
@@ -72,21 +72,21 @@ int gr_drawrect(surface_t *dst, int x, int y, int w, int h, int r, int g, int b)
case 32:
/* top */
for (i = 0; i < w; i++) {
*((DWORD *)dp + i) = col;
*((uint32_t *)dp + i) = col;
}
/* side */
h-=2;
for (i = 0; i < h; i++) {
dp += dst->bytes_per_line;
*((DWORD *)dp) = col;
*((DWORD *)dp + w - 1) = col;
*((uint32_t *)dp) = col;
*((uint32_t *)dp + w - 1) = col;
}
/* bottom */
dp += dst->bytes_per_line;
for (i = 0; i < w; i++) {
*((DWORD *)dp + i) = col;
*((uint32_t *)dp + i) = col;
}
break;
+6 -6
View File
@@ -9,7 +9,7 @@
#include "ags.h"
int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh) {
BYTE *sp, *dp;
uint8_t *sp, *dp;
int x, y;
if (FALSE == gr_clip(src, &sx, &sy, &sw, &sh, dst, &dx, &dy)) {
@@ -17,12 +17,12 @@ int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx
}
if (src->alpha == NULL) {
WARNING("src alpha NULL\n");
WARNING("src alpha NULL");
return NG;
}
if (dst->alpha == NULL) {
WARNING("dst alpha NULL\n");
WARNING("dst alpha NULL");
return NG;
}
@@ -30,11 +30,11 @@ int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx
dp = GETOFFSET_ALPHA(dst, dx, dy);
for (y = 0; y < sh; y++) {
BYTE *yls = sp + y * src->width;
BYTE *yld = dp + y * dst->width;
uint8_t *yls = sp + y * src->width;
uint8_t *yld = dp + y * dst->width;
for (x = 0; x < sw; x++) {
int s = *yls, d = *yld;
*yld = (BYTE)(min(255, (s + d)));
*yld = (uint8_t)(min(255, (s + d)));
yls++; yld++;
}
}
+11 -11
View File
@@ -12,7 +12,7 @@ void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *
float a1, a2, xd, yd;
int *row, *col;
int x, y;
BYTE *sp, *dp;
uint8_t *sp, *dp;
if (!gr_clip_xywh(dst, &dx, &dy, &dw, &dh)) return;
if (!gr_clip_xywh(src, &sx, &sy, &sw, &sh)) return;
@@ -40,16 +40,16 @@ void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *
switch(dst->depth) {
case 16:
{
WORD *yls, *yld;
BYTE *_yls, *_yld;
uint16_t *yls, *yld;
uint8_t *_yls, *_yld;
for (y = 0; y < dh; y++) {
yls = (WORD *)(sp + *(y + col) * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
yls = (uint16_t *)(sp + *(y + col) * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < dw; x++) {
*(yld + x) = *(yls + *(row + x));
}
_yld = (BYTE *)yld;
_yld = (uint8_t *)yld;
while(*(col + y) == *(col + y + 1)) {
_yls = _yld;
_yld += dst->bytes_per_line;
@@ -62,16 +62,16 @@ void gr_copy_stretch(surface_t *dst, int dx, int dy, int dw, int dh, surface_t *
case 24:
case 32:
{
DWORD *yls, *yld;
BYTE *_yls, *_yld;
uint32_t *yls, *yld;
uint8_t *_yls, *_yld;
for (y = 0; y < dh; y++) {
yls = (DWORD *)(sp + *(y + col) * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
yls = (uint32_t *)(sp + *(y + col) * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
for (x = 0; x < dw; x++) {
*(yld + x) = *(yls+ *(row + x));
}
_yld = (BYTE *)yld;
_yld = (uint8_t *)yld;
while(*(col + y) == *(col + y + 1)) {
_yls = _yld;
_yld += dst->bytes_per_line;
+9 -9
View File
@@ -8,7 +8,7 @@
#include "ags.h"
int gre_Blend(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, int lv) {
BYTE *sp, *dp, *wp;
uint8_t *sp, *dp, *wp;
int x, y;
wp = GETOFFSET_PIXEL(write, wx, wy);
@@ -18,12 +18,12 @@ int gre_Blend(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy,
switch(dst->depth) {
case 16:
{
WORD *yls, *yld, *ylw;
uint16_t *yls, *yld, *ylw;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
ylw = (WORD *)(wp + y * write->bytes_per_line);
yls = (uint16_t *)(sp + y * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
ylw = (uint16_t *)(wp + y * write->bytes_per_line);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND16(*yls, *yld, lv);
@@ -35,12 +35,12 @@ int gre_Blend(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy,
case 24:
case 32:
{
DWORD *yls, *yld, *ylw;
uint32_t *yls, *yld, *ylw;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
ylw = (DWORD *)(wp + y * write->bytes_per_line);
yls = (uint32_t *)(sp + y * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
ylw = (uint32_t *)(wp + y * write->bytes_per_line);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND24(*yls, *yld, lv);
+9 -9
View File
@@ -7,7 +7,7 @@
#include "ags.h"
int gre_BlendScreen(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height) {
BYTE *sp, *dp, *wp;
uint8_t *sp, *dp, *wp;
int x, y;
wp = GETOFFSET_PIXEL(write, wx, wy);
@@ -17,12 +17,12 @@ int gre_BlendScreen(surface_t *write, int wx, int wy, surface_t *dst, int dx, in
switch(dst->depth) {
case 16:
{
WORD *yls, *yld, *ylw;
uint16_t *yls, *yld, *ylw;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
ylw = (WORD *)(wp + y * write->bytes_per_line);
yls = (uint16_t *)(sp + y * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
ylw = (uint16_t *)(wp + y * write->bytes_per_line);
for (x = 0; x < width; x++) {
*ylw = SUTURADD16(*yls, *yld);
@@ -34,12 +34,12 @@ int gre_BlendScreen(surface_t *write, int wx, int wy, surface_t *dst, int dx, in
case 32:
case 24:
{
DWORD *yls, *yld, *ylw;
uint32_t *yls, *yld, *ylw;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
ylw = (DWORD *)(wp + y * write->bytes_per_line);
yls = (uint32_t *)(sp + y * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
ylw = (uint32_t *)(wp + y * write->bytes_per_line);
for (x = 0; x < width; x++) {
*ylw = SUTURADD24(*yls, *yld);
+25 -25
View File
@@ -9,7 +9,7 @@
#include "ags.h"
int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int width, int height, surface_t *alpha, int ax, int ay, int lv) {
BYTE *sp, *dp, *wp, *ap;
uint8_t *sp, *dp, *wp, *ap;
int x, y;
wp = GETOFFSET_PIXEL(write, wx, wy);
@@ -21,14 +21,14 @@ int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, i
switch(dst->depth) {
case 16:
{
WORD *yls, *yld, *ylw;
BYTE *yla;
uint16_t *yls, *yld, *ylw;
uint8_t *yla;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
ylw = (WORD *)(wp + y * write->bytes_per_line);
yla = (BYTE *)(ap + y * alpha->width);
yls = (uint16_t *)(sp + y * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
ylw = (uint16_t *)(wp + y * write->bytes_per_line);
yla = (uint8_t *)(ap + y * alpha->width);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND16(*yls, *yld, *yla);
@@ -40,14 +40,14 @@ int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, i
case 24:
case 32:
{
DWORD *yls, *yld, *ylw;
BYTE *yla;
uint32_t *yls, *yld, *ylw;
uint8_t *yla;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
ylw = (DWORD *)(wp + y * write->bytes_per_line);
yla = (BYTE *)(ap + y * alpha->width);
yls = (uint32_t *)(sp + y * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
ylw = (uint32_t *)(wp + y * write->bytes_per_line);
yla = (uint8_t *)(ap + y * alpha->width);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND24(*yls, *yld, *yla);
@@ -62,14 +62,14 @@ int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, i
switch(dst->depth) {
case 16:
{
WORD *yls, *yld, *ylw;
BYTE *yla;
uint16_t *yls, *yld, *ylw;
uint8_t *yla;
for (y = 0; y < height; y++) {
yls = (WORD *)(sp + y * src->bytes_per_line);
yld = (WORD *)(dp + y * dst->bytes_per_line);
ylw = (WORD *)(wp + y * write->bytes_per_line);
yla = (BYTE *)(ap + y * alpha->width);
yls = (uint16_t *)(sp + y * src->bytes_per_line);
yld = (uint16_t *)(dp + y * dst->bytes_per_line);
ylw = (uint16_t *)(wp + y * write->bytes_per_line);
yla = (uint8_t *)(ap + y * alpha->width);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND16(*yls, *yld, (*yla * lv) / 255);
@@ -81,14 +81,14 @@ int gre_BlendUseAMap(surface_t *write, int wx, int wy, surface_t *dst, int dx, i
case 24:
case 32:
{
DWORD *yls, *yld, *ylw;
BYTE *yla;
uint32_t *yls, *yld, *ylw;
uint8_t *yla;
for (y = 0; y < height; y++) {
yls = (DWORD *)(sp + y * src->bytes_per_line);
yld = (DWORD *)(dp + y * dst->bytes_per_line);
ylw = (DWORD *)(wp + y * write->bytes_per_line);
yla = (BYTE *)(ap + y * alpha->width);
yls = (uint32_t *)(sp + y * src->bytes_per_line);
yld = (uint32_t *)(dp + y * dst->bytes_per_line);
ylw = (uint32_t *)(wp + y * write->bytes_per_line);
yla = (uint8_t *)(ap + y * alpha->width);
for (x = 0; x < width; x++) {
*ylw = ALPHABLEND24(*yls, *yld, (*yla * lv) / 255);
+1 -1
View File
@@ -49,7 +49,7 @@ extern int gr_blend_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, in
extern int gr_saturadd_alpha_map(surface_t *dst, int dx, int dy, surface_t *src, int sx, int sy, int sw, int sh);
/* in graph_draw_amap.c */
extern int gr_draw_amap(surface_t *dst, int dx, int dy, BYTE *src, int width, int height, int scanline);
extern int gr_draw_amap(surface_t *dst, int dx, int dy, uint8_t *src, int width, int height, int scanline);
// /* in graph_bright_dst_only.c */
#define gr_bright_dst_only(dst,dx,dy,w,h,lv) gr_copy_bright(dst,dx,dy,dst,dx,dy,w,h,lv)
+9 -9
View File
@@ -21,28 +21,28 @@ static surface_t *create(int width, int height, int depth, boolean has_pixel, bo
if (has_pixel) {
switch (s->depth) {
case 8:
s->pixel = calloc(width * (height +1), sizeof(BYTE));
s->pixel = calloc(width * (height +1), sizeof(uint8_t));
s->bytes_per_line = width;
s->bytes_per_pixel = 1;
break;
case 16:
s->pixel = calloc(width * (height +1) * 2, sizeof(BYTE));
s->pixel = calloc(width * (height +1) * 2, sizeof(uint8_t));
s->bytes_per_line = width * 2;
s->bytes_per_pixel = 2;
break;
case 24:
case 32:
s->pixel = calloc(width * (height +1) * 4, sizeof(BYTE));
s->pixel = calloc(width * (height +1) * 4, sizeof(uint8_t));
s->bytes_per_line = width * 4;
s->bytes_per_pixel = 4;
break;
default:
WARNING("depth %d is not supported\n", s->depth);
WARNING("depth %d is not supported", s->depth);
}
}
if (has_alpha) {
s->alpha = calloc(width * (height +1), sizeof(BYTE));
s->alpha = calloc(width * (height +1), sizeof(uint8_t));
}
return s;
@@ -108,13 +108,13 @@ surface_t *sf_dup(surface_t *in) {
if (in->pixel) {
len = sf->bytes_per_line * sf->height;
sf->pixel = malloc(sizeof(BYTE) * (len + sf->bytes_per_line));
sf->pixel = malloc(sizeof(uint8_t) * (len + sf->bytes_per_line));
memcpy(sf->pixel, in->pixel, len);
}
if (in->alpha) {
len = sf->width * sf->height;
sf->alpha = malloc(sizeof(BYTE) * (len + sf->width));
sf->alpha = malloc(sizeof(uint8_t) * (len + sf->width));
memcpy(sf->alpha, in->alpha, len);
}
@@ -167,7 +167,7 @@ surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha) {
if (in->pixel) {
len = sf->bytes_per_line * sf->height;
sf->pixel = malloc(sizeof(BYTE) * (len + sf->bytes_per_line));
sf->pixel = malloc(sizeof(uint8_t) * (len + sf->bytes_per_line));
if (copypixel) {
memcpy(sf->pixel, in->pixel, len);
}
@@ -175,7 +175,7 @@ surface_t *sf_dup2(surface_t *in, boolean copypixel, boolean copyalpha) {
if (in->alpha) {
len = sf->width * sf->height;
sf->alpha = malloc(sizeof(BYTE) * (len + sf->width));
sf->alpha = malloc(sizeof(uint8_t) * (len + sf->width));
if (copyalpha) {
memcpy(sf->alpha, in->alpha, len);
}
+2 -2
View File
@@ -65,7 +65,7 @@ static void resolve_func(S39AIN_DLLFN *func, const Module *mod) {
if (mf)
func->entrypoint = mf->entrypoint;
else
WARNING("Cannot resolve DLL function %s.%s\n", mod->name, func->name);
WARNING("Cannot resolve DLL function %s.%s", mod->name, func->name);
}
int resolve_module(S39AIN_DLLINF *dll) {
@@ -80,6 +80,6 @@ int resolve_module(S39AIN_DLLINF *dll) {
return OK;
}
}
WARNING("Cannot resolve DLL: %s\n", dll->name);
WARNING("Cannot resolve DLL: %s", dll->name);
return NG;
}
+4 -4
View File
@@ -16,23 +16,23 @@ static void Init() {
*var = 0;
DEBUG_COMMAND_YET("nDEMO.Init %p:\n", var);
DEBUG_COMMAND_YET("nDEMO.Init %p:", var);
}
static void SetKeyCancelFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMO.SetKeyCancelFlag %d:\n", p1);
DEBUG_COMMAND_YET("nDEMO.SetKeyCancelFlag %d:", p1);
}
static void SetLoopFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMO.SetLoopFlag %d:\n", p1);
DEBUG_COMMAND_YET("nDEMO.SetLoopFlag %d:", p1);
}
static void Run() {
DEBUG_COMMAND_YET("nDEMO.Run:\n");
DEBUG_COMMAND_YET("nDEMO.Run:");
}
static const ModuleFunc functions[] = {
+3 -3
View File
@@ -14,17 +14,17 @@ static void Init() {
int p3 = getCaliValue();
int *var = getCaliVariable();
DEBUG_COMMAND_YET("nDEMOE.Init %p:\n", var);
DEBUG_COMMAND_YET("nDEMOE.Init %p:", var);
}
static void SetKeyCancelFlag() {
int p1 = getCaliValue();
DEBUG_COMMAND_YET("nDEMOE.SetKeyCancelFlag %d:\n", p1);
DEBUG_COMMAND_YET("nDEMOE.SetKeyCancelFlag %d:", p1);
}
static void Run() {
DEBUG_COMMAND_YET("nDEMOE.Run:\n");
DEBUG_COMMAND_YET("nDEMOE.Run:");
}
static const ModuleFunc functions[] = {
+4 -4
View File
@@ -17,24 +17,24 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("oDEMO.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("oDEMO.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("oDEMO.SetKeyCancelFlag %d:\n", cancelflag);
DEBUG_COMMAND_YET("oDEMO.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("oDEMO.SetLoopFlag %d:\n", loopflag);
DEBUG_COMMAND_YET("oDEMO.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("oDEMO.Run:\n");
DEBUG_COMMAND_YET("oDEMO.Run:");
}
static const ModuleFunc functions[] = {
+45 -45
View File
@@ -13,11 +13,11 @@
#define NUM_MAPS 16
#define NUM_LAYERS 3
#define MAPDATASIZE (128 * 128 * sizeof(WORD) * NUM_LAYERS)
#define MAPDATASIZE (128 * 128 * sizeof(uint16_t) * NUM_LAYERS)
typedef struct {
DWORD size;
DWORD map;
uint32_t size;
uint32_t map;
} RecordHeader;
static void *mapdata[NUM_MAPS];
@@ -46,7 +46,7 @@ static void MakeMapSetParam() {
int p4 = getCaliValue();
if (p1 != NUM_LAYERS) {
WARNING("Unexpected number of layers: %d\n", p1);
WARNING("Unexpected number of layers: %d", p1);
return;
}
setChipParam_index = 0;
@@ -54,7 +54,7 @@ static void MakeMapSetParam() {
window_height = p3;
map_width = p4;
DEBUG_COMMAND("oujimisc.MakeMapSetParam %d,%d,%d,%d:\n", p1,p2,p3,p4);
DEBUG_COMMAND("oujimisc.MakeMapSetParam %d,%d,%d,%d:", p1,p2,p3,p4);
}
static void MakeMapSetChipParam() {
@@ -65,7 +65,7 @@ static void MakeMapSetChipParam() {
int p5 = getCaliValue();
if (setChipParam_index >= NUM_LAYERS) {
WARNING("unexpected MakeMapSeChipParam call\n");
WARNING("unexpected MakeMapSeChipParam call");
return;
}
MyRectangle *r = &chip_params[setChipParam_index++];
@@ -74,7 +74,7 @@ static void MakeMapSetChipParam() {
r->w = p3;
r->h = p4;
DEBUG_COMMAND("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:\n", p1,p2,p3,p4,p5);
DEBUG_COMMAND("oujimisc.MakeMapSeChipParam %d,%d,%d,%d,%d:", p1,p2,p3,p4,p5);
}
static void MakeMapDraw() {
@@ -106,13 +106,13 @@ static void MakeMapDraw() {
}
}
DEBUG_COMMAND("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:\n", p1,dstX,dstY,posX,posY,a1,a2,a3);
DEBUG_COMMAND("oujimisc.MakeMapDraw %d,%d,%d,%d,%d,%p,%p,%p:", p1,dstX,dstY,posX,posY,a1,a2,a3);
}
static void MakeMapInit() {
int p1 = getCaliValue(); /* ISys3x */
DEBUG_COMMAND_YET("oujimisc.MakeMapInit %d:\n", p1);
DEBUG_COMMAND_YET("oujimisc.MakeMapInit %d:", p1);
}
static void DrawNumber() {
@@ -137,7 +137,7 @@ static void DrawNumber() {
dstX += width;
}
DEBUG_COMMAND("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:\n", p1,srcX,srcY,width,height,dstX,dstY,num);
DEBUG_COMMAND("oujimisc.DrawNumber %d,%d,%d,%d,%d,%d,%d,%d:", p1,srcX,srcY,width,height,dstX,dstY,num);
}
static void TempMapCreateShadow() {
@@ -153,35 +153,35 @@ static void TempMapCreateShadow() {
ald_freedata(dfile);
}
DEBUG_COMMAND("oujimisc.TempMapCreateShadow:\n");
DEBUG_COMMAND("oujimisc.TempMapCreateShadow:");
}
static void TempMapInit() {
int p1 = getCaliValue(); /* ISys3x */
int p2 = getCaliValue();
DEBUG_COMMAND_YET("oujimisc.TempMapInit %d,%d:\n", p1,p2);
DEBUG_COMMAND_YET("oujimisc.TempMapInit %d,%d:", p1,p2);
}
static void TempMapLoadToShadow() {
int map = getCaliValue();
int *a1 = getCaliVariable();
int a1page = preVarPage;
int *a2 = getCaliVariable();
int a2page = preVarPage;
int *a3 = getCaliVariable();
int a3page = preVarPage;
struct VarRef r1, r2, r3;
if (!getCaliArray(&r1) || !getCaliArray(&r2) || !getCaliArray(&r3))
return;
int size = getCaliValue();
if (!mapdata[map]) {
WARNING("No map %d\n", map);
WARNING("No map %d", map);
return;
}
if (a1page == 0 || a2page == 0 || a3page == 0) {
WARNING("non-array destination variable\n");
if (r1.page == 0 || r2.page == 0 || r3.page == 0) {
WARNING("non-array destination variable");
return;
}
WORD *p = mapdata[map];
int *a1 = v_resolveRef(&r1);
int *a2 = v_resolveRef(&r2);
int *a3 = v_resolveRef(&r3);
uint16_t *p = mapdata[map];
for (int i = 0; i < size; i++)
*a1++ = SDL_SwapLE16(*p++);
for (int i = 0; i < size; i++)
@@ -189,28 +189,28 @@ static void TempMapLoadToShadow() {
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);
DEBUG_COMMAND("oujimisc.TempMapLoadToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
}
static void TempMapSaveToShadow() {
int map = getCaliValue();
int *a1 = getCaliVariable();
int a1page = preVarPage;
int *a2 = getCaliVariable();
int a2page = preVarPage;
int *a3 = getCaliVariable();
int a3page = preVarPage;
struct VarRef r1, r2, r3;
if (!getCaliArray(&r1) || !getCaliArray(&r2) || !getCaliArray(&r3))
return;
int size = getCaliValue();
if (!mapdata[map]) {
WARNING("No map %d\n", map);
WARNING("No map %d", map);
return;
}
if (a1page == 0 || a2page == 0 || a3page == 0) {
WARNING("non-array source variable\n");
if (r1.page == 0 || r2.page == 0 || r3.page == 0) {
WARNING("non-array source variable");
return;
}
WORD *p = mapdata[map];
int *a1 = v_resolveRef(&r1);
int *a2 = v_resolveRef(&r2);
int *a3 = v_resolveRef(&r3);
uint16_t *p = mapdata[map];
for (int i = 0; i < size; i++)
*p++ = SDL_SwapLE16(*a1++);
for (int i = 0; i < size; i++)
@@ -218,7 +218,7 @@ static void TempMapSaveToShadow() {
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);
DEBUG_COMMAND("oujimisc.TempMapSaveToShadow %d,%p,%p,%p,%d:", map,a1,a2,a3,size);
}
static void TempMapFileSave() {
@@ -228,7 +228,7 @@ static void TempMapFileSave() {
sprintf(fname, "王子_M%d.asd", p1);
FILE *fp = fc_open(fname, 'w');
if (!fp) {
WARNING("Cannot open %s\n", fname);
WARNING("Cannot open %s", fname);
return;
}
@@ -239,7 +239,7 @@ static void TempMapFileSave() {
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);
WARNING("compress2() failed: %d", r);
free(compressed);
continue;
}
@@ -250,7 +250,7 @@ static void TempMapFileSave() {
}
fclose(fp);
DEBUG_COMMAND("oujimisc.TempMapFileSave %d:\n", p1);
DEBUG_COMMAND("oujimisc.TempMapFileSave %d:", p1);
}
static void TempMapFileLoad() {
@@ -260,39 +260,39 @@ static void TempMapFileLoad() {
sprintf(fname, "王子_M%d.asd", p1);
FILE *fp = fc_open(fname, 'r');
if (!fp) {
WARNING("Cannot open %s\n", fname);
WARNING("Cannot open %s", fname);
return;
}
for (int i = 0; i < NUM_MAPS; i++) {
RecordHeader hdr;
if (fread(&hdr, sizeof(hdr), 1, fp) != 1) {
WARNING("fread error\n");
WARNING("fread error");
break;
}
if (hdr.map != i) {
WARNING("unexpected map no. %d != %d\n", hdr.map, i);
WARNING("unexpected map no. %d != %d", hdr.map, i);
break;
}
if (!mapdata[i]) {
WARNING("map %d is not allocated\n", i);
WARNING("map %d is not allocated", i);
break;
}
void *compressed = malloc(hdr.size);
if (fread(compressed, hdr.size, 1, fp) != 1) {
WARNING("fread error\n");
WARNING("fread error");
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);
WARNING("uncompress() failed: %d", r);
free(compressed);
}
fclose(fp);
DEBUG_COMMAND("oujimisc.TempMapFileLoad %d:\n", p1);
DEBUG_COMMAND("oujimisc.TempMapFileLoad %d:", p1);
}
static void CalcMoveDiffer() {
@@ -322,7 +322,7 @@ static void CalcMoveDiffer() {
*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);
DEBUG_COMMAND("oujimisc.CalcMoveDiffer %p,%p,%d,%d,%d,%d,%p,%d:", dx,dy,moveL,moveU,moveR,moveD,pt,duration);
}
static const ModuleFunc functions[] = {

Some files were not shown because too many files have changed in this diff Show More