Skip to content

Commit dc5ef32

Browse files
committed
various fix, especially to use binary only file
1 parent 2e73901 commit dc5ef32

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

deploy/deploystuff.bat

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
::change according to your installation
22

3-
set projectPath=D:\Project\SNESTilesKitten\
4-
set compilePath=D:\Project\compile\STK\
5-
set deployPath=D:\Project\SNESTilesKitten\deploy\SNESTilesKitten\
3+
set projectPath=F:\Project\SNESTilesKitten\
4+
set compilePath=F:\Project\compile\STK\
5+
set deployPath=F:\Project\SNESTilesKitten\deploy\SNESTilesKitten\
66
set originalBinDir=%compilePath%
7-
set vscdll=D:\Visual Studio\VC\Redist\MSVC\14.12.25810\x64\Microsoft.VC141.CRT\msvcp140.dll
87

98
rmdir /Q /S %deployPath%
109
mkdir %deployPath%
@@ -15,7 +14,6 @@ mkdir %deployPath%
1514

1615
mkdir %compilePath%
1716
cd %compilePath%
18-
set QMAKE_MSC_VER=1910
1917
qmake %projectPath%\SNESTilesKitten.pro -spec win32-msvc "CONFIG+=release"
2018
nmake
2119

@@ -40,5 +38,3 @@ rmdir /Q /S %deployPath%\imageformats
4038
del %deployPath%\opengl32sw.dll
4139
del %deployPath%\libEGL.dll
4240
del %deployPath%\libGLESV2.dll
43-
44-
xcopy /y "%vscdll%" %deployPath%

mainui.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void MainUI::closeEvent(QCloseEvent *event)
184184
void MainUI::on_romOpenButton_clicked()
185185
{
186186
QString fileName = QFileDialog::getOpenFileName(this,
187-
tr("Select ROM"), lastROMDirectory, tr("SNES ROM (*.smc *.sfc);;All files (*)"));
187+
tr("Select ROM"), lastROMDirectory, tr("SNES ROM or associated (*.smc *.sfc *.gfx *.bin);;All files (*)"));
188188
if (!fileName.isNull())
189189
openRom(fileName);
190190
}

romdataengine.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ QString ROMDataEngine::getRomFile() const
230230

231231
void ROMDataEngine::setRomFile(const QString &value)
232232
{
233+
qDebug() << "Loading rom " << value;
233234
romFile = value;
234235
ROMInfo romI(romFile);
236+
qDebug() << romI.size;
235237
romInfo = romI;
236238
}
237239

@@ -261,7 +263,7 @@ unsigned int ROMDataEngine::snesToPC(unsigned int romAddr, QString romType)
261263
return rommapping_snes_to_pc(romAddr, rType, false);
262264
}
263265

264-
unsigned int ROMDataEngine::getRomPosition(const TilePreset &preset, unsigned int directAddr, unsigned int snesAddr)
266+
unsigned int ROMDataEngine::getRomPosition(const TilePreset &preset, int directAddr, unsigned int snesAddr)
265267
{
266268
bool romHasHeader = romInfo.hasHeader;
267269
if (overrideHeaderInfo)
@@ -270,7 +272,7 @@ unsigned int ROMDataEngine::getRomPosition(const TilePreset &preset, unsigned in
270272
enum rom_type rType = HiROM;
271273
if (preset.romType == "LoROM")
272274
rType = LoROM;
273-
if (directAddr == 0) {
275+
if (directAddr == -1) {
274276
filePos = rommapping_snes_to_pc(snesAddr, rType, romHasHeader);
275277
} else {
276278
filePos = directAddr;

romdataengine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class ROMDataEngine
3838
static unsigned int snesToPC(unsigned int romAddr, QString romType);
3939

4040
private:
41-
unsigned int getRomPosition(const TilePreset &preset, unsigned int directAddr, unsigned int snesAddr);
41+
unsigned int getRomPosition(const TilePreset &preset, int directAddr, unsigned int snesAddr);
4242
QString romFile;
4343

4444
static bool loadedCompressionPlugins;

rominfo.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ ROMInfo::ROMInfo(QString romFile)
1717
QFile f(romFile);
1818
f.open(QIODevice::ReadOnly);
1919
if (f.size())
20-
if (f.size() & 0x200)
2120
{
22-
qDebug() << "ROM has header";
23-
hasHeader = true;
24-
}
25-
else {
26-
hasHeader = false;
27-
qDebug() << "ROM has no header";
21+
if (f.size() & 0x200)
22+
{
23+
qDebug() << "ROM has header";
24+
hasHeader = true;
25+
} else {
26+
hasHeader = false;
27+
qDebug() << "ROM has no header";
28+
}
2829
}
2930
/* 0xFC0 - 21 game title
3031
0xFD5 - rom makeup?
@@ -52,4 +53,5 @@ ROMInfo::ROMInfo(QString romFile)
5253
romType = "LoROM";
5354
}
5455
romTitle = mromTitle;
56+
qDebug() << romFile << "is " << romType << hasHeader << size;
5557
}

tilepreset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TilePreset::TilePreset()
99
romName = "";
1010
romType = "";
1111

12-
pcTilesLocation = 0;
12+
pcTilesLocation = -1;
1313
SNESTilesLocation = 0;
1414
length = 0;
1515
bpp = 0;

tilepreset.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class TilePreset
1818
TilesPattern tilesPattern;
1919

2020
unsigned int SNESTilesLocation;
21-
unsigned int pcTilesLocation;
21+
int pcTilesLocation;
2222
unsigned int SNESPaletteLocation;
2323
unsigned int pcPaletteLocation;
2424
bool paletteNoZeroColor;

0 commit comments

Comments
 (0)