diff code_part1/OSTC_code_asm_part1/start.asm @ 667:8a8124f6b389

aGF handling during deco init
author heinrichsweikamp
date Sun, 02 Dec 2012 22:25:31 +0100
parents ea2bc3b9224e
children 8f8d39117ff7
line wrap: on
line diff
--- 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.
+
 
 ;=============================================================================