V 2.39 - BETA Build 74 - prelim. bugfix only

- fix - processing gamefile (PTU 3.2.1i) causes exception
pull/104/head
bm98 6 years ago
parent e6f15e53f2
commit 490f241bd9

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.38.0.73" )]
[assembly: AssemblyFileVersion( "2.38.0.73" )]
[assembly: AssemblyVersion( "2.39.0.74" )]
[assembly: AssemblyFileVersion( "2.39.0.74" )]

@ -1,5 +1,5 @@
SC Joystick Mapper V 2.38 - Build 73 BETA
(c) Cassini, StandardToaster - 19-Jul-2018
SC Joystick Mapper V 2.39 - Build 74 BETA
(c) Cassini, StandardToaster - 04-Aug-2018
Contains 14 files + graphics:
@ -44,6 +44,9 @@ Scanned for viruses before packing...
cassini@burri-web.org
Changelog:
V 2.39 - BETA Build 74
- fix - processing gamefile (PTU 3.2.1i) causes exception
- NOTE: other new stuff is not complete so you're on your own here
V 2.38 - BETA Build 73
- add - ability to hide joystick device tabs in Settings
- add - ability to color joystick device tabs in Settings

@ -26,12 +26,25 @@ namespace SCJMapper_V2.p4kFile
if ( reader.IsOpen( ) ) {
try {
long cPos = p4kSignatures.FindSignatureInPage( reader, p4kSignatures.EndOfCentralDirRecord );
if ( cPos >= 0 ) {
m_recordOffset = cPos;
reader.Seek( cPos );
m_item = p4kRecReader.ByteToType<MyRecord>( reader.TheReader );
m_itemValid = true;
long thisPos = 0;
// 20180804BM- fix when the last page is barely used and the sig is one or more pages before
// - backup one or more pages to find end of dir (max 10 times)
int tries = 10;
while ( !m_itemValid && ( tries > 0 ) ) {
thisPos = reader.Position;
long cPos = p4kSignatures.FindSignatureInPage( reader, p4kSignatures.EndOfCentralDirRecord );
if ( cPos >= 0 ) {
m_recordOffset = cPos;
reader.Seek( cPos );
m_item = p4kRecReader.ByteToType<MyRecord>( reader.TheReader );
m_itemValid = true;
}
else {
// backup one page again
reader.Seek( thisPos );
reader.BackwardPage( );
tries--;
}
}
}
catch {

@ -132,6 +132,16 @@ namespace SCJMapper_V2.p4kFile
}
}
/// <summary>
/// As the file is 4k page oriented - this backups to the previous page
/// </summary>
public void BackwardPage()
{
long current = TheReader.BaseStream.Position;
long seek = -PageSize;
TheReader.BaseStream.Seek( seek, SeekOrigin.Current );
}
/// <summary>
/// Places the stream at the last Page of the file
/// </summary>

@ -27,8 +27,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>73</ApplicationRevision>
<ApplicationVersion>2.38.0.%2a</ApplicationVersion>
<ApplicationRevision>74</ApplicationRevision>
<ApplicationVersion>2.39.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>

Loading…
Cancel
Save