From 7b096b400febabf9e73c6709a30695b1772ffcd1 Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 14 Jan 2015 21:02:00 +0000 Subject: [PATCH] Glade Port: - Fix compiling issues. Updates to latest code structure changes. (Regressions from r1031, r5061, r5068.) --- desmume/src/gtk-glade/callbacks.cpp | 3 + desmume/src/gtk-glade/callbacks_IO.cpp | 1 + desmume/src/gtk-glade/desmume.cpp | 12 +--- desmume/src/gtk-glade/desmume.h | 6 +- desmume/src/gtk-glade/gdk_gl.cpp | 7 ++- desmume/src/gtk-glade/globals.h | 4 +- desmume/src/gtk-glade/main.cpp | 83 +++++++++++++------------- desmume/src/sndsdl.h | 2 + 8 files changed, 59 insertions(+), 59 deletions(-) diff --git a/desmume/src/gtk-glade/callbacks.cpp b/desmume/src/gtk-glade/callbacks.cpp index f17bfd6b8..97e7d051a 100755 --- a/desmume/src/gtk-glade/callbacks.cpp +++ b/desmume/src/gtk-glade/callbacks.cpp @@ -1,5 +1,6 @@ /* callbacks.c - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Damien Nozay (damdoum) * Copyright (C) 2007 Pascal Giard (evilynux) * Author: damdoum at users.sourceforge.net @@ -22,6 +23,8 @@ #include "callbacks.h" +#include "../GPU.h" + #define SAVESTATE_SLOT(x) ((x) < 10 ? (x) : 0) /* globals */ diff --git a/desmume/src/gtk-glade/callbacks_IO.cpp b/desmume/src/gtk-glade/callbacks_IO.cpp index 2cccd9537..faa155846 100755 --- a/desmume/src/gtk-glade/callbacks_IO.cpp +++ b/desmume/src/gtk-glade/callbacks_IO.cpp @@ -1,5 +1,6 @@ /* callbacks_IO.c - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Damien Nozay (damdoum) * Copyright (C) 2007 Pascal Giard (evilynux) * Author: damdoum at users.sourceforge.net diff --git a/desmume/src/gtk-glade/desmume.cpp b/desmume/src/gtk-glade/desmume.cpp index 90085b1b6..81c3293b8 100755 --- a/desmume/src/gtk-glade/desmume.cpp +++ b/desmume/src/gtk-glade/desmume.cpp @@ -1,6 +1,6 @@ /* desmume.c - this file is part of DeSmuME * - * Copyright (C) 2006,2007 DeSmuME Team + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Pascal Giard (evilynux) * * This file is free software; you can redistribute it and/or modify @@ -37,17 +37,9 @@ void desmume_mem_init(); u8 *desmume_rom_data = NULL; u32 desmume_last_cycle; -void desmume_init( struct armcpu_memory_iface *arm9_mem_if, - struct armcpu_ctrl_iface **arm9_ctrl_iface, //ticksPrevFrame = ticksCurFrame; - struct armcpu_memory_iface *arm7_mem_if, - struct armcpu_ctrl_iface **arm7_ctrl_iface) +void desmume_init() { -#ifdef GDB_STUB - NDS_Init( arm9_mem_if, arm9_ctrl_iface, - arm7_mem_if, arm7_ctrl_iface); -#else NDS_Init(); -#endif SPU_ChangeSoundCore(SNDCORE_SDL, 735 * 4); execute = false; } diff --git a/desmume/src/gtk-glade/desmume.h b/desmume/src/gtk-glade/desmume.h index 4a6dcc292..767ea1603 100755 --- a/desmume/src/gtk-glade/desmume.h +++ b/desmume/src/gtk-glade/desmume.h @@ -1,5 +1,6 @@ /* desmume.h - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,10 +27,7 @@ extern SDL_sem *glade_fps_limiter_semaphore; extern int glade_fps_limiter_disabled; -extern void desmume_init( struct armcpu_memory_iface *arm9_mem_if, - struct armcpu_ctrl_iface **arm9_ctrl_iface, - struct armcpu_memory_iface *arm7_mem_if, - struct armcpu_ctrl_iface **arm7_ctrl_iface); +extern void desmume_init( void); extern void desmume_free( void); extern int desmume_open(const char *filename); diff --git a/desmume/src/gtk-glade/gdk_gl.cpp b/desmume/src/gtk-glade/gdk_gl.cpp index 34803742e..75f952ff6 100755 --- a/desmume/src/gtk-glade/gdk_gl.cpp +++ b/desmume/src/gtk-glade/gdk_gl.cpp @@ -1,5 +1,6 @@ /* gdk_gl.cpp - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Damien Nozay (damdoum) * Author: damdoum at users.sourceforge.net * @@ -26,6 +27,8 @@ #include #include +#include "../GPU.h" + #define _DUP8(a) a,a,a,a, a,a,a,a #define _DUP4(a) a,a,a,a #define _DUP2(a) a,a @@ -48,7 +51,7 @@ static int gtk_glade_use_software_colour_convert; #undef _DUP2 /* FIXME: Purpose of this code? */ -static BOOL _fun_gl_Begin (int screen) { return FALSE; } +/*static BOOL _fun_gl_Begin (int screen) { return FALSE; } static void _fun_gl_End (int screen) { } fun_gl_Begin Open_GL_beg = _fun_gl_Begin; @@ -57,7 +60,7 @@ fun_gl_End Open_GL_end = _fun_gl_End; void register_gl_fun(fun_gl_Begin beg,fun_gl_End end) { Open_GL_beg = beg; Open_GL_end = end; -} +}*/ /************************************************/ /* BEGIN & END */ diff --git a/desmume/src/gtk-glade/globals.h b/desmume/src/gtk-glade/globals.h index fe6d3f7cd..6c0e5c6a7 100755 --- a/desmume/src/gtk-glade/globals.h +++ b/desmume/src/gtk-glade/globals.h @@ -1,5 +1,6 @@ /* globals.h - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Damien Nozay (damdoum) * Author: damdoum at users.sourceforge.net * @@ -35,7 +36,7 @@ #include #define _(String) gettext (String) -#include "SDL.h" +#include // fix gtk-glade on windows with no configure #ifndef DATADIR @@ -86,6 +87,7 @@ typedef union _callback_arg{ #include "../registers.h" #include "../armcpu.h" #include "../NDSSystem.h" +#include "../GPU.h" #include "../sndsdl.h" #include "../ctrlssdl.h" #include "../types.h" diff --git a/desmume/src/gtk-glade/main.cpp b/desmume/src/gtk-glade/main.cpp index 30db38ffa..ebeb2aa30 100755 --- a/desmume/src/gtk-glade/main.cpp +++ b/desmume/src/gtk-glade/main.cpp @@ -1,5 +1,6 @@ /* main.c - this file is part of DeSmuME * + * Copyright (C) 2007-2015 DeSmuME Team * Copyright (C) 2007 Damien Nozay (damdoum) * Copyright (C) 2007 Pascal Giard (evilynux) * Author: damdoum at users.sourceforge.net @@ -31,6 +32,7 @@ #include "desmume_config.h" #ifdef GDB_STUB +#include "../armcpu.h" #include "../gdbstub.h" #endif @@ -363,15 +365,6 @@ joinThread_gdb( void *thread_handle) { static int common_gtk_glade_main( struct configured_features *my_config) { - /*SDL_TimerID limiter_timer;*/ -#ifdef GDB_STUB - gdbstub_handle_t arm9_gdb_stub; - gdbstub_handle_t arm7_gdb_stub; -#endif - struct armcpu_memory_iface *arm9_memio = &arm9_base_memory_iface; - struct armcpu_memory_iface *arm7_memio = &arm7_base_memory_iface; - struct armcpu_ctrl_iface *arm9_ctrl_iface; - struct armcpu_ctrl_iface *arm7_ctrl_iface; /* the firmware settings */ struct NDS_fw_config_data fw_config; gchar *uifile; @@ -389,35 +382,10 @@ common_gtk_glade_main( struct configured_features *my_config) { #ifdef GTKGLEXT_AVAILABLE // check if you have GTHREAD when running configure script //g_thread_init(NULL); - register_gl_fun(my_gl_Begin,my_gl_End); + //register_gl_fun(my_gl_Begin,my_gl_End); #endif init_keyvals(); -#ifdef GDB_STUB - if ( my_config->arm9_gdb_port != 0) { - arm9_gdb_stub = createStub_gdb( my_config->arm9_gdb_port, - &arm9_memio, - &arm9_base_memory_iface); - - if ( arm9_gdb_stub == NULL) { - g_print( _("Failed to create ARM9 gdbstub on port %d\n"), - my_config->arm9_gdb_port); - return -1; - } - } - if ( my_config->arm7_gdb_port != 0) { - arm7_gdb_stub = createStub_gdb( my_config->arm7_gdb_port, - &arm7_memio, - &arm7_base_memory_iface); - - if ( arm7_gdb_stub == NULL) { - g_print( _("Failed to create ARM7 gdbstub on port %d\n"), - my_config->arm7_gdb_port); - return -1; - } - } -#endif - if(SDL_Init( SDL_INIT_TIMER | SDL_INIT_VIDEO) == -1) { fprintf(stderr, _("Error trying to initialize SDL: %s\n"), @@ -425,9 +393,7 @@ common_gtk_glade_main( struct configured_features *my_config) { return 1; } - desmume_init( arm9_memio, &arm9_ctrl_iface, - arm7_memio, &arm7_ctrl_iface); - + desmume_init(); /* Create the dummy firmware */ NDS_CreateDummyFirmware( &fw_config); @@ -438,12 +404,37 @@ common_gtk_glade_main( struct configured_features *my_config) { * where the cpus are set up. */ #ifdef GDB_STUB - if ( my_config->arm9_gdb_port != 0) { - activateStub_gdb( arm9_gdb_stub, arm9_ctrl_iface); + gdbstub_handle_t arm9_gdb_stub = NULL; + gdbstub_handle_t arm7_gdb_stub = NULL; + + if ( my_config->arm9_gdb_port > 0) { + arm9_gdb_stub = createStub_gdb( my_config->arm9_gdb_port, + &NDS_ARM9, + &arm9_direct_memory_iface); + + if ( arm9_gdb_stub == NULL) { + g_printerr("Failed to create ARM9 gdbstub on port %d\n", + my_config->arm9_gdb_port); + exit( -1); } - if ( my_config->arm7_gdb_port != 0) { - activateStub_gdb( arm7_gdb_stub, arm7_ctrl_iface); + else { + activateStub_gdb( arm9_gdb_stub); } + } + if ( my_config->arm7_gdb_port > 0) { + arm7_gdb_stub = createStub_gdb( my_config->arm7_gdb_port, + &NDS_ARM7, + &arm7_base_memory_iface); + + if ( arm7_gdb_stub == NULL) { + g_printerr("Failed to create ARM7 gdbstub on port %d\n", + my_config->arm7_gdb_port); + exit( -1); + } + else { + activateStub_gdb( arm7_gdb_stub); + } + } #endif /* Initialize joysticks */ @@ -521,6 +512,14 @@ common_gtk_glade_main( struct configured_features *my_config) { gtk_main(); desmume_free(); +#ifdef GDB_STUB + destroyStub_gdb( arm9_gdb_stub); + arm9_gdb_stub = NULL; + + destroyStub_gdb( arm7_gdb_stub); + arm7_gdb_stub = NULL; +#endif + /* Unload joystick */ uninit_joy(); diff --git a/desmume/src/sndsdl.h b/desmume/src/sndsdl.h index c11016024..cde81d7af 100644 --- a/desmume/src/sndsdl.h +++ b/desmume/src/sndsdl.h @@ -1,4 +1,5 @@ /* + Copyright (C) 2005-2015 DeSmuME Team Copyright 2005-2006 Theo Berkau This file is free software: you can redistribute it and/or modify @@ -18,6 +19,7 @@ #ifndef SNDSDL_H #define SNDSDL_H +#include "SPU.h" #define SNDCORE_SDL 2 extern SoundInterface_struct SNDSDL;