Index: src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java	(revision 3760)
+++ src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java	(working copy)
@@ -88,6 +88,8 @@
 
 	private int mapId;
 
+	private boolean custom;
+
 	public TREHeader() {
 		super(DEFAULT_HEADER_LEN, "GARMIN TRE");
 	}
@@ -175,8 +177,11 @@
 		writer.put(getPoiDisplayFlags());
 
 		writer.put3(displayPriority);
-		writer.putInt(0x110301);
-
+		if (custom)
+			writer.putInt(0x170401);
+		else
+			writer.putInt(0x110301);
+		
 		writer.putChar((char) 1);
 		writer.put((byte) 0);
 
@@ -240,6 +245,8 @@
 
 		if (props.containsKey("transparent"))
 			poiDisplayFlags |= POI_FLAG_TRANSPARENT;
+		custom = props.containsKey("custom");
+			
 	}
 	
 	/**
Index: resources/help/en/options
===================================================================
--- resources/help/en/options	(revision 3760)
+++ resources/help/en/options	(working copy)
@@ -698,6 +698,10 @@
 	lower map too.  Useful for contour line maps among other
 	things.
 
+--custom
+	Write a different TRE header (1,4,23) instead of (1,3,17). Useful 
+	for marine maps.	
+	
 --hide-gmapsupp-on-pc
 	Set a bit in the gmapsupp.img that tells PC software that the file is
 	already installed on the PC and therefore there is no need to read it 
Index: doc/options.txt
===================================================================
--- doc/options.txt	(revision 3760)
+++ doc/options.txt	(working copy)
@@ -700,6 +700,10 @@
 lower map too.  Useful for contour line maps among other
 things.
 <p>
+;--custom
+: 	Write a different TRE header (1,4,23) instead of (1,3,17). Useful
+for marine maps.	
+<p>
 ;--hide-gmapsupp-on-pc
 : 	Set a bit in the gmapsupp.img that tells PC software that the file is
 already installed on the PC and therefore there is no need to read it 
