diff code_part1/OSTC_code_asm_part1/simulator.asm @ 124:4f9f477bb452

Rewrite display of decoplan: * Common stuff - fix clearing bottom of list, for fleecker-free updates. - fix "Wait..." topline_box while computing deco in planning - fix 'No Deco" std color and mark last page. - Allow stops up to 240' * ZHL-16c model: - 6 lines max (sim or dive) - Print exceed stops as "add: ddd'" * GF model - 6 lines in divemode, 8 in planning. - any suitable number of pages. - "more..." when not the last page displayed. - fix displaying special depth for last stop (CF#29). - fix 0-time stops: just skip display. - fix end of list when reached the deepest stop. - fix no need to buffer decoplan twice.
author JeanDo
date Sat, 01 Jan 2011 01:57:50 +0100
parents 6a94f96e9cea
children 3fd7d304a0fe
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/simulator.asm	Thu Dec 30 23:45:20 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/simulator.asm	Sat Jan 01 01:57:50 2011 +0100
@@ -154,37 +154,29 @@
 	goto	diveloop						; Start Divemode
 
 simulator_show_decoplan:
-	call	PLED_ClearScreen
-	call	PLED_simdata_screen
-	call	divemode_copy_decolist				;copy gf_decolist (0x250:.32) to gf_decolist_copy (0x0E0:.32)
-	call	divemenu_see_decoplan
-
-	WIN_LEFT .0
-	WIN_TOP .160
-	call    PLED_standard_color
-
-	STRCPY  "TTS: "
-	movff   char_O_ascenttime,lo
- 	bcf		leftbind
-	output_8
-	STRCAT_PRINT    "' "
+        call	PLED_ClearScreen
+        call	PLED_simdata_screen
+        call	divemenu_see_decoplan
+        
+        ; Display TTS, if any...
+        movff   char_O_ascenttime,WREG
+        iorwf   WREG
+        bz      simulator_decoplan_notts
 
-;call	enable_rs232
-;	lfsr	FSR0,0x250
-;	movlw	0x20
-;	movwf	wait_temp
-;xy:						; Clear Deco list
-;	movff	POSTINC0,TXREG
-;	call	rs232_wait_tx
-;	decfsz	wait_temp,F
-;	bra		xy
-;	movff	char_O_array_decodepth+0,TXREG
-;
-		
-	
-	WIN_INVERT	.1	; Init new Wordprocessor	
-	DISPLAYTEXT	.188		; Sim. Results:
-	WIN_INVERT	.0	; Init new Wordprocessor	
+        WIN_LEFT .0
+        WIN_TOP .160
+        call    PLED_standard_color
+        
+        STRCPY  "TTS: "
+        movff   char_O_ascenttime,lo
+        bcf		leftbind
+        output_8
+        STRCAT_PRINT    "'"		
+simulator_decoplan_notts:
+
+        WIN_INVERT	.1	                ; Init new Wordprocessor	
+        DISPLAYTEXT	.188		        ; Sim. Results:
+        WIN_INVERT	.0                  ; Init new Wordprocessor	
 	
 simulator_show_decoplan1:
 	bcf		switch_left
@@ -224,11 +216,11 @@
 	bra		simulator_show_decoplan4	; Quit
 
 simulator_show_decoplan5_1:
-	incf	temp8,F
+	incf	decoplan_page,F
 	btfsc	last_ceiling_gf_shown		; last ceiling shown?
 	bra		simulator_show_decoplan5_0	; All done, clear and return
 
-	call	PLED_decoplan_gf_page_current	; Re-Draw Current page of GF Decoplan
+	call	PLED_decoplan_gf        	; Re-Draw Current page of GF Decoplan
 	bra		simulator_show_decoplan1	
 
 simulator_show_decoplan4:
@@ -269,6 +261,7 @@
 
 	call	simulator_save_tissue_data		; Stores 32 floats "pre_tissue" into bank3
 
+	call	PLED_topline_box
 	WIN_INVERT	.1
 	DISPLAYTEXT	.12							;" Wait.."
 	WIN_INVERT	.0
@@ -280,8 +273,8 @@
 	call	deco_calc_hauptroutine		    ; calc_tissue
 	movlb	b'00000001'						; rambank 1 selected
 
-	movff	char_O_deco_status,deco_status		; 
-	tstfsz	deco_status							; deco_status=0 if decompression calculation done
+	movff	char_O_deco_status,WREG
+	tstfsz	WREG                        ; deco_status=0 if decompression calculation done
 	bra		simulator_calc_deco_loop1			; Not finished
 
 	movlw	d'1'
@@ -342,8 +335,8 @@
 	call	deco_calc_hauptroutine		; calc_tissue
 	movlb	b'00000001'						; rambank 1 selected
 
-	movff	char_O_deco_status,deco_status		; 
-	tstfsz	deco_status							; deco_status=0 if decompression calculation done
+	movff	char_O_deco_status,WREG
+	tstfsz	WREG                        ; deco_status=0 if decompression calculation done
 	bra		simulator_calc_deco2				; Not finished
 	bra		simulator_calc_deco3				; finished!