Use a variable to control use of Time Tool.

This ensures use of the Time Tool is fully under the control of the programmer, rather than potentially being affected by other things that may load it (like the Time Zone CDev). It also avoids calls to tiStatus in the default non-Time Tool code paths, and thereby allows them to work under Golden Gate.
This commit is contained in:
Stephen Heumann 2023-01-02 18:01:28 -06:00
parent c4d485e960
commit 69765a96ef
3 changed files with 20 additions and 20 deletions

4
cc.asm
View File

@ -187,6 +187,7 @@ TAB equ 9 TAB key code
stz ~QuickExitList
stz ~QuickExitList+2
case on
stz __useTimeTool do not use Time Tool
jsl ~InitIO reset standard I/O
case off
@ -363,6 +364,9 @@ start ds 2 start of the command line string
stz ~ExitList+2
stz ~QuickExitList
stz ~QuickExitList+2
case on
stz __useTimeTool do not use Time Tool
case off
lda #~RTL set up so exit(), etc. call ~RTL
sta ~C_Quit+1

View File

@ -394,13 +394,11 @@ ad1 tay
****************************************************************
*
~get_tz_offset private
pha make space for status return/TZ prefs
lda >__useTimeTool if not using time tool
beq no_tz assume we have no TZ offset
pha make space for TZ prefs
pha
_tiStatus check if time tool is active
bcs no_tz
lda 1,s
beq no_tz
pea 1 get one record element only (TZ offset)
tsc get time zone preference
@ -409,9 +407,14 @@ ad1 tay
pha
_tiGetTimePrefs
pla
bcs no_tz
bcc have_tz
pla
pla
lda #0 assume 0 offset if TZ info not available
no_tz tax
rts
pha determine if it's daylight savings
have_tz pha determine if it's daylight savings
ph2 #$5E
_ReadBParam
pla
@ -430,12 +433,6 @@ ad1 tay
ret pla return offset value
plx
rts
no_tz pla
pla
lda #0 assume 0 offset if no TZ info available
tax
rts
end
****************************************************************
@ -1318,14 +1315,11 @@ Y_skip inx
;%Z - time zone name or abbreviation, if available
;we print the numeric offset for both, or nothing if time zone is not available
fmt_z anop
fmt_Z pha check if time tool is active
_tiStatus
pla
bcs z_ret
beq z_ret
fmt_Z lda >__useTimeTool if not using Time Tool
beq z_ret write nothing
pea 0 push pointer to string buffer
tdc
; clc
clc
adc #numstr
pha
pha make space for TZ preferences record

View File

@ -35,6 +35,8 @@ sys_nerr entry # of error messages
_toolErr entry last error in a tool call (C)
~TOOLERROR entry last error in a tool call (Pascal)
ds 2
__useTimeTool entry use Time Tool in <time.h> functions?
ds 2
end
****************************************************************