-
Notifications
You must be signed in to change notification settings - Fork 0
/
afp.timezone.s
103 lines (98 loc) · 2.79 KB
/
afp.timezone.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
; %help
; afp.timezone - Set workstation AFP timezone.
;
; usage: afp.timezone w/e <0-24>
;
; Adjusts workstation time zone west or east relative to AFP server.
;
; %hend
.pc02
.include "davex-mg.inc"
sptr = xczpage
;prbyte = $fdda
;cout = $fded
pfxbuf = filebuff2
DX_start dx_mg_auto_origin ; load address
DX_info $01,$12,dx_cc_iie_or_iigs,$00
DX_ptab
DX_parm $00,t_string ; +/-
DX_parm $00,t_int1 ; hours
DX_end_ptab
DX_desc "Set AFP time zone."
DX_main
cli ; appletalk requires interrupts
;bra :+ ; DELETEME
ATcall inforeq
bcc :+
jmp noatalk
: lda #$01 ; second parm
jsr xgetparm_n ; davex ensures this is here
cpy #24
bcs badparms
sty timeflag
lda #$00
jsr xgetparm_n ; zero length if not specified
sta sptr+1
sty sptr
ldy #$00
lda (sptr),y
beq badparms
; next two commented out, user might say west or east instead of w or e
;cmp #$01
;bne badparms
iny
lda (sptr),y
and #$5f ; upper case and strip high bit
cmp #'W'
beq dowest
cmp #'E'
beq doit
jsr cout
; fall through if not +
badparms: lda #$01
jsr xredirect
jsr xmess
asc_hi "Bad parameter(s)!"
.byte $00
bra exiterr
;
dowest: lda #$80
ora timeflag
sta timeflag
doit:
;lda timeflag
;jsr prbyte
;lda #$8d
;jsr cout
ATcall tzreq
bcs tzerr
rts ; buhbye
;
tzerr: lda #$01
jsr xredirect
jsr xmess
asc_hi "Set time zone failed!"
.byte $00
bra exiterr
noatalk: lda #$01
jsr xredirect
jsr xmess
asc_hi "AppleTalk offline!"
.byte $00
exiterr: lda #$ff
jsr xredirect
jmp xerr
;
inforeq: .byte 0,2 ; sync GetInfo
.word $0000 ; result code
.dword $00000000 ; completion address
thisnet: .word $0000 ; this network #
abridge: .byte $00 ; local bridge
hwid: .byte $00 ; hardware ID, IIgs only
romver: .word $00 ; ROM version, IIgs only
nodenum: .byte $00 ; node number
;
tzreq: .byte 0,$30 ; sync FITimeZone
.word $0000 ; result
timeflag: .byte $00 ; time flag (b6-0=hours,b7=1 subtract)
DX_end