# HG changeset patch
# User heinrichsweikamp
# Date 1354483531 -3600
# Node ID 8a8124f6b3891be97029ed1624f6c51cd18532d1
# Parent  3282581fe178b3825303d62a4761c4c502e69e09
aGF handling during deco init

diff -r 3282581fe178 -r 8a8124f6b389 code_part1/OSTC_code_asm_part1/start.asm
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sun Dec 02 19:19:11 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun Dec 02 22:25:31 2012 +0100
@@ -352,10 +352,7 @@
 	movlw	d'1'
 	movff	WREG,char_I_deco_model      ; Set Flagbyte for GF method
 ; Load GF values into RAM
-	GETCUSTOM8	d'32'			        ; GF low
-	movff   EEDATA,char_I_GF_Low_percentage
-	GETCUSTOM8	d'33'			        ; GF high
-	movff   EEDATA,char_I_GF_High_percentage
+    rcall   restart_load_gf
 	return							    ; start in Surfacemode
 restart_5_test_gfO2_mode:
 	movlw	d'5'					    ; GF CC mode
@@ -365,10 +362,7 @@
 	movlw	d'1'
 	movff	WREG,char_I_deco_model	    ; Set Flagbyte for GF method
 	; Load GF values into RAM
-	GETCUSTOM8	d'32'                   ; GF low
-	movff		EEDATA,char_I_GF_Low_percentage
-	GETCUSTOM8	d'33'                   ; GF high
-	movff		EEDATA,char_I_GF_High_percentage
+    rcall   restart_load_gf
 	return							    ; start in Surfacemode
 restart_5_test_pSCR_mode:
 	movlw	d'6'					    ; pSCR-GF
@@ -378,11 +372,27 @@
 	movlw	d'1'
 	movff	WREG,char_I_deco_model	    ; Set Flagbyte for GF method
 	; Load GF values into RAM
+    rcall   restart_load_gf
+	return							    ; start in Surfacemode
+
+restart_load_gf:
+    btfss   use_aGF
+    bra     restart_load_gf2            ; Use aGf
+    ; Use normal GF
+	; Load GF values into RAM
 	GETCUSTOM8	d'32'                   ; GF low
-	movff		EEDATA,char_I_GF_Low_percentage
+	movff	EEDATA,char_I_GF_Low_percentage
 	GETCUSTOM8	d'33'                   ; GF high
-	movff		EEDATA,char_I_GF_High_percentage
-	return							    ; start in Surfacemode
+	movff	EEDATA,char_I_GF_High_percentage
+	return                              ; Done.
+restart_load_gf2:                       ; Use aGf
+	; Load GF values into RAM
+	GETCUSTOM8	d'67'                   ; aGF low
+	movff	EEDATA,char_I_GF_Low_percentage
+	GETCUSTOM8	d'68'                   ; aGF high
+	movff	EEDATA,char_I_GF_High_percentage
+	return                              ; Done.
+
 
 ;=============================================================================