├── .classpath
├── .cproject
├── .gitignore
├── .project
├── .settings
├── org.eclipse.core.resources.prefs
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── GBA.key
├── README.md
├── assets
├── A2.png
├── AB.png
├── AB2.png
├── B2.png
├── cheat.png
├── cheat2.png
├── direction.png
├── down.png
├── fastforward.png
├── fastforward2.png
├── left.png
├── left2.png
├── left2_2.png
├── leftdown.png
├── leftup.png
├── load.png
├── load2.png
├── red.png
├── reset.png
├── reset2.png
├── right.png
├── right2.png
├── right2_2.png
├── rightdown.png
├── rightup.png
├── save.png
├── save2.png
├── select.png
├── select2.png
├── start.png
├── start2.png
└── up.png
├── jni
├── Android.mk
├── Application.mk
├── SDL
│ ├── include
│ │ ├── SDL.h
│ │ ├── SDL_assert.h
│ │ ├── SDL_atomic.h
│ │ ├── SDL_audio.h
│ │ ├── SDL_bits.h
│ │ ├── SDL_blendmode.h
│ │ ├── SDL_clipboard.h
│ │ ├── SDL_config.h
│ │ ├── SDL_config.h.cmake
│ │ ├── SDL_config.h.in
│ │ ├── SDL_config_android.h
│ │ ├── SDL_config_iphoneos.h
│ │ ├── SDL_config_macosx.h
│ │ ├── SDL_config_minimal.h
│ │ ├── SDL_config_pandora.h
│ │ ├── SDL_config_psp.h
│ │ ├── SDL_config_windows.h
│ │ ├── SDL_config_wiz.h
│ │ ├── SDL_copying.h
│ │ ├── SDL_cpuinfo.h
│ │ ├── SDL_endian.h
│ │ ├── SDL_error.h
│ │ ├── SDL_events.h
│ │ ├── SDL_filesystem.h
│ │ ├── SDL_gamecontroller.h
│ │ ├── SDL_gesture.h
│ │ ├── SDL_haptic.h
│ │ ├── SDL_hints.h
│ │ ├── SDL_joystick.h
│ │ ├── SDL_keyboard.h
│ │ ├── SDL_keycode.h
│ │ ├── SDL_loadso.h
│ │ ├── SDL_log.h
│ │ ├── SDL_main.h
│ │ ├── SDL_messagebox.h
│ │ ├── SDL_mouse.h
│ │ ├── SDL_mutex.h
│ │ ├── SDL_name.h
│ │ ├── SDL_opengl.h
│ │ ├── SDL_opengles.h
│ │ ├── SDL_opengles2.h
│ │ ├── SDL_pixels.h
│ │ ├── SDL_platform.h
│ │ ├── SDL_power.h
│ │ ├── SDL_quit.h
│ │ ├── SDL_rect.h
│ │ ├── SDL_render.h
│ │ ├── SDL_revision.h
│ │ ├── SDL_rwops.h
│ │ ├── SDL_scancode.h
│ │ ├── SDL_shape.h
│ │ ├── SDL_stdinc.h
│ │ ├── SDL_surface.h
│ │ ├── SDL_system.h
│ │ ├── SDL_syswm.h
│ │ ├── SDL_test.h
│ │ ├── SDL_test_assert.h
│ │ ├── SDL_test_common.h
│ │ ├── SDL_test_compare.h
│ │ ├── SDL_test_crc32.h
│ │ ├── SDL_test_font.h
│ │ ├── SDL_test_fuzzer.h
│ │ ├── SDL_test_harness.h
│ │ ├── SDL_test_images.h
│ │ ├── SDL_test_log.h
│ │ ├── SDL_test_md5.h
│ │ ├── SDL_test_random.h
│ │ ├── SDL_thread.h
│ │ ├── SDL_timer.h
│ │ ├── SDL_touch.h
│ │ ├── SDL_types.h
│ │ ├── SDL_version.h
│ │ ├── SDL_video.h
│ │ ├── begin_code.h
│ │ ├── close_code.h
│ │ └── doxyfile
│ └── lib
│ │ ├── armeabi-v7a
│ │ └── libSDL2.a
│ │ ├── armeabi
│ │ └── libSDL2.a
│ │ └── x86
│ │ └── libSDL2.a
├── SDL2_image
│ ├── Android.mk
│ ├── IMG.c
│ ├── IMG_bmp.c
│ ├── IMG_gif.c
│ ├── IMG_jpg.c
│ ├── IMG_lbm.c
│ ├── IMG_pcx.c
│ ├── IMG_png.c
│ ├── IMG_pnm.c
│ ├── IMG_tga.c
│ ├── IMG_tif.c
│ ├── IMG_webp.c
│ ├── IMG_xcf.c
│ ├── IMG_xpm.c
│ ├── IMG_xv.c
│ ├── IMG_xxx.c
│ ├── SDL_image.h
│ ├── miniz.h
│ └── showimage.c
├── libpng
│ ├── Android.mk
│ ├── png.c
│ ├── png.h
│ ├── pngconf.h
│ ├── pngerror.c
│ ├── pngget.c
│ ├── pngmem.c
│ ├── pngpread.c
│ ├── pngread.c
│ ├── pngrio.c
│ ├── pngrtran.c
│ ├── pngrutil.c
│ ├── pngset.c
│ ├── pngtrans.c
│ ├── pngwio.c
│ ├── pngwrite.c
│ ├── pngwtran.c
│ └── pngwutil.c
├── src
│ ├── 2xSaI.cpp
│ ├── Android.mk
│ ├── AutoBuild.h
│ ├── CheatSearch.cpp
│ ├── CheatSearch.h
│ ├── Cheats.cpp
│ ├── Cheats.h
│ ├── EEprom.cpp
│ ├── EEprom.h
│ ├── Flash.cpp
│ ├── Flash.h
│ ├── GBA.cpp
│ ├── GBA.h
│ ├── GBAinline.h
│ ├── Gfx.cpp
│ ├── Gfx.h
│ ├── Globals.cpp
│ ├── Globals.h
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── Mode0.cpp
│ ├── Mode1.cpp
│ ├── Mode2.cpp
│ ├── Mode3.cpp
│ ├── Mode4.cpp
│ ├── Mode5.cpp
│ ├── NLS.h
│ ├── Port.h
│ ├── RTC.cpp
│ ├── RTC.h
│ ├── SDL
│ │ ├── SDL.cpp
│ │ ├── debugger.cpp
│ │ └── debugger.h
│ ├── SDL_android_main.c
│ ├── Sound.cpp
│ ├── Sound.h
│ ├── Sram.cpp
│ ├── Sram.h
│ ├── System.h
│ ├── Text.cpp
│ ├── Text.h
│ ├── Util.cpp
│ ├── Util.h
│ ├── admame.cpp
│ ├── agbprint.cpp
│ ├── agbprint.h
│ ├── arm-new.h
│ ├── armdis.cpp
│ ├── armdis.h
│ ├── bilinear.cpp
│ ├── bios.cpp
│ ├── bios.h
│ ├── elf.cpp
│ ├── elf.h
│ ├── expr-lex.cpp
│ ├── expr.cpp
│ ├── expr.cpp.h
│ ├── expr.l
│ ├── expr.y
│ ├── exprNode.cpp
│ ├── exprNode.h
│ ├── gb
│ │ ├── GB.cpp
│ │ ├── GB.h
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── gbCheats.cpp
│ │ ├── gbCheats.h
│ │ ├── gbCodes.h
│ │ ├── gbCodesCB.h
│ │ ├── gbDis.cpp
│ │ ├── gbGfx.cpp
│ │ ├── gbGlobals.cpp
│ │ ├── gbGlobals.h
│ │ ├── gbMemory.cpp
│ │ ├── gbMemory.h
│ │ ├── gbPrinter.cpp
│ │ ├── gbPrinter.h
│ │ ├── gbSGB.cpp
│ │ ├── gbSGB.h
│ │ ├── gbSound.cpp
│ │ └── gbSound.h
│ ├── getopt.c
│ ├── getopt.h
│ ├── getopt1.c
│ ├── hq2x.cpp
│ ├── hq2x.h
│ ├── interframe.cpp
│ ├── interp.h
│ ├── lq2x.h
│ ├── memgzio.c
│ ├── memgzio.h
│ ├── motionblur.cpp
│ ├── pixel.cpp
│ ├── remote.cpp
│ ├── scanline.cpp
│ ├── simple2x.cpp
│ ├── thumb.h
│ ├── unzip.cpp
│ └── unzip.h
└── zlib
│ ├── .cvsignore
│ ├── Android.mk
│ ├── adler32.c
│ ├── compress.c
│ ├── crc32.c
│ ├── crc32.h
│ ├── deflate.c
│ ├── deflate.h
│ ├── gzio.c
│ ├── infback.c
│ ├── inffast.c
│ ├── inffast.h
│ ├── inffixed.h
│ ├── inflate.c
│ ├── inflate.h
│ ├── inftrees.c
│ ├── inftrees.h
│ ├── trees.c
│ ├── trees.h
│ ├── uncompr.c
│ ├── zconf.h
│ ├── zlib.h
│ ├── zlib.vcproj
│ ├── zutil.c
│ └── zutil.h
├── libs
├── GoogleAdMobAdsSdk-6.4.1.jar
└── android-support-v4.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-xxhdpi
│ ├── ic_launcher.png
│ └── icon.png
├── layout-land
│ └── main.xml
├── layout-large-land
│ └── main.xml
├── layout-large
│ └── main.xml
├── layout
│ ├── cheat_view.xml
│ ├── file_view.xml
│ ├── gameshark.xml
│ ├── main.xml
│ ├── save_state.xml
│ ├── select_game.xml
│ └── state_view.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
├── com
└── van
│ └── gba
│ ├── Cheat.java
│ ├── GamesharkActivity.java
│ ├── LoadStateActivity.java
│ ├── SaveStateActivity.java
│ └── SelectGameActivity.java
└── org
└── libsdl
└── app
└── SDLActivity.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | bin/
3 | *.apk
4 | gen/
5 | libs/armeabi/
6 | libs/armeabi-v7a/
7 | libs/x86/
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | GBA
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder
10 | clean,full,incremental,
11 |
12 |
13 | ?children?
14 | ?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|?name?=entry\\\\\\\|\\\|\||
15 |
16 |
17 | ?name?
18 |
19 |
20 |
21 | org.eclipse.cdt.make.core.append_environment
22 | true
23 |
24 |
25 | org.eclipse.cdt.make.core.buildArguments
26 |
27 |
28 |
29 | org.eclipse.cdt.make.core.buildCommand
30 | ndk-build
31 |
32 |
33 | org.eclipse.cdt.make.core.cleanBuildTarget
34 | clean
35 |
36 |
37 | org.eclipse.cdt.make.core.contents
38 | org.eclipse.cdt.make.core.activeConfigSettings
39 |
40 |
41 | org.eclipse.cdt.make.core.enableAutoBuild
42 | false
43 |
44 |
45 | org.eclipse.cdt.make.core.enableCleanBuild
46 | true
47 |
48 |
49 | org.eclipse.cdt.make.core.enableFullBuild
50 | true
51 |
52 |
53 | org.eclipse.cdt.make.core.stopOnError
54 | true
55 |
56 |
57 | org.eclipse.cdt.make.core.useDefaultBuildCmd
58 | true
59 |
60 |
61 |
62 |
63 | com.android.ide.eclipse.adt.ResourceManagerBuilder
64 |
65 |
66 |
67 |
68 | com.android.ide.eclipse.adt.PreCompilerBuilder
69 |
70 |
71 |
72 |
73 | org.eclipse.jdt.core.javabuilder
74 |
75 |
76 |
77 |
78 | com.android.ide.eclipse.adt.ApkBuilder
79 |
80 |
81 |
82 |
83 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
84 | full,incremental,
85 |
86 |
87 |
88 |
89 |
90 | com.android.ide.eclipse.adt.AndroidNature
91 | org.eclipse.jdt.core.javanature
92 | org.eclipse.cdt.core.cnature
93 | org.eclipse.cdt.core.ccnature
94 | org.eclipse.cdt.managedbuilder.core.managedBuildNature
95 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
96 |
97 |
98 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/com/van/gba/SelectGameActivity.java=UTF-8
3 | encoding//src/org/libsdl/app/SDLActivity.java=UTF-8
4 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
24 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
42 |
43 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/GBA.key:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/GBA.key
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GBA-Emulator-android
2 | emulator gba android
3 |
--------------------------------------------------------------------------------
/assets/A2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/A2.png
--------------------------------------------------------------------------------
/assets/AB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/AB.png
--------------------------------------------------------------------------------
/assets/AB2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/AB2.png
--------------------------------------------------------------------------------
/assets/B2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/B2.png
--------------------------------------------------------------------------------
/assets/cheat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/cheat.png
--------------------------------------------------------------------------------
/assets/cheat2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/cheat2.png
--------------------------------------------------------------------------------
/assets/direction.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/direction.png
--------------------------------------------------------------------------------
/assets/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/down.png
--------------------------------------------------------------------------------
/assets/fastforward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/fastforward.png
--------------------------------------------------------------------------------
/assets/fastforward2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/fastforward2.png
--------------------------------------------------------------------------------
/assets/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/left.png
--------------------------------------------------------------------------------
/assets/left2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/left2.png
--------------------------------------------------------------------------------
/assets/left2_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/left2_2.png
--------------------------------------------------------------------------------
/assets/leftdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/leftdown.png
--------------------------------------------------------------------------------
/assets/leftup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/leftup.png
--------------------------------------------------------------------------------
/assets/load.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/load.png
--------------------------------------------------------------------------------
/assets/load2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/load2.png
--------------------------------------------------------------------------------
/assets/red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/red.png
--------------------------------------------------------------------------------
/assets/reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/reset.png
--------------------------------------------------------------------------------
/assets/reset2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/reset2.png
--------------------------------------------------------------------------------
/assets/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/right.png
--------------------------------------------------------------------------------
/assets/right2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/right2.png
--------------------------------------------------------------------------------
/assets/right2_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/right2_2.png
--------------------------------------------------------------------------------
/assets/rightdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/rightdown.png
--------------------------------------------------------------------------------
/assets/rightup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/rightup.png
--------------------------------------------------------------------------------
/assets/save.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/save.png
--------------------------------------------------------------------------------
/assets/save2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/save2.png
--------------------------------------------------------------------------------
/assets/select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/select.png
--------------------------------------------------------------------------------
/assets/select2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/select2.png
--------------------------------------------------------------------------------
/assets/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/start.png
--------------------------------------------------------------------------------
/assets/start2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/start2.png
--------------------------------------------------------------------------------
/assets/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/assets/up.png
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_PLATFORM := android-9
2 | APP_STL := gnustl_static
3 | #APP_ABI := armeabi
4 | APP_ABI := armeabi armeabi-v7a x86
5 | APP_OPTIM := release
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_bits.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_bits.h
24 | *
25 | * Functions for fiddling with bits and bitmasks.
26 | */
27 |
28 | #ifndef _SDL_bits_h
29 | #define _SDL_bits_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \file SDL_bits.h
41 | */
42 |
43 | /**
44 | * Get the index of the most significant bit. Result is undefined when called
45 | * with 0. This operation can also be stated as "count leading zeroes" and
46 | * "log base 2".
47 | *
48 | * \return Index of the most significant bit, or -1 if the value is 0.
49 | */
50 | SDL_FORCE_INLINE int
51 | SDL_MostSignificantBitIndex32(Uint32 x)
52 | {
53 | #if defined(__GNUC__) && __GNUC__ >= 4
54 | /* Count Leading Zeroes builtin in GCC.
55 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
56 | */
57 | if (x == 0) {
58 | return -1;
59 | }
60 | return 31 - __builtin_clz(x);
61 | #else
62 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
63 | * , released in the public domain.
64 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
65 | */
66 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
67 | const int S[] = {1, 2, 4, 8, 16};
68 |
69 | int msbIndex = 0;
70 | int i;
71 |
72 | if (x == 0) {
73 | return -1;
74 | }
75 |
76 | for (i = 4; i >= 0; i--)
77 | {
78 | if (x & b[i])
79 | {
80 | x >>= S[i];
81 | msbIndex |= S[i];
82 | }
83 | }
84 |
85 | return msbIndex;
86 | #endif
87 | }
88 |
89 | /* Ends C function definitions when using C++ */
90 | #ifdef __cplusplus
91 | }
92 | #endif
93 | #include "close_code.h"
94 |
95 | #endif /* _SDL_bits_h */
96 |
97 | /* vi: set ts=4 sw=4 expandtab: */
98 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_blendmode.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_blendmode.h
24 | *
25 | * Header file declaring the SDL_BlendMode enumeration
26 | */
27 |
28 | #ifndef _SDL_blendmode_h
29 | #define _SDL_blendmode_h
30 |
31 | #include "begin_code.h"
32 | /* Set up for C function definitions, even when using C++ */
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | /**
38 | * \brief The blend mode used in SDL_RenderCopy() and drawing operations.
39 | */
40 | typedef enum
41 | {
42 | SDL_BLENDMODE_NONE = 0x00000000, /**< no blending
43 | dstRGBA = srcRGBA */
44 | SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending
45 | dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA))
46 | dstA = srcA + (dstA * (1-srcA)) */
47 | SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending
48 | dstRGB = (srcRGB * srcA) + dstRGB
49 | dstA = dstA */
50 | SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate
51 | dstRGB = srcRGB * dstRGB
52 | dstA = dstA */
53 | } SDL_BlendMode;
54 |
55 | /* Ends C function definitions when using C++ */
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 | #include "close_code.h"
60 |
61 | #endif /* _SDL_video_h */
62 |
63 | /* vi: set ts=4 sw=4 expandtab: */
64 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_clipboard.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_clipboard.h
24 | *
25 | * Include file for SDL clipboard handling
26 | */
27 |
28 | #ifndef _SDL_clipboard_h
29 | #define _SDL_clipboard_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Function prototypes */
40 |
41 | /**
42 | * \brief Put UTF-8 text into the clipboard
43 | *
44 | * \sa SDL_GetClipboardText()
45 | */
46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
47 |
48 | /**
49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
50 | *
51 | * \sa SDL_SetClipboardText()
52 | */
53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
54 |
55 | /**
56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
57 | *
58 | * \sa SDL_GetClipboardText()
59 | */
60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
61 |
62 |
63 | /* Ends C function definitions when using C++ */
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 | #include "close_code.h"
68 |
69 | #endif /* _SDL_clipboard_h */
70 |
71 | /* vi: set ts=4 sw=4 expandtab: */
72 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_h
23 | #define _SDL_config_h
24 |
25 | #include "SDL_platform.h"
26 |
27 | /**
28 | * \file SDL_config.h
29 | */
30 |
31 | /* Add any platform that doesn't build using the configure system. */
32 | #if defined(__WIN32__)
33 | #include "SDL_config_windows.h"
34 | #elif defined(__MACOSX__)
35 | #include "SDL_config_macosx.h"
36 | #elif defined(__IPHONEOS__)
37 | #include "SDL_config_iphoneos.h"
38 | #elif defined(__ANDROID__)
39 | #include "SDL_config_android.h"
40 | #elif defined(__PSP__)
41 | #include "SDL_config_psp.h"
42 | #else
43 | /* This is a minimal configuration just to get SDL running on new platforms */
44 | #include "SDL_config_minimal.h"
45 | #endif /* platform config */
46 |
47 | #ifdef USING_GENERATED_CONFIG_H
48 | #error Wrong SDL_config.h, check your include path?
49 | #endif
50 |
51 | #endif /* _SDL_config_h */
52 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config_android.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_android_h
23 | #define _SDL_config_android_h
24 |
25 | #include "SDL_platform.h"
26 |
27 | /**
28 | * \file SDL_config_android.h
29 | *
30 | * This is a configuration that can be used to build SDL for Android
31 | */
32 |
33 | #include
34 |
35 | #define HAVE_GCC_ATOMICS 1
36 |
37 | #define HAVE_ALLOCA_H 1
38 | #define HAVE_SYS_TYPES_H 1
39 | #define HAVE_STDIO_H 1
40 | #define STDC_HEADERS 1
41 | #define HAVE_STRING_H 1
42 | #define HAVE_INTTYPES_H 1
43 | #define HAVE_STDINT_H 1
44 | #define HAVE_CTYPE_H 1
45 | #define HAVE_MATH_H 1
46 | #define HAVE_SIGNAL_H 1
47 |
48 | /* C library functions */
49 | #define HAVE_MALLOC 1
50 | #define HAVE_CALLOC 1
51 | #define HAVE_REALLOC 1
52 | #define HAVE_FREE 1
53 | #define HAVE_ALLOCA 1
54 | #define HAVE_GETENV 1
55 | #define HAVE_SETENV 1
56 | #define HAVE_PUTENV 1
57 | #define HAVE_SETENV 1
58 | #define HAVE_UNSETENV 1
59 | #define HAVE_QSORT 1
60 | #define HAVE_ABS 1
61 | #define HAVE_BCOPY 1
62 | #define HAVE_MEMSET 1
63 | #define HAVE_MEMCPY 1
64 | #define HAVE_MEMMOVE 1
65 | #define HAVE_MEMCMP 1
66 | #define HAVE_STRLEN 1
67 | #define HAVE_STRLCPY 1
68 | #define HAVE_STRLCAT 1
69 | #define HAVE_STRDUP 1
70 | #define HAVE_STRCHR 1
71 | #define HAVE_STRRCHR 1
72 | #define HAVE_STRSTR 1
73 | #define HAVE_STRTOL 1
74 | #define HAVE_STRTOUL 1
75 | #define HAVE_STRTOLL 1
76 | #define HAVE_STRTOULL 1
77 | #define HAVE_STRTOD 1
78 | #define HAVE_ATOI 1
79 | #define HAVE_ATOF 1
80 | #define HAVE_STRCMP 1
81 | #define HAVE_STRNCMP 1
82 | #define HAVE_STRCASECMP 1
83 | #define HAVE_STRNCASECMP 1
84 | #define HAVE_SSCANF 1
85 | #define HAVE_SNPRINTF 1
86 | #define HAVE_VSNPRINTF 1
87 | #define HAVE_M_PI 1
88 | #define HAVE_ATAN 1
89 | #define HAVE_ATAN2 1
90 | #define HAVE_CEIL 1
91 | #define HAVE_COPYSIGN 1
92 | #define HAVE_COS 1
93 | #define HAVE_COSF 1
94 | #define HAVE_FABS 1
95 | #define HAVE_FLOOR 1
96 | #define HAVE_LOG 1
97 | #define HAVE_POW 1
98 | #define HAVE_SCALBN 1
99 | #define HAVE_SIN 1
100 | #define HAVE_SINF 1
101 | #define HAVE_SQRT 1
102 | #define HAVE_SIGACTION 1
103 | #define HAVE_SETJMP 1
104 | #define HAVE_NANOSLEEP 1
105 | #define HAVE_SYSCONF 1
106 |
107 | #define SIZEOF_VOIDP 4
108 |
109 | /* Enable various audio drivers */
110 | #define SDL_AUDIO_DRIVER_ANDROID 1
111 | #define SDL_AUDIO_DRIVER_DUMMY 1
112 |
113 | /* Enable various input drivers */
114 | #define SDL_JOYSTICK_ANDROID 1
115 | #define SDL_HAPTIC_DUMMY 1
116 |
117 | /* Enable various shared object loading systems */
118 | #define SDL_LOADSO_DLOPEN 1
119 |
120 | /* Enable various threading systems */
121 | #define SDL_THREAD_PTHREAD 1
122 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
123 |
124 | /* Enable various timer systems */
125 | #define SDL_TIMER_UNIX 1
126 |
127 | /* Enable various video drivers */
128 | #define SDL_VIDEO_DRIVER_ANDROID 1
129 |
130 | /* Enable OpenGL ES */
131 | #define SDL_VIDEO_OPENGL_ES 1
132 | #define SDL_VIDEO_OPENGL_EGL 1
133 | #define SDL_VIDEO_RENDER_OGL_ES 1
134 | #define SDL_VIDEO_RENDER_OGL_ES2 1
135 |
136 | /* Enable system power support */
137 | #define SDL_POWER_ANDROID 1
138 |
139 | /* !!! FIXME: what does Android do for filesystem stuff? */
140 | #define SDL_FILESYSTEM_DUMMY 1
141 |
142 | #endif /* _SDL_config_android_h */
143 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config_minimal.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_minimal_h
23 | #define _SDL_config_minimal_h
24 |
25 | #include "SDL_platform.h"
26 |
27 | /**
28 | * \file SDL_config_minimal.h
29 | *
30 | * This is the minimal configuration that can be used to build SDL.
31 | */
32 |
33 | #define HAVE_STDARG_H 1
34 | #define HAVE_STDDEF_H 1
35 |
36 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */
37 | #if defined(_MSC_VER) && (_MSC_VER < 1600)
38 | /* Here are some reasonable defaults */
39 | typedef unsigned int size_t;
40 | typedef signed char int8_t;
41 | typedef unsigned char uint8_t;
42 | typedef signed short int16_t;
43 | typedef unsigned short uint16_t;
44 | typedef signed int int32_t;
45 | typedef unsigned int uint32_t;
46 | typedef signed long long int64_t;
47 | typedef unsigned long long uint64_t;
48 | typedef unsigned long uintptr_t;
49 | #else
50 | #define HAVE_STDINT_H 1
51 | #endif /* Visual Studio 2008 */
52 |
53 | #ifdef __GNUC__
54 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
55 | #endif
56 |
57 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */
58 | #define SDL_AUDIO_DRIVER_DUMMY 1
59 |
60 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
61 | #define SDL_JOYSTICK_DISABLED 1
62 |
63 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
64 | #define SDL_HAPTIC_DISABLED 1
65 |
66 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
67 | #define SDL_LOADSO_DISABLED 1
68 |
69 | /* Enable the stub thread support (src/thread/generic/\*.c) */
70 | #define SDL_THREADS_DISABLED 1
71 |
72 | /* Enable the stub timer support (src/timer/dummy/\*.c) */
73 | #define SDL_TIMERS_DISABLED 1
74 |
75 | /* Enable the dummy video driver (src/video/dummy/\*.c) */
76 | #define SDL_VIDEO_DRIVER_DUMMY 1
77 |
78 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
79 | #define SDL_FILESYSTEM_DUMMY 1
80 |
81 | #endif /* _SDL_config_minimal_h */
82 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config_pandora.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_h
23 | #define _SDL_config_h
24 |
25 | /* This is a set of defines to configure the SDL features */
26 |
27 | /* General platform specific identifiers */
28 | #include "SDL_platform.h"
29 |
30 | #ifdef __LP64__
31 | #define SIZEOF_VOIDP 8
32 | #else
33 | #define SIZEOF_VOIDP 4
34 | #endif
35 |
36 | #define SDL_BYTEORDER 1234
37 |
38 | #define HAVE_ALLOCA_H 1
39 | #define HAVE_SYS_TYPES_H 1
40 | #define HAVE_STDIO_H 1
41 | #define STDC_HEADERS 1
42 | #define HAVE_STDLIB_H 1
43 | #define HAVE_STDARG_H 1
44 | #define HAVE_MALLOC_H 1
45 | #define HAVE_MEMORY_H 1
46 | #define HAVE_STRING_H 1
47 | #define HAVE_STRINGS_H 1
48 | #define HAVE_INTTYPES_H 1
49 | #define HAVE_STDINT_H 1
50 | #define HAVE_CTYPE_H 1
51 | #define HAVE_MATH_H 1
52 | #define HAVE_ICONV_H 1
53 | #define HAVE_SIGNAL_H 1
54 | #define HAVE_MALLOC 1
55 | #define HAVE_CALLOC 1
56 | #define HAVE_REALLOC 1
57 | #define HAVE_FREE 1
58 | #define HAVE_ALLOCA 1
59 | #define HAVE_GETENV 1
60 | #define HAVE_SETENV 1
61 | #define HAVE_PUTENV 1
62 | #define HAVE_UNSETENV 1
63 | #define HAVE_QSORT 1
64 | #define HAVE_ABS 1
65 | #define HAVE_BCOPY 1
66 | #define HAVE_MEMSET 1
67 | #define HAVE_MEMCPY 1
68 | #define HAVE_MEMMOVE 1
69 | #define HAVE_STRLEN 1
70 | #define HAVE_STRDUP 1
71 | #define HAVE_STRCHR 1
72 | #define HAVE_STRRCHR 1
73 | #define HAVE_STRSTR 1
74 | #define HAVE_STRTOL 1
75 | #define HAVE_STRTOUL 1
76 | #define HAVE_STRTOLL 1
77 | #define HAVE_STRTOULL 1
78 | #define HAVE_ATOI 1
79 | #define HAVE_ATOF 1
80 | #define HAVE_STRCMP 1
81 | #define HAVE_STRNCMP 1
82 | #define HAVE_STRCASECMP 1
83 | #define HAVE_STRNCASECMP 1
84 | #define HAVE_SSCANF 1
85 | #define HAVE_SNPRINTF 1
86 | #define HAVE_VSNPRINTF 1
87 | #define HAVE_M_PI 1
88 | #define HAVE_CEIL 1
89 | #define HAVE_COPYSIGN 1
90 | #define HAVE_COS 1
91 | #define HAVE_COSF 1
92 | #define HAVE_FABS 1
93 | #define HAVE_FLOOR 1
94 | #define HAVE_LOG 1
95 | #define HAVE_SCALBN 1
96 | #define HAVE_SIN 1
97 | #define HAVE_SINF 1
98 | #define HAVE_SQRT 1
99 | #define HAVE_SIGACTION 1
100 | #define HAVE_SETJMP 1
101 | #define HAVE_NANOSLEEP 1
102 |
103 | #define SDL_AUDIO_DRIVER_DUMMY 1
104 | #define SDL_AUDIO_DRIVER_OSS 1
105 |
106 | #define SDL_INPUT_LINUXEV 1
107 | #define SDL_INPUT_TSLIB 1
108 | #define SDL_JOYSTICK_LINUX 1
109 | #define SDL_HAPTIC_LINUX 1
110 |
111 | #define SDL_LOADSO_DLOPEN 1
112 |
113 | #define SDL_THREAD_PTHREAD 1
114 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
115 |
116 | #define SDL_TIMER_UNIX 1
117 | #define SDL_FILESYSTEM_UNIX 1
118 |
119 | #define SDL_VIDEO_DRIVER_DUMMY 1
120 | #define SDL_VIDEO_DRIVER_X11 1
121 | #define SDL_VIDEO_DRIVER_PANDORA 1
122 | #define SDL_VIDEO_RENDER_OGL_ES 1
123 | #define SDL_VIDEO_OPENGL_ES 1
124 |
125 | #endif /* _SDL_config_h */
126 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config_psp.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_psp_h
23 | #define _SDL_config_psp_h
24 |
25 | #include "SDL_platform.h"
26 |
27 |
28 |
29 | #ifdef __GNUC__
30 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
31 | #endif
32 |
33 | #define HAVE_GCC_ATOMICS 1
34 |
35 | #define HAVE_ALLOCA_H 1
36 | #define HAVE_SYS_TYPES_H 1
37 | #define HAVE_STDIO_H 1
38 | #define STDC_HEADERS 1
39 | #define HAVE_STRING_H 1
40 | #define HAVE_INTTYPES_H 1
41 | #define HAVE_STDINT_H 1
42 | #define HAVE_CTYPE_H 1
43 | #define HAVE_MATH_H 1
44 | #define HAVE_SIGNAL_H 1
45 |
46 | /* C library functions */
47 | #define HAVE_MALLOC 1
48 | #define HAVE_CALLOC 1
49 | #define HAVE_REALLOC 1
50 | #define HAVE_FREE 1
51 | #define HAVE_ALLOCA 1
52 | #define HAVE_GETENV 1
53 | #define HAVE_SETENV 1
54 | #define HAVE_PUTENV 1
55 | #define HAVE_SETENV 1
56 | #define HAVE_UNSETENV 1
57 | #define HAVE_QSORT 1
58 | #define HAVE_ABS 1
59 | #define HAVE_BCOPY 1
60 | #define HAVE_MEMSET 1
61 | #define HAVE_MEMCPY 1
62 | #define HAVE_MEMMOVE 1
63 | #define HAVE_MEMCMP 1
64 | #define HAVE_STRLEN 1
65 | #define HAVE_STRLCPY 1
66 | #define HAVE_STRLCAT 1
67 | #define HAVE_STRDUP 1
68 | #define HAVE_STRCHR 1
69 | #define HAVE_STRRCHR 1
70 | #define HAVE_STRSTR 1
71 | #define HAVE_STRTOL 1
72 | #define HAVE_STRTOUL 1
73 | #define HAVE_STRTOLL 1
74 | #define HAVE_STRTOULL 1
75 | #define HAVE_STRTOD 1
76 | #define HAVE_ATOI 1
77 | #define HAVE_ATOF 1
78 | #define HAVE_STRCMP 1
79 | #define HAVE_STRNCMP 1
80 | #define HAVE_STRCASECMP 1
81 | #define HAVE_STRNCASECMP 1
82 | #define HAVE_SSCANF 1
83 | #define HAVE_SNPRINTF 1
84 | #define HAVE_VSNPRINTF 1
85 | #define HAVE_M_PI 1
86 | #define HAVE_ATAN 1
87 | #define HAVE_ATAN2 1
88 | #define HAVE_CEIL 1
89 | #define HAVE_COPYSIGN 1
90 | #define HAVE_COS 1
91 | #define HAVE_COSF 1
92 | #define HAVE_FABS 1
93 | #define HAVE_FLOOR 1
94 | #define HAVE_LOG 1
95 | #define HAVE_POW 1
96 | #define HAVE_SCALBN 1
97 | #define HAVE_SIN 1
98 | #define HAVE_SINF 1
99 | #define HAVE_SQRT 1
100 | #define HAVE_SETJMP 1
101 | #define HAVE_NANOSLEEP 1
102 | /* #define HAVE_SYSCONF 1 */
103 | /* #define HAVE_SIGACTION 1 */
104 |
105 |
106 | /* PSP isn't that sophisticated */
107 | #define LACKS_SYS_MMAN_H 1
108 |
109 | /* Enable the stub thread support (src/thread/psp/\*.c) */
110 | #define SDL_THREAD_PSP 1
111 |
112 | /* Enable the stub timer support (src/timer/psp/\*.c) */
113 | #define SDL_TIMERS_PSP 1
114 |
115 | /* Enable the stub joystick driver (src/joystick/psp/\*.c) */
116 | #define SDL_JOYSTICK_PSP 1
117 |
118 | /* Enable the stub audio driver (src/audio/psp/\*.c) */
119 | #define SDL_AUDIO_DRIVER_PSP 1
120 |
121 | /* PSP video dirver */
122 | #define SDL_VIDEO_DRIVER_PSP 1
123 |
124 | /* PSP render dirver */
125 | #define SDL_VIDEO_RENDER_PSP 1
126 |
127 | #define SDL_POWER_PSP 1
128 |
129 | /* !!! FIXME: what does PSP do for filesystem stuff? */
130 | #define SDL_FILESYSTEM_DUMMY 1
131 |
132 | /* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */
133 | #define SDL_HAPTIC_DISABLED 1
134 |
135 | /* PSP can't load shared object (src/loadso/dummy/\*.c) */
136 | #define SDL_LOADSO_DISABLED 1
137 |
138 |
139 | #endif /* _SDL_config_psp_h */
140 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_config_wiz.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_config_h
23 | #define _SDL_config_h
24 |
25 | /* This is a set of defines to configure the SDL features */
26 |
27 | /* General platform specific identifiers */
28 | #include "SDL_platform.h"
29 |
30 | #define SDL_BYTEORDER 1234
31 |
32 | #define HAVE_ALLOCA_H 1
33 | #define HAVE_SYS_TYPES_H 1
34 | #define HAVE_STDIO_H 1
35 | #define STDC_HEADERS 1
36 | #define HAVE_STDLIB_H 1
37 | #define HAVE_STDARG_H 1
38 | #define HAVE_MALLOC_H 1
39 | #define HAVE_MEMORY_H 1
40 | #define HAVE_STRING_H 1
41 | #define HAVE_STRINGS_H 1
42 | #define HAVE_INTTYPES_H 1
43 | #define HAVE_STDINT_H 1
44 | #define HAVE_CTYPE_H 1
45 | #define HAVE_MATH_H 1
46 | #define HAVE_ICONV_H 1
47 | #define HAVE_SIGNAL_H 1
48 | #define HAVE_MALLOC 1
49 | #define HAVE_CALLOC 1
50 | #define HAVE_REALLOC 1
51 | #define HAVE_FREE 1
52 | #define HAVE_ALLOCA 1
53 | #define HAVE_GETENV 1
54 | #define HAVE_SETENV 1
55 | #define HAVE_PUTENV 1
56 | #define HAVE_UNSETENV 1
57 | #define HAVE_QSORT 1
58 | #define HAVE_ABS 1
59 | #define HAVE_BCOPY 1
60 | #define HAVE_MEMSET 1
61 | #define HAVE_MEMCPY 1
62 | #define HAVE_MEMMOVE 1
63 | #define HAVE_STRLEN 1
64 | #define HAVE_STRDUP 1
65 | #define HAVE_STRCHR 1
66 | #define HAVE_STRRCHR 1
67 | #define HAVE_STRSTR 1
68 | #define HAVE_STRTOL 1
69 | #define HAVE_STRTOUL 1
70 | #define HAVE_STRTOLL 1
71 | #define HAVE_STRTOULL 1
72 | #define HAVE_ATOI 1
73 | #define HAVE_ATOF 1
74 | #define HAVE_STRCMP 1
75 | #define HAVE_STRNCMP 1
76 | #define HAVE_STRCASECMP 1
77 | #define HAVE_STRNCASECMP 1
78 | #define HAVE_SSCANF 1
79 | #define HAVE_SNPRINTF 1
80 | #define HAVE_VSNPRINTF 1
81 | #define HAVE_M_PI 1
82 | #define HAVE_CEIL 1
83 | #define HAVE_COPYSIGN 1
84 | #define HAVE_COS 1
85 | #define HAVE_COSF 1
86 | #define HAVE_FABS 1
87 | #define HAVE_FLOOR 1
88 | #define HAVE_LOG 1
89 | #define HAVE_SCALBN 1
90 | #define HAVE_SIN 1
91 | #define HAVE_SINF 1
92 | #define HAVE_SQRT 1
93 | #define HAVE_SIGACTION 1
94 | #define HAVE_SETJMP 1
95 | #define HAVE_NANOSLEEP 1
96 | #define HAVE_POW 1
97 |
98 | #define SDL_CDROM_DISABLED 1
99 | #define SDL_AUDIO_DRIVER_DUMMY 1
100 | #define SDL_AUDIO_DRIVER_OSS 1
101 |
102 | #define SDL_INPUT_LINUXEV 1
103 | #define SDL_INPUT_TSLIB 1
104 | #define SDL_JOYSTICK_LINUX 1
105 | #define SDL_HAPTIC_LINUX 1
106 |
107 | #define SDL_LOADSO_DLOPEN 1
108 |
109 | #define SDL_THREAD_PTHREAD 1
110 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
111 |
112 | #define SDL_TIMER_UNIX 1
113 |
114 | #define SDL_VIDEO_DRIVER_DUMMY 1
115 | #define SDL_VIDEO_DRIVER_PANDORA 1
116 | #define SDL_VIDEO_RENDER_OGL_ES 1
117 | #define SDL_VIDEO_OPENGL_ES 1
118 |
119 | #endif /* _SDL_config_h */
120 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_copying.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_error.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_error.h
24 | *
25 | * Simple error message routines for SDL.
26 | */
27 |
28 | #ifndef _SDL_error_h
29 | #define _SDL_error_h
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Public functions */
40 | /* SDL_SetError() unconditionally returns -1. */
41 | extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...);
42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void);
43 | extern DECLSPEC void SDLCALL SDL_ClearError(void);
44 |
45 | /**
46 | * \name Internal error functions
47 | *
48 | * \internal
49 | * Private error reporting function - used internally.
50 | */
51 | /* @{ */
52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
55 | typedef enum
56 | {
57 | SDL_ENOMEM,
58 | SDL_EFREAD,
59 | SDL_EFWRITE,
60 | SDL_EFSEEK,
61 | SDL_UNSUPPORTED,
62 | SDL_LASTERROR
63 | } SDL_errorcode;
64 | /* SDL_Error() unconditionally returns -1. */
65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
66 | /* @} *//* Internal error functions */
67 |
68 | /* Ends C function definitions when using C++ */
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 | #include "close_code.h"
73 |
74 | #endif /* _SDL_error_h */
75 |
76 | /* vi: set ts=4 sw=4 expandtab: */
77 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_gesture.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_gesture.h
24 | *
25 | * Include file for SDL gesture event handling.
26 | */
27 |
28 | #ifndef _SDL_gesture_h
29 | #define _SDL_gesture_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "SDL_touch.h"
36 |
37 |
38 | #include "begin_code.h"
39 | /* Set up for C function definitions, even when using C++ */
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | typedef Sint64 SDL_GestureID;
45 |
46 | /* Function prototypes */
47 |
48 | /**
49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1)
50 | *
51 | *
52 | */
53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId);
54 |
55 |
56 | /**
57 | * \brief Save all currently loaded Dollar Gesture templates
58 | *
59 | *
60 | */
61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src);
62 |
63 | /**
64 | * \brief Save a currently loaded Dollar Gesture template
65 | *
66 | *
67 | */
68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src);
69 |
70 |
71 | /**
72 | * \brief Load Dollar Gesture templates from a file
73 | *
74 | *
75 | */
76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src);
77 |
78 |
79 | /* Ends C function definitions when using C++ */
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 | #include "close_code.h"
84 |
85 | #endif /* _SDL_gesture_h */
86 |
87 | /* vi: set ts=4 sw=4 expandtab: */
88 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_loadso.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_loadso.h
24 | *
25 | * System dependent library loading routines
26 | *
27 | * Some things to keep in mind:
28 | * \li These functions only work on C function names. Other languages may
29 | * have name mangling and intrinsic language support that varies from
30 | * compiler to compiler.
31 | * \li Make sure you declare your function pointers with the same calling
32 | * convention as the actual library function. Your code will crash
33 | * mysteriously if you do not do this.
34 | * \li Avoid namespace collisions. If you load a symbol from the library,
35 | * it is not defined whether or not it goes into the global symbol
36 | * namespace for the application. If it does and it conflicts with
37 | * symbols in your code or other shared libraries, you will not get
38 | * the results you expect. :)
39 | */
40 |
41 | #ifndef _SDL_loadso_h
42 | #define _SDL_loadso_h
43 |
44 | #include "SDL_stdinc.h"
45 | #include "SDL_error.h"
46 |
47 | #include "begin_code.h"
48 | /* Set up for C function definitions, even when using C++ */
49 | #ifdef __cplusplus
50 | extern "C" {
51 | #endif
52 |
53 | /**
54 | * This function dynamically loads a shared object and returns a pointer
55 | * to the object handle (or NULL if there was an error).
56 | * The 'sofile' parameter is a system dependent name of the object file.
57 | */
58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
59 |
60 | /**
61 | * Given an object handle, this function looks up the address of the
62 | * named function in the shared object and returns it. This address
63 | * is no longer valid after calling SDL_UnloadObject().
64 | */
65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
66 | const char *name);
67 |
68 | /**
69 | * Unload a shared object from memory.
70 | */
71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
72 |
73 | /* Ends C function definitions when using C++ */
74 | #ifdef __cplusplus
75 | }
76 | #endif
77 | #include "close_code.h"
78 |
79 | #endif /* _SDL_loadso_h */
80 |
81 | /* vi: set ts=4 sw=4 expandtab: */
82 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_main.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_main_h
23 | #define _SDL_main_h
24 |
25 | #include "SDL_stdinc.h"
26 |
27 | /**
28 | * \file SDL_main.h
29 | *
30 | * Redefine main() on some platforms so that it is called by SDL.
31 | */
32 |
33 | #ifndef SDL_MAIN_HANDLED
34 | #if defined(__WIN32__)
35 | /* On Windows SDL provides WinMain(), which parses the command line and passes
36 | the arguments to your main function.
37 |
38 | If you provide your own WinMain(), you may define SDL_MAIN_HANDLED
39 | */
40 | #define SDL_MAIN_AVAILABLE
41 |
42 | #elif defined(__IPHONEOS__)
43 | /* On iOS SDL provides a main function that creates an application delegate
44 | and starts the iOS application run loop.
45 |
46 | See src/video/uikit/SDL_uikitappdelegate.m for more details.
47 | */
48 | #define SDL_MAIN_NEEDED
49 |
50 | #elif defined(__ANDROID__)
51 | /* On Android SDL provides a Java class in SDLActivity.java that is the
52 | main activity entry point.
53 |
54 | See README-android.txt for more details on extending that class.
55 | */
56 | #define SDL_MAIN_NEEDED
57 |
58 | #endif
59 | #endif /* SDL_MAIN_HANDLED */
60 |
61 | #ifdef __cplusplus
62 | #define C_LINKAGE "C"
63 | #else
64 | #define C_LINKAGE
65 | #endif /* __cplusplus */
66 |
67 | /**
68 | * \file SDL_main.h
69 | *
70 | * The application's main() function must be called with C linkage,
71 | * and should be declared like this:
72 | * \code
73 | * #ifdef __cplusplus
74 | * extern "C"
75 | * #endif
76 | * int main(int argc, char *argv[])
77 | * {
78 | * }
79 | * \endcode
80 | */
81 |
82 | #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
83 | #define main SDL_main
84 | #endif
85 |
86 | /**
87 | * The prototype for the application's main() function
88 | */
89 | extern C_LINKAGE int SDL_main(int argc, char *argv[]);
90 |
91 |
92 | #include "begin_code.h"
93 | #ifdef __cplusplus
94 | extern "C" {
95 | #endif
96 |
97 | /**
98 | * This is called by the real SDL main function to let the rest of the
99 | * library know that initialization was done properly.
100 | *
101 | * Calling this yourself without knowing what you're doing can cause
102 | * crashes and hard to diagnose problems with your application.
103 | */
104 | extern DECLSPEC void SDL_SetMainReady(void);
105 |
106 | #ifdef __WIN32__
107 |
108 | /**
109 | * This can be called to set the application class at startup
110 | */
111 | extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
112 | void *hInst);
113 | extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
114 |
115 | #endif /* __WIN32__ */
116 |
117 |
118 | #ifdef __cplusplus
119 | }
120 | #endif
121 | #include "close_code.h"
122 |
123 | #endif /* _SDL_main_h */
124 |
125 | /* vi: set ts=4 sw=4 expandtab: */
126 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_name.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef _SDLname_h_
3 | #define _SDLname_h_
4 |
5 | #if defined(__STDC__) || defined(__cplusplus)
6 | #define NeedFunctionPrototypes 1
7 | #endif
8 |
9 | #define SDL_NAME(X) SDL_##X
10 |
11 | #endif /* _SDLname_h_ */
12 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_opengles.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers.
26 | */
27 |
28 | #ifdef __IPHONEOS__
29 | #include
30 | #include
31 | #else
32 | #include
33 | #include
34 | #endif
35 |
36 | #ifndef APIENTRY
37 | #define APIENTRY
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_opengles2.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_opengles.h
24 | *
25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers.
26 | */
27 |
28 | #ifdef __IPHONEOS__
29 | #include
30 | #include
31 | #else
32 | #include
33 | #include
34 | #endif
35 |
36 | #ifndef APIENTRY
37 | #define APIENTRY
38 | #endif
39 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_power.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_power_h
23 | #define _SDL_power_h
24 |
25 | /**
26 | * \file SDL_power.h
27 | *
28 | * Header for the SDL power management routines.
29 | */
30 |
31 | #include "SDL_stdinc.h"
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /**
40 | * \brief The basic state for the system's power supply.
41 | */
42 | typedef enum
43 | {
44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */
45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */
48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
49 | } SDL_PowerState;
50 |
51 |
52 | /**
53 | * \brief Get the current power supply details.
54 | *
55 | * \param secs Seconds of battery life left. You can pass a NULL here if
56 | * you don't care. Will return -1 if we can't determine a
57 | * value, or we're not running on a battery.
58 | *
59 | * \param pct Percentage of battery life left, between 0 and 100. You can
60 | * pass a NULL here if you don't care. Will return -1 if we
61 | * can't determine a value, or we're not running on a battery.
62 | *
63 | * \return The state of the battery (if any).
64 | */
65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
66 |
67 | /* Ends C function definitions when using C++ */
68 | #ifdef __cplusplus
69 | }
70 | #endif
71 | #include "close_code.h"
72 |
73 | #endif /* _SDL_power_h */
74 |
75 | /* vi: set ts=4 sw=4 expandtab: */
76 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_quit.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_quit.h
24 | *
25 | * Include file for SDL quit event handling.
26 | */
27 |
28 | #ifndef _SDL_quit_h
29 | #define _SDL_quit_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | /**
35 | * \file SDL_quit.h
36 | *
37 | * An ::SDL_QUIT event is generated when the user tries to close the application
38 | * window. If it is ignored or filtered out, the window will remain open.
39 | * If it is not ignored or filtered, it is queued normally and the window
40 | * is allowed to close. When the window is closed, screen updates will
41 | * complete, but have no effect.
42 | *
43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
44 | * and SIGTERM (system termination request), if handlers do not already
45 | * exist, that generate ::SDL_QUIT events as well. There is no way
46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal
47 | * handler in your application will override the default generation of
48 | * quit events for that signal.
49 | *
50 | * \sa SDL_Quit()
51 | */
52 |
53 | /* There are no functions directly affecting the quit event */
54 |
55 | #define SDL_QuitRequested() \
56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0))
57 |
58 | #endif /* _SDL_quit_h */
59 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_revision.h:
--------------------------------------------------------------------------------
1 | #define SDL_REVISION "hg-7890:c031abe0b287"
2 | #define SDL_REVISION_NUMBER 7890
3 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef _SDL_test_h
31 | #define _SDL_test_h
32 |
33 | #include "SDL.h"
34 | #include "SDL_test_common.h"
35 | #include "SDL_test_font.h"
36 | #include "SDL_test_random.h"
37 | #include "SDL_test_fuzzer.h"
38 | #include "SDL_test_crc32.h"
39 | #include "SDL_test_md5.h"
40 | #include "SDL_test_log.h"
41 | #include "SDL_test_assert.h"
42 | #include "SDL_test_harness.h"
43 | #include "SDL_test_images.h"
44 | #include "SDL_test_compare.h"
45 |
46 | #include "begin_code.h"
47 | /* Set up for C function definitions, even when using C++ */
48 | #ifdef __cplusplus
49 | extern "C" {
50 | #endif
51 |
52 | /* Global definitions */
53 |
54 | /*
55 | * Note: Maximum size of SDLTest log message is less than SDLs limit
56 | * to ensure we can fit additional information such as the timestamp.
57 | */
58 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584
59 |
60 | /* Ends C function definitions when using C++ */
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 | #include "close_code.h"
65 |
66 | #endif /* _SDL_test_h */
67 |
68 | /* vi: set ts=4 sw=4 expandtab: */
69 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_assert.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Assert API for test code and test cases
33 | *
34 | */
35 |
36 | #ifndef _SDL_test_assert_h
37 | #define _SDL_test_assert_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Fails the assert.
47 | */
48 | #define ASSERT_FAIL 0
49 |
50 | /**
51 | * \brief Passes the assert.
52 | */
53 | #define ASSERT_PASS 1
54 |
55 | /**
56 | * \brief Assert that logs and break execution flow on failures.
57 | *
58 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
59 | * \param assertDescription Message to log with the assert describing it.
60 | */
61 | void SDLTest_Assert(int assertCondition, const char *assertDescription, ...);
62 |
63 | /**
64 | * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
65 | *
66 | * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
67 | * \param assertDescription Message to log with the assert describing it.
68 | *
69 | * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
70 | */
71 | int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...);
72 |
73 | /**
74 | * \brief Explicitely pass without checking an assertion condition. Updates assertion counter.
75 | *
76 | * \param assertDescription Message to log with the assert describing it.
77 | */
78 | void SDLTest_AssertPass(const char *assertDescription, ...);
79 |
80 | /**
81 | * \brief Resets the assert summary counters to zero.
82 | */
83 | void SDLTest_ResetAssertSummary();
84 |
85 | /**
86 | * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
87 | */
88 | void SDLTest_LogAssertSummary();
89 |
90 |
91 | /**
92 | * \brief Converts the current assert summary state to a test result.
93 | *
94 | * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
95 | */
96 | int SDLTest_AssertSummaryToTestResult();
97 |
98 | #ifdef __cplusplus
99 | }
100 | #endif
101 | #include "close_code.h"
102 |
103 | #endif /* _SDL_test_assert_h */
104 |
105 | /* vi: set ts=4 sw=4 expandtab: */
106 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_compare.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_compare.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines comparison functions (i.e. for surfaces).
33 |
34 | */
35 |
36 | #ifndef _SDL_test_compare_h
37 | #define _SDL_test_compare_h
38 |
39 | #include "SDL.h"
40 |
41 | #include "SDL_test_images.h"
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /**
50 | * \brief Compares a surface and with reference image data for equality
51 | *
52 | * \param surface Surface used in comparison
53 | * \param referenceSurface Test Surface used in comparison
54 | * \param allowable_error Allowable difference (squared) in blending accuracy.
55 | *
56 | * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
57 | */
58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
59 |
60 |
61 | /* Ends C function definitions when using C++ */
62 | #ifdef __cplusplus
63 | }
64 | #endif
65 | #include "close_code.h"
66 |
67 | #endif /* _SDL_test_compare_h */
68 |
69 | /* vi: set ts=4 sw=4 expandtab: */
70 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_crc32.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_crc32.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Implements CRC32 calculations (default output is Perl String::CRC32 compatible).
33 |
34 | */
35 |
36 | #ifndef _SDL_test_crc32_h
37 | #define _SDL_test_crc32_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 |
46 | /* ------------ Definitions --------- */
47 |
48 | /* Definition shared by all CRC routines */
49 |
50 | #ifndef CrcUint32
51 | #define CrcUint32 unsigned int
52 | #endif
53 | #ifndef CrcUint8
54 | #define CrcUint8 unsigned char
55 | #endif
56 |
57 | #ifdef ORIGINAL_METHOD
58 | #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */
59 | #else
60 | #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */
61 | #endif
62 |
63 | /**
64 | * Data structure for CRC32 (checksum) computation
65 | */
66 | typedef struct {
67 | CrcUint32 crc32_table[256]; /* CRC table */
68 | } SDLTest_Crc32Context;
69 |
70 | /* ---------- Function Prototypes ------------- */
71 |
72 | /**
73 | * /brief Initialize the CRC context
74 | *
75 | * Note: The function initializes the crc table required for all crc calculations.
76 | *
77 | * /param crcContext pointer to context variable
78 | *
79 | * /returns 0 for OK, -1 on error
80 | *
81 | */
82 | int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext);
83 |
84 |
85 | /**
86 | * /brief calculate a crc32 from a data block
87 | *
88 | * /param crcContext pointer to context variable
89 | * /param inBuf input buffer to checksum
90 | * /param inLen length of input buffer
91 | * /param crc32 pointer to Uint32 to store the final CRC into
92 | *
93 | * /returns 0 for OK, -1 on error
94 | *
95 | */
96 | int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
97 |
98 | /* Same routine broken down into three steps */
99 | int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
100 | int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32);
101 | int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
102 |
103 |
104 | /**
105 | * /brief clean up CRC context
106 | *
107 | * /param crcContext pointer to context variable
108 | *
109 | * /returns 0 for OK, -1 on error
110 | *
111 | */
112 |
113 | int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext);
114 |
115 |
116 | /* Ends C function definitions when using C++ */
117 | #ifdef __cplusplus
118 | }
119 | #endif
120 | #include "close_code.h"
121 |
122 | #endif /* _SDL_test_crc32_h */
123 |
124 | /* vi: set ts=4 sw=4 expandtab: */
125 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_font.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_font.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | #ifndef _SDL_test_font_h
31 | #define _SDL_test_font_h
32 |
33 | #include "begin_code.h"
34 | /* Set up for C function definitions, even when using C++ */
35 | #ifdef __cplusplus
36 | extern "C" {
37 | #endif
38 |
39 | /* Function prototypes */
40 |
41 | /**
42 | * \brief Draw a string in the currently set font.
43 | *
44 | * \param renderer The renderer to draw on.
45 | * \param x The X coordinate of the upper left corner of the string.
46 | * \param y The Y coordinate of the upper left corner of the string.
47 | * \param s The string to draw.
48 | *
49 | * \returns Returns 0 on success, -1 on failure.
50 | */
51 | int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s);
52 |
53 |
54 | /* Ends C function definitions when using C++ */
55 | #ifdef __cplusplus
56 | }
57 | #endif
58 | #include "close_code.h"
59 |
60 | #endif /* _SDL_test_font_h */
61 |
62 | /* vi: set ts=4 sw=4 expandtab: */
63 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_images.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_images.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | Defines some images for tests.
33 |
34 | */
35 |
36 | #ifndef _SDL_test_images_h
37 | #define _SDL_test_images_h
38 |
39 | #include "SDL.h"
40 |
41 | #include "begin_code.h"
42 | /* Set up for C function definitions, even when using C++ */
43 | #ifdef __cplusplus
44 | extern "C" {
45 | #endif
46 |
47 | /**
48 | *Type for test images.
49 | */
50 | typedef struct SDLTest_SurfaceImage_s {
51 | int width;
52 | int height;
53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
54 | const char *pixel_data;
55 | } SDLTest_SurfaceImage_t;
56 |
57 | /* Test images */
58 | SDL_Surface *SDLTest_ImageBlit();
59 | SDL_Surface *SDLTest_ImageBlitColor();
60 | SDL_Surface *SDLTest_ImageBlitAlpha();
61 | SDL_Surface *SDLTest_ImageBlitBlendAdd();
62 | SDL_Surface *SDLTest_ImageBlitBlend();
63 | SDL_Surface *SDLTest_ImageBlitBlendMod();
64 | SDL_Surface *SDLTest_ImageBlitBlendNone();
65 | SDL_Surface *SDLTest_ImageBlitBlendAll();
66 | SDL_Surface *SDLTest_ImageFace();
67 | SDL_Surface *SDLTest_ImagePrimitives();
68 | SDL_Surface *SDLTest_ImagePrimitivesBlend();
69 |
70 | /* Ends C function definitions when using C++ */
71 | #ifdef __cplusplus
72 | }
73 | #endif
74 | #include "close_code.h"
75 |
76 | #endif /* _SDL_test_images_h */
77 |
78 | /* vi: set ts=4 sw=4 expandtab: */
79 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_log.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_log.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 | *
32 | * Wrapper to log in the TEST category
33 | *
34 | */
35 |
36 | #ifndef _SDL_test_log_h
37 | #define _SDL_test_log_h
38 |
39 | #include "begin_code.h"
40 | /* Set up for C function definitions, even when using C++ */
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /**
46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority.
47 | *
48 | * \param fmt Message to be logged
49 | */
50 | void SDLTest_Log(const char *fmt, ...);
51 |
52 | /**
53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
54 | *
55 | * \param fmt Message to be logged
56 | */
57 | void SDLTest_LogError(const char *fmt, ...);
58 |
59 | /* Ends C function definitions when using C++ */
60 | #ifdef __cplusplus
61 | }
62 | #endif
63 | #include "close_code.h"
64 |
65 | #endif /* _SDL_test_log_h */
66 |
67 | /* vi: set ts=4 sw=4 expandtab: */
68 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_test_random.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_test_random.h
24 | *
25 | * Include file for SDL test framework.
26 | *
27 | * This code is a part of the SDL2_test library, not the main SDL library.
28 | */
29 |
30 | /*
31 |
32 | A "32-bit Multiply with carry random number generator. Very fast.
33 | Includes a list of recommended multipliers.
34 |
35 | multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32.
36 | period: (a*2^31)-1
37 |
38 | */
39 |
40 | #ifndef _SDL_test_random_h
41 | #define _SDL_test_random_h
42 |
43 | #include "begin_code.h"
44 | /* Set up for C function definitions, even when using C++ */
45 | #ifdef __cplusplus
46 | extern "C" {
47 | #endif
48 |
49 | /* --- Definitions */
50 |
51 | /*
52 | * Macros that return a random number in a specific format.
53 | */
54 | #define SDLTest_RandomInt(c) ((int)SDLTest_Random(c))
55 |
56 | /*
57 | * Context structure for the random number generator state.
58 | */
59 | typedef struct {
60 | unsigned int a;
61 | unsigned int x;
62 | unsigned int c;
63 | unsigned int ah;
64 | unsigned int al;
65 | } SDLTest_RandomContext;
66 |
67 |
68 | /* --- Function prototypes */
69 |
70 | /**
71 | * \brief Initialize random number generator with two integers.
72 | *
73 | * Note: The random sequence of numbers returned by ...Random() is the
74 | * same for the same two integers and has a period of 2^31.
75 | *
76 | * \param rndContext pointer to context structure
77 | * \param xi integer that defines the random sequence
78 | * \param ci integer that defines the random sequence
79 | *
80 | */
81 | void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
82 | unsigned int ci);
83 |
84 | /**
85 | * \brief Initialize random number generator based on current system time.
86 | *
87 | * \param rndContext pointer to context structure
88 | *
89 | */
90 | void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
91 |
92 |
93 | /**
94 | * \brief Initialize random number generator based on current system time.
95 | *
96 | * Note: ...RandomInit() or ...RandomInitTime() must have been called
97 | * before using this function.
98 | *
99 | * \param rndContext pointer to context structure
100 | *
101 | * \returns A random number (32bit unsigned integer)
102 | *
103 | */
104 | unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);
105 |
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* _SDL_test_random_h */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_timer.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | #ifndef _SDL_timer_h
23 | #define _SDL_timer_h
24 |
25 | /**
26 | * \file SDL_timer.h
27 | *
28 | * Header for the SDL time management routines.
29 | */
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 |
34 | #include "begin_code.h"
35 | /* Set up for C function definitions, even when using C++ */
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | /**
41 | * \brief Get the number of milliseconds since the SDL library initialization.
42 | *
43 | * \note This value wraps if the program runs for more than ~49 days.
44 | */
45 | extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
46 |
47 | /**
48 | * \brief Compare SDL ticks values, and return true if A has passed B
49 | *
50 | * e.g. if you want to wait 100 ms, you could do this:
51 | * Uint32 timeout = SDL_GetTicks() + 100;
52 | * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
53 | * ... do work until timeout has elapsed
54 | * }
55 | */
56 | #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
57 |
58 | /**
59 | * \brief Get the current value of the high resolution counter
60 | */
61 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
62 |
63 | /**
64 | * \brief Get the count per second of the high resolution counter
65 | */
66 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
67 |
68 | /**
69 | * \brief Wait a specified number of milliseconds before returning.
70 | */
71 | extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
72 |
73 | /**
74 | * Function prototype for the timer callback function.
75 | *
76 | * The callback function is passed the current timer interval and returns
77 | * the next timer interval. If the returned value is the same as the one
78 | * passed in, the periodic alarm continues, otherwise a new alarm is
79 | * scheduled. If the callback returns 0, the periodic alarm is cancelled.
80 | */
81 | typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
82 |
83 | /**
84 | * Definition of the timer ID type.
85 | */
86 | typedef int SDL_TimerID;
87 |
88 | /**
89 | * \brief Add a new timer to the pool of timers already running.
90 | *
91 | * \return A timer ID, or NULL when an error occurs.
92 | */
93 | extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
94 | SDL_TimerCallback callback,
95 | void *param);
96 |
97 | /**
98 | * \brief Remove a timer knowing its ID.
99 | *
100 | * \return A boolean value indicating success or failure.
101 | *
102 | * \warning It is not safe to remove a timer multiple times.
103 | */
104 | extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
105 |
106 |
107 | /* Ends C function definitions when using C++ */
108 | #ifdef __cplusplus
109 | }
110 | #endif
111 | #include "close_code.h"
112 |
113 | #endif /* _SDL_timer_h */
114 |
115 | /* vi: set ts=4 sw=4 expandtab: */
116 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_touch.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_touch.h
24 | *
25 | * Include file for SDL touch event handling.
26 | */
27 |
28 | #ifndef _SDL_touch_h
29 | #define _SDL_touch_h
30 |
31 | #include "SDL_stdinc.h"
32 | #include "SDL_error.h"
33 | #include "SDL_video.h"
34 |
35 | #include "begin_code.h"
36 | /* Set up for C function definitions, even when using C++ */
37 | #ifdef __cplusplus
38 | extern "C" {
39 | #endif
40 |
41 | typedef Sint64 SDL_TouchID;
42 | typedef Sint64 SDL_FingerID;
43 |
44 | typedef struct SDL_Finger
45 | {
46 | SDL_FingerID id;
47 | float x;
48 | float y;
49 | float pressure;
50 | } SDL_Finger;
51 |
52 | /* Used as the device ID for mouse events simulated with touch input */
53 | #define SDL_TOUCH_MOUSEID ((Uint32)-1)
54 |
55 |
56 | /* Function prototypes */
57 |
58 | /**
59 | * \brief Get the number of registered touch devices.
60 | */
61 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
62 |
63 | /**
64 | * \brief Get the touch ID with the given index, or 0 if the index is invalid.
65 | */
66 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
67 |
68 | /**
69 | * \brief Get the number of active fingers for a given touch device.
70 | */
71 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
72 |
73 | /**
74 | * \brief Get the finger object of the given touch, with the given index.
75 | */
76 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
77 |
78 | /* Ends C function definitions when using C++ */
79 | #ifdef __cplusplus
80 | }
81 | #endif
82 | #include "close_code.h"
83 |
84 | #endif /* _SDL_touch_h */
85 |
86 | /* vi: set ts=4 sw=4 expandtab: */
87 |
--------------------------------------------------------------------------------
/jni/SDL/include/SDL_types.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file SDL_types.h
24 | *
25 | * \deprecated
26 | */
27 |
28 | /* DEPRECATED */
29 | #include "SDL_stdinc.h"
30 |
--------------------------------------------------------------------------------
/jni/SDL/include/close_code.h:
--------------------------------------------------------------------------------
1 | /*
2 | Simple DirectMedia Layer
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /**
23 | * \file close_code.h
24 | *
25 | * This file reverses the effects of begin_code.h and should be included
26 | * after you finish any function and structure declarations in your headers
27 | */
28 |
29 | #undef _begin_code_h
30 |
31 | /* Reset structure packing at previous byte alignment */
32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__)
33 | #ifdef __BORLANDC__
34 | #pragma nopackwarning
35 | #endif
36 | #pragma pack(pop)
37 | #endif /* Compiler needs structure packing set */
38 |
--------------------------------------------------------------------------------
/jni/SDL/lib/armeabi-v7a/libSDL2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/jni/SDL/lib/armeabi-v7a/libSDL2.a
--------------------------------------------------------------------------------
/jni/SDL/lib/armeabi/libSDL2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/jni/SDL/lib/armeabi/libSDL2.a
--------------------------------------------------------------------------------
/jni/SDL/lib/x86/libSDL2.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/jni/SDL/lib/x86/libSDL2.a
--------------------------------------------------------------------------------
/jni/SDL2_image/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := SDL2_image
6 | LOCAL_STATIC_LIBRARIES := android_native_app_glue
7 |
8 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
9 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../SDL/include
10 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libpng
11 |
12 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
13 |
14 | LOCAL_SRC_FILES := \
15 | $(subst $(LOCAL_PATH)/,, \
16 | $(wildcard $(LOCAL_PATH)/*.c))
17 |
18 | LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DLOAD_PNG -DLOAD_BMP
19 | LOCAL_LDLIBS += -L$(LOCAL_PATH)/../../obj/local/$(TARGET_ARCH_ABI)
20 | LOCAL_LDLIBS += -L$(LOCAL_PATH)/../SDL/lib/$(TARGET_ARCH_ABI)
21 | LOCAL_LDLIBS += -ldl -llog -landroid -lSDL2 -lGLESv2 -lGLESv1_CM -lOpenSLES
22 | LOCAL_CPPFLAGS += -D__GXX_EXPERIMENTAL_CXX0X__
23 | LOCAL_CPPFLAGS += -fexceptions -frtti -x c++ -std=c++11 -fpermissive
24 |
25 | include $(BUILD_STATIC_LIBRARY)
26 | $(call import-module,android/native_app_glue)
27 |
28 |
--------------------------------------------------------------------------------
/jni/SDL2_image/IMG_tga.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/jni/SDL2_image/IMG_tga.c
--------------------------------------------------------------------------------
/jni/SDL2_image/IMG_xxx.c:
--------------------------------------------------------------------------------
1 | /*
2 | SDL_image: An example image loading library for use with SDL
3 | Copyright (C) 1997-2013 Sam Lantinga
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any damages
7 | arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any purpose,
10 | including commercial applications, and to alter it and redistribute it
11 | freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must not
14 | claim that you wrote the original software. If you use this software
15 | in a product, an acknowledgment in the product documentation would be
16 | appreciated but is not required.
17 | 2. Altered source versions must be plainly marked as such, and must not be
18 | misrepresented as being the original software.
19 | 3. This notice may not be removed or altered from any source distribution.
20 | */
21 |
22 | /* This is a generic "format not supported" image framework */
23 |
24 | #include
25 |
26 | #include "SDL_image.h"
27 |
28 | #ifdef LOAD_XXX
29 |
30 | /* See if an image is contained in a data source */
31 | int IMG_isXXX(SDL_RWops *src)
32 | {
33 | int start;
34 | int is_XXX;
35 |
36 | if ( !src )
37 | return 0;
38 | start = SDL_RWtell(src);
39 | is_XXX = 0;
40 |
41 | /* Detect the image here */
42 |
43 | SDL_RWseek(src, start, RW_SEEK_SET);
44 | return(is_XXX);
45 | }
46 |
47 | /* Load a XXX type image from an SDL datasource */
48 | SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
49 | {
50 | int start;
51 | const char *error = NULL;
52 | SDL_Surface *surface = NULL;
53 |
54 | if ( !src ) {
55 | /* The error message has been set in SDL_RWFromFile */
56 | return NULL;
57 | }
58 | start = SDL_RWtell(src);
59 |
60 | /* Load the image here */
61 |
62 | if ( error ) {
63 | SDL_RWseek(src, start, RW_SEEK_SET);
64 | if ( surface ) {
65 | SDL_FreeSurface(surface);
66 | surface = NULL;
67 | }
68 | IMG_SetError(error);
69 | }
70 | return surface;
71 | }
72 |
73 | #else
74 |
75 | /* See if an image is contained in a data source */
76 | int IMG_isXXX(SDL_RWops *src)
77 | {
78 | return(0);
79 | }
80 |
81 | /* Load a XXX type image from an SDL datasource */
82 | SDL_Surface *IMG_LoadXXX_RW(SDL_RWops *src)
83 | {
84 | return(NULL);
85 | }
86 |
87 | #endif /* LOAD_XXX */
88 |
--------------------------------------------------------------------------------
/jni/libpng/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := png
6 |
7 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
8 |
9 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
10 |
11 | LOCAL_SRC_FILES := \
12 | $(subst $(LOCAL_PATH)/,, \
13 | $(wildcard $(LOCAL_PATH)/*.c))
14 |
15 | LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES -DPNG_NO_ASSEMBLER_CODE
16 | LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid -lzlib
17 | LOCAL_LDLIBS += $(LOCAL_PATH)/../../obj/local/$(TARGET_ARCH_ABI)
18 |
19 | include $(BUILD_STATIC_LIBRARY)
20 |
21 |
--------------------------------------------------------------------------------
/jni/src/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := main
6 |
7 | LOCAL_STATIC_LIBRARIES := android_native_app_glue
8 |
9 | SDL_PATH := ../SDL
10 |
11 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
12 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../libpng
13 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../zlib
14 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/../SDL2_image
15 |
16 | # Add your application source files here...
17 | LOCAL_SRC_FILES := \
18 | $(subst $(LOCAL_PATH)/,, \
19 | $(wildcard $(LOCAL_PATH)/SDL/*.cpp) \
20 | $(wildcard $(LOCAL_PATH)/gb/*.cpp) \
21 | $(wildcard $(LOCAL_PATH)/*.cpp) \
22 | $(wildcard $(LOCAL_PATH)/*.c) )
23 |
24 | LOCAL_STATIC_LIBRARIES += SDL2
25 | LOCAL_STATIC_LIBRARIES += zlib png SDL2_image
26 |
27 | LOCAL_LDLIBS += -L$(LOCAL_PATH)/../../obj/local/$(TARGET_ARCH_ABI)
28 | LOCAL_LDLIBS += -L$(LOCAL_PATH)/../SDL/lib/$(TARGET_ARCH_ABI)
29 | LOCAL_LDLIBS += -lGLESv1_CM -llog -lzlib -lGLESv2 -lSDL2 -lOpenSLES -lEGL -landroid -lSDL2_image -lpng
30 | LOCAL_CFLAGS += -DBKPT_SUPPORT -DC_CORE -DSDL -DHAVE_ZUTIL_H -DFINAL_VERSION
31 | LOCAL_CFLAGS += -DNDEBUG -O3
32 | LOCAL_CPPFLAGS += -Wno-write-strings -Wno-overflow
33 |
34 | include $(BUILD_SHARED_LIBRARY)
35 | $(call import-module,android/native_app_glue)
--------------------------------------------------------------------------------
/jni/src/AutoBuild.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef __AUTOBUILD_H__
21 | #define __AUTOBUILD_H__
22 | #ifndef VERSION
23 | #define VERSION "1.7.2"
24 | #endif
25 | //change the FALSE to TRUE for autoincrement of build number
26 | #define INCREMENT_VERSION FALSE
27 | #define FILEVER 1,7,2,560
28 | #define PRODUCTVER 1,7,2,560
29 | #define STRFILEVER "1, 7, 2, 560\0"
30 | #define STRPRODUCTVER "1, 7, 2, 560\0"
31 | #endif //__AUTOBUILD_H__
32 |
--------------------------------------------------------------------------------
/jni/src/CheatSearch.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_CHEATSEARCH_H
21 | #define VBA_CHEATSEARCH_H
22 |
23 | #include "System.h"
24 |
25 | struct CheatSearchBlock {
26 | int size;
27 | u32 offset;
28 | u8 *bits;
29 | u8 *data;
30 | u8 *saved;
31 | };
32 |
33 | struct CheatSearchData {
34 | int count;
35 | CheatSearchBlock *blocks;
36 | };
37 |
38 | enum {
39 | SEARCH_EQ,
40 | SEARCH_NE,
41 | SEARCH_LT,
42 | SEARCH_LE,
43 | SEARCH_GT,
44 | SEARCH_GE
45 | };
46 |
47 | enum {
48 | BITS_8,
49 | BITS_16,
50 | BITS_32
51 | };
52 |
53 | #define SET_BIT(bits,off) \
54 | (bits)[(off) >> 3] |= (1 << ((off) & 7))
55 |
56 | #define CLEAR_BIT(bits, off) \
57 | (bits)[(off) >> 3] &= ~(1 << ((off) & 7))
58 |
59 | #define IS_BIT_SET(bits, off) \
60 | (bits)[(off) >> 3] & (1 << ((off) & 7))
61 |
62 | extern CheatSearchData cheatSearchData;
63 | extern void cheatSearchCleanup(CheatSearchData *cs);
64 | extern void cheatSearchStart(const CheatSearchData *cs);
65 | extern void cheatSearch(const CheatSearchData *cs, int compare, int size,
66 | bool isSigned);
67 | extern void cheatSearchValue(const CheatSearchData *cs, int compare, int size,
68 | bool isSigned, u32 value);
69 | extern int cheatSearchGetCount(const CheatSearchData *cs, int size);
70 | extern void cheatSearchUpdateValues(const CheatSearchData *cs);
71 | extern s32 cheatSearchSignedRead(u8 *data, int off, int size);
72 | extern u32 cheatSearchRead(u8 *data, int off, int size);
73 | #endif
74 |
--------------------------------------------------------------------------------
/jni/src/Cheats.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef GBA_CHEATS_H
21 | #define GBA_CHEATS_H
22 |
23 | struct CheatsData {
24 | int code;
25 | int size;
26 | int status;
27 | bool enabled;
28 | u32 address;
29 | u32 value;
30 | u32 oldValue;
31 | char codestring[20];
32 | char desc[32];
33 | };
34 |
35 | extern void cheatsAdd(const char *,const char *,u32,u32,int,int);
36 | extern void cheatsAddCheatCode(const char *code, const char *desc);
37 | extern void cheatsAddGSACode(const char *code, const char *desc, bool v3);
38 | extern void cheatsAddCBACode(const char *code, const char *desc);
39 | extern bool cheatsImportGSACodeFile(const char *name, int game, bool v3);
40 | extern void cheatsDelete(int number, bool restore);
41 | extern void cheatsDeleteAll(bool restore);
42 | extern void cheatsEnable(int number);
43 | extern void cheatsDisable(int number);
44 | extern void cheatsSaveGame(gzFile file);
45 | extern void cheatsReadGame(gzFile file);
46 | extern void cheatsSaveCheatList(const char *file);
47 | extern bool cheatsLoadCheatList(const char *file);
48 | extern void cheatsWriteMemory(u32 *, u32, u32);
49 | extern void cheatsWriteHalfWord(u16 *, u16, u16);
50 | extern void cheatsWriteByte(u8 *, u8);
51 | extern int cheatsCheckKeys(u32,u32);
52 | extern int cheatsNumber;
53 | extern CheatsData cheatsList[100];
54 | #endif // GBA_CHEATS_H
55 |
--------------------------------------------------------------------------------
/jni/src/EEprom.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_EEPROM_H
21 | #define VBA_EEPROM_H
22 |
23 | extern void eepromSaveGame(gzFile gzFile);
24 | extern void eepromReadGame(gzFile gzFile, int version);
25 | extern int eepromRead(u32 address);
26 | extern void eepromWrite(u32 address, u8 value);
27 | extern void eepromReset();
28 | extern u8 eepromData[0x2000];
29 | extern bool eepromInUse;
30 | extern int eepromSize;
31 |
32 | #define EEPROM_IDLE 0
33 | #define EEPROM_READADDRESS 1
34 | #define EEPROM_READDATA 2
35 | #define EEPROM_READDATA2 3
36 | #define EEPROM_WRITEDATA 4
37 |
38 | #endif // VBA_EEPROM_H
39 |
--------------------------------------------------------------------------------
/jni/src/Flash.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_FLASH_H
21 | #define VBA_FLASH_H
22 |
23 | extern void flashSaveGame(gzFile gzFile);
24 | extern void flashReadGame(gzFile gzFile, int version);
25 | extern u8 flashRead(u32 address);
26 | extern void flashWrite(u32 address, u8 byte);
27 | extern u8 flashSaveMemory[0x20000];
28 | extern void flashSaveDecide(u32 address, u8 byte);
29 | extern void flashReset();
30 | extern void flashSetSize(int size);
31 |
32 | extern int flashSize;
33 | #endif // VBA_FLASH_H
34 |
--------------------------------------------------------------------------------
/jni/src/GBA.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_GBA_H
21 | #define VBA_GBA_H
22 |
23 | #include "System.h"
24 |
25 | #define SAVE_GAME_VERSION_1 1
26 | #define SAVE_GAME_VERSION_2 2
27 | #define SAVE_GAME_VERSION_3 3
28 | #define SAVE_GAME_VERSION_4 4
29 | #define SAVE_GAME_VERSION_5 5
30 | #define SAVE_GAME_VERSION_6 6
31 | #define SAVE_GAME_VERSION_7 7
32 | #define SAVE_GAME_VERSION_8 8
33 | #define SAVE_GAME_VERSION SAVE_GAME_VERSION_8
34 |
35 | typedef struct {
36 | u8 *address;
37 | u32 mask;
38 | } memoryMap;
39 |
40 | typedef union {
41 | struct {
42 | #ifdef WORDS_BIGENDIAN
43 | u8 B3;
44 | u8 B2;
45 | u8 B1;
46 | u8 B0;
47 | #else
48 | u8 B0;
49 | u8 B1;
50 | u8 B2;
51 | u8 B3;
52 | #endif
53 | } B;
54 | struct {
55 | #ifdef WORDS_BIGENDIAN
56 | u16 W1;
57 | u16 W0;
58 | #else
59 | u16 W0;
60 | u16 W1;
61 | #endif
62 | } W;
63 | #ifdef WORDS_BIGENDIAN
64 | volatile u32 I;
65 | #else
66 | u32 I;
67 | #endif
68 | } reg_pair;
69 |
70 | #ifndef NO_GBA_MAP
71 | extern memoryMap map[256];
72 | #endif
73 |
74 | extern reg_pair reg[45];
75 | extern u8 biosProtected[4];
76 |
77 | extern bool N_FLAG;
78 | extern bool Z_FLAG;
79 | extern bool C_FLAG;
80 | extern bool V_FLAG;
81 | extern bool armIrqEnable;
82 | extern bool armState;
83 | extern int armMode;
84 | extern void (*cpuSaveGameFunc)(u32,u8);
85 |
86 | extern bool freezeWorkRAM[0x40000];
87 | extern bool freezeInternalRAM[0x8000];
88 | extern bool CPUReadGSASnapshot(const char *);
89 | extern bool CPUWriteGSASnapshot(const char *, const char *, const char *, const char *);
90 | extern bool CPUWriteBatteryFile(const char *);
91 | extern bool CPUReadBatteryFile(const char *);
92 | extern bool CPUExportEepromFile(const char *);
93 | extern bool CPUImportEepromFile(const char *);
94 | extern bool CPUWritePNGFile(const char *);
95 | extern bool CPUWriteBMPFile(const char *);
96 | extern void CPUCleanUp();
97 | extern void CPUUpdateRender();
98 | extern bool CPUReadMemState(char *, int);
99 | extern bool CPUReadState(const char *);
100 | extern bool CPUWriteMemState(char *, int);
101 | extern bool CPUWriteState(const char *);
102 | extern int CPULoadRom(const char *);
103 | extern void CPUUpdateRegister(u32, u16);
104 | extern void CPUWriteHalfWord(u32, u16);
105 | extern void CPUWriteByte(u32, u8);
106 | extern void CPUInit(const char *,bool);
107 | extern void CPUReset();
108 | extern void CPULoop(int);
109 | extern void CPUCheckDMA(int,int);
110 | extern bool CPUIsGBAImage(const char *);
111 | extern bool CPUIsZipFile(const char *);
112 | #ifdef PROFILING
113 | extern void cpuProfil(char *buffer, int, u32, int);
114 | extern void cpuEnableProfiling(int hz);
115 | #endif
116 |
117 | extern struct EmulatedSystem GBASystem;
118 |
119 | #define R13_IRQ 18
120 | #define R14_IRQ 19
121 | #define SPSR_IRQ 20
122 | #define R13_USR 26
123 | #define R14_USR 27
124 | #define R13_SVC 28
125 | #define R14_SVC 29
126 | #define SPSR_SVC 30
127 | #define R13_ABT 31
128 | #define R14_ABT 32
129 | #define SPSR_ABT 33
130 | #define R13_UND 34
131 | #define R14_UND 35
132 | #define SPSR_UND 36
133 | #define R8_FIQ 37
134 | #define R9_FIQ 38
135 | #define R10_FIQ 39
136 | #define R11_FIQ 40
137 | #define R12_FIQ 41
138 | #define R13_FIQ 42
139 | #define R14_FIQ 43
140 | #define SPSR_FIQ 44
141 |
142 | #include "Cheats.h"
143 | #include "Globals.h"
144 | #include "EEprom.h"
145 | #include "Flash.h"
146 |
147 | #endif //VBA_GBA_H
148 |
--------------------------------------------------------------------------------
/jni/src/Gfx.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include "System.h"
20 |
21 | int coeff[32] = {
22 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
23 | 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16};
24 |
25 |
26 | u32 line0[240];
27 | u32 line1[240];
28 | u32 line2[240];
29 | u32 line3[240];
30 | u32 lineOBJ[240];
31 | u32 lineOBJWin[240];
32 | u32 lineMix[240];
33 | bool gfxInWin0[240];
34 | bool gfxInWin1[240];
35 |
36 | int gfxBG2Changed = 0;
37 | int gfxBG3Changed = 0;
38 |
39 | int gfxBG2X = 0;
40 | int gfxBG2Y = 0;
41 | int gfxBG2LastX = 0;
42 | int gfxBG2LastY = 0;
43 | int gfxBG3X = 0;
44 | int gfxBG3Y = 0;
45 | int gfxBG3LastX = 0;
46 | int gfxBG3LastY = 0;
47 | int gfxLastVCOUNT = 0;
48 |
--------------------------------------------------------------------------------
/jni/src/Globals.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include "GBA.h"
20 |
21 | reg_pair reg[45];
22 | memoryMap map[256];
23 | bool ioReadable[0x400];
24 | bool N_FLAG = 0;
25 | bool C_FLAG = 0;
26 | bool Z_FLAG = 0;
27 | bool V_FLAG = 0;
28 | bool armState = true;
29 | bool armIrqEnable = true;
30 | u32 armNextPC = 0x00000000;
31 | int armMode = 0x1f;
32 | u32 stop = 0x08000568;
33 | int saveType = 0;
34 | bool useBios = false;
35 | bool skipBios = false;
36 | int frameSkip = 1;
37 | bool speedup = false;
38 | bool synchronize = true;
39 | bool cpuDisableSfx = false;
40 | bool cpuIsMultiBoot = false;
41 | bool parseDebug = true;
42 | int layerSettings = 0xff00;
43 | int layerEnable = 0xff00;
44 | bool speedHack = false;
45 | int cpuSaveType = 0;
46 | bool cpuEnhancedDetection = true;
47 | bool cheatsEnabled = true;
48 |
49 | u8 *bios = NULL;
50 | u8 *rom = NULL;
51 | u8 *internalRAM = NULL;
52 | u8 *workRAM = NULL;
53 | u8 *paletteRAM = NULL;
54 | u8 *vram = NULL;
55 | u8 *pix = NULL;
56 | u8 *oam = NULL;
57 | u8 *ioMem = NULL;
58 |
59 | u16 DISPCNT = 0x0080;
60 | u16 DISPSTAT = 0x0000;
61 | u16 VCOUNT = 0x0000;
62 | u16 BG0CNT = 0x0000;
63 | u16 BG1CNT = 0x0000;
64 | u16 BG2CNT = 0x0000;
65 | u16 BG3CNT = 0x0000;
66 | u16 BG0HOFS = 0x0000;
67 | u16 BG0VOFS = 0x0000;
68 | u16 BG1HOFS = 0x0000;
69 | u16 BG1VOFS = 0x0000;
70 | u16 BG2HOFS = 0x0000;
71 | u16 BG2VOFS = 0x0000;
72 | u16 BG3HOFS = 0x0000;
73 | u16 BG3VOFS = 0x0000;
74 | u16 BG2PA = 0x0100;
75 | u16 BG2PB = 0x0000;
76 | u16 BG2PC = 0x0000;
77 | u16 BG2PD = 0x0100;
78 | u16 BG2X_L = 0x0000;
79 | u16 BG2X_H = 0x0000;
80 | u16 BG2Y_L = 0x0000;
81 | u16 BG2Y_H = 0x0000;
82 | u16 BG3PA = 0x0100;
83 | u16 BG3PB = 0x0000;
84 | u16 BG3PC = 0x0000;
85 | u16 BG3PD = 0x0100;
86 | u16 BG3X_L = 0x0000;
87 | u16 BG3X_H = 0x0000;
88 | u16 BG3Y_L = 0x0000;
89 | u16 BG3Y_H = 0x0000;
90 | u16 WIN0H = 0x0000;
91 | u16 WIN1H = 0x0000;
92 | u16 WIN0V = 0x0000;
93 | u16 WIN1V = 0x0000;
94 | u16 WININ = 0x0000;
95 | u16 WINOUT = 0x0000;
96 | u16 MOSAIC = 0x0000;
97 | u16 BLDMOD = 0x0000;
98 | u16 COLEV = 0x0000;
99 | u16 COLY = 0x0000;
100 | u16 DM0SAD_L = 0x0000;
101 | u16 DM0SAD_H = 0x0000;
102 | u16 DM0DAD_L = 0x0000;
103 | u16 DM0DAD_H = 0x0000;
104 | u16 DM0CNT_L = 0x0000;
105 | u16 DM0CNT_H = 0x0000;
106 | u16 DM1SAD_L = 0x0000;
107 | u16 DM1SAD_H = 0x0000;
108 | u16 DM1DAD_L = 0x0000;
109 | u16 DM1DAD_H = 0x0000;
110 | u16 DM1CNT_L = 0x0000;
111 | u16 DM1CNT_H = 0x0000;
112 | u16 DM2SAD_L = 0x0000;
113 | u16 DM2SAD_H = 0x0000;
114 | u16 DM2DAD_L = 0x0000;
115 | u16 DM2DAD_H = 0x0000;
116 | u16 DM2CNT_L = 0x0000;
117 | u16 DM2CNT_H = 0x0000;
118 | u16 DM3SAD_L = 0x0000;
119 | u16 DM3SAD_H = 0x0000;
120 | u16 DM3DAD_L = 0x0000;
121 | u16 DM3DAD_H = 0x0000;
122 | u16 DM3CNT_L = 0x0000;
123 | u16 DM3CNT_H = 0x0000;
124 | u16 TM0D = 0x0000;
125 | u16 TM0CNT = 0x0000;
126 | u16 TM1D = 0x0000;
127 | u16 TM1CNT = 0x0000;
128 | u16 TM2D = 0x0000;
129 | u16 TM2CNT = 0x0000;
130 | u16 TM3D = 0x0000;
131 | u16 TM3CNT = 0x0000;
132 | u16 P1 = 0xFFFF;
133 | u16 IE = 0x0000;
134 | u16 IF = 0x0000;
135 | u16 IME = 0x0000;
136 |
--------------------------------------------------------------------------------
/jni/src/Globals.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_GLOBALS_H
21 | #define VBA_GLOBALS_H
22 |
23 | #define VERBOSE_SWI 1
24 | #define VERBOSE_UNALIGNED_MEMORY 2
25 | #define VERBOSE_ILLEGAL_WRITE 4
26 | #define VERBOSE_ILLEGAL_READ 8
27 | #define VERBOSE_DMA0 16
28 | #define VERBOSE_DMA1 32
29 | #define VERBOSE_DMA2 64
30 | #define VERBOSE_DMA3 128
31 | #define VERBOSE_UNDEFINED 256
32 | #define VERBOSE_AGBPRINT 512
33 |
34 | extern reg_pair reg[45];
35 | extern bool ioReadable[0x400];
36 | extern bool N_FLAG;
37 | extern bool C_FLAG;
38 | extern bool Z_FLAG;
39 | extern bool V_FLAG;
40 | extern bool armState;
41 | extern bool armIrqEnable;
42 | extern u32 armNextPC;
43 | extern int armMode;
44 | extern u32 stop;
45 | extern int saveType;
46 | extern bool useBios;
47 | extern bool skipBios;
48 | extern int frameSkip;
49 | extern bool speedup;
50 | extern bool synchronize;
51 | extern bool cpuDisableSfx;
52 | extern bool cpuIsMultiBoot;
53 | extern bool parseDebug;
54 | extern int layerSettings;
55 | extern int layerEnable;
56 | extern bool speedHack;
57 | extern int cpuSaveType;
58 | extern bool cpuEnhancedDetection;
59 | extern bool cheatsEnabled;
60 |
61 | extern u8 *bios;
62 | extern u8 *rom;
63 | extern u8 *internalRAM;
64 | extern u8 *workRAM;
65 | extern u8 *paletteRAM;
66 | extern u8 *vram;
67 | extern u8 *pix;
68 | extern u8 *oam;
69 | extern u8 *ioMem;
70 |
71 | extern u16 DISPCNT;
72 | extern u16 DISPSTAT;
73 | extern u16 VCOUNT;
74 | extern u16 BG0CNT;
75 | extern u16 BG1CNT;
76 | extern u16 BG2CNT;
77 | extern u16 BG3CNT;
78 | extern u16 BG0HOFS;
79 | extern u16 BG0VOFS;
80 | extern u16 BG1HOFS;
81 | extern u16 BG1VOFS;
82 | extern u16 BG2HOFS;
83 | extern u16 BG2VOFS;
84 | extern u16 BG3HOFS;
85 | extern u16 BG3VOFS;
86 | extern u16 BG2PA;
87 | extern u16 BG2PB;
88 | extern u16 BG2PC;
89 | extern u16 BG2PD;
90 | extern u16 BG2X_L;
91 | extern u16 BG2X_H;
92 | extern u16 BG2Y_L;
93 | extern u16 BG2Y_H;
94 | extern u16 BG3PA;
95 | extern u16 BG3PB;
96 | extern u16 BG3PC;
97 | extern u16 BG3PD;
98 | extern u16 BG3X_L;
99 | extern u16 BG3X_H;
100 | extern u16 BG3Y_L;
101 | extern u16 BG3Y_H;
102 | extern u16 WIN0H;
103 | extern u16 WIN1H;
104 | extern u16 WIN0V;
105 | extern u16 WIN1V;
106 | extern u16 WININ;
107 | extern u16 WINOUT;
108 | extern u16 MOSAIC;
109 | extern u16 BLDMOD;
110 | extern u16 COLEV;
111 | extern u16 COLY;
112 | extern u16 DM0SAD_L;
113 | extern u16 DM0SAD_H;
114 | extern u16 DM0DAD_L;
115 | extern u16 DM0DAD_H;
116 | extern u16 DM0CNT_L;
117 | extern u16 DM0CNT_H;
118 | extern u16 DM1SAD_L;
119 | extern u16 DM1SAD_H;
120 | extern u16 DM1DAD_L;
121 | extern u16 DM1DAD_H;
122 | extern u16 DM1CNT_L;
123 | extern u16 DM1CNT_H;
124 | extern u16 DM2SAD_L;
125 | extern u16 DM2SAD_H;
126 | extern u16 DM2DAD_L;
127 | extern u16 DM2DAD_H;
128 | extern u16 DM2CNT_L;
129 | extern u16 DM2CNT_H;
130 | extern u16 DM3SAD_L;
131 | extern u16 DM3SAD_H;
132 | extern u16 DM3DAD_L;
133 | extern u16 DM3DAD_H;
134 | extern u16 DM3CNT_L;
135 | extern u16 DM3CNT_H;
136 | extern u16 TM0D;
137 | extern u16 TM0CNT;
138 | extern u16 TM1D;
139 | extern u16 TM1CNT;
140 | extern u16 TM2D;
141 | extern u16 TM2CNT;
142 | extern u16 TM3D;
143 | extern u16 TM3CNT;
144 | extern u16 P1;
145 | extern u16 IE;
146 | extern u16 IF;
147 | extern u16 IME;
148 |
149 | #endif // VBA_GLOBALS_H
150 |
--------------------------------------------------------------------------------
/jni/src/Makefile.am:
--------------------------------------------------------------------------------
1 | CORE_SUBDIRS = gb
2 |
3 | EXTRA_SUBDIRS = i386 prof sdl gtk
4 |
5 | SUBDIRS = $(CORE_SUBDIRS) @VBA_SRC_EXTRA@
6 |
7 | DIST_SUBDIRS = $(CORE_SUBDIRS) $(EXTRA_SUBDIRS)
8 |
9 | dist_sysconf_DATA = VisualBoyAdvance.cfg
10 |
11 | EXTRA_DIST = \
12 | win32 \
13 | expr.l \
14 | expr.y \
15 | CheatSearch.cpp \
16 | CheatSearch.h
17 |
18 | dist-hook:
19 | rm -rf `find $(distdir)/win32 -name CVS`
20 |
--------------------------------------------------------------------------------
/jni/src/NLS.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #define N_(String) (String)
21 |
22 | #define MSG_UNSUPPORTED_VBA_SGM 1
23 | #define MSG_CANNOT_LOAD_SGM 2
24 | #define MSG_SAVE_GAME_NOT_USING_BIOS 3
25 | #define MSG_SAVE_GAME_USING_BIOS 4
26 | #define MSG_UNSUPPORTED_SAVE_TYPE 5
27 | #define MSG_CANNOT_OPEN_FILE 6
28 | #define MSG_BAD_ZIP_FILE 7
29 | #define MSG_NO_IMAGE_ON_ZIP 8
30 | #define MSG_ERROR_OPENING_IMAGE 9
31 | #define MSG_ERROR_READING_IMAGE 10
32 | #define MSG_UNSUPPORTED_BIOS_FUNCTION 11
33 | #define MSG_INVALID_BIOS_FILE_SIZE 12
34 | #define MSG_INVALID_CHEAT_CODE 13
35 | #define MSG_UNKNOWN_ARM_OPCODE 14
36 | #define MSG_UNKNOWN_THUMB_OPCODE 15
37 | #define MSG_ERROR_CREATING_FILE 16
38 | #define MSG_FAILED_TO_READ_SGM 17
39 | #define MSG_FAILED_TO_READ_RTC 18
40 | #define MSG_UNSUPPORTED_VB_SGM 19
41 | #define MSG_CANNOT_LOAD_SGM_FOR 20
42 | #define MSG_ERROR_OPENING_IMAGE_FROM 21
43 | #define MSG_ERROR_READING_IMAGE_FROM 22
44 | #define MSG_UNSUPPORTED_ROM_SIZE 23
45 | #define MSG_UNSUPPORTED_RAM_SIZE 24
46 | #define MSG_UNKNOWN_CARTRIDGE_TYPE 25
47 | #define MSG_MAXIMUM_NUMBER_OF_CHEATS 26
48 | #define MSG_INVALID_GAMESHARK_CODE 27
49 | #define MSG_INVALID_GAMEGENIE_CODE 28
50 | #define MSG_INVALID_CHEAT_TO_REMOVE 29
51 | #define MSG_INVALID_CHEAT_CODE_ADDRESS 30
52 | #define MSG_UNSUPPORTED_CHEAT_LIST_VERSION 31
53 | #define MSG_UNSUPPORTED_CHEAT_LIST_TYPE 32
54 | #define MSG_INVALID_GSA_CODE 33
55 | #define MSG_CANNOT_IMPORT_SNAPSHOT_FOR 34
56 | #define MSG_UNSUPPORTED_SNAPSHOT_FILE 35
57 | #define MSG_UNSUPPORTED_ARM_MODE 36
58 | #define MSG_UNSUPPORTED_CODE_FILE 37
59 | #define MSG_GBA_CODE_WARNING 38
60 | #define MSG_INVALID_CBA_CODE 39
61 | #define MSG_CBA_CODE_WARNING 40
62 | #define MSG_OUT_OF_MEMORY 41
63 |
--------------------------------------------------------------------------------
/jni/src/Port.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_PORT_H
21 | #define VBA_PORT_H
22 |
23 | // swaps a 16-bit value
24 | //static inline u16 swap16(u16 v)
25 | //{
26 | // return (v<<8)|(v>>8);
27 | //}
28 | //
29 | //// swaps a 32-bit value
30 | //static inline u32 swap32(u32 v)
31 | //{
32 | // return (v<<24)|((v<<8)&0xff0000)|((v>>8)&0xff00)|(v>>24);
33 | //}
34 |
35 | #ifdef WORDS_BIGENDIAN
36 | #if defined(__GNUC__) && defined(__ppc__)
37 |
38 | #define READ16LE(base) \
39 | ({ unsigned short lhbrxResult; \
40 | __asm__ ("lhbrx %0, 0, %1" : "=r" (lhbrxResult) : "r" (base) : "memory"); \
41 | lhbrxResult; })
42 |
43 | #define READ32LE(base) \
44 | ({ unsigned long lwbrxResult; \
45 | __asm__ ("lwbrx %0, 0, %1" : "=r" (lwbrxResult) : "r" (base) : "memory"); \
46 | lwbrxResult; })
47 |
48 | #define WRITE16LE(base, value) \
49 | __asm__ ("sthbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory")
50 |
51 | #define WRITE32LE(base, value) \
52 | __asm__ ("stwbrx %0, 0, %1" : : "r" (value), "r" (base) : "memory")
53 |
54 | #else
55 | #define READ16LE(x) \
56 | swap16(*((u16 *)(x)))
57 | #define READ32LE(x) \
58 | swap32(*((u32 *)(x)))
59 | #define WRITE16LE(x,v) \
60 | *((u16 *)x) = swap16((v))
61 | #define WRITE32LE(x,v) \
62 | *((u32 *)x) = swap32((v))
63 | #endif
64 | #else
65 | #define READ16LE(x) \
66 | *((u16 *)x)
67 | #define READ32LE(x) \
68 | *((u32 *)x)
69 | #define WRITE16LE(x,v) \
70 | *((u16 *)x) = (v)
71 | #define WRITE32LE(x,v) \
72 | *((u32 *)x) = (v)
73 | #endif
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/jni/src/RTC.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_RTC_H
21 | #define VBA_RTC_H
22 | extern u16 rtcRead(u32 address);
23 | extern bool rtcWrite(u32 address, u16 value);
24 | extern void rtcEnable(bool);
25 | extern bool rtcIsEnabled();
26 | extern void rtcReset();
27 |
28 | extern void rtcReadGame(gzFile gzFile);
29 | extern void rtcSaveGame(gzFile gzFile);
30 |
31 | #endif
32 |
--------------------------------------------------------------------------------
/jni/src/SDL/debugger.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | extern void debuggerMain();
21 |
--------------------------------------------------------------------------------
/jni/src/SDL_android_main.c:
--------------------------------------------------------------------------------
1 |
2 | #include "SDL_config.h"
3 |
4 | #ifdef __ANDROID__
5 |
6 | /* Include the SDL main definition header */
7 | #include "SDL_main.h"
8 |
9 | /*******************************************************************************
10 | Functions called by JNI
11 | *******************************************************************************/
12 | #include
13 |
14 | /* Called before SDL_main() to initialize JNI bindings in SDL library */
15 | extern void SDL_Android_Init(JNIEnv* env, jclass cls);
16 |
17 | /* Start up the SDL app */
18 | void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject obj)
19 | {
20 | /* This interface could expand with ABI negotiation, calbacks, etc. */
21 | SDL_Android_Init(env, cls);
22 |
23 | SDL_SetMainReady();
24 |
25 | /* Run the application code! */
26 | int status;
27 | char *argv[2];
28 | argv[0] = SDL_strdup("SDL_app");
29 | argv[1] = NULL;
30 | status = SDL_main(1, argv);
31 |
32 | /* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
33 | /* exit(status); */
34 | }
35 |
36 | #endif /* __ANDROID__ */
37 |
38 | /* vi: set ts=4 sw=4 expandtab: */
39 |
--------------------------------------------------------------------------------
/jni/src/Sound.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_SOUND_H
21 | #define VBA_SOUND_H
22 |
23 | #define NR10 0x60
24 | #define NR11 0x62
25 | #define NR12 0x63
26 | #define NR13 0x64
27 | #define NR14 0x65
28 | #define NR21 0x68
29 | #define NR22 0x69
30 | #define NR23 0x6c
31 | #define NR24 0x6d
32 | #define NR30 0x70
33 | #define NR31 0x72
34 | #define NR32 0x73
35 | #define NR33 0x74
36 | #define NR34 0x75
37 | #define NR41 0x78
38 | #define NR42 0x79
39 | #define NR43 0x7c
40 | #define NR44 0x7d
41 | #define NR50 0x80
42 | #define NR51 0x81
43 | #define NR52 0x84
44 | #define SGCNT0_H 0x82
45 | #define FIFOA_L 0xa0
46 | #define FIFOA_H 0xa2
47 | #define FIFOB_L 0xa4
48 | #define FIFOB_H 0xa6
49 |
50 | extern void soundTick();
51 | extern void soundShutdown();
52 | extern bool soundInit();
53 | extern void soundPause();
54 | extern void soundResume();
55 | extern void soundEnable(int);
56 | extern void soundDisable(int);
57 | extern int soundGetEnable();
58 | extern void soundReset();
59 | extern void soundSaveGame(gzFile);
60 | extern void soundReadGame(gzFile, int);
61 | extern void soundEvent(u32, u8);
62 | extern void soundEvent(u32, u16);
63 | extern void soundTimerOverflow(int);
64 | extern void soundSetQuality(int);
65 |
66 | //extern int SOUND_TICKS;
67 | extern int SOUND_CLOCK_TICKS;
68 | extern int soundTicks;
69 | extern int soundPaused;
70 | extern bool soundOffFlag;
71 | extern int soundQuality;
72 | extern int soundBufferLen;
73 | extern int soundBufferTotalLen;
74 | extern u32 soundNextPosition;
75 | extern u16 soundFinalWave[1470];
76 | extern int soundVolume;
77 |
78 | extern bool soundEcho;
79 | extern bool soundLowPass;
80 | extern bool soundReverse;
81 |
82 | #endif // VBA_SOUND_H
83 |
--------------------------------------------------------------------------------
/jni/src/Sram.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include "GBA.h"
20 | #include "Flash.h"
21 | #include "Sram.h"
22 |
23 | u8 sramRead(u32 address)
24 | {
25 | return flashSaveMemory[address & 0xFFFF];
26 | }
27 |
28 | void sramWrite(u32 address, u8 byte)
29 | {
30 | flashSaveMemory[address & 0xFFFF] = byte;
31 | systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
32 | }
33 |
--------------------------------------------------------------------------------
/jni/src/Sram.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_SRAM_H
21 | #define VBA_SRAM_H
22 |
23 | extern u8 sramRead(u32 address);
24 | extern void sramWrite(u32 address, u8 byte);
25 |
26 | #endif // VBA_SRAM_H
27 |
--------------------------------------------------------------------------------
/jni/src/System.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_SYSTEM_H
21 | #define VBA_SYSTEM_H
22 |
23 | #include "unzip.h"
24 |
25 | #ifndef NULL
26 | #define NULL 0
27 | #endif
28 |
29 | typedef unsigned char u8;
30 | typedef unsigned short u16;
31 | typedef unsigned int u32;
32 |
33 | #ifdef _MSC_VER
34 | typedef unsigned __int64 u64;
35 | #else
36 | typedef unsigned long long u64;
37 | #endif
38 |
39 | typedef signed char s8;
40 | typedef signed short s16;
41 | typedef signed int s32;
42 |
43 | #ifdef _MSC_VER
44 | typedef signed __int64 s64;
45 | #else
46 | typedef signed long long s64;
47 | #endif
48 |
49 | struct EmulatedSystem {
50 | // main emulation function
51 | void (*emuMain)(int);
52 | // reset emulator
53 | void (*emuReset)();
54 | // clean up memory
55 | void (*emuCleanUp)();
56 | // load battery file
57 | bool (*emuReadBattery)(const char *);
58 | // write battery file
59 | bool (*emuWriteBattery)(const char *);
60 | // load state
61 | bool (*emuReadState)(const char *);
62 | // save state
63 | bool (*emuWriteState)(const char *);
64 | // load memory state (rewind)
65 | bool (*emuReadMemState)(char *, int);
66 | // write memory state (rewind)
67 | bool (*emuWriteMemState)(char *, int);
68 | // write PNG file
69 | bool (*emuWritePNG)(const char *);
70 | // write BMP file
71 | bool (*emuWriteBMP)(const char *);
72 | // emulator update CPSR (ARM only)
73 | void (*emuUpdateCPSR)();
74 | // emulator has debugger
75 | bool emuHasDebugger;
76 | // clock ticks to emulate
77 | int emuCount;
78 | };
79 |
80 | extern void log(const char *,...);
81 |
82 | extern bool systemPauseOnFrame();
83 | extern void systemGbPrint(u8 *,int,int,int,int);
84 | extern void systemScreenCapture(int);
85 | extern void systemDrawScreen();
86 | // updates the joystick data
87 | extern bool systemReadJoypads();
88 | // return information about the given joystick, -1 for default joystick
89 | extern u32 systemReadJoypad(int);
90 | extern u32 systemGetClock();
91 | extern void systemMessage(int, const char *, ...);
92 | extern void systemSetTitle(const char *);
93 | extern void systemWriteDataToSoundBuffer();
94 | extern void systemSoundShutdown();
95 | extern void systemSoundPause();
96 | extern void systemSoundResume();
97 | extern void systemSoundReset();
98 | extern bool systemSoundInit();
99 | extern void systemScreenMessage(const char *);
100 | extern void systemUpdateMotionSensor();
101 | extern int systemGetSensorX();
102 | extern int systemGetSensorY();
103 | extern bool systemCanChangeSoundQuality();
104 | extern void systemShowSpeed(int);
105 | extern void system10Frames(int);
106 | extern void systemFrame();
107 | extern void systemGbBorderOn();
108 |
109 | extern bool systemSoundOn;
110 | extern u16 systemColorMap16[0x10000];
111 | extern u32 systemColorMap32[0x10000];
112 | extern u16 systemGbPalette[24];
113 | extern int systemRedShift;
114 | extern int systemGreenShift;
115 | extern int systemBlueShift;
116 | extern int systemColorDepth;
117 | extern int systemDebug;
118 | extern int systemVerbose;
119 | extern int systemFrameSkip;
120 | extern int systemSaveUpdateCounter;
121 |
122 | #define SYSTEM_SAVE_UPDATED 30
123 | #define SYSTEM_SAVE_NOT_UPDATED 0
124 |
125 | #endif //VBA_SYSTEM_H
126 |
--------------------------------------------------------------------------------
/jni/src/Text.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | extern void drawText(u8 *, int, int, int, const char *);
21 | extern void drawTextTransp(u8 *, int, int, int, const char *);
22 |
--------------------------------------------------------------------------------
/jni/src/Util.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_UTIL_H
21 | #define VBA_UTIL_H
22 | enum IMAGE_TYPE {
23 | IMAGE_UNKNOWN = -1,
24 | IMAGE_GBA = 0,
25 | IMAGE_GB = 1
26 | };
27 |
28 | // save game
29 |
30 | typedef struct {
31 | void *address;
32 | int size;
33 | } variable_desc;
34 |
35 | extern bool utilWritePNGFile(const char *, int, int, u8 *);
36 | extern bool utilWriteBMPFile(const char *, int, int, u8 *);
37 | extern void utilApplyIPS(const char *ips, u8 **rom, int *size);
38 | extern void utilWriteBMP(char *, int, int, u8 *);
39 | extern bool utilIsGBAImage(const char *);
40 | extern bool utilIsGBImage(const char *);
41 | extern bool utilIsZipFile(const char *);
42 | extern bool utilIsGzipFile(const char *);
43 | extern bool utilIsRarFile(const char *);
44 | extern void utilGetBaseName(const char *, char *);
45 | extern IMAGE_TYPE utilFindType(const char *);
46 | extern u8 *utilLoad(const char *,
47 | bool (*)(const char*),
48 | u8 *,
49 | int &);
50 |
51 | extern void utilPutDword(u8 *, u32);
52 | extern void utilPutWord(u8 *, u16);
53 | extern void utilWriteData(gzFile, variable_desc *);
54 | extern void utilReadData(gzFile, variable_desc *);
55 | extern int utilReadInt(gzFile);
56 | extern void utilWriteInt(gzFile, int);
57 | extern gzFile utilGzOpen(const char *file, const char *mode);
58 | extern gzFile utilMemGzOpen(char *memory, int available, char *mode);
59 | extern int utilGzWrite(gzFile file, const voidp buffer, unsigned int len);
60 | extern int utilGzRead(gzFile file, voidp buffer, unsigned int len);
61 | extern int utilGzClose(gzFile file);
62 | extern long utilGzMemTell(gzFile file);
63 | extern void utilGBAFindSave(const u8 *, const int);
64 | #endif
65 |
--------------------------------------------------------------------------------
/jni/src/agbprint.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include
20 | #include
21 |
22 | #include "GBA.h"
23 | #include "Globals.h"
24 | #include "Port.h"
25 |
26 | #define debuggerWriteHalfWord(addr, value) \
27 | WRITE16LE((u16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask], (value))
28 |
29 | #define debuggerReadHalfWord(addr) \
30 | READ16LE(((u16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
31 |
32 | static bool agbPrintEnabled = false;
33 | static bool agbPrintProtect = false;
34 |
35 | bool agbPrintWrite(u32 address, u16 value)
36 | {
37 | if(agbPrintEnabled) {
38 | if(address == 0x9fe2ffe) { // protect
39 | agbPrintProtect = (value != 0);
40 | debuggerWriteHalfWord(address, value);
41 | return true;
42 | } else {
43 | if(agbPrintProtect &&
44 | ((address >= 0x9fe20f8 && address <= 0x9fe20ff) // control structure
45 | || (address >= 0x8fd0000 && address <= 0x8fdffff)
46 | || (address >= 0x9fd0000 && address <= 0x9fdffff))) {
47 | debuggerWriteHalfWord(address, value);
48 | return true;
49 | }
50 | }
51 | }
52 | return false;
53 | }
54 |
55 | void agbPrintReset()
56 | {
57 | agbPrintProtect = false;
58 | }
59 |
60 | void agbPrintEnable(bool enable)
61 | {
62 | agbPrintEnabled = enable;
63 | }
64 |
65 | bool agbPrintIsEnabled()
66 | {
67 | return agbPrintEnabled;
68 | }
69 |
70 | extern void (*dbgOutput)(char *, u32);
71 |
72 | void agbPrintFlush()
73 | {
74 | u16 get = debuggerReadHalfWord(0x9fe20fc);
75 | u16 put = debuggerReadHalfWord(0x9fe20fe);
76 |
77 | u32 address = (debuggerReadHalfWord(0x9fe20fa) << 16);
78 | if(address != 0xfd0000 && address != 0x1fd0000) {
79 | dbgOutput("Did you forget to call AGBPrintInit?\n", 0);
80 | // get rid of the text otherwise we will continue to be called
81 | debuggerWriteHalfWord(0x9fe20fc, put);
82 | return;
83 | }
84 |
85 | u8 *data = &rom[address];
86 |
87 | while(get != put) {
88 | char c = data[get++];
89 | char s[2];
90 | s[0] = c;
91 | s[1] = 0;
92 |
93 | if(systemVerbose & VERBOSE_AGBPRINT)
94 | dbgOutput(s, 0);
95 | if(c == '\n')
96 | break;
97 | }
98 | debuggerWriteHalfWord(0x9fe20fc, get);
99 | }
100 |
--------------------------------------------------------------------------------
/jni/src/agbprint.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_AGBPRINT_H
21 | #define VBA_AGBPRINT_H
22 | extern void agbPrintEnable(bool);
23 | extern bool agbPrintIsEnabled();
24 | extern void agbPrintReset();
25 | extern bool agbPrintWrite(u32, u16);
26 | extern void agbPrintFlush();
27 | #endif
28 |
--------------------------------------------------------------------------------
/jni/src/armdis.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | /************************************************************************/
21 | /* Arm/Thumb command set disassembler */
22 | /************************************************************************/
23 |
24 | #ifndef __ARMDIS_H__
25 | #define __ARMDIS_H__
26 |
27 | #define DIS_VIEW_ADDRESS 1
28 | #define DIS_VIEW_CODE 2
29 |
30 | int disThumb(u32 offset, char *dest, int flags);
31 | int disArm(u32 offset, char *dest, int flags);
32 |
33 | #endif // __ARMDIS_H__
34 |
--------------------------------------------------------------------------------
/jni/src/bios.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_BIOS_H
21 | #define VBA_BIOS_H
22 |
23 | extern void BIOS_ArcTan();
24 | extern void BIOS_ArcTan2();
25 | extern void BIOS_BitUnPack();
26 | extern void BIOS_BgAffineSet();
27 | extern void BIOS_CpuSet();
28 | extern void BIOS_CpuFastSet();
29 | extern void BIOS_Diff8bitUnFilterWram();
30 | extern void BIOS_Diff8bitUnFilterVram();
31 | extern void BIOS_Diff16bitUnFilter();
32 | extern void BIOS_Div();
33 | extern void BIOS_DivARM();
34 | extern void BIOS_HuffUnComp();
35 | extern void BIOS_LZ77UnCompVram();
36 | extern void BIOS_LZ77UnCompWram();
37 | extern void BIOS_ObjAffineSet();
38 | extern void BIOS_RegisterRamReset();
39 | extern void BIOS_RegisterRamReset(u32);
40 | extern void BIOS_RLUnCompVram();
41 | extern void BIOS_RLUnCompWram();
42 | extern void BIOS_SoftReset();
43 | extern void BIOS_Sqrt();
44 | extern void BIOS_MidiKey2Freq();
45 | extern void BIOS_SndDriverJmpTableCopy();
46 | #endif // VBA_BIOS_H
47 |
--------------------------------------------------------------------------------
/jni/src/expr.cpp.h:
--------------------------------------------------------------------------------
1 | #ifndef YYSTYPE
2 | #define YYSTYPE int
3 | #endif
4 | #define TOKEN_IDENTIFIER 257
5 | #define TOKEN_DOT 258
6 | #define TOKEN_STAR 259
7 | #define TOKEN_ARROW 260
8 | #define TOKEN_ADDR 261
9 | #define TOKEN_SIZEOF 262
10 | #define TOKEN_NUMBER 263
11 |
12 |
13 | extern YYSTYPE yylval;
14 |
--------------------------------------------------------------------------------
/jni/src/expr.l:
--------------------------------------------------------------------------------
1 | %{
2 | #include "expr.cpp.h"
3 |
4 | #ifndef __GNUC__
5 | #include
6 | #define isatty _isatty
7 | #endif
8 |
9 | char *exprString;
10 | int exprCol;
11 |
12 | #define YY_INPUT(buf,result,max_size) \
13 | { \
14 | int c = *exprString++; \
15 | exprCol++;\
16 | result = (c == 0) ? YY_NULL : (buf[0] = c, 1); \
17 | }
18 | %}
19 |
20 | %option nomain
21 | %option noyywrap
22 |
23 | SIZEOF "sizeof"
24 | ID [a-zA-Z_][a-zA-Z0-9_]*
25 | NUM [0-9]+
26 | DOT "."
27 | ARROW "->"
28 | STAR "*"
29 | ADDR "&"
30 |
31 | %%
32 |
33 | {SIZEOF} {
34 | return TOKEN_SIZEOF;
35 | }
36 |
37 | {ID} {
38 | return TOKEN_IDENTIFIER;
39 | }
40 |
41 | {NUM} {
42 | return TOKEN_NUMBER;
43 | }
44 |
45 | {DOT} {
46 | return TOKEN_DOT;
47 | }
48 |
49 | {ARROW} {
50 | return TOKEN_ARROW;
51 | }
52 |
53 | {ADDR} {
54 | return TOKEN_ADDR;
55 | }
56 |
57 | {STAR} {
58 | return TOKEN_STAR;
59 | }
60 |
61 | [ \t\n]+
62 |
63 | . return *yytext;
64 |
65 | %%
66 |
67 | void exprCleanBuffer()
68 | {
69 | yy_delete_buffer(yy_current_buffer);
70 | yy_init = 1;
71 | }
72 |
--------------------------------------------------------------------------------
/jni/src/expr.y:
--------------------------------------------------------------------------------
1 | %{
2 | namespace std {
3 | #include
4 | #include
5 | #include
6 | #include
7 | }
8 |
9 | using namespace std;
10 |
11 | #include "System.h"
12 | #include "elf.h"
13 | #include "exprNode.h"
14 |
15 | extern int yyerror(char *);
16 | extern int yylex();
17 | extern char *yytext;
18 |
19 |
20 | //#define YYERROR_VERBOSE 1
21 | //#define YYDEBUG 1
22 |
23 | Node *result = NULL;
24 | %}
25 |
26 | %token TOKEN_IDENTIFIER TOKEN_DOT TOKEN_STAR TOKEN_ARROW TOKEN_ADDR
27 | %token TOKEN_SIZEOF TOKEN_NUMBER
28 | %left TOKEN_DOT TOKEN_ARROW '['
29 | %expect 6
30 | %%
31 |
32 | final: expression { result = $1; }
33 | ;
34 |
35 | expression:
36 | simple_expression { $$ = $1; } |
37 | '(' expression ')' { $$ = $2; } |
38 | expression TOKEN_DOT ident { $$ = exprNodeDot($1, $3); } |
39 | expression TOKEN_ARROW ident { $$ = exprNodeArrow($1, $3); } |
40 | expression '[' number ']' { $$ = exprNodeArray($1, $3); }
41 | ;
42 | simple_expression:
43 | ident { $$ = $1; } |
44 | TOKEN_STAR expression { $$ = exprNodeStar($2); } |
45 | TOKEN_ADDR expression { $$ = exprNodeAddr($2); } |
46 | TOKEN_SIZEOF '(' expression ')' { $$ = exprNodeSizeof($3); }
47 | ;
48 |
49 | number:
50 | TOKEN_NUMBER { $$ = exprNodeNumber(); }
51 | ;
52 |
53 | ident:
54 | TOKEN_IDENTIFIER {$$ = exprNodeIdentifier(); }
55 | ;
56 |
57 | %%
58 |
59 | int yyerror(char *s)
60 | {
61 | return 0;
62 | }
63 |
64 | #ifndef SDL
65 | extern FILE *yyin;
66 | int main(int argc, char **argv)
67 | {
68 | // yydebug = 1;
69 | ++argv, --argc;
70 | if(argc > 0)
71 | yyin = fopen(argv[0], "r");
72 | else
73 | yyin = stdin;
74 | if(!yyparse())
75 | result->print();
76 | }
77 | #endif
78 |
--------------------------------------------------------------------------------
/jni/src/exprNode.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | struct Node {
21 | Type *type;
22 | u32 location;
23 | u32 objLocation;
24 | LocationType locType;
25 | int value;
26 | int index;
27 | char *name;
28 | Node *expression;
29 | Member *member;
30 | void (*print)(Node *);
31 | bool (*resolve)(Node *, Function *f, CompileUnit *u);
32 | };
33 |
34 | extern void exprNodeCleanUp();
35 |
36 | extern Node *exprNodeIdentifier();
37 | extern void exprNodeIdentifierPrint(Node *);
38 | extern bool exprNodeIdentifierResolve(Node *, Function *, CompileUnit *);
39 |
40 | extern Node *exprNodeNumber();
41 | extern void exprNodeNumberPrint(Node *);
42 | extern bool exprNodeNumberResolve(Node *, Function *, CompileUnit *);
43 |
44 | extern Node *exprNodeStar(Node *);
45 | extern void exprNodeStarPrint(Node *);
46 | extern bool exprNodeStarResolve(Node *, Function *, CompileUnit *);
47 |
48 | extern Node *exprNodeDot(Node *, Node *);
49 | extern void exprNodeDotPrint(Node *);
50 | extern bool exprNodeDotResolve(Node *, Function *, CompileUnit *);
51 |
52 | extern Node *exprNodeArrow(Node *, Node *);
53 | extern void exprNodeArrowPrint(Node *);
54 | extern bool exprNodeArrowResolve(Node *, Function *, CompileUnit *);
55 |
56 | extern Node *exprNodeAddr(Node *);
57 | extern void exprNodeAddrPrint(Node *);
58 | extern bool exprNodeAddrResolve(Node *, Function *, CompileUnit *);
59 |
60 | extern Node *exprNodeSizeof(Node *);
61 | extern void exprNodeSizeofPrint(Node *);
62 | extern bool exprNodeSizeofResolve(Node *, Function *, CompileUnit *);
63 |
64 | extern Node *exprNodeArray(Node *, Node *);
65 | extern void exprNodeArrayPrint(Node *);
66 | extern bool exprNodeArrayResolve(Node *, Function *, CompileUnit *);
67 |
68 | #define YYSTYPE struct Node *
69 |
--------------------------------------------------------------------------------
/jni/src/gb/GB.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef VBA_GB_GB_H
21 | #define VBA_GB_GB_H
22 |
23 | #define C_FLAG 0x10
24 | #define H_FLAG 0x20
25 | #define N_FLAG 0x40
26 | #define Z_FLAG 0x80
27 |
28 | typedef union {
29 | struct {
30 | #ifdef WORDS_BIGENDIAN
31 | u8 B1, B0;
32 | #else
33 | u8 B0,B1;
34 | #endif
35 | } B;
36 | u16 W;
37 | } gbRegister;
38 |
39 | extern bool gbLoadRom(const char *);
40 | extern void gbEmulate(int);
41 | extern bool gbIsGameboyRom(const char *);
42 | extern void gbSoundReset();
43 | extern void gbSoundSetQuality(int);
44 | extern void gbReset();
45 | extern void gbCleanUp();
46 | extern bool gbWriteBatteryFile(const char *);
47 | extern bool gbWriteBatteryFile(const char *, bool);
48 | extern bool gbReadBatteryFile(const char *);
49 | extern bool gbWriteSaveState(const char *);
50 | extern bool gbWriteMemSaveState(char *, int);
51 | extern bool gbReadSaveState(const char *);
52 | extern bool gbReadMemSaveState(char *, int);
53 | extern void gbSgbRenderBorder();
54 | extern bool gbWritePNGFile(const char *);
55 | extern bool gbWriteBMPFile(const char *);
56 | extern bool gbReadGSASnapshot(const char *);
57 |
58 | extern struct EmulatedSystem GBSystem;
59 |
60 | #endif
61 |
--------------------------------------------------------------------------------
/jni/src/gb/Makefile.am:
--------------------------------------------------------------------------------
1 | noinst_LIBRARIES = libgb.a
2 |
3 | libgb_a_SOURCES = \
4 | gbCheats.cpp \
5 | gbCheats.h \
6 | gbCodesCB.h \
7 | gbCodes.h \
8 | GB.cpp \
9 | GB.h \
10 | gbDis.cpp \
11 | gbGfx.cpp \
12 | gbGlobals.cpp \
13 | gbGlobals.h \
14 | gbMemory.cpp \
15 | gbMemory.h \
16 | gbPrinter.cpp \
17 | gbPrinter.h \
18 | gbSGB.cpp \
19 | gbSGB.h \
20 | gbSound.cpp \
21 | gbSound.h
22 |
--------------------------------------------------------------------------------
/jni/src/gb/gbCheats.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #ifndef __VBA_GB_GBCHEATS_H
21 | #define __VBA_GB_GBCHEATS_H
22 |
23 | #include "../System.h"
24 |
25 | struct gbXxCheat {
26 | char cheatDesc[100];
27 | char cheatCode[20];
28 | };
29 |
30 | struct gbCheat {
31 | char cheatCode[20];
32 | char cheatDesc[32];
33 | u16 address;
34 | int code;
35 | u8 compare;
36 | u8 value;
37 | bool enabled;
38 | };
39 |
40 | extern void gbCheatsSaveGame(gzFile);
41 | extern void gbCheatsReadGame(gzFile, int);
42 | extern void gbCheatsSaveCheatList(const char *);
43 | extern bool gbCheatsLoadCheatList(const char *);
44 | extern bool gbCheatReadGSCodeFile(const char *);
45 |
46 | extern void gbAddGsCheat(const char *, const char*);
47 | extern void gbAddGgCheat(const char *, const char*);
48 | extern void gbCheatRemove(int);
49 | extern void gbCheatRemoveAll();
50 | extern void gbCheatEnable(int);
51 | extern void gbCheatDisable(int);
52 | extern u8 gbCheatRead(u16);
53 |
54 | extern int gbCheatNumber;
55 | extern gbCheat gbCheatList[100];
56 | extern bool gbCheatMap[0x10000];
57 | #endif
58 |
59 |
--------------------------------------------------------------------------------
/jni/src/gb/gbGlobals.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include "../GBA.h"
20 |
21 | u8 *gbMemoryMap[16];
22 |
23 | int gbRomSizeMask = 0;
24 | int gbRomSize = 0;
25 | int gbRamSizeMask = 0;
26 | int gbRamSize = 0;
27 |
28 | u8 *gbMemory = NULL;
29 | u8 *gbVram = NULL;
30 | u8 *gbRom = NULL;
31 | u8 *gbRam = NULL;
32 | u8 *gbWram = NULL;
33 | u16 *gbLineBuffer = NULL;
34 |
35 | u16 gbPalette[128];
36 | u8 gbBgp[4] = { 0, 1, 2, 3};
37 | u8 gbObp0[4] = { 0, 1, 2, 3};
38 | u8 gbObp1[4] = { 0, 1, 2, 3};
39 | int gbWindowLine = -1;
40 |
41 | int gbCgbMode = 0;
42 |
43 | u16 gbColorFilter[32768];
44 | int gbColorOption = 0;
45 | int gbPaletteOption = 0;
46 | int gbEmulatorType = 0;
47 | int gbBorderOn = 1;
48 | int gbBorderAutomatic = 0;
49 | int gbBorderLineSkip = 160;
50 | int gbBorderRowSkip = 0;
51 | int gbBorderColumnSkip = 0;
52 | int gbDmaTicks = 0;
53 |
54 | u8 (*gbSerialFunction)(u8) = NULL;
55 |
--------------------------------------------------------------------------------
/jni/src/gb/gbGlobals.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | extern int gbRomSizeMask;
21 | extern int gbRomSize;
22 | extern int gbRamSize;
23 | extern int gbRamSizeMask;
24 |
25 | extern u8 *gbRom;
26 | extern u8 *gbRam;
27 | extern u8 *gbVram;
28 | extern u8 *gbWram;
29 | extern u8 *gbMemory;
30 | extern u16 *gbLineBuffer;
31 |
32 | extern u8 *gbMemoryMap[16];
33 |
34 | extern int gbFrameSkip;
35 | extern u16 gbColorFilter[32768];
36 | extern int gbColorOption;
37 | extern int gbPaletteOption;
38 | extern int gbEmulatorType;
39 | extern int gbBorderOn;
40 | extern int gbBorderAutomatic;
41 | extern int gbCgbMode;
42 | extern int gbSgbMode;
43 | extern int gbWindowLine;
44 | extern int gbSpeed;
45 | extern u8 gbBgp[4];
46 | extern u8 gbObp0[4];
47 | extern u8 gbObp1[4];
48 | extern u16 gbPalette[128];
49 |
50 | extern u8 register_LCDC;
51 | extern u8 register_LY;
52 | extern u8 register_SCY;
53 | extern u8 register_SCX;
54 | extern u8 register_WY;
55 | extern u8 register_WX;
56 | extern u8 register_VBK;
57 |
58 | extern int emulating;
59 |
60 | extern int gbBorderLineSkip;
61 | extern int gbBorderRowSkip;
62 | extern int gbBorderColumnSkip;
63 | extern int gbDmaTicks;
64 |
65 | extern void gbRenderLine();
66 | extern void gbDrawSprites();
67 |
68 | extern u8 (*gbSerialFunction)(u8);
69 |
--------------------------------------------------------------------------------
/jni/src/gb/gbMemory.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #include
21 |
22 | struct mapperMBC1 {
23 | int mapperRAMEnable;
24 | int mapperROMBank;
25 | int mapperRAMBank;
26 | int mapperMemoryModel;
27 | int mapperROMHighAddress;
28 | int mapperRAMAddress;
29 | };
30 |
31 | struct mapperMBC2 {
32 | int mapperRAMEnable;
33 | int mapperROMBank;
34 | };
35 |
36 | struct mapperMBC3 {
37 | int mapperRAMEnable;
38 | int mapperROMBank;
39 | int mapperRAMBank;
40 | int mapperRAMAddress;
41 | int mapperClockLatch;
42 | int mapperClockRegister;
43 | int mapperSeconds;
44 | int mapperMinutes;
45 | int mapperHours;
46 | int mapperDays;
47 | int mapperControl;
48 | int mapperLSeconds;
49 | int mapperLMinutes;
50 | int mapperLHours;
51 | int mapperLDays;
52 | int mapperLControl;
53 | time_t mapperLastTime;
54 | };
55 |
56 | struct mapperMBC5 {
57 | int mapperRAMEnable;
58 | int mapperROMBank;
59 | int mapperRAMBank;
60 | int mapperROMHighAddress;
61 | int mapperRAMAddress;
62 | int isRumbleCartridge;
63 | };
64 |
65 | struct mapperMBC7 {
66 | int mapperRAMEnable;
67 | int mapperROMBank;
68 | int mapperRAMBank;
69 | int mapperRAMAddress;
70 | int cs;
71 | int sk;
72 | int state;
73 | int buffer;
74 | int idle;
75 | int count;
76 | int code;
77 | int address;
78 | int writeEnable;
79 | int value;
80 | };
81 |
82 | struct mapperHuC1 {
83 | int mapperRAMEnable;
84 | int mapperROMBank;
85 | int mapperRAMBank;
86 | int mapperMemoryModel;
87 | int mapperROMHighAddress;
88 | int mapperRAMAddress;
89 | };
90 |
91 | struct mapperHuC3 {
92 | int mapperRAMEnable;
93 | int mapperROMBank;
94 | int mapperRAMBank;
95 | int mapperRAMAddress;
96 | int mapperAddress;
97 | int mapperRAMFlag;
98 | int mapperRAMValue;
99 | int mapperRegister1;
100 | int mapperRegister2;
101 | int mapperRegister3;
102 | int mapperRegister4;
103 | int mapperRegister5;
104 | int mapperRegister6;
105 | int mapperRegister7;
106 | int mapperRegister8;
107 | };
108 |
109 | extern mapperMBC1 gbDataMBC1;
110 | extern mapperMBC2 gbDataMBC2;
111 | extern mapperMBC3 gbDataMBC3;
112 | extern mapperMBC5 gbDataMBC5;
113 | extern mapperHuC1 gbDataHuC1;
114 | extern mapperHuC3 gbDataHuC3;
115 |
116 | void mapperMBC1ROM(u16,u8);
117 | void mapperMBC1RAM(u16,u8);
118 | void mapperMBC2ROM(u16,u8);
119 | void mapperMBC2RAM(u16,u8);
120 | void mapperMBC3ROM(u16,u8);
121 | void mapperMBC3RAM(u16,u8);
122 | u8 mapperMBC3ReadRAM(u16);
123 | void mapperMBC5ROM(u16,u8);
124 | void mapperMBC5RAM(u16,u8);
125 | void mapperMBC7ROM(u16,u8);
126 | void mapperMBC7RAM(u16,u8);
127 | u8 mapperMBC7ReadRAM(u16);
128 | void mapperHuC1ROM(u16,u8);
129 | void mapperHuC1RAM(u16,u8);
130 | void mapperHuC3ROM(u16,u8);
131 | void mapperHuC3RAM(u16,u8);
132 | u8 mapperHuC3ReadRAM(u16);
133 |
134 | //extern void (*mapper)(u16,u8);
135 | //extern void (*mapperRAM)(u16,u8);
136 | //extern u8 (*mapperReadRAM)(u16);
137 |
138 | extern void memoryUpdateMapMBC1();
139 | extern void memoryUpdateMapMBC2();
140 | extern void memoryUpdateMapMBC3();
141 | extern void memoryUpdateMapMBC5();
142 | extern void memoryUpdateMapMBC7();
143 | extern void memoryUpdateMapHuC1();
144 | extern void memoryUpdateMapHuC3();
145 |
146 |
147 |
148 |
149 |
150 |
--------------------------------------------------------------------------------
/jni/src/gb/gbPrinter.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | extern u8 gbPrinterSend(u8 b);
21 |
--------------------------------------------------------------------------------
/jni/src/gb/gbSGB.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | void gbSgbInit();
21 | void gbSgbShutdown();
22 | void gbSgbCommand();
23 | void gbSgbResetPacketState();
24 | void gbSgbReset();
25 | void gbSgbDoBitTransfer(u8);
26 | void gbSgbSaveGame(gzFile);
27 | void gbSgbReadGame(gzFile, int version);
28 | void gbSgbRenderBorder();
29 |
30 | extern u8 gbSgbATF[20*18];
31 | extern int gbSgbMode;
32 | extern int gbSgbMask;
33 | extern int gbSgbMultiplayer;
34 | extern u8 gbSgbNextController;
35 | extern int gbSgbPacketTimeout;
36 | extern u8 gbSgbReadingController;
37 | extern int gbSgbFourPlayers;
38 |
39 |
40 |
--------------------------------------------------------------------------------
/jni/src/gb/gbSound.h:
--------------------------------------------------------------------------------
1 | // -*- C++ -*-
2 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
3 | // Copyright (C) 1999-2003 Forgotten
4 | // Copyright (C) 2004 Forgotten and the VBA development team
5 |
6 | // This program is free software; you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation; either version 2, or(at your option)
9 | // any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | // You should have received a copy of the GNU General Public License
17 | // along with this program; if not, write to the Free Software Foundation,
18 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 |
20 | #define NR10 0xff10
21 | #define NR11 0xff11
22 | #define NR12 0xff12
23 | #define NR13 0xff13
24 | #define NR14 0xff14
25 | #define NR21 0xff16
26 | #define NR22 0xff17
27 | #define NR23 0xff18
28 | #define NR24 0xff19
29 | #define NR30 0xff1a
30 | #define NR31 0xff1b
31 | #define NR32 0xff1c
32 | #define NR33 0xff1d
33 | #define NR34 0xff1e
34 | #define NR41 0xff20
35 | #define NR42 0xff21
36 | #define NR43 0xff22
37 | #define NR44 0xff23
38 | #define NR50 0xff24
39 | #define NR51 0xff25
40 | #define NR52 0xff26
41 |
42 | #define SOUND_EVENT(address,value) \
43 | gbSoundEvent(address,value)
44 |
45 | extern void gbSoundTick();
46 | extern void gbSoundPause();
47 | extern void gbSoundResume();
48 | extern void gbSoundEnable(int);
49 | extern void gbSoundDisable(int);
50 | extern int gbSoundGetEnable();
51 | extern void gbSoundReset();
52 | extern void gbSoundSaveGame(gzFile);
53 | extern void gbSoundReadGame(int,gzFile);
54 | extern void gbSoundEvent(register u16, register int);
55 | extern void gbSoundSetQuality(int);
56 |
57 | extern int soundTicks;
58 | extern int soundQuality;
59 | extern int SOUND_CLOCK_TICKS;
60 |
--------------------------------------------------------------------------------
/jni/src/memgzio.h:
--------------------------------------------------------------------------------
1 | /* gzio.c -- IO on .gz files
2 | * Copyright (C) 1995-2002 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | *
5 | * Compile this file with -DNO_DEFLATE to avoid the compression code.
6 | */
7 |
8 | /* memgzio.c - IO on .gz files in memory
9 | * Adapted from original gzio.c from zlib library by Forgotten
10 | */
11 | #ifndef HAVE_ZUTIL_H
12 | #include "../win32/include/zlib/zutil.h"
13 | #else
14 | #include
15 | #endif
16 |
17 | gzFile ZEXPORT memgzopen(char *memory, int, const char *);
18 | int ZEXPORT memgzread(gzFile, voidp, unsigned);
19 | int ZEXPORT memgzwrite(gzFile, const voidp, unsigned);
20 | int ZEXPORT memgzclose(gzFile);
21 | long ZEXPORT memtell(gzFile);
22 |
--------------------------------------------------------------------------------
/jni/src/simple2x.cpp:
--------------------------------------------------------------------------------
1 | // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
2 | // Copyright (C) 1999-2003 Forgotten
3 | // Copyright (C) 2004 Forgotten and the VBA development team
4 |
5 | // This program is free software; you can redistribute it and/or modify
6 | // it under the terms of the GNU General Public License as published by
7 | // the Free Software Foundation; either version 2, or(at your option)
8 | // any later version.
9 | //
10 | // This program is distributed in the hope that it will be useful,
11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | // GNU General Public License for more details.
14 | //
15 | // You should have received a copy of the GNU General Public License
16 | // along with this program; if not, write to the Free Software Foundation,
17 | // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | #include "System.h"
20 |
21 | void Simple2x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */,
22 | u8 *dstPtr, u32 dstPitch, int width, int height)
23 | {
24 | u8 *nextLine, *finish;
25 |
26 | nextLine = dstPtr + dstPitch;
27 |
28 | do {
29 | u32 *bP = (u32 *) srcPtr;
30 | u32 *dP = (u32 *) dstPtr;
31 | u32 *nL = (u32 *) nextLine;
32 | u32 currentPixel;
33 |
34 | finish = (u8 *) bP + ((width+2) << 1);
35 | currentPixel = *bP++;
36 |
37 | do {
38 | #ifdef WORDS_BIGENDIAN
39 | u32 color = currentPixel >> 16;
40 | #else
41 | u32 color = currentPixel & 0xffff;
42 | #endif
43 |
44 | color = color | (color << 16);
45 |
46 | *(dP) = color;
47 | *(nL) = color;
48 |
49 | #ifdef WORDS_BIGENDIAN
50 | color = currentPixel & 0xffff;
51 | #else
52 | color = currentPixel >> 16;
53 | #endif
54 | color = color| (color << 16);
55 | *(dP + 1) = color;
56 | *(nL + 1) = color;
57 |
58 | currentPixel = *bP++;
59 |
60 | dP += 2;
61 | nL += 2;
62 | } while ((u8 *) bP < finish);
63 |
64 | srcPtr += srcPitch;
65 | dstPtr += dstPitch << 1;
66 | nextLine += dstPitch << 1;
67 | }
68 | while (--height);
69 | }
70 |
71 | void Simple2x32(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */,
72 | u8 *dstPtr, u32 dstPitch, int width, int height)
73 | {
74 | u8 *nextLine, *finish;
75 |
76 | nextLine = dstPtr + dstPitch;
77 |
78 | do {
79 | u32 *bP = (u32 *) srcPtr;
80 | u32 *dP = (u32 *) dstPtr;
81 | u32 *nL = (u32 *) nextLine;
82 | u32 currentPixel;
83 |
84 | finish = (u8 *) bP + ((width+1) << 2);
85 | currentPixel = *bP++;
86 |
87 | do {
88 | u32 color = currentPixel;
89 |
90 | *(dP) = color;
91 | *(dP+1) = color;
92 | *(nL) = color;
93 | *(nL + 1) = color;
94 |
95 | currentPixel = *bP++;
96 |
97 | dP += 2;
98 | nL += 2;
99 | } while ((u8 *) bP < finish);
100 |
101 | srcPtr += srcPitch;
102 | dstPtr += dstPitch << 1;
103 | nextLine += dstPitch << 1;
104 | }
105 | while (--height);
106 | }
107 |
--------------------------------------------------------------------------------
/jni/zlib/.cvsignore:
--------------------------------------------------------------------------------
1 | zlib.vcproj.A2.Spacy.user
2 | debug
3 | release
--------------------------------------------------------------------------------
/jni/zlib/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := zlib
6 |
7 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
8 |
9 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
10 |
11 | LOCAL_SRC_FILES := \
12 | $(subst $(LOCAL_PATH)/,, \
13 | $(wildcard $(LOCAL_PATH)/*.c))
14 |
15 | LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
16 | LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid
17 |
18 | include $(BUILD_STATIC_LIBRARY)
19 |
20 |
--------------------------------------------------------------------------------
/jni/zlib/compress.c:
--------------------------------------------------------------------------------
1 | /* compress.c -- compress a memory buffer
2 | * Copyright (C) 1995-2003 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id: compress.c,v 1.1 2006/05/12 21:27:36 spacy51 Exp $ */
7 |
8 | #define ZLIB_INTERNAL
9 | #include "zlib.h"
10 |
11 | /* ===========================================================================
12 | Compresses the source buffer into the destination buffer. The level
13 | parameter has the same meaning as in deflateInit. sourceLen is the byte
14 | length of the source buffer. Upon entry, destLen is the total size of the
15 | destination buffer, which must be at least 0.1% larger than sourceLen plus
16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
17 |
18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer,
20 | Z_STREAM_ERROR if the level parameter is invalid.
21 | */
22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
23 | Bytef *dest;
24 | uLongf *destLen;
25 | const Bytef *source;
26 | uLong sourceLen;
27 | int level;
28 | {
29 | z_stream stream;
30 | int err;
31 |
32 | stream.next_in = (Bytef*)source;
33 | stream.avail_in = (uInt)sourceLen;
34 | #ifdef MAXSEG_64K
35 | /* Check for source > 64K on 16-bit machine: */
36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37 | #endif
38 | stream.next_out = dest;
39 | stream.avail_out = (uInt)*destLen;
40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41 |
42 | stream.zalloc = (alloc_func)0;
43 | stream.zfree = (free_func)0;
44 | stream.opaque = (voidpf)0;
45 |
46 | err = deflateInit(&stream, level);
47 | if (err != Z_OK) return err;
48 |
49 | err = deflate(&stream, Z_FINISH);
50 | if (err != Z_STREAM_END) {
51 | deflateEnd(&stream);
52 | return err == Z_OK ? Z_BUF_ERROR : err;
53 | }
54 | *destLen = stream.total_out;
55 |
56 | err = deflateEnd(&stream);
57 | return err;
58 | }
59 |
60 | /* ===========================================================================
61 | */
62 | int ZEXPORT compress (dest, destLen, source, sourceLen)
63 | Bytef *dest;
64 | uLongf *destLen;
65 | const Bytef *source;
66 | uLong sourceLen;
67 | {
68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
69 | }
70 |
71 | /* ===========================================================================
72 | If the default memLevel or windowBits for deflateInit() is changed, then
73 | this function needs to be updated.
74 | */
75 | uLong ZEXPORT compressBound (sourceLen)
76 | uLong sourceLen;
77 | {
78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
79 | }
80 |
--------------------------------------------------------------------------------
/jni/zlib/inffast.h:
--------------------------------------------------------------------------------
1 | /* inffast.h -- header to use inffast.c
2 | * Copyright (C) 1995-2003 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | void inflate_fast OF((z_streamp strm, unsigned start));
12 |
--------------------------------------------------------------------------------
/jni/zlib/inftrees.h:
--------------------------------------------------------------------------------
1 | /* inftrees.h -- header to use inftrees.c
2 | * Copyright (C) 1995-2005 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | /* Structure for decoding tables. Each entry provides either the
12 | information needed to do the operation requested by the code that
13 | indexed that table entry, or it provides a pointer to another
14 | table that indexes more bits of the code. op indicates whether
15 | the entry is a pointer to another table, a literal, a length or
16 | distance, an end-of-block, or an invalid code. For a table
17 | pointer, the low four bits of op is the number of index bits of
18 | that table. For a length or distance, the low four bits of op
19 | is the number of extra bits to get after the code. bits is
20 | the number of bits in this code or part of the code to drop off
21 | of the bit buffer. val is the actual byte to output in the case
22 | of a literal, the base length or distance, or the offset from
23 | the current table to the next table. Each entry is four bytes. */
24 | typedef struct {
25 | unsigned char op; /* operation, extra bits, table bits */
26 | unsigned char bits; /* bits in this part of the code */
27 | unsigned short val; /* offset in table or code value */
28 | } code;
29 |
30 | /* op values as set by inflate_table():
31 | 00000000 - literal
32 | 0000tttt - table link, tttt != 0 is the number of table index bits
33 | 0001eeee - length or distance, eeee is the number of extra bits
34 | 01100000 - end of block
35 | 01000000 - invalid code
36 | */
37 |
38 | /* Maximum size of dynamic tree. The maximum found in a long but non-
39 | exhaustive search was 1444 code structures (852 for length/literals
40 | and 592 for distances, the latter actually the result of an
41 | exhaustive search). The true maximum is not known, but the value
42 | below is more than safe. */
43 | #define ENOUGH 2048
44 | #define MAXD 592
45 |
46 | /* Type of code to build for inftable() */
47 | typedef enum {
48 | CODES,
49 | LENS,
50 | DISTS
51 | } codetype;
52 |
53 | extern int inflate_table OF((codetype type, unsigned short FAR *lens,
54 | unsigned codes, code FAR * FAR *table,
55 | unsigned FAR *bits, unsigned short FAR *work));
56 |
--------------------------------------------------------------------------------
/jni/zlib/uncompr.c:
--------------------------------------------------------------------------------
1 | /* uncompr.c -- decompress a memory buffer
2 | * Copyright (C) 1995-2003 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id: uncompr.c,v 1.1 2006/05/12 21:27:37 spacy51 Exp $ */
7 |
8 | #define ZLIB_INTERNAL
9 | #include "zlib.h"
10 |
11 | /* ===========================================================================
12 | Decompresses the source buffer into the destination buffer. sourceLen is
13 | the byte length of the source buffer. Upon entry, destLen is the total
14 | size of the destination buffer, which must be large enough to hold the
15 | entire uncompressed data. (The size of the uncompressed data must have
16 | been saved previously by the compressor and transmitted to the decompressor
17 | by some mechanism outside the scope of this compression library.)
18 | Upon exit, destLen is the actual size of the compressed buffer.
19 | This function can be used to decompress a whole file at once if the
20 | input file is mmap'ed.
21 |
22 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
23 | enough memory, Z_BUF_ERROR if there was not enough room in the output
24 | buffer, or Z_DATA_ERROR if the input data was corrupted.
25 | */
26 | int ZEXPORT uncompress (dest, destLen, source, sourceLen)
27 | Bytef *dest;
28 | uLongf *destLen;
29 | const Bytef *source;
30 | uLong sourceLen;
31 | {
32 | z_stream stream;
33 | int err;
34 |
35 | stream.next_in = (Bytef*)source;
36 | stream.avail_in = (uInt)sourceLen;
37 | /* Check for source > 64K on 16-bit machine: */
38 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
39 |
40 | stream.next_out = dest;
41 | stream.avail_out = (uInt)*destLen;
42 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
43 |
44 | stream.zalloc = (alloc_func)0;
45 | stream.zfree = (free_func)0;
46 |
47 | err = inflateInit(&stream);
48 | if (err != Z_OK) return err;
49 |
50 | err = inflate(&stream, Z_FINISH);
51 | if (err != Z_STREAM_END) {
52 | inflateEnd(&stream);
53 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
54 | return Z_DATA_ERROR;
55 | return err;
56 | }
57 | *destLen = stream.total_out;
58 |
59 | err = inflateEnd(&stream);
60 | return err;
61 | }
62 |
--------------------------------------------------------------------------------
/libs/GoogleAdMobAdsSdk-6.4.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/libs/GoogleAdMobAdsSdk-6.4.1.jar
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zzy619/GBA-Emulator-android/68e03482a5d26820d9d8e47d5ff3a64200d5efa0/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/res/layout-land/main.xml:
--------------------------------------------------------------------------------
1 |
7 |
14 |
15 |
19 |
20 |
21 |
28 |
29 |
30 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/res/layout-large-land/main.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/layout-large/main.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/layout/cheat_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
20 |
26 |
27 |
28 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/res/layout/file_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/layout/gameshark.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
11 |
12 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
33 |
34 |
39 |
40 |
47 |
48 |
53 |
54 |
55 |
56 |
61 |
62 |
63 |
67 |
68 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
16 |
17 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/layout/save_state.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/res/layout/select_game.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
14 |
17 |
25 |
26 |
27 |
28 |
29 |
35 |
43 |
44 |
45 |
46 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/res/layout/state_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
26 |
27 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | GBA
5 | Settings
6 | Hello world!
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/van/gba/Cheat.java:
--------------------------------------------------------------------------------
1 | package com.van.gba;
2 |
3 | public class Cheat
4 | {
5 | public String mDescription = "";
6 | public String mCode = "";
7 | public boolean mEnable = true;
8 | public Cheat(String description, String code, boolean enable)
9 | {
10 | mDescription = description;
11 | mCode = code;
12 | mEnable = enable;
13 | }
14 | }
--------------------------------------------------------------------------------
/src/com/van/gba/LoadStateActivity.java:
--------------------------------------------------------------------------------
1 | package com.van.gba;
2 |
3 | import java.io.File;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | //import com.google.ads.AdRequest;
8 | //import com.google.ads.AdSize;
9 | //import com.google.ads.AdView;
10 | //import com.van.fceux2.MainActivity;
11 |
12 | import android.app.Activity;
13 | import android.content.Intent;
14 | import android.graphics.Bitmap;
15 | import android.graphics.BitmapFactory;
16 | import android.os.Bundle;
17 | import android.os.Environment;
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.AdapterView;
21 | import android.widget.ListView;
22 | import android.widget.AdapterView.OnItemClickListener;
23 | import com.van.gba.R;
24 |
25 | public class LoadStateActivity extends Activity {
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState)
28 | {
29 | super.onCreate(savedInstanceState);
30 | this.setContentView(R.layout.save_state);
31 |
32 | // AdView adView = new AdView(this, AdSize.BANNER, MainActivity.admodId);
33 | // ViewGroup adsContainer = (ViewGroup)this.findViewById(R.id.adsContainer);
34 | // adsContainer.addView(adView);
35 | // AdRequest oAdRequest = new AdRequest();
36 | // adView.loadAd(oAdRequest);
37 |
38 | List bms = new ArrayList();
39 | List ss = new ArrayList();
40 | for(int i=0; i<10; i++)
41 | ss.add("" + i);
42 |
43 | String strPath = Environment.getExternalStorageDirectory().getAbsolutePath();
44 | strPath += "/Android/data/" + this.getApplication().getPackageName() + "/";
45 | String strTemp = org.libsdl.app.SDLActivity.mRomFile.substring(org.libsdl.app.SDLActivity.mRomFile.lastIndexOf("/") + 1);
46 | strTemp = strTemp.substring(0, strTemp.lastIndexOf("."));
47 |
48 |
49 | for(int i=0; i<10; i++)
50 | {
51 | String strStateFile = strPath + strTemp + i + ".sgm";
52 | //String strStateFile = strPrefix + ".fc" + i;
53 | File file = new File(strStateFile);
54 | if(file.exists())
55 | {
56 | ss.set(i, strStateFile);
57 | String strImageFile = strStateFile + ".png";
58 | File imageFile = new File(strImageFile);
59 | if(imageFile.exists())
60 | {
61 | Bitmap bm = BitmapFactory.decodeFile(strImageFile);
62 | bms.add(bm);
63 | }
64 | else
65 | {
66 | bms.add(null);
67 | }
68 | }
69 | else
70 | {
71 | bms.add(null);
72 | }
73 | }
74 |
75 | ListView lv = (ListView)this.findViewById(R.id.ListStates);
76 |
77 | lv.setAdapter(new SaveStateAdapter(this, R.layout.state_view, ss, bms));
78 | lv.setOnItemClickListener(new OnItemClickListener(){
79 | @Override
80 | public void onItemClick(AdapterView> arg0, View arg1, int arg2, long arg3) {
81 | org.libsdl.app.SDLActivity.strStateSlot = "" + arg2;
82 | LoadStateActivity.this.finish();
83 | }});
84 | }
85 |
86 | @Override
87 | public void onBackPressed()
88 | {
89 | org.libsdl.app.SDLActivity.strStateSlot = "";
90 | finish();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------