Linux: Fixed makefile and compilation errors

This commit is contained in:
Souryo 2017-09-02 17:46:41 -04:00
parent 30d1c80742
commit ac119852ef
4 changed files with 19 additions and 13 deletions

View file

@ -291,7 +291,7 @@ AssemblerSpecialCodes Assembler::GetAddrModeAndOperandSize(LineData &lineData, s
bool Assembler::IsOpModeAvailable(string &opCode, AddrMode mode)
{
return _availableModesByOpName[opCode].find(mode) != _availableModesByOpName[opCode].end();
return _availableModesByOpName[opCode].find((int)mode) != _availableModesByOpName[opCode].end();
}
void Assembler::AssembleInstruction(LineData &lineData, uint16_t &instructionAddress, vector<int16_t>& output, bool firstPass)
@ -393,9 +393,9 @@ uint32_t Assembler::AssembleCode(string code, uint16_t startAddress, int16_t* as
{
for(uint8_t i = 0; i < 255; i++) {
if(_availableModesByOpName.find(opName[i]) == _availableModesByOpName.end()) {
_availableModesByOpName[opName[i]] = std::unordered_set<AddrMode>();
_availableModesByOpName[opName[i]] = std::unordered_set<int>();
}
_availableModesByOpName[opName[i]].emplace(DisassemblyInfo::OPMode[i]);
_availableModesByOpName[opName[i]].emplace((int)DisassemblyInfo::OPMode[i]);
}
std::unordered_map<string, uint16_t> temporaryLabels;

View file

@ -39,7 +39,7 @@ enum AssemblerSpecialCodes
class Assembler
{
private:
std::unordered_map<string, std::unordered_set<AddrMode>> _availableModesByOpName;
std::unordered_map<string, std::unordered_set<int>> _availableModesByOpName;
bool _needSecondPass;
shared_ptr<LabelManager> _labelManager;

View file

@ -87,7 +87,7 @@
//
this.btnOk.Location = new System.Drawing.Point(194, 3);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.Size = new System.Drawing.Size(70, 23);
this.btnOk.TabIndex = 0;
this.btnOk.Text = "Apply";
this.btnOk.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
@ -99,7 +99,7 @@
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(275, 3);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.Size = new System.Drawing.Size(70, 23);
this.btnCancel.TabIndex = 1;
this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true;
@ -147,8 +147,8 @@
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 21.23288F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 78.76712F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.AutoSize, 21.23288F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.Controls.Add(this.btnExecute, 0, 3);
this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.flowLayoutPanel2, 0, 1);
@ -169,7 +169,7 @@
this.btnExecute.Image = global::Mesen.GUI.Properties.Resources.Play;
this.btnExecute.Location = new System.Drawing.Point(3, 89);
this.btnExecute.Name = "btnExecute";
this.btnExecute.Size = new System.Drawing.Size(87, 23);
this.btnExecute.Size = new System.Drawing.Size(82, 23);
this.btnExecute.TabIndex = 6;
this.btnExecute.Text = "Execute";
this.btnExecute.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@ -286,11 +286,11 @@
this.lblNoChanges.AutoSize = true;
this.lblNoChanges.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128)));
this.lblNoChanges.ForeColor = System.Drawing.SystemColors.GrayText;
this.lblNoChanges.Location = new System.Drawing.Point(14, 8);
this.lblNoChanges.Location = new System.Drawing.Point(0, 8);
this.lblNoChanges.Name = "lblNoChanges";
this.lblNoChanges.Size = new System.Drawing.Size(174, 13);
this.lblNoChanges.TabIndex = 2;
this.lblNoChanges.Text = "Current code matches original code";
this.lblNoChanges.Text = "New code matches original code";
//
// groupBox1
//

View file

@ -32,6 +32,7 @@ UTILOBJ=$(patsubst Utilities/%.cpp,Utilities/$(OBJFOLDER)/%.o,$(wildcard Utiliti
LINUXOBJ=$(patsubst Linux/%.cpp,Linux/$(OBJFOLDER)/%.o,$(wildcard Linux/*.cpp))
LIBEVDEVOBJ=$(patsubst Linux/libevdev/%.c,Linux/$(OBJFOLDER)/%.o,$(wildcard Linux/libevdev/*.c))
SEVENZIPOBJ=$(patsubst SevenZip/%.c,SevenZip/$(OBJFOLDER)/%.o,$(wildcard SevenZip/*.c))
LUAOBJ=$(patsubst Lua/%.c,Lua/$(OBJFOLDER)/%.o,$(wildcard Lua/*.c))
all: ui
@ -57,6 +58,7 @@ rungametests:
testhelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
mkdir -p TestHelper/$(OBJFOLDER)
ar -rcs TestHelper/$(OBJFOLDER)/libSevenZip.a $(SEVENZIPOBJ)
ar -rcs TestHelper/$(OBJFOLDER)/libLua.a $(LUAOBJ)
ar -rcs TestHelper/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
ar -rcs TestHelper/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
ar -rcs TestHelper/$(OBJFOLDER)/libCore.a $(COREOBJ)
@ -64,6 +66,8 @@ testhelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
SevenZip/$(OBJFOLDER)/%.o: SevenZip/%.c
mkdir -p SevenZip/$(OBJFOLDER) && cd SevenZip/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst SevenZip/%, ../%, $<)
Lua/$(OBJFOLDER)/%.o: Lua/%.c
mkdir -p Lua/$(OBJFOLDER) && cd Lua/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst Lua/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/%.cpp
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
Utilities/$(OBJFOLDER)/%.o: Utilities/HQX/%.cpp
@ -81,18 +85,20 @@ Linux/$(OBJFOLDER)/%.o: Linux/%.cpp
Linux/$(OBJFOLDER)/%.o: Linux/libevdev/%.c
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -Wno-parentheses -Wno-switch -c $(patsubst Linux/%, ../%, $<)
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) InteropDLL/ConsoleWrapper.cpp InteropDLL/DebugWrapper.cpp
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) InteropDLL/ConsoleWrapper.cpp InteropDLL/DebugWrapper.cpp
mkdir -p InteropDLL/$(OBJFOLDER)
ar -rcs InteropDLL/$(OBJFOLDER)/libSevenZip.a $(SEVENZIPOBJ)
ar -rcs InteropDLL/$(OBJFOLDER)/libLua.a $(LUAOBJ)
ar -rcs InteropDLL/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
ar -rcs InteropDLL/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
ar -rcs InteropDLL/$(OBJFOLDER)/libCore.a $(COREOBJ)
cd InteropDLL/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -Wl,-z,defs -Wno-parentheses -Wno-switch -shared -o $(SHAREDLIB) ../*.cpp -L . -lMesenLinux -lCore -lUtilities -lSevenZip -pthread -lSDL2 -lstdc++fs
cd InteropDLL/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -Wl,-z,defs -Wno-parentheses -Wno-switch -shared -o $(SHAREDLIB) ../*.cpp -L . -lMesenLinux -lCore -lUtilities -lLua -lSevenZip -pthread -lSDL2 -lstdc++fs
run:
MONO_LOG_LEVEL=debug mono $(RELEASEFOLDER)/Mesen.exe
clean:
rm Lua/$(OBJFOLDER) -r -f
rm SevenZip/$(OBJFOLDER) -r -f
rm Utilities/$(OBJFOLDER) -r -f
rm Core/$(OBJFOLDER) -r -f