Merge pull request #1 from libretro/master

Rebase
This commit is contained in:
Wes Smith 2019-04-15 22:27:52 -04:00 committed by GitHub
commit b6bb24e016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 22925 additions and 21669 deletions

3
.gitignore vendored
View File

@ -6,10 +6,13 @@ src/wx/cmdtab.cpp
src/wx/wxvbam.xrs
build/*
build32/*
vsbuild/*
dependencies/*
vcpkg/*
.vs/*
*.o
*.so
*.dll
*.exe
# vim swap files

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "dependencies"]
path = dependencies
url = https://github.com/visualboyadvance-m/dependencies.git
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/Microsoft/vcpkg.git

View File

@ -1,6 +1,9 @@
---
sudo: required
services:
- xvfb
matrix:
fast_finish: true
include:
@ -15,38 +18,38 @@ matrix:
- cd build
- cmake ..
- make -j2
# - ./visualboyadvance-m --help
# - xvfb-run ./visualboyadvance-m --help
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mingw-w64
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-x86_64
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake ..
- make -j2
cache:
directories:
- "$HOME/.ccache"
- env: BUILD_ENV=mingw-w32
language: cpp
os: linux
dist: trusty
before_script:
- ./installdeps MinGW-w64-i686
script:
- mkdir build
- cd build
- /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake ..
- make -j2
cache:
directories:
- "$HOME/.ccache"
# - env: BUILD_ENV=mingw-w64
# language: cpp
# os: linux
# dist: trusty
# before_script:
# - ./installdeps MinGW-w64-x86_64
# script:
# - mkdir build
# - cd build
# - /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake ..
# - make -j2
# cache:
# directories:
# - "$HOME/.ccache"
# - env: BUILD_ENV=mingw-w32
# language: cpp
# os: linux
# dist: trusty
# before_script:
# - ./installdeps MinGW-w64-i686
# script:
# - mkdir build
# - cd build
# - /usr/lib/mxe/usr/bin/i686-w64-mingw32.static-cmake ..
# - make -j2
# cache:
# directories:
# - "$HOME/.ccache"
- env: BUILD_ENV=libretro
language: cpp
os: linux

View File

@ -1,3 +1,25 @@
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # link to full path of libs
cmake_policy(SET CMP0005 NEW) # escapes in add_definitions
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW) # use vars for options
endif()
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
cmake_policy(SET CMP0043 NEW) # for wxWidgets, use generator expressions
endif()
endif()
option(ENABLE_VCPKG "Use dependencies for Visual Studio from vcpkg" ON)
set(NLS_DEFAULT ON)
# get win32 deps before project declaration, because toolchain is set for vcpkg
set(VCPKG_DEPS zlib libpng SDL2 SFML gettext wxWidgets)
include(${CMAKE_SOURCE_DIR}/cmake/Win32Deps.cmake)
project(VBA-M C CXX)
cmake_minimum_required(VERSION 2.8.12)
@ -12,19 +34,13 @@ endif()
set(ALL_TARGETS fex visualboyadvance-m vbamcore vbam)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # link to full path of libs
cmake_policy(SET CMP0005 NEW) # escapes in add_definitions
endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#Output all binaries at top level
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
option(ENABLE_SDL "Build the SDL port" OFF)
option(ENABLE_WX "Build the wxWidgets port" ON)
option(ENABLE_DEBUGGER "Enable the debugger" ON)
option(ENABLE_NLS "Enable translations" ON)
option(ENABLE_ASAN "Enable -fsanitize=<option>, address by default, requires debug build" OFF)
option(VBAM_STATIC "Try to link all libraries statically" OFF)
@ -37,7 +53,15 @@ if(VBAM_STATIC)
set(OPENAL_STATIC ON)
endif()
set(ASM_DEFAULT OFF)
set(ENABLE_BUNDLED_LIBS_DEFAULT OFF)
# on visual studio use all bundled stuff
if(MSVC)
set(ENABLE_BUNDLED_LIBS_DEFAULT ON)
endif()
# XXX: do some stuff with this
#option(ENABLE_BUNDLED_LIBS "Use bundled libraries instead of system libraries" ${ENABLE_BUNDLED_LIBS_DEFAULT})
# use ccache if available, and not already enabled on the command line
# but not with ninja and msys ccache on msys2
@ -51,32 +75,14 @@ if(NOT (WIN32 AND (NOT $ENV{MSYSTEM} STREQUAL "") AND CMAKE_GENERATOR STREQUAL N
endif()
endif()
if(NOT CMAKE_SYSTEM_PROCESSOR)
if(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
elseif(CMAKE_TOOLCHAIN_FILE MATCHES mxe)
if(CMAKE_TOOLCHAIN_FILE MATCHES "i[3-9]86")
set(CMAKE_SYSTEM_PROCESSOR i686)
else()
set(CMAKE_SYSTEM_PROCESSOR x86_64)
endif()
endif()
endif()
# turn asm on by default on 32bit x86
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
set(ASM_DEFAULT ON)
set(X86_32 ON)
else()
set(AMD64 ON)
endif()
endif()
set(SSP_DEFAULT OFF)
option(ENABLE_SSP "Enable gcc stack protector support" ${SSP_DEFAULT})
set(ASM_DEFAULT OFF)
include(Architecture)
option(ENABLE_ASM "Enable x86 ASM related options" ${ASM_DEFAULT})
# The ARM ASM core seems to be very buggy, see #98 and #54. Default to it being
@ -110,8 +116,9 @@ option(ENABLE_FFMPEG "Enable ffmpeg A/V recording" ${FFMPEG_DEFAULT})
set(LTO_DEFAULT ON)
if(WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND AMD64)
# lto produces buggy binaries for 64 bit win32
# lto produces buggy binaries for 64 bit win32
# and we generally don't want it when debugging because it makes linking slow
if((WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND AMD64) OR CMAKE_BUILD_TYPE MATCHES Debug)
set(LTO_DEFAULT OFF)
endif()
@ -123,15 +130,22 @@ endif()
option(ENABLE_GBA_LOGGING "Enable extended GBA logging" ON)
if(ENABLE_GBA_LOGGING)
add_definitions(-DGBA_LOGGING )
add_definitions(-DGBA_LOGGING )
endif()
if(ENABLE_MMX)
add_definitions(-DMMX)
add_definitions(-DMMX)
endif()
# The SDL port can't be built without debugging support
if(NOT ENABLE_DEBUGGER AND ENABLE_SDL)
message(SEND_ERROR "The SDL port can't be built without debugging support")
message(SEND_ERROR "The SDL port can't be built without debugging support")
endif()
# this has to run after the toolchain is initialized so it can't be in
# Win32deps.cmake
if(MINGW)
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-include")
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include")
endif()
find_package(Git)
@ -155,7 +169,7 @@ endif()
include_directories(${CMAKE_BINARY_DIR})
configure_file("${CMAKE_SOURCE_DIR}/src/version.h.in" "${CMAKE_BINARY_DIR}/version.h" @ONLY)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DDEBUG)
else()
add_definitions(-DNDEBUG)
@ -183,7 +197,11 @@ endif()
# Look for some dependencies using CMake scripts
find_package(ZLIB REQUIRED)
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
find_package(PNG REQUIRED)
if(EXISTS /etc/redhat-release)
@ -204,14 +222,21 @@ add_definitions(${SDL2_DEFINITIONS})
if(ENABLE_LINK)
# msys2 does not have static sfml libs atm
# while on mxe we use static libs
if(WIN32 AND ((NOT (MINGW AND MSYS)) OR CMAKE_TOOLCHAIN_FILE MATCHES mxe))
if(WIN32 AND ((NOT (MINGW AND MSYS)) OR CMAKE_TOOLCHAIN_FILE MATCHES mxe) AND NOT CMAKE_TOOLCHAIN_FILE MATCHES vcpkg)
set(SFML_STATIC_LIBRARIES TRUE)
endif()
find_package(SFML 2 COMPONENTS network system REQUIRED)
find_package(SFML 2 COMPONENTS network system)
if(NOT SFML_FOUND)
message(WARNING "SFML not found, LINK will be disabled")
set(ENABLE_LINK NO)
endif()
endif()
# set the standard libraries all ports use
set(VBAMCORE_LIBS
set(
VBAMCORE_LIBS
vbamcore
fex
${SDL2_LIBRARY}
@ -244,9 +269,9 @@ if(NOT ENABLE_FFMPEG)
endif()
if(ENABLE_LIRC)
set(WITHLIRC 1)
set(WITHLIRC 1)
else()
set(WITHLIRC 0)
set(WITHLIRC 0)
endif()
include(GNUInstallDirs)
@ -297,6 +322,8 @@ if(NOT ENABLE_ASM_CORE)
add_definitions(-DC_CORE)
endif()
option(ENABLE_NLS "Enable translations" ${NLS_DEFAULT})
# Enable internationalization
if(ENABLE_NLS)
set(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
@ -332,37 +359,17 @@ if(ENABLE_NLS)
endif()
endif()
# Win32 deps submodule
if(WIN32)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include")
set(git_checkout FALSE)
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(git_checkout TRUE)
execute_process(COMMAND "${GIT_EXECUTABLE}" submodule update --init --remote --recursive RESULT_VARIABLE git_status WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
endif()
if(NOT (git_checkout AND git_status EQUAL 0))
message(FATAL_ERROR "Please pull in git submodules, e.g.\nrun: git submodule update --init --remote --recursive")
endif()
endif()
if(MINGW)
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-include")
include_directories("${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include")
elseif(MSVC)
set(DEPS_MSVC "${CMAKE_SOURCE_DIR}/dependencies/msvc")
include_directories("${DEPS_MSVC}") # for GL/glext.h and getopt.h
endif()
endif()
include(ProcessorCount)
ProcessorCount(num_cpus)
# Compiler flags
# Compiler stuff
if(CMAKE_C_COMPILER_ID STREQUAL Clang AND CMAKE_CXX_COMPILER_ID STREQUAL Clang)
include(LLVMToolchain)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(LTO_FLAGS "")
unset(LTO_FLAGS)
if(ENABLE_LTO)
if(CMAKE_COMPILER_IS_GNUCXX)
if(num_cpus GREATER 1)
@ -373,6 +380,21 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
else()
set(LTO_FLAGS -flto)
endif()
# check that LTO is not broken before enabling it
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${LTO_FLAGS}")
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("int main(int argc, char** argv) { return 0; }" LTO_WORKS)
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
if(NOT LTO_WORKS)
message(WARNING "LTO does not seem to be working on your system, if using clang make sure LLVMGold is installed")
unset(LTO_FLAGS)
set(ENABLE_LTO OFF)
endif()
endif()
unset(MY_C_OPT_FLAGS)
@ -441,20 +463,34 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
endif()
endif()
set(MY_C_FLAGS ${MY_C_FLAGS} -fopenmp)
endif()
check_cxx_compiler_flag(-fdiagnostics-color=auto COMPILER_COLOR_OUTPUT)
if(COMPILER_COLOR_OUTPUT)
add_compile_options(-fdiagnostics-color=auto)
if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
unset(COMPILER_COLOR_DIAGNOSTICS)
check_cxx_compiler_flag(-fdiagnostics-color=always COMPILER_COLOR_DIAGNOSTICS)
if(COMPILER_COLOR_DIAGNOSTICS)
add_compile_options(-fdiagnostics-color=always)
else()
unset(COMPILER_COLOR_DIAGNOSTICS)
check_cxx_compiler_flag(-fdiagnostics-color COMPILER_COLOR_DIAGNOSTICS)
if(COMPILER_COLOR_DIAGNOSTICS)
add_compile_options(-fdiagnostics-color)
endif()
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
unset(COMPILER_COLOR_DIAGNOSTICS)
check_cxx_compiler_flag(-fcolor-diagnostics COMPILER_COLOR_DIAGNOSTICS)
if(COMPILER_COLOR_DIAGNOSTICS)
add_compile_options(-fcolor-diagnostics)
endif()
endif()
if(MINGW)
set(MY_C_FLAGS ${MY_C_FLAGS} -static-libgcc -static-libstdc++)
endif()
if(CMAKE_BUILD_TYPE STREQUAL Debug)
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(MY_C_FLAGS ${MY_C_FLAGS} ${MY_C_DBG_FLAGS} -Wall -Wextra)
else()
set(MY_C_FLAGS ${MY_C_FLAGS} ${MY_C_OPT_FLAGS} -Wno-error)
@ -537,7 +573,8 @@ endif()
add_subdirectory (fex)
set(SRC_MAIN
set(
SRC_MAIN
src/Util.cpp
src/common/ConfigManager.cpp
src/common/dictionary.c
@ -551,7 +588,8 @@ if(MSVC)
set(SRC_MAIN ${SRC_MAIN} "dependencies/msvc/getopt.c")
endif()
set(HDR_MAIN
set(
HDR_MAIN
src/System.h
src/Util.h
src/common/array.h
@ -577,7 +615,8 @@ if(ENABLE_NLS)
set(HDR_MAIN ${HDR_MAIN} src/NLS.h)
endif()
set(SRC_GBA
set(
SRC_GBA
src/gba/agbprint.cpp
src/gba/bios.cpp
src/gba/BreakpointStructures.cpp
@ -607,7 +646,8 @@ set(SRC_GBA
src/gba/Sram.cpp
)
set(HDR_GBA
set(
HDR_GBA
src/gba/agbprint.h
src/gba/bios.h
src/gba/BreakpointStructures.h
@ -630,7 +670,8 @@ set(HDR_GBA
src/gba/Sram.h
)
set(SRC_GB
set(
SRC_GB
src/gb/GB.cpp
src/gb/gbCheats.cpp
src/gb/gbDis.cpp
@ -642,7 +683,8 @@ set(SRC_GB
src/gb/gbSound.cpp
)
set(HDR_GB
set(
HDR_GB
src/gb/gb.h
src/gb/gbCheats.h
src/gb/gbCodes.h
@ -654,7 +696,8 @@ set(HDR_GB
src/gb/gbSound.h
)
set(SRC_APU
set(
SRC_APU
src/apu/Blip_Buffer.cpp
src/apu/Effects_Buffer.cpp
src/apu/Gb_Apu.cpp
@ -663,7 +706,8 @@ set(SRC_APU
src/apu/Multi_Buffer.cpp
)
set(HDR_APU
set(
HDR_APU
src/apu/blargg_common.h #Unused(?) but in the VS projects
src/apu/blargg_config.h #Unused(?) but in the VS projects
src/apu/blargg_source.h
@ -674,7 +718,8 @@ set(HDR_APU
src/apu/Multi_Buffer.h
)
set(SRC_SDL
set(
SRC_SDL
src/sdl/SDL.cpp
src/sdl/filters.cpp
src/sdl/text.cpp
@ -684,7 +729,8 @@ set(SRC_SDL
src/sdl/expr-lex.cpp
)
set(HDR_SDL
set(
HDR_SDL
src/sdl/filters.h
src/sdl/text.h
src/sdl/inputSDL.h
@ -692,7 +738,8 @@ set(HDR_SDL
src/sdl/exprNode.h
)
set(SRC_FILTERS
set(
SRC_FILTERS
src/filters/2xSaI.cpp
src/filters/admame.cpp
src/filters/bilinear.cpp
@ -705,7 +752,8 @@ set(SRC_FILTERS
src/filters/xBRZ/xbrz.cpp
)
set(HDR_FILTERS
set(
HDR_FILTERS
src/filters/hq2x.h
src/filters/interp.h
src/filters/lq2x.h
@ -713,18 +761,21 @@ set(HDR_FILTERS
src/filters/xBRZ/xbrz.h
)
set(SRC_HQ_C
set(
SRC_HQ_C
src/filters/hq/c/hq_implementation.cpp
)
set(HDR_HQ_C
set(
HDR_HQ_C
src/filters/hq/c/hq3x_pattern.h
src/filters/hq/c/hq4x_pattern.h
src/filters/hq/c/hq_base.h
src/filters/hq/c/hq_shared.h
)
set(SRC_HQ_ASM
set(
SRC_HQ_ASM
src/filters/hq/asm/hq3x_16.asm
src/filters/hq/asm/hq3x_32.asm
src/filters/hq/asm/hq4x_16.asm
@ -744,12 +795,14 @@ else()
endif()
if(ENABLE_DEBUGGER)
set(SRC_DEBUGGER
set(
SRC_DEBUGGER
src/gba/armdis.cpp
src/gba/elf.cpp
src/gba/remote.cpp
)
set(HDR_DEBUGGER
set(
HDR_DEBUGGER
src/gba/armdis.h
src/gba/elf.h
src/gba/remote.h
@ -816,13 +869,17 @@ if(ENABLE_SDL)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vbam${CMAKE_EXECUTABLE_SUFFIX} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
if(WIN32)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
RENAME vbam.cfg)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
RENAME vbam.cfg
)
else()
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
RENAME vbam.cfg)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/sdl/vbam.cfg-example
DESTINATION ${CMAKE_INSTALL_FULL_SYSCONFDIR}
RENAME vbam.cfg
)
endif()
endif()
@ -864,4 +921,5 @@ set(CPACK_PACKAGE_VERSION_MAJOR "2")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "0-Git-" ${COMMITHASH})
list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/dependencies")
list(APPEND CPACK_SOURCE_IGNORE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg")
include(CPack)

53
CMakeSettings.json Normal file
View File

@ -0,0 +1,53 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x64"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}, {
"name": "x86-Release",
"generator": "Ninja",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": ""
}
]
}

View File

@ -60,10 +60,23 @@ cmake ..
make -j`nproc`
```
`./installdeps` is supported on MSys2, Linux (Debian/Ubuntu, Fedora, Arch or
Solus) and Mac OS X (homebrew, macports or fink.)
`./installdeps` is supported on MSys2, Linux (Debian/Ubuntu, Fedora, Arch,
Solus and RHEL/CentOS) and Mac OS X (homebrew, macports or fink.)
The Ninja cmake generator is also now supported, including on msys2.
The Ninja cmake generator is also now supported, including on msys2 and Visual Studio.
### Visual Studio Support
For visual studio, dependency management is handled automatically with vcpkg,
just clone the repository with git and build with cmake. You can do this from
the developer command line as well. 2019 will not work yet for building
dependencies, but you can build the dependencies in 2017 and then use the
project from 2019.
Using your own user-wide installation of vcpkg is supported, just make sure the
environment variable `VCPKG_ROOT` is set.
### Dependencies
If your OS is not supported, you will need the following:

24
cmake/Architecture.cmake Normal file
View File

@ -0,0 +1,24 @@
if(NOT CMAKE_SYSTEM_PROCESSOR)
if(NOT CMAKE_TOOLCHAIN_FILE AND CMAKE_HOST_SYSTEM_PROCESSOR)
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
elseif(CMAKE_TOOLCHAIN_FILE MATCHES mxe)
if(CMAKE_TOOLCHAIN_FILE MATCHES "i[3-9]86")
set(CMAKE_SYSTEM_PROCESSOR i686)
else()
set(CMAKE_SYSTEM_PROCESSOR x86_64)
endif()
endif()
endif()
# turn asm on by default on 32bit x86
# and set WINARCH for windows stuff
if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
if(NOT (MSVC AND CMAKE_TOOLCHAIN_FILE MATCHES vcpkg))
set(ASM_DEFAULT ON)
endif()
set(X86_32 ON)
else()
set(AMD64 ON)
endif()
endif()

32
cmake/LLVMToolchain.cmake Normal file
View File

@ -0,0 +1,32 @@
function(use_llvm_toolchain)
if(CMAKE_C_COMPILER_ID STREQUAL Clang)
set(compiler "${CMAKE_C_COMPILER}")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(compiler "${CMAKE_CXX_COMPILER}")
else()
return()
endif()
foreach(tool ar ranlib ld nm objdump as)
execute_process(
COMMAND "${compiler}" -print-prog-name=llvm-${tool}
OUTPUT_VARIABLE prog_path
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(prog_path MATCHES "^/")
if(tool STREQUAL ld)
set(tool linker)
elseif(tool STREQUAL as)
set(tool asm_compiler)
endif()
string(TOUPPER ${tool} utool)
set(CMAKE_${utool} "${prog_path}" PARENT_SCOPE)
set(CMAKE_${utool} "${prog_path}" CACHE FILEPATH "${tool}" FORCE)
endif()
endforeach()
endfunction()
use_llvm_toolchain()

62
cmake/Win32Deps.cmake Normal file
View File

@ -0,0 +1,62 @@
if(WIN32)
# compiler has not been detected yet maybe
if(CMAKE_C_COMPILER MATCHES "cl\\.exe" OR CMAKE_CXX_COMPILER MATCHES "cl\\.exe" OR MSVC OR DEFINED ENV{VisualStudioVersion})
set(VS TRUE)
endif()
set(WINARCH x86)
if(CMAKE_C_COMPILER MATCHES x64 OR CMAKE_CXX_COMPILER MATCHES x64 OR "$ENV{VSCMD_ARG_TGT_ARCH}" MATCHES x64)
set(WINARCH x64)
endif()
# Win32 deps submodules (dependencies and vcpkg)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/dependencies/mingw-xaudio/include" OR NOT EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
set(git_checkout FALSE)
# find_package(Git)
#if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(git_checkout TRUE)
execute_process(COMMAND git submodule update --init --remote --recursive RESULT_VARIABLE git_status WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
endif()
if(NOT (git_checkout AND git_status EQUAL 0))
message(FATAL_ERROR "Please pull in git submodules, e.g.\nrun: git submodule update --init --remote --recursive")
endif()
endif()
if(VS)
set(DEPS_MSVC "${CMAKE_SOURCE_DIR}/dependencies/msvc")
include_directories("${DEPS_MSVC}") # for GL/glext.h and getopt.h
endif()
if(VS AND ENABLE_VCPKG)
if(NOT DEFINED ENV{VCPKG_ROOT})
set(ENV{VCPKG_ROOT} "${CMAKE_SOURCE_DIR}/vcpkg")
endif()
# build vcpkg if not built
if(NOT EXISTS $ENV{VCPKG_ROOT}/vcpkg.exe)
execute_process(
COMMAND bootstrap-vcpkg.bat
WORKING_DIRECTORY $ENV{VCPKG_ROOT}
)
endif()
foreach(pkg ${VCPKG_DEPS})
#list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${WINARCH}-windows-static)
list(APPEND VCPKG_DEPS_QUALIFIED ${pkg}:${WINARCH}-windows)
endforeach()
# build our deps
execute_process(
COMMAND vcpkg install ${VCPKG_DEPS_QUALIFIED}
WORKING_DIRECTORY $ENV{VCPKG_ROOT}
)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH '' FORCE)
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
set(NLS_DEFAULT OFF)
set(ENABLE_NLS OFF) # not sure why this is necessary
endif()
endif()

View File

@ -20,6 +20,7 @@ int g_allocCountTemp = 0;
void* SzAlloc(void* p, size_t size)
{
(void)p; // unused param
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
@ -31,6 +32,7 @@ void* SzAlloc(void* p, size_t size)
void SzFree(void* p, void* address)
{
(void)p; // unused param
#ifdef _SZ_ALLOC_DEBUG
if (address != 0) {
g_allocCount--;
@ -42,6 +44,7 @@ void SzFree(void* p, void* address)
void* SzAllocTemp(void* p, size_t size)
{
(void)p; // unused param
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
@ -56,6 +59,7 @@ void* SzAllocTemp(void* p, size_t size)
void SzFreeTemp(void* p, void* address)
{
(void)p; // unused param
#ifdef _SZ_ALLOC_DEBUG
if (address != 0) {
g_allocCountTemp--;

View File

@ -325,24 +325,30 @@ size_t utf8_encode_char( unsigned wide, char * target )
target[5] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x4000000;
break;
case 5:
target[4] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x200000;
break;
case 4:
target[3] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x10000;
break;
case 3:
target[2] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0x800;
break;
case 2:
target[1] = 0x80 | ( wide & 0x3F );
wide = wide >> 6;
wide |= 0xC0;
case 1:
break;
case 1:
target[0] = wide;
break;
}
return count;

File diff suppressed because it is too large Load Diff

View File

@ -155,6 +155,8 @@ linux_installdeps() {
debian_installdeps
elif [ -f /etc/fedora-release ]; then
fedora_installdeps
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
rhel_installdeps
elif [ -f /etc/arch-release ]; then
archlinux_installdeps
elif [ -f /etc/solus-release ]; then
@ -280,7 +282,7 @@ debian_installdeps() {
installing
if [ -z "$target" ]; then
sudo apt-get -qq update
sudo apt-get -qq -y update
sfml_libs=$(apt-cache search libsfml | grep -E 'graphics|window|network' | sed 's/ - .*//')
@ -302,13 +304,44 @@ debian_installdeps() {
;;
esac
mxe_apt_sources='/etc/apt/sources.list.d/mxeapt.list'
# if on the travis ubuntu trusty, add xenial sources for newer gnutls
# otherwise the mxe pkg server does not work
if [ -n "$TRAVIS" ]; then
if grep -q trusty /etc/apt/sources.list 2>/dev/null; then
sudo sh -c "sed 's/trusty/xenial/g' /etc/apt/sources.list > /etc/apt/sources.list.d/xenial.list"
fi
fi
sudo apt-get -qq -y update
curl_gnutls_lib=$(apt-cache search libcurl | grep -E '^libcurl[0-9]+-gnutls - ' | sed 's/ - .*//' | sort | tail -1)
sudo apt-get -qy install apt apt-transport-https ca-certificates $curl_gnutls_lib curl
# this is necessary to upgrade libcurl from trusty to xenial on travis
sudo apt-get -qy -f install
debian_rel=trusty
apt_ssl_exceptions=/etc/apt/apt.conf.d/80ssl-exceptions
if ! grep -Eq '(pkg|mirror)\.mxe\.cc' $apt_ssl_exceptions 2>/dev/null; then
sudo sh -c "cat >> $apt_ssl_exceptions" <<EOF
Acquire::https::pkg.mxe.cc::Verify-Peer "false";
Acquire::https::pkg.mxe.cc::Verify-Host "false";
Acquire::https::mirror.mxe.cc::Verify-Peer "false";
Acquire::https::mirror.mxe.cc::Verify-Host "false";
EOF
fi
mxe_apt_sources=/etc/apt/sources.list.d/mxeapt.list
sudo apt-get -qq -y update
sudo apt-get -qq update
if [ -z "$(apt-cache search '^mxe-source$')" ]; then
if [ ! -f "$mxe_apt_sources" ]; then
echo "deb http://pkg.mxe.cc/repos/apt/debian wheezy main" | sudo -- sh -c "cat > $mxe_apt_sources"
check sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D43A795B73B16ABE9643FE1AFD8FFF16DB45C6AB
echo "deb https://pkg.mxe.cc/repos/apt $debian_rel main" | sudo -- sh -c "cat > $mxe_apt_sources"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C6BF758A33A3A276 || :
else
error "$mxe_apt_sources exists but mxe packages are not found in apt, either delete it or fix it"
fi
@ -318,9 +351,9 @@ debian_installdeps() {
for dep in gcc zlib ffmpeg gettext sdl2 sfml openal wxwidgets; do
set -- "$@" "mxe-${target}-$dep"
done
check sudo apt-get -qq update
check sudo apt-get --allow-unauthenticated -qq -y update
# native wx-common needed for wxrc executable
check sudo apt-get -qy install build-essential cmake ccache wx-common "$@"
check sudo apt-get --allow-unauthenticated -qy install build-essential cmake ccache wx-common "$@"
fi
build_instructions
@ -376,7 +409,7 @@ fedora_installdeps() {
fi
# non-multiarch packages first
check sudo dnf -y --nogpgcheck --best --allowerasing install gcc gcc-c++ make cmake ccache git nasm redhat-rpm-config pkgconfig ccache
check sudo dnf -y --nogpgcheck --best --allowerasing install gcc gcc-c++ make cmake ccache git nasm redhat-rpm-config pkgconfig ccache ninja-build
# try to install multiarch libgcc, glibc-devel and pkgconfig if available
if [ -n "$amd64" ]; then
@ -396,7 +429,7 @@ fedora_installdeps() {
# this is sometimes necessary for rawhide
set -- --exclude='glibc32*'
fi
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel gtk2-devel gtk3-devel; do
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel SFML-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
case $pkg in
*ffmpeg*)
[ -n "$no_ffmpeg" ] && continue
@ -504,6 +537,190 @@ fedora_installdeps() {
build_instructions
}
rhel_installdeps() {
rhel=1
ffmpeg=ffmpeg-devel
no_ffmpeg=
rpms_installed=
check_cross
installing
warning=
rhel_release=$(rpm -E %rhel)
tries=3
curdir=$(pwd)
# this source is necessary for mingw packages on rhel, and may be for other things in the future
check sudo yum -y install epel-release
# make sure rpmfusion is installed for ffmpeg
while [ $tries -gt 0 ]; do
mkdir -p "${tmp}/fusion"
cd "${tmp}/fusion"
if ! curl -fLO https://download1.rpmfusion.org/free/el/rpmfusion-free-release-${rhel_release}.noarch.rpm; then
rhel_release=$((rhel_release - 1))
tries=$((tries - 1))
continue
fi
if ! curl -fLO https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-${rhel_release}.noarch.rpm; then
tries=0
break
fi
# check if already installed
if rpm -q rpmfusion-free-release-${rhel_release} >/dev/null 2>&1 && rpm -q rpmfusion-nonfree-release-${rhel_release} >/dev/null 2>&1; then
info_msg 'rpmfusion already installed, good'
break
fi
# otherwise try to install
if ! sudo rpm --nodeps -Uvh ./rpmfusion-*.rpm; then
tries=0
break
fi
break
done
cd "$curdir"
if [ $tries -eq 0 ]; then
warning 'installing rpmfusion repos failed, continuing without ffmpeg'
no_ffmpeg=1
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
# non-multiarch packages first
CMAKE=cmake3
check sudo yum -y install gcc gcc-c++ make cmake3 ccache git nasm redhat-rpm-config pkgconfig ccache ninja-build
# try to install multiarch libgcc, glibc-devel and pkgconfig if available
if [ -n "$amd64" ]; then
for pkg in pkgconfig libgcc glibc-devel; do
if [ "$target" = m32 ]; then
sudo yum -y install "$pkg".i686
else
sudo yum -y install "$pkg".x86_64
fi
done
fi
set --
if [ -z "$target" -o "$target" = m32 ]; then
# try to install both 64 bit and 32 bit versions on 64 bit hosts (see below)
if [ -n "$amd64" ]; then
# this is sometimes necessary for rawhide
set -- --exclude='glibc32*'
fi
warning='RHEL does not currently have SFML packages, LINK support will be disabled'
cmake_flags="$cmake_flags -DENABLE_LINK=NO"
for pkg in zlib-devel mesa-libGL-devel ffmpeg-devel gettext-devel libpng-devel SDL2-devel openal-soft-devel wxGTK3-devel gtk3-devel; do
case $pkg in
*ffmpeg*)
[ -n "$no_ffmpeg" ] && continue
;;
esac
if [ -n "$amd64" ]; then
if [ "$target" = m32 ]; then
set -- "$@" "${pkg}.i686"
else
set -- "$@" "${pkg}.x86_64"
fi
else
set -- "$@" "$pkg"
fi
done
# redhat has a bug where all necessary -devel packages are not pulled in for 32 bit direct -devel deps
# this hack adds them to the list
if [ -n "$amd64" -a "$target" = m32 ]; then
info_msg 'Calculating dependencies, this will take a while..'
curdeps=
newdeps=$@
while [ "$curdeps" != "$newdeps" ]; do
curdeps=$newdeps
set -- $(echo "$@" $(repoquery --deplist "$@" 2>/dev/null | sed -n 's/\.x86_64$/.i686/; s/^ *provider: *\([^ ]*-devel-.*\)$/\1/p' | sort -u) | sed 's/ */\n/g' | sort -u)
newdeps=$@
printf '%s' .
done
echo
info_msg 'Done'
## install the RPMs with rpm --force get around file conflicts
host_rpms=$(echo "$@" | sed 's/\.i686//g')
# first update the host arch versions to reduce chances of conflicts
check sudo yum -y install $host_rpms
oldcwd=$PWD
mkdir "$tmp/rpms"
cd "$tmp/rpms"
check sudo yum -y download "$@"
# first try installing with yum to pull in deps
check sudo yum -y --skip-broken install *.rpm
# follow up with rpm --force to ignore conflicts
check sudo rpm -Uvh --force *.rpm
rm -f *.rpm
# reinstall the host rpms to make sure any overwritten files are the host version
check sudo yum -y download $host_rpms
check sudo yum -y --skip-broken install *.rpm
check sudo rpm -Uvh --force *.rpm
cd "$oldcwd"
rm -rf "$tmp/rpms"
ffmpeg=ffmpeg-devel.i686
rpms_installed=1
fi
else # mingw build
set -- "$@" pkgconfig
case "$target" in
mingw-w64-i686)
target=mingw32
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-i686.cmake -DENABLE_LINK=NO"
;;
mingw-w64-x86_64)
target=mingw64
cmake_flags="$cmake_flags -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-cross-MinGW-w64-x86_64.cmake -DENABLE_LINK=NO"
;;
*)
error 'unknown cross target (this should not happen)'
;;
esac
# install static deps
for pkg in zlib gettext libpng SDL2 wxWidgets; do
set -- "$@" "${target}-${pkg}-static"
done
# install deps that are not available as static
for pkg in openal-soft; do
set -- "$@" "${target}-${pkg}"
done
warning='SFML is required for LINK support, RHEL/EPEL does not currently have a MinGW SFML package, if you want LINK support you will need to install it manually'
fi
[ -z "$rpms_installed" ] && check sudo yum -y install "$@"
if ! rpm -q $ffmpeg >/dev/null 2>&1; then
warning 'ffmpeg failed to install (probably due to conflicts)'
cmake_flags="$cmake_flags -DENABLE_FFMPEG=NO"
fi
[ -n "$warning" ] && warning "$warning"
build_instructions
}
suse_installdeps() {
suse=1
check_cross

View File

@ -64,6 +64,62 @@ bool FileExists(const char *filename)
#endif
}
// Get user-specific config dir manually.
// apple: ~/Library/Application Support/
// windows: %APPDATA%/
// unix: ${XDG_CONFIG_HOME:-~/.config}/
std::string get_xdg_user_config_home()
{
std::string path;
#ifdef __APPLE__
std::string home(getenv("HOME"));
path = home + "/Library/Application Support";
#elif _WIN32
std::string app_data(getenv("LOCALAPPDATA"));
path = app_data;
#else // Unix
char *xdg_var = getenv("XDG_CONFIG_HOME");
if (!xdg_var || !*xdg_var)
{
std::string xdg_default(getenv("HOME"));
path = xdg_default + "/.config";
}
else
{
path = xdg_var;
}
#endif
return path + FILE_SEP;
}
// Get user-specific data dir manually.
// apple: ~/Library/Application Support/
// windows: %APPDATA%/
// unix: ${XDG_DATA_HOME:-~/.local/share}/
std::string get_xdg_user_data_home()
{
std::string path;
#ifdef __APPLE__
std::string home(getenv("HOME"));
path = home + "/Library/Application Support";
#elif _WIN32
std::string app_data(getenv("LOCALAPPDATA"));
path = app_data;
#else // Unix
char *xdg_var = getenv("XDG_DATA_HOME");
if (!xdg_var || !*xdg_var)
{
std::string xdg_default(getenv("HOME"));
path = xdg_default + "/.local/share";
}
else
{
path = xdg_var;
}
#endif
return path + FILE_SEP;
}
void utilReadScreenPixels(uint8_t *dest, int w, int h)
{
uint8_t *b = dest;

View File

@ -1,8 +1,17 @@
#ifndef UTIL_H
#define UTIL_H
#include <string>
#include "System.h"
#ifdef _WIN32
#define FILE_SEP '\\'
#else // MacOS, Unix
#define FILE_SEP '/'
#endif
#define FREAD_UNCHECKED(A,B,C,D) (void)(fread(A,B,C,D) + 1)
enum IMAGE_TYPE { IMAGE_UNKNOWN = -1, IMAGE_GBA = 0, IMAGE_GB = 1 };
// save game
@ -13,6 +22,9 @@ typedef struct {
bool FileExists(const char *filename);
std::string get_xdg_user_config_home();
std::string get_xdg_user_data_home();
void utilReadScreenPixels(uint8_t *dest, int w, int h);
bool utilWritePNGFile(const char *, int, int, uint8_t *);
bool utilWriteBMPFile(const char *, int, int, uint8_t *);

File diff suppressed because it is too large Load Diff

View File

@ -1,181 +1,183 @@
#ifndef _CONFIGMANAGER_H
#define _CONFIGMANAGER_H
#pragma once
#include "../sdl/filters.h"
#include <stdio.h>
#ifndef __GNUC__
#define HAVE_DECL_GETOPT 0
#define __STDC__ 1
#ifndef __LIBRETRO__
#include "getopt.h"
#endif
#else // ! __GNUC__
#define HAVE_DECL_GETOPT 1
#ifndef __LIBRETRO__
#include <getopt.h>
#endif
#endif // ! __GNUC__
#define MAX_CHEATS 16384
extern bool cpuIsMultiBoot;
extern bool mirroringEnable;
extern bool parseDebug;
extern bool speedHack;
extern bool speedup;
extern char *rewindMemory;
extern const char *aviRecordDir;
extern const char *biosFileNameGB;
extern const char *biosFileNameGBA;
extern const char *biosFileNameGBC;
extern const char *loadDotCodeFile;
extern const char *saveDotCodeFile;
extern const char *linkHostAddr;
extern const char *movieRecordDir;
extern const char *romDirGB;
extern const char *romDirGBA;
extern const char *romDirGBC;
extern const char *soundRecordDir;
extern int *rewindSerials;
extern int active;
extern int agbPrint;
extern int autoFire;
extern int autoFireMaxCount;
extern int autoFireToggle;
extern int autoFrameSkip;
extern int autoLoadMostRecent;
extern int autoPatch;
extern int autoSaveLoadCheatList;
extern int aviRecording;
extern int captureFormat;
extern int cheatsEnabled;
extern int cpuDisableSfx;
extern int cpuSaveType;
extern int dinputKeyFocus;
extern int disableMMX;
extern int disableStatusMessages;
extern int dsoundDisableHardwareAcceleration;
extern int filterHeight;
extern int filterMagnification;
extern int filterMT; // enable multi-threading for pixel filters
extern int filter;
extern int filterWidth;
extern int frameSkip;
extern int frameskipadjust;
extern int fsAdapter;
extern int fsColorDepth;
extern int fsForceChange;
extern int fsFrequency;
extern int fsHeight;
extern int fsWidth;
extern int fullScreen;
extern int fullScreenStretch;
extern int gdbBreakOnLoad;
extern int gdbPort;
extern int glFilter;
extern int ifbType;
extern int joypadDefault;
extern int languageOption;
extern int layerEnable;
extern int layerSettings;
extern int linkAuto;
extern int linkHacks;
extern int linkMode;
extern int linkNumPlayers;
extern int linkTimeout;
extern int maxScale;
extern int movieFrame;
extern int moviePlayFrame;
extern int moviePlaying;
extern int movieRecording;
extern int openGL;
extern int autoPatch;
extern int optFlashSize;
extern int optPrintUsage;
extern int paused;
extern int pauseWhenInactive;
extern int recentFreeze;
extern int renderedFrames;
extern int rewindCount;
extern int rewindCounter;
extern int rewindPos;
extern int rewindSaveNeeded;
extern int rewindTimer;
extern int rewindTopPos;
// extern int romSize;
extern int rtcEnabled;
extern int saveType;
extern int screenMessage;
extern int sensorX;
extern int sensorY;
extern int showRenderedFrames;
extern int showSpeed;
extern int showSpeedTransparent;
extern int sizeX;
extern int sizeY;
extern int skipBios;
extern int skipSaveGameBattery;
extern int skipSaveGameCheats;
extern int soundRecording;
extern int speedupToggle;
extern int sunBars;
extern int surfaceSizeX;
extern int surfaceSizeY;
extern int threadPriority;
extern int tripleBuffering;
extern int useBios;
extern int useBiosFileGB;
extern int useBiosFileGBA;
extern int useBiosFileGBC;
extern int videoOption;
extern int vsync;
extern int wasPaused;
extern int windowPositionX;
extern int windowPositionY;
extern int winFlashSize;
extern int winGbBorderOn;
extern int winGbPrinterEnabled;
extern int winPauseNextFrame;
extern uint32_t autoFrameSkipLastTime;
extern uint32_t movieLastJoypad;
extern uint32_t movieNextJoypad;
extern uint32_t throttle;
extern uint32_t speedup_throttle;
extern uint32_t speedup_frame_skip;
extern int preparedCheats;
extern const char *preparedCheatCodes[MAX_CHEATS];
// allow up to 100 IPS/UPS/PPF patches given on commandline
#define PATCH_MAX_NUM 100
extern int patchNum;
extern char *patchNames[PATCH_MAX_NUM]; // and so on
extern int mouseCounter;
extern FilterFunc filterFunction;
extern IFBFilterFunc ifbFunction;
extern char *homeDir;
extern const char *screenShotDir;
extern const char *saveDir;
extern const char *batteryDir;
// Directory within homedir to use for default save location.
#define DOT_DIR ".vbam"
void SetHome(char *_arg0);
void SaveConfigFile();
void CloseConfig();
uint32_t ReadPrefHex(const char *pref_key, int default_value);
uint32_t ReadPrefHex(const char *pref_key);
uint32_t ReadPref(const char *pref_key, int default_value);
uint32_t ReadPref(const char *pref_key);
const char *ReadPrefString(const char *pref_key, const char *default_value);
const char *ReadPrefString(const char *pref_key);
void LoadConfigFile(int argc, char **argv);
void LoadConfig();
int ReadOpts(int argc, char **argv);
#endif
#ifndef _CONFIGMANAGER_H
#define _CONFIGMANAGER_H
#pragma once
#include "../sdl/filters.h"
#include <stdio.h>
#ifndef __GNUC__
#define HAVE_DECL_GETOPT 0
#define __STDC__ 1
#ifndef __LIBRETRO__
#include "getopt.h"
#endif
#else // ! __GNUC__
#define HAVE_DECL_GETOPT 1
#ifndef __LIBRETRO__
#include <getopt.h>
#endif
#endif // ! __GNUC__
#define MAX_CHEATS 16384
extern bool cpuIsMultiBoot;
extern bool mirroringEnable;
extern bool parseDebug;
extern bool speedHack;
extern bool speedup;
extern char *rewindMemory;
extern const char *aviRecordDir;
extern const char *biosFileNameGB;
extern const char *biosFileNameGBA;
extern const char *biosFileNameGBC;
extern const char *loadDotCodeFile;
extern const char *saveDotCodeFile;
extern const char *linkHostAddr;
extern const char *movieRecordDir;
extern const char *romDirGB;
extern const char *romDirGBA;
extern const char *romDirGBC;
extern const char *soundRecordDir;
extern int *rewindSerials;
extern int active;
extern int agbPrint;
extern int autoFire;
extern int autoFireMaxCount;
extern int autoFireToggle;
extern int autoFrameSkip;
extern int autoLoadMostRecent;
extern int autoPatch;
extern int autoSaveLoadCheatList;
extern int aviRecording;
extern int captureFormat;
extern int cheatsEnabled;
extern int cpuDisableSfx;
extern int cpuSaveType;
extern int dinputKeyFocus;
extern int disableMMX;
extern int disableStatusMessages;
extern int dsoundDisableHardwareAcceleration;
extern int filterHeight;
extern int filterMagnification;
extern int filterMT; // enable multi-threading for pixel filters
extern int filter;
extern int filterWidth;
extern int frameSkip;
extern int frameskipadjust;
extern int fsAdapter;
extern int fsColorDepth;
extern int fsForceChange;
extern int fsFrequency;
extern int fsHeight;
extern int fsWidth;
extern int fullScreen;
extern int fullScreenStretch;
extern int gdbBreakOnLoad;
extern int gdbPort;
extern int glFilter;
extern int ifbType;
extern int joypadDefault;
extern int languageOption;
extern int layerEnable;
extern int layerSettings;
extern int linkAuto;
extern int linkHacks;
extern int linkMode;
extern int linkNumPlayers;
extern int linkTimeout;
extern int maxScale;
extern int movieFrame;
extern int moviePlayFrame;
extern int moviePlaying;
extern int movieRecording;
extern int openGL;
extern int autoPatch;
extern int optFlashSize;
extern int optPrintUsage;
extern int paused;
extern int pauseWhenInactive;
extern int recentFreeze;
extern int renderedFrames;
extern int rewindCount;
extern int rewindCounter;
extern int rewindPos;
extern int rewindSaveNeeded;
extern int rewindTimer;
extern int rewindTopPos;
// extern int romSize;
extern int rtcEnabled;
extern int saveType;
extern int screenMessage;
extern int sensorX;
extern int sensorY;
extern int showRenderedFrames;
extern int showSpeed;
extern int showSpeedTransparent;
extern int sizeX;
extern int sizeY;
extern int skipBios;
extern int skipSaveGameBattery;
extern int skipSaveGameCheats;
extern int soundRecording;
extern int speedupToggle;
extern int sunBars;
extern int surfaceSizeX;
extern int surfaceSizeY;
extern int threadPriority;
extern int tripleBuffering;
extern int useBios;
extern int useBiosFileGB;
extern int useBiosFileGBA;
extern int useBiosFileGBC;
extern int videoOption;
extern int vsync;
extern int wasPaused;
extern uint32_t windowHeight;
extern int windowPositionX;
extern int windowPositionY;
extern uint32_t windowWidth;
extern int winFlashSize;
extern int winGbBorderOn;
extern int winGbPrinterEnabled;
extern int winPauseNextFrame;
extern uint32_t autoFrameSkipLastTime;
extern uint32_t movieLastJoypad;
extern uint32_t movieNextJoypad;
extern uint32_t throttle;
extern uint32_t speedup_throttle;
extern uint32_t speedup_frame_skip;
extern int preparedCheats;
extern const char *preparedCheatCodes[MAX_CHEATS];
// allow up to 100 IPS/UPS/PPF patches given on commandline
#define PATCH_MAX_NUM 100
extern int patchNum;
extern char *patchNames[PATCH_MAX_NUM]; // and so on
extern int mouseCounter;
extern FilterFunc filterFunction;
extern IFBFilterFunc ifbFunction;
extern char *homeDir;
extern const char *screenShotDir;
extern const char *saveDir;
extern const char *batteryDir;
// Directory within homedir to use for default save location.
#define DOT_DIR "visualboyadvance-m"
void SetHome(char *_arg0);
void SaveConfigFile();
void CloseConfig();
uint32_t ReadPrefHex(const char *pref_key, int default_value);
uint32_t ReadPrefHex(const char *pref_key);
uint32_t ReadPref(const char *pref_key, int default_value);
uint32_t ReadPref(const char *pref_key);
const char *ReadPrefString(const char *pref_key, const char *default_value);
const char *ReadPrefString(const char *pref_key);
void LoadConfigFile(int argc, char **argv);
void LoadConfig();
int ReadOpts(int argc, char **argv);
#endif

View File

@ -58,7 +58,7 @@ class SoundDriver
*/
virtual void write(uint16_t *finalWave, int length) = 0;
virtual void setThrottle(unsigned short throttle){};
virtual void setThrottle(unsigned short throttle) = 0;
};
#endif // __VBA_SOUND_DRIVER_H__

View File

@ -60,11 +60,12 @@ void SoundSDL::read(uint16_t* stream, int length) {
if (!initialized || !emulating)
return;
if (!buffer_size())
if (!buffer_size()) {
if (should_wait())
SDL_SemWait(data_available);
else
return;
}
SDL_LockMutex(mutex);
@ -136,7 +137,7 @@ bool SoundSDL::init(long sampleRate) {
sound_device = SDL_OpenAudioDevice(NULL, 0, &audio, &audio_spec, SDL_AUDIO_ALLOW_ANY_CHANGE);
if(sound_device < 0) {
if(sound_device == 0) {
std::cerr << "Failed to open audio: " << SDL_GetError() << std::endl;
return false;
}

View File

@ -45,7 +45,7 @@ protected:
private:
RingBuffer<uint16_t> samples_buf;
SDL_AudioDeviceID sound_device = -1;
SDL_AudioDeviceID sound_device = 0;
SDL_mutex* mutex;
SDL_sem* data_available;

View File

@ -643,7 +643,7 @@ dictionary *iniparser_load(const char *ininame)
char line[ASCIILINESZ + 1];
char section[ASCIILINESZ + 1];
char key[ASCIILINESZ + 1];
char tmp[ASCIILINESZ + 1];
char tmp[2 * ASCIILINESZ + 3];
char val[ASCIILINESZ + 1];
int last = 0;

View File

@ -157,10 +157,10 @@ static inline uint32_t INTERPOLATE (uint32_t A, uint32_t B)
static inline uint32_t Q_INTERPOLATE (uint32_t A, uint32_t B, uint32_t C, uint32_t D)
{
register uint32_t x = ((A & qcolorMask) >> 2) +
uint32_t x = ((A & qcolorMask) >> 2) +
((B & qcolorMask) >> 2) +
((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
register uint32_t y = (A & qlowpixelMask) +
uint32_t y = (A & qlowpixelMask) +
(B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask);
y = (y >> 2) & qlowpixelMask;
@ -283,7 +283,7 @@ void Super2xSaI (uint8_t *srcPtr, uint32_t srcPitch,
} else if (color5 == color3 && color2 != color6) {
product2b = product1b = color5;
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;
r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@ -415,7 +415,7 @@ void Super2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch,
} else if (color5 == color3 && color2 != color6) {
product2b = product1b = color5;
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;
r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@ -575,7 +575,7 @@ void SuperEagle (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
}
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;
r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@ -710,7 +710,7 @@ void SuperEagle32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
}
} else if (color5 == color3 && color2 == color6) {
register int r = 0;
int r = 0;
r += GetResult (color6, color5, color1, colorA1);
r += GetResult (color6, color5, color4, colorB1);
@ -790,7 +790,7 @@ void _2xSaI (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
for (uint32_t finish = width; finish; finish -= inc_bP) {
register uint32_t colorA, colorB;
uint32_t colorA, colorB;
uint32_t colorC, colorD,
colorE, colorF, colorG, colorH,
colorI, colorJ, colorK, colorL,
@ -863,7 +863,7 @@ void _2xSaI (uint8_t *srcPtr, uint32_t srcPitch, uint8_t *deltaPtr,
product1 = colorA;
product2 = colorA;
} else {
register int r = 0;
int r = 0;
product1 = INTERPOLATE (colorA, colorC);
product = INTERPOLATE (colorA, colorB);
@ -950,7 +950,7 @@ void _2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t * /* deltaPtr */,
dP = (uint32_t *) dstPtr;
for (uint32_t finish = width; finish; finish -= inc_bP) {
register uint32_t colorA, colorB;
uint32_t colorA, colorB;
uint32_t colorC, colorD,
colorE, colorF, colorG, colorH,
colorI, colorJ, colorK, colorL,
@ -1023,7 +1023,7 @@ void _2xSaI32 (uint8_t *srcPtr, uint32_t srcPitch, uint8_t * /* deltaPtr */,
product1 = colorA;
product2 = colorA;
} else {
register int r = 0;
int r = 0;
product1 = INTERPOLATE (colorA, colorC);
product = INTERPOLATE (colorA, colorB);

View File

@ -152,7 +152,7 @@ inline unsigned int RGBtoYUV_32(unsigned int c)
{
// Division through 3 slows down the emulation about 10% !!!
register unsigned char r, g, b;
unsigned char r, g, b;
b = c & 0x0000FF;
g = (c & 0x00FF00) >> 8;
r = c >> 16;
@ -254,7 +254,7 @@ inline unsigned int RGBtoYUV_16(unsigned short c)
{
// Division through 3 slows down the emulation about 10% !!!
register unsigned char r, g, b;
unsigned char r, g, b;
#ifdef RGB555
r = (c & 0x7C00) >> 7;
g = (c & 0x03E0) >> 2;

View File

@ -20,7 +20,7 @@ static uint8_t *frm3 = NULL;
extern uint32_t qRGB_COLOR_MASK[2];
static void Init()
void InterframeFilterInit()
{
frm1 = (uint8_t *)calloc(322*242,4);
// 1 frame ago
@ -163,8 +163,9 @@ static void SmartIB_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int start
void SmartIB(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
if(cpu_mmx) {
@ -329,8 +330,9 @@ static void SmartIB32_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int sta
void SmartIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
if(cpu_mmx) {
@ -445,8 +447,9 @@ static void MotionBlurIB_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, int
void MotionBlurIB(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
@ -550,8 +553,9 @@ static void MotionBlurIB32_MMX(uint8_t *srcPtr, uint32_t srcPitch, int width, in
void MotionBlurIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, int height)
{
(void)width; // unused param
if(frm1 == NULL) {
Init();
InterframeFilterInit();
}
#ifdef MMX
@ -569,7 +573,7 @@ void MotionBlurIB32(uint8_t *srcPtr, uint32_t srcPitch, int width, int starty, i
int sPitch = srcPitch >> 2;
int pos = 0;
for (int j = 0; j < height; j++)
for (int j = 0; j < height; j++)
for (int i = 0; i < sPitch; i++) {
uint32_t color = src0[pos];
src0[pos] = (((color & colorMask) >> 1) +

View File

@ -5,7 +5,7 @@
extern int RGB_LOW_BITS_MASK;
static void Init();
void InterframeFilterInit();
// call ifc to ignore previous frame / when starting new
void InterframeCleanup();

View File

@ -1,38 +1,38 @@
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *
// * to link the code of this program with the MAME library (or with modified *
// * versions of MAME that use the same license as MAME), and distribute *
// * linked combinations including the two. You must obey the GNU General *
// * Public License in all respects for all of the code used other than MAME. *
// * If you modify this file, you may extend this exception to your version *
// * of the file, but you are not obligated to do so. If you do not wish to *
// * do so, delete this exception statement from your version. *
// ****************************************************************************
#ifndef XBRZ_CONFIG_HEADER_284578425345
#define XBRZ_CONFIG_HEADER_284578425345
// do NOT include any headers here! used by xBRZ_dll!!!
namespace xbrz
{
struct ScalerCfg {
ScalerCfg()
: luminanceWeight(1), equalColorTolerance(30), dominantDirectionThreshold(3.6),
steepDirectionThreshold(2.2), newTestAttribute(0)
{
}
double luminanceWeight;
double equalColorTolerance;
double dominantDirectionThreshold;
double steepDirectionThreshold;
double newTestAttribute; // unused; test new parameters
};
}
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *
// * to link the code of this program with the MAME library (or with modified *
// * versions of MAME that use the same license as MAME), and distribute *
// * linked combinations including the two. You must obey the GNU General *
// * Public License in all respects for all of the code used other than MAME. *
// * If you modify this file, you may extend this exception to your version *
// * of the file, but you are not obligated to do so. If you do not wish to *
// * do so, delete this exception statement from your version. *
// ****************************************************************************
#ifndef XBRZ_CONFIG_HEADER_284578425345
#define XBRZ_CONFIG_HEADER_284578425345
// do NOT include any headers here! used by xBRZ_dll!!!
namespace xbrz
{
struct ScalerCfg {
ScalerCfg()
: luminanceWeight(1), equalColorTolerance(30), dominantDirectionThreshold(3.6),
steepDirectionThreshold(2.2), newTestAttribute(0)
{
}
double luminanceWeight;
double equalColorTolerance;
double dominantDirectionThreshold;
double steepDirectionThreshold;
double newTestAttribute; // unused; test new parameters
};
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,102 +1,102 @@
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *
// * to link the code of this program with the MAME library (or with modified *
// * versions of MAME that use the same license as MAME), and distribute *
// * linked combinations including the two. You must obey the GNU General *
// * Public License in all respects for all of the code used other than MAME. *
// * If you modify this file, you may extend this exception to your version *
// * of the file, but you are not obligated to do so. If you do not wish to *
// * do so, delete this exception statement from your version. *
// ****************************************************************************
#ifndef XBRZ_HEADER_3847894708239054
#define XBRZ_HEADER_3847894708239054
#include "config.h"
#include <cstddef> //size_t
#include <limits>
#include <stdint.h> //uint32_t
namespace xbrz
{
/*
-------------------------------------------------------------------------
| xBRZ: "Scale by rules" - high quality image upscaling filter by Zenju |
-------------------------------------------------------------------------
using a modified approach of xBR:
http://board.byuu.org/viewtopic.php?f=10&t=2248
- new rule set preserving small image features
- highly optimized for performance
- support alpha channel
- support multithreading
- support 64-bit architectures
- support processing image slices
- support scaling up to 6xBRZ
*/
enum ColorFormat // from high bits -> low bits, 8 bit per channel
{ RGB, // 8 bit for each red, green, blue, upper 8 bits unused
ARGB, // including alpha channel, BGRA byte order on little-endian machines
};
/*
-> map source (srcWidth * srcHeight) to target (scale * width x scale * height) image, optionally
processing a half-open slice of rows [yFirst, yLast) only
-> support for source/target pitch in bytes!
-> if your emulator changes only a few image slices during each cycle (e.g. DOSBox) then there's no
need to run xBRZ on the complete image:
Just make sure you enlarge the source image slice by 2 rows on top and 2 on bottom (this is the
additional range the xBRZ algorithm is using during analysis)
Caveat: If there are multiple changed slices, make sure they do not overlap after adding these
additional rows in order to avoid a memory race condition
in the target image data if you are using multiple threads for processing each enlarged slice!
THREAD-SAFETY: - parts of the same image may be scaled by multiple threads as long as the [yFirst,
yLast) ranges do not overlap!
- there is a minor inefficiency for the first row of a slice, so avoid processing
single rows only; suggestion: process 8-16 rows at least
*/
void scale(size_t factor, // valid range: 2 - 6
const uint32_t *src, int srcWidth, int srcHeight, int srcPitch, uint32_t *trg,
int trgPitch, ColorFormat colFmt, const ScalerCfg &cfg = ScalerCfg(), int yFirst = 0,
int yLast = std::numeric_limits<int>::max()); // slice of source image
void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg,
int trgWidth, int trgHeight);
enum SliceType {
NN_SCALE_SLICE_SOURCE,
NN_SCALE_SLICE_TARGET,
};
void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight,
int srcPitch, // pitch in bytes!
uint32_t *trg, int trgWidth, int trgHeight, int trgPitch, SliceType st,
int yFirst, int yLast);
// parameter tuning
bool equalColorTest(uint32_t col1, uint32_t col2, ColorFormat colFmt, double luminanceWeight,
double equalColorTolerance);
//########################### implementation ###########################
inline void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg,
int trgWidth, int trgHeight)
{
nearestNeighborScale(src,
srcWidth,
srcHeight,
srcWidth * sizeof(uint32_t),
trg,
trgWidth,
trgHeight,
trgWidth * sizeof(uint32_t),
NN_SCALE_SLICE_TARGET,
0,
trgHeight);
}
}
#endif
// ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * *
// * Additionally and as a special exception, the author gives permission *
// * to link the code of this program with the MAME library (or with modified *
// * versions of MAME that use the same license as MAME), and distribute *
// * linked combinations including the two. You must obey the GNU General *
// * Public License in all respects for all of the code used other than MAME. *
// * If you modify this file, you may extend this exception to your version *
// * of the file, but you are not obligated to do so. If you do not wish to *
// * do so, delete this exception statement from your version. *
// ****************************************************************************
#ifndef XBRZ_HEADER_3847894708239054
#define XBRZ_HEADER_3847894708239054
#include "config.h"
#include <cstddef> //size_t
#include <limits>
#include <stdint.h> //uint32_t
namespace xbrz
{
/*
-------------------------------------------------------------------------
| xBRZ: "Scale by rules" - high quality image upscaling filter by Zenju |
-------------------------------------------------------------------------
using a modified approach of xBR:
http://board.byuu.org/viewtopic.php?f=10&t=2248
- new rule set preserving small image features
- highly optimized for performance
- support alpha channel
- support multithreading
- support 64-bit architectures
- support processing image slices
- support scaling up to 6xBRZ
*/
enum ColorFormat // from high bits -> low bits, 8 bit per channel
{ RGB, // 8 bit for each red, green, blue, upper 8 bits unused
ARGB, // including alpha channel, BGRA byte order on little-endian machines
};
/*
-> map source (srcWidth * srcHeight) to target (scale * width x scale * height) image, optionally
processing a half-open slice of rows [yFirst, yLast) only
-> support for source/target pitch in bytes!
-> if your emulator changes only a few image slices during each cycle (e.g. DOSBox) then there's no
need to run xBRZ on the complete image:
Just make sure you enlarge the source image slice by 2 rows on top and 2 on bottom (this is the
additional range the xBRZ algorithm is using during analysis)
Caveat: If there are multiple changed slices, make sure they do not overlap after adding these
additional rows in order to avoid a memory race condition
in the target image data if you are using multiple threads for processing each enlarged slice!
THREAD-SAFETY: - parts of the same image may be scaled by multiple threads as long as the [yFirst,
yLast) ranges do not overlap!
- there is a minor inefficiency for the first row of a slice, so avoid processing
single rows only; suggestion: process 8-16 rows at least
*/
void scale(size_t factor, // valid range: 2 - 6
const uint32_t *src, int srcWidth, int srcHeight, int srcPitch, uint32_t *trg,
int trgPitch, ColorFormat colFmt, const ScalerCfg &cfg = ScalerCfg(), int yFirst = 0,
int yLast = std::numeric_limits<int>::max()); // slice of source image
void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg,
int trgWidth, int trgHeight);
enum SliceType {
NN_SCALE_SLICE_SOURCE,
NN_SCALE_SLICE_TARGET,
};
void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight,
int srcPitch, // pitch in bytes!
uint32_t *trg, int trgWidth, int trgHeight, int trgPitch, SliceType st,
int yFirst, int yLast);
// parameter tuning
bool equalColorTest(uint32_t col1, uint32_t col2, ColorFormat colFmt, double luminanceWeight,
double equalColorTolerance);
//########################### implementation ###########################
inline void nearestNeighborScale(const uint32_t *src, int srcWidth, int srcHeight, uint32_t *trg,
int trgWidth, int trgHeight)
{
nearestNeighborScale(src,
srcWidth,
srcHeight,
srcWidth * sizeof(uint32_t),
trg,
trgWidth,
trgHeight,
trgWidth * sizeof(uint32_t),
NN_SCALE_SLICE_TARGET,
0,
trgHeight);
}
}
#endif

View File

@ -900,7 +900,7 @@ void gbCompareLYToLYC()
}
}
void gbWriteMemory(register uint16_t address, register uint8_t value)
void gbWriteMemory(uint16_t address, uint8_t value)
{
if (address < 0x8000) {
@ -1720,7 +1720,7 @@ void gbWriteMemory(register uint16_t address, register uint8_t value)
gbMemory[address] = value;
}
uint8_t gbReadMemory(register uint16_t address)
uint8_t gbReadMemory(uint16_t address)
{
if (gbCheatMap[address])
return gbCheatRead(address);
@ -2189,7 +2189,7 @@ static void gbSelectColorizationPalette()
}
// Check if the checksum is in the list.
int idx;
size_t idx;
for (idx = 0; idx < sizeof(gbColorizationChecksums); idx++) {
if (gbColorizationChecksums[idx] == checksum) {
break;
@ -2201,7 +2201,7 @@ static void gbSelectColorizationPalette()
// Indexes above 0x40 have to be disambiguated.
if (idx > 0x40) {
// No idea how that works. But it works.
for (int i = idx - 0x41, j = 0; i < sizeof(gbColorizationDisambigChars); i += 14, j += 14) {
for (size_t i = idx - 0x41, j = 0; i < sizeof(gbColorizationDisambigChars); i += 14, j += 14) {
if (gbRom[0x0137] == gbColorizationDisambigChars[i]) {
infoIdx = idx + j;
break;
@ -3430,7 +3430,7 @@ bool gbReadGSASnapshot(const char* fileName)
fseek(file, 0x4, SEEK_SET);
char buffer[16];
char buffer2[16];
fread(buffer, 1, 15, file);
FREAD_UNCHECKED(buffer, 1, 15, file);
buffer[15] = 0;
memcpy(buffer2, &gbRom[0x134], 15);
buffer2[15] = 0;
@ -3443,8 +3443,6 @@ bool gbReadGSASnapshot(const char* fileName)
return false;
}
fseek(file, 0x13, SEEK_SET);
size_t read = 0;
int toRead = 0;
switch (gbRomType) {
case 0x03:
case 0x0f:
@ -3453,13 +3451,11 @@ bool gbReadGSASnapshot(const char* fileName)
case 0x1b:
case 0x1e:
case 0xff:
read = fread(gbRam, 1, (gbRamSizeMask + 1), file);
toRead = (gbRamSizeMask + 1);
FREAD_UNCHECKED(gbRam, 1, (gbRamSizeMask + 1), file);
break;
case 0x06:
case 0x22:
read = fread(&gbMemory[0xa000], 1, 256, file);
toRead = 256;
FREAD_UNCHECKED(&gbMemory[0xa000], 1, 256, file);
break;
default:
systemMessage(MSG_UNSUPPORTED_SNAPSHOT_FILE,
@ -4509,7 +4505,7 @@ void gbEmulate(int ticksToStop)
clockTicks = 0;
gbDmaTicks = 0;
register int opcode = 0;
int opcode = 0;
int opcode1 = 0;
int opcode2 = 0;

View File

@ -24,7 +24,7 @@ int gbDis(char*, uint16_t);
bool gbLoadRom(const char*);
bool gbUpdateSizes();
void gbEmulate(int);
void gbWriteMemory(register uint16_t, register uint8_t);
void gbWriteMemory(uint16_t, uint8_t);
void gbDrawLine();
bool gbIsGameboyRom(const char*);
void gbGetHardwareType();

View File

@ -416,10 +416,10 @@ bool gbCheatReadGSCodeFile(const char* fileName)
char code[9];
int i;
for (i = 0; i < count; i++) {
fread(&dummy, 1, 2, file);
fread(desc, 1, 12, file);
FREAD_UNCHECKED(&dummy, 1, 2, file);
FREAD_UNCHECKED(desc, 1, 12, file);
desc[12] = 0;
fread(code, 1, 8, file);
FREAD_UNCHECKED(code, 1, 8, file);
code[8] = 0;
gbAddGsCheat(code, desc);
}

View File

@ -991,8 +991,17 @@ mapperHuC3 gbDataHuC3 = {
1, // ROM bank
0, // RAM bank
0, // RAM address
0, // Address
0, // RAM flag
0 // RAM read value
0, // RAM read value
0, // Register 1
0, // Register 2
0, // Register 3
0, // Register 4
0, // Register 5
0, // Register 6
0, // Register 7
0 // Register 8
};
// HuC3 ROM write registers

View File

@ -67,7 +67,7 @@ void gbSgbReset()
gbSgbNextController = 0x0f;
gbSgbReadingController = 0;
memset(gbSgbSCPPalette, 0, 512 * 4);
memset(gbSgbSCPPalette, 0, 512 * 4 * sizeof(uint16_t));
memset(gbSgbATF, 0, 20 * 18);
memset(gbSgbATFList, 0, 45 * 20 * 18);
memset(gbSgbPacket, 0, 16 * 7);
@ -119,7 +119,7 @@ void gbSgbFillScreen(uint16_t color)
int yLine = (y + gbBorderRowSkip + 1) * (gbBorderLineSkip + 2) + gbBorderColumnSkip;
#endif
uint16_t* dest = (uint16_t*)pix + yLine;
for (register int x = 0; x < 160; x++)
for (int x = 0; x < 160; x++)
gbSgbDraw16Bit(dest++, color);
}
} break;
@ -127,7 +127,7 @@ void gbSgbFillScreen(uint16_t color)
for (int y = 0; y < 144; y++) {
int yLine = (y + gbBorderRowSkip) * gbBorderLineSkip + gbBorderColumnSkip;
uint8_t* dest = (uint8_t*)pix + yLine * 3;
for (register int x = 0; x < 160; x++) {
for (int x = 0; x < 160; x++) {
gbSgbDraw24Bit(dest, color);
dest += 3;
}
@ -141,7 +141,7 @@ void gbSgbFillScreen(uint16_t color)
int yLine = (y + gbBorderRowSkip + 1) * (gbBorderLineSkip + 1) + gbBorderColumnSkip;
#endif
uint32_t* dest = (uint32_t*)pix + yLine;
for (register int x = 0; x < 160; x++) {
for (int x = 0; x < 160; x++) {
gbSgbDraw32Bit(dest++, color);
}
}

View File

@ -37,7 +37,7 @@ uint8_t gbSoundRead(uint16_t address)
return gbMemory[address];
}
void gbSoundEvent(register uint16_t address, register int data)
void gbSoundEvent(uint16_t address, int data)
{
gbMemory[address] = data;

File diff suppressed because it is too large Load Diff

View File

@ -2055,15 +2055,15 @@ bool cheatsImportGSACodeFile(const char* name, int game, bool v3)
found = true;
break;
}
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
fseek(f, len, SEEK_CUR);
int codes = 0;
fread(&codes, 1, 4, f);
FREAD_UNCHECKED(&codes, 1, 4, f);
while (codes > 0) {
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
fseek(f, len, SEEK_CUR);
fseek(f, 8, SEEK_CUR);
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
fseek(f, len * 12, SEEK_CUR);
codes--;
}
@ -2073,26 +2073,26 @@ bool cheatsImportGSACodeFile(const char* name, int game, bool v3)
if (found) {
char desc[256];
char code[17];
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
fseek(f, len, SEEK_CUR);
int codes = 0;
fread(&codes, 1, 4, f);
FREAD_UNCHECKED(&codes, 1, 4, f);
while (codes > 0) {
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
if (len > 255)
goto evil_gsa_code_file; //XXX: this functione needs a rewrite in general, so for the short this is better than nothing
fread(desc, 1, len, f);
FREAD_UNCHECKED(desc, 1, len, f);
desc[len] = 0;
desc[31] = 0;
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
fseek(f, len, SEEK_CUR);
fseek(f, 4, SEEK_CUR);
fread(&len, 1, 4, f);
FREAD_UNCHECKED(&len, 1, 4, f);
while (len) {
fseek(f, 4, SEEK_CUR);
fread(code, 1, 8, f);
FREAD_UNCHECKED(code, 1, 8, f);
fseek(f, 4, SEEK_CUR);
fread(&code[8], 1, 8, f);
FREAD_UNCHECKED(&code[8], 1, 8, f);
code[16] = 0;
cheatsAddGSACode(code, desc, v3);
len -= 2;
@ -2734,16 +2734,16 @@ bool cheatsLoadCheatList(const char* file)
}
} else if (type == 0) {
for (int i = 0; i < count; i++) {
fread(&cheatsList[i].code, 1, sizeof(int), f);
fread(&cheatsList[i].size, 1, sizeof(int), f);
fread(&cheatsList[i].status, 1, sizeof(int), f);
fread(&cheatsList[i].enabled, 1, sizeof(int), f);
FREAD_UNCHECKED(&cheatsList[i].code, 1, sizeof(int), f);
FREAD_UNCHECKED(&cheatsList[i].size, 1, sizeof(int), f);
FREAD_UNCHECKED(&cheatsList[i].status, 1, sizeof(int), f);
FREAD_UNCHECKED(&cheatsList[i].enabled, 1, sizeof(int), f);
cheatsList[i].enabled = cheatsList[i].enabled ? true : false;
fread(&cheatsList[i].address, 1, sizeof(uint32_t), f);
FREAD_UNCHECKED(&cheatsList[i].address, 1, sizeof(uint32_t), f);
cheatsList[i].rawaddress = cheatsList[i].address;
fread(&cheatsList[i].value, 1, sizeof(uint32_t), f);
fread(&cheatsList[i].oldValue, 1, sizeof(uint32_t), f);
fread(&cheatsList[i].codestring, 1, 20 * sizeof(char), f);
FREAD_UNCHECKED(&cheatsList[i].value, 1, sizeof(uint32_t), f);
FREAD_UNCHECKED(&cheatsList[i].oldValue, 1, sizeof(uint32_t), f);
FREAD_UNCHECKED(&cheatsList[i].codestring, 1, 20 * sizeof(char), f);
if (fread(&cheatsList[i].desc, 1, 32 * sizeof(char), f) != 32 * sizeof(char)) {
fclose(f);
return false;

View File

@ -144,8 +144,8 @@ static void count(uint32_t opcode, int cond_res)
//#ifdef __POWERPC__
#define OP_SUBS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -161,8 +161,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_RSBS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subfco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -178,8 +178,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_ADDS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -195,8 +195,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_ADCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"addeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@ -214,8 +214,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_SBCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"subfeo. %0, %3, %2\n" \
"mcrxr cr1\n" \
@ -233,8 +233,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_RSCS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr xer, %4\n" \
"subfeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@ -252,8 +252,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_CMP \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -268,8 +268,8 @@ static void count(uint32_t opcode, int cond_res)
}
#define OP_CMN \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \

View File

@ -89,8 +89,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#ifdef __POWERPC__
#define ADD_RD_RS_RN(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -106,8 +106,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define ADD_RD_RS_O3(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -124,8 +124,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#define ADD_RD_RS_O3_0 ADD_RD_RS_O3
#define ADD_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -141,8 +141,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMN_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("addco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -157,8 +157,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define ADC_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr 1, %4\n" \ /* reg 1 is xer */
"addeo. %0, %2, %3\n" \
"mcrxr cr1\n" \
@ -177,8 +177,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SUB_RD_RS_RN(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -194,8 +194,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SUB_RD_RS_O3(N) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -212,8 +212,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
#define SUB_RD_RS_O3_0 SUB_RD_RS_O3
#define SUB_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -229,8 +229,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMP_RN_O8(d) \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -245,8 +245,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define SBC_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("mtspr 1, %4\n" \ /* reg 1 is xer */
"subfeo. %0, %3, %2\n" \
"mcrxr cr1\n" \
@ -265,8 +265,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define NEG_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subfco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \
@ -282,8 +282,8 @@ static INSN_REGPARM void thumbBreakpoint(uint32_t opcode)
}
#define CMP_RD_RS \
{ \
register int Flags; \
register int Result; \
int Flags; \
int Result; \
asm volatile("subco. %0, %2, %3\n" \
"mcrxr cr1\n" \
"mfcr %1\n" \

View File

@ -1007,21 +1007,21 @@ bool CPUReadGSASnapshot(const char* fileName)
// long size = ftell(file);
fseek(file, 0x0, SEEK_SET);
fread(&i, 1, 4, file);
FREAD_UNCHECKED(&i, 1, 4, file);
fseek(file, i, SEEK_CUR); // Skip SharkPortSave
fseek(file, 4, SEEK_CUR); // skip some sort of flag
fread(&i, 1, 4, file); // name length
FREAD_UNCHECKED(&i, 1, 4, file); // name length
fseek(file, i, SEEK_CUR); // skip name
fread(&i, 1, 4, file); // desc length
FREAD_UNCHECKED(&i, 1, 4, file); // desc length
fseek(file, i, SEEK_CUR); // skip desc
fread(&i, 1, 4, file); // notes length
FREAD_UNCHECKED(&i, 1, 4, file); // notes length
fseek(file, i, SEEK_CUR); // skip notes
int saveSize;
fread(&saveSize, 1, 4, file); // read length
FREAD_UNCHECKED(&saveSize, 1, 4, file); // read length
saveSize -= 0x1c; // remove header size
char buffer[17];
char buffer2[17];
fread(buffer, 1, 16, file);
FREAD_UNCHECKED(buffer, 1, 16, file);
buffer[16] = 0;
for (i = 0; i < 16; i++)
if (buffer[i] < 32)
@ -1074,7 +1074,7 @@ bool CPUReadGSASPSnapshot(const char* fileName)
// read save name
fseek(file, namepos, SEEK_SET);
fread(savename, 1, namesz, file);
FREAD_UNCHECKED(savename, 1, namesz, file);
savename[namesz] = 0;
memcpy(romname, &rom[0xa0], namesz);
@ -1091,7 +1091,7 @@ bool CPUReadGSASPSnapshot(const char* fileName)
// read footer tag
fseek(file, footerpos, SEEK_SET);
fread(footer, 1, footersz, file);
FREAD_UNCHECKED(footer, 1, footersz, file);
footer[footersz] = 0;
if (memcmp(footer, gsvfooter, footersz)) {
@ -1106,7 +1106,7 @@ bool CPUReadGSASPSnapshot(const char* fileName)
}
// Read up to 128k save
fread(flashSaveMemory, 1, FLASH_128K_SZ, file);
FREAD_UNCHECKED(flashSaveMemory, 1, FLASH_128K_SZ, file);
fclose(file);
CPUReset();

View File

@ -3,6 +3,7 @@
#include "../common/Types.h"
#include "../System.h"
#include "../Util.h"
const uint64_t TICKS_PER_SECOND = 16777216;

View File

@ -609,6 +609,7 @@ void EnableSpeedHacks(bool enable)
void BootLink(int m_type, const char* hostAddr, int timeout, bool m_hacks, int m_numplayers)
{
(void)m_numplayers; // unused param
if (linkDriver) {
// Connection has already been established
return;
@ -888,7 +889,7 @@ bool CableServer::RecvGB(void)
if (counter == 1)
return false;
int numbytes;
int numbytes = 0;
if (lanlink.type == 0) { // TCP
fdset.clear();
@ -1230,6 +1231,7 @@ void StartCableSocket(uint16_t value)
static void UpdateCableSocket(int ticks)
{
(void)ticks; // unused param
if (linkid && transfer_direction == SENDING && lc.transferring && linktime >= transfer_start_time_from_master) {
cable_data[linkid] = READ16LE(&ioMem[COMM_SIODATA8]);
@ -2199,7 +2201,8 @@ static void StartRFUSocket(uint16_t value)
case 0x24: // send [non-important] data (used by server often)
rfu_data.rfu_linktime[linkid] = linktime; //save the ticks before reseted to zero
if (rfu_cansend && rfu_qsend2 >= 0) {
// rfu_qsend2 >= 0 due to being `uint8_t`
if (rfu_cansend) {
if (rfu_ishost) {
for (int j = 0; j < rfu_data.numgbas; j++)
if (j != linkid) {
@ -2560,7 +2563,7 @@ uint16_t gbLinkUpdate(uint8_t b, int gbSerialOn) //used on external clock
rfu_enabled = false;
if (gbSerialOn) {
if (gba_link_enabled)
if (gba_link_enabled) {
//Single Computer
if (GetLinkMode() == LINK_GAMEBOY_IPC) {
#if (defined __WIN32__ || defined _WIN32)
@ -2595,7 +2598,7 @@ uint16_t gbLinkUpdate(uint8_t b, int gbSerialOn) //used on external clock
}
}
}
}
if (dat == 0xff /*||dat==0x00||b==0x00*/) //dat==0xff||dat==0x00
LinkFirstTime = true;
}

View File

@ -59,6 +59,7 @@ char GBASockClient::ReceiveCmd(char* data_in, bool block)
void GBASockClient::ReceiveClock(bool block)
{
(void)block; // unused param
if (IsDisconnected())
return;

View File

@ -56,7 +56,7 @@ static inline uint32_t CPUReadMemory(uint32_t address)
}
}
#endif
uint32_t value;
uint32_t value = 0;
uint32_t oldAddress = address;
if (address & 3) {

View File

@ -701,9 +701,9 @@ extern int dexp_lex(void);
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
yy_state_type yy_current_state;
char *yy_cp, *yy_bp;
int yy_act;
#line 31 "debugger-expr.l"
@ -748,7 +748,7 @@ YY_DECL
yy_current_state = (yy_start);
yy_match:
do {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -1073,9 +1073,9 @@ YY_DECL
*/
static int yy_get_next_buffer(void)
{
register char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char* source = (yytext_ptr);
register int number_to_move, i;
char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char* source = (yytext_ptr);
int number_to_move, i;
int ret_val;
if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
@ -1192,13 +1192,13 @@ static int yy_get_next_buffer(void)
static yy_state_type yy_get_previous_state(void)
{
register yy_state_type yy_current_state;
register char* yy_cp;
yy_state_type yy_current_state;
char* yy_cp;
yy_current_state = (yy_start);
for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -1221,10 +1221,10 @@ static yy_state_type yy_get_previous_state(void)
*/
static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state)
{
register int yy_is_jam;
register char* yy_cp = (yy_c_buf_p);
int yy_is_jam;
char* yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
YY_CHAR yy_c = 1;
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -1240,9 +1240,9 @@ static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state)
return yy_is_jam ? 0 : yy_current_state;
}
static void yyunput(int c, register char* yy_bp)
static void yyunput(int c, char* yy_bp)
{
register char* yy_cp;
char* yy_cp;
yy_cp = (yy_c_buf_p);
@ -1251,9 +1251,9 @@ static void yyunput(int c, register char* yy_bp)
if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2) { /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = (yy_n_chars) + 2;
register char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
int number_to_move = (yy_n_chars) + 2;
char* dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
*--dest = *--source;
@ -1849,7 +1849,7 @@ int dexp_lex_destroy(void)
#ifndef yytext_ptr
static void yy_flex_strncpy(char* s1, yyconst char* s2, int n)
{
register int i;
int i;
for (i = 0; i < n; ++i)
s1[i] = s2[i];
}
@ -1858,7 +1858,7 @@ static void yy_flex_strncpy(char* s1, yyconst char* s2, int n)
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen(yyconst char* s)
{
register int n;
int n;
for (n = 0; s[n]; ++n)
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
extern unsigned char* DotCodeData;
extern char filebuffer[];
int OpenDotCodeFile(void);
int CheckEReaderRegion(void);
int LoadDotCodeData(int size, uint32_t* DCdata, unsigned long MEM1, unsigned long MEM2);
void EReaderWriteMemory(uint32_t address, uint32_t value);
void BIOS_EReader_ScanCard(int swi_num);
extern unsigned char* DotCodeData;
extern char filebuffer[];
int OpenDotCodeFile(void);
int CheckEReaderRegion(void);
int LoadDotCodeData(int size, uint32_t* DCdata, unsigned long MEM1, unsigned long MEM2);
void EReaderWriteMemory(uint32_t address, uint32_t value);
void BIOS_EReader_ScanCard(int swi_num);

View File

@ -349,6 +349,7 @@ void debuggerDontBreak(int n, char** args)
void debuggerDontBreakClear(int n, char** args)
{
(void)args; // unused params
if (n == 1) {
debuggerNumOfDontBreak = 0;
{
@ -782,7 +783,7 @@ unsigned int AddressToGBA(uint8_t* mem)
void debuggerDoSearch()
{
int count = 0;
unsigned int count = 0;
while (true) {
unsigned int final = SearchStart + SearchLength - 1;
@ -1882,6 +1883,8 @@ void debuggerSymbols(int argc, char** argv)
void debuggerWhere(int n, char** args)
{
(void)n; // unused params
(void)args; // unused params
void elfPrintCallChain(uint32_t);
elfPrintCallChain(armNextPC);
}
@ -1958,6 +1961,7 @@ void debuggerVar(int n, char** args)
bool debuggerBreakOnExecution(uint32_t address, uint8_t state)
{
(void)state; // unused params
if (dontBreakNow)
return false;
if (debuggerInDB(address))
@ -1975,6 +1979,7 @@ bool debuggerBreakOnExecution(uint32_t address, uint8_t state)
bool debuggerBreakOnRead(uint32_t address, int size)
{
(void)size; // unused params
if (dontBreakNow)
return false;
if (debuggerInDB(armState ? reg[15].I - 4 : reg[15].I - 2))
@ -1996,6 +2001,8 @@ bool debuggerBreakOnRead(uint32_t address, int size)
bool debuggerBreakOnWrite(uint32_t address, uint32_t value, int size)
{
(void)value; // unused params
(void)size; // unused params
if (dontBreakNow)
return false;
if (debuggerInDB(armState ? reg[15].I - 4 : reg[15].I - 2))
@ -2019,6 +2026,8 @@ bool debuggerBreakOnWrite(uint32_t address, uint32_t value, int size)
void debuggerBreakOnWrite(uint32_t address, uint32_t oldvalue, uint32_t value, int size, int t)
{
(void)oldvalue; // unused params
(void)t; // unused params
debuggerBreakOnWrite(address, value, size);
//uint32_t lastValue;
//dexp_eval("old_value", &lastValue);
@ -2677,6 +2686,8 @@ void deleteBreak(uint32_t address, uint8_t flags, char** expression, int howToDe
}
void clearBreaks(uint32_t address, uint8_t flags, char** expression, int howToClear)
{
(void)address; // unused params
(void)expression; // unused params
if (howToClear == 2) {
removeConditionalWithFlag(flags, true);
removeConditionalWithFlag(flags << 4, true);
@ -2692,6 +2703,7 @@ void clearBreaks(uint32_t address, uint8_t flags, char** expression, int howToCl
void listBreaks(uint32_t address, uint8_t flags, char** expression, int howToList)
{
(void)expression; // unused params
flags |= (flags << 4);
if (howToList) {
printAllFlagConditionalsWithAddress(address, flags, true);
@ -2896,8 +2908,7 @@ void executeBreakCommands(int n, char** cmd)
operation(address, flag, cmd + 1, n - 1);
return;
}
brkcmd_special_register:
//brkcmd_special_register:
switch (command[4]) {
case 'l':
debuggerBreakRegisterList((n > 0) && (tolower(cmd[0][0]) == 'v'));
@ -3528,7 +3539,7 @@ void remotePutPacket(const char* packet)
const char* hex = "0123456789abcdef";
size_t count = strlen(packet);
char buffer[count + 5];
char* buffer = new char[count + 5];
unsigned char csum = 0;
@ -3548,10 +3559,15 @@ void remotePutPacket(const char* packet)
char c = 0;
while (c != '+') {
remoteSendFnc(buffer, (int)count + 4);
if (remoteRecvFnc(&c, 1) < 0)
if (remoteRecvFnc(&c, 1) < 0) {
delete[] buffer;
return;
}
// fprintf(stderr,"sent:%s recieved:%c\n",buffer,c);
}
delete[] buffer;
}
void remoteOutput(const char* s, uint32_t addr)
@ -3684,7 +3700,7 @@ void remoteMemoryRead(char* p)
sscanf(p, "%x,%x:", &address, &count);
// monprintf("Memory read for %08x %d\n", address, count);
char buffer[(count*2)+1];
char* buffer = new char[(count*2)+1];
char* s = buffer;
for (int i = 0; i < count; i++) {
@ -3695,6 +3711,8 @@ void remoteMemoryRead(char* p)
}
*s = 0;
remotePutPacket(buffer);
delete[] buffer;
}
void remoteQuery(char* p)
@ -3779,7 +3797,7 @@ void remoteSetBreakPoint(char* p)
void remoteClearBreakPoint(char* p)
{
int result;
int result = 0;
uint32_t address;
int count;
sscanf(p, ",%x,%x#", &address, &count);
@ -3968,6 +3986,7 @@ void remoteReadRegister(char* p)
void remoteReadRegisters(char* p)
{
(void)p; // unused params
char buffer[1024];
char* s = buffer;
@ -4226,6 +4245,7 @@ void remoteStubMain()
void remoteStubSignal(int sig, int number)
{
(void)number; // unused params
remoteSignal = sig;
remoteResumed = false;
remoteSendStatus();

View File

@ -1,79 +1,79 @@
#ifndef REMOTE_H
#define REMOTE_H
#include "GBA.h"
#define BitSet(array, bit) ((uint8_t*)(array))[(bit) >> 3] |= (1 << ((bit)&7))
#define BitClear(array, bit) ((uint8_t*)(array))[(bit) >> 3] &= ~(1 << ((bit)&7))
#define BitGet(array, bit) ((uint8_t)((array)[(bit) >> 3]) & (uint8_t)(1 << ((bit)&7)))
#define BreakSet(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] |= ((addr & 1) ? (flag << 4) : (flag & 0xf))
#define BreakClear(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] &= ~((addr & 1) ? (flag << 4) : (flag & 0xf))
// check
#define BreakThumbCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x80 : 0x8)
#define BreakARMCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x40 : 0x4)
#define BreakReadCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x20 : 0x2)
#define BreakWriteCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x10 : 0x1)
#define BreakCheck(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? (flag << 4) : (flag & 0xf))
extern bool debugger;
extern bool dexp_eval(char*, uint32_t*);
extern void dexp_setVar(char*, uint32_t);
extern void dexp_listVars();
extern void dexp_saveVars(char*);
extern void dexp_loadVars(char*);
void debuggerOutput(const char* s, uint32_t addr);
bool debuggerBreakOnExecution(uint32_t address, uint8_t state);
bool debuggerBreakOnWrite(uint32_t address, uint32_t value, int size);
void debuggerBreakOnWrite(uint32_t address, uint32_t oldvalue, uint32_t value, int size, int t);
bool debuggerBreakOnRead(uint32_t address, int size);
struct regBreak {
// uint8_t regNum; /No longer needed
// bit 0 = equal
// bit 1 = greater
// bit 2 = smaller
// bit 3 = signed
uint8_t flags;
uint32_t intVal;
struct regBreak* next;
};
extern uint8_t lowRegBreakCounter[4]; //(r0-r3)
extern uint8_t medRegBreakCounter[4]; //(r4-r7)
extern uint8_t highRegBreakCounter[4]; //(r8-r11)
extern uint8_t statusRegBreakCounter[4]; //(r12-r15)
extern bool enableRegBreak;
extern regBreak* breakRegList[16];
extern void breakReg_check(int i);
struct regBreak* getFromBreakRegList(uint8_t regnum, int location);
void clearBreakRegList();
void clearParticularRegListBreaks(int reg);
void deleteFromBreakRegList(uint8_t regnum, int location);
void addBreakRegToList(uint8_t regnum, uint8_t flags, uint32_t value);
void printBreakRegList(bool verbose);
void remoteStubMain();
void remoteStubSignal(int sig, int number);
void remoteOutput(const char* s, uint32_t addr);
void remoteSetProtocol(int p);
void remoteSetPort(int port);
#endif // REMOTE_H
#ifndef REMOTE_H
#define REMOTE_H
#include "GBA.h"
#define BitSet(array, bit) ((uint8_t*)(array))[(bit) >> 3] |= (1 << ((bit)&7))
#define BitClear(array, bit) ((uint8_t*)(array))[(bit) >> 3] &= ~(1 << ((bit)&7))
#define BitGet(array, bit) ((uint8_t)((array)[(bit) >> 3]) & (uint8_t)(1 << ((bit)&7)))
#define BreakSet(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] |= ((addr & 1) ? (flag << 4) : (flag & 0xf))
#define BreakClear(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] &= ~((addr & 1) ? (flag << 4) : (flag & 0xf))
// check
#define BreakThumbCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x80 : 0x8)
#define BreakARMCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x40 : 0x4)
#define BreakReadCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x20 : 0x2)
#define BreakWriteCheck(array, addr) ((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? 0x10 : 0x1)
#define BreakCheck(array, addr, flag) \
((uint8_t*)(array))[(addr) >> 1] & ((addr & 1) ? (flag << 4) : (flag & 0xf))
extern bool debugger;
extern bool dexp_eval(char*, uint32_t*);
extern void dexp_setVar(char*, uint32_t);
extern void dexp_listVars();
extern void dexp_saveVars(char*);
extern void dexp_loadVars(char*);
void debuggerOutput(const char* s, uint32_t addr);
bool debuggerBreakOnExecution(uint32_t address, uint8_t state);
bool debuggerBreakOnWrite(uint32_t address, uint32_t value, int size);
void debuggerBreakOnWrite(uint32_t address, uint32_t oldvalue, uint32_t value, int size, int t);
bool debuggerBreakOnRead(uint32_t address, int size);
struct regBreak {
// uint8_t regNum; /No longer needed
// bit 0 = equal
// bit 1 = greater
// bit 2 = smaller
// bit 3 = signed
uint8_t flags;
uint32_t intVal;
struct regBreak* next;
};
extern uint8_t lowRegBreakCounter[4]; //(r0-r3)
extern uint8_t medRegBreakCounter[4]; //(r4-r7)
extern uint8_t highRegBreakCounter[4]; //(r8-r11)
extern uint8_t statusRegBreakCounter[4]; //(r12-r15)
extern bool enableRegBreak;
extern regBreak* breakRegList[16];
extern void breakReg_check(int i);
struct regBreak* getFromBreakRegList(uint8_t regnum, int location);
void clearBreakRegList();
void clearParticularRegListBreaks(int reg);
void deleteFromBreakRegList(uint8_t regnum, int location);
void addBreakRegToList(uint8_t regnum, uint8_t flags, uint32_t value);
void printBreakRegList(bool verbose);
void remoteStubMain();
void remoteStubSignal(int sig, int number);
void remoteOutput(const char* s, uint32_t addr);
void remoteSetProtocol(int p);
void remoteSetPort(int port);
#endif // REMOTE_H

View File

@ -33,6 +33,7 @@ void SoundRetro::write(uint16_t* finalWave, int length)
bool SoundRetro::init(long sampleRate)
{
(void)sampleRate; // unused param
return true;
}
@ -51,3 +52,8 @@ void SoundRetro::resume()
void SoundRetro::reset()
{
}
void SoundRetro::setThrottle(unsigned short throttle)
{
(void)throttle; // unused param
}

View File

@ -30,6 +30,7 @@ public:
virtual void reset();
virtual void resume();
virtual void write(uint16_t* finalWave, int length);
virtual void setThrottle(unsigned short throttle);
};
#endif // __VBA_SOUND_RETRO_H__

View File

@ -192,7 +192,7 @@ uint8_t *utilLoad(const char *file, bool (*accept)(const char *), uint8_t *data,
}
}
fread(image, 1, size, fp); // read into buffer
FREAD_UNCHECKED(image, 1, size, fp); // read into buffer
fclose(fp);
return image;
}

View File

@ -31,6 +31,8 @@
#include "../gb/gbSGB.h"
#include "../gb/gbSound.h"
#define VBA_CURRENT_VERSION "2.1.1"
static retro_log_printf_t log_cb;
static retro_video_refresh_t video_cb;
static retro_input_poll_t poll_cb;
@ -536,9 +538,9 @@ void retro_get_system_info(struct retro_system_info *info)
info->need_fullpath = false;
info->valid_extensions = "dmg|gb|gbc|cgb|sgb|gba";
#ifdef GIT_VERSION
info->library_version = "2.1.0" GIT_VERSION;
info->library_version = VBA_CURRENT_VERSION GIT_VERSION;
#else
info->library_version = "2.1.0-GIT";
info->library_version = VBA_CURRENT_VERSION;
#endif
info->library_name = "VBA-M";
info->block_extract = false;

View File

@ -64,13 +64,27 @@
#include "inputSDL.h"
#include "text.h"
// from: https://stackoverflow.com/questions/7608714/why-is-my-pointer-not-null-after-free
#define freeSafe(ptr) free(ptr); ptr = NULL;
#ifndef _WIN32
#include <unistd.h>
#define GETCWD getcwd
#else // _WIN32
#include <direct.h>
#include <io.h>
#define GETCWD _getcwd
#define snprintf sprintf
#define stat _stat
#define access _access
#ifndef W_OK
#define W_OK 2
#endif
#define mkdir(X,Y) (_mkdir(X))
// from: https://www.linuxquestions.org/questions/programming-9/porting-to-win32-429334/
#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & _S_IFMT) == _S_IFDIR)
#endif
#endif // _WIN32
#ifndef __GNUC__
@ -202,6 +216,8 @@ int sdlMirroringEnable = 1;
void systemConsoleMessage(const char*);
char* home;
char homeConfigDir[1024];
char homeDataDir[1024];
char screenMessageBuffer[21];
uint32_t screenMessageTime = 0;
@ -246,7 +262,7 @@ void StartLirc(void)
fprintf(stdout, "Success\n");
//read the config file
char LIRCConfigLoc[2048];
sprintf(LIRCConfigLoc, "%s/%s/%s", homeDir, DOT_DIR, "lircrc");
sprintf(LIRCConfigLoc, "%s%c%s", homeConfigDir, FILE_SEP, "lircrc");
fprintf(stdout, "LIRC Config file:");
if (lirc_readconfig(LIRCConfigLoc, &LIRCConfigInfo, NULL) == 0) {
//check vbam dir for lircrc
@ -284,59 +300,47 @@ void StopLirc(void)
bool sdlCheckDirectory(const char* dir)
{
bool res = false;
if (!dir || !dir[0]) {
return false;
}
struct stat buf;
int len = strlen(dir);
if (!dir || !dir[0])
return false;
char* p = (char*)dir + len - 1;
while (p != dir && (*p == '/' || *p == '\\')) {
*p = 0;
p--;
if (stat(dir, &buf) == 0)
{
if (!(buf.st_mode & S_IFDIR))
{
fprintf(stderr, "Error: %s is not a directory\n", dir);
return false;
}
return true;
}
if (stat(dir, &buf) == 0) {
if (!(buf.st_mode & S_IFDIR)) {
fprintf(stderr, "Error: %s is not a directory\n", dir);
}
res = true;
} else {
fprintf(stderr, "Error: %s does not exist\n", dir);
else
{
fprintf(stderr, "Error: %s does not exist\n", dir);
return false;
}
return res;
}
char* sdlGetFilename(char* name)
{
static char filebuffer[2048];
int len = strlen(name);
char* p = name + len - 1;
while (true) {
if (*p == '/' || *p == '\\') {
p++;
break;
}
len--;
p--;
if (len == 0)
break;
}
if (len == 0)
strcpy(filebuffer, name);
char path[1024] = ""; // avoid warning about uninitialised value
char *filename = strrchr(name, FILE_SEP);
if (filename)
strncpy(path, filename + 1, strlen(filename));
else
strcpy(filebuffer, p);
return filebuffer;
sprintf(path, "%s", name);
return strdup(path);
}
char* sdlGetFilePath(char* name)
{
char path[1024] = ""; // avoid warning about uninitialised value
char *filename = strrchr(name, FILE_SEP);
if (filename)
strncpy(path, name, strlen(name) - strlen(filename));
else
sprintf(path, "%c%c", '.', FILE_SEP);
return strdup(path);
}
FILE* sdlFindFile(const char* name)
@ -366,8 +370,8 @@ FILE* sdlFindFile(const char* name)
}
if (homeDir) {
fprintf(stdout, "Searching home directory: %s%c%s\n", homeDir, FILE_SEP, DOT_DIR);
sprintf(path, "%s%c%s%c%s", homeDir, FILE_SEP, DOT_DIR, FILE_SEP, name);
fprintf(stdout, "Searching home directory: %s\n", homeDataDir);
sprintf(path, "%s%c%s", homeDataDir, FILE_SEP, name);
f = fopen(path, "r");
if (f != NULL)
return f;
@ -488,7 +492,8 @@ static void sdlOpenGLVideoResize()
void sdlOpenGLInit(int w, int h)
{
(void)w; // unused params
(void)h; // unused params
#if 0
float screenAspect = (float) sizeX / sizeY,
windowAspect = (float) w / h;
@ -654,15 +659,18 @@ static int sdlCalculateShift(uint32_t mask)
static char* sdlStateName(int num)
{
static char stateName[2048];
char *gameDir = sdlGetFilePath(filename);
char *gameFile = sdlGetFilename(filename);
if (saveDir)
sprintf(stateName, "%s/%s%d.sgm", saveDir, sdlGetFilename(filename),
num + 1);
else if (homeDir)
sprintf(stateName, "%s/%s/%s%d.sgm", homeDir, DOT_DIR, sdlGetFilename(filename), num + 1);
sprintf(stateName, "%s%c%s%d.sgm", saveDir, FILE_SEP, gameFile, num + 1);
else if (access(gameDir, W_OK) == 0)
sprintf(stateName, "%s%c%s%d.sgm", gameDir, FILE_SEP, gameFile, num + 1);
else
sprintf(stateName, "%s%d.sgm", filename, num + 1);
sprintf(stateName, "%s%c%s%d.sgm", homeDataDir, FILE_SEP, gameFile, num + 1);
freeSafe(gameDir);
freeSafe(gameFile);
return stateName;
}
@ -753,37 +761,46 @@ void sdlWriteBackupStateExchange(int from, int to, int backup)
void sdlWriteBattery()
{
char buffer[1048];
char buffer[2048];
char *gameDir = sdlGetFilePath(filename);
char *gameFile = sdlGetFilename(filename);
if (batteryDir)
sprintf(buffer, "%s/%s.sav", batteryDir, sdlGetFilename(filename));
else if (homeDir)
sprintf(buffer, "%s/%s/%s.sav", homeDir, DOT_DIR, sdlGetFilename(filename));
sprintf(buffer, "%s%c%s.sav", batteryDir, FILE_SEP, gameFile);
else if (access(gameDir, W_OK) == 0)
sprintf(buffer, "%s%c%s.sav", gameDir, FILE_SEP, gameFile);
else
sprintf(buffer, "%s.sav", filename);
sprintf(buffer, "%s%c%s.sav", homeDataDir, FILE_SEP, gameFile);
emulator.emuWriteBattery(buffer);
bool result = emulator.emuWriteBattery(buffer);
systemScreenMessage("Wrote battery");
if (result)
systemMessage(0, "Wrote battery '%s'", buffer);
freeSafe(gameFile);
freeSafe(gameDir);
}
void sdlReadBattery()
{
char buffer[1048];
char buffer[2048];
char *gameDir = sdlGetFilePath(filename);
char *gameFile = sdlGetFilename(filename);
if (batteryDir)
sprintf(buffer, "%s/%s.sav", batteryDir, sdlGetFilename(filename));
else if (homeDir)
sprintf(buffer, "%s/%s/%s.sav", homeDir, DOT_DIR, sdlGetFilename(filename));
sprintf(buffer, "%s%c%s.sav", batteryDir, FILE_SEP, gameFile);
else if (access(gameDir, W_OK) == 0)
sprintf(buffer, "%s%c%s.sav", gameDir, FILE_SEP, gameFile);
else
sprintf(buffer, "%s.sav", filename);
sprintf(buffer, "%s%c%s.sav", homeDataDir, FILE_SEP, gameFile);
bool res = false;
bool result = emulator.emuReadBattery(buffer);
res = emulator.emuReadBattery(buffer);
if (result)
systemMessage(0, "Loaded battery '%s'", buffer);
if (res)
systemScreenMessage("Loaded battery");
freeSafe(gameFile);
freeSafe(gameDir);
}
void sdlReadDesktopVideoMode()
@ -1637,12 +1654,30 @@ void handleRewinds()
}
}
void SetHomeConfigDir()
{
sprintf(homeConfigDir, "%s%s", get_xdg_user_config_home().c_str(), DOT_DIR);
struct stat s;
if (stat(homeDataDir, &s) == -1 || !S_ISDIR(s.st_mode))
mkdir(homeDataDir, 0755);
}
void SetHomeDataDir()
{
sprintf(homeDataDir, "%s%s", get_xdg_user_data_home().c_str(), DOT_DIR);
struct stat s;
if (stat(homeDataDir, &s) == -1 || !S_ISDIR(s.st_mode))
mkdir(homeDataDir, 0755);
}
int main(int argc, char** argv)
{
fprintf(stdout, "%s\n", VBA_NAME_AND_SUBVERSION);
home = argv[0];
SetHome(home);
SetHomeConfigDir();
SetHomeDataDir();
frameSkip = 2;
gbBorderOn = 0;
@ -2024,6 +2059,7 @@ int main(int argc, char** argv)
void systemMessage(int num, const char* msg, ...)
{
(void)num; // unused params
va_list valist;
va_start(valist, msg);
@ -2208,27 +2244,35 @@ void system10Frames(int rate)
void systemScreenCapture(int a)
{
char buffer[2048];
bool result = false;
char *gameDir = sdlGetFilePath(filename);
char *gameFile = sdlGetFilename(filename);
if (captureFormat) {
if (screenShotDir)
sprintf(buffer, "%s/%s%02d.bmp", screenShotDir, sdlGetFilename(filename), a);
else if (homeDir)
sprintf(buffer, "%s/%s/%s%02d.bmp", homeDir, DOT_DIR, sdlGetFilename(filename), a);
sprintf(buffer, "%s%c%s%02d.bmp", screenShotDir, FILE_SEP, gameFile, a);
else if (access(gameDir, W_OK) == 0)
sprintf(buffer, "%s%c%s%02d.bmp", gameDir, FILE_SEP, gameFile, a);
else
sprintf(buffer, "%s%02d.bmp", filename, a);
sprintf(buffer, "%s%c%s%02d.bmp", homeDataDir, FILE_SEP, gameFile, a);
emulator.emuWriteBMP(buffer);
result = emulator.emuWriteBMP(buffer);
} else {
if (screenShotDir)
sprintf(buffer, "%s/%s%02d.png", screenShotDir, sdlGetFilename(filename), a);
else if (homeDir)
sprintf(buffer, "%s/%s/%s%02d.png", homeDir, DOT_DIR, sdlGetFilename(filename), a);
sprintf(buffer, "%s%c%s%02d.png", screenShotDir, FILE_SEP, gameFile, a);
else if (access(gameDir, W_OK) == 0)
sprintf(buffer, "%s%c%s%02d.png", gameDir, FILE_SEP, gameFile, a);
else
sprintf(buffer, "%s%02d.png", filename, a);
emulator.emuWritePNG(buffer);
sprintf(buffer, "%s%c%s%02d.png", homeDataDir, FILE_SEP, gameFile, a);
result = emulator.emuWritePNG(buffer);
}
systemScreenMessage("Screen capture");
if (result)
systemScreenMessage("Screen capture");
freeSafe(gameFile);
freeSafe(gameDir);
}
void systemSaveOldest()
@ -2248,6 +2292,12 @@ uint32_t systemGetClock()
void systemGbPrint(uint8_t* data, int len, int pages, int feed, int palette, int contrast)
{
(void)data; // unused params
(void)len; // unused params
(void)pages; // unused params
(void)feed; // unused params
(void)palette; // unused params
(void)contrast; // unused params
}
/* xKiv: added timestamp */
@ -2370,6 +2420,8 @@ void systemOnSoundShutdown()
void systemOnWriteDataToSoundBuffer(const uint16_t* finalWave, int length)
{
(void)finalWave; // unused params
(void)length; // unused params
}
void log(const char* defaultMsg, ...)

View File

@ -634,9 +634,9 @@ extern int yylex(void);
*/
YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
yy_state_type yy_current_state;
char *yy_cp, *yy_bp;
int yy_act;
#line 33 "expr.l"
@ -681,7 +681,7 @@ YY_DECL
yy_current_state = (yy_start);
yy_match:
do {
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -912,9 +912,9 @@ YY_DECL
*/
static int yy_get_next_buffer(void)
{
register char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
register char* source = (yytext_ptr);
register int number_to_move, i;
char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char* source = (yytext_ptr);
int number_to_move, i;
int ret_val;
if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
@ -1031,13 +1031,13 @@ static int yy_get_next_buffer(void)
static yy_state_type yy_get_previous_state(void)
{
register yy_state_type yy_current_state;
register char* yy_cp;
yy_state_type yy_current_state;
char* yy_cp;
yy_current_state = (yy_start);
for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -1060,10 +1060,10 @@ static yy_state_type yy_get_previous_state(void)
*/
static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state)
{
register int yy_is_jam;
register char* yy_cp = (yy_c_buf_p);
int yy_is_jam;
char* yy_cp = (yy_c_buf_p);
register YY_CHAR yy_c = 1;
YY_CHAR yy_c = 1;
if (yy_accept[yy_current_state]) {
(yy_last_accepting_state) = yy_current_state;
(yy_last_accepting_cpos) = yy_cp;
@ -1655,7 +1655,7 @@ int yylex_destroy(void)
#ifndef yytext_ptr
static void yy_flex_strncpy(char* s1, yyconst char* s2, int n)
{
register int i;
int i;
for (i = 0; i < n; ++i)
s1[i] = s2[i];
}
@ -1664,7 +1664,7 @@ static void yy_flex_strncpy(char* s1, yyconst char* s2, int n)
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen(yyconst char* s)
{
register int n;
int n;
for (n = 0; s[n]; ++n)
;

View File

@ -1530,6 +1530,7 @@ yyreturn:
int yyerror(const char* s)
{
(void)s; // unused params
return 0;
}

View File

@ -97,6 +97,9 @@ Node* exprNodeNumber()
bool exprNodeNumberResolve(Node* n, Function* f, CompileUnit* u)
{
(void)n; // unused params
(void)f; // unused params
(void)u; // unused params
return true;
}

View File

@ -605,6 +605,7 @@ void (*sdlStretcher24[4])(uint8_t*, uint8_t*, int) = {
bool sdlStretchInit(int colorDepth, int sizeMultiplier, int srcWidth)
{
(void)srcWidth; // unused params
#ifndef C_CORE
sdlMakeStretcher(srcWidth, sizeMultiplier);
#else

View File

@ -340,7 +340,7 @@ static void exchange(argv) char** argv;
if (top - middle > middle - bottom) {
/* Bottom segment is the short one. */
int len = middle - bottom;
register int i;
int i;
/* Swap it with the top part of the top segment. */
for (i = 0; i < len; i++) {
@ -354,7 +354,7 @@ static void exchange(argv) char** argv;
} else {
/* Top segment is the short one. */
int len = top - middle;
register int i;
int i;
/* Swap it with the bottom part of the bottom segment. */
for (i = 0; i < len; i++) {

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@ void MainFrame::GetMenuOptionBool(const char* menuName, bool& field)
field = !field;
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -65,7 +65,7 @@ void MainFrame::GetMenuOptionInt(const char* menuName, int& field, int mask)
bool is_checked = ((field) & (mask)) != (value);
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -80,7 +80,7 @@ void MainFrame::SetMenuOption(const char* menuName, int value)
{
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -506,6 +506,7 @@ static bool maker_lt(const rom_maker& r1, const rom_maker& r2)
void SetDialogLabel(wxDialog* dlg, const wxString& id, wxString ts, size_t l)
{
(void)l; // unused params
ts.Replace(wxT("&"), wxT("&&"), true);
(dynamic_cast<wxControl*>((*dlg).FindWindow(wxXmlResource::GetXRCID(id))))->SetLabel(ts);
}
@ -527,7 +528,7 @@ EVT_HANDLER_MASK(RomInformation, "ROM information...", CMDEN_GB | CMDEN_GBA)
} while (0)
#define setblabs(id, b, ts) \
do { \
s.Printf(wxT("%02x (%s)"), (unsigned int)b, ts); \
s.Printf(wxT("%02x (%s)"), (unsigned int)b, ts.c_str()); \
setlab(id); \
} while (0)
#define setlabs(id, ts, l) \
@ -548,7 +549,7 @@ EVT_HANDLER_MASK(RomInformation, "ROM information...", CMDEN_GB | CMDEN_GBA)
s.Printf(wxT("%02x"), gbRom[0x14b]);
setlab("MakerCode");
const rom_maker m = { s }, *rm;
const rom_maker m = { s, wxString() }, *rm;
rm = std::lower_bound(&makers[0], &makers[num_makers], m, maker_lt);
if (rm < &makers[num_makers] && !wxStrcmp(m.code, rm->code))
@ -776,7 +777,7 @@ EVT_HANDLER_MASK(RomInformation, "ROM information...", CMDEN_GB | CMDEN_GBA)
SetDialogLabel(dlg, wxT("CRC32"), rom_crc32, 8);
setlabs("GameCode", rom[0xac], 4);
setlabs("MakerCode", rom[0xb0], 2);
const rom_maker m = { s }, *rm;
const rom_maker m = { s, wxString() }, *rm;
rm = std::lower_bound(&makers[0], &makers[num_makers], m, maker_lt);
if (rm < &makers[num_makers] && !wxStrcmp(m.code, rm->code))
@ -804,6 +805,9 @@ EVT_HANDLER_MASK(RomInformation, "ROM information...", CMDEN_GB | CMDEN_GBA)
dlg->Fit();
ShowModal(dlg);
} break;
default:
break;
}
}
@ -865,9 +869,9 @@ EVT_HANDLER_MASK(ImportBatteryFile, "Import battery file...", CMDEN_GB | CMDEN_G
wxString msg;
if (panel->emusys->emuReadBattery(fn.mb_fn_str()))
msg.Printf(_("Loaded battery %s"), fn.mb_str());
msg.Printf(_("Loaded battery %s"), fn.c_str());
else
msg.Printf(_("Error loading battery %s"), fn.mb_str());
msg.Printf(_("Error loading battery %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -903,7 +907,7 @@ EVT_HANDLER_MASK(ImportGamesharkCodeFile, "Import GameShark code file...", CMDEN
wxFFile f(fn, wxT("rb"));
if (!f.IsOpened()) {
wxLogError(_("Cannot open file %s"), fn.mb_str());
wxLogError(_("Cannot open file %s"), fn.c_str());
return;
}
@ -913,7 +917,7 @@ EVT_HANDLER_MASK(ImportGamesharkCodeFile, "Import GameShark code file...", CMDEN
char buf[14];
if (f.Read(&len, sizeof(len)) != sizeof(len) || wxUINT32_SWAP_ON_BE(len) != 14 || f.Read(buf, 14) != 14 || memcmp(buf, "SharkPortCODES", 14)) {
wxLogError(_("Unsupported code file %s"), fn.mb_str());
wxLogError(_("Unsupported code file %s"), fn.c_str());
return;
}
@ -971,7 +975,7 @@ EVT_HANDLER_MASK(ImportGamesharkCodeFile, "Import GameShark code file...", CMDEN
game = lst->GetSelection();
if (game == wxNOT_FOUND)
if ((int)game == wxNOT_FOUND)
game = 0;
}
@ -983,9 +987,9 @@ EVT_HANDLER_MASK(ImportGamesharkCodeFile, "Import GameShark code file...", CMDEN
}
if (res)
msg.Printf(_("Loaded code file %s"), fn.mb_str());
msg.Printf(_("Loaded code file %s"), fn.c_str());
else
msg.Printf(_("Error loading code file %s"), fn.mb_str());
msg.Printf(_("Error loading code file %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -1031,9 +1035,9 @@ EVT_HANDLER_MASK(ImportGamesharkActionReplaySnapshot,
}
if (res)
msg.Printf(_("Loaded snapshot file %s"), fn.mb_str());
msg.Printf(_("Loaded snapshot file %s"), fn.c_str());
else
msg.Printf(_("Error loading snapshot file %s"), fn.mb_str());
msg.Printf(_("Error loading snapshot file %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -1056,9 +1060,9 @@ EVT_HANDLER_MASK(ExportBatteryFile, "Export battery file...", CMDEN_GB | CMDEN_G
wxString msg;
if (panel->emusys->emuWriteBattery(fn.mb_fn_str()))
msg.Printf(_("Wrote battery %s"), fn.mb_str());
msg.Printf(_("Wrote battery %s"), fn.c_str());
else
msg.Printf(_("Error writing battery %s"), fn.mb_str());
msg.Printf(_("Error writing battery %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -1097,11 +1101,11 @@ EVT_HANDLER_MASK(ExportGamesharkSnapshot, "Export GameShark snapshot...", CMDEN_
// FIXME: this will fail on big-endian machines if file format is
// little-endian
// fix in GBA.cpp
if (CPUWriteGSASnapshot(fn.mb_str(), tit->GetValue().mb_str(),
dsc->GetValue().mb_str(), n->GetValue().mb_str()))
msg.Printf(_("Saved snapshot file %s"), fn.mb_str());
if (CPUWriteGSASnapshot(fn.utf8_str(), tit->GetValue().utf8_str(),
dsc->GetValue().utf8_str(), n->GetValue().utf8_str()))
msg.Printf(_("Saved snapshot file %s"), fn.c_str());
else
msg.Printf(_("Error saving snapshot file %s"), fn.mb_str());
msg.Printf(_("Error saving snapshot file %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -1141,7 +1145,7 @@ EVT_HANDLER_MASK(ScreenCapture, "Screen capture...", CMDEN_GB | CMDEN_GBA)
panel->emusys->emuWriteBMP(fn.mb_fn_str());
wxString msg;
msg.Printf(_("Wrote snapshot %s"), fn.mb_str());
msg.Printf(_("Wrote snapshot %s"), fn.c_str());
systemScreenMessage(msg);
}
@ -1606,7 +1610,7 @@ EVT_HANDLER_MASK(Rewind, "Rewind", CMDEN_REWIND)
// if within 5 seconds of last one, and > 1 state, delete last state & move back
// FIXME: 5 should actually be user-configurable
// maybe instead of 5, 10% of rewind_interval
if (panel->num_rewind_states > 1 && (gopts.rewind_interval <= 5 || panel->rewind_time / 6 > gopts.rewind_interval - 5)) {
if (panel->num_rewind_states > 1 && (gopts.rewind_interval <= 5 || (int)panel->rewind_time / 6 > gopts.rewind_interval - 5)) {
--panel->num_rewind_states;
panel->next_rewind_state = rew_st;
@ -1713,7 +1717,7 @@ EVT_HANDLER_MASK(VideoLayersReset, "Show all video layers", CMDEN_GB | CMDEN_GBA
#define set_vl(s) \
do { \
int id = XRCID(s); \
for (int i = 0; i < checkable_mi.size(); i++) \
for (size_t i = 0; i < checkable_mi.size(); i++) \
if (checkable_mi[i].cmd == id) { \
checkable_mi[i].mi->Check(true); \
break; \
@ -1937,7 +1941,7 @@ void MainFrame::GDBBreak()
if (!debugOpenPty())
return;
msg.Printf(_("Waiting for connection at %s"), debugGetSlavePty().mb_str());
msg.Printf(_("Waiting for connection at %s"), debugGetSlavePty().c_str());
} else
#endif
{
@ -2242,7 +2246,7 @@ EVT_HANDLER(GameBoyAdvanceConfigure, "Game Boy Advance options...")
vba_over.append(wxTextFile::GetEOL());
fn.Mkdir(0777, wxPATH_MKDIR_FULL);
wxTempFileOutputStream fos(fn.GetFullPath());
fos.Write(vba_over.mb_str(), vba_over.size());
fos.Write(vba_over.c_str(), vba_over.size());
fos.Commit();
}
}
@ -2291,7 +2295,7 @@ EVT_HANDLER_MASK(ChangeFilter, "Change Pixel Filter", CMDEN_NREC_ANY)
{
int filt = gopts.filter;
if (filt == FF_PLUGIN || ++gopts.filter == FF_PLUGIN && gopts.filter_plugin.empty()) {
if ((filt == FF_PLUGIN || ++gopts.filter == FF_PLUGIN) && gopts.filter_plugin.empty()) {
gopts.filter = 0;
}

View File

@ -18,7 +18,7 @@ SET(EVLINES )
FOREACH(EV ${MW})
# stripping the wxID_ makes it look better, but it's still all-caps
STRING(REGEX REPLACE "^[^\"]*\\((wxID_|)([^,]*),[^\"]*(\"[^\"]*\")[^,)]*(,[^)]*|).*"
" {wxT(\"\\2\"), wxTRANSLATE(\\3), XRCID(\"\\1\\2\")\\4 }"
" new_cmditem(wxT(\"\\2\"), wxTRANSLATE(\\3), XRCID(\"\\1\\2\")\\4 )"
EV "${EV}")
STRING(REGEX REPLACE "XRCID\\(\"(wxID_[^\"]*)\"\\)" "\\1" EV ${EV})
LIST(APPEND EVLINES "${EV},\n")

View File

@ -69,7 +69,7 @@ bool GetFADevices(wxArrayString& names, wxArrayString& ids)
}
GetFADevices(fa, &names, &ids, NULL);
//fa->Release();
//fa->Release();
FAudio_Release(fa);
return true;
}
@ -371,7 +371,7 @@ bool FAudio_Output::init(long sampleRate)
wfx.nBlockAlign = wfx.nChannels * (wfx.wBitsPerSample / 8);
wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign;
// create sound receiver
hr = FAudio_CreateMasteringVoice(
hr = FAudio_CreateMasteringVoice(
faud,
&mVoice,
FAUDIO_DEFAULT_CHANNELS,
@ -386,9 +386,9 @@ bool FAudio_Output::init(long sampleRate)
return false;
}
// create sound emitter
// create sound emitter
//This should be FAudio_CreateSourceVoice()
//hr = faud->CreateSourceVoice(&sVoice, &wfx, 0, 4.0f, &notify);
//hr = faud->CreateSourceVoice(&sVoice, &wfx, 0, 4.0f, &notify);
hr = FAudio_CreateSourceVoice(faud, &sVoice, (const FAudioWaveFormatEx*)&wfx, 0, 4.0f, &notify, NULL, NULL);
if (hr != S_OK) {
@ -516,7 +516,7 @@ bool FAudio_Output::init(long sampleRate)
}
void FAudio_Output::write(uint16_t* finalWave, int length)
{
{
UINT32 flags = 0;
if (!initialized || failed)
return;

View File

@ -229,7 +229,7 @@ public:
s.Printf(wxT("0x%08X"), address);
addr->SetLabel(s);
if (!mode || (mode < 3 || mode > 5) && bg < 2) {
if ((!mode || (mode < 3 || mode > 5)) && bg < 2) {
uint16_t value = *((uint16_t*)&vram[address - 0x6000000]);
s.Printf(wxT("%d"), value & 1023);
tile->SetLabel(s);
@ -738,6 +738,10 @@ void MainFrame::MapViewer()
case IMAGE_GB:
LoadXRCViewer(GBMap);
break;
case IMAGE_UNKNOWN:
// do nothing
break;
}
}
@ -1113,6 +1117,10 @@ void MainFrame::OAMViewer()
case IMAGE_GB:
LoadXRCViewer(GBOAM);
break;
case IMAGE_UNKNOWN:
// do nothing
break;
}
}
@ -1233,11 +1241,13 @@ public:
}
void SelBG(wxMouseEvent& ev)
{
(void)ev; // unused params
spv->SetSel(-1, -1, false);
ShowSel();
}
void SelSprite(wxMouseEvent& ev)
{
(void)ev; // unused params
bpv->SetSel(-1, -1, false);
ShowSel();
}
@ -1273,14 +1283,17 @@ public:
}
void SaveBG(wxCommandEvent& ev)
{
(void)ev; // unused params
savepal(this, colbmp, 16 * 16, wxT("bg"));
}
void SaveOBJ(wxCommandEvent& ev)
{
(void)ev; // unused params
savepal(this, colbmp + 16 * 16 * 3, 16 * 16, wxT("obj"));
}
void ChangeBackdrop(wxCommandEvent& ev)
{
(void)ev; // unused params
// FIXME: this should really be a preference
// should also have some way of indicating selection
// perhaps replace w/ checkbox + colorpickerctrl
@ -1294,7 +1307,7 @@ public:
*cd = dlg.GetColourData();
wxColour c = cd->GetColour();
//Binary or the upper 5 bits of each color choice
customBackdropColor = (c.Red() >> 3) || ((c.Green() >> 3) << 5) || ((c.Blue() >> 3) << 10);
customBackdropColor = ((c.Red() >> 3) != 0) || (((c.Green() >> 3) << 5) != 0) || (((c.Blue() >> 3) << 10) != 0);
} else
// kind of an unintuitive way to turn it off...
customBackdropColor = -1;
@ -1347,11 +1360,13 @@ public:
}
void SelBG(wxMouseEvent& ev)
{
(void)ev; // unused params
spv->SetSel(-1, -1, false);
ShowSel();
}
void SelSprite(wxMouseEvent& ev)
{
(void)ev; // unused params
bpv->SetSel(-1, -1, false);
ShowSel();
}
@ -1386,10 +1401,12 @@ public:
}
void SaveBG(wxCommandEvent& ev)
{
(void)ev; // unused params
savepal(this, colbmp, 4 * 8, wxT("bg"));
}
void SaveOBJ(wxCommandEvent& ev)
{
(void)ev; // unused params
savepal(this, colbmp + 4 * 8 * 3, 4 * 8, wxT("obj"));
}
@ -1419,6 +1436,10 @@ void MainFrame::PaletteViewer()
case IMAGE_GB:
LoadXRCViewer(GBPalette);
break;
case IMAGE_UNKNOWN:
// do nothing
break;
}
}
@ -1687,5 +1708,9 @@ void MainFrame::TileViewer()
case IMAGE_GB:
LoadXRCViewer(GBTile);
break;
case IMAGE_UNKNOWN:
// do nothing
break;
}
}

View File

@ -17,7 +17,6 @@
#include <wx/filepicker.h>
#include <wx/progdlg.h>
#include <wx/spinctrl.h>
#include <wx/valnum.h>
#include <wx/stockitem.h>
#include <wx/tokenzr.h>
#include <wx/txtstrm.h>
@ -73,10 +72,12 @@ public:
wxButton* okb;
void ServerOKButton(wxCommandEvent& ev)
{
(void)ev; // unused params
okb->SetLabel(_("Start!"));
}
void ClientOKButton(wxCommandEvent& ev)
{
(void)ev; // unused params
okb->SetLabel(_("Connect"));
}
// attached to OK, so skip when OK
@ -88,7 +89,7 @@ public:
return;
if (!server) {
bool valid = SetLinkServerHost(gopts.link_host.mb_str());
bool valid = SetLinkServerHost(gopts.link_host.c_str());
if (!valid) {
wxMessageBox(_("You must enter a valid host name"),
@ -111,10 +112,10 @@ public:
char host[length];
GetLinkServerHost(host, length);
title.Printf(_("Waiting for clients..."));
connmsg.Printf(_("Server IP address is: %s\n"), wxString(host, wxConvLibc).mb_str());
connmsg.Printf(_("Server IP address is: %s\n"), wxString(host, wxConvLibc).c_str());
} else {
title.Printf(_("Waiting for connection..."));
connmsg.Printf(_("Connecting to %s\n"), gopts.link_host.mb_str());
connmsg.Printf(_("Connecting to %s\n"), gopts.link_host.c_str());
}
// Init link
@ -306,7 +307,7 @@ public:
} break;
case wxID_REMOVE: {
bool asked = false, restore;
bool asked = false, restore = false;
for (int i = list->GetItemCount() - 1; i >= 0; i--)
if (list->GetItemState(i, wxLIST_STATE_SELECTED)) {
@ -436,9 +437,9 @@ public:
if (isgb) {
if (!ce_type)
gbAddGsCheat(tok.mb_str(), ce_desc.mb_str());
gbAddGsCheat(tok.utf8_str(), ce_desc.utf8_str());
else
gbAddGgCheat(tok.mb_str(), ce_desc.mb_str());
gbAddGgCheat(tok.utf8_str(), ce_desc.utf8_str());
} else {
// Flashcart CHT format
if (tok.Contains(wxT("="))) {
@ -446,16 +447,16 @@ public:
}
// Generic Code
else if (tok.Contains(wxT(":")))
cheatsAddCheatCode(tok.mb_str(), ce_desc.mb_str());
cheatsAddCheatCode(tok.utf8_str(), ce_desc.utf8_str());
// following determination of type by lengths is
// same used by win32 and gtk code
// and like win32/gtk code, user-chosen fmt is ignored
else if (tok.size() == 12) {
tok = tok.substr(0, 8) + wxT(' ') + tok.substr(8);
cheatsAddCBACode(tok.mb_str(), ce_desc.mb_str());
cheatsAddCBACode(tok.utf8_str(), ce_desc.utf8_str());
} else if (tok.size() == 16)
// not sure why 1-tok is !v3 and 2-tok is v3..
cheatsAddGSACode(tok.mb_str(), ce_desc.mb_str(), false);
cheatsAddGSACode(tok.utf8_str(), ce_desc.utf8_str(), false);
// CBA codes are assumed to be N+4, and anything else
// is assumed to be GSA v3 (although I assume the
// actual formats should be 8+4 and 8+8)
@ -463,18 +464,18 @@ public:
if (!tk.HasMoreTokens()) {
// throw an error appropriate to chosen type
if (ce_type == 1) // GSA
cheatsAddGSACode(tok.mb_str(), ce_desc.mb_str(), false);
cheatsAddGSACode(tok.utf8_str(), ce_desc.utf8_str(), false);
else
cheatsAddCBACode(tok.mb_str(), ce_desc.mb_str());
cheatsAddCBACode(tok.utf8_str(), ce_desc.utf8_str());
} else {
wxString tok2 = tk.GetNextToken();
if (tok2.size() == 4) {
tok += wxT(' ') + tok2;
cheatsAddCBACode(tok.mb_str(), ce_desc.mb_str());
cheatsAddCBACode(tok.utf8_str(), ce_desc.utf8_str());
} else {
tok += tok2;
cheatsAddGSACode(tok.mb_str(), ce_desc.mb_str(), true);
cheatsAddGSACode(tok.utf8_str(), ce_desc.utf8_str(), true);
}
}
}
@ -624,7 +625,7 @@ public:
} else if (ce_desc != odesc) {
*dirty = true;
char* p = isgb ? gbCheatList[id].cheatDesc : cheatsList[id].desc;
strncpy(p, ce_desc.mb_str(), sizeof(cheatsList[0].desc));
strncpy(p, ce_desc.utf8_str(), sizeof(cheatsList[0].desc));
p[sizeof(cheatsList[0].desc) - 1] = 0;
item1.SetId(id);
item1.SetText(wxString(p, wxConvUTF8));
@ -674,7 +675,7 @@ void CheatList_t::ParseChtLine(wxString desc, wxString tok)
wxString cheat_value;
uint32_t address = 0;
uint32_t value = 0;
sscanf(cheat_addr.mb_str(), "%8x", &address);
sscanf(cheat_addr.utf8_str(), "%8x", &address);
if (address < 0x40000)
address += 0x2000000;
@ -685,11 +686,11 @@ void CheatList_t::ParseChtLine(wxString desc, wxString tok)
while (value_tk.HasMoreTokens()) {
wxString value_token = value_tk.GetNextToken();
sscanf(value_token.mb_str(), "%2x", &value);
sscanf(value_token.utf8_str(), "%2x", &value);
cheat_line.Printf(wxT("%08X"), address);
cheat_value.Printf(wxT("%02X"), value);
cheat_line = cheat_line + wxT(":") + cheat_value;
cheatsAddCheatCode(cheat_line.mb_str(), cheat_desc.mb_str());
cheatsAddCheatCode(cheat_line.utf8_str(), cheat_desc.utf8_str());
address++;
}
}
@ -705,10 +706,14 @@ public:
CheatListFill(const CheatListFill& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new CheatListFill(*this); }
bool TransferFromWindow() { return true; }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
CheatList_t& clh = cheat_list_handler;
@ -886,6 +891,7 @@ public:
void UpdateVals(wxCommandEvent& ev)
{
(void)ev; // unused params
if (cheatSearchData.count) {
cheatSearchUpdateValues(&cheatSearchData);
@ -898,6 +904,7 @@ public:
void ResetSearch(wxCommandEvent& ev)
{
(void)ev; // unused params
if (!cheatSearchData.count) {
CheatSearchBlock* block = cheatSearchData.blocks;
@ -989,6 +996,7 @@ public:
void AddCheatB(wxCommandEvent& ev)
{
(void)ev; // unused params
int idx = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (idx >= 0)
@ -1070,7 +1078,7 @@ public:
for (int i = 0; i < (1 << size); i++) {
addr_s.Printf(wxT("%02X%02X%02X%02X"), bank, val & 0xff,
addr & 0xff, addr >> 8);
gbAddGsCheat(addr_s.mb_str(), ca_desc.mb_str());
gbAddGsCheat(addr_s.utf8_str(), ca_desc.utf8_str());
val >>= 8;
addr++;
}
@ -1092,7 +1100,7 @@ public:
}
addr_s.append(s);
cheatsAddCheatCode(addr_s.mb_str(), ca_desc.mb_str());
cheatsAddCheatCode(addr_s.utf8_str(), ca_desc.utf8_str());
}
}
@ -1195,6 +1203,7 @@ public:
void UpdateView(wxCommandEvent& ev)
{
(void)ev; // unused params
dlg->TransferDataFromWindow();
if (ofmt != fmt && !val_s.empty()) {
@ -1283,10 +1292,14 @@ public:
CheatFindFill(const CheatFindFill& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new CheatFindFill(*this); }
bool TransferFromWindow() { return true; }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
CheatFind_t& cfh = cheat_find_handler;
@ -1314,7 +1327,7 @@ wxString CheatListCtrl::OnGetItemText(long item, long column) const
off = (item & ((1 << (cap_size - size)) - 1)) << size;
item >>= cap_size - size;
} else if (cap_size < size) {
for (int i = 0; i < addrs.size(); i++) {
for (size_t i = 0; i < addrs.size(); i++) {
if (!(addrs[i] & ((1 << size) - 1)) && !item--) {
item = i;
break;
@ -1419,6 +1432,7 @@ public:
}
void ColorReset(wxCommandEvent& ev)
{
(void)ev; // unused params
const uint16_t* color = &systemGbPalette[pno * 8];
for (int i = 0; i < 8; i++, color++)
@ -1429,6 +1443,7 @@ public:
void ColorButton(wxCommandEvent& ev)
{
(void)ev; // unused params
c->SetSelection(0);
}
} GBColorConfigHandler[3];
@ -1443,10 +1458,14 @@ public:
GBACtrlEnabler(const GBACtrlEnabler& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new GBACtrlEnabler(*this); }
bool TransferFromWindow() { return true; }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
GetWindow()->Enable(wxGetApp().frame->GetPanel()->game_type() == IMAGE_GBA);
@ -1465,6 +1484,7 @@ public:
}
void Detect(wxCommandEvent& ev)
{
(void)ev; // unused params
uint32_t sz = wxGetApp().frame->GetPanel()->game_size();
utilGBAFindSave(sz);
type->SetSelection(saveType);
@ -1490,6 +1510,7 @@ public:
void FullVol(wxCommandEvent& ev)
{
(void)ev; // unused params
vol->SetValue(100);
}
void AdjustFrames(int count)
@ -1500,6 +1521,7 @@ public:
}
void AdjustFramesEv(wxCommandEvent& ev)
{
(void)ev; // unused params
AdjustFrames(bufs->GetValue());
}
@ -1549,7 +1571,7 @@ public:
dev->SetSelection(0);
for (int i = 0; i < names.size(); i++) {
for (size_t i = 0; i < names.size(); i++) {
dev->Append(names[i]);
if (api == gopts.audio_api && gopts.audio_dev == dev_ids[i])
@ -1572,7 +1594,7 @@ public:
if (newapi == lastapi)
return;
gopts.audio_dev = "";
gopts.audio_dev = wxT("");
FillDev(newapi);
}
} sound_config_handler;
@ -1587,9 +1609,13 @@ public:
SoundConfigLoad(const SoundConfigLoad& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new SoundConfigLoad(*this); }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
SoundConfig_t& sch = sound_config_handler;
@ -1650,9 +1676,13 @@ public:
ScreenModeList(const ScreenModeList& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new ScreenModeList(*this); }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
wxChoice* c = wxStaticCast(GetWindow(), wxChoice);
@ -1666,7 +1696,7 @@ public:
vm = d.GetModes();
wxString s;
for (int i = 0; i < vm.size(); i++) {
for (size_t i = 0; i < vm.size(); i++) {
s.Printf(_("%d x %d - %dbpp @ %dHz"), vm[i].w, vm[i].h, vm[i].bpp, vm[i].refresh);
c->Append(s);
@ -1724,10 +1754,14 @@ public:
PluginEnabler(const PluginEnabler& e)
: wxValidator()
{
(void)e; // unused params
}
wxObject* Clone() const { return new PluginEnabler(*this); }
bool TransferFromWindow() { return true; }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
GetWindow()->Enable(gopts.filter == FF_PLUGIN);
@ -1752,22 +1786,25 @@ class PluginListFiller : public PluginEnabler {
public:
PluginListFiller(wxDialog* parent, wxControl* lab, wxChoice* ch)
: PluginEnabler()
, dlg(parent)
, txt(lab)
, dlg(parent)
, plugins()
, filtch(ch)
, plugins()
{
}
PluginListFiller(const PluginListFiller& e)
: PluginEnabler()
, dlg(e.dlg)
, txt(e.txt)
, dlg(e.dlg)
, plugins(e.plugins)
, filtch(e.filtch)
, plugins(e.plugins)
{
}
wxObject* Clone() const { return new PluginListFiller(*this); }
bool Validate(wxWindow* p) { return true; }
bool Validate(wxWindow* p) {
(void)p; // unused params
return true;
}
bool TransferToWindow()
{
PluginEnabler::TransferToWindow();
@ -1775,13 +1812,13 @@ public:
ch->Clear();
ch->Append(_("None"));
plugins.clear();
const wxString& plpath = wxStandardPaths::Get().GetPluginsDir();
wxDir::GetAllFiles(plpath, &plugins, wxT("*.rpi"));
const wxString plpath = wxGetApp().GetPluginsDir();
wxDir::GetAllFiles(plpath, &plugins, wxT("*.rpi"), wxDIR_FILES | wxDIR_DIRS);
for (int i = 0; i < plugins.size(); i++) {
for (size_t i = 0; i < plugins.size(); i++) {
wxDynamicLibrary dl(plugins[i], wxDL_VERBATIM | wxDL_NOW);
RENDPLUG_GetInfo GetInfo;
const RENDER_PLUGIN_INFO* rpi;
const RENDER_PLUGIN_INFO* rpi = NULL;
if (dl.IsLoaded() && (GetInfo = (RENDPLUG_GetInfo)dl.GetSymbol(wxT("RenderPluginGetInfo"))) &&
// note that in actual kega fusion plugins, rpi->Output is
@ -1798,13 +1835,15 @@ public:
s += wxT(": ");
s += wxString(rpi->Name, wxConvUTF8, sizeof(rpi->Name));
fn.MakeRelativeTo(plpath);
plugins[i] = fn.GetFullName();
plugins[i] = fn.GetFullPath();
ch->Append(s);
if (plugins[i] == gopts.filter_plugin)
ch->SetSelection(i + 1);
} else
}
else {
plugins.RemoveAt(i--);
}
}
if (ch->GetCount() == 1) {
@ -1812,7 +1851,7 @@ public:
// to put the plugins... it depends on where program was
// installed, and of course OS
wxString msg;
msg.Printf(_("No usable rpi plugins found in %s"), plpath.mb_str());
msg.Printf(_("No usable rpi plugins found in %s"), plpath.c_str());
systemScreenMessage(msg);
ch->Hide();
txt->Hide();
@ -1994,7 +2033,7 @@ public:
asb->Enable(!key->GetValue().empty());
int cmd = id->val;
for (int i = 0; i < accels.size(); i++)
for (size_t i = 0; i < accels.size(); i++)
if (accels[i].GetCommand() == cmdtab[cmd].cmd_id)
lb->Append(wxKeyTextCtrl::ToString(accels[i].GetFlags(),
accels[i].GetKeyCode()));
@ -2003,12 +2042,14 @@ public:
// after selecting a key in key list, enable Remove button
void KeySel(wxCommandEvent& ev)
{
(void)ev; // unused params
remb->Enable(lb->GetSelection() != wxNOT_FOUND);
}
// remove selected binding
void Remove(wxCommandEvent& ev)
{
(void)ev; // unused params
int lsel = lb->GetSelection();
if (lsel == wxNOT_FOUND)
@ -2039,7 +2080,7 @@ public:
// if it's a system accel, disable by assigning to NOOP
wxAcceleratorEntry_v& sys_accels = wxGetApp().frame->sys_accels;
for (int i = 0; i < sys_accels.size(); i++)
for (size_t i = 0; i < sys_accels.size(); i++)
if (sys_accels[i].GetFlags() == selmod && sys_accels[i].GetKeyCode() == selkey) {
wxAcceleratorEntry ne(selmod, selkey, XRCID("NOOP"));
user_accels.push_back(ne);
@ -2057,6 +2098,7 @@ public:
// wipe out all user bindings
void ResetAll(wxCommandEvent& ev)
{
(void)ev; // unused params
if (user_accels.empty() || wxMessageBox(_("This will clear all user-defined accelerators. Are you sure?"), _("Confirm"), wxYES_NO) != wxYES)
return;
@ -2072,6 +2114,7 @@ public:
// remove old key binding, add new key binding, and update GUI
void Assign(wxCommandEvent& ev)
{
(void)ev; // unused params
wxTreeItemId csel = tc->GetSelection();
wxString accel = key->GetValue();
@ -2083,7 +2126,7 @@ public:
if (!wxKeyTextCtrl::FromString(accel, acmod, ackey))
return; // this should never happen
for (int i = 0; i < lb->GetCount(); i++)
for (unsigned int i = 0; i < lb->GetCount(); i++)
if (lb->GetString(i) == accel)
return; // ignore attempts to add twice
@ -2112,6 +2155,7 @@ public:
// update curas and maybe enable asb
void CheckKey(wxCommandEvent& ev)
{
(void)ev; // unused params
wxString nkey = key->GetValue();
if (nkey.empty()) {
@ -2132,7 +2176,7 @@ public:
asb->Enable(tc->GetSelection().IsOk());
int cmd = -1;
for (int i = 0; i < accels.size(); i++)
for (size_t i = 0; i < accels.size(); i++)
if (accels[i].GetFlags() == acmod && accels[i].GetKeyCode() == ackey) {
int cmdid = accels[i].GetCommand();
@ -2219,6 +2263,7 @@ public:
// set thrsel from thr
void SetThrottleSel(wxSpinEvent& evt)
{
(void)evt; // unused params
DoSetThrottleSel(thr->GetValue());
}
@ -2233,6 +2278,7 @@ public:
// set thr from thrsel
void SetThrottle(wxCommandEvent& evt)
{
(void)evt; // unused params
uint32_t val = thrsel->GetSelection() * 25;
if (val <= 600)
@ -2272,6 +2318,7 @@ public:
// set speedup_throttle_sel from speedup_throttle
void SetSpeedupThrottleSel(wxSpinEvent& evt)
{
(void)evt; // unused params
DoSetSpeedupThrottleSel(speedup_throttle_spin->GetValue());
}
@ -2290,6 +2337,7 @@ public:
// set speedup_throttle from speedup_throttle_sel
void SetSpeedupThrottle(wxCommandEvent& evt)
{
(void)evt; // unused params
uint32_t val = speedup_throttle_sel->GetSelection() * 25;
if (val > 0 && val <= 600) {
@ -2312,6 +2360,7 @@ public:
// set speedup_frame_skip_sel from speedup_frame_skip
void SpeedupFrameSkipCtrl_t::SetSpeedupFrameSkipSel(wxSpinEvent& evt)
{
(void)evt; // unused params
DoSetSpeedupFrameSkipSel(speedup_frame_skip_spin->GetValue());
}
@ -2330,6 +2379,7 @@ void SpeedupFrameSkipCtrl_t::DoSetSpeedupFrameSkipSel(uint32_t val)
// set speedup_frame_skip from speedup_frame_skip_sel
void SpeedupFrameSkipCtrl_t::SetSpeedupFrameSkip(wxCommandEvent& evt)
{
(void)evt; // unused params
uint32_t val = speedup_frame_skip_sel->GetSelection();
if (val > 0 && val <= 30) {
@ -2357,7 +2407,7 @@ void CheckThrowXRCError(T pointer, const wxString& name)
std::string errormessage = "Unable to load a \"";
errormessage += typeid(pointer).name();
errormessage += "\" from the builtin xrc file: ";
errormessage += name.mb_str();
errormessage += name.utf8_str();
throw std::runtime_error(errormessage);
}
}
@ -2451,7 +2501,7 @@ wxAcceleratorEntry_v MainFrame::get_accels(wxAcceleratorEntry_v user_accels)
// then user overrides
// silently keep only last defined binding
// same horribly inefficent O(n*m) search for duplicates as above..
for (int i = 0; i < user_accels.size(); i++) {
for (size_t i = 0; i < user_accels.size(); i++) {
const wxAcceleratorEntry& ae = user_accels[i];
for (wxAcceleratorEntry_v::iterator e = accels.begin(); e < accels.end(); ++e)
@ -2477,7 +2527,7 @@ void MainFrame::set_global_accels()
// the menus will be added now
// first, zero out menu item on all accels
for (int i = 0; i < accels.size(); i++)
for (size_t i = 0; i < accels.size(); i++)
accels[i].Set(accels[i].GetFlags(), accels[i].GetKeyCode(),
accels[i].GetCommand());
@ -2495,7 +2545,7 @@ void MainFrame::set_global_accels()
int cmd = cmdtab[i].cmd_id;
int last_accel = -1;
for (int j = 0; j < accels.size(); j++)
for (size_t j = 0; j < accels.size(); j++)
if (cmd == accels[j].GetCommand())
last_accel = j;
@ -2512,14 +2562,14 @@ void MainFrame::set_global_accels()
// Finally, install a global accelerator table for any non-menu accels
int len = 0;
for (int i = 0; i < accels.size(); i++)
for (size_t i = 0; i < accels.size(); i++)
if (!accels[i].GetMenuItem())
len++;
if (len) {
wxAcceleratorEntry tab[1000];
for (int i = 0, j = 0; i < accels.size(); i++)
for (size_t i = 0, j = 0; i < accels.size(); i++)
if (!accels[i].GetMenuItem())
tab[j++] = accels[i];
@ -2534,7 +2584,7 @@ void MainFrame::set_global_accels()
for (int i = 0; i < 10; i++)
recent_accel[i] = wxAcceleratorEntry();
for (int i = 0; i < accels.size(); i++)
for (size_t i = 0; i < accels.size(); i++)
if (accels[i].GetCommand() >= wxID_FILE1 && accels[i].GetCommand() <= wxID_FILE10)
recent_accel[accels[i].GetCommand() - wxID_FILE1] = accels[i];
@ -2545,7 +2595,7 @@ void MainFrame::MenuOptionBool(const char* menuName, bool& field)
{
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -2560,7 +2610,7 @@ void MainFrame::MenuOptionIntMask(const char* menuName, int& field, int mask)
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
int value = mask;
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -2576,7 +2626,7 @@ void MainFrame::MenuOptionIntRadioValue(const char* menuName, int& field, int va
{
int id = wxXmlResource::GetXRCID(wxString(menuName, wxConvUTF8));
for (int i = 0; i < checkable_mi.size(); i++) {
for (size_t i = 0; i < checkable_mi.size(); i++) {
if (checkable_mi[i].cmd != id)
continue;
@ -2760,9 +2810,9 @@ bool MainFrame::BindControls()
if (a->GetFlags() == e->GetFlags() && a->GetKeyCode() == e->GetKeyCode()) {
if (e->GetMenuItem()) {
wxLogInfo(_("Duplicate menu accelerator: %s for %s and %s; keeping first"),
wxKeyTextCtrl::ToString(a->GetFlags(), a->GetKeyCode()).mb_str(),
e->GetMenuItem()->GetItemLabelText().mb_str(),
mi->GetItemLabelText().mb_str());
wxKeyTextCtrl::ToString(a->GetFlags(), a->GetKeyCode()).c_str(),
e->GetMenuItem()->GetItemLabelText().c_str(),
mi->GetItemLabelText().c_str());
delete a;
a = 0;
} else {
@ -2774,9 +2824,9 @@ bool MainFrame::BindControls()
break;
wxLogInfo(_("Menu accelerator %s for %s overrides default for %s ; keeping menu"),
wxKeyTextCtrl::ToString(a->GetFlags(), a->GetKeyCode()).mb_str(),
mi->GetItemLabelText().mb_str(),
cmdtab[cmd].cmd);
wxKeyTextCtrl::ToString(a->GetFlags(), a->GetKeyCode()).c_str(),
mi->GetItemLabelText().c_str(),
cmdtab[cmd].cmd.c_str());
}
sys_accels.erase(e);
@ -2794,7 +2844,7 @@ bool MainFrame::BindControls()
// store checkable items
if (mi->IsCheckable()) {
checkable_mi_t cmi = { cmdtab[i].cmd_id, mi };
checkable_mi_t cmi = { cmdtab[i].cmd_id, mi, NULL, NULL, 0, 0 };
checkable_mi.push_back(cmi);
for (int j = 0; j < num_opts; j++) {
@ -2877,10 +2927,10 @@ bool MainFrame::BindControls()
MenuOptionIntRadioValue("LinkType4Gameboy", gopts.gba_link_type, 4);
}
for (int i = 0; i < checkable_mi.size(); i++)
for (size_t i = 0; i < checkable_mi.size(); i++)
if (!checkable_mi[i].boolopt && !checkable_mi[i].intopt) {
wxLogError(_("Invalid menu item %s; removing"),
checkable_mi[i].mi->GetItemLabelText().mb_str());
checkable_mi[i].mi->GetItemLabelText().c_str());
checkable_mi[i].mi->GetMenu()->Remove(checkable_mi[i].mi);
checkable_mi[i].mi = NULL;
}
@ -3314,6 +3364,7 @@ bool MainFrame::BindControls()
}
#define getcbbe(n, o) getbe(n, o, cb, wxCheckBox, CB)
wxBoolIntEnValidator* bienval;
(void)bienval; // not used yet
#define getbie(n, o, v, cv, t, wt) \
do { \
cv = SafeXRCCTRL<t>(d, n); \
@ -3656,7 +3707,7 @@ bool MainFrame::BindControls()
if (menubar) {
wxTreeItemId mid = tc->AppendItem(rid, _("Menu commands"));
for (int i = 0; i < menubar->GetMenuCount(); i++) {
for (size_t i = 0; i < menubar->GetMenuCount(); i++) {
#if wxCHECK_VERSION(2, 8, 8)
wxTreeItemId id = tc->AppendItem(mid, menubar->GetMenuLabelText(i));
#else
@ -3784,7 +3835,7 @@ bool MainFrame::BindControls()
bool isv = !gopts.link_host.empty();
if (isv) {
isv = SetLinkServerHost(gopts.link_host.mb_str());
isv = SetLinkServerHost(gopts.link_host.c_str());
}
if (!isv) {

View File

@ -27,7 +27,8 @@
#ifdef winlog
#undef winlog
#endif
#define winlog //
// https://stackoverflow.com/a/1306690/262458
#define winlog(x,...) do {} while(0)
#define debugState() //
#endif
@ -133,6 +134,7 @@ void OpenAL::debugState()
break;
}
alGetSourcei(source, AL_BUFFERS_QUEUED, &value);
ASSERT_SUCCESS;
winlog(" Buffers in queue: %i\n", value);
@ -148,7 +150,7 @@ bool OpenAL::init(long sampleRate)
assert(initialized == false);
if (!gopts.audio_dev.empty()) {
device = alcOpenDevice(gopts.audio_dev.mb_str());
device = alcOpenDevice(gopts.audio_dev.utf8_str());
} else {
device = alcOpenDevice(NULL);
}
@ -252,6 +254,7 @@ void OpenAL::reset()
void OpenAL::write(uint16_t* finalWave, int length)
{
(void)length; // unused param
if (!initialized)
return;

View File

@ -13,31 +13,30 @@
-p/--profile=hz
*/
#define WJKB newWxJoyKeyBinding
/* not sure how well other compilers support field-init syntax */
#define STROPT(c, n, d, v) \
{ \
wxT(c), (n), d, &v \
}
#define INTOPT(c, n, d, v, min, max) \
{ \
wxT(c), (n), d, NULL, &v, wxT(""), min, max \
}
#define DOUBLEOPT(c, n, d, v, min, max) \
{ \
wxT(c), (n), d, NULL, NULL, wxT(""), min, max, NULL, &v \
}
#define UINTOPT(c, n, d, v, min, max) \
{ \
wxT(c), (n), d, NULL, NULL, wxT(""), min, max, NULL, NULL, &v \
}
#define BOOLOPT(c, n, d, v) \
{ \
wxT(c), (n), d, NULL, NULL, wxT(""), 0, 0, &v \
}
#define ENUMOPT(c, n, d, v, e) \
{ \
wxT(c), (n), d, NULL, &v, e \
}
new_opt_desc(wxT(c), (n), d, &v)
#define INTOPT(c, n, d, v, min, max) \
new_opt_desc(wxT(c), (n), d, NULL, &v, wxT(""), min, max)
#define DOUBLEOPT(c, n, d, v, min, max) \
new_opt_desc(wxT(c), (n), d, NULL, NULL, wxT(""), min, max, NULL, &v)
#define UINTOPT(c, n, d, v, min, max) \
new_opt_desc(wxT(c), (n), d, NULL, NULL, wxT(""), min, max, NULL, NULL, &v)
#define BOOLOPT(c, n, d, v) \
new_opt_desc(wxT(c), (n), d, NULL, NULL, wxT(""), 0, 0, &v)
#define ENUMOPT(c, n, d, v, e) \
new_opt_desc(wxT(c), (n), d, NULL, &v, e)
#define NOOPT(c, n, d) \
new_opt_desc(c, (n), d)
opts_t gopts;
@ -137,21 +136,34 @@ const wxString joynames[NUM_KEYS] = {
};
wxJoyKeyBinding defkeys[NUM_KEYS * 2] = {
{ WXK_UP }, { 1, WXJB_AXIS_MINUS, 1 }, { WXK_DOWN }, { 1, WXJB_AXIS_PLUS, 1 },
{ WXK_LEFT }, { 0, WXJB_AXIS_MINUS, 1 }, { WXK_RIGHT }, { 0, WXJB_AXIS_PLUS, 1 },
{ wxT('X') }, { 0, WXJB_BUTTON, 1 }, { wxT('Z') }, { 1, WXJB_BUTTON, 1 },
{ wxT('A') }, { 2, WXJB_BUTTON, 1 }, { wxT('S') }, { 3, WXJB_BUTTON, 1 },
{ WXK_BACK }, { 4, WXJB_BUTTON, 1 }, { WXK_RETURN }, { 5, WXJB_BUTTON, 1 },
{ WXK_NUMPAD_UP }, { 0 }, { WXK_NUMPAD_DOWN }, { 0 },
{ WXK_NUMPAD_LEFT }, { 0 }, { WXK_NUMPAD_RIGHT }, { 0 },
{ WXK_NUMPAD_PAGEUP }, { 0 }, { WXK_NUMPAD_PAGEDOWN }, { 0 },
{ wxT('W') }, { 0 }, { wxT('Q') }, { 0 },
{ WXK_SPACE }, { 0 }, { 0 }, { 0 },
{ 0 }, { 0 }
WJKB(WXK_UP), WJKB(1, WXJB_AXIS_MINUS, 1), WJKB(WXK_DOWN), WJKB(1, WXJB_AXIS_PLUS, 1),
WJKB(WXK_LEFT), WJKB(0, WXJB_AXIS_MINUS, 1), WJKB(WXK_RIGHT), WJKB(0, WXJB_AXIS_PLUS, 1),
WJKB(wxT('X')), WJKB(0, WXJB_BUTTON, 1), WJKB(wxT('Z')), WJKB(1, WXJB_BUTTON, 1),
WJKB(wxT('A')), WJKB(2, WXJB_BUTTON, 1), WJKB(wxT('S')), WJKB(3, WXJB_BUTTON, 1),
WJKB(WXK_BACK), WJKB(4, WXJB_BUTTON, 1), WJKB(WXK_RETURN), WJKB(5, WXJB_BUTTON, 1),
WJKB(WXK_NUMPAD_UP), WJKB(0), WJKB(WXK_NUMPAD_DOWN), WJKB(0),
WJKB(WXK_NUMPAD_LEFT), WJKB(0), WJKB(WXK_NUMPAD_RIGHT), WJKB(0),
WJKB(WXK_NUMPAD_PAGEUP), WJKB(0), WJKB(WXK_NUMPAD_PAGEDOWN), WJKB(0),
WJKB(wxT('W')), WJKB(0), WJKB(wxT('Q')), WJKB(0),
WJKB(WXK_SPACE), WJKB(0), WJKB(0), WJKB(0),
WJKB(0), WJKB(0)
};
wxAcceleratorEntry_v sys_accels;
// Initializer for struct opt_desc
opt_desc new_opt_desc(wxString opt, const char* cmd, wxString desc,
wxString* stropt, int* intopt, wxString enumvals,
double min, double max, bool* boolopt,
double* doubleopt, uint32_t* uintopt, wxString curstr,
int curint, double curdouble, uint32_t curuint)
{
struct opt_desc new_opt = {opt, cmd, desc, stropt, intopt, enumvals,
min, max, boolopt, doubleopt, uintopt,
curstr, curint, curdouble, curuint};
return new_opt;
}
// Note: this table must be sorted in option name order
// Both for better user display and for (fast) searching by name
opt_desc opts[] = {
@ -178,9 +190,9 @@ opt_desc opts[] = {
/// GB
STROPT("GB/BiosFile", "", wxTRANSLATE("BIOS file to use for GB, if enabled"), gopts.gb_bios),
STROPT("GB/GBCBiosFile", "", wxTRANSLATE("BIOS file to use for GBC, if enabled"), gopts.gbc_bios),
{ wxT("GB/Palette0"), "", wxTRANSLATE("The default palette, as 8 comma-separated 4-digit hex integers (rgb555).") },
{ wxT("GB/Palette1"), "", wxTRANSLATE("The first user palette, as 8 comma-separated 4-digit hex integers (rgb555).") },
{ wxT("GB/Palette2"), "", wxTRANSLATE("The second user palette, as 8 comma-separated 4-digit hex integers (rgb555).") },
NOOPT(wxT("GB/Palette0"), "", wxTRANSLATE("The default palette, as 8 comma-separated 4-digit hex integers (rgb555).")),
NOOPT(wxT("GB/Palette1"), "", wxTRANSLATE("The first user palette, as 8 comma-separated 4-digit hex integers (rgb555).")),
NOOPT(wxT("GB/Palette2"), "", wxTRANSLATE("The second user palette, as 8 comma-separated 4-digit hex integers (rgb555).")),
BOOLOPT("GB/PrintAutoPage", "PrintGather", wxTRANSLATE("Automatically gather a full page before printing"), gopts.print_auto_page),
BOOLOPT("GB/PrintScreenCap", "PrintSnap", wxTRANSLATE("Automatically save printouts as screen captures with -print suffix"), gopts.print_screen_cap),
STROPT("GB/ROMDir", "", wxTRANSLATE("Directory to look for ROM files"), gopts.gb_rom_dir),
@ -210,14 +222,14 @@ opt_desc opts[] = {
INTOPT("General/StatusBar", "StatusBar", wxTRANSLATE("Enable status bar"), gopts.statusbar, 0, 1),
/// Joypad
{ wxT("Joypad/*/*"), "", wxTRANSLATE("The parameter Joypad/<n>/<button> contains a comma-separated list of key names which map to joypad #<n> button <button>. Button is one of Up, Down, Left, Right, A, B, L, R, Select, Start, MotionUp, MotionDown, MotionLeft, MotionRight, AutoA, AutoB, Speed, Capture, GS") },
NOOPT(wxT("Joypad/*/*"), "", wxTRANSLATE("The parameter Joypad/<n>/<button> contains a comma-separated list of key names which map to joypad #<n> button <button>. Button is one of Up, Down, Left, Right, A, B, L, R, Select, Start, MotionUp, MotionDown, MotionLeft, MotionRight, AutoA, AutoB, Speed, Capture, GS")),
INTOPT("Joypad/AutofireThrottle", "", wxTRANSLATE("The autofire toggle period, in frames (1/60 s)"), gopts.autofire_rate, 1, 1000),
/// Keyboard
INTOPT("Joypad/Default", "", wxTRANSLATE("The number of the stick to use in single-player mode"), gopts.default_stick, 1, 4),
/// Keyboard
{ wxT("Keyboard/*"), "", wxTRANSLATE("The parameter Keyboard/<cmd> contains a comma-separated list of key names (e.g. Alt-Shift-F1). When the named key is pressed, the command <cmd> is executed.") },
NOOPT(wxT("Keyboard/*"), "", wxTRANSLATE("The parameter Keyboard/<cmd> contains a comma-separated list of key names (e.g. Alt-Shift-F1). When the named key is pressed, the command <cmd> is executed.")),
// Core
INTOPT("preferences/agbPrint", "AGBPrinter", wxTRANSLATE("Enable AGB debug print"), agbPrint, 0, 1),
@ -239,7 +251,6 @@ opt_desc opts[] = {
INTOPT("preferences/fsFrequency", "", wxTRANSLATE("Fullscreen mode frequency (0 = any)"), fsFrequency, 0, 999),
INTOPT("preferences/fsHeight", "", wxTRANSLATE("Fullscreen mode height (0 = desktop)"), fsHeight, 0, 99999),
INTOPT("preferences/fsWidth", "", wxTRANSLATE("Fullscreen mode width (0 = desktop)"), fsWidth, 0, 99999),
INTOPT("preferences/fullScreen", "Fullscreen", wxTRANSLATE("Enter fullscreen mode at startup"), fullScreen, 0, 1),
INTOPT("preferences/gbPaletteOption", "", wxTRANSLATE("The palette to use"), gbPaletteOption, 0, 2),
INTOPT("preferences/gbPrinter", "Printer", wxTRANSLATE("Enable printer emulation"), winGbPrinterEnabled, 0, 1),
INTOPT("preferences/gdbBreakOnLoad", "DebugGDBBreakOnLoad", wxTRANSLATE("Break into GDB after loading the game."), gdbBreakOnLoad, 0, 1),
@ -264,8 +275,14 @@ opt_desc opts[] = {
INTOPT("preferences/useBiosGBC", "BootRomGBC", wxTRANSLATE("Use the specified BIOS file for GBC"), useBiosFileGBC, 0, 1),
INTOPT("preferences/vsync", "VSync", wxTRANSLATE("Wait for vertical sync"), vsync, 0, 1),
/// Sound
/// Geometry
INTOPT("geometry/fullScreen", "Fullscreen", wxTRANSLATE("Enter fullscreen mode at startup"), fullScreen, 0, 1),
UINTOPT("geometry/windowHeight", "Height", wxTRANSLATE("Window height at startup"), windowHeight, 0, 99999),
UINTOPT("geometry/windowWidth", "Width", wxTRANSLATE("Window width at startup"), windowWidth, 0, 99999),
INTOPT("geometry/windowX", "X", wxTRANSLATE("Window axis X position at startup"), windowPositionX, -1, 99999),
INTOPT("geometry/windowY", "Y", wxTRANSLATE("Window axis Y position at startup"), windowPositionY, -1, 99999),
/// Sound
ENUMOPT("Sound/AudioAPI", "", wxTRANSLATE("Sound API; if unsupported, default API will be used"), gopts.audio_api, wxTRANSLATE("sdl|openal|directsound|xaudio2|faudio")),
STROPT("Sound/AudioDevice", "", wxTRANSLATE("Device ID of chosen audio device for chosen driver"), gopts.audio_dev),
INTOPT("Sound/Buffers", "", wxTRANSLATE("Number of sound buffers"), gopts.audio_buffers, 2, 10),
@ -339,7 +356,6 @@ bool opt_lt(const opt_desc& opt1, const opt_desc& opt2)
}
// FIXME: simulate MakeInstanceFilename(vbam.ini) using subkeys (Slave%d/*)
void load_opts()
{
// just for sanity...
@ -369,7 +385,7 @@ void load_opts()
for (cont = cfg->GetFirstEntry(s, grp_idx); cont;
cont = cfg->GetNextEntry(s, grp_idx)) {
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.c_str());
item_del.push_back(s);
}
@ -407,7 +423,7 @@ void load_opts()
for (cont = cfg->GetFirstGroup(e, key_idx); cont;
cont = cfg->GetNextGroup(e, key_idx)) {
s.append(e);
//wxLogWarning(_("Invalid option group %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option group %s present; removing if possible"), s.c_str());
grp_del.push_back(s);
s.resize(poff2);
}
@ -422,7 +438,7 @@ void load_opts()
if (i == NUM_KEYS) {
s.append(e);
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.c_str());
item_del.push_back(s);
s.resize(poff2);
}
@ -434,7 +450,7 @@ void load_opts()
} else {
s.append(wxT('/'));
s.append(e);
//wxLogWarning(_("Invalid option group %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option group %s present; removing if possible"), s.c_str());
grp_del.push_back(s);
s.resize(poff);
}
@ -444,23 +460,23 @@ void load_opts()
cont = cfg->GetNextEntry(e, entry_idx)) {
// kb options come from a different list
if (s == wxT("Keyboard")) {
const cmditem dummy = { e };
const cmditem dummy = new_cmditem(e);
if (!std::binary_search(&cmdtab[0], &cmdtab[ncmds], dummy, cmditem_lt)) {
s.append(wxT('/'));
s.append(e);
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.c_str());
item_del.push_back(s);
s.resize(poff);
}
} else {
s.append(wxT('/'));
s.append(e);
const opt_desc dummy = { s };
opt_desc dummy = new_opt_desc(s);
wxString opt_name(dummy.opt);
if (!std::binary_search(&opts[0], &opts[num_opts], dummy, opt_lt) && opt_name != wxT("General/LastUpdated") && opt_name != wxT("General/LastUpdatedFileName")) {
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.mb_str());
//wxLogWarning(_("Invalid option %s present; removing if possible"), s.c_str());
item_del.push_back(s);
}
@ -471,10 +487,10 @@ void load_opts()
cfg->SetPath(wxT("/"));
}
for (int i = 0; i < item_del.size(); i++)
for (size_t i = 0; i < item_del.size(); i++)
cfg->DeleteEntry(item_del[i]);
for (int i = 0; i < grp_del.size(); i++)
for (size_t i = 0; i < grp_del.size(); i++)
cfg->DeleteGroup(grp_del[i]);
// now read actual values and set to default if unset
@ -495,7 +511,7 @@ void load_opts()
if (gotit && !s.empty()) {
const auto found_pos = vec_find(enum_opts, s);
const bool matched = found_pos != wxNOT_FOUND;
const bool matched = ((int)found_pos != wxNOT_FOUND);
if (!matched) {
opt.curint = 0;
@ -505,9 +521,9 @@ void load_opts()
// technically, the translation for this string could incorproate
// the equals sign if necessary instead of doing it this way
wxLogWarning(_("Invalid value %s for option %s; valid values are %s%s%s"),
s, opt.opt, ev,
isx ? wxT(" = ") : wxT(""),
isx ? evx : wxT(""));
s.c_str(), opt.opt.c_str(), ev.c_str(),
isx ? wxT(" = ") : wxEmptyString,
isx ? evx.c_str() : wxEmptyString);
// write first option
cfg->Write(opt.opt, enum_opts[0]);
} else
@ -521,14 +537,14 @@ void load_opts()
cfg->Read(opt.opt, &opt.curint, *opt.intopt);
if (opt.curint < opt.min || opt.curint > opt.max) {
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), opt.curint, opt.opt, opt.min, opt.max);
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), opt.curint, opt.opt.c_str(), opt.min, opt.max);
} else
*opt.intopt = opt.curint;
} else if (opt.doubleopt) {
cfg->Read(opt.opt, &opt.curdouble, *opt.doubleopt);
if (opt.curdouble < opt.min || opt.curdouble > opt.max) {
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), opt.curdouble, opt.opt, opt.min, opt.max);
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), opt.curdouble, opt.opt.c_str(), opt.min, opt.max);
} else
*opt.doubleopt = opt.curdouble;
} else if (opt.uintopt) {
@ -537,7 +553,7 @@ void load_opts()
opt.curuint = val;
if (opt.curuint < opt.min || opt.curuint > opt.max) {
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), opt.curuint, opt.opt, opt.min, opt.max);
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), opt.curuint, opt.opt.c_str(), opt.min, opt.max);
} else
*opt.uintopt = opt.curuint;
} else if (opt.boolopt) {
@ -551,7 +567,7 @@ void load_opts()
wxString optn;
optn.Printf(wxT("GB/Palette%d"), i);
wxString val;
const opt_desc dummy = { optn };
const opt_desc dummy = new_opt_desc(optn);
opt_desc* opt = std::lower_bound(&opts[0], &opts[num_opts], dummy, opt_lt);
wxString entry;
@ -569,7 +585,7 @@ void load_opts()
int start = cpos;
cpos = val.find(wxT(','), cpos);
if (cpos == wxString::npos)
if ((size_t)cpos == wxString::npos)
cpos = val.size();
long ival;
@ -580,7 +596,7 @@ void load_opts()
entry.ToLong(&ival, 16);
systemGbPalette[i * 8 + j] = ival;
if (cpos != val.size())
if ((size_t)cpos != val.size())
cpos++;
}
}
@ -589,14 +605,14 @@ void load_opts()
for (int i = 0; i < 4; i++) {
for (int j = 0; j < NUM_KEYS; j++) {
wxString optname;
optname.Printf(wxT("Joypad/%d/%s"), i + 1, joynames[j]);
optname.Printf(wxT("Joypad/%d/%s"), i + 1, joynames[j].c_str());
bool gotit = cfg->Read(optname, &s);
if (gotit) {
gopts.joykey_bindings[i][j] = wxJoyKeyTextCtrl::FromString(s);
if (s.size() && !gopts.joykey_bindings[i][j].size())
wxLogWarning(_("Invalid key binding %s for %s"), s.mb_str(), optname.mb_str());
wxLogWarning(_("Invalid key binding %s for %s"), s.c_str(), optname.c_str());
} else {
s = wxJoyKeyTextCtrl::ToString(gopts.joykey_bindings[i][j]);
cfg->Write(optname, s);
@ -617,9 +633,9 @@ void load_opts()
wxAcceleratorEntry_v val = wxKeyTextCtrl::FromString(s);
if (!val.size())
wxLogWarning(_("Invalid key binding %s for %s"), s.mb_str(), kbopt.mb_str());
wxLogWarning(_("Invalid key binding %s for %s"), s.c_str(), kbopt.c_str());
else {
for (int j = 0; j < val.size(); j++)
for (size_t j = 0; j < val.size(); j++)
val[j].Set(val[j].GetFlags(), val[j].GetKeyCode(),
cmdtab[i].cmd_id);
@ -665,7 +681,7 @@ void update_opts()
cfg->Write(opt.opt, (opt.curdouble = *opt.doubleopt));
} else if (opt.uintopt) {
if (*opt.uintopt != opt.curuint)
cfg->Write(opt.opt, (opt.curuint = *opt.uintopt));
cfg->Write(opt.opt, (long)(opt.curuint = *opt.uintopt));
} else if (opt.boolopt) {
if (*opt.boolopt != opt.curbool)
cfg->Write(opt.opt, (opt.curbool = *opt.boolopt));
@ -677,7 +693,7 @@ void update_opts()
for (int i = 0; i < 3; i++) {
wxString optn;
optn.Printf(wxT("GB/Palette%d"), i);
const opt_desc dummy = { optn };
const opt_desc dummy = new_opt_desc(optn);
opt_desc* opt = std::lower_bound(&opts[0], &opts[num_opts], dummy, opt_lt);
wxString val;
wxString entry;
@ -703,7 +719,7 @@ void update_opts()
for (int j = 0; j < NUM_KEYS; j++) {
wxString s, o;
wxString optname;
optname.Printf(wxT("Joypad/%d/%s"), i + 1, joynames[j]);
optname.Printf(wxT("Joypad/%d/%s"), i + 1, joynames[j].c_str());
s = wxJoyKeyTextCtrl::ToString(gopts.joykey_bindings[i][j]);
cfg->Read(optname, &o);
@ -721,9 +737,9 @@ void update_opts()
for (bool cont = cfg->GetFirstEntry(s, entry_idx); cont;
cont = cfg->GetNextEntry(s, entry_idx)) {
const cmditem dummy = { s };
const cmditem dummy = new_cmditem(s);
cmditem* cmd = std::lower_bound(&cmdtab[0], &cmdtab[ncmds], dummy, cmditem_lt);
int i;
size_t i;
for (i = 0; i < gopts.accels.size(); i++)
if (gopts.accels[i].GetCommand() == cmd->cmd_id)
@ -733,7 +749,7 @@ void update_opts()
item_del.push_back(s);
}
for (int i = 0; i < item_del.size(); i++)
for (size_t i = 0; i < item_del.size(); i++)
cfg->DeleteEntry(item_del[i]);
}
@ -772,7 +788,7 @@ void update_opts()
bool opt_set(const wxString& name, const wxString& val)
{
const opt_desc dummy = { name };
const opt_desc dummy = new_opt_desc(name);
const opt_desc* opt = std::lower_bound(&opts[0], &opts[num_opts], dummy, opt_lt);
if (!wxStrcmp(name, opt->opt)) {
@ -781,7 +797,7 @@ bool opt_set(const wxString& name, const wxString& val)
else if (opt->boolopt) {
if (!(val == wxT('0') || val == wxT('1')))
wxLogWarning(_("Invalid flag option %s - %s ignored"),
name, val);
name.c_str(), val.c_str());
else
*opt->boolopt = val == wxT('1');
} else if (!opt->enumvals.empty()) {
@ -790,7 +806,7 @@ bool opt_set(const wxString& name, const wxString& val)
auto enum_opts = str_split(ev, wxT("|"));
const std::size_t found_pos = vec_find(enum_opts, s);
const bool matched = found_pos != wxNOT_FOUND;
const bool matched = ((int)found_pos != wxNOT_FOUND);
if (!matched) {
const wxString evx = wxGetTranslation(opt->enumvals);
@ -798,9 +814,9 @@ bool opt_set(const wxString& name, const wxString& val)
// technically, the translation for this string could incorproate
// the equals sign if necessary instead of doing it this way
wxLogWarning(_("Invalid value %s for option %s; valid values are %s%s%s"),
s, opt->opt, opt->enumvals,
isx ? wxT(" = ") : wxT(""),
isx ? evx : wxT(""));
s.c_str(), opt->opt.c_str(), opt->enumvals.c_str(),
isx ? wxT(" = ") : wxEmptyString,
isx ? evx.c_str() : wxEmptyString);
} else {
*opt->intopt = found_pos;
}
@ -809,7 +825,7 @@ bool opt_set(const wxString& name, const wxString& val)
long ival;
if (!s.ToLong(&ival) || ival < opt->min || ival > opt->max)
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), ival, name, opt->min, opt->max);
wxLogWarning(_("Invalid value %d for option %s; valid values are %d - %d"), ival, name.c_str(), opt->min, opt->max);
else
*opt->intopt = ival;
} else if (opt->doubleopt) {
@ -817,7 +833,7 @@ bool opt_set(const wxString& name, const wxString& val)
double dval;
if (!s.ToDouble(&dval) || dval < opt->min || dval > opt->max)
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), dval, name, opt->min, opt->max);
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), dval, name.c_str(), opt->min, opt->max);
else
*opt->doubleopt = dval;
} else if (opt->uintopt) {
@ -825,7 +841,7 @@ bool opt_set(const wxString& name, const wxString& val)
unsigned long uival;
if (!s.ToULong(&uival) || uival < opt->min || uival > opt->max)
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), uival, name, opt->min, opt->max);
wxLogWarning(_("Invalid value %f for option %s; valid values are %f - %f"), uival, name.c_str(), opt->min, opt->max);
else
*opt->uintopt = (uint32_t)uival;
} else {
@ -839,7 +855,7 @@ bool opt_set(const wxString& name, const wxString& val)
wxString vals(val);
for (int j = 0, cpos = 0; j < 8; j++) {
for (size_t j = 0, cpos = 0; j < 8; j++) {
int start = cpos;
cpos = vals.find(wxT(','), cpos);
@ -868,7 +884,7 @@ bool opt_set(const wxString& name, const wxString& val)
auto parts = str_split(name, wxT("/"));
if (parts[0] != wxT("Keyboard")) {
cmditem* cmd = std::lower_bound(&cmdtab[0], &cmdtab[ncmds], cmditem{parts[1]}, cmditem_lt);
cmditem* cmd = std::lower_bound(&cmdtab[0], &cmdtab[ncmds], cmditem{parts[1],wxString(),0,0,NULL}, cmditem_lt);
if (cmd == &cmdtab[ncmds] || wxStrcmp(parts[1], cmd->cmd))
return false;
@ -889,12 +905,12 @@ bool opt_set(const wxString& name, const wxString& val)
if (!val.empty()) {
auto aval = wxKeyTextCtrl::FromString(val);
for (int i = 0; i < aval.size(); i++)
for (size_t i = 0; i < aval.size(); i++)
aval[i].Set(aval[i].GetFlags(), aval[i].GetKeyCode(),
cmd->cmd_id);
if (!aval.size())
wxLogWarning(_("Invalid key binding %s for %s"), val, name);
wxLogWarning(_("Invalid key binding %s for %s"), val.c_str(), name.c_str());
else
gopts.accels.insert(gopts.accels.end(), aval.begin(), aval.end());
}
@ -920,7 +936,7 @@ bool opt_set(const wxString& name, const wxString& val)
auto b = wxJoyKeyTextCtrl::FromString(val);
if (!b.size())
wxLogWarning(_("Invalid key binding %s for %s"), val, name);
wxLogWarning(_("Invalid key binding %s for %s"), val.c_str(), name.c_str());
else
gopts.joykey_bindings[jno][kno] = b;
}

View File

@ -101,6 +101,14 @@ extern struct opt_desc {
uint32_t curuint;
#define curbool curint
} opts[];
// Initializer for struct opt_desc
opt_desc new_opt_desc(wxString opt = "", const char* cmd = NULL, wxString desc = "",
wxString* stropt = NULL, int* intopt = NULL, wxString enumvals = "",
double min = 0, double max = 0, bool* boolopt = NULL,
double* doubleopt = NULL, uint32_t* uintopt = NULL, wxString curstr = "",
int curint = 0, double curdouble = 0, uint32_t curuint = 0);
extern const int num_opts;
extern const wxAcceleratorEntry default_accels[];

View File

@ -22,17 +22,17 @@ IMPLEMENT_DYNAMIC_CLASS(GameArea, wxPanel)
GameArea::GameArea()
: wxPanel()
, loaded(IMAGE_UNKNOWN)
, panel(NULL)
, emusys(NULL)
, basic_width(GBAWidth)
, basic_height(GBAHeight)
, fullscreen(false)
, paused(false)
, was_paused(false)
, rewind_time(0)
, do_rewind(false)
, rewind_mem(0)
, loaded(IMAGE_UNKNOWN)
, basic_width(GBAWidth)
, basic_height(GBAHeight)
, fullscreen(false)
, paused(false)
, pointer_blanked(false)
, mouse_active_time(0)
{
@ -83,7 +83,7 @@ void GameArea::LoadGame(const wxString& name)
if (t == IMAGE_UNKNOWN) {
wxString s;
s.Printf(_("%s is not a valid ROM file"), name.mb_str());
s.Printf(_("%s is not a valid ROM file"), name.c_str());
wxMessageDialog dlg(GetParent(), s, _("Problem loading file"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
@ -140,7 +140,7 @@ void GameArea::LoadGame(const wxString& name)
if (t == IMAGE_GB) {
if (!gbLoadRom(fn)) {
wxString s;
s.Printf(_("Unable to load Game Boy ROM %s"), name.mb_str());
s.Printf(_("Unable to load Game Boy ROM %s"), name.c_str());
wxMessageDialog dlg(GetParent(), s, _("Problem loading file"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
@ -155,7 +155,7 @@ void GameArea::LoadGame(const wxString& name)
wxCharBuffer pfnb(pfn.GetFullPath().mb_fn_str());
applyPatch(pfnb.data(), &gbRom, &size);
if (size != rom_size)
if (size != (int)rom_size)
gbUpdateSizes();
rom_size = size;
@ -192,7 +192,7 @@ void GameArea::LoadGame(const wxString& name)
gbCPUInit(fn, use_bios);
if (use_bios && !useBios) {
wxLogError(_("Could not load BIOS %s"), (gbCgbMode ? gopts.gbc_bios : gopts.gb_bios).mb_str());
wxLogError(_("Could not load BIOS %s"), (gbCgbMode ? gopts.gbc_bios : gopts.gb_bios).c_str());
// could clear use flag & file name now, but better to force
// user to do it
}
@ -215,7 +215,7 @@ void GameArea::LoadGame(const wxString& name)
{
if (!(rom_size = CPULoadRom(fn))) {
wxString s;
s.Printf(_("Unable to load Game Boy Advance ROM %s"), name.mb_str());
s.Printf(_("Unable to load Game Boy Advance ROM %s"), name.c_str());
wxMessageDialog dlg(GetParent(), s, _("Problem loading file"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
@ -285,7 +285,7 @@ void GameArea::LoadGame(const wxString& name)
CPUInit(gopts.gba_bios.mb_fn_str(), useBiosFileGBA);
if (useBiosFileGBA && !useBios) {
wxLogError(_("Could not load BIOS %s"), gopts.gba_bios.mb_str());
wxLogError(_("Could not load BIOS %s"), gopts.gba_bios.c_str());
// could clear use flag & file name now, but better to force
// user to do it
}
@ -302,7 +302,8 @@ void GameArea::LoadGame(const wxString& name)
loaded = t;
SetFrameTitle();
SetFocus();
AdjustSize(true);
// Use custom geometry
AdjustSize(false);
emulating = true;
was_paused = true;
MainFrame* mf = wxGetApp().frame;
@ -354,7 +355,7 @@ void GameArea::LoadGame(const wxString& name)
if (emusys->emuReadBattery(fnb.data())) {
wxString msg;
msg.Printf(_("Loaded battery %s"), bat.GetFullPath().mb_str());
msg.Printf(_("Loaded battery %s"), bat.GetFullPath().c_str());
systemScreenMessage(msg);
if (cpuSaveType == 0 && ovSaveType == 0 && t == IMAGE_GBA) {
@ -371,6 +372,7 @@ void GameArea::LoadGame(const wxString& name)
case 0x10000:
if (saveType == GBA_SAVE_EEPROM || saveType == GBA_SAVE_SRAM)
break;
break;
case 0x20000:
saveType = GBA_SAVE_FLASH;
@ -461,6 +463,10 @@ void GameArea::recompute_dirs()
batdir = wxGetApp().GetAbsolutePath(gopts.battery_dir);
}
if (!wxIsWritable(batdir)) {
batdir = wxGetApp().GetDataDir();
}
statedir = gopts.state_dir;
if (!statedir.size()) {
@ -469,11 +475,9 @@ void GameArea::recompute_dirs()
statedir = wxGetApp().GetAbsolutePath(gopts.state_dir);
}
if (!wxIsWritable(batdir))
batdir = wxGetApp().GetConfigurationPath();
if (!wxIsWritable(statedir))
statedir = wxGetApp().GetConfigurationPath();
if (!wxIsWritable(statedir)) {
statedir = wxGetApp().GetDataDir();
}
}
void GameArea::UnloadGame(bool destruct)
@ -570,7 +574,7 @@ bool GameArea::LoadState()
bool GameArea::LoadState(int slot)
{
wxString fname;
fname.Printf(SAVESLOT_FMT, game_name().mb_str(), slot);
fname.Printf(SAVESLOT_FMT, game_name().c_str(), slot);
return LoadState(wxFileName(statedir, fname));
}
@ -604,7 +608,7 @@ bool GameArea::LoadState(const wxFileName& fname)
wxString msg;
msg.Printf(ret ? _("Loaded state %s") : _("Error loading state %s"),
fname.GetFullPath().mb_str());
fname.GetFullPath().c_str());
systemScreenMessage(msg);
return ret;
}
@ -617,7 +621,7 @@ bool GameArea::SaveState()
bool GameArea::SaveState(int slot)
{
wxString fname;
fname.Printf(SAVESLOT_FMT, game_name().mb_str(), slot);
fname.Printf(SAVESLOT_FMT, game_name().c_str(), slot);
return SaveState(wxFileName(statedir, fname));
}
@ -628,7 +632,7 @@ bool GameArea::SaveState(const wxFileName& fname)
wxGetApp().frame->update_state_ts(true);
wxString msg;
msg.Printf(ret ? _("Saved state %s") : _("Error saving state %s"),
fname.GetFullPath().mb_str());
fname.GetFullPath().c_str());
systemScreenMessage(msg);
return ret;
}
@ -658,7 +662,7 @@ void GameArea::SaveBattery()
// of course some games just write battery way too often for such
// a thing to be useful
if (!emusys->emuWriteBattery(fnb.data()))
wxLogError(_("Error writing battery %s"), fn);
wxLogError(_("Error writing battery %s"), fn.c_str());
systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
}
@ -840,7 +844,7 @@ void GameArea::ShowFullScreen(bool full)
// in particular, unix does Matches() in wrong direction
wxArrayVideoModes vm = d.GetModes();
int best_mode = -1;
int i;
size_t i;
for (i = 0; i < vm.size(); i++) {
if (vm[i].w != gopts.fs_mode.w || vm[i].h != gopts.fs_mode.h)
@ -997,7 +1001,7 @@ void GameArea::OnIdle(wxIdleEvent& event)
panel = new GLDrawingPanel(this, basic_width, basic_height);
break;
#endif
#ifdef __WXMSW__
#if defined(__WXMSW__) && !defined(NO_D3D)
case RND_DIRECT3D:
panel = new DXDrawingPanel(this, basic_width, basic_height);
break;
@ -1016,7 +1020,6 @@ void GameArea::OnIdle(wxIdleEvent& event)
// set userdata so we know it's the panel and not the frame being resized
// the userdata is freed on disconnect/destruction
w->Connect(wxEVT_SIZE, wxSizeEventHandler(GameArea::OnSize), new wxObject, this);
this->Connect(wxEVT_SIZE, wxSizeEventHandler(GameArea::OnSize), NULL, this);
w->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
@ -1030,10 +1033,28 @@ void GameArea::OnIdle(wxIdleEvent& event)
AdjustMinSize();
AdjustSize(false);
unsigned frame_priority = 0;
// add spacers on top and bottom to center panel vertically
// but not on 2.8 which does not handle this correctly
#if wxCHECK_VERSION(2, 9, 0)
GetSizer()->Add(0, 0, 1, wxEXPAND);
GetSizer()->Add(w, 0, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER | wxEXPAND) : wxEXPAND);
#else
frame_priority = 1;
#endif
// On windows with the vcpkg version of wxWidgets which is 3.1.2, the
// wxEXPAND flag throws an XRC error, but it is necessary on earlier versions of wxWidgets
#if defined(__WXMSW__) && wxCHECK_VERSION(3, 1, 2)
GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL) : wxEXPAND);
#else
GetSizer()->Add(w, frame_priority, gopts.retain_aspect ? (wxSHAPED | wxALIGN_CENTER_HORIZONTAL | wxEXPAND) : wxEXPAND);
#endif
#if wxCHECK_VERSION(2, 9, 0)
GetSizer()->Add(0, 0, 1, wxEXPAND);
#endif
Layout();
if (pointer_blanked)
@ -1136,9 +1157,9 @@ static std::vector<game_key>* game_keys_pressed(int key, int mod, int joy)
for (int key_num = 0; key_num < NUM_KEYS; key_num++) {
wxJoyKeyBinding_v& b = gopts.joykey_bindings[player][key_num];
for (int bind_num = 0; bind_num < b.size(); bind_num++)
for (size_t bind_num = 0; bind_num < b.size(); bind_num++)
if (b[bind_num].key == key && b[bind_num].mod == mod && b[bind_num].joy == joy)
vec->push_back({player, key_num, bind_num, b});
vec->push_back({player, key_num, (int)bind_num, b});
}
return vec;
@ -1166,7 +1187,7 @@ static bool process_key_press(bool down, int key, int mod, int joy = 0)
}
// check if key is already pressed
int kpno;
size_t kpno;
for (kpno = 0; kpno < keys_pressed.size(); kpno++)
if (keys_pressed[kpno].key == key && keys_pressed[kpno].mod == mod && keys_pressed[kpno].joy == joy)
@ -1199,11 +1220,11 @@ static bool process_key_press(bool down, int key, int mod, int joy = 0)
}
else {
// only release if no others pressed
int bind2;
size_t bind2;
auto b = game_key.b;
for (bind2 = 0; bind2 < game_key.b.size(); bind2++) {
if (game_key.bind_num == bind2 || (b[bind2].key == key && b[bind2].mod == mod && b[bind2].joy == joy))
if ((size_t)game_key.bind_num == bind2 || (b[bind2].key == key && b[bind2].mod == mod && b[bind2].joy == joy))
continue;
for (kpno = 0; kpno < keys_pressed.size(); kpno++)
@ -1269,10 +1290,8 @@ void GameArea::EraseBackground(wxEraseEvent& ev)
void GameArea::OnSize(wxSizeEvent& ev)
{
if (!ev.GetEventUserData()) { // is frame
draw_black_background(this);
Layout();
}
draw_black_background(this);
Layout();
// panel may resize
if (panel)
@ -1281,6 +1300,14 @@ void GameArea::OnSize(wxSizeEvent& ev)
ev.Skip(true);
}
#if defined(__WXGTK__) && defined(HAVE_XSS)
#include <X11/Xlib.h>
#define Status int
#include <X11/extensions/scrnsaver.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#endif
void GameArea::OnSDLJoy(wxSDLJoyEvent& ev)
{
int key = ev.GetControlIndex();
@ -1302,6 +1329,16 @@ void GameArea::OnSDLJoy(wxSDLJoyEvent& ev)
process_key_press(value & SDL_HAT_LEFT, key, WXJB_HAT_W, joy);
} else
process_key_press(ev.GetControlValue() != 0, key, mod, joy);
// tell Linux to turn off the screensaver/screen-blank if joystick button was pressed
// this shouldn't be necessary of course
#if defined(__WXGTK__) && defined(HAVE_XSS)
if (!wxGetApp().UsingWayland()) {
Display* display = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(wxGetApp().frame->GetHandle()));
XResetScreenSaver(display);
XFlush(display);
}
#endif
}
BEGIN_EVENT_TABLE(GameArea, wxPanel)
@ -1320,8 +1357,8 @@ DrawingPanelBase::DrawingPanelBase(int _width, int _height)
, todraw(0)
, pixbuf1(0)
, pixbuf2(0)
, rpi(0)
, nthreads(0)
, rpi(0)
{
memset(delta, 0xff, sizeof(delta));
@ -1336,7 +1373,7 @@ DrawingPanelBase::DrawingPanelBase(int _width, int _height)
break;
wxFileName fpn(gopts.filter_plugin);
fpn.MakeAbsolute(wxStandardPaths::Get().GetPluginsDir());
fpn.MakeAbsolute(wxGetApp().GetPluginsDir());
if (!filt_plugin.Load(fpn.GetFullPath(), wxDL_VERBATIM | wxDL_NOW))
break;
@ -1417,6 +1454,7 @@ void DrawingPanelBase::DrawingPanelInit()
void DrawingPanelBase::PaintEv(wxPaintEvent& ev)
{
(void)ev; // unused params
wxPaintDC dc(GetWindow());
if (!todraw) {
@ -1434,6 +1472,7 @@ void DrawingPanelBase::PaintEv(wxPaintEvent& ev)
void DrawingPanelBase::EraseBackground(wxEraseEvent& ev)
{
(void)ev; // unused params
// do nothing, do not allow propagation
}
@ -1783,7 +1822,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
if (panel->osdstat.size())
drawText(todraw + outstride * (systemColorDepth != 24), outstride,
10, 20, panel->osdstat.mb_str(), showSpeedTransparent);
10, 20, panel->osdstat.utf8_str(), showSpeedTransparent);
if (!disableStatusMessages && !panel->osdtext.empty()) {
if (systemGetClock() - panel->osdtime < OSD_TIME) {
@ -1791,7 +1830,7 @@ void DrawingPanelBase::DrawArea(uint8_t** data)
int linelen = std::ceil(width * scale - 20) / 8;
int nlines = (message.size() + linelen - 1) / linelen;
int cury = height - 14 - nlines * 10;
char* buf = strdup(message.mb_str());
char* buf = strdup(message.utf8_str());
char* ptr = buf;
while (nlines > 1) {
@ -1875,7 +1914,7 @@ void DrawingPanelBase::DrawOSD(wxWindowDC& dc)
// find amt of text that will fit on a line is to search
wxArrayInt llen; // length of each line, in chars
for (int off = 0; off < msg.size();) {
for (size_t off = 0; off < msg.size();) {
// One way would be to bsearch on GetTextExtent() looking for
// best fit.
// Another would be to use GetPartialTextExtents and search
@ -2202,6 +2241,7 @@ void GLDrawingPanel::AdjustViewport()
void GLDrawingPanel::DrawArea(wxWindowDC& dc)
{
(void)dc; // unused params
#ifndef wxGL_IMPLICIT_CONTEXT
SetCurrent(*ctx);
#else
@ -2294,7 +2334,7 @@ void GameArea::StartVidRecording(const wxString& fname)
if ((ret = vid_rec.Record(fnb.data(), basic_width, basic_height,
systemColorDepth))
!= MRET_OK)
wxLogError(_("Unable to begin recording to %s (%s)"), fname.mb_str(),
wxLogError(_("Unable to begin recording to %s (%s)"), fname.c_str(),
media_err(ret));
else {
MainFrame* mf = wxGetApp().frame;
@ -2325,7 +2365,7 @@ void GameArea::StartSoundRecording(const wxString& fname)
MediaRet ret;
if ((ret = snd_rec.Record(fnb.data())) != MRET_OK)
wxLogError(_("Unable to begin recording to %s (%s)"), fname.mb_str(),
wxLogError(_("Unable to begin recording to %s (%s)"), fname.c_str(),
media_err(ret));
else {
MainFrame* mf = wxGetApp().frame;

View File

@ -1,36 +1,26 @@
#include <algorithm>
#include <wx/string.h>
#include <string>
#include <vector>
#include "strutils.h"
// From: https://stackoverflow.com/a/7408245/262458
//
// modified to ignore empty tokens
std::vector<wxString> str_split(const wxString& text, const wxString& sep) {
std::vector<wxString> tokens;
std::size_t start = 0, end = 0;
wxArrayString str_split(const wxString& text, const wxString& sep) {
wxArrayString tokens;
size_t start = 0, end = 0;
while ((end = text.find(sep, start)) != std::string::npos) {
wxString token = text.substr(start, end - start);
if (token.length())
tokens.push_back(token);
tokens.Add(token);
start = end + 1;
}
tokens.push_back(text.substr(start));
tokens.Add(text.substr(start));
return tokens;
}
// From: https://stackoverflow.com/a/15099743/262458
std::size_t vec_find(std::vector<wxString>& opts, const wxString& val) {
auto it = std::find(opts.begin(), opts.end(), val);
if (it == opts.end())
return wxNOT_FOUND;
return std::distance(opts.begin(), it);
size_t vec_find(wxArrayString& opts, const wxString& val) {
return opts.Index(val);
}

View File

@ -1,15 +1,13 @@
#ifndef STRUTILS_H
#define STRUTILS_H
#include <algorithm>
#include <wx/string.h>
#include <string>
#include <vector>
#include <wx/arrstr.h>
// From: https://stackoverflow.com/a/7408245/262458
std::vector<wxString> str_split(const wxString& text, const wxString& sep);
wxArrayString str_split(const wxString& text, const wxString& sep);
// From: https://stackoverflow.com/a/15099743/262458
std::size_t vec_find(std::vector<wxString>& opts, const wxString& val);
size_t vec_find(wxArrayString& opts, const wxString& val);
#endif

View File

@ -39,12 +39,13 @@ bool soundBufferLow;
void systemMessage(int id, const char* fmt, ...)
{
(void)id; // unused params
static char* buf = NULL;
static int buflen = 80;
va_list args;
// auto-conversion of wxCharBuffer to const char * seems broken
// so save underlying wxCharBuffer (or create one of none is used)
wxCharBuffer _fmt(wxString(wxGetTranslation(wxString(fmt, wxConvLibc))).mb_str());
wxCharBuffer _fmt(wxString(wxGetTranslation(wxString(fmt, wxConvLibc))).utf8_str());
if (!buf) {
buf = (char*)malloc(buflen);
@ -71,7 +72,7 @@ void systemMessage(int id, const char* fmt, ...)
exit(1);
}
wxLogError(wxT("%s"), wxString(buf, wxConvLibc).mb_str());
wxLogError(wxT("%s"), wxString(buf, wxConvLibc).c_str());
}
static int frames = 0;
@ -129,7 +130,7 @@ void systemStartGameRecording(const wxString& fname)
uint32_t version = 1;
if (!game_file.Open(fn, wxT("wb")) || game_file.Write(&version, sizeof(version)) != sizeof(version)) {
wxLogError(_("Cannot open output file %s"), fname.mb_str());
wxLogError(_("Cannot open output file %s"), fname.c_str());
return;
}
@ -190,7 +191,7 @@ void systemStartGamePlayback(const wxString& fname)
uint32_t version;
if (!game_file.Open(fn, wxT("rb")) || game_file.Read(&version, sizeof(version)) != sizeof(version) || wxUINT32_SWAP_ON_BE(version) != 1) {
wxLogError(_("Cannot open recording file %s"), fname.mb_str());
wxLogError(_("Cannot open recording file %s"), fname.c_str());
return;
}
@ -359,7 +360,7 @@ void system10Frames(int rate)
static int speedadj = 0;
uint32_t t = systemGetClock();
if (!panel->was_paused && prevclock && (t - prevclock) != 10000 / rate) {
if (!panel->was_paused && prevclock && (t - prevclock) != (uint32_t)(10000 / rate)) {
int speed = t == prevclock ? 100 * 10000 / rate - (t - prevclock) : 100;
// why 98??
@ -415,7 +416,7 @@ void systemScreenCapture(int num)
do {
wxString bfn;
bfn.Printf(wxT("%s%02d"), panel->game_name().mb_str(),
bfn.Printf(wxT("%s%02d"), panel->game_name().c_str(),
num++);
if (captureFormat == 0)
@ -434,7 +435,7 @@ void systemScreenCapture(int num)
panel->emusys->emuWriteBMP(fn.GetFullPath().mb_fn_str());
wxString msg;
msg.Printf(_("Wrote snapshot %s"), fn.GetFullPath().mb_str());
msg.Printf(_("Wrote snapshot %s"), fn.GetFullPath().c_str());
systemScreenMessage(msg);
}
@ -691,11 +692,11 @@ private:
IMPLEMENT_CLASS(PrintDialog, wxEvtHandler)
PrintDialog::PrintDialog(const uint16_t* data, int lines, bool cont)
: img(160, lines)
, npw(1)
, nph(1)
, wxPrintout(wxGetApp().frame->GetPanel()->game_name() + wxT(" Printout"))
PrintDialog::PrintDialog(const uint16_t* data, int lines, bool cont):
wxPrintout(wxGetApp().frame->GetPanel()->game_name() + wxT(" Printout")),
img(160, lines),
npw(1),
nph(1)
{
dlg = wxStaticCast(wxGetApp().frame->FindWindow(XRCID("GBPrinter")), wxDialog);
p = XRCCTRL(*dlg, "Preview", wxPanel);
@ -769,6 +770,7 @@ void PrintDialog::ShowImg(wxPaintEvent& evt)
void PrintDialog::ChangeMag(wxCommandEvent& evt)
{
(void)evt; // unused params
int m = mag->GetSelection() + 1;
wxScrolledWindow* pp = wxStaticCast(p->GetParent(), wxScrolledWindow);
wxSize sz(m * 160, m * img.GetHeight());
@ -805,7 +807,7 @@ void PrintDialog::DoSave(wxCommandEvent&)
if (scimg.SaveFile(of)) {
wxString msg;
msg.Printf(_("Wrote printer output to %s"), of.mb_str());
msg.Printf(_("Wrote printer output to %s"), of.c_str());
systemScreenMessage(msg);
wxButton* cb = wxStaticCast(dlg->FindWindow(wxID_CANCEL), wxButton);
@ -891,6 +893,8 @@ void PrintDialog::DoPrint(wxCommandEvent&)
void systemGbPrint(uint8_t* data, int len, int pages, int feed, int pal, int cont)
{
(void)pages; // unused params
(void)cont; // unused params
ModalPause mp; // this might take a while, so signal a pause
GameArea* panel = wxGetApp().frame->GetPanel();
static uint16_t* accum_prdata;
@ -963,7 +967,7 @@ void systemGbPrint(uint8_t* data, int len, int pages, int feed, int pal, int con
do {
wxString bfn;
bfn.Printf(wxT("%s-print%02d"), panel->game_name().mb_str(),
bfn.Printf(wxT("%s-print%02d"), panel->game_name().c_str(),
num++);
if (captureFormat == 0)
@ -986,7 +990,7 @@ void systemGbPrint(uint8_t* data, int len, int pages, int feed, int pal, int con
if (ret) {
wxString msg;
msg.Printf(_("Wrote printer output to %s"), of.mb_str());
msg.Printf(_("Wrote printer output to %s"), of.c_str());
systemScreenMessage(msg);
}
@ -1111,6 +1115,8 @@ SoundDriver* systemSoundInit()
void systemOnWriteDataToSoundBuffer(const uint16_t* finalWave, int length)
{
(void)finalWave; // unused params
(void)length; // unused params
#ifndef NO_FFMPEG
GameArea* panel = wxGetApp().frame->GetPanel();
@ -1174,7 +1180,7 @@ bool debugOpenPty()
if ((pty_master = posix_openpt(O_RDWR | O_NOCTTY)) < 0 || grantpt(pty_master) < 0 || unlockpt(pty_master) < 0 || !(slave_name = ptsname(pty_master))) {
wxLogError(_("Error opening pseudo tty: %s"), wxString(strerror(errno),
wxConvLibc)
.mb_str());
.c_str());
if (pty_master >= 0) {
close(pty_master);
@ -1311,7 +1317,7 @@ void log(const char* defaultMsg, ...)
if (out == NULL) {
// FIXME: this should be an option
wxFileName trace_log(wxGetApp().GetConfigurationPath(), wxT("trace.log"));
out = fopen(trace_log.GetFullPath().mb_str(), "w");
out = fopen(trace_log.GetFullPath().utf8_str(), "w");
if (!out)
return;

View File

@ -82,11 +82,13 @@ public:
}
void Next(wxCommandEvent& ev)
{
(void)ev; // unused params
CPULoop(1);
GotoPC();
}
void Goto(wxCommandEvent& ev)
{
(void)ev; // unused params
wxString as = goto_addr->GetValue();
if (!as.size())
@ -100,6 +102,7 @@ public:
// wx-2.8.4 or MacOSX compiler can't resolve overloads in evt table
void GotoPCEv(wxCommandEvent& ev)
{
(void)ev; // unused params
GotoPC();
}
void GotoPC()
@ -120,6 +123,7 @@ public:
}
void RefreshCmd(wxCommandEvent& ev)
{
(void)ev; // unused params
UpdateDis();
}
void UpdateDis()
@ -143,6 +147,7 @@ public:
void RefillListEv(wxCommandEvent& ev)
{
(void)ev; // unused params
// what an unsafe calling convention
// examination of disArm shows that max len is 69 chars
// (e.g. 0x081cb6db), and I assume disThumb is shorter
@ -221,11 +226,13 @@ public:
}
void Next(wxCommandEvent& ev)
{
(void)ev; // unused params
gbEmulate(1);
GotoPC();
}
void Goto(wxCommandEvent& ev)
{
(void)ev; // unused params
wxString as = goto_addr->GetValue();
if (!as.size())
@ -239,6 +246,7 @@ public:
// wx-2.8.4 or MacOSX compiler can't resolve overloads in evt table
void GotoPCEv(wxCommandEvent& ev)
{
(void)ev; // unused params
GotoPC();
}
void GotoPC()
@ -248,6 +256,7 @@ public:
}
void RefreshCmd(wxCommandEvent& ev)
{
(void)ev; // unused params
UpdateDis();
}
void UpdateDis()
@ -278,6 +287,7 @@ public:
void RefillListEv(wxCommandEvent& ev)
{
(void)ev; // unused params
// what an unsafe calling convention
// examination of gbDis shows that max len is 26 chars
// (e.g. 0xe2)
@ -322,6 +332,10 @@ void MainFrame::Disassemble(void)
case IMAGE_GB:
LoadXRCViewer(GBDisassemble);
break;
case IMAGE_UNKNOWN:
// do nothing
break;
}
}
@ -357,7 +371,7 @@ public:
wxString longline = lline;
int lwidth = 0;
for (int i = 0; i < NUM_IOREGS; i++) {
for (long unsigned int i = 0; i < NUM_IOREGS; i++) {
addr->Append(wxGetTranslation(ioregs[i].name));
// find longest label
@ -391,6 +405,7 @@ public:
void SelectEv(wxCommandEvent& ev)
{
(void)ev; // unused params
Select(addr->GetSelection());
}
@ -450,11 +465,13 @@ public:
void RefreshEv(wxCommandEvent& ev)
{
(void)ev; // unused params
Update();
}
void Apply(wxCommandEvent& ev)
{
(void)ev; // unused params
int sel = addr->GetSelection();
uint16_t* addr = ioregs[sel].address ? ioregs[sel].address : (uint16_t*)&ioMem[ioregs[sel].offset];
uint16_t mask, reg = *addr;
@ -534,6 +551,7 @@ void LogDialog::Update()
void LogDialog::Save(wxCommandEvent& ev)
{
(void)ev; // unused params
static wxString logdir = wxEmptyString, def_name = wxEmptyString;
if (def_name.empty())
@ -560,6 +578,7 @@ void LogDialog::Save(wxCommandEvent& ev)
void LogDialog::Clear(wxCommandEvent& ev)
{
(void)ev; // unused params
wxGetApp().log.clear();
Update();
}
@ -641,12 +660,14 @@ public:
}
void BlockStart(wxCommandEvent& ev)
{
(void)ev; // unused params
unsigned long l;
bs->GetStringSelection().ToULong(&l, 0);
Goto(l);
}
void GotoEv(wxCommandEvent& ev)
{
(void)ev; // unused params
unsigned long l;
wxString v = goto_addr->GetValue();
@ -662,6 +683,7 @@ public:
}
void RefreshCmd(wxCommandEvent& ev)
{
(void)ev; // unused params
Update();
}
@ -669,6 +691,7 @@ public:
void Load(wxCommandEvent& ev)
{
(void)ev; // unused params
if (memsave_fn.empty())
memsave_fn = wxGetApp().frame->GetPanel()->game_name() + wxT(".dmp");
@ -686,7 +709,7 @@ public:
wxFileName fn(memsave_fn);
if (!fn.IsFileReadable()) {
wxLogError(wxT("Can't open file %s"), memsave_fn.mb_str());
wxLogError(wxT("Can't open file %s"), memsave_fn.c_str());
return;
}
@ -720,6 +743,7 @@ public:
void Save(wxCommandEvent& ev)
{
(void)ev; // unused params
wxString s;
s.Printf(addrlen == 4 ? wxT("%04X") : wxT("%08X"), mv->GetAddr());
selreg_addr->SetValue(s);
@ -802,6 +826,7 @@ public:
// wx-2.8.4 or MacOSX compiler can't resolve overloads in evt table
void RefillListEv(wxCommandEvent& ev)
{
(void)ev; // unused params
Update();
}
@ -823,6 +848,7 @@ public:
void WriteVal(wxCommandEvent& ev)
{
(void)ev; // unused params
switch (mv->fmt) {
case 0:
CPUWriteByteQuick(mv->writeaddr, mv->writeval);
@ -849,7 +875,7 @@ public:
while (len > 0) {
memoryMap m = map[addr >> 24];
uint32_t off = addr & m.mask;
uint32_t wlen = (off + len) > m.mask ? m.mask + 1 - off : len;
int wlen = (off + len) > m.mask ? m.mask + 1 - off : len;
wlen = f.Read(m.address + off, wlen);
if (wlen < 0)
@ -871,7 +897,7 @@ public:
while (len > 0) {
memoryMap m = map[addr >> 24];
uint32_t off = addr & m.mask;
uint32_t wlen = (off + len) > m.mask ? m.mask + 1 - off : len;
int wlen = (off + len) > m.mask ? m.mask + 1 - off : len;
wlen = f.Write(m.address + off, wlen);
if (wlen < 0)
@ -910,6 +936,7 @@ public:
// wx-2.8.4 or MacOSX compiler can't resolve overloads in evt table
void RefillListEv(wxCommandEvent& ev)
{
(void)ev; // unused params
Update();
}
@ -931,6 +958,7 @@ public:
void WriteVal(wxCommandEvent& ev)
{
(void)ev; // unused params
switch (mv->fmt) {
case 0:
GBWriteByteQuick(mv->writeaddr, mv->writeval);
@ -957,7 +985,7 @@ public:
while (len > 0) {
uint8_t* maddr = gbMemoryMap[addr >> 12];
uint32_t off = addr & 0xfff;
uint32_t wlen = (off + len) > 0xfff ? 0x1000 - off : len;
int wlen = (off + len) > 0xfff ? 0x1000 - off : len;
wlen = f.Read(maddr + off, wlen);
if (wlen < 0)
@ -979,7 +1007,7 @@ public:
while (len > 0) {
uint8_t* maddr = gbMemoryMap[addr >> 12];
uint32_t off = addr & 0xfff;
uint32_t wlen = (off + len) > 0xfff ? 0x1000 - off : len;
int wlen = (off + len) > 0xfff ? 0x1000 - off : len;
wlen = f.Write(maddr + off, wlen);
if (wlen < 0)
@ -1009,5 +1037,8 @@ void MainFrame::MemViewer()
case IMAGE_GB:
LoadXRCViewer(GBMem);
break;
default:
break;
}
}

View File

@ -5,6 +5,7 @@
namespace Viewers {
void Viewer::CloseDlg(wxCloseEvent& ev)
{
(void)ev; // unused params
// stop tracking dialog
MainFrame* f = wxGetApp().frame;
@ -76,12 +77,12 @@ IMPLEMENT_DYNAMIC_CLASS(DisList, wxPanel)
DisList::DisList()
: wxPanel()
, nlines(0)
, topaddr(0)
, tc()
, sb()
, didinit(false)
, nlines(0)
, issel(false)
, topaddr(0)
{
}
@ -191,7 +192,7 @@ void DisList::Refill()
MoveSB();
wxString val;
for (int i = 0; i < nlines && i < strings.size(); i++) {
for (size_t i = 0; i < (size_t)nlines && i < strings.size(); i++) {
val += strings[i];
val += wxT('\n');
}
@ -203,6 +204,7 @@ void DisList::Refill()
// on resize, recompute shown lines and refill if necessary
void DisList::Resize(wxSizeEvent& ev)
{
(void)ev; // unused params
if (!didinit) // prevent crash on win32
return;
@ -215,10 +217,10 @@ void DisList::Resize(wxSizeEvent& ev)
wxString val;
tc.SetSize(sz.GetWidth(), (nlines + 1) * lineheight + extraheight);
if (nlines > strings.size())
if ((size_t)nlines > strings.size())
RefillNeeded();
else {
for (int i = 0; i < nlines && i < strings.size(); i++) {
for (size_t i = 0; i < (size_t)nlines && i < strings.size(); i++) {
val += strings[i];
val += wxT('\n');
}
@ -236,7 +238,7 @@ void DisList::SetSel()
if (!issel)
return;
if (nlines > addrs.size() || (uint32_t)addrs[0] > seladdr || (uint32_t)addrs[nlines - 1] <= seladdr)
if ((size_t)nlines > addrs.size() || (uint32_t)addrs[0] > seladdr || (uint32_t)addrs[nlines - 1] <= seladdr)
return;
for (int i = 0, start = 0; i < nlines; i++) {
@ -262,7 +264,7 @@ void DisList::SetSel(uint32_t addr)
seladdr = addr;
issel = true;
if (addrs.size() < 4 || addrs.size() < nlines || topaddr > addr || (uint32_t)addrs[addrs.size() - 4] < addr) {
if (addrs.size() < 4 || addrs.size() < (size_t)nlines || topaddr > addr || (uint32_t)addrs[addrs.size() - 4] < addr) {
topaddr = addr;
strings.clear();
addrs.clear();
@ -282,13 +284,13 @@ IMPLEMENT_DYNAMIC_CLASS(MemView, wxPanel)
MemView::MemView()
: wxPanel()
, nlines(0)
, topaddr(0)
, addrlab(0)
, disp()
, sb()
, didinit(false)
, nlines(0)
, selnib(-1)
, topaddr(0)
, addrlab(0)
{
}
@ -370,7 +372,7 @@ void MemView::MouseEvent(wxMouseEvent& ev)
void MemView::ShowCaret()
{
if (seladdr < topaddr || seladdr >= topaddr + nlines * 16)
if (seladdr < (int)topaddr || seladdr >= (int)topaddr + nlines * 16)
selnib = -1;
if (selnib < 0) {
@ -429,7 +431,7 @@ void MemView::KeyEvent(wxKeyEvent& ev)
selnib--;
if (selnib >= 32) {
if (seladdr == maxaddr - 16)
if (seladdr == (int)maxaddr - 16)
selnib = 32 - nnib;
else {
selnib -= 32;
@ -461,7 +463,7 @@ void MemView::KeyEvent(wxKeyEvent& ev)
case WXK_DOWN:
case WXK_NUMPAD_DOWN:
if (seladdr < maxaddr - 16)
if (seladdr < (int)maxaddr - 16)
seladdr += 16;
break;
@ -493,7 +495,7 @@ void MemView::KeyEvent(wxKeyEvent& ev)
selnib--;
if (selnib >= 32) {
if (seladdr == maxaddr - 16)
if (seladdr == (int)maxaddr - 16)
selnib = 32 - nnib;
else {
selnib -= 32;
@ -507,7 +509,7 @@ void MemView::KeyEvent(wxKeyEvent& ev)
mask = 0xff << bno * 8;
val = k << bno * 8;
} else {
mask = 0xf << bno * 8 + nibno * 4;
mask = 8 * (0xf << bno) + 4 * nibno;
val = isdigit(k) ? k - '0' : tolower(k) + 10 - 'a';
val <<= bno * 8 + nibno * 4;
}
@ -515,7 +517,7 @@ void MemView::KeyEvent(wxKeyEvent& ev)
if ((words[wno] & mask) == val)
break;
words[wno] = words[wno] & ~mask | val;
words[wno] = ((words[wno] & ~mask) | val);
writeaddr = topaddr + 4 * wno;
val = words[wno];
@ -631,6 +633,7 @@ void MemView::Repaint()
void MemView::RepaintEv(wxPaintEvent& ev)
{
(void)ev; // unused params
wxPaintDC dc(&disp);
dc.SetBackgroundMode(wxSOLID);
Refill(dc);
@ -644,7 +647,7 @@ void MemView::Refill(wxDC& dc)
// doesn't seem to inherit font properly
dc.SetFont(GetFont());
for (int i = 0; i < nlines && i < words.size() / 4; i++) {
for (size_t i = 0; i < (size_t)nlines && i < words.size() / 4; i++) {
wxString line, word;
line.Printf(maxaddr > 0xffff ? wxT("%08X ") : wxT("%04X "), topaddr + i * 16);
@ -693,6 +696,7 @@ void MemView::Refill(wxDC& dc)
// on resize, recompute shown lines and refill if necessary
void MemView::Resize(wxSizeEvent& ev)
{
(void)ev; // unused params
if (!didinit) // prevent crash on win32
return;
@ -705,7 +709,7 @@ void MemView::Resize(wxSizeEvent& ev)
wxString val;
disp.SetSize(sz.GetWidth(), (nlines + 1) * charheight);
if (nlines > words.size() / 4) {
if ((size_t)nlines > words.size() / 4) {
if (topaddr + nlines * 16 > maxaddr)
topaddr = maxaddr - nlines * 16 + 1;
@ -889,6 +893,7 @@ void PixView::SetSel(int x, int y, bool desel_cview_update)
void PixView::Redraw(wxPaintEvent& ev)
{
(void)ev; // unused params
if (!bm)
return;
@ -988,6 +993,7 @@ void PixViewEvt::click()
IMPLEMENT_DYNAMIC_CLASS(GfxPanel, wxPanel)
void GfxPanel::DrawBitmap(wxPaintEvent& ev)
{
(void)ev; // unused params
if (!bm)
return;
@ -1122,6 +1128,7 @@ void GfxViewer::BMPSize(int w, int h)
void GfxViewer::StretchTog(wxCommandEvent& ev)
{
(void)ev; // unused params
wxSize sz;
if (str->GetValue()) {
@ -1138,6 +1145,7 @@ void GfxViewer::StretchTog(wxCommandEvent& ev)
void GfxViewer::SaveBMP(wxCommandEvent& ev)
{
(void)ev; // unused params
GameArea* panel = wxGetApp().frame->GetPanel();
bmp_save_dir = wxGetApp().frame->GetGamePath(gopts.scrshot_dir);
// no attempt is made here to translate the dialog type name
@ -1175,6 +1183,7 @@ void GfxViewer::SaveBMP(wxCommandEvent& ev)
void GfxViewer::RefreshEv(wxCommandEvent& ev)
{
(void)ev; // unused params
Update();
}

View File

@ -58,7 +58,7 @@ protected:
// on errors, abort program
#define baddialog() \
do { \
wxLogError(_("Unable to load dialog %s from resources"), dname); \
wxLogError(_("Unable to load dialog %s from resources"), dname.c_str()); \
wxGetApp().frame->Close(true); \
return; \
} while (0)
@ -141,6 +141,7 @@ protected:
// assigned to textctrl to avoid mouse input
void MouseEvent(wxMouseEvent& ev)
{
(void)ev; // unused param
}
// the subwidgets
wxTextCtrl tc;
@ -412,6 +413,7 @@ public:
}
void MouseEvent(wxMouseEvent& ev)
{
(void)ev; // unused param
}
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(DispCheckBox)

View File

@ -8,6 +8,13 @@ BEGIN_EVENT_TABLE(wxJoyKeyTextCtrl, wxKeyTextCtrl)
EVT_SDLJOY(wxJoyKeyTextCtrl::OnJoy)
END_EVENT_TABLE()
// Initializer for struct wxJoyKeyBinding
wxJoyKeyBinding newWxJoyKeyBinding(int key, int mod, int joy)
{
struct wxJoyKeyBinding tmp = {key, mod, joy};
return tmp;
}
int wxJoyKeyTextCtrl::DigitalButton(wxSDLJoyEvent& event)
{
int sdlval = event.GetControlValue();
@ -151,7 +158,7 @@ wxString wxJoyKeyTextCtrl::ToString(wxJoyKeyBinding_v keys, wxChar sep)
{
wxString ret;
for (int i = 0; i < keys.size(); i++) {
for (size_t i = 0; i < keys.size(); i++) {
if (i > 0)
ret += sep;
@ -213,7 +220,7 @@ static bool ParseJoy(const wxString& s, int len, int& mod, int& key, int& joy)
return false;
const wxString p = s.Mid(l);
int alen = len - l;
size_t alen = len - l;
joyre.GetMatch(&b, &l, 1);
joy = simple_atoi(s.Mid(b), l);
#define is_ctrl(re) re.Matches(p) && re.GetMatch(&b, &l) && l == alen && !b
@ -268,12 +275,12 @@ wxJoyKeyBinding_v wxJoyKeyTextCtrl::FromString(const wxString& s, wxChar sep)
{
wxJoyKeyBinding_v ret, empty;
int mod, key, joy;
int len = s.size();
size_t len = s.size();
if (!len)
return empty;
for (int lastkey = len - 1; (lastkey = s.rfind(sep, lastkey)) != wxString::npos; lastkey--) {
for (size_t lastkey = len - 1; (lastkey = s.rfind(sep, lastkey)) != wxString::npos; lastkey--) {
if (lastkey == len - 1) {
// sep as accel
if (!lastkey)

View File

@ -16,6 +16,7 @@ void wxKeyTextCtrl::OnKeyDown(wxKeyEvent& event)
void wxKeyTextCtrl::OnKeyUp(wxKeyEvent& event)
{
(void)event; // unused param
int mod = lastmod;
int key = lastkey;
lastmod = lastkey = 0;
@ -30,7 +31,7 @@ void wxKeyTextCtrl::OnKeyUp(wxKeyEvent& event)
// if blank or backspace is modified, add normally instead
if (clearable && !mod && key == WXK_BACK && !GetValue().empty()) {
wxString val = GetValue();
int lastkey = val.rfind(multikey);
size_t lastkey = val.rfind(multikey);
if (lastkey && lastkey != wxString::npos) {
// if this was actually a ,-accel, delete instead
@ -79,7 +80,7 @@ wxString wxKeyTextCtrl::ToString(int mod, int key)
wxString s = ae.ToString();
if (char_override || mod_override) {
int l = s.rfind(wxT('-'));
size_t l = s.rfind(wxT('-'));
if (l == wxString::npos)
l = 0;
@ -150,7 +151,7 @@ wxString wxKeyTextCtrl::ToString(wxAcceleratorEntry_v keys, wxChar sep)
{
wxString ret;
for (int i = 0; i < keys.size(); i++) {
for (size_t i = 0; i < keys.size(); i++) {
if (i > 0)
ret += sep;
@ -176,16 +177,16 @@ bool wxKeyTextCtrl::ParseString(const wxString& s, int len, int& mod, int& key)
a.Append(s.Left(len));
wxAcceleratorEntry ae;
#ifndef __WXMAC__
#define check_meta(str) \
do { \
wxString meta = str; \
for (int ml = 0; (ml = a.find(meta, ml)) != wxString::npos; ml++) { \
if (!ml || a[ml - 1] == wxT('-') || a[ml - 1] == wxT('+')) { \
mod |= wxMOD_META; \
a.erase(ml, meta.size()); \
ml = -1; \
} \
} \
#define check_meta(str) \
do { \
wxString meta = str; \
for (size_t ml = 0; (ml = a.find(meta, ml)) != wxString::npos; ml++) { \
if (!ml || a[ml - 1] == wxT('-') || a[ml - 1] == wxT('+')) { \
mod |= wxMOD_META; \
a.erase(ml, meta.size()); \
ml = -1; \
} \
} \
} while (0)
check_meta(wxT("Meta-"));
check_meta(wxT("Meta+"));
@ -252,9 +253,9 @@ wxAcceleratorEntry_v wxKeyTextCtrl::FromString(const wxString& s, wxChar sep)
{
wxAcceleratorEntry_v ret, empty;
int mod, key;
int len = s.size();
size_t len = s.size();
for (int lastkey = len - 1; (lastkey = s.rfind(sep, lastkey)) != wxString::npos; lastkey--) {
for (size_t lastkey = len - 1; (lastkey = s.rfind(sep, lastkey)) != wxString::npos; lastkey--) {
if (lastkey == len - 1) {
// sep as accel
if (!lastkey)

View File

@ -14,13 +14,19 @@ struct wxSDLJoyState {
if (dev)
SDL_JoystickClose(dev);
}
wxSDLJoyState()
{
dev = NULL;
nax = nhat = nbut = 0;
curval = NULL;
}
};
wxSDLJoy::wxSDLJoy(bool analog)
: wxTimer()
, digital(!analog)
, evthandler(0)
, joystate(0)
, evthandler(0)
, nosticks(true)
{
// Start up joystick if not already started
@ -36,8 +42,7 @@ wxSDLJoy::wxSDLJoy(bool analog)
if (!njoy)
return;
joystate = new wxSDLJoyState_t[njoy];
memset(joystate, 0, njoy * sizeof(*joystate));
joystate = new wxSDLJoyState[njoy];
for (int i = 0; i < njoy; i++) {
SDL_Joystick* dev = joystate[i].dev = SDL_JoystickOpen(i);
@ -45,7 +50,17 @@ wxSDLJoy::wxSDLJoy(bool analog)
nctrl += joystate[i].nax = SDL_JoystickNumAxes(dev);
nctrl += joystate[i].nhat = SDL_JoystickNumHats(dev);
nctrl += joystate[i].nbut = SDL_JoystickNumButtons(dev);
joystate[i].curval = new short[nctrl];
joystate[i].curval = new short[nctrl]{0};
// initialize axis previous value to initial state
#if SDL_VERSION_ATLEAST(2, 0, 6)
for (int j = 0; j < joystate[i].nax; j++) {
int16_t initial_state = 0;
SDL_JoystickGetAxisInitialState(dev, j, &initial_state);
joystate[i].curval[j] = initial_state;
}
#endif
memset(joystate[i].curval, 0, sizeof(short) * nctrl);
}
}
@ -134,13 +149,6 @@ void wxSDLJoy::Notify()
for (int j = 0; j < nax; j++) {
val = SDL_JoystickGetAxis(dev, j);
// trigger axes always return max negative value, we ignore these
#if SDL_VERSION_ATLEAST(2, 0, 6)
int16_t initial_state;
if (SDL_JoystickGetAxisInitialState(dev, j, &initial_state) && val == initial_state)
continue;
#endif
if (digital) {
if (val > 0x3fff)
val = 0x7fff;

View File

@ -15,6 +15,9 @@ typedef struct wxJoyKeyBinding {
// if joy is non-0, key = control number, and mod = control type
} wxJoyKeyBinding;
// Initializer for struct wxJoyKeyBinding
wxJoyKeyBinding newWxJoyKeyBinding(int key = 0, int mod = 0, int joy = 0);
typedef std::vector<wxJoyKeyBinding> wxJoyKeyBinding_v;
// joystick control types
@ -87,6 +90,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}

View File

@ -99,6 +99,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}

View File

@ -13,7 +13,7 @@
#include <wx/event.h>
#include <wx/timer.h>
typedef struct wxSDLJoyState wxSDLJoyState_t;
struct wxSDLJoyState;
class wxSDLJoy : public wxTimer {
public:
@ -61,7 +61,7 @@ public:
protected:
bool digital;
int njoy;
wxSDLJoyState_t* joystate;
wxSDLJoyState* joystate;
wxEvtHandler* evthandler;
bool nosticks;
void Notify();

View File

@ -33,16 +33,16 @@ class wxBoolIntValidator : public wxValidator {
public:
wxBoolIntValidator(int* _vptr, int _val, int _mask = ~0)
: wxValidator()
, vptr(_vptr)
, val(_val)
, mask(_mask)
, vptr(_vptr)
{
}
wxBoolIntValidator(const wxBoolIntValidator& v)
: wxValidator()
, vptr(v.vptr)
, val(v.val)
, mask(v.mask)
, vptr(v.vptr)
{
}
wxObject* Clone() const
@ -53,6 +53,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}
@ -105,6 +106,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}
@ -133,6 +135,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}
@ -156,8 +159,8 @@ public:
}
wxColorValidator(uint16_t* vptr)
: wxValidator()
, ptr16(vptr)
, ptr32(0)
, ptr16(vptr)
{
}
wxColorValidator(const wxColorValidator& v)
@ -174,6 +177,7 @@ public:
bool TransferFromWindow();
bool Validate(wxWindow* p)
{
(void)p; // unused params
return true;
}

View File

@ -289,7 +289,7 @@ bool wxColorValidator::TransferFromWindow()
static void enable(wxWindow_v controls, std::vector<int> reverse, bool en)
{
for (int i = 0; i < controls.size(); i++)
for (size_t i = 0; i < controls.size(); i++)
controls[i]->Enable(reverse.size() <= i || !reverse[i] ? en : !en);
}
@ -461,6 +461,7 @@ bool wxUIntValidator::TransferFromWindow()
bool wxUIntValidator::Validate(wxWindow* parent)
{
(void)parent; // unused params
wxSpinCtrl* ctrl = wxDynamicCast(GetWindow(), wxSpinCtrl);
if (ctrl) {

View File

@ -32,24 +32,12 @@
IMPLEMENT_APP(wxvbamApp)
IMPLEMENT_DYNAMIC_CLASS(MainFrame, wxFrame)
// Get XDG_CONFIG_HOME dir manually
// only native support for XDG config when wxWidgets >= 3.1
static wxString get_xdg_user_config_home()
// Initializer for struct cmditem
cmditem new_cmditem(const wxString cmd, const wxString name, int cmd_id,
int mask_flags, wxMenuItem* mi)
{
wxString path;
char *xdg_config_home = getenv("XDG_CONFIG_HOME");
// Default for XDG_CONFIG_HOME is '$HOME/.config'
if (!xdg_config_home || !*xdg_config_home)
{
wxString xdg_default(getenv("HOME"));
xdg_default += "/.config";
path = xdg_default;
}
else
{
path = xdg_config_home;
}
return path + "/";
struct cmditem tmp = {cmd, name, cmd_id, mask_flags, mi};
return tmp;
}
// generate config file path
@ -68,38 +56,48 @@ static void get_config_path(wxPathList& path, bool exists = true)
if ((wxDirExists(s) && wxIsWritable(s)) || ((!exists || !wxDirExists(s)) && parent.IsDirWritable())) \
path.Add(s); \
} while (0)
#define add_nonstandard_path(p) \
do { \
const wxString& s = p; \
wxFileName parent = wxFileName::DirName(s + wxT("//..")); \
parent.MakeAbsolute(); \
if ((wxDirExists(s) && wxIsWritable(s)) || ((!exists || !wxDirExists(s)) && parent.IsDirWritable())) \
path.Add(s); \
} while (0)
static bool debug_dumped = false;
if (!debug_dumped) {
wxLogDebug(wxT("GetUserLocalDataDir(): %s"), stdp.GetUserLocalDataDir().mb_str());
wxLogDebug(wxT("GetUserDataDir(): %s"), stdp.GetUserDataDir().mb_str());
wxLogDebug(wxT("GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()): %s"), stdp.GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()).mb_str());
wxLogDebug(wxT("GetResourcesDir(): %s"), stdp.GetResourcesDir().mb_str());
wxLogDebug(wxT("GetDataDir(): %s"), stdp.GetDataDir().mb_str());
wxLogDebug(wxT("GetLocalDataDir(): %s"), stdp.GetLocalDataDir().mb_str());
wxLogDebug(wxT("GetPluginsDir(): %s"), stdp.GetPluginsDir().mb_str());
#if defined(__LINUX__)
wxLogDebug(wxT("XdgConfigDir: %s"), get_xdg_user_config_home() + current_app_name);
#endif
wxLogDebug(wxT("GetUserLocalDataDir(): %s"), stdp.GetUserLocalDataDir().c_str());
wxLogDebug(wxT("GetUserDataDir(): %s"), stdp.GetUserDataDir().c_str());
wxLogDebug(wxT("GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()): %s"), stdp.GetLocalizedResourcesDir(wxGetApp().locale.GetCanonicalName()).c_str());
wxLogDebug(wxT("GetResourcesDir(): %s"), stdp.GetResourcesDir().c_str());
wxLogDebug(wxT("GetDataDir(): %s"), stdp.GetDataDir().c_str());
wxLogDebug(wxT("GetLocalDataDir(): %s"), stdp.GetLocalDataDir().c_str());
wxLogDebug(wxT("plugins_dir: %s"), wxGetApp().GetPluginsDir().c_str());
wxLogDebug(wxT("XdgConfigDir: %s"), (wxString(get_xdg_user_config_home().c_str(), wxConvLibc) + current_app_name).c_str());
debug_dumped = true;
}
// When native support for XDG dirs is available (wxWidgets >= 3.1),
// this will be no longer necessary
#if defined(__LINUX__)
#if defined(__WXGTK__)
// XDG spec manual support
// ${XDG_CONFIG_HOME:-$HOME/.config}/`appname`
wxString old_config = wxString(getenv("HOME")) + "/.vbam";
wxString new_config = get_xdg_user_config_home();
wxString old_config = wxString(getenv("HOME"), wxConvLibc) + wxT(FILE_SEP) + wxT(".vbam");
wxString new_config(get_xdg_user_config_home().c_str(), wxConvLibc);
if (!wxDirExists(old_config) && wxIsWritable(new_config))
{
path.Add(new_config + current_app_name);
wxFileName new_path(new_config, wxEmptyString);
new_path.AppendDir(current_app_name);
new_path.MakeAbsolute();
add_nonstandard_path(new_path.GetFullPath());
}
else
{
// config is in $HOME/.vbam/vbam.conf
path.Add(old_config);
// config is in $HOME/.vbam/
add_nonstandard_path(old_config);
}
#endif
@ -110,7 +108,7 @@ static void get_config_path(wxPathList& path, bool exists = true)
add_path(GetResourcesDir());
add_path(GetDataDir());
add_path(GetLocalDataDir());
add_path(GetPluginsDir());
add_nonstandard_path(wxGetApp().GetPluginsDir());
}
static void tack_full_path(wxString& s, const wxString& app = wxEmptyString)
@ -119,17 +117,18 @@ static void tack_full_path(wxString& s, const wxString& app = wxEmptyString)
wxPathList full_config_path;
get_config_path(full_config_path, false);
for (int i = 0; i < full_config_path.size(); i++)
for (size_t i = 0; i < full_config_path.size(); i++)
s += wxT("\n\t") + full_config_path[i] + app;
}
const wxString wxvbamApp::GetPluginsDir()
{
return wxStandardPaths::Get().GetPluginsDir();
}
wxString wxvbamApp::GetConfigurationPath()
{
#if defined(__WXMSW__) || defined(__APPLE__)
wxString config("vbam.ini");
#else
wxString config("vbam.conf");
#endif
wxString config(wxT("vbam.ini"));
// first check if config files exists in reverse order
// (from system paths to more local paths.)
if (data_path.empty()) {
@ -149,7 +148,7 @@ wxString wxvbamApp::GetConfigurationPath()
// dir or parent to create it in in OnInit in normal order
// (from user paths to system paths.)
if (data_path.empty()) {
for (int i = 0; i < config_path.size(); i++) {
for (size_t i = 0; i < config_path.size(); i++) {
// Check if path is writeable
if (wxIsWritable(config_path[i])) {
data_path = config_path[i];
@ -215,6 +214,9 @@ bool wxvbamApp::OnInit()
if (!wxApp::OnInit())
return false;
if (console_mode)
return true;
// prepare for loading xrc files
wxXmlResource* xr = wxXmlResource::Get();
// note: if linking statically, next 2 pull in lot of unused code
@ -227,7 +229,7 @@ bool wxvbamApp::OnInit()
// 2.9 has LoadAllFiles(), but this is 2.8, so we'll do it manually
wxString cwd = wxGetCwd();
for (int i = 0; i < config_path.size(); i++)
for (size_t i = 0; i < config_path.size(); i++)
if (wxDirExists(config_path[i]) && wxSetWorkingDirectory(config_path[i])) {
// *.xr[cs] doesn't work (double the number of scans)
// 2.9 gives errors for no files found, so manual precheck needed
@ -253,12 +255,22 @@ bool wxvbamApp::OnInit()
// this needs to be in a subdir to support other config as well
// but subdir flag behaves differently 2.8 vs. 2.9. Oh well.
// NOTE: this does not support XDG (freedesktop.org) paths
#if defined(__WXMSW__) || defined(__APPLE__)
wxString confname("vbam.ini");
#else
wxString confname("vbam.conf");
#endif
wxString confname(wxT("vbam.ini"));
wxFileName vbamconf(GetConfigurationPath(), confname);
// /MIGRATION
// migrate from 'vbam.{cfg,conf}' to 'vbam.ini' to manage a single config
// file for all platforms.
#if !defined(__WXMSW__) && !defined(__APPLE__)
wxString oldConf(GetConfigurationPath() + wxT(FILE_SEP) + wxT("vbam.conf"));
#else
wxString oldConf(GetConfigurationPath() + wxT(FILE_SEP) + wxT("vbam.cfg"));
#endif
wxString newConf(GetConfigurationPath() + wxT(FILE_SEP) + wxT("vbam.ini"));
if (wxFileExists(oldConf))
{
wxRenameFile(oldConf, newConf, false);
}
// /END_MIGRATION
cfg = new wxFileConfig(wxT("vbam"), wxEmptyString,
vbamconf.GetFullPath(),
wxEmptyString, wxCONFIG_USE_LOCAL_FILE);
@ -295,7 +307,7 @@ bool wxvbamApp::OnInit()
}
// process command-line options
for (int i = 0; i < pending_optset.size(); i++) {
for (size_t i = 0; i < pending_optset.size(); i++) {
auto parts = str_split(pending_optset[i], wxT('='));
opt_set(parts[0], parts[1]);
}
@ -395,6 +407,11 @@ bool wxvbamApp::OnInit()
}
// create the main window
int x = windowPositionX;
int y = windowPositionY;
int width = windowWidth;
int height = windowHeight;
int isFullscreen = fullScreen;
frame = wxDynamicCast(xr->LoadFrame(NULL, wxT("MainFrame")), MainFrame);
if (!frame) {
@ -406,10 +423,43 @@ bool wxvbamApp::OnInit()
if (!frame->BindControls())
return false;
if (x >= 0 && y >= 0 && width > 0 && height > 0)
frame->SetSize(x, y, width, height);
if (isFullscreen && wxGetApp().pending_load != wxEmptyString)
frame->ShowFullScreen(isFullscreen);
frame->Show(true);
return true;
}
int wxvbamApp::OnRun()
{
if (console_mode)
{
// we could check for our own error codes here...
return console_status;
}
else
{
return wxApp::OnRun();
}
}
bool wxvbamApp::OnCmdLineHelp(wxCmdLineParser& parser)
{
wxApp::OnCmdLineHelp(parser);
console_mode = true;
return true;
}
bool wxvbamApp::OnCmdLineError(wxCmdLineParser& parser)
{
wxApp::OnCmdLineError(parser);
console_mode = true;
console_status = 1;
return true;
}
void wxvbamApp::OnInitCmdLine(wxCmdLineParser& cl)
{
wxApp::OnInitCmdLine(cl);
@ -428,28 +478,33 @@ void wxvbamApp::OnInitCmdLine(wxCmdLineParser& cl)
// locale
static wxCmdLineEntryDesc opttab[] = {
{ wxCMD_LINE_OPTION, NULL, t("save-xrc"),
N_("Save built-in XRC file and exit") },
N_("Save built-in XRC file and exit"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
{ wxCMD_LINE_OPTION, NULL, t("save-over"),
N_("Save built-in vba-over.ini and exit") },
N_("Save built-in vba-over.ini and exit"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
{ wxCMD_LINE_SWITCH, NULL, t("print-cfg-path"),
N_("Print configuration path and exit") },
N_("Print configuration path and exit"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
{ wxCMD_LINE_SWITCH, t("f"), t("fullscreen"),
N_("Start in full-screen mode") },
N_("Start in full-screen mode"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
#if !defined(NO_LINK) && !defined(__WXMSW__)
{ wxCMD_LINE_SWITCH, t("s"), t("delete-shared-state"),
N_("Delete shared link state first, if it exists") },
N_("Delete shared link state first, if it exists"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
#endif
// stupid wx cmd line parser doesn't support duplicate options
// { wxCMD_LINE_OPTION, t("o"), t("option"),
// _("Set configuration option; <opt>=<value> or help for list"),
{
wxCMD_LINE_SWITCH, t("o"), t("list-options"),
N_("List all settable options and exit") },
{ wxCMD_LINE_SWITCH, t("o"), t("list-options"),
N_("List all settable options and exit"),
wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE },
{ wxCMD_LINE_PARAM, NULL, NULL,
N_("ROM file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_PARAM, NULL, NULL,
N_("<config>=<value>"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_MULTIPLE | wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE }
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, wxCMD_LINE_VAL_NONE }
};
// 2.9 automatically translates desc, but 2.8 doesn't
#if !wxCHECK_VERSION(2, 9, 0)
@ -491,10 +546,11 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
"To override, remove all but changed root node(s). "
"First found root node of correct name in any .xrc or "
".xrs files in following search path overrides built-in:"),
s.mb_str());
s.c_str());
tack_full_path(lm);
wxLogMessage(lm);
return false;
console_mode = true;
return true;
}
if (cl.Found(wxT("print-cfg-path"))) {
@ -504,7 +560,8 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
wxString lm(_("Configuration is read from, in order:"));
tack_full_path(lm);
wxLogMessage(lm);
return false;
console_mode = true;
return true;
}
if (cl.Found(wxT("save-over"), &s)) {
@ -516,13 +573,14 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
wxString lm;
lm.Printf(_("Wrote built-in override file to %s\n"
"To override, delete all but changed section. First found section is used from search path:"),
s.mb_str());
s.c_str());
wxString oi = wxFileName::GetPathSeparator();
oi += wxT("vba-over.ini");
tack_full_path(lm, oi);
lm.append(_("\n\tbuilt-in"));
wxLogMessage(lm);
return false;
console_mode = true;
return true;
}
if (cl.Found(wxT("f"))) {
@ -535,17 +593,17 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
"For flag options, true and false are specified as 1 and 0, respectively.\n\n"));
for (int i = 0; i < num_opts; i++) {
wxPrintf(wxT("%s (%s"), opts[i].opt,
opts[i].boolopt ? wxT("flag") : opts[i].stropt ? wxT("string") : !opts[i].enumvals.empty() ? opts[i].enumvals : (wxString)(opts[i].intopt ? wxT("int") : opts[i].doubleopt ? wxT("decimal") : wxT("string")));
wxPrintf(wxT("%s (%s"), opts[i].opt.c_str(),
opts[i].boolopt ? wxT("flag") : opts[i].stropt ? wxT("string") : !opts[i].enumvals.empty() ? opts[i].enumvals.c_str() : (opts[i].intopt ? wxT("int") : opts[i].doubleopt ? wxT("decimal") : wxT("string")));
if (!opts[i].enumvals.empty()) {
const wxString evx = wxGetTranslation(opts[i].enumvals);
if (wxStrcmp(evx, opts[i].enumvals))
wxPrintf(wxT(" = %s"), evx);
wxPrintf(wxT(" = %s"), evx.c_str());
}
wxPrintf(wxT(")\n\t%s\n\n"), opts[i].desc);
wxPrintf(wxT(")\n\t%s\n\n"), opts[i].desc.c_str());
if (!opts[i].enumvals.empty())
opts[i].enumvals = wxGetTranslation(opts[i].enumvals);
@ -554,9 +612,10 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
wxPrintf(_("The commands available for the Keyboard/* option are:\n\n"));
for (int i = 0; i < ncmds; i++)
wxPrintf(wxT("%s (%s)\n"), cmdtab[i].cmd, cmdtab[i].name);
wxPrintf(wxT("%s (%s)\n"), cmdtab[i].cmd.c_str(), cmdtab[i].name.c_str());
return false;
console_mode = true;
return true;
}
#if !defined(NO_LINK) && !defined(__WXMSW__)
@ -585,11 +644,11 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
} else {
if (!complained) {
wxFprintf(stderr, _("Bad configuration option or multiple ROM files given:\n"));
wxFprintf(stderr, wxT("%s\n"), pending_load.mb_str());
wxFprintf(stderr, wxT("%s\n"), pending_load.c_str());
complained = true;
}
wxFprintf(stderr, wxT("%s\n"), p);
wxFprintf(stderr, wxT("%s\n"), p.c_str());
}
}
}
@ -601,16 +660,30 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
return true;
}
wxString wxvbamApp::GetConfigDir()
{
return GetAbsolutePath(wxString((get_xdg_user_config_home() + DOT_DIR).c_str(), wxConvLibc));
}
wxString wxvbamApp::GetDataDir()
{
return GetAbsolutePath(wxString((get_xdg_user_data_home() + DOT_DIR).c_str(), wxConvLibc));
}
wxvbamApp::~wxvbamApp() {
free(home);
if (home != NULL)
{
free(home);
home = NULL;
}
}
MainFrame::MainFrame()
: wxFrame()
, focused(false)
, paused(false)
, menus_opened(0)
, dialog_opened(0)
, focused(false)
{
}
@ -629,6 +702,9 @@ EVT_ACTIVATE(MainFrame::OnActivate)
// requires DragAcceptFiles(true); even then may not do anything
EVT_DROP_FILES(MainFrame::OnDropFile)
// for window geometry
EVT_MOVE(MainFrame::OnMove)
EVT_SIZE(MainFrame::OnSize)
// pause game if menu pops up
//
// This is a feature most people don't like, and it causes problems with
@ -684,6 +760,40 @@ void MainFrame::OnMenu(wxContextMenuEvent& event)
}
}
void MainFrame::OnMove(wxMoveEvent& event)
{
(void)event; // unused params
wxRect pos = GetRect();
int x = pos.GetX(), y = pos.GetY();
if (x >= 0 && y >= 0 && !IsFullScreen())
{
windowPositionX = x;
windowPositionY = y;
update_opts();
}
}
void MainFrame::OnSize(wxSizeEvent& event)
{
wxFrame::OnSize(event);
wxRect pos = GetRect();
int height = pos.GetHeight(), width = pos.GetWidth();
int x = pos.GetX(), y = pos.GetY();
bool isFullscreen = IsFullScreen();
if (height > 0 && width > 0 && !isFullscreen)
{
windowHeight = height;
windowWidth = width;
}
if (x >= 0 && y >= 0 && !isFullscreen)
{
windowPositionX = x;
windowPositionY = y;
}
fullScreen = isFullscreen;
update_opts();
}
wxString MainFrame::GetGamePath(wxString path)
{
wxString game_path = path;
@ -699,7 +809,10 @@ wxString MainFrame::GetGamePath(wxString path)
game_path = wxFileName::GetCwd();
if (!wxIsWritable(game_path))
game_path = wxGetApp().GetConfigurationPath();
{
game_path = wxGetApp().GetAbsolutePath(wxString((get_xdg_user_data_home() + DOT_DIR).c_str(), wxConvLibc));
wxFileName::Mkdir(game_path, 0777, wxPATH_MKDIR_FULL);
}
return game_path;
}
@ -716,7 +829,7 @@ void MainFrame::SetJoystick()
for (int j = 0; j < NUM_KEYS; j++) {
wxJoyKeyBinding_v b = gopts.joykey_bindings[i][j];
for (int k = 0; k < b.size(); k++) {
for (size_t k = 0; k < b.size(); k++) {
int jn = b[k].joy;
if (jn) {
@ -766,7 +879,7 @@ void MainFrame::update_state_ts(bool force)
if (panel->game_type() != IMAGE_UNKNOWN) {
wxString fn;
fn.Printf(SAVESLOT_FMT, panel->game_name().mb_str(), i + 1);
fn.Printf(SAVESLOT_FMT, panel->game_name().c_str(), i + 1);
wxFileName fp(panel->state_dir(), fn);
wxDateTime ts; // = wxInvalidDateTime
@ -785,7 +898,7 @@ void MainFrame::update_state_ts(bool force)
wxString df = fts.Format(wxT("0&0 %x %X"));
if (!ts.IsValid())
for (int j = 0; j < df.size(); j++)
for (size_t j = 0; j < df.size(); j++)
if (wxIsdigit(df[j]))
df[j] = wxT('-');

View File

@ -83,10 +83,16 @@ public:
{
}
virtual bool OnInit();
virtual int OnRun();
virtual bool OnCmdLineHelp(wxCmdLineParser&);
virtual bool OnCmdLineError(wxCmdLineParser&);
virtual bool UsingWayland() { return using_wayland; }
virtual void OnInitCmdLine(wxCmdLineParser&);
virtual bool OnCmdLineParsed(wxCmdLineParser&);
virtual wxString GetConfigDir();
virtual wxString GetDataDir();
wxString GetConfigurationPath();
const wxString GetPluginsDir();
wxString GetAbsolutePath(wxString path);
// name of a file to load at earliest opportunity
wxString pending_load;
@ -139,10 +145,12 @@ public:
protected:
bool using_wayland;
bool console_mode = false;
int console_status = 0;
private:
wxPathList config_path;
char* home;
char* home = NULL;
};
DECLARE_APP(wxvbamApp);
@ -355,6 +363,9 @@ private:
void OnDropFile(wxDropFilesEvent&);
// pop up menu in fullscreen mode
void OnMenu(wxContextMenuEvent&);
// window geometry
void OnMove(wxMoveEvent& event);
void OnSize(wxSizeEvent& event);
// Load a named wxDialog from the XRC file
wxDialog* LoadXRCDialog(const char* name);
// Load a named wxDialog from the XRC file
@ -645,6 +656,11 @@ extern struct cmditem {
wxMenuItem* mi; // the menu item to invoke command, if present
} cmdtab[];
extern const int ncmds;
// Initializer for struct cmditem
cmditem new_cmditem(const wxString cmd = "", const wxString name = "",
int cmd_id = 0, int mask_flags = 0, wxMenuItem* mi = NULL);
// for binary search
extern bool cmditem_lt(const struct cmditem& cmd1, const struct cmditem& cmd2);

View File

@ -1,128 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="AccelConfig">
<title>Key Shortcuts</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Co_mmands:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTreeCtrl" name="Commands">
<style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_HIDE_ROOT</style>
<size>300,300</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Current Keys:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxListBox" name="Current"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxButton" name="Assign">
<label>_Assign</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Remove">
<label>_Remove</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="ResetAll">
<label>Re_set All</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<cols>3</cols>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Currently assigned to:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="AlreadyThere"/>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Shortcut Key:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Shortcut" subclass="wxKeyTextCtrl">
<style>wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="AccelConfig">
<title>Key Shortcuts</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Co_mmands:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTreeCtrl" name="Commands">
<style>wxTR_HAS_BUTTONS|wxTR_NO_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_HIDE_ROOT</style>
<size>300,300</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Current Keys:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxListBox" name="Current"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxButton" name="Assign">
<label>_Assign</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Remove">
<label>_Remove</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="ResetAll">
<label>Re_set All</label>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<cols>3</cols>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Currently assigned to:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="AlreadyThere"/>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Shortcut Key:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Shortcut" subclass="wxKeyTextCtrl">
<style>wxTE_PROCESS_ENTER|wxTE_PROCESS_TAB</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,113 +1,113 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatAdd">
<title>Add Cheat</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Description</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Desc"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Address</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText" name="Address"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Value</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<option>1</option>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Value"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Format</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText" name="Format"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatAdd">
<title>Add Cheat</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Description</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Desc"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Address</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText" name="Address"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Value</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<option>1</option>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Value"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Format</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText" name="Format"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>

View File

@ -1,218 +1,218 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatCreate">
<title>Cheat Search</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxListCtrl" name="CheatList" subclass="CheatListCtrl">
<style>wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VIRTUAL</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>-1,200</minsize>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="EQ">
<label>E_qual</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="NE">
<label>_Not equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="LT">
<label>_Less than</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="LE">
<label>L_ess or equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="GT">
<label>_Greater than</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="GE">
<label>G_reater or equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Compare type</label>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="Signed">
<label>S_igned</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Unsigned">
<label>_Unsigned</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Hexadecimal">
<label>_Hexadecimal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Signed/Unsigned</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="Size8">
<label>_8 bits</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Size16">
<label>_16 bits</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Size32">
<label>_32 bits</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Data size</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="OldValue">
<label>Ol_d value</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="SpecificValue">
<label>Specific _value</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Value"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<label>Search value</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxButton" name="Search">
<label>_Search</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Update">
<label>U_pdate Old</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Clear">
<label>_Clear</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="AddCheat">
<label>_Add cheat</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_OK"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALIGN_CENTRE</flag>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatCreate">
<title>Cheat Search</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxListCtrl" name="CheatList" subclass="CheatListCtrl">
<style>wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VIRTUAL</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>-1,200</minsize>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="EQ">
<label>E_qual</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="NE">
<label>_Not equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="LT">
<label>_Less than</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="LE">
<label>L_ess or equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="GT">
<label>_Greater than</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="GE">
<label>G_reater or equal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Compare type</label>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="Signed">
<label>S_igned</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Unsigned">
<label>_Unsigned</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Hexadecimal">
<label>_Hexadecimal</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Signed/Unsigned</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="Size8">
<label>_8 bits</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Size16">
<label>_16 bits</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="Size32">
<label>_32 bits</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Data size</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="OldValue">
<label>Ol_d value</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="SpecificValue">
<label>Specific _value</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Value"/>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<label>Search value</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxButton" name="Search">
<label>_Search</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Update">
<label>U_pdate Old</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Clear">
<label>_Clear</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="AddCheat">
<label>_Add cheat</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_OK"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALIGN_CENTRE</flag>
</object>
</object>
</object>
</resource>

View File

@ -1,93 +1,93 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatEdit">
<title>Edit Cheat</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Description</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Desc"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Type</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxChoice" name="Type"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>C_odes</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<option>1</option>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Codes">
<style>wxTE_MULTILINE|wxTE_DONTWRAP</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatEdit">
<title>Edit Cheat</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Description</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Desc"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>_Type</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxChoice" name="Type"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>C_odes</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<option>1</option>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxTextCtrl" name="Codes">
<style>wxTE_MULTILINE|wxTE_DONTWRAP</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>

View File

@ -1,62 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatList">
<title>Cheat List</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxToolBar">
<object class="tool" name="wxID_OPEN">
<bitmap stock_id="wxART_FILE_OPEN"/>
<tooltip>Open cheat list</tooltip>
</object>
<object class="tool" name="wxID_SAVE">
<bitmap stock_id="wxART_FILE_SAVE"/>
<tooltip>Save cheat list</tooltip>
</object>
<object class="separator"/>
<object class="tool" name="wxID_ADD">
<bitmap stock_id="wxART_ADD_BOOKMARK"/>
<tooltip>Add new cheat</tooltip>
</object>
<object class="tool" name="wxID_REMOVE">
<bitmap stock_id="wxART_DEL_BOOKMARK"/>
<tooltip>Delete selected cheat</tooltip>
</object>
<object class="tool" name="wxID_CLEAR">
<bitmap platform="unix" stock_id="gtk-clear"/>
<bitmap stock_id="wxART_DELETE"/>
<tooltip>Delete all cheats</tooltip>
</object>
<object class="separator"/>
<object class="tool" name="wxID_SELECTALL">
<bitmap platform="unix" stock_id="gtk-select-all"/>
<bitmap stock_id="wxART_TICK_MARK"/>
<tooltip>Toggle all Cheats</tooltip>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxListCtrl" name="Cheats" subclass="wxCheckedListCtrl">
<style>wxLC_REPORT</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>200,100d</minsize>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
</object>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CheatList">
<title>Cheat List</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxToolBar">
<object class="tool" name="wxID_OPEN">
<bitmap stock_id="wxART_FILE_OPEN"/>
<tooltip>Open cheat list</tooltip>
</object>
<object class="tool" name="wxID_SAVE">
<bitmap stock_id="wxART_FILE_SAVE"/>
<tooltip>Save cheat list</tooltip>
</object>
<object class="separator"/>
<object class="tool" name="wxID_ADD">
<bitmap stock_id="wxART_ADD_BOOKMARK"/>
<tooltip>Add new cheat</tooltip>
</object>
<object class="tool" name="wxID_REMOVE">
<bitmap stock_id="wxART_DEL_BOOKMARK"/>
<tooltip>Delete selected cheat</tooltip>
</object>
<object class="tool" name="wxID_CLEAR">
<bitmap platform="unix" stock_id="gtk-clear"/>
<bitmap stock_id="wxART_DELETE"/>
<tooltip>Delete all cheats</tooltip>
</object>
<object class="separator"/>
<object class="tool" name="wxID_SELECTALL">
<bitmap platform="unix" stock_id="gtk-select-all"/>
<bitmap stock_id="wxART_TICK_MARK"/>
<tooltip>Toggle all Cheats</tooltip>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxListCtrl" name="Cheats" subclass="wxCheckedListCtrl">
<style>wxLC_REPORT</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>200,100d</minsize>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK">
<default>1</default>
</object>
</object>
</object>
</object>
</object>
</object>
</resource>

View File

@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CodeSelect">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxListBox" name="CodeList">
<style>wxLB_HSCROLL|wxLB_SORT</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="CodeSelect">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxListBox" name="CodeList">
<style>wxLB_HSCROLL|wxLB_SORT</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,135 +1,135 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="DirectoriesConfig">
<title>Directories</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy Advance ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBARoms">
<message>Game Boy Advance ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
<size>439,30</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBRoms">
<message>Game Boy ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy Color ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBCRoms">
<message>Game Boy Color ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Native Saves</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="BatSaves">
<message>Native Saves</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Emulator Saves</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="StateSaves">
<message>Emulator Saves</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Screenshots</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="Screenshots">
<message>Screenshots</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Recordings</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="Recordings">
<message>Recordings</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="DirectoriesConfig">
<title>Directories</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy Advance ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBARoms">
<message>Game Boy Advance ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
<size>439,30</size>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBRoms">
<message>Game Boy ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game Boy Color ROMs</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="GBCRoms">
<message>Game Boy Color ROMs</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Native Saves</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="BatSaves">
<message>Native Saves</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Emulator Saves</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="StateSaves">
<message>Emulator Saves</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Screenshots</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="Screenshots">
<message>Screenshots</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Recordings</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxDirPickerCtrl" name="Recordings">
<message>Recordings</message>
<style>wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST</style>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,482 +1,482 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="Disassemble">
<title>Disassemble</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="InsAuto">
<label>_Automatic</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="InsARM">
<label>A_RM</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="InsThumb">
<label>_THUMB</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="GotoAddress">
<style>wxTE_PROCESS_ENTER</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Goto">
<label>_Go</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxPanel" name="Disassembly" subclass="DisList">
<font>
<family>modern</family>
</font>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>R0:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R0">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R1:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R1">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R2:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R2">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R3:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R3">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R4:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R4">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R5:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R5">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R6:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R6">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R7:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R7">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R8:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R8">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R9:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R9">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R10:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R10">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R11:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R11">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R12:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R12">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>SP:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R13">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>LR:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R14">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>PC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R15">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CPSR:</label>
</object>
<flag>wxBOTTOM|wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R16">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxBOTTOM|wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="N" subclass="DispCheckBox">
<label>N</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="I" subclass="DispCheckBox">
<label>I</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Z" subclass="DispCheckBox">
<label>Z</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="F" subclass="DispCheckBox">
<label>F</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="C" subclass="DispCheckBox">
<label>C</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="T" subclass="DispCheckBox">
<label>T</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="V" subclass="DispCheckBox">
<label>V</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>2</cols>
<object class="sizeritem">
<object class="wxStaticText">
<label>Mode:</label>
</object>
<flag>wxLEFT|wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Mode">
<font>
<family>modern</family>
</font>
<label>00</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
</object>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>4</cols>
<object class="sizeritem">
<object class="wxButton" name="GotoPC">
<label>G_oto PC</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>Re_fresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Next">
<label>_Next</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="Disassemble">
<title>Disassemble</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="InsAuto">
<label>_Automatic</label>
<style>wxRB_GROUP</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="InsARM">
<label>A_RM</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="InsThumb">
<label>_THUMB</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="GotoAddress">
<style>wxTE_PROCESS_ENTER</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Goto">
<label>_Go</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxPanel" name="Disassembly" subclass="DisList">
<font>
<family>modern</family>
</font>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>R0:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R0">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R1:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R1">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R2:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R2">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R3:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R3">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R4:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R4">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R5:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R5">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R6:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R6">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R7:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R7">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R8:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R8">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R9:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R9">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R10:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R10">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R11:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R11">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>R12:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R12">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>SP:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R13">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>LR:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R14">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>PC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R15">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CPSR:</label>
</object>
<flag>wxBOTTOM|wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="R16">
<font>
<family>modern</family>
</font>
<label>00000000</label>
</object>
<flag>wxBOTTOM|wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="N" subclass="DispCheckBox">
<label>N</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="I" subclass="DispCheckBox">
<label>I</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Z" subclass="DispCheckBox">
<label>Z</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="F" subclass="DispCheckBox">
<label>F</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="C" subclass="DispCheckBox">
<label>C</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="T" subclass="DispCheckBox">
<label>T</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="V" subclass="DispCheckBox">
<label>V</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>2</cols>
<object class="sizeritem">
<object class="wxStaticText">
<label>Mode:</label>
</object>
<flag>wxLEFT|wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Mode">
<font>
<family>modern</family>
</font>
<label>00</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
</object>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>4</cols>
<object class="sizeritem">
<object class="wxButton" name="GotoPC">
<label>G_oto PC</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>Re_fresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Next">
<label>_Next</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>

View File

@ -1,303 +1,303 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="DisplayConfig">
<title>Display settings</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxNotebook">
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>Output module</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputSimple">
<label>Simple</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputQuartz2D">
<label>Quartz2D</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputOpenGL">
<label>OpenGL</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputDirect3D">
<label>Direct3D 9</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Filters</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Display filter :</label>
</object>
</object>
<object class="sizeritem">
<object class="wxChoice" name="Filter">
<content>
<item>None</item>
<item>2xSaI</item>
<item>Super 2xSaI</item>
<item>Super Eagle</item>
<item>Pixelate</item>
<item>Advance MAME Scale2x</item>
<item>Bilinear</item>
<item>Bilinear Plus</item>
<item>Scanlines</item>
<item>TV Mode</item>
<item>HQ 2x</item>
<item>LQ 2x</item>
<item>Simple 2x</item>
<item>Simple 3x</item>
<item>HQ 3x</item>
<item>Simple 4x</item>
<item>HQ 4x</item>
<item>xBRZ 2x</item>
<item>xBRZ 3x</item>
<item>xBRZ 4x</item>
<item>xBRZ 5x</item>
<item>xBRZ 6x</item>
<item>Plugin</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="PluginLab">
<label>Plugin :</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxChoice" name="Plugin"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Interframe blending :</label>
</object>
<flag>wxRIGHT|wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxChoice" name="IFB">
<content>
<item>None</item>
<item>Smart interframe blending</item>
<item>Interframe motion blur</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<label>Basic</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>Frame Skip</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxStaticText" name="FrameSkipLab">
<label>_Number of frames to skip :</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxSpinCtrl" name="FrameSkip">
<min>0</min>
<max>9</max>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<label>Speed</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<flag>wxEXPAND</flag>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Speed indicator :</label>
</object>
</object>
<object class="sizeritem">
<object class="wxChoice" name="SpeedIndicator">
<content>
<item>None</item>
<item>Percentage</item>
<item>Detailed</item>
</content>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
</object>
</object>
</object>
<label>On-Screen Display</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Default magnification :</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="DefaultScale">
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Maximum magnification factor :</label>
<tooltip>0 = no maximum</tooltip>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxSpinCtrl" name="MaxScale">
<tooltip>0 = no limit</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
<label>Zoom</label>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="DisplayConfig">
<title>Display settings</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxNotebook">
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>Output module</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputSimple">
<label>Simple</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputQuartz2D">
<label>Quartz2D</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputOpenGL">
<label>OpenGL</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="OutputDirect3D">
<label>Direct3D 9</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Filters</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Display filter :</label>
</object>
</object>
<object class="sizeritem">
<object class="wxChoice" name="Filter">
<content>
<item>None</item>
<item>2xSaI</item>
<item>Super 2xSaI</item>
<item>Super Eagle</item>
<item>Pixelate</item>
<item>Advance MAME Scale2x</item>
<item>Bilinear</item>
<item>Bilinear Plus</item>
<item>Scanlines</item>
<item>TV Mode</item>
<item>HQ 2x</item>
<item>LQ 2x</item>
<item>Simple 2x</item>
<item>Simple 3x</item>
<item>HQ 3x</item>
<item>Simple 4x</item>
<item>HQ 4x</item>
<item>xBRZ 2x</item>
<item>xBRZ 3x</item>
<item>xBRZ 4x</item>
<item>xBRZ 5x</item>
<item>xBRZ 6x</item>
<item>Plugin</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="PluginLab">
<label>Plugin :</label>
</object>
<flag>wxALL|wxALIGN_RIGHT|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxChoice" name="Plugin"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Interframe blending :</label>
</object>
<flag>wxRIGHT|wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxChoice" name="IFB">
<content>
<item>None</item>
<item>Smart interframe blending</item>
<item>Interframe motion blur</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<label>Basic</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxStaticText">
<label>Frame Skip</label>
<font>
<weight>bold</weight>
</font>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxStaticText" name="FrameSkipLab">
<label>_Number of frames to skip :</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxSpinCtrl" name="FrameSkip">
<min>0</min>
<max>9</max>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<label>Speed</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<flag>wxEXPAND</flag>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Speed indicator :</label>
</object>
</object>
<object class="sizeritem">
<object class="wxChoice" name="SpeedIndicator">
<content>
<item>None</item>
<item>Percentage</item>
<item>Detailed</item>
</content>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
</object>
</object>
</object>
<label>On-Screen Display</label>
</object>
<object class="notebookpage">
<object class="wxPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Default magnification :</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="DefaultScale">
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Maximum magnification factor :</label>
<tooltip>0 = no maximum</tooltip>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxSpinCtrl" name="MaxScale">
<tooltip>0 = no limit</tooltip>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
<label>Zoom</label>
</object>
</object>
</object>
<object class="sizeritem">
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
</object>
</object>
</object>
</resource>

View File

@ -1,69 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="ExportSPS">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Title"/>
<flag>wxEXPAND|wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Description:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Description"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Notes:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Notes">
<style>wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxHSCROLL</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>200,100</minsize>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
<growablerows>2</growablerows>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="ExportSPS">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Title"/>
<flag>wxEXPAND|wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Description:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Description"/>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Notes:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxTextCtrl" name="Notes">
<style>wxTE_PROCESS_ENTER|wxTE_MULTILINE|wxHSCROLL</style>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
<minsize>200,100</minsize>
</object>
<cols>2</cols>
<growablecols>1</growablecols>
<growablerows>2</growablerows>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
<object class="button">
<object class="wxButton" name="wxID_CANCEL"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,170 +1,170 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBAROMInfo">
<title>Rom Information</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Game title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Title"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Internal title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="IntTitle"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Scene Release:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Scene"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Release Number:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Release"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CRC32:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="CRC32"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="GameCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Maker code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="MakerCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Maker name:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="MakerName"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Main unit code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="UnitCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Device type:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="DeviceType"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>ROM version:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Version"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CRC:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="CRC">
<label>ROM Information</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<cols>2</cols>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBAROMInfo">
<title>Rom Information</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Game title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Title"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Internal title:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="IntTitle"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Scene Release:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Scene"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Release Number:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Release"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CRC32:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="CRC32"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Game code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="GameCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Maker code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="MakerCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Maker name:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="MakerName"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Main unit code:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="UnitCode"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Device type:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="DeviceType"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>ROM version:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Version"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>CRC:</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="CRC">
<label>ROM Information</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<cols>2</cols>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStdDialogButtonSizer">
<object class="button">
<object class="wxButton" name="wxID_OK"/>
</object>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,105 +1,105 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxPanel" name="GBColorPrefPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxChoice" name="ColorSet">
<content>
<item/>
<item>Standard</item>
<item>Blue Sea</item>
<item>Dark Night</item>
<item>Green Forest</item>
<item>Hot Desert</item>
<item>Pink Dreams</item>
<item>Weird Colors</item>
<item>Real GB Colors</item>
<item>Real 'GB on GBASP' Colors</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color0"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color1"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color2"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color3"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Background</label>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color4"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color5"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color6"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color7"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Sprites</label>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxCheckBox" name="UsePalette" subclass="wxFarRadio">
<label>Use this palette</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="spacer">
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxButton" name="Reset">
<label>Restore</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxPanel" name="GBColorPrefPanel">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxChoice" name="ColorSet">
<content>
<item/>
<item>Standard</item>
<item>Blue Sea</item>
<item>Dark Night</item>
<item>Green Forest</item>
<item>Hot Desert</item>
<item>Pink Dreams</item>
<item>Weird Colors</item>
<item>Real GB Colors</item>
<item>Real 'GB on GBASP' Colors</item>
</content>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color0"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color1"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color2"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color3"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Background</label>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color4"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color5"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color6"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxColourPickerCtrl" name="Color7"/>
<flag>wxALL</flag>
<border>5</border>
</object>
<label>Sprites</label>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxCheckBox" name="UsePalette" subclass="wxFarRadio">
<label>Use this palette</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_VERTICAL</flag>
<border>5</border>
</object>
<object class="spacer">
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxButton" name="Reset">
<label>Restore</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>

View File

@ -1,251 +1,251 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBDisassemble">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxTextCtrl" name="GotoAddress">
<style>wxTE_PROCESS_ENTER</style>
</object>
<option>0</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Goto">
<label>_Go</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxPanel" name="Disassembly" subclass="DisList">
<font>
<family>modern</family>
</font>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>AF:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="AF">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>BC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="BC">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>DE:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="DE">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>HL:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="HL">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>SP:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="SP">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>PC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="PC">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>IFF:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="IFF">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>LY:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="LY">
<font>
<family>modern</family>
</font>
<label>00</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Z" subclass="DispCheckBox">
<label>Z</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="N" subclass="DispCheckBox">
<label>N</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="H" subclass="DispCheckBox">
<label>H</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="C" subclass="DispCheckBox">
<label>C</label>
</object>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>4</cols>
<object class="sizeritem">
<object class="wxButton" name="GotoPC">
<label>G_oto PC</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>Re_fresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Next">
<label>_Next</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBDisassemble">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxTextCtrl" name="GotoAddress">
<style>wxTE_PROCESS_ENTER</style>
</object>
<option>0</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Goto">
<label>_Go</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxPanel" name="Disassembly" subclass="DisList">
<font>
<family>modern</family>
</font>
</object>
<option>1</option>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>AF:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="AF">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>BC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="BC">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>DE:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="DE">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>HL:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="HL">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>SP:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="SP">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>PC:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="PC">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>IFF:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="IFF">
<font>
<family>modern</family>
</font>
<label>0000</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>LY:</label>
</object>
<flag>wxRIGHT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="LY">
<font>
<family>modern</family>
</font>
<label>00</label>
</object>
<flag>wxLEFT</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Z" subclass="DispCheckBox">
<label>Z</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="N" subclass="DispCheckBox">
<label>N</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="H" subclass="DispCheckBox">
<label>H</label>
</object>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="wxCheckBox" name="C" subclass="DispCheckBox">
<label>C</label>
</object>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<cols>4</cols>
<object class="sizeritem">
<object class="wxButton" name="GotoPC">
<label>G_oto PC</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>Re_fresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="Next">
<label>_Next</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL</flag>
<border>5</border>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>

View File

@ -1,172 +1,172 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBMapViewer">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="CharBase0">
<label>0x8000</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="CharBase1">
<label>0x8800</label>
</object>
</object>
<label>Char Base</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="MapBase0">
<label>0x9800</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="MapBase1">
<label>0x9C00</label>
</object>
</object>
<label>Map Base</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxLEFT|wxRIGHT|wxEXPAND</flag>
<border>5</border>
</object>
<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Stretch">
<label>Stretch to _fit</label>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Auto _update</label>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="spacer"/>
<object class="sizeritem">
<object class="wxStaticText" name="Coords"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Address:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Address"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Tile:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Tile"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Flip:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Flip"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Palette:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Palette"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Priority:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Priority"/>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxScrolledWindow">
<object class="wxPanel" name="GfxView" subclass="GfxPanel">
<size>128,128d</size>
<style>wxFULL_REPAINT_ON_RESIZE</style>
</object>
<size>128,128d</size>
<style>wxBORDER_SUNKEN|wxCLIP_CHILDREN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxPanel" name="Zoom" subclass="PixView">
<size>64,64d</size>
<style>wxBORDER_SUNKEN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="unknown" name="Color"/>
<flag>wxALL|wxALIGN_BOTTOM</flag>
<border>5</border>
</object>
<cols>3</cols>
<growablecols>1</growablecols>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>_Refresh</label>
</object>
</object>
<object class="sizeritem">
<object class="wxButton" name="Save">
<label>_Save</label>
</object>
<flag>wxALIGN_CENTRE_HORIZONTAL</flag>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALIGN_RIGHT</flag>
</object>
<cols>3</cols>
</object>
<flag>wxEXPAND|wxALL</flag>
<border>5</border>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBMapViewer">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="CharBase0">
<label>0x8000</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="CharBase1">
<label>0x8800</label>
</object>
</object>
<label>Char Base</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticBoxSizer">
<object class="sizeritem">
<object class="wxRadioButton" name="MapBase0">
<label>0x9800</label>
<style>wxRB_GROUP</style>
</object>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="MapBase1">
<label>0x9C00</label>
</object>
</object>
<label>Map Base</label>
<orient>wxVERTICAL</orient>
</object>
<flag>wxLEFT|wxRIGHT|wxEXPAND</flag>
<border>5</border>
</object>
<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Stretch">
<label>Stretch to _fit</label>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Auto _update</label>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<object class="spacer"/>
<object class="sizeritem">
<object class="wxStaticText" name="Coords"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Address:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Address"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Tile:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Tile"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Flip:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Flip"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Palette:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Palette"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Priority:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Priority"/>
</object>
<cols>2</cols>
</object>
<flag>wxALL|wxEXPAND</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxScrolledWindow">
<object class="wxPanel" name="GfxView" subclass="GfxPanel">
<size>128,128d</size>
<style>wxFULL_REPAINT_ON_RESIZE</style>
</object>
<size>128,128d</size>
<style>wxBORDER_SUNKEN|wxCLIP_CHILDREN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxPanel" name="Zoom" subclass="PixView">
<size>64,64d</size>
<style>wxBORDER_SUNKEN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="spacer"/>
<object class="sizeritem">
<object class="unknown" name="Color"/>
<flag>wxALL|wxALIGN_BOTTOM</flag>
<border>5</border>
</object>
<cols>3</cols>
<growablecols>1</growablecols>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>_Refresh</label>
</object>
</object>
<object class="sizeritem">
<object class="wxButton" name="Save">
<label>_Save</label>
</object>
<flag>wxALIGN_CENTRE_HORIZONTAL</flag>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALIGN_RIGHT</flag>
</object>
<cols>3</cols>
</object>
<flag>wxEXPAND|wxALL</flag>
<border>5</border>
</object>
</object>
</object>
</resource>

View File

@ -1,165 +1,165 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBOAMViewer">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Sprite:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxSpinCtrl" name="Sprite">
<min>0</min>
<max>39</max>
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<cols>2</cols>
<object class="sizeritem">
<object class="wxStaticText">
<label>Pos:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Pos"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Tile:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Tile"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Prio:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Priority"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>OAP:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="OAP"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Pal:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Palette"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Flags:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Flags"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Bank:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Bank"/>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Stretch">
<label>Stretch to _fit</label>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxScrolledWindow">
<object class="wxPanel" name="GfxView" subclass="GfxPanel">
<size>64,64d</size>
<style>wxFULL_REPAINT_ON_RESIZE</style>
</object>
<size>64,64d</size>
<style>wxBORDER_SUNKEN|wxCLIP_CHILDREN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxPanel" name="Zoom" subclass="PixView">
<size>64,64d</size>
<style>wxBORDER_SUNKEN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
</object>
<object class="sizeritem">
<object class="unknown" name="Color"/>
<flag>wxALL|wxALIGN_BOTTOM</flag>
<border>5</border>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>_Refresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_SAVE">
<label>_Save...</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL|wxALIGN_RIGHT</flag>
<border>5</border>
</object>
<cols>3</cols>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwidgets.org/wxxrc" version="2.5.3.0">
<object class="wxDialog" name="GBOAMViewer">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxStaticText">
<label>Sprite:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxSpinCtrl" name="Sprite">
<min>0</min>
<max>39</max>
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxFlexGridSizer">
<cols>2</cols>
<object class="sizeritem">
<object class="wxStaticText">
<label>Pos:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Pos"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Tile:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Tile"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Prio:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Priority"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>OAP:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="OAP"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Pal:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Palette"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Flags:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Flags"/>
</object>
<object class="sizeritem">
<object class="wxStaticText">
<label>Bank:</label>
</object>
</object>
<object class="sizeritem">
<object class="wxStaticText" name="Bank"/>
</object>
</object>
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="Stretch">
<label>Stretch to _fit</label>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckBox" name="AutoUpdate">
<label>Automatic _update</label>
</object>
</object>
<orient>wxVERTICAL</orient>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<object class="sizeritem">
<object class="wxScrolledWindow">
<object class="wxPanel" name="GfxView" subclass="GfxPanel">
<size>64,64d</size>
<style>wxFULL_REPAINT_ON_RESIZE</style>
</object>
<size>64,64d</size>
<style>wxBORDER_SUNKEN|wxCLIP_CHILDREN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxPanel" name="Zoom" subclass="PixView">
<size>64,64d</size>
<style>wxBORDER_SUNKEN</style>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<orient>wxHORIZONTAL</orient>
</object>
</object>
<object class="sizeritem">
<object class="unknown" name="Color"/>
<flag>wxALL|wxALIGN_BOTTOM</flag>
<border>5</border>
</object>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<object class="wxGridSizer">
<object class="sizeritem">
<object class="wxButton" name="Refresh">
<label>_Refresh</label>
</object>
<flag>wxALL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_SAVE">
<label>_Save...</label>
</object>
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CLOSE"/>
<flag>wxALL|wxALIGN_RIGHT</flag>
<border>5</border>
</object>
<cols>3</cols>
</object>
<flag>wxEXPAND</flag>
</object>
</object>
</object>
</resource>

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