(PS3) Dodge function pointers / make direct calls through

HAVE_GRIFFIN define
This commit is contained in:
Twinaphex 2012-03-29 01:15:22 +02:00
parent eee0233abb
commit 5553774f6f
4 changed files with 63 additions and 13 deletions

View File

@ -71,7 +71,7 @@ endif
PPU_LDLIBS = -ldbgfont $(GL_LIBS) -lsnes -lcgc -lgcm_cmd -lgcm_sys_stub -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lsysutil_np_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lnetctl_stub -lpthread
DEFINES += -DSSNES_CONSOLE -DHAVE_OPENGL -DHAVE_CG -DHAVE_FBO -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DPACKAGE_VERSION=\"$(SSNES_VERSION)\" -Dmain=ssnes_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
DEFINES += -DSSNES_CONSOLE -DHAVE_OPENGL -DHAVE_CG -DHAVE_FBO -DHAVE_RSOUND -DHAVE_ZLIB -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(SSNES_VERSION)\" -Dmain=ssnes_main -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
ifeq ($(DEBUG), 1)
PPU_OPTIMIZE_LV := -O0 -g

View File

@ -31,6 +31,20 @@
============================================================ */
#include "../../conf/config_file.c"
/*============================================================
VIDEO
============================================================ */
#ifdef __CELLOS_LV2__
#include "../../ps3/ps3_video_psgl.c"
#endif
/*============================================================
INPUT
============================================================ */
#ifdef __CELLOS_LV2__
#include "../../ps3/ps3_input.c"
#endif
/*============================================================
SNES STATE
============================================================ */
@ -103,19 +117,7 @@
============================================================ */
#include "../../rewind.c"
/*============================================================
INPUT
============================================================ */
#ifdef __CELLOS_LV2__
#include "../../ps3/ps3_input.c"
#endif
/*============================================================
VIDEO
============================================================ */
#ifdef __CELLOS_LV2__
#include "../../ps3/ps3_video_psgl.c"
#endif
/*============================================================
MAIN

47
console/griffin/hook.h Normal file
View File

@ -0,0 +1,47 @@
/* SSNES - A Super Nintendo Entertainment System (SNES) Emulator frontend for libsnes.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* Some code herein may be based on code found in BSNES.
*
* SSNES 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 Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* SSNES 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 SSNES.
* If not, see <http://www.gnu.org/licenses/>.
*/
#define audio_init_func(device, rate, latency) driver.audio->init(device, rate, latency)
#define audio_write_func(buf, size) driver.audio->write(driver.audio_data, buf, size)
#define audio_stop_func() driver.audio->stop(driver.audio_data)
#define audio_start_func() driver.audio->start(driver.audio_data)
#define audio_set_nonblock_state_func(state) driver.audio->set_nonblock_state(driver.audio_data, state)
#define audio_free_func() driver.audio->free(driver.audio_data)
#define audio_use_float_func() driver.audio->use_float(driver.audio_data)
#define audio_write_avail_func() driver.audio->write_avail(driver.audio_data)
#define audio_buffer_size_func() driver.audio->buffer_size(driver.audio_data)
/* PlayStation3 */
#ifdef __CELLOS_LV2__
#define video_init_func(video_info, input, input_data) \
gl_init(video_info, input, input_data)
#define video_frame_func(data, width, height, pitch, msg) \
gl_frame(driver.video_data, data, width, height, pitch, msg)
#define video_set_nonblock_state_func(state) driver.video->set_nonblock_state(driver.video_data, state)
#define video_alive_func() gl_alive(driver.video_data)
#define video_focus_func() gl_focus(driver.video_data)
#define video_xml_shader_func(path) driver.video->xml_shader(driver.video_data, path)
#define video_free_func() gl_free(driver.video_data)
#define input_init_func() ps3_input_initialize()
#define input_poll_func() ps3_input_poll(driver.input_data)
#define input_input_state_func(snes_keybinds, port, device, index, id) \
ps3_input_state(driver.input_data, snes_keybinds, port, device, index, id)
#define input_key_pressed_func(key) ps3_key_pressed(driver.input_data, key)
#define input_free_func() ps3_free_input(driver.input_data)
#endif

View File

@ -213,6 +213,7 @@ extern const input_driver_t input_xdk360;
// Convenience macros.
#ifdef HAVE_GRIFFIN
#include "console/griffin/hook.h"
#else
#define audio_init_func(device, rate, latency) driver.audio->init(device, rate, latency)
#define audio_write_func(buf, size) driver.audio->write(driver.audio_data, buf, size)