# HG changeset patch # User JeanDo # Date 1323459819 -3600 # Node ID 33abbc08f01e92c3001732f72737b8b258c974a8 # Parent acf4776eec089fe49b1ca0e06b257327b0914005 Minor cleanups for TESTING=1 emulator mode. diff -r acf4776eec08 -r 33abbc08f01e code_part1/OSTC_code_asm_part1/start.asm --- a/code_part1/OSTC_code_asm_part1/start.asm Fri Dec 09 20:43:35 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/start.asm Fri Dec 09 20:43:39 2011 +0100 @@ -24,7 +24,7 @@ start: movlb b'00000001' ; ram bank 1 selected - movff STKPTR,temp10 + movff STKPTR,temp10 ; Save stack pointer, for crash reports. clrf temp10+1 call init btfsc divemode ; Reset from Divemode? @@ -59,12 +59,20 @@ call pressuretest_sleep_fast ; Gets pressure without averaging (faster!) bcf sleepmode ; Normal mode again - Ifdef TESTING - movlw LOW(.1000) - movwf amb_pressure+0 - movlw HIGH(.1000) - movwf amb_pressure+1 - Else +; Extra power-up reset (JeanDo emulator) + Ifdef TESTING + call reset_gases + call reset_all_cf + call reset_external_eeprom + + movlw LOW(.1000) + movwf amb_pressure+0 + movlw HIGH(.1000) + movwf amb_pressure+1 + Endif + +; Get real pressure (if not in emulator mode) + Ifndef TESTING SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure ; copy for compatibility Endif @@ -92,12 +100,6 @@ movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine movff int_I_pres_respiration+1,int_I_pres_surface+1 -; Extra power-up reset (JeanDo) - ifdef TESTING - call reset_gases - call reset_all_cf - endif - call deco_clear_tissue movlb b'00000001' ; select ram bank 1 diff -r acf4776eec08 -r 33abbc08f01e code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Fri Dec 09 20:43:35 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Fri Dec 09 20:43:39 2011 +0100 @@ -267,6 +267,7 @@ call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode movlb b'00000001' ; select ram bank 1 + ostc_debug 'J' ; Sends debug-information to screen if debugmode active return diff -r acf4776eec08 -r 33abbc08f01e code_part1/OSTC_code_asm_part1/wait.asm --- a/code_part1/OSTC_code_asm_part1/wait.asm Fri Dec 09 20:43:35 2011 +0100 +++ b/code_part1/OSTC_code_asm_part1/wait.asm Fri Dec 09 20:43:39 2011 +0100 @@ -90,6 +90,9 @@ WAITMSX movwf waitms_temp ; Holds number of ms to wait + Ifdef TESTING + return ; In emulation, just skips waits + Endif WAITMSX1: movf TMR1L,W addlw d'66' ; 66*15,26µs ~ 1ms