Compare commits

...
29 Commits
Author SHA1 Message Date
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
kichikuou 0a37920c95 Version 2.5.1 2022-07-31 16:07:25 +09:00
kichikuou fa44889047 Fix a bug in sdl_setPalette()
It called SDL_SetPaletteColors() with wrong arguments when `first` was
not zero. PP command was affected by this.
2022-07-31 13:53:37 +09:00
kichikuou cee18a572e Implement palette shift effect (CD 1001)
Used in Toushin Toshi 2.
2022-07-31 12:44:30 +09:00
kichikuou 652d284628 Debugger: Check out-of-bounds array access
This prevents the debugger from SEGVing when trying to access a
variable.
2022-07-30 18:14:35 +09:00
kichikuou d2661e97f1 sdl_effect: Implement EFFECT_CIRCLE_WIPE_{IN,OUT} 2022-07-23 10:57:59 +09:00
kichikuou 0e9afe7c0a Implement grDrawFillCircle 2022-07-23 09:18:58 +09:00
kichikuou fbe8af5f7b Fix command line option name in README.md 2022-07-17 22:22:36 +09:00
kichikuou 0c1f8f8450 Version 2.5.0 2022-07-17 21:26:48 +09:00
kichikuou 078525e2c2 Reduce console message spam 2022-07-16 21:15:55 +09:00
kichikuou d4a4022894 Enable ARM Neon support in stb_image 2022-07-16 17:46:26 +09:00
kichikuou dc89c92139 Switch JPEG decoder to stb_image
To enable JPEG support on Android without complicating CMake files.
2022-07-16 17:16:44 +09:00
kichikuou 4f351fc767 Improve warning messages 2022-07-16 16:00:24 +09:00
kichikuou 02ef4a1771 Android: Upgrade SDL2_mixer to 2.6.0 2022-07-10 14:42:57 +09:00
kichikuou 4a20d74f1a Do not call sdl_getEvent in sdl_getWheelInfo
This fixes performance regression in Graymerca.
2022-07-02 15:30:18 +09:00
191 changed files with 11090 additions and 3078 deletions
+2 -2
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
@@ -17,7 +17,7 @@ jobs:
ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk-bundle ./gradlew assembleRelease
- 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
+4 -4
View File
@@ -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@v11
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 -3
View File
@@ -19,6 +19,7 @@ jobs:
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
pacboy: >-
gcc:p
cmake:p
@@ -26,14 +27,13 @@ jobs:
SDL2:p
SDL2_ttf:p
SDL2_mixer:p
libjpeg-turbo:p
libwebp:p
cjson:p
nsis:p
ntldd-git:p
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
@@ -51,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
-6
View File
@@ -28,7 +28,6 @@ check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION)
check_symbol_exists(uname "sys/utsname.h" HAVE_UNAME)
if (EMSCRIPTEN)
set(HAVE_JPEG 1)
set(DEFAULT_FONT_PATH /fonts/)
elseif (ANDROID)
set(SDL2MIXER_FOUND 1)
@@ -59,11 +58,6 @@ else()
endif()
endif()
include(FindJPEG)
if (JPEG_FOUND)
set(HAVE_JPEG 1)
endif()
optional_pkg_check_modules(WEBP IMPORTED_TARGET libwebp)
if (WEBP_FOUND)
set(HAVE_WEBP 1)
+3 -3
View File
@@ -41,7 +41,7 @@ examine / modify variables in the game. There are two ways to use the debugger:
- Through [Visual Studio Code](https://code.visualstudio.com/) (recommended):
The [vscode-system3x](https://github.com/kichikuou/vscode-system3x) extension
provides graphical debugging interface for System 3.x.
- Using CUI debugger: Running xsystem35 with `-debugger` option will start the
- Using CUI debugger: Running xsystem35 with `-debug` option will start the
debugger with console interface. Type `help` to see a list of available
commands.
@@ -81,7 +81,7 @@ Run xsystem35 from within the game directory.
[Homebrew](https://brew.sh/index_ja) is needed.
$ brew install cmake pkg-config sdl2 sdl2_mixer sdl2_ttf libjpeg webp cjson
$ brew install cmake pkg-config sdl2 sdl2_mixer sdl2_ttf webp cjson
$ mkdir -p out/debug
$ cd out/debug
$ cmake -DCMAKE_BUILD_TYPE=Debug ../../
@@ -91,7 +91,7 @@ Run xsystem35 from within the game directory.
[MSYS2](https://www.msys2.org) is needed.
$ pacman -S cmake mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-libwebp mingw-w64-x86_64-cjson
$ pacman -S cmake mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer mingw-w64-x86_64-libwebp mingw-w64-x86_64-cjson
$ mkdir -p out/debug
$ cd out/debug
$ cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Debug ../../
+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.
+7 -9
View File
@@ -16,8 +16,8 @@ android {
}
minSdkVersion 19
targetSdkVersion 31
versionCode 8
versionName "2.4.0"
versionCode 11
versionName "2.6.0"
externalNativeBuild {
cmake {
arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
@@ -32,6 +32,10 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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'
@@ -44,9 +48,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'
}
}
@@ -73,7 +75,3 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
static String getInstalledCmakeVersion() {
('cmake --version'.execute().text =~ /cmake version ([0-9.]+)/)[0][1]
}
+15 -9
View File
@@ -5,19 +5,18 @@ project(GAME)
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
)
# TODO: Use SDL2_mixer 2.0.5 once released
FetchContent_Declare(
SDL_mixer
GIT_REPOSITORY https://github.com/libsdl-org/SDL_mixer.git
GIT_TAG 6845d9f3cb3f35542f1ec7e74dba6b30bf968959
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
@@ -29,14 +28,21 @@ 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(SUPPORT_OGG ON CACHE BOOL "Enable OGG support in SDL_mixer" 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})
target_compile_definitions(SDL2_mixer PRIVATE MUSIC_WAV)
endif()
# The main CMakeLists.txt of xsystem35
+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)
@@ -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;
}
}
+1 -2
View File
@@ -1,5 +1,5 @@
#cmakedefine PACKAGE "@PACKAGE@"
#define VERSION "2.4.0"
#define VERSION "2.6.0"
#cmakedefine CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@"
@@ -25,7 +25,6 @@
#cmakedefine SEQ_DEVICE "@SEQ_DEVICE@"
#cmakedefine HAVE_GETLOGIN @HAVE_GETLOGIN@
#cmakedefine HAVE_JPEG @HAVE_JPEG@
#cmakedefine HAVE_MMAP @HAVE_MMAP@
#cmakedefine HAVE_SIGACTION @HAVE_SIGACTION@
#cmakedefine HAVE_UNAME @HAVE_UNAME@
+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[] = {
-5
View File
@@ -102,7 +102,6 @@ target_compile_options(modules PRIVATE -Wno-pointer-sign)
if (EMSCRIPTEN)
set(LIBS
"SHELL:-s USE_ZLIB=1"
"SHELL:-s USE_LIBJPEG=1"
"SHELL:-s USE_SDL=2")
target_compile_options(modules PRIVATE ${LIBS})
target_link_options(modules PRIVATE ${LIBS})
@@ -117,7 +116,3 @@ else()
target_link_libraries(modules PRIVATE PkgConfig::SDL2MIXER)
endif()
endif()
if (HAVE_JPEG AND NOT EMSCRIPTEN)
target_link_libraries(modules PRIVATE JPEG::JPEG)
endif()
+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 &&
+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;
+3 -11
View File
@@ -36,11 +36,7 @@
#include "input.h"
#include "ngraph.h"
#include "cg.h"
#ifdef HAVE_JPEG
#include "jpeg.h"
#endif
#ifdef HAVE_JPEG
#define FPS 30
@@ -69,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);
@@ -88,8 +84,6 @@ static void ndd_run(int demonum) {
alk_free(alk);
}
#endif
static void Init() {
int p1 = getCaliValue(); /* ISys3x */
int p2 = getCaliValue(); /* IWinMsg */
@@ -98,18 +92,16 @@ 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() {
int p1 = getCaliValue(); // デモ番号 0,1,2
int p2 = getCaliValue();
#ifdef HAVE_JPEG
ndd_run(p1);
#endif
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[] = {
+127 -127
View File
@@ -126,7 +126,7 @@ static void Init() {
sact.version = detect_sact_version();
if (!sact.version)
SYSERROR("Cannot determine SACT version");
NOTICE("SACT version = %d\n", sact.version);
NOTICE("SACT version = %d", sact.version);
// 初期座標原点
sact.origin.x = 0;
@@ -160,7 +160,7 @@ static void Init() {
sact.logging = FALSE;
}
DEBUG_COMMAND("SACT.Init %d:\n", p1);
DEBUG_COMMAND("SACT.Init %d:", p1);
}
/**
@@ -181,7 +181,7 @@ static void CreateSprite() {
sp_new(wNum, wNumCG1, wNumCG2, wNumCG3, wType);
DEBUG_COMMAND_YET("SACT.CreateSprite %d,%d,%d,%d,%d:\n", wNum, wNumCG1, wNumCG2, wNumCG3, wType);
DEBUG_COMMAND_YET("SACT.CreateSprite %d,%d,%d,%d,%d:", wNum, wNumCG1, wNumCG2, wNumCG3, wType);
}
/**
@@ -202,7 +202,7 @@ static void CreateTextSprite() {
sp_new_msg(wNum, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.CreateTextSprite %d,%d,%d,%d,%d:\n", wNum, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.CreateTextSprite %d,%d,%d,%d,%d:", wNum, wX, wY, wWidth, wHeight);
}
/**
@@ -215,7 +215,7 @@ static void SetWallPaper() {
sp_set_wall_paper(wNum);
DEBUG_COMMAND_YET("SACT.SetWallPaper %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SetWallPaper %d:", wNum);
}
/**
@@ -225,7 +225,7 @@ static void SetWallPaper() {
static void Clear() {
sp_free_all();
DEBUG_COMMAND_YET("SACT.Clear:\n");
DEBUG_COMMAND_YET("SACT.Clear:");
}
/**
@@ -238,7 +238,7 @@ static void Delete() {
sp_free(wNum);
DEBUG_COMMAND_YET("SACT.Delete %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.Delete %d:", wNum);
}
/**
@@ -256,7 +256,7 @@ static void SpriteDeleteCount() {
sp_free(i);
}
DEBUG_COMMAND_YET("SACT.SpriteDeleteCount %d,%d:\n", wNum, wCount);
DEBUG_COMMAND_YET("SACT.SpriteDeleteCount %d,%d:", wNum, wCount);
}
/**
@@ -266,7 +266,7 @@ static void SpriteDeleteCount() {
static void Draw() {
sp_update_all(TRUE);
DEBUG_COMMAND_YET("SACT.Draw:\n");
DEBUG_COMMAND_YET("SACT.Draw:");
}
/**
@@ -287,7 +287,7 @@ static void DrawEffect() {
sp_eupdate(wType, wEffectTime, wEffectkey);
DEBUG_COMMAND_YET("SACT.DrawEffect %d,%d,%d:\n", wType, wEffectTime, wEffectkey);
DEBUG_COMMAND_YET("SACT.DrawEffect %d,%d,%d:", wType, wEffectTime, wEffectkey);
}
/**
@@ -304,7 +304,7 @@ static void DrawEffectAlphaMap() {
sp_eupdate_amap(nIndexAlphaMap, wEffectTime, wEffectKey);
DEBUG_COMMAND_YET("SACT.DrawEffectAlphaMap %d,%d,%d:\n", nIndexAlphaMap, wEffectTime, wEffectKey);
DEBUG_COMMAND_YET("SACT.DrawEffectAlphaMap %d,%d,%d:", nIndexAlphaMap, wEffectTime, wEffectKey);
}
/**
@@ -331,7 +331,7 @@ static void QuakeScreen() {
sp_quake_screen(wType, wParam1, wParam2, wCount, nfKeyEnable);
DEBUG_COMMAND_YET("SACT.QuakeScreen %d,%d,%d,%d,%d:\n", wType, wParam1, wParam2, wCount, nfKeyEnable);
DEBUG_COMMAND_YET("SACT.QuakeScreen %d,%d,%d,%d,%d:", wType, wParam1, wParam2, wCount, nfKeyEnable);
}
/**
@@ -347,7 +347,7 @@ static void SetOrigin() {
sact.origin.x = wX;
sact.origin.y = wY;
DEBUG_COMMAND_YET("SACT.SetOrigin %d,%d:\n", wX, wY);
DEBUG_COMMAND_YET("SACT.SetOrigin %d,%d:", wX, wY);
}
/**
@@ -364,7 +364,7 @@ static void SetShow() {
sp_set_show(wNum, wCount, wShow);
DEBUG_COMMAND_YET("SACT.SetShow %d,%d,%d:\n", wNum, wCount, wShow);
DEBUG_COMMAND_YET("SACT.SetShow %d,%d,%d:", wNum, wCount, wShow);
}
/**
@@ -381,7 +381,7 @@ static void SetBlendRate() {
sp_set_blendrate(wNum, wCount, nBlendRate);
DEBUG_COMMAND_YET("SACT.SetBlendRate %d,%d,%d:\n", wNum, wCount, nBlendRate);
DEBUG_COMMAND_YET("SACT.SetBlendRate %d,%d,%d:", wNum, wCount, nBlendRate);
}
/**
@@ -398,7 +398,7 @@ static void SetPos() {
sp_set_pos(wNum, wX, wY);
DEBUG_COMMAND_YET("SACT.SetPos %d,%d,%d:\n", wNum, wX, wY);
DEBUG_COMMAND_YET("SACT.SetPos %d,%d,%d:", wNum, wX, wY);
}
/**
@@ -415,7 +415,7 @@ static void SetMove() {
sp_set_move(wNum, wX, wY);
DEBUG_COMMAND_YET("SACT.SetMove %d,%d,%d:\n", wNum, wX, wY);
DEBUG_COMMAND_YET("SACT.SetMove %d,%d,%d:", wNum, wX, wY);
}
/**
@@ -430,7 +430,7 @@ static void SetMoveTime() {
sp_set_movetime(wNum, wTime);
DEBUG_COMMAND_YET("SACT.SetMoveTime %d,%d:\n", wNum, wTime);
DEBUG_COMMAND_YET("SACT.SetMoveTime %d,%d:", wNum, wTime);
}
/**
@@ -445,7 +445,7 @@ static void SetMoveSpeed() {
sp_set_movespeed(wNum, wSpeed);
DEBUG_COMMAND_YET("SACT.SetMoveSpeed %d,%d:\n", wNum, wSpeed);
DEBUG_COMMAND_YET("SACT.SetMoveSpeed %d,%d:", wNum, wSpeed);
}
/**
@@ -465,7 +465,7 @@ static void SetMoveSpeedCount() {
sp_set_movespeed(i, wSpeed);
}
DEBUG_COMMAND_YET("SACT.SetMoveSpeedCount %d,%d,%d:\n", wNum, wCount, wSpeed);
DEBUG_COMMAND_YET("SACT.SetMoveSpeedCount %d,%d,%d:", wNum, wCount, wSpeed);
}
/**
@@ -485,7 +485,7 @@ static void SetSpriteAnimeTimeInterval() {
sp_set_animeinterval(i, nTime);
}
DEBUG_COMMAND_YET("SACT.SetSpriteAnimeTimeInterval %d,%d,%d:\n", wNum, wCount, nTime);
DEBUG_COMMAND_YET("SACT.SetSpriteAnimeTimeInterval %d,%d,%d:", wNum, wCount, nTime);
}
/**
@@ -498,7 +498,7 @@ static void AddZKeyHideSprite() {
sp_add_zkey_hidesprite(wNum);
DEBUG_COMMAND_YET("SACT.AddZKeyHideSprite %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.AddZKeyHideSprite %d:", wNum);
}
/**
@@ -508,7 +508,7 @@ static void AddZKeyHideSprite() {
static void ClearZKeyHideSprite() {
sp_clear_zkey_hidesprite_all();
DEBUG_COMMAND_YET("SACT.ClearZKeyHideSprite:\n");
DEBUG_COMMAND_YET("SACT.ClearZKeyHideSprite:");
}
/**
@@ -524,7 +524,7 @@ static void SpriteFreeze() {
sp_freeze_sprite(wNum, wIndex);
DEBUG_COMMAND_YET("SACT.SpriteFreeze %d,%d:\n", wNum, wIndex);
DEBUG_COMMAND_YET("SACT.SpriteFreeze %d,%d:", wNum, wIndex);
}
/**
@@ -537,7 +537,7 @@ static void SpriteThaw() {
sp_thaw_sprite(wNum);
DEBUG_COMMAND_YET("SACT.SpriteThaw %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SpriteThaw %d:", wNum);
}
/**
@@ -557,7 +557,7 @@ static void SpriteFreezeCount() {
sp_freeze_sprite(i, wIndex);
}
DEBUG_COMMAND_YET("SACT.SpriteFreezeCount %d,%d,%d:\n", wNum, wCount, wIndex);
DEBUG_COMMAND_YET("SACT.SpriteFreezeCount %d,%d,%d:", wNum, wCount, wIndex);
}
/**
@@ -575,7 +575,7 @@ static void SpriteThawCount() {
sp_thaw_sprite(i);
}
DEBUG_COMMAND_YET("SACT.SpriteThawCount %d,%d:\n", wNum, wCount);
DEBUG_COMMAND_YET("SACT.SpriteThawCount %d,%d:", wNum, wCount);
}
/**
@@ -588,7 +588,7 @@ static void QuakeSpriteAdd() {
sp_add_quakesprite(wNum);
DEBUG_COMMAND_YET("SACT.QuakeSpriteAdd %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.QuakeSpriteAdd %d:", wNum);
}
/**
@@ -597,7 +597,7 @@ static void QuakeSpriteAdd() {
*/
static void QuakeSpriteReset() {
sp_clear_quakesprite_all();
DEBUG_COMMAND_YET("SACT.QuakeSpriteReset:\n");
DEBUG_COMMAND_YET("SACT.QuakeSpriteReset:");
}
/**
@@ -623,7 +623,7 @@ static void QuakeSprite() {
sp_quake_sprite(wType, wAmplitudeX, wAmplitudeY, wCount, nfKeyEnable);
DEBUG_COMMAND_YET("SACT.QuakeSprite %d,%d,%d,%d:\n", wType, wAmplitudeX, wAmplitudeY, wCount);
DEBUG_COMMAND_YET("SACT.QuakeSprite %d,%d,%d,%d:", wType, wAmplitudeX, wAmplitudeY, wCount);
}
/**
@@ -638,7 +638,7 @@ static void QuerySpriteIsExist() {
sp_query_isexist(wNum, var);
DEBUG_COMMAND_YET("SACT.QuerySpriteIsExist %d,%p:\n", wNum, var);
DEBUG_COMMAND_YET("SACT.QuerySpriteIsExist %d,%p:", wNum, var);
}
/**
@@ -659,7 +659,7 @@ static void QuerySpriteInfo() {
sp_query_info(wNum, vType, vCG1, vCG2, vCG3);
DEBUG_COMMAND_YET("SACT.QuerySpriteInfo %d,%p,%p,%p,%p:\n", wNum, vType, vCG1, vCG2, vCG3);
DEBUG_COMMAND_YET("SACT.QuerySpriteInfo %d,%p,%p,%p,%p:", wNum, vType, vCG1, vCG2, vCG3);
}
/**
@@ -674,7 +674,7 @@ static void QuerySpriteShow() {
sp_query_show(wNum, vShow);
DEBUG_COMMAND_YET("SACT.QuerySpriteShow %d,%p:\n", wNum, vShow);
DEBUG_COMMAND_YET("SACT.QuerySpriteShow %d,%p:", wNum, vShow);
}
/**
@@ -691,7 +691,7 @@ static void QuerySpritePos() {
sp_query_pos(wNum, vX, vY);
DEBUG_COMMAND_YET("SACT.QuerySpritePos %d,%p,%p:\n", wNum, vX, vY);
DEBUG_COMMAND_YET("SACT.QuerySpritePos %d,%p,%p:", wNum, vX, vY);
}
/**
@@ -708,7 +708,7 @@ static void QuerySpriteSize() {
sp_query_size(wNum, vWidth, vHeight);
DEBUG_COMMAND_YET("SACT.QuerySpriteSize %d,%p,%p:\n", wNum, vWidth, vHeight);
DEBUG_COMMAND_YET("SACT.QuerySpriteSize %d,%p,%p:", wNum, vWidth, vHeight);
}
/**
@@ -725,7 +725,7 @@ static void QueryTextPos() {
sp_query_textpos(wNum, vX, vY);
DEBUG_COMMAND_YET("SACT.QueryTextPos %d,%p,%p:\n", wNum, vX, vY);
DEBUG_COMMAND_YET("SACT.QueryTextPos %d,%p,%p:", wNum, vX, vY);
}
/**
@@ -735,7 +735,7 @@ static void QueryTextPos() {
static void CG_Clear() {
scg_freeall();
DEBUG_COMMAND_YET("SACT.CG_Clear:\n");
DEBUG_COMMAND_YET("SACT.CG_Clear:");
}
/**
@@ -748,7 +748,7 @@ static void CG_Reset() {
scg_free(wNumCG);
DEBUG_COMMAND_YET("SACT.CG_Reset %d:\n", wNumCG);
DEBUG_COMMAND_YET("SACT.CG_Reset %d:", wNumCG);
}
/**
@@ -764,7 +764,7 @@ static void CG_QueryType() {
scg_querytype(wNumCG, vType);
DEBUG_COMMAND_YET("SACT.CG_QueryType %d,%p:\n", wNumCG, vType);
DEBUG_COMMAND_YET("SACT.CG_QueryType %d,%p:", wNumCG, vType);
}
/**
@@ -781,7 +781,7 @@ static void CG_QuerySize() {
scg_querysize(wNumCG, vWidth, vHeight);
DEBUG_COMMAND_YET("SACT.CG_QuerySize %d,%p,%p:\n", wNumCG, vWidth, vHeight);
DEBUG_COMMAND_YET("SACT.CG_QuerySize %d,%p,%p:", wNumCG, vWidth, vHeight);
}
/**
@@ -796,7 +796,7 @@ static void CG_QueryBpp() {
scg_querybpp(wNumCG, vBpp);
DEBUG_COMMAND_YET("SACT.CG_QueryBpp %d,%p:\n", wNumCG, vBpp);
DEBUG_COMMAND_YET("SACT.CG_QueryBpp %d,%p:", wNumCG, vBpp);
}
/**
@@ -811,7 +811,7 @@ static void CG_ExistAlphaMap() {
scg_existalphamap(wNumCG, vMask);
DEBUG_COMMAND_YET("SACT.CG_ExistAlphaMap %d,%p:\n", wNumCG, vMask);
DEBUG_COMMAND_YET("SACT.CG_ExistAlphaMap %d,%p:", wNumCG, vMask);
}
/**
@@ -836,7 +836,7 @@ static void CG_Create() {
scg_create(wNumCG, wWidth, wHeight, wR, wG, wB, wBlendRate);
DEBUG_COMMAND_YET("SACT.CG_Create %d,%d,%d,%d,%d,%d,%d:\n", wNumCG, wWidth, wHeight, wR, wG, wB, wBlendRate);
DEBUG_COMMAND_YET("SACT.CG_Create %d,%d,%d,%d,%d,%d,%d:", wNumCG, wWidth, wHeight, wR, wG, wB, wBlendRate);
}
/**
@@ -855,7 +855,7 @@ static void CG_CreateReverse() {
scg_create_reverse(wNumCG, wNumSrcCG, wReverseX, wReverseY);
DEBUG_COMMAND_YET("SACT.CG_CreateReverse %d,%d,%d,%d:\n", wNumCG, wNumSrcCG, wReverseX, wReverseY);
DEBUG_COMMAND_YET("SACT.CG_CreateReverse %d,%d,%d,%d:", wNumCG, wNumSrcCG, wReverseX, wReverseY);
}
/**
@@ -874,7 +874,7 @@ static void CG_CreateStretch() {
scg_create_stretch(wNumCG, wWidth, wHeight, wNumSrcCG);
DEBUG_COMMAND_YET("SACT.CG_CreateStretch %d,%d,%d,%d:\n", wNumCG, wWidth, wHeight, wNumSrcCG);
DEBUG_COMMAND_YET("SACT.CG_CreateStretch %d,%d,%d,%d:", wNumCG, wWidth, wHeight, wNumSrcCG);
}
/**
@@ -895,7 +895,7 @@ static void CG_CreateBlend() {
int wNumBlendCG = getCaliValue();
int wAlphaMapMode = getCaliValue();
DEBUG_COMMAND_YET("SACT.CG_CreateBlend %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumBaseCG, wX, wY, wNumBlendCG, wAlphaMapMode);
DEBUG_COMMAND_YET("SACT.CG_CreateBlend %d,%d,%d,%d,%d,%d:", wNumDstCG, wNumBaseCG, wX, wY, wNumBlendCG, wAlphaMapMode);
scg_create_blend(wNumDstCG, wNumBaseCG, wX, wY, wNumBlendCG, wAlphaMapMode);
}
@@ -920,7 +920,7 @@ static void CG_CreateText() {
scg_create_text(wNumCG, wSize, wR, wG, wB, wText);
DEBUG_COMMAND_YET("SACT.CG_CreateText %d,%d,%d,%d,%d,%d:\n", wNumCG, wSize, wR, wG, wB, wText);
DEBUG_COMMAND_YET("SACT.CG_CreateText %d,%d,%d,%d,%d,%d:", wNumCG, wSize, wR, wG, wB, wText);
}
/**
@@ -948,7 +948,7 @@ static void CG_CreateTextNum() {
scg_create_textnum(wNumCG, wSize, wR, wG, wB, wFigs, wZeroPadding, wValue);
DEBUG_COMMAND_YET("SACT.CG_CreateTextNum %d,%d,%d,%d,%d,%d,%d,%d:\n", wNumCG, wSize, wR, wG, wB, wFigs, wZeroPadding, wValue);
DEBUG_COMMAND_YET("SACT.CG_CreateTextNum %d,%d,%d,%d,%d,%d,%d,%d:", wNumCG, wSize, wR, wG, wB, wFigs, wZeroPadding, wValue);
}
/**
@@ -963,7 +963,7 @@ static void CG_Copy() {
scg_copy(wNumDst, wNumSrc);
DEBUG_COMMAND_YET("SACT.CG_Copy %d,%d:\n", wNumDst, wNumSrc);
DEBUG_COMMAND_YET("SACT.CG_Copy %d,%d:", wNumDst, wNumSrc);
}
/**
@@ -986,7 +986,7 @@ static void CG_Cut() {
scg_cut(wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.CG_Cut %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.CG_Cut %d,%d,%d,%d,%d,%d:", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
}
/**
@@ -1010,7 +1010,7 @@ static void CG_PartCopy() {
scg_partcopy(wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.PartCopy %d,%d,%d,%d,%d,%d:\n", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
DEBUG_COMMAND_YET("SACT.PartCopy %d,%d,%d,%d,%d,%d:", wNumDstCG, wNumSrcCG, wX, wY, wWidth, wHeight);
}
/**
@@ -1021,7 +1021,7 @@ static void CG_PartCopy() {
static void WaitKeySimple() {
int *vKey = getCaliVariable();
DEBUG_COMMAND_YET("SACT.WaitKeySimple %d:\n", vKey);
DEBUG_COMMAND_YET("SACT.WaitKeySimple %d:", vKey);
// とりあえず全更新
sp_update_all(TRUE);
@@ -1057,7 +1057,7 @@ static void WaitKeyMessage() {
smsg_keywait(wMessageMark1, wMessageMark2, wMessageLength);
DEBUG_COMMAND_YET("SACT.WaitKeyMessage %d,%d,%d:\n", wMessageMark1, wMessageMark2, wMessageLength);
DEBUG_COMMAND_YET("SACT.WaitKeyMessage %d,%d,%d:", wMessageMark1, wMessageMark2, wMessageLength);
}
/**
@@ -1074,11 +1074,11 @@ static void WaitKeySprite() {
int *vRsv1 = getCaliVariable();
int *vRsv2 = getCaliVariable();
DEBUG_COMMAND("SACT.WaitKeySprite %p,%p,%p,%p:\n", vOK, vRND, vRsv1, vRsv2);
DEBUG_COMMAND("SACT.WaitKeySprite %p,%p,%p,%p:", vOK, vRND, vRsv1, vRsv2);
sp_keywait(vOK, vRND, vRsv1, vRsv2, NULL, -1);
DEBUG_COMMAND_YET("SACT.WaitKeySprite %d,%d,%d,%d:\n", *vOK, *vRND, *vRsv1, *vRsv2);
DEBUG_COMMAND_YET("SACT.WaitKeySprite %d,%d,%d,%d:", *vOK, *vRND, *vRsv1, *vRsv2);
}
/**
@@ -1091,8 +1091,8 @@ static void PeekKey() {
int nKeyCode = getCaliValue();
int *vResult = getCaliVariable();
WARNING("NOT IMPLEMENTED\n");
DEBUG_COMMAND_YET("SACT.PeekKey %d,%p:\n", nKeyCode, vResult);
WARNING("NOT IMPLEMENTED");
DEBUG_COMMAND_YET("SACT.PeekKey %d,%p:", nKeyCode, vResult);
}
/**
@@ -1100,8 +1100,8 @@ static void PeekKey() {
*
*/
static void WaitMsgSkipKeyUp() {
WARNING("NOT IMPLEMENTED\n");
DEBUG_COMMAND_YET("SACT.WaitMsgSkipKeyUp:\n");
WARNING("NOT IMPLEMENTED");
DEBUG_COMMAND_YET("SACT.WaitMsgSkipKeyUp:");
}
/**
@@ -1130,7 +1130,7 @@ static void WaitKeySimpleTimeOut() {
sact.waittype = KEYWAIT_NONE;
DEBUG_COMMAND_YET("SACT.WaitKeySimpleTimeOut %p,%p,%d:\n", vRND, vD03, wTime);
DEBUG_COMMAND_YET("SACT.WaitKeySimpleTimeOut %p,%p,%d:", vRND, vD03, wTime);
}
/**
@@ -1153,7 +1153,7 @@ static void WaitKeySpriteTimeOut() {
sp_keywait(vOK, vRND, vD01, vD02, vD03, wTime);
DEBUG_COMMAND_YET("SACT.WaitKeySpriteTimeOut %p,%p,%p,%p,%p,%d:\n", vOK, vRND, vD01, vD02, vD03, wTime);
DEBUG_COMMAND_YET("SACT.WaitKeySpriteTimeOut %p,%p,%p,%p,%p,%d:", vOK, vRND, vD01, vD02, vD03, wTime);
}
/**
@@ -1166,7 +1166,7 @@ static void QueryMessageSkip() {
*vSkip = msgskip_isSkipping() ? 1 : 0;
DEBUG_COMMAND_YET("SACT.QueryMessageSkip %p:\n", vSkip);
DEBUG_COMMAND_YET("SACT.QueryMessageSkip %p:", vSkip);
}
/**
@@ -1181,7 +1181,7 @@ static void RegistReplaceString() {
sstr_regist_replace(sstr, dstr);
DEBUG_COMMAND_YET("SACT.RegistReplaceString %d,%d:\n", sstr, dstr);
DEBUG_COMMAND_YET("SACT.RegistReplaceString %d,%d:", sstr, dstr);
}
/**
@@ -1221,7 +1221,7 @@ static void MessageOutput() {
smsg_out(wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, 0, 0, 0, vMessageLength);
DEBUG_COMMAND_YET("SACT.MessageOutput %d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, vMessageLength);
DEBUG_COMMAND_YET("SACT.MessageOutput %d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, vMessageLength);
}
/**
@@ -1265,7 +1265,7 @@ static void MessageOutputEx() {
smsg_out(wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace, wMessageAlign, wRubySize, wRubyFont, wRubyLineSpace, vLength);
DEBUG_COMMAND_YET("SACT.MessageOutputEx %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:\n", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace,wMessageAlign, wRubySize, wRubyFont, wRubyLineSpace, vLength);
DEBUG_COMMAND_YET("SACT.MessageOutputEx %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%p:", wMessageSpriteNumber, wMessageSize, wMessageColorR, wMessageColorG, wMessageColorB, wMessageFont, wMessageSpeed, wMessageLineSpace,wMessageAlign, wRubySize, wRubyFont, wRubyLineSpace, vLength);
}
/**
@@ -1280,7 +1280,7 @@ static void MessageNewLine() {
smsg_newline(wMessageSpriteNumber, wMessageSize);
DEBUG_COMMAND_YET("SACT.MessageNewLine %d,%d:\n", wMessageSpriteNumber, wMessageSize);
DEBUG_COMMAND_YET("SACT.MessageNewLine %d,%d:", wMessageSpriteNumber, wMessageSize);
}
/**
@@ -1293,7 +1293,7 @@ static void MessageClear() {
smsg_clear(wMessageSpriteNumber);
DEBUG_COMMAND_YET("SACT.MessageClear %d:\n", wMessageSpriteNumber);
DEBUG_COMMAND_YET("SACT.MessageClear %d:", wMessageSpriteNumber);
}
/**
@@ -1306,7 +1306,7 @@ static void MessageIsEmpty() {
*wResult = smsg_is_empty();
DEBUG_COMMAND_YET("SACT.MessageIsEmpty %p:\n", wResult);
DEBUG_COMMAND_YET("SACT.MessageIsEmpty %p:", wResult);
}
/**
@@ -1319,9 +1319,9 @@ static void MessagePeek() {
int *vCount = getCaliVariable();
int nTopStringNum = getCaliValue();
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
DEBUG_COMMAND_YET("SACT.MessagePeek %p,%d:\n", vCount, nTopStringNum);
DEBUG_COMMAND_YET("SACT.MessagePeek %p,%d:", vCount, nTopStringNum);
}
/**
@@ -1330,7 +1330,7 @@ static void MessagePeek() {
*/
static void Log_Stop() {
sact.logging = FALSE;
DEBUG_COMMAND_YET("SACT.Log_Stop:\n");
DEBUG_COMMAND_YET("SACT.Log_Stop:");
}
/**
@@ -1339,7 +1339,7 @@ static void Log_Stop() {
*/
static void Log_Start() {
sact.logging = TRUE;
DEBUG_COMMAND_YET("SACT.Log_Start:\n");
DEBUG_COMMAND_YET("SACT.Log_Start:");
}
/**
@@ -1349,7 +1349,7 @@ static void Log_Start() {
static void MenuClear() {
ssel_clear();
DEBUG_COMMAND_YET("SACT.MenuClear:\n");
DEBUG_COMMAND_YET("SACT.MenuClear:");
}
/**
@@ -1364,7 +1364,7 @@ static void MenuAdd() {
ssel_add(nString, wI);
DEBUG_COMMAND_YET("SACT.MenuAdd %d,%d:\n", nString, wI);
DEBUG_COMMAND_YET("SACT.MenuAdd %d,%d:", nString, wI);
}
/**
@@ -1393,7 +1393,7 @@ static void MenuOpen() {
*wMenuResult = ssel_select(wNum, wChoiceSize, wMenuOutSpc, wChoiceLineSpace, wChoiceAutoMoveCursor, nAlign);
DEBUG_COMMAND_YET("SACT.MenuOpen %p,%d,%d,%d,%d,%d,%d:\n", wMenuResult, wNum, wChoiceSize, wMenuOutSpc, wChoiceLineSpace, wChoiceAutoMoveCursor, nAlign);
DEBUG_COMMAND_YET("SACT.MenuOpen %p,%d,%d,%d,%d,%d,%d:", wMenuResult, wNum, wChoiceSize, wMenuOutSpc, wChoiceLineSpace, wChoiceAutoMoveCursor, nAlign);
}
/**
@@ -1406,7 +1406,7 @@ static void PushString() {
sstr_push(nString);
DEBUG_COMMAND_YET("SACT.PushString %d:\n", nString);
DEBUG_COMMAND_YET("SACT.PushString %d:", nString);
}
/**
@@ -1419,7 +1419,7 @@ static void PopString() {
sstr_pop(nString);
DEBUG_COMMAND_YET("SACT.PopString %d:\n", nString);
DEBUG_COMMAND_YET("SACT.PopString %d:", nString);
}
/**
@@ -1442,7 +1442,7 @@ static void Numeral_SetCG() {
sp_num_setcg(nNum, nIndex, nCG);
DEBUG_COMMAND_YET("SACT.Numeral_SetCG %d,%d,%d:\n", nNum, nIndex, nCG);
DEBUG_COMMAND_YET("SACT.Numeral_SetCG %d,%d,%d:", nNum, nIndex, nCG);
}
/**
@@ -1459,7 +1459,7 @@ static void Numeral_GetCG() {
sp_num_getcg(nNum, nIndex, vCG);
DEBUG_COMMAND_YET("SACT.Numeral_GetCG %d,%d,%p:\n", nNum, nIndex, vCG);
DEBUG_COMMAND_YET("SACT.Numeral_GetCG %d,%d,%p:", nNum, nIndex, vCG);
}
/**
@@ -1476,7 +1476,7 @@ static void Numeral_SetPos() {
sp_num_setpos(nNum, nX, nY);
DEBUG_COMMAND_YET("SACT.Numeral_SetPos %d,%d,%d:\n", nNum, nX, nY);
DEBUG_COMMAND_YET("SACT.Numeral_SetPos %d,%d,%d:", nNum, nX, nY);
}
/**
@@ -1493,7 +1493,7 @@ static void Numeral_GetPos() {
sp_num_getpos(nNum, vX, vY);
DEBUG_COMMAND_YET("SACT.Numeral_GetPos %d,%p,%p:\n", nNum, vX, vY);
DEBUG_COMMAND_YET("SACT.Numeral_GetPos %d,%p,%p:", nNum, vX, vY);
}
/**
@@ -1508,7 +1508,7 @@ static void Numeral_SetSpan() {
sp_num_setspan(nNum, nSpan);
DEBUG_COMMAND_YET("SACT.Numeral_SetSpan %d,%d:\n", nNum, nSpan);
DEBUG_COMMAND_YET("SACT.Numeral_SetSpan %d,%d:", nNum, nSpan);
}
/**
@@ -1523,7 +1523,7 @@ static void Numeral_GetSpan() {
sp_num_getspan(nNum, vSpan);
DEBUG_COMMAND_YET("SACT.Numeral_GetSpan %d,%p:\n", nNum, vSpan);
DEBUG_COMMAND_YET("SACT.Numeral_GetSpan %d,%p:", nNum, vSpan);
}
/**
@@ -1531,7 +1531,7 @@ static void Numeral_GetSpan() {
*
*/
static void ExpSp_Clear() {
DEBUG_COMMAND_YET("SACT.ExpSp_Clear:\n");
DEBUG_COMMAND_YET("SACT.ExpSp_Clear:");
sp_exp_clear();
}
@@ -1548,7 +1548,7 @@ static void ExpSp_Add() {
sp_exp_add(wNumSP1, wNumSP2);
DEBUG_COMMAND_YET("SACT.ExpSp_Add %d,%d:\n", wNumSP1, wNumSP2);
DEBUG_COMMAND_YET("SACT.ExpSp_Add %d,%d:", wNumSP1, wNumSP2);
}
/**
@@ -1561,7 +1561,7 @@ static void ExpSp_Del() {
sp_exp_del(wNum);
DEBUG_COMMAND_YET("SACT.ExpSp_Del %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.ExpSp_Del %d:", wNum);
}
/**
@@ -1576,7 +1576,7 @@ static void TimerSet() {
stimer_reset(wTimerID, wCount);
DEBUG_COMMAND("SACT.TimerSet %d,%d:\n", wTimerID, wCount);
DEBUG_COMMAND("SACT.TimerSet %d,%d:", wTimerID, wCount);
}
/**
@@ -1591,7 +1591,7 @@ static void TimerGet() {
*vRND = stimer_get(wTimerID);
DEBUG_COMMAND("SACT.TimerGet %d,%p:\n", wTimerID, vRND);
DEBUG_COMMAND("SACT.TimerGet %d,%p:", wTimerID, vRND);
}
/**
@@ -1608,7 +1608,7 @@ static void TimerWait() {
sys_keywait(10, KEYWAIT_NONCANCELABLE);
}
DEBUG_COMMAND("SACT.TimerWait %d,%d:\n", wTimerID, wCount);
DEBUG_COMMAND("SACT.TimerWait %d,%d:", wTimerID, wCount);
}
/**
@@ -1621,7 +1621,7 @@ static void Wait() {
sys_keywait(wCount*10, KEYWAIT_NONCANCELABLE);
DEBUG_COMMAND_YET("SACT.Wait %d:\n", wCount);
DEBUG_COMMAND_YET("SACT.Wait %d:", wCount);
}
/**
@@ -1634,7 +1634,7 @@ static void SoundPlay() {
ssnd_play(wNum);
DEBUG_COMMAND_YET("SACT.SoundPlay %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SoundPlay %d:", wNum);
}
/**
@@ -1649,7 +1649,7 @@ static void SoundStop() {
ssnd_stop(wNum, wFadeTime);
DEBUG_COMMAND_YET("SACT.SoundStop %d,%d:\n", wNum, wFadeTime);
DEBUG_COMMAND_YET("SACT.SoundStop %d,%d:", wNum, wFadeTime);
}
/**
@@ -1663,7 +1663,7 @@ static void SoundStopAll() {
ssnd_stopall(wFadeTime);
DEBUG_COMMAND_YET("SACT.SoundStopAll %d:\n", wFadeTime);
DEBUG_COMMAND_YET("SACT.SoundStopAll %d:", wFadeTime);
}
/**
@@ -1676,7 +1676,7 @@ static void SoundWait() {
ssnd_wait(wNum);
DEBUG_COMMAND_YET("SACT.SoundWait %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SoundWait %d:", wNum);
}
/**
@@ -1691,7 +1691,7 @@ static void SoundWaitKey() {
ssnd_waitkey(wNum, vKey);
DEBUG_COMMAND_YET("SACT.SoundWaitKey %d,%p:\n", wNum, vKey);
DEBUG_COMMAND_YET("SACT.SoundWaitKey %d,%p:", wNum, vKey);
}
/**
@@ -1704,7 +1704,7 @@ static void SoundPrepare() {
ssnd_prepare(wNum);
DEBUG_COMMAND_YET("SACT.SoundPrepare %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SoundPrepare %d:", wNum);
}
/**
@@ -1717,7 +1717,7 @@ static void SoundPrepareLR() {
ssnd_prepareLRrev(wNum);
DEBUG_COMMAND_YET("SACT.SoundPrepareLR %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SoundPrepareLR %d:", wNum);
}
/**
@@ -1730,7 +1730,7 @@ static void SoundPlayLR() {
ssnd_playLRrev(wNum);
DEBUG_COMMAND_YET("SACT.SoundPlayLR %d:\n", wNum);
DEBUG_COMMAND_YET("SACT.SoundPlayLR %d:", wNum);
}
/**
@@ -1754,7 +1754,7 @@ static void SpriteSound() {
sp_sound_set(i, wNumWave1, wNumWave2, wNumWave3);
}
DEBUG_COMMAND_YET("SACT.SpriteSound %d,%d,%d,%d,%d:\n", wNumSP, nCount, wNumWave1, wNumWave2, wNumWave3);
DEBUG_COMMAND_YET("SACT.SpriteSound %d,%d,%d,%d,%d:", wNumSP, nCount, wNumWave1, wNumWave2, wNumWave3);
}
/**
@@ -1762,7 +1762,7 @@ static void SpriteSound() {
* SpriteSoundで設定したすべての音の再生終了まで待つ (~SP_SOUND_WAIT)
*/
static void SpriteSoundWait() {
DEBUG_COMMAND_YET("SACT.SpriteSoundWait:\n");
DEBUG_COMMAND_YET("SACT.SpriteSoundWait:");
sp_sound_wait();
}
@@ -1777,7 +1777,7 @@ static void SpriteSoundOB() {
sp_sound_ob(wNumWave);
DEBUG_COMMAND_YET("SACT.SpriteSoundOB %d:\n", wNumWave);
DEBUG_COMMAND_YET("SACT.SpriteSoundOB %d:", wNumWave);
}
/**
@@ -1792,7 +1792,7 @@ static void MusicCheck() {
*vRND = smus_check(wNum);
DEBUG_COMMAND_YET("SACT.MusicCheck %d,%p:\n", wNum, vRND);
DEBUG_COMMAND_YET("SACT.MusicCheck %d,%p:", wNum, vRND);
}
/**
@@ -1807,7 +1807,7 @@ static void MusicGetLength() {
*vRND = smus_getlength(wNum);
DEBUG_COMMAND_YET("SACT.MusicGetLength %d,%d:\n", wNum, *vRND);
DEBUG_COMMAND_YET("SACT.MusicGetLength %d,%d:", wNum, *vRND);
}
/**
@@ -1822,7 +1822,7 @@ static void MusicGetPos() {
*vRND = smus_getpos(wNum);
DEBUG_COMMAND_YET("SACT.MusicGetPos %d,%d:\n", wNum, *vRND);
DEBUG_COMMAND_YET("SACT.MusicGetPos %d,%d:", wNum, *vRND);
}
/**
@@ -1839,7 +1839,7 @@ static void MusicPlay() {
smus_play(wNum, wFadeTime, wVolume);
DEBUG_COMMAND_YET("SACT.MusicPlay %d,%d,%d:\n", wNum, wFadeTime, wVolume);
DEBUG_COMMAND_YET("SACT.MusicPlay %d,%d,%d:", wNum, wFadeTime, wVolume);
}
/**
@@ -1854,7 +1854,7 @@ static void MusicStop() {
smus_stop(wNum, wFadeTime);
DEBUG_COMMAND_YET("SACT.MusicStop %d,%d:\n", wNum, wFadeTime);
DEBUG_COMMAND_YET("SACT.MusicStop %d,%d:", wNum, wFadeTime);
}
/**
@@ -1867,7 +1867,7 @@ static void MusicStopAll() {
smus_stopall(wFadeTime);
DEBUG_COMMAND_YET("SACT.MusicStopAll %d:\n", wFadeTime);
DEBUG_COMMAND_YET("SACT.MusicStopAll %d:", wFadeTime);
}
/**
@@ -1884,7 +1884,7 @@ static void MusicFade() {
smus_fade(wNum, wFadeTime, wVolume);
DEBUG_COMMAND_YET("SACT.MusicFade %d,%d,%d:\n", wNum, wFadeTime, wVolume);
DEBUG_COMMAND_YET("SACT.MusicFade %d,%d,%d:", wNum, wFadeTime, wVolume);
}
/**
@@ -1903,7 +1903,7 @@ static void MusicWait() {
smus_wait(wNum, nTimeOut);
DEBUG_COMMAND_YET("SACT.MusicWait %d,%d:\n", wNum, nTimeOut);
DEBUG_COMMAND_YET("SACT.MusicWait %d,%d:", wNum, nTimeOut);
}
/**
@@ -1919,7 +1919,7 @@ static void MusicWaitPos() {
smus_waitpos(wNum, wIndex);
DEBUG_COMMAND_YET("SACT.MusicWaitPos %d,%d:\n", wNum, wIndex);
DEBUG_COMMAND_YET("SACT.MusicWaitPos %d,%d:", wNum, wIndex);
}
/**
@@ -1934,7 +1934,7 @@ static void SoundGetLinkNum() {
*vRND = ssnd_getlinknum(wNum);
DEBUG_COMMAND_YET("SACT.SoundGetLinkNum %d,%p:\n", wNum, vRND);
DEBUG_COMMAND_YET("SACT.SoundGetLinkNum %d,%p:", wNum, vRND);
}
/**
@@ -1959,7 +1959,7 @@ static void ChartPos() {
schart_pos(pos, pos1, pos2, val1, val2, val);
DEBUG_COMMAND_YET("SACT.ChartPos %p,%d,%d,%d,%d,%d:\n", pos, pos1, pos2, val1, val2, val);
DEBUG_COMMAND_YET("SACT.ChartPos %p,%d,%d,%d,%d,%d:", pos, pos1, pos2, val1, val2, val);
}
/**
@@ -1978,7 +1978,7 @@ static void NumToStr() {
sstr_num2str(strno, fig, zeropad, num);
DEBUG_COMMAND_YET("SACT.NumToStr %d,%d,%d,%d:\n", strno, fig, zeropad, num);
DEBUG_COMMAND_YET("SACT.NumToStr %d,%d,%d,%d:", strno, fig, zeropad, num);
}
/**
@@ -1988,9 +1988,9 @@ static void Maze_Create() {
int p1 = getCaliValue();
int p2 = getCaliValue();
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
DEBUG_COMMAND_YET("SACT.Maze_Create %d,%d:\n", p1,p2);
DEBUG_COMMAND_YET("SACT.Maze_Create %d,%d:", p1,p2);
}
/**
@@ -2001,9 +2001,9 @@ static void Maze_Get() {
int p2 = getCaliValue();
int p3 = getCaliValue();
WARNING("NOT IMPLEMENTED\n");
WARNING("NOT IMPLEMENTED");
DEBUG_COMMAND_YET("SACT.Maze_Get %p,%d,%d:\n", p1,p2,p3);
DEBUG_COMMAND_YET("SACT.Maze_Get %p,%d,%d:", p1,p2,p3);
}
/**
@@ -2016,7 +2016,7 @@ static void EncryptWORD() {
scryp_encrypt_word(array, num, key);
DEBUG_COMMAND_YET("SACT.EncryptWORD %p,%d,%d:\n", array, num, key);
DEBUG_COMMAND_YET("SACT.EncryptWORD %p,%d,%d:", array, num, key);
}
/**
@@ -2029,7 +2029,7 @@ static void DecryptWORD() {
scryp_encrypt_word(array, num, key);
DEBUG_COMMAND_YET("SACT.DecryptWORD %p,%d,%d:\n", array, num, key);
DEBUG_COMMAND_YET("SACT.DecryptWORD %p,%d,%d:", array, num, key);
}
/**
@@ -2041,7 +2041,7 @@ static void EncryptString() {
scryp_encrypt_str(p1, p2);
DEBUG_COMMAND_YET("SACT.EncryptString %d,%d:\n", p1,p2);
DEBUG_COMMAND_YET("SACT.EncryptString %d,%d:", p1,p2);
}
/**
@@ -2053,7 +2053,7 @@ static void DecryptString() {
scryp_decrypt_str(p1, p2);
DEBUG_COMMAND_YET("SACT.DecryptString %d,%d:\n", p1,p2);
DEBUG_COMMAND_YET("SACT.DecryptString %d,%d:", p1,p2);
}
/**
@@ -2063,7 +2063,7 @@ static void DecryptString() {
static void XMenuClear() {
spxm_clear();
DEBUG_COMMAND_YET("SACT.XMenuClear:\n");
DEBUG_COMMAND_YET("SACT.XMenuClear:");
}
/**
@@ -2078,7 +2078,7 @@ static void XMenuRegister() {
spxm_register(nRegiNum, nMenuID);
DEBUG_COMMAND_YET("SACT.XMenuRegister %d,%d:\n", nRegiNum, nMenuID);
DEBUG_COMMAND_YET("SACT.XMenuRegister %d,%d:", nRegiNum, nMenuID);
}
/**
@@ -2093,7 +2093,7 @@ static void XMenuGetNum() {
*vMenuID = spxm_getnum(nRegiNum);
DEBUG_COMMAND_YET("SACT.XMenuGetNum %d,%p:\n", nRegiNum, vMenuID);
DEBUG_COMMAND_YET("SACT.XMenuGetNum %d,%p:", nRegiNum, vMenuID);
}
/**
@@ -2108,7 +2108,7 @@ static void XMenuGetText() {
spxm_gettext(nRegiNum, strno);
DEBUG_COMMAND_YET("SACT.XMenuGetText %d,%d:\n", nRegiNum, strno);
DEBUG_COMMAND_YET("SACT.XMenuGetText %d,%d:", nRegiNum, strno);
}
/**
@@ -2118,7 +2118,7 @@ static void XMenuGetText() {
static void XMenuTitleRegister() {
spxm_titlereg();
DEBUG_COMMAND_YET("SACT.XMenuTitleRegister:\n");
DEBUG_COMMAND_YET("SACT.XMenuTitleRegister:");
}
/**
@@ -2131,7 +2131,7 @@ static void XMenuTitleGet() {
spxm_titleget(strno);
DEBUG_COMMAND_YET("SACT.XMenuTitleGet %d:\n", strno);
DEBUG_COMMAND_YET("SACT.XMenuTitleGet %d:", strno);
}
static void SACT_reset(void) {
+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--) {
+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 */
*/
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 */
*/
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[] = {
+16 -16
View File
@@ -48,7 +48,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 +61,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 +76,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 +94,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 +107,7 @@ static void wavUnloadAll() {
mus_wav_unload(i);
}
DEBUG_COMMAND("ShSound.wavUnloadAll:\n");
DEBUG_COMMAND("ShSound.wavUnloadAll:");
}
static void wavLoadMemory() {
@@ -122,7 +122,7 @@ static void wavLoadMemory() {
chunk = pcm_sdlmixer_load(no);
#endif
DEBUG_COMMAND("ShSound.wavLoadMemory %d:\n", no);
DEBUG_COMMAND("ShSound.wavLoadMemory %d:", no);
}
static void wavSendMemory() {
@@ -140,7 +140,7 @@ static void wavSendMemory() {
}
#endif
DEBUG_COMMAND("ShSound.wavSendMemory %d:\n", slot);
DEBUG_COMMAND("ShSound.wavSendMemory %d:", slot);
}
static void wavFadeVolumeMemory() {
@@ -159,7 +159,7 @@ static void wavFadeVolumeMemory() {
pcmlib_fade_volume_memory(chunk, start, range);
#endif
DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:\n", start, range);
DEBUG_COMMAND("ShSound.wavFadeVolumeMemory %d,%d:", start, range);
}
static void wavReversePanMemory() {
@@ -173,7 +173,7 @@ static void wavReversePanMemory() {
pcmlib_reverse_pan_memory(chunk);
#endif
DEBUG_COMMAND("ShSound.wavReversePanMemory:\n");
DEBUG_COMMAND("ShSound.wavReversePanMemory:");
}
static void wavPlay() {
@@ -188,7 +188,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 +206,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 +217,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 +232,7 @@ static void wavStopAll() {
mus_wav_stop(i);
}
DEBUG_COMMAND("ShSound.wavStopAll:\n");
DEBUG_COMMAND("ShSound.wavStopAll:");
}
static void wavPause() {
@@ -243,7 +243,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 +258,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 +280,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[] = {
+10 -10
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,7 +82,7 @@ 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 */
@@ -91,7 +91,7 @@ static void SetWindowTitle(void) { /* 6 */
ags_setWindowTitle(svar_get(strno));
DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:\n", strno, p2);
DEBUG_COMMAND("ShString.SetWindowTitle: %d,%d:", strno, p2);
}
static void FillString() {
@@ -113,7 +113,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 +130,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 +160,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[] = {
+4 -4
View File
@@ -29,24 +29,24 @@ 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);
+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[] = {
+4 -4
View File
@@ -16,24 +16,24 @@ static void Init() {
*var = 1;
DEBUG_COMMAND_YET("tDemo.Init %d,%d,%d,%p:\n", p1, p2, p3, var);
DEBUG_COMMAND_YET("tDemo.Init %d,%d,%d,%p:", p1, p2, p3, var);
}
static void SetKeyCancelFlag() {
int cancelflag = getCaliValue();
DEBUG_COMMAND_YET("tDemo.SetKeyCancelFlag %d:\n", cancelflag);
DEBUG_COMMAND_YET("tDemo.SetKeyCancelFlag %d:", cancelflag);
}
static void SetLoopFlag() {
/* Loop Flag */
int loopflag = getCaliValue(); /* 0 なら無限繰り返し */
DEBUG_COMMAND_YET("tDemo.SetLoopFlag %d:\n", loopflag);
DEBUG_COMMAND_YET("tDemo.SetLoopFlag %d:", loopflag);
}
static void Run() {
DEBUG_COMMAND_YET("tDemo.Run:\n");
DEBUG_COMMAND_YET("tDemo.Run:");
}
static const ModuleFunc functions[] = {
+1 -8
View File
@@ -41,13 +41,7 @@ target_sources(xsystem35 PRIVATE
# CG
target_sources(xsystem35 PRIVATE
pms.c vsp.c bmp.c qnt.c)
if (HAVE_JPEG)
target_sources(xsystem35 PRIVATE jpeg.c)
if (NOT EMSCRIPTEN)
target_link_libraries(xsystem35 PRIVATE JPEG::JPEG)
endif()
endif()
pms.c vsp.c bmp.c qnt.c jpeg.c)
if (HAVE_WEBP)
target_sources(xsystem35 PRIVATE webp.c)
target_link_libraries(xsystem35 PRIVATE PkgConfig::WEBP)
@@ -88,7 +82,6 @@ if (EMSCRIPTEN)
set(LIBS
"SHELL:-s USE_ZLIB=1"
"SHELL:-s USE_LIBJPEG=1"
"SHELL:-s USE_SDL=2"
"SHELL:-s USE_SDL_TTF=2")
target_compile_options(xsystem35 PRIVATE ${LIBS})
+5 -5
View File
@@ -25,7 +25,7 @@
#include "portab.h"
int LittleEndian_getDW(const BYTE *b,int index) {
int LittleEndian_getDW(const uint8_t *b,int index) {
int c0, c1, c2, c3;
int d0, d1;
c0 = *(b + index + 0);
@@ -34,10 +34,10 @@ int LittleEndian_getDW(const BYTE *b,int index) {
c3 = *(b + index + 3);
d0 = c0 + (c1 << 8);
d1 = c2 + (c3 << 8);
return (DWORD)(d0 + (d1 << 16));
return (uint32_t)(d0 + (d1 << 16));
}
int LittleEndian_get3B(const BYTE *b,int index) {
int LittleEndian_get3B(const uint8_t *b,int index) {
int c0, c1, c2;
c0 = *(b + index + 0);
c1 = *(b + index + 1);
@@ -45,14 +45,14 @@ int LittleEndian_get3B(const BYTE *b,int index) {
return c0 + (c1 << 8) + (c2 << 16);
}
int LittleEndian_getW(const BYTE *b,int index) {
int LittleEndian_getW(const uint8_t *b,int index) {
int c0, c1;
c0 = *(b + index + 0);
c1 = *(b + index + 1);
return c0 + (c1 << 8);
}
void LittleEndian_putW(int num, BYTE *b, int index) {
void LittleEndian_putW(int num, uint8_t *b, int index) {
int c0, c1;
num %= 65536;
c0 = num % 256;
+4 -4
View File
@@ -28,9 +28,9 @@
#include "portab.h"
extern int LittleEndian_getDW(const BYTE *b,int index);
extern int LittleEndian_get3B(const BYTE *b,int index);
extern int LittleEndian_getW(const BYTE *b,int index);
extern void LittleEndian_putW(int num, BYTE *b, int index);
extern int LittleEndian_getDW(const uint8_t *b,int index);
extern int LittleEndian_get3B(const uint8_t *b,int index);
extern int LittleEndian_getW(const uint8_t *b,int index);
extern void LittleEndian_putW(int num, uint8_t *b, int index);
#endif /* !__LITTLEENDIAN__ */
+28 -14
View File
@@ -63,11 +63,11 @@ static void initPal(Palette256 *pal) {
boolean ags_check_param(int *x, int *y, int *w, int *h) {
if (*x >= nact->ags.world_size.width) {
WARNING("Illegal Param x = %d (max=%d)(@%03x:%05x)\n", *x, nact->ags.world_size.width, sl_getPage(), sl_getIndex());
WARNING("Illegal Param x = %d (max=%d)(@%03x:%05x)", *x, nact->ags.world_size.width, sl_getPage(), sl_getIndex());
return FALSE;
}
if (*y >= nact->ags.world_size.height) {
WARNING("Illegal Param y = %d (max=%d)\n", *y, nact->ags.world_size.height);
WARNING("Illegal Param y = %d (max=%d)", *y, nact->ags.world_size.height);
return FALSE;
}
@@ -85,11 +85,11 @@ boolean ags_check_param(int *x, int *y, int *w, int *h) {
boolean ags_check_param_xy(int *x, int *y) {
if (*x >= nact->ags.world_size.width) {
WARNING("Illegal Param x = %d\n", *x);
WARNING("Illegal Param x = %d", *x);
return FALSE;
}
if (*y >= nact->ags.world_size.height) {
WARNING("Illegal Param y = %d\n", *y);
WARNING("Illegal Param y = %d", *y);
return FALSE;
}
@@ -100,7 +100,7 @@ boolean ags_check_param_xy(int *x, int *y) {
}
void ags_init(const char *render_driver) {
nact->ags.mouse_movesw = 2; /* 0:IZを無視, 1: 直接指定場所へ, 2: スムーズに指定場所に */
nact->ags.mouse_movesw = MOUSE_WARP_SMOOTH;
nact->ags.pal = &pal_256;
nact->ags.world_size.width = SYS35_DEFAULT_WIDTH;
nact->ags.world_size.height = SYS35_DEFAULT_HEIGHT;
@@ -123,7 +123,7 @@ void ags_remove(void) {
}
void ags_reset(void) {
nact->ags.mouse_movesw = 2;
nact->ags.mouse_movesw = MOUSE_WARP_SMOOTH;
nact->ags.eventcb = NULL;
initPal(&pal_256);
cg_reset();
@@ -164,7 +164,7 @@ void ags_setViewArea(int x, int y, int width, int height) {
void ags_setWindowTitle(const char *src) {
#define TITLEHEAD "XSystem35 Version "VERSION":"
BYTE *utf, *d;
uint8_t *utf, *d;
utf = toUTF8(src);
if (NULL == (d = malloc(strlen(utf) + strlen(TITLEHEAD) + 1))) {
@@ -301,6 +301,20 @@ void ags_getPixel(int x, int y, Palette *cell) {
sdl_getPixel(x, y, cell);
}
void ags_copyPaletteShift(int sx, int sy, int w, int h, int dx, int dy, uint8_t sprite) {
if (!ags_check_param(&sx, &sy, &w, &h)) return;
if (!ags_check_param(&dx, &dy, &w, &h)) return;
for (int y = 0; y < h; y++) {
uint8_t *src = GETOFFSET_PIXEL(nact->ags.dib, sx, sy + y);
uint8_t *dst = GETOFFSET_PIXEL(nact->ags.dib, dx, dy + y);
for (int x = 0; x < w; x++, src++, dst++) {
if (*src != sprite)
*dst = (*src & 0xf0) | (*dst & 0x0f);
}
}
}
void ags_changeColorArea(int sx, int sy, int w, int h, int dst, int src, int cnt) {
if (nact->ags.world_depth != 8) return;
@@ -310,8 +324,8 @@ void ags_changeColorArea(int sx, int sy, int w, int h, int dst, int src, int cnt
agsurface_t *dib = nact->ags.dib;
int x, y;
int src_last = src + cnt,dif = dst - src;
BYTE *yl;
BYTE *sdata = GETOFFSET_PIXEL(dib, sx, sy);
uint8_t *yl;
uint8_t *sdata = GETOFFSET_PIXEL(dib, sx, sy);
for (y = 0; y < h; y++) {
yl = sdata + y * dib->bytes_per_line;
@@ -505,11 +519,11 @@ void ags_alpha_getPixel(int x, int y, int *pic) {
if (!ags_check_param_xy(&x, &y)) {
*pic = 0;
} else {
alpha_get_pixel(nact->ags.dib, x, y, (BYTE *)pic);
alpha_get_pixel(nact->ags.dib, x, y, (uint8_t *)pic);
}
}
void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b) {
void ags_alpha_setPixel(int x, int y, int w, int h, uint8_t *b) {
int savex, savey, savew, offset;
savex = x;
@@ -635,11 +649,11 @@ void ags_setCursorLocation(int x, int y, boolean is_dibgeo) {
}
switch(nact->ags.mouse_movesw) {
case 0:
case MOUSE_WARP_DISABLED:
return;
case 1:
case MOUSE_WARP_DIRECT:
sdl_setCursorLocation(x, y); break;
case 2:
case MOUSE_WARP_SMOOTH:
sys_getMouseInfo(&p, is_dibgeo);
delx = x - p.x;
dely = y - p.y;
+18 -16
View File
@@ -67,8 +67,8 @@ struct agsurface {
int bytes_per_line; /* bytes per line */
int bytes_per_pixel; /* bytes per pixel */
BYTE *pixel; /* pixel data (can be NULL) */
BYTE *alpha; /* alpha pixel data (can be NULL) */
uint8_t *pixel; /* pixel data (can be NULL) */
uint8_t *alpha; /* alpha pixel data (can be NULL) */
};
typedef struct agsurface agsurface_t;
@@ -97,6 +97,11 @@ typedef struct _agsevent agsevent_t;
#define AGSEVENT_BUTTON_MID 2
#define AGSEVENT_BUTTON_RIGHT 3
enum mouse_warp_mode {
MOUSE_WARP_DISABLED,
MOUSE_WARP_DIRECT,
MOUSE_WARP_SMOOTH,
};
struct _ags {
Palette256 *pal; /* system palette */
@@ -108,11 +113,7 @@ struct _ags {
int world_depth; /* depth of off-screen (bits per pixel) */
int mouse_movesw; /* mouse cursor move mode
0: ignore IZ
1: move to the geometory direcly
2: move to the geometory smoothly
*/
enum mouse_warp_mode mouse_movesw;
agsurface_t *dib; /* main surface */
void (*eventcb)(agsevent_t *e); /* deliver event */
@@ -161,6 +162,7 @@ extern void ags_copyArea_shadow_withrate(int sx, int sy, int w, int h, int dx, i
extern void ags_wrapColor(int x, int y, int w, int h, int p1, int p2);
extern void ags_getPixel(int x, int y, Palette *cell);
extern void ags_copyPaletteShift(int sx, int sy, int w, int h, int dx, int dy, uint8_t sprite);
extern void ags_changeColorArea(int x, int y, int w, int h, int dst, int src, int cnt);
extern void* ags_saveRegion(int x, int y, int w, int h);
@@ -187,7 +189,7 @@ extern void ags_alpha_lowercut(int sx, int sy, int w, int h, int s, int d);
extern void ags_alpha_setLevel(int x, int y, int w, int h, int lv);
extern void ags_alpha_copyArea(int sx, int sy, int w, int h, int dx, int dy);
extern void ags_alpha_getPixel(int x, int y, int *pic);
extern void ags_alpha_setPixel(int x, int y, int w, int h, BYTE *b);
extern void ags_alpha_setPixel(int x, int y, int w, int h, uint8_t *b);
/* fader */
extern void ags_fadeIn(int rate, boolean flg);
@@ -225,15 +227,15 @@ void ags_runEffect(int duration_ms, boolean cancelable, ags_EffectStepFunc step,
#define GMASK24 0x0000ff00
#define BMASK24 0x000000ff
#define PIXR16(pic) (BYTE)(((pic) & RMASK16) >> 8)
#define PIXG16(pic) (BYTE)(((pic) & GMASK16) >> 3)
#define PIXB16(pic) (BYTE)(((pic) & BMASK16) << 3)
#define PIX16(r,g,b) (WORD)((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | ((b ) >> 3))
#define PIXR16(pic) (uint8_t)(((pic) & RMASK16) >> 8)
#define PIXG16(pic) (uint8_t)(((pic) & GMASK16) >> 3)
#define PIXB16(pic) (uint8_t)(((pic) & BMASK16) << 3)
#define PIX16(r,g,b) (uint16_t)((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | ((b ) >> 3))
#define PIXR24(pic) (BYTE)(((pic) & RMASK24) >> 16)
#define PIXG24(pic) (BYTE)(((pic) & GMASK24) >> 8)
#define PIXB24(pic) (BYTE)(((pic) & BMASK24) )
#define PIX24(r,g,b) (DWORD)((((r) << 16) | ((g) << 8) | (b) ))
#define PIXR24(pic) (uint8_t)(((pic) & RMASK24) >> 16)
#define PIXG24(pic) (uint8_t)(((pic) & GMASK24) >> 8)
#define PIXB24(pic) (uint8_t)(((pic) & BMASK24) )
#define PIX24(r,g,b) (uint32_t)((((r) << 16) | ((g) << 8) | (b)))
#define ALPHABLEND16(f, b, a) (PIX16((((PIXR16((f)) - PIXR16((b))) * (a)) >> 8)+ PIXR16((b)),\
(((PIXG16((f)) - PIXG16((b))) * (a)) >> 8)+ PIXG16((b)),\
+12 -12
View File
@@ -37,9 +37,9 @@
* src : source alpha plane pixel
* src_pitch: soruce alpha plane pitch
*/
void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, BYTE *src, int src_pitch) {
BYTE *ad = GETOFFSET_ALPHA(dst, dx, dy);
BYTE *as = src;
void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, uint8_t *src, int src_pitch) {
uint8_t *ad = GETOFFSET_ALPHA(dst, dx, dy);
uint8_t *as = src;
int i;
for (i = 0; i < h; i++) {
@@ -56,7 +56,7 @@ void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, BYTE *src,
* y : location y
* pic: acired alpha pixel
*/
void alpha_get_pixel(agsurface_t *suf, int x, int y, BYTE *pic) {
void alpha_get_pixel(agsurface_t *suf, int x, int y, uint8_t *pic) {
*pic = *GETOFFSET_ALPHA(suf, x, y);
}
@@ -71,13 +71,13 @@ void alpha_get_pixel(agsurface_t *suf, int x, int y, BYTE *pic) {
* d : setteled level
*/
void alpha_lowercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d) {
BYTE *a = GETOFFSET_ALPHA(suf, sx, sy), *b;
uint8_t *a = GETOFFSET_ALPHA(suf, sx, sy), *b;
int x, y;
for (y = 0; y < h; y++) {
b = a + y * suf->width;
for (x = 0; x < w; x++) {
if (*b <= (BYTE)s) *b = (BYTE)d;
if (*b <= (uint8_t)s) *b = (uint8_t)d;
b++;
}
}
@@ -94,13 +94,13 @@ void alpha_lowercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d
* d : setteled level
*/
void alpha_uppercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d) {
BYTE *dp = GETOFFSET_ALPHA(suf, sx, sy);
uint8_t *dp = GETOFFSET_ALPHA(suf, sx, sy);
int x, y;
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
if (*(dp + x) >= (BYTE)s) {
*(dp + x) = (BYTE)d;
if (*(dp + x) >= (uint8_t)s) {
*(dp + x) = (uint8_t)d;
}
}
dp += suf->width;
@@ -117,7 +117,7 @@ void alpha_uppercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d
* lv : level to be set
*/
void alpha_set_level(agsurface_t *suf, int sx, int sy, int w, int h, int lv) {
BYTE *a = GETOFFSET_ALPHA(suf, sx, sy);
uint8_t *a = GETOFFSET_ALPHA(suf, sx, sy);
while(h--){
memset(a, lv, w);
@@ -136,8 +136,8 @@ void alpha_set_level(agsurface_t *suf, int sx, int sy, int w, int h, int lv) {
* dy : destination y
*/
void alpha_copy_area(agsurface_t *suf, int sx, int sy, int w, int h, int dx, int dy) {
BYTE *src = GETOFFSET_ALPHA(suf, sx, sy);
BYTE *dst = GETOFFSET_ALPHA(suf, dx, dy);
uint8_t *src = GETOFFSET_ALPHA(suf, sx, sy);
uint8_t *dst = GETOFFSET_ALPHA(suf, dx, dy);
if (sy <= dy && dy < (sy + h)) {
src += (h-1) * suf->width;
+2 -2
View File
@@ -27,8 +27,8 @@
#include "portab.h"
#include "ags.h"
extern void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, BYTE *src, int src_pitch);
extern void alpha_get_pixel(agsurface_t *suf, int x, int y, BYTE *pic);
extern void alpha_set_pixels(agsurface_t *dst, int dx, int dy, int w, int h, uint8_t *src, int src_pitch);
extern void alpha_get_pixel(agsurface_t *suf, int x, int y, uint8_t *pic);
extern void alpha_lowercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d);
extern void alpha_uppercut(agsurface_t *suf, int sx, int sy, int w, int h, int s, int d);
extern void alpha_set_level(agsurface_t *suf, int sx, int sy, int w, int h, int lv);
+1 -1
View File
@@ -54,7 +54,7 @@ int bgi_read(const char *path) {
FILE *fp = fopen(path, "rb");
if (!fp) {
WARNING("Could not open %s\n", path);
WARNING("Could not open %s", path);
return NG;
}
+8 -8
View File
@@ -35,41 +35,41 @@ int musbgm_reset(void) {
}
int musbgm_play(int no, int time, int vol) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return NG;
}
int musbgm_stop(int no, int time) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return NG;
}
int musbgm_fade(int no, int time, int vol) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return NG;
}
int musbgm_getpos(int no) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return 0;
}
int musbgm_getlen(int no) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return 0;
}
int musbgm_isplaying(int no) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return 0;
}
int musbgm_stopall(int time) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return NG;
}
int musbgm_wait(int no, int timeout) {
printf("%s not implemented\n", __func__);
WARNING("not implemented");
return NG;
}
+2 -2
View File
@@ -58,7 +58,7 @@ static Mix_Music *bgm_load(int no) {
dfile = ald_getdata(DRIFILE_BGM, no -1);
if (dfile == NULL) {
WARNING("DRIFILE_BGM fail to open %d\n", no -1);
WARNING("DRIFILE_BGM fail to open %d", no -1);
return NULL;
}
@@ -66,7 +66,7 @@ static Mix_Music *bgm_load(int no) {
mix_music = Mix_LoadMUS_RW(rwops, SDL_TRUE /* freesrc */);
if (mix_music == NULL) {
WARNING("Failed to load BGM %d: %s\n", no, SDL_GetError());
WARNING("Failed to load BGM %d: %s", no, SDL_GetError());
free_music();
return NULL;
}
+18 -18
View File
@@ -35,17 +35,17 @@
/*
* static methods
*/
static bmp_header *extract_header(BYTE *b);
static void getpal(Palette256 *pal, BYTE *b);
static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b);
static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b);
static bmp_header *extract_header(uint8_t *b);
static void getpal(Palette256 *pal, uint8_t *b);
static void extract_8bit(bmp_header *bmp, uint8_t *pic, uint8_t *b);
static void extract_24bit(bmp_header *bmp, uint16_t *pic, uint8_t *b);
/*
* Get information from cg header
* b: raw data (pointer to header)
* return: acquired bmp information object
*/
static bmp_header *extract_header(BYTE *b) {
static bmp_header *extract_header(uint8_t *b) {
bmp_header *bmp = malloc(sizeof(bmp_header));
bmp->bmpSize = LittleEndian_getDW(b, 2);
@@ -68,7 +68,7 @@ static bmp_header *extract_header(BYTE *b) {
* pal: palette to be stored
* b : raw data (pointer to palette)
*/
static void getpal(Palette256 *pal, BYTE *b) {
static void getpal(Palette256 *pal, uint8_t *b) {
int i;
for (i = 0; i < 256; i++) {
@@ -84,7 +84,7 @@ static void getpal(Palette256 *pal, BYTE *b) {
* pic: pixel to be stored
* b : raw data (pointer to pixel)
*/
static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b) {
static void extract_8bit(bmp_header *bmp, uint8_t *pic, uint8_t *b) {
int i, j;
int pos;
int LineNeed = (bmp->bmpXW * bmp->bmpBpp) / 8;
@@ -94,7 +94,7 @@ static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b) {
pos = LineNeed * (bmp->bmpYW); /* 最上行の位置 */
for (i = 0; i < bmp->bmpYW; i++) {
const BYTE* p;
const uint8_t* p;
pos -= LineNeed;
p = b + pos;
for (j = 0; j < bmp->bmpXW; j++)
@@ -108,7 +108,7 @@ static void extract_8bit(bmp_header *bmp, BYTE *pic, BYTE *b) {
* pic: pixel to be stored (16 bit converted)
* b : raw data (pointer to pixel)
*/
static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b) {
static void extract_24bit(bmp_header *bmp, uint16_t *pic, uint8_t *b) {
int i, j;
int pos;
int LineNeed = (bmp->bmpXW * bmp->bmpBpp) / 8;
@@ -118,12 +118,12 @@ static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b) {
pos = LineNeed * (bmp->bmpYW); /* 最上行の位置 */
for (i = 0; i < bmp->bmpYW; i++) {
const BYTE* p;
const uint8_t* p;
pos -= LineNeed;
p = b + pos;
for (j = 0; j < bmp->bmpXW; j++) {
WORD r,g,b;
uint16_t r,g,b;
b = (*p++);
g = (*p++);
r = (*p++);
@@ -145,7 +145,7 @@ static void extract_24bit(bmp_header *bmp, WORD *pic, BYTE *b) {
* data: raw data (pointer to data top)
* return: TRUE if data is bmp
*/
boolean bmp256_checkfmt(BYTE *data) {
boolean bmp256_checkfmt(uint8_t *data) {
int w, h, bpp;
if (data[0] != 'B' || data[1] != 'M') return FALSE;
@@ -164,7 +164,7 @@ boolean bmp256_checkfmt(BYTE *data) {
* data: raw data (pointer to data top)
* return: extracted image data and information
*/
cgdata *bmp256_extract(BYTE *data) {
cgdata *bmp256_extract(uint8_t *data) {
bmp_header *bmp = extract_header(data);
cgdata *cg = calloc(1, sizeof(cgdata));
@@ -172,7 +172,7 @@ cgdata *bmp256_extract(BYTE *data) {
getpal(cg->pal, data + bmp->bmpPp);
/* +10: margin for broken cg */
cg->pic = malloc(sizeof(BYTE) * ((bmp->bmpXW + 10) * (bmp->bmpYW + 10)));
cg->pic = malloc(sizeof(uint8_t) * ((bmp->bmpXW + 10) * (bmp->bmpYW + 10)));
extract_8bit(bmp, cg->pic, data + bmp->bmpDp);
cg->type = ALCG_BMP8;
@@ -193,7 +193,7 @@ cgdata *bmp256_extract(BYTE *data) {
* data: raw data (pointer to data top)
* return: TRUE if data is pms
*/
boolean bmp16m_checkfmt(BYTE *data) {
boolean bmp16m_checkfmt(uint8_t *data) {
int w, h, bpp;
if (data[0] != 'B' || data[1] != 'M') return FALSE;
@@ -213,13 +213,13 @@ boolean bmp16m_checkfmt(BYTE *data) {
* data: raw data (pointer to data top)
* return: extracted image data and information
*/
cgdata *bmp16m_extract(BYTE *data) {
cgdata *bmp16m_extract(uint8_t *data) {
cgdata *cg = calloc(1, sizeof(cgdata));
bmp_header *bmp = extract_header(data);
/* +10: margin for broken cg */
cg->pic = (BYTE *)malloc(sizeof(WORD) * (bmp->bmpXW + 10) * (bmp->bmpYW + 10));
extract_24bit(bmp, (WORD *)cg->pic, data + bmp->bmpDp);
cg->pic = (uint8_t *)malloc(sizeof(uint16_t) * (bmp->bmpXW + 10) * (bmp->bmpYW + 10));
extract_24bit(bmp, (uint16_t *)cg->pic, data + bmp->bmpDp);
cg->type = ALCG_BMP24;
cg->x = 0;
+4 -4
View File
@@ -46,9 +46,9 @@ typedef struct {
BMP_Type bmpTp; /* bmp type */
} bmp_header;
extern boolean bmp256_checkfmt(BYTE *data);
extern cgdata *bmp256_extract(BYTE *data);
extern boolean bmp16m_checkfmt(BYTE *data);
extern cgdata *bmp16m_extract(BYTE *data);
extern boolean bmp256_checkfmt(uint8_t *data);
extern cgdata *bmp256_extract(uint8_t *data);
extern boolean bmp16m_checkfmt(uint8_t *data);
extern cgdata *bmp16m_extract(uint8_t *data);
#endif /* !__BMP__ */
+44 -29
View File
@@ -31,6 +31,7 @@
#include "portab.h"
#include "variable.h"
#include "scenario.h"
#include "nact.h"
#include "xsystem35.h"
#define CALI_TRUE (1) /* comparison is ture */
@@ -44,50 +45,64 @@
#define CALI_DEPTH_MAX (256)
int getCaliValue();
int *getCaliVariable();
int *getVariable();
static int buf[CALI_DEPTH_MAX]; /* 計算式バッファ */
static int *cali = buf; /* インデックス */
/* 変数番号を返す */
static int *getVar(int c0) {
if ((c0 & 0x40) == 0)
return v_ref(c0 & 0x3f); // 0 - 0x3f
int c1 = sl_getc();
if (c0 != 0xc0)
return v_ref(((c0 & 0x3f) * 256) + c1); // 0x100 - 0x3fff
if (c1 == 1) {
c0 = sl_getc();
c1 = sl_getc();
int index = getCaliValue();
return v_ref_indexed(c0 << 8 | c1, index);
} else if (c1 >= 0x40) {
return v_ref(c1); // 0x40 - 0xff
static int *getVar(int c0, struct VarRef *ref) {
int addr = sl_getIndex();
int var;
if ((c0 & 0x40) == 0) {
var = c0 & 0x3f; // 0 - 0x3f
} else {
int c1 = sl_getc();
if (c0 != 0xc0)
var = (c0 & 0x3f) * 256 + c1; // 0x100 - 0x3fff
else if (c1 == 1) {
c0 = sl_getc();
c1 = sl_getc();
var = c0 << 8 | c1;
int index = getCaliValue();
int *store = v_ref_indexed(var, index, ref);
if (!store)
WARNING("%03d:%05x: Out of bounds index access: %s[%d]", sl_getPage(), addr, v_name(var), index);
return store;
} else if (c1 >= 0x40) {
var = c1; // 0x40 - 0xff
} else {
SYSERROR("Invalid variable reference at %d:0x%x", sl_getPage(), addr);
return NULL;
}
}
SYSERROR("Invalid variable reference at %d:0x%x", sl_getPage(), sl_getIndex() - 2);
return NULL;
int *store = v_ref(var, ref);
if (!store)
WARNING("%03d:%05x: Out of bounds array access: %s", sl_getPage(), addr, v_name(var));
return store;
}
/* 変数番号が返る */
int *getCaliVariable() {
int *c0 = getVar(sl_getc());
int *getCaliVariable(void) {
int *c0 = getVar(sl_getc(), NULL);
if (sl_getc() != 0x7f) {
SYSERROR("Something is Wrong @ %03d:%05x", sl_getPage(), sl_getIndex());
}
return c0;
}
bool getCaliArray(struct VarRef *ref) {
bool ok = getVar(sl_getc(), ref) != NULL;
if (sl_getc() != 0x7f) {
SYSERROR("Something is Wrong @ %03d:%05x", sl_getPage(), sl_getIndex());
}
return ok;
}
/* 変数代入コマンド用 */
int *getVariable() {
return getVar(sl_getc());
int *getVariable(void) {
return getVar(sl_getc(), NULL);
}
/* 計算式の評価後の値が返る */
int getCaliValue() {
int getCaliValue(void) {
register int ingVal,edVal,rstVal;
int c0,c1;
int *bufc = cali;
@@ -129,7 +144,7 @@ int getCaliValue() {
}
}
l_var:
t = getVar(c0);
t = getVar(c0, NULL);
*cali++ = t ? *t : 0;
} else {
switch(c0) {
@@ -232,7 +247,7 @@ int getCaliValue() {
c0 = *--cali;
if (cali != bufc) {
WARNING("Something is wrong @ %03d:%05x\n", sl_getPage(), sl_getIndex());
WARNING("Something is wrong @ %03d:%05x", sl_getPage(), sl_getIndex());
cali = bufc;
return 0;
}
+17 -15
View File
@@ -21,6 +21,7 @@
*/
/* $Id: cdrom.FreeBSD.c,v 1.17 2002/08/18 09:35:29 chikama Exp $ */
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -32,6 +33,7 @@
#include "portab.h"
#include "cdrom.h"
#include "music_private.h"
#include "system.h"
static int cdrom_init(char *);
static int cdrom_exit(void);
@@ -79,14 +81,14 @@ static int get_cd_entry() {
/* 最終トラック番号を得る */
if (do_ioctl(CDIOREADTOCHEADER, &tochdr) < 0) {
perror("CDIOREADTOCHEADER");
WARNING("CDIOREADTOCHEADER: %s", strerror(errno));
return NG;
}
lastindex = endtrk = tochdr.ending_track;
i = tochdr.ending_track - tochdr.starting_track + 1;
if (endtrk <= 1) { /* 2トラック以上ないとダメ */
fprintf(stderr, "No CD-AUDIO in CD-ROM\n");
WARNING("No CD-AUDIO in CD-ROM");
return NG;
}
@@ -98,7 +100,7 @@ static int get_cd_entry() {
toc.data_len = (i + 1) * sizeof(struct cd_toc_entry);
toc.data = toc_buffer;
if (do_ioctl(CDIOREADTOCENTRYS, &toc) < 0) {
perror("CDIOREADTOCENTRYS");
WARNING("CDIOREADTOCENTRYS: %s", strerror(errno));
return NG;
}
@@ -115,13 +117,13 @@ static int get_cd_entry() {
msf.end_s = toc_buffer[2].addr.msf.second;
msf.end_f = toc_buffer[2].addr.msf.frame;
if (do_ioctl(CDIOCPLAYMSF, &msf) < 0) {
perror("CDIOPLAYMSF");
fprintf(stderr, "CD-ROM: change TRKMODE\n");
WARNING("CDIOPLAYMSF: %s", strerror(errno));
WARNING("CD-ROM: change TRKMODE");
msfmode = FALSE;
}
/* stop */
if (do_ioctl(CDIOCSTOP, NULL) < 0) {
perror("CDIOCSTOP");
WARNING("CDIOCSTOP: %s", strerror(errno));
return NG;
}
return OK;
@@ -132,7 +134,7 @@ int cdrom_init(char *dev_cd) {
if (dev_cd == NULL) return NG;
if ((cd_fd = open(dev_cd, O_RDONLY, 0)) < 0) {
perror("CDROM_DEVICE OPEN");
WARNING("CDROM_DEVICE OPEN: %s", strerror(errno));
enabled = FALSE;
return NG;
}
@@ -169,9 +171,9 @@ int cdrom_start(int trk, int loop) {
return NG;
}
/* drive spin up */
if (do_ioctl(CDIOCSTART, NULL) < 0) {
perror("CDIOCSTART");
return NG;
if (do_ioctl(CDIOCSTART, NULL) < 0) {
WARNING("CDIOCSTART: %s", strerror(errno));
return NG;
}
if (msfmode) {
msf.start_m = toc_buffer[trk - 1].addr.msf.minute;
@@ -181,14 +183,14 @@ int cdrom_start(int trk, int loop) {
msf.end_s = toc_buffer[trk].addr.msf.second;
msf.end_f = toc_buffer[trk].addr.msf.frame;
if (do_ioctl(CDIOCPLAYMSF, &msf) < 0) {
perror("CDIOPLAYMSF");
WARNING("CDIOPLAYMSF: %s", strerror(errno));
return NG;
}
} else {
track.start_track = track.end_track = trk;
track.start_index = track.end_index = 0;
if (do_ioctl(CDIOCPLAYTRACKS, &track) < 0) {
perror("CDIOCPLAYTRACKS");
WARNING("CDIOCPLAYTRACKS: %s", strerror(errno));
return NG;
}
}
@@ -200,8 +202,8 @@ int cdrom_stop() {
if (enabled) {
/* if (do_ioctl(CDIOCSTOP, NULL) < 0) { */
if (do_ioctl(CDIOCPAUSE, NULL) < 0) {
/* perror("CDIOCSTOP"); */
perror("CDIOCPAUSE");
/* WARNING("CDIOCSTOP: %s", strerror(errno)); */
WARNING("CDIOCPAUSE: %s", strerror(errno));
}
return OK;
}
@@ -222,7 +224,7 @@ int cdrom_getPlayingInfo (cd_time *info) {
s.address_format = CD_MSF_FORMAT;
s.data_format = CD_CURRENT_POSITION;
if (do_ioctl(CDIOCREADSUBCHANNEL, &s) < 0) {
perror("CDIOCREADSUBCHANNEL");
WARNING("CDIOCREADSUBCHANNEL: %s", strerror(errno));
return NG;
}
if (s.data->header.audio_status != CD_AS_PLAY_IN_PROGRESS) {
+19 -16
View File
@@ -21,9 +21,11 @@
*/
/* $Id: cdrom.Linux.c,v 1.18 2002/08/18 09:35:29 chikama Exp $ */
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <fcntl.h>
@@ -41,6 +43,7 @@ struct cdrom_msf0 {
#include "portab.h"
#include "cdrom.h"
#include "music_private.h"
#include "system.h"
static int cdrom_init(char *);
static int cdrom_exit(void);
@@ -89,12 +92,12 @@ static int get_cd_entry() {
/* 最終トラック番号を得る */
if (do_ioctl(CDROMREADTOCHDR, &tochdr) < 0) {
perror("CDROMREADTOCHDR");
WARNING("CDROMREADTOCHDR: %s", strerror(errno));
return NG;
}
lastindex = endtrk = tochdr.cdth_trk1;
if (endtrk <= 1) { /* 2トラック以上ないとダメ */
fprintf(stderr, "No CD-AUDIO in CD-ROM\n");
WARNING("No CD-AUDIO in CD-ROM");
return NG;
}
@@ -105,7 +108,7 @@ static int get_cd_entry() {
for (i = 1; i <= endtrk; i++) {
toc.cdte_track = i;
if (do_ioctl(CDROMREADTOCENTRY, &toc) < 0) {
perror("CDROMREADTOCENTRY");
WARNING("CDROMREADTOCENTRY: %s", strerror(errno));
return NG;
}
tocmsf[i - 1].minute = toc.cdte_addr.msf.minute;
@@ -115,7 +118,7 @@ static int get_cd_entry() {
/* リードアウトを読み出す */
toc.cdte_track = CDROM_LEADOUT;
if (do_ioctl(CDROMREADTOCENTRY, &toc) < 0) {
perror("CDROMREADTOCENTRY");
WARNING("CDROMREADTOCENTRY: %s", strerror(errno));
return NG;
}
@@ -146,13 +149,13 @@ static int get_cd_entry() {
msf.cdmsf_sec1 = tocmsf[2].second;
msf.cdmsf_frame1 = tocmsf[2].frame;
if (do_ioctl(CDROMPLAYMSF, &msf) < 0) {
perror("CDROMPLAYMSF");
fprintf(stderr, "CD-ROM: change TRKIND mode\n");
WARNING("CDROMPLAYMSF: %s", strerror(errno));
WARNING("CD-ROM: change TRKIND mode");
msfmode = FALSE;
}
/* stop */
if (do_ioctl(CDROMSTOP, NULL) < 0) {
perror("CDROMSTOP");
WARNING("CDROMSTOP: %s", strerror(errno));
return NG;
}
return OK;
@@ -163,7 +166,7 @@ static int cdrom_init(char *dev_cd) {
if (dev_cd == NULL) return NG;
if ((cd_fd = open(dev_cd, O_RDONLY, 0)) < 0) {
perror("CDROM_DEVICE OPEN");
WARNING("CDROM_DEVICE OPEN: %s", strerror(errno));
enabled = FALSE;
return NG;
}
@@ -200,9 +203,9 @@ static int cdrom_start(int trk, int loop) {
return NG;
}
/* drive spin up */
if (do_ioctl(CDROMSTART, NULL) < 0) {
perror("CDROMSTART");
return NG;
if (do_ioctl(CDROMSTART, NULL) < 0) {
WARNING("CDROMSTART: %s", strerror(errno));
return NG;
}
if (msfmode) {
@@ -213,7 +216,7 @@ static int cdrom_start(int trk, int loop) {
msf.cdmsf_sec1 = tocmsf[trk].second;
msf.cdmsf_frame1 = tocmsf[trk].frame;
if (do_ioctl(CDROMPLAYMSF, &msf) < 0) {
perror("CDROMPLAYMSF");
WARNING("CDROMPLAYMSF: %s", strerror(errno));
return NG;
}
return OK;
@@ -221,7 +224,7 @@ static int cdrom_start(int trk, int loop) {
ti.cdti_trk0 = ti.cdti_trk1 = trk;
ti.cdti_ind0 = ti.cdti_ind1 = 0;
if (do_ioctl(CDROMPLAYTRKIND, &ti) < 0) {
perror("CDROMPLAYTRKIND");
WARNING("CDROMPLAYTRKIND: %s", strerror(errno));
return NG;
}
return OK;
@@ -233,8 +236,8 @@ static int cdrom_stop() {
if (enabled) {
/* if (do_ioctl(CDROMSTOP, NULL) < 0) { */
if (do_ioctl(CDROMPAUSE, NULL) < 0) {
/* perror("CDROMSTOP"); */
perror("CDROMPAUSE");
/* WARNING("CDROMSTOP: %s", strerror(errno)); */
WARNING("CDROMPAUSE: %s", strerror(errno));
return NG;
}
return OK;
@@ -251,7 +254,7 @@ static int cdrom_getPlayingInfo (cd_time *info) {
sc.cdsc_format = CDROM_MSF;
if (do_ioctl(CDROMSUBCHNL, &sc) < 0) {
perror("CDROMSUBCHNL");
WARNING("CDROMSUBCHNL: %s", strerror(errno));
return NG;
}
if (sc.cdsc_audiostatus != CDROM_AUDIO_PLAY) {
+1 -1
View File
@@ -99,7 +99,7 @@ int cd_init(cdromdevice_t *cd) {
ret = cd->init(dev);
#else
/* error */
WARNING("no cdrom device available\n");
WARNING("no cdrom device available");
ret = NG;
#endif
}
+3 -3
View File
@@ -72,7 +72,7 @@ static int cdrom_init(char *playlist_path) {
fp = fopen("_inmm.ini", "r");
}
if (!fp) {
NOTICE("cdrom: Cannot open playlist %s\n", playlist_path);
NOTICE("cdrom: Cannot open playlist %s", playlist_path);
return NG;
}
@@ -93,7 +93,7 @@ static int cdrom_init(char *playlist_path) {
}
}
fclose(fp);
NOTICE("cdrom: Loaded playlist from %s\n", playlist_path);
NOTICE("cdrom: Loaded playlist from %s", playlist_path);
trackno = 0;
enabled = TRUE;
@@ -135,7 +135,7 @@ static int cdrom_start(int trk, int loop) {
#endif
if (!mix_music) {
WARNING("Cannot load %s: %s\n", playlist[trk], Mix_GetError());
WARNING("Cannot load %s: %s", playlist[trk], Mix_GetError());
return NG;
}
if (Mix_PlayMusic(mix_music, loop == 0 ? -1 : loop) != 0) {

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