mirror of https://github.com/PCSX2/pcsx2.git
DEV9: Clang Format
This commit is contained in:
parent
af63023d92
commit
fad389faab
|
@ -821,7 +821,7 @@ void DEV9write16(u32 addr, u16 value)
|
||||||
dev9.fifo_bytes_write = 0;
|
dev9.fifo_bytes_write = 0;
|
||||||
dev9.fifo_bytes_read = 0;
|
dev9.fifo_bytes_read = 0;
|
||||||
dev9.xfr_ctrl &= ~SPD_XFR_WRITE; //?
|
dev9.xfr_ctrl &= ~SPD_XFR_WRITE; //?
|
||||||
dev9.if_ctrl |= SPD_IF_READ; //?
|
dev9.if_ctrl |= SPD_IF_READ; //?
|
||||||
|
|
||||||
FIFOIntr();
|
FIFOIntr();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ IP_Address IPControl_GetValue(GtkEntry* entryCtl)
|
||||||
return {0};
|
return {0};
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPControl_Enable(GtkEntry *ipEntry, bool enabled, IP_Address value)
|
void IPControl_Enable(GtkEntry* ipEntry, bool enabled, IP_Address value)
|
||||||
{
|
{
|
||||||
if (enabled)
|
if (enabled)
|
||||||
{
|
{
|
||||||
|
@ -74,27 +74,27 @@ void IPControl_Enable(GtkEntry *ipEntry, bool enabled, IP_Address value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnAutoMaskChanged(GtkToggleButton *togglebutton, gpointer usr_data)
|
void OnAutoMaskChanged(GtkToggleButton* togglebutton, gpointer usr_data)
|
||||||
{
|
{
|
||||||
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_SUBNET"), !gtk_toggle_button_get_active(togglebutton), config.Mask);
|
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_SUBNET"), !gtk_toggle_button_get_active(togglebutton), config.Mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnAutoGatewayChanged(GtkToggleButton *togglebutton, gpointer usr_data)
|
void OnAutoGatewayChanged(GtkToggleButton* togglebutton, gpointer usr_data)
|
||||||
{
|
{
|
||||||
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_GATEWAY"), !gtk_toggle_button_get_active(togglebutton), config.Gateway);
|
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_GATEWAY"), !gtk_toggle_button_get_active(togglebutton), config.Gateway);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnAutoDNS1Changed(GtkToggleButton *togglebutton, gpointer usr_data)
|
void OnAutoDNS1Changed(GtkToggleButton* togglebutton, gpointer usr_data)
|
||||||
{
|
{
|
||||||
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_DNS1"), !gtk_toggle_button_get_active(togglebutton), config.DNS1);
|
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_DNS1"), !gtk_toggle_button_get_active(togglebutton), config.DNS1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnAutoDNS2Changed(GtkToggleButton *togglebutton, gpointer usr_data)
|
void OnAutoDNS2Changed(GtkToggleButton* togglebutton, gpointer usr_data)
|
||||||
{
|
{
|
||||||
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_DNS2"), !gtk_toggle_button_get_active(togglebutton), config.DNS2);
|
IPControl_Enable((GtkEntry*)gtk_builder_get_object(builder, "IDC_IPADDRESS_DNS2"), !gtk_toggle_button_get_active(togglebutton), config.DNS2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnInterceptChanged(GtkToggleButton *togglebutton, gpointer usr_data)
|
void OnInterceptChanged(GtkToggleButton* togglebutton, gpointer usr_data)
|
||||||
{
|
{
|
||||||
if (gtk_toggle_button_get_active(togglebutton))
|
if (gtk_toggle_button_get_active(togglebutton))
|
||||||
{
|
{
|
||||||
|
@ -190,9 +190,9 @@ void OnInitDialog()
|
||||||
|
|
||||||
//Checkboxes
|
//Checkboxes
|
||||||
gtk_toggle_button_set_active((GtkToggleButton*)gtk_builder_get_object(builder, "IDC_ETHENABLED"),
|
gtk_toggle_button_set_active((GtkToggleButton*)gtk_builder_get_object(builder, "IDC_ETHENABLED"),
|
||||||
config.ethEnable);
|
config.ethEnable);
|
||||||
gtk_toggle_button_set_active((GtkToggleButton*)gtk_builder_get_object(builder, "IDC_HDDENABLED"),
|
gtk_toggle_button_set_active((GtkToggleButton*)gtk_builder_get_object(builder, "IDC_HDDENABLED"),
|
||||||
config.hddEnable);
|
config.hddEnable);
|
||||||
|
|
||||||
initialized = 1;
|
initialized = 1;
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ void OnBrowse(GtkButton* button, gpointer usr_data)
|
||||||
static const wxChar* hddFilterType = L"HDD|*.raw;*.RAW";
|
static const wxChar* hddFilterType = L"HDD|*.raw;*.RAW";
|
||||||
|
|
||||||
wxFileDialog ctrl(nullptr, _("HDD Image File"), GetSettingsFolder().ToString(), HDD_DEF,
|
wxFileDialog ctrl(nullptr, _("HDD Image File"), GetSettingsFolder().ToString(), HDD_DEF,
|
||||||
(wxString)hddFilterType + L"|" + _("All Files (*.*)") + L"|*.*", wxFD_SAVE);
|
(wxString)hddFilterType + L"|" + _("All Files (*.*)") + L"|*.*", wxFD_SAVE);
|
||||||
|
|
||||||
if (ctrl.ShowModal() != wxID_CANCEL)
|
if (ctrl.ShowModal() != wxID_CANCEL)
|
||||||
{
|
{
|
||||||
|
@ -229,13 +229,13 @@ void OnBrowse(GtkButton* button, gpointer usr_data)
|
||||||
void OnSpin(GtkSpinButton* spin, gpointer usr_data)
|
void OnSpin(GtkSpinButton* spin, gpointer usr_data)
|
||||||
{
|
{
|
||||||
gtk_range_set_value((GtkRange*)gtk_builder_get_object(builder, "IDC_HDDSIZE_SLIDER"),
|
gtk_range_set_value((GtkRange*)gtk_builder_get_object(builder, "IDC_HDDSIZE_SLIDER"),
|
||||||
gtk_spin_button_get_value(spin));
|
gtk_spin_button_get_value(spin));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnSlide(GtkRange* range, gpointer usr_data)
|
void OnSlide(GtkRange* range, gpointer usr_data)
|
||||||
{
|
{
|
||||||
gtk_spin_button_set_value((GtkSpinButton*)gtk_builder_get_object(builder, "IDC_HDDSIZE_SPIN"),
|
gtk_spin_button_set_value((GtkSpinButton*)gtk_builder_get_object(builder, "IDC_HDDSIZE_SPIN"),
|
||||||
gtk_range_get_value(range));
|
gtk_range_get_value(range));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnOk()
|
void OnOk()
|
||||||
|
@ -305,14 +305,14 @@ void DEV9configure()
|
||||||
{
|
{
|
||||||
builder = gtk_builder_new();
|
builder = gtk_builder_new();
|
||||||
gtk_builder_add_callback_symbols(builder,
|
gtk_builder_add_callback_symbols(builder,
|
||||||
"OnInterceptChanged", G_CALLBACK(&OnInterceptChanged),
|
"OnInterceptChanged", G_CALLBACK(&OnInterceptChanged),
|
||||||
"OnAutoMaskChanged", G_CALLBACK(&OnAutoMaskChanged),
|
"OnAutoMaskChanged", G_CALLBACK(&OnAutoMaskChanged),
|
||||||
"OnAutoGatewayChanged", G_CALLBACK(&OnAutoGatewayChanged),
|
"OnAutoGatewayChanged", G_CALLBACK(&OnAutoGatewayChanged),
|
||||||
"OnAutoDNS1Changed", G_CALLBACK(&OnAutoDNS1Changed),
|
"OnAutoDNS1Changed", G_CALLBACK(&OnAutoDNS1Changed),
|
||||||
"OnAutoDNS2Changed", G_CALLBACK(&OnAutoDNS2Changed),
|
"OnAutoDNS2Changed", G_CALLBACK(&OnAutoDNS2Changed),
|
||||||
"OnBrowse", G_CALLBACK(&OnBrowse),
|
"OnBrowse", G_CALLBACK(&OnBrowse),
|
||||||
"OnSpin", G_CALLBACK(&OnSpin),
|
"OnSpin", G_CALLBACK(&OnSpin),
|
||||||
"OnSlide", G_CALLBACK(&OnSlide), nullptr);
|
"OnSlide", G_CALLBACK(&OnSlide), nullptr);
|
||||||
if (!gtk_builder_add_from_resource(builder, "/net/pcsx2/dev9/DEV9/Linux/dev9.ui", &error))
|
if (!gtk_builder_add_from_resource(builder, "/net/pcsx2/dev9/DEV9/Linux/dev9.ui", &error))
|
||||||
{
|
{
|
||||||
g_warning("Could not build config ui: %s", error->message);
|
g_warning("Could not build config ui: %s", error->message);
|
||||||
|
|
|
@ -183,30 +183,30 @@ void OnInitDialog(HWND hW)
|
||||||
Edit_LimitText(GetDlgItem(hW, IDC_HDDSIZE_TEXT), 3); //Excluding null char
|
Edit_LimitText(GetDlgItem(hW, IDC_HDDSIZE_TEXT), 3); //Excluding null char
|
||||||
//HDDSpin
|
//HDDSpin
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETRANGE,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETRANGE,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)MAKELPARAM(HDD_MAX_GB, HDD_MIN_GB));
|
(LPARAM)MAKELPARAM(HDD_MAX_GB, HDD_MIN_GB));
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)(config.HddSize / 1024));
|
(LPARAM)(config.HddSize / 1024));
|
||||||
|
|
||||||
//HDDSlider
|
//HDDSlider
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETRANGE,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETRANGE,
|
||||||
(WPARAM)FALSE,
|
(WPARAM)FALSE,
|
||||||
(LPARAM)MAKELPARAM(HDD_MIN_GB, HDD_MAX_GB));
|
(LPARAM)MAKELPARAM(HDD_MIN_GB, HDD_MAX_GB));
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPAGESIZE,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPAGESIZE,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)10);
|
(LPARAM)10);
|
||||||
|
|
||||||
for (int i = HDD_MIN_GB; i < HDD_MAX_GB; i += 5)
|
for (int i = HDD_MIN_GB; i < HDD_MAX_GB; i += 5)
|
||||||
{
|
{
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETTIC,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETTIC,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)i);
|
(LPARAM)i);
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
||||||
(WPARAM)TRUE,
|
(WPARAM)TRUE,
|
||||||
(LPARAM)(config.HddSize / 1024));
|
(LPARAM)(config.HddSize / 1024));
|
||||||
|
|
||||||
//Checkboxes
|
//Checkboxes
|
||||||
Button_SetCheck(GetDlgItem(hW, IDC_ETHENABLED), config.ethEnable);
|
Button_SetCheck(GetDlgItem(hW, IDC_ETHENABLED), config.ethEnable);
|
||||||
|
@ -245,11 +245,11 @@ void OnBrowse(HWND hW)
|
||||||
int filesizeGb = ghc::filesystem::file_size(hddFile) / (1024 * 1024 * 1024);
|
int filesizeGb = ghc::filesystem::file_size(hddFile) / (1024 * 1024 * 1024);
|
||||||
//Set slider
|
//Set slider
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)filesizeGb);
|
(LPARAM)filesizeGb);
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
||||||
(WPARAM)TRUE,
|
(WPARAM)TRUE,
|
||||||
(LPARAM)filesizeGb);
|
(LPARAM)filesizeGb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hddFile.parent_path() == inis)
|
if (hddFile.parent_path() == inis)
|
||||||
|
@ -421,11 +421,11 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)curpos);
|
(LPARAM)curpos);
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
||||||
(WPARAM)TRUE,
|
(WPARAM)TRUE,
|
||||||
(LPARAM)curpos);
|
(LPARAM)curpos);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -454,8 +454,8 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case TB_THUMBTRACK:
|
case TB_THUMBTRACK:
|
||||||
//Update Textbox
|
//Update Textbox
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SPIN), UDM_SETPOS,
|
||||||
(WPARAM)0,
|
(WPARAM)0,
|
||||||
(LPARAM)curpos);
|
(LPARAM)curpos);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -483,8 +483,8 @@ BOOL CALLBACK ConfigureDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
//Update Textbox
|
//Update Textbox
|
||||||
//Edit_SetText(GetDlgItem(hW, IDC_HDDSIZE_TEXT), to_wstring(curpos).c_str());
|
//Edit_SetText(GetDlgItem(hW, IDC_HDDSIZE_TEXT), to_wstring(curpos).c_str());
|
||||||
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
SendMessage(GetDlgItem(hW, IDC_HDDSIZE_SLIDER), TBM_SETPOS,
|
||||||
(WPARAM)TRUE,
|
(WPARAM)TRUE,
|
||||||
(LPARAM)curpos);
|
(LPARAM)curpos);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -501,9 +501,9 @@ void DEV9configure()
|
||||||
Config oldConfig = config;
|
Config oldConfig = config;
|
||||||
|
|
||||||
DialogBox(hInst,
|
DialogBox(hInst,
|
||||||
MAKEINTRESOURCE(IDD_CONFIG),
|
MAKEINTRESOURCE(IDD_CONFIG),
|
||||||
GetActiveWindow(),
|
GetActiveWindow(),
|
||||||
(DLGPROC)ConfigureDlgProc);
|
(DLGPROC)ConfigureDlgProc);
|
||||||
//SysMessage("Nothing to Configure");
|
//SysMessage("Nothing to Configure");
|
||||||
|
|
||||||
ApplyConfigIfRunning(oldConfig);
|
ApplyConfigIfRunning(oldConfig);
|
||||||
|
|
Loading…
Reference in New Issue