Removed unneeded color depth checks and fixed some spacing
This commit is contained in:
parent
843a90632f
commit
6f3699c7aa
|
@ -58,21 +58,21 @@ public:
|
||||||
wxButton *okb;
|
wxButton *okb;
|
||||||
void ServerOKButton(wxCommandEvent &ev)
|
void ServerOKButton(wxCommandEvent &ev)
|
||||||
{
|
{
|
||||||
okb->SetLabel(_("Start!"));
|
okb->SetLabel(_("Start!"));
|
||||||
}
|
}
|
||||||
void ClientOKButton(wxCommandEvent &ev)
|
void ClientOKButton(wxCommandEvent &ev)
|
||||||
{
|
{
|
||||||
okb->SetLabel(_("Connect"));
|
okb->SetLabel(_("Connect"));
|
||||||
}
|
}
|
||||||
// attached to OK, so skip when OK
|
// attached to OK, so skip when OK
|
||||||
void NetConnect(wxCommandEvent &ev)
|
void NetConnect(wxCommandEvent &ev)
|
||||||
{
|
{
|
||||||
static const int length = 256;
|
static const int length = 256;
|
||||||
if(!dlg->Validate() || !dlg->TransferDataFromWindow())
|
if(!dlg->Validate() || !dlg->TransferDataFromWindow())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!server) {
|
if (!server) {
|
||||||
bool valid = SetLinkServerHost(gopts.link_host.mb_str());
|
bool valid = SetLinkServerHost(gopts.link_host.mb_str());
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
wxMessageBox(_("You must enter a valid host name"),
|
wxMessageBox(_("You must enter a valid host name"),
|
||||||
_("Host name invalid"), wxICON_ERROR | wxOK);
|
_("Host name invalid"), wxICON_ERROR | wxOK);
|
||||||
|
@ -167,31 +167,31 @@ public:
|
||||||
|
|
||||||
void Reload()
|
void Reload()
|
||||||
{
|
{
|
||||||
list->DeleteAllItems();
|
list->DeleteAllItems();
|
||||||
Reload(0);
|
Reload(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reload(int start)
|
void Reload(int start)
|
||||||
{
|
{
|
||||||
if(isgb) {
|
if(isgb) {
|
||||||
for(int i = start; i < gbCheatNumber; i++) {
|
for(int i = start; i < gbCheatNumber; i++) {
|
||||||
item0.SetId(i);
|
item0.SetId(i);
|
||||||
item0.SetText(wxString(gbCheatList[i].cheatCode, wxConvLibc));
|
item0.SetText(wxString(gbCheatList[i].cheatCode, wxConvLibc));
|
||||||
list->InsertItem(item0);
|
list->InsertItem(item0);
|
||||||
item1.SetId(i);
|
item1.SetId(i);
|
||||||
item1.SetText(wxString(gbCheatList[i].cheatDesc, wxConvUTF8));
|
item1.SetText(wxString(gbCheatList[i].cheatDesc, wxConvUTF8));
|
||||||
list->SetItem(item1);
|
list->SetItem(item1);
|
||||||
list->Check(i, gbCheatList[i].enabled);
|
list->Check(i, gbCheatList[i].enabled);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(int i = start; i < cheatsNumber; i++) {
|
for(int i = start; i < cheatsNumber; i++) {
|
||||||
item0.SetId(i);
|
item0.SetId(i);
|
||||||
item0.SetText(wxString(cheatsList[i].codestring, wxConvLibc));
|
item0.SetText(wxString(cheatsList[i].codestring, wxConvLibc));
|
||||||
list->InsertItem(item0);
|
list->InsertItem(item0);
|
||||||
item1.SetId(i);
|
item1.SetId(i);
|
||||||
item1.SetText(wxString(cheatsList[i].desc, wxConvUTF8));
|
item1.SetText(wxString(cheatsList[i].desc, wxConvUTF8));
|
||||||
list->SetItem(item1);
|
list->SetItem(item1);
|
||||||
list->Check(i, cheatsList[i].enabled);
|
list->Check(i, cheatsList[i].enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AdjustDescWidth();
|
AdjustDescWidth();
|
||||||
|
@ -202,91 +202,91 @@ public:
|
||||||
switch(ev.GetId()) {
|
switch(ev.GetId()) {
|
||||||
case wxID_OPEN:
|
case wxID_OPEN:
|
||||||
{
|
{
|
||||||
wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir,
|
wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir,
|
||||||
cheatfn, _("VBA cheat lists (*.clt)|*.clt"),
|
cheatfn, _("VBA cheat lists (*.clt)|*.clt"),
|
||||||
wxFD_OPEN|wxFD_FILE_MUST_EXIST);
|
wxFD_OPEN|wxFD_FILE_MUST_EXIST);
|
||||||
int ret = subdlg.ShowModal();
|
int ret = subdlg.ShowModal();
|
||||||
cheatdir = subdlg.GetDirectory();
|
cheatdir = subdlg.GetDirectory();
|
||||||
cheatfn = subdlg.GetPath();
|
cheatfn = subdlg.GetPath();
|
||||||
if(ret != wxID_OK)
|
if(ret != wxID_OK)
|
||||||
break;
|
break;
|
||||||
bool cld;
|
bool cld;
|
||||||
if(isgb)
|
if(isgb)
|
||||||
cld = gbCheatsLoadCheatList(cheatfn.mb_fn_str());
|
cld = gbCheatsLoadCheatList(cheatfn.mb_fn_str());
|
||||||
else
|
else
|
||||||
cld = cheatsLoadCheatList(cheatfn.mb_fn_str());
|
cld = cheatsLoadCheatList(cheatfn.mb_fn_str());
|
||||||
if(cld) {
|
if(cld) {
|
||||||
*dirty = cheatfn != deffn;
|
*dirty = cheatfn != deffn;
|
||||||
systemScreenMessage(_("Loaded cheats"));
|
systemScreenMessage(_("Loaded cheats"));
|
||||||
} else
|
} else
|
||||||
*dirty = true; // attempted load always clears
|
*dirty = true; // attempted load always clears
|
||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case wxID_SAVE:
|
case wxID_SAVE:
|
||||||
{
|
{
|
||||||
wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir,
|
wxFileDialog subdlg(dlg, _("Select cheat file"), cheatdir,
|
||||||
cheatfn, _("VBA cheat lists (*.clt)|*.clt"),
|
cheatfn, _("VBA cheat lists (*.clt)|*.clt"),
|
||||||
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
|
||||||
int ret = subdlg.ShowModal();
|
int ret = subdlg.ShowModal();
|
||||||
cheatdir = subdlg.GetDirectory();
|
cheatdir = subdlg.GetDirectory();
|
||||||
cheatfn = subdlg.GetPath();
|
cheatfn = subdlg.GetPath();
|
||||||
if(ret != wxID_OK)
|
if(ret != wxID_OK)
|
||||||
break;
|
break;
|
||||||
// note that there is no way to test for succes of save
|
// note that there is no way to test for succes of save
|
||||||
if(isgb)
|
if(isgb)
|
||||||
gbCheatsSaveCheatList(cheatfn.mb_fn_str());
|
gbCheatsSaveCheatList(cheatfn.mb_fn_str());
|
||||||
else
|
else
|
||||||
cheatsSaveCheatList(cheatfn.mb_fn_str());
|
cheatsSaveCheatList(cheatfn.mb_fn_str());
|
||||||
if(cheatfn == deffn)
|
if(cheatfn == deffn)
|
||||||
*dirty = false;
|
*dirty = false;
|
||||||
systemScreenMessage(_("Saved cheats"));
|
systemScreenMessage(_("Saved cheats"));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case wxID_ADD:
|
case wxID_ADD:
|
||||||
{
|
{
|
||||||
int ncheats = isgb ? gbCheatNumber : cheatsNumber;
|
int ncheats = isgb ? gbCheatNumber : cheatsNumber;
|
||||||
ce_codes = wxEmptyString;
|
ce_codes = wxEmptyString;
|
||||||
wxDialog *subdlg = GetXRCDialog("CheatEdit");
|
wxDialog *subdlg = GetXRCDialog("CheatEdit");
|
||||||
subdlg->ShowModal();
|
subdlg->ShowModal();
|
||||||
AddCheat();
|
AddCheat();
|
||||||
Reload(ncheats);
|
Reload(ncheats);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case wxID_REMOVE:
|
case wxID_REMOVE:
|
||||||
{
|
{
|
||||||
bool asked = false, restore;
|
bool asked = false, restore;
|
||||||
for(int i = list->GetItemCount() - 1; i >= 0; i--)
|
for(int i = list->GetItemCount() - 1; i >= 0; i--)
|
||||||
if(list->GetItemState(i, wxLIST_STATE_SELECTED)) {
|
if(list->GetItemState(i, wxLIST_STATE_SELECTED)) {
|
||||||
list->DeleteItem(i);
|
list->DeleteItem(i);
|
||||||
if(isgb)
|
if(isgb)
|
||||||
gbCheatRemove(i);
|
gbCheatRemove(i);
|
||||||
else {
|
else {
|
||||||
if(!asked) {
|
if(!asked) {
|
||||||
asked = true;
|
asked = true;
|
||||||
restore = wxMessageBox(_("Restore old values?"),
|
restore = wxMessageBox(_("Restore old values?"),
|
||||||
_("Removing cheats"),
|
_("Removing cheats"),
|
||||||
wxYES_NO|wxICON_QUESTION) == wxYES;
|
wxYES_NO|wxICON_QUESTION) == wxYES;
|
||||||
}
|
}
|
||||||
cheatsDelete(i, restore);
|
cheatsDelete(i, restore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case wxID_CLEAR:
|
case wxID_CLEAR:
|
||||||
if(isgb) {
|
if(isgb) {
|
||||||
if(gbCheatNumber) {
|
if(gbCheatNumber) {
|
||||||
*dirty = true;
|
*dirty = true;
|
||||||
gbCheatRemoveAll();
|
gbCheatRemoveAll();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(cheatsNumber) {
|
if(cheatsNumber) {
|
||||||
bool restore = wxMessageBox(_("Restore old values?"),
|
bool restore = wxMessageBox(_("Restore old values?"),
|
||||||
_("Removing cheats"),
|
_("Removing cheats"),
|
||||||
wxYES_NO|wxICON_QUESTION) == wxYES;
|
wxYES_NO|wxICON_QUESTION) == wxYES;
|
||||||
*dirty = true;
|
*dirty = true;
|
||||||
cheatsDeleteAll(restore);
|
cheatsDeleteAll(restore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reload();
|
Reload();
|
||||||
break;
|
break;
|
||||||
|
@ -295,34 +295,34 @@ public:
|
||||||
// are selected
|
// are selected
|
||||||
*dirty = true;
|
*dirty = true;
|
||||||
if(isgb) {
|
if(isgb) {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < gbCheatNumber; i++)
|
for(i = 0; i < gbCheatNumber; i++)
|
||||||
if(!gbCheatList[i].enabled)
|
if(!gbCheatList[i].enabled)
|
||||||
break;
|
break;
|
||||||
if(i < gbCheatNumber)
|
if(i < gbCheatNumber)
|
||||||
for(; i < gbCheatNumber; i++) {
|
for(; i < gbCheatNumber; i++) {
|
||||||
gbCheatEnable(i);
|
gbCheatEnable(i);
|
||||||
list->Check(i, true);
|
list->Check(i, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(i = 0; i < gbCheatNumber; i++) {
|
for(i = 0; i < gbCheatNumber; i++) {
|
||||||
gbCheatDisable(i);
|
gbCheatDisable(i);
|
||||||
list->Check(i, false);
|
list->Check(i, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < cheatsNumber; i++)
|
for(i = 0; i < cheatsNumber; i++)
|
||||||
if(!cheatsList[i].enabled)
|
if(!cheatsList[i].enabled)
|
||||||
break;
|
break;
|
||||||
if(i < cheatsNumber)
|
if(i < cheatsNumber)
|
||||||
for(; i < cheatsNumber; i++) {
|
for(; i < cheatsNumber; i++) {
|
||||||
cheatsEnable(i);
|
cheatsEnable(i);
|
||||||
list->Check(i, true);
|
list->Check(i, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for(i = 0; i < cheatsNumber; i++) {
|
for(i = 0; i < cheatsNumber; i++) {
|
||||||
cheatsDisable(i);
|
cheatsDisable(i);
|
||||||
list->Check(i, false);
|
list->Check(i, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -793,44 +793,44 @@ public:
|
||||||
|
|
||||||
void Deselect()
|
void Deselect()
|
||||||
{
|
{
|
||||||
int idx = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
int idx = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
list->SetItemState(idx, 0, wxLIST_STATE_SELECTED);
|
list->SetItemState(idx, 0, wxLIST_STATE_SELECTED);
|
||||||
add_b->Disable();
|
add_b->Disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Select(wxListEvent &ev)
|
void Select(wxListEvent &ev)
|
||||||
{
|
{
|
||||||
add_b->Enable(list->GetItemState(ev.GetIndex(), wxLIST_STATE_SELECTED) != 0);
|
add_b->Enable(list->GetItemState(ev.GetIndex(), wxLIST_STATE_SELECTED) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCheatB(wxCommandEvent &ev)
|
void AddCheatB(wxCommandEvent &ev)
|
||||||
{
|
{
|
||||||
int idx = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
int idx = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
AddCheat(idx);
|
AddCheat(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCheatL(wxListEvent &ev)
|
void AddCheatL(wxListEvent &ev)
|
||||||
{
|
{
|
||||||
AddCheat(ev.GetIndex());
|
AddCheat(ev.GetIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddCheat(int idx)
|
void AddCheat(int idx)
|
||||||
{
|
{
|
||||||
wxString addr_s = list->OnGetItemText(idx, 0);
|
wxString addr_s = list->OnGetItemText(idx, 0);
|
||||||
ca_addr->SetLabel(addr_s);
|
ca_addr->SetLabel(addr_s);
|
||||||
wxString s;
|
wxString s;
|
||||||
switch(size) {
|
switch(size) {
|
||||||
case BITS_8:
|
case BITS_8:
|
||||||
s = _("8-bit ");
|
s = _("8-bit ");
|
||||||
break;
|
break;
|
||||||
case BITS_16:
|
case BITS_16:
|
||||||
s = _("16-bit ");
|
s = _("16-bit ");
|
||||||
break;
|
break;
|
||||||
case BITS_32:
|
case BITS_32:
|
||||||
s = _("32-bit ");
|
s = _("32-bit ");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch(fmt) {
|
switch(fmt) {
|
||||||
case CFVFMT_SD:
|
case CFVFMT_SD:
|
||||||
|
|
|
@ -1025,22 +1025,11 @@ DrawingPanel::DrawingPanel(int _width, int _height) :
|
||||||
} while(0);
|
} while(0);
|
||||||
} else {
|
} else {
|
||||||
scale = builtin_ff_scale(gopts.filter);
|
scale = builtin_ff_scale(gopts.filter);
|
||||||
#ifndef NO_ASM
|
|
||||||
// while there is a 32->16 frontend for these, it's probably more
|
|
||||||
// efficient to just use 16 to start with
|
|
||||||
// unfortunately, this also means that the 32-bit output needs to
|
|
||||||
// be sensed in lower code
|
|
||||||
#define out_16 (systemColorDepth == 16 && gopts.filter == FF_PLUGIN)
|
|
||||||
if(gopts.filter == FF_HQ3X || gopts.filter == FF_HQ4X)
|
|
||||||
systemColorDepth = 16;
|
|
||||||
else
|
|
||||||
#else
|
|
||||||
#define out_16 (systemColorDepth == 16)
|
#define out_16 (systemColorDepth == 16)
|
||||||
#endif
|
#endif
|
||||||
systemColorDepth = 32;
|
systemColorDepth = 32;
|
||||||
}
|
}
|
||||||
// Intialize color tables
|
// Intialize color tables
|
||||||
if(systemColorDepth == 32) {
|
|
||||||
#if wxBYTE_ORDER == wxLITTLE_ENDIAN
|
#if wxBYTE_ORDER == wxLITTLE_ENDIAN
|
||||||
systemRedShift = 3;
|
systemRedShift = 3;
|
||||||
systemGreenShift = 11;
|
systemGreenShift = 11;
|
||||||
|
@ -1052,14 +1041,6 @@ DrawingPanel::DrawingPanel(int _width, int _height) :
|
||||||
systemBlueShift = 11;
|
systemBlueShift = 11;
|
||||||
RGB_LOW_BITS_MASK = 0x01010100;
|
RGB_LOW_BITS_MASK = 0x01010100;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
// plugins expect RGB in native byte order
|
|
||||||
systemRedShift = 10;
|
|
||||||
systemGreenShift = 5;
|
|
||||||
systemBlueShift = 0;
|
|
||||||
RGB_LOW_BITS_MASK = 0x0421;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: should be "true" for GBA carts if lcd mode selected
|
// FIXME: should be "true" for GBA carts if lcd mode selected
|
||||||
// which means this needs to be re-run at pref change time
|
// which means this needs to be re-run at pref change time
|
||||||
utilUpdateSystemColorMaps(false);
|
utilUpdateSystemColorMaps(false);
|
||||||
|
|
Loading…
Reference in New Issue