Skip to content

Commit

Permalink
start work on the input config dialog. nonfunctional and looks like s…
Browse files Browse the repository at this point in the history
…hit.

add manifest crap under Windows so it gets the cool controls.
  • Loading branch information
Arisotura committed Mar 23, 2017
1 parent f237afe commit 4931424
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 0 deletions.
34 changes: 34 additions & 0 deletions melon.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#define VOS_NT_WINDOWS32 0x00040004L
#define VFT_APP 0x00000001L

//this will set your .exe icon
//A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "melon.ico"

//include version information in .exe, modify these values to match your needs
1 VERSIONINFO
FILEVERSION 0,1,1,1
PRODUCTVERSION 0,1,1,1
FILETYPE VFT_APP
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "Melon Factory of Kuribo64"
VALUE "FileVersion", "0.1"
VALUE "FileDescription", "DS emulator, sorta. also 1st quality melon."
VALUE "InternalName", "SDnolem"
VALUE "LegalCopyright", "2016-2017 StapleButter & co."
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "zafkflzdasd.exe"
VALUE "ProductName", "melonDS"
VALUE "ProductVersion", "0.1"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 1252 //language codes
}
}

1 24 "xp.manifest"
6 changes: 6 additions & 0 deletions melonDS.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<Add library="wsock32" />
<Add library="oleacc" />
</Linker>
<Unit filename="melon.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="src/ARM.cpp" />
<Unit filename="src/ARM.h" />
<Unit filename="src/ARMInterpreter.cpp" />
Expand Down Expand Up @@ -104,8 +107,11 @@
<Unit filename="src/Wifi.h" />
<Unit filename="src/types.h" />
<Unit filename="src/version.h" />
<Unit filename="src/wx/InputConfig.cpp" />
<Unit filename="src/wx/InputConfig.h" />
<Unit filename="src/wx/main.cpp" />
<Unit filename="src/wx/main.h" />
<Unit filename="xp.manifest" />
<Extensions>
<code_completion />
<envvars />
Expand Down
81 changes: 81 additions & 0 deletions src/wx/InputConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
Copyright 2016-2017 StapleButter
This file is part of melonDS.
melonDS 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 Foundation, either version 3 of the License, or (at your option)
any later version.
melonDS 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 melonDS. If not, see http://www.gnu.org/licenses/.
*/

#include "../types.h"
#include "InputConfig.h"
#include "../Config.h"


wxBEGIN_EVENT_TABLE(InputConfigDialog, wxDialog)
wxEND_EVENT_TABLE()


InputConfigDialog::InputConfigDialog(wxWindow* parent)
: wxDialog(parent, -1, "Input configuration - melonDS")
{
int keyorder[12] = {0, 1, 10, 11, 5, 4, 6, 7, 9, 8, 3, 2};
char keylabels[12][8] = {"A:", "B:", "Select:", "Start:", "Right:", "Left:", "Up:", "Down:", "R:", "L:", "X:", "Y:"};

wxBoxSizer* vboxmain = new wxBoxSizer(wxVERTICAL);

{
wxPanel* p = new wxPanel(this);
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);

wxStaticBox* kbdside = new wxStaticBox(p, wxID_ANY, "Keyboard");
{
wxGridSizer* grid = new wxGridSizer(2, 3, 0);

for (int i = 0; i < 12; i++)
{
int j = keyorder[i];

wxStaticText* label = new wxStaticText(kbdside, wxID_ANY, keylabels[j]);
grid->Add(label);

const char* keyname = SDL_GetKeyName(SDL_GetKeyFromScancode((SDL_Scancode)Config::KeyMapping[j]));
wxButton* btn = new wxButton(kbdside, 100+i, keyname);
grid->Add(btn);
}

kbdside->SetSizer(grid);
}
sizer->Add(kbdside);

p->SetSizer(sizer);
vboxmain->Add(p, 0, wxALL&(~wxBOTTOM), 15);
}

{
wxPanel* p = new wxPanel(this);
wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);

wxButton* derp = new wxButton(p, 1001, "derp");
sizer->Add(derp);

wxButton* boobs = new wxButton(p, 1002, "boobs");
sizer->Add(3, 0);
sizer->Add(boobs);

p->SetSizer(sizer);
vboxmain->Add(p, 0, wxALL|wxALIGN_RIGHT, 15);
}

SetSizer(vboxmain);
Fit();
}
39 changes: 39 additions & 0 deletions src/wx/InputConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
Copyright 2016-2017 StapleButter
This file is part of melonDS.
melonDS 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 Foundation, either version 3 of the License, or (at your option)
any later version.
melonDS 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 melonDS. If not, see http://www.gnu.org/licenses/.
*/

#ifndef WX_INPUTCONFIG_H
#define WX_INPUTCONFIG_H

#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#include <SDL2/SDL.h>

class InputConfigDialog : public wxDialog
{
public:
InputConfigDialog(wxWindow* parent);

private:
wxDECLARE_EVENT_TABLE();
};

#endif // WX_INPUTCONFIG_H

10 changes: 10 additions & 0 deletions src/wx/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "../NDS.h"
#include "../GPU.h"

#include "InputConfig.h"


bool Touching;

Expand Down Expand Up @@ -58,6 +60,8 @@ wxBEGIN_EVENT_TABLE(MainFrame, wxFrame)
EVT_MENU(ID_OPENROM, MainFrame::OnOpenROM)
EVT_MENU(ID_EXIT, MainFrame::OnCloseFromMenu)

EVT_MENU(ID_INPUTCONFIG, MainFrame::OnInputConfig)

EVT_PAINT(MainFrame::OnPaint)
EVT_IDLE(MainFrame::OnIdle)
wxEND_EVENT_TABLE()
Expand Down Expand Up @@ -179,6 +183,12 @@ void MainFrame::OnOpenROM(wxCommandEvent& event)
emustatuschangemutex->Unlock();
}

void MainFrame::OnInputConfig(wxCommandEvent& event)
{
InputConfigDialog dlg(this);
dlg.ShowModal();
}

void MainFrame::ProcessSDLEvents()
{
bool running = (emustatus == 1);
Expand Down
2 changes: 2 additions & 0 deletions src/wx/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ class MainFrame : public wxFrame
void OnCloseFromMenu(wxCommandEvent& event);
void OnOpenROM(wxCommandEvent& event);

void OnInputConfig(wxCommandEvent& event);

void ProcessSDLEvents();

void OnPaint(wxPaintEvent& event);
Expand Down
23 changes: 23 additions & 0 deletions xp.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
name="Exe.Apps.Project"
processorArchitecture="amd64"
version="1.0.0.0"
type="win32"/>
<description>Project</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

0 comments on commit 4931424

Please sign in to comment.