From 2465d2d3af2612998dfc2318564b4788f2e4bd94 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 15 May 2015 00:50:33 +0200 Subject: implement the zip code override --- src/export/split_version_2.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/export') diff --git a/src/export/split_version_2.c b/src/export/split_version_2.c index 4a5d1b8..64c3eee 100644 --- a/src/export/split_version_2.c +++ b/src/export/split_version_2.c @@ -52,9 +52,9 @@ enum { g_outfiles = 17 }; static enum { CD_NO = 0, CD_S = 1, CD_W = 2 } g_cd; static int g_outfilemap[3][29] = { - {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11, 6,-1,16, 5,13,12, 8,10, 3, 9,-1,-1, 7,14 }, - {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,11,-1, 6, 5,-1,-1,16, 8,10,11, 3, 9,13,-1,12, 7,14 }, - {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,13, 6,16, 5, 8,10, 3, 9,12,-1,-1,11, 7,14 } + {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11, 6,-1,16, 5,13,12, 8,10, 1, 9,-1,-1, 7,14 }, + {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,11,-1, 6, 5,-1,-1,16, 8,10,11, 1, 9,13,-1,12, 7,14 }, + {-1,-1,-1, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,13, 6,16, 5, 8,10, 1, 9,12,-1,-1,11, 7,14 } }; static struct { @@ -117,15 +117,18 @@ static void dump_primary( uint8_t *end, uint32_t flags ) { if this is the first line of a continuation. */ - /* Dump first 5 chars of zip, they're always there */ - dump_string( end -= 5, 5, 1 ); + /* Dump first 5 chars of zip, they're always there. The extra + zip overrides if flag is set */ + end -= 5; + if( !(flags & 0x0080) ) + dump_string( end, 5, 1 ); /* Dump first 5 chars of prefix, they're always here in s and w */ if( g_cd != CD_NO ) dump_string( end -= 5, 5, 2 ); - /* There is another version of the zip code present, if this bit is set */ - if( flags & 0x0080 ) dump_string( end -= 5, 5, 3 ); + /* There is an override version of the zip code present, if this bit is set */ + if( flags & 0x0080 ) dump_string( end -= 5, 5, 1 ); /* There is an unclear X present, if this bit is set */ if( flags & 0x0040 ) dump_string( end -= 1, 1, 4 ); -- cgit v1.2.3