delete more yahbooze files
This commit is contained in:
parent
c5f15da366
commit
89f7fb918c
|
@ -1,492 +0,0 @@
|
|||
project(yabause)
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFile)
|
||||
|
||||
set(yabause_SOURCES
|
||||
bios.c
|
||||
cdbase.c cheat.c coffelf.c cs0.c cs1.c cs2.c
|
||||
debug.c
|
||||
error.c
|
||||
m68kcore.c m68kd.c memory.c movie.c
|
||||
netlink.c
|
||||
osdcore.c
|
||||
peripheral.c profile.c
|
||||
scu.c sh2core.c sh2d.c sh2idle.c sh2int.c sh2trace.c smpc.c snddummy.c
|
||||
titan/titan.c
|
||||
vdp1.c vdp2.c vdp2debug.c vidogl.c vidshared.c vidsoft.c
|
||||
yabause.c ygl.c yglshader.c)
|
||||
|
||||
# new SCSP
|
||||
option(YAB_USE_SCSP2 "Use the new SCSP implementation.")
|
||||
if (YAB_USE_SCSP2)
|
||||
add_definitions(-DUSE_SCSP2=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} scsp2.c)
|
||||
else()
|
||||
set(yabause_SOURCES ${yabause_SOURCES} scsp.c)
|
||||
endif()
|
||||
|
||||
# disable strdup warning in MSVC
|
||||
if (MSVC)
|
||||
add_definitions(/wd4996)
|
||||
endif ()
|
||||
|
||||
# math library
|
||||
if (UNIX)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} "m")
|
||||
endif()
|
||||
|
||||
# Bigendian
|
||||
include(TestBigEndian)
|
||||
test_big_endian(WORDS_BIGENDIAN)
|
||||
if (WORDS_BIGENDIAN)
|
||||
add_definitions(-DWORDS_BIGENDIAN=1)
|
||||
endif (WORDS_BIGENDIAN)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
# variadic macros
|
||||
check_c_source_compiles("#define MACRO(...) puts(__VA_ARGS__)
|
||||
int main(int argc, char ** argv) { MACRO(\"foo\"); }"
|
||||
VARIADIC_MACROS_OK)
|
||||
if (VARIADIC_MACROS_OK)
|
||||
add_definitions(-DHAVE_C99_VARIADIC_MACROS=1)
|
||||
endif (VARIADIC_MACROS_OK)
|
||||
|
||||
# gettimeofday
|
||||
check_function_exists(gettimeofday GETTIMEOFDAY_OK)
|
||||
if (GETTIMEOFDAY_OK)
|
||||
add_definitions(-DHAVE_GETTIMEOFDAY=1)
|
||||
endif ()
|
||||
|
||||
# floorf
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} "-lm")
|
||||
check_function_exists(floorf FLOORF_OK)
|
||||
if (FLOORF_OK)
|
||||
add_definitions(-DHAVE_FLOORF=1)
|
||||
endif ()
|
||||
|
||||
# sys/time.h
|
||||
check_include_file("sys/time.h" SYSTIME_OK)
|
||||
if (SYSTIME_OK)
|
||||
add_definitions(-DHAVE_SYS_TIME_H=1)
|
||||
endif()
|
||||
|
||||
# Find stdint.h
|
||||
check_include_file("stdint.h" STDINT_H_FOUND)
|
||||
if (STDINT_H_FOUND)
|
||||
add_definitions(-DHAVE_STDINT_H=1)
|
||||
endif()
|
||||
|
||||
# OpenGL
|
||||
option(YAB_WANT_OPENGL "use OpenGL for video output (most ports require it)" ON)
|
||||
if (YAB_WANT_OPENGL)
|
||||
include(FindOpenGL)
|
||||
if (OPENGL_FOUND)
|
||||
add_definitions(-DHAVE_LIBGL=1)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${OPENGL_LIBRARIES})
|
||||
|
||||
include(FindGLUT)
|
||||
if (GLUT_FOUND)
|
||||
include_directories(${GLUT_INCLUDE_DIR})
|
||||
add_definitions(-DHAVE_LIBGLUT=1)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${GLUT_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# glXGetProcAddress
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OPENGL_LIBRARIES})
|
||||
check_function_exists(glXGetProcAddress GLXGETPROCADDRESS_OK)
|
||||
if (GLXGETPROCADDRESS_OK)
|
||||
add_definitions(-DHAVE_GLXGETPROCADDRESS=1)
|
||||
endif()
|
||||
endif(OPENGL_FOUND)
|
||||
endif (YAB_WANT_OPENGL)
|
||||
|
||||
# SDL
|
||||
option(YAB_WANT_SDL "use SDL cores if available" ON)
|
||||
if (YAB_WANT_SDL)
|
||||
include(FindSDL)
|
||||
if (SDL_FOUND)
|
||||
add_definitions(-DHAVE_LIBSDL=1)
|
||||
include_directories(${SDL_INCLUDE_DIR})
|
||||
set(yabause_SOURCES ${yabause_SOURCES} persdljoy.c sndsdl.c)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${SDL_LIBRARY})
|
||||
endif (SDL_FOUND)
|
||||
endif (YAB_WANT_SDL)
|
||||
|
||||
# OpenAL
|
||||
option(YAB_WANT_OPENAL "use OpenAL sound core if available" ON)
|
||||
if (YAB_WANT_OPENAL)
|
||||
include(FindOpenAL)
|
||||
if (OPENAL_FOUND)
|
||||
find_package(Threads)
|
||||
add_definitions(-DHAVE_LIBAL=1)
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
set(yabause_SOURCES ${yabause_SOURCES} sndal.c)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${OPENAL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif (OPENAL_FOUND)
|
||||
endif (YAB_WANT_OPENAL)
|
||||
|
||||
# mini18n
|
||||
find_path(MINI18N_INCLUDE_DIR mini18n.h)
|
||||
find_library(MINI18N_LIBRARY mini18n)
|
||||
if (NOT MINI18N_INCLUDE_DIR STREQUAL "MINI18N_INCLUDE_DIR-NOTFOUND" AND NOT MINI18N_LIBRARY STREQUAL "MINI18N_LIBRARY-NOTFOUND")
|
||||
set(MINI18N_FOUND TRUE)
|
||||
include_directories(${MINI18N_INCLUDE_DIR})
|
||||
add_definitions(-DHAVE_LIBMINI18N=1)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${MINI18N_LIBRARY})
|
||||
endif (NOT MINI18N_INCLUDE_DIR STREQUAL "MINI18N_INCLUDE_DIR-NOTFOUND" AND NOT MINI18N_LIBRARY STREQUAL "MINI18N_LIBRARY-NOTFOUND")
|
||||
|
||||
if (MINI18N_FOUND)
|
||||
if (UNIX)
|
||||
add_definitions(-DYTSDIR=\"${CMAKE_INSTALL_PREFIX}/share/${YAB_PACKAGE}/yts\")
|
||||
elseif (WIN32)
|
||||
add_definitions(-DYTSDIR=\"trans\")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# APPLE // not necessary mac os x, but i don't care ;)
|
||||
if (APPLE)
|
||||
FIND_LIBRARY(COREFOUNDATION_LIBRARY NAMES CoreFoundation )
|
||||
FIND_LIBRARY(IOKIT_LIBRARY NAMES IOKit )
|
||||
set(yabause_SOURCES ${yabause_SOURCES} macjoy.c permacjoy.c cd-macosx.c sndmac.c)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${COREFOUNDATION_LIBRARY} ${IOKIT_LIBRARY})
|
||||
|
||||
check_function_exists(glBindRenderbuffer HAVE_FBO)
|
||||
if (HAVE_FBO)
|
||||
add_definitions(-DHAVE_FBO=1)
|
||||
endif()
|
||||
endif (APPLE)
|
||||
|
||||
# Visual Studio
|
||||
if (MSVC)
|
||||
# Find DDK
|
||||
if (EXISTS "$ENV{SYSTEMDRIVE}/WINDDK/3790.1830/")
|
||||
set(DDK_DIR "$ENV{SYSTEMDRIVE}/WINDDK/3790.1830/")
|
||||
elseif (EXISTS "$ENV{SYSTEMDRIVE}/WINDDK/6000/")
|
||||
set(DDK_DIR "$ENV{SYSTEMDRIVE}/WINDDK/6000/")
|
||||
elseif (EXISTS "$ENV{SYSTEMDRIVE}/WINDDK/7600.16385.0/")
|
||||
set(DDK_DIR "$ENV{SYSTEMDRIVE}/WINDDK/7600.16385.0/")
|
||||
endif (EXISTS "$ENV{SYSTEMDRIVE}/WINDDK/3790.1830/")
|
||||
|
||||
add_definitions(-DHAVE_C99_VARIADIC_MACROS -D_CRT_SECURE_NO_WARNINGS -DC68K_NO_JUMP_TABLE
|
||||
-D_UNICODE -DUNICODE)
|
||||
endif (MSVC)
|
||||
|
||||
# Windows ddk
|
||||
if (WIN32)
|
||||
option(YAB_WANT_DDK "Use the real DDK instead of the built-in one")
|
||||
if(YAB_WANT_DDK)
|
||||
# Find ntddcdrm.h
|
||||
find_path(ntddcdrm_INCLUDE_DIR ntddcdrm.h
|
||||
PATHS "${DDK_DIR}" "${DDK_DIR}/inc" PATH_SUFFIXES ddk api)
|
||||
|
||||
if (ntddcdrm_INCLUDE_DIR)
|
||||
include_directories(${ntddcdrm_INCLUDE_DIR})
|
||||
message(STATUS "Found ntddcdrm.h: ${ntddcdrm_INCLUDE_DIR}")
|
||||
add_definitions(-DHAVE_NTDDCDRM=1)
|
||||
else (ntddcdrm_INCLUDE_DIR)
|
||||
message(STATUS "Could not find ntddcdrm.h")
|
||||
endif (ntddcdrm_INCLUDE_DIR)
|
||||
endif(YAB_WANT_DDK)
|
||||
|
||||
set(yabause_SOURCES ${yabause_SOURCES} cd-windows.c)
|
||||
|
||||
option(YAB_WANT_DIRECTSOUND "use DirectX sound core if available")
|
||||
option(YAB_WANT_DIRECTINPUT "use DirectX input core if available")
|
||||
|
||||
if (YAB_WANT_DIRECTSOUND OR YAB_WANT_DIRECTINPUT)
|
||||
find_path(DirectX_INCLUDE_DIR dxerr9.h "$ENV{DXSDK_DIR}/Include")
|
||||
if (NOT DirectX_INCLUDE_DIR)
|
||||
find_path(DirectX_INCLUDE_DIR "dxerr.h" "$ENV{DXSDK_DIR}/Include")
|
||||
if (DirectX_INCLUDE_DIR)
|
||||
set(DXERRH_IS_BROKEN 1 CACHE INTERNAL "dxerr is broken")
|
||||
endif (DirectX_INCLUDE_DIR)
|
||||
endif(NOT DirectX_INCLUDE_DIR)
|
||||
|
||||
find_library(DirectX_GUID_LIBRARY dxguid "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
if (YAB_WANT_DIRECTINPUT)
|
||||
find_library(DirectX_INPUT8_LIBRARY dinput8 "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
endif(YAB_WANT_DIRECTINPUT)
|
||||
if (YAB_WANT_DIRECTSOUND)
|
||||
find_library(DirectX_SOUND_LIBRARY dsound "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
endif(YAB_WANT_DIRECTSOUND)
|
||||
|
||||
if (DXERRH_IS_BROKEN)
|
||||
find_library(DirectX_ERR_LIBRARY dxerr "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
elseif(MINGW)
|
||||
find_library(DirectX_ERR_LIBRARY dxerr8 "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
else()
|
||||
find_library(DirectX_ERR_LIBRARY dxerr9 "$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib")
|
||||
endif()
|
||||
|
||||
if (DirectX_INCLUDE_DIR AND DirectX_GUID_LIBRARY AND DirectX_ERR_LIBRARY)
|
||||
set(DIRECTX_FOUND "found")
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${DirectX_GUID_LIBRARY} ${DirectX_ERR_LIBRARY})
|
||||
|
||||
if (DirectX_SOUND_LIBRARY AND DirectX_INPUT8_LIBRARY)
|
||||
add_definitions(-DHAVE_DIRECTINPUT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} snddx.c)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${DirectX_INPUT8_LIBRARY})
|
||||
endif (DirectX_SOUND_LIBRARY AND DirectX_INPUT8_LIBRARY)
|
||||
if (YAB_WANT_DIRECTSOUND AND DirectX_SOUND_LIBRARY)
|
||||
add_definitions(-DHAVE_DIRECTSOUND)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} perdx.c)
|
||||
set(YABAUSE_LIBRARIES ${YABAUSE_LIBRARIES} ${DirectX_SOUND_LIBRARY})
|
||||
endif (YAB_WANT_DIRECTSOUND AND DirectX_SOUND_LIBRARY)
|
||||
|
||||
if (DXERRH_IS_BROKEN)
|
||||
add_definitions(-DDXERRH_IS_BROKEN)
|
||||
message(STATUS "Using work-around for dxerr.h")
|
||||
endif(DXERRH_IS_BROKEN)
|
||||
endif (DirectX_INCLUDE_DIR AND DirectX_GUID_LIBRARY AND DirectX_ERR_LIBRARY)
|
||||
endif (YAB_WANT_DIRECTSOUND OR YAB_WANT_DIRECTINPUT)
|
||||
endif (WIN32)
|
||||
|
||||
if (WII)
|
||||
set(CMAKE_C_FLAGS "-mrvl -mcpu=750 -meabi -mhard-float")
|
||||
add_definitions(-DGEKKO=1)
|
||||
# that shouldn't be hardcoded, either use an ENV variable or try to detect it...
|
||||
include_directories(/opt/devkitpro/libogc/include/)
|
||||
endif()
|
||||
|
||||
option(YAB_WANT_ARM7 "Build a binary with arm7 support")
|
||||
|
||||
# SH2 dynamic recompiler
|
||||
message(STATUS "CMAKE_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}")
|
||||
message(STATUS "CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
option(SH2_DYNAREC "SH2 dynamic recompiler" ON)
|
||||
if (SH2_DYNAREC)
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||
enable_language(ASM-ATT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_x86.s)
|
||||
set_source_files_properties(sh2_dynarec/sh2_dynarec.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
add_definitions(-DSH2_DYNAREC=1)
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
enable_language(ASM-ATT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_x64.s)
|
||||
set_source_files_properties(sh2_dynarec/sh2_dynarec.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
add_definitions(-DSH2_DYNAREC=1)
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv5tel")
|
||||
enable_language(ASM-ATT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_arm.s)
|
||||
set_source_files_properties(sh2_dynarec/sh2_dynarec.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
add_definitions(-DSH2_DYNAREC=1)
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv5tel")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
|
||||
enable_language(ASM-ATT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_arm.s)
|
||||
set_source_files_properties(sh2_dynarec/sh2_dynarec.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
add_definitions(-DSH2_DYNAREC=1 -DHAVE_ARMv6=1 -DHAVE_ARMv7=1)
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
|
||||
if (ANDROID)
|
||||
enable_language(ASM-ATT)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_arm.s)
|
||||
set_source_files_properties(sh2_dynarec/sh2_dynarec.c PROPERTIES COMPILE_FLAGS "-Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
|
||||
add_definitions(-DSH2_DYNAREC=1)
|
||||
add_definitions(-DANDROID=1)
|
||||
if (YAB_WANT_ARM7)
|
||||
add_definitions(-DHAVE_ARMv6=1 -DHAVE_ARMv7=1)
|
||||
endif()
|
||||
endif ()
|
||||
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
endif (SH2_DYNAREC)
|
||||
|
||||
# c68k
|
||||
option(YAB_WANT_C68K "enable c68k compilation" ON)
|
||||
if (YAB_WANT_C68K)
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(c68kinc
|
||||
DOWNLOAD_COMMAND ""
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/c68k
|
||||
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
||||
INSTALL_COMMAND ""
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/c68k
|
||||
)
|
||||
|
||||
add_definitions(-DHAVE_C68K=1)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/c68k)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} c68k/c68kexec.c c68k/c68k.c c68k/gen68k.c m68kc68k.c)
|
||||
if (MSVC)
|
||||
set_source_files_properties(c68k/c68kexec.c PROPERTIES COMPILE_FLAGS "/Od /wd4146")
|
||||
else()
|
||||
set_source_files_properties(c68k/c68kexec.c PROPERTIES COMPILE_FLAGS "-O0")
|
||||
endif()
|
||||
endif(YAB_WANT_C68K)
|
||||
|
||||
# q68
|
||||
option(YAB_WANT_Q68 "enable q68 compilation" OFF)
|
||||
if (YAB_WANT_Q68)
|
||||
add_definitions(-DHAVE_Q68=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES}
|
||||
m68kq68.c q68/q68.c q68/q68-core.c q68/q68-disasm.c
|
||||
q68/q68-const.h q68/q68.h q68/q68-internal.h q68/q68-jit.h q68/q68-jit-psp.h q68/q68-jit-x86.h)
|
||||
endif()
|
||||
|
||||
# *DEBUG
|
||||
set(YAB_DEBUG "" CACHE STRING "List of enabled debug information")
|
||||
foreach(DEBUG IN LISTS YAB_DEBUG)
|
||||
if (${DEBUG} STREQUAL "main")
|
||||
add_definitions(-DDEBUG=1)
|
||||
elseif (${DEBUG} STREQUAL "cd")
|
||||
add_definitions(-DCDDEBUG=1)
|
||||
elseif (${DEBUG} STREQUAL "idle")
|
||||
add_definitions(-DIDLE_DETECT_VERBOSE=1)
|
||||
else (${DEBUG} STREQUAL "main")
|
||||
string(TOUPPER ${DEBUG} UPDEBUG)
|
||||
add_definitions(-D${UPDEBUG}_DEBUG=1)
|
||||
endif (${DEBUG} STREQUAL "main")
|
||||
endforeach(DEBUG)
|
||||
|
||||
# Network
|
||||
option(YAB_NETWORK "Enable network")
|
||||
if (YAB_NETWORK)
|
||||
add_definitions(-DUSESOCKET=1)
|
||||
endif()
|
||||
|
||||
# Peripheral key name
|
||||
option(YAB_PERKEYNAME "Try to display key names instead of cryptic values" OFF)
|
||||
if (YAB_PERKEYNAME)
|
||||
add_definitions(-DPERKEYNAME=1)
|
||||
endif()
|
||||
|
||||
option(YAB_PORT_OSD "Let ports provides their own OSD core list" OFF)
|
||||
if (YAB_PORT_OSD)
|
||||
add_definitions(-DYAB_PORT_OSD=1)
|
||||
endif()
|
||||
|
||||
# Exec from cache
|
||||
option(YAB_EXEC_FROM_CACHE "Allow code execution from 0xC0000000" OFF)
|
||||
if (YAB_EXEC_FROM_CACHE)
|
||||
add_definitions(-DEXEC_FROM_CACHE=1)
|
||||
endif()
|
||||
|
||||
# Optimized DMA
|
||||
option(YAB_OPTIMIZED_DMA "Use optimized DMA when possible" OFF)
|
||||
if (YAB_OPTIMIZED_DMA)
|
||||
add_definitions(-DOPTIMIZED_DMA=1)
|
||||
endif()
|
||||
|
||||
# Yabause Arch
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
add_definitions(-DARCH_IS_MACOSX=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
add_definitions(-DARCH_IS_FREEBSD=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c cd-freebsd.c)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(-DARCH_IS_LINUX=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-linux.c cd-linux.c)
|
||||
|
||||
check_include_file("linux/joystick.h" LINUX_HAS_JOYSTICK)
|
||||
if (LINUX_HAS_JOYSTICK)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} perlinuxjoy.c)
|
||||
endif()
|
||||
|
||||
check_c_source_compiles("
|
||||
#include <linux/cdrom.h>
|
||||
int main(int argc, char ** argv) { int i = CDSL_CURRENT; }
|
||||
" LINUX_CDROM_H_OK)
|
||||
if (NOT LINUX_CDROM_H_OK)
|
||||
add_definitions(-DLINUX_CDROM_H_IS_BROKEN)
|
||||
endif (NOT LINUX_CDROM_H_OK)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
|
||||
add_definitions(-DARCH_IS_NETBSD=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c cd-netbsd.c)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
|
||||
add_definitions(-DARCH_IS_NETBSD=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c cd-netbsd.c)
|
||||
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
|
||||
add_definitions(-DARCH_IS_WINDOWS=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c)
|
||||
else ()
|
||||
add_definitions(-DUNKNOWN_ARCH=1)
|
||||
set(yabause_SOURCES ${yabause_SOURCES} thr-dummy.c)
|
||||
endif ()
|
||||
|
||||
set(YAB_OPTIMIZATION "-O3" CACHE STRING "Override optimization level")
|
||||
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION} -march=i686 -msse")
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION}")
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv5tel")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION}")
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv5tel")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION}")
|
||||
endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
|
||||
if(ANDROID)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${YAB_OPTIMIZATION}")
|
||||
endif()
|
||||
|
||||
# Warnings defined to know when we're breaking compilation with MSVC
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdeclaration-after-statement")
|
||||
endif ()
|
||||
|
||||
if (MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4018 /wd4244")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244")
|
||||
endif ()
|
||||
|
||||
add_definitions(-DPACKAGE=\"${YAB_PACKAGE}\")
|
||||
add_definitions(-DVERSION=\"${YAB_VERSION}\")
|
||||
|
||||
add_library(yabause ${yabause_SOURCES})
|
||||
|
||||
if (YAB_WANT_C68K)
|
||||
add_dependencies(yabause c68kinc)
|
||||
endif(YAB_WANT_C68K)
|
||||
|
||||
macro(yab_port_start)
|
||||
if (YAB_PORT_BUILT AND NOT YAB_MULTIBUILD)
|
||||
return()
|
||||
endif ()
|
||||
endmacro(yab_port_start)
|
||||
|
||||
macro(yab_port_stop)
|
||||
set(YAB_PORT_BUILT TRUE PARENT_SCOPE)
|
||||
endmacro(yab_port_stop)
|
||||
|
||||
macro(yab_port_success YAB_TARGET)
|
||||
if (NOT YAB_MULTIBUILD)
|
||||
set_target_properties(${YAB_TARGET} PROPERTIES OUTPUT_NAME yabause)
|
||||
set(YAB_PORT_NAME "yabause")
|
||||
else ()
|
||||
set(YAB_PORT_NAME ${YAB_TARGET})
|
||||
endif ()
|
||||
set(YAB_PORT_BUILT TRUE PARENT_SCOPE)
|
||||
endmacro(yab_port_success)
|
||||
|
||||
set(YAB_MAN_DIR "share/man")
|
||||
if (NOT $ENV{PKGMANDIR} STREQUAL "")
|
||||
set(YAB_MAN_DIR $ENV{PKGMANDIR})
|
||||
endif ()
|
||||
|
||||
option(YAB_MULTIBUILD "Choose wether to build all ports or only a single one")
|
||||
set(YAB_PORT_BUILT FALSE)
|
||||
set(YAB_PORTS "gtk;qt;windows;dreamcast;wii;carbon;cocoa" CACHE STRING "List of ports to build")
|
||||
foreach(PORT IN LISTS YAB_PORTS)
|
||||
add_subdirectory(${PORT})
|
||||
endforeach(PORT)
|
||||
|
||||
# this is stupid, but CMake automatic definitions are based on variables...
|
||||
if (YAB_WANT_C68K)
|
||||
set(HAVE_C68K ON)
|
||||
endif()
|
||||
if (YAB_WANT_Q68)
|
||||
set(HAVE_Q68 ON)
|
||||
endif()
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
|
@ -1,117 +0,0 @@
|
|||
EXTRA_DIST = Makefile.dc Makefile.mng logo.bmp logo.png Makefile.wii logo.svg
|
||||
|
||||
if COMPILE_C68K
|
||||
SUBDIRS = c68k . $(YUI_SUBDIR)
|
||||
else
|
||||
SUBDIRS = . $(YUI_SUBDIR)
|
||||
endif
|
||||
if YUI_IS_CARBON
|
||||
YUI_SUBDIR=carbon
|
||||
endif
|
||||
if YUI_IS_DREAMCAST
|
||||
YUI_SUBDIR=dreamcast
|
||||
endif
|
||||
if YUI_IS_GTK
|
||||
YUI_SUBDIR=gtk
|
||||
endif
|
||||
if YUI_IS_PSP
|
||||
YUI_SUBDIR=psp
|
||||
endif
|
||||
if YUI_IS_QT
|
||||
YUI_SUBDIR=qt
|
||||
endif
|
||||
if YUI_IS_WII
|
||||
YUI_SUBDIR=wii
|
||||
endif
|
||||
if YUI_IS_WINDOWS
|
||||
YUI_SUBDIR=windows
|
||||
endif
|
||||
|
||||
noinst_LIBRARIES = libyabause.a
|
||||
libyabause_a_SOURCES = \
|
||||
bios.c bios.h cdbase.c cdbase.h cheat.c cheat.h coffelf.c coffelf.h \
|
||||
core.h cs0.c cs0.h cs1.c cs1.h cs2.c cs2.h \
|
||||
debug.c debug.h error.c error.h memory.c memory.h \
|
||||
m68kcore.c m68kcore.h m68kd.c m68kd.h movie.c movie.h \
|
||||
netlink.c netlink.h \
|
||||
osdcore.c osdcore.h \
|
||||
peripheral.h peripheral.c \
|
||||
persdljoy.c persdljoy.h profile.c profile.h \
|
||||
scu.c scu.h sh2core.c sh2core.h sh2d.c sh2d.h \
|
||||
sh2idle.c sh2idle.h sh2int.c sh2int.h sh2trace.c sh2trace.h \
|
||||
smpc.c smpc.h sndal.c sndal.h snddummy.c sndsdl.c sndsdl.h sndwav.c \
|
||||
threads.h titan/titan.c titan/titan.h vdp1.c vdp1.h vdp2.c vdp2.h \
|
||||
vdp2debug.c vdp2debug.h vidogl.c vidogl.h vidshared.c vidshared.h \
|
||||
vidsoft.c vidsoft.h yabause.c yabause.h ygl.h ygl.c yglshader.c yui.h
|
||||
|
||||
if USE_SCSP2
|
||||
libyabause_a_SOURCES += scsp2.c scsp2.h
|
||||
else
|
||||
libyabause_a_SOURCES += scsp.c scsp.h
|
||||
endif
|
||||
|
||||
if COMPILE_C68K
|
||||
libyabause_a_SOURCES += c68k/c68kexec.c c68k/c68k.c c68k/gen68k.c m68kc68k.c m68kc68k.h
|
||||
c68kexec.o: c68k/c68kexec.c
|
||||
$(COMPILE) -Ic68k -O0 $(srcdir)/c68k/c68kexec.c -c -o c68kexec.o
|
||||
endif
|
||||
|
||||
if COMPILE_Q68
|
||||
libyabause_a_SOURCES += m68kq68.c q68/q68.c q68/q68-core.c q68/q68-disasm.c \
|
||||
q68/q68-const.h q68/q68.h q68/q68-internal.h q68/q68-jit.h q68/q68-jit-psp.h q68/q68-jit-x86.h
|
||||
if Q68_USE_JIT
|
||||
libyabause_a_SOURCES += q68/q68-jit.c
|
||||
if CPU_IS_X86
|
||||
libyabause_a_SOURCES += q68/q68-jit-x86.S
|
||||
endif
|
||||
if CPU_IS_X64
|
||||
libyabause_a_SOURCES += q68/q68-jit-x86.S
|
||||
endif
|
||||
if CPU_IS_PSP
|
||||
libyabause_a_SOURCES += q68/q68-jit-psp.S
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if ARCH_IS_FREEBSD
|
||||
libyabause_a_SOURCES += cd-freebsd.c thr-dummy.c
|
||||
endif
|
||||
if ARCH_IS_LINUX
|
||||
libyabause_a_SOURCES += cd-linux.c perlinuxjoy.c perlinuxjoy.h thr-linux.c
|
||||
if USE_DYNAREC
|
||||
if CPU_IS_X64
|
||||
libyabause_a_SOURCES += sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_x64.s
|
||||
AM_CFLAGS = -DSH2_DYNAREC=1
|
||||
endif
|
||||
if CPU_IS_X86
|
||||
libyabause_a_SOURCES += sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_x86.s
|
||||
AM_CFLAGS = -DSH2_DYNAREC=1
|
||||
endif
|
||||
if CPU_IS_ARM
|
||||
libyabause_a_SOURCES += sh2_dynarec/sh2_dynarec.c sh2_dynarec/linkage_arm.s
|
||||
AM_CFLAGS = -DSH2_DYNAREC=1 -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=softfp
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if ARCH_IS_MACOSX
|
||||
libyabause_a_SOURCES += cd-macosx.c macjoy.c macjoy.h permacjoy.c permacjoy.h thr-dummy.c
|
||||
endif
|
||||
if ARCH_IS_NETBSD
|
||||
libyabause_a_SOURCES += cd-netbsd.c thr-dummy.c
|
||||
endif
|
||||
if ARCH_IS_WINDOWS
|
||||
libyabause_a_SOURCES += cd-windows.c thr-dummy.c
|
||||
endif
|
||||
if YUI_IS_DREAMCAST
|
||||
libyabause_a_SOURCES += thr-dummy.c
|
||||
endif
|
||||
if YUI_IS_WII
|
||||
libyabause_a_SOURCES += thr-dummy.c
|
||||
endif
|
||||
|
||||
if TEST_PSP_SH2
|
||||
libyabause_a_SOURCES += psp/psp-sh2.c psp/rtl.c psp/rtlexec.c psp/rtlinsn.c \
|
||||
psp/rtlopt.c psp/rtlunit.c psp/satopt-sh2.c psp/sh2.c \
|
||||
psp/sh2-interpret.c psp/sh2-opcodeinfo.c \
|
||||
psp/sh2-optimize.c
|
||||
endif
|
|
@ -1,67 +0,0 @@
|
|||
# Makefile.dc
|
||||
# Dreamcast Makefile
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Lawrence Sebald
|
||||
# Based on KOS makefiles (C) by Dan Potter
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
all: yabause.bin
|
||||
|
||||
include $(KOS_BASE)/Makefile.rules
|
||||
|
||||
KOS_CFLAGS += -I. -DDEBUG -DNO_CLI -DVERSION="0.9.11"
|
||||
KOS_ASFLAGS += -g
|
||||
|
||||
OBJS = bios.o cdbase.o cheat.o cs0.o cs1.o cs2.o debug.o error.o m68kd.o \
|
||||
memory.o netlink.o peripheral.o profile.o scsp.o scu.o sh2core.o sh2idle.o \
|
||||
sh2int.o sh2d.o smpc.o vdp1.o vdp2.o yabause.o m68kcore.o coffelf.o \
|
||||
m68kc68k.o movie.o snddummy.o
|
||||
C68K_OBJS = c68k/c68k.o c68k/c68kexec.o c68k/gen68k.o
|
||||
ARCH_OBJS = dreamcast/yui.o dreamcast/perdc.o dreamcast/viddc.o \
|
||||
dreamcast/localtime.o dreamcast/cd.o dreamcast/sh2rec/sh2rec.o \
|
||||
dreamcast/sh2rec/sh2rec_htab.o dreamcast/sh2rec/sh2exec.o \
|
||||
dreamcast/sh2rec/sh2rec_mem.o
|
||||
|
||||
c68k/c68kexec.o: c68k/gen68k
|
||||
|
||||
c68k/gen68k: c68k/c68kexec.c c68k/c68k.c c68k/gen68k.c
|
||||
$(CC) $(CFLAGS) -DC68K_GEN -o $@ $^
|
||||
cd c68k && ./gen68k
|
||||
|
||||
yabause.elf: $(OBJS) $(ARCH_OBJS) $(C68K_OBJS)
|
||||
kos-cc -o $@ $^ -lm
|
||||
|
||||
yabause.bin: yabause.elf
|
||||
$(KOS_OBJCOPY) -R .stack -O binary yabause.elf yabause.bin
|
||||
|
||||
cdtest.elf: dreamcast/cd.o tools/cdtest.o
|
||||
kos-cc -o $@ $^
|
||||
|
||||
cdtest.bin: cdtest.elf
|
||||
$(KOS_OBJCOPY) -R .stack -O binary cdtest.elf cdtest.bin
|
||||
|
||||
run: yabause.bin
|
||||
$(KOS_LOADER) yabause.bin
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS) $(ARCH_OBJS)
|
||||
rm -f tools/cdtest.o
|
||||
rm -f yabause.elf
|
||||
rm -f cdtest.elf
|
||||
rm -f cdtest.bin
|
||||
|
||||
distclean: clean
|
||||
rm -f yabause.bin
|
|
@ -1,86 +0,0 @@
|
|||
# Makefile.mng
|
||||
# Mingw makefile
|
||||
# Copyright (C) 2002, 2003, 2004 Lawrence Sebald
|
||||
# Copyright (C) 2004-2007 Theo Berkau
|
||||
# Based on KOS makefiles (C) by Dan Potter
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
TARGET = yabause.exe
|
||||
CC = gcc
|
||||
RC = windres
|
||||
#DDEFINES=-DDEBUG
|
||||
VERSION=0.9.10
|
||||
DDEFINES=
|
||||
VDEFINES=-DPACKAGE=\"yabause-win\" -DVERSION=\"$(VERSION)\" -DHAVE_LIBGLUT -DHAVE_LIBGL \
|
||||
-D_WIN32_IE=0x0500 -D_UNICODE -DUNICODE -DHAVE_LIBMINI18N
|
||||
CFLAGS=$(VDEFINES) $(DDEFINES) -O3 -fomit-frame-pointer -fno-strict-aliasing -Wall
|
||||
#CFLAGS=$(VDEFINES) $(DDEFINES) -O3 -fno-strict-aliasing -Wall -g
|
||||
CFLAGS2= -fomit-frame-pointer -fno-strict-aliasing -Wall
|
||||
#CFLAGS2= -fno-strict-aliasing -Wall -g
|
||||
LDFLAGS=-lmingw32 -lopengl32 -lglut32 -lkernel32 -lgdi32 -lcomctl32 -lcomdlg32 -lwinmm \
|
||||
-lws2_32 -ldxguid -ldinput8 -ldxerr8 -ldsound -lmini18n -lvfw32 -mwindows -mthreads
|
||||
OBJS = bios.o cdbase.o cheat.o coffelf.o cs0.o cs1.o cs2.o debug.o error.o m68kcore.o \
|
||||
m68kc68k.o m68kd.o memory.o movie.o netlink.o peripheral.o profile.o scsp.o scu.o sh2core.o \
|
||||
sh2idle.o sh2int.o sh2d.o smpc.o vdp1.o vdp2.o vdp2debug.o vidogl.o vidshared.o \
|
||||
vidsoft.o yabause.o ygl.o cd-windows.o c68k/c68k.o c68k/c68kexec.o c68k/gen68k.o \
|
||||
windows/perdx.o windows/snddx.o windows/yui.o windows/cheats.o windows/resource.o \
|
||||
windows/custctl.o windows/disasm.o windows/hexedit.o windows/cpudebug/yuidebug.o \
|
||||
windows/cpudebug/debug-68k.o windows/cpudebug/debug-scsp.o windows/cpudebug/debug-scu.o \
|
||||
windows/cpudebug/debug-sh2.o windows/cpudebug/debug-smpc.o windows/cpudebug/debug-vdp1.o \
|
||||
windows/cpudebug/debug-vdp2.o windows/settings/settings.o windows/settings/settings-basic.o \
|
||||
windows/settings/settings-input.o windows/settings/settings-log.o windows/settings/settings-netlink.o \
|
||||
windows/settings/settings-sound.o windows/settings/settings-video.o windows\bup-manager.o windows\aviout.o windows\ramwatch.o
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
windows/resource.o: windows/resource.rc windows/resource.h
|
||||
cd windows && $(RC) $(VDEFINES) $(DDEFINES) resource.rc -o resource.o
|
||||
cd ..
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
rm -f $(TARGET)
|
||||
|
||||
installer:
|
||||
makensis "/XOutFile ..\..\yabause-$(VERSION)-win.exe" windows\installer\installer.nsi
|
||||
|
||||
release:
|
||||
zip -9 yabause-$(VERSION)-win.zip * -i *.dll -i yabause.exe
|
||||
cd .. && zip -9 src\yabause-$(VERSION)-win.zip * -i AUTHORS -i Changelog -i COPYING -i README -i README.WIN
|
||||
|
||||
cdbase.o: cdbase.h
|
||||
cs0.o: cs0.h core.h
|
||||
cs1.o: cs1.h core.h
|
||||
debug.o: debug.h
|
||||
memory.o: debug.h memory.h
|
||||
scu.o: scu.h debug.h core.h
|
||||
sh2core.o: sh2core.h core.h
|
||||
sh2int.o: sh2core.h sh2int.h core.h
|
||||
vdp1.o: vdp1.h debug.h memory.h
|
||||
c68k/c68k.o: c68k/c68k.h
|
||||
c68k/c68kexec.o: c68k/c68k.h c68k/c68k_ini.inc
|
||||
$(CC) $(CFLAGS2) -c c68k/c68kexec.c -o $@
|
||||
c68k/c68k_ini.inc: c68k/gen68k.exe
|
||||
c68k/gen68k.exe: c68k/c68kexec.c c68k/c68k.c c68k/gen68k.c
|
||||
$(CC) $(CFLAGS) -DC68K_GEN -o $@ $^
|
||||
cd c68k && gen68k
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
# Makefile.wii
|
||||
# Wii makefile
|
||||
# Copyright (C) 2002, 2003, 2004 Lawrence Sebald
|
||||
# Copyright (C) 2004-2008 Theo Berkau
|
||||
# Based on KOS makefiles (C) by Dan Potter
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
|
||||
endif
|
||||
|
||||
include $(DEVKITPPC)/wii_rules
|
||||
|
||||
TARGET = yabause.elf
|
||||
DDEFINES=
|
||||
VDEFINES=-DPACKAGE=\"yabause-wii\" -DVERSION=\"0.9.6\" -DWORDS_BIGENDIAN -DREENTRANT_SYSCALLS_PROVIDED
|
||||
MACHDEP = -DGEKKO -mcpu=750 -meabi -mhard-float
|
||||
CFLAGS=$(VDEFINES) $(DDEFINES) -g -O2 -mrvl -Wall $(MACHDEP) -I$(LIBOGC_INC)
|
||||
LDFLAGS= -g $(MACHDEP) -mrvl -Wl,-Map,$(notdir $@).map
|
||||
LIBS := -lfat -lwiiuse -lbte -logc -lm
|
||||
OBJS = bios.o cdbase.o cheat.o coffelf.o cs0.o cs1.o cs2.o debug.o \
|
||||
error.o m68kcore.o m68kc68k.o m68kd.o memory.o netlink.o peripheral.o \
|
||||
profile.o scsp.o scu.o sh2core.o sh2idle.o sh2int.o sh2d.o smpc.o vdp1.o \
|
||||
vdp2.o vidshared.o vidsoft.o yabause.o ygl.o c68k/c68k.o c68k/c68kexec.o \
|
||||
wii/yui.o wii/perwii.o wii/sndwii.o
|
||||
DEPSDIR = $(CURDIR)
|
||||
export LD := $(CC)
|
||||
export LIBPATHS := -L$(LIBOGC_LIB)
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJS)
|
||||
rm -f $(TARGET)
|
||||
|
||||
c68k/c68kexec.o:
|
||||
$(CC) $(VDEFINES) $(DDEFINES) -mrvl -Wall $(MACHDEP) -I$(LIBOGC_INC) -c c68k/c68kexec.c -o $@
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.yabause.android"
|
||||
android:versionCode="1"
|
||||
android:versionName="0.9.11">
|
||||
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8"/>
|
||||
<application android:label="@string/app_name" android:icon="@drawable/icon">
|
||||
<activity android:name="Yabause"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
android:label="@string/app_name">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
|
@ -1,114 +0,0 @@
|
|||
find_program(NDK_BUILD ndk-build)
|
||||
|
||||
if(NOT NDK_BUILD)
|
||||
message(FATAL_ERROR "ndk build not found, bye")
|
||||
endif()
|
||||
|
||||
find_program(SDK_ANDROID android)
|
||||
|
||||
if(NOT SDK_ANDROID)
|
||||
message(FATAL_ERROR "sdk android tool not found, bye")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
set(yabause_android_SHADOW
|
||||
AndroidManifest.xml
|
||||
project.properties
|
||||
jni/yui.c
|
||||
jni/miniegl.h
|
||||
jni/sndaudiotrack.c
|
||||
jni/sndaudiotrack.h
|
||||
src/org/yabause/android/Yabause.java
|
||||
src/org/yabause/android/YabauseView.java
|
||||
res/drawable/pad.png
|
||||
res/drawable-hdpi/icon.png
|
||||
res/drawable-ldpi/icon.png
|
||||
res/drawable-mdpi/icon.png
|
||||
res/layout/main.xml
|
||||
res/menu/emulation.xml
|
||||
res/values/strings.xml
|
||||
)
|
||||
|
||||
foreach(item IN LISTS yabause_android_SHADOW)
|
||||
message(STATUS ${item})
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${item}"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${item}" "${CMAKE_CURRENT_BINARY_DIR}/${item}"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${item}"
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(YABAUSE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jni/Android.mk.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/jni/Android.mk
|
||||
@ONLY
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/local.properties"
|
||||
COMMAND ${SDK_ANDROID} update project -p "${CMAKE_CURRENT_BINARY_DIR}"
|
||||
DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/project.properties"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/jni/Android.mk"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/jni/libyabause.a"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/../libyabause.a ${CMAKE_CURRENT_BINARY_DIR}/jni/libyabause.a
|
||||
DEPENDS yabause "${CMAKE_CURRENT_BINARY_DIR}/../config.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/local.properties"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/libs/armeabi/libyabause.so"
|
||||
COMMAND "${NDK_BUILD}"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/jni/libyabause.a"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/jni/yui.c"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/jni/miniegl.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/jni/sndaudiotrack.c"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/jni/sndaudiotrack.h"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
set(yabause_android_RES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/drawable/pad.png"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/drawable-hdpi/icon.png"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/drawable-ldpi/icon.png"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/drawable-mdpi/icon.png"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/layout/main.xml"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/menu/emulation.xml"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/res/values/strings.xml"
|
||||
)
|
||||
set(yabause_android_SRC
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/org/yabause/android/Yabause.java"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/src/org/yabause/android/YabauseView.java"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/bin/Yabause-debug.apk"
|
||||
COMMAND "ant" ARGS "debug"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libs/armeabi/libyabause.so"
|
||||
DEPENDS ${yabause_android_SRC}
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml"
|
||||
DEPENDS ${yabause_android_RES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/bin/Yabause-release-unsigned.apk"
|
||||
COMMAND "ant" ARGS "release"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libs/armeabi/libyabause.so"
|
||||
DEPENDS ${yabause_android_SRC}
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml"
|
||||
DEPENDS ${yabause_android_RES}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
add_custom_target(yabause-android ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/bin/Yabause-release-unsigned.apk")
|
||||
else()
|
||||
add_custom_target(yabause-android ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/bin/Yabause-debug.apk")
|
||||
endif()
|
|
@ -1,14 +0,0 @@
|
|||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_C_COMPILER arm-linux-androideabi-gcc)
|
||||
SET(CMAKE_CXX_COMPILER arm-linux-androideabi-g++)
|
||||
SET(CMAKE_ASM-ATT_COMPILER arm-linux-androideabi-as)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH /home/guillaume/projects/android/toolchain/sysroot/usr/)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
|
||||
SET(ANDROID ON)
|
|
@ -1,85 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="Yabause" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<loadproperties srcFile="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
|
||||
<!-- extension targets. Uncomment the ones where you want to do custom work
|
||||
in between standard targets -->
|
||||
<!--
|
||||
<target name="-pre-build">
|
||||
</target>
|
||||
<target name="-pre-compile">
|
||||
</target>
|
||||
|
||||
/* This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir} */
|
||||
<target name="-post-compile">
|
||||
</target>
|
||||
-->
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
|
@ -1,14 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := yabause
|
||||
LOCAL_SRC_FILES := yui.c sndaudiotrack.c
|
||||
LOCAL_STATIC_LIBRARIES := yabause-prebuilt
|
||||
LOCAL_LDLIBS := -llog -ljnigraphics -lGLESv1_CM
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := yabause-prebuilt
|
||||
LOCAL_SRC_FILES := libyabause.a
|
||||
LOCAL_EXPORT_C_INCLUDES := @YABAUSE_INCLUDE_DIR@
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef _MINIEGL_
|
||||
#define _MINIEGL_
|
||||
|
||||
typedef int EGLint;
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLContext;
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLClientBuffer;
|
||||
|
||||
/* EGL aliases */
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_TRUE 1
|
||||
|
||||
/* Out-of-band handle values */
|
||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||
|
||||
/* GetCurrentSurface targets */
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_READ 0x305A
|
||||
|
||||
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_WIDTH 0x3057
|
||||
|
||||
/* QueryString targets */
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
|
||||
EGLContext (*eglGetCurrentContext)(void);
|
||||
EGLSurface (*eglGetCurrentSurface)(EGLint readdraw);
|
||||
EGLDisplay (*eglGetCurrentDisplay)(void);
|
||||
EGLBoolean (*eglQuerySurface)(EGLDisplay dpy, EGLSurface surface,EGLint attribute, EGLint *value);
|
||||
EGLBoolean (*eglSwapInterval)(EGLDisplay dpy, EGLint interval);
|
||||
EGLBoolean (*eglMakeCurrent)(EGLDisplay dpy, EGLSurface draw,EGLSurface read, EGLContext ctx);
|
||||
EGLBoolean (*eglSwapBuffers)(EGLDisplay dpy, EGLSurface surface);
|
||||
const char * (*eglQueryString)(EGLDisplay dpy, EGLint name);
|
||||
EGLint (*eglGetError)(void);
|
||||
|
||||
|
||||
#endif // _MINIEGL_
|
|
@ -1,221 +0,0 @@
|
|||
/* Copyright 2012 Guillaume Duhamel
|
||||
Copyright 2005-2006 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <jni.h>
|
||||
#include <android/log.h>
|
||||
#include "sndaudiotrack.h"
|
||||
#include "debug.h"
|
||||
|
||||
static int SNDAudioTrackInit(void);
|
||||
static void SNDAudioTrackDeInit(void);
|
||||
static int SNDAudioTrackReset(void);
|
||||
static int SNDAudioTrackChangeVideoFormat(int vertfreq);
|
||||
static void SNDAudioTrackUpdateAudio(u32 *leftchanbuffer, u32 *rightchanbuffer, u32 num_samples);
|
||||
static u32 SNDAudioTrackGetAudioSpace(void);
|
||||
static void SNDAudioTrackMuteAudio(void);
|
||||
static void SNDAudioTrackUnMuteAudio(void);
|
||||
static void SNDAudioTrackSetVolume(int volume);
|
||||
|
||||
SoundInterface_struct SNDAudioTrack = {
|
||||
SNDCORE_AUDIOTRACK,
|
||||
"Audio Track Sound Interface",
|
||||
SNDAudioTrackInit,
|
||||
SNDAudioTrackDeInit,
|
||||
SNDAudioTrackReset,
|
||||
SNDAudioTrackChangeVideoFormat,
|
||||
SNDAudioTrackUpdateAudio,
|
||||
SNDAudioTrackGetAudioSpace,
|
||||
SNDAudioTrackMuteAudio,
|
||||
SNDAudioTrackUnMuteAudio,
|
||||
SNDAudioTrackSetVolume
|
||||
};
|
||||
|
||||
extern JavaVM * yvm;
|
||||
|
||||
jobject gtrack = NULL;
|
||||
|
||||
jclass cAudioTrack = NULL;
|
||||
|
||||
jmethodID mWrite = NULL;
|
||||
|
||||
int mbufferSizeInBytes;
|
||||
|
||||
static u16 *stereodata16;
|
||||
static u8 soundvolume;
|
||||
static u8 soundmaxvolume;
|
||||
static u8 soundbufsize;
|
||||
static int soundoffset;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int SNDAudioTrackInit(void)
|
||||
{
|
||||
int sampleRateInHz = 44100;
|
||||
int channelConfig = 12; //AudioFormat.CHANNEL_OUT_STEREO
|
||||
int audioFormat = 2; //AudioFormat.ENCODING_PCM_16BIT
|
||||
JNIEnv * env;
|
||||
jobject mtrack = NULL;
|
||||
jmethodID mPlay = NULL;
|
||||
jmethodID mGetMinBufferSize = NULL;
|
||||
jmethodID mAudioTrack = NULL;
|
||||
|
||||
if ((*yvm)->GetEnv(yvm, (void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return -1;
|
||||
|
||||
cAudioTrack = (*env)->FindClass(env, "android/media/AudioTrack");
|
||||
|
||||
mAudioTrack = (*env)->GetMethodID(env, cAudioTrack, "<init>", "(IIIIII)V");
|
||||
|
||||
mWrite = (*env)->GetMethodID(env, cAudioTrack, "write", "([BII)I");
|
||||
|
||||
mPlay = (*env)->GetMethodID(env, cAudioTrack, "play", "()V");
|
||||
|
||||
mGetMinBufferSize = (*env)->GetStaticMethodID(env, cAudioTrack, "getMinBufferSize", "(III)I");
|
||||
|
||||
mbufferSizeInBytes = (*env)->CallStaticIntMethod(env, cAudioTrack, mGetMinBufferSize, sampleRateInHz, channelConfig, audioFormat);
|
||||
|
||||
mtrack = (*env)->NewObject(env, cAudioTrack, mAudioTrack, 3 /* STREAM_MUSIC */, sampleRateInHz, channelConfig, audioFormat, mbufferSizeInBytes, 1 /* MODE_STREAM */);
|
||||
|
||||
gtrack = (*env)->NewGlobalRef(env, mtrack);
|
||||
|
||||
(*env)->CallNonvirtualVoidMethod(env, gtrack, cAudioTrack, mPlay);
|
||||
|
||||
if ((stereodata16 = (u16 *)malloc(2 * mbufferSizeInBytes)) == NULL)
|
||||
return -1;
|
||||
memset(stereodata16, 0, soundbufsize);
|
||||
|
||||
soundvolume = 100;
|
||||
soundmaxvolume = 100;
|
||||
soundbufsize = 85;
|
||||
soundoffset = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SNDAudioTrackDeInit(void)
|
||||
{
|
||||
JNIEnv * env;
|
||||
|
||||
if ((*yvm)->GetEnv(yvm, (void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
|
||||
free(stereodata16);
|
||||
stereodata16 = NULL;
|
||||
|
||||
(*env)->DeleteGlobalRef(env, gtrack);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int SNDAudioTrackReset(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int SNDAudioTrackChangeVideoFormat(int vertfreq)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void sdlConvert32uto16s(s32 *srcL, s32 *srcR, s16 *dst, u32 len) {
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
// Left Channel
|
||||
*srcL = ( *srcL *soundvolume ) / soundmaxvolume;
|
||||
if (*srcL > 0x7FFF) *dst = 0x7FFF;
|
||||
else if (*srcL < -0x8000) *dst = -0x8000;
|
||||
else *dst = *srcL;
|
||||
srcL++;
|
||||
dst++;
|
||||
// Right Channel
|
||||
*srcR = ( *srcR *soundvolume ) / soundmaxvolume;
|
||||
if (*srcR > 0x7FFF) *dst = 0x7FFF;
|
||||
else if (*srcR < -0x8000) *dst = -0x8000;
|
||||
else *dst = *srcR;
|
||||
srcR++;
|
||||
dst++;
|
||||
}
|
||||
}
|
||||
|
||||
static void SNDAudioTrackUpdateAudio(u32 *leftchanbuffer, u32 *rightchanbuffer, u32 num_samples)
|
||||
{
|
||||
u32 copy1size=0;
|
||||
|
||||
copy1size = (num_samples * sizeof(s16) * 2);
|
||||
|
||||
sdlConvert32uto16s((s32 *)leftchanbuffer, (s32 *)rightchanbuffer, (s16 *)(((u8 *)stereodata16)+soundoffset), copy1size / sizeof(s16) / 2);
|
||||
|
||||
soundoffset += copy1size;
|
||||
|
||||
if (soundoffset > mbufferSizeInBytes) {
|
||||
JNIEnv * env;
|
||||
if ((*yvm)->GetEnv(yvm, (void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
|
||||
jshortArray array = (*env)->NewShortArray(env, soundoffset);
|
||||
if(array) {
|
||||
(*env)->SetShortArrayRegion(env, array, 0, soundoffset, stereodata16);
|
||||
}
|
||||
|
||||
(*env)->CallNonvirtualIntMethod(env, gtrack, cAudioTrack, mWrite, array, 0, soundoffset);
|
||||
|
||||
soundoffset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static u32 SNDAudioTrackGetAudioSpace(void)
|
||||
{
|
||||
static int i = 0;
|
||||
i++;
|
||||
if (i == 55) {
|
||||
i = 0;
|
||||
return mbufferSizeInBytes;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SNDAudioTrackMuteAudio(void)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SNDAudioTrackUnMuteAudio(void)
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void SNDAudioTrackSetVolume(int volume)
|
||||
{
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/* Copyright 2012 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SNDAUDIOTRACK_H
|
||||
#define SNDAUDIOTRACK_H
|
||||
|
||||
#define SNDCORE_AUDIOTRACK 4
|
||||
|
||||
#include "scsp.h"
|
||||
|
||||
extern SoundInterface_struct SNDAudioTrack;
|
||||
#endif
|
|
@ -1,419 +0,0 @@
|
|||
/* Copyright 2011 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <jni.h>
|
||||
#include <android/bitmap.h>
|
||||
#include <android/log.h>
|
||||
|
||||
#include "../../config.h"
|
||||
#include "yabause.h"
|
||||
#include "scsp.h"
|
||||
#include "vidsoft.h"
|
||||
#include "peripheral.h"
|
||||
#include "m68kcore.h"
|
||||
#include "sh2core.h"
|
||||
#include "sh2int.h"
|
||||
#include "cdbase.h"
|
||||
#include "cs2.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define _ANDROID_2_2_
|
||||
#ifdef _ANDROID_2_2_
|
||||
#include "miniegl.h"
|
||||
#else
|
||||
#include <EGL/egl.h>
|
||||
#endif
|
||||
|
||||
#include <GLES/gl.h>
|
||||
#include <GLES/glext.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "sndaudiotrack.h"
|
||||
|
||||
JavaVM * yvm;
|
||||
static jobject yabause;
|
||||
static jobject ybitmap;
|
||||
|
||||
static char biospath[256] = "/mnt/sdcard/jap.rom";
|
||||
static char cdpath[256] = "\0";
|
||||
static char buppath[256] = "\0";
|
||||
static char mpegpath[256] = "\0";
|
||||
static char cartpath[256] = "\0";
|
||||
|
||||
EGLDisplay g_Display = EGL_NO_DISPLAY;
|
||||
EGLSurface g_Surface = EGL_NO_SURFACE;
|
||||
EGLContext g_Context = EGL_NO_CONTEXT;
|
||||
GLuint g_FrameBuffer = 0;
|
||||
GLuint g_VertexBuffer = 0;
|
||||
int g_buf_width = -1;
|
||||
int g_buf_height = -1;
|
||||
pthread_mutex_t g_mtxGlLock = PTHREAD_MUTEX_INITIALIZER;
|
||||
float vertices [] = {
|
||||
0, 0, 0, 0,
|
||||
320, 0, 0, 0,
|
||||
320, 224, 0, 0,
|
||||
0, 224, 0, 0
|
||||
};
|
||||
|
||||
|
||||
M68K_struct * M68KCoreList[] = {
|
||||
&M68KDummy,
|
||||
#ifdef HAVE_C68K
|
||||
&M68KC68K,
|
||||
#endif
|
||||
#ifdef HAVE_Q68
|
||||
&M68KQ68,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
SH2Interface_struct *SH2CoreList[] = {
|
||||
&SH2Interpreter,
|
||||
&SH2DebugInterpreter,
|
||||
#ifdef SH2_DYNAREC
|
||||
&SH2Dynarec,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
PerInterface_struct *PERCoreList[] = {
|
||||
&PERDummy,
|
||||
NULL
|
||||
};
|
||||
|
||||
CDInterface *CDCoreList[] = {
|
||||
&DummyCD,
|
||||
&ISOCD,
|
||||
NULL
|
||||
};
|
||||
|
||||
SoundInterface_struct *SNDCoreList[] = {
|
||||
&SNDDummy,
|
||||
&SNDAudioTrack,
|
||||
NULL
|
||||
};
|
||||
|
||||
VideoInterface_struct *VIDCoreList[] = {
|
||||
&VIDDummy,
|
||||
&VIDSoft,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
#define LOG_TAG "yabause"
|
||||
|
||||
/* Override printf for debug*/
|
||||
int printf( const char * fmt, ... )
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
int result = __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, fmt, ap);
|
||||
va_end(ap);
|
||||
return result;
|
||||
}
|
||||
|
||||
void YuiErrorMsg(const char *string)
|
||||
{
|
||||
jclass yclass;
|
||||
jmethodID errorMsg;
|
||||
jstring message;
|
||||
JNIEnv * env;
|
||||
if ((*yvm)->GetEnv(yvm, (void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return;
|
||||
|
||||
yclass = (*env)->GetObjectClass(env, yabause);
|
||||
errorMsg = (*env)->GetMethodID(env, yclass, "errorMsg", "(Ljava/lang/String;)V");
|
||||
message = (*env)->NewStringUTF(env, string);
|
||||
(*env)->CallVoidMethod(env, yabause, errorMsg, message);
|
||||
}
|
||||
|
||||
void YuiSwapBuffers(void)
|
||||
{
|
||||
int buf_width, buf_height;
|
||||
int error;
|
||||
|
||||
|
||||
pthread_mutex_lock(&g_mtxGlLock);
|
||||
if( g_Display == EGL_NO_DISPLAY )
|
||||
{
|
||||
pthread_mutex_unlock(&g_mtxGlLock);
|
||||
return;
|
||||
}
|
||||
|
||||
if( eglMakeCurrent(g_Display,g_Surface,g_Surface,g_Context) == EGL_FALSE )
|
||||
{
|
||||
printf( "eglMakeCurrent fail %04x",eglGetError());
|
||||
pthread_mutex_unlock(&g_mtxGlLock);
|
||||
return;
|
||||
}
|
||||
|
||||
glClearColor( 0.0f,0.0f,0.0f,1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
|
||||
if( g_FrameBuffer == 0 )
|
||||
{
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glGenTextures(1,&g_FrameBuffer);
|
||||
glBindTexture(GL_TEXTURE_2D, g_FrameBuffer);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1024, 1024, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
|
||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
error = glGetError();
|
||||
if( error != GL_NO_ERROR )
|
||||
{
|
||||
printf("gl error %d", error );
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
glBindTexture(GL_TEXTURE_2D, g_FrameBuffer);
|
||||
}
|
||||
|
||||
|
||||
VIDCore->GetGlSize(&buf_width, &buf_height);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0,0,0,buf_width,buf_height,GL_RGBA,GL_UNSIGNED_BYTE,dispbuffer);
|
||||
|
||||
|
||||
if( g_VertexBuffer == 0 )
|
||||
{
|
||||
glGenBuffers(1, &g_VertexBuffer);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, g_VertexBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices),vertices,GL_STATIC_DRAW);
|
||||
error = glGetError();
|
||||
if( error != GL_NO_ERROR )
|
||||
{
|
||||
printf("gl error %d", error );
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, g_VertexBuffer);
|
||||
}
|
||||
|
||||
if( buf_width != g_buf_width || buf_height != g_buf_height )
|
||||
{
|
||||
vertices[6]=vertices[10]=(float)buf_width/1024.f;
|
||||
vertices[11]=vertices[15]=(float)buf_height/1024.f;
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices),vertices,GL_STATIC_DRAW);
|
||||
glVertexPointer(2, GL_FLOAT, sizeof(float)*4, 0);
|
||||
glTexCoordPointer(2, GL_FLOAT, sizeof(float)*4, (void*)(sizeof(float)*2));
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
g_buf_width = buf_width;
|
||||
g_buf_height = buf_height;
|
||||
}
|
||||
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
eglSwapBuffers(g_Display,g_Surface);
|
||||
|
||||
pthread_mutex_unlock(&g_mtxGlLock);
|
||||
}
|
||||
|
||||
int Java_org_yabause_android_YabauseRunnable_initViewport( int width, int height)
|
||||
{
|
||||
int swidth;
|
||||
int sheight;
|
||||
int error;
|
||||
char * buf;
|
||||
|
||||
g_Display = eglGetCurrentDisplay();
|
||||
g_Surface = eglGetCurrentSurface(EGL_READ);
|
||||
g_Context = eglGetCurrentContext();
|
||||
|
||||
eglQuerySurface(g_Display,g_Surface,EGL_WIDTH,&swidth);
|
||||
eglQuerySurface(g_Display,g_Surface,EGL_HEIGHT,&sheight);
|
||||
|
||||
glViewport(0,0,swidth,sheight);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrthof(0, 320, 224, 0, 1, 0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
printf(glGetString(GL_VENDOR));
|
||||
printf(glGetString(GL_RENDERER));
|
||||
printf(glGetString(GL_VERSION));
|
||||
printf(glGetString(GL_EXTENSIONS));
|
||||
printf(eglQueryString(g_Display,EGL_EXTENSIONS));
|
||||
eglSwapInterval(g_Display,0);
|
||||
eglMakeCurrent(g_Display,EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _ANDROID_2_2_
|
||||
int initEGLFunc()
|
||||
{
|
||||
void * handle;
|
||||
char *error;
|
||||
|
||||
handle = dlopen("libEGL.so",RTLD_LAZY);
|
||||
if( handle == NULL )
|
||||
{
|
||||
printf(dlerror());
|
||||
return -1;
|
||||
}
|
||||
|
||||
eglGetCurrentDisplay = dlsym(handle, "eglGetCurrentDisplay");
|
||||
if( eglGetCurrentDisplay == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglGetCurrentSurface = dlsym(handle, "eglGetCurrentSurface");
|
||||
if( eglGetCurrentSurface == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglGetCurrentContext = dlsym(handle, "eglGetCurrentContext");
|
||||
if( eglGetCurrentContext == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglQuerySurface = dlsym(handle, "eglQuerySurface");
|
||||
if( eglQuerySurface == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglSwapInterval = dlsym(handle, "eglSwapInterval");
|
||||
if( eglSwapInterval == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglMakeCurrent = dlsym(handle, "eglMakeCurrent");
|
||||
if( eglMakeCurrent == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglSwapBuffers = dlsym(handle, "eglSwapBuffers");
|
||||
if( eglSwapBuffers == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglQueryString = dlsym(handle, "eglQueryString");
|
||||
if( eglQueryString == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
eglGetError = dlsym(handle, "eglGetError");
|
||||
if( eglGetError == NULL){ printf(dlerror()); return -1; }
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int initEGLFunc()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int Java_org_yabause_android_YabauseRunnable_lockGL()
|
||||
{
|
||||
pthread_mutex_lock(&g_mtxGlLock);
|
||||
}
|
||||
|
||||
int Java_org_yabause_android_YabauseRunnable_unlockGL()
|
||||
{
|
||||
pthread_mutex_unlock(&g_mtxGlLock);
|
||||
}
|
||||
|
||||
|
||||
jint
|
||||
Java_org_yabause_android_YabauseRunnable_init( JNIEnv* env, jobject obj, jobject yab, jobject bitmap )
|
||||
{
|
||||
yabauseinit_struct yinit;
|
||||
int res;
|
||||
void * padbits;
|
||||
|
||||
if( initEGLFunc() == -1 ) return -1;
|
||||
|
||||
yabause = (*env)->NewGlobalRef(env, yab);
|
||||
ybitmap = (*env)->NewGlobalRef(env, bitmap);
|
||||
|
||||
yinit.m68kcoretype = M68KCORE_C68K;
|
||||
yinit.percoretype = PERCORE_DUMMY;
|
||||
#ifdef SH2_DYNAREC
|
||||
yinit.sh2coretype = 2;
|
||||
#else
|
||||
yinit.sh2coretype = SH2CORE_DEFAULT;
|
||||
#endif
|
||||
yinit.vidcoretype = VIDCORE_SOFT;
|
||||
yinit.sndcoretype = SNDCORE_AUDIOTRACK;
|
||||
yinit.cdcoretype = CDCORE_DEFAULT;
|
||||
yinit.carttype = CART_NONE;
|
||||
yinit.regionid = 0;
|
||||
yinit.biospath = biospath;
|
||||
yinit.cdpath = cdpath;
|
||||
yinit.buppath = buppath;
|
||||
yinit.mpegpath = mpegpath;
|
||||
yinit.cartpath = cartpath;
|
||||
yinit.videoformattype = VIDEOFORMATTYPE_NTSC;
|
||||
|
||||
res = YabauseInit(&yinit);
|
||||
|
||||
PerPortReset();
|
||||
padbits = PerPadAdd(&PORTDATA1);
|
||||
PerSetKey(1, PERPAD_LEFT, padbits);
|
||||
PerSetKey(4, PERPAD_UP, padbits);
|
||||
PerSetKey(6, PERPAD_DOWN, padbits);
|
||||
PerSetKey(9, PERPAD_RIGHT, padbits);
|
||||
|
||||
ScspSetFrameAccurate(1);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void
|
||||
Java_org_yabause_android_YabauseRunnable_deinit( JNIEnv* env )
|
||||
{
|
||||
YabauseDeInit();
|
||||
}
|
||||
|
||||
void
|
||||
Java_org_yabause_android_YabauseRunnable_exec( JNIEnv* env )
|
||||
{
|
||||
YabauseExec();
|
||||
}
|
||||
|
||||
void
|
||||
Java_org_yabause_android_YabauseRunnable_press( JNIEnv* env, jobject obj, jint key )
|
||||
{
|
||||
PerKeyDown(key);
|
||||
}
|
||||
|
||||
void
|
||||
Java_org_yabause_android_YabauseRunnable_release( JNIEnv* env, jobject obj, jint key )
|
||||
{
|
||||
PerKeyUp(key);
|
||||
}
|
||||
|
||||
void log_callback(char * message)
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "yabause", "%s", message);
|
||||
}
|
||||
|
||||
jint JNI_OnLoad(JavaVM * vm, void * reserved)
|
||||
{
|
||||
JNIEnv * env;
|
||||
if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_6) != JNI_OK)
|
||||
return -1;
|
||||
|
||||
yvm = vm;
|
||||
|
||||
LogStart();
|
||||
LogChangeOutput(DEBUG_CALLBACK, (char *) log_callback);
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Project target.
|
||||
target=android-8
|
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 12 KiB |
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<org.yabause.android.YabauseView
|
||||
android:id="@+id/yabause_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/yabause_pad"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/pad"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<group android:id="@+id/running">
|
||||
<item android:id="@+id/pause" android:title="Pause" />
|
||||
</group>
|
||||
<group android:id="@+id/paused" android:visible="false">
|
||||
<item android:id="@+id/resume" android:title="Resume" />
|
||||
</group>
|
||||
<item android:id="@+id/quit"
|
||||
android:title="Quit" />
|
||||
</menu>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Yabause</string>
|
||||
</resources>
|
|
@ -1,265 +0,0 @@
|
|||
/* Copyright 2011 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.yabause.android;
|
||||
|
||||
import java.lang.Runnable;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MenuInflater;
|
||||
import android.app.Dialog;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.content.DialogInterface;
|
||||
import org.yabause.android.YabauseView;
|
||||
import android.widget.ImageView;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnTouchListener;
|
||||
|
||||
class InputHandler extends Handler {
|
||||
private YabauseRunnable yr;
|
||||
|
||||
public InputHandler(YabauseRunnable yr) {
|
||||
this.yr = yr;
|
||||
}
|
||||
|
||||
public void handleMessage(Message msg) {
|
||||
if (msg.arg1 == 1) {
|
||||
yr.press(msg.arg2);
|
||||
} else if (msg.arg1 == 2) {
|
||||
yr.release(msg.arg2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class YabauseRunnable implements Runnable
|
||||
{
|
||||
public static native int init(Yabause yabause, Bitmap bitmap);
|
||||
public static native void deinit();
|
||||
public static native void exec();
|
||||
public static native void press(int key);
|
||||
public static native void release(int key);
|
||||
public static native int initViewport( int width, int hieght);
|
||||
public static native int drawScreen();
|
||||
public static native int lockGL();
|
||||
public static native int unlockGL();
|
||||
|
||||
private boolean inited;
|
||||
private boolean paused;
|
||||
public InputHandler handler;
|
||||
|
||||
public YabauseRunnable(Yabause yabause, Bitmap bitmap)
|
||||
{
|
||||
handler = new InputHandler(this);
|
||||
int ok = init(yabause, bitmap);
|
||||
inited = (ok == 0);
|
||||
}
|
||||
|
||||
public void pause()
|
||||
{
|
||||
Log.v("Yabause", "pause... should really pause emulation now...");
|
||||
paused = true;
|
||||
}
|
||||
|
||||
public void resume()
|
||||
{
|
||||
Log.v("Yabause", "resuming emulation...");
|
||||
paused = false;
|
||||
handler.post(this);
|
||||
}
|
||||
|
||||
public void destroy()
|
||||
{
|
||||
Log.v("Yabause", "destroying yabause...");
|
||||
inited = false;
|
||||
deinit();
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
if (inited && (! paused))
|
||||
{
|
||||
exec();
|
||||
|
||||
handler.post(this);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean paused()
|
||||
{
|
||||
return paused;
|
||||
}
|
||||
}
|
||||
|
||||
class YabauseHandler extends Handler {
|
||||
private Yabause yabause;
|
||||
|
||||
public YabauseHandler(Yabause yabause) {
|
||||
this.yabause = yabause;
|
||||
}
|
||||
|
||||
public void handleMessage(Message msg) {
|
||||
yabause.showDialog(msg.what, msg.getData());
|
||||
}
|
||||
}
|
||||
|
||||
public class Yabause extends Activity implements OnTouchListener
|
||||
{
|
||||
private static final String TAG = "Yabause";
|
||||
private YabauseRunnable yabauseThread;
|
||||
private YabauseHandler handler;
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.main);
|
||||
|
||||
YabauseView view = (YabauseView) findViewById(R.id.yabause_view);
|
||||
handler = new YabauseHandler(this);
|
||||
yabauseThread = new YabauseRunnable(this,null);
|
||||
view.setYabauseRunnable(yabauseThread);
|
||||
|
||||
ImageView pad = (ImageView) findViewById(R.id.yabause_pad);
|
||||
pad.setOnTouchListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause()
|
||||
{
|
||||
super.onPause();
|
||||
Log.v(TAG, "pause... should pause emulation...");
|
||||
yabauseThread.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
super.onResume();
|
||||
Log.v(TAG, "resume... should resume emulation...");
|
||||
yabauseThread.resume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
super.onDestroy();
|
||||
Log.v(TAG, "this is the end...");
|
||||
yabauseThread.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.emulation, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.pause:
|
||||
yabauseThread.pause();
|
||||
return true;
|
||||
case R.id.quit:
|
||||
this.finish();
|
||||
return true;
|
||||
case R.id.resume:
|
||||
yabauseThread.resume();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
if (yabauseThread.paused()) {
|
||||
menu.setGroupVisible(R.id.paused, true);
|
||||
menu.setGroupVisible(R.id.running, false);
|
||||
} else {
|
||||
menu.setGroupVisible(R.id.paused, false);
|
||||
menu.setGroupVisible(R.id.running, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(int id, Bundle args) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setMessage(args.getString("message"))
|
||||
.setCancelable(false)
|
||||
.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
Yabause.this.finish();
|
||||
}
|
||||
})
|
||||
.setPositiveButton("Ignore", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
return alert;
|
||||
}
|
||||
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
int action = event.getActionMasked();
|
||||
float x = event.getX();
|
||||
float y = event.getY();
|
||||
int keyx = (int) ((x - 10) / 30);
|
||||
int keyy = (int) ((y - 10) / 30);
|
||||
int key = (keyx << 2) | keyy;
|
||||
int keya = 0;
|
||||
if (action == event.ACTION_DOWN) {
|
||||
keya = 1;
|
||||
} else if (action == event.ACTION_UP) {
|
||||
keya = 2;
|
||||
}
|
||||
|
||||
Message message = handler.obtainMessage();
|
||||
message.arg1 = keya;
|
||||
message.arg2 = key;
|
||||
yabauseThread.handler.sendMessage(message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void errorMsg(String msg) {
|
||||
Message message = handler.obtainMessage();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("message", msg);
|
||||
message.setData(bundle);
|
||||
handler.sendMessage(message);
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("yabause");
|
||||
}
|
||||
}
|
|
@ -1,196 +0,0 @@
|
|||
/* Copyright 2011 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package org.yabause.android;
|
||||
|
||||
import java.lang.Runnable;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
import javax.microedition.khronos.egl.EGLContext;
|
||||
import javax.microedition.khronos.egl.EGLDisplay;
|
||||
import javax.microedition.khronos.egl.EGLSurface;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceHolder.Callback;
|
||||
import android.view.SurfaceView;
|
||||
import android.view.View;
|
||||
|
||||
class YabauseView extends SurfaceView implements Callback, View.OnKeyListener, View.OnTouchListener{
|
||||
private static String TAG = "YabauseView";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private int axisX = 0;
|
||||
private int axisY = 0;
|
||||
|
||||
public boolean[] pointers = new boolean[256];
|
||||
public int[] pointerX = new int[256];
|
||||
public int[] pointerY = new int[256];
|
||||
|
||||
private YabauseRunnable _Runnable = null;
|
||||
|
||||
private EGLContext mEglContext;
|
||||
private EGLDisplay mEglDisplay;
|
||||
private EGLSurface mEglSurface;
|
||||
private EGLConfig mEglConfig;
|
||||
|
||||
|
||||
public YabauseView(Context context, AttributeSet attrs) {
|
||||
super(context,attrs);
|
||||
init(false, 0, 0);
|
||||
}
|
||||
|
||||
public YabauseView(Context context) {
|
||||
super(context);
|
||||
init(false, 0, 0);
|
||||
}
|
||||
|
||||
public YabauseView(Context context, boolean translucent, int depth, int stencil) {
|
||||
super(context);
|
||||
init(translucent, depth, stencil);
|
||||
}
|
||||
|
||||
public void setYabauseRunnable( YabauseRunnable runnable )
|
||||
{
|
||||
_Runnable = runnable;
|
||||
}
|
||||
|
||||
private void init(boolean translucent, int depth, int stencil) {
|
||||
|
||||
setFocusable( true );
|
||||
setFocusableInTouchMode( true );
|
||||
requestFocus();
|
||||
setOnKeyListener( this );
|
||||
setOnTouchListener( this );
|
||||
|
||||
getHolder().addCallback(this);
|
||||
getHolder().setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
||||
initGLES();
|
||||
|
||||
}
|
||||
|
||||
private boolean initGLES(){
|
||||
|
||||
EGL10 egl = (EGL10)EGLContext.getEGL();
|
||||
|
||||
mEglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
|
||||
if( mEglDisplay == EGL10.EGL_NO_DISPLAY ){
|
||||
Log.e(TAG, "Fail to get Display");
|
||||
return false;
|
||||
}
|
||||
|
||||
int[] version = new int[2];
|
||||
if( !egl.eglInitialize(mEglDisplay, version) ){
|
||||
Log.e(TAG, "Fail to eglInitialize");
|
||||
return false;
|
||||
}
|
||||
|
||||
int[] configSpec = {
|
||||
EGL10.EGL_NONE
|
||||
};
|
||||
EGLConfig[] configs = new EGLConfig[1];
|
||||
|
||||
int[] numConfigs = new int[1];
|
||||
if( !egl.eglChooseConfig(mEglDisplay, configSpec, configs, 1, numConfigs) ){
|
||||
Log.e(TAG, "Fail to Choose Config");
|
||||
return false;
|
||||
}
|
||||
mEglConfig = configs[0];
|
||||
|
||||
mEglContext = egl.eglCreateContext(mEglDisplay, mEglConfig, EGL10.EGL_NO_CONTEXT, null);
|
||||
if( mEglContext == EGL10.EGL_NO_CONTEXT ){
|
||||
Log.e(TAG, "Fail to Create OpenGL Context");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
private boolean createSurface(){
|
||||
EGL10 egl = (EGL10)EGLContext.getEGL();
|
||||
mEglSurface = egl.eglCreateWindowSurface(mEglDisplay, mEglConfig, getHolder(), null);
|
||||
if( mEglSurface == EGL10.EGL_NO_SURFACE ){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void endGLES(){
|
||||
EGL10 egl = (EGL10)EGLContext.getEGL();
|
||||
if( mEglSurface != null){
|
||||
//レンダリングコンテキストとの結びつけは解除
|
||||
egl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
|
||||
|
||||
egl.eglDestroySurface(mEglDisplay, mEglSurface);
|
||||
mEglSurface = null;
|
||||
}
|
||||
|
||||
if( mEglContext != null ){
|
||||
egl.eglDestroyContext(mEglDisplay, mEglContext);
|
||||
mEglContext = null;
|
||||
}
|
||||
|
||||
if( mEglDisplay != null){
|
||||
egl.eglTerminate(mEglDisplay);
|
||||
mEglDisplay = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||
|
||||
EGL10 egl = (EGL10)EGLContext.getEGL();
|
||||
|
||||
YabauseRunnable.lockGL();
|
||||
egl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext);
|
||||
YabauseRunnable.initViewport(width, height);
|
||||
YabauseRunnable.unlockGL();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
if( !createSurface() ){
|
||||
Log.e(TAG, "Fail to Creat4e Surface");
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
|
||||
}
|
||||
|
||||
// Key events
|
||||
public boolean onKey( View v, int keyCode, KeyEvent event )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onTouch( View v, MotionEvent event )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
1869
yabause/src/bios.c
1869
yabause/src/bios.c
File diff suppressed because it is too large
Load Diff
|
@ -1,58 +0,0 @@
|
|||
/* Copyright 2006 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef BIOS_H
|
||||
#define BIOS_H
|
||||
|
||||
#include "sh2core.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char filename[12];
|
||||
char comment[11];
|
||||
u8 language;
|
||||
u8 year;
|
||||
u8 month;
|
||||
u8 day;
|
||||
u8 hour;
|
||||
u8 minute;
|
||||
u8 week;
|
||||
u32 datasize;
|
||||
u16 blocksize;
|
||||
} saveinfo_struct;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 id;
|
||||
char name[32];
|
||||
} deviceinfo_struct;
|
||||
|
||||
void BiosInit(void);
|
||||
int FASTCALL BiosHandleFunc(SH2_struct * sh);
|
||||
|
||||
deviceinfo_struct *BupGetDeviceList(int *numdevices);
|
||||
int BupGetStats(u32 device, u32 *freespace, u32 *maxspace);
|
||||
saveinfo_struct *BupGetSaveList(u32 device, int *numsaves);
|
||||
int BupDeleteSave(u32 device, const char *savename);
|
||||
void BupFormat(u32 device);
|
||||
int BupCopySave(u32 srcdevice, u32 dstdevice, const char *savename);
|
||||
int BupImportSave(u32 device, const char *filename);
|
||||
int BupExportSave(u32 device, const char *savename, const char *filename);
|
||||
#endif
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
project(gen68k)
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
# variadic macros
|
||||
check_c_source_compiles("#define MACRO(...) puts(__VA_ARGS__)
|
||||
int main(int argc, char ** argv) { MACRO(\"foo\"); }"
|
||||
VARIADIC_MACROS_OK)
|
||||
if (VARIADIC_MACROS_OK)
|
||||
add_definitions(-DHAVE_C99_VARIADIC_MACROS=1)
|
||||
endif (VARIADIC_MACROS_OK)
|
||||
|
||||
set(gen68k_SOURCES c68kexec.c c68k.c gen68k.c)
|
||||
|
||||
add_definitions(-DC68K_GEN)
|
||||
if (MSVC)
|
||||
add_definitions(-DC68K_NO_JUMP_TABLE)
|
||||
endif (MSVC)
|
||||
|
||||
add_executable(gen68k ${gen68k_SOURCES})
|
||||
|
||||
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gen68k)
|
||||
|
||||
set(GEN68K_INC c68k_ini.inc c68k_op0.inc c68k_op1.inc c68k_op2.inc c68k_op3.inc c68k_op4.inc c68k_op5.inc c68k_op6.inc c68k_op7.inc c68k_op8.inc c68k_op9.inc c68k_opA.inc c68k_opB.inc c68k_opC.inc c68k_opD.inc c68k_opE.inc c68k_opF.inc)
|
||||
|
||||
add_custom_command(OUTPUT ${GEN68K_INC} COMMAND gen68k DEPENDS gen68k)
|
||||
|
||||
add_custom_target(c68kinc ALL DEPENDS ${GEN68K_INC})
|
|
@ -1,11 +0,0 @@
|
|||
EXTRA_DIST = c68k.h c68kmac.inc gen68k.h gen68k.inc
|
||||
noinst_PROGRAMS = gen68k
|
||||
gen68k_SOURCES = c68kexec.c c68k.c gen68k.c
|
||||
gen68k_CFLAGS = -DC68K_GEN
|
||||
gen68k_LDFLAGS = -DC68K_GEN
|
||||
|
||||
all-local: gen68k$(EXEEXT)
|
||||
./gen68k$(EXEEXT)
|
||||
|
||||
clean-local:
|
||||
-rm *_*.inc
|
|
@ -1,311 +0,0 @@
|
|||
/* Copyright 2003-2004 Stephane Dallongeville
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*********************************************************************************
|
||||
*
|
||||
* C68K (68000 CPU emulator) version 0.80
|
||||
* Compiled with Dev-C++
|
||||
* Copyright 2003-2004 Stephane Dallongeville
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "c68k.h"
|
||||
|
||||
// shared global variable
|
||||
//////////////////////////
|
||||
|
||||
c68k_struc C68K;
|
||||
|
||||
// include macro file
|
||||
//////////////////////
|
||||
|
||||
#include "c68kmac.inc"
|
||||
|
||||
// prototype
|
||||
/////////////
|
||||
|
||||
u32 FASTCALL C68k_Read_Dummy(const u32 adr);
|
||||
void FASTCALL C68k_Write_Dummy(const u32 adr, u32 data);
|
||||
|
||||
u32 C68k_Read_Byte(c68k_struc *cpu, u32 adr);
|
||||
u32 C68k_Read_Word(c68k_struc *cpu, u32 adr);
|
||||
u32 C68k_Read_Long(c68k_struc *cpu, u32 adr);
|
||||
void C68k_Write_Byte(c68k_struc *cpu, u32 adr, u32 data);
|
||||
void C68k_Write_Word(c68k_struc *cpu, u32 adr, u32 data);
|
||||
void C68k_Write_Long(c68k_struc *cpu, u32 adr, u32 data);
|
||||
|
||||
s32 FASTCALL C68k_Interrupt_Ack_Dummy(s32 level);
|
||||
void FASTCALL C68k_Reset_Dummy(void);
|
||||
|
||||
// core main functions
|
||||
///////////////////////
|
||||
|
||||
void C68k_Init(c68k_struc *cpu, C68K_INT_CALLBACK *int_cb)
|
||||
{
|
||||
memset(cpu, 0, sizeof(c68k_struc));
|
||||
|
||||
C68k_Set_ReadB(cpu, C68k_Read_Dummy);
|
||||
C68k_Set_ReadW(cpu, C68k_Read_Dummy);
|
||||
|
||||
C68k_Set_WriteB(cpu, C68k_Write_Dummy);
|
||||
C68k_Set_WriteW(cpu, C68k_Write_Dummy);
|
||||
|
||||
if (int_cb) cpu->Interrupt_CallBack = int_cb;
|
||||
else cpu->Interrupt_CallBack = C68k_Interrupt_Ack_Dummy;
|
||||
cpu->Reset_CallBack = C68k_Reset_Dummy;
|
||||
|
||||
// used to init JumpTable
|
||||
cpu->Status |= C68K_DISABLE;
|
||||
C68k_Exec(cpu, 0);
|
||||
|
||||
cpu->Status &= ~C68K_DISABLE;
|
||||
}
|
||||
|
||||
s32 FASTCALL C68k_Reset(c68k_struc *cpu)
|
||||
{
|
||||
memset(cpu, 0, ((u8 *)&(cpu->dirty1)) - ((u8 *)&(cpu->D[0])));
|
||||
|
||||
cpu->flag_notZ = 1;
|
||||
cpu->flag_I = 7;
|
||||
cpu->flag_S = C68K_SR_S;
|
||||
|
||||
cpu->A[7] = C68k_Read_Long(cpu, 0);
|
||||
C68k_Set_PC(cpu, C68k_Read_Long(cpu, 4));
|
||||
|
||||
return cpu->Status;
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
|
||||
void FASTCALL C68k_Set_IRQ(c68k_struc *cpu, s32 level)
|
||||
{
|
||||
cpu->IRQLine = level;
|
||||
if (cpu->Status & C68K_RUNNING)
|
||||
{
|
||||
cpu->CycleSup = cpu->CycleIO;
|
||||
cpu->CycleIO = 0;
|
||||
}
|
||||
cpu->Status &= ~(C68K_HALTED | C68K_WAITING);
|
||||
}
|
||||
|
||||
/////////////////////////////////
|
||||
|
||||
s32 FASTCALL C68k_Get_CycleToDo(c68k_struc *cpu)
|
||||
{
|
||||
if (!(cpu->Status & C68K_RUNNING)) return -1;
|
||||
|
||||
return cpu->CycleToDo;
|
||||
}
|
||||
|
||||
s32 FASTCALL C68k_Get_CycleRemaining(c68k_struc *cpu)
|
||||
{
|
||||
if (!(cpu->Status & C68K_RUNNING)) return -1;
|
||||
|
||||
return (cpu->CycleIO + cpu->CycleSup);
|
||||
}
|
||||
|
||||
s32 FASTCALL C68k_Get_CycleDone(c68k_struc *cpu)
|
||||
{
|
||||
if (!(cpu->Status & C68K_RUNNING)) return -1;
|
||||
|
||||
return (cpu->CycleToDo - (cpu->CycleIO + cpu->CycleSup));
|
||||
}
|
||||
|
||||
void FASTCALL C68k_Release_Cycle(c68k_struc *cpu)
|
||||
{
|
||||
if (cpu->Status & C68K_RUNNING) cpu->CycleIO = cpu->CycleSup = 0;
|
||||
}
|
||||
|
||||
void FASTCALL C68k_Add_Cycle(c68k_struc *cpu, s32 cycle)
|
||||
{
|
||||
if (cpu->Status & C68K_RUNNING) cpu->CycleIO -= cycle;
|
||||
}
|
||||
|
||||
// Read / Write dummy functions
|
||||
////////////////////////////////
|
||||
|
||||
u32 FASTCALL C68k_Read_Dummy(UNUSED const u32 adr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void FASTCALL C68k_Write_Dummy(UNUSED const u32 adr, UNUSED u32 data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
s32 FASTCALL C68k_Interrupt_Ack_Dummy(s32 level)
|
||||
{
|
||||
// return vector
|
||||
return (C68K_INTERRUPT_AUTOVECTOR_EX + level);
|
||||
}
|
||||
|
||||
void FASTCALL C68k_Reset_Dummy(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Read / Write core functions
|
||||
///////////////////////////////
|
||||
|
||||
u32 C68k_Read_Byte(c68k_struc *cpu, u32 adr)
|
||||
{
|
||||
return cpu->Read_Byte(adr);
|
||||
}
|
||||
|
||||
u32 C68k_Read_Word(c68k_struc *cpu, u32 adr)
|
||||
{
|
||||
return cpu->Read_Word(adr);
|
||||
}
|
||||
|
||||
u32 C68k_Read_Long(c68k_struc *cpu, u32 adr)
|
||||
{
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
return (cpu->Read_Word(adr) << 16) | (cpu->Read_Word(adr + 2) & 0xFFFF);
|
||||
#else
|
||||
return (cpu->Read_Word(adr) << 16) | (cpu->Read_Word(adr + 2) & 0xFFFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
void C68k_Write_Byte(c68k_struc *cpu, u32 adr, u32 data)
|
||||
{
|
||||
cpu->Write_Byte(adr, data);
|
||||
}
|
||||
|
||||
void C68k_Write_Word(c68k_struc *cpu, u32 adr, u32 data)
|
||||
{
|
||||
cpu->Write_Word(adr, data);
|
||||
}
|
||||
|
||||
void C68k_Write_Long(c68k_struc *cpu, u32 adr, u32 data)
|
||||
{
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
cpu->Write_Word(adr, data >> 16);
|
||||
cpu->Write_Word(adr + 2, data & 0xFFFF);
|
||||
#else
|
||||
cpu->Write_Word(adr, data >> 16);
|
||||
cpu->Write_Word(adr + 2, data & 0xFFFF);
|
||||
#endif
|
||||
}
|
||||
|
||||
// setting core functions
|
||||
//////////////////////////
|
||||
|
||||
void C68k_Set_Fetch(c68k_struc *cpu, u32 low_adr, u32 high_adr, pointer fetch_adr)
|
||||
{
|
||||
u32 i, j;
|
||||
|
||||
i = (low_adr >> C68K_FETCH_SFT) & C68K_FETCH_MASK;
|
||||
j = (high_adr >> C68K_FETCH_SFT) & C68K_FETCH_MASK;
|
||||
fetch_adr -= i << C68K_FETCH_SFT;
|
||||
while (i <= j) cpu->Fetch[i++] = fetch_adr;
|
||||
}
|
||||
|
||||
void C68k_Set_ReadB(c68k_struc *cpu, C68K_READ *Func)
|
||||
{
|
||||
cpu->Read_Byte = Func;
|
||||
}
|
||||
|
||||
void C68k_Set_ReadW(c68k_struc *cpu, C68K_READ *Func)
|
||||
{
|
||||
cpu->Read_Word = Func;
|
||||
}
|
||||
|
||||
void C68k_Set_WriteB(c68k_struc *cpu, C68K_WRITE *Func)
|
||||
{
|
||||
cpu->Write_Byte = Func;
|
||||
}
|
||||
|
||||
void C68k_Set_WriteW(c68k_struc *cpu, C68K_WRITE *Func)
|
||||
{
|
||||
cpu->Write_Word = Func;
|
||||
}
|
||||
|
||||
// externals main functions
|
||||
////////////////////////////
|
||||
|
||||
u32 C68k_Get_DReg(c68k_struc *cpu, u32 num)
|
||||
{
|
||||
return cpu->D[num];
|
||||
}
|
||||
|
||||
u32 C68k_Get_AReg(c68k_struc *cpu, u32 num)
|
||||
{
|
||||
return cpu->A[num];
|
||||
}
|
||||
|
||||
u32 C68k_Get_PC(c68k_struc *cpu)
|
||||
{
|
||||
return (cpu->PC - cpu->BasePC);
|
||||
}
|
||||
|
||||
u32 C68k_Get_SR(c68k_struc *cpu)
|
||||
{
|
||||
c68k_struc *CPU = cpu;
|
||||
return GET_SR;
|
||||
}
|
||||
|
||||
u32 C68k_Get_USP(c68k_struc *cpu)
|
||||
{
|
||||
if (cpu->flag_S) return cpu->USP;
|
||||
else return cpu->A[7];
|
||||
}
|
||||
|
||||
u32 C68k_Get_MSP(c68k_struc *cpu)
|
||||
{
|
||||
if (cpu->flag_S) return cpu->A[7];
|
||||
else return cpu->USP;
|
||||
}
|
||||
|
||||
void C68k_Set_DReg(c68k_struc *cpu, u32 num, u32 val)
|
||||
{
|
||||
cpu->D[num] = val;
|
||||
}
|
||||
|
||||
void C68k_Set_AReg(c68k_struc *cpu, u32 num, u32 val)
|
||||
{
|
||||
cpu->A[num] = val;
|
||||
}
|
||||
|
||||
void C68k_Set_PC(c68k_struc *cpu, u32 val)
|
||||
{
|
||||
cpu->BasePC = cpu->Fetch[(val >> C68K_FETCH_SFT) & C68K_FETCH_MASK];
|
||||
cpu->PC = val + cpu->BasePC;
|
||||
}
|
||||
|
||||
void C68k_Set_SR(c68k_struc *cpu, u32 val)
|
||||
{
|
||||
c68k_struc *CPU = cpu;
|
||||
SET_SR(val);
|
||||
}
|
||||
|
||||
void C68k_Set_USP(c68k_struc *cpu, u32 val)
|
||||
{
|
||||
if (cpu->flag_S) cpu->USP = val;
|
||||
else cpu->A[7] = val;
|
||||
}
|
||||
|
||||
void C68k_Set_MSP(c68k_struc *cpu, u32 val)
|
||||
{
|
||||
if (cpu->flag_S) cpu->A[7] = val;
|
||||
else cpu->USP = val;
|
||||
}
|
|
@ -1,213 +0,0 @@
|
|||
/* Copyright 2003-2004 Stephane Dallongeville
|
||||
Copyright 2004 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*********************************************************************************
|
||||
* C68K.H :
|
||||
*
|
||||
* C68K include file
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef _C68K_H_
|
||||
#define _C68K_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../core.h"
|
||||
|
||||
// setting
|
||||
///////////
|
||||
|
||||
//#define NEOCD_HLE
|
||||
|
||||
//#define C68K_GEN
|
||||
#define C68K_BYTE_SWAP_OPT
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
#define C68K_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
#define BYTE_OFF 3
|
||||
#define WORD_OFF 1
|
||||
#else
|
||||
#define BYTE_OFF 0
|
||||
#define WORD_OFF 0
|
||||
#endif
|
||||
|
||||
//#define C68K_NO_JUMP_TABLE
|
||||
//#define C68K_DEBUG
|
||||
#define C68K_TAS_CAN_SET_MEMORY
|
||||
//#define C68K_CONST_JUMP_TABLE
|
||||
//#define C68K_AUTOVECTOR_CALLBACK
|
||||
|
||||
// 68K core types definitions
|
||||
//////////////////////////////
|
||||
|
||||
#define C68K_FETCH_BITS 8 // [4-12] default = 8
|
||||
#define C68K_ADR_BITS 24
|
||||
|
||||
#define C68K_FETCH_SFT (C68K_ADR_BITS - C68K_FETCH_BITS)
|
||||
#define C68K_FETCH_BANK (1 << C68K_FETCH_BITS)
|
||||
#define C68K_FETCH_MASK (C68K_FETCH_BANK - 1)
|
||||
|
||||
#define C68K_SR_C_SFT 8
|
||||
#define C68K_SR_V_SFT 7
|
||||
#define C68K_SR_Z_SFT 0
|
||||
#define C68K_SR_N_SFT 7
|
||||
#define C68K_SR_X_SFT 8
|
||||
|
||||
#define C68K_SR_S_SFT 13
|
||||
|
||||
#define C68K_SR_C (1 << C68K_SR_C_SFT)
|
||||
#define C68K_SR_V (1 << C68K_SR_V_SFT)
|
||||
#define C68K_SR_Z 0
|
||||
#define C68K_SR_N (1 << C68K_SR_N_SFT)
|
||||
#define C68K_SR_X (1 << C68K_SR_X_SFT)
|
||||
|
||||
#define C68K_SR_S (1 << C68K_SR_S_SFT)
|
||||
|
||||
#define C68K_CCR_MASK 0x1F
|
||||
#define C68K_SR_MASK (0x2700 | C68K_CCR_MASK)
|
||||
|
||||
// exception defines taken from musashi core
|
||||
#define C68K_RESET_EX 1
|
||||
#define C68K_BUS_ERROR_EX 2
|
||||
#define C68K_ADDRESS_ERROR_EX 3
|
||||
#define C68K_ILLEGAL_INSTRUCTION_EX 4
|
||||
#define C68K_ZERO_DIVIDE_EX 5
|
||||
#define C68K_CHK_EX 6
|
||||
#define C68K_TRAPV_EX 7
|
||||
#define C68K_PRIVILEGE_VIOLATION_EX 8
|
||||
#define C68K_TRACE_EX 9
|
||||
#define C68K_1010_EX 10
|
||||
#define C68K_1111_EX 11
|
||||
#define C68K_FORMAT_ERROR_EX 14
|
||||
#define C68K_UNINITIALIZED_INTERRUPT_EX 15
|
||||
#define C68K_SPURIOUS_INTERRUPT_EX 24
|
||||
#define C68K_INTERRUPT_AUTOVECTOR_EX 24
|
||||
#define C68K_TRAP_BASE_EX 32
|
||||
|
||||
#define C68K_INT_ACK_AUTOVECTOR -1
|
||||
|
||||
#define C68K_RUNNING 0x01
|
||||
#define C68K_HALTED 0x02
|
||||
#define C68K_WAITING 0x04
|
||||
#define C68K_DISABLE 0x10
|
||||
#define C68K_FAULTED 0x40
|
||||
|
||||
typedef u32 FASTCALL C68K_READ(const u32 adr);
|
||||
typedef void FASTCALL C68K_WRITE(const u32 adr, u32 data);
|
||||
|
||||
typedef s32 FASTCALL C68K_INT_CALLBACK(s32 level);
|
||||
typedef void FASTCALL C68K_RESET_CALLBACK(void);
|
||||
|
||||
typedef struct {
|
||||
u32 D[8]; // 32 bytes aligned
|
||||
u32 A[8]; // 16 bytes aligned
|
||||
|
||||
u32 flag_C; // 32 bytes aligned
|
||||
u32 flag_V;
|
||||
u32 flag_notZ;
|
||||
u32 flag_N;
|
||||
|
||||
u32 flag_X; // 16 bytes aligned
|
||||
u32 flag_I;
|
||||
u32 flag_S;
|
||||
|
||||
u32 USP;
|
||||
|
||||
pointer PC; // 32 bytes aligned
|
||||
pointer BasePC;
|
||||
u32 Status;
|
||||
s32 IRQLine;
|
||||
|
||||
s32 CycleToDo; // 16 bytes aligned
|
||||
s32 CycleIO;
|
||||
s32 CycleSup;
|
||||
u32 dirty1;
|
||||
|
||||
C68K_READ *Read_Byte; // 32 bytes aligned
|
||||
C68K_READ *Read_Word;
|
||||
|
||||
C68K_WRITE *Write_Byte;
|
||||
C68K_WRITE *Write_Word;
|
||||
|
||||
C68K_INT_CALLBACK *Interrupt_CallBack; // 16 bytes aligned
|
||||
C68K_RESET_CALLBACK *Reset_CallBack;
|
||||
|
||||
pointer Fetch[C68K_FETCH_BANK]; // 32 bytes aligned
|
||||
} c68k_struc;
|
||||
|
||||
|
||||
// 68K core var declaration
|
||||
////////////////////////////
|
||||
|
||||
extern c68k_struc C68K;
|
||||
|
||||
|
||||
// 68K core function declaration
|
||||
/////////////////////////////////
|
||||
|
||||
void C68k_Init(c68k_struc *cpu, C68K_INT_CALLBACK *int_cb);
|
||||
|
||||
s32 FASTCALL C68k_Reset(c68k_struc *cpu);
|
||||
|
||||
// if < 0 --> error (cpu state returned)
|
||||
// if >= 0 --> number of extras cycles done
|
||||
s32 FASTCALL C68k_Exec(c68k_struc *cpu, s32 cycle);
|
||||
|
||||
void FASTCALL C68k_Set_IRQ(c68k_struc *cpu, s32 level);
|
||||
|
||||
s32 FASTCALL C68k_Get_CycleToDo(c68k_struc *cpu);
|
||||
s32 FASTCALL C68k_Get_CycleRemaining(c68k_struc *cpu);
|
||||
s32 FASTCALL C68k_Get_CycleDone(c68k_struc *cpu);
|
||||
void FASTCALL C68k_Release_Cycle(c68k_struc *cpu);
|
||||
void FASTCALL C68k_Add_Cycle(c68k_struc *cpu, s32 cycle);
|
||||
|
||||
void C68k_Set_Fetch(c68k_struc *cpu, u32 low_adr, u32 high_adr, pointer fetch_adr);
|
||||
|
||||
void C68k_Set_ReadB(c68k_struc *cpu, C68K_READ *Func);
|
||||
void C68k_Set_ReadW(c68k_struc *cpu, C68K_READ *Func);
|
||||
void C68k_Set_WriteB(c68k_struc *cpu, C68K_WRITE *Func);
|
||||
void C68k_Set_WriteW(c68k_struc *cpu, C68K_WRITE *Func);
|
||||
|
||||
u32 C68k_Get_DReg(c68k_struc *cpu, u32 num);
|
||||
u32 C68k_Get_AReg(c68k_struc *cpu, u32 num);
|
||||
u32 C68k_Get_PC(c68k_struc *cpu);
|
||||
u32 C68k_Get_SR(c68k_struc *cpu);
|
||||
u32 C68k_Get_USP(c68k_struc *cpu);
|
||||
u32 C68k_Get_MSP(c68k_struc *cpu);
|
||||
|
||||
void C68k_Set_DReg(c68k_struc *cpu, u32 num, u32 val);
|
||||
void C68k_Set_AReg(c68k_struc *cpu, u32 num, u32 val);
|
||||
void C68k_Set_PC(c68k_struc *cpu, u32 val);
|
||||
void C68k_Set_SR(c68k_struc *cpu, u32 val);
|
||||
void C68k_Set_USP(c68k_struc *cpu, u32 val);
|
||||
void C68k_Set_MSP(c68k_struc *cpu, u32 val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _C68K_H_
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,335 +0,0 @@
|
|||
/* Copyright 2003-2004 Stephane Dallongeville
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "../core.h"
|
||||
#include "c68k.h"
|
||||
|
||||
// #define TRACE_WITH_Q68 // Define to use Q68 tracing code to trace insns
|
||||
// (requires Q68 built in, of course)
|
||||
|
||||
#ifdef NEOCD_HLE
|
||||
void cdrom_load_files(void);
|
||||
void neogeo_cdda_control(void);
|
||||
void neogeo_prio_switch(void);
|
||||
void neogeo_upload(void);
|
||||
#endif
|
||||
|
||||
// exception cycle table (taken from musashi core)
|
||||
static const s32 c68k_exception_cycle_table[256] =
|
||||
{
|
||||
4, // 0: Reset - Initial Stack Pointer
|
||||
4, // 1: Reset - Initial Program Counter
|
||||
50, // 2: Bus Error
|
||||
50, // 3: Address Error
|
||||
34, // 4: Illegal Instruction
|
||||
38, // 5: Divide by Zero
|
||||
40, // 6: CHK
|
||||
34, // 7: TRAPV
|
||||
34, // 8: Privilege Violation
|
||||
34, // 9: Trace
|
||||
4, // 10:
|
||||
4, // 11:
|
||||
4, // 12: RESERVED
|
||||
4, // 13: Coprocessor Protocol Violation
|
||||
4, // 14: Format Error
|
||||
44, // 15: Uninitialized Interrupt
|
||||
4, // 16: RESERVED
|
||||
4, // 17: RESERVED
|
||||
4, // 18: RESERVED
|
||||
4, // 19: RESERVED
|
||||
4, // 20: RESERVED
|
||||
4, // 21: RESERVED
|
||||
4, // 22: RESERVED
|
||||
4, // 23: RESERVED
|
||||
44, // 24: Spurious Interrupt
|
||||
44, // 25: Level 1 Interrupt Autovector
|
||||
44, // 26: Level 2 Interrupt Autovector
|
||||
44, // 27: Level 3 Interrupt Autovector
|
||||
44, // 28: Level 4 Interrupt Autovector
|
||||
44, // 29: Level 5 Interrupt Autovector
|
||||
44, // 30: Level 6 Interrupt Autovector
|
||||
44, // 31: Level 7 Interrupt Autovector
|
||||
34, // 32: TRAP #0
|
||||
34, // 33: TRAP #1
|
||||
34, // 34: TRAP #2
|
||||
34, // 35: TRAP #3
|
||||
34, // 36: TRAP #4
|
||||
34, // 37: TRAP #5
|
||||
34, // 38: TRAP #6
|
||||
34, // 39: TRAP #7
|
||||
34, // 40: TRAP #8
|
||||
34, // 41: TRAP #9
|
||||
34, // 42: TRAP #10
|
||||
34, // 43: TRAP #11
|
||||
34, // 44: TRAP #12
|
||||
34, // 45: TRAP #13
|
||||
34, // 46: TRAP #14
|
||||
34, // 47: TRAP #15
|
||||
4, // 48: FP Branch or Set on Unknown Condition
|
||||
4, // 49: FP Inexact Result
|
||||
4, // 50: FP Divide by Zero
|
||||
4, // 51: FP Underflow
|
||||
4, // 52: FP Operand Error
|
||||
4, // 53: FP Overflow
|
||||
4, // 54: FP Signaling NAN
|
||||
4, // 55: FP Unimplemented Data Type
|
||||
4, // 56: MMU Configuration Error
|
||||
4, // 57: MMU Illegal Operation Error
|
||||
4, // 58: MMU Access Level Violation Error
|
||||
4, // 59: RESERVED
|
||||
4, // 60: RESERVED
|
||||
4, // 61: RESERVED
|
||||
4, // 62: RESERVED
|
||||
4, // 63: RESERVED
|
||||
// 64-255: User Defined
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
|
||||
4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
|
||||
};
|
||||
|
||||
// global variable
|
||||
///////////////////
|
||||
|
||||
#ifndef C68K_GEN
|
||||
|
||||
#ifndef C68K_NO_JUMP_TABLE
|
||||
#ifndef C68K_CONST_JUMP_TABLE
|
||||
static void *JumpTable[0x10000];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static u32 C68k_Initialised = 0;
|
||||
|
||||
#endif // C68K_GEN
|
||||
|
||||
#ifdef NEOCD_HLE
|
||||
extern int img_display;
|
||||
#endif
|
||||
|
||||
// include macro file
|
||||
//////////////////////
|
||||
|
||||
#include "c68kmac.inc"
|
||||
|
||||
#ifndef C68K_GEN
|
||||
# ifdef TRACE_WITH_Q68
|
||||
#include "../q68/q68.h"
|
||||
static c68k_struc *TRACE_CPU;
|
||||
static uint32_t readw(uint32_t address) {
|
||||
return TRACE_CPU->Read_Word(address);
|
||||
}
|
||||
/* Make our own version of the structure to avoid the overhead of dozens of
|
||||
* function calls every instruction */
|
||||
static struct {
|
||||
u32 D[8], A[8], PC, SR, USP, SSP, dummy[7];
|
||||
void *readb, *readw, *writeb, *writew;
|
||||
} state = {.readw = readw};
|
||||
void TRACE(int PC,c68k_struc *CPU,int Opcode,int CCnt) {
|
||||
static FILE *f;
|
||||
if (!f) f = fopen("c68k.log", "w");
|
||||
TRACE_CPU = CPU;
|
||||
memcpy(state.D, CPU->D, 16*4);
|
||||
state.PC = PC - 2 - CPU->BasePC;
|
||||
state.SR = GET_SR;
|
||||
if (f) q68_trace((Q68State *)&state, f,
|
||||
CPU->CycleToDo - CCnt, CPU->CycleToDo);
|
||||
}
|
||||
# endif // TRACE_WITH_Q68
|
||||
#endif // !C68K_GEN
|
||||
|
||||
// main exec function
|
||||
//////////////////////
|
||||
|
||||
s32 FASTCALL C68k_Exec(c68k_struc *cpu, s32 cycle)
|
||||
{
|
||||
#ifndef C68K_GEN
|
||||
#if 0
|
||||
register c68k_struc *CPU asm ("ebx");
|
||||
register pointer PC asm ("esi");
|
||||
register s32 CCnt asm ("edi");
|
||||
// register u32 Opcode asm ("edi");
|
||||
// c68k_struc *CPU;
|
||||
// u32 PC;
|
||||
// s32 CCnt;
|
||||
u32 Opcode;
|
||||
#else
|
||||
// register c68k_struc *CPU asm ("r10");
|
||||
// register u32 PC asm ("r11");
|
||||
// register s32 CCnt asm ("r12");
|
||||
// register u32 Opcode asm ("r13");
|
||||
c68k_struc *CPU;
|
||||
pointer PC;
|
||||
s32 CCnt;
|
||||
u32 Opcode;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef C68K_GEN
|
||||
|
||||
#ifndef C68K_NO_JUMP_TABLE
|
||||
#ifdef C68K_CONST_JUMP_TABLE
|
||||
#include "c68k_ini.inc"
|
||||
#endif
|
||||
#else
|
||||
C68k_Initialised = 1;
|
||||
#endif
|
||||
|
||||
CPU = cpu;
|
||||
PC = CPU->PC;
|
||||
|
||||
if (CPU->Status & (C68K_RUNNING | C68K_DISABLE | C68K_FAULTED))
|
||||
{
|
||||
#ifndef C68K_NO_JUMP_TABLE
|
||||
#ifndef C68K_CONST_JUMP_TABLE
|
||||
if (!C68k_Initialised) goto C68k_Init;
|
||||
#endif
|
||||
#endif
|
||||
return (CPU->Status | 0x80000000);
|
||||
}
|
||||
|
||||
if (cycle <= 0) return -cycle;
|
||||
|
||||
CPU->CycleToDo = CCnt = cycle;
|
||||
|
||||
#ifndef C68K_DEBUG
|
||||
CHECK_INT
|
||||
#else
|
||||
{
|
||||
s32 line, vect;
|
||||
|
||||
line = CPU->IRQLine;
|
||||
|
||||
if ((line == 7) || (line > CPU->flag_I))
|
||||
{
|
||||
PRE_IO
|
||||
|
||||
/* get vector */
|
||||
CPU->IRQLine = 0;
|
||||
vect = CPU->Interrupt_CallBack(line);
|
||||
if (vect == C68K_INT_ACK_AUTOVECTOR)
|
||||
vect = C68K_INTERRUPT_AUTOVECTOR_EX + (line & 7);
|
||||
|
||||
/* adjust CCnt */
|
||||
CCnt -= c68k_exception_cycle_table[vect];
|
||||
|
||||
/* swap A7 and USP */
|
||||
if (!CPU->flag_S)
|
||||
{
|
||||
u32 tmpSP;
|
||||
|
||||
tmpSP = CPU->USP;
|
||||
CPU->USP = CPU->A[7];
|
||||
CPU->A[7] = tmpSP;
|
||||
}
|
||||
|
||||
/* push PC and SR */
|
||||
PUSH_32_F(PC - CPU->BasePC)
|
||||
PUSH_16_F(GET_SR)
|
||||
|
||||
/* adjust SR */
|
||||
CPU->flag_S = C68K_SR_S;
|
||||
CPU->flag_I = line;
|
||||
|
||||
/* fetch new PC */
|
||||
READ_LONG_F(vect * 4, PC)
|
||||
SET_PC(PC)
|
||||
|
||||
POST_IO
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (CPU->Status & (C68K_HALTED | C68K_WAITING)) return CPU->CycleToDo;
|
||||
|
||||
CPU->CycleSup = 0;
|
||||
CPU->Status |= C68K_RUNNING;
|
||||
|
||||
#ifndef C68K_DEBUG
|
||||
NEXT
|
||||
#else
|
||||
#ifdef C68K_NO_JUMP_TABLE
|
||||
NEXT
|
||||
#else
|
||||
Opcode = FETCH_WORD;
|
||||
PC += 2;
|
||||
goto *JumpTable[Opcode];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef C68K_NO_JUMP_TABLE
|
||||
SwitchTable:
|
||||
switch(Opcode)
|
||||
{
|
||||
#endif
|
||||
#include "c68k_op0.inc"
|
||||
#include "c68k_op1.inc"
|
||||
#include "c68k_op2.inc"
|
||||
#include "c68k_op3.inc"
|
||||
#include "c68k_op4.inc"
|
||||
#include "c68k_op5.inc"
|
||||
#include "c68k_op6.inc"
|
||||
#include "c68k_op7.inc"
|
||||
#include "c68k_op8.inc"
|
||||
#include "c68k_op9.inc"
|
||||
#include "c68k_opA.inc"
|
||||
#include "c68k_opB.inc"
|
||||
#include "c68k_opC.inc"
|
||||
#include "c68k_opD.inc"
|
||||
#include "c68k_opE.inc"
|
||||
#include "c68k_opF.inc"
|
||||
#ifdef C68K_NO_JUMP_TABLE
|
||||
}
|
||||
#endif
|
||||
|
||||
C68k_Exec_End:
|
||||
CHECK_INT
|
||||
if ((CCnt += CPU->CycleSup) > 0)
|
||||
{
|
||||
CPU->CycleSup = 0;
|
||||
NEXT;
|
||||
}
|
||||
|
||||
C68k_Exec_Really_End:
|
||||
CPU->Status &= ~C68K_RUNNING;
|
||||
CPU->PC = PC;
|
||||
|
||||
return (CPU->CycleToDo - CCnt);
|
||||
|
||||
#ifndef C68K_CONST_JUMP_TABLE
|
||||
#ifndef C68K_NO_JUMP_TABLE
|
||||
C68k_Init:
|
||||
{
|
||||
u32 i, j;
|
||||
|
||||
#include "c68k_ini.inc"
|
||||
|
||||
C68k_Initialised = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,307 +0,0 @@
|
|||
/* Copyright 2003-2004 Stephane Dallongeville
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
// internals core macros
|
||||
/////////////////////////
|
||||
|
||||
#define LSL(A, C) ((A) << (C))
|
||||
#define LSR(A, C) ((A) >> (C))
|
||||
|
||||
#define LSR_32(A, C) ((C) < 32 ? (A) >> (C) : 0)
|
||||
#define LSL_32(A, C) ((C) < 32 ? (A) << (C) : 0)
|
||||
|
||||
#define ROL_8(A, C) (LSL(A, C) | LSR(A, 8-(C)))
|
||||
#define ROL_9(A, C) (LSL(A, C) | LSR(A, 9-(C)))
|
||||
#define ROL_16(A, C) (LSL(A, C) | LSR(A, 16-(C)))
|
||||
#define ROL_17(A, C) (LSL(A, C) | LSR(A, 17-(C)))
|
||||
#define ROL_32(A, C) (LSL_32(A, C) | LSR_32(A, 32-(C)))
|
||||
#define ROL_33(A, C) (LSL_32(A, C) | LSR_32(A, 33-(C)))
|
||||
|
||||
#define ROR_8(A, C) (LSR(A, C) | LSL(A, 8-(C)))
|
||||
#define ROR_9(A, C) (LSR(A, C) | LSL(A, 9-(C)))
|
||||
#define ROR_16(A, C) (LSR(A, C) | LSL(A, 16-(C)))
|
||||
#define ROR_17(A, C) (LSR(A, C) | LSL(A, 17-(C)))
|
||||
#define ROR_32(A, C) (LSR_32(A, C) | LSL_32(A, 32-(C)))
|
||||
#define ROR_33(A, C) (LSR_32(A, C) | LSL_32(A, 33-(C)))
|
||||
|
||||
|
||||
#ifdef TRACE_WITH_Q68
|
||||
extern void TRACE(int,c68k_struc*,int,int);
|
||||
#else
|
||||
# define TRACE(a,b,c,d) /*nothing*/
|
||||
#endif
|
||||
#ifndef C68K_NO_JUMP_TABLE
|
||||
#define NEXT \
|
||||
PRE_IO \
|
||||
Opcode = FETCH_WORD; \
|
||||
PC += 2; \
|
||||
TRACE(PC, CPU, Opcode, CCnt); \
|
||||
goto *JumpTable[Opcode];
|
||||
#else
|
||||
#define NEXT \
|
||||
PRE_IO \
|
||||
Opcode = FETCH_WORD; \
|
||||
PC += 2; \
|
||||
TRACE(PC, CPU, Opcode, CCnt); \
|
||||
goto SwitchTable;
|
||||
#endif
|
||||
|
||||
#define RET(A) \
|
||||
CCnt -= (A); \
|
||||
if (CCnt <= 0) goto C68k_Exec_End; \
|
||||
NEXT
|
||||
|
||||
#define SET_PC(A) \
|
||||
CPU->BasePC = CPU->Fetch[((A) >> C68K_FETCH_SFT) & C68K_FETCH_MASK]; \
|
||||
CPU->BasePC -= (A) & 0xFF000000; \
|
||||
PC = (A) + CPU->BasePC;
|
||||
|
||||
#define PRE_IO \
|
||||
CPU->CycleIO = CCnt;
|
||||
|
||||
#define POST_IO \
|
||||
CCnt = CPU->CycleIO;
|
||||
|
||||
#define READ_BYTE_F(A, D) \
|
||||
D = CPU->Read_Byte(A) & 0xFF;
|
||||
|
||||
#define READ_WORD_F(A, D) \
|
||||
D = CPU->Read_Word(A) & 0xFFFF;
|
||||
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
#define READ_LONG_F(A, D) \
|
||||
D = CPU->Read_Word((A)) << 16; \
|
||||
D |= CPU->Read_Word((A) + 2) & 0xFFFF;
|
||||
|
||||
#define READ_LONG_DEC_F(A, D) \
|
||||
D = CPU->Read_Word((A) + 2) & 0xFFFF; \
|
||||
D |= CPU->Read_Word((A)) << 16;
|
||||
#else
|
||||
#define READ_LONG_F(A, D) \
|
||||
D = CPU->Read_Word((A)) << 16; \
|
||||
D |= CPU->Read_Word((A) + 2) & 0xFFFF;
|
||||
|
||||
#define READ_LONG_DEC_F(A, D) \
|
||||
D = CPU->Read_Word((A) + 2) & 0xFFFF; \
|
||||
D |= CPU->Read_Word((A)) << 16;
|
||||
#endif
|
||||
|
||||
#define READSX_BYTE_F(A, D) \
|
||||
D = (s32)(s8)CPU->Read_Byte(A);
|
||||
|
||||
#define READSX_WORD_F(A, D) \
|
||||
D = (s32)(s16)CPU->Read_Word(A);
|
||||
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
#define READSX_LONG_F(A, D) \
|
||||
D = CPU->Read_Word((A)) << 16; \
|
||||
D |= CPU->Read_Word((A) + 2) & 0xFFFF;
|
||||
|
||||
#define READSX_LONG_DEC_F(A, D) \
|
||||
D = CPU->Read_Word((A) + 2) & 0xFFFF; \
|
||||
D |= CPU->Read_Word((A)) << 16;
|
||||
#else
|
||||
#define READSX_LONG_F(A, D) \
|
||||
D = CPU->Read_Word((A)) << 16; \
|
||||
D |= CPU->Read_Word((A) + 2) & 0xFFFF;
|
||||
|
||||
#define READSX_LONG_DEC_F(A, D) \
|
||||
D = CPU->Read_Word((A) + 2) & 0xFFFF; \
|
||||
D |= CPU->Read_Word((A)) << 16;
|
||||
#endif
|
||||
|
||||
#define WRITE_BYTE_F(A, D) \
|
||||
CPU->Write_Byte(A, D);
|
||||
|
||||
#define WRITE_WORD_F(A, D) \
|
||||
CPU->Write_Word(A, D);
|
||||
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
#define WRITE_LONG_F(A, D) \
|
||||
CPU->Write_Word((A), (D) >> 16); \
|
||||
CPU->Write_Word((A) + 2, (D) & 0xFFFF);
|
||||
|
||||
#define WRITE_LONG_DEC_F(A, D) \
|
||||
CPU->Write_Word((A) + 2, (D) & 0xFFFF); \
|
||||
CPU->Write_Word((A), (D) >> 16);
|
||||
#else
|
||||
#define WRITE_LONG_F(A, D) \
|
||||
CPU->Write_Word((A), (D) >> 16); \
|
||||
CPU->Write_Word((A) + 2, (D) & 0xFFFF);
|
||||
|
||||
#define WRITE_LONG_DEC_F(A, D) \
|
||||
CPU->Write_Word((A) + 2, (D) & 0xFFFF); \
|
||||
CPU->Write_Word((A), (D) >> 16);
|
||||
#endif
|
||||
|
||||
#define PUSH_16_F(D) \
|
||||
CPU->Write_Word(CPU->A[7] -= 2, D); \
|
||||
|
||||
#define POP_16_F(D) \
|
||||
D = (u16)CPU->Read_Word(CPU->A[7]); \
|
||||
CPU->A[7] += 2;
|
||||
|
||||
#ifdef C68K_BIG_ENDIAN
|
||||
#define PUSH_32_F(D) \
|
||||
CPU->A[7] -= 4; \
|
||||
CPU->Write_Word(CPU->A[7] + 2, (D) & 0xFFFF); \
|
||||
CPU->Write_Word(CPU->A[7], (D) >> 16);
|
||||
|
||||
#define POP_32_F(D) \
|
||||
D = CPU->Read_Word(CPU->A[7]) << 16; \
|
||||
D |= CPU->Read_Word(CPU->A[7] + 2) & 0xFFFF; \
|
||||
CPU->A[7] += 4;
|
||||
#else
|
||||
#define PUSH_32_F(D) \
|
||||
CPU->A[7] -= 4; \
|
||||
CPU->Write_Word(CPU->A[7] + 2, (D) & 0xFFFF); \
|
||||
CPU->Write_Word(CPU->A[7], (D) >> 16);
|
||||
|
||||
#define POP_32_F(D) \
|
||||
D = CPU->Read_Word(CPU->A[7]) << 16; \
|
||||
D |= CPU->Read_Word(CPU->A[7] + 2) & 0xFFFF; \
|
||||
CPU->A[7] += 4;
|
||||
#endif
|
||||
|
||||
#define FETCH_BYTE \
|
||||
((*(u16*)PC) & 0xFF)
|
||||
|
||||
#define FETCH_WORD \
|
||||
(*(u16*)PC)
|
||||
|
||||
|
||||
#define FETCH_LONG \
|
||||
(*(u32*)PC)
|
||||
|
||||
#define DECODE_EXT_WORD \
|
||||
{ \
|
||||
u32 ext; \
|
||||
\
|
||||
ext = (*(u16*)PC); \
|
||||
PC += 2; \
|
||||
\
|
||||
adr += (s32)((s8)(ext)); \
|
||||
if (ext & 0x0800) adr += (s32) CPU->D[ext >> 12]; \
|
||||
else adr += (s32)((s16)(CPU->D[ext >> 12])); \
|
||||
}
|
||||
|
||||
#ifndef C68K_BIG_ENDIAN
|
||||
#ifdef C68K_BYTE_SWAP_OPT
|
||||
#undef FETCH_LONG
|
||||
#define FETCH_LONG \
|
||||
((((u32)(*(u16*)PC)) << 16) | ((u32)(*(u16*)(PC + 2))))
|
||||
// ((((u32)(*(u8*)(PC + 2))) | (((u32)(*(u8*)(PC + 3))) << 8) | (((u32)(*(u8*)PC)) << 16) | (((u32)(*(u8*)(PC + 1))) << 24)))
|
||||
#else
|
||||
#undef FETCH_BYTE
|
||||
#define FETCH_BYTE \
|
||||
(*(u16*)PC) >> 8)
|
||||
|
||||
#undef FETCH_WORD
|
||||
#define FETCH_WORD \
|
||||
((((u16)(*(u8*)PC)) << 8) | ((u16)(*(u8*)(PC + 1))))
|
||||
// ((((u16)(*(u8*)(PC + 1))) | (((u16)(*(u8*)PC)) << 8)))
|
||||
|
||||
#undef FETCH_LONG
|
||||
#define FETCH_LONG \
|
||||
((((u32)(*(u8*)PC)) << 24) | (((u32)(*(u8*)(PC + 1))) << 16) | (((u32)(*(u8*)(PC + 2))) << 8) | ((u32)(*(u8*)(PC + 3))))
|
||||
// ((((u32)(*(u8*)(PC + 3))) | (((u32)(*(u8*)(PC + 2))) << 8) | (((u32)(*(u8*)(PC + 1))) << 16) | (((u32)(*(u8*)PC)) << 24)))
|
||||
|
||||
#undef DECODE_EXT_WORD
|
||||
#define DECODE_EXT_WORD \
|
||||
{ \
|
||||
u32 ext; \
|
||||
\
|
||||
ext = (*(u16*)PC); \
|
||||
PC += 2; \
|
||||
\
|
||||
adr += (s32)((s8)(ext >> 8)); \
|
||||
if (ext & 0x0008) adr += (s32) CPU->D[(ext >> 4) & 0x000F]; \
|
||||
else adr += (s32)((s16)(CPU->D[(ext >> 4) & 0x000F])); \
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define GET_CCR \
|
||||
(((CPU->flag_C >> (C68K_SR_C_SFT - 0)) & 1) | \
|
||||
((CPU->flag_V >> (C68K_SR_V_SFT - 1)) & 2) | \
|
||||
(((!CPU->flag_notZ) & 1) << 2) | \
|
||||
((CPU->flag_N >> (C68K_SR_N_SFT - 3)) & 8) | \
|
||||
((CPU->flag_X >> (C68K_SR_X_SFT - 4)) & 0x10))
|
||||
|
||||
#define GET_SR \
|
||||
((CPU->flag_S << 0) | \
|
||||
(CPU->flag_I << 8) | \
|
||||
GET_CCR)
|
||||
|
||||
#define SET_CCR(A) \
|
||||
CPU->flag_C = (A) << (C68K_SR_C_SFT - 0); \
|
||||
CPU->flag_V = (A) << (C68K_SR_V_SFT - 1); \
|
||||
CPU->flag_notZ = ~(A) & 4; \
|
||||
CPU->flag_N = (A) << (C68K_SR_N_SFT - 3); \
|
||||
CPU->flag_X = (A) << (C68K_SR_X_SFT - 4);
|
||||
|
||||
#define SET_SR(A) \
|
||||
SET_CCR(A) \
|
||||
CPU->flag_I = ((A) >> 8) & 7; \
|
||||
CPU->flag_S = (A) & C68K_SR_S;
|
||||
|
||||
#define CHECK_INT \
|
||||
{ \
|
||||
s32 line, vect; \
|
||||
\
|
||||
line = CPU->IRQLine; \
|
||||
\
|
||||
if ((line == 7) || (line > CPU->flag_I)) \
|
||||
{ \
|
||||
/* get vector */ \
|
||||
CPU->IRQLine = 0; \
|
||||
vect = CPU->Interrupt_CallBack(line); \
|
||||
if (vect == C68K_INT_ACK_AUTOVECTOR) \
|
||||
vect = C68K_INTERRUPT_AUTOVECTOR_EX + (line & 7); \
|
||||
\
|
||||
/* adjust CCnt */ \
|
||||
CCnt -= c68k_exception_cycle_table[vect]; \
|
||||
\
|
||||
/* swap A7 and USP */ \
|
||||
if (!CPU->flag_S) \
|
||||
{ \
|
||||
u32 tmpSP; \
|
||||
\
|
||||
tmpSP = CPU->USP; \
|
||||
CPU->USP = CPU->A[7]; \
|
||||
CPU->A[7] = tmpSP; \
|
||||
} \
|
||||
\
|
||||
PRE_IO \
|
||||
\
|
||||
/* push PC and SR */ \
|
||||
PUSH_32_F(PC - CPU->BasePC) \
|
||||
PUSH_16_F(GET_SR) \
|
||||
\
|
||||
/* adjust SR */ \
|
||||
CPU->flag_S = C68K_SR_S; \
|
||||
CPU->flag_I = line; \
|
||||
\
|
||||
/* fetch new PC */ \
|
||||
READ_LONG_F(vect * 4, PC) \
|
||||
SET_PC(PC) \
|
||||
\
|
||||
POST_IO \
|
||||
} \
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
AC_INIT(gen68k, 0.9.10)
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
AM_INIT_AUTOMAKE([1.8.0 foreign])
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
AC_LANG(C)
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
AC_OUTPUT
|
File diff suppressed because it is too large
Load Diff
|
@ -1,68 +0,0 @@
|
|||
/* Copyright 2003-2004 Stephane Dallongeville
|
||||
Copyright 2004 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/*********************************************************************************
|
||||
* GEN68K.H :
|
||||
*
|
||||
* C68K generator include file
|
||||
*
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef _GEN68K_H_
|
||||
#define _GEN68K_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// setting
|
||||
///////////
|
||||
|
||||
// structure definition
|
||||
////////////////////////
|
||||
|
||||
typedef struct {
|
||||
u32 name;
|
||||
u32 mask;
|
||||
u32 match;
|
||||
} c68k_ea_info_struc;
|
||||
|
||||
typedef struct __c68k_op_info_struc {
|
||||
s8 op_name[8 + 1];
|
||||
u16 op_base;
|
||||
u16 op_mask;
|
||||
s8 size_type;
|
||||
s8 size_sft;
|
||||
s8 eam_sft;
|
||||
s8 reg_sft;
|
||||
s8 eam2_sft;
|
||||
s8 reg2_sft;
|
||||
s8 ea_supported[12 + 1];
|
||||
s8 ea2_supported[12 + 1];
|
||||
void (*genfunc)(void);
|
||||
} c68k_op_info_struc;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _GEN68K_H_
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,36 +0,0 @@
|
|||
project(yabause-carbon)
|
||||
|
||||
find_library(CARBON_LIBRARY carbon)
|
||||
|
||||
if (NOT CARBON_LIBRARY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(yabause_carbon_SOURCES main.c settings.c settings.h cpustatus.c cpustatus.h)
|
||||
|
||||
add_executable(yabause-carbon ${yabause_carbon_SOURCES})
|
||||
target_link_libraries(yabause-carbon yabause ${YABAUSE_LIBRARIES} ${CARBON_LIBRARY})
|
||||
|
||||
if (NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_SOURCE_DIR}/Yabause.app" "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app"
|
||||
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/Yabause.app"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app"
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS/yabause"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:yabause-carbon> "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS/yabause"
|
||||
DEPENDS yabause-carbon
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS"
|
||||
)
|
||||
|
||||
add_custom_target(yabause-carbon-app ALL
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS/yabause")
|
|
@ -1,23 +0,0 @@
|
|||
EXTRA_DIST = build_dmg.sh Yabause.app/Contents/Info.plist Yabause.app/Contents/Resources/yabause.icns \
|
||||
Yabause.app/Contents/Resources/cpustatus.nib/classes.nib Yabause.app/Contents/Resources/cpustatus.nib/info.nib \
|
||||
Yabause.app/Contents/Resources/cpustatus.nib/objects.xib \
|
||||
Yabause.app/Contents/Resources/menu.nib/classes.nib Yabause.app/Contents/Resources/menu.nib/info.nib \
|
||||
Yabause.app/Contents/Resources/menu.nib/objects.xib \
|
||||
Yabause.app/Contents/Resources/preferences.nib/classes.nib Yabause.app/Contents/Resources/preferences.nib/info.nib \
|
||||
Yabause.app/Contents/Resources/preferences.nib/objects.xib
|
||||
bin_PROGRAMS = yabause
|
||||
yabause_SOURCES = main.c settings.c settings.h cpustatus.c cpustatus.h
|
||||
yabause_CFLAGS = $(YAB_CFLAGS)
|
||||
yabause_LDADD = $(YAB_LIBS) ../libyabause.a
|
||||
|
||||
all-local:
|
||||
if [ ! -e Yabause.app/Contents/MacOS ]; then mkdir Yabause.app/Contents/MacOS; fi
|
||||
cp yabause Yabause.app/Contents/MacOS
|
||||
if [ ! -e Yabause.app/Contents/Frameworks ]; then mkdir Yabause.app/Contents/Frameworks; fi
|
||||
if [ ! -e Yabause.app/Contents/Frameworks/SDL.framework ]; then \
|
||||
if [ -e /Library/Frameworks/SDL.framework ]; then \
|
||||
cp -R /Library/Frameworks/SDL.framework Yabause.app/Contents/Frameworks; \
|
||||
elif [ -e ~/Library/Frameworks/SDL.framework ]; then \
|
||||
cp -R ~/Library/Frameworks/SDL.framework Yabause.app/Contents/Frameworks; \
|
||||
fi; \
|
||||
fi
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>yabause</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>yabause.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.yabause.Yabause</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Yabause</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.10</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.9.10</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
IBClasses = ();
|
||||
IBVersion = 1;
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>76 101 356 240 0 0 1280 1002 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBLockedObjects</key>
|
||||
<array>
|
||||
<integer>223</integer>
|
||||
<integer>239</integer>
|
||||
<integer>240</integer>
|
||||
<integer>241</integer>
|
||||
<integer>242</integer>
|
||||
<integer>243</integer>
|
||||
<integer>244</integer>
|
||||
<integer>245</integer>
|
||||
<integer>232</integer>
|
||||
<integer>235</integer>
|
||||
<integer>246</integer>
|
||||
<integer>247</integer>
|
||||
<integer>248</integer>
|
||||
<integer>249</integer>
|
||||
<integer>250</integer>
|
||||
<integer>251</integer>
|
||||
<integer>252</integer>
|
||||
<integer>253</integer>
|
||||
<integer>254</integer>
|
||||
<integer>258</integer>
|
||||
<integer>259</integer>
|
||||
<integer>261</integer>
|
||||
<integer>277</integer>
|
||||
<integer>296</integer>
|
||||
<integer>286</integer>
|
||||
<integer>271</integer>
|
||||
<integer>267</integer>
|
||||
<integer>299</integer>
|
||||
<integer>300</integer>
|
||||
<integer>306</integer>
|
||||
<integer>304</integer>
|
||||
<integer>270</integer>
|
||||
<integer>308</integer>
|
||||
<integer>303</integer>
|
||||
<integer>266</integer>
|
||||
<integer>298</integer>
|
||||
<integer>273</integer>
|
||||
<integer>302</integer>
|
||||
<integer>274</integer>
|
||||
<integer>301</integer>
|
||||
<integer>269</integer>
|
||||
<integer>311</integer>
|
||||
<integer>310</integer>
|
||||
<integer>295</integer>
|
||||
</array>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>1</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>166</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8L2127</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCarbonFramework</string>
|
||||
</dict>
|
||||
</plist>
|
File diff suppressed because it is too large
Load Diff
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>740</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>6</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>167</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>10C540</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCarbonFramework</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<object class="NSIBObjectData">
|
||||
<object name="rootObject" class="NSCustomObject" id="1">
|
||||
</object>
|
||||
<array count="6" name="allObjects">
|
||||
<object class="IBCarbonStaticText" id="319">
|
||||
<string name="title">Address</string>
|
||||
<string name="bounds">55 20 71 72 </string>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="181">
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">50</int>
|
||||
<string name="title">Browse</string>
|
||||
<string name="bounds">20 239 40 309 </string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="180">
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">1</int>
|
||||
<string name="bounds">23 23 39 228 </string>
|
||||
</object>
|
||||
<object class="IBCarbonWindow" id="166">
|
||||
<boolean name="hasCollapseBox">FALSE</boolean>
|
||||
<boolean name="hasHorizontalZoom">FALSE</boolean>
|
||||
<boolean name="isResizable">FALSE</boolean>
|
||||
<boolean name="hasVerticalZoom">FALSE</boolean>
|
||||
<int name="carbonWindowClass">5</int>
|
||||
<string name="title">Load</string>
|
||||
<object name="rootControl" class="IBCarbonRootControl" id="167">
|
||||
<array count="4" name="subviews">
|
||||
<reference idRef="180"/>
|
||||
<reference idRef="181"/>
|
||||
<object class="IBCarbonEditText" id="318">
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">2</int>
|
||||
<string name="bounds">55 83 71 306 </string>
|
||||
</object>
|
||||
<reference idRef="319"/>
|
||||
</array>
|
||||
<string name="bounds">0 0 94 329 </string>
|
||||
</object>
|
||||
<string name="windowRect">72 111 166 440 </string>
|
||||
<string name="ScreenRectAtEncodeTime">60 0 778 1280 </string>
|
||||
</object>
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="318"/>
|
||||
</array>
|
||||
<array count="6" name="allParents">
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="1"/>
|
||||
<reference idRef="166"/>
|
||||
<reference idRef="167"/>
|
||||
</array>
|
||||
<dictionary count="2" name="nameTable">
|
||||
<string>Dialog</string>
|
||||
<reference idRef="166"/>
|
||||
<string>File's Owner</string>
|
||||
<reference idRef="1"/>
|
||||
</dictionary>
|
||||
<string name="targetFramework">IBCarbonFramework</string>
|
||||
<unsigned_int name="nextObjectID">320</unsigned_int>
|
||||
</object>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>740</string>
|
||||
<key>IBOldestOS</key>
|
||||
<integer>6</integer>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>195</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>10C540</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCarbonFramework</string>
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
IBClasses = ();
|
||||
IBVersion = 1;
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>267 126 356 240 0 0 1280 1002 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>446.1</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>166</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>8P2137</string>
|
||||
<key>targetFramework</key>
|
||||
<string>IBCarbonFramework</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,775 +0,0 @@
|
|||
<?xml version="1.0" standalone="yes"?>
|
||||
<object class="NSIBObjectData">
|
||||
<string name="targetFramework">IBCarbonFramework</string>
|
||||
<object name="rootObject" class="NSCustomObject" id="1">
|
||||
<string name="customClass">NSApplication</string>
|
||||
</object>
|
||||
<array count="114" name="allObjects">
|
||||
<object class="IBCarbonWindow" id="166">
|
||||
<string name="windowRect">81 82 409 437 </string>
|
||||
<string name="title">Yabause preferences</string>
|
||||
<object name="rootControl" class="IBCarbonRootControl" id="167">
|
||||
<string name="bounds">0 0 328 355 </string>
|
||||
<array count="1" name="subviews">
|
||||
<object class="IBCarbonTab" id="193">
|
||||
<string name="bounds">12 -1 328 360 </string>
|
||||
<array count="4" name="subviews">
|
||||
<object class="IBCarbonUserPane" id="194">
|
||||
<string name="bounds">49 -1 328 360 </string>
|
||||
<array count="3" name="subviews">
|
||||
<object class="IBCarbonGroupBox" id="182">
|
||||
<string name="bounds">50 19 116 340 </string>
|
||||
<array count="2" name="subviews">
|
||||
<object class="IBCarbonEditText" id="180">
|
||||
<string name="bounds">81 38 97 243 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">1</int>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="181">
|
||||
<string name="bounds">79 254 99 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">50</int>
|
||||
<string name="title">Browse</string>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Bios</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="183">
|
||||
<string name="bounds">124 19 218 340 </string>
|
||||
<array count="3" name="subviews">
|
||||
<object class="IBCarbonEditText" id="185">
|
||||
<string name="bounds">155 38 171 243 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">2</int>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="184">
|
||||
<string name="bounds">153 254 173 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">51</int>
|
||||
<string name="title">Browse</string>
|
||||
</object>
|
||||
<object class="IBCarbonPopupButton" id="226">
|
||||
<string name="bounds">182 35 202 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">3</int>
|
||||
<object name="menu" class="IBCarbonMenu" id="225">
|
||||
<string name="title">Popup:</string>
|
||||
<array count="3" name="items">
|
||||
<object class="IBCarbonMenuItem" id="229">
|
||||
<string name="title">Dummy CD</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="227">
|
||||
<string name="title">ISO or CUE file</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="228">
|
||||
<string name="title">Cdrom device</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Cdrom</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="192">
|
||||
<string name="bounds">226 19 290 340 </string>
|
||||
<array count="1" name="subviews">
|
||||
<object class="IBCarbonPopupButton" id="188">
|
||||
<string name="bounds">254 35 274 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">4</int>
|
||||
<object name="menu" class="IBCarbonMenu" id="187">
|
||||
<string name="title">Popup:</string>
|
||||
<array count="9" name="items">
|
||||
<object class="IBCarbonMenuItem" id="191">
|
||||
<string name="title">Auto-detect</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="298">
|
||||
<string name="title">Japan (NTSC)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="189">
|
||||
<string name="title">Asia (NTSC)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="299">
|
||||
<string name="title">North America (NTSC)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="300">
|
||||
<string name="title">Central/South America (NTSC)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="190">
|
||||
<string name="title">Korea (NTSC)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="301">
|
||||
<string name="title">Asia (PAL)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="302">
|
||||
<string name="title">Europe + others (PAL)</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="303">
|
||||
<string name="title">Central/South America (PAL)</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Region</string>
|
||||
</object>
|
||||
</array>
|
||||
<ostype name="controlSignature">tabs</ostype>
|
||||
<int name="controlID">129</int>
|
||||
<int name="featureBits">2</int>
|
||||
</object>
|
||||
<object class="IBCarbonUserPane" id="195">
|
||||
<string name="bounds">49 -1 328 360 </string>
|
||||
<array count="3" name="subviews">
|
||||
<object class="IBCarbonGroupBox" id="203">
|
||||
<string name="bounds">50 19 146 340 </string>
|
||||
<array count="2" name="subviews">
|
||||
<object class="IBCarbonPopupButton" id="202">
|
||||
<string name="bounds">78 35 98 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">5</int>
|
||||
<object name="menu" class="IBCarbonMenu" id="198">
|
||||
<string name="title">Popup:</string>
|
||||
<array count="3" name="items">
|
||||
<object class="IBCarbonMenuItem" id="201">
|
||||
<boolean name="checked">TRUE</boolean>
|
||||
<string name="title">Dummy Video Interface</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="199">
|
||||
<string name="title">OpenGL Video Interface</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="200">
|
||||
<string name="title">Software Video Interface</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBCarbonCheckBox" id="312">
|
||||
<string name="bounds">112 35 130 196 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">11</int>
|
||||
<string name="title">Enable auto frameskip</string>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Video core</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="209">
|
||||
<string name="bounds">148 19 242 340 </string>
|
||||
<array count="5" name="subviews">
|
||||
<object class="IBCarbonEditText" id="205">
|
||||
<string name="bounds">207 98 223 226 </string>
|
||||
<boolean name="enabled">FALSE</boolean>
|
||||
<string name="title">224</string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="206">
|
||||
<string name="bounds">176 35 192 87 </string>
|
||||
<string name="title">Width</string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="207">
|
||||
<string name="bounds">200 35 216 87 </string>
|
||||
<string name="title">Height</string>
|
||||
</object>
|
||||
<object class="IBCarbonCheckBox" id="208">
|
||||
<string name="bounds">178 237 192 324 </string>
|
||||
<boolean name="enabled">FALSE</boolean>
|
||||
<string name="title">Keep ratio</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="210">
|
||||
<string name="bounds">177 98 193 226 </string>
|
||||
<boolean name="enabled">FALSE</boolean>
|
||||
<string name="title">320</string>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Resolution</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="216">
|
||||
<string name="bounds">244 19 308 340 </string>
|
||||
<array count="1" name="subviews">
|
||||
<object class="IBCarbonPopupButton" id="212">
|
||||
<string name="bounds">272 35 292 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">6</int>
|
||||
<object name="menu" class="IBCarbonMenu" id="211">
|
||||
<string name="title">Popup:</string>
|
||||
<array count="2" name="items">
|
||||
<object class="IBCarbonMenuItem" id="215">
|
||||
<string name="title">Dummy Sound Interface</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="213">
|
||||
<string name="title">SDL Sound Interface</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Sound core</string>
|
||||
</object>
|
||||
</array>
|
||||
<ostype name="controlSignature">tabs</ostype>
|
||||
<int name="controlID">130</int>
|
||||
<int name="featureBits">2</int>
|
||||
</object>
|
||||
<object class="IBCarbonUserPane" id="196">
|
||||
<string name="bounds">49 -1 328 360 </string>
|
||||
<array count="3" name="subviews">
|
||||
<object class="IBCarbonGroupBox" id="224">
|
||||
<string name="bounds">50 19 144 340 </string>
|
||||
<array count="3" name="subviews">
|
||||
<object class="IBCarbonEditText" id="217">
|
||||
<string name="bounds">81 38 97 243 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">7</int>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="218">
|
||||
<string name="bounds">79 254 99 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">52</int>
|
||||
<string name="title">Browse</string>
|
||||
</object>
|
||||
<object class="IBCarbonPopupButton" id="220">
|
||||
<string name="bounds">108 35 128 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">8</int>
|
||||
<object name="menu" class="IBCarbonMenu" id="219">
|
||||
<string name="title">Popup:</string>
|
||||
<array count="10" name="items">
|
||||
<object class="IBCarbonMenuItem" id="223">
|
||||
<string name="title">None</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="221">
|
||||
<string name="title">Pro Action Replay</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="222">
|
||||
<string name="title">4 Mbit Backup Ram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="305">
|
||||
<string name="title">8 Mbit Backup Ram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="306">
|
||||
<string name="title">16 Mbit Backup Ram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="307">
|
||||
<string name="title">32 Mbit Backup Ram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="308">
|
||||
<string name="title">8 Mbit Dram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="309">
|
||||
<string name="title">32 Mbit Dram</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="310">
|
||||
<string name="title">Netlink</string>
|
||||
</object>
|
||||
<object class="IBCarbonMenuItem" id="311">
|
||||
<string name="title">16 Mbit ROM</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Cartridge</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="230">
|
||||
<string name="bounds">152 19 218 340 </string>
|
||||
<array count="2" name="subviews">
|
||||
<object class="IBCarbonEditText" id="232">
|
||||
<string name="bounds">183 38 199 243 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">9</int>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="231">
|
||||
<string name="bounds">181 254 201 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">53</int>
|
||||
<string name="title">Browse</string>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Memory</string>
|
||||
</object>
|
||||
<object class="IBCarbonGroupBox" id="233">
|
||||
<string name="bounds">226 19 292 340 </string>
|
||||
<array count="2" name="subviews">
|
||||
<object class="IBCarbonEditText" id="234">
|
||||
<string name="bounds">257 38 273 243 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">10</int>
|
||||
</object>
|
||||
<object class="IBCarbonButton" id="235">
|
||||
<string name="bounds">255 254 275 324 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">54</int>
|
||||
<string name="title">Browse</string>
|
||||
</object>
|
||||
</array>
|
||||
<string name="title">Mpeg ROM</string>
|
||||
</object>
|
||||
</array>
|
||||
<ostype name="controlSignature">tabs</ostype>
|
||||
<int name="controlID">131</int>
|
||||
<int name="featureBits">2</int>
|
||||
</object>
|
||||
<object class="IBCarbonUserPane" id="197">
|
||||
<string name="bounds">49 -1 328 360 </string>
|
||||
<array count="27" name="subviews">
|
||||
<object class="IBCarbonStaticText" id="239">
|
||||
<string name="bounds">64 19 80 115 </string>
|
||||
<string name="title">Up</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="245">
|
||||
<string name="bounds">65 126 81 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">31</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="247">
|
||||
<string name="bounds">90 19 106 115 </string>
|
||||
<string name="title">Right</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="248">
|
||||
<string name="bounds">91 126 107 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">32</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="249">
|
||||
<string name="bounds">116 19 132 115 </string>
|
||||
<string name="title">Down</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="250">
|
||||
<string name="bounds">117 126 133 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">33</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="251">
|
||||
<string name="bounds">142 19 158 115 </string>
|
||||
<string name="title">Left</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="252">
|
||||
<string name="bounds">143 126 159 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">34</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="263">
|
||||
<string name="bounds">168 19 184 115 </string>
|
||||
<string name="title">Right trigger</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="264">
|
||||
<string name="bounds">169 126 185 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">35</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="265">
|
||||
<string name="bounds">194 19 210 115 </string>
|
||||
<string name="title">Left trigger</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="266">
|
||||
<string name="bounds">195 126 211 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">36</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="267">
|
||||
<string name="bounds">220 19 236 115 </string>
|
||||
<string name="title">Start</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="268">
|
||||
<string name="bounds">221 126 237 167 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">37</int>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="283">
|
||||
<string name="bounds">65 296 81 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">38</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="284">
|
||||
<string name="bounds">64 189 80 285 </string>
|
||||
<string name="title">A</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="285">
|
||||
<string name="bounds">117 296 133 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">40</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="286">
|
||||
<string name="bounds">142 189 158 285 </string>
|
||||
<string name="title">X</string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="287">
|
||||
<string name="bounds">194 189 210 285 </string>
|
||||
<string name="title">Z</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="288">
|
||||
<string name="bounds">169 296 185 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">42</int>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="295">
|
||||
<string name="bounds">195 296 211 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">43</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="290">
|
||||
<string name="bounds">90 189 106 285 </string>
|
||||
<string name="title">B</string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="291">
|
||||
<string name="bounds">116 189 132 285 </string>
|
||||
<string name="title">C</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="289">
|
||||
<string name="bounds">91 296 107 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">39</int>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="293">
|
||||
<string name="bounds">143 296 159 337 </string>
|
||||
<ostype name="controlSignature">conf</ostype>
|
||||
<int name="controlID">41</int>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="296">
|
||||
<string name="bounds">168 189 184 285 </string>
|
||||
<string name="title">Y</string>
|
||||
</object>
|
||||
<object class="IBCarbonSeparator" id="297">
|
||||
<string name="bounds">54 178 296 179 </string>
|
||||
</object>
|
||||
</array>
|
||||
<ostype name="controlSignature">tabs</ostype>
|
||||
<int name="controlID">132</int>
|
||||
<string name="title">Input</string>
|
||||
<int name="featureBits">2</int>
|
||||
</object>
|
||||
</array>
|
||||
<ostype name="controlSignature">tabs</ostype>
|
||||
<int name="controlID">128</int>
|
||||
<array count="4" name="tabItems">
|
||||
<dictionary count="4">
|
||||
<string>contentResID</string>
|
||||
<string>0</string>
|
||||
<string>tabEnabled</string>
|
||||
<string>1</string>
|
||||
<string>tabName</string>
|
||||
<string>General</string>
|
||||
<string>userPane</string>
|
||||
<reference idRef="194"/>
|
||||
</dictionary>
|
||||
<dictionary count="4">
|
||||
<string>contentResID</string>
|
||||
<string>0</string>
|
||||
<string>tabEnabled</string>
|
||||
<string>1</string>
|
||||
<string>tabName</string>
|
||||
<string>Video/Sound</string>
|
||||
<string>userPane</string>
|
||||
<reference idRef="195"/>
|
||||
</dictionary>
|
||||
<dictionary count="4">
|
||||
<string>contentResID</string>
|
||||
<string>0</string>
|
||||
<string>tabEnabled</string>
|
||||
<string>1</string>
|
||||
<string>tabName</string>
|
||||
<string>Memory</string>
|
||||
<string>userPane</string>
|
||||
<reference idRef="196"/>
|
||||
</dictionary>
|
||||
<dictionary count="4">
|
||||
<string>contentResID</string>
|
||||
<string>0</string>
|
||||
<string>tabEnabled</string>
|
||||
<string>1</string>
|
||||
<string>tabName</string>
|
||||
<string>Input</string>
|
||||
<string>userPane</string>
|
||||
<reference idRef="197"/>
|
||||
</dictionary>
|
||||
</array>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<boolean name="isResizable">FALSE</boolean>
|
||||
<int name="carbonWindowClass">5</int>
|
||||
</object>
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="180"/>
|
||||
<reference idRef="181"/>
|
||||
<reference idRef="182"/>
|
||||
<reference idRef="183"/>
|
||||
<reference idRef="184"/>
|
||||
<reference idRef="185"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="188"/>
|
||||
<reference idRef="189"/>
|
||||
<reference idRef="190"/>
|
||||
<reference idRef="191"/>
|
||||
<reference idRef="192"/>
|
||||
<reference idRef="193"/>
|
||||
<reference idRef="194"/>
|
||||
<reference idRef="195"/>
|
||||
<reference idRef="196"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="198"/>
|
||||
<reference idRef="199"/>
|
||||
<reference idRef="200"/>
|
||||
<reference idRef="201"/>
|
||||
<reference idRef="202"/>
|
||||
<reference idRef="203"/>
|
||||
<reference idRef="205"/>
|
||||
<reference idRef="206"/>
|
||||
<reference idRef="207"/>
|
||||
<reference idRef="208"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="210"/>
|
||||
<reference idRef="211"/>
|
||||
<reference idRef="212"/>
|
||||
<reference idRef="213"/>
|
||||
<reference idRef="215"/>
|
||||
<reference idRef="216"/>
|
||||
<reference idRef="217"/>
|
||||
<reference idRef="218"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="220"/>
|
||||
<reference idRef="221"/>
|
||||
<reference idRef="222"/>
|
||||
<reference idRef="223"/>
|
||||
<reference idRef="224"/>
|
||||
<reference idRef="225"/>
|
||||
<reference idRef="226"/>
|
||||
<reference idRef="227"/>
|
||||
<reference idRef="228"/>
|
||||
<reference idRef="229"/>
|
||||
<reference idRef="230"/>
|
||||
<reference idRef="231"/>
|
||||
<reference idRef="232"/>
|
||||
<reference idRef="233"/>
|
||||
<reference idRef="234"/>
|
||||
<reference idRef="235"/>
|
||||
<reference idRef="239"/>
|
||||
<reference idRef="245"/>
|
||||
<reference idRef="247"/>
|
||||
<reference idRef="248"/>
|
||||
<reference idRef="249"/>
|
||||
<reference idRef="250"/>
|
||||
<reference idRef="251"/>
|
||||
<reference idRef="252"/>
|
||||
<object class="IBCarbonStaticText" id="259">
|
||||
<string name="bounds">23642 -6178 23658 -6082 </string>
|
||||
<string name="title">Up</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="260">
|
||||
<string name="bounds">23653 -6048 23649 -6053 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="261">
|
||||
<string name="bounds">23647 -6173 23663 -6077 </string>
|
||||
<string name="title">Up</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="262">
|
||||
<string name="bounds">23658 -6043 23654 -6048 </string>
|
||||
</object>
|
||||
<reference idRef="263"/>
|
||||
<reference idRef="264"/>
|
||||
<reference idRef="265"/>
|
||||
<reference idRef="266"/>
|
||||
<reference idRef="267"/>
|
||||
<reference idRef="268"/>
|
||||
<object class="IBCarbonEditText" id="269">
|
||||
<string name="bounds">23648 -6053 23644 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="270">
|
||||
<string name="bounds">23585 -6183 23601 -6087 </string>
|
||||
<string name="title">Right</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="271">
|
||||
<string name="bounds">23700 -6053 23696 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="272">
|
||||
<string name="bounds">23611 -6183 23627 -6087 </string>
|
||||
<string name="title">Down</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="273">
|
||||
<string name="bounds">23726 -6053 23722 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="274">
|
||||
<string name="bounds">23715 -6183 23731 -6087 </string>
|
||||
<string name="title">Start</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="275">
|
||||
<string name="bounds">23622 -6053 23618 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="276">
|
||||
<string name="bounds">23689 -6183 23705 -6087 </string>
|
||||
<string name="title">Left trigger</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="277">
|
||||
<string name="bounds">23596 -6053 23592 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="278">
|
||||
<string name="bounds">23674 -6053 23670 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="279">
|
||||
<string name="bounds">23663 -6183 23679 -6087 </string>
|
||||
<string name="title">Right trigger</string>
|
||||
</object>
|
||||
<object class="IBCarbonEditText" id="280">
|
||||
<string name="bounds">23570 -6053 23566 -6058 </string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="281">
|
||||
<string name="bounds">23559 -6183 23575 -6087 </string>
|
||||
<string name="title">Up</string>
|
||||
</object>
|
||||
<object class="IBCarbonStaticText" id="282">
|
||||
<string name="bounds">23637 -6183 23653 -6087 </string>
|
||||
<string name="title">Left</string>
|
||||
</object>
|
||||
<reference idRef="283"/>
|
||||
<reference idRef="284"/>
|
||||
<reference idRef="285"/>
|
||||
<reference idRef="286"/>
|
||||
<reference idRef="287"/>
|
||||
<reference idRef="288"/>
|
||||
<reference idRef="289"/>
|
||||
<reference idRef="290"/>
|
||||
<reference idRef="291"/>
|
||||
<reference idRef="293"/>
|
||||
<reference idRef="295"/>
|
||||
<reference idRef="296"/>
|
||||
<reference idRef="297"/>
|
||||
<reference idRef="298"/>
|
||||
<reference idRef="299"/>
|
||||
<reference idRef="300"/>
|
||||
<reference idRef="301"/>
|
||||
<reference idRef="302"/>
|
||||
<reference idRef="303"/>
|
||||
<reference idRef="305"/>
|
||||
<reference idRef="306"/>
|
||||
<reference idRef="307"/>
|
||||
<reference idRef="308"/>
|
||||
<reference idRef="309"/>
|
||||
<reference idRef="310"/>
|
||||
<reference idRef="311"/>
|
||||
<reference idRef="312"/>
|
||||
</array>
|
||||
<array count="114" name="allParents">
|
||||
<reference idRef="1"/>
|
||||
<reference idRef="166"/>
|
||||
<reference idRef="182"/>
|
||||
<reference idRef="182"/>
|
||||
<reference idRef="194"/>
|
||||
<reference idRef="194"/>
|
||||
<reference idRef="183"/>
|
||||
<reference idRef="183"/>
|
||||
<reference idRef="188"/>
|
||||
<reference idRef="192"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="194"/>
|
||||
<reference idRef="167"/>
|
||||
<reference idRef="193"/>
|
||||
<reference idRef="193"/>
|
||||
<reference idRef="193"/>
|
||||
<reference idRef="193"/>
|
||||
<reference idRef="202"/>
|
||||
<reference idRef="198"/>
|
||||
<reference idRef="198"/>
|
||||
<reference idRef="198"/>
|
||||
<reference idRef="203"/>
|
||||
<reference idRef="195"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="195"/>
|
||||
<reference idRef="209"/>
|
||||
<reference idRef="212"/>
|
||||
<reference idRef="216"/>
|
||||
<reference idRef="211"/>
|
||||
<reference idRef="211"/>
|
||||
<reference idRef="195"/>
|
||||
<reference idRef="224"/>
|
||||
<reference idRef="224"/>
|
||||
<reference idRef="220"/>
|
||||
<reference idRef="224"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="196"/>
|
||||
<reference idRef="226"/>
|
||||
<reference idRef="183"/>
|
||||
<reference idRef="225"/>
|
||||
<reference idRef="225"/>
|
||||
<reference idRef="225"/>
|
||||
<reference idRef="196"/>
|
||||
<reference idRef="230"/>
|
||||
<reference idRef="230"/>
|
||||
<reference idRef="196"/>
|
||||
<reference idRef="233"/>
|
||||
<reference idRef="233"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="197"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="187"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="219"/>
|
||||
<reference idRef="203"/>
|
||||
</array>
|
||||
<dictionary count="3" name="nameTable">
|
||||
<string>Dialog</string>
|
||||
<reference idRef="166"/>
|
||||
<string>File's Owner</string>
|
||||
<reference idRef="1"/>
|
||||
<string>NSCustomView2</string>
|
||||
<reference idRef="297"/>
|
||||
</dictionary>
|
||||
<unsigned_int name="nextObjectID">313</unsigned_int>
|
||||
</object>
|
Binary file not shown.
|
@ -1,33 +0,0 @@
|
|||
# Copyright 2006 Guillaume Duhamel
|
||||
# Copyright 2006 Lawrence Sebald
|
||||
# Copyright 2007 Anders Montonen
|
||||
#
|
||||
# This file is part of Yabause.
|
||||
#
|
||||
# Yabause is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Yabause is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Yabause; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
hdiutil create -megabytes 20 tmp.dmg -layout NONE -fs HFS+ -volname Yabause -ov
|
||||
tmp=`hdid tmp.dmg`
|
||||
disk=`echo $tmp | cut -f 1 -d\ `
|
||||
cp -R Yabause.app /Volumes/Yabause/
|
||||
cp ../../ChangeLog /Volumes/Yabause/
|
||||
cp ../../README /Volumes/Yabause/
|
||||
cp ../../README.MAC /Volumes/Yabause/
|
||||
cp ../../AUTHORS /Volumes/Yabause/
|
||||
cp ../../COPYING /Volumes/Yabause/
|
||||
hdiutil eject $disk
|
||||
hdiutil convert -format UDZO tmp.dmg -o Yabause.dmg
|
||||
rm tmp.dmg
|
|
@ -1,206 +0,0 @@
|
|||
/* Copyright 2006 Anders Montonen
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#include "cpustatus.h"
|
||||
#include "../sh2core.h"
|
||||
|
||||
/* Dialog field IDs */
|
||||
|
||||
#define SLAVE_ID_OFFSET 30
|
||||
|
||||
#define R0_ID 1
|
||||
#define R1_ID 2
|
||||
#define R2_ID 3
|
||||
#define R3_ID 4
|
||||
#define R4_ID 5
|
||||
#define R5_ID 6
|
||||
#define R6_ID 7
|
||||
#define R7_ID 8
|
||||
#define R8_ID 9
|
||||
#define R9_ID 10
|
||||
#define R10_ID 11
|
||||
#define R11_ID 12
|
||||
#define R12_ID 13
|
||||
#define R13_ID 14
|
||||
#define R14_ID 15
|
||||
#define R15_ID 16
|
||||
#define MACH_ID 17
|
||||
#define MACL_ID 18
|
||||
#define GBR_ID 19
|
||||
#define VBR_ID 20
|
||||
#define PC_ID 21
|
||||
#define PR_ID 22
|
||||
#define SR_ID 23
|
||||
|
||||
static WindowRef CPUStatusWindow;
|
||||
|
||||
static OSStatus CPUStatusWindowEventHandler(EventHandlerCallRef myHandler,
|
||||
EventRef theEvent,
|
||||
void *userData)
|
||||
{
|
||||
OSStatus result = eventNotHandledErr;
|
||||
WindowRef window;
|
||||
MenuRef menu;
|
||||
|
||||
switch(GetEventKind(theEvent))
|
||||
{
|
||||
case kEventWindowClose:
|
||||
GetEventParameter(theEvent, kEventParamDirectObject, typeWindowRef,
|
||||
0, sizeof(typeWindowRef), 0, &window);
|
||||
DisposeWindow(window);
|
||||
menu = GetMenuRef(1);
|
||||
ChangeMenuItemAttributes(menu, 4, 0, kMenuItemAttrHidden);
|
||||
ChangeMenuItemAttributes(menu, 5, kMenuItemAttrHidden, 0);
|
||||
|
||||
result = noErr;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ShowCPUStatusWindow(void)
|
||||
{
|
||||
IBNibRef nib;
|
||||
|
||||
EventTypeSpec eventList[] = { {kEventClassWindow, kEventWindowClose} };
|
||||
|
||||
CreateNibReference(CFSTR("cpustatus"), &nib);
|
||||
CreateWindowFromNib(nib, CFSTR("Window"), &CPUStatusWindow);
|
||||
ShowWindow(CPUStatusWindow);
|
||||
|
||||
InstallWindowEventHandler(CPUStatusWindow,
|
||||
NewEventHandlerUPP(CPUStatusWindowEventHandler),
|
||||
GetEventTypeCount(eventList),
|
||||
eventList, CPUStatusWindow, NULL);
|
||||
|
||||
UpdateCPUStatusWindow();
|
||||
}
|
||||
|
||||
void HideCPUStatusWindow(void)
|
||||
{
|
||||
DisposeWindow(CPUStatusWindow);
|
||||
}
|
||||
|
||||
static void SetSRString(u32 SR, CFMutableStringRef s)
|
||||
{
|
||||
int ii;
|
||||
|
||||
for(ii = 0; ii < 32; ii++)
|
||||
{
|
||||
if(SR & 0x80000000)
|
||||
CFStringAppendCString(s, "1", kCFStringEncodingASCII);
|
||||
else
|
||||
CFStringAppendCString(s, "0", kCFStringEncodingASCII);
|
||||
|
||||
SR <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void SetRegisterValue(const int controlId, CFStringRef s)
|
||||
{
|
||||
ControlID id;
|
||||
ControlRef control;
|
||||
|
||||
id.signature = 'cpus';
|
||||
id.id = controlId;
|
||||
GetControlByID(CPUStatusWindow, &id, &control);
|
||||
SetControlData(control, kControlEditTextPart,
|
||||
kControlEditTextCFStringTag, sizeof(CFStringRef), &s);
|
||||
|
||||
}
|
||||
|
||||
void UpdateCPUStatusWindow(void)
|
||||
{
|
||||
CFStringRef s;
|
||||
CFMutableStringRef ms;
|
||||
sh2regs_struct master = {0};
|
||||
sh2regs_struct slave = {0};
|
||||
int ii = 0;
|
||||
int srNumber = 0;
|
||||
|
||||
if(MSH2)
|
||||
SH2GetRegisters(MSH2, &master);
|
||||
|
||||
if(SSH2)
|
||||
SH2GetRegisters(SSH2, &slave);
|
||||
|
||||
/* Master registers */
|
||||
for(ii = 0; ii < 16; ii++)
|
||||
{
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.R[ii]);
|
||||
SetRegisterValue(ii+1, s);
|
||||
}
|
||||
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.MACH);
|
||||
SetRegisterValue(MACH_ID, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.MACL);
|
||||
SetRegisterValue(MACL_ID, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.GBR);
|
||||
SetRegisterValue(GBR_ID, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.VBR);
|
||||
SetRegisterValue(VBR_ID, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.PC);
|
||||
SetRegisterValue(PC_ID, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), master.PR);
|
||||
SetRegisterValue(PR_ID, s);
|
||||
|
||||
ms = CFStringCreateMutable(kCFAllocatorDefault, 32);
|
||||
SetSRString(master.SR.all, ms);
|
||||
SetRegisterValue(SR_ID, ms);
|
||||
|
||||
/* Slave registers */
|
||||
for(ii = 0; ii < 16; ii++)
|
||||
{
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.R[ii]);
|
||||
SetRegisterValue(ii+1+SLAVE_ID_OFFSET, s);
|
||||
}
|
||||
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.MACH);
|
||||
SetRegisterValue(MACH_ID+SLAVE_ID_OFFSET, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.MACL);
|
||||
SetRegisterValue(MACL_ID+SLAVE_ID_OFFSET, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.GBR);
|
||||
SetRegisterValue(GBR_ID+SLAVE_ID_OFFSET, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.VBR);
|
||||
SetRegisterValue(VBR_ID+SLAVE_ID_OFFSET, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.PC);
|
||||
SetRegisterValue(PC_ID+SLAVE_ID_OFFSET, s);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%x"), slave.PR);
|
||||
SetRegisterValue(PR_ID+SLAVE_ID_OFFSET, s);
|
||||
ms = CFStringCreateMutable(kCFAllocatorDefault, 32);
|
||||
SetSRString(slave.SR.all, ms);
|
||||
SetRegisterValue(SR_ID+SLAVE_ID_OFFSET, ms);
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/* Copyright 2006 Anders Montonen
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef CPUSTATUS_H_
|
||||
#define CPUSTATUS_H_
|
||||
|
||||
void ShowCPUStatusWindow(void);
|
||||
void HideCPUStatusWindow(void);
|
||||
void UpdateCPUStatusWindow(void);
|
||||
|
||||
#endif /* CPUSTATUS_H_ */
|
|
@ -1,609 +0,0 @@
|
|||
/* Copyright 2006 Guillaume Duhamel
|
||||
Copyright 2006 Anders Montonen
|
||||
Copyright 2010 Alex Marshall
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <AGL/agl.h>
|
||||
|
||||
#include "../core.h"
|
||||
#include "../memory.h"
|
||||
#include "settings.h"
|
||||
#include "cpustatus.h"
|
||||
#include "../yabause.h"
|
||||
|
||||
#define YUI_MENU_EMULATION 1
|
||||
#define YUI_MENU_DEBUG 2
|
||||
|
||||
#define YUI_COMMAND_RESET 1
|
||||
#define YUI_COMMAND_PAUSE 2
|
||||
#define YUI_COMMAND_RESUME 3
|
||||
#define YUI_COMMAND_SHOW_CPU 4
|
||||
#define YUI_COMMAND_HIDE_CPU 5
|
||||
#define YUI_COMMAND_TOGGLE_NBG0 6
|
||||
#define YUI_COMMAND_TOGGLE_NBG1 7
|
||||
#define YUI_COMMAND_TOGGLE_NBG2 8
|
||||
#define YUI_COMMAND_TOGGLE_NBG3 9
|
||||
#define YUI_COMMAND_TOGGLE_RBG0 10
|
||||
#define YUI_COMMAND_TOGGLE_VDP1 11
|
||||
#define YUI_COMMAND_TOGGLE_FULLSCREEN 12
|
||||
#define YUI_COMMAND_LOAD_BINARY 13
|
||||
#define YUI_COMMAND_LOAD_AND_EXECUTE 14
|
||||
#define YUI_COMMAND_SAVE_BINARY 15
|
||||
|
||||
AGLContext myAGLContext = NULL;
|
||||
WindowRef myWindow = NULL;
|
||||
yabauseinit_struct yinit;
|
||||
|
||||
M68K_struct * M68KCoreList[] = {
|
||||
&M68KDummy,
|
||||
#ifdef HAVE_C68K
|
||||
&M68KC68K,
|
||||
#endif
|
||||
#ifdef HAVE_Q68
|
||||
&M68KQ68,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
SH2Interface_struct *SH2CoreList[] = {
|
||||
&SH2Interpreter,
|
||||
&SH2DebugInterpreter,
|
||||
NULL
|
||||
};
|
||||
|
||||
PerInterface_struct *PERCoreList[] = {
|
||||
&PERDummy,
|
||||
NULL
|
||||
};
|
||||
|
||||
CDInterface *CDCoreList[] = {
|
||||
&DummyCD,
|
||||
&ISOCD,
|
||||
&ArchCD,
|
||||
NULL
|
||||
};
|
||||
|
||||
SoundInterface_struct *SNDCoreList[] = {
|
||||
&SNDDummy,
|
||||
#ifdef HAVE_LIBSDL
|
||||
&SNDSDL,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
VideoInterface_struct *VIDCoreList[] = {
|
||||
&VIDDummy,
|
||||
&VIDOGL,
|
||||
&VIDSoft,
|
||||
NULL
|
||||
};
|
||||
|
||||
static EventLoopTimerRef EventTimer;
|
||||
int load_file_core(char* file, char* addr, int type);
|
||||
|
||||
void YuiIdle(EventLoopTimerRef a, void * b)
|
||||
{
|
||||
PERCore->HandleEvents();
|
||||
}
|
||||
|
||||
void read_settings(void) {
|
||||
PerPad_struct * pad;
|
||||
int i;
|
||||
CFStringRef s;
|
||||
yinit.percoretype = PERCORE_DUMMY;
|
||||
yinit.sh2coretype = SH2CORE_INTERPRETER;
|
||||
yinit.vidcoretype = VIDCORE_OGL;
|
||||
yinit.m68kcoretype = M68KCORE_C68K;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("VideoCore"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.vidcoretype = CFStringGetIntValue(s) - 1;
|
||||
yinit.sndcoretype = SNDCORE_DUMMY;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("SoundCore"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.sndcoretype = CFStringGetIntValue(s) - 1;
|
||||
yinit.cdcoretype = CDCORE_ARCH;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("CDROMCore"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.cdcoretype = CFStringGetIntValue(s) - 1;
|
||||
yinit.carttype = CART_NONE;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("CartType"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.carttype = CFStringGetIntValue(s) - 1;
|
||||
yinit.regionid = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("Region"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.regionid = CFStringGetIntValue(s) - 1;
|
||||
|
||||
yinit.biospath = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("BiosPath"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.biospath = strdup(CFStringGetCStringPtr(s, 0));
|
||||
yinit.cdpath = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("CDROMDrive"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.cdpath = strdup(CFStringGetCStringPtr(s, 0));
|
||||
yinit.buppath = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("BackupRamPath"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.buppath = strdup(CFStringGetCStringPtr(s, 0));
|
||||
yinit.mpegpath = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("MpegRomPath"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.mpegpath = strdup(CFStringGetCStringPtr(s, 0));
|
||||
yinit.cartpath = 0;
|
||||
s = CFPreferencesCopyAppValue(CFSTR("CartPath"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.cartpath = strdup(CFStringGetCStringPtr(s, 0));
|
||||
|
||||
yinit.videoformattype = VIDEOFORMATTYPE_NTSC;
|
||||
|
||||
s = CFPreferencesCopyAppValue(CFSTR("AutoFrameSkip"),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
yinit.frameskip = CFStringGetIntValue(s);
|
||||
|
||||
PerPortReset();
|
||||
pad = PerPadAdd(&PORTDATA1);
|
||||
|
||||
i = 0;
|
||||
while(PerPadNames[i]) {
|
||||
s = CFPreferencesCopyAppValue(
|
||||
CFStringCreateWithCString(0, PerPadNames[i], 0),
|
||||
kCFPreferencesCurrentApplication);
|
||||
if (s)
|
||||
PerSetKey(CFStringGetIntValue(s), i, pad);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
static void YuiPause(const int Pause)
|
||||
{
|
||||
EventTimerInterval Interval;
|
||||
|
||||
if(Pause)
|
||||
{
|
||||
Interval = kEventDurationForever;
|
||||
ScspMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
}
|
||||
else
|
||||
{
|
||||
Interval = 16*kEventDurationMillisecond;
|
||||
ScspUnMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
}
|
||||
|
||||
SetEventLoopTimerNextFireTime(EventTimer, Interval);
|
||||
}
|
||||
|
||||
void YuiRun(void) {
|
||||
static int FirstRun = 1;
|
||||
EventLoopTimerUPP myFrameUPP;
|
||||
|
||||
if(FirstRun)
|
||||
{
|
||||
myFrameUPP = NewEventLoopTimerUPP(YuiIdle);
|
||||
InstallEventLoopTimer(GetCurrentEventLoop(), kEventDurationNoWait,
|
||||
16*kEventDurationMillisecond, myFrameUPP, NULL, &EventTimer);
|
||||
FirstRun = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
YuiPause(0);
|
||||
YabauseDeInit();
|
||||
}
|
||||
|
||||
read_settings();
|
||||
YabauseInit(&yinit);
|
||||
}
|
||||
|
||||
static void TogglePairedMenuItems(MenuRef menu, MenuItemIndex BaseItemIndex)
|
||||
{
|
||||
MenuItemAttributes ItemAttributes;
|
||||
|
||||
GetMenuItemAttributes(menu, BaseItemIndex, &ItemAttributes);
|
||||
|
||||
if(ItemAttributes & kMenuItemAttrHidden)
|
||||
{
|
||||
ChangeMenuItemAttributes(menu, BaseItemIndex, 0, kMenuItemAttrHidden);
|
||||
ChangeMenuItemAttributes(menu, BaseItemIndex+1, kMenuItemAttrHidden, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeMenuItemAttributes(menu, BaseItemIndex, kMenuItemAttrHidden, 0);
|
||||
ChangeMenuItemAttributes(menu, BaseItemIndex+1, 0, kMenuItemAttrHidden);
|
||||
}
|
||||
}
|
||||
|
||||
OSStatus MyWindowEventHandler (EventHandlerCallRef myHandler, EventRef theEvent, void* userData)
|
||||
{
|
||||
OSStatus ret = noErr;
|
||||
MenuRef menu;
|
||||
|
||||
switch(GetEventClass(theEvent)) {
|
||||
case kEventClassWindow:
|
||||
switch (GetEventKind (theEvent)) {
|
||||
case kEventWindowClose:
|
||||
|
||||
YabauseDeInit();
|
||||
QuitApplicationEventLoop();
|
||||
break;
|
||||
|
||||
case kEventWindowBoundsChanged:
|
||||
aglUpdateContext(myAGLContext);
|
||||
{
|
||||
Rect bounds;
|
||||
GetEventParameter(theEvent, kEventParamCurrentBounds,
|
||||
typeQDRectangle, NULL, sizeof(Rect), NULL, &bounds);
|
||||
glViewport(0, 0, bounds.right - bounds.left,
|
||||
bounds.bottom - bounds.top);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case kEventClassCommand:
|
||||
{
|
||||
HICommand command;
|
||||
GetEventParameter(theEvent, kEventParamDirectObject,
|
||||
typeHICommand, NULL, sizeof(HICommand), NULL, &command);
|
||||
switch(command.commandID) {
|
||||
case kHICommandPreferences:
|
||||
CreateSettingsWindow();
|
||||
break;
|
||||
case kHICommandQuit:
|
||||
YabauseDeInit();
|
||||
QuitApplicationEventLoop();
|
||||
break;
|
||||
case YUI_COMMAND_RESET:
|
||||
YabauseReset();
|
||||
break;
|
||||
case YUI_COMMAND_PAUSE:
|
||||
YuiPause(1);
|
||||
menu = GetMenuRef(YUI_MENU_EMULATION);
|
||||
TogglePairedMenuItems(menu, 2);
|
||||
UpdateCPUStatusWindow();
|
||||
break;
|
||||
case YUI_COMMAND_RESUME:
|
||||
YuiPause(0);
|
||||
menu = GetMenuRef(YUI_MENU_EMULATION);
|
||||
TogglePairedMenuItems(menu, 2);
|
||||
break;
|
||||
case YUI_COMMAND_SHOW_CPU:
|
||||
ShowCPUStatusWindow();
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 1);
|
||||
break;
|
||||
case YUI_COMMAND_HIDE_CPU:
|
||||
HideCPUStatusWindow();
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 1);
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_NBG0:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 4);
|
||||
ToggleNBG0();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_NBG1:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 6);
|
||||
ToggleNBG1();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_NBG2:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 8);
|
||||
ToggleNBG2();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_NBG3:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 10);
|
||||
ToggleNBG3();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_RBG0:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 12);
|
||||
ToggleRBG0();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_VDP1:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_DEBUG);
|
||||
TogglePairedMenuItems(menu, 14);
|
||||
ToggleVDP1();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_TOGGLE_FULLSCREEN:
|
||||
if(VIDCore)
|
||||
{
|
||||
menu = GetMenuRef(YUI_MENU_EMULATION);
|
||||
TogglePairedMenuItems(menu, 5);
|
||||
ToggleFullScreen();
|
||||
}
|
||||
break;
|
||||
case YUI_COMMAND_LOAD_BINARY:
|
||||
CreateLoadWindow(0);
|
||||
break;
|
||||
case YUI_COMMAND_LOAD_AND_EXECUTE:
|
||||
CreateLoadWindow(1);
|
||||
break;
|
||||
case YUI_COMMAND_SAVE_BINARY:
|
||||
// MappedMemorySave(file, address, size);
|
||||
break;
|
||||
default:
|
||||
ret = eventNotHandledErr;
|
||||
printf("unhandled command\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kEventClassKeyboard:
|
||||
switch(GetEventKind(theEvent)) {
|
||||
int i;
|
||||
UInt32 key;
|
||||
case kEventRawKeyDown:
|
||||
GetEventParameter(theEvent, kEventParamKeyCode,
|
||||
typeUInt32, NULL, sizeof(UInt32), NULL, &key);
|
||||
PerKeyDown(key);
|
||||
break;
|
||||
case kEventRawKeyUp:
|
||||
GetEventParameter(theEvent, kEventParamKeyCode,
|
||||
typeUInt32, NULL, sizeof(UInt32), NULL, &key);
|
||||
PerKeyUp(key);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static WindowRef CreateMyWindow() {
|
||||
|
||||
WindowRef myWindow;
|
||||
Rect contentBounds;
|
||||
|
||||
CFStringRef windowTitle = CFSTR("Yabause");
|
||||
WindowClass windowClass = kDocumentWindowClass;
|
||||
WindowAttributes attributes =
|
||||
kWindowStandardDocumentAttributes |
|
||||
kWindowStandardHandlerAttribute |
|
||||
kWindowLiveResizeAttribute;
|
||||
|
||||
EventTypeSpec eventList[] = {
|
||||
{ kEventClassWindow, kEventWindowClose },
|
||||
{ kEventClassWindow, kEventWindowBoundsChanged },
|
||||
{ kEventClassCommand, kEventCommandProcess },
|
||||
{ kEventClassKeyboard, kEventRawKeyDown },
|
||||
{ kEventClassKeyboard, kEventRawKeyUp }
|
||||
};
|
||||
|
||||
SetRect(&contentBounds, 200, 200, 520, 424);
|
||||
|
||||
CreateNewWindow (windowClass,
|
||||
attributes,
|
||||
&contentBounds,
|
||||
&myWindow);
|
||||
|
||||
SetWindowTitleWithCFString (myWindow, windowTitle);
|
||||
CFRelease(windowTitle);
|
||||
ShowWindow(myWindow);
|
||||
|
||||
InstallWindowEventHandler(myWindow,
|
||||
NewEventHandlerUPP (MyWindowEventHandler),
|
||||
GetEventTypeCount(eventList),
|
||||
eventList, myWindow, NULL);
|
||||
return myWindow;
|
||||
}
|
||||
|
||||
static OSStatus MyAGLReportError (void) {
|
||||
GLenum err = aglGetError();
|
||||
|
||||
if (err == AGL_NO_ERROR)
|
||||
return noErr;
|
||||
else
|
||||
return (OSStatus) err;
|
||||
}
|
||||
|
||||
static OSStatus MySetWindowAsDrawableObject (WindowRef window)
|
||||
{
|
||||
OSStatus err = noErr;
|
||||
|
||||
GLint attributes[] = { AGL_RGBA,
|
||||
AGL_DOUBLEBUFFER,
|
||||
AGL_DEPTH_SIZE, 24,
|
||||
AGL_NONE };
|
||||
|
||||
AGLPixelFormat myAGLPixelFormat;
|
||||
|
||||
myAGLPixelFormat = aglChoosePixelFormat (NULL, 0, attributes);
|
||||
|
||||
err = MyAGLReportError ();
|
||||
|
||||
if (myAGLPixelFormat) {
|
||||
myAGLContext = aglCreateContext (myAGLPixelFormat, NULL);
|
||||
|
||||
err = MyAGLReportError ();
|
||||
aglDestroyPixelFormat(myAGLPixelFormat);
|
||||
}
|
||||
|
||||
if (! aglSetDrawable (myAGLContext, GetWindowPort (window)))
|
||||
err = MyAGLReportError ();
|
||||
|
||||
if (!aglSetCurrentContext (myAGLContext))
|
||||
err = MyAGLReportError ();
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
MenuRef menu;
|
||||
EventLoopTimerRef nextFrameTimer;
|
||||
IBNibRef menuNib;
|
||||
|
||||
myWindow = CreateMyWindow();
|
||||
MySetWindowAsDrawableObject(myWindow);
|
||||
|
||||
CreateNibReference(CFSTR("menu"), &menuNib);
|
||||
SetMenuBarFromNib(menuNib, CFSTR("MenuBar"));
|
||||
|
||||
EnableMenuCommand(NULL, kHICommandPreferences);
|
||||
|
||||
read_settings();
|
||||
|
||||
YuiRun();
|
||||
if(argc >= 2)
|
||||
load_file_core(argv[1], (argc >= 3) ? argv[2] : NULL, 1);
|
||||
|
||||
RunApplicationEventLoop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void YuiErrorMsg(const char * string) {
|
||||
printf("%s\n", string);
|
||||
}
|
||||
|
||||
void YuiSetVideoAttribute(int type, int val) {
|
||||
}
|
||||
|
||||
int YuiSetVideoMode(int width, int height, int bpp, int fullscreen)
|
||||
{
|
||||
static CFDictionaryRef oldDisplayMode = 0;
|
||||
static int oldDisplayModeValid = 0;
|
||||
|
||||
AGLPixelFormat myAGLPixelFormat;
|
||||
AGLDrawable myDrawable = aglGetDrawable(myAGLContext);
|
||||
OSStatus err = noErr;
|
||||
GLint attributesFullscreen[] = { AGL_RGBA,
|
||||
AGL_FULLSCREEN,
|
||||
AGL_DOUBLEBUFFER,
|
||||
AGL_DEPTH_SIZE, 24,
|
||||
AGL_NONE };
|
||||
CGDirectDisplayID displayId = kCGDirectMainDisplay;
|
||||
|
||||
if(myDrawable)
|
||||
{
|
||||
if(fullscreen)
|
||||
{
|
||||
Rect bounds;
|
||||
CGPoint point;
|
||||
CGDisplayCount displayCount;
|
||||
|
||||
GetWindowBounds(myWindow, kWindowGlobalPortRgn, &bounds);
|
||||
point.x = (float)bounds.left;
|
||||
point.y = (float)bounds.top;
|
||||
|
||||
CGGetDisplaysWithPoint(point, 1, &displayId, &displayCount);
|
||||
|
||||
CFDictionaryRef refDisplayMode = CGDisplayBestModeForParameters(displayId,
|
||||
bpp, width, height, NULL);
|
||||
if(refDisplayMode)
|
||||
{
|
||||
GDHandle gdhDisplay;
|
||||
oldDisplayMode = CGDisplayCurrentMode(displayId);
|
||||
oldDisplayModeValid = 1;
|
||||
|
||||
aglSetDrawable(myAGLContext, NULL);
|
||||
aglSetCurrentContext(NULL);
|
||||
aglDestroyContext(myAGLContext);
|
||||
myAGLContext = NULL;
|
||||
|
||||
CGCaptureAllDisplays();
|
||||
CGDisplaySwitchToMode(displayId, refDisplayMode);
|
||||
CGDisplayHideCursor(displayId);
|
||||
|
||||
DMGetGDeviceByDisplayID((DisplayIDType)displayId, &gdhDisplay, 0);
|
||||
|
||||
myAGLPixelFormat = aglChoosePixelFormat(&gdhDisplay, 1, attributesFullscreen);
|
||||
if(myAGLPixelFormat)
|
||||
{
|
||||
myAGLContext = aglCreateContext(myAGLPixelFormat, NULL);
|
||||
if(myAGLContext)
|
||||
{
|
||||
aglSetCurrentContext(myAGLContext);
|
||||
aglSetFullScreen(myAGLContext, width, height, 0, 0);
|
||||
}
|
||||
|
||||
err = MyAGLReportError();
|
||||
aglDestroyPixelFormat(myAGLPixelFormat);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = MyAGLReportError();
|
||||
CGReleaseAllDisplays();
|
||||
CGDisplayShowCursor(displayId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
err = MyAGLReportError();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(oldDisplayModeValid)
|
||||
{
|
||||
oldDisplayModeValid = 0;
|
||||
|
||||
aglSetDrawable(myAGLContext, NULL);
|
||||
aglSetCurrentContext(NULL);
|
||||
aglDestroyContext(myAGLContext);
|
||||
myAGLContext = NULL;
|
||||
|
||||
CGDisplayShowCursor(displayId);
|
||||
CGDisplaySwitchToMode(displayId, oldDisplayMode);
|
||||
CGReleaseAllDisplays();
|
||||
|
||||
MySetWindowAsDrawableObject(myWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !(err == noErr);
|
||||
}
|
||||
|
||||
void YuiSwapBuffers(void) {
|
||||
aglSwapBuffers(myAGLContext);
|
||||
}
|
|
@ -1,491 +0,0 @@
|
|||
/* Copyright 2006 Guillaume Duhamel
|
||||
Copyright 2006 Anders Montonen
|
||||
Copyright 2010 Alex Marshall
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <unistd.h>
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include "settings.h"
|
||||
|
||||
#define TAB_ID 128
|
||||
#define TAB_SIGNATURE 'tabs'
|
||||
int tabList[] = {129, 130, 131, 132};
|
||||
|
||||
int loadtype = 0;
|
||||
ControlRef oldTab;
|
||||
|
||||
int mystrnlen(char* in, int maxlen)
|
||||
{
|
||||
int len;
|
||||
for(len = 0; (*in != 0) && (len < maxlen); len++, in++);
|
||||
return len;
|
||||
}
|
||||
|
||||
unsigned int mytoi(char* in)
|
||||
{
|
||||
unsigned int out = 0;
|
||||
int length = 0;
|
||||
int i;
|
||||
int format = 0; /* Decimal */
|
||||
if((in[0] == '0') && (in[1] == 'x')) {
|
||||
in += 2;
|
||||
format = 1; /* Hexadecimal */
|
||||
}else if(in[0] == '$') {
|
||||
in += 1;
|
||||
format = 1; /* Hexadecimal */
|
||||
}else if((in[0] == 'H') && (in[1] == '\'')) {
|
||||
in += 2;
|
||||
format = 1; /* Hexadecimal */
|
||||
}
|
||||
length = mystrnlen(in, 11);
|
||||
for(i = 0; i < length; i++) {
|
||||
switch(format) {
|
||||
case 0: /* Decimal */
|
||||
out *= 10;
|
||||
if((in[i] >= '0') && (in[i] <= '9'))
|
||||
out += in[i] - '0';
|
||||
break;
|
||||
case 1: /* Hexadecimal */
|
||||
out <<= 4;
|
||||
if((in[i] >= '0') && (in[i] <= '9'))
|
||||
out += in[i] - '0';
|
||||
if((in[i] >= 'A') && (in[i] <= 'F'))
|
||||
out += (in[i] - 'A') + 0xA;
|
||||
if((in[i] >= 'a') && (in[i] <= 'f'))
|
||||
out += (in[i] - 'a') + 0xA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
void SelectItemOfTabControl(ControlRef tabControl)
|
||||
{
|
||||
ControlRef userPane;
|
||||
ControlID controlID;
|
||||
|
||||
GetControlID(tabControl, &controlID);
|
||||
if (controlID.id != TAB_ID) return;
|
||||
|
||||
controlID.signature = TAB_SIGNATURE;
|
||||
|
||||
controlID.id = tabList[GetControlValue(tabControl) - 1];
|
||||
GetControlByID(GetControlOwner(tabControl), &controlID, &userPane);
|
||||
|
||||
DisableControl(oldTab);
|
||||
SetControlVisibility(oldTab, false, false);
|
||||
EnableControl(userPane);
|
||||
SetControlVisibility(userPane, true, true);
|
||||
oldTab = userPane;
|
||||
|
||||
Draw1Control(tabControl);
|
||||
}
|
||||
|
||||
pascal OSStatus TabEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
|
||||
{
|
||||
ControlRef control;
|
||||
|
||||
GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef,
|
||||
NULL, sizeof(ControlRef), NULL, &control );
|
||||
|
||||
SelectItemOfTabControl(control);
|
||||
|
||||
return eventNotHandledErr;
|
||||
}
|
||||
|
||||
void InstallTabHandler(WindowRef window)
|
||||
{
|
||||
EventTypeSpec controlSpec = { kEventClassControl, kEventControlHit };
|
||||
ControlRef tabControl;
|
||||
ControlID controlID;
|
||||
int i;
|
||||
|
||||
controlID.signature = TAB_SIGNATURE;
|
||||
|
||||
for(i = 0;i < 4;i++) {
|
||||
controlID.id = tabList[i];
|
||||
GetControlByID(window, &controlID, &tabControl);
|
||||
DisableControl(tabControl);
|
||||
SetControlVisibility(tabControl, false, false);
|
||||
}
|
||||
|
||||
controlID.id = TAB_ID;
|
||||
GetControlByID(window, &controlID, &tabControl);
|
||||
|
||||
InstallControlEventHandler(tabControl,
|
||||
NewEventHandlerUPP( TabEventHandler ),
|
||||
1, &controlSpec, 0, NULL);
|
||||
|
||||
SetControl32BitValue(tabControl, 1);
|
||||
|
||||
SelectItemOfTabControl(tabControl);
|
||||
}
|
||||
|
||||
CFStringRef get_settings(WindowRef window, int i) {
|
||||
ControlID id;
|
||||
ControlRef control;
|
||||
CFStringRef s;
|
||||
|
||||
id.signature = 'conf';
|
||||
id.id = i;
|
||||
GetControlByID(window, &id, &control);
|
||||
GetControlData(control, kControlEditTextPart,
|
||||
kControlEditTextCFStringTag, sizeof(CFStringRef), &s, NULL);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
CFStringRef get_settings_c(WindowRef window, int i) {
|
||||
ControlID id;
|
||||
ControlRef control;
|
||||
CFStringRef s;
|
||||
|
||||
id.signature = 'conf';
|
||||
id.id = i;
|
||||
GetControlByID(window, &id, &control);
|
||||
s = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,
|
||||
CFSTR("%d"), GetControl32BitValue(control));
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
void set_settings(WindowRef window, int i, CFStringRef s) {
|
||||
ControlID id;
|
||||
ControlRef control;
|
||||
|
||||
if (s) {
|
||||
id.signature = 'conf';
|
||||
id.id = i;
|
||||
GetControlByID(window, &id, &control);
|
||||
SetControlData(control, kControlEditTextPart,
|
||||
kControlEditTextCFStringTag, sizeof(CFStringRef), &s);
|
||||
}
|
||||
}
|
||||
|
||||
void set_settings_c(WindowRef window, int i, CFStringRef s) {
|
||||
ControlID id;
|
||||
ControlRef control;
|
||||
|
||||
if (s) {
|
||||
id.signature = 'conf';
|
||||
id.id = i;
|
||||
GetControlByID(window, &id, &control);
|
||||
SetControl32BitValue(control, CFStringGetIntValue(s));
|
||||
}
|
||||
}
|
||||
|
||||
void save_settings(WindowRef window) {
|
||||
PerPad_struct * pad;
|
||||
int i;
|
||||
CFStringRef s;
|
||||
|
||||
CFPreferencesSetAppValue(CFSTR("BiosPath"), get_settings(window, 1),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("CDROMDrive"), get_settings(window, 2),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("CDROMCore"), get_settings_c(window, 3),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("Region"), get_settings_c(window, 4),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("VideoCore"), get_settings_c(window, 5),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("SoundCore"), get_settings_c(window, 6),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("CartPath"), get_settings(window, 7),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("CartType"), get_settings_c(window, 8),
|
||||
kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("BackupRamPath"),
|
||||
get_settings(window, 9), kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("MpegRomPath"),
|
||||
get_settings(window, 10), kCFPreferencesCurrentApplication);
|
||||
CFPreferencesSetAppValue(CFSTR("AutoFrameSkip"),
|
||||
get_settings_c(window, 11), kCFPreferencesCurrentApplication);
|
||||
|
||||
PerPortReset();
|
||||
pad = PerPadAdd(&PORTDATA1);
|
||||
|
||||
i = 0;
|
||||
while(PerPadNames[i]) {
|
||||
s = get_settings(window, 31 + i);
|
||||
CFPreferencesSetAppValue(
|
||||
CFStringCreateWithCString(0, PerPadNames[i], 0),
|
||||
s, kCFPreferencesCurrentApplication);
|
||||
PerSetKey(CFStringGetIntValue(s), i, pad);
|
||||
i++;
|
||||
}
|
||||
|
||||
CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
|
||||
}
|
||||
|
||||
void load_settings(WindowRef window) {
|
||||
int i;
|
||||
|
||||
set_settings(window, 1, CFPreferencesCopyAppValue(CFSTR("BiosPath"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings(window, 2, CFPreferencesCopyAppValue(CFSTR("CDROMDrive"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 3, CFPreferencesCopyAppValue(CFSTR("CDROMCore"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 4, CFPreferencesCopyAppValue(CFSTR("Region"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 5, CFPreferencesCopyAppValue(CFSTR("VideoCore"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 6, CFPreferencesCopyAppValue(CFSTR("SoundCore"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings(window, 7, CFPreferencesCopyAppValue(CFSTR("CartPath"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 8, CFPreferencesCopyAppValue(CFSTR("CartType"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings(window, 9,
|
||||
CFPreferencesCopyAppValue(CFSTR("BackupRamPath"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings(window, 10, CFPreferencesCopyAppValue(CFSTR("MpegRomPath"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
set_settings_c(window, 11, CFPreferencesCopyAppValue(CFSTR("AutoFrameSkip"),
|
||||
kCFPreferencesCurrentApplication));
|
||||
|
||||
i = 0;
|
||||
while(PerPadNames[i]) {
|
||||
set_settings(window, 31 + i, CFPreferencesCopyAppValue(
|
||||
CFStringCreateWithCString(0, PerPadNames[i], 0),
|
||||
kCFPreferencesCurrentApplication));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
int load_file_core(char* file, char* addr, int type)
|
||||
{
|
||||
unsigned int adr;
|
||||
int ret = -1;
|
||||
if(addr == NULL)
|
||||
adr = 0;
|
||||
else
|
||||
adr = mytoi(addr);
|
||||
switch(type) {
|
||||
case 0:
|
||||
ret = MappedMemoryLoad(file, adr);
|
||||
break;
|
||||
case 1:
|
||||
MappedMemoryLoadExec(file, adr);
|
||||
ret = 0;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void load_file(WindowRef window, int type) {
|
||||
char addrbuf[12];
|
||||
char filebuf[256];
|
||||
int ret = -1;
|
||||
CFStringGetCString(get_settings(window, 1), filebuf, 256, kCFStringEncodingUTF8);
|
||||
CFStringGetCString(get_settings(window, 2), addrbuf, 12, kCFStringEncodingUTF8);
|
||||
ret = load_file_core(filebuf, addrbuf, type);
|
||||
(void)(ret); /* We need to do something about bad return values... */
|
||||
}
|
||||
|
||||
OSStatus SettingsWindowEventHandler (EventHandlerCallRef myHandler, EventRef theEvent, void* userData)
|
||||
{
|
||||
OSStatus result = eventNotHandledErr;
|
||||
|
||||
switch (GetEventKind (theEvent))
|
||||
{
|
||||
case kEventWindowClose:
|
||||
{
|
||||
WindowRef window;
|
||||
GetEventParameter(theEvent, kEventParamDirectObject, typeWindowRef,
|
||||
0, sizeof(typeWindowRef), 0, &window);
|
||||
|
||||
save_settings(window);
|
||||
|
||||
DisposeWindow(window);
|
||||
}
|
||||
result = noErr;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
OSStatus BrowseHandler(EventHandlerCallRef h, EventRef event, void* data) {
|
||||
NavDialogRef dialog;
|
||||
NavDialogCreationOptions options;
|
||||
|
||||
NavGetDefaultDialogCreationOptions(&options);
|
||||
NavCreateChooseFileDialog(&options, NULL, NULL, NULL, NULL,
|
||||
NULL, &dialog);
|
||||
NavDialogRun(dialog);
|
||||
|
||||
if (NavDialogGetUserAction(dialog) == kNavUserActionChoose) {
|
||||
NavReplyRecord reply;
|
||||
FSRef fileAsFSRef;
|
||||
CFURLRef fileAsCFURLRef = NULL;
|
||||
CFStringRef s;
|
||||
|
||||
NavDialogGetReply(dialog, &reply);
|
||||
|
||||
AEGetNthPtr(&(reply.selection), 1, typeFSRef,
|
||||
NULL, NULL, &fileAsFSRef, sizeof(FSRef), NULL);
|
||||
|
||||
NavDisposeReply(&reply);
|
||||
NavDialogDispose(dialog);
|
||||
|
||||
fileAsCFURLRef = CFURLCreateFromFSRef(NULL, &fileAsFSRef);
|
||||
s = CFURLCopyFileSystemPath(fileAsCFURLRef, kCFURLPOSIXPathStyle);
|
||||
|
||||
CFShow(s);
|
||||
|
||||
SetControlData(data, kControlEditTextPart,
|
||||
kControlEditTextCFStringTag, sizeof(CFStringRef), &s);
|
||||
Draw1Control(data);
|
||||
}
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
||||
OSStatus KeyConfigHandler(EventHandlerCallRef h, EventRef event, void* data) {
|
||||
UInt32 key;
|
||||
CFStringRef s;
|
||||
GetEventParameter(event, kEventParamKeyCode,
|
||||
typeUInt32, NULL, sizeof(UInt32), NULL, &key);
|
||||
s = CFStringCreateWithFormat(NULL, NULL, CFSTR("%d"), key);
|
||||
SetControlData(data, kControlEditTextPart,
|
||||
kControlEditTextCFStringTag, sizeof(CFStringRef), &s);
|
||||
Draw1Control(data);
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
||||
void InstallBrowseHandler(WindowRef myWindow, const SInt32 ControllerId,
|
||||
const SInt32 ControlledId)
|
||||
{
|
||||
EventTypeSpec flist[] = {
|
||||
{ kEventClassControl, kEventControlHit }
|
||||
};
|
||||
ControlID Id;
|
||||
ControlRef Controller, Controlled;
|
||||
|
||||
Id.signature = 'conf';
|
||||
Id.id = ControllerId;
|
||||
GetControlByID(myWindow, &Id, &Controller);
|
||||
Id.id = ControlledId;
|
||||
GetControlByID(myWindow, &Id, &Controlled);
|
||||
InstallControlEventHandler(Controller, NewEventHandlerUPP(BrowseHandler),
|
||||
GetEventTypeCount(flist), flist, Controlled, NULL);
|
||||
}
|
||||
|
||||
WindowRef CreateSettingsWindow() {
|
||||
|
||||
WindowRef myWindow;
|
||||
IBNibRef nib;
|
||||
|
||||
EventTypeSpec eventList[] = {
|
||||
{ kEventClassWindow, kEventWindowClose }
|
||||
};
|
||||
|
||||
CreateNibReference(CFSTR("preferences"), &nib);
|
||||
CreateWindowFromNib(nib, CFSTR("Dialog"), &myWindow);
|
||||
|
||||
load_settings(myWindow);
|
||||
|
||||
InstallTabHandler(myWindow);
|
||||
|
||||
{
|
||||
int i;
|
||||
ControlRef control, controlled;
|
||||
ControlID id;
|
||||
EventTypeSpec elist[] = {
|
||||
{ kEventClassKeyboard, kEventRawKeyDown },
|
||||
{ kEventClassKeyboard, kEventRawKeyUp }
|
||||
};
|
||||
|
||||
id.signature = 'conf';
|
||||
i = 0;
|
||||
while(PerPadNames[i]) {
|
||||
id.id = 31 + i;
|
||||
GetControlByID(myWindow, &id, &control);
|
||||
|
||||
InstallControlEventHandler(control, NewEventHandlerUPP(KeyConfigHandler),
|
||||
GetEventTypeCount(elist), elist, control, NULL);
|
||||
i++;
|
||||
}
|
||||
|
||||
InstallBrowseHandler(myWindow, 50, 1); /* BIOS */
|
||||
InstallBrowseHandler(myWindow, 51, 2); /* CDROM */
|
||||
InstallBrowseHandler(myWindow, 52, 7); /* Cartridge ROM */
|
||||
InstallBrowseHandler(myWindow, 53, 9); /* Memory */
|
||||
InstallBrowseHandler(myWindow, 54, 10); /* MPEG ROM */
|
||||
}
|
||||
|
||||
ShowWindow(myWindow);
|
||||
|
||||
InstallWindowEventHandler(myWindow,
|
||||
NewEventHandlerUPP (SettingsWindowEventHandler),
|
||||
GetEventTypeCount(eventList),
|
||||
eventList, myWindow, NULL);
|
||||
|
||||
return myWindow;
|
||||
}
|
||||
|
||||
OSStatus LoadWindowEventHandler (EventHandlerCallRef myHandler, EventRef theEvent, void* userData)
|
||||
{
|
||||
OSStatus result = eventNotHandledErr;
|
||||
switch (GetEventKind (theEvent))
|
||||
{
|
||||
case kEventWindowClose:
|
||||
{
|
||||
WindowRef window;
|
||||
GetEventParameter(theEvent, kEventParamDirectObject, typeWindowRef,
|
||||
0, sizeof(typeWindowRef), 0, &window);
|
||||
|
||||
load_file(window, loadtype);
|
||||
|
||||
DisposeWindow(window);
|
||||
}
|
||||
result = noErr;
|
||||
break;
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
WindowRef CreateLoadWindow(int type) {
|
||||
WindowRef myWindow;
|
||||
IBNibRef nib;
|
||||
int* hack;
|
||||
EventTypeSpec eventList[] = {
|
||||
{ kEventClassWindow, kEventWindowClose }
|
||||
};
|
||||
|
||||
CreateNibReference(CFSTR("load_dialog"), &nib);
|
||||
CreateWindowFromNib(nib, CFSTR("Dialog"), &myWindow);
|
||||
|
||||
InstallTabHandler(myWindow);
|
||||
hack = malloc(sizeof(int));
|
||||
loadtype = type;
|
||||
InstallBrowseHandler(myWindow, 50, 1); /* File */
|
||||
ShowWindow(myWindow);
|
||||
|
||||
InstallWindowEventHandler(myWindow,
|
||||
NewEventHandlerUPP (LoadWindowEventHandler),
|
||||
GetEventTypeCount(eventList),
|
||||
eventList, myWindow, NULL);
|
||||
return myWindow;
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
/* Copyright 2006 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#include "../yabause.h"
|
||||
#include "../peripheral.h"
|
||||
#include "../sh2core.h"
|
||||
#include "../sh2int.h"
|
||||
#include "../vidogl.h"
|
||||
#include "../vidsoft.h"
|
||||
#include "../scsp.h"
|
||||
#include "../sndsdl.h"
|
||||
#include "../cdbase.h"
|
||||
#include "../cs0.h"
|
||||
#include "../m68kcore.h"
|
||||
|
||||
extern yabauseinit_struct yinit;
|
||||
|
||||
WindowRef CreateSettingsWindow();
|
||||
|
||||
typedef struct _YuiAction YuiAction;
|
||||
|
||||
/*
|
||||
struct _YuiAction {
|
||||
UInt32 key;
|
||||
const char * name;
|
||||
void (*press)(void);
|
||||
void (*release)(void);
|
||||
};
|
||||
|
||||
extern YuiAction key_config[];
|
||||
*/
|
|
@ -1,166 +0,0 @@
|
|||
/* Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2004-2006 Guillaume Duhamel
|
||||
Copyright 2005 Joost Peters
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/cdio.h>
|
||||
#include <sys/cdrio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cdbase.h"
|
||||
#include "debug.h"
|
||||
|
||||
static int FreeBSDCDInit(const char *);
|
||||
static void FreeBSDCDDeInit(void);
|
||||
static s32 FreeBSDCDReadTOC(u32 *);
|
||||
static int FreeBSDCDGetStatus(void);
|
||||
static int FreeBSDCDReadSectorFAD(u32, void *);
|
||||
static void FreeBSDCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface ArchCD = {
|
||||
CDCORE_ARCH,
|
||||
"FreeBSD CD Drive",
|
||||
FreeBSDCDInit,
|
||||
FreeBSDCDDeInit,
|
||||
FreeBSDCDGetStatus,
|
||||
FreeBSDCDReadTOC,
|
||||
FreeBSDCDReadSectorFAD,
|
||||
FreeBSDCDReadAheadFAD,
|
||||
};
|
||||
|
||||
static int hCDROM;
|
||||
|
||||
static int FreeBSDCDInit(const char * cdrom_name) {
|
||||
int bsize = 2352;
|
||||
|
||||
if ((hCDROM = open(cdrom_name, O_RDONLY | O_NONBLOCK)) == -1) {
|
||||
LOG("CDInit (%s) failed\n", cdrom_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl (hCDROM, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG("CDInit (%s) OK\n", cdrom_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void FreeBSDCDDeInit(void) {
|
||||
if (hCDROM != -1) {
|
||||
close(hCDROM);
|
||||
}
|
||||
|
||||
LOG("CDDeInit OK\n");
|
||||
}
|
||||
|
||||
|
||||
static s32 FreeBSDCDReadTOC(u32 * TOC)
|
||||
{
|
||||
int success;
|
||||
struct ioc_toc_header ctTOC;
|
||||
struct ioc_read_toc_single_entry ctTOCent;
|
||||
int i, j;
|
||||
int add150 = 0;
|
||||
|
||||
ctTOCent.address_format = CD_LBA_FORMAT;
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
memset(TOC, 0xFF, 0xCC * 2);
|
||||
memset(&ctTOC, 0xFF, sizeof(struct ioc_toc_header));
|
||||
|
||||
if (ioctl(hCDROM, CDIOREADTOCHEADER, &ctTOC) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctTOCent.track = ctTOC.starting_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRY, &ctTOCent);
|
||||
if (ctTOCent.entry.addr.lba == 0) add150 = 150;
|
||||
TOC[0] = ((ctTOCent.entry.control << 28) |
|
||||
(ctTOCent.entry.addr_type << 24) |
|
||||
ctTOCent.entry.addr.lba + add150);
|
||||
|
||||
// convert TOC to saturn format
|
||||
for (i = ctTOC.starting_track + 1; i <= ctTOC.ending_track; i++)
|
||||
{
|
||||
ctTOCent.track = i;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRY, &ctTOCent);
|
||||
TOC[i - 1] = (ctTOCent.entry.control << 28) |
|
||||
(ctTOCent.entry.addr_type << 24) |
|
||||
(ctTOCent.entry.addr.lba + add150);
|
||||
}
|
||||
|
||||
// Do First, Last, and Lead out sections here
|
||||
|
||||
ctTOCent.track = ctTOC.starting_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRY, &ctTOCent);
|
||||
TOC[99] = (ctTOCent.entry.control << 28) |
|
||||
(ctTOCent.entry.addr_type << 24) |
|
||||
(ctTOC.starting_track << 16);
|
||||
|
||||
ctTOCent.track = ctTOC.ending_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRY, &ctTOCent);
|
||||
TOC[100] = (ctTOCent.entry.control << 28) |
|
||||
(ctTOCent.entry.addr_type << 24) |
|
||||
(ctTOC.starting_track << 16);
|
||||
|
||||
ctTOCent.track = 0xAA;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRY, &ctTOCent);
|
||||
TOC[101] = (ctTOCent.entry.control << 28) |
|
||||
(ctTOCent.entry.addr_type << 24) |
|
||||
(ctTOCent.entry.addr.lba + add150);
|
||||
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int FreeBSDCDGetStatus(void) {
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
// see ../windows/cd.cc for more info
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int FreeBSDCDReadSectorFAD(u32 FAD, void *buffer) {
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
lseek(hCDROM, (FAD - 150) * 2352, SEEK_SET);
|
||||
read(hCDROM, buffer, 2352);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void FreeBSDCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// No-op
|
||||
}
|
|
@ -1,182 +0,0 @@
|
|||
/* Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2004-2006 Guillaume Duhamel
|
||||
Copyright 2005 Joost Peters
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/cdrom.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#ifdef LINUX_CDROM_H_IS_BROKEN
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#include "cdbase.h"
|
||||
#include "debug.h"
|
||||
|
||||
static int LinuxCDInit(const char *);
|
||||
static void LinuxCDDeInit(void);
|
||||
static s32 LinuxCDReadTOC(u32 *);
|
||||
static int LinuxCDGetStatus(void);
|
||||
static int LinuxCDReadSectorFAD(u32, void *);
|
||||
static void LinuxCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface ArchCD = {
|
||||
CDCORE_ARCH,
|
||||
"Linux CD Drive",
|
||||
LinuxCDInit,
|
||||
LinuxCDDeInit,
|
||||
LinuxCDGetStatus,
|
||||
LinuxCDReadTOC,
|
||||
LinuxCDReadSectorFAD,
|
||||
LinuxCDReadAheadFAD,
|
||||
};
|
||||
|
||||
static int hCDROM;
|
||||
|
||||
static int LinuxCDInit(const char * cdrom_name) {
|
||||
if ((hCDROM = open(cdrom_name, O_RDONLY | O_NONBLOCK)) == -1) {
|
||||
return -1;
|
||||
}
|
||||
LOG("CDInit (%s) OK\n", cdrom_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void LinuxCDDeInit(void) {
|
||||
if (hCDROM != -1) {
|
||||
close(hCDROM);
|
||||
}
|
||||
|
||||
LOG("CDDeInit OK\n");
|
||||
}
|
||||
|
||||
|
||||
static s32 LinuxCDReadTOC(u32 * TOC)
|
||||
{
|
||||
struct cdrom_tochdr ctTOC;
|
||||
struct cdrom_tocentry ctTOCent;
|
||||
int i;
|
||||
int add150 = 0;
|
||||
|
||||
ctTOCent.cdte_format = CDROM_LBA;
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
memset(TOC, 0xFF, 0xCC * 2);
|
||||
memset(&ctTOC, 0xFF, sizeof(struct cdrom_tochdr));
|
||||
|
||||
if (ioctl(hCDROM, CDROMREADTOCHDR, &ctTOC) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctTOCent.cdte_track = ctTOC.cdth_trk0;
|
||||
ioctl(hCDROM, CDROMREADTOCENTRY, &ctTOCent);
|
||||
if (ctTOCent.cdte_addr.lba == 0) add150 = 150;
|
||||
TOC[0] = ((ctTOCent.cdte_ctrl << 28) |
|
||||
(ctTOCent.cdte_adr << 24) |
|
||||
(ctTOCent.cdte_addr.lba + add150));
|
||||
|
||||
// convert TOC to saturn format
|
||||
for (i = ctTOC.cdth_trk0 + 1; i <= ctTOC.cdth_trk1; i++)
|
||||
{
|
||||
ctTOCent.cdte_track = i;
|
||||
ioctl(hCDROM, CDROMREADTOCENTRY, &ctTOCent);
|
||||
TOC[i - 1] = (ctTOCent.cdte_ctrl << 28) |
|
||||
(ctTOCent.cdte_adr << 24) |
|
||||
(ctTOCent.cdte_addr.lba + add150);
|
||||
}
|
||||
|
||||
// Do First, Last, and Lead out sections here
|
||||
|
||||
ctTOCent.cdte_track = ctTOC.cdth_trk0;
|
||||
ioctl(hCDROM, CDROMREADTOCENTRY, &ctTOCent);
|
||||
TOC[99] = (ctTOCent.cdte_ctrl << 28) |
|
||||
(ctTOCent.cdte_adr << 24) |
|
||||
(ctTOC.cdth_trk0 << 16);
|
||||
|
||||
ctTOCent.cdte_track = ctTOC.cdth_trk1;
|
||||
ioctl(hCDROM, CDROMREADTOCENTRY, &ctTOCent);
|
||||
TOC[100] = (ctTOCent.cdte_ctrl << 28) |
|
||||
(ctTOCent.cdte_adr << 24) |
|
||||
(ctTOC.cdth_trk1 << 16);
|
||||
|
||||
ctTOCent.cdte_track = CDROM_LEADOUT;
|
||||
ioctl(hCDROM, CDROMREADTOCENTRY, &ctTOCent);
|
||||
TOC[101] = (ctTOCent.cdte_ctrl << 28) |
|
||||
(ctTOCent.cdte_adr << 24) |
|
||||
(ctTOCent.cdte_addr.lba + add150);
|
||||
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int LinuxCDGetStatus(void) {
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
// see ../windows/cd.cc for more info
|
||||
|
||||
int ret = ioctl(hCDROM, CDROM_DRIVE_STATUS, CDSL_CURRENT);
|
||||
switch(ret) {
|
||||
case CDS_DISC_OK:
|
||||
return 0;
|
||||
case CDS_NO_DISC:
|
||||
return 2;
|
||||
case CDS_TRAY_OPEN:
|
||||
return 3;
|
||||
}
|
||||
|
||||
// guess it's ok to say there's no disc here...
|
||||
return 2;
|
||||
}
|
||||
|
||||
static int LinuxCDReadSectorFAD(u32 FAD, void *buffer) {
|
||||
union {
|
||||
struct cdrom_msf msf;
|
||||
char bigbuf[2352];
|
||||
} position;
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
position.msf.cdmsf_min0 = FAD / 4500;
|
||||
position.msf.cdmsf_sec0 = (FAD % 4500) / 75;
|
||||
position.msf.cdmsf_frame0 = FAD % 75;
|
||||
|
||||
if (ioctl(hCDROM, CDROMREADRAW, &position) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(buffer, position.bigbuf, 2352);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void LinuxCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// No-op
|
||||
}
|
|
@ -1,227 +0,0 @@
|
|||
/* Copyright 2004-2005 Lucas Newman
|
||||
Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2005 Weston Yager
|
||||
Copyright 2006-2008 Guillaume Duhamel
|
||||
Copyright 2010 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <paths.h>
|
||||
#include <sys/param.h>
|
||||
#include <IOKit/IOKitLib.h>
|
||||
#include <IOKit/IOBSD.h>
|
||||
#include <IOKit/storage/IOMediaBSDClient.h>
|
||||
#include <IOKit/storage/IOMedia.h>
|
||||
#include <IOKit/storage/IOCDTypes.h>
|
||||
#include <IOKit/storage/IOCDMedia.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <util.h>
|
||||
|
||||
#include "cdbase.h"
|
||||
|
||||
static int MacOSXCDInit(const char *);
|
||||
static void MacOSXCDDeInit(void);
|
||||
static int MacOSXCDGetStatus(void);
|
||||
static s32 MacOSXCDReadTOC(u32 *);
|
||||
static int MacOSXCDReadSectorFAD(u32, void *);
|
||||
static void MacOSXCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface ArchCD = {
|
||||
CDCORE_ARCH,
|
||||
"MacOSX CD Drive",
|
||||
MacOSXCDInit,
|
||||
MacOSXCDDeInit,
|
||||
MacOSXCDGetStatus,
|
||||
MacOSXCDReadTOC,
|
||||
MacOSXCDReadSectorFAD,
|
||||
MacOSXCDReadAheadFAD,
|
||||
};
|
||||
|
||||
static int hCDROM;
|
||||
|
||||
static int MacOSXCDInit(const char * useless_for_now)
|
||||
{
|
||||
CFMutableDictionaryRef classesToMatch;
|
||||
io_iterator_t mediaIterator;
|
||||
io_object_t media;
|
||||
char cdrom_name[ MAXPATHLEN ];
|
||||
|
||||
classesToMatch = IOServiceMatching(kIOCDMediaClass);
|
||||
CFDictionarySetValue(classesToMatch, CFSTR(kIOMediaEjectableKey),
|
||||
kCFBooleanTrue);
|
||||
IOServiceGetMatchingServices(kIOMasterPortDefault,
|
||||
classesToMatch, &mediaIterator);
|
||||
|
||||
media = IOIteratorNext(mediaIterator);
|
||||
|
||||
if(media)
|
||||
{
|
||||
CFTypeRef path;
|
||||
|
||||
path = IORegistryEntryCreateCFProperty(media,
|
||||
CFSTR(kIOBSDNameKey),
|
||||
kCFAllocatorDefault, 0);
|
||||
|
||||
if (path)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
strcpy(cdrom_name, _PATH_DEV);
|
||||
strcat(cdrom_name, "r");
|
||||
length = strlen(cdrom_name);
|
||||
|
||||
CFStringGetCString(path, cdrom_name + length,
|
||||
MAXPATHLEN - length, kCFStringEncodingUTF8);
|
||||
|
||||
CFRelease(path);
|
||||
}
|
||||
IOObjectRelease(media);
|
||||
}
|
||||
|
||||
if ((hCDROM = open(cdrom_name, O_RDONLY)) == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void MacOSXCDDeInit(void)
|
||||
{
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
close(hCDROM);
|
||||
}
|
||||
}
|
||||
|
||||
static CDTOC * GetTOCFromCDPath(void)
|
||||
{
|
||||
CFMutableDictionaryRef classesToMatch;
|
||||
io_iterator_t mediaIterator;
|
||||
io_object_t media;
|
||||
CDTOC * TOC;
|
||||
|
||||
classesToMatch = IOServiceMatching(kIOCDMediaClass);
|
||||
CFDictionarySetValue(classesToMatch, CFSTR(kIOMediaEjectableKey),
|
||||
kCFBooleanTrue);
|
||||
IOServiceGetMatchingServices(kIOMasterPortDefault,
|
||||
classesToMatch, &mediaIterator);
|
||||
|
||||
media = IOIteratorNext(mediaIterator);
|
||||
|
||||
if(media)
|
||||
{
|
||||
CFDataRef TOCData = IORegistryEntryCreateCFProperty(media, CFSTR(kIOCDMediaTOCKey), kCFAllocatorDefault, 0);
|
||||
TOC = malloc(CFDataGetLength(TOCData));
|
||||
CFDataGetBytes(TOCData,CFRangeMake(0,CFDataGetLength(TOCData)),(UInt8 *)TOC);
|
||||
CFRelease(TOCData);
|
||||
IOObjectRelease(media);
|
||||
}
|
||||
|
||||
return TOC;
|
||||
}
|
||||
|
||||
static s32 MacOSXCDReadTOC(u32 *TOC)
|
||||
{
|
||||
int add150 = 150, tracks = 0;
|
||||
u_char track;
|
||||
int i, fad = 0;
|
||||
CDTOC *cdTOC = GetTOCFromCDPath();
|
||||
CDTOCDescriptor *pTrackDescriptors;
|
||||
pTrackDescriptors = cdTOC->descriptors;
|
||||
|
||||
memset(TOC, 0xFF, 0xCC * 2);
|
||||
|
||||
/* Convert TOC to Saturn format */
|
||||
for( i = 3; i < CDTOCGetDescriptorCount(cdTOC); i++ ) {
|
||||
track = pTrackDescriptors[i].point;
|
||||
fad = CDConvertMSFToLBA(pTrackDescriptors[i].p) + add150;
|
||||
if ((track > 99) || (track < 1))
|
||||
continue;
|
||||
TOC[i-3] = (pTrackDescriptors[i].control << 28 | pTrackDescriptors[i].adr << 24 | fad);
|
||||
tracks++;
|
||||
}
|
||||
|
||||
/* First */
|
||||
TOC[99] = pTrackDescriptors[0].control << 28 | pTrackDescriptors[0].adr << 24 | 1 << 16;
|
||||
/* Last */
|
||||
TOC[100] = pTrackDescriptors[1].control << 28 | pTrackDescriptors[1].adr << 24 | tracks << 16;
|
||||
/* Leadout */
|
||||
TOC[101] = pTrackDescriptors[2].control << 28 | pTrackDescriptors[2].adr << 24 | CDConvertMSFToLBA(pTrackDescriptors[2].p) + add150;
|
||||
|
||||
//free(cdTOC); Looks like this is not need, will look into that.
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
static int MacOSXCDGetStatus(void)
|
||||
{
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
// see ../windows/cd.cc for more info
|
||||
|
||||
//Return that disc is present and spinning. 2 and 3 can't happen in the mac port, i don't understand what "not spinning" is supposed to say
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int MacOSXCDReadSectorFAD(u32 FAD, void *buffer)
|
||||
{
|
||||
const int blockSize = 2352;
|
||||
#ifdef CRAB_REWRITE
|
||||
const int cacheBlocks = 32;
|
||||
static u8 cache[blockSize * cacheBlocks];
|
||||
static u32 cacheFAD = 0xFFFFFF00;
|
||||
#endif
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
#ifdef CRAB_REWRITE
|
||||
/* See if the block we are looking for is in the cache already... */
|
||||
if(FAD < cacheFAD || FAD >= cacheFAD + cacheBlocks) {
|
||||
/* Cache miss, read some blocks from the cd, then we'll hit the
|
||||
cache below. */
|
||||
if(!pread(hCDROM, cache, blockSize * cacheBlocks,
|
||||
(FAD - 150) * blockSize)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
cacheFAD = FAD;
|
||||
}
|
||||
|
||||
/* Cache hit, copy the block out. */
|
||||
memcpy(buffer, cache + (blockSize * (FAD - cacheFAD)), blockSize);
|
||||
return 1;
|
||||
#else
|
||||
if (pread(hCDROM, buffer, blockSize, (FAD - 150) * blockSize))
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void MacOSXCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// No-op
|
||||
}
|
|
@ -1,167 +0,0 @@
|
|||
/* Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2004-2005 Guillaume Duhamel
|
||||
Copyright 2005 Joost Peters
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/cdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "cdbase.h"
|
||||
#include "debug.h"
|
||||
|
||||
static int NetBSDCDInit(const char *);
|
||||
static void NetBSDCDDeInit(void);
|
||||
static s32 NetBSDCDReadTOC(u32 *);
|
||||
static int NetBSDCDGetStatus(void);
|
||||
static int NetBSDCDReadSectorFAD(u32, void *);
|
||||
static void NetBSDCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface ArchCD = {
|
||||
CDCORE_ARCH,
|
||||
"NetBSD CD Drive",
|
||||
NetBSDCDInit,
|
||||
NetBSDCDDeInit,
|
||||
NetBSDCDGetStatus,
|
||||
NetBSDCDReadTOC,
|
||||
NetBSDCDReadSectorFAD,
|
||||
NetBSDCDReadAheadFAD,
|
||||
};
|
||||
|
||||
static int hCDROM;
|
||||
|
||||
static int NetBSDCDInit(const char * cdrom_name) {
|
||||
if ((hCDROM = open(cdrom_name, O_RDONLY | O_NONBLOCK)) == -1) {
|
||||
LOG("CDInit (%s) failed\n", cdrom_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG("CDInit (%s) OK\n", cdrom_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void NetBSDCDDeInit(void) {
|
||||
if (hCDROM != -1) {
|
||||
close(hCDROM);
|
||||
}
|
||||
|
||||
LOG("CDDeInit OK\n");
|
||||
}
|
||||
|
||||
|
||||
static s32 NetBSDCDReadTOC(u32 * TOC)
|
||||
{
|
||||
int success;
|
||||
struct ioc_toc_header ctTOC;
|
||||
struct ioc_read_toc_entry ctTOCent;
|
||||
struct cd_toc_entry data;
|
||||
int i, j;
|
||||
int add150 = 0;
|
||||
|
||||
ctTOCent.address_format = CD_LBA_FORMAT;
|
||||
ctTOCent.data_len = sizeof (struct cd_toc_entry);
|
||||
ctTOCent.data = &data;
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
memset(TOC, 0xFF, 0xCC * 2);
|
||||
memset(&ctTOC, 0xFF, sizeof(struct ioc_toc_header));
|
||||
|
||||
if (ioctl(hCDROM, CDIOREADTOCHEADER, &ctTOC) == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctTOCent.starting_track = ctTOC.starting_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRYS, &ctTOCent);
|
||||
if (ctTOCent.data->addr.lba == 0) add150 = 150;
|
||||
TOC[0] = ((ctTOCent.data->control << 28) |
|
||||
(ctTOCent.data->addr_type << 24) |
|
||||
ctTOCent.data->addr.lba + add150);
|
||||
|
||||
// convert TOC to saturn format
|
||||
for (i = ctTOC.starting_track + 1; i <= ctTOC.ending_track; i++)
|
||||
{
|
||||
ctTOCent.starting_track = i;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRYS, &ctTOCent);
|
||||
TOC[i - 1] = (ctTOCent.data->control << 28) |
|
||||
(ctTOCent.data->addr_type << 24) |
|
||||
(ctTOCent.data->addr.lba + add150);
|
||||
}
|
||||
|
||||
// Do First, Last, and Lead out sections here
|
||||
|
||||
ctTOCent.starting_track = ctTOC.starting_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRYS, &ctTOCent);
|
||||
TOC[99] = (ctTOCent.data->control << 28) |
|
||||
(ctTOCent.data->addr_type << 24) |
|
||||
(ctTOC.starting_track << 16);
|
||||
|
||||
ctTOCent.starting_track = ctTOC.ending_track;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRYS, &ctTOCent);
|
||||
TOC[100] = (ctTOCent.data->control << 28) |
|
||||
(ctTOCent.data->addr_type << 24) |
|
||||
(ctTOC.starting_track << 16);
|
||||
|
||||
ctTOCent.starting_track = 0xAA;
|
||||
ioctl(hCDROM, CDIOREADTOCENTRYS, &ctTOCent);
|
||||
TOC[101] = (ctTOCent.data->control << 28) |
|
||||
(ctTOCent.data->addr_type << 24) |
|
||||
(ctTOCent.data->addr.lba + add150);
|
||||
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int NetBSDCDGetStatus(void) {
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
// see ../windows/cd.cc for more info
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int NetBSDCDReadSectorFAD(u32 FAD, void *buffer) {
|
||||
static const s8 syncHdr[] = {
|
||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
if (hCDROM != -1)
|
||||
{
|
||||
memcpy(buffer, syncHdr, sizeof (syncHdr));
|
||||
lseek(hCDROM, (FAD - 150) * 2048, SEEK_SET);
|
||||
read(hCDROM, (char *)buffer + 0x10, 2048);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void NetBSDCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// No-op
|
||||
}
|
|
@ -1,364 +0,0 @@
|
|||
/* Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2005 Joost Peters
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "windows/cd.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static HANDLE hCDROM;
|
||||
static SCSI_PASS_THROUGH_DIRECT sptd;
|
||||
static int KillCDThread=0;
|
||||
static HANDLE thread_handle=INVALID_HANDLE_VALUE;
|
||||
static int drivestatus=0;
|
||||
static DWORD thread_id;
|
||||
|
||||
CDInterface ArchCD = {
|
||||
CDCORE_SPTI,
|
||||
"Windows SPTI Driver",
|
||||
SPTICDInit,
|
||||
SPTICDDeInit,
|
||||
SPTICDGetStatus,
|
||||
SPTICDReadTOC,
|
||||
SPTICDReadSectorFAD,
|
||||
SPTICDReadAheadFAD,
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// SPTI Interface
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DWORD WINAPI __stdcall SPTICDThread(void *b);
|
||||
|
||||
int SPTICDInit(const char *cdrom_name) {
|
||||
char pipe_name[7];
|
||||
|
||||
sprintf(pipe_name, "\\\\.\\?:");
|
||||
pipe_name[4] = cdrom_name[0];
|
||||
|
||||
if ((hCDROM = CreateFileA(pipe_name, GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
|
||||
NULL)) == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Setup a separate thread for handling SPTI commands(that way the emulation
|
||||
// code doesn't have to wait for a response)
|
||||
KillCDThread=0;
|
||||
thread_handle = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE) SPTICDThread,(void *) &KillCDThread,0,&thread_id);
|
||||
|
||||
// Set it to highest priority to avoid breaks
|
||||
// SetThreadPriority(thread_handle,THREAD_PRIORITY_HIGHEST);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SPTICDDeInit() {
|
||||
if (thread_handle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
// Set the flag telling it to stop
|
||||
KillCDThread=1;
|
||||
if (WaitForSingleObject(thread_handle,INFINITE) == WAIT_TIMEOUT)
|
||||
{
|
||||
// Couldn't close thread cleanly
|
||||
TerminateThread(thread_handle,0);
|
||||
}
|
||||
CloseHandle(thread_handle);
|
||||
thread_handle = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
CloseHandle(hCDROM);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DWORD WINAPI __stdcall SPTICDThread(void *b)
|
||||
{
|
||||
while (KillCDThread != 1)
|
||||
{
|
||||
DWORD dwBytesReturned;
|
||||
unsigned char statusbuf[8];
|
||||
BOOL success;
|
||||
|
||||
// Check to see if we have any work to do(for now, let's just do a drive
|
||||
// status check once a second)
|
||||
|
||||
sptd.Length=sizeof(sptd);
|
||||
sptd.PathId=0; //
|
||||
sptd.TargetId=0; // Don't need these, they're automatically generated
|
||||
sptd.Lun=0; //
|
||||
sptd.CdbLength=12;
|
||||
sptd.SenseInfoLength=0; // No sense data
|
||||
sptd.DataIn=SCSI_IOCTL_DATA_IN;
|
||||
sptd.TimeOutValue=60; // may need to be changed
|
||||
sptd.DataBuffer=(PVOID)&(statusbuf);
|
||||
sptd.SenseInfoOffset=0;
|
||||
sptd.DataTransferLength=8; // may need to change this
|
||||
|
||||
sptd.Cdb[0]=0xBD; // CDB12 code
|
||||
sptd.Cdb[1]=0; // Reserved
|
||||
sptd.Cdb[2]=0; // Reserved
|
||||
sptd.Cdb[3]=0; // Reserved
|
||||
sptd.Cdb[4]=0; // Reserved
|
||||
sptd.Cdb[5]=0; // Reserved
|
||||
sptd.Cdb[6]=0; // Reserved
|
||||
sptd.Cdb[7]=0; // Reserved
|
||||
sptd.Cdb[8]=0; // Allocation Length(byte 1)
|
||||
sptd.Cdb[9]=8; // Allocation Length(byte 2) (may have to change this)
|
||||
sptd.Cdb[10]=0; // Reserved
|
||||
sptd.Cdb[11]=0; // Control
|
||||
sptd.Cdb[12]=0;
|
||||
sptd.Cdb[13]=0;
|
||||
sptd.Cdb[14]=0;
|
||||
sptd.Cdb[15]=0;
|
||||
|
||||
success=DeviceIoControl(hCDROM, IOCTL_SCSI_PASS_THROUGH_DIRECT,
|
||||
(PVOID)&sptd, (DWORD)sizeof(SCSI_PASS_THROUGH_DIRECT),
|
||||
NULL, 0, &dwBytesReturned, NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
// Figure out drive status
|
||||
|
||||
// Is door open?
|
||||
if (statusbuf[1] & 0x10)
|
||||
drivestatus = 3;
|
||||
else
|
||||
{
|
||||
// Ok, so the door is closed, now is there a disc there?
|
||||
success = DeviceIoControl(hCDROM, IOCTL_STORAGE_CHECK_VERIFY,
|
||||
NULL, 0, NULL, 0, &dwBytesReturned, NULL);
|
||||
if (!success)
|
||||
drivestatus = 2;
|
||||
else
|
||||
drivestatus = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
drivestatus = 2;
|
||||
|
||||
Sleep(1000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int SPTICDGetStatus() {
|
||||
// This function is called periodically to see what the status of the
|
||||
// drive is.
|
||||
//
|
||||
// Should return one of the following values:
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
//
|
||||
// If you really don't want to bother too much with this function, just
|
||||
// return status 0. Though it is kind of nice when the bios's cd player,
|
||||
// etc. recognizes when you've ejected the tray and popped in another disc.
|
||||
/*
|
||||
DWORD dwBytesReturned;
|
||||
unsigned char statusbuf[8];
|
||||
BOOL success;
|
||||
|
||||
sptd.Length=sizeof(sptd);
|
||||
sptd.PathId=0; //
|
||||
sptd.TargetId=0; // Don't need these, they're automatically generated
|
||||
sptd.Lun=0; //
|
||||
sptd.CdbLength=12;
|
||||
sptd.SenseInfoLength=0; // No sense data
|
||||
sptd.DataIn=SCSI_IOCTL_DATA_IN;
|
||||
sptd.TimeOutValue=60; // may need to be changed
|
||||
sptd.DataBuffer=(PVOID)&(statusbuf);
|
||||
sptd.SenseInfoOffset=0;
|
||||
sptd.DataTransferLength=8; // may need to change this
|
||||
|
||||
sptd.Cdb[0]=0xBD; // CDB12 code
|
||||
sptd.Cdb[1]=0; // Reserved
|
||||
sptd.Cdb[2]=0; // Reserved
|
||||
sptd.Cdb[3]=0; // Reserved
|
||||
sptd.Cdb[4]=0; // Reserved
|
||||
sptd.Cdb[5]=0; // Reserved
|
||||
sptd.Cdb[6]=0; // Reserved
|
||||
sptd.Cdb[7]=0; // Reserved
|
||||
sptd.Cdb[8]=0; // Allocation Length(byte 1)
|
||||
sptd.Cdb[9]=8; // Allocation Length(byte 2) (may have to change this)
|
||||
sptd.Cdb[10]=0; // Reserved
|
||||
sptd.Cdb[11]=0; // Control
|
||||
sptd.Cdb[12]=0;
|
||||
sptd.Cdb[13]=0;
|
||||
sptd.Cdb[14]=0;
|
||||
sptd.Cdb[15]=0;
|
||||
|
||||
success=DeviceIoControl(hCDROM, IOCTL_SCSI_PASS_THROUGH_DIRECT,
|
||||
(PVOID)&sptd, (DWORD)sizeof(SCSI_PASS_THROUGH_DIRECT),
|
||||
NULL, 0, &dwBytesReturned, NULL);
|
||||
|
||||
if (success)
|
||||
{
|
||||
// Figure out drive status
|
||||
|
||||
// Is door open?
|
||||
if (statusbuf[1] & 0x10) return 3;
|
||||
|
||||
// Ok, so the door is closed, now is there a disc there?
|
||||
success = DeviceIoControl(hCDROM, IOCTL_STORAGE_CHECK_VERIFY,
|
||||
NULL, 0, NULL, 0, &dwBytesReturned, NULL);
|
||||
if (!success)
|
||||
return 2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 2;
|
||||
*/
|
||||
return drivestatus;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define MSF_TO_FAD(m,s,f) ((m * 4500) + (s * 75) + f)
|
||||
|
||||
s32 SPTICDReadTOC(u32 *TOC) {
|
||||
// FILE *debugfp;
|
||||
CDROM_TOC ctTOC;
|
||||
DWORD dwNotUsed;
|
||||
int i;
|
||||
|
||||
if (hCDROM != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
memset(TOC, 0xFF, 0xCC * 2);
|
||||
memset(&ctTOC, 0xFF, sizeof(CDROM_TOC));
|
||||
|
||||
if (DeviceIoControl (hCDROM, IOCTL_CDROM_READ_TOC,
|
||||
NULL, 0, &ctTOC, sizeof(ctTOC),
|
||||
&dwNotUsed, NULL) == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// convert TOC to saturn format
|
||||
for (i = 0; i < ctTOC.LastTrack; i++)
|
||||
{
|
||||
TOC[i] = (ctTOC.TrackData[i].Control << 28) |
|
||||
(ctTOC.TrackData[i].Adr << 24) |
|
||||
MSF_TO_FAD(ctTOC.TrackData[i].Address[1], ctTOC.TrackData[i].Address[2], ctTOC.TrackData[i].Address[3]);
|
||||
}
|
||||
|
||||
// Do First, Last, and Lead out sections here
|
||||
|
||||
TOC[99] = (ctTOC.TrackData[0].Control << 28) |
|
||||
(ctTOC.TrackData[0].Adr << 24) |
|
||||
(ctTOC.FirstTrack << 16);
|
||||
|
||||
TOC[100] = (ctTOC.TrackData[ctTOC.LastTrack - 1].Control << 28) |
|
||||
(ctTOC.TrackData[ctTOC.LastTrack - 1].Adr << 24) |
|
||||
(ctTOC.LastTrack << 16);
|
||||
|
||||
TOC[101] = (ctTOC.TrackData[ctTOC.LastTrack].Control << 28) |
|
||||
(ctTOC.TrackData[ctTOC.LastTrack].Adr << 24) |
|
||||
MSF_TO_FAD(ctTOC.TrackData[ctTOC.LastTrack].Address[1], ctTOC.TrackData[ctTOC.LastTrack].Address[2], ctTOC.TrackData[ctTOC.LastTrack].Address[3]);
|
||||
|
||||
// debugfp = fopen("cot2toc.bin", "wb");
|
||||
// fwrite((void *)TOC, 1, 0xCC * 2, debugfp);
|
||||
// fclose(debugfp);
|
||||
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int SPTICDReadSectorFAD(u32 FAD, void *buffer) {
|
||||
// This function is supposed to read exactly 1 -RAW- 2352-byte sector at
|
||||
// the specified FAD address to buffer. Should return true if successful,
|
||||
// false if there was an error.
|
||||
//
|
||||
// Special Note: To convert from FAD to LBA/LSN, minus 150.
|
||||
//
|
||||
// The whole process needed to be changed since I need more control over
|
||||
// sector detection, etc. Not to mention it means less work for the porter
|
||||
// since they only have to implement raw sector reading as opposed to
|
||||
// implementing mode 1, mode 2 form1/form2, -and- raw sector reading.
|
||||
|
||||
DWORD dwBytesReturned;
|
||||
BOOL success;
|
||||
|
||||
sptd.Length=sizeof(sptd);
|
||||
sptd.PathId=0; //
|
||||
sptd.TargetId=0; // Don't need these, they're automatically generated
|
||||
sptd.Lun=0; //
|
||||
sptd.CdbLength=12;
|
||||
sptd.SenseInfoLength=0; // No sense data
|
||||
sptd.DataIn=SCSI_IOCTL_DATA_IN;
|
||||
sptd.TimeOutValue=60; // may need to be changed
|
||||
sptd.DataBuffer=(PVOID)buffer;
|
||||
sptd.SenseInfoOffset=0;
|
||||
sptd.DataTransferLength=2352;
|
||||
|
||||
sptd.Cdb[0]=0xBE; // CDB12 code
|
||||
sptd.Cdb[1]=0; // Sector Type, RELADR
|
||||
FAD -= 150;
|
||||
sptd.Cdb[2]=(unsigned char)((FAD & 0xFF000000) >> 24); // lba(byte 1)
|
||||
sptd.Cdb[3]=(unsigned char)((FAD & 0x00FF0000) >> 16); // lba(byte 2)
|
||||
sptd.Cdb[4]=(unsigned char)((FAD & 0x0000FF00) >> 8); // lba(byte 3)
|
||||
sptd.Cdb[5]=(unsigned char)(FAD & 0x000000FF); // lba(byte 4)
|
||||
sptd.Cdb[6]=0; // number of sectors(byte 1)
|
||||
sptd.Cdb[7]=0; // number of sectors(byte 2)
|
||||
sptd.Cdb[8]=1; // number of sectors(byte 3)
|
||||
sptd.Cdb[9]=0xF8; // Sync + All Headers + User data + EDC/ECC
|
||||
sptd.Cdb[10]=0;
|
||||
sptd.Cdb[11]=0;
|
||||
sptd.Cdb[12]=0;
|
||||
sptd.Cdb[13]=0;
|
||||
sptd.Cdb[14]=0;
|
||||
sptd.Cdb[15]=0;
|
||||
|
||||
success=DeviceIoControl(hCDROM,
|
||||
IOCTL_SCSI_PASS_THROUGH_DIRECT,
|
||||
(PVOID)&sptd, (DWORD)sizeof(SCSI_PASS_THROUGH_DIRECT),
|
||||
NULL, 0,
|
||||
&dwBytesReturned,
|
||||
NULL);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SPTICDReadAheadFAD(u32 FAD) {
|
||||
// No-op
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
|
@ -1,512 +0,0 @@
|
|||
/* Copyright 2004-2008 Theo Berkau
|
||||
Copyright 2005 Joost Peters
|
||||
Copyright 2005-2006 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include "cdbase.h"
|
||||
#include "error.h"
|
||||
#include "debug.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Contains the Dummy and ISO CD Interfaces
|
||||
|
||||
static int DummyCDInit(const char *);
|
||||
static void DummyCDDeInit(void);
|
||||
static int DummyCDGetStatus(void);
|
||||
static s32 DummyCDReadTOC(u32 *);
|
||||
static int DummyCDReadSectorFAD(u32, void *);
|
||||
static void DummyCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface DummyCD = {
|
||||
CDCORE_DUMMY,
|
||||
"Dummy CD Drive",
|
||||
DummyCDInit,
|
||||
DummyCDDeInit,
|
||||
DummyCDGetStatus,
|
||||
DummyCDReadTOC,
|
||||
DummyCDReadSectorFAD,
|
||||
DummyCDReadAheadFAD,
|
||||
};
|
||||
|
||||
static int ISOCDInit(const char *);
|
||||
static void ISOCDDeInit(void);
|
||||
static int ISOCDGetStatus(void);
|
||||
static s32 ISOCDReadTOC(u32 *);
|
||||
static int ISOCDReadSectorFAD(u32, void *);
|
||||
static void ISOCDReadAheadFAD(u32);
|
||||
|
||||
CDInterface ISOCD = {
|
||||
CDCORE_ISO,
|
||||
"ISO-File Virtual Drive",
|
||||
ISOCDInit,
|
||||
ISOCDDeInit,
|
||||
ISOCDGetStatus,
|
||||
ISOCDReadTOC,
|
||||
ISOCDReadSectorFAD,
|
||||
ISOCDReadAheadFAD,
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Dummy Interface
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int DummyCDInit(UNUSED const char *cdrom_name)
|
||||
{
|
||||
// Initialization function. cdrom_name can be whatever you want it to
|
||||
// be. Obviously with some ports(e.g. the dreamcast port) you probably
|
||||
// won't even use it.
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void DummyCDDeInit(void)
|
||||
{
|
||||
// Cleanup function. Enough said.
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int DummyCDGetStatus(void)
|
||||
{
|
||||
// This function is called periodically to see what the status of the
|
||||
// drive is.
|
||||
//
|
||||
// Should return one of the following values:
|
||||
// 0 - CD Present, disc spinning
|
||||
// 1 - CD Present, disc not spinning
|
||||
// 2 - CD not present
|
||||
// 3 - Tray open
|
||||
//
|
||||
// If you really don't want to bother too much with this function, just
|
||||
// return status 0. Though it is kind of nice when the bios's cd
|
||||
// player, etc. recognizes when you've ejected the tray and popped in
|
||||
// another disc.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static s32 DummyCDReadTOC(UNUSED u32 *TOC)
|
||||
{
|
||||
// The format of TOC is as follows:
|
||||
// TOC[0] - TOC[98] are meant for tracks 1-99. Each entry has the
|
||||
// following format:
|
||||
// bits 0 - 23: track FAD address
|
||||
// bits 24 - 27: track addr
|
||||
// bits 28 - 31: track ctrl
|
||||
//
|
||||
// Any Unused tracks should be set to 0xFFFFFFFF
|
||||
//
|
||||
// TOC[99] - Point A0 information
|
||||
// Uses the following format:
|
||||
// bits 0 - 7: PFRAME(should always be 0)
|
||||
// bits 7 - 15: PSEC(Program area format: 0x00 - CDDA or CDROM,
|
||||
// 0x10 - CDI, 0x20 - CDROM-XA)
|
||||
// bits 16 - 23: PMIN(first track's number)
|
||||
// bits 24 - 27: first track's addr
|
||||
// bits 28 - 31: first track's ctrl
|
||||
//
|
||||
// TOC[100] - Point A1 information
|
||||
// Uses the following format:
|
||||
// bits 0 - 7: PFRAME(should always be 0)
|
||||
// bits 7 - 15: PSEC(should always be 0)
|
||||
// bits 16 - 23: PMIN(last track's number)
|
||||
// bits 24 - 27: last track's addr
|
||||
// bits 28 - 31: last track's ctrl
|
||||
//
|
||||
// TOC[101] - Point A2 information
|
||||
// Uses the following format:
|
||||
// bits 0 - 23: leadout FAD address
|
||||
// bits 24 - 27: leadout's addr
|
||||
// bits 28 - 31: leadout's ctrl
|
||||
//
|
||||
// Special Note: To convert from LBA/LSN to FAD, add 150.
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int DummyCDReadSectorFAD(UNUSED u32 FAD, void * buffer)
|
||||
{
|
||||
// This function is supposed to read exactly 1 -RAW- 2352-byte sector
|
||||
// at the specified FAD address to buffer. Should return true if
|
||||
// successful, false if there was an error.
|
||||
//
|
||||
// Special Note: To convert from FAD to LBA/LSN, minus 150.
|
||||
//
|
||||
// The whole process needed to be changed since I need more control
|
||||
// over sector detection, etc. Not to mention it means less work for
|
||||
// the porter since they only have to implement raw sector reading as
|
||||
// opposed to implementing mode 1, mode 2 form1/form2, -and- raw
|
||||
// sector reading.
|
||||
|
||||
memset(buffer, 0, 2352);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void DummyCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// This function is called to tell the driver which sector (FAD
|
||||
// address) is expected to be read next. If the driver supports
|
||||
// read-ahead, it should start reading the given sector in the
|
||||
// background while the emulation continues, so that when the
|
||||
// sector is actually read with ReadSectorFAD() it'll be available
|
||||
// immediately. (Note that there's no guarantee this sector will
|
||||
// actually be requested--the emulated CD might be stopped before
|
||||
// the sector is read, for example.)
|
||||
//
|
||||
// This function should NOT block. If the driver can't perform
|
||||
// asynchronous reads (or you just don't want to bother handling
|
||||
// them), make this function a no-op and just read sectors
|
||||
// normally.
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ISO Interface
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static const s8 syncHdr[12] = { 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00 };
|
||||
static FILE *isofile=NULL;
|
||||
static int isofilesize=0;
|
||||
static int bytesPerSector = 0;
|
||||
static int isbincue = 0;
|
||||
static u32 isoTOC[102];
|
||||
static struct
|
||||
{
|
||||
u32 fadstart;
|
||||
u32 fileoffset;
|
||||
} isooffsettbl[100];
|
||||
|
||||
#define MSF_TO_FAD(m,s,f) ((m * 4500) + (s * 75) + f)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int InitBinCue(const char *cuefilename)
|
||||
{
|
||||
u32 size;
|
||||
char *tempbuffer, *tempbuffer2;
|
||||
unsigned int tracknum;
|
||||
unsigned int indexnum, min, sec, frame;
|
||||
unsigned int pregap=0;
|
||||
char *p, *p2;
|
||||
|
||||
fseek(isofile, 0, SEEK_END);
|
||||
size = ftell(isofile);
|
||||
fseek(isofile, 0, SEEK_SET);
|
||||
|
||||
// Allocate buffer with enough space for reading cue
|
||||
if ((tempbuffer = (char *)calloc(size, 1)) == NULL)
|
||||
return -1;
|
||||
|
||||
// Skip image filename
|
||||
if (fscanf(isofile, "FILE \"%*[^\"]\" %*s\r\n") == EOF)
|
||||
{
|
||||
free(tempbuffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Time to generate TOC
|
||||
for (;;)
|
||||
{
|
||||
// Retrieve a line in cue
|
||||
if (fscanf(isofile, "%s", tempbuffer) == EOF)
|
||||
break;
|
||||
|
||||
// Figure out what it is
|
||||
if (strncmp(tempbuffer, "TRACK", 5) == 0)
|
||||
{
|
||||
// Handle accordingly
|
||||
if (fscanf(isofile, "%d %[^\r\n]\r\n", &tracknum, tempbuffer) == EOF)
|
||||
break;
|
||||
|
||||
if (strncmp(tempbuffer, "MODE1", 5) == 0 ||
|
||||
strncmp(tempbuffer, "MODE2", 5) == 0)
|
||||
{
|
||||
// Figure out the track sector size
|
||||
bytesPerSector = atoi(tempbuffer + 6);
|
||||
|
||||
// Update toc entry
|
||||
isoTOC[tracknum-1] = 0x41000000;
|
||||
}
|
||||
else if (strncmp(tempbuffer, "AUDIO", 5) == 0)
|
||||
{
|
||||
// fix me
|
||||
// Update toc entry
|
||||
isoTOC[tracknum-1] = 0x01000000;
|
||||
}
|
||||
}
|
||||
else if (strncmp(tempbuffer, "INDEX", 5) == 0)
|
||||
{
|
||||
// Handle accordingly
|
||||
|
||||
if (fscanf(isofile, "%d %d:%d:%d\r\n", &indexnum, &min, &sec, &frame) == EOF)
|
||||
break;
|
||||
|
||||
if (indexnum == 1)
|
||||
{
|
||||
// Update toc entry
|
||||
isoTOC[tracknum-1] = (isoTOC[tracknum-1] & 0xFF000000) | (MSF_TO_FAD(min, sec, frame) + pregap + 150);
|
||||
|
||||
isooffsettbl[tracknum-1].fadstart = MSF_TO_FAD(min, sec, frame) + pregap + 150;
|
||||
isooffsettbl[tracknum-1].fileoffset = pregap + 150;
|
||||
}
|
||||
}
|
||||
else if (strncmp(tempbuffer, "PREGAP", 5) == 0)
|
||||
{
|
||||
if (fscanf(isofile, "%d:%d:%d\r\n", &min, &sec, &frame) == EOF)
|
||||
break;
|
||||
|
||||
pregap += MSF_TO_FAD(min, sec, frame);
|
||||
}
|
||||
else if (strncmp(tempbuffer, "POSTGAP", 5) == 0)
|
||||
{
|
||||
if (fscanf(isofile, "%d:%d:%d\r\n", &min, &sec, &frame) == EOF)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Go back, retrieve image filename
|
||||
fseek(isofile, 0, SEEK_SET);
|
||||
fscanf(isofile, "FILE \"%[^\"]\" %*s\r\n", tempbuffer);
|
||||
fclose(isofile);
|
||||
|
||||
// Now go and open up the image file, figure out its size, etc.
|
||||
if ((isofile = fopen(tempbuffer, "rb")) == NULL)
|
||||
{
|
||||
// Ok, exact path didn't work. Let's trim the path and try opening the
|
||||
// file from the same directory as the cue.
|
||||
|
||||
// find the start of filename
|
||||
p = tempbuffer;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (strcspn(p, "/\\") == strlen(p))
|
||||
break;
|
||||
|
||||
p += strcspn(p, "/\\") + 1;
|
||||
}
|
||||
|
||||
// append directory of cue file with bin filename
|
||||
if ((tempbuffer2 = (char *)calloc(strlen(cuefilename) + strlen(p) + 1, 1)) == NULL)
|
||||
{
|
||||
free(tempbuffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// find end of path
|
||||
p2 = (char *)cuefilename;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (strcspn(p2, "/\\") == strlen(p2))
|
||||
break;
|
||||
p2 += strcspn(p2, "/\\") + 1;
|
||||
}
|
||||
|
||||
// Make sure there was at least some kind of path, otherwise our
|
||||
// second check is pretty useless
|
||||
if (cuefilename == p2 && tempbuffer == p)
|
||||
{
|
||||
free(tempbuffer);
|
||||
free(tempbuffer2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
strncpy(tempbuffer2, cuefilename, p2 - cuefilename);
|
||||
strcat(tempbuffer2, p);
|
||||
|
||||
// Let's give it another try
|
||||
isofile = fopen(tempbuffer2, "rb");
|
||||
free(tempbuffer2);
|
||||
|
||||
if (isofile == NULL)
|
||||
{
|
||||
YabSetError(YAB_ERR_FILENOTFOUND, tempbuffer);
|
||||
free(tempbuffer);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// buffer is no longer needed
|
||||
free(tempbuffer);
|
||||
|
||||
fseek(isofile, 0, SEEK_END);
|
||||
isofilesize = ftell(isofile);
|
||||
fseek(isofile, 0, SEEK_SET);
|
||||
|
||||
// Now then, generate rest of TOC
|
||||
isoTOC[99] = (isoTOC[0] & 0xFF000000) | 0x010000;
|
||||
isoTOC[100] = (isoTOC[tracknum - 1] & 0xFF000000) | (tracknum << 16);
|
||||
isoTOC[101] = (isoTOC[tracknum - 1] & 0xFF000000) | ((isofilesize / bytesPerSector) + pregap + 150);
|
||||
|
||||
isooffsettbl[tracknum].fileoffset = 0;
|
||||
isooffsettbl[tracknum].fadstart = 0xFFFFFFFF;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int ISOCDInit(const char * iso) {
|
||||
char header[6];
|
||||
|
||||
memset(isoTOC, 0xFF, 0xCC * 2);
|
||||
|
||||
if (!iso)
|
||||
return -1;
|
||||
|
||||
if (!(isofile = fopen(iso, "rb")))
|
||||
{
|
||||
YabSetError(YAB_ERR_FILENOTFOUND, (char *)iso);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fread((void *)header, 1, 6, isofile);
|
||||
|
||||
// Figure out what kind of image format we're dealing with
|
||||
if (strncmp(header, "FILE \"", 6) == 0)
|
||||
{
|
||||
// It's a BIN/CUE
|
||||
isbincue = 1;
|
||||
|
||||
// Generate TOC for bin file
|
||||
if (InitBinCue(iso) != 0)
|
||||
{
|
||||
if (isofile)
|
||||
free(isofile);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Assume it's an ISO file
|
||||
isbincue = 0;
|
||||
|
||||
fseek(isofile, 0, SEEK_END);
|
||||
isofilesize = ftell(isofile);
|
||||
|
||||
if (0 == (isofilesize % 2048))
|
||||
bytesPerSector = 2048;
|
||||
else if (0 == (isofilesize % 2352))
|
||||
bytesPerSector = 2352;
|
||||
else
|
||||
{
|
||||
YabSetError(YAB_ERR_OTHER, "Unsupported CD image!\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Generate TOC
|
||||
isoTOC[0] = 0x41000096;
|
||||
isoTOC[99] = 0x41010000;
|
||||
isoTOC[100] = 0x41010000;
|
||||
isoTOC[101] = (0x41 << 24) | (isofilesize / bytesPerSector); //this isn't fully correct, but it does the job for now.
|
||||
|
||||
isooffsettbl[0].fileoffset = 150;
|
||||
isooffsettbl[0].fadstart = 150;
|
||||
isooffsettbl[1].fileoffset = 0;
|
||||
isooffsettbl[1].fadstart = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void ISOCDDeInit(void) {
|
||||
if (isofile)
|
||||
{
|
||||
fclose(isofile);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int ISOCDGetStatus(void) {
|
||||
return isofile != NULL ? 0 : 2;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static s32 ISOCDReadTOC(u32 * TOC) {
|
||||
memcpy(TOC, isoTOC, 0xCC * 2);
|
||||
|
||||
return (0xCC * 2);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int ISOCDReadSectorFAD(u32 FAD, void *buffer) {
|
||||
int sector;
|
||||
int i;
|
||||
|
||||
assert(isofile);
|
||||
|
||||
memset(buffer, 0, 2352);
|
||||
|
||||
for (i = 1; i < 100; i++)
|
||||
{
|
||||
if (FAD < isooffsettbl[i].fadstart)
|
||||
{
|
||||
sector = FAD - isooffsettbl[i-1].fileoffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == 100) {
|
||||
CDLOG("Warning: Sector not found in track list");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((sector * bytesPerSector) >= isofilesize) {
|
||||
CDLOG("Warning: Trying to read beyond end of CD image! (sector: %d)\n", sector);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fseek(isofile, sector * bytesPerSector, SEEK_SET);
|
||||
|
||||
if (2048 == bytesPerSector) {
|
||||
memcpy(buffer, syncHdr, 12);
|
||||
fread((char *)buffer + 0x10, bytesPerSector, 1, isofile);
|
||||
} else { //2352
|
||||
fread(buffer, bytesPerSector, 1, isofile);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void ISOCDReadAheadFAD(UNUSED u32 FAD)
|
||||
{
|
||||
// No-op
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* Copyright 2004-2005 Theo Berkau
|
||||
Copyright 2005 Joost Peters
|
||||
Copyright 2006 Guillaume Duhamel
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef CDBASE_H
|
||||
#define CDBASE_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "core.h"
|
||||
|
||||
#define CDCORE_DEFAULT -1
|
||||
#define CDCORE_DUMMY 0
|
||||
#define CDCORE_ISO 1
|
||||
#define CDCORE_ARCH 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int id;
|
||||
const char *Name;
|
||||
int (*Init)(const char *);
|
||||
void (*DeInit)(void);
|
||||
int (*GetStatus)(void);
|
||||
s32 (*ReadTOC)(u32 *TOC);
|
||||
int (*ReadSectorFAD)(u32 FAD, void *buffer);
|
||||
void (*ReadAheadFAD)(u32 FAD);
|
||||
} CDInterface;
|
||||
|
||||
extern CDInterface DummyCD;
|
||||
|
||||
extern CDInterface ISOCD;
|
||||
|
||||
extern CDInterface ArchCD;
|
||||
|
||||
#endif
|
|
@ -1,383 +0,0 @@
|
|||
/* Copyright 2007-2008 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "cheat.h"
|
||||
#include "memory.h"
|
||||
#include "sh2core.h"
|
||||
|
||||
cheatlist_struct *cheatlist=NULL;
|
||||
int numcheats=0;
|
||||
int cheatsize;
|
||||
|
||||
#define DoubleWordSwap(x) x = (((x & 0xFF000000) >> 24) + \
|
||||
((x & 0x00FF0000) >> 8) + \
|
||||
((x & 0x0000FF00) << 8) + \
|
||||
((x & 0x000000FF) << 24));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatInit(void)
|
||||
{
|
||||
cheatsize = 10;
|
||||
if ((cheatlist = (cheatlist_struct *)calloc(cheatsize, sizeof(cheatlist_struct))) == NULL)
|
||||
return -1;
|
||||
cheatlist[0].type = CHEATTYPE_NONE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CheatDeInit(void)
|
||||
{
|
||||
if (cheatlist)
|
||||
free(cheatlist);
|
||||
cheatlist = NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatAddCode(int type, u32 addr, u32 val)
|
||||
{
|
||||
cheatlist[numcheats].type = type;
|
||||
cheatlist[numcheats].addr = addr;
|
||||
cheatlist[numcheats].val = val;
|
||||
cheatlist[numcheats].desc = NULL;
|
||||
cheatlist[numcheats].enable = 1;
|
||||
numcheats++;
|
||||
|
||||
// Make sure we still have room
|
||||
if (numcheats >= cheatsize)
|
||||
{
|
||||
cheatlist = realloc(cheatlist, sizeof(cheatlist_struct) * (cheatsize * 2));
|
||||
cheatsize *= 2;
|
||||
}
|
||||
|
||||
cheatlist[numcheats].type = CHEATTYPE_NONE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatAddARCode(const char *code)
|
||||
{
|
||||
unsigned long addr;
|
||||
unsigned short val;
|
||||
sscanf(code, "%08lX %04hX", &addr, &val);
|
||||
switch (addr >> 28)
|
||||
{
|
||||
case 0x0:
|
||||
// One time word write(fix me)
|
||||
return -1;
|
||||
case 0x1:
|
||||
return CheatAddCode(CHEATTYPE_WORDWRITE, addr & 0x0FFFFFFF, val);
|
||||
case 0x3:
|
||||
return CheatAddCode(CHEATTYPE_BYTEWRITE, addr & 0x0FFFFFFF, val);
|
||||
case 0xD:
|
||||
return CheatAddCode(CHEATTYPE_ENABLE, addr & 0x0FFFFFFF, val);
|
||||
default: return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static int FindCheat(int type, u32 addr, u32 val)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < numcheats; i++)
|
||||
{
|
||||
if (cheatlist[i].type == type &&
|
||||
cheatlist[i].addr == addr &&
|
||||
cheatlist[i].val == val)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatChangeDescription(int type, u32 addr, u32 val, char *desc)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ((i = FindCheat(type, addr, val)) == -1)
|
||||
// There is no matches, so let's bail
|
||||
return -1;
|
||||
|
||||
return CheatChangeDescriptionByIndex(i, desc);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatChangeDescriptionByIndex(int i, char *desc)
|
||||
{
|
||||
// Free old description(if existing)
|
||||
if (cheatlist[i].desc)
|
||||
free(cheatlist[i].desc);
|
||||
|
||||
cheatlist[i].desc = strdup(desc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatRemoveCode(int type, u32 addr, u32 val)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ((i = FindCheat(type, addr, val)) == -1)
|
||||
// There is no matches, so let's bail
|
||||
return -1;
|
||||
|
||||
return CheatRemoveCodeByIndex(i);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatRemoveCodeByIndex(int i)
|
||||
{
|
||||
// If there's a description, free the memory.
|
||||
if (cheatlist[i].desc)
|
||||
{
|
||||
free(cheatlist[i].desc);
|
||||
cheatlist[i].desc = NULL;
|
||||
}
|
||||
|
||||
// Move all entries one forward
|
||||
for (; i < numcheats-1; i++)
|
||||
memcpy(&cheatlist[i], &cheatlist[i+1], sizeof(cheatlist_struct));
|
||||
|
||||
numcheats--;
|
||||
|
||||
// Set the last one to type none
|
||||
cheatlist[numcheats].type = CHEATTYPE_NONE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatRemoveARCode(const char *code)
|
||||
{
|
||||
unsigned long addr;
|
||||
unsigned short val;
|
||||
sscanf(code, "%08lX %04hX", &addr, &val);
|
||||
|
||||
switch (addr >> 28)
|
||||
{
|
||||
case 0x1:
|
||||
return CheatRemoveCode(CHEATTYPE_WORDWRITE, addr & 0x0FFFFFFF, val);
|
||||
case 0x3:
|
||||
return CheatRemoveCode(CHEATTYPE_BYTEWRITE, addr & 0x0FFFFFFF, val);
|
||||
case 0xD:
|
||||
return CheatRemoveCode(CHEATTYPE_ENABLE, addr & 0x0FFFFFFF, val);
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CheatClearCodes(void)
|
||||
{
|
||||
while (numcheats > 0)
|
||||
CheatRemoveCodeByIndex(numcheats-1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CheatEnableCode(int index)
|
||||
{
|
||||
cheatlist[index].enable = 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CheatDisableCode(int index)
|
||||
{
|
||||
cheatlist[index].enable = 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CheatDoPatches(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
switch (cheatlist[i].type)
|
||||
{
|
||||
case CHEATTYPE_NONE:
|
||||
return;
|
||||
case CHEATTYPE_ENABLE:
|
||||
if (cheatlist[i].enable == 0)
|
||||
continue;
|
||||
if (MappedMemoryReadWord(cheatlist[i].addr) != cheatlist[i].val)
|
||||
return;
|
||||
break;
|
||||
case CHEATTYPE_BYTEWRITE:
|
||||
if (cheatlist[i].enable == 0)
|
||||
continue;
|
||||
MappedMemoryWriteByte(cheatlist[i].addr, (u8)cheatlist[i].val);
|
||||
SH2WriteNotify(cheatlist[i].addr, 1);
|
||||
break;
|
||||
case CHEATTYPE_WORDWRITE:
|
||||
if (cheatlist[i].enable == 0)
|
||||
continue;
|
||||
MappedMemoryWriteWord(cheatlist[i].addr, (u16)cheatlist[i].val);
|
||||
SH2WriteNotify(cheatlist[i].addr, 2);
|
||||
break;
|
||||
case CHEATTYPE_LONGWRITE:
|
||||
if (cheatlist[i].enable == 0)
|
||||
continue;
|
||||
MappedMemoryWriteLong(cheatlist[i].addr, cheatlist[i].val);
|
||||
SH2WriteNotify(cheatlist[i].addr, 4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
cheatlist_struct *CheatGetList(int *cheatnum)
|
||||
{
|
||||
if (cheatnum == NULL)
|
||||
return NULL;
|
||||
|
||||
*cheatnum = numcheats;
|
||||
return cheatlist;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatSave(const char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
int i;
|
||||
int num;
|
||||
IOCheck_struct check;
|
||||
|
||||
if (!filename)
|
||||
return -1;
|
||||
|
||||
if ((fp = fopen(filename, "wb")) == NULL)
|
||||
return -1;
|
||||
|
||||
fprintf(fp, "YCHT");
|
||||
num = numcheats;
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
DoubleWordSwap(num);
|
||||
#endif
|
||||
ywrite(&check, (void *)&num, sizeof(int), 1, fp);
|
||||
|
||||
for(i = 0; i < numcheats; i++)
|
||||
{
|
||||
u8 descsize;
|
||||
cheatlist_struct cheat;
|
||||
|
||||
memcpy(&cheat, &cheatlist[i], sizeof(cheatlist_struct));
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
DoubleWordSwap(cheat.type);
|
||||
DoubleWordSwap(cheat.addr);
|
||||
DoubleWordSwap(cheat.val);
|
||||
DoubleWordSwap(cheat.enable);
|
||||
#endif
|
||||
ywrite(&check, (void *)&cheat.type, sizeof(int), 1, fp);
|
||||
ywrite(&check, (void *)&cheat.addr, sizeof(u32), 1, fp);
|
||||
ywrite(&check, (void *)&cheat.val, sizeof(u32), 1, fp);
|
||||
descsize = (u8)strlen(cheatlist[i].desc)+1;
|
||||
ywrite(&check, (void *)&descsize, sizeof(u8), 1, fp);
|
||||
ywrite(&check, (void *)cheatlist[i].desc, sizeof(char), descsize, fp);
|
||||
ywrite(&check, (void *)&cheat.enable, sizeof(int), 1, fp);
|
||||
}
|
||||
|
||||
fclose (fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int CheatLoad(const char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
int i;
|
||||
char id[4];
|
||||
char desc[256];
|
||||
IOCheck_struct check;
|
||||
|
||||
if (!filename)
|
||||
return -1;
|
||||
|
||||
if ((fp = fopen(filename, "rb")) == NULL)
|
||||
return -1;
|
||||
|
||||
yread(&check, (void *)id, 1, 4, fp);
|
||||
if (strncmp(id, "YCHT", 4) != 0)
|
||||
{
|
||||
fclose(fp);
|
||||
return -2;
|
||||
}
|
||||
|
||||
CheatClearCodes();
|
||||
|
||||
yread(&check, (void *)&numcheats, sizeof(int), 1, fp);
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
DoubleWordSwap(numcheats);
|
||||
#endif
|
||||
|
||||
if (numcheats >= cheatsize)
|
||||
{
|
||||
cheatlist = realloc(cheatlist, sizeof(cheatlist_struct) * (cheatsize * 2));
|
||||
memset((void *)cheatlist, 0, sizeof(cheatlist_struct) * (cheatsize * 2));
|
||||
cheatsize *= 2;
|
||||
}
|
||||
|
||||
for(i = 0; i < numcheats; i++)
|
||||
{
|
||||
u8 descsize;
|
||||
|
||||
yread(&check, (void *)&cheatlist[i].type, sizeof(int), 1, fp);
|
||||
yread(&check, (void *)&cheatlist[i].addr, sizeof(u32), 1, fp);
|
||||
yread(&check, (void *)&cheatlist[i].val, sizeof(u32), 1, fp);
|
||||
yread(&check, (void *)&descsize, sizeof(u8), 1, fp);
|
||||
yread(&check, (void *)desc, sizeof(char), descsize, fp);
|
||||
CheatChangeDescriptionByIndex(i, desc);
|
||||
yread(&check, (void *)&cheatlist[i].enable, sizeof(int), 1, fp);
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
DoubleWordSwap(cheatlist[i].type);
|
||||
DoubleWordSwap(cheatlist[i].addr);
|
||||
DoubleWordSwap(cheatlist[i].val);
|
||||
DoubleWordSwap(cheatlist[i].enable);
|
||||
#endif
|
||||
}
|
||||
|
||||
fclose (fp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* Copyright 2007 Theo Berkau
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef CHEAT_H
|
||||
#define CHEAT_H
|
||||
|
||||
#include "core.h"
|
||||
|
||||
enum
|
||||
{
|
||||
CHEATTYPE_NONE=0,
|
||||
CHEATTYPE_ENABLE,
|
||||
CHEATTYPE_BYTEWRITE,
|
||||
CHEATTYPE_WORDWRITE,
|
||||
CHEATTYPE_LONGWRITE
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
u32 addr;
|
||||
u32 val;
|
||||
char *desc;
|
||||
int enable;
|
||||
} cheatlist_struct;
|
||||
|
||||
int CheatInit(void);
|
||||
void CheatDeInit(void);
|
||||
int CheatAddCode(int type, u32 addr, u32 val);
|
||||
int CheatAddARCode(const char *code);
|
||||
int CheatChangeDescription(int type, u32 addr, u32 val, char *desc);
|
||||
int CheatChangeDescriptionByIndex(int i, char *desc);
|
||||
int CheatRemoveCode(int type, u32 addr, u32 val);
|
||||
int CheatRemoveCodeByIndex(int i);
|
||||
int CheatRemoveARCode(const char *code);
|
||||
void CheatClearCodes(void);
|
||||
void CheatEnableCode(int index);
|
||||
void CheatDisableCode(int index);
|
||||
void CheatDoPatches(void);
|
||||
cheatlist_struct *CheatGetList(int *cheatnum);
|
||||
int CheatSave(const char *filename);
|
||||
int CheatLoad(const char *filename);
|
||||
|
||||
#endif
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Yabause</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Yabause.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.yabause.yabause.cocoa</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Yabause</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>${YAB_VERSION}</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string></string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © Yabause Team</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,73 +0,0 @@
|
|||
project(yabause-cocoa)
|
||||
|
||||
yab_port_start()
|
||||
|
||||
find_library(AUDIO_LIBRARY AudioUnit)
|
||||
|
||||
if (NOT AUDIO_LIBRARY)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(yabause_cocoa_SOURCES
|
||||
main.m
|
||||
PerCocoa.m
|
||||
YabauseButtonFormatter.m
|
||||
YabauseController.m
|
||||
YabauseGLView.m
|
||||
YabausePrefsController.m
|
||||
vidgcd.c
|
||||
vidgcd.h
|
||||
)
|
||||
|
||||
set(yabause_cocoa_XIBS English.lproj/MainMenu)
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
|
||||
add_executable(yabause-cocoa MACOSX_BUNDLE ${yabause_cocoa_SOURCES})
|
||||
target_link_libraries(yabause-cocoa yabause ${YABAUSE_LIBRARIES}
|
||||
${AUDIO_LIBRARY})
|
||||
|
||||
yab_port_stop()
|
||||
set_target_properties(yabause-cocoa PROPERTIES OUTPUT_NAME Yabause)
|
||||
|
||||
set_target_properties(yabause-cocoa PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/CMake-Info.plist)
|
||||
|
||||
find_program(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin")
|
||||
if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND")
|
||||
message(SEND_ERROR "ibtool can not be found and is needed to compile the .xib files. It should have been installed with
|
||||
the Apple developer tools. The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin")
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
TARGET yabause-cocoa PRE_BUILD
|
||||
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/MacOS)
|
||||
|
||||
add_custom_command(
|
||||
TARGET yabause-cocoa PRE_BUILD
|
||||
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/Resources/English.lproj)
|
||||
|
||||
foreach(xib ${yabause_cocoa_XIBS})
|
||||
add_custom_command(
|
||||
TARGET yabause-cocoa POST_BUILD
|
||||
COMMAND ${IBTOOL} --errors --warnings --notices
|
||||
--output-format human-readable-text
|
||||
--compile ${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/Resources/${xib}.nib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${xib}.xib
|
||||
COMMENT "Compiling ${CMAKE_CURRENT_SOURCE_DIR}/${xib}.xib")
|
||||
|
||||
endforeach()
|
||||
|
||||
add_custom_command(
|
||||
TARGET yabause-cocoa POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Yabause.icns ${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/Resources)
|
||||
|
||||
add_custom_command(
|
||||
TARGET yabause-cocoa POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/controller.png ${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/Contents/Resources)
|
||||
|
||||
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Yabause.app/" DESTINATION "Yabause.app" USE_SOURCE_PERMISSIONS)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../AUTHORS DESTINATION ".")
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../ChangeLog DESTINATION ".")
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../COPYING DESTINATION ".")
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../README DESTINATION ".")
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../README.MAC DESTINATION ".")
|
|
@ -1 +0,0 @@
|
|||
/* Localized versions of Info.plist keys */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,32 +0,0 @@
|
|||
/* Copyright 2010, 2011 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef PerCocoa_h
|
||||
#define PerCocoa_h
|
||||
|
||||
#include "peripheral.h"
|
||||
|
||||
#define PERCORE_COCOA 42
|
||||
extern PerInterface_struct PERCocoa;
|
||||
|
||||
/* Update a key mapping */
|
||||
void PERCocoaSetKey(u32 key, u8 name, int port);
|
||||
u32 PERCocoaGetKey(u8 n, int p);
|
||||
|
||||
#endif /* !PerCocoa_h */
|
|
@ -1,168 +0,0 @@
|
|||
/* Copyright 2010, 2011 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "PerCocoa.h"
|
||||
#include "yabause.h"
|
||||
|
||||
#include <AppKit/NSEvent.h>
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
/* Forward Declarations. */
|
||||
static int PERCocoaInit(void);
|
||||
static void PERCocoaDeInit(void);
|
||||
static int PERCocoaHandleEvents(void);
|
||||
static void PERCocoaNothing(void);
|
||||
|
||||
static u32 PERCocoaScan(void);
|
||||
static void PERCocoaFlush(void);
|
||||
|
||||
static PerPad_struct *c1 = NULL, *c2 = NULL;
|
||||
|
||||
PerInterface_struct PERCocoa = {
|
||||
PERCORE_COCOA,
|
||||
"Cocoa Keyboard Input Interface",
|
||||
&PERCocoaInit,
|
||||
&PERCocoaDeInit,
|
||||
&PERCocoaHandleEvents,
|
||||
&PERCocoaNothing,
|
||||
&PERCocoaScan,
|
||||
0,
|
||||
&PERCocoaFlush
|
||||
};
|
||||
|
||||
/* Utility function to check if everything's set up right for a port */
|
||||
static BOOL AllSetForPort(int p) {
|
||||
int i;
|
||||
NSString *str;
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
id val;
|
||||
Class c = [NSNumber class];
|
||||
|
||||
for(i = 0; i < 13; ++i) {
|
||||
str = [NSString stringWithFormat:@"Keyboard %d %s", p, PerPadNames[i]];
|
||||
val = [d objectForKey:str];
|
||||
|
||||
if(!val || ![val isKindOfClass:c]) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
void PERCocoaSetKey(u32 key, u8 n, int p) {
|
||||
PerPad_struct *c;
|
||||
NSString *str;
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
NSNumber *val = [NSNumber numberWithUnsignedInt:(unsigned int)key];
|
||||
|
||||
assert(n <= PERPAD_Z);
|
||||
|
||||
/* Build the string we'll look for, and set the value for that key */
|
||||
str = [NSString stringWithFormat:@"Pad %d %s", p, PerPadNames[n]];
|
||||
[d setObject:val forKey:str];
|
||||
[d synchronize];
|
||||
|
||||
/* Update the mapping if we're running */
|
||||
if(p == 0) {
|
||||
c = c1;
|
||||
}
|
||||
else {
|
||||
c = c2;
|
||||
}
|
||||
|
||||
/* This will effectively make sure we don't update until we've started. */
|
||||
if(c) {
|
||||
PerSetKey(key, n, c);
|
||||
}
|
||||
}
|
||||
|
||||
u32 PERCocoaGetKey(u8 n, int p) {
|
||||
NSString *str;
|
||||
id result;
|
||||
NSUserDefaults *d = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
assert(n <= PERPAD_Z);
|
||||
|
||||
/* Fetch the key data */
|
||||
str = [NSString stringWithFormat:@"Pad %d %s", p, PerPadNames[n]];
|
||||
result = [d objectForKey:str];
|
||||
|
||||
if(result && [result isKindOfClass:[NSNumber class]]) {
|
||||
return (u32)[result unsignedIntValue];
|
||||
}
|
||||
else {
|
||||
return (u32)-1;
|
||||
}
|
||||
}
|
||||
static int PERCocoaInit(void) {
|
||||
/* Fill in pad 1 */
|
||||
c1 = PerPadAdd(&PORTDATA1);
|
||||
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_UP, 0), PERPAD_UP, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_DOWN, 0), PERPAD_DOWN, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_LEFT, 0), PERPAD_LEFT, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_RIGHT, 0), PERPAD_RIGHT, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_LEFT_TRIGGER, 0), PERPAD_LEFT_TRIGGER, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_RIGHT_TRIGGER, 0), PERPAD_RIGHT_TRIGGER, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_START, 0), PERPAD_START, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_A, 0), PERPAD_A, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_B, 0), PERPAD_B, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_C, 0), PERPAD_C, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_X, 0), PERPAD_X, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_Y, 0), PERPAD_Y, c1);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_Z, 0), PERPAD_Z, c1);
|
||||
|
||||
/* Fill in pad 2 */
|
||||
c2 = PerPadAdd(&PORTDATA2);
|
||||
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_UP, 1), PERPAD_UP, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_DOWN, 1), PERPAD_DOWN, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_LEFT, 1), PERPAD_LEFT, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_RIGHT, 1), PERPAD_RIGHT, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_LEFT_TRIGGER, 1), PERPAD_LEFT_TRIGGER, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_RIGHT_TRIGGER, 1), PERPAD_RIGHT_TRIGGER, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_START, 1), PERPAD_START, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_A, 1), PERPAD_A, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_B, 1), PERPAD_B, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_C, 1), PERPAD_C, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_X, 1), PERPAD_X, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_Y, 1), PERPAD_Y, c2);
|
||||
PerSetKey(PERCocoaGetKey(PERPAD_Z, 1), PERPAD_Z, c2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void PERCocoaDeInit(void) {
|
||||
}
|
||||
|
||||
static int PERCocoaHandleEvents(void) {
|
||||
return YabauseExec();
|
||||
}
|
||||
|
||||
static void PERCocoaNothing(void) {
|
||||
}
|
||||
|
||||
static u32 PERCocoaScan(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void PERCocoaFlush(void) {
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>Yabause.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.yabause.yabause.cocoa</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.9.12</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string></string>
|
||||
<key>NSMainNibFile</key>
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © Yabause Team</string>
|
||||
</dict>
|
||||
</plist>
|
Binary file not shown.
|
@ -1,808 +0,0 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 42;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2A1145191385E5010087C872 /* YabauseButtonFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A1145181385E5010087C872 /* YabauseButtonFormatter.m */; };
|
||||
2A3392711162E100000DA0E9 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A3392701162E100000DA0E9 /* GLUT.framework */; };
|
||||
2A474DF01163A013006993EA /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A474DEF1163A013006993EA /* AudioUnit.framework */; };
|
||||
2A474DF21163A013006993EA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A474DF11163A013006993EA /* CoreAudio.framework */; };
|
||||
2A7AB7CC117D1C1B00E47298 /* vidsoft.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7AB7CB117D1C1B00E47298 /* vidsoft.c */; };
|
||||
2A7D39D3115BA16100DE3BD1 /* bios.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3987115BA16100DE3BD1 /* bios.c */; };
|
||||
2A7D39D4115BA16100DE3BD1 /* cd-macosx.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3989115BA16100DE3BD1 /* cd-macosx.c */; };
|
||||
2A7D39D5115BA16100DE3BD1 /* cdbase.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D398A115BA16100DE3BD1 /* cdbase.c */; };
|
||||
2A7D39D6115BA16100DE3BD1 /* cheat.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D398C115BA16100DE3BD1 /* cheat.c */; };
|
||||
2A7D39D7115BA16100DE3BD1 /* coffelf.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D398E115BA16100DE3BD1 /* coffelf.c */; };
|
||||
2A7D39D8115BA16100DE3BD1 /* cs0.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3991115BA16100DE3BD1 /* cs0.c */; };
|
||||
2A7D39D9115BA16100DE3BD1 /* cs1.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3993115BA16100DE3BD1 /* cs1.c */; };
|
||||
2A7D39DA115BA16100DE3BD1 /* cs2.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3995115BA16100DE3BD1 /* cs2.c */; };
|
||||
2A7D39DB115BA16100DE3BD1 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3997115BA16100DE3BD1 /* debug.c */; };
|
||||
2A7D39DC115BA16100DE3BD1 /* error.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3999115BA16100DE3BD1 /* error.c */; };
|
||||
2A7D39DD115BA16100DE3BD1 /* m68kc68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D399B115BA16100DE3BD1 /* m68kc68k.c */; };
|
||||
2A7D39DE115BA16100DE3BD1 /* m68kcore.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D399D115BA16100DE3BD1 /* m68kcore.c */; };
|
||||
2A7D39DF115BA16100DE3BD1 /* m68kd.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D399F115BA16100DE3BD1 /* m68kd.c */; };
|
||||
2A7D39E1115BA16100DE3BD1 /* macjoy.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39A2115BA16100DE3BD1 /* macjoy.c */; };
|
||||
2A7D39E2115BA16100DE3BD1 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39A4115BA16100DE3BD1 /* memory.c */; };
|
||||
2A7D39E3115BA16100DE3BD1 /* movie.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39A6115BA16100DE3BD1 /* movie.c */; };
|
||||
2A7D39E4115BA16100DE3BD1 /* netlink.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39A8115BA16100DE3BD1 /* netlink.c */; };
|
||||
2A7D39E5115BA16100DE3BD1 /* peripheral.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39AA115BA16100DE3BD1 /* peripheral.c */; };
|
||||
2A7D39E6115BA16100DE3BD1 /* permacjoy.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39AC115BA16100DE3BD1 /* permacjoy.c */; };
|
||||
2A7D39E7115BA16100DE3BD1 /* profile.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39AE115BA16100DE3BD1 /* profile.c */; };
|
||||
2A7D39E9115BA16100DE3BD1 /* scu.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39B2115BA16100DE3BD1 /* scu.c */; };
|
||||
2A7D39EA115BA16100DE3BD1 /* sh2core.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39B4115BA16100DE3BD1 /* sh2core.c */; };
|
||||
2A7D39EB115BA16100DE3BD1 /* sh2d.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39B6115BA16100DE3BD1 /* sh2d.c */; };
|
||||
2A7D39EC115BA16100DE3BD1 /* sh2idle.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39B8115BA16100DE3BD1 /* sh2idle.c */; };
|
||||
2A7D39ED115BA16100DE3BD1 /* sh2int.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39BA115BA16100DE3BD1 /* sh2int.c */; };
|
||||
2A7D39EE115BA16100DE3BD1 /* sh2trace.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39BC115BA16100DE3BD1 /* sh2trace.c */; };
|
||||
2A7D39EF115BA16100DE3BD1 /* smpc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39BE115BA16100DE3BD1 /* smpc.c */; };
|
||||
2A7D39F1115BA16100DE3BD1 /* vdp1.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39C2115BA16100DE3BD1 /* vdp1.c */; };
|
||||
2A7D39F2115BA16100DE3BD1 /* vdp2.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39C4115BA16100DE3BD1 /* vdp2.c */; };
|
||||
2A7D39F3115BA16100DE3BD1 /* vdp2debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39C6115BA16100DE3BD1 /* vdp2debug.c */; };
|
||||
2A7D39F4115BA16100DE3BD1 /* vidogl.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39C8115BA16100DE3BD1 /* vidogl.c */; };
|
||||
2A7D39F5115BA16100DE3BD1 /* vidshared.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39CA115BA16100DE3BD1 /* vidshared.c */; };
|
||||
2A7D39F6115BA16100DE3BD1 /* vidgcd.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39CC115BA16100DE3BD1 /* vidgcd.c */; };
|
||||
2A7D39F7115BA16100DE3BD1 /* yabause.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39CE115BA16100DE3BD1 /* yabause.c */; };
|
||||
2A7D39F8115BA16100DE3BD1 /* ygl.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D39D0115BA16100DE3BD1 /* ygl.c */; };
|
||||
2A7D3A1E115BA29F00DE3BD1 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A7D3A1D115BA29F00DE3BD1 /* OpenGL.framework */; };
|
||||
2A7D3A31115BA35200DE3BD1 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A7D3A30115BA35200DE3BD1 /* CoreFoundation.framework */; };
|
||||
2A7D3A33115BA35200DE3BD1 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A7D3A32115BA35200DE3BD1 /* IOKit.framework */; };
|
||||
2A7D3A48115BA3AF00DE3BD1 /* c68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3A41115BA3AF00DE3BD1 /* c68k.c */; };
|
||||
2A7D3A49115BA3AF00DE3BD1 /* c68kexec.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3A43115BA3AF00DE3BD1 /* c68kexec.c */; settings = {COMPILER_FLAGS = "-O0"; }; };
|
||||
2A7D3A4B115BA3AF00DE3BD1 /* gen68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3A45115BA3AF00DE3BD1 /* gen68k.c */; };
|
||||
2A7D3A5A115BA41200DE3BD1 /* gen68k.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A7D3A45115BA3AF00DE3BD1 /* gen68k.c */; };
|
||||
2A7D3A9B115BAB9E00DE3BD1 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2A7D3A99115BAB9E00DE3BD1 /* MainMenu.xib */; };
|
||||
2A7D3AD5115BB01500DE3BD1 /* Yabause.icns in Resources */ = {isa = PBXBuildFile; fileRef = 2A7D3AD4115BB01500DE3BD1 /* Yabause.icns */; };
|
||||
2A82CCA1116171DB00F15B02 /* PerCocoa.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A82CCA0116171DB00F15B02 /* PerCocoa.m */; };
|
||||
2A9D7600116645D700A580EB /* sndmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 2A9D75FE116645D700A580EB /* sndmac.c */; };
|
||||
2A9D760E11665F2800A580EB /* controller.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A9D760D11665F2800A580EB /* controller.png */; };
|
||||
2A9D7621116667C300A580EB /* YabausePrefsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A9D761F116667C300A580EB /* YabausePrefsController.m */; };
|
||||
2AD10F9E118BBC850088FB2C /* scsp2.c in Sources */ = {isa = PBXBuildFile; fileRef = 2AD10F97118BBC850088FB2C /* scsp2.c */; };
|
||||
2AD10F9F118BBC850088FB2C /* snddummy.c in Sources */ = {isa = PBXBuildFile; fileRef = 2AD10F99118BBC850088FB2C /* snddummy.c */; };
|
||||
2AD10FA0118BBC850088FB2C /* sndwav.c in Sources */ = {isa = PBXBuildFile; fileRef = 2AD10F9A118BBC850088FB2C /* sndwav.c */; };
|
||||
2AD10FDB118BCFA00088FB2C /* thr-dummy.c in Sources */ = {isa = PBXBuildFile; fileRef = 2AD10F9B118BBC850088FB2C /* thr-dummy.c */; };
|
||||
2AF0CA51116146A400196BED /* YabauseGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AF0CA4F116146A400196BED /* YabauseGLView.m */; };
|
||||
2AF0CA9911614DD500196BED /* YabauseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AF0CA9811614DD500196BED /* YabauseController.m */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
|
||||
F07BF9E414A1C2C500775818 /* yglshader.c in Sources */ = {isa = PBXBuildFile; fileRef = F07BF9E314A1C2C500775818 /* yglshader.c */; };
|
||||
F07E62CB15054DCC00DF8A4E /* titan.c in Sources */ = {isa = PBXBuildFile; fileRef = F07E62CA15054DCC00DF8A4E /* titan.c */; };
|
||||
F0E47FAD156C34EC001A1B51 /* osdcore.c in Sources */ = {isa = PBXBuildFile; fileRef = F0E47FAC156C34EC001A1B51 /* osdcore.c */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
2A7D3A7A115BA63900DE3BD1 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 2A7D3A54115BA3E700DE3BD1;
|
||||
remoteInfo = gen68k;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
|
||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
2A1145171385E5010087C872 /* YabauseButtonFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YabauseButtonFormatter.h; sourceTree = "<group>"; };
|
||||
2A1145181385E5010087C872 /* YabauseButtonFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YabauseButtonFormatter.m; sourceTree = "<group>"; };
|
||||
2A3392701162E100000DA0E9 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = System/Library/Frameworks/GLUT.framework; sourceTree = SDKROOT; };
|
||||
2A474DEF1163A013006993EA /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
|
||||
2A474DF11163A013006993EA /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
|
||||
2A7AB7CB117D1C1B00E47298 /* vidsoft.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vidsoft.c; path = ../vidsoft.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7AB7CE117D1CBE00E47298 /* vidsoft.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vidsoft.h; path = ../vidsoft.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3987115BA16100DE3BD1 /* bios.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bios.c; path = ../bios.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3988115BA16100DE3BD1 /* bios.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bios.h; path = ../bios.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3989115BA16100DE3BD1 /* cd-macosx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "cd-macosx.c"; path = "../cd-macosx.c"; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398A115BA16100DE3BD1 /* cdbase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cdbase.c; path = ../cdbase.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398B115BA16100DE3BD1 /* cdbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cdbase.h; path = ../cdbase.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398C115BA16100DE3BD1 /* cheat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cheat.c; path = ../cheat.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398D115BA16100DE3BD1 /* cheat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cheat.h; path = ../cheat.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398E115BA16100DE3BD1 /* coffelf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = coffelf.c; path = ../coffelf.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D398F115BA16100DE3BD1 /* coffelf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = coffelf.h; path = ../coffelf.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3990115BA16100DE3BD1 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = ../core.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3991115BA16100DE3BD1 /* cs0.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cs0.c; path = ../cs0.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3992115BA16100DE3BD1 /* cs0.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cs0.h; path = ../cs0.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3993115BA16100DE3BD1 /* cs1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cs1.c; path = ../cs1.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3994115BA16100DE3BD1 /* cs1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cs1.h; path = ../cs1.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3995115BA16100DE3BD1 /* cs2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cs2.c; path = ../cs2.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3996115BA16100DE3BD1 /* cs2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cs2.h; path = ../cs2.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3997115BA16100DE3BD1 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = debug.c; path = ../debug.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3998115BA16100DE3BD1 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = debug.h; path = ../debug.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3999115BA16100DE3BD1 /* error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = error.c; path = ../error.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399A115BA16100DE3BD1 /* error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = error.h; path = ../error.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399B115BA16100DE3BD1 /* m68kc68k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m68kc68k.c; path = ../m68kc68k.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399C115BA16100DE3BD1 /* m68kc68k.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m68kc68k.h; path = ../m68kc68k.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399D115BA16100DE3BD1 /* m68kcore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m68kcore.c; path = ../m68kcore.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399E115BA16100DE3BD1 /* m68kcore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m68kcore.h; path = ../m68kcore.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D399F115BA16100DE3BD1 /* m68kd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m68kd.c; path = ../m68kd.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A0115BA16100DE3BD1 /* m68kd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = m68kd.h; path = ../m68kd.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A1115BA16100DE3BD1 /* m68kq68.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = m68kq68.c; path = ../m68kq68.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A2115BA16100DE3BD1 /* macjoy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = macjoy.c; path = ../macjoy.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A3115BA16100DE3BD1 /* macjoy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macjoy.h; path = ../macjoy.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A4115BA16100DE3BD1 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ../memory.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A5115BA16100DE3BD1 /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = memory.h; path = ../memory.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A6115BA16100DE3BD1 /* movie.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = movie.c; path = ../movie.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A7115BA16100DE3BD1 /* movie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = movie.h; path = ../movie.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A8115BA16100DE3BD1 /* netlink.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = netlink.c; path = ../netlink.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39A9115BA16100DE3BD1 /* netlink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = netlink.h; path = ../netlink.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AA115BA16100DE3BD1 /* peripheral.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = peripheral.c; path = ../peripheral.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AB115BA16100DE3BD1 /* peripheral.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = peripheral.h; path = ../peripheral.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AC115BA16100DE3BD1 /* permacjoy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = permacjoy.c; path = ../permacjoy.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AD115BA16100DE3BD1 /* permacjoy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = permacjoy.h; path = ../permacjoy.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AE115BA16100DE3BD1 /* profile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = profile.c; path = ../profile.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39AF115BA16100DE3BD1 /* profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = profile.h; path = ../profile.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B0115BA16100DE3BD1 /* scsp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = scsp.c; path = ../scsp.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B1115BA16100DE3BD1 /* scsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scsp.h; path = ../scsp.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B2115BA16100DE3BD1 /* scu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = scu.c; path = ../scu.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B3115BA16100DE3BD1 /* scu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scu.h; path = ../scu.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B4115BA16100DE3BD1 /* sh2core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sh2core.c; path = ../sh2core.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B5115BA16100DE3BD1 /* sh2core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sh2core.h; path = ../sh2core.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B6115BA16100DE3BD1 /* sh2d.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sh2d.c; path = ../sh2d.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B7115BA16100DE3BD1 /* sh2d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sh2d.h; path = ../sh2d.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B8115BA16100DE3BD1 /* sh2idle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sh2idle.c; path = ../sh2idle.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39B9115BA16100DE3BD1 /* sh2idle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sh2idle.h; path = ../sh2idle.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BA115BA16100DE3BD1 /* sh2int.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sh2int.c; path = ../sh2int.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BB115BA16100DE3BD1 /* sh2int.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sh2int.h; path = ../sh2int.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BC115BA16100DE3BD1 /* sh2trace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sh2trace.c; path = ../sh2trace.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BD115BA16100DE3BD1 /* sh2trace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sh2trace.h; path = ../sh2trace.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BE115BA16100DE3BD1 /* smpc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = smpc.c; path = ../smpc.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39BF115BA16100DE3BD1 /* smpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = smpc.h; path = ../smpc.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C2115BA16100DE3BD1 /* vdp1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vdp1.c; path = ../vdp1.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C3115BA16100DE3BD1 /* vdp1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vdp1.h; path = ../vdp1.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C4115BA16100DE3BD1 /* vdp2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vdp2.c; path = ../vdp2.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C5115BA16100DE3BD1 /* vdp2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vdp2.h; path = ../vdp2.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C6115BA16100DE3BD1 /* vdp2debug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vdp2debug.c; path = ../vdp2debug.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C7115BA16100DE3BD1 /* vdp2debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vdp2debug.h; path = ../vdp2debug.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C8115BA16100DE3BD1 /* vidogl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vidogl.c; path = ../vidogl.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39C9115BA16100DE3BD1 /* vidogl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vidogl.h; path = ../vidogl.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39CA115BA16100DE3BD1 /* vidshared.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vidshared.c; path = ../vidshared.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39CB115BA16100DE3BD1 /* vidshared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vidshared.h; path = ../vidshared.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39CC115BA16100DE3BD1 /* vidgcd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vidgcd.c; sourceTree = "<group>"; };
|
||||
2A7D39CD115BA16100DE3BD1 /* vidgcd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vidgcd.h; sourceTree = "<group>"; };
|
||||
2A7D39CE115BA16100DE3BD1 /* yabause.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yabause.c; path = ../yabause.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39CF115BA16100DE3BD1 /* yabause.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = yabause.h; path = ../yabause.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39D0115BA16100DE3BD1 /* ygl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ygl.c; path = ../ygl.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39D1115BA16100DE3BD1 /* ygl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ygl.h; path = ../ygl.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D39D2115BA16100DE3BD1 /* yui.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = yui.h; path = ../yui.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A1D115BA29F00DE3BD1 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
|
||||
2A7D3A30115BA35200DE3BD1 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
|
||||
2A7D3A32115BA35200DE3BD1 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
|
||||
2A7D3A41115BA3AF00DE3BD1 /* c68k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = c68k.c; path = ../c68k/c68k.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A42115BA3AF00DE3BD1 /* c68k.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = c68k.h; path = ../c68k/c68k.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A43115BA3AF00DE3BD1 /* c68kexec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = c68kexec.c; path = ../c68k/c68kexec.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A44115BA3AF00DE3BD1 /* c68kmac.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = c68kmac.inc; path = ../c68k/c68kmac.inc; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A45115BA3AF00DE3BD1 /* gen68k.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = gen68k.c; path = ../c68k/gen68k.c; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A46115BA3AF00DE3BD1 /* gen68k.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = gen68k.h; path = ../c68k/gen68k.h; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A47115BA3AF00DE3BD1 /* gen68k.inc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.pascal; name = gen68k.inc; path = ../c68k/gen68k.inc; sourceTree = SOURCE_ROOT; };
|
||||
2A7D3A55115BA3E700DE3BD1 /* gen68k */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = gen68k; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2A7D3A9A115BAB9E00DE3BD1 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; };
|
||||
2A7D3AD4115BB01500DE3BD1 /* Yabause.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Yabause.icns; sourceTree = "<group>"; };
|
||||
2A82CC9F116171DB00F15B02 /* PerCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerCocoa.h; sourceTree = "<group>"; };
|
||||
2A82CCA0116171DB00F15B02 /* PerCocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PerCocoa.m; sourceTree = "<group>"; };
|
||||
2A9D75FE116645D700A580EB /* sndmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sndmac.c; path = ../sndmac.c; sourceTree = SOURCE_ROOT; };
|
||||
2A9D75FF116645D700A580EB /* sndmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sndmac.h; path = ../sndmac.h; sourceTree = SOURCE_ROOT; };
|
||||
2A9D760D11665F2800A580EB /* controller.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = controller.png; path = resources/controller.png; sourceTree = "<group>"; };
|
||||
2A9D761F116667C300A580EB /* YabausePrefsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YabausePrefsController.m; sourceTree = "<group>"; };
|
||||
2A9D7620116667C300A580EB /* YabausePrefsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YabausePrefsController.h; sourceTree = "<group>"; };
|
||||
2AD10F97118BBC850088FB2C /* scsp2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = scsp2.c; path = ../scsp2.c; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F98118BBC850088FB2C /* scsp2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scsp2.h; path = ../scsp2.h; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F99118BBC850088FB2C /* snddummy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = snddummy.c; path = ../snddummy.c; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F9A118BBC850088FB2C /* sndwav.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sndwav.c; path = ../sndwav.c; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F9B118BBC850088FB2C /* thr-dummy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "thr-dummy.c"; path = "../thr-dummy.c"; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F9C118BBC850088FB2C /* thr-macosx.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "thr-macosx.c"; path = "../thr-macosx.c"; sourceTree = SOURCE_ROOT; };
|
||||
2AD10F9D118BBC850088FB2C /* threads.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = threads.h; path = ../threads.h; sourceTree = SOURCE_ROOT; };
|
||||
2AF0CA4F116146A400196BED /* YabauseGLView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YabauseGLView.m; sourceTree = "<group>"; };
|
||||
2AF0CA50116146A400196BED /* YabauseGLView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YabauseGLView.h; sourceTree = "<group>"; };
|
||||
2AF0CA9711614DD500196BED /* YabauseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YabauseController.h; sourceTree = "<group>"; };
|
||||
2AF0CA9811614DD500196BED /* YabauseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YabauseController.m; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Yabause-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Yabause-Info.plist"; sourceTree = "<group>"; };
|
||||
8D1107320486CEB800E47090 /* Yabause.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Yabause.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F07BF9E314A1C2C500775818 /* yglshader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = yglshader.c; path = ../yglshader.c; sourceTree = SOURCE_ROOT; };
|
||||
F07E62CA15054DCC00DF8A4E /* titan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = titan.c; path = ../titan/titan.c; sourceTree = SOURCE_ROOT; };
|
||||
F07E62CC15054DF500DF8A4E /* titan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = titan.h; path = ../titan/titan.h; sourceTree = SOURCE_ROOT; };
|
||||
F0E47FAC156C34EC001A1B51 /* osdcore.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = osdcore.c; path = ../osdcore.c; sourceTree = SOURCE_ROOT; };
|
||||
F0E47FAE156C34FB001A1B51 /* osdcore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = osdcore.h; path = ../osdcore.h; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2A7D3A53115BA3E700DE3BD1 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8D11072E0486CEB800E47090 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
|
||||
2A7D3A1E115BA29F00DE3BD1 /* OpenGL.framework in Frameworks */,
|
||||
2A7D3A31115BA35200DE3BD1 /* CoreFoundation.framework in Frameworks */,
|
||||
2A7D3A33115BA35200DE3BD1 /* IOKit.framework in Frameworks */,
|
||||
2A3392711162E100000DA0E9 /* GLUT.framework in Frameworks */,
|
||||
2A474DF01163A013006993EA /* AudioUnit.framework in Frameworks */,
|
||||
2A474DF21163A013006993EA /* CoreAudio.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
080E96DDFE201D6D7F000001 /* Classes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A1145171385E5010087C872 /* YabauseButtonFormatter.h */,
|
||||
2A1145181385E5010087C872 /* YabauseButtonFormatter.m */,
|
||||
2AF0CA9711614DD500196BED /* YabauseController.h */,
|
||||
2AF0CA9811614DD500196BED /* YabauseController.m */,
|
||||
2AF0CA50116146A400196BED /* YabauseGLView.h */,
|
||||
2AF0CA4F116146A400196BED /* YabauseGLView.m */,
|
||||
2A9D7620116667C300A580EB /* YabausePrefsController.h */,
|
||||
2A9D761F116667C300A580EB /* YabausePrefsController.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A3392701162E100000DA0E9 /* GLUT.framework */,
|
||||
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
|
||||
2A7D3A1D115BA29F00DE3BD1 /* OpenGL.framework */,
|
||||
2A7D3A30115BA35200DE3BD1 /* CoreFoundation.framework */,
|
||||
2A7D3A32115BA35200DE3BD1 /* IOKit.framework */,
|
||||
2A474DEF1163A013006993EA /* AudioUnit.framework */,
|
||||
2A474DF11163A013006993EA /* CoreAudio.framework */,
|
||||
);
|
||||
name = "Linked Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
|
||||
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
|
||||
);
|
||||
name = "Other Frameworks";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
19C28FACFE9D520D11CA2CBB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8D1107320486CEB800E47090 /* Yabause.app */,
|
||||
2A7D3A55115BA3E700DE3BD1 /* gen68k */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97314FDCFA39411CA2CEA /* Yabause */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A7D3972115BA0DD00DE3BD1 /* Emulation Core */,
|
||||
080E96DDFE201D6D7F000001 /* Classes */,
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */,
|
||||
29B97317FDCFA39411CA2CEA /* Resources */,
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */,
|
||||
19C28FACFE9D520D11CA2CBB /* Products */,
|
||||
);
|
||||
name = Yabause;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
29B97316FDCFA39411CA2CEA /* main.m */,
|
||||
2A82CC9F116171DB00F15B02 /* PerCocoa.h */,
|
||||
2A82CCA0116171DB00F15B02 /* PerCocoa.m */,
|
||||
2A7D39CD115BA16100DE3BD1 /* vidgcd.h */,
|
||||
2A7D39CC115BA16100DE3BD1 /* vidgcd.c */,
|
||||
);
|
||||
name = "Other Sources";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A9D760D11665F2800A580EB /* controller.png */,
|
||||
2A7D3AD4115BB01500DE3BD1 /* Yabause.icns */,
|
||||
8D1107310486CEB800E47090 /* Yabause-Info.plist */,
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
|
||||
2A7D3A99115BAB9E00DE3BD1 /* MainMenu.xib */,
|
||||
);
|
||||
name = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
|
||||
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2A7D3972115BA0DD00DE3BD1 /* Emulation Core */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F0E47FAE156C34FB001A1B51 /* osdcore.h */,
|
||||
F0E47FAC156C34EC001A1B51 /* osdcore.c */,
|
||||
F07E62CC15054DF500DF8A4E /* titan.h */,
|
||||
F07E62CA15054DCC00DF8A4E /* titan.c */,
|
||||
F07BF9E314A1C2C500775818 /* yglshader.c */,
|
||||
2A7D3A3E115BA38900DE3BD1 /* C68K */,
|
||||
2A7D3987115BA16100DE3BD1 /* bios.c */,
|
||||
2A7D3988115BA16100DE3BD1 /* bios.h */,
|
||||
2A7D3989115BA16100DE3BD1 /* cd-macosx.c */,
|
||||
2A7D398A115BA16100DE3BD1 /* cdbase.c */,
|
||||
2A7D398B115BA16100DE3BD1 /* cdbase.h */,
|
||||
2A7D398C115BA16100DE3BD1 /* cheat.c */,
|
||||
2A7D398D115BA16100DE3BD1 /* cheat.h */,
|
||||
2A7D398E115BA16100DE3BD1 /* coffelf.c */,
|
||||
2A7D398F115BA16100DE3BD1 /* coffelf.h */,
|
||||
2A7D3990115BA16100DE3BD1 /* core.h */,
|
||||
2A7D3991115BA16100DE3BD1 /* cs0.c */,
|
||||
2A7D3992115BA16100DE3BD1 /* cs0.h */,
|
||||
2A7D3993115BA16100DE3BD1 /* cs1.c */,
|
||||
2A7D3994115BA16100DE3BD1 /* cs1.h */,
|
||||
2A7D3995115BA16100DE3BD1 /* cs2.c */,
|
||||
2A7D3996115BA16100DE3BD1 /* cs2.h */,
|
||||
2A7D3997115BA16100DE3BD1 /* debug.c */,
|
||||
2A7D3998115BA16100DE3BD1 /* debug.h */,
|
||||
2A7D3999115BA16100DE3BD1 /* error.c */,
|
||||
2A7D399A115BA16100DE3BD1 /* error.h */,
|
||||
2A7D399B115BA16100DE3BD1 /* m68kc68k.c */,
|
||||
2A7D399C115BA16100DE3BD1 /* m68kc68k.h */,
|
||||
2A7D399D115BA16100DE3BD1 /* m68kcore.c */,
|
||||
2A7D399E115BA16100DE3BD1 /* m68kcore.h */,
|
||||
2A7D399F115BA16100DE3BD1 /* m68kd.c */,
|
||||
2A7D39A0115BA16100DE3BD1 /* m68kd.h */,
|
||||
2A7D39A1115BA16100DE3BD1 /* m68kq68.c */,
|
||||
2A7D39A2115BA16100DE3BD1 /* macjoy.c */,
|
||||
2A7D39A3115BA16100DE3BD1 /* macjoy.h */,
|
||||
2A7D39A4115BA16100DE3BD1 /* memory.c */,
|
||||
2A7D39A5115BA16100DE3BD1 /* memory.h */,
|
||||
2A7D39A6115BA16100DE3BD1 /* movie.c */,
|
||||
2A7D39A7115BA16100DE3BD1 /* movie.h */,
|
||||
2A7D39A8115BA16100DE3BD1 /* netlink.c */,
|
||||
2A7D39A9115BA16100DE3BD1 /* netlink.h */,
|
||||
2A7D39AA115BA16100DE3BD1 /* peripheral.c */,
|
||||
2A7D39AB115BA16100DE3BD1 /* peripheral.h */,
|
||||
2A7D39AC115BA16100DE3BD1 /* permacjoy.c */,
|
||||
2A7D39AD115BA16100DE3BD1 /* permacjoy.h */,
|
||||
2A7D39AE115BA16100DE3BD1 /* profile.c */,
|
||||
2A7D39AF115BA16100DE3BD1 /* profile.h */,
|
||||
2A7D39B0115BA16100DE3BD1 /* scsp.c */,
|
||||
2A7D39B1115BA16100DE3BD1 /* scsp.h */,
|
||||
2AD10F97118BBC850088FB2C /* scsp2.c */,
|
||||
2AD10F98118BBC850088FB2C /* scsp2.h */,
|
||||
2A7D39B2115BA16100DE3BD1 /* scu.c */,
|
||||
2A7D39B3115BA16100DE3BD1 /* scu.h */,
|
||||
2A7D39B4115BA16100DE3BD1 /* sh2core.c */,
|
||||
2A7D39B5115BA16100DE3BD1 /* sh2core.h */,
|
||||
2A7D39B6115BA16100DE3BD1 /* sh2d.c */,
|
||||
2A7D39B7115BA16100DE3BD1 /* sh2d.h */,
|
||||
2A7D39B8115BA16100DE3BD1 /* sh2idle.c */,
|
||||
2A7D39B9115BA16100DE3BD1 /* sh2idle.h */,
|
||||
2A7D39BA115BA16100DE3BD1 /* sh2int.c */,
|
||||
2A7D39BB115BA16100DE3BD1 /* sh2int.h */,
|
||||
2A7D39BC115BA16100DE3BD1 /* sh2trace.c */,
|
||||
2A7D39BD115BA16100DE3BD1 /* sh2trace.h */,
|
||||
2A7D39BE115BA16100DE3BD1 /* smpc.c */,
|
||||
2A7D39BF115BA16100DE3BD1 /* smpc.h */,
|
||||
2AD10F99118BBC850088FB2C /* snddummy.c */,
|
||||
2A9D75FE116645D700A580EB /* sndmac.c */,
|
||||
2A9D75FF116645D700A580EB /* sndmac.h */,
|
||||
2AD10F9A118BBC850088FB2C /* sndwav.c */,
|
||||
2AD10F9B118BBC850088FB2C /* thr-dummy.c */,
|
||||
2AD10F9C118BBC850088FB2C /* thr-macosx.c */,
|
||||
2AD10F9D118BBC850088FB2C /* threads.h */,
|
||||
2A7D39C2115BA16100DE3BD1 /* vdp1.c */,
|
||||
2A7D39C3115BA16100DE3BD1 /* vdp1.h */,
|
||||
2A7D39C4115BA16100DE3BD1 /* vdp2.c */,
|
||||
2A7D39C5115BA16100DE3BD1 /* vdp2.h */,
|
||||
2A7D39C6115BA16100DE3BD1 /* vdp2debug.c */,
|
||||
2A7D39C7115BA16100DE3BD1 /* vdp2debug.h */,
|
||||
2A7D39C8115BA16100DE3BD1 /* vidogl.c */,
|
||||
2A7D39C9115BA16100DE3BD1 /* vidogl.h */,
|
||||
2A7D39CA115BA16100DE3BD1 /* vidshared.c */,
|
||||
2A7D39CB115BA16100DE3BD1 /* vidshared.h */,
|
||||
2A7AB7CE117D1CBE00E47298 /* vidsoft.h */,
|
||||
2A7AB7CB117D1C1B00E47298 /* vidsoft.c */,
|
||||
2A7D39CE115BA16100DE3BD1 /* yabause.c */,
|
||||
2A7D39CF115BA16100DE3BD1 /* yabause.h */,
|
||||
2A7D39D0115BA16100DE3BD1 /* ygl.c */,
|
||||
2A7D39D1115BA16100DE3BD1 /* ygl.h */,
|
||||
2A7D39D2115BA16100DE3BD1 /* yui.h */,
|
||||
);
|
||||
name = "Emulation Core";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2A7D3A3E115BA38900DE3BD1 /* C68K */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2A7D3A41115BA3AF00DE3BD1 /* c68k.c */,
|
||||
2A7D3A42115BA3AF00DE3BD1 /* c68k.h */,
|
||||
2A7D3A43115BA3AF00DE3BD1 /* c68kexec.c */,
|
||||
2A7D3A44115BA3AF00DE3BD1 /* c68kmac.inc */,
|
||||
2A7D3A45115BA3AF00DE3BD1 /* gen68k.c */,
|
||||
2A7D3A46115BA3AF00DE3BD1 /* gen68k.h */,
|
||||
2A7D3A47115BA3AF00DE3BD1 /* gen68k.inc */,
|
||||
);
|
||||
name = C68K;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2A7D3A54115BA3E700DE3BD1 /* gen68k */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2A7D3A59115BA40C00DE3BD1 /* Build configuration list for PBXNativeTarget "gen68k" */;
|
||||
buildPhases = (
|
||||
2A7D3A52115BA3E700DE3BD1 /* Sources */,
|
||||
2A7D3A53115BA3E700DE3BD1 /* Frameworks */,
|
||||
2A7D3A6F115BA5A200DE3BD1 /* Run gen68k */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = gen68k;
|
||||
productName = gen68k;
|
||||
productReference = 2A7D3A55115BA3E700DE3BD1 /* gen68k */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
8D1107260486CEB800E47090 /* Yabause */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Yabause" */;
|
||||
buildPhases = (
|
||||
8D1107290486CEB800E47090 /* Resources */,
|
||||
8D11072C0486CEB800E47090 /* Sources */,
|
||||
8D11072E0486CEB800E47090 /* Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
2A7D3A7B115BA63900DE3BD1 /* PBXTargetDependency */,
|
||||
);
|
||||
name = Yabause;
|
||||
productInstallPath = "$(HOME)/Applications";
|
||||
productName = Yabause;
|
||||
productReference = 8D1107320486CEB800E47090 /* Yabause.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Yabause" */;
|
||||
compatibilityVersion = "Xcode 2.4";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 1;
|
||||
knownRegions = (
|
||||
English,
|
||||
Japanese,
|
||||
French,
|
||||
German,
|
||||
);
|
||||
mainGroup = 29B97314FDCFA39411CA2CEA /* Yabause */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
2A7D3A54115BA3E700DE3BD1 /* gen68k */,
|
||||
8D1107260486CEB800E47090 /* Yabause */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
8D1107290486CEB800E47090 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
|
||||
2A7D3A9B115BAB9E00DE3BD1 /* MainMenu.xib in Resources */,
|
||||
2A7D3AD5115BB01500DE3BD1 /* Yabause.icns in Resources */,
|
||||
2A9D760E11665F2800A580EB /* controller.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2A7D3A6F115BA5A200DE3BD1 /* Run gen68k */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"$(PROJECT_DIR)/../gen68k/gen68k.c",
|
||||
"$(PROJECT_DIR)/../gen68k/gen68k.h",
|
||||
"$(PROJECT_DIR)/../gen68k/gen68k.inc",
|
||||
"$(PROJECT_DIR)/../gen68k/c68kmac.inc",
|
||||
"$(PROJECT_DIR)/../gen68k/c68kexec.c",
|
||||
"$(PROJECT_DIR)/../gen68k/c68k.c",
|
||||
"$(PROJECT_DIR)/../gen68k/c68k.h",
|
||||
);
|
||||
name = "Run gen68k";
|
||||
outputPaths = (
|
||||
"$(PROJECT_DIR)/../gen68k/c68k_op0.inc",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "cd ../c68k\n\"$BUILD_DIR/$CONFIGURATION/gen68k\"";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2A7D3A52115BA3E700DE3BD1 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2A7D3A5A115BA41200DE3BD1 /* gen68k.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
8D11072C0486CEB800E47090 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */,
|
||||
2A7D39D3115BA16100DE3BD1 /* bios.c in Sources */,
|
||||
2A7D39D4115BA16100DE3BD1 /* cd-macosx.c in Sources */,
|
||||
2A7D39D5115BA16100DE3BD1 /* cdbase.c in Sources */,
|
||||
2A7D39D6115BA16100DE3BD1 /* cheat.c in Sources */,
|
||||
2A7D39D7115BA16100DE3BD1 /* coffelf.c in Sources */,
|
||||
2A7D39D8115BA16100DE3BD1 /* cs0.c in Sources */,
|
||||
2A7D39D9115BA16100DE3BD1 /* cs1.c in Sources */,
|
||||
2A7D39DA115BA16100DE3BD1 /* cs2.c in Sources */,
|
||||
2A7D39DB115BA16100DE3BD1 /* debug.c in Sources */,
|
||||
2A7D39DC115BA16100DE3BD1 /* error.c in Sources */,
|
||||
2A7D39DD115BA16100DE3BD1 /* m68kc68k.c in Sources */,
|
||||
2A7D39DE115BA16100DE3BD1 /* m68kcore.c in Sources */,
|
||||
2A7D39DF115BA16100DE3BD1 /* m68kd.c in Sources */,
|
||||
2A7D39E1115BA16100DE3BD1 /* macjoy.c in Sources */,
|
||||
2A7D39E2115BA16100DE3BD1 /* memory.c in Sources */,
|
||||
2A7D39E3115BA16100DE3BD1 /* movie.c in Sources */,
|
||||
2A7D39E4115BA16100DE3BD1 /* netlink.c in Sources */,
|
||||
2A7D39E5115BA16100DE3BD1 /* peripheral.c in Sources */,
|
||||
2A7D39E6115BA16100DE3BD1 /* permacjoy.c in Sources */,
|
||||
2A7D39E7115BA16100DE3BD1 /* profile.c in Sources */,
|
||||
2A7D39E9115BA16100DE3BD1 /* scu.c in Sources */,
|
||||
2A7D39EA115BA16100DE3BD1 /* sh2core.c in Sources */,
|
||||
2A7D39EB115BA16100DE3BD1 /* sh2d.c in Sources */,
|
||||
2A7D39EC115BA16100DE3BD1 /* sh2idle.c in Sources */,
|
||||
2A7D39ED115BA16100DE3BD1 /* sh2int.c in Sources */,
|
||||
2A7D39EE115BA16100DE3BD1 /* sh2trace.c in Sources */,
|
||||
2A7D39EF115BA16100DE3BD1 /* smpc.c in Sources */,
|
||||
2A7D39F1115BA16100DE3BD1 /* vdp1.c in Sources */,
|
||||
2A7D39F2115BA16100DE3BD1 /* vdp2.c in Sources */,
|
||||
2A7D39F3115BA16100DE3BD1 /* vdp2debug.c in Sources */,
|
||||
2A7D39F4115BA16100DE3BD1 /* vidogl.c in Sources */,
|
||||
2A7D39F5115BA16100DE3BD1 /* vidshared.c in Sources */,
|
||||
2A7D39F6115BA16100DE3BD1 /* vidgcd.c in Sources */,
|
||||
2A7D39F7115BA16100DE3BD1 /* yabause.c in Sources */,
|
||||
2A7D39F8115BA16100DE3BD1 /* ygl.c in Sources */,
|
||||
2A7D3A48115BA3AF00DE3BD1 /* c68k.c in Sources */,
|
||||
2A7D3A49115BA3AF00DE3BD1 /* c68kexec.c in Sources */,
|
||||
2A7D3A4B115BA3AF00DE3BD1 /* gen68k.c in Sources */,
|
||||
2AF0CA51116146A400196BED /* YabauseGLView.m in Sources */,
|
||||
2AF0CA9911614DD500196BED /* YabauseController.m in Sources */,
|
||||
2A82CCA1116171DB00F15B02 /* PerCocoa.m in Sources */,
|
||||
2A9D7600116645D700A580EB /* sndmac.c in Sources */,
|
||||
2A9D7621116667C300A580EB /* YabausePrefsController.m in Sources */,
|
||||
2A7AB7CC117D1C1B00E47298 /* vidsoft.c in Sources */,
|
||||
2AD10F9E118BBC850088FB2C /* scsp2.c in Sources */,
|
||||
2AD10F9F118BBC850088FB2C /* snddummy.c in Sources */,
|
||||
2AD10FA0118BBC850088FB2C /* sndwav.c in Sources */,
|
||||
2AD10FDB118BCFA00088FB2C /* thr-dummy.c in Sources */,
|
||||
2A1145191385E5010087C872 /* YabauseButtonFormatter.m in Sources */,
|
||||
F07BF9E414A1C2C500775818 /* yglshader.c in Sources */,
|
||||
F07E62CB15054DCC00DF8A4E /* titan.c in Sources */,
|
||||
F0E47FAD156C34EC001A1B51 /* osdcore.c in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
2A7D3A7B115BA63900DE3BD1 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2A7D3A54115BA3E700DE3BD1 /* gen68k */;
|
||||
targetProxy = 2A7D3A7A115BA63900DE3BD1 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
089C165DFE840E0CC02AAC07 /* English */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2A7D3A99115BAB9E00DE3BD1 /* MainMenu.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
2A7D3A9A115BAB9E00DE3BD1 /* English */,
|
||||
);
|
||||
name = MainMenu.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2A7D3A57115BA3E800DE3BD1 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = C68K_GEN;
|
||||
INSTALL_PATH = /usr/local/bin;
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = gen68k;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2A7D3A58115BA3E800DE3BD1 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = C68K_GEN;
|
||||
INSTALL_PATH = /usr/local/bin;
|
||||
PREBINDING = NO;
|
||||
PRODUCT_NAME = gen68k;
|
||||
ZERO_LINK = NO;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4B08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
ENABLE_OPENMP_SUPPORT = NO;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_ENABLE_FIX_AND_CONTINUE = YES;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_UNROLL_LOOPS = YES;
|
||||
GCC_VERSION = 4.2;
|
||||
INFOPLIST_FILE = "Yabause-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
OTHER_CFLAGS = "-fnested-functions";
|
||||
PRODUCT_NAME = Yabause;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF4C08A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_OPENMP_SUPPORT = NO;
|
||||
GCC_MODEL_TUNING = G5;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
GCC_UNROLL_LOOPS = YES;
|
||||
GCC_VERSION = 4.2;
|
||||
INFOPLIST_FILE = "Yabause-Info.plist";
|
||||
INSTALL_PATH = "$(HOME)/Applications";
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "-fnested-functions";
|
||||
PRODUCT_NAME = Yabause;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
C01FCF4F08A954540054247B /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
ENABLE_OPENMP_SUPPORT = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"USE_SCSP2=1",
|
||||
CRAB_REWRITE,
|
||||
NO_CLI,
|
||||
HAVE_LIBGL,
|
||||
HAVE_LIBGLUT,
|
||||
HAVE_SYS_TIME_H,
|
||||
HAVE_GETTIMEOFDAY,
|
||||
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1)",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1 = "VERSION=\\\"0.9.10\\\"";
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
C01FCF5008A954540054247B /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_OPTIMIZATION_LEVEL = 3;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"USE_SCSP2=1",
|
||||
CRAB_REWRITE,
|
||||
NO_CLI,
|
||||
HAVE_LIBGL,
|
||||
HAVE_LIBGLUT,
|
||||
HAVE_SYS_TIME_H,
|
||||
HAVE_GETTIMEOFDAY,
|
||||
"$(GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1)",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS_QUOTED_FOR_PROJECT_1 = "VERSION=\\\"0.9.10\\\"";
|
||||
GCC_VERSION = 4.2;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)";
|
||||
OTHER_CFLAGS = "";
|
||||
PREBINDING = NO;
|
||||
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2A7D3A59115BA40C00DE3BD1 /* Build configuration list for PBXNativeTarget "gen68k" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2A7D3A57115BA3E800DE3BD1 /* Debug */,
|
||||
2A7D3A58115BA3E800DE3BD1 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Yabause" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4B08A954540054247B /* Debug */,
|
||||
C01FCF4C08A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Yabause" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
C01FCF4F08A954540054247B /* Debug */,
|
||||
C01FCF5008A954540054247B /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
/* Copyright 2011 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef YabauseButtonFormatter_h
|
||||
#define YabauseButtonFormatter_h
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
@interface YabauseButtonFormatter : NSFormatter {
|
||||
}
|
||||
|
||||
- (NSString *)stringForObjectValue:(id)obj;
|
||||
- (BOOL)getObjectValue:(id *)obj
|
||||
forString:(NSString *)str
|
||||
errorDescription:(NSString **)err;
|
||||
|
||||
- (BOOL)control:(NSControl*)control
|
||||
textView:(NSTextView*)textView
|
||||
doCommandBySelector:(SEL)commandSelector;
|
||||
|
||||
@end /* @interface YabauseButtonFormatter */
|
||||
|
||||
#endif /* !YabauseButtonFormatter_h */
|
|
@ -1,112 +0,0 @@
|
|||
/* Copyright 2011 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "YabauseButtonFormatter.h"
|
||||
#include <objc/runtime.h>
|
||||
|
||||
@implementation YabauseButtonFormatter
|
||||
|
||||
- (NSString *)stringForObjectValue:(id)obj
|
||||
{
|
||||
if(![obj isKindOfClass:[NSString class]]) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
if([obj length] >= 1) {
|
||||
return [obj substringToIndex:1];
|
||||
}
|
||||
else {
|
||||
return [NSString string];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)getObjectValue:(id *)obj
|
||||
forString:(NSString *)str
|
||||
errorDescription:(NSString **)err
|
||||
{
|
||||
if(obj) {
|
||||
if([str length] >= 1) {
|
||||
*obj = [NSString stringWithString:[str substringToIndex:1]];
|
||||
}
|
||||
else {
|
||||
*obj = [NSString string];
|
||||
}
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr
|
||||
proposedSelectedRange:(NSRangePointer)proposedSelRangePtr
|
||||
originalString:(NSString *)origString
|
||||
originalSelectedRange:(NSRange)origSelRange
|
||||
errorDescription:(NSString **)error
|
||||
{
|
||||
NSString *rs = [[*partialStringPtr substringToIndex:1] uppercaseString];
|
||||
|
||||
*partialStringPtr = rs;
|
||||
*proposedSelRangePtr = NSMakeRange(0, [rs length]);
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)control:(NSControl*)control
|
||||
textView:(NSTextView*)textView
|
||||
doCommandBySelector:(SEL)commandSelector
|
||||
{
|
||||
BOOL result = NO;
|
||||
|
||||
/* handle all the fun special cases... */
|
||||
if(commandSelector == @selector(insertNewline:)) {
|
||||
[textView insertText:@"\u23CE"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(insertTab:)) {
|
||||
[textView insertText:@"\u21E5"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(cancelOperation:)) {
|
||||
[textView insertText:@"\u241B"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(deleteBackward:)) {
|
||||
[textView insertText:@"\u232B"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(moveLeft:)) {
|
||||
[textView insertText:@"\u2190"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(moveUp:)) {
|
||||
[textView insertText:@"\u2191"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(moveRight:)) {
|
||||
[textView insertText:@"\u2192"];
|
||||
result = YES;
|
||||
}
|
||||
else if(commandSelector == @selector(moveDown:)) {
|
||||
[textView insertText:@"\u2193"];
|
||||
result = YES;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end /* @implementation YabauseButtonFormatter */
|
|
@ -1,69 +0,0 @@
|
|||
/* Copyright 2010, 2012 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef YabauseController_h
|
||||
#define YabauseController_h
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class YabauseGLView;
|
||||
@class YabausePrefsController;
|
||||
|
||||
@interface YabauseController : NSObject {
|
||||
IBOutlet YabauseGLView *view;
|
||||
IBOutlet NSPanel *prefsPane;
|
||||
IBOutlet YabausePrefsController *prefs;
|
||||
IBOutlet NSMenuItem *frameskip;
|
||||
IBOutlet NSWindow *logWindow;
|
||||
IBOutlet NSTextView *logView;
|
||||
BOOL _running;
|
||||
BOOL _paused;
|
||||
NSLock *_runLock;
|
||||
NSThread *_emuThd;
|
||||
char *_bramFile;
|
||||
char *_isoFile;
|
||||
BOOL _doneExecuting;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib;
|
||||
- (void)dealloc;
|
||||
|
||||
/* NSWindow delegate methods */
|
||||
- (BOOL)windowShouldClose:(id)sender;
|
||||
|
||||
/* NSApplication delegate methods */
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app;
|
||||
|
||||
- (IBAction)showPreferences:(id)sender;
|
||||
- (IBAction)runBIOS:(id)sender;
|
||||
- (IBAction)runCD:(id)sender;
|
||||
- (IBAction)runISO:(id)sender;
|
||||
- (IBAction)toggleFullscreen:(id)sender;
|
||||
- (IBAction)toggle:(id)sender;
|
||||
- (IBAction)toggleFrameskip:(id)sender;
|
||||
- (IBAction)pause:(id)sender;
|
||||
- (IBAction)reset:(id)sender;
|
||||
|
||||
- (YabauseGLView *)view;
|
||||
|
||||
@end
|
||||
|
||||
extern YabauseController *controller;
|
||||
|
||||
#endif /* !YabauseController_h */
|
|
@ -1,379 +0,0 @@
|
|||
/* Copyright 2010, 2012 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <sched.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "YabauseController.h"
|
||||
#include "YabauseGLView.h"
|
||||
#include "YabausePrefsController.h"
|
||||
|
||||
#include "vdp1.h"
|
||||
#include "vdp2.h"
|
||||
#include "scsp.h"
|
||||
#include "peripheral.h"
|
||||
#include "cdbase.h"
|
||||
#include "yabause.h"
|
||||
#include "yui.h"
|
||||
#include "PerCocoa.h"
|
||||
#include "m68kc68k.h"
|
||||
#include "cs0.h"
|
||||
|
||||
YabauseController *controller;
|
||||
|
||||
@interface YabauseController (InternalFunctions)
|
||||
- (void)startEmulationWithCDCore:(int)cdcore CDPath:(const char *)fn;
|
||||
- (void)emulationThread:(id)ignored;
|
||||
- (void)terminateEmulation;
|
||||
@end
|
||||
|
||||
/* Menu Item tags. */
|
||||
enum {
|
||||
tagVDP1 = 1,
|
||||
tagNBG0 = 2,
|
||||
tagNBG1 = 3,
|
||||
tagNBG2 = 4,
|
||||
tagNBG3 = 5,
|
||||
tagRBG0 = 6,
|
||||
tagFPS = 7
|
||||
};
|
||||
|
||||
static void FlipToggle(NSMenuItem *item) {
|
||||
if([item state] == NSOffState) {
|
||||
[item setState:NSOnState];
|
||||
}
|
||||
else {
|
||||
[item setState:NSOffState];
|
||||
}
|
||||
}
|
||||
|
||||
@implementation YabauseController
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
NSUserDefaults *p = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
controller = self;
|
||||
_running = NO;
|
||||
_paused = NO;
|
||||
_runLock = [[NSLock alloc] init];
|
||||
_emuThd = nil;
|
||||
_bramFile = NULL;
|
||||
_doneExecuting = NO;
|
||||
|
||||
if([p boolForKey:@"Enable Frameskip"]) {
|
||||
[frameskip setState:NSOnState];
|
||||
EnableAutoFrameSkip();
|
||||
}
|
||||
else {
|
||||
[frameskip setState:NSOffState];
|
||||
DisableAutoFrameSkip();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_runLock release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(id)sender
|
||||
{
|
||||
[self terminateEmulation];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)app
|
||||
{
|
||||
[self terminateEmulation];
|
||||
return NSTerminateNow;
|
||||
}
|
||||
|
||||
- (IBAction)showPreferences:(id)sender
|
||||
{
|
||||
[prefsPane makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
- (IBAction)runBIOS:(id)sender
|
||||
{
|
||||
/* This will simply start up the system with the dummy CD core, so there's
|
||||
no way it'll actually read that there's a disc to be played. */
|
||||
[self startEmulationWithCDCore:CDCORE_DUMMY CDPath:NULL];
|
||||
}
|
||||
|
||||
- (IBAction)runCD:(id)sender
|
||||
{
|
||||
[self startEmulationWithCDCore:CDCORE_ARCH CDPath:NULL];
|
||||
}
|
||||
|
||||
- (IBAction)runISO:(id)sender
|
||||
{
|
||||
NSOpenPanel *p = [NSOpenPanel openPanel];
|
||||
NSArray *types = [NSArray arrayWithObjects:@"iso", @"cue", nil];
|
||||
|
||||
[p setAllowedFileTypes:types];
|
||||
if([p runModal] == NSFileHandlingPanelOKButton) {
|
||||
NSString *fn = [[[p URLs] objectAtIndex:0] path];
|
||||
[self startEmulationWithCDCore:CDCORE_ISO
|
||||
CDPath:[fn fileSystemRepresentation]];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleFullscreen:(id)sender
|
||||
{
|
||||
/* The view handles any heavy lifting here... */
|
||||
[view toggleFullscreen];
|
||||
}
|
||||
|
||||
- (IBAction)toggle:(id)sender
|
||||
{
|
||||
/* None of these will work unless we're running... */
|
||||
if(!_running) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Flip the checkmark on the button. */
|
||||
FlipToggle((NSMenuItem *)sender);
|
||||
|
||||
/* Do whatever this toggle is asking us to do. */
|
||||
switch([sender tag]) {
|
||||
case tagVDP1:
|
||||
ToggleVDP1();
|
||||
break;
|
||||
|
||||
case tagNBG0:
|
||||
ToggleNBG0();
|
||||
break;
|
||||
|
||||
case tagNBG1:
|
||||
ToggleNBG1();
|
||||
break;
|
||||
|
||||
case tagNBG2:
|
||||
ToggleNBG2();
|
||||
break;
|
||||
|
||||
case tagNBG3:
|
||||
ToggleNBG3();
|
||||
break;
|
||||
|
||||
case tagRBG0:
|
||||
ToggleRBG0();
|
||||
break;
|
||||
|
||||
case tagFPS:
|
||||
ToggleFPS();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleFrameskip:(id)sender
|
||||
{
|
||||
NSUserDefaults *p = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if([sender state] == NSOnState) {
|
||||
DisableAutoFrameSkip();
|
||||
[sender setState:NSOffState];
|
||||
[p setBool:NO forKey:@"Enable Frameskip"];
|
||||
}
|
||||
else {
|
||||
EnableAutoFrameSkip();
|
||||
[sender setState:NSOnState];
|
||||
[p setBool:YES forKey:@"Enable Frameskip"];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)pause:(id)sender
|
||||
{
|
||||
if(_running) {
|
||||
if(!_paused) {
|
||||
_paused = YES;
|
||||
|
||||
/* Mute the audio before we actually pause otherwise the user might
|
||||
not like the result... */
|
||||
ScspMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
[_runLock lock];
|
||||
[sender setState:NSOnState];
|
||||
}
|
||||
else {
|
||||
_paused = NO;
|
||||
[_runLock unlock];
|
||||
ScspUnMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
[sender setState:NSOffState];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)reset:(id)sender
|
||||
{
|
||||
if(_running) {
|
||||
/* Act as if the user pressed the reset button on the console. */
|
||||
YabauseResetButton();
|
||||
}
|
||||
}
|
||||
|
||||
- (YabauseGLView *)view
|
||||
{
|
||||
return view;
|
||||
}
|
||||
|
||||
@end /* @implementation YabauseController */
|
||||
|
||||
@implementation YabauseController (InternalFunctions)
|
||||
|
||||
- (void)startEmulationWithCDCore:(int)cdcore CDPath:(const char *)fn
|
||||
{
|
||||
if(!_running) {
|
||||
yabauseinit_struct yinit;
|
||||
int initok;
|
||||
NSString *bios = [prefs biosPath];
|
||||
NSString *mpeg = [prefs mpegPath];
|
||||
NSString *bram = [prefs bramPath];
|
||||
NSString *cart = [prefs cartPath];
|
||||
|
||||
yinit.percoretype = PERCORE_COCOA;
|
||||
yinit.sh2coretype = SH2CORE_DEFAULT;
|
||||
yinit.vidcoretype = [prefs videoCore];
|
||||
yinit.sndcoretype = [prefs soundCore];
|
||||
yinit.m68kcoretype = M68KCORE_C68K;
|
||||
yinit.cdcoretype = cdcore;
|
||||
yinit.carttype = [prefs cartType];
|
||||
yinit.regionid = [prefs region];
|
||||
yinit.biospath = ([bios length] > 0 && ![prefs emulateBios]) ?
|
||||
[bios UTF8String] : NULL;
|
||||
yinit.cdpath = fn;
|
||||
yinit.buppath = NULL;
|
||||
yinit.mpegpath = ([mpeg length] > 0) ? [mpeg UTF8String] : NULL;
|
||||
yinit.videoformattype = ([prefs region] < 10) ? VIDEOFORMATTYPE_NTSC :
|
||||
VIDEOFORMATTYPE_PAL;
|
||||
yinit.frameskip = [frameskip state] == NSOnState;
|
||||
yinit.clocksync = 0;
|
||||
yinit.basetime = 0;
|
||||
yinit.usethreads = 0;
|
||||
|
||||
/* Set up the internal save ram if specified. */
|
||||
if([bram length] > 0) {
|
||||
const char *tmp = [bram UTF8String];
|
||||
yinit.buppath = _bramFile = strdup(tmp);
|
||||
}
|
||||
|
||||
if(fn)
|
||||
_isoFile = strdup(fn);
|
||||
|
||||
/* Set up the cartridge stuff based on what was selected. */
|
||||
if(yinit.carttype == CART_NETLINK) {
|
||||
yinit.cartpath = NULL;
|
||||
yinit.netlinksetting = ([cart length] > 0) ?
|
||||
[cart UTF8String] : NULL;
|
||||
}
|
||||
else {
|
||||
yinit.cartpath = ([cart length] > 0) ? [cart UTF8String] : NULL;
|
||||
yinit.netlinksetting = NULL;
|
||||
}
|
||||
|
||||
if(cdcore == CDCORE_DUMMY && !yinit.biospath) {
|
||||
NSRunAlertPanel(@"Yabause Error", @"You must specify a BIOS file "
|
||||
"(and have BIOS emulation disabled) in order to "
|
||||
"run the BIOS.", @"OK", NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
[[view openGLContext] makeCurrentContext];
|
||||
initok = YabauseInit(&yinit);
|
||||
[NSOpenGLContext clearCurrentContext];
|
||||
if (initok != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
YabauseSetDecilineMode(1);
|
||||
|
||||
_running = YES;
|
||||
_doneExecuting = NO;
|
||||
|
||||
[view showWindow];
|
||||
|
||||
/* The emulation itself takes place in a separate thread from the main
|
||||
GUI thread. */
|
||||
[NSThread detachNewThreadSelector:@selector(emulationThread:)
|
||||
toTarget:self
|
||||
withObject:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)emulationThread:(id)ignored
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
CGLContextObj cxt;
|
||||
|
||||
_emuThd = [NSThread currentThread];
|
||||
|
||||
/* Make the OpenGL context current for this thread, otherwise we will be
|
||||
drawing to nothingness. */
|
||||
[[view openGLContext] makeCurrentContext];
|
||||
|
||||
ScspUnMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
|
||||
while(_running) {
|
||||
/* If we get paused from the GUI, we'll end up waiting in this lock
|
||||
here... Maybe not the most clear way to do it, but it works. */
|
||||
[_runLock lock];
|
||||
|
||||
/* Make sure the main thread doesn't attempt to flip the buffer before
|
||||
this thread is done rendering. */
|
||||
cxt = CGLGetCurrentContext();
|
||||
CGLLockContext(cxt);
|
||||
|
||||
/* Shortcut a function call here... We should technically be doing a
|
||||
PERCore->HandleEvents(), but that function simply calls YabauseExec()
|
||||
anyway... so cut out the middleman. */
|
||||
YabauseExec();
|
||||
|
||||
CGLUnlockContext(cxt);
|
||||
[_runLock unlock];
|
||||
}
|
||||
|
||||
ScspMuteAudio(SCSP_MUTE_SYSTEM);
|
||||
|
||||
_doneExecuting = YES;
|
||||
[pool release];
|
||||
}
|
||||
|
||||
- (void)terminateEmulation
|
||||
{
|
||||
_running = NO;
|
||||
|
||||
/* Wait for the thread to die, and then clean up after it. */
|
||||
if(_emuThd) {
|
||||
while(!_doneExecuting) {
|
||||
sched_yield();
|
||||
}
|
||||
|
||||
YabauseDeInit();
|
||||
|
||||
free(_bramFile);
|
||||
_bramFile = NULL;
|
||||
free(_isoFile);
|
||||
_isoFile = NULL;
|
||||
|
||||
_emuThd = nil;
|
||||
}
|
||||
}
|
||||
|
||||
@end /* @implementation YabauseController (InternalFunctions) */
|
|
@ -1,48 +0,0 @@
|
|||
/* Copyright 2010 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef YabauseGLView_h
|
||||
#define YabauseGLView_h
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/GL.h>
|
||||
|
||||
@interface YabauseGLView : NSOpenGLView {
|
||||
IBOutlet NSWindow *window;
|
||||
BOOL _isFullscreen;
|
||||
NSPoint _mouseLoc;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect;
|
||||
|
||||
- (void)toggleFullscreen;
|
||||
|
||||
- (BOOL)acceptsFirstResponder;
|
||||
- (void)keyDown:(NSEvent *)event;
|
||||
- (void)keyUp:(NSEvent *)event;
|
||||
|
||||
- (void)showWindow;
|
||||
|
||||
- (void)reshape;
|
||||
- (void)drawRect:(NSRect)rect;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* !YabauseGLView_h */
|
|
@ -1,217 +0,0 @@
|
|||
/* Copyright 2010 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "YabauseGLView.h"
|
||||
|
||||
#include "peripheral.h"
|
||||
#include "vdp1.h"
|
||||
|
||||
@interface YabauseGLView (InternalFunctions)
|
||||
- (NSScreen *)screen;
|
||||
- (CGDirectDisplayID)screenID;
|
||||
|
||||
/* These are nice to have, but not really necessary to things... */
|
||||
- (float)width;
|
||||
- (float)height;
|
||||
@end
|
||||
|
||||
@implementation YabauseGLView
|
||||
|
||||
- (id)initWithFrame:(NSRect)frameRect
|
||||
{
|
||||
NSOpenGLPixelFormatAttribute attrs[] = {
|
||||
NSOpenGLPFAWindow,
|
||||
NSOpenGLPFANoRecovery,
|
||||
NSOpenGLPFAColorSize, 32,
|
||||
NSOpenGLPFADepthSize, 32,
|
||||
NSOpenGLPFADoubleBuffer,
|
||||
0
|
||||
};
|
||||
|
||||
NSOpenGLPixelFormat *fmt;
|
||||
|
||||
fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
|
||||
|
||||
if(fmt == nil) {
|
||||
[fmt release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
if(!(self = [super initWithFrame:frameRect pixelFormat:fmt])) {
|
||||
[fmt release];
|
||||
return nil;
|
||||
}
|
||||
|
||||
_isFullscreen = NO;
|
||||
|
||||
[fmt release];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)toggleFullscreen
|
||||
{
|
||||
CGError err;
|
||||
CGDisplayFadeReservationToken token;
|
||||
CGDirectDisplayID d = [self screenID];
|
||||
|
||||
err = CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval,
|
||||
&token);
|
||||
|
||||
if(err == kCGErrorSuccess) {
|
||||
CGDisplayFade(token, 0.5, kCGDisplayBlendNormal,
|
||||
kCGDisplayBlendSolidColor, 0, 0, 0, 1);
|
||||
}
|
||||
|
||||
if(!_isFullscreen) {
|
||||
[self enterFullScreenMode:[self screen] withOptions:nil];
|
||||
|
||||
/* Hide the cursor, but store its location so we can restore it later.
|
||||
Also, disassociate the mouse and the cursor position. */
|
||||
CGDisplayHideCursor(d);
|
||||
_mouseLoc = [NSEvent mouseLocation];
|
||||
CGDisplayMoveCursorToPoint(d, CGPointZero);
|
||||
CGAssociateMouseAndMouseCursorPosition(FALSE);
|
||||
}
|
||||
else {
|
||||
CGPoint mousePoint;
|
||||
int height = CGDisplayPixelsHigh(d);
|
||||
|
||||
mousePoint.x = _mouseLoc.x;
|
||||
mousePoint.y = height - _mouseLoc.y;
|
||||
|
||||
/* Show the mouse pointer, and reassociate it with the mouse. */
|
||||
CGAssociateMouseAndMouseCursorPosition(TRUE);
|
||||
CGDisplayMoveCursorToPoint(d, mousePoint);
|
||||
CGDisplayShowCursor(d);
|
||||
|
||||
[self exitFullScreenModeWithOptions:nil];
|
||||
[[self window] makeFirstResponder:self];
|
||||
}
|
||||
|
||||
if(err == kCGErrorSuccess) {
|
||||
CGDisplayFade(token, 0.5, kCGDisplayBlendNormal,
|
||||
kCGDisplayBlendSolidColor, 0, 0, 0, 0);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
}
|
||||
|
||||
if(VIDCore)
|
||||
VIDCore->Resize([self width], [self height], 0);
|
||||
|
||||
_isFullscreen = !_isFullscreen;
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event
|
||||
{
|
||||
if([[event charactersIgnoringModifiers] length] >= 1) {
|
||||
PerKeyDown([[event charactersIgnoringModifiers] characterAtIndex:0]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)keyUp:(NSEvent *)event
|
||||
{
|
||||
if([[event charactersIgnoringModifiers] length] >= 1) {
|
||||
PerKeyUp([[event charactersIgnoringModifiers] characterAtIndex:0]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showWindow
|
||||
{
|
||||
[window makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
- (void)reshape
|
||||
{
|
||||
CGLContextObj cxt = CGLGetCurrentContext();
|
||||
|
||||
/* Make sure that the emulation thread doesn't attempt to do any OpenGL
|
||||
calls during the resize event, otherwise one of the two will crash. */
|
||||
CGLLockContext(cxt);
|
||||
|
||||
if(VIDCore)
|
||||
VIDCore->Resize([self width], [self height], 0);
|
||||
|
||||
CGLUnlockContext(cxt);
|
||||
|
||||
[super reshape];
|
||||
}
|
||||
|
||||
- (void)drawRect:(NSRect)rect
|
||||
{
|
||||
CGLContextObj cxt = CGLGetCurrentContext();
|
||||
|
||||
/* Make sure that the emulation thread doesn't attempt to do any OpenGL
|
||||
calls during the flush to the screen. */
|
||||
CGLLockContext(cxt);
|
||||
[[self openGLContext] flushBuffer];
|
||||
CGLUnlockContext(cxt);
|
||||
}
|
||||
|
||||
@end /* @implementation YabauseGLView */
|
||||
|
||||
@implementation YabauseGLView (InternalFunctions)
|
||||
|
||||
- (NSScreen *)screen
|
||||
{
|
||||
NSArray *screens = [NSScreen screens];
|
||||
NSEnumerator *i = [screens objectEnumerator];
|
||||
NSScreen *obj;
|
||||
NSRect f = [window frame];
|
||||
NSRect sf;
|
||||
|
||||
/* Look for the screen that has the main window on it. */
|
||||
while((obj = (NSScreen *)[i nextObject])) {
|
||||
sf = [obj frame];
|
||||
|
||||
if(f.origin.x >= sf.origin.x && f.origin.y >= sf.origin.y &&
|
||||
f.origin.x <= sf.origin.x + sf.size.width &&
|
||||
f.origin.y <= sf.origin.y + sf.size.height) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/* Punt. */
|
||||
return [NSScreen mainScreen];
|
||||
}
|
||||
|
||||
- (CGDirectDisplayID)screenID
|
||||
{
|
||||
NSScreen *s = [self screen];
|
||||
NSDictionary *d = [s deviceDescription];
|
||||
NSNumber *n = (NSNumber *)[d objectForKey:@"NSScreenNumber"];
|
||||
|
||||
return (CGDirectDisplayID)[n unsignedIntValue];
|
||||
}
|
||||
|
||||
- (float)width
|
||||
{
|
||||
return [self bounds].size.width;
|
||||
}
|
||||
|
||||
- (float)height
|
||||
{
|
||||
return [self bounds].size.height;
|
||||
}
|
||||
|
||||
@end /* @implementation YabauseGLView (InternalFunctions) */
|
|
@ -1,80 +0,0 @@
|
|||
/* Copyright 2010-2011 Lawrence Sebald
|
||||
|
||||
This file is part of Yabause.
|
||||
|
||||
Yabause is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Yabause is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Yabause; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef YabausePrefsController_h
|
||||
#define YabausePrefsController_h
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface YabausePrefsController : NSObject {
|
||||
IBOutlet NSTextField *biosPath;
|
||||
IBOutlet NSTextField *bramPath;
|
||||
IBOutlet NSButton *cartBrowse;
|
||||
IBOutlet NSTextField *cartPath;
|
||||
IBOutlet NSPopUpButton *cartType;
|
||||
IBOutlet NSButton *emulateBios;
|
||||
IBOutlet NSTextField *mpegPath;
|
||||
IBOutlet NSPopUpButton *region;
|
||||
IBOutlet NSPopUpButton *soundCore;
|
||||
IBOutlet NSPopUpButton *videoCore;
|
||||
IBOutlet NSPanel *prefsPane;
|
||||
IBOutlet NSPanel *buttonAssignment;
|
||||
IBOutlet NSTextField *buttonBox;
|
||||
|
||||
int _cartType;
|
||||
int _region;
|
||||
int _soundCore;
|
||||
int _videoCore;
|
||||
|
||||
NSUserDefaults *_prefs;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib;
|
||||
- (void)dealloc;
|
||||
|
||||
/* NSTextField delegate methods */
|
||||
- (void)controlTextDidEndEditing:(NSNotification *)notification;
|
||||
|
||||
- (IBAction)cartSelected:(id)sender;
|
||||
- (IBAction)regionSelected:(id)sender;
|
||||
- (IBAction)soundCoreSelected:(id)sender;
|
||||
- (IBAction)videoCoreSelected:(id)sender;
|
||||
- (IBAction)biosBrowse:(id)sender;
|
||||
- (IBAction)mpegBrowse:(id)sender;
|
||||
- (IBAction)bramBrowse:(id)sender;
|
||||
- (IBAction)cartBrowse:(id)sender;
|
||||
- (IBAction)biosToggle:(id)sender;
|
||||
- (IBAction)buttonSelect:(id)sender;
|
||||
|
||||
- (IBAction)buttonSetOk:(id)sender;
|
||||
- (IBAction)buttonSetCancel:(id)sender;
|
||||
|
||||
- (int)cartType;
|
||||
- (int)region;
|
||||
- (int)soundCore;
|
||||
- (int)videoCore;
|
||||
- (NSString *)biosPath;
|
||||
- (BOOL)emulateBios;
|
||||
- (NSString *)mpegPath;
|
||||
- (NSString *)bramPath;
|
||||
- (NSString *)cartPath;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* !YabausePrefsController_h */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue