/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2014 David Quintana [gigaherz]
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 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 PCSX2.
* If not, see .
*/
#include
#include
#include
#include
#include
#include
#include "Config.h"
#include "../DEV9.h"
#include "pcap.h"
#include "pcap_io.h"
#include "net.h"
static GtkBuilder * builder;
void SysMessage(char *fmt, ...) {
va_list list;
char tmp[512];
va_start(list,fmt);
vsprintf(tmp,fmt,list);
va_end(list);
GtkWidget *dialog = gtk_message_dialog_new (NULL,
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", tmp);
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_hide(dialog);
}
void OnInitDialog() {
char *dev;
gint idx = 0;
static int initialized = 0;
LoadConf();
if( initialized )
return;
gtk_combo_box_text_append_text((GtkComboBoxText *)gtk_builder_get_object(builder,"IDC_BAYTYPE"),"Expansion");
gtk_combo_box_text_append_text((GtkComboBoxText *)gtk_builder_get_object(builder,"IDC_BAYTYPE"),"PC Card");
for (int i=0; imessage);
g_error_free(error);
g_object_unref(G_OBJECT(builder));
}
GtkDialog *dlg = GTK_DIALOG (gtk_builder_get_object(builder, "IDD_CONFDLG"));
OnInitDialog();
gint result = gtk_dialog_run (dlg);
switch(result) {
case -5: //IDOK
OnOk();
break;
case -6: //IDCANCEL
break;
}
gtk_widget_hide (GTK_WIDGET(dlg));
}
void __attribute__((constructor)) DllMain() {
//gtk_builder_add_from_file(builder, "dev9ghzdrk.ui", NULL);
//builder = gtk_build_new_from_resource( "/net/pcsx2/dev9ghzdrk/dev9ghzdrk.ui" );
}
NetAdapter* GetNetAdapter()
{
NetAdapter* na;
na = new PCAPAdapter();
if (!na->isInitialised())
{
delete na;
return 0;
}
return na;
}
s32 _DEV9open()
{
NetAdapter* na=GetNetAdapter();
if (!na)
{
emu_printf("Failed to GetNetAdapter()\n");
config.ethEnable = false;
}
else
{
InitNet(na);
}
return 0;
}
void _DEV9close() {
TermNet();
}